Skip to content

Commit

Permalink
fix(core): apply compatibility layer when running angular cli migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentEnder committed Nov 17, 2022
1 parent c0deca8 commit 9d7ed66
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

0 comments on commit 9d7ed66

Please sign in to comment.