mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Merge pull request #17935 from timvandermeij/mkdirp
Remove the `mkdirp` dependency in favor of the built-in Node.js `fs.mkdirSync`
This commit is contained in:
commit
14947ad0ad
3 changed files with 15 additions and 32 deletions
18
gulpfile.mjs
18
gulpfile.mjs
|
@ -26,7 +26,6 @@ import { fileURLToPath } from "url";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import gulp from "gulp";
|
import gulp from "gulp";
|
||||||
import merge from "merge-stream";
|
import merge from "merge-stream";
|
||||||
import { mkdirp } from "mkdirp";
|
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import postcss from "gulp-postcss";
|
import postcss from "gulp-postcss";
|
||||||
import postcssDarkThemeClass from "postcss-dark-theme-class";
|
import postcssDarkThemeClass from "postcss-dark-theme-class";
|
||||||
|
@ -670,7 +669,7 @@ function replaceInFile(filePath, find, replacement) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTempFile(prefix, suffix) {
|
function getTempFile(prefix, suffix) {
|
||||||
mkdirp.sync(BUILD_DIR + "tmp/");
|
fs.mkdirSync(BUILD_DIR + "tmp/", { recursive: true });
|
||||||
const bytes = crypto.randomBytes(6).toString("hex");
|
const bytes = crypto.randomBytes(6).toString("hex");
|
||||||
const filePath = BUILD_DIR + "tmp/" + prefix + bytes + suffix;
|
const filePath = BUILD_DIR + "tmp/" + prefix + bytes + suffix;
|
||||||
fs.writeFileSync(filePath, "");
|
fs.writeFileSync(filePath, "");
|
||||||
|
@ -926,7 +925,7 @@ gulp.task("locale", function () {
|
||||||
console.log("### Building localization files");
|
console.log("### Building localization files");
|
||||||
|
|
||||||
rimraf.sync(VIEWER_LOCALE_OUTPUT);
|
rimraf.sync(VIEWER_LOCALE_OUTPUT);
|
||||||
mkdirp.sync(VIEWER_LOCALE_OUTPUT);
|
fs.mkdirSync(VIEWER_LOCALE_OUTPUT, { recursive: true });
|
||||||
|
|
||||||
const subfolders = fs.readdirSync(L10N_DIR);
|
const subfolders = fs.readdirSync(L10N_DIR);
|
||||||
subfolders.sort();
|
subfolders.sort();
|
||||||
|
@ -942,7 +941,7 @@ gulp.task("locale", function () {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
mkdirp.sync(VIEWER_LOCALE_OUTPUT + "/" + locale);
|
fs.mkdirSync(VIEWER_LOCALE_OUTPUT + "/" + locale, { recursive: true });
|
||||||
|
|
||||||
locales.push(locale);
|
locales.push(locale);
|
||||||
|
|
||||||
|
@ -1511,15 +1510,16 @@ gulp.task("jsdoc", function (done) {
|
||||||
const JSDOC_FILES = ["src/display/api.js"];
|
const JSDOC_FILES = ["src/display/api.js"];
|
||||||
|
|
||||||
rimraf(JSDOC_BUILD_DIR, function () {
|
rimraf(JSDOC_BUILD_DIR, function () {
|
||||||
mkdirp(JSDOC_BUILD_DIR).then(function () {
|
fs.mkdirSync(JSDOC_BUILD_DIR, { recursive: true });
|
||||||
|
|
||||||
const command =
|
const command =
|
||||||
'"node_modules/.bin/jsdoc" -d ' +
|
'"node_modules/.bin/jsdoc" -d ' +
|
||||||
JSDOC_BUILD_DIR +
|
JSDOC_BUILD_DIR +
|
||||||
" " +
|
" " +
|
||||||
JSDOC_FILES.join(" ");
|
JSDOC_FILES.join(" ");
|
||||||
|
|
||||||
exec(command, done);
|
exec(command, done);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task("types", function (done) {
|
gulp.task("types", function (done) {
|
||||||
|
@ -1862,7 +1862,7 @@ function createBaseline(done) {
|
||||||
|
|
||||||
let initializeCommand = "git fetch origin";
|
let initializeCommand = "git fetch origin";
|
||||||
if (!checkDir(BASELINE_DIR)) {
|
if (!checkDir(BASELINE_DIR)) {
|
||||||
mkdirp.sync(BASELINE_DIR);
|
fs.mkdirSync(BASELINE_DIR, { recursive: true });
|
||||||
initializeCommand = "git clone ../../ .";
|
initializeCommand = "git clone ../../ .";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2198,7 +2198,7 @@ gulp.task(
|
||||||
console.log("### Cloning baseline distribution");
|
console.log("### Cloning baseline distribution");
|
||||||
|
|
||||||
rimraf.sync(DIST_DIR);
|
rimraf.sync(DIST_DIR);
|
||||||
mkdirp.sync(DIST_DIR);
|
fs.mkdirSync(DIST_DIR, { recursive: true });
|
||||||
safeSpawnSync("git", ["clone", "--depth", "1", DIST_REPO_URL, DIST_DIR]);
|
safeSpawnSync("git", ["clone", "--depth", "1", DIST_REPO_URL, DIST_DIR]);
|
||||||
|
|
||||||
console.log();
|
console.log();
|
||||||
|
@ -2346,7 +2346,7 @@ gulp.task(
|
||||||
|
|
||||||
// Copy the mozcentral build to the mozcentral baseline directory.
|
// Copy the mozcentral build to the mozcentral baseline directory.
|
||||||
rimraf.sync(MOZCENTRAL_BASELINE_DIR);
|
rimraf.sync(MOZCENTRAL_BASELINE_DIR);
|
||||||
mkdirp.sync(MOZCENTRAL_BASELINE_DIR);
|
fs.mkdirSync(MOZCENTRAL_BASELINE_DIR, { recursive: true });
|
||||||
|
|
||||||
gulp
|
gulp
|
||||||
.src([BASELINE_DIR + BUILD_DIR + "mozcentral/**/*"])
|
.src([BASELINE_DIR + BUILD_DIR + "mozcentral/**/*"])
|
||||||
|
|
16
package-lock.json
generated
16
package-lock.json
generated
|
@ -43,7 +43,6 @@
|
||||||
"jsdoc": "^4.0.2",
|
"jsdoc": "^4.0.2",
|
||||||
"jstransformer-markdown-it": "^3.0.0",
|
"jstransformer-markdown-it": "^3.0.0",
|
||||||
"merge-stream": "^2.0.0",
|
"merge-stream": "^2.0.0",
|
||||||
"mkdirp": "^3.0.1",
|
|
||||||
"needle": "^3.3.1",
|
"needle": "^3.3.1",
|
||||||
"path2d": "^0.2.0",
|
"path2d": "^0.2.0",
|
||||||
"pngjs": "^7.0.0",
|
"pngjs": "^7.0.0",
|
||||||
|
@ -11126,21 +11125,6 @@
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mkdirp": {
|
|
||||||
"version": "3.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz",
|
|
||||||
"integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==",
|
|
||||||
"dev": true,
|
|
||||||
"bin": {
|
|
||||||
"mkdirp": "dist/cjs/src/bin.js"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/isaacs"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/mkdirp-classic": {
|
"node_modules/mkdirp-classic": {
|
||||||
"version": "0.5.3",
|
"version": "0.5.3",
|
||||||
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
|
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
"jsdoc": "^4.0.2",
|
"jsdoc": "^4.0.2",
|
||||||
"jstransformer-markdown-it": "^3.0.0",
|
"jstransformer-markdown-it": "^3.0.0",
|
||||||
"merge-stream": "^2.0.0",
|
"merge-stream": "^2.0.0",
|
||||||
"mkdirp": "^3.0.1",
|
|
||||||
"needle": "^3.3.1",
|
"needle": "^3.3.1",
|
||||||
"path2d": "^0.2.0",
|
"path2d": "^0.2.0",
|
||||||
"pngjs": "^7.0.0",
|
"pngjs": "^7.0.0",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue