Skip to content

Commit 5300722

Browse files
authored
chore(deps): fs-extra removal (#669)
1 parent 7582412 commit 5300722

6 files changed

Lines changed: 24 additions & 38 deletions

File tree

package-lock.json

Lines changed: 7 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"@rollup/plugin-terser": "^0.4.4",
3030
"@rollup/plugin-typescript": "^12.1.4",
3131
"@types/express": "^5.0.3",
32-
"@types/fs-extra": "^11.0.4",
3332
"@types/mime-types": "^3.0.1",
3433
"@types/prompts": "^2.4.9",
3534
"@typescript-eslint/eslint-plugin": "^8.34.0",

packages/jitar/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
"dependencies": {
3232
"dotenv": "^17.0.1",
3333
"express": "^5.1.0",
34-
"fs-extra": "^11.3.0",
3534
"glob": "11.0.3",
3635
"mime-types": "^3.0.1"
3736
},

packages/jitar/rollup.definitions.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
export const SERVER_EXTERNALS =
33
[
44
'express',
5-
'fs-extra',
65
'glob',
76
'mime-types',
87
'dotenv',

packages/sourcing/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"clean": "rm -rf dist"
1717
},
1818
"dependencies": {
19-
"fs-extra": "^11.3.0",
2019
"glob": "11.0.3",
2120
"mime-types": "^3.0.1"
2221
}

packages/sourcing/src/files/LocalFileSystem.ts

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

2-
import fs from 'fs-extra';
2+
import fsp from 'node:fs/promises';
3+
import fs from 'node:fs';
34
import { glob } from 'glob';
45
import mime from 'mime-types';
56
import path from 'path';
@@ -10,17 +11,26 @@ export default class LocalFileSystem implements FileSystem
1011
{
1112
copy(source: string, destination: string): Promise<void>
1213
{
13-
return fs.copy(source, destination, { overwrite: true });
14+
return fsp.cp(source, destination, { recursive: true, force: true });
1415
}
1516

1617
delete(location: string): Promise<void>
1718
{
18-
return fs.remove(location);
19+
return fsp.rm(location, { recursive: true, force: true });
1920
}
2021

21-
exists(location: string): Promise<boolean>
22+
async exists(location: string): Promise<boolean>
2223
{
23-
return fs.exists(location);
24+
try
25+
{
26+
await fsp.stat(location);
27+
28+
return true;
29+
}
30+
catch
31+
{
32+
return false;
33+
}
2434
}
2535

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

6575
read(location: string): Promise<Buffer>
6676
{
67-
return fs.readFile(location);
77+
return fsp.readFile(location);
6878
}
6979

7080
resolve(location: string): string
@@ -100,6 +110,6 @@ export default class LocalFileSystem implements FileSystem
100110

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

103-
return fs.writeFile(location, content);
113+
return fsp.writeFile(location, content);
104114
}
105115
}

0 commit comments

Comments
 (0)