Skip to content

Commit

Permalink
fix(@angular/cli): remove ng from blueprints help, simplify blueprint…
Browse files Browse the repository at this point in the history
…s logic

Closes #4887
  • Loading branch information
hansl committed Feb 23, 2017
1 parent b4594ba commit d4b56e4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 41 deletions.
19 changes: 7 additions & 12 deletions packages/@angular/cli/ember-cli/lib/commands/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ module.exports = Command.extend({
default: false,
aliases: ['v'],
description: 'Adds more details to output logging.'
},
{ name: 'pod', type: Boolean, default: false, aliases: ['p'] },
{ name: 'classic', type: Boolean, default: false, aliases: ['c'] },
{ name: 'dummy', type: Boolean, default: false, aliases: ['dum', 'id'] },
{ name: 'in-repo-addon', type: String, default: null, aliases: ['in-repo', 'ir'] }
}
],

anonymousOptions: [
Expand Down Expand Up @@ -63,7 +59,7 @@ module.exports = Command.extend({
};

if (this.settings && this.settings.usePods && !commandOptions.classic) {
commandOptions.pod = !commandOptions.pod;
commandOptions.pod = false;
}

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

addAdditionalJsonForHelp: function(json, options) {
json.availableBlueprints = this.getAllBlueprints(options);
json.availableBlueprints = this.getAllBlueprints(options).filter(x => x.name !== 'ng');
},

getAllBlueprints: function(options) {
Expand Down Expand Up @@ -132,14 +128,13 @@ module.exports = Command.extend({
}

var output = '';

if (blueprints.length && !singleBlueprintName && !options.json) {
output += ' ' + collection.source + ':' + EOL;
}

var blueprintsJson = [];

blueprints.forEach(function(blueprint) {
if (blueprint.name === 'ng') {
// Skip
return;
}
var singleMatch = singleBlueprintName === blueprint.name;
if (singleMatch) {
verbose = true;
Expand Down
24 changes: 3 additions & 21 deletions packages/@angular/cli/ember-cli/lib/models/blueprint.js
Original file line number Diff line number Diff line change
Expand Up @@ -499,12 +499,10 @@ Blueprint.prototype.install = function(options) {
var ui = this.ui = options.ui;
var dryRun = this.dryRun = options.dryRun;
this.project = options.project;
this.pod = options.pod;
this.pod = false;
this.options = options;
this.hasPathToken = hasPathToken(this.files());

podDeprecations(this.project.config(), ui);

ui.writeLine('installing ' + this.name);

if (dryRun) {
Expand Down Expand Up @@ -536,12 +534,10 @@ Blueprint.prototype.uninstall = function(options) {
var ui = this.ui = options.ui;
var dryRun = this.dryRun = options.dryRun;
this.project = options.project;
this.pod = options.pod;
this.pod = false;
this.options = options;
this.hasPathToken = hasPathToken(this.files());

podDeprecations(this.project.config(), ui);

ui.writeLine('uninstalling ' + this.name);

if (dryRun) {
Expand Down Expand Up @@ -1109,7 +1105,7 @@ Blueprint.prototype.insertIntoFile = function(pathRelativeToProjectRoot, content
Blueprint.prototype._printCommand = printCommand;

Blueprint.prototype.printBasicHelp = function(verbose) {
var initialMargin = ' ';
var initialMargin = ' ';
var output = initialMargin;
if (this.overridden) {
output += chalk.grey('(overridden) ' + this.name);
Expand Down Expand Up @@ -1420,20 +1416,6 @@ function inRepoAddonExists(name, root) {
return existsSync(addonPath);
}

function podDeprecations(config, ui) {
/*
var podModulePrefix = config.podModulePrefix || '';
var podPath = podModulePrefix.substr(podModulePrefix.lastIndexOf('/') + 1);
// Disabled until we are ready to deprecate podModulePrefix
deprecateUI(ui)('`podModulePrefix` is deprecated and will be removed from future versions of ember-cli.'+
' Please move existing pods from \'app/' + podPath + '/\' to \'app/\'.', config.podModulePrefix);
*/
if (config.usePodsByDefault) {
ui.writeDeprecateLine('`usePodsByDefault` is no longer supported in \'config/environment.js\',' +
' use `usePods` in \'.ember-cli\' instead.');
}
}

/**
@private
@method destPath
Expand Down
9 changes: 1 addition & 8 deletions packages/@angular/cli/ember-cli/lib/models/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,14 +345,7 @@ Project.prototype.localBlueprintLookupPath = function() {
@return {Array} List of paths
*/
Project.prototype.blueprintLookupPaths = function() {
if (this.isEmberCLIProject()) {
var lookupPaths = [this.localBlueprintLookupPath()];
var addonLookupPaths = this.addonBlueprintLookupPaths();

return lookupPaths.concat(addonLookupPaths);
} else {
return this.addonBlueprintLookupPaths();
}
return this.addonBlueprintLookupPaths();
};

/**
Expand Down

0 comments on commit d4b56e4

Please sign in to comment.