Skip to content

Commit

Permalink
feat(@angular/cli): move ng update to using the proper schematic
Browse files Browse the repository at this point in the history
  • Loading branch information
hansl authored and filipesilva committed Mar 28, 2018
1 parent 3708935 commit 33a6823
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 30 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@angular-devkit/core": "0.4.7",
"@angular-devkit/schematics": "0.4.7",
"@schematics/angular": "0.4.7",
"@schematics/package-update": "0.4.7",
"@schematics/update": "^0.4.7",
"ajv": "^6.1.1",
"chalk": "~2.2.0",
"common-tags": "^1.3.1",
Expand Down
26 changes: 5 additions & 21 deletions packages/@angular/cli/commands/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,22 @@ export interface UpdateOptions extends CoreSchematicOptions {

export default class UpdateCommand extends SchematicCommand {
public readonly name = 'update';
public readonly description = 'Updates your application.';
public readonly description = 'Updates your application and its dependencies.';
public static aliases: string[] = [];
public readonly scope = CommandScope.inProject;
public readonly arguments: string[] = [];
public readonly arguments: string[] = [ 'packages' ];
public readonly options: Option[] = [
...this.coreOptions,
{
name: 'dry-run',
type: Boolean,
default: false,
aliases: ['d'],
description: 'Run through without making any changes.'
},
{
name: 'next',
type: Boolean,
default: false,
description: 'Install the next version, instead of the latest.'
}
];

public async run(options: UpdateOptions) {
const collectionName = '@schematics/package-update';
const schematicName = 'all';

const collectionName = '@schematics/update';
const schematicName = 'update';

const schematicRunOptions = {
collectionName,
schematicName,
schematicOptions: {
version: options.next ? 'next' : undefined
},
schematicOptions: options,
dryRun: options.dryRun,
force: options.force,
workingDir: this.project.root,
Expand Down
2 changes: 1 addition & 1 deletion packages/@angular/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@angular-devkit/schematics": "0.4.7",
"@ngtools/json-schema": "1.2.0",
"@schematics/angular": "0.4.7",
"@schematics/package-update": "0.4.7",
"@schematics/update": "0.4.7",
"ajv": "^6.1.1",
"chalk": "~2.2.0",
"common-tags": "^1.3.1",
Expand Down
2 changes: 1 addition & 1 deletion scripts/publish/validate_dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const ANGULAR_PACKAGES = [
'@angular/compiler',
'@angular/compiler-cli',
'@angular/core',
'@schematics/package-update'
'@schematics/update'
];
const OPTIONAL_PACKAGES = [
'@angular/service-worker',
Expand Down

0 comments on commit 33a6823

Please sign in to comment.