Skip to content

Commit b13af1d

Browse files
committed
replace mkdirp with mkdirSync with recursive: true
1 parent 010a6d9 commit b13af1d

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

commands/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
const VersionChecker = require('ember-cli-version-checker');
55

66
const fs = require('fs');
7-
const mkdirp = require('mkdirp');
87
const path = require('path');
98
const { styleText } = require('node:util');
109
const strip = require('../utils').strip;
1110
const getConfigPath = require('../utils').getConfigPath;
11+
const { mkdirSync } = require('node:fs');
1212

1313
const FEATURES = require('../features');
1414

@@ -48,7 +48,9 @@ const SHARED = {
4848
}
4949
}
5050

51-
mkdirp.sync(path.join(this.project.root, path.dirname(configPath)));
51+
mkdirSync(path.join(this.project.root, path.dirname(configPath)), {
52+
recursive: true,
53+
});
5254

5355
fs.writeFileSync(configPath, '{}', { encoding: 'UTF-8' });
5456

features/template-only-glimmer-components.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
const { styleText } = require('node:util');
55
const fs = require('fs');
66
const globSync = require('glob').globSync;
7-
const mkdirp = require('mkdirp');
7+
const { mkdirSync } = require('node:fs');
88
const p = require('util').promisify;
99
const path = require('path');
1010
const strip = require('../utils').strip;
@@ -208,7 +208,7 @@ module.exports = {
208208
let componentPath = components[i];
209209
console.log(` ${styleText('green', 'create')} ${componentPath}`);
210210
let absolutePath = path.join(project.root, componentPath);
211-
await mkdirp(path.dirname(absolutePath));
211+
await mkdirSync(path.dirname(absolutePath), { recursive: true });
212212
await p(fs.writeFile)(absolutePath, ComponentFile, {
213213
encoding: 'UTF-8',
214214
});

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
"ember-cli-version-checker": "^5.1.2",
2828
"glob": "^13.0.1",
2929
"inquirer": "^13.2.2",
30-
"mkdirp": "^1.0.4",
3130
"silent-error": "^1.1.1"
3231
},
3332
"devDependencies": {

pnpm-lock.yaml

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

tests/commands-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const CWD = process.cwd();
55
const fs = require('fs');
66
const createTempDir = require('broccoli-test-helper').createTempDir;
77
const execa = require('execa');
8-
const mkdirp = require('mkdirp');
8+
const { mkdirSync } = require('node:fs');
99
const p = require('path').join;
1010
const strip = require('../utils').strip;
1111
const { stripVTControlCharacters: stripAnsi } = require('node:util');
@@ -45,11 +45,11 @@ QUnit.module('commands', (hooks) => {
4545

4646
process.chdir(project.path());
4747

48-
mkdirp.sync(p(CWD, 'node_modules', '@ember'));
48+
mkdirSync(p(CWD, 'node_modules', '@ember'), { recursive: true });
4949
fs.symlinkSync(p(CWD, 'node_modules'), p(project.path(), 'node_modules'));
5050
fs.symlinkSync(CWD, p(CWD, 'node_modules', '@ember', 'optional-features'));
5151

52-
mkdirp.sync(p(CWD, 'node_modules', 'ember-source'));
52+
mkdirSync(p(CWD, 'node_modules', 'ember-source'), { recursive: true });
5353
fs.writeFileSync(
5454
p(CWD, 'node_modules', 'ember-source', 'package.json'),
5555
strip`

0 commit comments

Comments
 (0)