@yao-pkg/pkg-fetch 3.6.0 → 3.6.1

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,163 +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_extra_1 = __importDefault(require("fs-extra"));
46
- var https_proxy_agent_1 = __importDefault(require("https-proxy-agent"));
47
- var path_1 = __importDefault(require("path"));
48
- var child_process_1 = require("child_process");
49
- var stream_1 = __importDefault(require("stream"));
50
- var semver_1 = require("semver");
51
- var log_1 = require("./log");
52
- function downloadUrl(url, file) {
53
- var _a, _b, _c;
54
- return __awaiter(this, void 0, void 0, function () {
55
- var proxy, res, tempFile, ws, totalSize, currentSize;
56
- return __generator(this, function (_d) {
57
- switch (_d.label) {
58
- case 0:
59
- log_1.log.enableProgress(path_1.default.basename(file));
60
- log_1.log.showProgress(0);
61
- 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;
62
- return [4 /*yield*/, (0, node_fetch_1.default)(url, proxy ? { agent: (0, https_proxy_agent_1.default)(proxy) } : undefined)];
63
- case 1:
64
- res = _d.sent();
65
- if (!res.ok) {
66
- log_1.log.disableProgress();
67
- throw (0, log_1.wasReported)("".concat(res.status, ": ").concat(res.statusText));
68
- }
69
- tempFile = "".concat(file, ".downloading");
70
- fs_extra_1.default.mkdirpSync(path_1.default.dirname(tempFile));
71
- ws = fs_extra_1.default.createWriteStream(tempFile);
72
- totalSize = Number(res.headers.get('content-length'));
73
- currentSize = 0;
74
- res.body.on('data', function (chunk) {
75
- if (totalSize != null && totalSize !== 0) {
76
- currentSize += chunk.length;
77
- log_1.log.showProgress((currentSize / totalSize) * 100);
78
- }
79
- });
80
- res.body.pipe(ws);
81
- return [2 /*return*/, new Promise(function (resolve, reject) {
82
- stream_1.default.finished(ws, function (err) {
83
- if (err) {
84
- log_1.log.disableProgress();
85
- fs_extra_1.default.rmSync(tempFile);
86
- reject((0, log_1.wasReported)("".concat(err.name, ": ").concat(err.message)));
87
- }
88
- else {
89
- log_1.log.showProgress(100);
90
- log_1.log.disableProgress();
91
- fs_extra_1.default.moveSync(tempFile, file);
92
- resolve();
93
- }
94
- });
95
- })];
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();
96
60
  }
97
61
  });
98
62
  });
99
63
  }
100
64
  exports.downloadUrl = downloadUrl;
101
- function hash(filePath) {
102
- return __awaiter(this, void 0, void 0, function () {
103
- return __generator(this, function (_a) {
104
- return [2 /*return*/, new Promise(function (resolve, reject) {
105
- var resultHash = crypto_1.default.createHash('sha256');
106
- var input = fs_extra_1.default.createReadStream(filePath);
107
- input.on('error', function (e) {
108
- reject(e);
109
- });
110
- input.on('readable', function () {
111
- var data = input.read();
112
- if (data) {
113
- resultHash.update(data);
114
- }
115
- else {
116
- resolve(resultHash.digest('hex'));
117
- }
118
- });
119
- })];
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);
120
71
  });
121
- });
122
- }
123
- exports.hash = hash;
124
- function plusx(file) {
125
- return __awaiter(this, void 0, void 0, function () {
126
- var s, newMode, base8;
127
- return __generator(this, function (_a) {
128
- switch (_a.label) {
129
- case 0: return [4 /*yield*/, fs_extra_1.default.stat(file)];
130
- case 1:
131
- s = _a.sent();
132
- newMode = s.mode | 64 | 8 | 1;
133
- if (s.mode === newMode)
134
- return [2 /*return*/];
135
- base8 = newMode.toString(8).slice(-3);
136
- return [4 /*yield*/, fs_extra_1.default.chmod(file, base8)];
137
- case 2:
138
- _a.sent();
139
- 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'));
140
79
  }
141
80
  });
142
81
  });
143
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
+ }
144
92
  exports.plusx = plusx;
