@pnpm/tarball-resolver
Advanced tools
Comparing version
import { type ResolveResult } from '@pnpm/resolver-base'; | ||
export declare function resolveFromTarball(wantedDependency: { | ||
import { type FetchFromRegistry } from '@pnpm/fetching-types'; | ||
export declare function resolveFromTarball(fetchFromRegistry: FetchFromRegistry, wantedDependency: { | ||
pref: string; | ||
}): Promise<ResolveResult | null>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.resolveFromTarball = resolveFromTarball; | ||
async function resolveFromTarball(wantedDependency) { | ||
async function resolveFromTarball(fetchFromRegistry, wantedDependency) { | ||
if (!wantedDependency.pref.startsWith('http:') && !wantedDependency.pref.startsWith('https:')) { | ||
@@ -10,7 +10,9 @@ return null; | ||
return null; | ||
// If there are redirects, we want to get the final URL address | ||
const { url: resolvedUrl } = await fetchFromRegistry(wantedDependency.pref, { method: 'HEAD' }); | ||
return { | ||
id: wantedDependency.pref, | ||
normalizedPref: wantedDependency.pref, | ||
id: resolvedUrl, | ||
normalizedPref: resolvedUrl, | ||
resolution: { | ||
tarball: wantedDependency.pref, | ||
tarball: resolvedUrl, | ||
}, | ||
@@ -17,0 +19,0 @@ resolvedVia: 'url', |
{ | ||
"name": "@pnpm/tarball-resolver", | ||
"version": "1000.0.0", | ||
"version": "1001.0.0", | ||
"description": "Resolver for tarball dependencies", | ||
@@ -21,3 +21,4 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@pnpm/resolver-base": "1000.0.0" | ||
"@pnpm/fetching-types": "1000.1.0", | ||
"@pnpm/resolver-base": "1000.1.0" | ||
}, | ||
@@ -29,3 +30,4 @@ "funding": "https://opencollective.com/pnpm", | ||
"devDependencies": { | ||
"@pnpm/tarball-resolver": "1000.0.0" | ||
"@pnpm/fetch": "1000.1.0", | ||
"@pnpm/tarball-resolver": "1001.0.0" | ||
}, | ||
@@ -32,0 +34,0 @@ "exports": { |
Sorry, the diff of this file is not supported yet
6069
7.72%42
7.69%2
100%2
100%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
Updated