@pnpm/resolving.npm-resolver 1101.3.2 → 1101.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -233,8 +233,8 @@ async function runAgeCheck(context, registry, name, version, cutoff, ignoreMissi
233
233
  * attestation endpoint is cheaper than the packument: presence of
234
234
  * provenance on the current version is not sufficient to clear a
235
235
  * downgrade. A package could have shipped earlier versions under a
236
- * `trustedPublisher` (the higher-rank evidence) and then dropped
237
- * back to plain provenance for the version we're verifying —
236
+ * `trustedPublisher` with provenance (the higher-rank evidence) and
237
+ * then dropped back to plain provenance for the version we're verifying —
238
238
  * `failIfTrustDowngraded` correctly flags that, and a "has any
239
239
  * attestation → pass" shortcut would silently miss it.
240
240
  */
package/lib/index.d.ts CHANGED
@@ -108,6 +108,7 @@ export type ResolveFromNpmOptions = {
108
108
  preferredVersions?: PreferredVersions;
109
109
  preferWorkspacePackages?: boolean;
110
110
  update?: false | 'compatible' | 'latest';
111
+ updateChecksums?: boolean;
111
112
  injectWorkspacePackages?: boolean;
112
113
  calcSpecifier?: boolean;
113
114
  pinnedVersion?: PinnedVersion;
package/lib/index.js CHANGED
@@ -287,6 +287,7 @@ async function resolveNpm(ctx, wantedDependency, opts) {
287
287
  preferredVersionSelectors: opts.preferredVersions?.[spec.name],
288
288
  registry,
289
289
  includeLatestTag: opts.update === 'latest',
290
+ updateChecksums: opts.updateChecksums,
290
291
  optional: wantedDependency.optional,
291
292
  });
292
293
  }
@@ -490,6 +491,7 @@ async function pickFromSimpleRegistry(ctx, wantedDependency, opts, spec, registr
490
491
  preferredVersionSelectors: opts.preferredVersions?.[spec.name],
491
492
  registry,
492
493
  includeLatestTag: opts.update === 'latest',
494
+ updateChecksums: opts.updateChecksums,
493
495
  optional: wantedDependency.optional,
494
496
  });
