Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): throw graceful error in runNxMigration() if no collection #10655

Merged
merged 4 commits into from
Jun 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/nx/src/command-line/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,12 @@ async function runNxMigration(root: string, packageName: string, name: string) {

const collection = readJsonFile<MigrationsJson>(collectionPath);
const g = collection.generators || collection.schematics;
if (!g[name]) {
const source = collection.generators ? 'generators' : 'schematics';
throw new Error(
`Unable to determine implementation path for "${collectionPath}:${name}" using collection.${source}`
);
}
const implRelativePath = g[name].implementation || g[name].factory;

let implPath: string;
Expand Down