From 55344f8a9d0e533b06f9e3decae868e5909f9194 Mon Sep 17 00:00:00 2001 From: AaronDewes Date: Tue, 26 Jul 2022 17:23:19 +0000 Subject: [PATCH] Drop mkdirp --- package-lock.json | 3 ++- package.json | 1 - server/storage/fs.js | 5 +++-- test/frontend/runner.js | 5 +++-- test/wdio.common.conf.js | 6 ++++-- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1c63786c..c7f59d77 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,6 @@ "double-ended-queue": "^2.1.0-0", "express": "^4.17.3", "helmet": "^3.23.3", - "mkdirp": "^0.5.6", "mozlog": "^3.0.1", "node-fetch": "^2.6.7", "redis": "^3.1.1", @@ -13038,6 +13037,7 @@ "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, "dependencies": { "minimist": "^1.2.6" }, @@ -32682,6 +32682,7 @@ "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, "requires": { "minimist": "^1.2.6" } diff --git a/package.json b/package.json index b02c08c2..b6e9840b 100644 --- a/package.json +++ b/package.json @@ -146,7 +146,6 @@ "double-ended-queue": "^2.1.0-0", "express": "^4.17.3", "helmet": "^3.23.3", - "mkdirp": "^0.5.6", "mozlog": "^3.0.1", "node-fetch": "^2.6.7", "redis": "^3.1.1", diff --git a/server/storage/fs.js b/server/storage/fs.js index aa6da744..abffc7d2 100644 --- a/server/storage/fs.js +++ b/server/storage/fs.js @@ -1,7 +1,6 @@ const fs = require('fs'); const path = require('path'); const promisify = require('util').promisify; -const mkdirp = require('mkdirp'); const stat = promisify(fs.stat); @@ -9,7 +8,9 @@ class FSStorage { constructor(config, log) { this.log = log; this.dir = config.file_dir; - mkdirp.sync(this.dir); + fs.mkdirSync(this.dir, { + recursive: true + }); } async length(id) { diff --git a/test/frontend/runner.js b/test/frontend/runner.js index 998298ad..adc711c2 100644 --- a/test/frontend/runner.js +++ b/test/frontend/runner.js @@ -1,7 +1,6 @@ /* eslint-disable no-undef, no-process-exit */ const fs = require('fs'); const path = require('path'); -const mkdirp = require('mkdirp'); const puppeteer = require('puppeteer'); const webpack = require('webpack'); const config = require('../../webpack.config'); @@ -44,7 +43,9 @@ const server = app.listen(async function() { const coverage = await page.evaluate(() => __coverage__); if (coverage) { const dir = path.resolve(__dirname, '../../.nyc_output'); - mkdirp.sync(dir); + fs.mkdirSync(dir, { + recursive: true + }); fs.writeFileSync( path.resolve(dir, 'frontend.json'), JSON.stringify(coverage) diff --git a/test/wdio.common.conf.js b/test/wdio.common.conf.js index 4138bafa..195528b9 100644 --- a/test/wdio.common.conf.js +++ b/test/wdio.common.conf.js @@ -1,9 +1,11 @@ const path = require('path'); -const mkdirp = require('mkdirp'); +const fs = require('fs'); const rimraf = require('rimraf'); const dir = path.join(__dirname, 'integration', 'downloads'); -mkdirp.sync(dir); +fs.mkdirSync(dir, { + recursive: true +}); rimraf.sync(`${dir}${path.sep}*`); exports.config = {