@pnpm/npm-resolver
Advanced tools
Comparing version 15.0.3 to 15.0.4
@@ -8,5 +8,11 @@ import { VersionSelectors } from '@pnpm/resolver-base'; | ||
versions: Record<string, PackageInRegistry>; | ||
time?: Record<string, string>; | ||
time?: PackageMetaTime; | ||
cachedAt?: number; | ||
} | ||
export type PackageMetaTime = Record<string, string> & { | ||
unpublished?: { | ||
time: string; | ||
versions: string[]; | ||
}; | ||
}; | ||
export interface PackageMetaCache { | ||
@@ -13,0 +19,0 @@ get: (key: string) => PackageMeta | undefined; |
@@ -10,2 +10,10 @@ "use strict"; | ||
function pickPackageFromMeta(pickVersionByVersionRangeFn, spec, preferredVersionSelectors, meta, publishedBy) { | ||
if ((!meta.versions || Object.keys(meta.versions).length === 0) && !publishedBy) { | ||
// Unfortunately, the npm registry doesn't return the time field in the abbreviated metadata. | ||
// So we won't always know if the package was unpublished. | ||
if (meta.time?.unpublished?.versions?.length) { | ||
throw new error_1.PnpmError('UNPUBLISHED_PKG', `No versions available for ${spec.name} because it was unpublished`); | ||
} | ||
throw new error_1.PnpmError('NO_VERSIONS', `No versions available for ${spec.name}. The package may be unpublished.`); | ||
} | ||
try { | ||
@@ -12,0 +20,0 @@ let version; |
{ | ||
"name": "@pnpm/npm-resolver", | ||
"version": "15.0.3", | ||
"version": "15.0.4", | ||
"description": "Resolver for npm-hosted packages", | ||
@@ -61,3 +61,3 @@ "main": "lib/index.js", | ||
"@pnpm/fetch": "6.0.5", | ||
"@pnpm/npm-resolver": "15.0.3", | ||
"@pnpm/npm-resolver": "15.0.4", | ||
"@pnpm/test-fixtures": "0.0.28" | ||
@@ -64,0 +64,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
66209
882