X Tutup
Skip to content

Commit 33a6823

Browse files
hanslfilipesilva
authored andcommitted
feat(@angular/cli): move ng update to using the proper schematic
1 parent 3708935 commit 33a6823

File tree

5 files changed

+14
-30
lines changed

5 files changed

+14
-30
lines changed

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"@angular-devkit/core": "0.4.7",
4747
"@angular-devkit/schematics": "0.4.7",
4848
"@schematics/angular": "0.4.7",
49-
"@schematics/package-update": "0.4.7",
49+
"@schematics/update": "^0.4.7",
5050
"ajv": "^6.1.1",
5151
"chalk": "~2.2.0",
5252
"common-tags": "^1.3.1",

packages/@angular/cli/commands/update.ts

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,22 @@ export interface UpdateOptions extends CoreSchematicOptions {
99

1010
export default class UpdateCommand extends SchematicCommand {
1111
public readonly name = 'update';
12-
public readonly description = 'Updates your application.';
12+
public readonly description = 'Updates your application and its dependencies.';
1313
public static aliases: string[] = [];
1414
public readonly scope = CommandScope.inProject;
15-
public readonly arguments: string[] = [];
15+
public readonly arguments: string[] = [ 'packages' ];
1616
public readonly options: Option[] = [
1717
...this.coreOptions,
18-
{
19-
name: 'dry-run',
20-
type: Boolean,
21-
default: false,
22-
aliases: ['d'],
23-
description: 'Run through without making any changes.'
24-
},
25-
{
26-
name: 'next',
27-
type: Boolean,
28-
default: false,
29-
description: 'Install the next version, instead of the latest.'
30-
}
3118
];
3219

3320
public async run(options: UpdateOptions) {
34-
const collectionName = '@schematics/package-update';
35-
const schematicName = 'all';
36-
21+
const collectionName = '@schematics/update';
22+
const schematicName = 'update';
3723

3824
const schematicRunOptions = {
3925
collectionName,
4026
schematicName,
41-
schematicOptions: {
42-
version: options.next ? 'next' : undefined
43-
},
27+
schematicOptions: options,
4428
dryRun: options.dryRun,
4529
force: options.force,
4630
workingDir: this.project.root,

packages/@angular/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@angular-devkit/schematics": "0.4.7",
3434
"@ngtools/json-schema": "1.2.0",
3535
"@schematics/angular": "0.4.7",
36-
"@schematics/package-update": "0.4.7",
36+
"@schematics/update": "0.4.7",
3737
"ajv": "^6.1.1",
3838
"chalk": "~2.2.0",
3939
"common-tags": "^1.3.1",

scripts/publish/validate_dependencies.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const ANGULAR_PACKAGES = [
1717
'@angular/compiler',
1818
'@angular/compiler-cli',
1919
'@angular/core',
20-
'@schematics/package-update'
20+
'@schematics/update'
2121
];
2222
const OPTIONAL_PACKAGES = [
2323
'@angular/service-worker',

0 commit comments

Comments
 (0)
X Tutup