fix(storage): migrate filesystem operations to smartfs and tighten TypeScript initialization checks

This commit is contained in:
2026-04-30 10:12:32 +00:00
parent 1c4ba7a7d0
commit 6084ffb0ce
9 changed files with 2827 additions and 3656 deletions
+5 -7
View File
@@ -6,8 +6,8 @@ import * as paths from './paths.js';
*/
export class Smartconfig {
cwd: string;
lookupPath: string;
smartconfigJsonExists: boolean;
lookupPath!: string;
smartconfigJsonExists = false;
smartconfigJsonData: any;
/**
@@ -48,9 +48,7 @@ export class Smartconfig {
* checks if the JSON exists
*/
private checkSmartconfigJsonExists() {
this.smartconfigJsonExists = plugins.smartfile.fs.fileExistsSync(
this.lookupPath,
);
this.smartconfigJsonExists = plugins.nodeFs.existsSync(this.lookupPath);
}
/**
@@ -69,8 +67,8 @@ export class Smartconfig {
*/
private checkSmartconfigJsonData() {
if (this.smartconfigJsonExists) {
this.smartconfigJsonData = plugins.smartfile.fs.toObjectSync(
this.lookupPath,
this.smartconfigJsonData = plugins.smartjson.parse(
plugins.nodeFs.readFileSync(this.lookupPath, 'utf8'),
);
} else {
this.smartconfigJsonData = {};