Skip to content

Commit

Permalink
perf: remove mkdirp dependency (#1549)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann authored Aug 25, 2024
1 parent 5e208c5 commit 69f674d
Show file tree
Hide file tree
Showing 5 changed files with 170 additions and 192 deletions.
21 changes: 0 additions & 21 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 packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"dependencies": {
"fast-glob": "^3.3.2",
"minimatch": "^9.0.4",
"mkdirp": "^3.0.1",
"path-browserify": "^1.0.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/common/scripts/buildDeno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ commonFile.getFunctionOrThrow("isNodeJs").remove();
commonFile.getImportDeclarationOrThrow("path").remove();
commonFile.getImportDeclarationOrThrow("minimatch").remove();
commonFile.getImportDeclarationOrThrow("fast-glob").remove();
commonFile.getImportDeclarationOrThrow("mkdirp").remove();
commonFile.getImportDeclarationOrThrow("os").remove();
commonFile.getImportDeclarationOrThrow("fs").remove();
commonFile.getImportDeclarationOrThrow("fs/promises").remove();
commonFile.getVariableDeclarationOrThrow("path$1").remove();

const runtimeFileDestinationPath = `${folderPath}/DenoRuntime.ts`;
Expand Down
332 changes: 166 additions & 166 deletions packages/common/src/data/libFiles.ts

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions packages/common/src/runtimes/NodeRuntime.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fastGlob from "fast-glob";
import * as fs from "fs";
import * as fsp from "fs/promises";
import * as minimatch from "minimatch";
import * as mkdirp from "mkdirp";
import * as os from "os";
import * as path from "path";
import { Runtime, RuntimeFileInfo, RuntimeFileSystem, RuntimePath } from "./Runtime";
Expand Down Expand Up @@ -97,11 +97,11 @@ class NodeRuntimeFileSystem implements RuntimeFileSystem {
}

async mkdir(dirPath: string) {
await mkdirp.mkdirp(dirPath);
await fsp.mkdir(dirPath, { recursive: true });
}

mkdirSync(dirPath: string) {
mkdirp.sync(dirPath);
fs.mkdirSync(dirPath, { recursive: true });
}

move(srcPath: string, destPath: string) {
Expand Down

0 comments on commit 69f674d

Please sign in to comment.