Skip to content

Commit 3427b0b

Browse files
author
Kelly Selden
committed
--no-welcome is not supported for ember-addon
1 parent b9f9f64 commit 3427b0b

4 files changed

Lines changed: 59 additions & 83 deletions

File tree

src/get-project-options.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,13 @@ module.exports = async function getProjectOptions({
5656
options.push('yarn');
5757
}
5858

59-
let hasWelcome = checkForDep('ember-welcome-page');
59+
// addons don't support the welcome option
60+
if (projectType === 'app') {
61+
let hasWelcome = checkForDep('ember-welcome-page');
6062

61-
if (hasWelcome) {
62-
options.push('welcome');
63+
if (hasWelcome) {
64+
options.push('welcome');
65+
}
6366
}
6467

6568
return options;

src/load-safe-default-blueprint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function loadSafeDefaultBlueprint(projectOptions, version) {
1010
if (projectOptions.includes('yarn')) {
1111
options.push('--yarn');
1212
}
13-
if (!projectOptions.includes('welcome')) {
13+
if (!projectOptions.includes('welcome') && !projectOptions.includes('addon')) {
1414
options.push('--no-welcome');
1515
}
1616

test/integration/load-safe-default-blueprint-test.js

Lines changed: 50 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -22,61 +22,66 @@ describe(_loadSafeDefaultBlueprint, function() {
2222
projectOptions.push('app');
2323
});
2424

25-
it('npm, welcome', async function() {
26-
projectOptions.push('welcome');
27-
28-
let blueprint = loadSafeDefaultBlueprint();
29-
30-
expect(blueprint).to.deep.equal({
31-
name: 'ember-cli',
32-
type: 'app',
33-
version,
34-
options: []
25+
describe('welcome', function() {
26+
beforeEach(function() {
27+
projectOptions.push('welcome');
3528
});
36-
});
3729

38-
it('npm, no welcome', async function() {
39-
let blueprint = loadSafeDefaultBlueprint();
30+
it('npm', async function() {
31+
let blueprint = loadSafeDefaultBlueprint();
4032

41-
expect(blueprint).to.deep.equal({
42-
name: 'ember-cli',
43-
type: 'app',
44-
version,
45-
options: [
46-
'--no-welcome'
47-
]
33+
expect(blueprint).to.deep.equal({
34+
name: 'ember-cli',
35+
type: 'app',
36+
version,
37+
options: []
38+
});
4839
});
49-
});
5040

51-
it('yarn, welcome', async function() {
52-
projectOptions.push('yarn');
53-
projectOptions.push('welcome');
41+
it('yarn', async function() {
42+
projectOptions.push('yarn');
5443

55-
let blueprint = loadSafeDefaultBlueprint();
44+
let blueprint = loadSafeDefaultBlueprint();
5645

57-
expect(blueprint).to.deep.equal({
58-
name: 'ember-cli',
59-
type: 'app',
60-
version,
61-
options: [
62-
'--yarn'
63-
]
46+
expect(blueprint).to.deep.equal({
47+
name: 'ember-cli',
48+
type: 'app',
49+
version,
50+
options: [
51+
'--yarn'
52+
]
53+
});
6454
});
6555
});
6656

67-
it('yarn, no welcome', async function() {
68-
projectOptions.push('yarn');
57+
describe('no welcome', function() {
58+
it('npm', async function() {
59+
let blueprint = loadSafeDefaultBlueprint();
60+
61+
expect(blueprint).to.deep.equal({
62+
name: 'ember-cli',
63+
type: 'app',
64+
version,
65+
options: [
66+
'--no-welcome'
67+
]
68+
});
69+
});
6970

70-
let blueprint = loadSafeDefaultBlueprint();
71+
it('yarn', async function() {
72+
projectOptions.push('yarn');
7173

72-
expect(blueprint).to.deep.equal({
73-
name: 'ember-cli',
74-
type: 'app',
75-
version,
76-
options: [
77-
'--yarn',
78-
'--no-welcome'
79-
]
74+
let blueprint = loadSafeDefaultBlueprint();
75+
76+
expect(blueprint).to.deep.equal({
77+
name: 'ember-cli',
78+
type: 'app',
79+
version,
80+
options: [
81+
'--yarn',
82+
'--no-welcome'
83+
]
84+
});
8085
});
8186
});
8287
});
@@ -86,9 +91,7 @@ describe(_loadSafeDefaultBlueprint, function() {
8691
projectOptions.push('addon');
8792
});
8893

89-
it('npm, welcome', async function() {
90-
projectOptions.push('welcome');
91-
94+
it('npm', async function() {
9295
let blueprint = loadSafeDefaultBlueprint();
9396

9497
expect(blueprint).to.deep.equal({
@@ -99,22 +102,8 @@ describe(_loadSafeDefaultBlueprint, function() {
99102
});
100103
});
101104

102-
it('npm, no welcome', async function() {
103-
let blueprint = loadSafeDefaultBlueprint();
104-
105-
expect(blueprint).to.deep.equal({
106-
name: 'ember-cli',
107-
type: 'addon',
108-
version,
109-
options: [
110-
'--no-welcome'
111-
]
112-
});
113-
});
114-
115-
it('yarn, welcome', async function() {
105+
it('yarn', async function() {
116106
projectOptions.push('yarn');
117-
projectOptions.push('welcome');
118107

119108
let blueprint = loadSafeDefaultBlueprint();
120109

@@ -127,21 +116,5 @@ describe(_loadSafeDefaultBlueprint, function() {
127116
]
128117
});
129118
});
130-
131-
it('yarn, no welcome', async function() {
132-
projectOptions.push('yarn');
133-
134-
let blueprint = loadSafeDefaultBlueprint();
135-
136-
expect(blueprint).to.deep.equal({
137-
name: 'ember-cli',
138-
type: 'addon',
139-
version,
140-
options: [
141-
'--yarn',
142-
'--no-welcome'
143-
]
144-
});
145-
});
146119
});
147120
});

test/unit/get-project-options-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ describe(_getProjectOptions, function() {
128128
expect(await getProjectOptions()).to.deep.equal(['addon']);
129129
});
130130

131-
it('detects welcome option', async function() {
131+
it('doesn\'t detect welcome option', async function() {
132132
packageJson = {
133133
keywords: [
134134
'ember-addon'
@@ -139,7 +139,7 @@ describe(_getProjectOptions, function() {
139139
}
140140
};
141141

142-
expect(await getProjectOptions()).to.deep.equal(['addon', 'welcome']);
142+
expect(await getProjectOptions()).to.deep.equal(['addon']);
143143
});
144144

145145
it('detects yarn option', async function() {

0 commit comments

Comments
 (0)