Skip to content

Commit

Permalink
fix(core): handle specifying a prerelease version without a package w…
Browse files Browse the repository at this point in the history
…hen migrating (nrwl#11129)
  • Loading branch information
leosvelperez authored Jul 13, 2022
1 parent ba592f8 commit 9933d91
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions packages/nx/src/command-line/migrate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,12 @@ describe('Migration', () => {
targetVersion: '12.0.0',
}
);
expect(
parseMigrationsOptions({ packageAndVersion: '8.12.0-beta.0' })
).toMatchObject({
targetPackage: '@nrwl/workspace',
targetVersion: '8.12.0-beta.0',
});
expect(
parseMigrationsOptions({ packageAndVersion: 'next' })
).toMatchObject({
Expand Down
8 changes: 4 additions & 4 deletions packages/nx/src/command-line/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,14 +394,14 @@ function parseTargetPackageAndVersion(args: string) {
}
} else {
if (
args.match(/^\d+(?:\.\d+)?(?:\.\d+)?$/) ||
args === 'latest' ||
args === 'next'
args === 'next' ||
valid(args) ||
args.match(/^\d+(?:\.\d+)?(?:\.\d+)?$/)
) {
const targetVersion = normalizeVersionWithTagCheck(args);
const targetPackage =
args.match(/^\d+(?:\.\d+)?(?:\.\d+)?$/) &&
lt(targetVersion, '14.0.0-beta.0')
!['latest', 'next'].includes(args) && lt(targetVersion, '14.0.0-beta.0')
? '@nrwl/workspace'
: 'nx';

Expand Down

0 comments on commit 9933d91

Please sign in to comment.