@pnpm/engine.runtime.node-resolver 1101.1.13 → 1101.1.14

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @pnpm/node.resolver
2
2
 
3
+ ## 1101.1.14
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies:
8
+ - @pnpm/config.reader@1101.12.1
9
+
3
10
  ## 1101.1.13
4
11
 
5
12
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/engine.runtime.node-resolver",
3
- "version": "1101.1.13",
3
+ "version": "1101.1.14",
4
4
  "description": "Resolves a Node.js version specifier to an exact Node.js version",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -29,7 +29,7 @@
29
29
  "!*.map"
30
30
  ],
31
31
  "dependencies": {
32
- "@pnpm/config.reader": "1101.12.0",
32
+ "@pnpm/config.reader": "1101.12.1",
33
33
  "@pnpm/crypto.shasums-file": "1100.1.3",
34
34
  "@pnpm/error": "1100.0.1",
35
35
  "@pnpm/fetching.types": "1100.0.2",
@@ -40,8 +40,8 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@jest/globals": "30.4.1",
43
- "@pnpm/engine.runtime.node-resolver": "1101.1.13",
44
- "@pnpm/network.fetch": "1100.1.5",
43
+ "@pnpm/engine.runtime.node-resolver": "1101.1.14",
44
+ "@pnpm/network.fetch": "1100.1.6",
45
45
  "@types/semver": "7.7.1"
46
46
  },
