Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 7 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.1.4",
"@types/express": "^5.0.3",
"@types/fs-extra": "^11.0.4",
"@types/mime-types": "^3.0.1",
"@types/prompts": "^2.4.9",
"@typescript-eslint/eslint-plugin": "^8.34.0",
Expand Down
1 change: 0 additions & 1 deletion packages/jitar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"dependencies": {
"dotenv": "^17.0.1",
"express": "^5.1.0",
"fs-extra": "^11.3.0",
"glob": "11.0.3",
"mime-types": "^3.0.1"
},
Expand Down
1 change: 0 additions & 1 deletion packages/jitar/rollup.definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
export const SERVER_EXTERNALS =
[
'express',
'fs-extra',
'glob',
'mime-types',
'dotenv',
Expand Down
1 change: 0 additions & 1 deletion packages/sourcing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"clean": "rm -rf dist"
},
"dependencies": {
"fs-extra": "^11.3.0",
"glob": "11.0.3",
"mime-types": "^3.0.1"
}
Expand Down
24 changes: 17 additions & 7 deletions packages/sourcing/src/files/LocalFileSystem.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import fs from 'fs-extra';
import fsp from 'node:fs/promises';
import fs from 'node:fs';
import { glob } from 'glob';
import mime from 'mime-types';
import path from 'path';
Expand All @@ -10,17 +11,26 @@ export default class LocalFileSystem implements FileSystem
{
copy(source: string, destination: string): Promise<void>
{
return fs.copy(source, destination, { overwrite: true });
return fsp.cp(source, destination, { recursive: true, force: true });
}

delete(location: string): Promise<void>
{
return fs.remove(location);
return fsp.rm(location, { recursive: true, force: true });
}

exists(location: string): Promise<boolean>
async exists(location: string): Promise<boolean>
{
return fs.exists(location);
try
{
await fsp.stat(location);

return true;
}
catch
{
return false;
}
}

isAbsolute(location: string): boolean
Expand Down Expand Up @@ -64,7 +74,7 @@ export default class LocalFileSystem implements FileSystem

read(location: string): Promise<Buffer>
{
return fs.readFile(location);
return fsp.readFile(location);
}

resolve(location: string): string
Expand Down Expand Up @@ -100,6 +110,6 @@ export default class LocalFileSystem implements FileSystem

fs.mkdirSync(directory, { recursive: true });

return fs.writeFile(location, content);
return fsp.writeFile(location, content);
}
}