Skip to content

Commit ea01b72

Browse files
authored
Merge pull request #274 from Windvis/backport-release/no-warp-drive-flag-issue
Fix an issue with the `--no-warp-drive` option
2 parents 0ec90cf + 0954aa3 commit ea01b72

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

index.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,13 @@ module.exports = {
6565
let name = stringUtil.dasherize(rawName);
6666
let namespace = stringUtil.classify(rawName);
6767

68+
const warpDrive = options.warpDrive ?? options.emberData;
69+
6870
let hasOptions =
69-
!options.welcome || options.packageManager || options.ciProvider;
71+
!options.welcome ||
72+
options.packageManager ||
73+
options.ciProvider ||
74+
!warpDrive;
7075
let blueprintOptions = '';
7176
if (hasOptions) {
7277
let indent = `\n `;
@@ -80,8 +85,7 @@ module.exports = {
8085
options.packageManager === 'pnpm' && '"--pnpm"',
8186
options.ciProvider && `"--ci-provider=${options.ciProvider}"`,
8287
options.typescript && `"--typescript"`,
83-
!options.emberData && `"--no-ember-data"`,
84-
!options.warpDrive && `"--no-warp-drive"`,
88+
warpDrive === false && `"--no-warp-drive"`,
8589
]
8690
.filter(Boolean)
8791
.join(',\n ') +
@@ -117,7 +121,7 @@ module.exports = {
117121
blueprint: 'app',
118122
blueprintOptions,
119123
lang: options.lang,
120-
warpDrive: options.warpDrive ?? options.emberData,
124+
warpDrive,
121125
ciProvider: options.ciProvider,
122126
typescript: options.typescript,
123127
packageManager: options.packageManager ?? 'npm',

tests/arguments.test.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,25 @@ describe('Blueprint Arguments', function () {
126126

127127
expect(parse(files['package.json']).devDependencies['@warp-drive/core'])
128128
.to.not.be.undefined;
129+
130+
expect(
131+
parse(files.config['ember-cli-update.json'])
132+
.packages.at(0)
133+
.blueprints.at(0).options,
134+
).to.not.include('--no-warp-drive');
129135
});
130136

131137
it('does not add warp-drive if you pass --no-warp-drive', async function () {
132138
const { files } = await generateApp({ flags: ['--no-warp-drive'] });
133139

134140
expect(parse(files['package.json']).devDependencies['@warp-drive/core'])
135141
.to.be.undefined;
142+
143+
expect(
144+
parse(files.config['ember-cli-update.json'])
145+
.packages.at(0)
146+
.blueprints.at(0).options,
147+
).to.include('--no-warp-drive');
136148
});
137149
});
138150

0 commit comments

Comments
 (0)