Skip to content

Commit a245221

Browse files
author
Kelly Selden
committed
implement init option
1 parent 6b3c2a1 commit a245221

43 files changed

Lines changed: 603 additions & 2 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/init.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,19 @@ module.exports = async function init({
9292
blueprint
9393
});
9494

95+
let init = false;
96+
9597
if (!baseBlueprint) {
9698
// for non-existing default blueprints
9799
blueprint.isBaseBlueprint = true;
100+
init = true;
98101
}
99102

100103
let result = await (await boilerplateUpdate({
101104
endVersion: blueprint.version,
102105
resolveConflicts,
103106
reset,
107+
init,
104108
createCustomDiff: true,
105109
customDiffOptions: ({
106110
packageJson
@@ -122,7 +126,7 @@ module.exports = async function init({
122126
blueprint
123127
});
124128

125-
if (!reset) {
129+
if (!(reset || init)) {
126130
await stageBlueprintFile({
127131
cwd,
128132
emberCliUpdateJsonPath

test/acceptance/ember-cli-update-test.js

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ describe(function() {
360360
assertNoStaged(status);
361361
});
362362

363-
it('can init the default blueprint', async function() {
363+
it('can reset the default blueprint', async function() {
364364
this.timeout(5 * 60 * 1000);
365365

366366
let {
@@ -387,6 +387,32 @@ describe(function() {
387387
assertNoStaged(status);
388388
});
389389

390+
it('can init the default blueprint', async function() {
391+
this.timeout(5 * 60 * 1000);
392+
393+
let {
394+
status
395+
} = await (await merge({
396+
fixturesPath: 'test/fixtures/app/local',
397+
commitMessage: 'my-app',
398+
init: true,
399+
to: '2.11.1'
400+
})).promise;
401+
402+
expect(path.join(tmpPath, 'config/ember-cli-update.json')).to.be.a.file()
403+
.and.equal('test/fixtures/ember-cli-update-json/default/config/ember-cli-update.json');
404+
405+
await fs.remove(path.join(tmpPath, 'config/ember-cli-update.json'));
406+
407+
fixtureCompare({
408+
mergeFixtures: 'test/fixtures/app/init/my-app'
409+
});
410+
411+
expect(status).to.match(/^ M README\.md$/m);
412+
413+
assertNoStaged(status);
414+
});
415+
390416
it('can install an addon with a default blueprint and a state file', async function() {
391417
this.timeout(3 * 60 * 1000);
392418

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"directory": "bower_components",
3+
"analytics": false
4+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
8+
[*]
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true
13+
indent_style = space
14+
indent_size = 2
15+
16+
[*.hbs]
17+
insert_final_newline = false
18+
19+
[*.{diff,md}]
20+
trim_trailing_whitespace = false
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
/**
3+
Ember CLI sends analytics information by default. The data is completely
4+
anonymous, but there are times when you might want to disable this behavior.
5+
6+
Setting `disableAnalytics` to true will prevent any data from being sent.
7+
*/
8+
"disableAnalytics": false
9+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module.exports = {
2+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
7+
# dependencies
8+
/node_modules
9+
/bower_components
10+
11+
# misc
12+
/.sass-cache
13+
/connect.lock
14+
/coverage/*
15+
/libpeerconnection.log
16+
npm-debug.log*
17+
testem.log
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"predef": [
3+
"document",
4+
"window",
5+
"-Promise"
6+
],
7+
"browser": true,
8+
"boss": true,
9+
"curly": true,
10+
"debug": false,
11+
"devel": true,
12+
"eqeqeq": true,
13+
"evil": true,
14+
"forin": false,
15+
"immed": false,
16+
"laxbreak": false,
17+
"newcap": true,
18+
"noarg": true,
19+
"noempty": false,
20+
"nonew": false,
21+
"nomen": false,
22+
"onevar": false,
23+
"plusplus": false,
24+
"regexp": false,
25+
"undef": true,
26+
"sub": true,
27+
"strict": false,
28+
"white": false,
29+
"eqnull": true,
30+
"esversion": 6,
31+
"unused": true
32+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
language: node_js
3+
node_js:
4+
- "4"
5+
6+
sudo: false
7+
8+
cache:
9+
directories:
10+
- $HOME/.npm
11+
- $HOME/.cache # includes bowers cache
12+
13+
before_install:
14+
- npm config set spin false
15+
- npm install -g bower phantomjs-prebuilt
16+
- bower --version
17+
- phantomjs --version
18+
19+
install:
20+
- npm install
21+
- bower install
22+
23+
script:
24+
- npm test
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"ignore_dirs": ["tmp", "dist"]
3+
}

0 commit comments

Comments
 (0)