Skip to content

Commit 5ed8d38

Browse files
filipesilvaDanny Blue
authored and
Danny Blue
committed
chore(new): remove blueprint option (angular#2390)
1 parent a3b0fbd commit 5ed8d38

File tree

3 files changed

+3
-47
lines changed

3 files changed

+3
-47
lines changed

packages/angular-cli/commands/init.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const InitCommand: any = Command.extend({
1818
availableOptions: [
1919
{ name: 'dry-run', type: Boolean, default: false, aliases: ['d'] },
2020
{ name: 'verbose', type: Boolean, default: false, aliases: ['v'] },
21-
{ name: 'blueprint', type: String, aliases: ['b'] },
2221
{ name: 'link-cli', type: Boolean, default: false, aliases: ['lc'] },
2322
{ name: 'skip-npm', type: Boolean, default: false, aliases: ['sn'] },
2423
{ name: 'skip-bower', type: Boolean, default: true, aliases: ['sb'] },
@@ -34,10 +33,6 @@ const InitCommand: any = Command.extend({
3433

3534
anonymousOptions: ['<glob-pattern>'],
3635

37-
_defaultBlueprint: function () {
38-
return 'ng2';
39-
},
40-
4136
run: function (commandOptions: any, rawArgs: string[]) {
4237
if (commandOptions.dryRun) {
4338
commandOptions.skipNpm = true;
@@ -100,7 +95,7 @@ const InitCommand: any = Command.extend({
10095

10196
const blueprintOpts = {
10297
dryRun: commandOptions.dryRun,
103-
blueprint: commandOptions.blueprint || this._defaultBlueprint(),
98+
blueprint: 'ng2',
10499
rawName: packageName,
105100
targetFiles: rawArgs || '',
106101
rawArgs: rawArgs.toString(),

packages/angular-cli/commands/new.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import * as chalk from 'chalk';
2+
import InitCommand from './init';
3+
24
const Command = require('ember-cli/lib/models/command');
35
const Project = require('ember-cli/lib/models/project');
46
const SilentError = require('silent-error');
57
const validProjectName = require('ember-cli/lib/utilities/valid-project-name');
68

7-
const normalizeBlueprint = require('ember-cli/lib/utilities/normalize-blueprint-option');
8-
import InitCommand from './init';
99

1010
const NewCommand = Command.extend({
1111
name: 'new',
@@ -15,7 +15,6 @@ const NewCommand = Command.extend({
1515
availableOptions: [
1616
{ name: 'dry-run', type: Boolean, default: false, aliases: ['d'] },
1717
{ name: 'verbose', type: Boolean, default: false, aliases: ['v'] },
18-
{ name: 'blueprint', type: String, default: 'ng2', aliases: ['b'] },
1918
{ name: 'link-cli', type: Boolean, default: false, aliases: ['lc'] },
2019
{ name: 'skip-npm', type: Boolean, default: false, aliases: ['sn'] },
2120
{ name: 'skip-bower', type: Boolean, default: true, aliases: ['sb'] },
@@ -62,8 +61,6 @@ const NewCommand = Command.extend({
6261
));
6362
}
6463

65-
commandOptions.blueprint = normalizeBlueprint(commandOptions.blueprint);
66-
6764
if (!commandOptions.directory) {
6865
commandOptions.directory = packageName;
6966
}

tests/acceptance/new.spec.js

-36
Original file line numberDiff line numberDiff line change
@@ -103,42 +103,6 @@ describe('Acceptance: ng new', function () {
103103
.then(confirmBlueprinted);
104104
});
105105

106-
it('ng new with blueprint uses the specified blueprint directory with a relative path',
107-
function () {
108-
return tmp.setup('./tmp/my_blueprint')
109-
.then(function () {
110-
return tmp.setup('./tmp/my_blueprint/files');
111-
})
112-
.then(function () {
113-
fs.writeFileSync('./tmp/my_blueprint/files/gitignore');
114-
process.chdir('./tmp');
115-
116-
return ng([
117-
'new', 'foo', '--skip-npm', '--skip-bower', '--skip-git',
118-
'--blueprint=./my_blueprint'
119-
]);
120-
})
121-
.then(confirmBlueprintedForDir('tmp/my_blueprint'));
122-
});
123-
124-
it('ng new with blueprint uses the specified blueprint directory with an absolute path',
125-
function () {
126-
return tmp.setup('./tmp/my_blueprint')
127-
.then(function () {
128-
return tmp.setup('./tmp/my_blueprint/files');
129-
})
130-
.then(function () {
131-
fs.writeFileSync('./tmp/my_blueprint/files/gitignore');
132-
process.chdir('./tmp');
133-
134-
return ng([
135-
'new', 'foo', '--skip-npm', '--skip-bower', '--skip-git',
136-
'--blueprint=' + path.resolve(process.cwd(), './my_blueprint')
137-
]);
138-
})
139-
.then(confirmBlueprintedForDir('tmp/my_blueprint'));
140-
});
141-
142106
it('ng new without skip-git flag creates .git dir', function () {
143107
return ng(['new', 'foo', '--skip-npm', '--skip-bower']).then(function () {
144108
expect(existsSync('.git'));

0 commit comments

Comments
 (0)