145
- function spawn(command, args, options) {
146
- return __awaiter(this, void 0, void 0, function () {
147
- var error;
148
- return __generator(this, function (_a) {
149
- error = (0, child_process_1.spawnSync)(command, args, options).error;
150
- if (error) {
151
- throw error;
152
- }
153
- return [2 /*return*/];
154
- });
155
- });
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
+ }
156
98
  }
157
99
  exports.spawn = spawn;
158
100
  function nodeBinarySortFunction(a, b) {
159
- var coercedVersionA = (0, semver_1.coerce)(a);
160
- var coercedVersionB = (0, semver_1.coerce)(b);
101
+ const coercedVersionA = (0, semver_1.coerce)(a);
102
+ const coercedVersionB = (0, semver_1.coerce)(b);
161
103
  if (coercedVersionA && coercedVersionB) {
162
104
  return coercedVersionA.compare(coercedVersionB);
163
105
  }
package/lib-es5/verify.js CHANGED
@@ -1,59 +1,139 @@
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
+ if (modules === 127) {
63
+ // no cpu features anymore
64
+ } else
65
+ if (modules === 137) {
66
+ // no cpu features anymore
67
+ } else
68
+ if (modules === 147) {
69
+ // no cpu features anymore
70
+ } else {
71
+ assert(false, 'unknown node modules version: ' + modules);
72
+ }
73
+
74
+ if (modules >= 46 && // no cpu_features field in 0.12
75
+ process.arch !== 'arm' && // non-zero features even in sourceless mode in arm
76
+ modules < 72) { // no cpu_features field in 12+
77
+ cpuFeatures = cd.readUInt32LE(kCpuFeaturesOffset);
78
+ assert(cpuFeatures === 0, 'CPU_FEATURES must be zero');
79
+ }
80
+
81
+ var s2 = new vm.Script(undefined, { filename: 's2', cachedData: cd, sourceless: true });
82
+ fn = s2.runInThisContext();
83
+ result = fn();
84
+ assert.equal(result, 42);
85
+
86
+ if (modules === 14) {
87
+ } else
88
+ if (modules === 46 || modules === 48 ||
89
+ modules === 51 || modules === 57 || modules === 59 || modules === 64) {
90
+ var paddedPayloadOffset = 0x48; // see SerializedCodeData::Payload()
91
+ var index = paddedPayloadOffset + 10;
92
+ cd[index] ^= 0xf0;
93
+ var s3 = new vm.Script(undefined, { filename: 's3', cachedData: cd, sourceless: true });
94
+ assert(s3.cachedDataRejected, 's3.cachedDataRejected must be true');
95
+ } else
96
+ if (modules === 72) {
97
+ } else
98
+ if (modules === 79) {
99
+ } else
100
+ if (modules === 83) {
101
+ } else
102
+ if (modules === 93) {
103
+ } else
104
+ if (modules === 108) {
105
+ } else
106
+ if (modules === 111) {
107
+ } else
108
+ if (modules === 115) {
109
+ } else
110
+ if (modules === 127) {
111
+ } else
112
+ if (modules === 137) {
113
+ } else
114
+ if (modules === 147) {
115
+ } else {
116
+ assert(false, 'unknown node modules version: ' + modules);
117
+ }
118
+
119
+ var s4 = new vm.Script(text, { filename: 's4', produceCachedData: true });
120
+ assert(s4.cachedDataProduced, 's4.cachedDataProduced must be true');
121
+ cd = s4.cachedData;
122
+
123
+ if (modules >= 46 && // no cpu_features field in 0.12
124
+ process.arch !== 'arm' && // zero features even in non-sourceless mode in arm
125
+ modules < 72) { // no cpu_features field in 12+
126
+ cpuFeatures = cd.readUInt32LE(kCpuFeaturesOffset);
127
+ assert(cpuFeatures !== 0, 'CPU_FEATURES must be non-zero');
128
+ }
129
+
130
+ console.log('ok');
131
+ `;
132
+ async function verify(local) {
133
+ await (0, utils_1.plusx)(local);
134
+ (0, child_process_1.spawnSync)(local, ['-e', script], {
135
+ env: { PKG_EXECPATH: 'PKG_INVOKE_NODEJS' },
136
+ stdio: 'inherit',
57
137
  });
58
138
  }
59
139
  exports.verify = verify;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yao-pkg/pkg-fetch",
3
- "version": "3.6.0",
3
+ "version": "3.6.1",
4
4
  "description": "Compiles and stores base binaries for pkg",
5
5
  "main": "lib-es5/index.js",
6
6
  "license": "MIT",
@@ -18,19 +18,17 @@
18
18
  "patches/*"
19
19
  ],
20
20
  "dependencies": {
21
- "chalk": "^4.1.2",
22
- "fs-extra": "^9.1.0",
23
21
  "https-proxy-agent": "^5.0.0",
24
22
  "node-fetch": "^2.6.6",
23
+ "picocolors": "^1.1.0",
25
24
  "progress": "^2.0.3",
26
25
  "semver": "^7.3.5",
27
- "tar-fs": "^2.1.1",
26
+ "tar-fs": "^3.1.1",
28
27
  "yargs": "^16.2.0"
29
28
  },
30
29
  "devDependencies": {
31
30
  "@release-it/conventional-changelog": "^7.0.2",
32
- "@types/fs-extra": "^9.0.13",
33
- "@types/node": "^14.17.32",
31
+ "@types/node": "^16.18.113",
34
32
  "@types/node-fetch": "^2.5.12",
35
33
  "@types/progress": "^2.0.5",
36
34
  "@types/semver": "^7.3.9",
@@ -46,7 +44,7 @@
46
44
  "lint-staged": "^10.5.4",
47
45
  "prettier": "^2.4.1",
48
46
  "release-it": "^16.2.1",
49
- "rimraf": "^3.0.2",
47
+ "rimraf": "^6.0.1",
50
48
  "simple-git-hooks": ">=2.7.0",
51
49
  "typescript": "^4.4.4"
52
50
  },
@@ -60,54 +58,9 @@
60
58
  "applyPatches": "node lib-es5/apply-patches.js",
61
59
  "printHashes": "node lib-es5/print-hashes.js",
62
60
  "updateExpected": "node lib-es5/generate-expected-shas.js",
63
- "release": "read -p 'GITHUB_TOKEN: ' GITHUB_TOKEN && export GITHUB_TOKEN=$GITHUB_TOKEN && release-it"
64
- },
65
- "release-it": {
66
- "github": {
67
- "release": false
68
- },
69
- "hooks": {
70
- "before:init": [
71
- "yarn lint"
72
- ]
73
- },
74
- "npm": {
75
- "publish": true
76
- },
77
- "plugins": {
78
- "@release-it/conventional-changelog": {
79
- "infile": "CHANGELOG.md",
80
- "preset": {
81
- "name": "conventionalcommits",
82
- "types": [
83
- {
84
- "type": "feat",
85
- "section": "Features"
86
- },
87
- {
88
- "type": "fix",
89
- "section": "Bug Fixes"
90
- },
91
- {
92
- "type": "test",
93
- "section": "Test added"
94
- },
95
- {
96
- "type": "refactor",
97
- "section": "Code refactoring"
98
- },
99
- {
100
- "type": "chore",
101
- "section": "Chores"
102
- },
103
- {
104
- "type": "docs",
105
- "section": "Documentation"
106
- }
107
- ]
108
- }
109
- }
110
- }
61
+ "release": "read -p 'GITHUB_TOKEN: ' GITHUB_TOKEN && export GITHUB_TOKEN=$GITHUB_TOKEN && release-it",
62
+ "release:patch": "npm run release -- patch",
63
+ "release:minor": "npm run release -- minor"
111
64
  },
112
65
  "prettier": {
113
66
  "singleQuote": true
@@ -119,6 +72,8 @@
119
72
  "*.{js,css,md}": "prettier --write"
120
73
  },
121
74
  "publishConfig": {
122
- "access": "public"
123
- }
75
+ "access": "public",
76
+ "provenance": true
77
+ },
78
+ "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
124
79
  }
@@ -307,7 +307,7 @@ index de409a31f3..d26e4366ad 100644
307
307
 
308
308
  'conditions': [
309
309
  + ['target_arch=="arm64"', {
310
- + 'cflags': ['-msign-return-address=all'], # Pointer authentication.
310
+ + 'cflags': ['-mbranch-protection=standard'], # Pointer authentication.
311
311
  + }],
312
312
  ['OS=="aix"', {
313
313
  'ldflags': [