@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.
- package/README.md +117 -0
- package/lib-es5/apply-patches.d.ts +3 -0
- package/lib-es5/apply-patches.js +91 -0
- package/lib-es5/bin.d.ts +3 -0
- package/lib-es5/bin.js +102 -0
- package/lib-es5/build.d.ts +4 -0
- package/lib-es5/build.js +436 -0
- package/lib-es5/expected-shas.json +67 -0
- package/lib-es5/expected.d.ts +2 -0
- package/lib-es5/expected.js +9 -0
- package/lib-es5/generate-expected-shas.d.ts +2 -0
- package/lib-es5/generate-expected-shas.js +83 -0
- package/lib-es5/index.d.ts +15 -0
- package/lib-es5/index.js +255 -0
- package/lib-es5/log.d.ts +20 -0
- package/lib-es5/log.js +112 -0
- package/lib-es5/places.d.ts +19 -0
- package/lib-es5/places.js +40 -0
- package/lib-es5/print-hashes.d.ts +2 -0
- package/lib-es5/print-hashes.js +13 -0
- package/lib-es5/system.d.ts +11 -0
- package/lib-es5/system.js +153 -0
- package/lib-es5/tsconfig.json +10 -0
- package/lib-es5/utils.d.ts +8 -0
- package/lib-es5/utils.js +167 -0
- package/lib-es5/verify.d.ts +2 -0
- package/lib-es5/verify.js +60 -0
- package/license.md +21 -0
- package/package.json +124 -0
- package/patches/node.v10.24.1.cpp.patch +568 -0
- package/patches/node.v12.22.11.cpp.patch +679 -0
- package/patches/node.v14.21.3.cpp.patch +560 -0
- package/patches/node.v16.19.1.cpp.patch +572 -0
- package/patches/node.v18.15.0.cpp.patch +581 -0
- package/patches/node.v19.8.1.cpp.patch +581 -0
- package/patches/node.v8.17.0.cpp.patch +549 -0
- package/patches/patches.json +9 -0
package/lib-es5/utils.js
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
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
|
+
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
|
+
})];
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
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
|
+
})];
|
|
120
|
+
});
|
|
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*/];
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
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
|
+
});
|
|
156
|
+
}
|
|
157
|
+
exports.spawn = spawn;
|
|
158
|
+
function nodeBinarySortFunction(a, b) {
|
|
159
|
+
var coercedVersionA = (0, semver_1.coerce)(a);
|
|
160
|
+
var coercedVersionB = (0, semver_1.coerce)(b);
|
|
161
|
+
if (coercedVersionA && coercedVersionB) {
|
|
162
|
+
return coercedVersionA.compare(coercedVersionB);
|
|
163
|
+
}
|
|
164
|
+
return 0;
|
|
165
|
+
}
|
|
166
|
+
exports.nodeBinarySortFunction = nodeBinarySortFunction;
|
|
167
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
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 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 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
|
+
});
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
exports.verify = verify;
|
|
60
|
+
//# sourceMappingURL=verify.js.map
|
package/license.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 Zeit, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@yao-pkg/pkg-fetch",
|
|
3
|
+
"version": "3.5.3",
|
|
4
|
+
"description": "Compiles and stores base binaries for pkg",
|
|
5
|
+
"main": "lib-es5/index.js",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/yao-pkg/pkg-fetch.git"
|
|
10
|
+
},
|
|
11
|
+
"bin": {
|
|
12
|
+
"pkg-fetch": "lib-es5/bin.js"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"lib-es5/*.js",
|
|
16
|
+
"lib-es5/*.ts",
|
|
17
|
+
"lib-es5/*.json",
|
|
18
|
+
"patches/*"
|
|
19
|
+
],
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"chalk": "^4.1.2",
|
|
22
|
+
"fs-extra": "^9.1.0",
|
|
23
|
+
"https-proxy-agent": "^5.0.0",
|
|
24
|
+
"node-fetch": "^2.6.6",
|
|
25
|
+
"progress": "^2.0.3",
|
|
26
|
+
"semver": "^7.3.5",
|
|
27
|
+
"tar-fs": "^2.1.1",
|
|
28
|
+
"yargs": "^16.2.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@release-it/conventional-changelog": "^7.0.2",
|
|
32
|
+
"@types/fs-extra": "^9.0.13",
|
|
33
|
+
"@types/node": "^14.17.32",
|
|
34
|
+
"@types/node-fetch": "^2.5.12",
|
|
35
|
+
"@types/progress": "^2.0.5",
|
|
36
|
+
"@types/semver": "^7.3.9",
|
|
37
|
+
"@types/tar-fs": "^2.0.1",
|
|
38
|
+
"@types/yargs": "^16.0.4",
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
40
|
+
"@typescript-eslint/parser": "^4.33.0",
|
|
41
|
+
"eslint": "^7.32.0",
|
|
42
|
+
"eslint-config-airbnb-base": "^14.2.1",
|
|
43
|
+
"eslint-config-prettier": "^8.3.0",
|
|
44
|
+
"eslint-import-resolver-typescript": "^2.5.0",
|
|
45
|
+
"eslint-plugin-import": "^2.25.2",
|
|
46
|
+
"lint-staged": "^10.5.4",
|
|
47
|
+
"prettier": "^2.4.1",
|
|
48
|
+
"release-it": "^16.2.1",
|
|
49
|
+
"rimraf": "^3.0.2",
|
|
50
|
+
"simple-git-hooks": ">=2.7.0",
|
|
51
|
+
"typescript": "^4.4.4"
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"build": "rimraf lib-es5 && tsc --build lib",
|
|
55
|
+
"bin": "node lib-es5/bin.js",
|
|
56
|
+
"lint": "eslint lib",
|
|
57
|
+
"prepare": "npm run build",
|
|
58
|
+
"prepublishOnly": "npm run lint",
|
|
59
|
+
"start": "node lib-es5/bin.js",
|
|
60
|
+
"applyPatches": "node lib-es5/apply-patches.js",
|
|
61
|
+
"printHashes": "node lib-es5/print-hashes.js",
|
|
62
|
+
"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
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"prettier": {
|
|
113
|
+
"singleQuote": true
|
|
114
|
+
},
|
|
115
|
+
"simple-git-hooks": {
|
|
116
|
+
"pre-commit": "npx lint-staged"
|
|
117
|
+
},
|
|
118
|
+
"lint-staged": {
|
|
119
|
+
"*.{js,css,md}": "prettier --write"
|
|
120
|
+
},
|
|
121
|
+
"publishConfig": {
|
|
122
|
+
"access": "public"
|
|
123
|
+
}
|
|
124
|
+
}
|