Skip to content

Commit

Permalink
fix(core): apply compatibility layer when running angular cli migrati…
Browse files Browse the repository at this point in the history
…ons (#13231)
  • Loading branch information
AgentEnder committed Nov 17, 2022
1 parent ab3ceb4 commit 4860281
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions packages/nx/src/command-line/migrate.ts
Expand Up @@ -932,6 +932,13 @@ export async function executeMigrations(
const depsBeforeMigrations = getStringifiedPackageJsonDeps(root);

const migrationsWithNoChanges: typeof migrations = [];

let ngCliAdapter: typeof import('../adapter/ngcli-adapter');
if (migrations.some((m) => m.cli !== 'nx')) {
ngCliAdapter = await import('../adapter/ngcli-adapter');
require('../adapter/compat');
}

for (const m of migrations) {
try {
if (m.cli === 'nx') {
Expand All @@ -947,9 +954,12 @@ export async function executeMigrations(
logger.info(` ${m.description}\n`);
printChanges(changes, ' ');
} else {
const { madeChanges, loggingQueue } = await (
await import('../adapter/ngcli-adapter')
).runMigration(root, m.package, m.name, isVerbose);
const { madeChanges, loggingQueue } = await ngCliAdapter.runMigration(
root,
m.package,
m.name,
isVerbose
);

if (!madeChanges) {
migrationsWithNoChanges.push(m);
Expand Down

1 comment on commit 4860281

@vercel
Copy link

@vercel vercel bot commented on 4860281 Nov 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-nrwl.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx-five.vercel.app
nx.dev

Please sign in to comment.