fix(misc): handle migrating packages with numbers in the name (#8598)
This commit is contained in:
parent
c5b63958e6
commit
736df256b5
@ -673,6 +673,10 @@ describe('Migration', () => {
|
||||
});
|
||||
|
||||
it('should handle different variations of the target package', () => {
|
||||
expect(parseMigrationsOptions(['@angular/core'])).toMatchObject({
|
||||
targetPackage: '@angular/core',
|
||||
targetVersion: 'latest',
|
||||
});
|
||||
expect(parseMigrationsOptions(['8.12'])).toMatchObject({
|
||||
targetPackage: '@nrwl/workspace',
|
||||
targetVersion: '8.12.0',
|
||||
@ -681,6 +685,10 @@ describe('Migration', () => {
|
||||
targetPackage: '@nrwl/workspace',
|
||||
targetVersion: '8.0.0',
|
||||
});
|
||||
expect(parseMigrationsOptions(['12'])).toMatchObject({
|
||||
targetPackage: '@nrwl/workspace',
|
||||
targetVersion: '12.0.0',
|
||||
});
|
||||
expect(parseMigrationsOptions(['next'])).toMatchObject({
|
||||
targetPackage: '@nrwl/workspace',
|
||||
targetVersion: 'next',
|
||||
@ -697,6 +705,10 @@ describe('Migration', () => {
|
||||
targetPackage: 'mypackage',
|
||||
targetVersion: 'latest',
|
||||
});
|
||||
expect(parseMigrationsOptions(['mypackage2'])).toMatchObject({
|
||||
targetPackage: 'mypackage2',
|
||||
targetVersion: 'latest',
|
||||
});
|
||||
expect(parseMigrationsOptions(['@nrwl/workspace@latest'])).toMatchObject({
|
||||
targetPackage: '@nrwl/workspace',
|
||||
targetVersion: 'latest',
|
||||
|
||||
@ -359,7 +359,11 @@ function parseTargetPackageAndVersion(args: string) {
|
||||
return { targetPackage, targetVersion };
|
||||
}
|
||||
} else {
|
||||
if (args.match(/[0-9]/) || args === 'latest' || args === 'next') {
|
||||
if (
|
||||
args.match(/^\d+(?:\.\d+)?(?:\.\d+)?$/) ||
|
||||
args === 'latest' ||
|
||||
args === 'next'
|
||||
) {
|
||||
return {
|
||||
targetPackage: '@nrwl/workspace',
|
||||
targetVersion: normalizeVersionWithTagCheck(args),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user