From d699392fc46dca7b6391ca78f48efb40619a0cfc Mon Sep 17 00:00:00 2001 From: Hans Larsen Date: Tue, 6 Feb 2018 15:46:15 -0800 Subject: [PATCH] feat(@angular/cli): add support for ng update --next --- package-lock.json | 7 +++++++ packages/@angular/cli/commands/update.ts | 6 ++++++ packages/@angular/cli/tasks/update.ts | 4 +++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index e054ad028d..7fa447497c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1069,6 +1069,12 @@ "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, "builtin-status-codes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", @@ -9102,6 +9108,7 @@ "dev": true, "requires": { "babel-code-frame": "6.26.0", + "builtin-modules": "1.1.1", "chalk": "2.2.0", "commander": "2.11.0", "diff": "3.3.1", diff --git a/packages/@angular/cli/commands/update.ts b/packages/@angular/cli/commands/update.ts index 39afec8f70..4530a0cdf6 100644 --- a/packages/@angular/cli/commands/update.ts +++ b/packages/@angular/cli/commands/update.ts @@ -16,6 +16,12 @@ const UpdateCommand = Command.extend({ 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.' } ], diff --git a/packages/@angular/cli/tasks/update.ts b/packages/@angular/cli/tasks/update.ts index 7a0858aa7e..d2dc460410 100644 --- a/packages/@angular/cli/tasks/update.ts +++ b/packages/@angular/cli/tasks/update.ts @@ -4,6 +4,7 @@ import SchematicRunTask from './schematic-run'; export interface UpdateTaskOptions { dryRun: boolean; force: boolean; + next: boolean; } export const UpdateTask: any = Task.extend({ @@ -17,7 +18,8 @@ export const UpdateTask: any = Task.extend({ const schematicRunOptions = { taskOptions: { - dryRun: options.dryRun + dryRun: options.dryRun, + version: options.next ? 'next' : undefined }, workingDir: this.project.root, collectionName,