fix(js): nx release-version resolve-version-spec should normalize fetchSpec (#21710)

This commit is contained in:
Colum Ferry 2024-02-10 13:58:27 +00:00 committed by GitHub
parent b1d0294d46
commit 11e139c7ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -76,7 +76,7 @@ describe('resolveVersionSpec()', () => {
'projectA',
'1.0.0',
'link:../projectB',
'/packages/fuck'
'/packages/projectB'
)
).toEqual(expect.stringContaining(join('/packages/projectB')));
});

View File

@ -1,4 +1,5 @@
import * as npa from 'npm-package-arg';
import { normalizePath } from '@nx/devkit';
export function resolveVersionSpec(
name: string,
@ -26,5 +27,7 @@ export function resolveVersionSpec(
const npaResult = npa.resolve(name, spec, location);
return npaResult.fetchSpec;
return npaResult.fetchSpec.includes('\\')
? normalizePath(npaResult.fetchSpec)
: npaResult.fetchSpec;
}