@pnpm/node.fetcher 1000.1.0 → 1001.0.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.
- package/lib/index.d.ts +0 -8
- package/lib/index.js +8 -141
- package/lib/index.js.map +1 -1
- package/package.json +12 -18
- package/lib/getNodeArtifactAddress.d.ts +0 -12
- package/lib/getNodeArtifactAddress.js +0 -15
- package/lib/getNodeArtifactAddress.js.map +0 -1
- package/lib/normalizeArch.d.ts +0 -1
- package/lib/normalizeArch.js +0 -19
- package/lib/normalizeArch.js.map +0 -1
package/lib/index.d.ts
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { type FetchFromRegistry, type RetryTimeoutOptions } from '@pnpm/fetching-types';
|
|
2
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
3
|
export interface FetchNodeOptionsToDir {
|
|
12
4
|
storeDir: string;
|
|
13
5
|
fetchTimeout?: number;
|
package/lib/index.js
CHANGED
|
@@ -3,67 +3,15 @@ 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;
|
|
7
6
|
exports.fetchNode = fetchNode;
|
|
8
|
-
const promises_1 = __importDefault(require("fs/promises"));
|
|
9
7
|
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const constants_1 = require("@pnpm/constants");
|
|
11
8
|
const error_1 = require("@pnpm/error");
|
|
12
9
|
const crypto_shasums_file_1 = require("@pnpm/crypto.shasums-file");
|
|
13
10
|
const create_cafs_store_1 = require("@pnpm/create-cafs-store");
|
|
14
11
|
const tarball_fetcher_1 = require("@pnpm/tarball-fetcher");
|
|
15
12
|
const node_resolver_1 = require("@pnpm/node.resolver");
|
|
16
|
-
const
|
|
17
|
-
const adm_zip_1 = __importDefault(require("adm-zip"));
|
|
18
|
-
const rename_overwrite_1 = __importDefault(require("rename-overwrite"));
|
|
19
|
-
const tempy_1 = __importDefault(require("tempy"));
|
|
13
|
+
const fetching_binary_fetcher_1 = require("@pnpm/fetching.binary-fetcher");
|
|
20
14
|
const detect_libc_1 = require("detect-libc");
|
|
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
15
|
// Constants
|
|
68
16
|
const DEFAULT_NODE_MIRROR_BASE_URL = 'https://nodejs.org/download/release/';
|
|
69
17
|
/**
|
|
@@ -80,7 +28,7 @@ async function fetchNode(fetch, version, targetDir, opts) {
|
|
|
80
28
|
const nodeMirrorBaseUrl = opts.nodeMirrorBaseUrl ?? DEFAULT_NODE_MIRROR_BASE_URL;
|
|
81
29
|
const artifactInfo = await getNodeArtifactInfo(fetch, version, { nodeMirrorBaseUrl });
|
|
82
30
|
if (artifactInfo.isZip) {
|
|
83
|
-
await downloadAndUnpackZip(fetch, artifactInfo, targetDir);
|
|
31
|
+
await (0, fetching_binary_fetcher_1.downloadAndUnpackZip)(fetch, artifactInfo, targetDir);
|
|
84
32
|
return;
|
|
85
33
|
}
|
|
86
34
|
await downloadAndUnpackTarballToDir(fetch, artifactInfo, targetDir, opts);
|
|
@@ -105,7 +53,7 @@ async function validateSystemCompatibility() {
|
|
|
105
53
|
* @throws {PnpmError} When integrity file cannot be fetched or parsed
|
|
106
54
|
*/
|
|
107
55
|
async function getNodeArtifactInfo(fetch, version, opts) {
|
|
108
|
-
const tarball = (0,
|
|
56
|
+
const tarball = (0, node_resolver_1.getNodeArtifactAddress)({
|
|
109
57
|
version,
|
|
110
58
|
baseUrl: opts.nodeMirrorBaseUrl,
|
|
111
59
|
platform: process.platform,
|
|
@@ -114,11 +62,9 @@ async function getNodeArtifactInfo(fetch, version, opts) {
|
|
|
114
62
|
const tarballFileName = `${tarball.basename}${tarball.extname}`;
|
|
115
63
|
const shasumsFileUrl = `${tarball.dirname}/SHASUMS256.txt`;
|
|
116
64
|
const url = `${tarball.dirname}/${tarballFileName}`;
|
|
117
|
-
const integrity = opts.
|
|
118
|
-
?
|
|
119
|
-
: await loadArtifactIntegrity(fetch, tarballFileName, shasumsFileUrl
|
|
120
|
-
expectedVersionIntegrity: opts.expectedVersionIntegrity,
|
|
121
|
-
});
|
|
65
|
+
const integrity = opts.integrities
|
|
66
|
+
? opts.integrities[`${process.platform}-${process.arch}`]
|
|
67
|
+
: await loadArtifactIntegrity(fetch, tarballFileName, shasumsFileUrl);
|
|
122
68
|
return {
|
|
123
69
|
url,
|
|
124
70
|
integrity,
|
|
@@ -136,8 +82,8 @@ async function getNodeArtifactInfo(fetch, version, opts) {
|
|
|
136
82
|
* @returns Promise resolving to the integrity hash in base64 format
|
|
137
83
|
* @throws {PnpmError} When integrity file cannot be fetched or parsed
|
|
138
84
|
*/
|
|
139
|
-
async function loadArtifactIntegrity(fetch, fileName, shasumsUrl
|
|
140
|
-
const body = await (0, crypto_shasums_file_1.
|
|
85
|
+
async function loadArtifactIntegrity(fetch, fileName, shasumsUrl) {
|
|
86
|
+
const body = await (0, crypto_shasums_file_1.fetchShasumsFileRaw)(fetch, shasumsUrl);
|
|
141
87
|
return (0, crypto_shasums_file_1.pickFileChecksumFromShasumsFile)(body, fileName);
|
|
142
88
|
}
|
|
143
89
|
/**
|
|
@@ -178,83 +124,4 @@ async function downloadAndUnpackTarballToDir(fetch, artifactInfo, targetDir, opt
|
|
|
178
124
|
force: true,
|
|
179
125
|
});
|
|
180
126
|
}
|
|
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: {},
|
|
197
|
-
});
|
|
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);
|
|
255
|
-
const nodeDir = path_1.default.dirname(targetDir);
|
|
256
|
-
const extractedDir = path_1.default.join(nodeDir, basename);
|
|
257
|
-
zip.extractAllTo(nodeDir, true);
|
|
258
|
-
await (0, rename_overwrite_1.default)(extractedDir, targetDir);
|
|
259
|
-
}
|
|
260
127
|
//# 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":";;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/node.fetcher",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1001.0.0",
|
|
4
4
|
"description": "Node.js artifacts fetcher",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -26,28 +26,22 @@
|
|
|
26
26
|
"!*.map"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"adm-zip": "^0.5.16",
|
|
30
29
|
"detect-libc": "^2.0.3",
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"@pnpm/
|
|
35
|
-
"@pnpm/
|
|
36
|
-
"@pnpm/
|
|
37
|
-
"@pnpm/
|
|
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"
|
|
30
|
+
"@pnpm/create-cafs-store": "1000.0.17",
|
|
31
|
+
"@pnpm/crypto.shasums-file": "1001.0.0",
|
|
32
|
+
"@pnpm/error": "1000.0.4",
|
|
33
|
+
"@pnpm/fetching-types": "1000.2.0",
|
|
34
|
+
"@pnpm/fetching.binary-fetcher": "1000.0.0",
|
|
35
|
+
"@pnpm/node.resolver": "1001.0.0",
|
|
36
|
+
"@pnpm/tarball-fetcher": "1001.0.12"
|
|
43
37
|
},
|
|
44
38
|
"devDependencies": {
|
|
45
39
|
"@types/adm-zip": "^0.5.7",
|
|
46
|
-
"
|
|
40
|
+
"adm-zip": "^0.5.16",
|
|
47
41
|
"node-fetch": "npm:@pnpm/node-fetch@1.0.0",
|
|
48
|
-
"@pnpm/node.fetcher": "
|
|
49
|
-
"@pnpm/
|
|
50
|
-
"@pnpm/
|
|
42
|
+
"@pnpm/node.fetcher": "1001.0.0",
|
|
43
|
+
"@pnpm/prepare": "0.0.123",
|
|
44
|
+
"@pnpm/cafs-types": "1000.0.0"
|
|
51
45
|
},
|
|
52
46
|
"engines": {
|
|
53
47
|
"node": ">=18.12"
|
|
@@ -1,12 +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
|
-
}
|
|
12
|
-
export declare function getNodeArtifactAddress({ version, baseUrl, platform, arch, }: GetNodeArtifactAddressOptions): NodeArtifactAddress;
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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/normalizeArch.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getNormalizedArch(platform: string, arch: string, nodeVersion?: string): string;
|
package/lib/normalizeArch.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getNormalizedArch = getNormalizedArch;
|
|
4
|
-
function getNormalizedArch(platform, arch, nodeVersion) {
|
|
5
|
-
if (nodeVersion) {
|
|
6
|
-
const nodeMajorVersion = +nodeVersion.split('.')[0];
|
|
7
|
-
if ((platform === 'darwin' && arch === 'arm64' && (nodeMajorVersion < 16))) {
|
|
8
|
-
return 'x64';
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
if (platform === 'win32' && arch === 'ia32') {
|
|
12
|
-
return 'x86';
|
|
13
|
-
}
|
|
14
|
-
if (arch === 'arm') {
|
|
15
|
-
return 'armv7l';
|
|
16
|
-
}
|
|
17
|
-
return arch;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=normalizeArch.js.map
|
package/lib/normalizeArch.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"normalizeArch.js","sourceRoot":"","sources":["../src/normalizeArch.ts"],"names":[],"mappings":";;AAAA,8CAcC;AAdD,SAAgB,iBAAiB,CAAE,QAAgB,EAAE,IAAY,EAAE,WAAoB;IACrF,IAAI,WAAW,EAAE,CAAC;QAChB,MAAM,gBAAgB,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;QACnD,IAAI,CAAC,QAAQ,KAAK,QAAQ,IAAI,IAAI,KAAK,OAAO,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;YAC3E,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC;IACD,IAAI,QAAQ,KAAK,OAAO,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QAC5C,OAAO,KAAK,CAAA;IACd,CAAC;IACD,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;QACnB,OAAO,QAAQ,CAAA;IACjB,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|