@pnpm/node.fetcher 1000.0.19 → 1000.1.0

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.
@@ -0,0 +1,12 @@
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
+ }
12
+ export declare function getNodeArtifactAddress({ version, baseUrl, platform, arch, }: GetNodeArtifactAddressOptions): NodeArtifactAddress;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getNodeArtifactAddress = getNodeArtifactAddress;
4
+ const normalizeArch_1 = require("./normalizeArch");
5
+ function getNodeArtifactAddress({ version, baseUrl, platform, arch, }) {
6
+ const isWindowsPlatform = platform === 'win32';
7
+ const normalizedPlatform = isWindowsPlatform ? 'win' : platform;
8
+ const normalizedArch = (0, normalizeArch_1.getNormalizedArch)(platform, arch, version);
9
+ return {
10
+ dirname: `${baseUrl}v${version}`,
11
+ basename: `node-v${version}-${normalizedPlatform}-${normalizedArch}`,
12
+ extname: isWindowsPlatform ? '.zip' : '.tar.gz',
13
+ };
14
+ }
15
+ //# sourceMappingURL=getNodeArtifactAddress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNodeArtifactAddress.js","sourceRoot":"","sources":["../src/getNodeArtifactAddress.ts"],"names":[],"mappings":";;AAeA,wDAcC;AA7BD,mDAAmD;AAenD,SAAgB,sBAAsB,CAAE,EACtC,OAAO,EACP,OAAO,EACP,QAAQ,EACR,IAAI,GAC0B;IAC9B,MAAM,iBAAiB,GAAG,QAAQ,KAAK,OAAO,CAAA;IAC9C,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAA;IAC/D,MAAM,cAAc,GAAG,IAAA,iCAAiB,EAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;IACjE,OAAO;QACL,OAAO,EAAE,GAAG,OAAO,IAAI,OAAO,EAAE;QAChC,QAAQ,EAAE,SAAS,OAAO,IAAI,kBAAkB,IAAI,cAAc,EAAE;QACpE,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;KAChD,CAAA;AACH,CAAC"}
package/lib/index.d.ts CHANGED
@@ -1,8 +1,33 @@
1
1
  import { type FetchFromRegistry, type RetryTimeoutOptions } from '@pnpm/fetching-types';
