Skip to content

Commit 69f674d

Browse files
authored
perf: remove mkdirp dependency (#1549)
1 parent 5e208c5 commit 69f674d

File tree

5 files changed

+170
-192
lines changed

5 files changed

+170
-192
lines changed

package-lock.json

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

packages/common/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"dependencies": {
2222
"fast-glob": "^3.3.2",
2323
"minimatch": "^9.0.4",
24-
"mkdirp": "^3.0.1",
2524
"path-browserify": "^1.0.1"
2625
},
2726
"devDependencies": {

packages/common/scripts/buildDeno.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ commonFile.getFunctionOrThrow("isNodeJs").remove();
2323
commonFile.getImportDeclarationOrThrow("path").remove();
2424
commonFile.getImportDeclarationOrThrow("minimatch").remove();
2525
commonFile.getImportDeclarationOrThrow("fast-glob").remove();
26-
commonFile.getImportDeclarationOrThrow("mkdirp").remove();
2726
commonFile.getImportDeclarationOrThrow("os").remove();
2827
commonFile.getImportDeclarationOrThrow("fs").remove();
28+
commonFile.getImportDeclarationOrThrow("fs/promises").remove();
2929
commonFile.getVariableDeclarationOrThrow("path$1").remove();
3030

3131
const runtimeFileDestinationPath = `${folderPath}/DenoRuntime.ts`;

packages/common/src/data/libFiles.ts

Lines changed: 166 additions & 166 deletions
Large diffs are not rendered by default.

packages/common/src/runtimes/NodeRuntime.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fastGlob from "fast-glob";
22
import * as fs from "fs";
3+
import * as fsp from "fs/promises";
34
import * as minimatch from "minimatch";
4-
import * as mkdirp from "mkdirp";
55
import * as os from "os";
66
import * as path from "path";
77
import { Runtime, RuntimeFileInfo, RuntimeFileSystem, RuntimePath } from "./Runtime";
@@ -97,11 +97,11 @@ class NodeRuntimeFileSystem implements RuntimeFileSystem {
9797
}
9898

9999
async mkdir(dirPath: string) {
100-
await mkdirp.mkdirp(dirPath);
100+
await fsp.mkdir(dirPath, { recursive: true });
101101
}
102102

103103
mkdirSync(dirPath: string) {
104-
mkdirp.sync(dirPath);
104+
fs.mkdirSync(dirPath, { recursive: true });
105105
}
106106

107107
move(srcPath: string, destPath: string) {

0 commit comments

Comments
 (0)