Skip to content

Commit de2d489

Browse files
Copilothotlong
andcommitted
refactor: LocalStorageDriver extends MemoryDriver for cleaner architecture
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 977ac3e commit de2d489

4 files changed

Lines changed: 142 additions & 775 deletions

File tree

packages/drivers/fs/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,6 @@ export interface FileSystemDriverConfig extends MemoryDriverConfig {
8989
* - Content: Array of records `[{id: "1", ...}, {id: "2", ...}]`
9090
*/
9191
export class FileSystemDriver extends MemoryDriver {
92-
// Driver metadata (ObjectStack-compatible)
93-
public readonly name = 'FileSystemDriver';
94-
public readonly version = '4.0.0';
95-
9692
private dataDir: string;
9793
private prettyPrint: boolean;
9894
private enableBackup: boolean;
@@ -106,6 +102,10 @@ export class FileSystemDriver extends MemoryDriver {
106102
indexes: config.indexes
107103
});
108104

105+
// Override driver name and version
106+
(this as any).name = 'FileSystemDriver';
107+
(this as any).version = '4.0.0';
108+
109109
this.dataDir = path.resolve(config.dataDir);
110110
this.prettyPrint = config.prettyPrint !== false;
111111
this.enableBackup = config.enableBackup !== false;

packages/drivers/localstorage/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
},
2222
"dependencies": {
2323
"@objectql/types": "workspace:*",
24+
"@objectql/driver-memory": "workspace:*",
2425
"@objectstack/spec": "^0.7.1"
2526
},
2627
"devDependencies": {

0 commit comments

Comments
 (0)