fix(core): Replace smartchok/smartfile with smartwatch/smartfs, update watcher and plugins, and bump dependencies
This commit is contained in:
@@ -5,6 +5,19 @@ import * as interfaces from './interfaces/index.js';
|
||||
import { Watcher } from './tswatch.classes.watcher.js';
|
||||
import { logger } from './tswatch.logging.js';
|
||||
|
||||
// Create smartfs instance for directory operations
|
||||
const smartfs = new plugins.smartfs.SmartFs(new plugins.smartfs.SmartFsProviderNode());
|
||||
|
||||
/**
|
||||
* Lists all folders in a directory
|
||||
*/
|
||||
const listFolders = async (dirPath: string): Promise<string[]> => {
|
||||
const entries = await smartfs.directory(dirPath).list();
|
||||
return entries
|
||||
.filter((entry) => entry.isDirectory)
|
||||
.map((entry) => entry.name);
|
||||
};
|
||||
|
||||
export class TsWatch {
|
||||
public watchmode: interfaces.TWatchModes;
|
||||
public watcherMap = new plugins.lik.ObjectMap<Watcher>();
|
||||
@@ -79,7 +92,7 @@ export class TsWatch {
|
||||
);
|
||||
|
||||
// lets get the other ts folders
|
||||
let tsfolders = await plugins.smartfile.fs.listFolders(paths.cwd);
|
||||
let tsfolders = await listFolders(paths.cwd);
|
||||
tsfolders = tsfolders.filter(
|
||||
(itemArg) => itemArg.startsWith('ts') && itemArg !== 'ts_web',
|
||||
);
|
||||
@@ -125,7 +138,7 @@ export class TsWatch {
|
||||
bundler: 'esbuild',
|
||||
});
|
||||
};
|
||||
let tsfolders = await plugins.smartfile.fs.listFolders(paths.cwd);
|
||||
let tsfolders = await listFolders(paths.cwd);
|
||||
tsfolders = tsfolders.filter(
|
||||
(itemArg) => itemArg.startsWith('ts') && itemArg !== 'ts_web',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user