File tree Expand file tree Collapse file tree 4 files changed +35
-1
lines changed
Expand file tree Collapse file tree 4 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export function initLocal(workspace: Workspace) {
2727 if ( runOpts === false || process . env . NX_SKIP_TASKS_RUNNER ) {
2828 if ( workspace . type === 'angular' && process . argv [ 2 ] === 'update' ) {
2929 console . log (
30- `Nx provides a much improved version of "ng update". It runs same migrations, but allows you to:`
30+ `Nx provides a much improved version of "ng update". It runs the same migrations, but allows you to:`
3131 ) ;
3232 console . log ( `- rerun the same migration multiple times` ) ;
3333 console . log ( `- reorder migrations` ) ;
Original file line number Diff line number Diff line change 139139 "version" : " 10.4.5" ,
140140 "description" : " Update the 'update' npm script to invoke nx migrate" ,
141141 "factory" : " ./src/migrations/update-10-4-0/update-script-to-invoke-nx-migrate"
142+ },
143+ "update-decorate-angular-cli" : {
144+ "version" : " 10.4.6" ,
145+ "description" : " Update the decoration script when using Angular CLI" ,
146+ "factory" : " ./src/migrations/update-10-4-0/update-decorate-angular-cli"
142147 }
143148 },
144149 "packageJsonUpdates" : {
Original file line number Diff line number Diff line change 1+ import { join as pathJoin } from 'path' ;
2+ import { readFileSync } from 'fs' ;
3+ import { Tree } from '@angular-devkit/schematics' ;
4+
5+ export default function update ( ) {
6+ return ( host : Tree ) => {
7+ const decorateCli = readFileSync (
8+ pathJoin (
9+ __dirname as any ,
10+ '..' ,
11+ '..' ,
12+ 'schematics' ,
13+ 'utils' ,
14+ 'decorate-angular-cli.js__tmpl__'
15+ )
16+ ) . toString ( ) ;
17+ if ( host . exists ( '/decorate-angular-cli.js' ) ) {
18+ host . overwrite ( '/decorate-angular-cli.js' , decorateCli ) ;
19+ }
20+ } ;
21+ }
Original file line number Diff line number Diff line change @@ -50,6 +50,14 @@ if (!process.env['NX_CLI_SET']) {
5050 const { output } = require('@nrwl/workspace');
5151 output.warn({ title: 'The Angular CLI was invoked instead of the Nx CLI. Use "npx ng [command]" or "nx [command]" instead.' });
5252}
53+
54+ if (process.argv[2] === 'update') {
55+ const { output } = require('@nrwl/workspace');
56+ output.error({
57+ title: '"ng update" is deprecated in favor of "nx migrate". Read more: https://nx.dev/latest/angular/workspace/update'
58+ });
59+ throw new Error();
60+ }
5361${angularCLIInit}
5462 `);
5563 }
You can’t perform that action at this time.
0 commit comments