@yao-pkg/pkg-fetch 3.5.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.
@@ -0,0 +1,436 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ return new (P || (P = Promise))(function (resolve, reject) {
16
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20
+ });
21
+ };
22
+ var __generator = (this && this.__generator) || function (thisArg, body) {
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
+ function verb(n) { return function (v) { return step([n, v]); }; }
26
+ function step(op) {
27
+ if (f) throw new TypeError("Generator is already executing.");
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
+ if (y = 0, t) op = [op[0] & 2, t.value];
31
+ switch (op[0]) {
32
+ case 0: case 1: t = op; break;
33
+ case 4: _.label++; return { value: op[1], done: false };
34
+ case 5: _.label++; y = op[1]; op = [0]; continue;
35
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
+ default:
37
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
+ if (t[2]) _.ops.pop();
42
+ _.trys.pop(); continue;
43
+ }
44
+ op = body.call(thisArg, _);
45
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
+ }
48
+ };
49
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
50
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
51
+ if (ar || !(i in from)) {
52
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
53
+ ar[i] = from[i];
54
+ }
55
+ }
56
+ return to.concat(ar || Array.prototype.slice.call(from));
57
+ };
58
+ var __importDefault = (this && this.__importDefault) || function (mod) {
59
+ return (mod && mod.__esModule) ? mod : { "default": mod };
60
+ };
61
+ Object.defineProperty(exports, "__esModule", { value: true });
62
+ exports.prepBuildPath = exports.fetchExtractApply = void 0;
63
+ var zlib_1 = require("zlib");
64
+ var crypto_1 = __importDefault(require("crypto"));
65
+ var fs_extra_1 = __importDefault(require("fs-extra"));
66
+ var os_1 = __importDefault(require("os"));
67
+ var path_1 = __importDefault(require("path"));
68
+ var stream_1 = require("stream");
69
+ var util_1 = require("util");
70
+ var tar_fs_1 = __importDefault(require("tar-fs"));
71
+ var places_1 = require("./places");
72
+ var utils_1 = require("./utils");
73
+ var system_1 = require("./system");
74
+ var log_1 = require("./log");
75
+ var patches_json_1 = __importDefault(require("../patches/patches.json"));
76
+ var buildPath = path_1.default.resolve(process.env.PKG_BUILD_PATH ||
77
+ path_1.default.join(os_1.default.tmpdir(), "pkg.".concat(crypto_1.default.randomBytes(12).toString('hex'))));
78
+ var nodePath = path_1.default.join(buildPath, 'node');
79
+ var patchesPath = path_1.default.resolve(__dirname, '../patches');
80
+ var nodeRepo = 'https://nodejs.org/dist';
81
+ var nodeArchivePath = path_1.default.join(places_1.cachePath, 'node');
82
+ function getMajor(nodeVersion) {
83
+ var _a = nodeVersion.match(/^v?(\d+)/) || ['', 0], version = _a[1];
84
+ return Number(version) | 0;
85
+ }
86
+ function getConfigureArgs(major, targetPlatform) {
87
+ var args = [];
88
+ // first of all v8_inspector introduces the use
89
+ // of `prime_rehash_policy` symbol that requires
90
+ // GLIBCXX_3.4.18 on some systems
91
+ // also we don't support any kind of debugging
92
+ // against packaged apps, hence v8_inspector is useless
93
+ args.push('--without-inspector');
94
+ if (system_1.hostPlatform === 'alpine') {
95
+ // Statically Link against libgcc and libstdc++ libraries. See vercel/pkg#555.
96
+ // libgcc and libstdc++ grant GCC Runtime Library Exception of GPL
97
+ args.push('--partly-static');
98
+ }
99
+ if (targetPlatform === 'linuxstatic') {
100
+ args.push('--fully-static');
101
+ }
102
+ // Link Time Optimization
103
+ if (major >= 12) {
104
+ if (system_1.hostPlatform !== 'win') {
105
+ args.push('--enable-lto');
106
+ }
107
+ }
108
+ // production binaries do NOT take NODE_OPTIONS from end-users
109
+ args.push('--without-node-options');
110
+ // The dtrace and etw support was removed in https://github.com/nodejs/node/commit/aa3a572e6bee116cde69508dc29478b40f40551a
111
+ if (major <= 18) {
112
+ // DTrace
113
+ args.push('--without-dtrace');
114
+ }
115
+ // bundled npm package manager
116
+ args.push('--without-npm');
117
+ // Small ICU
118
+ args.push('--with-intl=small-icu');
119
+ // Workaround for nodejs/node#39313
120
+ // All supported macOS versions have zlib as a system library
121
+ if (targetPlatform === 'macos') {
122
+ args.push('--shared-zlib');
123
+ }
124
+ return args;
125
+ }
126
+ function tarFetch(nodeVersion) {
127
+ return __awaiter(this, void 0, void 0, function () {
128
+ var distUrl, tarName, archivePath, hashPath, _a, _b, _c;
129
+ return __generator(this, function (_d) {
130
+ switch (_d.label) {
131
+ case 0:
132
+ log_1.log.info('Fetching Node.js source archive from nodejs.org...');
133
+ distUrl = "".concat(nodeRepo, "/").concat(nodeVersion);
134
+ tarName = "node-".concat(nodeVersion, ".tar.gz");
135
+ archivePath = path_1.default.join(nodeArchivePath, tarName);
136
+ hashPath = path_1.default.join(nodeArchivePath, "".concat(tarName, ".sha256sum"));
137
+ if (fs_extra_1.default.existsSync(hashPath) && fs_extra_1.default.existsSync(archivePath)) {
138
+ return [2 /*return*/];
139
+ }
140
+ return [4 /*yield*/, fs_extra_1.default.remove(hashPath).catch(function () { return undefined; })];
141
+ case 1:
142
+ _d.sent();
143
+ return [4 /*yield*/, fs_extra_1.default.remove(archivePath).catch(function () { return undefined; })];
144
+ case 2:
145
+ _d.sent();
146
+ return [4 /*yield*/, (0, utils_1.downloadUrl)("".concat(distUrl, "/SHASUMS256.txt"), hashPath)];
147
+ case 3:
148
+ _d.sent();
149
+ _b = (_a = fs_extra_1.default).writeFile;
150
+ _c = [hashPath];
151
+ return [4 /*yield*/, fs_extra_1.default.readFile(hashPath, 'utf8')];
152
+ case 4: return [4 /*yield*/, _b.apply(_a, _c.concat([(_d.sent())
153
+ .split('\n')
154
+ .filter(function (l) { return l.includes(tarName); })[0]]))];
155
+ case 5:
156
+ _d.sent();
157
+ return [4 /*yield*/, (0, utils_1.downloadUrl)("".concat(distUrl, "/").concat(tarName), archivePath)];
158
+ case 6:
159
+ _d.sent();
160
+ return [2 /*return*/];
161
+ }
162
+ });
163
+ });
164
+ }
165
+ function tarExtract(nodeVersion, suppressTarOutput) {
166
+ return __awaiter(this, void 0, void 0, function () {
167
+ var tarName, expectedHash, actualHash, pipe, source, gunzip, extract;
168
+ return __generator(this, function (_a) {
169
+ switch (_a.label) {
170
+ case 0:
171
+ log_1.log.info('Extracting Node.js source archive...');
172
+ tarName = "node-".concat(nodeVersion, ".tar.gz");
173
+ return [4 /*yield*/, fs_extra_1.default.readFile(path_1.default.join(nodeArchivePath, "".concat(tarName, ".sha256sum")), 'utf8')];
174
+ case 1:
175
+ expectedHash = (_a.sent()).split(' ')[0];
176
+ return [4 /*yield*/, (0, utils_1.hash)(path_1.default.join(nodeArchivePath, tarName))];
177
+ case 2:
178
+ actualHash = _a.sent();
179
+ if (!(expectedHash !== actualHash)) return [3 /*break*/, 5];
180
+ return [4 /*yield*/, fs_extra_1.default.remove(path_1.default.join(nodeArchivePath, tarName))];
181
+ case 3:
182
+ _a.sent();
183
+ return [4 /*yield*/, fs_extra_1.default.remove(path_1.default.join(nodeArchivePath, "".concat(tarName, ".sha256sum")))];
184
+ case 4:
185
+ _a.sent();
186
+ throw (0, log_1.wasReported)("Hash mismatch for ".concat(tarName));
187
+ case 5:
188
+ pipe = (0, util_1.promisify)(stream_1.pipeline);
189
+ source = fs_extra_1.default.createReadStream(path_1.default.join(nodeArchivePath, tarName));
190
+ gunzip = (0, zlib_1.createGunzip)();
191
+ extract = tar_fs_1.default.extract(nodePath, {
192
+ strip: 1,
193
+ map: function (header) {
194
+ if (!suppressTarOutput) {
195
+ log_1.log.info(header.name);
196
+ }
197
+ return header;
198
+ },
199
+ });
200
+ return [4 /*yield*/, pipe(source, gunzip, extract)];
201
+ case 6:
202
+ _a.sent();
203
+ return [2 /*return*/];
204
+ }
205
+ });
206
+ });
207
+ }
208
+ function applyPatches(nodeVersion) {
209
+ return __awaiter(this, void 0, void 0, function () {
210
+ var storedPatches, storedPatch, patches, _i, patches_1, patch, patchPath, args;
211
+ return __generator(this, function (_a) {
212
+ switch (_a.label) {
213
+ case 0:
214
+ log_1.log.info('Applying patches');
215
+ storedPatches = patches_json_1.default[nodeVersion];
216
+ storedPatch = 'patches' in storedPatches ? storedPatches.patches : storedPatches;
217
+ patches = 'sameAs' in storedPatch
218
+ ? patches_json_1.default[storedPatch.sameAs]
219
+ : storedPatch;
220
+ _i = 0, patches_1 = patches;
221
+ _a.label = 1;
222
+ case 1:
223
+ if (!(_i < patches_1.length)) return [3 /*break*/, 4];
224
+ patch = patches_1[_i];
225
+ patchPath = path_1.default.join(patchesPath, patch);
226
+ args = ['-p1', '-i', patchPath];
227
+ return [4 /*yield*/, (0, utils_1.spawn)('patch', args, { cwd: nodePath, stdio: 'inherit' })];
228
+ case 2:
229
+ _a.sent();
230
+ _a.label = 3;
231
+ case 3:
232
+ _i++;
233
+ return [3 /*break*/, 1];
234
+ case 4: return [2 /*return*/];
235
+ }
236
+ });
237
+ });
238
+ }
239
+ function fetchExtractApply(nodeVersion, quietExtraction) {
240
+ return __awaiter(this, void 0, void 0, function () {
241
+ return __generator(this, function (_a) {
242
+ switch (_a.label) {
243
+ case 0: return [4 /*yield*/, tarFetch(nodeVersion)];
244
+ case 1:
245
+ _a.sent();
246
+ return [4 /*yield*/, tarExtract(nodeVersion, quietExtraction)];
247
+ case 2:
248
+ _a.sent();
249
+ return [4 /*yield*/, applyPatches(nodeVersion)];
250
+ case 3:
251
+ _a.sent();
252
+ return [2 /*return*/];
253
+ }
254
+ });
255
+ });
256
+ }
257
+ exports.fetchExtractApply = fetchExtractApply;
258
+ function compileOnWindows(nodeVersion, targetArch, targetPlatform) {
259
+ return __awaiter(this, void 0, void 0, function () {
260
+ var args, major, config_flags;
261
+ return __generator(this, function (_a) {
262
+ switch (_a.label) {
263
+ case 0:
264
+ args = ['/c', 'vcbuild.bat', targetArch];
265
+ major = getMajor(nodeVersion);
266
+ config_flags = getConfigureArgs(major, targetPlatform);
267
+ // The dtrace and etw support was removed in https://github.com/nodejs/node/commit/aa3a572e6bee116cde69508dc29478b40f40551a
268
+ if (major <= 18) {
269
+ // Event Tracing for Windows
270
+ args.push('noetw');
271
+ }
272
+ // Performance counters on Windows
273
+ if (major <= 10) {
274
+ args.push('noperfctr');
275
+ }
276
+ // Link Time Code Generation
277
+ if (major >= 12) {
278
+ args.push('ltcg');
279
+ }
280
+ // Can't cross compile for arm64 with small-icu
281
+ if (system_1.hostArch !== targetArch &&
282
+ !config_flags.includes('--with-intl=full-icu')) {
283
+ config_flags.push('--without-intl');
284
+ }
285
+ return [4 /*yield*/, (0, utils_1.spawn)('cmd', args, {
286
+ cwd: nodePath,
287
+ env: __assign(__assign({}, process.env), { config_flags: config_flags.join(' ') }),
288
+ stdio: 'inherit',
289
+ })];
290
+ case 1:
291
+ _a.sent();
292
+ if (major <= 10) {
293
+ return [2 /*return*/, path_1.default.join(nodePath, 'Release/node.exe')];
294
+ }
295
+ return [2 /*return*/, path_1.default.join(nodePath, 'out/Release/node.exe')];
296
+ }
297
+ });
298
+ });
299
+ }
300
+ var _a = process.env.MAKE_JOB_COUNT, MAKE_JOB_COUNT = _a === void 0 ? os_1.default.cpus().length : _a;
301
+ function compileOnUnix(nodeVersion, targetArch, targetPlatform) {
302
+ return __awaiter(this, void 0, void 0, function () {
303
+ var args, cpu, _a, _b, CFLAGS, _c, CXXFLAGS, output;
304
+ return __generator(this, function (_d) {
305
+ switch (_d.label) {
306
+ case 0:
307
+ args = [];
308
+ cpu = {
309
+ x86: 'ia32',
310
+ x64: 'x64',
311
+ armv6: 'arm',
312
+ armv7: 'arm',
313
+ arm64: 'arm64',
314
+ ppc64: 'ppc64',
315
+ s390x: 's390x',
316
+ }[targetArch];
317
+ if (cpu) {
318
+ args.push('--dest-cpu', cpu);
319
+ }
320
+ if (targetArch === 'armv7') {
321
+ _a = process.env, _b = _a.CFLAGS, CFLAGS = _b === void 0 ? '' : _b, _c = _a.CXXFLAGS, CXXFLAGS = _c === void 0 ? '' : _c;
322
+ process.env.CFLAGS = "".concat(CFLAGS, " -marm -mcpu=cortex-a7");
323
+ process.env.CXXFLAGS = "".concat(CXXFLAGS, " -marm -mcpu=cortex-a7");
324
+ args.push('--with-arm-float-abi=hard');
325
+ args.push('--with-arm-fpu=vfpv3');
326
+ }
327
+ if (system_1.hostArch !== targetArch) {
328
+ log_1.log.warn('Cross compiling!');
329
+ log_1.log.warn('You are responsible for appropriate env like CC, CC_host, etc.');
330
+ args.push('--cross-compiling');
331
+ }
332
+ args.push.apply(args, getConfigureArgs(getMajor(nodeVersion), targetPlatform));
333
+ // TODO same for windows?
334
+ return [4 /*yield*/, (0, utils_1.spawn)('/bin/sh', __spreadArray(['./configure'], args, true), {
335
+ cwd: nodePath,
336
+ stdio: 'inherit',
337
+ })];
338
+ case 1:
339
+ // TODO same for windows?
340
+ _d.sent();
341
+ return [4 /*yield*/, (0, utils_1.spawn)(system_1.hostPlatform === 'freebsd' ? 'gmake' : 'make', ['-j', String(MAKE_JOB_COUNT)], {
342
+ cwd: nodePath,
343
+ stdio: 'inherit',
344
+ })];
345
+ case 2:
346
+ _d.sent();
347
+ output = path_1.default.join(nodePath, 'out/Release/node');
348
+ return [4 /*yield*/, (0, utils_1.spawn)(process.env.STRIP || 'strip', __spreadArray(__spreadArray([], (targetPlatform === 'macos' ? ['-x'] : []), true), [output], false), {
349
+ stdio: 'inherit',
350
+ })];
351
+ case 3:
352
+ _d.sent();
353
+ if (!(targetPlatform === 'macos')) return [3 /*break*/, 5];
354
+ // Newer versions of Apple Clang automatically ad-hoc sign the compiled executable.
355
+ // However, for final executable to be signable, base binary MUST NOT have an existing signature.
356
+ return [4 /*yield*/, (0, utils_1.spawn)('codesign', ['--remove-signature', output], {
357
+ stdio: 'inherit',
358
+ })];
359
+ case 4:
360
+ // Newer versions of Apple Clang automatically ad-hoc sign the compiled executable.
361
+ // However, for final executable to be signable, base binary MUST NOT have an existing signature.
362
+ _d.sent();
363
+ _d.label = 5;
364
+ case 5: return [2 /*return*/, output];
365
+ }
366
+ });
367
+ });
368
+ }
369
+ function compile(nodeVersion, targetArch, targetPlatform) {
370
+ return __awaiter(this, void 0, void 0, function () {
371
+ var win;
372
+ return __generator(this, function (_a) {
373
+ log_1.log.info('Compiling Node.js from sources...');
374
+ win = system_1.hostPlatform === 'win';
375
+ if (win) {
376
+ return [2 /*return*/, compileOnWindows(nodeVersion, targetArch, targetPlatform)];
377
+ }
378
+ return [2 /*return*/, compileOnUnix(nodeVersion, targetArch, targetPlatform)];
379
+ });
380
+ });
381
+ }
382
+ function prepBuildPath() {
383
+ return __awaiter(this, void 0, void 0, function () {
384
+ return __generator(this, function (_a) {
385
+ switch (_a.label) {
386
+ case 0: return [4 /*yield*/, fs_extra_1.default.remove(buildPath)];
387
+ case 1:
388
+ _a.sent();
389
+ return [4 /*yield*/, fs_extra_1.default.mkdirp(nodePath)];
390
+ case 2:
391
+ _a.sent();
392
+ return [4 /*yield*/, fs_extra_1.default.mkdirp(nodeArchivePath)];
393
+ case 3:
394
+ _a.sent();
395
+ return [2 /*return*/];
396
+ }
397
+ });
398
+ });
399
+ }
400
+ exports.prepBuildPath = prepBuildPath;
401
+ function build(nodeVersion, targetArch, targetPlatform, local) {
402
+ return __awaiter(this, void 0, void 0, function () {
403
+ var output, outputHash;
404
+ return __generator(this, function (_a) {
405
+ switch (_a.label) {
406
+ case 0: return [4 /*yield*/, prepBuildPath()];
407
+ case 1:
408
+ _a.sent();
409
+ return [4 /*yield*/, fetchExtractApply(nodeVersion, false)];
410
+ case 2:
411
+ _a.sent();
412
+ return [4 /*yield*/, compile(nodeVersion, targetArch, targetPlatform)];
413
+ case 3:
414
+ output = _a.sent();
415
+ return [4 /*yield*/, (0, utils_1.hash)(output)];
416
+ case 4:
417
+ outputHash = _a.sent();
418
+ return [4 /*yield*/, fs_extra_1.default.mkdirp(path_1.default.dirname(local))];
419
+ case 5:
420
+ _a.sent();
421
+ return [4 /*yield*/, fs_extra_1.default.copy(output, local)];
422
+ case 6:
423
+ _a.sent();
424
+ return [4 /*yield*/, fs_extra_1.default.promises.writeFile("".concat(local, ".sha256sum"), "".concat(outputHash, " ").concat(path_1.default.basename(local), "\n"))];
425
+ case 7:
426
+ _a.sent();
427
+ return [4 /*yield*/, fs_extra_1.default.remove(buildPath)];
428
+ case 8:
429
+ _a.sent();
430
+ return [2 /*return*/];
431
+ }
432
+ });
433
+ });
434
+ }
435
+ exports.default = build;
436
+ //# sourceMappingURL=build.js.map
@@ -0,0 +1,67 @@
1
+ {
2
+ "node-v8.17.0-alpine-arm64": "807df81524ec8e1e266ac7fbed434c6b2281ae20b9fa7eaa524de90f3330c4d7",
3
+ "node-v8.17.0-alpine-x64": "83a3914de57ee6be7d68ebaac8a10c1a2972d554800f1bee218cc4a23650e0fb",
4
+ "node-v8.17.0-linux-arm64": "f06855896bfa10bead1f08fac080305fb6fbfb2cc691168a3f0f0e834e12bfba",
5
+ "node-v8.17.0-linux-x64": "14d75d43de1ff86469d354bf42a83b9494e09502fa7bc23a975e2cb82b1608b0",
6
+ "node-v8.17.0-linuxstatic-arm64": "84de8fe30b2bd1dcb3615cf1d1b538aa48e1fcf66620ef97dce6b7ae85b45025",
7
+ "node-v8.17.0-linuxstatic-x64": "5206878079f160e75a02ad33b7559b4a869e8181ee03d51d7211b52995f9ca7b",
8
+ "node-v8.17.0-macos-x64": "dffa71e39100f4daa57de73fda7b4debecd09f552b15cf11854c8475380d3817",
9
+ "node-v8.17.0-win-x64": "4556a06dc59a0196453ba5962ea077ea71fe566e4de1c92f73f057446d422251",
10
+ "node-v10.24.1-alpine-arm64": "f6a59f1ace2ef1f4bf976ff85d9a74bdc71bda098e8aa018e2a089c590aeedea",
11
+ "node-v10.24.1-alpine-x64": "24f862b22a59ac0adb746d5bd3f2226c8eb2f6e1565a1cb4d2418c9cb0f3769e",
12
+ "node-v10.24.1-linux-arm64": "e3a3e5197e3f3d1063e3178786890b29493b8dfc31362f3417cce90ca7eb3e98",
13
+ "node-v10.24.1-linux-x64": "c59574f4ea7b1423bd7ef586887ea41c43cfb2a63431126af0de20291a3a94db",
14
+ "node-v10.24.1-linuxstatic-arm64": "01bc2cfbf7a7dd1a74201ae34a6cfafc1ad1c6d77039f587111738a81637bc5b",
15
+ "node-v10.24.1-linuxstatic-armv7": "4933be03e394a82f5aa5fc4600b29392b2ce7eac24bd2ef8759f9a8e8c841990",
16
+ "node-v10.24.1-linuxstatic-x64": "a7bbd62b712b3a7ac54953b646f0802e84bc7ecadb0b8a0756323fcffe3310a5",
17
+ "node-v10.24.1-macos-x64": "f2e4679262a1cc6f3213cc4f0453d662e48c021975b651534fcbf26d6fdab474",
18
+ "node-v10.24.1-win-x64": "958647af177a9089bb4f3495e352d5348a1b42858d0111004ca26c3a2ece3f73",
19
+ "node-v12.22.11-alpine-arm64": "0933ab559bb34c720f0a7e0066f32608960a4d6290977c3af15529f7abfe7265",
20
+ "node-v12.22.11-alpine-x64": "2ec8d7b761f03b2172bcf3b1b56c648e844116ab08a5484d7932138c374cf18c",
21
+ "node-v12.22.11-linux-arm64": "3a50d85ebd5ba7e1e62165b9df237925789ef9ed0ed92fd9d0f3a9df7503f751",
22
+ "node-v12.22.11-linux-x64": "617d58e81711d3a1d34a737db39e751caa05040a1a586e6dd688241cfb3f3eed",
23
+ "node-v12.22.11-linuxstatic-arm64": "0c5b03cbe32ce50f16dbb35769a2a897b30e8fdb2137c4799edb55898b475622",
24
+ "node-v12.22.11-linuxstatic-x64": "37714fc3ae8b1d0c92b124f8ab353c77e40494075646e43ce8e20bd4038b5b83",
25
+ "node-v12.22.11-macos-x64": "5394093f0fd2bb5ea38ee2a5eaec9e00d3d1da9e3f7c3c99c68eecfe17354286",
26
+ "node-v12.22.11-win-x64": "24bedd07eb0cad64d505ec731c438765370bbed32d8e1f47129fe3612fadfcdb",
27
+ "node-v14.21.3-alpine-arm64": "801f71544a48e92554d61291b63ed8addd19921075826d0ef299819a9300f996",
28
+ "node-v14.21.3-alpine-x64": "62882ceabf13342eb51c5323a11e4be736bec651646071adf93e40fd02125919",
29
+ "node-v14.21.3-linux-arm64": "a4c46261e179775268528f0693be44922768cff96afe5f194748c519405fcec4",
30
+ "node-v14.21.3-linux-x64": "b0b1fbf8e0caa5483f5538fccc90d9c681824c26f6b3008dacc5b6928881bf39",
31
+ "node-v14.21.3-linuxstatic-arm64": "d14f9dccf9c861a14a4491a8f5796c3a8cce914d36a8b802b7b72bd4dd1acb1a",
32
+ "node-v14.21.3-linuxstatic-armv7": "183dd014d294ad418fb0902d3fa91dc5d780b4ae5e2e58bd77c52c60fc79be3f",
33
+ "node-v14.21.3-linuxstatic-x64": "b941d79858ac45ce1400439d32fd5eba6d339417ff341491a78b5ad6fe799450",
34
+ "node-v14.21.3-macos-x64": "0cff926be3b4d4ef31b2daac7c8b191c2bcc961ea90692c2c245d9a694c98832",
35
+ "node-v14.21.3-win-arm64": "dfb0f0b94d50f0530aefe93b6333c4caeec34c683c29f9631555c1501d80cc98",
36
+ "node-v14.21.3-win-x64": "223dc070ebf5d4528ac2f276ddf69bc83f58e68e2cc9067020c62c07d5ad4e90",
37
+ "node-v16.19.1-alpine-arm64": "3020ec066271c71d72479181ac7ec24b5186df61e16b682fb7b060ad2a9a363a",
38
+ "node-v16.19.1-alpine-x64": "38e6561457ee35634a071417b1234ce0e7694e45088763a4da5de915fbb02f68",
39
+ "node-v16.19.1-linux-arm64": "98f0dda14f5037dafb35617de34c1f772f2b3c2e04955be62cdf125100d0962c",
40
+ "node-v16.19.1-linux-x64": "07e151674f4f4a2c6641b8c818f258067f1dbd8d68f3648663c606afea34e576",
41
+ "node-v16.19.1-linuxstatic-arm64": "2c40b15e6a3d40ae822bbefe5b269e15a30952be793a30a418b87eae7c1ebdff",
42
+ "node-v16.19.1-linuxstatic-armv7": "8dd5d18557fb602070d1eca72a5b73d3b8167e6f3c951e0bd6aed5376597c31d",
43
+ "node-v16.19.1-linuxstatic-x64": "f4ac69917aca69694101cda07902dff6d5f99bd2e62e6f72dedd045e67f11066",
44
+ "node-v16.19.1-macos-x64": "9396df4caf2fdbc40bf878ef44a73e09aac6e13411dccbd8bb9b63b5a4517ca7",
45
+ "node-v16.19.1-win-arm64": "a2901e03d4e3f2cfded37598160075a8867fc4147a71984477cf72250ae292db",
46
+ "node-v16.19.1-win-x64": "549e8bd07950d58a325938d004936f43a99a6bcc12139ced6a2d67f6b09470c1",
47
+ "node-v18.15.0-alpine-arm64": "cc758d91840c5a8893fcd7f696be38aa227e5e6036b28aeb29ebbe9efe4c55ef",
48
+ "node-v18.15.0-alpine-x64": "be0b5f11290adb0eae8ab32907dae1334ee43d3023bb9870eb98515a47aa7031",
49
+ "node-v18.15.0-linux-arm64": "d4420e35dd1075a23db48874d14a596503e4c7223e515b620b5036b2916ab128",
50
+ "node-v18.15.0-linux-x64": "a4735a8e58c7269985c15cb9b36a700cf778e720828ee79ce6ed45982e42993e",
51
+ "node-v18.15.0-linuxstatic-arm64": "60d4ac648a0782f6d8e83b79262ca7ead87f04cb2f9dce187c1e90827c4fadbe",
52
+ "node-v18.15.0-linuxstatic-armv7": "3cc2753714271de3eb02e584ffa199ba33a3f72ed22647900a4c85d743c39272",
53
+ "node-v18.15.0-linuxstatic-x64": "7a2dde6a5e1e9f711d100d0ae019ba785de5968bb3daa4ae658135f766f667c1",
54
+ "node-v18.15.0-macos-x64": "13cc043442af8f110836e7a4abcfc4ba5cf1d9568564485f018fd93d688291e1",
55
+ "node-v18.15.0-win-arm64": "d66ac1fc6bfeb25dc538f13e284d71b12684d02913eb5e666d21b2b245ffac74",
56
+ "node-v18.15.0-win-x64": "1729a85e503f54ba5345d8ff10552e8706fb231f7be635e67367cb5205e0a1b4",
57
+ "node-v19.8.1-alpine-arm64": "2c93c7b842be25bc6110b31278da9fd5699a42323d9e869b3d5019e15ba6724c",
58
+ "node-v19.8.1-alpine-x64": "5d7944fe93d3221ca4c4a3651af2af79349a2a5b9c424c12867f44d14feefe6d",
59
+ "node-v19.8.1-linux-arm64": "2ca0a267ca5fd44e29fef5a4c205e49af98a623d959958c3e66f1cf5d291bb1b",
60
+ "node-v19.8.1-linux-x64": "0060edcd98f924dcac284841d941ce7aabc39ef1fd08c068ec4e24acaaa16220",
61
+ "node-v19.8.1-linuxstatic-arm64": "7f4d7a8349ca0f6f8e329a86e590b8c2c7936fcfeb33c65c54315c6e534eb6c0",
62
+ "node-v19.8.1-linuxstatic-armv7": "0a4b44593c11a7c5161556a35c63a83581b6fd93ab1360d4f37cdb1d642d57ed",
63
+ "node-v19.8.1-linuxstatic-x64": "f995f279381bb4ff5f74f3a14086c5a3cfaa9caab60bcdf6d5278479140e3760",
64
+ "node-v19.8.1-macos-x64": "df526135f58d3728f603daefc75e5173e0eb03b2cdf4341bf3bcdbd236705ae0",
65
+ "node-v19.8.1-win-arm64": "69dc4c5ae7e590282c57f85db5ef9109437b600fdebdd64927a44567a8b926af",
66
+ "node-v19.8.1-win-x64": "bc60b74070057e830e9d5f2d16dfae78e2a1faed9bf29fd8e55c81da21cd0309"
67
+ }
@@ -0,0 +1,2 @@
1
+ export declare const EXPECTED_HASHES: Record<string, string>;
2
+ //# sourceMappingURL=expected.d.ts.map
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.EXPECTED_HASHES = void 0;
7
+ var expected_shas_json_1 = __importDefault(require("./expected-shas.json"));
8
+ exports.EXPECTED_HASHES = expected_shas_json_1.default;
9
+ //# sourceMappingURL=expected.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generate-expected-shas.d.ts.map
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ var yargs_1 = __importDefault(require("yargs"));
43
+ var fs_1 = require("fs");
44
+ var path_1 = require("path");
45
+ var log_1 = require("./log");
46
+ var package_json_1 = require("../package.json");
47
+ var utils_1 = require("./utils");
48
+ function main() {
49
+ return __awaiter(this, void 0, void 0, function () {
50
+ var argv, shaFileContent, shaMap, _i, _a, line, lineParts, sortedShaMap, _b, _c, nodeVersion;
51
+ return __generator(this, function (_d) {
52
+ argv = yargs_1.default
53
+ .option('input', { alias: 'i', default: 'shas.txt', type: 'string' })
54
+ .version(package_json_1.version)
55
+ .alias('v', 'version')
56
+ .help()
57
+ .alias('h', 'help').argv;
58
+ shaFileContent = (0, fs_1.readFileSync)(argv.input).toString();
59
+ shaMap = {};
60
+ for (_i = 0, _a = shaFileContent.split('\n'); _i < _a.length; _i++) {
61
+ line = _a[_i];
62
+ lineParts = line.split(/\s+/);
63
+ if (lineParts.length === 2) {
64
+ // eslint-disable-next-line prefer-destructuring
65
+ shaMap[lineParts[1]] = lineParts[0];
66
+ }
67
+ }
68
+ sortedShaMap = {};
69
+ for (_b = 0, _c = Object.keys(shaMap).sort(utils_1.nodeBinarySortFunction); _b < _c.length; _b++) {
70
+ nodeVersion = _c[_b];
71
+ sortedShaMap[nodeVersion] = shaMap[nodeVersion];
72
+ }
73
+ (0, fs_1.writeFileSync)((0, path_1.join)(__dirname, '../lib/expected-shas.json'), "".concat(JSON.stringify(sortedShaMap, null, 2), "\n"));
74
+ return [2 /*return*/];
75
+ });
76
+ });
77
+ }
78
+ main().catch(function (error) {
79
+ if (!error.wasReported)
80
+ log_1.log.error(error);
81
+ process.exit(2);
82
+ });
83
+ //# sourceMappingURL=generate-expected-shas.js.map
@@ -0,0 +1,15 @@
1
+ import * as system from './system';
2
+ interface NeedOptions {
3
+ forceFetch?: boolean;
4
+ forceBuild?: boolean;
5
+ dryRun?: boolean;
6
+ output?: string;
7
+ nodeRange: string;
8
+ platform: string;
9
+ arch: string;
10
+ }
11
+ export declare function satisfyingNodeVersion(nodeRange: string): string;
12
+ export declare function getNodeVersion(nodeRange: string): string;
13
+ export declare function need(opts: NeedOptions): Promise<string>;
14
+ export { system };
15
+ //# sourceMappingURL=index.d.ts.map