Skip to content

Commit

Permalink
feat(core): show a warning about using ng update insteda of nx migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
vsavkin committed Dec 9, 2020
1 parent 021c842 commit da05843
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion packages/cli/lib/init-local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { parseRunOneOptions } from './parse-run-one-options';
* @param workspace Relevant local workspace properties
*/
process.env.NX_CLI_SET = 'true';

export function initLocal(workspace: Workspace) {
require('@nrwl/workspace/' + 'src/utils/perf-logging');
const supportedNxCommands = require('@nrwl/workspace/' +
Expand All @@ -24,7 +25,25 @@ export function initLocal(workspace: Workspace) {
.argv;
} else {
if (runOpts === false || process.env.NX_SKIP_TASKS_RUNNER) {
loadCli(workspace);
if (workspace.type === 'angular' && process.argv[2] === 'update') {
console.log(
`Nx provides a much improved version of "ng update". It runs same migrations, but allows you to:`
);
console.log(`- rerun the same migration multiple times`);
console.log(`- reorder migrations`);
console.log(`- skip migrations`);
console.log(`- fix migrations that "almost work"`);
console.log(`- commit a partially migrated state`);
console.log(`- change versions of packages to match org requirements`);
console.log(
`And, in general, it is lot more reliable for non-trivial workspaces. Read more at: https://nx.dev/latest/angular/workspace/update`
);
console.log(
`Run "nx migrate latest" to update to the latest version of Nx.`
);
} else {
loadCli(workspace);
}
} else {
require('@nrwl/workspace' + '/src/command-line/run-one').runOne(runOpts);
}
Expand Down

0 comments on commit da05843

Please sign in to comment.