Skip to content

Commit

Permalink
chore(deps): drop fs-extras and mkdirp dependencies (#3230)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante authored Aug 23, 2024
1 parent 3b8d1df commit 248d382
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 37 deletions.
51 changes: 24 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,10 @@
"decamelize": "6.0.0",
"es6-error": "4.1.1",
"firefox-profile": "4.6.0",
"fs-extra": "11.2.0",
"fx-runner": "1.4.0",
"https-proxy-agent": "^7.0.0",
"jose": "5.6.3",
"jszip": "3.10.1",
"mkdirp": "3.0.1",
"multimatch": "6.0.0",
"node-fetch": "3.3.2",
"node-notifier": "10.0.1",
Expand Down Expand Up @@ -109,6 +107,7 @@
"eslint": "8.57.0",
"eslint-plugin-async-await": "0.0.0",
"eslint-plugin-import": "2.29.1",
"fs-extra": "11.2.0",
"git-rev-sync": "3.0.2",
"html-entities": "2.5.2",
"mocha": "10.7.0",
Expand Down
10 changes: 5 additions & 5 deletions src/extension-runners/chromium.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
* in a Chromium-based browser instance.
*/

import fs from 'fs/promises';
import path from 'path';

import fs from 'fs-extra';
import { mkdirp as asyncMkdirp } from 'mkdirp';
import {
Launcher as ChromeLauncher,
launch as defaultChromiumLaunch,
Expand Down Expand Up @@ -179,12 +178,13 @@ export class ChromiumExtensionRunner {

if (userDataDir && profileDirName) {
// copy profile dir to this temp user data dir.
await fs.copy(
await fs.cp(
path.join(userDataDir, profileDirName),
path.join(tmpDirPath, profileDirName),
{ recursive: true },
);
} else if (userDataDir) {
await fs.copy(userDataDir, tmpDirPath);
await fs.cp(userDataDir, tmpDirPath, { recursive: true });
}
userDataDir = tmpDirPath;
}
Expand Down Expand Up @@ -273,7 +273,7 @@ export class ChromiumExtensionRunner {

log.debug(`Creating reload-manager-extension in ${extPath}`);

await asyncMkdirp(extPath);
await fs.mkdir(extPath, { recursive: true });

await fs.writeFile(
path.join(extPath, 'manifest.json'),
Expand Down
4 changes: 1 addition & 3 deletions src/util/artifacts.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import fs from 'fs/promises';

import { mkdirp as defaultAsyncMkdirp } from 'mkdirp';

import { UsageError, isErrorWithCode } from '../errors.js';
import { createLogger } from './logger.js';

Expand All @@ -12,7 +10,7 @@ const defaultAsyncFsAccess = fs.access.bind(fs);
export async function prepareArtifactsDir(
artifactsDir,
{
asyncMkdirp = defaultAsyncMkdirp,
asyncMkdirp = (dirPath) => fs.mkdir(dirPath, { recursive: true }),
asyncFsAccess = defaultAsyncFsAccess,
} = {},
) {
Expand Down

0 comments on commit 248d382

Please sign in to comment.