47
47
  "engines": {
@@ -1,13 +0,0 @@
1
- export interface NodeArtifactAddress {
2
- basename: string;
3
- extname: string;
4
- dirname: string;
5
- }
6
- export interface GetNodeArtifactAddressOptions {
7
- version: string;
8
- baseUrl: string;
9
- platform: string;
10
- arch: string;
11
- libc?: string;
12
- }
13
- export declare function getNodeArtifactAddress({ version, baseUrl, platform, arch, libc, }: GetNodeArtifactAddressOptions): NodeArtifactAddress;
@@ -1,13 +0,0 @@
1
- import { getNormalizedArch } from './normalizeArch.js';
2
- export function getNodeArtifactAddress({ version, baseUrl, platform, arch, libc, }) {
3
- const isWindowsPlatform = platform === 'win32';
4
- const normalizedPlatform = isWindowsPlatform ? 'win' : platform;
5
- const normalizedArch = getNormalizedArch(platform, arch, version);
6
- const archSuffix = libc === 'musl' ? '-musl' : '';
7
- return {
8
- dirname: `${baseUrl}v${version}`,
9
- basename: `node-v${version}-${normalizedPlatform}-${normalizedArch}${archSuffix}`,
10
- extname: isWindowsPlatform ? '.zip' : '.tar.gz',
11
- };
12
- }
13
- //# sourceMappingURL=getNodeArtifactAddress.js.map
@@ -1 +0,0 @@
1
- export declare function getNodeMirror(nodeDownloadMirrors: Record<string, string> | undefined, releaseChannel: string): string;
@@ -1,8 +0,0 @@
1
- export function getNodeMirror(nodeDownloadMirrors, releaseChannel) {
2
- const nodeMirror = nodeDownloadMirrors?.[releaseChannel] ?? `https://nodejs.org/download/${releaseChannel}/`;
3
- return normalizeNodeMirror(nodeMirror);
4
- }
5
- function normalizeNodeMirror(nodeMirror) {
6
- return nodeMirror.endsWith('/') ? nodeMirror : `${nodeMirror}/`;
7
- }
8
- //# sourceMappingURL=getNodeMirror.js.map
package/lib/index.d.ts DELETED
@@ -1,24 +0,0 @@
1
- import type { FetchFromRegistry } from '@pnpm/fetching.types';
2
- import type { LatestInfo, LatestQuery, ResolveOptions, ResolveResult, VariationsResolution, WantedDependency } from '@pnpm/resolving.resolver-base';
3
- import { getNodeArtifactAddress } from './getNodeArtifactAddress.js';
4
- import { getNodeMirror } from './getNodeMirror.js';
5
- import { parseNodeSpecifier } from './parseNodeSpecifier.js';
6
- export { getNodeArtifactAddress, getNodeMirror, parseNodeSpecifier };
7
- export declare const DEFAULT_NODE_MIRROR_BASE_URL = "https://nodejs.org/download/release/";
8
- export declare const UNOFFICIAL_NODE_MIRROR_BASE_URL = "https://unofficial-builds.nodejs.org/download/release/";
9
- export declare const NODE_EXTRAS_IGNORE_PATTERN = "^(?:(?:lib/)?node_modules/(?:npm|corepack)(?:/|$)|bin/(?:npm|npx|corepack)$|(?:npm|npx|corepack)(?:\\.(?:cmd|ps1))?$)";
10
- export interface NodeRuntimeResolveResult extends ResolveResult {
11
- resolution: VariationsResolution;
12
- resolvedVia: 'nodejs.org';
13
- }
14
- export declare function resolveNodeRuntime(ctx: {
15
- fetchFromRegistry: FetchFromRegistry;
16
- nodeDownloadMirrors?: Record<string, string>;
17
- offline?: boolean;
18
- }, wantedDependency: WantedDependency, opts?: Partial<ResolveOptions>): Promise<NodeRuntimeResolveResult | null>;
19
- export declare function resolveLatestNodeRuntime(ctx: {
20
- fetchFromRegistry: FetchFromRegistry;
21
- nodeDownloadMirrors?: Record<string, string>;
22
- }, query: LatestQuery, _opts: ResolveOptions): Promise<LatestInfo | undefined>;
23
- export declare function resolveNodeVersion(fetch: FetchFromRegistry, versionSpec: string, nodeMirrorBaseUrl?: string): Promise<string | null>;
24
- export declare function resolveNodeVersions(fetch: FetchFromRegistry, versionSpec?: string, nodeMirrorBaseUrl?: string): Promise<string[]>;
@@ -1 +0,0 @@
1
- export declare function getNormalizedArch(platform: string, arch: string, nodeVersion?: string): string;
@@ -1,16 +0,0 @@
1
- export function getNormalizedArch(platform, arch, nodeVersion) {
2
- if (nodeVersion) {
3
- const nodeMajorVersion = +nodeVersion.split('.')[0];
4
- if ((platform === 'darwin' && arch === 'arm64' && (nodeMajorVersion < 16))) {
5
- return 'x64';
6
- }
7
- }
8
- if (platform === 'win32' && arch === 'ia32') {
9
- return 'x86';
10
- }
11
- if (arch === 'arm') {
12
- return 'armv7l';
13
- }
14
- return arch;
15
- }
16
- //# sourceMappingURL=normalizeArch.js.map
@@ -1,5 +0,0 @@
1
- export interface NodeSpecifier {
2
- releaseChannel: string;
3
- versionSpecifier: string;
4
- }
5
- export declare function parseNodeSpecifier(specifier: string): NodeSpecifier;
@@ -1,39 +0,0 @@
1
- import { PnpmError } from '@pnpm/error';
2
- const RELEASE_CHANNELS = ['nightly', 'rc', 'test', 'v8-canary', 'release'];
3
- const isStableVersion = (version) => /^\d+\.\d+\.\d+$/.test(version);
4
- export function parseNodeSpecifier(specifier) {
5
- // Handle "channel/version" format: "rc/18", "rc/18.0.0-rc.4", "release/22.0.0", "nightly/latest"
6
- if (specifier.includes('/')) {
7
- const [releaseChannel, versionSpecifier] = specifier.split('/', 2);
8
- if (!RELEASE_CHANNELS.includes(releaseChannel)) {
9
- throw new PnpmError('INVALID_NODE_RELEASE_CHANNEL', `"${releaseChannel}" is not a valid Node.js release channel`, {
10
- hint: `Valid release channels are: ${RELEASE_CHANNELS.join(', ')}`,
11
- });
12
- }
13
- return { releaseChannel, versionSpecifier };
14
- }
15
- // Exact prerelease version with a recognized release channel suffix.
16
- // e.g. "22.0.0-rc.4", "22.0.0-nightly20250315d765e70802", "22.0.0-v8-canary2025..."
17
- const prereleaseChannelMatch = specifier.match(/^\d+\.\d+\.\d+-(nightly|rc|test|v8-canary)/);
18
- if (prereleaseChannelMatch != null) {
19
- return { releaseChannel: prereleaseChannelMatch[1], versionSpecifier: specifier };
20
- }
21
- // Exact stable version: "22.0.0"
22
- if (isStableVersion(specifier)) {
23
- return { releaseChannel: 'release', versionSpecifier: specifier };
24
- }
25
- // Standalone release channel name means "latest from that channel".
26
- // e.g. "nightly" → latest nightly, "rc" → latest rc, "release" → latest release
27
- if (RELEASE_CHANNELS.includes(specifier)) {
28
- return { releaseChannel: specifier, versionSpecifier: 'latest' };
29
- }
30
- // Well-known version aliases on the stable release channel
31
- if (specifier === 'lts' || specifier === 'latest') {
32
- return { releaseChannel: 'release', versionSpecifier: specifier };
33
- }
34
- // Semver ranges ("18", "^18", ">=18", "18.x") and LTS codenames ("argon", "iron", "hydrogen")
35
- // are all passed through as versionSpecifier on the release channel.
36
- // Any truly invalid input will fail at resolution time with NODEJS_VERSION_NOT_FOUND.
37
- return { releaseChannel: 'release', versionSpecifier: specifier };
38
- }
39
- //# sourceMappingURL=parseNodeSpecifier.js.map