@napi-rs/cli 3.0.0-alpha.80 → 3.0.0-alpha.82
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/dist/api/build.js +71 -139
- package/dist/api/build.js.map +1 -1
- package/dist/index.cjs +261 -658
- package/dist/utils/metadata.d.ts +1 -1
- package/dist/utils/metadata.js +19 -10
- package/dist/utils/metadata.js.map +1 -1
- package/dist/utils/misc.d.ts +2 -1
- package/dist/utils/misc.js +10 -8
- package/dist/utils/misc.js.map +1 -1
- package/dist/utils/typegen.d.ts +1 -1
- package/dist/utils/typegen.js +5 -22
- package/dist/utils/typegen.js.map +1 -1
- package/package.json +3 -3
- package/src/api/build.ts +91 -170
- package/src/utils/__tests__/__snapshots__/config.spec.ts.snap +0 -0
- package/src/utils/__tests__/__snapshots__/target.spec.ts.snap +0 -0
- package/src/utils/__tests__/__snapshots__/typegen.spec.ts.md +2 -16
- package/src/utils/__tests__/__snapshots__/typegen.spec.ts.snap +0 -0
- package/src/utils/__tests__/__snapshots__/version.spec.ts.snap +0 -0
- package/src/utils/metadata.ts +25 -12
- package/src/utils/misc.ts +10 -9
- package/src/utils/typegen.ts +10 -32
package/dist/index.cjs
CHANGED
|
@@ -201,10 +201,144 @@ var debug = debugFactory("utils");
|
|
|
201
201
|
|
|
202
202
|
// dist/utils/misc.js
|
|
203
203
|
var import_node_fs = require("node:fs");
|
|
204
|
-
var import_node_module = require("node:module");
|
|
205
204
|
var import_node_util = require("node:util");
|
|
206
|
-
|
|
207
|
-
|
|
205
|
+
|
|
206
|
+
// package.json
|
|
207
|
+
var package_default = {
|
|
208
|
+
name: "@napi-rs/cli",
|
|
209
|
+
version: "3.0.0-alpha.82",
|
|
210
|
+
description: "Cli tools for napi-rs",
|
|
211
|
+
author: "LongYinan <lynweklm@gmail.com>",
|
|
212
|
+
homepage: "https://github.com/napi-rs/napi-rs",
|
|
213
|
+
license: "MIT",
|
|
214
|
+
type: "module",
|
|
215
|
+
engines: {
|
|
216
|
+
node: ">= 16"
|
|
217
|
+
},
|
|
218
|
+
bin: {
|
|
219
|
+
napi: "./dist/cli.js",
|
|
220
|
+
"napi-raw": "./cli.mjs"
|
|
221
|
+
},
|
|
222
|
+
main: "./dist/index.cjs",
|
|
223
|
+
module: "./dist/index.js",
|
|
224
|
+
exports: {
|
|
225
|
+
".": {
|
|
226
|
+
import: {
|
|
227
|
+
default: "./dist/index.js",
|
|
228
|
+
types: "./dist/index.d.ts"
|
|
229
|
+
},
|
|
230
|
+
require: {
|
|
231
|
+
default: "./dist/index.cjs",
|
|
232
|
+
types: "./dist/index.d.ts"
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"./package.json": {
|
|
236
|
+
import: "./package.json",
|
|
237
|
+
require: "./package.json"
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
files: [
|
|
241
|
+
"dist",
|
|
242
|
+
"src"
|
|
243
|
+
],
|
|
244
|
+
keywords: [
|
|
245
|
+
"cli",
|
|
246
|
+
"rust",
|
|
247
|
+
"napi",
|
|
248
|
+
"n-api",
|
|
249
|
+
"node-api",
|
|
250
|
+
"node-addon",
|
|
251
|
+
"neon"
|
|
252
|
+
],
|
|
253
|
+
maintainers: [
|
|
254
|
+
{
|
|
255
|
+
name: "LongYinan",
|
|
256
|
+
email: "lynweklm@gmail.com",
|
|
257
|
+
homepage: "https://github.com/Brooooooklyn"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
name: "forehalo",
|
|
261
|
+
homepage: "https://github.com/forehalo"
|
|
262
|
+
}
|
|
263
|
+
],
|
|
264
|
+
repository: {
|
|
265
|
+
type: "git",
|
|
266
|
+
url: "git+https://github.com/napi-rs/napi-rs.git"
|
|
267
|
+
},
|
|
268
|
+
publishConfig: {
|
|
269
|
+
registry: "https://registry.npmjs.org/",
|
|
270
|
+
access: "public"
|
|
271
|
+
},
|
|
272
|
+
bugs: {
|
|
273
|
+
url: "https://github.com/napi-rs/napi-rs/issues"
|
|
274
|
+
},
|
|
275
|
+
dependencies: {
|
|
276
|
+
"@inquirer/prompts": "^7.4.0",
|
|
277
|
+
"@napi-rs/cross-toolchain": "^0.0.19",
|
|
278
|
+
"@napi-rs/wasm-tools": "^0.0.3",
|
|
279
|
+
"@octokit/rest": "^22.0.0",
|
|
280
|
+
clipanion: "^4.0.0-rc.4",
|
|
281
|
+
colorette: "^2.0.20",
|
|
282
|
+
debug: "^4.4.0",
|
|
283
|
+
emnapi: "^1.4.0",
|
|
284
|
+
"js-yaml": "^4.1.0",
|
|
285
|
+
"lodash-es": "^4.17.21",
|
|
286
|
+
semver: "^7.7.1",
|
|
287
|
+
toml: "^3.0.0",
|
|
288
|
+
typanion: "^3.14.0",
|
|
289
|
+
"wasm-sjlj": "^1.0.6"
|
|
290
|
+
},
|
|
291
|
+
devDependencies: {
|
|
292
|
+
"@emnapi/core": "^1.4.0",
|
|
293
|
+
"@emnapi/runtime": "^1.4.0",
|
|
294
|
+
"@oxc-node/core": "^0.0.27",
|
|
295
|
+
"@types/debug": "^4.1.12",
|
|
296
|
+
"@types/inquirer": "^9.0.7",
|
|
297
|
+
"@types/js-yaml": "^4.0.9",
|
|
298
|
+
"@types/lodash-es": "^4.17.12",
|
|
299
|
+
"@types/node": "^22.13.16",
|
|
300
|
+
"@types/semver": "^7.7.0",
|
|
301
|
+
ava: "^6.2.0",
|
|
302
|
+
"env-paths": "^3.0.0",
|
|
303
|
+
esbuild: "^0.25.2",
|
|
304
|
+
prettier: "^3.5.3",
|
|
305
|
+
tslib: "^2.8.1",
|
|
306
|
+
typescript: "^5.8.2"
|
|
307
|
+
},
|
|
308
|
+
peerDependencies: {
|
|
309
|
+
"@emnapi/runtime": "^1.1.0",
|
|
310
|
+
emnapi: "^1.1.0"
|
|
311
|
+
},
|
|
312
|
+
peerDependenciesMeta: {
|
|
313
|
+
"@emnapi/runtime": {
|
|
314
|
+
optional: true
|
|
315
|
+
},
|
|
316
|
+
emnapi: {
|
|
317
|
+
optional: true
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
funding: {
|
|
321
|
+
type: "github",
|
|
322
|
+
url: "https://github.com/sponsors/Brooooooklyn"
|
|
323
|
+
},
|
|
324
|
+
scripts: {
|
|
325
|
+
codegen: "node --import @oxc-node/core/register ./codegen/index.ts",
|
|
326
|
+
build: "tsc && yarn build:cjs",
|
|
327
|
+
"build:cjs": "node ./esbuild.mjs",
|
|
328
|
+
test: "node --import @oxc-node/core/register ../node_modules/ava/entrypoints/cli.mjs"
|
|
329
|
+
},
|
|
330
|
+
ava: {
|
|
331
|
+
extensions: {
|
|
332
|
+
ts: "module"
|
|
333
|
+
},
|
|
334
|
+
files: [
|
|
335
|
+
"**/__tests__/**/*.spec.ts"
|
|
336
|
+
]
|
|
337
|
+
},
|
|
338
|
+
gitHead: "b3a477cac0284ff60a1c9f0e331993c02f8a8b8f"
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
// dist/utils/misc.js
|
|
208
342
|
var readFileAsync = (0, import_node_util.promisify)(import_node_fs.readFile);
|
|
209
343
|
var writeFileAsync = (0, import_node_util.promisify)(import_node_fs.writeFile);
|
|
210
344
|
var unlinkAsync = (0, import_node_util.promisify)(import_node_fs.unlink);
|
|
@@ -216,6 +350,14 @@ async function fileExists(path2) {
|
|
|
216
350
|
const exists = await statAsync(path2).then(() => true).catch(() => false);
|
|
217
351
|
return exists;
|
|
218
352
|
}
|
|
353
|
+
async function dirExistsAsync(path2) {
|
|
354
|
+
try {
|
|
355
|
+
const stats = await statAsync(path2);
|
|
356
|
+
return stats.isDirectory();
|
|
357
|
+
} catch {
|
|
358
|
+
return false;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
219
361
|
function pick(o, ...keys2) {
|
|
220
362
|
return keys2.reduce((acc, key) => {
|
|
221
363
|
acc[key] = o[key];
|
|
@@ -228,10 +370,10 @@ async function updatePackageJson(path2, partial) {
|
|
|
228
370
|
debug(`File not exists ${path2}`);
|
|
229
371
|
return;
|
|
230
372
|
}
|
|
231
|
-
const old =
|
|
373
|
+
const old = require(path2);
|
|
232
374
|
await writeFileAsync(path2, JSON.stringify({ ...old, ...partial }, null, 2));
|
|
233
375
|
}
|
|
234
|
-
var CLI_VERSION =
|
|
376
|
+
var CLI_VERSION = package_default.version;
|
|
235
377
|
|
|
236
378
|
// dist/utils/target.js
|
|
237
379
|
var import_node_child_process = require("node:child_process");
|
|
@@ -408,18 +550,27 @@ function napiEngineRequirement(napiVersion) {
|
|
|
408
550
|
// dist/utils/metadata.js
|
|
409
551
|
var import_node_child_process2 = require("node:child_process");
|
|
410
552
|
var import_node_fs2 = __toESM(require("node:fs"), 1);
|
|
411
|
-
function parseMetadata(manifestPath) {
|
|
553
|
+
async function parseMetadata(manifestPath) {
|
|
412
554
|
if (!import_node_fs2.default.existsSync(manifestPath)) {
|
|
413
555
|
throw new Error(`No crate found in manifest: ${manifestPath}`);
|
|
414
556
|
}
|
|
415
|
-
const
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
557
|
+
const childProcess = (0, import_node_child_process2.spawn)("cargo", ["metadata", "--manifest-path", manifestPath, "--format-version", "1"], { stdio: "pipe" });
|
|
558
|
+
let stdout = "";
|
|
559
|
+
let stderr = "";
|
|
560
|
+
let status = 0;
|
|
561
|
+
let error = null;
|
|
562
|
+
childProcess.stdout.on("data", (data) => {
|
|
563
|
+
stdout += data;
|
|
564
|
+
});
|
|
565
|
+
childProcess.stderr.on("data", (data) => {
|
|
566
|
+
stderr += data;
|
|
567
|
+
});
|
|
568
|
+
await new Promise((resolve7) => {
|
|
569
|
+
childProcess.on("close", (code) => {
|
|
570
|
+
status = code ?? 0;
|
|
571
|
+
resolve7();
|
|
572
|
+
});
|
|
573
|
+
});
|
|
423
574
|
if (error) {
|
|
424
575
|
throw new Error("cargo metadata failed to run", { cause: error });
|
|
425
576
|
}
|
|
@@ -675,11 +826,6 @@ function apply(func, thisArg, args) {
|
|
|
675
826
|
}
|
|
676
827
|
var apply_default = apply;
|
|
677
828
|
|
|
678
|
-
// ../node_modules/lodash-es/noop.js
|
|
679
|
-
function noop() {
|
|
680
|
-
}
|
|
681
|
-
var noop_default = noop;
|
|
682
|
-
|
|
683
829
|
// ../node_modules/lodash-es/_copyArray.js
|
|
684
830
|
function copyArray(source, array) {
|
|
685
831
|
var index = -1, length = source.length;
|
|
@@ -758,49 +904,6 @@ function arrayEach(array, iteratee) {
|
|
|
758
904
|
}
|
|
759
905
|
var arrayEach_default = arrayEach;
|
|
760
906
|
|
|
761
|
-
// ../node_modules/lodash-es/_baseFindIndex.js
|
|
762
|
-
function baseFindIndex(array, predicate, fromIndex, fromRight) {
|
|
763
|
-
var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
|
|
764
|
-
while (fromRight ? index-- : ++index < length) {
|
|
765
|
-
if (predicate(array[index], index, array)) {
|
|
766
|
-
return index;
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
return -1;
|
|
770
|
-
}
|
|
771
|
-
var baseFindIndex_default = baseFindIndex;
|
|
772
|
-
|
|
773
|
-
// ../node_modules/lodash-es/_baseIsNaN.js
|
|
774
|
-
function baseIsNaN(value) {
|
|
775
|
-
return value !== value;
|
|
776
|
-
}
|
|
777
|
-
var baseIsNaN_default = baseIsNaN;
|
|
778
|
-
|
|
779
|
-
// ../node_modules/lodash-es/_strictIndexOf.js
|
|
780
|
-
function strictIndexOf(array, value, fromIndex) {
|
|
781
|
-
var index = fromIndex - 1, length = array.length;
|
|
782
|
-
while (++index < length) {
|
|
783
|
-
if (array[index] === value) {
|
|
784
|
-
return index;
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
return -1;
|
|
788
|
-
}
|
|
789
|
-
var strictIndexOf_default = strictIndexOf;
|
|
790
|
-
|
|
791
|
-
// ../node_modules/lodash-es/_baseIndexOf.js
|
|
792
|
-
function baseIndexOf(array, value, fromIndex) {
|
|
793
|
-
return value === value ? strictIndexOf_default(array, value, fromIndex) : baseFindIndex_default(array, baseIsNaN_default, fromIndex);
|
|
794
|
-
}
|
|
795
|
-
var baseIndexOf_default = baseIndexOf;
|
|
796
|
-
|
|
797
|
-
// ../node_modules/lodash-es/_arrayIncludes.js
|
|
798
|
-
function arrayIncludes(array, value) {
|
|
799
|
-
var length = array == null ? 0 : array.length;
|
|
800
|
-
return !!length && baseIndexOf_default(array, value, 0) > -1;
|
|
801
|
-
}
|
|
802
|
-
var arrayIncludes_default = arrayIncludes;
|
|
803
|
-
|
|
804
907
|
// ../node_modules/lodash-es/_isIndex.js
|
|
805
908
|
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
806
909
|
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
@@ -1565,66 +1668,6 @@ function baseSlice(array, start, end) {
|
|
|
1565
1668
|
}
|
|
1566
1669
|
var baseSlice_default = baseSlice;
|
|
1567
1670
|
|
|
1568
|
-
// ../node_modules/lodash-es/_castSlice.js
|
|
1569
|
-
function castSlice(array, start, end) {
|
|
1570
|
-
var length = array.length;
|
|
1571
|
-
end = end === void 0 ? length : end;
|
|
1572
|
-
return !start && end >= length ? array : baseSlice_default(array, start, end);
|
|
1573
|
-
}
|
|
1574
|
-
var castSlice_default = castSlice;
|
|
1575
|
-
|
|
1576
|
-
// ../node_modules/lodash-es/_hasUnicode.js
|
|
1577
|
-
var rsAstralRange = "\\ud800-\\udfff";
|
|
1578
|
-
var rsComboMarksRange = "\\u0300-\\u036f";
|
|
1579
|
-
var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
|
|
1580
|
-
var rsComboSymbolsRange = "\\u20d0-\\u20ff";
|
|
1581
|
-
var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
|
|
1582
|
-
var rsVarRange = "\\ufe0e\\ufe0f";
|
|
1583
|
-
var rsZWJ = "\\u200d";
|
|
1584
|
-
var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
|
|
1585
|
-
function hasUnicode(string) {
|
|
1586
|
-
return reHasUnicode.test(string);
|
|
1587
|
-
}
|
|
1588
|
-
var hasUnicode_default = hasUnicode;
|
|
1589
|
-
|
|
1590
|
-
// ../node_modules/lodash-es/_asciiToArray.js
|
|
1591
|
-
function asciiToArray(string) {
|
|
1592
|
-
return string.split("");
|
|
1593
|
-
}
|
|
1594
|
-
var asciiToArray_default = asciiToArray;
|
|
1595
|
-
|
|
1596
|
-
// ../node_modules/lodash-es/_unicodeToArray.js
|
|
1597
|
-
var rsAstralRange2 = "\\ud800-\\udfff";
|
|
1598
|
-
var rsComboMarksRange2 = "\\u0300-\\u036f";
|
|
1599
|
-
var reComboHalfMarksRange2 = "\\ufe20-\\ufe2f";
|
|
1600
|
-
var rsComboSymbolsRange2 = "\\u20d0-\\u20ff";
|
|
1601
|
-
var rsComboRange2 = rsComboMarksRange2 + reComboHalfMarksRange2 + rsComboSymbolsRange2;
|
|
1602
|
-
var rsVarRange2 = "\\ufe0e\\ufe0f";
|
|
1603
|
-
var rsAstral = "[" + rsAstralRange2 + "]";
|
|
1604
|
-
var rsCombo = "[" + rsComboRange2 + "]";
|
|
1605
|
-
var rsFitz = "\\ud83c[\\udffb-\\udfff]";
|
|
1606
|
-
var rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")";
|
|
1607
|
-
var rsNonAstral = "[^" + rsAstralRange2 + "]";
|
|
1608
|
-
var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}";
|
|
1609
|
-
var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]";
|
|
1610
|
-
var rsZWJ2 = "\\u200d";
|
|
1611
|
-
var reOptMod = rsModifier + "?";
|
|
1612
|
-
var rsOptVar = "[" + rsVarRange2 + "]?";
|
|
1613
|
-
var rsOptJoin = "(?:" + rsZWJ2 + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*";
|
|
1614
|
-
var rsSeq = rsOptVar + reOptMod + rsOptJoin;
|
|
1615
|
-
var rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
|
|
1616
|
-
var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
|
|
1617
|
-
function unicodeToArray(string) {
|
|
1618
|
-
return string.match(reUnicode) || [];
|
|
1619
|
-
}
|
|
1620
|
-
var unicodeToArray_default = unicodeToArray;
|
|
1621
|
-
|
|
1622
|
-
// ../node_modules/lodash-es/_stringToArray.js
|
|
1623
|
-
function stringToArray(string) {
|
|
1624
|
-
return hasUnicode_default(string) ? unicodeToArray_default(string) : asciiToArray_default(string);
|
|
1625
|
-
}
|
|
1626
|
-
var stringToArray_default = stringToArray;
|
|
1627
|
-
|
|
1628
1671
|
// ../node_modules/lodash-es/_stackClear.js
|
|
1629
1672
|
function stackClear() {
|
|
1630
1673
|
this.__data__ = new ListCache_default();
|
|
@@ -2505,17 +2548,6 @@ function baseIteratee(value) {
|
|
|
2505
2548
|
}
|
|
2506
2549
|
var baseIteratee_default = baseIteratee;
|
|
2507
2550
|
|
|
2508
|
-
// ../node_modules/lodash-es/_arrayAggregator.js
|
|
2509
|
-
function arrayAggregator(array, setter, iteratee, accumulator) {
|
|
2510
|
-
var index = -1, length = array == null ? 0 : array.length;
|
|
2511
|
-
while (++index < length) {
|
|
2512
|
-
var value = array[index];
|
|
2513
|
-
setter(accumulator, value, iteratee(value), array);
|
|
2514
|
-
}
|
|
2515
|
-
return accumulator;
|
|
2516
|
-
}
|
|
2517
|
-
var arrayAggregator_default = arrayAggregator;
|
|
2518
|
-
|
|
2519
2551
|
// ../node_modules/lodash-es/_createBaseFor.js
|
|
2520
2552
|
function createBaseFor(fromRight) {
|
|
2521
2553
|
return function(object, iteratee, keysFunc) {
|
|
@@ -2565,24 +2597,6 @@ var createBaseEach_default = createBaseEach;
|
|
|
2565
2597
|
var baseEach = createBaseEach_default(baseForOwn_default);
|
|
2566
2598
|
var baseEach_default = baseEach;
|
|
2567
2599
|
|
|
2568
|
-
// ../node_modules/lodash-es/_baseAggregator.js
|
|
2569
|
-
function baseAggregator(collection, setter, iteratee, accumulator) {
|
|
2570
|
-
baseEach_default(collection, function(value, key, collection2) {
|
|
2571
|
-
setter(accumulator, value, iteratee(value), collection2);
|
|
2572
|
-
});
|
|
2573
|
-
return accumulator;
|
|
2574
|
-
}
|
|
2575
|
-
var baseAggregator_default = baseAggregator;
|
|
2576
|
-
|
|
2577
|
-
// ../node_modules/lodash-es/_createAggregator.js
|
|
2578
|
-
function createAggregator(setter, initializer) {
|
|
2579
|
-
return function(collection, iteratee) {
|
|
2580
|
-
var func = isArray_default(collection) ? arrayAggregator_default : baseAggregator_default, accumulator = initializer ? initializer() : {};
|
|
2581
|
-
return func(collection, setter, baseIteratee_default(iteratee, 2), accumulator);
|
|
2582
|
-
};
|
|
2583
|
-
}
|
|
2584
|
-
var createAggregator_default = createAggregator;
|
|
2585
|
-
|
|
2586
2600
|
// ../node_modules/lodash-es/_assignMergeValue.js
|
|
2587
2601
|
function assignMergeValue(object, key, value) {
|
|
2588
2602
|
if (value !== void 0 && !eq_default(object[key], value) || value === void 0 && !(key in object)) {
|
|
@@ -2681,18 +2695,6 @@ function baseMerge(object, source, srcIndex, customizer, stack) {
|
|
|
2681
2695
|
}
|
|
2682
2696
|
var baseMerge_default = baseMerge;
|
|
2683
2697
|
|
|
2684
|
-
// ../node_modules/lodash-es/_arrayIncludesWith.js
|
|
2685
|
-
function arrayIncludesWith(array, value, comparator) {
|
|
2686
|
-
var index = -1, length = array == null ? 0 : array.length;
|
|
2687
|
-
while (++index < length) {
|
|
2688
|
-
if (comparator(value, array[index])) {
|
|
2689
|
-
return true;
|
|
2690
|
-
}
|
|
2691
|
-
}
|
|
2692
|
-
return false;
|
|
2693
|
-
}
|
|
2694
|
-
var arrayIncludesWith_default = arrayIncludesWith;
|
|
2695
|
-
|
|
2696
2698
|
// ../node_modules/lodash-es/last.js
|
|
2697
2699
|
function last(array) {
|
|
2698
2700
|
var length = array == null ? 0 : array.length;
|
|
@@ -2710,48 +2712,18 @@ function baseMap(collection, iteratee) {
|
|
|
2710
2712
|
}
|
|
2711
2713
|
var baseMap_default = baseMap;
|
|
2712
2714
|
|
|
2713
|
-
// ../node_modules/lodash-es/groupBy.js
|
|
2714
|
-
var objectProto17 = Object.prototype;
|
|
2715
|
-
var hasOwnProperty14 = objectProto17.hasOwnProperty;
|
|
2716
|
-
var groupBy = createAggregator_default(function(result, value, key) {
|
|
2717
|
-
if (hasOwnProperty14.call(result, key)) {
|
|
2718
|
-
result[key].push(value);
|
|
2719
|
-
} else {
|
|
2720
|
-
baseAssignValue_default(result, key, [value]);
|
|
2721
|
-
}
|
|
2722
|
-
});
|
|
2723
|
-
var groupBy_default = groupBy;
|
|
2724
|
-
|
|
2725
2715
|
// ../node_modules/lodash-es/_parent.js
|
|
2726
2716
|
function parent(object, path2) {
|
|
2727
2717
|
return path2.length < 2 ? object : baseGet_default(object, baseSlice_default(path2, 0, -1));
|
|
2728
2718
|
}
|
|
2729
2719
|
var parent_default = parent;
|
|
2730
2720
|
|
|
2731
|
-
// ../node_modules/lodash-es/isEqual.js
|
|
2732
|
-
function isEqual(value, other) {
|
|
2733
|
-
return baseIsEqual_default(value, other);
|
|
2734
|
-
}
|
|
2735
|
-
var isEqual_default = isEqual;
|
|
2736
|
-
|
|
2737
2721
|
// ../node_modules/lodash-es/isNil.js
|
|
2738
2722
|
function isNil(value) {
|
|
2739
2723
|
return value == null;
|
|
2740
2724
|
}
|
|
2741
2725
|
var isNil_default = isNil;
|
|
2742
2726
|
|
|
2743
|
-
// ../node_modules/lodash-es/_baseIsRegExp.js
|
|
2744
|
-
var regexpTag5 = "[object RegExp]";
|
|
2745
|
-
function baseIsRegExp(value) {
|
|
2746
|
-
return isObjectLike_default(value) && baseGetTag_default(value) == regexpTag5;
|
|
2747
|
-
}
|
|
2748
|
-
var baseIsRegExp_default = baseIsRegExp;
|
|
2749
|
-
|
|
2750
|
-
// ../node_modules/lodash-es/isRegExp.js
|
|
2751
|
-
var nodeIsRegExp = nodeUtil_default && nodeUtil_default.isRegExp;
|
|
2752
|
-
var isRegExp = nodeIsRegExp ? baseUnary_default(nodeIsRegExp) : baseIsRegExp_default;
|
|
2753
|
-
var isRegExp_default = isRegExp;
|
|
2754
|
-
|
|
2755
2727
|
// ../node_modules/lodash-es/merge.js
|
|
2756
2728
|
var merge = createAssigner_default(function(object, source, srcIndex) {
|
|
2757
2729
|
baseMerge_default(object, source, srcIndex);
|
|
@@ -2983,86 +2955,6 @@ var sortBy = baseRest_default(function(collection, iteratees) {
|
|
|
2983
2955
|
});
|
|
2984
2956
|
var sortBy_default = sortBy;
|
|
2985
2957
|
|
|
2986
|
-
// ../node_modules/lodash-es/split.js
|
|
2987
|
-
var MAX_ARRAY_LENGTH = 4294967295;
|
|
2988
|
-
function split(string, separator, limit) {
|
|
2989
|
-
if (limit && typeof limit != "number" && isIterateeCall_default(string, separator, limit)) {
|
|
2990
|
-
separator = limit = void 0;
|
|
2991
|
-
}
|
|
2992
|
-
limit = limit === void 0 ? MAX_ARRAY_LENGTH : limit >>> 0;
|
|
2993
|
-
if (!limit) {
|
|
2994
|
-
return [];
|
|
2995
|
-
}
|
|
2996
|
-
string = toString_default(string);
|
|
2997
|
-
if (string && (typeof separator == "string" || separator != null && !isRegExp_default(separator))) {
|
|
2998
|
-
separator = baseToString_default(separator);
|
|
2999
|
-
if (!separator && hasUnicode_default(string)) {
|
|
3000
|
-
return castSlice_default(stringToArray_default(string), 0, limit);
|
|
3001
|
-
}
|
|
3002
|
-
}
|
|
3003
|
-
return string.split(separator, limit);
|
|
3004
|
-
}
|
|
3005
|
-
var split_default = split;
|
|
3006
|
-
|
|
3007
|
-
// ../node_modules/lodash-es/_createSet.js
|
|
3008
|
-
var INFINITY3 = 1 / 0;
|
|
3009
|
-
var createSet = !(Set_default && 1 / setToArray_default(new Set_default([, -0]))[1] == INFINITY3) ? noop_default : function(values) {
|
|
3010
|
-
return new Set_default(values);
|
|
3011
|
-
};
|
|
3012
|
-
var createSet_default = createSet;
|
|
3013
|
-
|
|
3014
|
-
// ../node_modules/lodash-es/_baseUniq.js
|
|
3015
|
-
var LARGE_ARRAY_SIZE2 = 200;
|
|
3016
|
-
function baseUniq(array, iteratee, comparator) {
|
|
3017
|
-
var index = -1, includes = arrayIncludes_default, length = array.length, isCommon = true, result = [], seen = result;
|
|
3018
|
-
if (comparator) {
|
|
3019
|
-
isCommon = false;
|
|
3020
|
-
includes = arrayIncludesWith_default;
|
|
3021
|
-
} else if (length >= LARGE_ARRAY_SIZE2) {
|
|
3022
|
-
var set = iteratee ? null : createSet_default(array);
|
|
3023
|
-
if (set) {
|
|
3024
|
-
return setToArray_default(set);
|
|
3025
|
-
}
|
|
3026
|
-
isCommon = false;
|
|
3027
|
-
includes = cacheHas_default;
|
|
3028
|
-
seen = new SetCache_default();
|
|
3029
|
-
} else {
|
|
3030
|
-
seen = iteratee ? [] : result;
|
|
3031
|
-
}
|
|
3032
|
-
outer:
|
|
3033
|
-
while (++index < length) {
|
|
3034
|
-
var value = array[index], computed = iteratee ? iteratee(value) : value;
|
|
3035
|
-
value = comparator || value !== 0 ? value : 0;
|
|
3036
|
-
if (isCommon && computed === computed) {
|
|
3037
|
-
var seenIndex = seen.length;
|
|
3038
|
-
while (seenIndex--) {
|
|
3039
|
-
if (seen[seenIndex] === computed) {
|
|
3040
|
-
continue outer;
|
|
3041
|
-
}
|
|
3042
|
-
}
|
|
3043
|
-
if (iteratee) {
|
|
3044
|
-
seen.push(computed);
|
|
3045
|
-
}
|
|
3046
|
-
result.push(value);
|
|
3047
|
-
} else if (!includes(seen, computed, comparator)) {
|
|
3048
|
-
if (seen !== result) {
|
|
3049
|
-
seen.push(computed);
|
|
3050
|
-
}
|
|
3051
|
-
result.push(value);
|
|
3052
|
-
}
|
|
3053
|
-
}
|
|
3054
|
-
return result;
|
|
3055
|
-
}
|
|
3056
|
-
var baseUniq_default = baseUniq;
|
|
3057
|
-
|
|
3058
|
-
// ../node_modules/lodash-es/unionWith.js
|
|
3059
|
-
var unionWith = baseRest_default(function(arrays) {
|
|
3060
|
-
var comparator = last_default(arrays);
|
|
3061
|
-
comparator = typeof comparator == "function" ? comparator : void 0;
|
|
3062
|
-
return baseUniq_default(baseFlatten_default(arrays, 1, isArrayLikeObject_default, true), void 0, comparator);
|
|
3063
|
-
});
|
|
3064
|
-
var unionWith_default = unionWith;
|
|
3065
|
-
|
|
3066
2958
|
// dist/utils/config.js
|
|
3067
2959
|
async function readNapiConfig(path2, configPath) {
|
|
3068
2960
|
if (configPath && !await fileExists(configPath)) {
|
|
@@ -3072,9 +2964,9 @@ async function readNapiConfig(path2, configPath) {
|
|
|
3072
2964
|
throw new Error(`package.json not found at ${path2}`);
|
|
3073
2965
|
}
|
|
3074
2966
|
const content = await readFileAsync(path2, "utf8");
|
|
3075
|
-
let
|
|
2967
|
+
let pkgJson;
|
|
3076
2968
|
try {
|
|
3077
|
-
|
|
2969
|
+
pkgJson = JSON.parse(content);
|
|
3078
2970
|
} catch (e) {
|
|
3079
2971
|
throw new Error(`Failed to parse package.json at ${path2}`, {
|
|
3080
2972
|
cause: e
|
|
@@ -3091,8 +2983,8 @@ async function readNapiConfig(path2, configPath) {
|
|
|
3091
2983
|
});
|
|
3092
2984
|
}
|
|
3093
2985
|
}
|
|
3094
|
-
const userNapiConfig =
|
|
3095
|
-
if (
|
|
2986
|
+
const userNapiConfig = pkgJson.napi ?? {};
|
|
2987
|
+
if (pkgJson.napi && separatedConfig) {
|
|
3096
2988
|
const pkgJsonPath = (0, import_colorette.underline)(path2);
|
|
3097
2989
|
const configPathUnderline = (0, import_colorette.underline)(configPath);
|
|
3098
2990
|
console.warn((0, import_colorette.yellow)(`Both napi field in ${pkgJsonPath} and [NAPI-RS config](${configPathUnderline}) file are found, the NAPI-RS config file will be used.`));
|
|
@@ -3100,9 +2992,9 @@ async function readNapiConfig(path2, configPath) {
|
|
|
3100
2992
|
}
|
|
3101
2993
|
const napiConfig = merge_default({
|
|
3102
2994
|
binaryName: "index",
|
|
3103
|
-
packageName:
|
|
2995
|
+
packageName: pkgJson.name,
|
|
3104
2996
|
targets: [],
|
|
3105
|
-
packageJson:
|
|
2997
|
+
packageJson: pkgJson,
|
|
3106
2998
|
npmClient: "npm"
|
|
3107
2999
|
}, omit_default(userNapiConfig, "targets"));
|
|
3108
3000
|
let targets = userNapiConfig.targets ?? [];
|
|
@@ -3227,11 +3119,10 @@ function exportDeclare(ambient) {
|
|
|
3227
3119
|
}
|
|
3228
3120
|
return "export declare";
|
|
3229
3121
|
}
|
|
3230
|
-
async function processTypeDef(intermediateTypeFile, constEnum
|
|
3122
|
+
async function processTypeDef(intermediateTypeFile, constEnum) {
|
|
3231
3123
|
const exports2 = [];
|
|
3232
3124
|
const defs = await readIntermediateTypeFile(intermediateTypeFile);
|
|
3233
3125
|
const groupedDefs = preprocessTypeDef(defs);
|
|
3234
|
-
header = header ?? "";
|
|
3235
3126
|
const dts = sortBy_default(Array.from(groupedDefs), ([namespace]) => namespace).map(([namespace, defs2]) => {
|
|
3236
3127
|
if (namespace === TOP_LEVEL_NAMESPACE) {
|
|
3237
3128
|
return defs2.map((def) => {
|
|
@@ -3264,31 +3155,17 @@ async function processTypeDef(intermediateTypeFile, constEnum, header) {
|
|
|
3264
3155
|
return declaration;
|
|
3265
3156
|
}
|
|
3266
3157
|
}).join("\n\n") + "\n";
|
|
3267
|
-
if (dts.indexOf("ExternalObject<") > -1) {
|
|
3268
|
-
header += `
|
|
3269
|
-
export declare class ExternalObject<T> {
|
|
3270
|
-
readonly '': {
|
|
3271
|
-
readonly '': unique symbol
|
|
3272
|
-
[K: symbol]: T
|
|
3273
|
-
}
|
|
3274
|
-
}
|
|
3275
|
-
`;
|
|
3276
|
-
}
|
|
3277
3158
|
return {
|
|
3278
|
-
dts
|
|
3159
|
+
dts,
|
|
3279
3160
|
exports: exports2
|
|
3280
3161
|
};
|
|
3281
3162
|
}
|
|
3282
3163
|
async function readIntermediateTypeFile(file) {
|
|
3283
3164
|
const content = await readFileAsync(file, "utf8");
|
|
3284
|
-
const defs =
|
|
3165
|
+
const defs = content.split("\n").filter(Boolean).map((line) => {
|
|
3285
3166
|
line = line.trim();
|
|
3286
|
-
if (!line.startsWith("{")) {
|
|
3287
|
-
const start = line.indexOf(":") + 1;
|
|
3288
|
-
line = line.slice(start);
|
|
3289
|
-
}
|
|
3290
3167
|
return JSON.parse(line);
|
|
3291
|
-
})
|
|
3168
|
+
});
|
|
3292
3169
|
return defs.sort((a, b) => {
|
|
3293
3170
|
if (a.kind === TypeDefKind.Struct) {
|
|
3294
3171
|
if (b.kind === TypeDefKind.Struct) {
|
|
@@ -3430,7 +3307,7 @@ async function collectNodeBinaries(root2) {
|
|
|
3430
3307
|
var import_node_child_process4 = require("node:child_process");
|
|
3431
3308
|
var import_node_crypto = require("node:crypto");
|
|
3432
3309
|
var import_node_fs3 = require("node:fs");
|
|
3433
|
-
var
|
|
3310
|
+
var import_node_module = require("node:module");
|
|
3434
3311
|
var import_node_os = require("node:os");
|
|
3435
3312
|
var import_node_path2 = require("node:path");
|
|
3436
3313
|
var colors3 = __toESM(require("colorette"), 1);
|
|
@@ -4937,17 +4814,14 @@ globalThis.onmessage = function (e) {
|
|
|
4937
4814
|
|
|
4938
4815
|
// dist/api/build.js
|
|
4939
4816
|
var debug3 = debugFactory("build");
|
|
4940
|
-
var
|
|
4817
|
+
var require2 = (0, import_node_module.createRequire)(__filename);
|
|
4941
4818
|
async function buildProject(options) {
|
|
4942
4819
|
debug3("napi build command receive options: %O", options);
|
|
4943
|
-
options = {
|
|
4944
|
-
dtsCache: true,
|
|
4945
|
-
...options
|
|
4946
|
-
};
|
|
4820
|
+
options = { dtsCache: true, ...options };
|
|
4947
4821
|
const cwd = options.cwd ?? process.cwd();
|
|
4948
4822
|
const resolvePath = (...paths) => (0, import_node_path2.resolve)(cwd, ...paths);
|
|
4949
4823
|
const manifestPath = resolvePath(options.manifestPath ?? "Cargo.toml");
|
|
4950
|
-
const metadata = parseMetadata(manifestPath);
|
|
4824
|
+
const metadata = await parseMetadata(manifestPath);
|
|
4951
4825
|
const pkg = metadata.packages.find((p) => {
|
|
4952
4826
|
if (options.package) {
|
|
4953
4827
|
return p.name === options.package;
|
|
@@ -4958,9 +4832,8 @@ async function buildProject(options) {
|
|
|
4958
4832
|
if (!pkg) {
|
|
4959
4833
|
throw new Error("Unable to find crate to build. It seems you are trying to build a crate in a workspace, try using `--package` option to specify the package to build.");
|
|
4960
4834
|
}
|
|
4961
|
-
const depsNapiPackages = pkg.dependencies.map((p) => metadata.packages.find((c) => c.name === p.name)).filter((c) => c != null && c.dependencies.some((d) => d.name == "napi-derive"));
|
|
4962
4835
|
const crateDir = (0, import_node_path2.parse)(pkg.manifest_path).dir;
|
|
4963
|
-
const builder = new Builder(options, pkg, cwd, options.target ? parseTriple(options.target) : process.env.CARGO_BUILD_TARGET ? parseTriple(process.env.CARGO_BUILD_TARGET) : getSystemDefaultTarget(), crateDir, resolvePath(options.outputDir ?? crateDir), options.targetDir ?? process.env.CARGO_BUILD_TARGET_DIR ?? metadata.target_directory, await readNapiConfig(resolvePath(options.configPath ?? options.packageJsonPath ?? "package.json"), options.configPath ? resolvePath(options.configPath) : void 0)
|
|
4836
|
+
const builder = new Builder(options, pkg, cwd, options.target ? parseTriple(options.target) : process.env.CARGO_BUILD_TARGET ? parseTriple(process.env.CARGO_BUILD_TARGET) : getSystemDefaultTarget(), crateDir, resolvePath(options.outputDir ?? crateDir), options.targetDir ?? process.env.CARGO_BUILD_TARGET_DIR ?? metadata.target_directory, await readNapiConfig(resolvePath(options.configPath ?? options.packageJsonPath ?? "package.json"), options.configPath ? resolvePath(options.configPath) : void 0));
|
|
4964
4837
|
return builder.build();
|
|
4965
4838
|
}
|
|
4966
4839
|
var Builder = class {
|
|
@@ -4972,11 +4845,10 @@ var Builder = class {
|
|
|
4972
4845
|
outputDir;
|
|
4973
4846
|
targetDir;
|
|
4974
4847
|
config;
|
|
4975
|
-
depsNapiPackages;
|
|
4976
4848
|
args = [];
|
|
4977
4849
|
envs = {};
|
|
4978
4850
|
outputs = [];
|
|
4979
|
-
constructor(options, crate, cwd, target, crateDir, outputDir, targetDir, config
|
|
4851
|
+
constructor(options, crate, cwd, target, crateDir, outputDir, targetDir, config) {
|
|
4980
4852
|
this.options = options;
|
|
4981
4853
|
this.crate = crate;
|
|
4982
4854
|
this.cwd = cwd;
|
|
@@ -4985,7 +4857,6 @@ var Builder = class {
|
|
|
4985
4857
|
this.outputDir = outputDir;
|
|
4986
4858
|
this.targetDir = targetDir;
|
|
4987
4859
|
this.config = config;
|
|
4988
|
-
this.depsNapiPackages = depsNapiPackages;
|
|
4989
4860
|
}
|
|
4990
4861
|
get cdyLibName() {
|
|
4991
4862
|
return this.crate.targets.find((t) => t.crate_types.includes("cdylib"))?.name;
|
|
@@ -5016,7 +4887,7 @@ var Builder = class {
|
|
|
5016
4887
|
debug3.warn("You are trying to use both `--cross-compile` and `--use-napi-cross` options, `--cross-compile` will be ignored.");
|
|
5017
4888
|
}
|
|
5018
4889
|
try {
|
|
5019
|
-
const { version: version2, download } =
|
|
4890
|
+
const { version: version2, download } = require2("@napi-rs/cross-toolchain");
|
|
5020
4891
|
const alias = {
|
|
5021
4892
|
"s390x-unknown-linux-gnu": "s390x-ibm-linux-gnu"
|
|
5022
4893
|
};
|
|
@@ -5080,10 +4951,7 @@ var Builder = class {
|
|
|
5080
4951
|
}
|
|
5081
4952
|
const command = process.env.CARGO ?? (this.options.useCross ? "cross" : "cargo");
|
|
5082
4953
|
const buildProcess = (0, import_node_child_process4.spawn)(command, this.args, {
|
|
5083
|
-
env: {
|
|
5084
|
-
...process.env,
|
|
5085
|
-
...this.envs
|
|
5086
|
-
},
|
|
4954
|
+
env: { ...process.env, ...this.envs },
|
|
5087
4955
|
stdio: watch ? ["inherit", "inherit", "pipe"] : "inherit",
|
|
5088
4956
|
cwd: this.cwd,
|
|
5089
4957
|
signal: controller.signal
|
|
@@ -5097,9 +4965,7 @@ var Builder = class {
|
|
|
5097
4965
|
}
|
|
5098
4966
|
});
|
|
5099
4967
|
buildProcess.once("error", (e) => {
|
|
5100
|
-
reject(new Error(`Build failed with error: ${e.message}`, {
|
|
5101
|
-
cause: e
|
|
5102
|
-
}));
|
|
4968
|
+
reject(new Error(`Build failed with error: ${e.message}`, { cause: e }));
|
|
5103
4969
|
});
|
|
5104
4970
|
buildProcess.stderr?.on("data", (data) => {
|
|
5105
4971
|
const output = data.toString();
|
|
@@ -5187,58 +5053,7 @@ var Builder = class {
|
|
|
5187
5053
|
return this;
|
|
5188
5054
|
}
|
|
5189
5055
|
setEnvs() {
|
|
5190
|
-
this.envs.
|
|
5191
|
-
if ((0, import_node_fs3.existsSync)(this.envs.TYPE_DEF_TMP_PATH)) {
|
|
5192
|
-
const { depsNapiPackages, crate } = this;
|
|
5193
|
-
let shouldInvalidateSelf = false;
|
|
5194
|
-
const content = (0, import_node_fs3.readFileSync)(this.envs.TYPE_DEF_TMP_PATH, "utf-8");
|
|
5195
|
-
const typedefRaw = content.split("\n").filter((line) => line.trim().length).map((line) => {
|
|
5196
|
-
const [pkgName, ...jsonContents] = split_default(line, ":");
|
|
5197
|
-
return {
|
|
5198
|
-
pkgName,
|
|
5199
|
-
jsonContent: jsonContents.join(":")
|
|
5200
|
-
};
|
|
5201
|
-
});
|
|
5202
|
-
const groupedTypedefRaw = groupBy_default(typedefRaw, ({ pkgName }) => pkgName);
|
|
5203
|
-
const invalidPackages = /* @__PURE__ */ new Set();
|
|
5204
|
-
for (const [pkgName, value] of Object.entries(groupedTypedefRaw)) {
|
|
5205
|
-
const packageInvalidKey = `NAPI_PACKAGE_${pkgName.toUpperCase().replaceAll("-", "_")}_INVALID`;
|
|
5206
|
-
let done = false;
|
|
5207
|
-
for (const { jsonContent } of value) {
|
|
5208
|
-
try {
|
|
5209
|
-
const json = JSON.parse(jsonContent);
|
|
5210
|
-
if (json.done === true) {
|
|
5211
|
-
done = true;
|
|
5212
|
-
break;
|
|
5213
|
-
}
|
|
5214
|
-
} catch {
|
|
5215
|
-
done = false;
|
|
5216
|
-
break;
|
|
5217
|
-
}
|
|
5218
|
-
}
|
|
5219
|
-
if (!done) {
|
|
5220
|
-
process.env[packageInvalidKey] = `${Date.now()}`;
|
|
5221
|
-
shouldInvalidateSelf = true;
|
|
5222
|
-
invalidPackages.add(pkgName);
|
|
5223
|
-
}
|
|
5224
|
-
}
|
|
5225
|
-
const typedefPackages = new Set(Object.keys(groupedTypedefRaw));
|
|
5226
|
-
for (const crate2 of depsNapiPackages) {
|
|
5227
|
-
if (!typedefPackages.has(crate2.name)) {
|
|
5228
|
-
debug3("Set invalid package typedef: %i", crate2.name);
|
|
5229
|
-
shouldInvalidateSelf = true;
|
|
5230
|
-
process.env[`NAPI_PACKAGE_${crate2.name.toUpperCase().replaceAll("-", "_")}_INVALID`] = `${Date.now()}`;
|
|
5231
|
-
}
|
|
5232
|
-
}
|
|
5233
|
-
if (shouldInvalidateSelf) {
|
|
5234
|
-
debug3("Set invalid package typedef: %i", crate.name);
|
|
5235
|
-
process.env[`NAPI_PACKAGE_${crate.name.toUpperCase().replaceAll("-", "_")}_INVALID`] = `${Date.now()}`;
|
|
5236
|
-
}
|
|
5237
|
-
if (invalidPackages.size) {
|
|
5238
|
-
debug3("Clean invalid packages typedef: %O", invalidPackages);
|
|
5239
|
-
(0, import_node_fs3.writeFileSync)(this.envs.TYPE_DEF_TMP_PATH, typedefRaw.filter(({ pkgName }) => !invalidPackages.has(pkgName)).map(({ pkgName, jsonContent }) => `${pkgName}:${jsonContent}`).join("\n"));
|
|
5240
|
-
}
|
|
5241
|
-
}
|
|
5056
|
+
this.envs.TYPE_DEF_TMP_FOLDER = this.generateIntermediateTypeDefFolder();
|
|
5242
5057
|
let rustflags = process.env.RUSTFLAGS ?? process.env.CARGO_BUILD_RUSTFLAGS ?? "";
|
|
5243
5058
|
if (this.target.abi?.includes("musl") && !rustflags.includes("target-feature=-crt-static")) {
|
|
5244
5059
|
rustflags += " -C target-feature=-crt-static";
|
|
@@ -5274,7 +5089,7 @@ var Builder = class {
|
|
|
5274
5089
|
});
|
|
5275
5090
|
}
|
|
5276
5091
|
if (this.target.platform === "wasi") {
|
|
5277
|
-
const emnapi = (0, import_node_path2.join)(
|
|
5092
|
+
const emnapi = (0, import_node_path2.join)(require2.resolve("emnapi"), "..", "lib", "wasm32-wasi-threads");
|
|
5278
5093
|
this.envs.EMNAPI_LINK_DIR = emnapi;
|
|
5279
5094
|
this.envs.SETJMP_LINK_DIR = import_wasm_sjlj.lib;
|
|
5280
5095
|
const { WASI_SDK_PATH } = process.env;
|
|
@@ -5337,16 +5152,14 @@ var Builder = class {
|
|
|
5337
5152
|
}
|
|
5338
5153
|
return this;
|
|
5339
5154
|
}
|
|
5340
|
-
|
|
5341
|
-
|
|
5155
|
+
generateIntermediateTypeDefFolder() {
|
|
5156
|
+
let folder = (0, import_node_path2.join)(this.targetDir, "napi-rs", `${this.crate.name}-${(0, import_node_crypto.createHash)("sha256").update(this.crate.manifest_path).update(CLI_VERSION).digest("hex").substring(0, 8)}`);
|
|
5342
5157
|
if (!this.options.dtsCache) {
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
} catch {
|
|
5346
|
-
}
|
|
5347
|
-
return `${dtsPath}_${Date.now()}.tmp`;
|
|
5158
|
+
(0, import_node_fs3.rmSync)(folder, { recursive: true, force: true });
|
|
5159
|
+
folder += `_${Date.now()}`;
|
|
5348
5160
|
}
|
|
5349
|
-
|
|
5161
|
+
mkdirAsync(folder, { recursive: true });
|
|
5162
|
+
return folder;
|
|
5350
5163
|
}
|
|
5351
5164
|
async postBuild() {
|
|
5352
5165
|
try {
|
|
@@ -5414,9 +5227,7 @@ var Builder = class {
|
|
|
5414
5227
|
});
|
|
5415
5228
|
return wasmBinaryName ? (0, import_node_path2.join)(this.outputDir, wasmBinaryName) : null;
|
|
5416
5229
|
} catch (e) {
|
|
5417
|
-
throw new Error("Failed to copy artifact", {
|
|
5418
|
-
cause: e
|
|
5419
|
-
});
|
|
5230
|
+
throw new Error("Failed to copy artifact", { cause: e });
|
|
5420
5231
|
}
|
|
5421
5232
|
}
|
|
5422
5233
|
getArtifactNames() {
|
|
@@ -5445,22 +5256,56 @@ var Builder = class {
|
|
|
5445
5256
|
return [];
|
|
5446
5257
|
}
|
|
5447
5258
|
async generateTypeDef() {
|
|
5448
|
-
|
|
5259
|
+
const typeDefDir = this.envs.TYPE_DEF_TMP_FOLDER;
|
|
5260
|
+
if (!await dirExistsAsync(typeDefDir)) {
|
|
5449
5261
|
return [];
|
|
5450
5262
|
}
|
|
5451
5263
|
const dest = (0, import_node_path2.join)(this.outputDir, this.options.dts ?? "index.d.ts");
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
|
|
5264
|
+
let header = "";
|
|
5265
|
+
let dts = "";
|
|
5266
|
+
let exports2 = [];
|
|
5267
|
+
if (!this.options.noDtsHeader) {
|
|
5268
|
+
if (this.options.dtsHeader) {
|
|
5269
|
+
header = this.options.dtsHeader;
|
|
5270
|
+
} else if (this.config.dtsHeaderFile) {
|
|
5271
|
+
try {
|
|
5272
|
+
header = await readFileAsync((0, import_node_path2.join)(this.cwd, this.config.dtsHeaderFile), "utf-8");
|
|
5273
|
+
} catch (e) {
|
|
5274
|
+
debug3.warn(`Failed to read dts header file ${this.config.dtsHeaderFile}`, e);
|
|
5275
|
+
}
|
|
5276
|
+
} else {
|
|
5277
|
+
header = DEFAULT_TYPE_DEF_HEADER;
|
|
5278
|
+
}
|
|
5279
|
+
}
|
|
5280
|
+
const files = await readdirAsync(typeDefDir, { withFileTypes: true });
|
|
5281
|
+
if (!files.length) {
|
|
5282
|
+
debug3("No type def files found. Skip generating dts file.");
|
|
5283
|
+
return [];
|
|
5284
|
+
}
|
|
5285
|
+
for (const file of files) {
|
|
5286
|
+
if (!file.isFile()) {
|
|
5287
|
+
continue;
|
|
5288
|
+
}
|
|
5289
|
+
const { dts: fileDts, exports: fileExports } = await processTypeDef((0, import_node_path2.join)(typeDefDir, file.name), this.options.constEnum ?? this.config.constEnum ?? true);
|
|
5290
|
+
dts += fileDts;
|
|
5291
|
+
exports2.push(...fileExports);
|
|
5292
|
+
}
|
|
5293
|
+
if (dts.indexOf("ExternalObject<") > -1) {
|
|
5294
|
+
header += `
|
|
5295
|
+
export declare class ExternalObject<T> {
|
|
5296
|
+
readonly '': {
|
|
5297
|
+
readonly '': unique symbol
|
|
5298
|
+
[K: symbol]: T
|
|
5299
|
+
}
|
|
5300
|
+
}
|
|
5301
|
+
`;
|
|
5302
|
+
}
|
|
5303
|
+
dts = header + dts;
|
|
5456
5304
|
try {
|
|
5457
5305
|
debug3("Writing type def to:");
|
|
5458
5306
|
debug3(" %i", dest);
|
|
5459
5307
|
await writeFileAsync(dest, dts, "utf-8");
|
|
5460
|
-
this.outputs.push({
|
|
5461
|
-
kind: "dts",
|
|
5462
|
-
path: dest
|
|
5463
|
-
});
|
|
5308
|
+
this.outputs.push({ kind: "dts", path: dest });
|
|
5464
5309
|
} catch (e) {
|
|
5465
5310
|
debug3.error("Failed to write type def file");
|
|
5466
5311
|
debug3.error(e);
|
|
@@ -5480,10 +5325,7 @@ var Builder = class {
|
|
|
5480
5325
|
debug3("Writing js binding to:");
|
|
5481
5326
|
debug3(" %i", dest);
|
|
5482
5327
|
await writeFileAsync(dest, binding, "utf-8");
|
|
5483
|
-
return {
|
|
5484
|
-
kind: "js",
|
|
5485
|
-
path: dest
|
|
5486
|
-
};
|
|
5328
|
+
return { kind: "js", path: dest };
|
|
5487
5329
|
} catch (e) {
|
|
5488
5330
|
throw new Error("Failed to write js binding file", { cause: e });
|
|
5489
5331
|
}
|
|
@@ -5506,26 +5348,11 @@ var Builder = class {
|
|
|
5506
5348
|
await writeFileAsync(browserEntryPath, `export * from '${this.config.packageName}-wasm32-wasi'
|
|
5507
5349
|
`);
|
|
5508
5350
|
return [
|
|
5509
|
-
{
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
},
|
|
5513
|
-
{
|
|
5514
|
-
kind: "js",
|
|
5515
|
-
path: browserBindingPath
|
|
5516
|
-
},
|
|
5517
|
-
{
|
|
5518
|
-
kind: "js",
|
|
5519
|
-
path: workerPath
|
|
5520
|
-
},
|
|
5521
|
-
{
|
|
5522
|
-
kind: "js",
|
|
5523
|
-
path: browserWorkerPath
|
|
5524
|
-
},
|
|
5525
|
-
{
|
|
5526
|
-
kind: "js",
|
|
5527
|
-
path: browserEntryPath
|
|
5528
|
-
}
|
|
5351
|
+
{ kind: "js", path: bindingPath },
|
|
5352
|
+
{ kind: "js", path: browserBindingPath },
|
|
5353
|
+
{ kind: "js", path: workerPath },
|
|
5354
|
+
{ kind: "js", path: browserWorkerPath },
|
|
5355
|
+
{ kind: "js", path: browserEntryPath }
|
|
5529
5356
|
];
|
|
5530
5357
|
}
|
|
5531
5358
|
return [];
|
|
@@ -6733,10 +6560,10 @@ var createTokenAuth = function createTokenAuth2(token) {
|
|
|
6733
6560
|
};
|
|
6734
6561
|
|
|
6735
6562
|
// ../node_modules/@octokit/rest/node_modules/@octokit/core/dist-src/version.js
|
|
6736
|
-
var VERSION4 = "
|
|
6563
|
+
var VERSION4 = "7.0.2";
|
|
6737
6564
|
|
|
6738
6565
|
// ../node_modules/@octokit/rest/node_modules/@octokit/core/dist-src/index.js
|
|
6739
|
-
var
|
|
6566
|
+
var noop = () => {
|
|
6740
6567
|
};
|
|
6741
6568
|
var consoleWarn = console.warn.bind(console);
|
|
6742
6569
|
var consoleError = console.error.bind(console);
|
|
@@ -6809,8 +6636,8 @@ var Octokit = class {
|
|
|
6809
6636
|
this.graphql = withCustomRequest(this.request).defaults(requestDefaults);
|
|
6810
6637
|
this.log = Object.assign(
|
|
6811
6638
|
{
|
|
6812
|
-
debug:
|
|
6813
|
-
info:
|
|
6639
|
+
debug: noop,
|
|
6640
|
+
info: noop,
|
|
6814
6641
|
warn: consoleWarn,
|
|
6815
6642
|
error: consoleError
|
|
6816
6643
|
},
|
|
@@ -6863,7 +6690,7 @@ var Octokit = class {
|
|
|
6863
6690
|
};
|
|
6864
6691
|
|
|
6865
6692
|
// ../node_modules/@octokit/rest/node_modules/@octokit/plugin-request-log/dist-src/version.js
|
|
6866
|
-
var VERSION5 = "
|
|
6693
|
+
var VERSION5 = "6.0.0";
|
|
6867
6694
|
|
|
6868
6695
|
// ../node_modules/@octokit/rest/node_modules/@octokit/plugin-request-log/dist-src/index.js
|
|
6869
6696
|
function requestLog(octokit) {
|
|
@@ -6993,7 +6820,7 @@ function paginateRest(octokit) {
|
|
|
6993
6820
|
paginateRest.VERSION = VERSION6;
|
|
6994
6821
|
|
|
6995
6822
|
// ../node_modules/@octokit/rest/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js
|
|
6996
|
-
var VERSION7 = "
|
|
6823
|
+
var VERSION7 = "16.0.0";
|
|
6997
6824
|
|
|
6998
6825
|
// ../node_modules/@octokit/rest/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js
|
|
6999
6826
|
var Endpoints = {
|
|
@@ -7467,6 +7294,9 @@ var Endpoints = {
|
|
|
7467
7294
|
getGithubBillingUsageReportOrg: [
|
|
7468
7295
|
"GET /organizations/{org}/settings/billing/usage"
|
|
7469
7296
|
],
|
|
7297
|
+
getGithubBillingUsageReportUser: [
|
|
7298
|
+
"GET /users/{username}/settings/billing/usage"
|
|
7299
|
+
],
|
|
7470
7300
|
getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"],
|
|
7471
7301
|
getGithubPackagesBillingUser: [
|
|
7472
7302
|
"GET /users/{username}/settings/billing/packages"
|
|
@@ -7478,6 +7308,13 @@ var Endpoints = {
|
|
|
7478
7308
|
"GET /users/{username}/settings/billing/shared-storage"
|
|
7479
7309
|
]
|
|
7480
7310
|
},
|
|
7311
|
+
campaigns: {
|
|
7312
|
+
createCampaign: ["POST /orgs/{org}/campaigns"],
|
|
7313
|
+
deleteCampaign: ["DELETE /orgs/{org}/campaigns/{campaign_number}"],
|
|
7314
|
+
getCampaignSummary: ["GET /orgs/{org}/campaigns/{campaign_number}"],
|
|
7315
|
+
listOrgCampaigns: ["GET /orgs/{org}/campaigns"],
|
|
7316
|
+
updateCampaign: ["PATCH /orgs/{org}/campaigns/{campaign_number}"]
|
|
7317
|
+
},
|
|
7481
7318
|
checks: {
|
|
7482
7319
|
create: ["POST /repos/{owner}/{repo}/check-runs"],
|
|
7483
7320
|
createSuite: ["POST /repos/{owner}/{repo}/check-suites"],
|
|
@@ -7756,10 +7593,9 @@ var Endpoints = {
|
|
|
7756
7593
|
getCopilotSeatDetailsForUser: [
|
|
7757
7594
|
"GET /orgs/{org}/members/{username}/copilot"
|
|
7758
7595
|
],
|
|
7759
|
-
listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
|
|
7760
|
-
usageMetricsForOrg: ["GET /orgs/{org}/copilot/usage"],
|
|
7761
|
-
usageMetricsForTeam: ["GET /orgs/{org}/team/{team_slug}/copilot/usage"]
|
|
7596
|
+
listCopilotSeats: ["GET /orgs/{org}/copilot/billing/seats"]
|
|
7762
7597
|
},
|
|
7598
|
+
credentials: { revoke: ["POST /credentials/revoke"] },
|
|
7763
7599
|
dependabot: {
|
|
7764
7600
|
addSelectedRepoToOrgSecret: [
|
|
7765
7601
|
"PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"
|
|
@@ -8298,183 +8134,6 @@ var Endpoints = {
|
|
|
8298
8134
|
"PATCH /orgs/{org}/private-registries/{secret_name}"
|
|
8299
8135
|
]
|
|
8300
8136
|
},
|
|
8301
|
-
projects: {
|
|
8302
|
-
addCollaborator: [
|
|
8303
|
-
"PUT /projects/{project_id}/collaborators/{username}",
|
|
8304
|
-
{},
|
|
8305
|
-
{
|
|
8306
|
-
deprecated: "octokit.rest.projects.addCollaborator() is deprecated, see https://docs.github.com/rest/projects/collaborators#add-project-collaborator"
|
|
8307
|
-
}
|
|
8308
|
-
],
|
|
8309
|
-
createCard: [
|
|
8310
|
-
"POST /projects/columns/{column_id}/cards",
|
|
8311
|
-
{},
|
|
8312
|
-
{
|
|
8313
|
-
deprecated: "octokit.rest.projects.createCard() is deprecated, see https://docs.github.com/rest/projects/cards#create-a-project-card"
|
|
8314
|
-
}
|
|
8315
|
-
],
|
|
8316
|
-
createColumn: [
|
|
8317
|
-
"POST /projects/{project_id}/columns",
|
|
8318
|
-
{},
|
|
8319
|
-
{
|
|
8320
|
-
deprecated: "octokit.rest.projects.createColumn() is deprecated, see https://docs.github.com/rest/projects/columns#create-a-project-column"
|
|
8321
|
-
}
|
|
8322
|
-
],
|
|
8323
|
-
createForAuthenticatedUser: [
|
|
8324
|
-
"POST /user/projects",
|
|
8325
|
-
{},
|
|
8326
|
-
{
|
|
8327
|
-
deprecated: "octokit.rest.projects.createForAuthenticatedUser() is deprecated, see https://docs.github.com/rest/projects/projects#create-a-user-project"
|
|
8328
|
-
}
|
|
8329
|
-
],
|
|
8330
|
-
createForOrg: [
|
|
8331
|
-
"POST /orgs/{org}/projects",
|
|
8332
|
-
{},
|
|
8333
|
-
{
|
|
8334
|
-
deprecated: "octokit.rest.projects.createForOrg() is deprecated, see https://docs.github.com/rest/projects/projects#create-an-organization-project"
|
|
8335
|
-
}
|
|
8336
|
-
],
|
|
8337
|
-
createForRepo: [
|
|
8338
|
-
"POST /repos/{owner}/{repo}/projects",
|
|
8339
|
-
{},
|
|
8340
|
-
{
|
|
8341
|
-
deprecated: "octokit.rest.projects.createForRepo() is deprecated, see https://docs.github.com/rest/projects/projects#create-a-repository-project"
|
|
8342
|
-
}
|
|
8343
|
-
],
|
|
8344
|
-
delete: [
|
|
8345
|
-
"DELETE /projects/{project_id}",
|
|
8346
|
-
{},
|
|
8347
|
-
{
|
|
8348
|
-
deprecated: "octokit.rest.projects.delete() is deprecated, see https://docs.github.com/rest/projects/projects#delete-a-project"
|
|
8349
|
-
}
|
|
8350
|
-
],
|
|
8351
|
-
deleteCard: [
|
|
8352
|
-
"DELETE /projects/columns/cards/{card_id}",
|
|
8353
|
-
{},
|
|
8354
|
-
{
|
|
8355
|
-
deprecated: "octokit.rest.projects.deleteCard() is deprecated, see https://docs.github.com/rest/projects/cards#delete-a-project-card"
|
|
8356
|
-
}
|
|
8357
|
-
],
|
|
8358
|
-
deleteColumn: [
|
|
8359
|
-
"DELETE /projects/columns/{column_id}",
|
|
8360
|
-
{},
|
|
8361
|
-
{
|
|
8362
|
-
deprecated: "octokit.rest.projects.deleteColumn() is deprecated, see https://docs.github.com/rest/projects/columns#delete-a-project-column"
|
|
8363
|
-
}
|
|
8364
|
-
],
|
|
8365
|
-
get: [
|
|
8366
|
-
"GET /projects/{project_id}",
|
|
8367
|
-
{},
|
|
8368
|
-
{
|
|
8369
|
-
deprecated: "octokit.rest.projects.get() is deprecated, see https://docs.github.com/rest/projects/projects#get-a-project"
|
|
8370
|
-
}
|
|
8371
|
-
],
|
|
8372
|
-
getCard: [
|
|
8373
|
-
"GET /projects/columns/cards/{card_id}",
|
|
8374
|
-
{},
|
|
8375
|
-
{
|
|
8376
|
-
deprecated: "octokit.rest.projects.getCard() is deprecated, see https://docs.github.com/rest/projects/cards#get-a-project-card"
|
|
8377
|
-
}
|
|
8378
|
-
],
|
|
8379
|
-
getColumn: [
|
|
8380
|
-
"GET /projects/columns/{column_id}",
|
|
8381
|
-
{},
|
|
8382
|
-
{
|
|
8383
|
-
deprecated: "octokit.rest.projects.getColumn() is deprecated, see https://docs.github.com/rest/projects/columns#get-a-project-column"
|
|
8384
|
-
}
|
|
8385
|
-
],
|
|
8386
|
-
getPermissionForUser: [
|
|
8387
|
-
"GET /projects/{project_id}/collaborators/{username}/permission",
|
|
8388
|
-
{},
|
|
8389
|
-
{
|
|
8390
|
-
deprecated: "octokit.rest.projects.getPermissionForUser() is deprecated, see https://docs.github.com/rest/projects/collaborators#get-project-permission-for-a-user"
|
|
8391
|
-
}
|
|
8392
|
-
],
|
|
8393
|
-
listCards: [
|
|
8394
|
-
"GET /projects/columns/{column_id}/cards",
|
|
8395
|
-
{},
|
|
8396
|
-
{
|
|
8397
|
-
deprecated: "octokit.rest.projects.listCards() is deprecated, see https://docs.github.com/rest/projects/cards#list-project-cards"
|
|
8398
|
-
}
|
|
8399
|
-
],
|
|
8400
|
-
listCollaborators: [
|
|
8401
|
-
"GET /projects/{project_id}/collaborators",
|
|
8402
|
-
{},
|
|
8403
|
-
{
|
|
8404
|
-
deprecated: "octokit.rest.projects.listCollaborators() is deprecated, see https://docs.github.com/rest/projects/collaborators#list-project-collaborators"
|
|
8405
|
-
}
|
|
8406
|
-
],
|
|
8407
|
-
listColumns: [
|
|
8408
|
-
"GET /projects/{project_id}/columns",
|
|
8409
|
-
{},
|
|
8410
|
-
{
|
|
8411
|
-
deprecated: "octokit.rest.projects.listColumns() is deprecated, see https://docs.github.com/rest/projects/columns#list-project-columns"
|
|
8412
|
-
}
|
|
8413
|
-
],
|
|
8414
|
-
listForOrg: [
|
|
8415
|
-
"GET /orgs/{org}/projects",
|
|
8416
|
-
{},
|
|
8417
|
-
{
|
|
8418
|
-
deprecated: "octokit.rest.projects.listForOrg() is deprecated, see https://docs.github.com/rest/projects/projects#list-organization-projects"
|
|
8419
|
-
}
|
|
8420
|
-
],
|
|
8421
|
-
listForRepo: [
|
|
8422
|
-
"GET /repos/{owner}/{repo}/projects",
|
|
8423
|
-
{},
|
|
8424
|
-
{
|
|
8425
|
-
deprecated: "octokit.rest.projects.listForRepo() is deprecated, see https://docs.github.com/rest/projects/projects#list-repository-projects"
|
|
8426
|
-
}
|
|
8427
|
-
],
|
|
8428
|
-
listForUser: [
|
|
8429
|
-
"GET /users/{username}/projects",
|
|
8430
|
-
{},
|
|
8431
|
-
{
|
|
8432
|
-
deprecated: "octokit.rest.projects.listForUser() is deprecated, see https://docs.github.com/rest/projects/projects#list-user-projects"
|
|
8433
|
-
}
|
|
8434
|
-
],
|
|
8435
|
-
moveCard: [
|
|
8436
|
-
"POST /projects/columns/cards/{card_id}/moves",
|
|
8437
|
-
{},
|
|
8438
|
-
{
|
|
8439
|
-
deprecated: "octokit.rest.projects.moveCard() is deprecated, see https://docs.github.com/rest/projects/cards#move-a-project-card"
|
|
8440
|
-
}
|
|
8441
|
-
],
|
|
8442
|
-
moveColumn: [
|
|
8443
|
-
"POST /projects/columns/{column_id}/moves",
|
|
8444
|
-
{},
|
|
8445
|
-
{
|
|
8446
|
-
deprecated: "octokit.rest.projects.moveColumn() is deprecated, see https://docs.github.com/rest/projects/columns#move-a-project-column"
|
|
8447
|
-
}
|
|
8448
|
-
],
|
|
8449
|
-
removeCollaborator: [
|
|
8450
|
-
"DELETE /projects/{project_id}/collaborators/{username}",
|
|
8451
|
-
{},
|
|
8452
|
-
{
|
|
8453
|
-
deprecated: "octokit.rest.projects.removeCollaborator() is deprecated, see https://docs.github.com/rest/projects/collaborators#remove-user-as-a-collaborator"
|
|
8454
|
-
}
|
|
8455
|
-
],
|
|
8456
|
-
update: [
|
|
8457
|
-
"PATCH /projects/{project_id}",
|
|
8458
|
-
{},
|
|
8459
|
-
{
|
|
8460
|
-
deprecated: "octokit.rest.projects.update() is deprecated, see https://docs.github.com/rest/projects/projects#update-a-project"
|
|
8461
|
-
}
|
|
8462
|
-
],
|
|
8463
|
-
updateCard: [
|
|
8464
|
-
"PATCH /projects/columns/cards/{card_id}",
|
|
8465
|
-
{},
|
|
8466
|
-
{
|
|
8467
|
-
deprecated: "octokit.rest.projects.updateCard() is deprecated, see https://docs.github.com/rest/projects/cards#update-an-existing-project-card"
|
|
8468
|
-
}
|
|
8469
|
-
],
|
|
8470
|
-
updateColumn: [
|
|
8471
|
-
"PATCH /projects/columns/{column_id}",
|
|
8472
|
-
{},
|
|
8473
|
-
{
|
|
8474
|
-
deprecated: "octokit.rest.projects.updateColumn() is deprecated, see https://docs.github.com/rest/projects/columns#update-an-existing-project-column"
|
|
8475
|
-
}
|
|
8476
|
-
]
|
|
8477
|
-
},
|
|
8478
8137
|
pulls: {
|
|
8479
8138
|
checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],
|
|
8480
8139
|
create: ["POST /repos/{owner}/{repo}/pulls"],
|
|
@@ -9085,37 +8744,9 @@ var Endpoints = {
|
|
|
9085
8744
|
addOrUpdateMembershipForUserInOrg: [
|
|
9086
8745
|
"PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"
|
|
9087
8746
|
],
|
|
9088
|
-
addOrUpdateProjectPermissionsInOrg: [
|
|
9089
|
-
"PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}",
|
|
9090
|
-
{},
|
|
9091
|
-
{
|
|
9092
|
-
deprecated: "octokit.rest.teams.addOrUpdateProjectPermissionsInOrg() is deprecated, see https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions"
|
|
9093
|
-
}
|
|
9094
|
-
],
|
|
9095
|
-
addOrUpdateProjectPermissionsLegacy: [
|
|
9096
|
-
"PUT /teams/{team_id}/projects/{project_id}",
|
|
9097
|
-
{},
|
|
9098
|
-
{
|
|
9099
|
-
deprecated: "octokit.rest.teams.addOrUpdateProjectPermissionsLegacy() is deprecated, see https://docs.github.com/rest/teams/teams#add-or-update-team-project-permissions-legacy"
|
|
9100
|
-
}
|
|
9101
|
-
],
|
|
9102
8747
|
addOrUpdateRepoPermissionsInOrg: [
|
|
9103
8748
|
"PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
|
|
9104
8749
|
],
|
|
9105
|
-
checkPermissionsForProjectInOrg: [
|
|
9106
|
-
"GET /orgs/{org}/teams/{team_slug}/projects/{project_id}",
|
|
9107
|
-
{},
|
|
9108
|
-
{
|
|
9109
|
-
deprecated: "octokit.rest.teams.checkPermissionsForProjectInOrg() is deprecated, see https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project"
|
|
9110
|
-
}
|
|
9111
|
-
],
|
|
9112
|
-
checkPermissionsForProjectLegacy: [
|
|
9113
|
-
"GET /teams/{team_id}/projects/{project_id}",
|
|
9114
|
-
{},
|
|
9115
|
-
{
|
|
9116
|
-
deprecated: "octokit.rest.teams.checkPermissionsForProjectLegacy() is deprecated, see https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-project-legacy"
|
|
9117
|
-
}
|
|
9118
|
-
],
|
|
9119
8750
|
checkPermissionsForRepoInOrg: [
|
|
9120
8751
|
"GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
|
|
9121
8752
|
],
|
|
@@ -9152,38 +8783,10 @@ var Endpoints = {
|
|
|
9152
8783
|
listPendingInvitationsInOrg: [
|
|
9153
8784
|
"GET /orgs/{org}/teams/{team_slug}/invitations"
|
|
9154
8785
|
],
|
|
9155
|
-
listProjectsInOrg: [
|
|
9156
|
-
"GET /orgs/{org}/teams/{team_slug}/projects",
|
|
9157
|
-
{},
|
|
9158
|
-
{
|
|
9159
|
-
deprecated: "octokit.rest.teams.listProjectsInOrg() is deprecated, see https://docs.github.com/rest/teams/teams#list-team-projects"
|
|
9160
|
-
}
|
|
9161
|
-
],
|
|
9162
|
-
listProjectsLegacy: [
|
|
9163
|
-
"GET /teams/{team_id}/projects",
|
|
9164
|
-
{},
|
|
9165
|
-
{
|
|
9166
|
-
deprecated: "octokit.rest.teams.listProjectsLegacy() is deprecated, see https://docs.github.com/rest/teams/teams#list-team-projects-legacy"
|
|
9167
|
-
}
|
|
9168
|
-
],
|
|
9169
8786
|
listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"],
|
|
9170
8787
|
removeMembershipForUserInOrg: [
|
|
9171
8788
|
"DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"
|
|
9172
8789
|
],
|
|
9173
|
-
removeProjectInOrg: [
|
|
9174
|
-
"DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}",
|
|
9175
|
-
{},
|
|
9176
|
-
{
|
|
9177
|
-
deprecated: "octokit.rest.teams.removeProjectInOrg() is deprecated, see https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team"
|
|
9178
|
-
}
|
|
9179
|
-
],
|
|
9180
|
-
removeProjectLegacy: [
|
|
9181
|
-
"DELETE /teams/{team_id}/projects/{project_id}",
|
|
9182
|
-
{},
|
|
9183
|
-
{
|
|
9184
|
-
deprecated: "octokit.rest.teams.removeProjectLegacy() is deprecated, see https://docs.github.com/rest/teams/teams#remove-a-project-from-a-team-legacy"
|
|
9185
|
-
}
|
|
9186
|
-
],
|
|
9187
8790
|
removeRepoInOrg: [
|
|
9188
8791
|
"DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
|
|
9189
8792
|
],
|
|
@@ -9465,7 +9068,7 @@ function legacyRestEndpointMethods(octokit) {
|
|
|
9465
9068
|
legacyRestEndpointMethods.VERSION = VERSION7;
|
|
9466
9069
|
|
|
9467
9070
|
// ../node_modules/@octokit/rest/dist-src/version.js
|
|
9468
|
-
var VERSION8 = "
|
|
9071
|
+
var VERSION8 = "22.0.0";
|
|
9469
9072
|
|
|
9470
9073
|
// ../node_modules/@octokit/rest/dist-src/index.js
|
|
9471
9074
|
var Octokit2 = Octokit.plugin(requestLog, legacyRestEndpointMethods, paginateRest).defaults(
|