Skip to content

Commit d4b56e4

Browse files
committed
fix(@angular/cli): remove ng from blueprints help, simplify blueprints logic
Closes #4887
1 parent b4594ba commit d4b56e4

File tree

3 files changed

+11
-41
lines changed

3 files changed

+11
-41
lines changed

packages/@angular/cli/ember-cli/lib/commands/generate.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ module.exports = Command.extend({
2929
default: false,
3030
aliases: ['v'],
3131
description: 'Adds more details to output logging.'
32-
},
33-
{ name: 'pod', type: Boolean, default: false, aliases: ['p'] },
34-
{ name: 'classic', type: Boolean, default: false, aliases: ['c'] },
35-
{ name: 'dummy', type: Boolean, default: false, aliases: ['dum', 'id'] },
36-
{ name: 'in-repo-addon', type: String, default: null, aliases: ['in-repo', 'ir'] }
32+
}
3733
],
3834

3935
anonymousOptions: [
@@ -63,7 +59,7 @@ module.exports = Command.extend({
6359
};
6460

6561
if (this.settings && this.settings.usePods && !commandOptions.classic) {
66-
commandOptions.pod = !commandOptions.pod;
62+
commandOptions.pod = false;
6763
}
6864

6965
var taskOptions = merge(taskArgs, commandOptions || {});
@@ -80,7 +76,7 @@ module.exports = Command.extend({
8076
},
8177

8278
addAdditionalJsonForHelp: function(json, options) {
83-
json.availableBlueprints = this.getAllBlueprints(options);
79+
json.availableBlueprints = this.getAllBlueprints(options).filter(x => x.name !== 'ng');
8480
},
8581

8682
getAllBlueprints: function(options) {
@@ -132,14 +128,13 @@ module.exports = Command.extend({
132128
}
133129

134130
var output = '';
135-
136-
if (blueprints.length && !singleBlueprintName && !options.json) {
137-
output += ' ' + collection.source + ':' + EOL;
138-
}
139-
140131
var blueprintsJson = [];
141132

142133
blueprints.forEach(function(blueprint) {
134+
if (blueprint.name === 'ng') {
135+
// Skip
136+
return;
137+
}
143138
var singleMatch = singleBlueprintName === blueprint.name;
144139
if (singleMatch) {
145140
verbose = true;

packages/@angular/cli/ember-cli/lib/models/blueprint.js

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -499,12 +499,10 @@ Blueprint.prototype.install = function(options) {
499499
var ui = this.ui = options.ui;
500500
var dryRun = this.dryRun = options.dryRun;
501501
this.project = options.project;
502-
this.pod = options.pod;
502+
this.pod = false;
503503
this.options = options;
504504
this.hasPathToken = hasPathToken(this.files());
505505

506-
podDeprecations(this.project.config(), ui);
507-
508506
ui.writeLine('installing ' + this.name);
509507

510508
if (dryRun) {
@@ -536,12 +534,10 @@ Blueprint.prototype.uninstall = function(options) {
536534
var ui = this.ui = options.ui;
537535
var dryRun = this.dryRun = options.dryRun;
538536
this.project = options.project;
539-
this.pod = options.pod;
537+
this.pod = false;
540538
this.options = options;
541539
this.hasPathToken = hasPathToken(this.files());
542540

543-
podDeprecations(this.project.config(), ui);
544-
545541
ui.writeLine('uninstalling ' + this.name);
546542

547543
if (dryRun) {
@@ -1109,7 +1105,7 @@ Blueprint.prototype.insertIntoFile = function(pathRelativeToProjectRoot, content
11091105
Blueprint.prototype._printCommand = printCommand;
11101106

11111107
Blueprint.prototype.printBasicHelp = function(verbose) {
1112-
var initialMargin = ' ';
1108+
var initialMargin = ' ';
11131109
var output = initialMargin;
11141110
if (this.overridden) {
11151111
output += chalk.grey('(overridden) ' + this.name);
@@ -1420,20 +1416,6 @@ function inRepoAddonExists(name, root) {
14201416
return existsSync(addonPath);
14211417
}
14221418

1423-
function podDeprecations(config, ui) {
1424-
/*
1425-
var podModulePrefix = config.podModulePrefix || '';
1426-
var podPath = podModulePrefix.substr(podModulePrefix.lastIndexOf('/') + 1);
1427-
// Disabled until we are ready to deprecate podModulePrefix
1428-
deprecateUI(ui)('`podModulePrefix` is deprecated and will be removed from future versions of ember-cli.'+
1429-
' Please move existing pods from \'app/' + podPath + '/\' to \'app/\'.', config.podModulePrefix);
1430-
*/
1431-
if (config.usePodsByDefault) {
1432-
ui.writeDeprecateLine('`usePodsByDefault` is no longer supported in \'config/environment.js\',' +
1433-
' use `usePods` in \'.ember-cli\' instead.');
1434-
}
1435-
}
1436-
14371419
/**
14381420
@private
14391421
@method destPath

packages/@angular/cli/ember-cli/lib/models/project.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -345,14 +345,7 @@ Project.prototype.localBlueprintLookupPath = function() {
345345
@return {Array} List of paths
346346
*/
347347
Project.prototype.blueprintLookupPaths = function() {
348-
if (this.isEmberCLIProject()) {
349-
var lookupPaths = [this.localBlueprintLookupPath()];
350-
var addonLookupPaths = this.addonBlueprintLookupPaths();
351-
352-
return lookupPaths.concat(addonLookupPaths);
353-
} else {
354-
return this.addonBlueprintLookupPaths();
355-
}
348+
return this.addonBlueprintLookupPaths();
356349
};
357350

358351
/**

0 commit comments

Comments
 (0)