2
- export interface FetchNodeOptions {
2
+ import { type Cafs } from '@pnpm/cafs-types';
3
+ import { type NodeRuntimeFetcher } from '@pnpm/fetcher-base';
4
+ export declare function createNodeRuntimeFetcher(ctx: {
5
+ fetch: FetchFromRegistry;
6
+ rawConfig: Record<string, string>;
7
+ offline?: boolean;
8
+ }): {
9
+ nodeRuntime: NodeRuntimeFetcher;
10
+ };
11
+ export interface FetchNodeOptionsToDir {
3
12
  storeDir: string;
4
13
  fetchTimeout?: number;
5
14
  nodeMirrorBaseUrl?: string;
6
15
  retry?: RetryTimeoutOptions;
7
16
  }
8
- export declare function fetchNode(fetch: FetchFromRegistry, version: string, targetDir: string, opts: FetchNodeOptions): Promise<void>;
17
+ export interface FetchNodeOptions {
18
+ cafs: Cafs;
19
+ filesIndexFile: string;
20
+ fetchTimeout?: number;
21
+ nodeMirrorBaseUrl?: string;
22
+ retry?: RetryTimeoutOptions;
23
+ }
24
+ /**
25
+ * Fetches and installs a Node.js version to the specified target directory.
26
+ *
27
+ * @param fetch - Function to fetch resources from registry
28
+ * @param version - Node.js version to install
29
+ * @param targetDir - Directory where Node.js should be installed
30
+ * @param opts - Configuration options for the fetch operation
31
+ * @throws {PnpmError} When system uses MUSL libc, integrity verification fails, or download fails
32
+ */
33
+ export declare function fetchNode(fetch: FetchFromRegistry, version: string, targetDir: string, opts: FetchNodeOptionsToDir): Promise<void>;
package/lib/index.js CHANGED
@@ -3,28 +3,152 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.createNodeRuntimeFetcher = createNodeRuntimeFetcher;
6
7
  exports.fetchNode = fetchNode;
7
- const fs_1 = __importDefault(require("fs"));
8
+ const promises_1 = __importDefault(require("fs/promises"));
8
9
  const path_1 = __importDefault(require("path"));
10
+ const constants_1 = require("@pnpm/constants");
9
11
  const error_1 = require("@pnpm/error");
10
- const pick_fetcher_1 = require("@pnpm/pick-fetcher");
12
+ const crypto_shasums_file_1 = require("@pnpm/crypto.shasums-file");
11
13
  const create_cafs_store_1 = require("@pnpm/create-cafs-store");
12
14
  const tarball_fetcher_1 = require("@pnpm/tarball-fetcher");
15
+ const node_resolver_1 = require("@pnpm/node.resolver");
16
+ const worker_1 = require("@pnpm/worker");
13
17
  const adm_zip_1 = __importDefault(require("adm-zip"));
14
18
  const rename_overwrite_1 = __importDefault(require("rename-overwrite"));
15
19
  const tempy_1 = __importDefault(require("tempy"));
16
20
  const detect_libc_1 = require("detect-libc");
17
- const getNodeTarball_1 = require("./getNodeTarball");
21
+ const ssri_1 = __importDefault(require("ssri"));
22
+ const getNodeArtifactAddress_1 = require("./getNodeArtifactAddress");
23
+ function createNodeRuntimeFetcher(ctx) {
24
+ const fetchNodeRuntime = async (cafs, resolution, opts) => {
25
+ if (!opts.pkg.version) {
26
+ throw new error_1.PnpmError('CANNOT_FETCH_NODE_WITHOUT_VERSION', 'Cannot fetch Node.js without a version');
27
+ }
28
+ if (ctx.offline) {
29
+ throw new error_1.PnpmError('CANNOT_DOWNLOAD_NODE_OFFLINE', 'Cannot download Node.js because offline mode is enabled.');
30
+ }
31
+ const version = opts.pkg.version;
32
+ const { releaseChannel } = (0, node_resolver_1.parseEnvSpecifier)(version);
33
+ await validateSystemCompatibility();
34
+ const nodeMirrorBaseUrl = (0, node_resolver_1.getNodeMirror)(ctx.rawConfig, releaseChannel);
35
+ const artifactInfo = await getNodeArtifactInfo(ctx.fetch, version, {
36
+ nodeMirrorBaseUrl,
37
+ expectedVersionIntegrity: resolution.integrity,
38
+ cachedShasumsFile: resolution._shasumsFileContent,
39
+ });
40
+ const manifest = {
41
+ name: 'node',
42
+ version,
43
+ bin: (0, constants_1.getNodeBinLocationForCurrentOS)(),
44
+ };
45
+ if (artifactInfo.isZip) {
46
+ const tempLocation = await cafs.tempDir();
47
+ await downloadAndUnpackZip(ctx.fetch, artifactInfo, tempLocation);
48
+ return {
49
+ ...await (0, worker_1.addFilesFromDir)({
50
+ storeDir: cafs.storeDir,
51
+ dir: tempLocation,
52
+ filesIndexFile: opts.filesIndexFile,
53
+ readManifest: false,
54
+ }),
55
+ manifest,
56
+ };
57
+ }
58
+ return {
59
+ ...await downloadAndUnpackTarball(ctx.fetch, artifactInfo, { cafs, filesIndexFile: opts.filesIndexFile }),
60
+ manifest,
61
+ };
62
+ };
63
+ return {
64
+ nodeRuntime: fetchNodeRuntime,
65
+ };
66
+ }
67
+ // Constants
68
+ const DEFAULT_NODE_MIRROR_BASE_URL = 'https://nodejs.org/download/release/';
69
+ /**
70
+ * Fetches and installs a Node.js version to the specified target directory.
71
+ *
72
+ * @param fetch - Function to fetch resources from registry
73
+ * @param version - Node.js version to install
74
+ * @param targetDir - Directory where Node.js should be installed
75
+ * @param opts - Configuration options for the fetch operation
76
+ * @throws {PnpmError} When system uses MUSL libc, integrity verification fails, or download fails
77
+ */
18
78
  async function fetchNode(fetch, version, targetDir, opts) {
79
+ await validateSystemCompatibility();
80
+ const nodeMirrorBaseUrl = opts.nodeMirrorBaseUrl ?? DEFAULT_NODE_MIRROR_BASE_URL;
81
+ const artifactInfo = await getNodeArtifactInfo(fetch, version, { nodeMirrorBaseUrl });
82
+ if (artifactInfo.isZip) {
83
+ await downloadAndUnpackZip(fetch, artifactInfo, targetDir);
84
+ return;
85
+ }
86
+ await downloadAndUnpackTarballToDir(fetch, artifactInfo, targetDir, opts);
87
+ }
88
+ /**
89
+ * Validates that the current system is compatible with Node.js installation.
90
+ *
91
+ * @throws {PnpmError} When system uses MUSL libc
92
+ */
93
+ async function validateSystemCompatibility() {
19
94
  if (await (0, detect_libc_1.isNonGlibcLinux)()) {
20
95
  throw new error_1.PnpmError('MUSL', 'The current system uses the "MUSL" C standard library. Node.js currently has prebuilt artifacts only for the "glibc" libc, so we can install Node.js only for glibc');
21
96
  }
22
- const nodeMirrorBaseUrl = opts.nodeMirrorBaseUrl ?? 'https://nodejs.org/download/release/';
23
- const { tarball, pkgName } = (0, getNodeTarball_1.getNodeTarball)(version, nodeMirrorBaseUrl, process.platform, process.arch);
24
- if (tarball.endsWith('.zip')) {
25
- await downloadAndUnpackZip(fetch, tarball, targetDir, pkgName);
26
- return;
27
- }
97
+ }
98
+ /**
99
+ * Gets Node.js artifact information including URL, integrity, and file type.
100
+ *
101
+ * @param fetch - Function to fetch resources from registry
102
+ * @param version - Node.js version
103
+ * @param nodeMirrorBaseUrl - Base URL for Node.js mirror
104
+ * @returns Promise resolving to artifact information
105
+ * @throws {PnpmError} When integrity file cannot be fetched or parsed
106
+ */
107
+ async function getNodeArtifactInfo(fetch, version, opts) {
108
+ const tarball = (0, getNodeArtifactAddress_1.getNodeArtifactAddress)({
109
+ version,
110
+ baseUrl: opts.nodeMirrorBaseUrl,
111
+ platform: process.platform,
112
+ arch: process.arch,
113
+ });
114
+ const tarballFileName = `${tarball.basename}${tarball.extname}`;
115
+ const shasumsFileUrl = `${tarball.dirname}/SHASUMS256.txt`;
116
+ const url = `${tarball.dirname}/${tarballFileName}`;
117
+ const integrity = opts.cachedShasumsFile
118
+ ? (0, crypto_shasums_file_1.pickFileChecksumFromShasumsFile)(opts.cachedShasumsFile, tarballFileName)
119
+ : await loadArtifactIntegrity(fetch, tarballFileName, shasumsFileUrl, {
120
+ expectedVersionIntegrity: opts.expectedVersionIntegrity,
121
+ });
122
+ return {
123
+ url,
124
+ integrity,
125
+ isZip: tarball.extname === '.zip',
126
+ basename: tarball.basename,
127
+ };
128
+ }
129
+ /**
130
+ * Loads and extracts the integrity hash for a specific Node.js artifact.
131
+ *
132
+ * @param fetch - Function to fetch resources from registry
133
+ * @param fileName - Name of the file to find integrity for
134
+ * @param shasumsUrl - URL of the SHASUMS256.txt file
135
+ * @param options - Optional configuration for integrity verification
136
+ * @returns Promise resolving to the integrity hash in base64 format
137
+ * @throws {PnpmError} When integrity file cannot be fetched or parsed
138
+ */
139
+ async function loadArtifactIntegrity(fetch, fileName, shasumsUrl, options) {
140
+ const body = await (0, crypto_shasums_file_1.fetchShasumsFile)(fetch, shasumsUrl, options?.expectedVersionIntegrity);
141
+ return (0, crypto_shasums_file_1.pickFileChecksumFromShasumsFile)(body, fileName);
142
+ }
143
+ /**
144
+ * Downloads and unpacks a tarball using the tarball fetcher.
145
+ *
146
+ * @param fetch - Function to fetch resources from registry
147
+ * @param artifactInfo - Information about the Node.js artifact
148
+ * @param targetDir - Directory where Node.js should be installed
149
+ * @param opts - Configuration options for the fetch operation
150
+ */
151
+ async function downloadAndUnpackTarballToDir(fetch, artifactInfo, targetDir, opts) {
28
152
  const getAuthHeader = () => undefined;
29
153
  const fetchers = (0, tarball_fetcher_1.createTarballFetcher)(fetch, getAuthHeader, {
30
154
  retry: opts.retry,
@@ -34,9 +158,14 @@ async function fetchNode(fetch, version, targetDir, opts) {
34
158
  unsafePerm: false,
35
159
  });
36
160
  const cafs = (0, create_cafs_store_1.createCafsStore)(opts.storeDir);
37
- const fetchTarball = (0, pick_fetcher_1.pickFetcher)(fetchers, { tarball });
38
- const { filesIndex } = await fetchTarball(cafs, { tarball }, {
39
- filesIndexFile: path_1.default.join(opts.storeDir, encodeURIComponent(tarball)), // TODO: change the name or don't save an index file for node.js tarballs
161
+ // Create a unique index file name for Node.js tarballs
162
+ const indexFileName = `node-${encodeURIComponent(artifactInfo.url)}`;
163
+ const filesIndexFile = path_1.default.join(opts.storeDir, indexFileName);
164
+ const { filesIndex } = await fetchers.remoteTarball(cafs, {
165
+ tarball: artifactInfo.url,
166
+ integrity: artifactInfo.integrity,
167
+ }, {
168
+ filesIndexFile,
40
169
  lockfileDir: process.cwd(),
41
170
  pkg: {},
42
171
  });
@@ -49,17 +178,83 @@ async function fetchNode(fetch, version, targetDir, opts) {
49
178
  force: true,
50
179
  });
51
180
  }
52
- async function downloadAndUnpackZip(fetchFromRegistry, zipUrl, targetDir, pkgName) {
53
- const response = await fetchFromRegistry(zipUrl);
54
- const tmp = path_1.default.join(tempy_1.default.directory(), 'pnpm.zip');
55
- const dest = fs_1.default.createWriteStream(tmp);
56
- await new Promise((resolve, reject) => {
57
- response.body.pipe(dest).on('error', reject).on('close', resolve);
181
+ async function downloadAndUnpackTarball(fetch, artifactInfo, opts) {
182
+ const getAuthHeader = () => undefined;
183
+ const fetchers = (0, tarball_fetcher_1.createTarballFetcher)(fetch, getAuthHeader, {
184
+ retry: opts.retry,
185
+ timeout: opts.fetchTimeout,
186
+ // These are not needed for fetching Node.js
187
+ rawConfig: {},
188
+ unsafePerm: false,
189
+ });
190
+ return fetchers.remoteTarball(opts.cafs, {
191
+ tarball: artifactInfo.url,
192
+ integrity: artifactInfo.integrity,
193
+ }, {
194
+ filesIndexFile: opts.filesIndexFile,
195
+ lockfileDir: process.cwd(),
196
+ pkg: {},
58
197
  });
59
- const zip = new adm_zip_1.default(tmp);
198
+ }
199
+ /**
200
+ * Downloads and unpacks a zip file containing Node.js.
201
+ *
202
+ * @param fetchFromRegistry - Function to fetch resources from registry
203
+ * @param artifactInfo - Information about the Node.js artifact
204
+ * @param targetDir - Directory where Node.js should be installed
205
+ * @throws {PnpmError} When integrity verification fails or extraction fails
206
+ */
207
+ async function downloadAndUnpackZip(fetchFromRegistry, artifactInfo, targetDir) {
208
+ const response = await fetchFromRegistry(artifactInfo.url);
209
+ const tmp = path_1.default.join(tempy_1.default.directory(), 'pnpm.zip');
210
+ try {
211
+ await downloadWithIntegrityCheck(response, tmp, artifactInfo.integrity);
212
+ await extractZipToTarget(tmp, artifactInfo.basename, targetDir);
213
+ }
214
+ finally {
215
+ // Clean up temporary file
216
+ try {
217
+ await promises_1.default.unlink(tmp);
218
+ }
219
+ catch {
220
+ // Ignore cleanup errors
221
+ }
222
+ }
223
+ }
224
+ /**
225
+ * Downloads a file with integrity verification.
226
+ *
227
+ * @param response - Fetch response containing the file data
228
+ * @param tmpPath - Temporary file path to save the download
229
+ * @param expectedIntegrity - Expected SHA-256 integrity hash
230
+ * @param url - URL being downloaded (for error messages)
231
+ * @throws {PnpmError} When integrity verification fails
232
+ */
233
+ async function downloadWithIntegrityCheck(response, tmpPath, expectedIntegrity) {
234
+ // Collect all chunks from the response
235
+ const chunks = [];
236
+ for await (const chunk of response.body) {
237
+ chunks.push(chunk);
238
+ }
239
+ const data = Buffer.concat(chunks);
240
+ // Verify integrity if provided
241
+ ssri_1.default.checkData(data, expectedIntegrity, { error: true });
242
+ // Write the verified data to file
243
+ await promises_1.default.writeFile(tmpPath, data);
244
+ }
245
+ /**
246
+ * Extracts a zip file to the target directory.
247
+ *
248
+ * @param zipPath - Path to the zip file
249
+ * @param basename - Base name of the file (without extension)
250
+ * @param targetDir - Directory where contents should be extracted
251
+ * @throws {PnpmError} When extraction fails
252
+ */
253
+ async function extractZipToTarget(zipPath, basename, targetDir) {
254
+ const zip = new adm_zip_1.default(zipPath);
60
255
  const nodeDir = path_1.default.dirname(targetDir);
256
+ const extractedDir = path_1.default.join(nodeDir, basename);
61
257
  zip.extractAllTo(nodeDir, true);
62
- await (0, rename_overwrite_1.default)(path_1.default.join(nodeDir, pkgName), targetDir);
63
- await fs_1.default.promises.unlink(tmp);
258
+ await (0, rename_overwrite_1.default)(extractedDir, targetDir);
64
259
  }
65
260
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAuBA,8BAiCC;AAxDD,4CA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.js artifacts fetcher",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -15,6 +15,7 @@
15
15
  "bugs": {
16
16
  "url": "https://github.com/pnpm/pnpm/issues"
17
17
  },
18
+ "type": "commonjs",
18
19
  "main": "lib/index.js",
19
20
  "types": "lib/index.d.ts",
20
21
  "exports": {
@@ -28,20 +29,25 @@
28
29
  "adm-zip": "^0.5.16",
29
30
  "detect-libc": "^2.0.3",
30
31
  "rename-overwrite": "^6.0.2",
32
+ "ssri": "10.0.5",
31
33
  "tempy": "^1.0.1",
32
- "@pnpm/create-cafs-store": "1000.0.15",
33
- "@pnpm/error": "1000.0.2",
34
- "@pnpm/fetcher-base": "1000.0.12",
35
- "@pnpm/fetching-types": "1000.1.0",
36
- "@pnpm/pick-fetcher": "1000.0.1",
37
- "@pnpm/tarball-fetcher": "1001.0.9"
34
+ "@pnpm/constants": "1001.2.0",
35
+ "@pnpm/create-cafs-store": "1000.0.16",
36
+ "@pnpm/error": "1000.0.3",
37
+ "@pnpm/crypto.shasums-file": "1000.0.0",
38
+ "@pnpm/fetcher-base": "1000.1.0",
39
+ "@pnpm/tarball-fetcher": "1001.0.11",
40
+ "@pnpm/node.resolver": "1000.1.0",
41
+ "@pnpm/worker": "1000.1.10",
42
+ "@pnpm/fetching-types": "1000.2.0"
38
43
  },
39
44
  "devDependencies": {
40
45
  "@types/adm-zip": "^0.5.7",
46
+ "@types/ssri": "^7.1.5",
41
47
  "node-fetch": "npm:@pnpm/node-fetch@1.0.0",
48
+ "@pnpm/node.fetcher": "1000.1.0",
42
49
  "@pnpm/cafs-types": "1000.0.0",
43
- "@pnpm/node.fetcher": "1000.0.19",
44
- "@pnpm/prepare": "0.0.121"
50
+ "@pnpm/prepare": "0.0.122"
45
51
  },
46
52
  "engines": {
47
53
  "node": ">=18.12"
@@ -1,4 +0,0 @@
1
- export declare function getNodeTarball(nodeVersion: string, nodeMirror: string, processPlatform: string, processArch: string): {
2
- pkgName: string;
3
- tarball: string;
4
- };
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getNodeTarball = getNodeTarball;
4
- const normalizeArch_1 = require("./normalizeArch");
5
- function getNodeTarball(nodeVersion, nodeMirror, processPlatform, processArch) {
6
- const platform = processPlatform === 'win32' ? 'win' : processPlatform;
7
- const arch = (0, normalizeArch_1.getNormalizedArch)(processPlatform, processArch, nodeVersion);
8
- const extension = platform === 'win' ? 'zip' : 'tar.gz';
9
- const pkgName = `node-v${nodeVersion}-${platform}-${arch}`;
10
- return {
11
- pkgName,
12
- tarball: `${nodeMirror}v${nodeVersion}/${pkgName}.${extension}`,
13
- };
14
- }
15
- //# sourceMappingURL=getNodeTarball.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getNodeTarball.js","sourceRoot":"","sources":["../src/getNodeTarball.ts"],"names":[],"mappings":";;AAEA,wCAcC;AAhBD,mDAAmD;AAEnD,SAAgB,cAAc,CAC5B,WAAmB,EACnB,UAAkB,EAClB,eAAuB,EACvB,WAAmB;IAEnB,MAAM,QAAQ,GAAG,eAAe,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,CAAA;IACtE,MAAM,IAAI,GAAG,IAAA,iCAAiB,EAAC,eAAe,EAAE,WAAW,EAAE,WAAW,CAAC,CAAA;IACzE,MAAM,SAAS,GAAG,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAA;IACvD,MAAM,OAAO,GAAG,SAAS,WAAW,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAA;IAC1D,OAAO;QACL,OAAO;QACP,OAAO,EAAE,GAAG,UAAU,IAAI,WAAW,IAAI,OAAO,IAAI,SAAS,EAAE;KAChE,CAAA;AACH,CAAC"}