feat(@angular/cli): move ng update to using the proper schematic

This commit is contained in:
Hans 2018-03-27 16:50:30 -07:00 committed by Filipe Silva
parent 3708935cef
commit 33a6823df1
5 changed files with 14 additions and 30 deletions

12
package-lock.json generated
View File

@ -192,10 +192,10 @@
"typescript": "2.6.2"
}
},
"@schematics/package-update": {
"@schematics/update": {
"version": "0.4.7",
"resolved": "https://registry.npmjs.org/@schematics/package-update/-/package-update-0.4.7.tgz",
"integrity": "sha512-QYLPKWARclx32N5yoDqv1/Ds/XrJ7ZNf2yL3ZJuC9+B/KKXWlkwOOHGEfzmSDRv8F8cTFjLAdNI84cy82oQBRA==",
"resolved": "https://registry.npmjs.org/@schematics/update/-/update-0.4.7.tgz",
"integrity": "sha512-z4UIVUBi/xNSNI+OlKP+0+++RySlYNqh8lQnQrHwVmXTfc28+x9rw2TN36gpc9JfjQX4hdsjJrmp6XRFwA+SWw==",
"requires": {
"rxjs": "5.5.8",
"semver": "5.5.0",
@ -1483,7 +1483,7 @@
},
"compression": {
"version": "1.7.2",
"resolved": "http://registry.npmjs.org/compression/-/compression-1.7.2.tgz",
"resolved": "https://registry.npmjs.org/compression/-/compression-1.7.2.tgz",
"integrity": "sha1-qv+81qr4VLROuygDU9WtFlH1mmk=",
"requires": {
"accepts": "1.3.5",
@ -2739,7 +2739,7 @@
},
"event-stream": {
"version": "3.3.4",
"resolved": "http://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz",
"resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz",
"integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=",
"dev": true,
"requires": {
@ -6804,7 +6804,7 @@
},
"onetime": {
"version": "1.1.0",
"resolved": "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz",
"integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=",
"dev": true
},

View File

@ -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",

View File

@ -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,

View File

@ -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",

View File

@ -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',