mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-23 17:41:50 -04:00
committed by
Zoltan Kochan
parent
08039f3870
commit
992820161c
5
.changeset/unlucky-sheep-play.md
Normal file
5
.changeset/unlucky-sheep-play.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/tarball-resolver": patch
|
||||
---
|
||||
|
||||
The ID of a tarball dependency should not contain colons, when the URL has a port. The colon should be escaped with a plus sign.
|
||||
@@ -10,7 +10,7 @@ export default async function resolveTarball (
|
||||
if (isRepository(wantedDependency.pref)) return null
|
||||
|
||||
return {
|
||||
id: `@${wantedDependency.pref.replace(/^.*:\/\/(git@)?/, '')}`,
|
||||
id: `@${wantedDependency.pref.replace(/^.*:\/\/(git@)?/, '').replace(':', '+')}`,
|
||||
normalizedPref: wantedDependency.pref,
|
||||
resolution: {
|
||||
tarball: wantedDependency.pref,
|
||||
|
||||
@@ -14,6 +14,19 @@ test('tarball from npm registry', async () => {
|
||||
})
|
||||
})
|
||||
|
||||
test('tarball from URL that contain port number', async () => {
|
||||
const resolutionResult = await resolveFromTarball({ pref: 'http://buildserver.mycompany.com:81/my-private-package-0.1.6.tgz' })
|
||||
|
||||
expect(resolutionResult).toStrictEqual({
|
||||
id: '@buildserver.mycompany.com+81/my-private-package-0.1.6.tgz',
|
||||
normalizedPref: 'http://buildserver.mycompany.com:81/my-private-package-0.1.6.tgz',
|
||||
resolution: {
|
||||
tarball: 'http://buildserver.mycompany.com:81/my-private-package-0.1.6.tgz',
|
||||
},
|
||||
resolvedVia: 'url',
|
||||
})
|
||||
})
|
||||
|
||||
test('tarball not from npm registry', async () => {
|
||||
const resolutionResult = await resolveFromTarball({ pref: 'https://github.com/hegemonic/taffydb/tarball/master' })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user