@yao-pkg/pkg-fetch 3.5.30 → 3.5.32

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-es5/utils.js CHANGED
@@ -1,173 +1,105 @@
1
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
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
39
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
40
4
  };
41
5
  Object.defineProperty(exports, "__esModule", { value: true });
42
6
  exports.nodeBinarySortFunction = exports.spawn = exports.plusx = exports.hash = exports.downloadUrl = void 0;
43
- var node_fetch_1 = __importDefault(require("node-fetch"));
44
- var crypto_1 = __importDefault(require("crypto"));
45
- var fs_1 = require("fs");
46
- var promises_1 = require("fs/promises");
47
- var https_proxy_agent_1 = __importDefault(require("https-proxy-agent"));
48
- var path_1 = __importDefault(require("path"));
49
- var child_process_1 = require("child_process");
50
- var stream_1 = __importDefault(require("stream"));
51
- var semver_1 = require("semver");
52
- var log_1 = require("./log");
53
- function downloadUrl(url, file) {
54
- var _a, _b, _c;
55
- return __awaiter(this, void 0, void 0, function () {
56
- var proxy, res, err_1, tempFile, ws, totalSize, currentSize;
57
- return __generator(this, function (_d) {
58
- switch (_d.label) {
59
- case 0:
60
- log_1.log.enableProgress(path_1.default.basename(file));
61
- log_1.log.showProgress(0);
62
- proxy = (_c = (_b = (_a = process.env.HTTPS_PROXY) !== null && _a !== void 0 ? _a : process.env.https_proxy) !== null && _b !== void 0 ? _b : process.env.HTTP_PROXY) !== null && _c !== void 0 ? _c : process.env.http_proxy;
63
- _d.label = 1;
64
- case 1:
65
- _d.trys.push([1, 3, , 4]);
66
- return [4 /*yield*/, (0, node_fetch_1.default)(url, proxy ? { agent: (0, https_proxy_agent_1.default)(proxy) } : undefined)];
67
- case 2:
68
- res = _d.sent();
69
- return [3 /*break*/, 4];
70
- case 3:
71
- err_1 = _d.sent();
72
- log_1.log.disableProgress();
73
- throw (0, log_1.wasReported)("Network error during fetch: ".concat(err_1.message));
74
- case 4:
75
- if (!res.ok) {
76
- log_1.log.disableProgress();
77
- throw (0, log_1.wasReported)("".concat(res.status, ": ").concat(res.statusText));
78
- }
79
- tempFile = "".concat(file, ".downloading");
80
- (0, fs_1.mkdirSync)(path_1.default.dirname(tempFile), { recursive: true });
81
- ws = (0, fs_1.createWriteStream)(tempFile);
82
- totalSize = Number(res.headers.get('content-length'));
83
- currentSize = 0;
84
- res.body.on('data', function (chunk) {
85
- if (totalSize != null && totalSize !== 0) {
86
- currentSize += chunk.length;
87
- log_1.log.showProgress((currentSize / totalSize) * 100);
88
- }
89
- });
90
- res.body.pipe(ws);
91
- return [2 /*return*/, new Promise(function (resolve, reject) {
92
- stream_1.default.finished(ws, function (err) {
93
- if (err) {
94
- log_1.log.disableProgress();
95
- (0, fs_1.rmSync)(tempFile);
96
- reject((0, log_1.wasReported)("".concat(err.name, ": ").concat(err.message)));
97
- }
98
- else {
99
- log_1.log.showProgress(100);
100
- log_1.log.disableProgress();
101
- (0, fs_1.renameSync)(tempFile, file);
102
- resolve();
103
- }
104
- });
105
- })];
7
+ const node_fetch_1 = __importDefault(require("node-fetch"));
8
+ const crypto_1 = __importDefault(require("crypto"));
9
+ const fs_1 = require("fs");
10
+ const promises_1 = require("fs/promises");
11
+ const https_proxy_agent_1 = __importDefault(require("https-proxy-agent"));
12
+ const path_1 = __importDefault(require("path"));
13
+ const child_process_1 = require("child_process");
14
+ const stream_1 = __importDefault(require("stream"));
15
+ const semver_1 = require("semver");
16
+ const log_1 = require("./log");
17
+ async function downloadUrl(url, file) {
18
+ log_1.log.enableProgress(path_1.default.basename(file));
19
+ log_1.log.showProgress(0);
20
+ const proxy = process.env.HTTPS_PROXY ??
21
+ process.env.https_proxy ??
22
+ process.env.HTTP_PROXY ??
23
+ process.env.http_proxy;
24
+ let res;
25
+ try {
26
+ res = await (0, node_fetch_1.default)(url, proxy ? { agent: (0, https_proxy_agent_1.default)(proxy) } : undefined);
27
+ }
28
+ catch (err) {
29
+ log_1.log.disableProgress();
30
+ throw (0, log_1.wasReported)(`Network error during fetch: ${err.message}`);
31
+ }
32
+ if (!res.ok) {
33
+ log_1.log.disableProgress();
34
+ throw (0, log_1.wasReported)(`${res.status}: ${res.statusText}`);
35
+ }
36
+ const tempFile = `${file}.downloading`;
37
+ (0, fs_1.mkdirSync)(path_1.default.dirname(tempFile), { recursive: true });
38
+ const ws = (0, fs_1.createWriteStream)(tempFile);
39
+ const totalSize = Number(res.headers.get('content-length'));
40
+ let currentSize = 0;
41
+ res.body.on('data', (chunk) => {
42
+ if (totalSize != null && totalSize !== 0) {
43
+ currentSize += chunk.length;
44
+ log_1.log.showProgress((currentSize / totalSize) * 100);
45
+ }
46
+ });
47
+ res.body.pipe(ws);
48
+ return new Promise((resolve, reject) => {
49
+ stream_1.default.finished(ws, (err) => {
50
+ if (err) {
51
+ log_1.log.disableProgress();
52
+ (0, fs_1.rmSync)(tempFile);
53
+ reject((0, log_1.wasReported)(`${err.name}: ${err.message}`));
54
+ }
55
+ else {
56
+ log_1.log.showProgress(100);
57
+ log_1.log.disableProgress();
58
+ (0, fs_1.renameSync)(tempFile, file);
59
+ resolve();
106
60
  }
107
61
  });
108
62
  });
109
63
  }
110
64
  exports.downloadUrl = downloadUrl;
111
- function hash(filePath) {
112
- return __awaiter(this, void 0, void 0, function () {
113
- return __generator(this, function (_a) {
114
- return [2 /*return*/, new Promise(function (resolve, reject) {
115
- var resultHash = crypto_1.default.createHash('sha256');
116
- var input = (0, fs_1.createReadStream)(filePath);
117
- input.on('error', function (e) {
118
- reject(e);
119
- });
120
- input.on('readable', function () {
121
- var data = input.read();
122
- if (data) {
123
- resultHash.update(data);
124
- }
125
- else {
126
- resolve(resultHash.digest('hex'));
127
- }
128
- });
129
- })];
65
+ async function hash(filePath) {
66
+ return new Promise((resolve, reject) => {
67
+ const resultHash = crypto_1.default.createHash('sha256');
68
+ const input = (0, fs_1.createReadStream)(filePath);
69
+ input.on('error', (e) => {
70
+ reject(e);
130
71
  });
131
- });
132
- }
133
- exports.hash = hash;
134
- function plusx(file) {
135
- return __awaiter(this, void 0, void 0, function () {
136
- var s, newMode, base8;
137
- return __generator(this, function (_a) {
138
- switch (_a.label) {
139
- case 0: return [4 /*yield*/, (0, promises_1.stat)(file)];
140
- case 1:
141
- s = _a.sent();
142
- newMode = s.mode | 64 | 8 | 1;
143
- if (s.mode === newMode)
144
- return [2 /*return*/];
145
- base8 = newMode.toString(8).slice(-3);
146
- return [4 /*yield*/, (0, promises_1.chmod)(file, base8)];
147
- case 2:
148
- _a.sent();
149
- return [2 /*return*/];
72
+ input.on('readable', () => {
73
+ const data = input.read();
74
+ if (data) {
75
+ resultHash.update(data);
76
+ }
77
+ else {
78
+ resolve(resultHash.digest('hex'));
150
79
  }
151
80
  });
152
81
  });
153
82
  }
83
+ exports.hash = hash;
84
+ async function plusx(file) {
85
+ const s = await (0, promises_1.stat)(file);
86
+ const newMode = s.mode | 64 | 8 | 1;
87
+ if (s.mode === newMode)
88
+ return;
89
+ const base8 = newMode.toString(8).slice(-3);
90
+ await (0, promises_1.chmod)(file, base8);
91
+ }
154
92
  exports.plusx = plusx;
155
- function spawn(command, args, options) {
156
- return __awaiter(this, void 0, void 0, function () {
157
- var error;
158
- return __generator(this, function (_a) {
159
- error = (0, child_process_1.spawnSync)(command, args, options).error;
160
- if (error) {
161
- throw error;
162
- }
163
- return [2 /*return*/];
164
- });
165
- });
93
+ async function spawn(command, args, options) {
94
+ const { error } = (0, child_process_1.spawnSync)(command, args, options);
95
+ if (error) {
96
+ throw error;
97
+ }
166
98
  }
167
99
  exports.spawn = spawn;
168
100
  function nodeBinarySortFunction(a, b) {
169
- var coercedVersionA = (0, semver_1.coerce)(a);
170
- var coercedVersionB = (0, semver_1.coerce)(b);
101
+ const coercedVersionA = (0, semver_1.coerce)(a);
102
+ const coercedVersionB = (0, semver_1.coerce)(b);
171
103
  if (coercedVersionA && coercedVersionB) {
172
104
  return coercedVersionA.compare(coercedVersionB);
173
105
  }
package/lib-es5/verify.js CHANGED
@@ -1,59 +1,124 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
39
3
  exports.verify = void 0;
40
- var child_process_1 = require("child_process");
41
- var utils_1 = require("./utils");
42
- var script = "\n var vm = require('vm');\n var assert = require('assert');\n var text = '(function () { return 42; })';\n var cd, fn, result;\n var modules = process.versions.modules | 0;\n var v8 = process.versions.v8.split('.').slice(0, 2).join('.');\n\n var s1 = new vm.Script(text, { filename: 's1', produceCachedData: true, sourceless: true });\n assert(s1.cachedDataProduced);\n cd = s1.cachedData;\n\n var kCpuFeaturesOffset, cpuFeatures;\n\n if (modules === 14) {\n } else\n if (modules === 46 || modules === 48 || modules === 51) {\n kCpuFeaturesOffset = 0x0c;\n } else\n if (modules === 57) {\n if (v8 === '6.2') {\n kCpuFeaturesOffset = 0x0c;\n } else\n if (v8 === '5.8') {\n kCpuFeaturesOffset = 0x0c;\n } else {\n kCpuFeaturesOffset = 0x10;\n }\n } else\n if (modules === 59) {\n kCpuFeaturesOffset = 0x0c;\n } else\n if (modules === 64) {\n kCpuFeaturesOffset = 0x0c;\n } else\n if (modules === 72) {\n // no cpu features anymore\n } else\n if (modules === 79) {\n // no cpu features anymore\n } else\n if (modules === 83) {\n // no cpu features anymore\n } else\n if (modules === 93) {\n // no cpu features anymore\n } else\n if (modules === 108) {\n // no cpu features anymore\n } else\n if (modules === 111) {\n // no cpu features anymore\n } else\n if (modules === 115) {\n // no cpu features anymore\n } else {\n assert(false, modules);\n }\n\n if (modules >= 46 && // no cpu_features field in 0.12\n process.arch !== 'arm' && // non-zero features even in sourceless mode in arm\n modules < 72) { // no cpu_features field in 12+\n cpuFeatures = cd.readUInt32LE(kCpuFeaturesOffset);\n assert(cpuFeatures === 0, 'CPU_FEATURES must be zero');\n }\n\n var s2 = new vm.Script(undefined, { filename: 's2', cachedData: cd, sourceless: true });\n fn = s2.runInThisContext();\n result = fn();\n assert.equal(result, 42);\n\n if (modules === 14) {\n } else\n if (modules === 46 || modules === 48 ||\n modules === 51 || modules === 57 || modules === 59 || modules === 64) {\n var paddedPayloadOffset = 0x48; // see SerializedCodeData::Payload()\n var index = paddedPayloadOffset + 10;\n cd[index] ^= 0xf0;\n var s3 = new vm.Script(undefined, { filename: 's3', cachedData: cd, sourceless: true });\n assert(s3.cachedDataRejected, 's3.cachedDataRejected must be true');\n } else\n if (modules === 72) {\n } else\n if (modules === 79) {\n } else\n if (modules === 83) {\n } else\n if (modules === 93) {\n } else\n if (modules === 108) {\n } else\n if (modules === 111) {\n } else\n if (modules === 115) {\n } else {\n assert(false, modules);\n }\n\n var s4 = new vm.Script(text, { filename: 's4', produceCachedData: true });\n assert(s4.cachedDataProduced, 's4.cachedDataProduced must be true');\n cd = s4.cachedData;\n\n if (modules >= 46 && // no cpu_features field in 0.12\n process.arch !== 'arm' && // zero features even in non-sourceless mode in arm\n modules < 72) { // no cpu_features field in 12+\n cpuFeatures = cd.readUInt32LE(kCpuFeaturesOffset);\n assert(cpuFeatures !== 0, 'CPU_FEATURES must be non-zero');\n }\n\n console.log('ok');\n";
43
- function verify(local) {
44
- return __awaiter(this, void 0, void 0, function () {
45
- return __generator(this, function (_a) {
46
- switch (_a.label) {
47
- case 0: return [4 /*yield*/, (0, utils_1.plusx)(local)];
48
- case 1:
49
- _a.sent();
50
- (0, child_process_1.spawnSync)(local, ['-e', script], {
51
- env: { PKG_EXECPATH: 'PKG_INVOKE_NODEJS' },
52
- stdio: 'inherit',
53
- });
54
- return [2 /*return*/];
55
- }
56
- });
4
+ const child_process_1 = require("child_process");
5
+ const utils_1 = require("./utils");
6
+ const script = `
7
+ var vm = require('vm');
8
+ var assert = require('assert');
9
+ var text = '(function () { return 42; })';
10
+ var cd, fn, result;
11
+ var modules = process.versions.modules | 0;
12
+ var v8 = process.versions.v8.split('.').slice(0, 2).join('.');
13
+
14
+ var s1 = new vm.Script(text, { filename: 's1', produceCachedData: true, sourceless: true });
15
+ assert(s1.cachedDataProduced);
16
+ cd = s1.cachedData;
17
+
18
+ var kCpuFeaturesOffset, cpuFeatures;
19
+
20
+ if (modules === 14) {
21
+ } else
22
+ if (modules === 46 || modules === 48 || modules === 51) {
23
+ kCpuFeaturesOffset = 0x0c;
24
+ } else
25
+ if (modules === 57) {
26
+ if (v8 === '6.2') {
27
+ kCpuFeaturesOffset = 0x0c;
28
+ } else
29
+ if (v8 === '5.8') {
30
+ kCpuFeaturesOffset = 0x0c;
31
+ } else {
32
+ kCpuFeaturesOffset = 0x10;
33
+ }
34
+ } else
35
+ if (modules === 59) {
36
+ kCpuFeaturesOffset = 0x0c;
37
+ } else
38
+ if (modules === 64) {
39
+ kCpuFeaturesOffset = 0x0c;
40
+ } else
41
+ if (modules === 72) {
42
+ // no cpu features anymore
43
+ } else
44
+ if (modules === 79) {
45
+ // no cpu features anymore
46
+ } else
47
+ if (modules === 83) {
48
+ // no cpu features anymore
49
+ } else
50
+ if (modules === 93) {
51
+ // no cpu features anymore
52
+ } else
53
+ if (modules === 108) {
54
+ // no cpu features anymore
55
+ } else
56
+ if (modules === 111) {
57
+ // no cpu features anymore
58
+ } else
59
+ if (modules === 115) {
60
+ // no cpu features anymore
61
+ } else {
62
+ assert(false, modules);
63
+ }
64
+
65
+ if (modules >= 46 && // no cpu_features field in 0.12
66
+ process.arch !== 'arm' && // non-zero features even in sourceless mode in arm
67
+ modules < 72) { // no cpu_features field in 12+
68
+ cpuFeatures = cd.readUInt32LE(kCpuFeaturesOffset);
69
+ assert(cpuFeatures === 0, 'CPU_FEATURES must be zero');
70
+ }
71
+
72
+ var s2 = new vm.Script(undefined, { filename: 's2', cachedData: cd, sourceless: true });
73
+ fn = s2.runInThisContext();
74
+ result = fn();
75
+ assert.equal(result, 42);
76
+
77
+ if (modules === 14) {
78
+ } else
79
+ if (modules === 46 || modules === 48 ||
80
+ modules === 51 || modules === 57 || modules === 59 || modules === 64) {
81
+ var paddedPayloadOffset = 0x48; // see SerializedCodeData::Payload()
82
+ var index = paddedPayloadOffset + 10;
83
+ cd[index] ^= 0xf0;
84
+ var s3 = new vm.Script(undefined, { filename: 's3', cachedData: cd, sourceless: true });
85
+ assert(s3.cachedDataRejected, 's3.cachedDataRejected must be true');
86
+ } else
87
+ if (modules === 72) {
88
+ } else
89
+ if (modules === 79) {
90
+ } else
91
+ if (modules === 83) {
92
+ } else
93
+ if (modules === 93) {
94
+ } else
95
+ if (modules === 108) {
96
+ } else
97
+ if (modules === 111) {
98
+ } else
99
+ if (modules === 115) {
100
+ } else {
101
+ assert(false, modules);
102
+ }
103
+
104
+ var s4 = new vm.Script(text, { filename: 's4', produceCachedData: true });
105
+ assert(s4.cachedDataProduced, 's4.cachedDataProduced must be true');
106
+ cd = s4.cachedData;
107
+
108
+ if (modules >= 46 && // no cpu_features field in 0.12
109
+ process.arch !== 'arm' && // zero features even in non-sourceless mode in arm
110
+ modules < 72) { // no cpu_features field in 12+
111
+ cpuFeatures = cd.readUInt32LE(kCpuFeaturesOffset);
112
+ assert(cpuFeatures !== 0, 'CPU_FEATURES must be non-zero');
113
+ }
114
+
115
+ console.log('ok');
116
+ `;
117
+ async function verify(local) {
118
+ await (0, utils_1.plusx)(local);
119
+ (0, child_process_1.spawnSync)(local, ['-e', script], {
120
+ env: { PKG_EXECPATH: 'PKG_INVOKE_NODEJS' },
121
+ stdio: 'inherit',
57
122
  });
58
123
  }
59
124
  exports.verify = verify;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yao-pkg/pkg-fetch",
3
- "version": "3.5.30",
3
+ "version": "3.5.32",
4
4
  "description": "Compiles and stores base binaries for pkg",
5
5
  "main": "lib-es5/index.js",
6
6
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  diff --git node/common.gypi node/common.gypi
2
- index 20e81dea95..3580f7f2e4 100644
2
+ index 311b203600..b2ee8cb47d 100644
3
3
  --- node/common.gypi
4
4
  +++ node/common.gypi
5
5
  @@ -187,7 +187,7 @@
@@ -69,7 +69,7 @@ index d3e35d6ec5..6e9bbe3849 100644
69
69
  static const char* GetVersion();
70
70
 
71
71
  diff --git node/deps/v8/src/api/api.cc node/deps/v8/src/api/api.cc
72
- index a06394e6c1..154b7a82a8 100644
72
+ index da0c960f99..08af13d77a 100644
73
73
  --- node/deps/v8/src/api/api.cc
74
74
  +++ node/deps/v8/src/api/api.cc
75
75
  @@ -806,6 +806,28 @@ void V8::SetFlagsFromCommandLine(int* argc, char** argv, bool remove_flags) {
@@ -288,10 +288,10 @@ index 88c079d10d..a7eaca0574 100644
288
288
  const permission = require('internal/process/permission');
289
289
  const { kEmptyObject } = require('internal/util');
290
290
  diff --git node/lib/internal/process/pre_execution.js node/lib/internal/process/pre_execution.js
291
- index 0bbabb80c2..5dd097b69e 100644
291
+ index 96bbfb4c35..ff50e19a6a 100644
292
292
  --- node/lib/internal/process/pre_execution.js
293
293
  +++ node/lib/internal/process/pre_execution.js
294
- @@ -50,7 +50,11 @@ const {
294
+ @@ -49,7 +49,11 @@ const {
295
295
  },
296
296
  } = require('internal/v8/startup_snapshot');
297
297
 
@@ -303,7 +303,7 @@ index 0bbabb80c2..5dd097b69e 100644
303
303
  return prepareExecution({
304
304
  expandArgv1,
305
305
  initializeModules,
306
- @@ -243,7 +247,12 @@ function patchProcessObject(expandArgv1) {
306
+ @@ -241,7 +245,12 @@ function patchProcessObject(expandArgv1) {
307
307
  let mainEntry;
308
308
  // If requested, update process.argv[1] to replace whatever the user provided with the resolved absolute file path of
309
309
  // the entry point.
@@ -317,7 +317,7 @@ index 0bbabb80c2..5dd097b69e 100644
317
317
  // Expand process.argv[1] into a full path.
318
318
  const path = require('path');
319
319
  try {
320
- @@ -739,6 +748,7 @@ function loadPreloadModules() {
320
+ @@ -737,6 +746,7 @@ function loadPreloadModules() {
321
321
  // For user code, we preload modules if `-r` is passed
322
322
  const preloadModules = getOptionValue('--require');
323
323
  if (preloadModules && preloadModules.length > 0) {
@@ -392,7 +392,7 @@ index 1137dcafcd..482feb65b5 100644
392
392
  }
393
393
 
394
394
  diff --git node/src/node_contextify.cc node/src/node_contextify.cc
395
- index 2b93926a73..9f68232bd4 100644
395
+ index 2331579b26..f84681ae02 100644
396
396
  --- node/src/node_contextify.cc
397
397
  +++ node/src/node_contextify.cc
398
398
  @@ -79,6 +79,7 @@ using v8::String;
@@ -59,7 +59,7 @@ index d3e35d6ec5..6e9bbe3849 100644
59
59
  static const char* GetVersion();
60
60
 
61
61
  diff --git node/deps/v8/src/api/api.cc node/deps/v8/src/api/api.cc
62
- index 2dd476dda3..8a51f25b57 100644
62
+ index f9ce798dc2..68af88ab13 100644
63
63
  --- node/deps/v8/src/api/api.cc
64
64
  +++ node/deps/v8/src/api/api.cc
65
65
  @@ -624,6 +624,28 @@ void V8::SetFlagsFromCommandLine(int* argc, char** argv, bool remove_flags) {
@@ -410,10 +410,10 @@ index 0f9442ea7a..e30582b3cc 100644
410
410
  __proto__: null,
411
411
  ...result.data,
412
412
  diff --git node/lib/internal/process/pre_execution.js node/lib/internal/process/pre_execution.js
413
- index d12d21905c..cf8a5c9096 100644
413
+ index 15443a710c..da28d36aa8 100644
414
414
  --- node/lib/internal/process/pre_execution.js
415
415
  +++ node/lib/internal/process/pre_execution.js
416
- @@ -50,7 +50,11 @@ const {
416
+ @@ -49,7 +49,11 @@ const {
417
417
  runDeserializeCallbacks,
418
418
  } = require('internal/v8/startup_snapshot');
419
419
 
@@ -425,7 +425,7 @@ index d12d21905c..cf8a5c9096 100644
425
425
  return prepareExecution({
426
426
  expandArgv1,
427
427
  initializeModules,
428
- @@ -265,7 +269,8 @@ function patchProcessObject(expandArgv1) {
428
+ @@ -263,7 +267,8 @@ function patchProcessObject(expandArgv1) {
429
429
  let mainEntry;
430
430
  // If requested, update process.argv[1] to replace whatever the user provided with the resolved absolute file path of
431
431
  // the entry point.
@@ -435,7 +435,7 @@ index d12d21905c..cf8a5c9096 100644
435
435
  // Expand process.argv[1] into a full path.
436
436
  const path = require('path');
437
437
  try {
438
- @@ -747,6 +752,7 @@ function loadPreloadModules() {
438
+ @@ -745,6 +750,7 @@ function loadPreloadModules() {
439
439
  // For user code, we preload modules if `-r` is passed
440
440
  const preloadModules = getOptionValue('--require');
441
441
  if (preloadModules && preloadModules.length > 0) {
@@ -1,5 +1,5 @@
1
1
  diff --git node/common.gypi node/common.gypi
2
- index 7727dfc4c6..3ab611dc48 100644
2
+ index db16253786..3a381990a3 100644
3
3
  --- node/common.gypi
4
4
  +++ node/common.gypi
5
5
  @@ -192,7 +192,7 @@
@@ -242,7 +242,7 @@ index 11ced93c08..1f4b534415 100644
242
242
  }
243
243
  uint32_t payload_length = GetHeaderValue(kPayloadLengthOffset);
244
244
  diff --git node/deps/v8/src/snapshot/read-only-serializer.cc node/deps/v8/src/snapshot/read-only-serializer.cc
245
- index fa60b3d07e..a4f06a25c4 100644
245
+ index 0178607289..88c8c2b852 100644
246
246
  --- node/deps/v8/src/snapshot/read-only-serializer.cc
247
247
  +++ node/deps/v8/src/snapshot/read-only-serializer.cc
248
248
  @@ -12,6 +12,9 @@
@@ -486,10 +486,10 @@ index 0000000000..a697294fdf
486
486
  + }());
487
487
  +}());
488
488
  diff --git node/lib/internal/modules/cjs/loader.js node/lib/internal/modules/cjs/loader.js
489
- index 8a28cd0e49..5534402a24 100644
489
+ index 414e450ee3..356cbbaa94 100644
490
490
  --- node/lib/internal/modules/cjs/loader.js
491
491
  +++ node/lib/internal/modules/cjs/loader.js
492
- @@ -260,12 +260,15 @@ function stat(filename) {
492
+ @@ -261,12 +261,15 @@ function stat(filename) {
493
493
  // Guard against internal bugs where a non-string filename is passed in by mistake.
494
494
  assert(typeof filename === 'string');
495
495
 
@@ -543,7 +543,7 @@ index 43a131f57c..6fe7afd784 100644
543
543
  __proto__: null,
544
544
  ...result.data,
545
545
  diff --git node/lib/internal/process/pre_execution.js node/lib/internal/process/pre_execution.js
546
- index c7f86098bd..32eac7d2ee 100644
546
+ index 8ed8802adc..8152188eb7 100644
547
547
  --- node/lib/internal/process/pre_execution.js
548
548
  +++ node/lib/internal/process/pre_execution.js
549
549
  @@ -42,7 +42,11 @@ const {
@@ -558,7 +558,7 @@ index c7f86098bd..32eac7d2ee 100644
558
558
  return prepareExecution({
559
559
  expandArgv1,
560
560
  initializeModules,
561
- @@ -241,7 +245,8 @@ function patchProcessObject(expandArgv1) {
561
+ @@ -274,7 +278,8 @@ function patchProcessObject(expandArgv1) {
562
562
  let mainEntry;
563
563
  // If requested, update process.argv[1] to replace whatever the user provided with the resolved absolute file path of
564
564
  // the entry point.
@@ -568,7 +568,7 @@ index c7f86098bd..32eac7d2ee 100644
568
568
  // Expand process.argv[1] into a full path.
569
569
  const path = require('path');
570
570
  try {
571
- @@ -678,6 +683,7 @@ function loadPreloadModules() {
571
+ @@ -690,6 +695,7 @@ function loadPreloadModules() {
572
572
  // For user code, we preload modules if `-r` is passed
573
573
  const preloadModules = getOptionValue('--require');
574
574
  if (preloadModules && preloadModules.length > 0) {
@@ -615,7 +615,7 @@ index f62eb36b57..8ccc42dbd4 100644
615
615
  parent_env_->AddCleanupHook([](void* data) {
616
616
  Environment* env = static_cast<Environment*>(data);
617
617
  diff --git node/src/node.cc node/src/node.cc
618
- index c70bec82a2..4f807cd526 100644
618
+ index 31439d0cc1..8dda6dcc8a 100644
619
619
  --- node/src/node.cc
620
620
  +++ node/src/node.cc
621
621
  @@ -355,6 +355,8 @@ MaybeLocal<Value> StartExecution(Environment* env, StartExecutionCallback cb) {
@@ -837,10 +837,10 @@ index 3295121b87..bfe838b8c1 100644
837
837
  + return adjacent(c, nargv);
838
838
  +}
839
839
  diff --git node/src/node_options.cc node/src/node_options.cc
840
- index 2a3ab5e73c..00b61629f2 100644
840
+ index 342bffb00f..1802fbac25 100644
841
841
  --- node/src/node_options.cc
842
842
  +++ node/src/node_options.cc
843
- @@ -422,6 +422,7 @@ void Parse(
843
+ @@ -430,6 +430,7 @@ void Parse(
844
844
  // TODO(addaleax): Make that unnecessary.
845
845
 
846
846
  DebugOptionsParser::DebugOptionsParser() {
@@ -1,7 +1,7 @@
1
1
  {
2
- "v24.11.0": ["node.v24.11.0.cpp.patch"],
3
- "v22.21.1": ["node.v22.21.1.cpp.patch"],
4
- "v20.19.5": ["node.v20.19.5.cpp.patch"],
2
+ "v24.13.0": ["node.v24.13.0.cpp.patch"],
3
+ "v22.22.0": ["node.v22.22.0.cpp.patch"],
4
+ "v20.20.0": ["node.v20.20.0.cpp.patch"],
5
5
  "v18.20.8": ["node.v18.20.8.cpp.patch"],
6
6
  "v16.20.2": ["node.v16.20.2.cpp.patch"],
7
7
  "v14.21.3": ["node.v14.21.3.cpp.patch"],