feat(tapbundle_serverside): add network port discovery utilities and migrate file I/O to smartfs; refactor runtimes to use Node fs and SmartFs, update server APIs and bump dependencies
This commit is contained in:
@@ -36,9 +36,9 @@ export class DenoRuntimeAdapter extends RuntimeAdapter {
|
||||
const denoJsonPath = plugins.path.join(process.cwd(), 'deno.json');
|
||||
const denoJsoncPath = plugins.path.join(process.cwd(), 'deno.jsonc');
|
||||
|
||||
if (plugins.smartfile.fs.fileExistsSync(denoJsonPath)) {
|
||||
if (plugins.fs.existsSync(denoJsonPath)) {
|
||||
configPath = denoJsonPath;
|
||||
} else if (plugins.smartfile.fs.fileExistsSync(denoJsoncPath)) {
|
||||
} else if (plugins.fs.existsSync(denoJsoncPath)) {
|
||||
configPath = denoJsoncPath;
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ export class DenoRuntimeAdapter extends RuntimeAdapter {
|
||||
// Check for 00init.ts file in test directory
|
||||
const testDir = plugins.path.dirname(testFile);
|
||||
const initFile = plugins.path.join(testDir, '00init.ts');
|
||||
const initFileExists = await plugins.smartfile.fs.fileExists(initFile);
|
||||
const initFileExists = await plugins.smartfsInstance.file(initFile).exists();
|
||||
|
||||
let runCommand = fullCommand;
|
||||
let loaderPath: string | null = null;
|
||||
@@ -187,7 +187,7 @@ import '${absoluteInitFile.replace(/\\/g, '/')}';
|
||||
import '${absoluteTestFile.replace(/\\/g, '/')}';
|
||||
`;
|
||||
loaderPath = plugins.path.join(testDir, `.loader_${plugins.path.basename(testFile)}`);
|
||||
await plugins.smartfile.memory.toFs(loaderContent, loaderPath);
|
||||
await plugins.smartfsInstance.file(loaderPath).write(loaderContent);
|
||||
|
||||
// Rebuild command with loader file
|
||||
const loaderCommand = this.createCommand(loaderPath, mergedOptions);
|
||||
@@ -200,8 +200,8 @@ import '${absoluteTestFile.replace(/\\/g, '/')}';
|
||||
if (loaderPath) {
|
||||
const cleanup = () => {
|
||||
try {
|
||||
if (plugins.smartfile.fs.fileExistsSync(loaderPath)) {
|
||||
plugins.smartfile.fs.removeSync(loaderPath);
|
||||
if (plugins.fs.existsSync(loaderPath)) {
|
||||
plugins.fs.rmSync(loaderPath, { force: true });
|
||||
}
|
||||
} catch (e) {
|
||||
// Ignore cleanup errors
|
||||
|
||||
Reference in New Issue
Block a user