495
497
  if (pickedPackage == null) {
@@ -14,6 +14,15 @@ export interface PickPackageOptions extends PickPackageFromMetaOptions {
14
14
  dryRun: boolean;
15
15
  includeLatestTag?: boolean;
16
16
  optional?: boolean;
17
+ /**
18
+ * When true, skip the on-disk exact-version cache fast path so a
19
+ * stale on-disk packument can't satisfy the call without a
20
+ * conditional registry request. The in-memory cache is left alone:
21
+ * its entries can only be populated by this install's own fresh
22
+ * network fetches, so they're authoritative for second-and-onward
23
+ * lookups within the same install.
24
+ */
25
+ updateChecksums?: boolean;
17
26
  }
18
27
  export declare function pickPackage(ctx: {
19
28
  fetch: (pkgName: string, opts: {
@@ -179,7 +179,7 @@ export async function pickPackage(ctx, spec, opts) {
179
179
  }
180
180
  }
181
181
  }
182
- if (!opts.includeLatestTag && spec.type === 'version') {
182
+ if (!opts.includeLatestTag && !opts.updateChecksums && spec.type === 'version') {
183
183
  metaCachedInStore = metaCachedInStore ?? await limit(async () => loadMeta(pkgMirror));
184
184
  // use the cached meta only if it has the required package version
185
185
  // otherwise it is probably out of date
@@ -78,7 +78,7 @@ function detectStrongestTrustEvidenceBeforeDate(meta, beforeDate, options) {
78
78
  return best;
79
79
  }
80
80
  export function getTrustEvidence(manifest) {
81
- if (manifest._npmUser?.trustedPublisher) {
81
+ if (manifest._npmUser?.trustedPublisher && manifest.dist?.attestations?.provenance) {
82
82
  return 'trustedPublisher';
83
83
  }
84
84
  if (manifest.dist?.attestations?.provenance) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/resolving.npm-resolver",
3
- "version": "1101.3.2",
3
+ "version": "1101.3.3",
4
4
  "description": "Resolver for npm-hosted packages",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -28,39 +28,39 @@
28
28
  "dependencies": {
29
29
  "@zkochan/retry": "^0.2.0",
30
30
  "encode-registry": "^3.0.1",
31
- "lru-cache": "^11.2.7",
31
+ "lru-cache": "^11.5.0",
32
32
  "normalize-path": "^3.0.0",
33
- "p-limit": "^7.1.0",
33
+ "p-limit": "^7.3.0",
34
34
  "p-memoize": "8.0.0",
35
35
  "parse-npm-tarball-url": "^5.0.0",
36
36
  "path-temp": "^3.0.0",
37
37
  "ramda": "npm:@pnpm/ramda@0.28.1",
38
38
  "rename-overwrite": "^7.0.1",
39
- "semver": "^7.7.2",
39
+ "semver": "^7.8.1",
40
40
  "semver-utils": "^1.1.4",
41
41
  "ssri": "13.0.1",
42
42
  "version-selector-type": "^3.0.0",
43
- "@pnpm/config.version-policy": "1100.1.1",
44
- "@pnpm/core-loggers": "1100.1.1",
43
+ "@pnpm/config.pick-registry-for-package": "1100.0.6",
44
+ "@pnpm/constants": "1100.0.0",
45
+ "@pnpm/core-loggers": "1100.1.2",
45
46
  "@pnpm/crypto.hash": "1100.0.1",
47
+ "@pnpm/config.version-policy": "1100.1.2",
48
+ "@pnpm/error": "1100.0.0",
46
49
  "@pnpm/fetching.types": "1100.0.1",
47
- "@pnpm/constants": "1100.0.0",
50
+ "@pnpm/resolving.registry.pkg-metadata-filter": "1100.0.5",
51
+ "@pnpm/resolving.registry.types": "1100.0.5",
52
+ "@pnpm/resolving.resolver-base": "1100.3.1",
53
+ "@pnpm/store.cafs": "1100.1.7",
54
+ "@pnpm/store.index": "1100.1.0",
48
55
  "@pnpm/fs.graceful-fs": "1100.1.0",
49
- "@pnpm/error": "1100.0.0",
50
- "@pnpm/config.pick-registry-for-package": "1100.0.5",
51
- "@pnpm/resolving.registry.pkg-metadata-filter": "1100.0.4",
52
- "@pnpm/resolving.registry.types": "1100.0.4",
53
- "@pnpm/resolving.resolver-base": "1100.3.0",
54
- "@pnpm/resolving.jsr-specifier-parser": "1100.0.0",
55
- "@pnpm/store.cafs": "1100.1.6",
56
+ "@pnpm/types": "1101.2.0",
56
57
  "@pnpm/workspace.range-resolver": "1100.0.1",
57
- "@pnpm/workspace.spec-parser": "1100.0.0",
58
- "@pnpm/types": "1101.1.1",
59
- "@pnpm/store.index": "1100.1.0"
58
+ "@pnpm/resolving.jsr-specifier-parser": "1100.0.0",
59
+ "@pnpm/workspace.spec-parser": "1100.0.0"
60
60
  },
61
61
  "peerDependencies": {
62
- "@pnpm/logger": ">=1001.0.0 <1002.0.0",
63
- "@pnpm/worker": "^1100.1.7"
62
+ "@pnpm/logger": "^1001.0.1",
63
+ "@pnpm/worker": "^1100.1.8"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@jest/globals": "30.3.0",
@@ -71,10 +71,10 @@
71
71
  "load-json-file": "^7.0.1",
72
72
  "tempy": "3.0.0",
73
73
  "@pnpm/logger": "1100.0.0",
74
- "@pnpm/network.fetch": "1100.0.6",
75
- "@pnpm/resolving.npm-resolver": "1101.3.2",
74
+ "@pnpm/testing.mock-agent": "1100.0.7",
75
+ "@pnpm/resolving.npm-resolver": "1101.3.3",
76
76
  "@pnpm/test-fixtures": "1100.0.0",
77
- "@pnpm/testing.mock-agent": "1100.0.6"
77
+ "@pnpm/network.fetch": "1100.0.7"
78
78
  },
79
79
  "engines": {
80
80
  "node": ">=22.13"