@pnpm/installing.package-requester 1100.0.0 → 1100.0.2

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.
@@ -1,6 +1,6 @@
1
1
  import type { Fetchers } from '@pnpm/fetching.fetcher-base';
2
2
  import type { CustomFetcher } from '@pnpm/hooks.types';
3
- import type { ResolveFunction } from '@pnpm/resolving.resolver-base';
3
+ import { type ResolveFunction } from '@pnpm/resolving.resolver-base';
4
4
  import type { Cafs } from '@pnpm/store.cafs-types';
5
5
  import type { FetchPackageToStoreFunction, GetFilesIndexFilePath, RequestPackageFunction } from '@pnpm/store.controller-types';
6
6
  export declare function createPackageRequester(opts: {
@@ -7,6 +7,7 @@ import { PnpmError } from '@pnpm/error';
7
7
  import { pickFetcher } from '@pnpm/fetching.pick-fetcher';
8
8
  import gfs from '@pnpm/fs.graceful-fs';
9
9
  import { logger } from '@pnpm/logger';
10
+ import { resolvePlatformSelector, selectPlatformVariant, } from '@pnpm/resolving.resolver-base';
10
11
  import { normalizeBundledManifest, } from '@pnpm/store.cafs';
11
12
  import { gitHostedStoreIndexKey, storeIndexKey } from '@pnpm/store.index';
12
13
  import { calcMaxWorkers, readPkgFromCafs as _readPkgFromCafs, } from '@pnpm/worker';
@@ -249,24 +250,17 @@ function getFilesIndexFilePath(ctx, opts) {
249
250
  return { filesIndexFile, target, resolution };
250
251
  }
251
252
  function findResolution(resolutionVariants, supportedArchitectures) {
252
- const platform = getOneIfNonCurrent(supportedArchitectures?.os) ?? process.platform;
253
- const cpu = getOneIfNonCurrent(supportedArchitectures?.cpu) ?? process.arch;
254
- const libc = getOneIfNonCurrent(supportedArchitectures?.libc) ?? getLibcFamilySync();
255
- const resolutionVariant = resolutionVariants
256
- .find((resolutionVariant) => resolutionVariant.targets.some((target) => target.os === platform &&
257
- target.cpu === cpu &&
258
- (target.libc == null || target.libc === libc)));
259
- if (!resolutionVariant) {
253
+ const selector = resolvePlatformSelector(supportedArchitectures, {
254
+ platform: process.platform,
255
+ arch: process.arch,
256
+ libc: getLibcFamilySync(),
257
+ });
258
+ const variant = selectPlatformVariant(resolutionVariants, selector);
259
+ if (!variant) {
260
260
  const resolutionTargets = resolutionVariants.map((variant) => variant.targets);
261
261
  throw new PnpmError('NO_RESOLUTION_MATCHED', `Cannot find a resolution variant for the current platform in these resolutions: ${JSON.stringify(resolutionTargets)}`);
262
262
  }
263
- return resolutionVariant.resolution;
264
- }
265
- function getOneIfNonCurrent(requirements) {
266
- if (requirements?.length && requirements[0] !== 'current') {
267
- return requirements[0];
268
- }
269
- return undefined;
263
+ return variant.resolution;
270
264
  }
271
265
  function fetchToStore(ctx, opts) {
272
266
  if (!opts.pkg.name) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/installing.package-requester",
3
- "version": "1100.0.0",
3
+ "version": "1100.0.2",
4
4
  "description": "Concurrent downloader of npm-compatible packages",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -35,23 +35,23 @@
35
35
  "ramda": "npm:@pnpm/ramda@0.28.1",
36
36
  "semver": "^7.7.2",
37
37
  "ssri": "13.0.1",
38
- "@pnpm/config.package-is-installable": "1100.0.0",
39
- "@pnpm/core-loggers": "1100.0.0",
38
+ "@pnpm/config.package-is-installable": "1100.0.1",
39
+ "@pnpm/core-loggers": "1100.0.1",
40
+ "@pnpm/deps.path": "1100.0.1",
41
+ "@pnpm/fetching.fetcher-base": "1100.0.2",
40
42
  "@pnpm/error": "1100.0.0",
41
- "@pnpm/deps.path": "1100.0.0",
42
- "@pnpm/fetching.fetcher-base": "1100.0.0",
43
+ "@pnpm/fetching.pick-fetcher": "1100.0.2",
43
44
  "@pnpm/fs.graceful-fs": "1100.0.0",
44
- "@pnpm/hooks.types": "1100.0.0",
45
- "@pnpm/resolving.resolver-base": "1100.0.0",
46
- "@pnpm/store.cafs": "1100.0.0",
47
- "@pnpm/fetching.pick-fetcher": "1100.0.0",
45
+ "@pnpm/hooks.types": "1100.0.2",
46
+ "@pnpm/store.cafs": "1100.0.2",
47
+ "@pnpm/store.controller-types": "1100.0.2",
48
+ "@pnpm/resolving.resolver-base": "1100.1.0",
48
49
  "@pnpm/store.index": "1100.0.0",
49
- "@pnpm/store.controller-types": "1100.0.0",
50
- "@pnpm/types": "1100.0.0"
50
+ "@pnpm/types": "1101.0.0"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "@pnpm/logger": ">=1001.0.0 <1002.0.0",
54
- "@pnpm/worker": "^1100.0.0"
54
+ "@pnpm/worker": "^1100.0.2"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@jest/globals": "30.3.0",
@@ -63,13 +63,13 @@
63
63
  "delay": "^7.0.0",
64
64
  "normalize-path": "^3.0.0",
65
65
  "tempy": "3.0.0",
66
- "@pnpm/installing.client": "1100.0.0",
67
- "@pnpm/installing.package-requester": "1100.0.0",
66
+ "@pnpm/installing.package-requester": "1100.0.2",
67
+ "@pnpm/installing.client": "1100.0.3",
68
68
  "@pnpm/logger": "1100.0.0",
69
- "@pnpm/store.create-cafs-store": "1100.0.0",
70
- "@pnpm/testing.mock-agent": "1100.0.0",
69
+ "@pnpm/store.create-cafs-store": "1100.0.2",
70
+ "@pnpm/store.cafs-types": "1100.0.0",
71
71
  "@pnpm/test-fixtures": "1100.0.0",
72
- "@pnpm/store.cafs-types": "1100.0.0"
72
+ "@pnpm/testing.mock-agent": "1100.0.1"
73
73
  },
74
74
  "engines": {
75
75
  "node": ">=22.13"