fix(core): handle specifying a prerelease version without a package when migrating (#11129)
This commit is contained in:
parent
ba592f8a99
commit
9933d91a1b
@ -768,6 +768,12 @@ describe('Migration', () => {
|
|||||||
targetVersion: '12.0.0',
|
targetVersion: '12.0.0',
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
expect(
|
||||||
|
parseMigrationsOptions({ packageAndVersion: '8.12.0-beta.0' })
|
||||||
|
).toMatchObject({
|
||||||
|
targetPackage: '@nrwl/workspace',
|
||||||
|
targetVersion: '8.12.0-beta.0',
|
||||||
|
});
|
||||||
expect(
|
expect(
|
||||||
parseMigrationsOptions({ packageAndVersion: 'next' })
|
parseMigrationsOptions({ packageAndVersion: 'next' })
|
||||||
).toMatchObject({
|
).toMatchObject({
|
||||||
|
|||||||
@ -394,14 +394,14 @@ function parseTargetPackageAndVersion(args: string) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (
|
if (
|
||||||
args.match(/^\d+(?:\.\d+)?(?:\.\d+)?$/) ||
|
|
||||||
args === 'latest' ||
|
args === 'latest' ||
|
||||||
args === 'next'
|
args === 'next' ||
|
||||||
|
valid(args) ||
|
||||||
|
args.match(/^\d+(?:\.\d+)?(?:\.\d+)?$/)
|
||||||
) {
|
) {
|
||||||
const targetVersion = normalizeVersionWithTagCheck(args);
|
const targetVersion = normalizeVersionWithTagCheck(args);
|
||||||
const targetPackage =
|
const targetPackage =
|
||||||
args.match(/^\d+(?:\.\d+)?(?:\.\d+)?$/) &&
|
!['latest', 'next'].includes(args) && lt(targetVersion, '14.0.0-beta.0')
|
||||||
lt(targetVersion, '14.0.0-beta.0')
|
|
||||||
? '@nrwl/workspace'
|
? '@nrwl/workspace'
|
||||||
: 'nx';
|
: 'nx';
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user