sv 0.8.6 → 0.8.8
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/bin.js +58 -2727
- package/package.json +3 -5
package/dist/bin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { AGENT_NAMES, Command, Element, Option, Tag,
|
|
2
|
+
import { AGENT_NAMES, Command, Element, Option, Tag, __export, __toESM as __toESM$1, __toESM$1 as __toESM, addPnpmBuildDependencies, box, cancel, confirm, create, detect, esm_exports, from, getUserAgent, group, installDependencies, installOption, intro, isCancel, log, multiselect, note, outro, packageManagerPrompt, parseCss$1, parseHtml, parseHtml$1, parseJson$1, parseScript$1, parseSvelte, program, require_picocolors, resolveCommand, select, spinner, templates, text, up, walk_exports } from "./package-manager-D3PRQ-L_.js";
|
|
3
3
|
import { addFromString, applyAddons, array_exports, common_exports, createWorkspace, dedent_default, exports_exports, formatFiles, function_exports, getHighlighter, imports_exports, kit_exports, object_exports, require_picocolors$1, setupAddons, variables_exports } from "./install-BTJ6iCTS.js";
|
|
4
4
|
import fs, { existsSync } from "node:fs";
|
|
5
5
|
import path, { dirname, join } from "node:path";
|
|
@@ -12,7 +12,7 @@ import { promisify } from "node:util";
|
|
|
12
12
|
|
|
13
13
|
//#region packages/cli/package.json
|
|
14
14
|
var name = "sv";
|
|
15
|
-
var version = "0.8.
|
|
15
|
+
var version = "0.8.8";
|
|
16
16
|
var type = "module";
|
|
17
17
|
var description = "A CLI for creating and updating SvelteKit projects";
|
|
18
18
|
var license = "MIT";
|
|
@@ -29,7 +29,7 @@ var scripts = {
|
|
|
29
29
|
};
|
|
30
30
|
var files = ["dist"];
|
|
31
31
|
var bin = "./dist/bin.js";
|
|
32
|
-
var exports
|
|
32
|
+
var exports = {
|
|
33
33
|
".": {
|
|
34
34
|
"types": "./dist/lib/index.d.ts",
|
|
35
35
|
"default": "./dist/index.js"
|
|
@@ -46,14 +46,12 @@ var devDependencies = {
|
|
|
46
46
|
"@sveltejs/create": "workspace:*",
|
|
47
47
|
"@types/degit": "^2.8.6",
|
|
48
48
|
"@types/ps-tree": "^1.1.6",
|
|
49
|
-
"@types/tar-fs": "^2.0.4",
|
|
50
49
|
"commander": "^13.1.0",
|
|
51
50
|
"degit": "^2.8.4",
|
|
52
51
|
"empathic": "^1.0.0",
|
|
53
52
|
"package-manager-detector": "^0.2.11",
|
|
54
53
|
"picocolors": "^1.1.1",
|
|
55
54
|
"ps-tree": "^1.2.0",
|
|
56
|
-
"tar-fs": "^3.0.8",
|
|
57
55
|
"tinyexec": "^0.3.2",
|
|
58
56
|
"valibot": "^0.41.0"
|
|
59
57
|
};
|
|
@@ -78,7 +76,7 @@ var package_default = {
|
|
|
78
76
|
scripts,
|
|
79
77
|
files,
|
|
80
78
|
bin,
|
|
81
|
-
exports
|
|
79
|
+
exports,
|
|
82
80
|
devDependencies,
|
|
83
81
|
keywords
|
|
84
82
|
};
|
|
@@ -479,7 +477,7 @@ function parse(schema, input, config2) {
|
|
|
479
477
|
if (dataset.issues) throw new ValiError(dataset.issues);
|
|
480
478
|
return dataset.value;
|
|
481
479
|
}
|
|
482
|
-
function pipe
|
|
480
|
+
function pipe(...pipe2) {
|
|
483
481
|
return {
|
|
484
482
|
...pipe2[0],
|
|
485
483
|
pipe: pipe2,
|
|
@@ -519,12 +517,12 @@ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
|
519
517
|
var __commonJS$1 = (cb, mod) => function() {
|
|
520
518
|
return mod || (0, cb[__getOwnPropNames$1(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
521
519
|
};
|
|
522
|
-
var __copyProps$1 = (to, from$
|
|
523
|
-
if (from$
|
|
520
|
+
var __copyProps$1 = (to, from$1, except, desc) => {
|
|
521
|
+
if (from$1 && typeof from$1 === "object" || typeof from$1 === "function") for (var keys$1 = __getOwnPropNames$1(from$1), i = 0, n$1 = keys$1.length, key; i < n$1; i++) {
|
|
524
522
|
key = keys$1[i];
|
|
525
523
|
if (!__hasOwnProp$1.call(to, key) && key !== except) __defProp$1(to, key, {
|
|
526
|
-
get: ((k) => from$
|
|
527
|
-
enumerable: !(desc = __getOwnPropDesc$1(from$
|
|
524
|
+
get: ((k) => from$1[k]).bind(null, key),
|
|
525
|
+
enumerable: !(desc = __getOwnPropDesc$1(from$1, key)) || desc.enumerable
|
|
528
526
|
});
|
|
529
527
|
}
|
|
530
528
|
return to;
|
|
@@ -539,15 +537,15 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
539
537
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
540
538
|
var __getProtoOf = Object.getPrototypeOf;
|
|
541
539
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
542
|
-
var __commonJS
|
|
540
|
+
var __commonJS = (cb, mod) => function() {
|
|
543
541
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
544
542
|
};
|
|
545
|
-
var __copyProps = (to, from$
|
|
546
|
-
if (from$
|
|
543
|
+
var __copyProps = (to, from$1, except, desc) => {
|
|
544
|
+
if (from$1 && typeof from$1 === "object" || typeof from$1 === "function") for (var keys$1 = __getOwnPropNames(from$1), i = 0, n$1 = keys$1.length, key; i < n$1; i++) {
|
|
547
545
|
key = keys$1[i];
|
|
548
546
|
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
549
|
-
get: ((k) => from$
|
|
550
|
-
enumerable: !(desc = __getOwnPropDesc(from$
|
|
547
|
+
get: ((k) => from$1[k]).bind(null, key),
|
|
548
|
+
enumerable: !(desc = __getOwnPropDesc(from$1, key)) || desc.enumerable
|
|
551
549
|
});
|
|
552
550
|
}
|
|
553
551
|
return to;
|
|
@@ -556,7 +554,7 @@ var __toESM$2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__
|
|
|
556
554
|
value: mod,
|
|
557
555
|
enumerable: true
|
|
558
556
|
}) : target, mod));
|
|
559
|
-
var require_src$1 = __commonJS
|
|
557
|
+
var require_src$1 = __commonJS({ "node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports$1, module$1) {
|
|
560
558
|
const ESC$1 = "\x1B";
|
|
561
559
|
const CSI$1 = `${ESC$1}[`;
|
|
562
560
|
const beep$1 = "\x07";
|
|
@@ -616,7 +614,7 @@ function ansiRegex$1({ onlyFirst = false } = {}) {
|
|
|
616
614
|
return new RegExp(pattern, onlyFirst ? undefined : "g");
|
|
617
615
|
}
|
|
618
616
|
const regex = ansiRegex$1();
|
|
619
|
-
var require_eastasianwidth = __commonJS
|
|
617
|
+
var require_eastasianwidth = __commonJS({ "node_modules/.pnpm/eastasianwidth@0.2.0/node_modules/eastasianwidth/eastasianwidth.js"(exports$1, module$1) {
|
|
620
618
|
var eaw = {};
|
|
621
619
|
if ("undefined" == typeof module$1) window.eastasianwidth = eaw;
|
|
622
620
|
else module$1.exports = eaw;
|
|
@@ -670,7 +668,7 @@ else break;
|
|
|
670
668
|
return result;
|
|
671
669
|
};
|
|
672
670
|
} });
|
|
673
|
-
var require_emoji_regex = __commonJS
|
|
671
|
+
var require_emoji_regex = __commonJS({ "node_modules/.pnpm/emoji-regex@9.2.2/node_modules/emoji-regex/index.js"(exports$1, module$1) {
|
|
674
672
|
module$1.exports = function() {
|
|
675
673
|
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
|
|
676
674
|
};
|
|
@@ -844,7 +842,7 @@ const ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
|
844
842
|
var import_src$2 = __toESM$2(require_src$1(), 1);
|
|
845
843
|
const cancel$1 = Symbol("clack:cancel");
|
|
846
844
|
var import_src$1 = __toESM$2(require_src$1(), 1);
|
|
847
|
-
var require_picocolors$1$1 = __commonJS
|
|
845
|
+
var require_picocolors$1$1 = __commonJS({ "node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports$1, module$1) {
|
|
848
846
|
let p$1 = process || {}, argv$1 = p$1.argv || [], env$1 = p$1.env || {};
|
|
849
847
|
let isColorSupported$1 = !(!!env$1.NO_COLOR || argv$1.includes("--no-color")) && (!!env$1.FORCE_COLOR || argv$1.includes("--color") || p$1.platform === "win32" || (p$1.stdout || {}).isTTY && env$1.TERM !== "dumb" || !!env$1.CI);
|
|
850
848
|
let formatter$1 = (open, close, replace = open) => (input) => {
|
|
@@ -918,7 +916,7 @@ function isUnicodeSupported() {
|
|
|
918
916
|
if (process$1.platform !== "win32") return process$1.env.TERM !== "linux";
|
|
919
917
|
return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
920
918
|
}
|
|
921
|
-
var require_picocolors$2 = __commonJS$1({ "node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports$
|
|
919
|
+
var require_picocolors$2 = __commonJS$1({ "node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports$1, module) {
|
|
922
920
|
let p = process || {}, argv = p.argv || [], env$1 = p.env || {};
|
|
923
921
|
let isColorSupported = !(!!env$1.NO_COLOR || argv.includes("--no-color")) && (!!env$1.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env$1.TERM !== "dumb" || !!env$1.CI);
|
|
924
922
|
let formatter = (open, close, replace = open) => (input) => {
|
|
@@ -981,10 +979,10 @@ var require_picocolors$2 = __commonJS$1({ "node_modules/.pnpm/picocolors@1.1.1/n
|
|
|
981
979
|
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
982
980
|
};
|
|
983
981
|
};
|
|
984
|
-
module
|
|
985
|
-
module
|
|
982
|
+
module.exports = createColors();
|
|
983
|
+
module.exports.createColors = createColors;
|
|
986
984
|
} });
|
|
987
|
-
var require_src = __commonJS$1({ "node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports$
|
|
985
|
+
var require_src = __commonJS$1({ "node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports$1, module) {
|
|
988
986
|
const ESC = "\x1B";
|
|
989
987
|
const CSI = `${ESC}[`;
|
|
990
988
|
const beep = "\x07";
|
|
@@ -1031,7 +1029,7 @@ else if (y > 0) ret += `${CSI}${y}B`;
|
|
|
1031
1029
|
return clear;
|
|
1032
1030
|
}
|
|
1033
1031
|
};
|
|
1034
|
-
module
|
|
1032
|
+
module.exports = {
|
|
1035
1033
|
cursor: cursor$1,
|
|
1036
1034
|
scroll,
|
|
1037
1035
|
erase: erase$1,
|
|
@@ -1099,7 +1097,7 @@ function createPrinter(...conditions) {
|
|
|
1099
1097
|
});
|
|
1100
1098
|
return printers;
|
|
1101
1099
|
}
|
|
1102
|
-
var import_picocolors$4 = __toESM(require_picocolors(), 1);
|
|
1100
|
+
var import_picocolors$4 = __toESM$1(require_picocolors(), 1);
|
|
1103
1101
|
var colors = import_picocolors$4.default;
|
|
1104
1102
|
|
|
1105
1103
|
//#endregion
|
|
@@ -1129,11 +1127,11 @@ function addEslintConfigPrettier(content) {
|
|
|
1129
1127
|
else elements.push(...nodesToInsert);
|
|
1130
1128
|
return generateCode();
|
|
1131
1129
|
}
|
|
1132
|
-
function addToDemoPage(content, path$
|
|
1130
|
+
function addToDemoPage(content, path$1) {
|
|
1133
1131
|
const { template, generateCode } = parseSvelte(content);
|
|
1134
|
-
for (const node of template.ast.childNodes) if (node.type === "tag" && node.attribs["href"] === `/demo/${path$
|
|
1132
|
+
for (const node of template.ast.childNodes) if (node.type === "tag" && node.attribs["href"] === `/demo/${path$1}`) return content;
|
|
1135
1133
|
const newLine = template.source ? "\n" : "";
|
|
1136
|
-
const src = template.source + `${newLine}<a href="/demo/${path$
|
|
1134
|
+
const src = template.source + `${newLine}<a href="/demo/${path$1}">${path$1}</a>`;
|
|
1137
1135
|
return generateCode({ template: src });
|
|
1138
1136
|
}
|
|
1139
1137
|
function getNodeTypesVersion() {
|
|
@@ -1243,7 +1241,7 @@ var drizzle_default = defineAddon({
|
|
|
1243
1241
|
options: options$5,
|
|
1244
1242
|
setup: ({ kit, unsupported, cwd, typescript }) => {
|
|
1245
1243
|
const ext = typescript ? "ts" : "js";
|
|
1246
|
-
if (!kit) unsupported("Requires SvelteKit");
|
|
1244
|
+
if (!kit) return unsupported("Requires SvelteKit");
|
|
1247
1245
|
const baseDBPath = path.resolve(kit.libDirectory, "server", "db");
|
|
1248
1246
|
const paths = {
|
|
1249
1247
|
"drizzle config": path.relative(cwd, path.resolve(cwd, `drizzle.config.${ext}`)),
|
|
@@ -1343,7 +1341,6 @@ var drizzle_default = defineAddon({
|
|
|
1343
1341
|
if (options$6.database === "sqlite") {
|
|
1344
1342
|
imports_exports.addNamed(ast, "drizzle-orm/sqlite-core", {
|
|
1345
1343
|
sqliteTable: "sqliteTable",
|
|
1346
|
-
text: "text",
|
|
1347
1344
|
integer: "integer"
|
|
1348
1345
|
});
|
|
1349
1346
|
userSchemaExpression = common_exports.expressionFromString(`sqliteTable('user', {
|
|
@@ -1355,7 +1352,6 @@ var drizzle_default = defineAddon({
|
|
|
1355
1352
|
imports_exports.addNamed(ast, "drizzle-orm/mysql-core", {
|
|
1356
1353
|
mysqlTable: "mysqlTable",
|
|
1357
1354
|
serial: "serial",
|
|
1358
|
-
text: "text",
|
|
1359
1355
|
int: "int"
|
|
1360
1356
|
});
|
|
1361
1357
|
userSchemaExpression = common_exports.expressionFromString(`mysqlTable('user', {
|
|
@@ -1367,7 +1363,6 @@ var drizzle_default = defineAddon({
|
|
|
1367
1363
|
imports_exports.addNamed(ast, "drizzle-orm/pg-core", {
|
|
1368
1364
|
pgTable: "pgTable",
|
|
1369
1365
|
serial: "serial",
|
|
1370
|
-
text: "text",
|
|
1371
1366
|
integer: "integer"
|
|
1372
1367
|
});
|
|
1373
1368
|
userSchemaExpression = common_exports.expressionFromString(`pgTable('user', {
|
|
@@ -1506,8 +1501,8 @@ var eslint_default = defineAddon({
|
|
|
1506
1501
|
sv.file(".vscode/settings.json", (content) => {
|
|
1507
1502
|
if (!content) return content;
|
|
1508
1503
|
const { data, generateCode } = parseJson$1(content);
|
|
1509
|
-
const validate
|
|
1510
|
-
if (validate
|
|
1504
|
+
const validate = data["eslint.validate"];
|
|
1505
|
+
if (validate && !validate.includes("svelte")) validate.push("svelte");
|
|
1511
1506
|
return generateCode();
|
|
1512
1507
|
});
|
|
1513
1508
|
sv.file("eslint.config.js", (content) => {
|
|
@@ -1931,8 +1926,8 @@ function guessIndent(code) {
|
|
|
1931
1926
|
}, Infinity);
|
|
1932
1927
|
return new Array(min + 1).join(" ");
|
|
1933
1928
|
}
|
|
1934
|
-
function getRelativePath(from$
|
|
1935
|
-
const fromParts = from$
|
|
1929
|
+
function getRelativePath(from$1, to) {
|
|
1930
|
+
const fromParts = from$1.split(/[/\\]/);
|
|
1936
1931
|
const toParts = to.split(/[/\\]/);
|
|
1937
1932
|
fromParts.pop();
|
|
1938
1933
|
while (fromParts[0] === toParts[0]) {
|
|
@@ -1945,9 +1940,9 @@ function getRelativePath(from$2, to) {
|
|
|
1945
1940
|
}
|
|
1946
1941
|
return fromParts.concat(toParts).join("/");
|
|
1947
1942
|
}
|
|
1948
|
-
const toString
|
|
1943
|
+
const toString = Object.prototype.toString;
|
|
1949
1944
|
function isObject(thing) {
|
|
1950
|
-
return toString
|
|
1945
|
+
return toString.call(thing) === "[object Object]";
|
|
1951
1946
|
}
|
|
1952
1947
|
function getLocator(source) {
|
|
1953
1948
|
const originalLines = source.split("\n");
|
|
@@ -3602,12 +3597,14 @@ var storybook_default = defineAddon({
|
|
|
3602
3597
|
runsAfter("eslint");
|
|
3603
3598
|
},
|
|
3604
3599
|
run: async ({ sv }) => {
|
|
3605
|
-
|
|
3600
|
+
const args = [
|
|
3606
3601
|
"storybook@latest",
|
|
3607
3602
|
"init",
|
|
3608
3603
|
"--skip-install",
|
|
3609
3604
|
"--no-dev"
|
|
3610
|
-
]
|
|
3605
|
+
];
|
|
3606
|
+
if (process$1.env.NODE_ENV?.toLowerCase() === "test") args.push("--yes");
|
|
3607
|
+
await sv.execute(args, "inherit");
|
|
3611
3608
|
sv.devDependency(`@types/node`, getNodeTypesVersion());
|
|
3612
3609
|
}
|
|
3613
3610
|
});
|
|
@@ -3721,7 +3718,7 @@ var vitest_addon_default = defineAddon({
|
|
|
3721
3718
|
options: {},
|
|
3722
3719
|
run: ({ sv, typescript, kit }) => {
|
|
3723
3720
|
const ext = typescript ? "ts" : "js";
|
|
3724
|
-
sv.devDependency("vitest", "
|
|
3721
|
+
sv.devDependency("vitest", "3.1.4");
|
|
3725
3722
|
sv.devDependency("@testing-library/svelte", "^5.2.4");
|
|
3726
3723
|
sv.devDependency("@testing-library/jest-dom", "^6.6.3");
|
|
3727
3724
|
sv.devDependency("jsdom", "^26.0.0");
|
|
@@ -3882,7 +3879,7 @@ var UnsupportedError = class extends Error {
|
|
|
3882
3879
|
|
|
3883
3880
|
//#endregion
|
|
3884
3881
|
//#region packages/cli/utils/common.ts
|
|
3885
|
-
var import_picocolors$3 = __toESM
|
|
3882
|
+
var import_picocolors$3 = __toESM(require_picocolors$1(), 1);
|
|
3886
3883
|
const NO_PREFIX = "--no-";
|
|
3887
3884
|
let options = [];
|
|
3888
3885
|
function getLongFlag(flags) {
|
|
@@ -3955,2683 +3952,8 @@ function forwardExitCode(error) {
|
|
|
3955
3952
|
else process$1.exit(1);
|
|
3956
3953
|
}
|
|
3957
3954
|
|
|
3958
|
-
//#endregion
|
|
3959
|
-
//#region node_modules/.pnpm/fast-fifo@1.3.2/node_modules/fast-fifo/fixed-size.js
|
|
3960
|
-
var require_fixed_size = __commonJS({ "node_modules/.pnpm/fast-fifo@1.3.2/node_modules/fast-fifo/fixed-size.js"(exports, module) {
|
|
3961
|
-
module.exports = class FixedFIFO$1 {
|
|
3962
|
-
constructor(hwm) {
|
|
3963
|
-
if (!(hwm > 0) || (hwm - 1 & hwm) !== 0) throw new Error("Max size for a FixedFIFO should be a power of two");
|
|
3964
|
-
this.buffer = new Array(hwm);
|
|
3965
|
-
this.mask = hwm - 1;
|
|
3966
|
-
this.top = 0;
|
|
3967
|
-
this.btm = 0;
|
|
3968
|
-
this.next = null;
|
|
3969
|
-
}
|
|
3970
|
-
clear() {
|
|
3971
|
-
this.top = this.btm = 0;
|
|
3972
|
-
this.next = null;
|
|
3973
|
-
this.buffer.fill(undefined);
|
|
3974
|
-
}
|
|
3975
|
-
push(data) {
|
|
3976
|
-
if (this.buffer[this.top] !== undefined) return false;
|
|
3977
|
-
this.buffer[this.top] = data;
|
|
3978
|
-
this.top = this.top + 1 & this.mask;
|
|
3979
|
-
return true;
|
|
3980
|
-
}
|
|
3981
|
-
shift() {
|
|
3982
|
-
const last = this.buffer[this.btm];
|
|
3983
|
-
if (last === undefined) return undefined;
|
|
3984
|
-
this.buffer[this.btm] = undefined;
|
|
3985
|
-
this.btm = this.btm + 1 & this.mask;
|
|
3986
|
-
return last;
|
|
3987
|
-
}
|
|
3988
|
-
peek() {
|
|
3989
|
-
return this.buffer[this.btm];
|
|
3990
|
-
}
|
|
3991
|
-
isEmpty() {
|
|
3992
|
-
return this.buffer[this.btm] === undefined;
|
|
3993
|
-
}
|
|
3994
|
-
};
|
|
3995
|
-
} });
|
|
3996
|
-
|
|
3997
|
-
//#endregion
|
|
3998
|
-
//#region node_modules/.pnpm/fast-fifo@1.3.2/node_modules/fast-fifo/index.js
|
|
3999
|
-
var require_fast_fifo = __commonJS({ "node_modules/.pnpm/fast-fifo@1.3.2/node_modules/fast-fifo/index.js"(exports, module) {
|
|
4000
|
-
const FixedFIFO = require_fixed_size();
|
|
4001
|
-
module.exports = class FastFIFO {
|
|
4002
|
-
constructor(hwm) {
|
|
4003
|
-
this.hwm = hwm || 16;
|
|
4004
|
-
this.head = new FixedFIFO(this.hwm);
|
|
4005
|
-
this.tail = this.head;
|
|
4006
|
-
this.length = 0;
|
|
4007
|
-
}
|
|
4008
|
-
clear() {
|
|
4009
|
-
this.head = this.tail;
|
|
4010
|
-
this.head.clear();
|
|
4011
|
-
this.length = 0;
|
|
4012
|
-
}
|
|
4013
|
-
push(val) {
|
|
4014
|
-
this.length++;
|
|
4015
|
-
if (!this.head.push(val)) {
|
|
4016
|
-
const prev = this.head;
|
|
4017
|
-
this.head = prev.next = new FixedFIFO(2 * this.head.buffer.length);
|
|
4018
|
-
this.head.push(val);
|
|
4019
|
-
}
|
|
4020
|
-
}
|
|
4021
|
-
shift() {
|
|
4022
|
-
if (this.length !== 0) this.length--;
|
|
4023
|
-
const val = this.tail.shift();
|
|
4024
|
-
if (val === undefined && this.tail.next) {
|
|
4025
|
-
const next = this.tail.next;
|
|
4026
|
-
this.tail.next = null;
|
|
4027
|
-
this.tail = next;
|
|
4028
|
-
return this.tail.shift();
|
|
4029
|
-
}
|
|
4030
|
-
return val;
|
|
4031
|
-
}
|
|
4032
|
-
peek() {
|
|
4033
|
-
const val = this.tail.peek();
|
|
4034
|
-
if (val === undefined && this.tail.next) return this.tail.next.peek();
|
|
4035
|
-
return val;
|
|
4036
|
-
}
|
|
4037
|
-
isEmpty() {
|
|
4038
|
-
return this.length === 0;
|
|
4039
|
-
}
|
|
4040
|
-
};
|
|
4041
|
-
} });
|
|
4042
|
-
|
|
4043
|
-
//#endregion
|
|
4044
|
-
//#region node_modules/.pnpm/b4a@1.6.7/node_modules/b4a/index.js
|
|
4045
|
-
var require_b4a = __commonJS({ "node_modules/.pnpm/b4a@1.6.7/node_modules/b4a/index.js"(exports, module) {
|
|
4046
|
-
function isBuffer(value) {
|
|
4047
|
-
return Buffer.isBuffer(value) || value instanceof Uint8Array;
|
|
4048
|
-
}
|
|
4049
|
-
function isEncoding(encoding) {
|
|
4050
|
-
return Buffer.isEncoding(encoding);
|
|
4051
|
-
}
|
|
4052
|
-
function alloc(size, fill$1, encoding) {
|
|
4053
|
-
return Buffer.alloc(size, fill$1, encoding);
|
|
4054
|
-
}
|
|
4055
|
-
function allocUnsafe(size) {
|
|
4056
|
-
return Buffer.allocUnsafe(size);
|
|
4057
|
-
}
|
|
4058
|
-
function allocUnsafeSlow(size) {
|
|
4059
|
-
return Buffer.allocUnsafeSlow(size);
|
|
4060
|
-
}
|
|
4061
|
-
function byteLength(string$1, encoding) {
|
|
4062
|
-
return Buffer.byteLength(string$1, encoding);
|
|
4063
|
-
}
|
|
4064
|
-
function compare(a, b) {
|
|
4065
|
-
return Buffer.compare(a, b);
|
|
4066
|
-
}
|
|
4067
|
-
function concat(buffers, totalLength) {
|
|
4068
|
-
return Buffer.concat(buffers, totalLength);
|
|
4069
|
-
}
|
|
4070
|
-
function copy(source, target, targetStart, start, end) {
|
|
4071
|
-
return toBuffer(source).copy(target, targetStart, start, end);
|
|
4072
|
-
}
|
|
4073
|
-
function equals(a, b) {
|
|
4074
|
-
return toBuffer(a).equals(b);
|
|
4075
|
-
}
|
|
4076
|
-
function fill(buffer, value, offset, end, encoding) {
|
|
4077
|
-
return toBuffer(buffer).fill(value, offset, end, encoding);
|
|
4078
|
-
}
|
|
4079
|
-
function from$1(value, encodingOrOffset, length) {
|
|
4080
|
-
return Buffer.from(value, encodingOrOffset, length);
|
|
4081
|
-
}
|
|
4082
|
-
function includes(buffer, value, byteOffset, encoding) {
|
|
4083
|
-
return toBuffer(buffer).includes(value, byteOffset, encoding);
|
|
4084
|
-
}
|
|
4085
|
-
function indexOf$1(buffer, value, byfeOffset, encoding) {
|
|
4086
|
-
return toBuffer(buffer).indexOf(value, byfeOffset, encoding);
|
|
4087
|
-
}
|
|
4088
|
-
function lastIndexOf(buffer, value, byteOffset, encoding) {
|
|
4089
|
-
return toBuffer(buffer).lastIndexOf(value, byteOffset, encoding);
|
|
4090
|
-
}
|
|
4091
|
-
function swap16(buffer) {
|
|
4092
|
-
return toBuffer(buffer).swap16();
|
|
4093
|
-
}
|
|
4094
|
-
function swap32(buffer) {
|
|
4095
|
-
return toBuffer(buffer).swap32();
|
|
4096
|
-
}
|
|
4097
|
-
function swap64(buffer) {
|
|
4098
|
-
return toBuffer(buffer).swap64();
|
|
4099
|
-
}
|
|
4100
|
-
function toBuffer(buffer) {
|
|
4101
|
-
if (Buffer.isBuffer(buffer)) return buffer;
|
|
4102
|
-
return Buffer.from(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
|
4103
|
-
}
|
|
4104
|
-
function toString(buffer, encoding, start, end) {
|
|
4105
|
-
return toBuffer(buffer).toString(encoding, start, end);
|
|
4106
|
-
}
|
|
4107
|
-
function write(buffer, string$1, offset, length, encoding) {
|
|
4108
|
-
return toBuffer(buffer).write(string$1, offset, length, encoding);
|
|
4109
|
-
}
|
|
4110
|
-
function writeDoubleLE(buffer, value, offset) {
|
|
4111
|
-
return toBuffer(buffer).writeDoubleLE(value, offset);
|
|
4112
|
-
}
|
|
4113
|
-
function writeFloatLE(buffer, value, offset) {
|
|
4114
|
-
return toBuffer(buffer).writeFloatLE(value, offset);
|
|
4115
|
-
}
|
|
4116
|
-
function writeUInt32LE(buffer, value, offset) {
|
|
4117
|
-
return toBuffer(buffer).writeUInt32LE(value, offset);
|
|
4118
|
-
}
|
|
4119
|
-
function writeInt32LE(buffer, value, offset) {
|
|
4120
|
-
return toBuffer(buffer).writeInt32LE(value, offset);
|
|
4121
|
-
}
|
|
4122
|
-
function readDoubleLE(buffer, offset) {
|
|
4123
|
-
return toBuffer(buffer).readDoubleLE(offset);
|
|
4124
|
-
}
|
|
4125
|
-
function readFloatLE(buffer, offset) {
|
|
4126
|
-
return toBuffer(buffer).readFloatLE(offset);
|
|
4127
|
-
}
|
|
4128
|
-
function readUInt32LE(buffer, offset) {
|
|
4129
|
-
return toBuffer(buffer).readUInt32LE(offset);
|
|
4130
|
-
}
|
|
4131
|
-
function readInt32LE(buffer, offset) {
|
|
4132
|
-
return toBuffer(buffer).readInt32LE(offset);
|
|
4133
|
-
}
|
|
4134
|
-
function writeDoubleBE(buffer, value, offset) {
|
|
4135
|
-
return toBuffer(buffer).writeDoubleBE(value, offset);
|
|
4136
|
-
}
|
|
4137
|
-
function writeFloatBE(buffer, value, offset) {
|
|
4138
|
-
return toBuffer(buffer).writeFloatBE(value, offset);
|
|
4139
|
-
}
|
|
4140
|
-
function writeUInt32BE(buffer, value, offset) {
|
|
4141
|
-
return toBuffer(buffer).writeUInt32BE(value, offset);
|
|
4142
|
-
}
|
|
4143
|
-
function writeInt32BE(buffer, value, offset) {
|
|
4144
|
-
return toBuffer(buffer).writeInt32BE(value, offset);
|
|
4145
|
-
}
|
|
4146
|
-
function readDoubleBE(buffer, offset) {
|
|
4147
|
-
return toBuffer(buffer).readDoubleBE(offset);
|
|
4148
|
-
}
|
|
4149
|
-
function readFloatBE(buffer, offset) {
|
|
4150
|
-
return toBuffer(buffer).readFloatBE(offset);
|
|
4151
|
-
}
|
|
4152
|
-
function readUInt32BE(buffer, offset) {
|
|
4153
|
-
return toBuffer(buffer).readUInt32BE(offset);
|
|
4154
|
-
}
|
|
4155
|
-
function readInt32BE(buffer, offset) {
|
|
4156
|
-
return toBuffer(buffer).readInt32BE(offset);
|
|
4157
|
-
}
|
|
4158
|
-
module.exports = {
|
|
4159
|
-
isBuffer,
|
|
4160
|
-
isEncoding,
|
|
4161
|
-
alloc,
|
|
4162
|
-
allocUnsafe,
|
|
4163
|
-
allocUnsafeSlow,
|
|
4164
|
-
byteLength,
|
|
4165
|
-
compare,
|
|
4166
|
-
concat,
|
|
4167
|
-
copy,
|
|
4168
|
-
equals,
|
|
4169
|
-
fill,
|
|
4170
|
-
from: from$1,
|
|
4171
|
-
includes,
|
|
4172
|
-
indexOf: indexOf$1,
|
|
4173
|
-
lastIndexOf,
|
|
4174
|
-
swap16,
|
|
4175
|
-
swap32,
|
|
4176
|
-
swap64,
|
|
4177
|
-
toBuffer,
|
|
4178
|
-
toString,
|
|
4179
|
-
write,
|
|
4180
|
-
writeDoubleLE,
|
|
4181
|
-
writeFloatLE,
|
|
4182
|
-
writeUInt32LE,
|
|
4183
|
-
writeInt32LE,
|
|
4184
|
-
readDoubleLE,
|
|
4185
|
-
readFloatLE,
|
|
4186
|
-
readUInt32LE,
|
|
4187
|
-
readInt32LE,
|
|
4188
|
-
writeDoubleBE,
|
|
4189
|
-
writeFloatBE,
|
|
4190
|
-
writeUInt32BE,
|
|
4191
|
-
writeInt32BE,
|
|
4192
|
-
readDoubleBE,
|
|
4193
|
-
readFloatBE,
|
|
4194
|
-
readUInt32BE,
|
|
4195
|
-
readInt32BE
|
|
4196
|
-
};
|
|
4197
|
-
} });
|
|
4198
|
-
|
|
4199
|
-
//#endregion
|
|
4200
|
-
//#region node_modules/.pnpm/text-decoder@1.2.3/node_modules/text-decoder/lib/pass-through-decoder.js
|
|
4201
|
-
var require_pass_through_decoder = __commonJS({ "node_modules/.pnpm/text-decoder@1.2.3/node_modules/text-decoder/lib/pass-through-decoder.js"(exports, module) {
|
|
4202
|
-
const b4a$4 = require_b4a();
|
|
4203
|
-
module.exports = class PassThroughDecoder$1 {
|
|
4204
|
-
constructor(encoding) {
|
|
4205
|
-
this.encoding = encoding;
|
|
4206
|
-
}
|
|
4207
|
-
get remaining() {
|
|
4208
|
-
return 0;
|
|
4209
|
-
}
|
|
4210
|
-
decode(tail) {
|
|
4211
|
-
return b4a$4.toString(tail, this.encoding);
|
|
4212
|
-
}
|
|
4213
|
-
flush() {
|
|
4214
|
-
return "";
|
|
4215
|
-
}
|
|
4216
|
-
};
|
|
4217
|
-
} });
|
|
4218
|
-
|
|
4219
|
-
//#endregion
|
|
4220
|
-
//#region node_modules/.pnpm/text-decoder@1.2.3/node_modules/text-decoder/lib/utf8-decoder.js
|
|
4221
|
-
var require_utf8_decoder = __commonJS({ "node_modules/.pnpm/text-decoder@1.2.3/node_modules/text-decoder/lib/utf8-decoder.js"(exports, module) {
|
|
4222
|
-
const b4a$3 = require_b4a();
|
|
4223
|
-
/**
|
|
4224
|
-
* https://encoding.spec.whatwg.org/#utf-8-decoder
|
|
4225
|
-
*/
|
|
4226
|
-
module.exports = class UTF8Decoder$1 {
|
|
4227
|
-
constructor() {
|
|
4228
|
-
this.codePoint = 0;
|
|
4229
|
-
this.bytesSeen = 0;
|
|
4230
|
-
this.bytesNeeded = 0;
|
|
4231
|
-
this.lowerBoundary = 128;
|
|
4232
|
-
this.upperBoundary = 191;
|
|
4233
|
-
}
|
|
4234
|
-
get remaining() {
|
|
4235
|
-
return this.bytesSeen;
|
|
4236
|
-
}
|
|
4237
|
-
decode(data) {
|
|
4238
|
-
if (this.bytesNeeded === 0) {
|
|
4239
|
-
let isBoundary = true;
|
|
4240
|
-
for (let i = Math.max(0, data.byteLength - 4), n$1 = data.byteLength; i < n$1 && isBoundary; i++) isBoundary = data[i] <= 127;
|
|
4241
|
-
if (isBoundary) return b4a$3.toString(data, "utf8");
|
|
4242
|
-
}
|
|
4243
|
-
let result = "";
|
|
4244
|
-
for (let i = 0, n$1 = data.byteLength; i < n$1; i++) {
|
|
4245
|
-
const byte = data[i];
|
|
4246
|
-
if (this.bytesNeeded === 0) {
|
|
4247
|
-
if (byte <= 127) result += String.fromCharCode(byte);
|
|
4248
|
-
else {
|
|
4249
|
-
this.bytesSeen = 1;
|
|
4250
|
-
if (byte >= 194 && byte <= 223) {
|
|
4251
|
-
this.bytesNeeded = 2;
|
|
4252
|
-
this.codePoint = byte & 31;
|
|
4253
|
-
} else if (byte >= 224 && byte <= 239) {
|
|
4254
|
-
if (byte === 224) this.lowerBoundary = 160;
|
|
4255
|
-
else if (byte === 237) this.upperBoundary = 159;
|
|
4256
|
-
this.bytesNeeded = 3;
|
|
4257
|
-
this.codePoint = byte & 15;
|
|
4258
|
-
} else if (byte >= 240 && byte <= 244) {
|
|
4259
|
-
if (byte === 240) this.lowerBoundary = 144;
|
|
4260
|
-
if (byte === 244) this.upperBoundary = 143;
|
|
4261
|
-
this.bytesNeeded = 4;
|
|
4262
|
-
this.codePoint = byte & 7;
|
|
4263
|
-
} else result += "�";
|
|
4264
|
-
}
|
|
4265
|
-
continue;
|
|
4266
|
-
}
|
|
4267
|
-
if (byte < this.lowerBoundary || byte > this.upperBoundary) {
|
|
4268
|
-
this.codePoint = 0;
|
|
4269
|
-
this.bytesNeeded = 0;
|
|
4270
|
-
this.bytesSeen = 0;
|
|
4271
|
-
this.lowerBoundary = 128;
|
|
4272
|
-
this.upperBoundary = 191;
|
|
4273
|
-
result += "�";
|
|
4274
|
-
continue;
|
|
4275
|
-
}
|
|
4276
|
-
this.lowerBoundary = 128;
|
|
4277
|
-
this.upperBoundary = 191;
|
|
4278
|
-
this.codePoint = this.codePoint << 6 | byte & 63;
|
|
4279
|
-
this.bytesSeen++;
|
|
4280
|
-
if (this.bytesSeen !== this.bytesNeeded) continue;
|
|
4281
|
-
result += String.fromCodePoint(this.codePoint);
|
|
4282
|
-
this.codePoint = 0;
|
|
4283
|
-
this.bytesNeeded = 0;
|
|
4284
|
-
this.bytesSeen = 0;
|
|
4285
|
-
}
|
|
4286
|
-
return result;
|
|
4287
|
-
}
|
|
4288
|
-
flush() {
|
|
4289
|
-
const result = this.bytesNeeded > 0 ? "�" : "";
|
|
4290
|
-
this.codePoint = 0;
|
|
4291
|
-
this.bytesNeeded = 0;
|
|
4292
|
-
this.bytesSeen = 0;
|
|
4293
|
-
this.lowerBoundary = 128;
|
|
4294
|
-
this.upperBoundary = 191;
|
|
4295
|
-
return result;
|
|
4296
|
-
}
|
|
4297
|
-
};
|
|
4298
|
-
} });
|
|
4299
|
-
|
|
4300
|
-
//#endregion
|
|
4301
|
-
//#region node_modules/.pnpm/text-decoder@1.2.3/node_modules/text-decoder/index.js
|
|
4302
|
-
var require_text_decoder = __commonJS({ "node_modules/.pnpm/text-decoder@1.2.3/node_modules/text-decoder/index.js"(exports, module) {
|
|
4303
|
-
const PassThroughDecoder = require_pass_through_decoder();
|
|
4304
|
-
const UTF8Decoder = require_utf8_decoder();
|
|
4305
|
-
module.exports = class TextDecoder$2 {
|
|
4306
|
-
constructor(encoding = "utf8") {
|
|
4307
|
-
this.encoding = normalizeEncoding(encoding);
|
|
4308
|
-
switch (this.encoding) {
|
|
4309
|
-
case "utf8":
|
|
4310
|
-
this.decoder = new UTF8Decoder();
|
|
4311
|
-
break;
|
|
4312
|
-
case "utf16le":
|
|
4313
|
-
case "base64": throw new Error("Unsupported encoding: " + this.encoding);
|
|
4314
|
-
default: this.decoder = new PassThroughDecoder(this.encoding);
|
|
4315
|
-
}
|
|
4316
|
-
}
|
|
4317
|
-
get remaining() {
|
|
4318
|
-
return this.decoder.remaining;
|
|
4319
|
-
}
|
|
4320
|
-
push(data) {
|
|
4321
|
-
if (typeof data === "string") return data;
|
|
4322
|
-
return this.decoder.decode(data);
|
|
4323
|
-
}
|
|
4324
|
-
write(data) {
|
|
4325
|
-
return this.push(data);
|
|
4326
|
-
}
|
|
4327
|
-
end(data) {
|
|
4328
|
-
let result = "";
|
|
4329
|
-
if (data) result = this.push(data);
|
|
4330
|
-
result += this.decoder.flush();
|
|
4331
|
-
return result;
|
|
4332
|
-
}
|
|
4333
|
-
};
|
|
4334
|
-
function normalizeEncoding(encoding) {
|
|
4335
|
-
encoding = encoding.toLowerCase();
|
|
4336
|
-
switch (encoding) {
|
|
4337
|
-
case "utf8":
|
|
4338
|
-
case "utf-8": return "utf8";
|
|
4339
|
-
case "ucs2":
|
|
4340
|
-
case "ucs-2":
|
|
4341
|
-
case "utf16le":
|
|
4342
|
-
case "utf-16le": return "utf16le";
|
|
4343
|
-
case "latin1":
|
|
4344
|
-
case "binary": return "latin1";
|
|
4345
|
-
case "base64":
|
|
4346
|
-
case "ascii":
|
|
4347
|
-
case "hex": return encoding;
|
|
4348
|
-
default: throw new Error("Unknown encoding: " + encoding);
|
|
4349
|
-
}
|
|
4350
|
-
}
|
|
4351
|
-
} });
|
|
4352
|
-
|
|
4353
|
-
//#endregion
|
|
4354
|
-
//#region node_modules/.pnpm/streamx@2.22.0/node_modules/streamx/index.js
|
|
4355
|
-
var require_streamx = __commonJS({ "node_modules/.pnpm/streamx@2.22.0/node_modules/streamx/index.js"(exports, module) {
|
|
4356
|
-
const { EventEmitter } = __require("events");
|
|
4357
|
-
const STREAM_DESTROYED = new Error("Stream was destroyed");
|
|
4358
|
-
const PREMATURE_CLOSE = new Error("Premature close");
|
|
4359
|
-
const FIFO$1 = require_fast_fifo();
|
|
4360
|
-
const TextDecoder$1 = require_text_decoder();
|
|
4361
|
-
const MAX = 536870911;
|
|
4362
|
-
const OPENING = 1;
|
|
4363
|
-
const PREDESTROYING = 2;
|
|
4364
|
-
const DESTROYING = 4;
|
|
4365
|
-
const DESTROYED = 8;
|
|
4366
|
-
const NOT_OPENING = MAX ^ OPENING;
|
|
4367
|
-
const NOT_PREDESTROYING = MAX ^ PREDESTROYING;
|
|
4368
|
-
const READ_ACTIVE = 16;
|
|
4369
|
-
const READ_UPDATING = 32;
|
|
4370
|
-
const READ_PRIMARY = 64;
|
|
4371
|
-
const READ_QUEUED = 128;
|
|
4372
|
-
const READ_RESUMED = 256;
|
|
4373
|
-
const READ_PIPE_DRAINED = 512;
|
|
4374
|
-
const READ_ENDING = 1024;
|
|
4375
|
-
const READ_EMIT_DATA = 2048;
|
|
4376
|
-
const READ_EMIT_READABLE = 4096;
|
|
4377
|
-
const READ_EMITTED_READABLE = 8192;
|
|
4378
|
-
const READ_DONE = 16384;
|
|
4379
|
-
const READ_NEXT_TICK = 32768;
|
|
4380
|
-
const READ_NEEDS_PUSH = 65536;
|
|
4381
|
-
const READ_READ_AHEAD = 131072;
|
|
4382
|
-
const READ_FLOWING = READ_RESUMED | READ_PIPE_DRAINED;
|
|
4383
|
-
const READ_ACTIVE_AND_NEEDS_PUSH = READ_ACTIVE | READ_NEEDS_PUSH;
|
|
4384
|
-
const READ_PRIMARY_AND_ACTIVE = READ_PRIMARY | READ_ACTIVE;
|
|
4385
|
-
const READ_EMIT_READABLE_AND_QUEUED = READ_EMIT_READABLE | READ_QUEUED;
|
|
4386
|
-
const READ_RESUMED_READ_AHEAD = READ_RESUMED | READ_READ_AHEAD;
|
|
4387
|
-
const READ_NOT_ACTIVE = MAX ^ READ_ACTIVE;
|
|
4388
|
-
const READ_NON_PRIMARY = MAX ^ READ_PRIMARY;
|
|
4389
|
-
const READ_NON_PRIMARY_AND_PUSHED = MAX ^ (READ_PRIMARY | READ_NEEDS_PUSH);
|
|
4390
|
-
const READ_PUSHED = MAX ^ READ_NEEDS_PUSH;
|
|
4391
|
-
const READ_PAUSED = MAX ^ READ_RESUMED;
|
|
4392
|
-
const READ_NOT_QUEUED = MAX ^ (READ_QUEUED | READ_EMITTED_READABLE);
|
|
4393
|
-
const READ_NOT_ENDING = MAX ^ READ_ENDING;
|
|
4394
|
-
const READ_PIPE_NOT_DRAINED = MAX ^ READ_FLOWING;
|
|
4395
|
-
const READ_NOT_NEXT_TICK = MAX ^ READ_NEXT_TICK;
|
|
4396
|
-
const READ_NOT_UPDATING = MAX ^ READ_UPDATING;
|
|
4397
|
-
const READ_NO_READ_AHEAD = MAX ^ READ_READ_AHEAD;
|
|
4398
|
-
const READ_PAUSED_NO_READ_AHEAD = MAX ^ READ_RESUMED_READ_AHEAD;
|
|
4399
|
-
const WRITE_ACTIVE = 262144;
|
|
4400
|
-
const WRITE_UPDATING = 524288;
|
|
4401
|
-
const WRITE_PRIMARY = 1048576;
|
|
4402
|
-
const WRITE_QUEUED = 2097152;
|
|
4403
|
-
const WRITE_UNDRAINED = 4194304;
|
|
4404
|
-
const WRITE_DONE = 8388608;
|
|
4405
|
-
const WRITE_EMIT_DRAIN = 16777216;
|
|
4406
|
-
const WRITE_NEXT_TICK = 33554432;
|
|
4407
|
-
const WRITE_WRITING = 67108864;
|
|
4408
|
-
const WRITE_FINISHING = 134217728;
|
|
4409
|
-
const WRITE_CORKED = 268435456;
|
|
4410
|
-
const WRITE_NOT_ACTIVE = MAX ^ (WRITE_ACTIVE | WRITE_WRITING);
|
|
4411
|
-
const WRITE_NON_PRIMARY = MAX ^ WRITE_PRIMARY;
|
|
4412
|
-
const WRITE_NOT_FINISHING = MAX ^ (WRITE_ACTIVE | WRITE_FINISHING);
|
|
4413
|
-
const WRITE_DRAINED = MAX ^ WRITE_UNDRAINED;
|
|
4414
|
-
const WRITE_NOT_QUEUED = MAX ^ WRITE_QUEUED;
|
|
4415
|
-
const WRITE_NOT_NEXT_TICK = MAX ^ WRITE_NEXT_TICK;
|
|
4416
|
-
const WRITE_NOT_UPDATING = MAX ^ WRITE_UPDATING;
|
|
4417
|
-
const WRITE_NOT_CORKED = MAX ^ WRITE_CORKED;
|
|
4418
|
-
const ACTIVE = READ_ACTIVE | WRITE_ACTIVE;
|
|
4419
|
-
const NOT_ACTIVE = MAX ^ ACTIVE;
|
|
4420
|
-
const DONE = READ_DONE | WRITE_DONE;
|
|
4421
|
-
const DESTROY_STATUS = DESTROYING | DESTROYED | PREDESTROYING;
|
|
4422
|
-
const OPEN_STATUS = DESTROY_STATUS | OPENING;
|
|
4423
|
-
const AUTO_DESTROY = DESTROY_STATUS | DONE;
|
|
4424
|
-
const NON_PRIMARY = WRITE_NON_PRIMARY & READ_NON_PRIMARY;
|
|
4425
|
-
const ACTIVE_OR_TICKING = WRITE_NEXT_TICK | READ_NEXT_TICK;
|
|
4426
|
-
const TICKING = ACTIVE_OR_TICKING & NOT_ACTIVE;
|
|
4427
|
-
const IS_OPENING = OPEN_STATUS | TICKING;
|
|
4428
|
-
const READ_PRIMARY_STATUS = OPEN_STATUS | READ_ENDING | READ_DONE;
|
|
4429
|
-
const READ_STATUS = OPEN_STATUS | READ_DONE | READ_QUEUED;
|
|
4430
|
-
const READ_ENDING_STATUS = OPEN_STATUS | READ_ENDING | READ_QUEUED;
|
|
4431
|
-
const READ_READABLE_STATUS = OPEN_STATUS | READ_EMIT_READABLE | READ_QUEUED | READ_EMITTED_READABLE;
|
|
4432
|
-
const SHOULD_NOT_READ = OPEN_STATUS | READ_ACTIVE | READ_ENDING | READ_DONE | READ_NEEDS_PUSH | READ_READ_AHEAD;
|
|
4433
|
-
const READ_BACKPRESSURE_STATUS = DESTROY_STATUS | READ_ENDING | READ_DONE;
|
|
4434
|
-
const READ_UPDATE_SYNC_STATUS = READ_UPDATING | OPEN_STATUS | READ_NEXT_TICK | READ_PRIMARY;
|
|
4435
|
-
const READ_NEXT_TICK_OR_OPENING = READ_NEXT_TICK | OPENING;
|
|
4436
|
-
const WRITE_PRIMARY_STATUS = OPEN_STATUS | WRITE_FINISHING | WRITE_DONE;
|
|
4437
|
-
const WRITE_QUEUED_AND_UNDRAINED = WRITE_QUEUED | WRITE_UNDRAINED;
|
|
4438
|
-
const WRITE_QUEUED_AND_ACTIVE = WRITE_QUEUED | WRITE_ACTIVE;
|
|
4439
|
-
const WRITE_DRAIN_STATUS = WRITE_QUEUED | WRITE_UNDRAINED | OPEN_STATUS | WRITE_ACTIVE;
|
|
4440
|
-
const WRITE_STATUS = OPEN_STATUS | WRITE_ACTIVE | WRITE_QUEUED | WRITE_CORKED;
|
|
4441
|
-
const WRITE_PRIMARY_AND_ACTIVE = WRITE_PRIMARY | WRITE_ACTIVE;
|
|
4442
|
-
const WRITE_ACTIVE_AND_WRITING = WRITE_ACTIVE | WRITE_WRITING;
|
|
4443
|
-
const WRITE_FINISHING_STATUS = OPEN_STATUS | WRITE_FINISHING | WRITE_QUEUED_AND_ACTIVE | WRITE_DONE;
|
|
4444
|
-
const WRITE_BACKPRESSURE_STATUS = WRITE_UNDRAINED | DESTROY_STATUS | WRITE_FINISHING | WRITE_DONE;
|
|
4445
|
-
const WRITE_UPDATE_SYNC_STATUS = WRITE_UPDATING | OPEN_STATUS | WRITE_NEXT_TICK | WRITE_PRIMARY;
|
|
4446
|
-
const WRITE_DROP_DATA = WRITE_FINISHING | WRITE_DONE | DESTROY_STATUS;
|
|
4447
|
-
const asyncIterator = Symbol.asyncIterator || Symbol("asyncIterator");
|
|
4448
|
-
var WritableState = class {
|
|
4449
|
-
constructor(stream, { highWaterMark = 16384, map = null, mapWritable: mapWritable$1, byteLength: byteLength$1, byteLengthWritable } = {}) {
|
|
4450
|
-
this.stream = stream;
|
|
4451
|
-
this.queue = new FIFO$1();
|
|
4452
|
-
this.highWaterMark = highWaterMark;
|
|
4453
|
-
this.buffered = 0;
|
|
4454
|
-
this.error = null;
|
|
4455
|
-
this.pipeline = null;
|
|
4456
|
-
this.drains = null;
|
|
4457
|
-
this.byteLength = byteLengthWritable || byteLength$1 || defaultByteLength;
|
|
4458
|
-
this.map = mapWritable$1 || map;
|
|
4459
|
-
this.afterWrite = afterWrite.bind(this);
|
|
4460
|
-
this.afterUpdateNextTick = updateWriteNT.bind(this);
|
|
4461
|
-
}
|
|
4462
|
-
get ended() {
|
|
4463
|
-
return (this.stream._duplexState & WRITE_DONE) !== 0;
|
|
4464
|
-
}
|
|
4465
|
-
push(data) {
|
|
4466
|
-
if ((this.stream._duplexState & WRITE_DROP_DATA) !== 0) return false;
|
|
4467
|
-
if (this.map !== null) data = this.map(data);
|
|
4468
|
-
this.buffered += this.byteLength(data);
|
|
4469
|
-
this.queue.push(data);
|
|
4470
|
-
if (this.buffered < this.highWaterMark) {
|
|
4471
|
-
this.stream._duplexState |= WRITE_QUEUED;
|
|
4472
|
-
return true;
|
|
4473
|
-
}
|
|
4474
|
-
this.stream._duplexState |= WRITE_QUEUED_AND_UNDRAINED;
|
|
4475
|
-
return false;
|
|
4476
|
-
}
|
|
4477
|
-
shift() {
|
|
4478
|
-
const data = this.queue.shift();
|
|
4479
|
-
this.buffered -= this.byteLength(data);
|
|
4480
|
-
if (this.buffered === 0) this.stream._duplexState &= WRITE_NOT_QUEUED;
|
|
4481
|
-
return data;
|
|
4482
|
-
}
|
|
4483
|
-
end(data) {
|
|
4484
|
-
if (typeof data === "function") this.stream.once("finish", data);
|
|
4485
|
-
else if (data !== undefined && data !== null) this.push(data);
|
|
4486
|
-
this.stream._duplexState = (this.stream._duplexState | WRITE_FINISHING) & WRITE_NON_PRIMARY;
|
|
4487
|
-
}
|
|
4488
|
-
autoBatch(data, cb) {
|
|
4489
|
-
const buffer = [];
|
|
4490
|
-
const stream = this.stream;
|
|
4491
|
-
buffer.push(data);
|
|
4492
|
-
while ((stream._duplexState & WRITE_STATUS) === WRITE_QUEUED_AND_ACTIVE) buffer.push(stream._writableState.shift());
|
|
4493
|
-
if ((stream._duplexState & OPEN_STATUS) !== 0) return cb(null);
|
|
4494
|
-
stream._writev(buffer, cb);
|
|
4495
|
-
}
|
|
4496
|
-
update() {
|
|
4497
|
-
const stream = this.stream;
|
|
4498
|
-
stream._duplexState |= WRITE_UPDATING;
|
|
4499
|
-
do {
|
|
4500
|
-
while ((stream._duplexState & WRITE_STATUS) === WRITE_QUEUED) {
|
|
4501
|
-
const data = this.shift();
|
|
4502
|
-
stream._duplexState |= WRITE_ACTIVE_AND_WRITING;
|
|
4503
|
-
stream._write(data, this.afterWrite);
|
|
4504
|
-
}
|
|
4505
|
-
if ((stream._duplexState & WRITE_PRIMARY_AND_ACTIVE) === 0) this.updateNonPrimary();
|
|
4506
|
-
} while (this.continueUpdate() === true);
|
|
4507
|
-
stream._duplexState &= WRITE_NOT_UPDATING;
|
|
4508
|
-
}
|
|
4509
|
-
updateNonPrimary() {
|
|
4510
|
-
const stream = this.stream;
|
|
4511
|
-
if ((stream._duplexState & WRITE_FINISHING_STATUS) === WRITE_FINISHING) {
|
|
4512
|
-
stream._duplexState = stream._duplexState | WRITE_ACTIVE;
|
|
4513
|
-
stream._final(afterFinal.bind(this));
|
|
4514
|
-
return;
|
|
4515
|
-
}
|
|
4516
|
-
if ((stream._duplexState & DESTROY_STATUS) === DESTROYING) {
|
|
4517
|
-
if ((stream._duplexState & ACTIVE_OR_TICKING) === 0) {
|
|
4518
|
-
stream._duplexState |= ACTIVE;
|
|
4519
|
-
stream._destroy(afterDestroy.bind(this));
|
|
4520
|
-
}
|
|
4521
|
-
return;
|
|
4522
|
-
}
|
|
4523
|
-
if ((stream._duplexState & IS_OPENING) === OPENING) {
|
|
4524
|
-
stream._duplexState = (stream._duplexState | ACTIVE) & NOT_OPENING;
|
|
4525
|
-
stream._open(afterOpen.bind(this));
|
|
4526
|
-
}
|
|
4527
|
-
}
|
|
4528
|
-
continueUpdate() {
|
|
4529
|
-
if ((this.stream._duplexState & WRITE_NEXT_TICK) === 0) return false;
|
|
4530
|
-
this.stream._duplexState &= WRITE_NOT_NEXT_TICK;
|
|
4531
|
-
return true;
|
|
4532
|
-
}
|
|
4533
|
-
updateCallback() {
|
|
4534
|
-
if ((this.stream._duplexState & WRITE_UPDATE_SYNC_STATUS) === WRITE_PRIMARY) this.update();
|
|
4535
|
-
else this.updateNextTick();
|
|
4536
|
-
}
|
|
4537
|
-
updateNextTick() {
|
|
4538
|
-
if ((this.stream._duplexState & WRITE_NEXT_TICK) !== 0) return;
|
|
4539
|
-
this.stream._duplexState |= WRITE_NEXT_TICK;
|
|
4540
|
-
if ((this.stream._duplexState & WRITE_UPDATING) === 0) queueMicrotask(this.afterUpdateNextTick);
|
|
4541
|
-
}
|
|
4542
|
-
};
|
|
4543
|
-
var ReadableState = class {
|
|
4544
|
-
constructor(stream, { highWaterMark = 16384, map = null, mapReadable, byteLength: byteLength$1, byteLengthReadable } = {}) {
|
|
4545
|
-
this.stream = stream;
|
|
4546
|
-
this.queue = new FIFO$1();
|
|
4547
|
-
this.highWaterMark = highWaterMark === 0 ? 1 : highWaterMark;
|
|
4548
|
-
this.buffered = 0;
|
|
4549
|
-
this.readAhead = highWaterMark > 0;
|
|
4550
|
-
this.error = null;
|
|
4551
|
-
this.pipeline = null;
|
|
4552
|
-
this.byteLength = byteLengthReadable || byteLength$1 || defaultByteLength;
|
|
4553
|
-
this.map = mapReadable || map;
|
|
4554
|
-
this.pipeTo = null;
|
|
4555
|
-
this.afterRead = afterRead.bind(this);
|
|
4556
|
-
this.afterUpdateNextTick = updateReadNT.bind(this);
|
|
4557
|
-
}
|
|
4558
|
-
get ended() {
|
|
4559
|
-
return (this.stream._duplexState & READ_DONE) !== 0;
|
|
4560
|
-
}
|
|
4561
|
-
pipe(pipeTo, cb) {
|
|
4562
|
-
if (this.pipeTo !== null) throw new Error("Can only pipe to one destination");
|
|
4563
|
-
if (typeof cb !== "function") cb = null;
|
|
4564
|
-
this.stream._duplexState |= READ_PIPE_DRAINED;
|
|
4565
|
-
this.pipeTo = pipeTo;
|
|
4566
|
-
this.pipeline = new Pipeline(this.stream, pipeTo, cb);
|
|
4567
|
-
if (cb) this.stream.on("error", noop$5);
|
|
4568
|
-
if (isStreamx(pipeTo)) {
|
|
4569
|
-
pipeTo._writableState.pipeline = this.pipeline;
|
|
4570
|
-
if (cb) pipeTo.on("error", noop$5);
|
|
4571
|
-
pipeTo.on("finish", this.pipeline.finished.bind(this.pipeline));
|
|
4572
|
-
} else {
|
|
4573
|
-
const onerror = this.pipeline.done.bind(this.pipeline, pipeTo);
|
|
4574
|
-
const onclose = this.pipeline.done.bind(this.pipeline, pipeTo, null);
|
|
4575
|
-
pipeTo.on("error", onerror);
|
|
4576
|
-
pipeTo.on("close", onclose);
|
|
4577
|
-
pipeTo.on("finish", this.pipeline.finished.bind(this.pipeline));
|
|
4578
|
-
}
|
|
4579
|
-
pipeTo.on("drain", afterDrain.bind(this));
|
|
4580
|
-
this.stream.emit("piping", pipeTo);
|
|
4581
|
-
pipeTo.emit("pipe", this.stream);
|
|
4582
|
-
}
|
|
4583
|
-
push(data) {
|
|
4584
|
-
const stream = this.stream;
|
|
4585
|
-
if (data === null) {
|
|
4586
|
-
this.highWaterMark = 0;
|
|
4587
|
-
stream._duplexState = (stream._duplexState | READ_ENDING) & READ_NON_PRIMARY_AND_PUSHED;
|
|
4588
|
-
return false;
|
|
4589
|
-
}
|
|
4590
|
-
if (this.map !== null) {
|
|
4591
|
-
data = this.map(data);
|
|
4592
|
-
if (data === null) {
|
|
4593
|
-
stream._duplexState &= READ_PUSHED;
|
|
4594
|
-
return this.buffered < this.highWaterMark;
|
|
4595
|
-
}
|
|
4596
|
-
}
|
|
4597
|
-
this.buffered += this.byteLength(data);
|
|
4598
|
-
this.queue.push(data);
|
|
4599
|
-
stream._duplexState = (stream._duplexState | READ_QUEUED) & READ_PUSHED;
|
|
4600
|
-
return this.buffered < this.highWaterMark;
|
|
4601
|
-
}
|
|
4602
|
-
shift() {
|
|
4603
|
-
const data = this.queue.shift();
|
|
4604
|
-
this.buffered -= this.byteLength(data);
|
|
4605
|
-
if (this.buffered === 0) this.stream._duplexState &= READ_NOT_QUEUED;
|
|
4606
|
-
return data;
|
|
4607
|
-
}
|
|
4608
|
-
unshift(data) {
|
|
4609
|
-
const pending = [this.map !== null ? this.map(data) : data];
|
|
4610
|
-
while (this.buffered > 0) pending.push(this.shift());
|
|
4611
|
-
for (let i = 0; i < pending.length - 1; i++) {
|
|
4612
|
-
const data$1 = pending[i];
|
|
4613
|
-
this.buffered += this.byteLength(data$1);
|
|
4614
|
-
this.queue.push(data$1);
|
|
4615
|
-
}
|
|
4616
|
-
this.push(pending[pending.length - 1]);
|
|
4617
|
-
}
|
|
4618
|
-
read() {
|
|
4619
|
-
const stream = this.stream;
|
|
4620
|
-
if ((stream._duplexState & READ_STATUS) === READ_QUEUED) {
|
|
4621
|
-
const data = this.shift();
|
|
4622
|
-
if (this.pipeTo !== null && this.pipeTo.write(data) === false) stream._duplexState &= READ_PIPE_NOT_DRAINED;
|
|
4623
|
-
if ((stream._duplexState & READ_EMIT_DATA) !== 0) stream.emit("data", data);
|
|
4624
|
-
return data;
|
|
4625
|
-
}
|
|
4626
|
-
if (this.readAhead === false) {
|
|
4627
|
-
stream._duplexState |= READ_READ_AHEAD;
|
|
4628
|
-
this.updateNextTick();
|
|
4629
|
-
}
|
|
4630
|
-
return null;
|
|
4631
|
-
}
|
|
4632
|
-
drain() {
|
|
4633
|
-
const stream = this.stream;
|
|
4634
|
-
while ((stream._duplexState & READ_STATUS) === READ_QUEUED && (stream._duplexState & READ_FLOWING) !== 0) {
|
|
4635
|
-
const data = this.shift();
|
|
4636
|
-
if (this.pipeTo !== null && this.pipeTo.write(data) === false) stream._duplexState &= READ_PIPE_NOT_DRAINED;
|
|
4637
|
-
if ((stream._duplexState & READ_EMIT_DATA) !== 0) stream.emit("data", data);
|
|
4638
|
-
}
|
|
4639
|
-
}
|
|
4640
|
-
update() {
|
|
4641
|
-
const stream = this.stream;
|
|
4642
|
-
stream._duplexState |= READ_UPDATING;
|
|
4643
|
-
do {
|
|
4644
|
-
this.drain();
|
|
4645
|
-
while (this.buffered < this.highWaterMark && (stream._duplexState & SHOULD_NOT_READ) === READ_READ_AHEAD) {
|
|
4646
|
-
stream._duplexState |= READ_ACTIVE_AND_NEEDS_PUSH;
|
|
4647
|
-
stream._read(this.afterRead);
|
|
4648
|
-
this.drain();
|
|
4649
|
-
}
|
|
4650
|
-
if ((stream._duplexState & READ_READABLE_STATUS) === READ_EMIT_READABLE_AND_QUEUED) {
|
|
4651
|
-
stream._duplexState |= READ_EMITTED_READABLE;
|
|
4652
|
-
stream.emit("readable");
|
|
4653
|
-
}
|
|
4654
|
-
if ((stream._duplexState & READ_PRIMARY_AND_ACTIVE) === 0) this.updateNonPrimary();
|
|
4655
|
-
} while (this.continueUpdate() === true);
|
|
4656
|
-
stream._duplexState &= READ_NOT_UPDATING;
|
|
4657
|
-
}
|
|
4658
|
-
updateNonPrimary() {
|
|
4659
|
-
const stream = this.stream;
|
|
4660
|
-
if ((stream._duplexState & READ_ENDING_STATUS) === READ_ENDING) {
|
|
4661
|
-
stream._duplexState = (stream._duplexState | READ_DONE) & READ_NOT_ENDING;
|
|
4662
|
-
stream.emit("end");
|
|
4663
|
-
if ((stream._duplexState & AUTO_DESTROY) === DONE) stream._duplexState |= DESTROYING;
|
|
4664
|
-
if (this.pipeTo !== null) this.pipeTo.end();
|
|
4665
|
-
}
|
|
4666
|
-
if ((stream._duplexState & DESTROY_STATUS) === DESTROYING) {
|
|
4667
|
-
if ((stream._duplexState & ACTIVE_OR_TICKING) === 0) {
|
|
4668
|
-
stream._duplexState |= ACTIVE;
|
|
4669
|
-
stream._destroy(afterDestroy.bind(this));
|
|
4670
|
-
}
|
|
4671
|
-
return;
|
|
4672
|
-
}
|
|
4673
|
-
if ((stream._duplexState & IS_OPENING) === OPENING) {
|
|
4674
|
-
stream._duplexState = (stream._duplexState | ACTIVE) & NOT_OPENING;
|
|
4675
|
-
stream._open(afterOpen.bind(this));
|
|
4676
|
-
}
|
|
4677
|
-
}
|
|
4678
|
-
continueUpdate() {
|
|
4679
|
-
if ((this.stream._duplexState & READ_NEXT_TICK) === 0) return false;
|
|
4680
|
-
this.stream._duplexState &= READ_NOT_NEXT_TICK;
|
|
4681
|
-
return true;
|
|
4682
|
-
}
|
|
4683
|
-
updateCallback() {
|
|
4684
|
-
if ((this.stream._duplexState & READ_UPDATE_SYNC_STATUS) === READ_PRIMARY) this.update();
|
|
4685
|
-
else this.updateNextTick();
|
|
4686
|
-
}
|
|
4687
|
-
updateNextTickIfOpen() {
|
|
4688
|
-
if ((this.stream._duplexState & READ_NEXT_TICK_OR_OPENING) !== 0) return;
|
|
4689
|
-
this.stream._duplexState |= READ_NEXT_TICK;
|
|
4690
|
-
if ((this.stream._duplexState & READ_UPDATING) === 0) queueMicrotask(this.afterUpdateNextTick);
|
|
4691
|
-
}
|
|
4692
|
-
updateNextTick() {
|
|
4693
|
-
if ((this.stream._duplexState & READ_NEXT_TICK) !== 0) return;
|
|
4694
|
-
this.stream._duplexState |= READ_NEXT_TICK;
|
|
4695
|
-
if ((this.stream._duplexState & READ_UPDATING) === 0) queueMicrotask(this.afterUpdateNextTick);
|
|
4696
|
-
}
|
|
4697
|
-
};
|
|
4698
|
-
var TransformState = class {
|
|
4699
|
-
constructor(stream) {
|
|
4700
|
-
this.data = null;
|
|
4701
|
-
this.afterTransform = afterTransform.bind(stream);
|
|
4702
|
-
this.afterFinal = null;
|
|
4703
|
-
}
|
|
4704
|
-
};
|
|
4705
|
-
var Pipeline = class {
|
|
4706
|
-
constructor(src, dst, cb) {
|
|
4707
|
-
this.from = src;
|
|
4708
|
-
this.to = dst;
|
|
4709
|
-
this.afterPipe = cb;
|
|
4710
|
-
this.error = null;
|
|
4711
|
-
this.pipeToFinished = false;
|
|
4712
|
-
}
|
|
4713
|
-
finished() {
|
|
4714
|
-
this.pipeToFinished = true;
|
|
4715
|
-
}
|
|
4716
|
-
done(stream, err) {
|
|
4717
|
-
if (err) this.error = err;
|
|
4718
|
-
if (stream === this.to) {
|
|
4719
|
-
this.to = null;
|
|
4720
|
-
if (this.from !== null) {
|
|
4721
|
-
if ((this.from._duplexState & READ_DONE) === 0 || !this.pipeToFinished) this.from.destroy(this.error || new Error("Writable stream closed prematurely"));
|
|
4722
|
-
return;
|
|
4723
|
-
}
|
|
4724
|
-
}
|
|
4725
|
-
if (stream === this.from) {
|
|
4726
|
-
this.from = null;
|
|
4727
|
-
if (this.to !== null) {
|
|
4728
|
-
if ((stream._duplexState & READ_DONE) === 0) this.to.destroy(this.error || new Error("Readable stream closed before ending"));
|
|
4729
|
-
return;
|
|
4730
|
-
}
|
|
4731
|
-
}
|
|
4732
|
-
if (this.afterPipe !== null) this.afterPipe(this.error);
|
|
4733
|
-
this.to = this.from = this.afterPipe = null;
|
|
4734
|
-
}
|
|
4735
|
-
};
|
|
4736
|
-
function afterDrain() {
|
|
4737
|
-
this.stream._duplexState |= READ_PIPE_DRAINED;
|
|
4738
|
-
this.updateCallback();
|
|
4739
|
-
}
|
|
4740
|
-
function afterFinal(err) {
|
|
4741
|
-
const stream = this.stream;
|
|
4742
|
-
if (err) stream.destroy(err);
|
|
4743
|
-
if ((stream._duplexState & DESTROY_STATUS) === 0) {
|
|
4744
|
-
stream._duplexState |= WRITE_DONE;
|
|
4745
|
-
stream.emit("finish");
|
|
4746
|
-
}
|
|
4747
|
-
if ((stream._duplexState & AUTO_DESTROY) === DONE) stream._duplexState |= DESTROYING;
|
|
4748
|
-
stream._duplexState &= WRITE_NOT_FINISHING;
|
|
4749
|
-
if ((stream._duplexState & WRITE_UPDATING) === 0) this.update();
|
|
4750
|
-
else this.updateNextTick();
|
|
4751
|
-
}
|
|
4752
|
-
function afterDestroy(err) {
|
|
4753
|
-
const stream = this.stream;
|
|
4754
|
-
if (!err && this.error !== STREAM_DESTROYED) err = this.error;
|
|
4755
|
-
if (err) stream.emit("error", err);
|
|
4756
|
-
stream._duplexState |= DESTROYED;
|
|
4757
|
-
stream.emit("close");
|
|
4758
|
-
const rs = stream._readableState;
|
|
4759
|
-
const ws = stream._writableState;
|
|
4760
|
-
if (rs !== null && rs.pipeline !== null) rs.pipeline.done(stream, err);
|
|
4761
|
-
if (ws !== null) {
|
|
4762
|
-
while (ws.drains !== null && ws.drains.length > 0) ws.drains.shift().resolve(false);
|
|
4763
|
-
if (ws.pipeline !== null) ws.pipeline.done(stream, err);
|
|
4764
|
-
}
|
|
4765
|
-
}
|
|
4766
|
-
function afterWrite(err) {
|
|
4767
|
-
const stream = this.stream;
|
|
4768
|
-
if (err) stream.destroy(err);
|
|
4769
|
-
stream._duplexState &= WRITE_NOT_ACTIVE;
|
|
4770
|
-
if (this.drains !== null) tickDrains(this.drains);
|
|
4771
|
-
if ((stream._duplexState & WRITE_DRAIN_STATUS) === WRITE_UNDRAINED) {
|
|
4772
|
-
stream._duplexState &= WRITE_DRAINED;
|
|
4773
|
-
if ((stream._duplexState & WRITE_EMIT_DRAIN) === WRITE_EMIT_DRAIN) stream.emit("drain");
|
|
4774
|
-
}
|
|
4775
|
-
this.updateCallback();
|
|
4776
|
-
}
|
|
4777
|
-
function afterRead(err) {
|
|
4778
|
-
if (err) this.stream.destroy(err);
|
|
4779
|
-
this.stream._duplexState &= READ_NOT_ACTIVE;
|
|
4780
|
-
if (this.readAhead === false && (this.stream._duplexState & READ_RESUMED) === 0) this.stream._duplexState &= READ_NO_READ_AHEAD;
|
|
4781
|
-
this.updateCallback();
|
|
4782
|
-
}
|
|
4783
|
-
function updateReadNT() {
|
|
4784
|
-
if ((this.stream._duplexState & READ_UPDATING) === 0) {
|
|
4785
|
-
this.stream._duplexState &= READ_NOT_NEXT_TICK;
|
|
4786
|
-
this.update();
|
|
4787
|
-
}
|
|
4788
|
-
}
|
|
4789
|
-
function updateWriteNT() {
|
|
4790
|
-
if ((this.stream._duplexState & WRITE_UPDATING) === 0) {
|
|
4791
|
-
this.stream._duplexState &= WRITE_NOT_NEXT_TICK;
|
|
4792
|
-
this.update();
|
|
4793
|
-
}
|
|
4794
|
-
}
|
|
4795
|
-
function tickDrains(drains) {
|
|
4796
|
-
for (let i = 0; i < drains.length; i++) if (--drains[i].writes === 0) {
|
|
4797
|
-
drains.shift().resolve(true);
|
|
4798
|
-
i--;
|
|
4799
|
-
}
|
|
4800
|
-
}
|
|
4801
|
-
function afterOpen(err) {
|
|
4802
|
-
const stream = this.stream;
|
|
4803
|
-
if (err) stream.destroy(err);
|
|
4804
|
-
if ((stream._duplexState & DESTROYING) === 0) {
|
|
4805
|
-
if ((stream._duplexState & READ_PRIMARY_STATUS) === 0) stream._duplexState |= READ_PRIMARY;
|
|
4806
|
-
if ((stream._duplexState & WRITE_PRIMARY_STATUS) === 0) stream._duplexState |= WRITE_PRIMARY;
|
|
4807
|
-
stream.emit("open");
|
|
4808
|
-
}
|
|
4809
|
-
stream._duplexState &= NOT_ACTIVE;
|
|
4810
|
-
if (stream._writableState !== null) stream._writableState.updateCallback();
|
|
4811
|
-
if (stream._readableState !== null) stream._readableState.updateCallback();
|
|
4812
|
-
}
|
|
4813
|
-
function afterTransform(err, data) {
|
|
4814
|
-
if (data !== undefined && data !== null) this.push(data);
|
|
4815
|
-
this._writableState.afterWrite(err);
|
|
4816
|
-
}
|
|
4817
|
-
function newListener(name$1) {
|
|
4818
|
-
if (this._readableState !== null) {
|
|
4819
|
-
if (name$1 === "data") {
|
|
4820
|
-
this._duplexState |= READ_EMIT_DATA | READ_RESUMED_READ_AHEAD;
|
|
4821
|
-
this._readableState.updateNextTick();
|
|
4822
|
-
}
|
|
4823
|
-
if (name$1 === "readable") {
|
|
4824
|
-
this._duplexState |= READ_EMIT_READABLE;
|
|
4825
|
-
this._readableState.updateNextTick();
|
|
4826
|
-
}
|
|
4827
|
-
}
|
|
4828
|
-
if (this._writableState !== null) {
|
|
4829
|
-
if (name$1 === "drain") {
|
|
4830
|
-
this._duplexState |= WRITE_EMIT_DRAIN;
|
|
4831
|
-
this._writableState.updateNextTick();
|
|
4832
|
-
}
|
|
4833
|
-
}
|
|
4834
|
-
}
|
|
4835
|
-
var Stream = class extends EventEmitter {
|
|
4836
|
-
constructor(opts) {
|
|
4837
|
-
super();
|
|
4838
|
-
this._duplexState = 0;
|
|
4839
|
-
this._readableState = null;
|
|
4840
|
-
this._writableState = null;
|
|
4841
|
-
if (opts) {
|
|
4842
|
-
if (opts.open) this._open = opts.open;
|
|
4843
|
-
if (opts.destroy) this._destroy = opts.destroy;
|
|
4844
|
-
if (opts.predestroy) this._predestroy = opts.predestroy;
|
|
4845
|
-
if (opts.signal) opts.signal.addEventListener("abort", abort.bind(this));
|
|
4846
|
-
}
|
|
4847
|
-
this.on("newListener", newListener);
|
|
4848
|
-
}
|
|
4849
|
-
_open(cb) {
|
|
4850
|
-
cb(null);
|
|
4851
|
-
}
|
|
4852
|
-
_destroy(cb) {
|
|
4853
|
-
cb(null);
|
|
4854
|
-
}
|
|
4855
|
-
_predestroy() {}
|
|
4856
|
-
get readable() {
|
|
4857
|
-
return this._readableState !== null ? true : undefined;
|
|
4858
|
-
}
|
|
4859
|
-
get writable() {
|
|
4860
|
-
return this._writableState !== null ? true : undefined;
|
|
4861
|
-
}
|
|
4862
|
-
get destroyed() {
|
|
4863
|
-
return (this._duplexState & DESTROYED) !== 0;
|
|
4864
|
-
}
|
|
4865
|
-
get destroying() {
|
|
4866
|
-
return (this._duplexState & DESTROY_STATUS) !== 0;
|
|
4867
|
-
}
|
|
4868
|
-
destroy(err) {
|
|
4869
|
-
if ((this._duplexState & DESTROY_STATUS) === 0) {
|
|
4870
|
-
if (!err) err = STREAM_DESTROYED;
|
|
4871
|
-
this._duplexState = (this._duplexState | DESTROYING) & NON_PRIMARY;
|
|
4872
|
-
if (this._readableState !== null) {
|
|
4873
|
-
this._readableState.highWaterMark = 0;
|
|
4874
|
-
this._readableState.error = err;
|
|
4875
|
-
}
|
|
4876
|
-
if (this._writableState !== null) {
|
|
4877
|
-
this._writableState.highWaterMark = 0;
|
|
4878
|
-
this._writableState.error = err;
|
|
4879
|
-
}
|
|
4880
|
-
this._duplexState |= PREDESTROYING;
|
|
4881
|
-
this._predestroy();
|
|
4882
|
-
this._duplexState &= NOT_PREDESTROYING;
|
|
4883
|
-
if (this._readableState !== null) this._readableState.updateNextTick();
|
|
4884
|
-
if (this._writableState !== null) this._writableState.updateNextTick();
|
|
4885
|
-
}
|
|
4886
|
-
}
|
|
4887
|
-
};
|
|
4888
|
-
var Readable$2 = class Readable$2 extends Stream {
|
|
4889
|
-
constructor(opts) {
|
|
4890
|
-
super(opts);
|
|
4891
|
-
this._duplexState |= OPENING | WRITE_DONE | READ_READ_AHEAD;
|
|
4892
|
-
this._readableState = new ReadableState(this, opts);
|
|
4893
|
-
if (opts) {
|
|
4894
|
-
if (this._readableState.readAhead === false) this._duplexState &= READ_NO_READ_AHEAD;
|
|
4895
|
-
if (opts.read) this._read = opts.read;
|
|
4896
|
-
if (opts.eagerOpen) this._readableState.updateNextTick();
|
|
4897
|
-
if (opts.encoding) this.setEncoding(opts.encoding);
|
|
4898
|
-
}
|
|
4899
|
-
}
|
|
4900
|
-
setEncoding(encoding) {
|
|
4901
|
-
const dec = new TextDecoder$1(encoding);
|
|
4902
|
-
const map = this._readableState.map || echo$1;
|
|
4903
|
-
this._readableState.map = mapOrSkip;
|
|
4904
|
-
return this;
|
|
4905
|
-
function mapOrSkip(data) {
|
|
4906
|
-
const next = dec.push(data);
|
|
4907
|
-
return next === "" && (data.byteLength !== 0 || dec.remaining > 0) ? null : map(next);
|
|
4908
|
-
}
|
|
4909
|
-
}
|
|
4910
|
-
_read(cb) {
|
|
4911
|
-
cb(null);
|
|
4912
|
-
}
|
|
4913
|
-
pipe(dest, cb) {
|
|
4914
|
-
this._readableState.updateNextTick();
|
|
4915
|
-
this._readableState.pipe(dest, cb);
|
|
4916
|
-
return dest;
|
|
4917
|
-
}
|
|
4918
|
-
read() {
|
|
4919
|
-
this._readableState.updateNextTick();
|
|
4920
|
-
return this._readableState.read();
|
|
4921
|
-
}
|
|
4922
|
-
push(data) {
|
|
4923
|
-
this._readableState.updateNextTickIfOpen();
|
|
4924
|
-
return this._readableState.push(data);
|
|
4925
|
-
}
|
|
4926
|
-
unshift(data) {
|
|
4927
|
-
this._readableState.updateNextTickIfOpen();
|
|
4928
|
-
return this._readableState.unshift(data);
|
|
4929
|
-
}
|
|
4930
|
-
resume() {
|
|
4931
|
-
this._duplexState |= READ_RESUMED_READ_AHEAD;
|
|
4932
|
-
this._readableState.updateNextTick();
|
|
4933
|
-
return this;
|
|
4934
|
-
}
|
|
4935
|
-
pause() {
|
|
4936
|
-
this._duplexState &= this._readableState.readAhead === false ? READ_PAUSED_NO_READ_AHEAD : READ_PAUSED;
|
|
4937
|
-
return this;
|
|
4938
|
-
}
|
|
4939
|
-
static _fromAsyncIterator(ite, opts) {
|
|
4940
|
-
let destroy;
|
|
4941
|
-
const rs = new Readable$2({
|
|
4942
|
-
...opts,
|
|
4943
|
-
read(cb) {
|
|
4944
|
-
ite.next().then(push).then(cb.bind(null, null)).catch(cb);
|
|
4945
|
-
},
|
|
4946
|
-
predestroy() {
|
|
4947
|
-
destroy = ite.return();
|
|
4948
|
-
},
|
|
4949
|
-
destroy(cb) {
|
|
4950
|
-
if (!destroy) return cb(null);
|
|
4951
|
-
destroy.then(cb.bind(null, null)).catch(cb);
|
|
4952
|
-
}
|
|
4953
|
-
});
|
|
4954
|
-
return rs;
|
|
4955
|
-
function push(data) {
|
|
4956
|
-
if (data.done) rs.push(null);
|
|
4957
|
-
else rs.push(data.value);
|
|
4958
|
-
}
|
|
4959
|
-
}
|
|
4960
|
-
static from(data, opts) {
|
|
4961
|
-
if (isReadStreamx(data)) return data;
|
|
4962
|
-
if (data[asyncIterator]) return this._fromAsyncIterator(data[asyncIterator](), opts);
|
|
4963
|
-
if (!Array.isArray(data)) data = data === undefined ? [] : [data];
|
|
4964
|
-
let i = 0;
|
|
4965
|
-
return new Readable$2({
|
|
4966
|
-
...opts,
|
|
4967
|
-
read(cb) {
|
|
4968
|
-
this.push(i === data.length ? null : data[i++]);
|
|
4969
|
-
cb(null);
|
|
4970
|
-
}
|
|
4971
|
-
});
|
|
4972
|
-
}
|
|
4973
|
-
static isBackpressured(rs) {
|
|
4974
|
-
return (rs._duplexState & READ_BACKPRESSURE_STATUS) !== 0 || rs._readableState.buffered >= rs._readableState.highWaterMark;
|
|
4975
|
-
}
|
|
4976
|
-
static isPaused(rs) {
|
|
4977
|
-
return (rs._duplexState & READ_RESUMED) === 0;
|
|
4978
|
-
}
|
|
4979
|
-
[asyncIterator]() {
|
|
4980
|
-
const stream = this;
|
|
4981
|
-
let error = null;
|
|
4982
|
-
let promiseResolve = null;
|
|
4983
|
-
let promiseReject = null;
|
|
4984
|
-
this.on("error", (err) => {
|
|
4985
|
-
error = err;
|
|
4986
|
-
});
|
|
4987
|
-
this.on("readable", onreadable);
|
|
4988
|
-
this.on("close", onclose);
|
|
4989
|
-
return {
|
|
4990
|
-
[asyncIterator]() {
|
|
4991
|
-
return this;
|
|
4992
|
-
},
|
|
4993
|
-
next() {
|
|
4994
|
-
return new Promise(function(resolve$1, reject) {
|
|
4995
|
-
promiseResolve = resolve$1;
|
|
4996
|
-
promiseReject = reject;
|
|
4997
|
-
const data = stream.read();
|
|
4998
|
-
if (data !== null) ondata(data);
|
|
4999
|
-
else if ((stream._duplexState & DESTROYED) !== 0) ondata(null);
|
|
5000
|
-
});
|
|
5001
|
-
},
|
|
5002
|
-
return() {
|
|
5003
|
-
return destroy(null);
|
|
5004
|
-
},
|
|
5005
|
-
throw(err) {
|
|
5006
|
-
return destroy(err);
|
|
5007
|
-
}
|
|
5008
|
-
};
|
|
5009
|
-
function onreadable() {
|
|
5010
|
-
if (promiseResolve !== null) ondata(stream.read());
|
|
5011
|
-
}
|
|
5012
|
-
function onclose() {
|
|
5013
|
-
if (promiseResolve !== null) ondata(null);
|
|
5014
|
-
}
|
|
5015
|
-
function ondata(data) {
|
|
5016
|
-
if (promiseReject === null) return;
|
|
5017
|
-
if (error) promiseReject(error);
|
|
5018
|
-
else if (data === null && (stream._duplexState & READ_DONE) === 0) promiseReject(STREAM_DESTROYED);
|
|
5019
|
-
else promiseResolve({
|
|
5020
|
-
value: data,
|
|
5021
|
-
done: data === null
|
|
5022
|
-
});
|
|
5023
|
-
promiseReject = promiseResolve = null;
|
|
5024
|
-
}
|
|
5025
|
-
function destroy(err) {
|
|
5026
|
-
stream.destroy(err);
|
|
5027
|
-
return new Promise((resolve$1, reject) => {
|
|
5028
|
-
if (stream._duplexState & DESTROYED) return resolve$1({
|
|
5029
|
-
value: undefined,
|
|
5030
|
-
done: true
|
|
5031
|
-
});
|
|
5032
|
-
stream.once("close", function() {
|
|
5033
|
-
if (err) reject(err);
|
|
5034
|
-
else resolve$1({
|
|
5035
|
-
value: undefined,
|
|
5036
|
-
done: true
|
|
5037
|
-
});
|
|
5038
|
-
});
|
|
5039
|
-
});
|
|
5040
|
-
}
|
|
5041
|
-
}
|
|
5042
|
-
};
|
|
5043
|
-
var Writable$2 = class extends Stream {
|
|
5044
|
-
constructor(opts) {
|
|
5045
|
-
super(opts);
|
|
5046
|
-
this._duplexState |= OPENING | READ_DONE;
|
|
5047
|
-
this._writableState = new WritableState(this, opts);
|
|
5048
|
-
if (opts) {
|
|
5049
|
-
if (opts.writev) this._writev = opts.writev;
|
|
5050
|
-
if (opts.write) this._write = opts.write;
|
|
5051
|
-
if (opts.final) this._final = opts.final;
|
|
5052
|
-
if (opts.eagerOpen) this._writableState.updateNextTick();
|
|
5053
|
-
}
|
|
5054
|
-
}
|
|
5055
|
-
cork() {
|
|
5056
|
-
this._duplexState |= WRITE_CORKED;
|
|
5057
|
-
}
|
|
5058
|
-
uncork() {
|
|
5059
|
-
this._duplexState &= WRITE_NOT_CORKED;
|
|
5060
|
-
this._writableState.updateNextTick();
|
|
5061
|
-
}
|
|
5062
|
-
_writev(batch, cb) {
|
|
5063
|
-
cb(null);
|
|
5064
|
-
}
|
|
5065
|
-
_write(data, cb) {
|
|
5066
|
-
this._writableState.autoBatch(data, cb);
|
|
5067
|
-
}
|
|
5068
|
-
_final(cb) {
|
|
5069
|
-
cb(null);
|
|
5070
|
-
}
|
|
5071
|
-
static isBackpressured(ws) {
|
|
5072
|
-
return (ws._duplexState & WRITE_BACKPRESSURE_STATUS) !== 0;
|
|
5073
|
-
}
|
|
5074
|
-
static drained(ws) {
|
|
5075
|
-
if (ws.destroyed) return Promise.resolve(false);
|
|
5076
|
-
const state = ws._writableState;
|
|
5077
|
-
const pending = isWritev(ws) ? Math.min(1, state.queue.length) : state.queue.length;
|
|
5078
|
-
const writes = pending + (ws._duplexState & WRITE_WRITING ? 1 : 0);
|
|
5079
|
-
if (writes === 0) return Promise.resolve(true);
|
|
5080
|
-
if (state.drains === null) state.drains = [];
|
|
5081
|
-
return new Promise((resolve$1) => {
|
|
5082
|
-
state.drains.push({
|
|
5083
|
-
writes,
|
|
5084
|
-
resolve: resolve$1
|
|
5085
|
-
});
|
|
5086
|
-
});
|
|
5087
|
-
}
|
|
5088
|
-
write(data) {
|
|
5089
|
-
this._writableState.updateNextTick();
|
|
5090
|
-
return this._writableState.push(data);
|
|
5091
|
-
}
|
|
5092
|
-
end(data) {
|
|
5093
|
-
this._writableState.updateNextTick();
|
|
5094
|
-
this._writableState.end(data);
|
|
5095
|
-
return this;
|
|
5096
|
-
}
|
|
5097
|
-
};
|
|
5098
|
-
var Duplex = class extends Readable$2 {
|
|
5099
|
-
constructor(opts) {
|
|
5100
|
-
super(opts);
|
|
5101
|
-
this._duplexState = OPENING | this._duplexState & READ_READ_AHEAD;
|
|
5102
|
-
this._writableState = new WritableState(this, opts);
|
|
5103
|
-
if (opts) {
|
|
5104
|
-
if (opts.writev) this._writev = opts.writev;
|
|
5105
|
-
if (opts.write) this._write = opts.write;
|
|
5106
|
-
if (opts.final) this._final = opts.final;
|
|
5107
|
-
}
|
|
5108
|
-
}
|
|
5109
|
-
cork() {
|
|
5110
|
-
this._duplexState |= WRITE_CORKED;
|
|
5111
|
-
}
|
|
5112
|
-
uncork() {
|
|
5113
|
-
this._duplexState &= WRITE_NOT_CORKED;
|
|
5114
|
-
this._writableState.updateNextTick();
|
|
5115
|
-
}
|
|
5116
|
-
_writev(batch, cb) {
|
|
5117
|
-
cb(null);
|
|
5118
|
-
}
|
|
5119
|
-
_write(data, cb) {
|
|
5120
|
-
this._writableState.autoBatch(data, cb);
|
|
5121
|
-
}
|
|
5122
|
-
_final(cb) {
|
|
5123
|
-
cb(null);
|
|
5124
|
-
}
|
|
5125
|
-
write(data) {
|
|
5126
|
-
this._writableState.updateNextTick();
|
|
5127
|
-
return this._writableState.push(data);
|
|
5128
|
-
}
|
|
5129
|
-
end(data) {
|
|
5130
|
-
this._writableState.updateNextTick();
|
|
5131
|
-
this._writableState.end(data);
|
|
5132
|
-
return this;
|
|
5133
|
-
}
|
|
5134
|
-
};
|
|
5135
|
-
var Transform = class extends Duplex {
|
|
5136
|
-
constructor(opts) {
|
|
5137
|
-
super(opts);
|
|
5138
|
-
this._transformState = new TransformState(this);
|
|
5139
|
-
if (opts) {
|
|
5140
|
-
if (opts.transform) this._transform = opts.transform;
|
|
5141
|
-
if (opts.flush) this._flush = opts.flush;
|
|
5142
|
-
}
|
|
5143
|
-
}
|
|
5144
|
-
_write(data, cb) {
|
|
5145
|
-
if (this._readableState.buffered >= this._readableState.highWaterMark) this._transformState.data = data;
|
|
5146
|
-
else this._transform(data, this._transformState.afterTransform);
|
|
5147
|
-
}
|
|
5148
|
-
_read(cb) {
|
|
5149
|
-
if (this._transformState.data !== null) {
|
|
5150
|
-
const data = this._transformState.data;
|
|
5151
|
-
this._transformState.data = null;
|
|
5152
|
-
cb(null);
|
|
5153
|
-
this._transform(data, this._transformState.afterTransform);
|
|
5154
|
-
} else cb(null);
|
|
5155
|
-
}
|
|
5156
|
-
destroy(err) {
|
|
5157
|
-
super.destroy(err);
|
|
5158
|
-
if (this._transformState.data !== null) {
|
|
5159
|
-
this._transformState.data = null;
|
|
5160
|
-
this._transformState.afterTransform();
|
|
5161
|
-
}
|
|
5162
|
-
}
|
|
5163
|
-
_transform(data, cb) {
|
|
5164
|
-
cb(null, data);
|
|
5165
|
-
}
|
|
5166
|
-
_flush(cb) {
|
|
5167
|
-
cb(null);
|
|
5168
|
-
}
|
|
5169
|
-
_final(cb) {
|
|
5170
|
-
this._transformState.afterFinal = cb;
|
|
5171
|
-
this._flush(transformAfterFlush.bind(this));
|
|
5172
|
-
}
|
|
5173
|
-
};
|
|
5174
|
-
var PassThrough = class extends Transform {};
|
|
5175
|
-
function transformAfterFlush(err, data) {
|
|
5176
|
-
const cb = this._transformState.afterFinal;
|
|
5177
|
-
if (err) return cb(err);
|
|
5178
|
-
if (data !== null && data !== undefined) this.push(data);
|
|
5179
|
-
this.push(null);
|
|
5180
|
-
cb(null);
|
|
5181
|
-
}
|
|
5182
|
-
function pipelinePromise(...streams) {
|
|
5183
|
-
return new Promise((resolve$1, reject) => {
|
|
5184
|
-
return pipeline$1(...streams, (err) => {
|
|
5185
|
-
if (err) return reject(err);
|
|
5186
|
-
resolve$1();
|
|
5187
|
-
});
|
|
5188
|
-
});
|
|
5189
|
-
}
|
|
5190
|
-
function pipeline$1(stream, ...streams) {
|
|
5191
|
-
const all = Array.isArray(stream) ? [...stream, ...streams] : [stream, ...streams];
|
|
5192
|
-
const done = all.length && typeof all[all.length - 1] === "function" ? all.pop() : null;
|
|
5193
|
-
if (all.length < 2) throw new Error("Pipeline requires at least 2 streams");
|
|
5194
|
-
let src = all[0];
|
|
5195
|
-
let dest = null;
|
|
5196
|
-
let error = null;
|
|
5197
|
-
for (let i = 1; i < all.length; i++) {
|
|
5198
|
-
dest = all[i];
|
|
5199
|
-
if (isStreamx(src)) src.pipe(dest, onerror);
|
|
5200
|
-
else {
|
|
5201
|
-
errorHandle(src, true, i > 1, onerror);
|
|
5202
|
-
src.pipe(dest);
|
|
5203
|
-
}
|
|
5204
|
-
src = dest;
|
|
5205
|
-
}
|
|
5206
|
-
if (done) {
|
|
5207
|
-
let fin = false;
|
|
5208
|
-
const autoDestroy = isStreamx(dest) || !!(dest._writableState && dest._writableState.autoDestroy);
|
|
5209
|
-
dest.on("error", (err) => {
|
|
5210
|
-
if (error === null) error = err;
|
|
5211
|
-
});
|
|
5212
|
-
dest.on("finish", () => {
|
|
5213
|
-
fin = true;
|
|
5214
|
-
if (!autoDestroy) done(error);
|
|
5215
|
-
});
|
|
5216
|
-
if (autoDestroy) dest.on("close", () => done(error || (fin ? null : PREMATURE_CLOSE)));
|
|
5217
|
-
}
|
|
5218
|
-
return dest;
|
|
5219
|
-
function errorHandle(s$1, rd, wr, onerror$1) {
|
|
5220
|
-
s$1.on("error", onerror$1);
|
|
5221
|
-
s$1.on("close", onclose);
|
|
5222
|
-
function onclose() {
|
|
5223
|
-
if (rd && s$1._readableState && !s$1._readableState.ended) return onerror$1(PREMATURE_CLOSE);
|
|
5224
|
-
if (wr && s$1._writableState && !s$1._writableState.ended) return onerror$1(PREMATURE_CLOSE);
|
|
5225
|
-
}
|
|
5226
|
-
}
|
|
5227
|
-
function onerror(err) {
|
|
5228
|
-
if (!err || error) return;
|
|
5229
|
-
error = err;
|
|
5230
|
-
for (const s$1 of all) s$1.destroy(err);
|
|
5231
|
-
}
|
|
5232
|
-
}
|
|
5233
|
-
function echo$1(s$1) {
|
|
5234
|
-
return s$1;
|
|
5235
|
-
}
|
|
5236
|
-
function isStream(stream) {
|
|
5237
|
-
return !!stream._readableState || !!stream._writableState;
|
|
5238
|
-
}
|
|
5239
|
-
function isStreamx(stream) {
|
|
5240
|
-
return typeof stream._duplexState === "number" && isStream(stream);
|
|
5241
|
-
}
|
|
5242
|
-
function isEnded(stream) {
|
|
5243
|
-
return !!stream._readableState && stream._readableState.ended;
|
|
5244
|
-
}
|
|
5245
|
-
function isFinished(stream) {
|
|
5246
|
-
return !!stream._writableState && stream._writableState.ended;
|
|
5247
|
-
}
|
|
5248
|
-
function getStreamError$2(stream, opts = {}) {
|
|
5249
|
-
const err = stream._readableState && stream._readableState.error || stream._writableState && stream._writableState.error;
|
|
5250
|
-
return !opts.all && err === STREAM_DESTROYED ? null : err;
|
|
5251
|
-
}
|
|
5252
|
-
function isReadStreamx(stream) {
|
|
5253
|
-
return isStreamx(stream) && stream.readable;
|
|
5254
|
-
}
|
|
5255
|
-
function isDisturbed(stream) {
|
|
5256
|
-
return (stream._duplexState & OPENING) !== OPENING || (stream._duplexState & ACTIVE_OR_TICKING) !== 0;
|
|
5257
|
-
}
|
|
5258
|
-
function isTypedArray(data) {
|
|
5259
|
-
return typeof data === "object" && data !== null && typeof data.byteLength === "number";
|
|
5260
|
-
}
|
|
5261
|
-
function defaultByteLength(data) {
|
|
5262
|
-
return isTypedArray(data) ? data.byteLength : 1024;
|
|
5263
|
-
}
|
|
5264
|
-
function noop$5() {}
|
|
5265
|
-
function abort() {
|
|
5266
|
-
this.destroy(new Error("Stream aborted."));
|
|
5267
|
-
}
|
|
5268
|
-
function isWritev(s$1) {
|
|
5269
|
-
return s$1._writev !== Writable$2.prototype._writev && s$1._writev !== Duplex.prototype._writev;
|
|
5270
|
-
}
|
|
5271
|
-
module.exports = {
|
|
5272
|
-
pipeline: pipeline$1,
|
|
5273
|
-
pipelinePromise,
|
|
5274
|
-
isStream,
|
|
5275
|
-
isStreamx,
|
|
5276
|
-
isEnded,
|
|
5277
|
-
isFinished,
|
|
5278
|
-
isDisturbed,
|
|
5279
|
-
getStreamError: getStreamError$2,
|
|
5280
|
-
Stream,
|
|
5281
|
-
Writable: Writable$2,
|
|
5282
|
-
Readable: Readable$2,
|
|
5283
|
-
Duplex,
|
|
5284
|
-
Transform,
|
|
5285
|
-
PassThrough
|
|
5286
|
-
};
|
|
5287
|
-
} });
|
|
5288
|
-
|
|
5289
|
-
//#endregion
|
|
5290
|
-
//#region node_modules/.pnpm/tar-stream@3.1.7/node_modules/tar-stream/headers.js
|
|
5291
|
-
var require_headers = __commonJS({ "node_modules/.pnpm/tar-stream@3.1.7/node_modules/tar-stream/headers.js"(exports) {
|
|
5292
|
-
const b4a$2 = require_b4a();
|
|
5293
|
-
const ZEROS = "0000000000000000000";
|
|
5294
|
-
const SEVENS = "7777777777777777777";
|
|
5295
|
-
const ZERO_OFFSET = "0".charCodeAt(0);
|
|
5296
|
-
const USTAR_MAGIC = b4a$2.from([
|
|
5297
|
-
117,
|
|
5298
|
-
115,
|
|
5299
|
-
116,
|
|
5300
|
-
97,
|
|
5301
|
-
114,
|
|
5302
|
-
0
|
|
5303
|
-
]);
|
|
5304
|
-
const USTAR_VER = b4a$2.from([ZERO_OFFSET, ZERO_OFFSET]);
|
|
5305
|
-
const GNU_MAGIC = b4a$2.from([
|
|
5306
|
-
117,
|
|
5307
|
-
115,
|
|
5308
|
-
116,
|
|
5309
|
-
97,
|
|
5310
|
-
114,
|
|
5311
|
-
32
|
|
5312
|
-
]);
|
|
5313
|
-
const GNU_VER = b4a$2.from([32, 0]);
|
|
5314
|
-
const MASK = 4095;
|
|
5315
|
-
const MAGIC_OFFSET = 257;
|
|
5316
|
-
const VERSION_OFFSET = 263;
|
|
5317
|
-
exports.decodeLongPath = function decodeLongPath(buf, encoding) {
|
|
5318
|
-
return decodeStr(buf, 0, buf.length, encoding);
|
|
5319
|
-
};
|
|
5320
|
-
exports.encodePax = function encodePax(opts) {
|
|
5321
|
-
let result = "";
|
|
5322
|
-
if (opts.name) result += addLength(" path=" + opts.name + "\n");
|
|
5323
|
-
if (opts.linkname) result += addLength(" linkpath=" + opts.linkname + "\n");
|
|
5324
|
-
const pax = opts.pax;
|
|
5325
|
-
if (pax) for (const key in pax) result += addLength(" " + key + "=" + pax[key] + "\n");
|
|
5326
|
-
return b4a$2.from(result);
|
|
5327
|
-
};
|
|
5328
|
-
exports.decodePax = function decodePax(buf) {
|
|
5329
|
-
const result = {};
|
|
5330
|
-
while (buf.length) {
|
|
5331
|
-
let i = 0;
|
|
5332
|
-
while (i < buf.length && buf[i] !== 32) i++;
|
|
5333
|
-
const len = parseInt(b4a$2.toString(buf.subarray(0, i)), 10);
|
|
5334
|
-
if (!len) return result;
|
|
5335
|
-
const b = b4a$2.toString(buf.subarray(i + 1, len - 1));
|
|
5336
|
-
const keyIndex = b.indexOf("=");
|
|
5337
|
-
if (keyIndex === -1) return result;
|
|
5338
|
-
result[b.slice(0, keyIndex)] = b.slice(keyIndex + 1);
|
|
5339
|
-
buf = buf.subarray(len);
|
|
5340
|
-
}
|
|
5341
|
-
return result;
|
|
5342
|
-
};
|
|
5343
|
-
exports.encode = function encode$1(opts) {
|
|
5344
|
-
const buf = b4a$2.alloc(512);
|
|
5345
|
-
let name$1 = opts.name;
|
|
5346
|
-
let prefix = "";
|
|
5347
|
-
if (opts.typeflag === 5 && name$1[name$1.length - 1] !== "/") name$1 += "/";
|
|
5348
|
-
if (b4a$2.byteLength(name$1) !== name$1.length) return null;
|
|
5349
|
-
while (b4a$2.byteLength(name$1) > 100) {
|
|
5350
|
-
const i = name$1.indexOf("/");
|
|
5351
|
-
if (i === -1) return null;
|
|
5352
|
-
prefix += prefix ? "/" + name$1.slice(0, i) : name$1.slice(0, i);
|
|
5353
|
-
name$1 = name$1.slice(i + 1);
|
|
5354
|
-
}
|
|
5355
|
-
if (b4a$2.byteLength(name$1) > 100 || b4a$2.byteLength(prefix) > 155) return null;
|
|
5356
|
-
if (opts.linkname && b4a$2.byteLength(opts.linkname) > 100) return null;
|
|
5357
|
-
b4a$2.write(buf, name$1);
|
|
5358
|
-
b4a$2.write(buf, encodeOct(opts.mode & MASK, 6), 100);
|
|
5359
|
-
b4a$2.write(buf, encodeOct(opts.uid, 6), 108);
|
|
5360
|
-
b4a$2.write(buf, encodeOct(opts.gid, 6), 116);
|
|
5361
|
-
encodeSize(opts.size, buf, 124);
|
|
5362
|
-
b4a$2.write(buf, encodeOct(opts.mtime.getTime() / 1e3 | 0, 11), 136);
|
|
5363
|
-
buf[156] = ZERO_OFFSET + toTypeflag(opts.type);
|
|
5364
|
-
if (opts.linkname) b4a$2.write(buf, opts.linkname, 157);
|
|
5365
|
-
b4a$2.copy(USTAR_MAGIC, buf, MAGIC_OFFSET);
|
|
5366
|
-
b4a$2.copy(USTAR_VER, buf, VERSION_OFFSET);
|
|
5367
|
-
if (opts.uname) b4a$2.write(buf, opts.uname, 265);
|
|
5368
|
-
if (opts.gname) b4a$2.write(buf, opts.gname, 297);
|
|
5369
|
-
b4a$2.write(buf, encodeOct(opts.devmajor || 0, 6), 329);
|
|
5370
|
-
b4a$2.write(buf, encodeOct(opts.devminor || 0, 6), 337);
|
|
5371
|
-
if (prefix) b4a$2.write(buf, prefix, 345);
|
|
5372
|
-
b4a$2.write(buf, encodeOct(cksum(buf), 6), 148);
|
|
5373
|
-
return buf;
|
|
5374
|
-
};
|
|
5375
|
-
exports.decode = function decode(buf, filenameEncoding, allowUnknownFormat) {
|
|
5376
|
-
let typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET;
|
|
5377
|
-
let name$1 = decodeStr(buf, 0, 100, filenameEncoding);
|
|
5378
|
-
const mode = decodeOct(buf, 100, 8);
|
|
5379
|
-
const uid = decodeOct(buf, 108, 8);
|
|
5380
|
-
const gid = decodeOct(buf, 116, 8);
|
|
5381
|
-
const size = decodeOct(buf, 124, 12);
|
|
5382
|
-
const mtime = decodeOct(buf, 136, 12);
|
|
5383
|
-
const type$1 = toType(typeflag);
|
|
5384
|
-
const linkname = buf[157] === 0 ? null : decodeStr(buf, 157, 100, filenameEncoding);
|
|
5385
|
-
const uname = decodeStr(buf, 265, 32);
|
|
5386
|
-
const gname = decodeStr(buf, 297, 32);
|
|
5387
|
-
const devmajor = decodeOct(buf, 329, 8);
|
|
5388
|
-
const devminor = decodeOct(buf, 337, 8);
|
|
5389
|
-
const c = cksum(buf);
|
|
5390
|
-
if (c === 256) return null;
|
|
5391
|
-
if (c !== decodeOct(buf, 148, 8)) throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");
|
|
5392
|
-
if (isUSTAR(buf)) {
|
|
5393
|
-
if (buf[345]) name$1 = decodeStr(buf, 345, 155, filenameEncoding) + "/" + name$1;
|
|
5394
|
-
} else if (isGNU(buf)) {} else if (!allowUnknownFormat) throw new Error("Invalid tar header: unknown format.");
|
|
5395
|
-
if (typeflag === 0 && name$1 && name$1[name$1.length - 1] === "/") typeflag = 5;
|
|
5396
|
-
return {
|
|
5397
|
-
name: name$1,
|
|
5398
|
-
mode,
|
|
5399
|
-
uid,
|
|
5400
|
-
gid,
|
|
5401
|
-
size,
|
|
5402
|
-
mtime: new Date(1e3 * mtime),
|
|
5403
|
-
type: type$1,
|
|
5404
|
-
linkname,
|
|
5405
|
-
uname,
|
|
5406
|
-
gname,
|
|
5407
|
-
devmajor,
|
|
5408
|
-
devminor,
|
|
5409
|
-
pax: null
|
|
5410
|
-
};
|
|
5411
|
-
};
|
|
5412
|
-
function isUSTAR(buf) {
|
|
5413
|
-
return b4a$2.equals(USTAR_MAGIC, buf.subarray(MAGIC_OFFSET, MAGIC_OFFSET + 6));
|
|
5414
|
-
}
|
|
5415
|
-
function isGNU(buf) {
|
|
5416
|
-
return b4a$2.equals(GNU_MAGIC, buf.subarray(MAGIC_OFFSET, MAGIC_OFFSET + 6)) && b4a$2.equals(GNU_VER, buf.subarray(VERSION_OFFSET, VERSION_OFFSET + 2));
|
|
5417
|
-
}
|
|
5418
|
-
function clamp(index, len, defaultValue) {
|
|
5419
|
-
if (typeof index !== "number") return defaultValue;
|
|
5420
|
-
index = ~~index;
|
|
5421
|
-
if (index >= len) return len;
|
|
5422
|
-
if (index >= 0) return index;
|
|
5423
|
-
index += len;
|
|
5424
|
-
if (index >= 0) return index;
|
|
5425
|
-
return 0;
|
|
5426
|
-
}
|
|
5427
|
-
function toType(flag) {
|
|
5428
|
-
switch (flag) {
|
|
5429
|
-
case 0: return "file";
|
|
5430
|
-
case 1: return "link";
|
|
5431
|
-
case 2: return "symlink";
|
|
5432
|
-
case 3: return "character-device";
|
|
5433
|
-
case 4: return "block-device";
|
|
5434
|
-
case 5: return "directory";
|
|
5435
|
-
case 6: return "fifo";
|
|
5436
|
-
case 7: return "contiguous-file";
|
|
5437
|
-
case 72: return "pax-header";
|
|
5438
|
-
case 55: return "pax-global-header";
|
|
5439
|
-
case 27: return "gnu-long-link-path";
|
|
5440
|
-
case 28:
|
|
5441
|
-
case 30: return "gnu-long-path";
|
|
5442
|
-
}
|
|
5443
|
-
return null;
|
|
5444
|
-
}
|
|
5445
|
-
function toTypeflag(flag) {
|
|
5446
|
-
switch (flag) {
|
|
5447
|
-
case "file": return 0;
|
|
5448
|
-
case "link": return 1;
|
|
5449
|
-
case "symlink": return 2;
|
|
5450
|
-
case "character-device": return 3;
|
|
5451
|
-
case "block-device": return 4;
|
|
5452
|
-
case "directory": return 5;
|
|
5453
|
-
case "fifo": return 6;
|
|
5454
|
-
case "contiguous-file": return 7;
|
|
5455
|
-
case "pax-header": return 72;
|
|
5456
|
-
}
|
|
5457
|
-
return 0;
|
|
5458
|
-
}
|
|
5459
|
-
function indexOf(block, num, offset, end) {
|
|
5460
|
-
for (; offset < end; offset++) if (block[offset] === num) return offset;
|
|
5461
|
-
return end;
|
|
5462
|
-
}
|
|
5463
|
-
function cksum(block) {
|
|
5464
|
-
let sum = 256;
|
|
5465
|
-
for (let i = 0; i < 148; i++) sum += block[i];
|
|
5466
|
-
for (let j = 156; j < 512; j++) sum += block[j];
|
|
5467
|
-
return sum;
|
|
5468
|
-
}
|
|
5469
|
-
function encodeOct(val, n$1) {
|
|
5470
|
-
val = val.toString(8);
|
|
5471
|
-
if (val.length > n$1) return SEVENS.slice(0, n$1) + " ";
|
|
5472
|
-
return ZEROS.slice(0, n$1 - val.length) + val + " ";
|
|
5473
|
-
}
|
|
5474
|
-
function encodeSizeBin(num, buf, off) {
|
|
5475
|
-
buf[off] = 128;
|
|
5476
|
-
for (let i = 11; i > 0; i--) {
|
|
5477
|
-
buf[off + i] = num & 255;
|
|
5478
|
-
num = Math.floor(num / 256);
|
|
5479
|
-
}
|
|
5480
|
-
}
|
|
5481
|
-
function encodeSize(num, buf, off) {
|
|
5482
|
-
if (num.toString(8).length > 11) encodeSizeBin(num, buf, off);
|
|
5483
|
-
else b4a$2.write(buf, encodeOct(num, 11), off);
|
|
5484
|
-
}
|
|
5485
|
-
function parse256(buf) {
|
|
5486
|
-
let positive;
|
|
5487
|
-
if (buf[0] === 128) positive = true;
|
|
5488
|
-
else if (buf[0] === 255) positive = false;
|
|
5489
|
-
else return null;
|
|
5490
|
-
const tuple = [];
|
|
5491
|
-
let i;
|
|
5492
|
-
for (i = buf.length - 1; i > 0; i--) {
|
|
5493
|
-
const byte = buf[i];
|
|
5494
|
-
if (positive) tuple.push(byte);
|
|
5495
|
-
else tuple.push(255 - byte);
|
|
5496
|
-
}
|
|
5497
|
-
let sum = 0;
|
|
5498
|
-
const l = tuple.length;
|
|
5499
|
-
for (i = 0; i < l; i++) sum += tuple[i] * Math.pow(256, i);
|
|
5500
|
-
return positive ? sum : -1 * sum;
|
|
5501
|
-
}
|
|
5502
|
-
function decodeOct(val, offset, length) {
|
|
5503
|
-
val = val.subarray(offset, offset + length);
|
|
5504
|
-
offset = 0;
|
|
5505
|
-
if (val[offset] & 128) return parse256(val);
|
|
5506
|
-
else {
|
|
5507
|
-
while (offset < val.length && val[offset] === 32) offset++;
|
|
5508
|
-
const end = clamp(indexOf(val, 32, offset, val.length), val.length, val.length);
|
|
5509
|
-
while (offset < end && val[offset] === 0) offset++;
|
|
5510
|
-
if (end === offset) return 0;
|
|
5511
|
-
return parseInt(b4a$2.toString(val.subarray(offset, end)), 8);
|
|
5512
|
-
}
|
|
5513
|
-
}
|
|
5514
|
-
function decodeStr(val, offset, length, encoding) {
|
|
5515
|
-
return b4a$2.toString(val.subarray(offset, indexOf(val, 0, offset, offset + length)), encoding);
|
|
5516
|
-
}
|
|
5517
|
-
function addLength(str) {
|
|
5518
|
-
const len = b4a$2.byteLength(str);
|
|
5519
|
-
let digits = Math.floor(Math.log(len) / Math.log(10)) + 1;
|
|
5520
|
-
if (len + digits >= Math.pow(10, digits)) digits++;
|
|
5521
|
-
return len + digits + str;
|
|
5522
|
-
}
|
|
5523
|
-
} });
|
|
5524
|
-
|
|
5525
|
-
//#endregion
|
|
5526
|
-
//#region node_modules/.pnpm/tar-stream@3.1.7/node_modules/tar-stream/extract.js
|
|
5527
|
-
var require_extract = __commonJS({ "node_modules/.pnpm/tar-stream@3.1.7/node_modules/tar-stream/extract.js"(exports, module) {
|
|
5528
|
-
const { Writable: Writable$1, Readable: Readable$1, getStreamError: getStreamError$1 } = require_streamx();
|
|
5529
|
-
const FIFO = require_fast_fifo();
|
|
5530
|
-
const b4a$1 = require_b4a();
|
|
5531
|
-
const headers$1 = require_headers();
|
|
5532
|
-
const EMPTY = b4a$1.alloc(0);
|
|
5533
|
-
var BufferList = class {
|
|
5534
|
-
constructor() {
|
|
5535
|
-
this.buffered = 0;
|
|
5536
|
-
this.shifted = 0;
|
|
5537
|
-
this.queue = new FIFO();
|
|
5538
|
-
this._offset = 0;
|
|
5539
|
-
}
|
|
5540
|
-
push(buffer) {
|
|
5541
|
-
this.buffered += buffer.byteLength;
|
|
5542
|
-
this.queue.push(buffer);
|
|
5543
|
-
}
|
|
5544
|
-
shiftFirst(size) {
|
|
5545
|
-
return this._buffered === 0 ? null : this._next(size);
|
|
5546
|
-
}
|
|
5547
|
-
shift(size) {
|
|
5548
|
-
if (size > this.buffered) return null;
|
|
5549
|
-
if (size === 0) return EMPTY;
|
|
5550
|
-
let chunk = this._next(size);
|
|
5551
|
-
if (size === chunk.byteLength) return chunk;
|
|
5552
|
-
const chunks = [chunk];
|
|
5553
|
-
while ((size -= chunk.byteLength) > 0) {
|
|
5554
|
-
chunk = this._next(size);
|
|
5555
|
-
chunks.push(chunk);
|
|
5556
|
-
}
|
|
5557
|
-
return b4a$1.concat(chunks);
|
|
5558
|
-
}
|
|
5559
|
-
_next(size) {
|
|
5560
|
-
const buf = this.queue.peek();
|
|
5561
|
-
const rem = buf.byteLength - this._offset;
|
|
5562
|
-
if (size >= rem) {
|
|
5563
|
-
const sub = this._offset ? buf.subarray(this._offset, buf.byteLength) : buf;
|
|
5564
|
-
this.queue.shift();
|
|
5565
|
-
this._offset = 0;
|
|
5566
|
-
this.buffered -= rem;
|
|
5567
|
-
this.shifted += rem;
|
|
5568
|
-
return sub;
|
|
5569
|
-
}
|
|
5570
|
-
this.buffered -= size;
|
|
5571
|
-
this.shifted += size;
|
|
5572
|
-
return buf.subarray(this._offset, this._offset += size);
|
|
5573
|
-
}
|
|
5574
|
-
};
|
|
5575
|
-
var Source = class extends Readable$1 {
|
|
5576
|
-
constructor(self, header, offset) {
|
|
5577
|
-
super();
|
|
5578
|
-
this.header = header;
|
|
5579
|
-
this.offset = offset;
|
|
5580
|
-
this._parent = self;
|
|
5581
|
-
}
|
|
5582
|
-
_read(cb) {
|
|
5583
|
-
if (this.header.size === 0) this.push(null);
|
|
5584
|
-
if (this._parent._stream === this) this._parent._update();
|
|
5585
|
-
cb(null);
|
|
5586
|
-
}
|
|
5587
|
-
_predestroy() {
|
|
5588
|
-
this._parent.destroy(getStreamError$1(this));
|
|
5589
|
-
}
|
|
5590
|
-
_detach() {
|
|
5591
|
-
if (this._parent._stream === this) {
|
|
5592
|
-
this._parent._stream = null;
|
|
5593
|
-
this._parent._missing = overflow$1(this.header.size);
|
|
5594
|
-
this._parent._update();
|
|
5595
|
-
}
|
|
5596
|
-
}
|
|
5597
|
-
_destroy(cb) {
|
|
5598
|
-
this._detach();
|
|
5599
|
-
cb(null);
|
|
5600
|
-
}
|
|
5601
|
-
};
|
|
5602
|
-
var Extract = class extends Writable$1 {
|
|
5603
|
-
constructor(opts) {
|
|
5604
|
-
super(opts);
|
|
5605
|
-
if (!opts) opts = {};
|
|
5606
|
-
this._buffer = new BufferList();
|
|
5607
|
-
this._offset = 0;
|
|
5608
|
-
this._header = null;
|
|
5609
|
-
this._stream = null;
|
|
5610
|
-
this._missing = 0;
|
|
5611
|
-
this._longHeader = false;
|
|
5612
|
-
this._callback = noop$4;
|
|
5613
|
-
this._locked = false;
|
|
5614
|
-
this._finished = false;
|
|
5615
|
-
this._pax = null;
|
|
5616
|
-
this._paxGlobal = null;
|
|
5617
|
-
this._gnuLongPath = null;
|
|
5618
|
-
this._gnuLongLinkPath = null;
|
|
5619
|
-
this._filenameEncoding = opts.filenameEncoding || "utf-8";
|
|
5620
|
-
this._allowUnknownFormat = !!opts.allowUnknownFormat;
|
|
5621
|
-
this._unlockBound = this._unlock.bind(this);
|
|
5622
|
-
}
|
|
5623
|
-
_unlock(err) {
|
|
5624
|
-
this._locked = false;
|
|
5625
|
-
if (err) {
|
|
5626
|
-
this.destroy(err);
|
|
5627
|
-
this._continueWrite(err);
|
|
5628
|
-
return;
|
|
5629
|
-
}
|
|
5630
|
-
this._update();
|
|
5631
|
-
}
|
|
5632
|
-
_consumeHeader() {
|
|
5633
|
-
if (this._locked) return false;
|
|
5634
|
-
this._offset = this._buffer.shifted;
|
|
5635
|
-
try {
|
|
5636
|
-
this._header = headers$1.decode(this._buffer.shift(512), this._filenameEncoding, this._allowUnknownFormat);
|
|
5637
|
-
} catch (err) {
|
|
5638
|
-
this._continueWrite(err);
|
|
5639
|
-
return false;
|
|
5640
|
-
}
|
|
5641
|
-
if (!this._header) return true;
|
|
5642
|
-
switch (this._header.type) {
|
|
5643
|
-
case "gnu-long-path":
|
|
5644
|
-
case "gnu-long-link-path":
|
|
5645
|
-
case "pax-global-header":
|
|
5646
|
-
case "pax-header":
|
|
5647
|
-
this._longHeader = true;
|
|
5648
|
-
this._missing = this._header.size;
|
|
5649
|
-
return true;
|
|
5650
|
-
}
|
|
5651
|
-
this._locked = true;
|
|
5652
|
-
this._applyLongHeaders();
|
|
5653
|
-
if (this._header.size === 0 || this._header.type === "directory") {
|
|
5654
|
-
this.emit("entry", this._header, this._createStream(), this._unlockBound);
|
|
5655
|
-
return true;
|
|
5656
|
-
}
|
|
5657
|
-
this._stream = this._createStream();
|
|
5658
|
-
this._missing = this._header.size;
|
|
5659
|
-
this.emit("entry", this._header, this._stream, this._unlockBound);
|
|
5660
|
-
return true;
|
|
5661
|
-
}
|
|
5662
|
-
_applyLongHeaders() {
|
|
5663
|
-
if (this._gnuLongPath) {
|
|
5664
|
-
this._header.name = this._gnuLongPath;
|
|
5665
|
-
this._gnuLongPath = null;
|
|
5666
|
-
}
|
|
5667
|
-
if (this._gnuLongLinkPath) {
|
|
5668
|
-
this._header.linkname = this._gnuLongLinkPath;
|
|
5669
|
-
this._gnuLongLinkPath = null;
|
|
5670
|
-
}
|
|
5671
|
-
if (this._pax) {
|
|
5672
|
-
if (this._pax.path) this._header.name = this._pax.path;
|
|
5673
|
-
if (this._pax.linkpath) this._header.linkname = this._pax.linkpath;
|
|
5674
|
-
if (this._pax.size) this._header.size = parseInt(this._pax.size, 10);
|
|
5675
|
-
this._header.pax = this._pax;
|
|
5676
|
-
this._pax = null;
|
|
5677
|
-
}
|
|
5678
|
-
}
|
|
5679
|
-
_decodeLongHeader(buf) {
|
|
5680
|
-
switch (this._header.type) {
|
|
5681
|
-
case "gnu-long-path":
|
|
5682
|
-
this._gnuLongPath = headers$1.decodeLongPath(buf, this._filenameEncoding);
|
|
5683
|
-
break;
|
|
5684
|
-
case "gnu-long-link-path":
|
|
5685
|
-
this._gnuLongLinkPath = headers$1.decodeLongPath(buf, this._filenameEncoding);
|
|
5686
|
-
break;
|
|
5687
|
-
case "pax-global-header":
|
|
5688
|
-
this._paxGlobal = headers$1.decodePax(buf);
|
|
5689
|
-
break;
|
|
5690
|
-
case "pax-header":
|
|
5691
|
-
this._pax = this._paxGlobal === null ? headers$1.decodePax(buf) : Object.assign({}, this._paxGlobal, headers$1.decodePax(buf));
|
|
5692
|
-
break;
|
|
5693
|
-
}
|
|
5694
|
-
}
|
|
5695
|
-
_consumeLongHeader() {
|
|
5696
|
-
this._longHeader = false;
|
|
5697
|
-
this._missing = overflow$1(this._header.size);
|
|
5698
|
-
const buf = this._buffer.shift(this._header.size);
|
|
5699
|
-
try {
|
|
5700
|
-
this._decodeLongHeader(buf);
|
|
5701
|
-
} catch (err) {
|
|
5702
|
-
this._continueWrite(err);
|
|
5703
|
-
return false;
|
|
5704
|
-
}
|
|
5705
|
-
return true;
|
|
5706
|
-
}
|
|
5707
|
-
_consumeStream() {
|
|
5708
|
-
const buf = this._buffer.shiftFirst(this._missing);
|
|
5709
|
-
if (buf === null) return false;
|
|
5710
|
-
this._missing -= buf.byteLength;
|
|
5711
|
-
const drained = this._stream.push(buf);
|
|
5712
|
-
if (this._missing === 0) {
|
|
5713
|
-
this._stream.push(null);
|
|
5714
|
-
if (drained) this._stream._detach();
|
|
5715
|
-
return drained && this._locked === false;
|
|
5716
|
-
}
|
|
5717
|
-
return drained;
|
|
5718
|
-
}
|
|
5719
|
-
_createStream() {
|
|
5720
|
-
return new Source(this, this._header, this._offset);
|
|
5721
|
-
}
|
|
5722
|
-
_update() {
|
|
5723
|
-
while (this._buffer.buffered > 0 && !this.destroying) {
|
|
5724
|
-
if (this._missing > 0) {
|
|
5725
|
-
if (this._stream !== null) {
|
|
5726
|
-
if (this._consumeStream() === false) return;
|
|
5727
|
-
continue;
|
|
5728
|
-
}
|
|
5729
|
-
if (this._longHeader === true) {
|
|
5730
|
-
if (this._missing > this._buffer.buffered) break;
|
|
5731
|
-
if (this._consumeLongHeader() === false) return false;
|
|
5732
|
-
continue;
|
|
5733
|
-
}
|
|
5734
|
-
const ignore = this._buffer.shiftFirst(this._missing);
|
|
5735
|
-
if (ignore !== null) this._missing -= ignore.byteLength;
|
|
5736
|
-
continue;
|
|
5737
|
-
}
|
|
5738
|
-
if (this._buffer.buffered < 512) break;
|
|
5739
|
-
if (this._stream !== null || this._consumeHeader() === false) return;
|
|
5740
|
-
}
|
|
5741
|
-
this._continueWrite(null);
|
|
5742
|
-
}
|
|
5743
|
-
_continueWrite(err) {
|
|
5744
|
-
const cb = this._callback;
|
|
5745
|
-
this._callback = noop$4;
|
|
5746
|
-
cb(err);
|
|
5747
|
-
}
|
|
5748
|
-
_write(data, cb) {
|
|
5749
|
-
this._callback = cb;
|
|
5750
|
-
this._buffer.push(data);
|
|
5751
|
-
this._update();
|
|
5752
|
-
}
|
|
5753
|
-
_final(cb) {
|
|
5754
|
-
this._finished = this._missing === 0 && this._buffer.buffered === 0;
|
|
5755
|
-
cb(this._finished ? null : new Error("Unexpected end of data"));
|
|
5756
|
-
}
|
|
5757
|
-
_predestroy() {
|
|
5758
|
-
this._continueWrite(null);
|
|
5759
|
-
}
|
|
5760
|
-
_destroy(cb) {
|
|
5761
|
-
if (this._stream) this._stream.destroy(getStreamError$1(this));
|
|
5762
|
-
cb(null);
|
|
5763
|
-
}
|
|
5764
|
-
[Symbol.asyncIterator]() {
|
|
5765
|
-
let error = null;
|
|
5766
|
-
let promiseResolve = null;
|
|
5767
|
-
let promiseReject = null;
|
|
5768
|
-
let entryStream = null;
|
|
5769
|
-
let entryCallback = null;
|
|
5770
|
-
const extract$1 = this;
|
|
5771
|
-
this.on("entry", onentry);
|
|
5772
|
-
this.on("error", (err) => {
|
|
5773
|
-
error = err;
|
|
5774
|
-
});
|
|
5775
|
-
this.on("close", onclose);
|
|
5776
|
-
return {
|
|
5777
|
-
[Symbol.asyncIterator]() {
|
|
5778
|
-
return this;
|
|
5779
|
-
},
|
|
5780
|
-
next() {
|
|
5781
|
-
return new Promise(onnext);
|
|
5782
|
-
},
|
|
5783
|
-
return() {
|
|
5784
|
-
return destroy(null);
|
|
5785
|
-
},
|
|
5786
|
-
throw(err) {
|
|
5787
|
-
return destroy(err);
|
|
5788
|
-
}
|
|
5789
|
-
};
|
|
5790
|
-
function consumeCallback(err) {
|
|
5791
|
-
if (!entryCallback) return;
|
|
5792
|
-
const cb = entryCallback;
|
|
5793
|
-
entryCallback = null;
|
|
5794
|
-
cb(err);
|
|
5795
|
-
}
|
|
5796
|
-
function onnext(resolve$1, reject) {
|
|
5797
|
-
if (error) return reject(error);
|
|
5798
|
-
if (entryStream) {
|
|
5799
|
-
resolve$1({
|
|
5800
|
-
value: entryStream,
|
|
5801
|
-
done: false
|
|
5802
|
-
});
|
|
5803
|
-
entryStream = null;
|
|
5804
|
-
return;
|
|
5805
|
-
}
|
|
5806
|
-
promiseResolve = resolve$1;
|
|
5807
|
-
promiseReject = reject;
|
|
5808
|
-
consumeCallback(null);
|
|
5809
|
-
if (extract$1._finished && promiseResolve) {
|
|
5810
|
-
promiseResolve({
|
|
5811
|
-
value: undefined,
|
|
5812
|
-
done: true
|
|
5813
|
-
});
|
|
5814
|
-
promiseResolve = promiseReject = null;
|
|
5815
|
-
}
|
|
5816
|
-
}
|
|
5817
|
-
function onentry(header, stream, callback) {
|
|
5818
|
-
entryCallback = callback;
|
|
5819
|
-
stream.on("error", noop$4);
|
|
5820
|
-
if (promiseResolve) {
|
|
5821
|
-
promiseResolve({
|
|
5822
|
-
value: stream,
|
|
5823
|
-
done: false
|
|
5824
|
-
});
|
|
5825
|
-
promiseResolve = promiseReject = null;
|
|
5826
|
-
} else entryStream = stream;
|
|
5827
|
-
}
|
|
5828
|
-
function onclose() {
|
|
5829
|
-
consumeCallback(error);
|
|
5830
|
-
if (!promiseResolve) return;
|
|
5831
|
-
if (error) promiseReject(error);
|
|
5832
|
-
else promiseResolve({
|
|
5833
|
-
value: undefined,
|
|
5834
|
-
done: true
|
|
5835
|
-
});
|
|
5836
|
-
promiseResolve = promiseReject = null;
|
|
5837
|
-
}
|
|
5838
|
-
function destroy(err) {
|
|
5839
|
-
extract$1.destroy(err);
|
|
5840
|
-
consumeCallback(err);
|
|
5841
|
-
return new Promise((resolve$1, reject) => {
|
|
5842
|
-
if (extract$1.destroyed) return resolve$1({
|
|
5843
|
-
value: undefined,
|
|
5844
|
-
done: true
|
|
5845
|
-
});
|
|
5846
|
-
extract$1.once("close", function() {
|
|
5847
|
-
if (err) reject(err);
|
|
5848
|
-
else resolve$1({
|
|
5849
|
-
value: undefined,
|
|
5850
|
-
done: true
|
|
5851
|
-
});
|
|
5852
|
-
});
|
|
5853
|
-
});
|
|
5854
|
-
}
|
|
5855
|
-
}
|
|
5856
|
-
};
|
|
5857
|
-
module.exports = function extract$1(opts) {
|
|
5858
|
-
return new Extract(opts);
|
|
5859
|
-
};
|
|
5860
|
-
function noop$4() {}
|
|
5861
|
-
function overflow$1(size) {
|
|
5862
|
-
size &= 511;
|
|
5863
|
-
return size && 512 - size;
|
|
5864
|
-
}
|
|
5865
|
-
} });
|
|
5866
|
-
|
|
5867
|
-
//#endregion
|
|
5868
|
-
//#region node_modules/.pnpm/tar-stream@3.1.7/node_modules/tar-stream/constants.js
|
|
5869
|
-
var require_constants = __commonJS({ "node_modules/.pnpm/tar-stream@3.1.7/node_modules/tar-stream/constants.js"(exports, module) {
|
|
5870
|
-
const constants$2 = {
|
|
5871
|
-
S_IFMT: 61440,
|
|
5872
|
-
S_IFDIR: 16384,
|
|
5873
|
-
S_IFCHR: 8192,
|
|
5874
|
-
S_IFBLK: 24576,
|
|
5875
|
-
S_IFIFO: 4096,
|
|
5876
|
-
S_IFLNK: 40960
|
|
5877
|
-
};
|
|
5878
|
-
try {
|
|
5879
|
-
module.exports = __require("fs").constants || constants$2;
|
|
5880
|
-
} catch {
|
|
5881
|
-
module.exports = constants$2;
|
|
5882
|
-
}
|
|
5883
|
-
} });
|
|
5884
|
-
|
|
5885
|
-
//#endregion
|
|
5886
|
-
//#region node_modules/.pnpm/tar-stream@3.1.7/node_modules/tar-stream/pack.js
|
|
5887
|
-
var require_pack = __commonJS({ "node_modules/.pnpm/tar-stream@3.1.7/node_modules/tar-stream/pack.js"(exports, module) {
|
|
5888
|
-
const { Readable, Writable, getStreamError } = require_streamx();
|
|
5889
|
-
const b4a = require_b4a();
|
|
5890
|
-
const constants$1 = require_constants();
|
|
5891
|
-
const headers = require_headers();
|
|
5892
|
-
const DMODE = 493;
|
|
5893
|
-
const FMODE = 420;
|
|
5894
|
-
const END_OF_TAR = b4a.alloc(1024);
|
|
5895
|
-
var Sink = class extends Writable {
|
|
5896
|
-
constructor(pack, header, callback) {
|
|
5897
|
-
super({
|
|
5898
|
-
mapWritable,
|
|
5899
|
-
eagerOpen: true
|
|
5900
|
-
});
|
|
5901
|
-
this.written = 0;
|
|
5902
|
-
this.header = header;
|
|
5903
|
-
this._callback = callback;
|
|
5904
|
-
this._linkname = null;
|
|
5905
|
-
this._isLinkname = header.type === "symlink" && !header.linkname;
|
|
5906
|
-
this._isVoid = header.type !== "file" && header.type !== "contiguous-file";
|
|
5907
|
-
this._finished = false;
|
|
5908
|
-
this._pack = pack;
|
|
5909
|
-
this._openCallback = null;
|
|
5910
|
-
if (this._pack._stream === null) this._pack._stream = this;
|
|
5911
|
-
else this._pack._pending.push(this);
|
|
5912
|
-
}
|
|
5913
|
-
_open(cb) {
|
|
5914
|
-
this._openCallback = cb;
|
|
5915
|
-
if (this._pack._stream === this) this._continueOpen();
|
|
5916
|
-
}
|
|
5917
|
-
_continuePack(err) {
|
|
5918
|
-
if (this._callback === null) return;
|
|
5919
|
-
const callback = this._callback;
|
|
5920
|
-
this._callback = null;
|
|
5921
|
-
callback(err);
|
|
5922
|
-
}
|
|
5923
|
-
_continueOpen() {
|
|
5924
|
-
if (this._pack._stream === null) this._pack._stream = this;
|
|
5925
|
-
const cb = this._openCallback;
|
|
5926
|
-
this._openCallback = null;
|
|
5927
|
-
if (cb === null) return;
|
|
5928
|
-
if (this._pack.destroying) return cb(new Error("pack stream destroyed"));
|
|
5929
|
-
if (this._pack._finalized) return cb(new Error("pack stream is already finalized"));
|
|
5930
|
-
this._pack._stream = this;
|
|
5931
|
-
if (!this._isLinkname) this._pack._encode(this.header);
|
|
5932
|
-
if (this._isVoid) {
|
|
5933
|
-
this._finish();
|
|
5934
|
-
this._continuePack(null);
|
|
5935
|
-
}
|
|
5936
|
-
cb(null);
|
|
5937
|
-
}
|
|
5938
|
-
_write(data, cb) {
|
|
5939
|
-
if (this._isLinkname) {
|
|
5940
|
-
this._linkname = this._linkname ? b4a.concat([this._linkname, data]) : data;
|
|
5941
|
-
return cb(null);
|
|
5942
|
-
}
|
|
5943
|
-
if (this._isVoid) {
|
|
5944
|
-
if (data.byteLength > 0) return cb(new Error("No body allowed for this entry"));
|
|
5945
|
-
return cb();
|
|
5946
|
-
}
|
|
5947
|
-
this.written += data.byteLength;
|
|
5948
|
-
if (this._pack.push(data)) return cb();
|
|
5949
|
-
this._pack._drain = cb;
|
|
5950
|
-
}
|
|
5951
|
-
_finish() {
|
|
5952
|
-
if (this._finished) return;
|
|
5953
|
-
this._finished = true;
|
|
5954
|
-
if (this._isLinkname) {
|
|
5955
|
-
this.header.linkname = this._linkname ? b4a.toString(this._linkname, "utf-8") : "";
|
|
5956
|
-
this._pack._encode(this.header);
|
|
5957
|
-
}
|
|
5958
|
-
overflow(this._pack, this.header.size);
|
|
5959
|
-
this._pack._done(this);
|
|
5960
|
-
}
|
|
5961
|
-
_final(cb) {
|
|
5962
|
-
if (this.written !== this.header.size) return cb(new Error("Size mismatch"));
|
|
5963
|
-
this._finish();
|
|
5964
|
-
cb(null);
|
|
5965
|
-
}
|
|
5966
|
-
_getError() {
|
|
5967
|
-
return getStreamError(this) || new Error("tar entry destroyed");
|
|
5968
|
-
}
|
|
5969
|
-
_predestroy() {
|
|
5970
|
-
this._pack.destroy(this._getError());
|
|
5971
|
-
}
|
|
5972
|
-
_destroy(cb) {
|
|
5973
|
-
this._pack._done(this);
|
|
5974
|
-
this._continuePack(this._finished ? null : this._getError());
|
|
5975
|
-
cb();
|
|
5976
|
-
}
|
|
5977
|
-
};
|
|
5978
|
-
var Pack = class extends Readable {
|
|
5979
|
-
constructor(opts) {
|
|
5980
|
-
super(opts);
|
|
5981
|
-
this._drain = noop$3;
|
|
5982
|
-
this._finalized = false;
|
|
5983
|
-
this._finalizing = false;
|
|
5984
|
-
this._pending = [];
|
|
5985
|
-
this._stream = null;
|
|
5986
|
-
}
|
|
5987
|
-
entry(header, buffer, callback) {
|
|
5988
|
-
if (this._finalized || this.destroying) throw new Error("already finalized or destroyed");
|
|
5989
|
-
if (typeof buffer === "function") {
|
|
5990
|
-
callback = buffer;
|
|
5991
|
-
buffer = null;
|
|
5992
|
-
}
|
|
5993
|
-
if (!callback) callback = noop$3;
|
|
5994
|
-
if (!header.size || header.type === "symlink") header.size = 0;
|
|
5995
|
-
if (!header.type) header.type = modeToType(header.mode);
|
|
5996
|
-
if (!header.mode) header.mode = header.type === "directory" ? DMODE : FMODE;
|
|
5997
|
-
if (!header.uid) header.uid = 0;
|
|
5998
|
-
if (!header.gid) header.gid = 0;
|
|
5999
|
-
if (!header.mtime) header.mtime = new Date();
|
|
6000
|
-
if (typeof buffer === "string") buffer = b4a.from(buffer);
|
|
6001
|
-
const sink = new Sink(this, header, callback);
|
|
6002
|
-
if (b4a.isBuffer(buffer)) {
|
|
6003
|
-
header.size = buffer.byteLength;
|
|
6004
|
-
sink.write(buffer);
|
|
6005
|
-
sink.end();
|
|
6006
|
-
return sink;
|
|
6007
|
-
}
|
|
6008
|
-
if (sink._isVoid) return sink;
|
|
6009
|
-
return sink;
|
|
6010
|
-
}
|
|
6011
|
-
finalize() {
|
|
6012
|
-
if (this._stream || this._pending.length > 0) {
|
|
6013
|
-
this._finalizing = true;
|
|
6014
|
-
return;
|
|
6015
|
-
}
|
|
6016
|
-
if (this._finalized) return;
|
|
6017
|
-
this._finalized = true;
|
|
6018
|
-
this.push(END_OF_TAR);
|
|
6019
|
-
this.push(null);
|
|
6020
|
-
}
|
|
6021
|
-
_done(stream) {
|
|
6022
|
-
if (stream !== this._stream) return;
|
|
6023
|
-
this._stream = null;
|
|
6024
|
-
if (this._finalizing) this.finalize();
|
|
6025
|
-
if (this._pending.length) this._pending.shift()._continueOpen();
|
|
6026
|
-
}
|
|
6027
|
-
_encode(header) {
|
|
6028
|
-
if (!header.pax) {
|
|
6029
|
-
const buf = headers.encode(header);
|
|
6030
|
-
if (buf) {
|
|
6031
|
-
this.push(buf);
|
|
6032
|
-
return;
|
|
6033
|
-
}
|
|
6034
|
-
}
|
|
6035
|
-
this._encodePax(header);
|
|
6036
|
-
}
|
|
6037
|
-
_encodePax(header) {
|
|
6038
|
-
const paxHeader = headers.encodePax({
|
|
6039
|
-
name: header.name,
|
|
6040
|
-
linkname: header.linkname,
|
|
6041
|
-
pax: header.pax
|
|
6042
|
-
});
|
|
6043
|
-
const newHeader = {
|
|
6044
|
-
name: "PaxHeader",
|
|
6045
|
-
mode: header.mode,
|
|
6046
|
-
uid: header.uid,
|
|
6047
|
-
gid: header.gid,
|
|
6048
|
-
size: paxHeader.byteLength,
|
|
6049
|
-
mtime: header.mtime,
|
|
6050
|
-
type: "pax-header",
|
|
6051
|
-
linkname: header.linkname && "PaxHeader",
|
|
6052
|
-
uname: header.uname,
|
|
6053
|
-
gname: header.gname,
|
|
6054
|
-
devmajor: header.devmajor,
|
|
6055
|
-
devminor: header.devminor
|
|
6056
|
-
};
|
|
6057
|
-
this.push(headers.encode(newHeader));
|
|
6058
|
-
this.push(paxHeader);
|
|
6059
|
-
overflow(this, paxHeader.byteLength);
|
|
6060
|
-
newHeader.size = header.size;
|
|
6061
|
-
newHeader.type = header.type;
|
|
6062
|
-
this.push(headers.encode(newHeader));
|
|
6063
|
-
}
|
|
6064
|
-
_doDrain() {
|
|
6065
|
-
const drain = this._drain;
|
|
6066
|
-
this._drain = noop$3;
|
|
6067
|
-
drain();
|
|
6068
|
-
}
|
|
6069
|
-
_predestroy() {
|
|
6070
|
-
const err = getStreamError(this);
|
|
6071
|
-
if (this._stream) this._stream.destroy(err);
|
|
6072
|
-
while (this._pending.length) {
|
|
6073
|
-
const stream = this._pending.shift();
|
|
6074
|
-
stream.destroy(err);
|
|
6075
|
-
stream._continueOpen();
|
|
6076
|
-
}
|
|
6077
|
-
this._doDrain();
|
|
6078
|
-
}
|
|
6079
|
-
_read(cb) {
|
|
6080
|
-
this._doDrain();
|
|
6081
|
-
cb();
|
|
6082
|
-
}
|
|
6083
|
-
};
|
|
6084
|
-
module.exports = function pack(opts) {
|
|
6085
|
-
return new Pack(opts);
|
|
6086
|
-
};
|
|
6087
|
-
function modeToType(mode) {
|
|
6088
|
-
switch (mode & constants$1.S_IFMT) {
|
|
6089
|
-
case constants$1.S_IFBLK: return "block-device";
|
|
6090
|
-
case constants$1.S_IFCHR: return "character-device";
|
|
6091
|
-
case constants$1.S_IFDIR: return "directory";
|
|
6092
|
-
case constants$1.S_IFIFO: return "fifo";
|
|
6093
|
-
case constants$1.S_IFLNK: return "symlink";
|
|
6094
|
-
}
|
|
6095
|
-
return "file";
|
|
6096
|
-
}
|
|
6097
|
-
function noop$3() {}
|
|
6098
|
-
function overflow(self, size) {
|
|
6099
|
-
size &= 511;
|
|
6100
|
-
if (size) self.push(END_OF_TAR.subarray(0, 512 - size));
|
|
6101
|
-
}
|
|
6102
|
-
function mapWritable(buf) {
|
|
6103
|
-
return b4a.isBuffer(buf) ? buf : b4a.from(buf);
|
|
6104
|
-
}
|
|
6105
|
-
} });
|
|
6106
|
-
|
|
6107
|
-
//#endregion
|
|
6108
|
-
//#region node_modules/.pnpm/tar-stream@3.1.7/node_modules/tar-stream/index.js
|
|
6109
|
-
var require_tar_stream = __commonJS({ "node_modules/.pnpm/tar-stream@3.1.7/node_modules/tar-stream/index.js"(exports) {
|
|
6110
|
-
exports.extract = require_extract();
|
|
6111
|
-
exports.pack = require_pack();
|
|
6112
|
-
} });
|
|
6113
|
-
|
|
6114
|
-
//#endregion
|
|
6115
|
-
//#region node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js
|
|
6116
|
-
var require_wrappy = __commonJS({ "node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js"(exports, module) {
|
|
6117
|
-
module.exports = wrappy$1;
|
|
6118
|
-
function wrappy$1(fn, cb) {
|
|
6119
|
-
if (fn && cb) return wrappy$1(fn)(cb);
|
|
6120
|
-
if (typeof fn !== "function") throw new TypeError("need wrapper function");
|
|
6121
|
-
Object.keys(fn).forEach(function(k) {
|
|
6122
|
-
wrapper[k] = fn[k];
|
|
6123
|
-
});
|
|
6124
|
-
return wrapper;
|
|
6125
|
-
function wrapper() {
|
|
6126
|
-
var args = new Array(arguments.length);
|
|
6127
|
-
for (var i = 0; i < args.length; i++) args[i] = arguments[i];
|
|
6128
|
-
var ret = fn.apply(this, args);
|
|
6129
|
-
var cb$1 = args[args.length - 1];
|
|
6130
|
-
if (typeof ret === "function" && ret !== cb$1) Object.keys(cb$1).forEach(function(k) {
|
|
6131
|
-
ret[k] = cb$1[k];
|
|
6132
|
-
});
|
|
6133
|
-
return ret;
|
|
6134
|
-
}
|
|
6135
|
-
}
|
|
6136
|
-
} });
|
|
6137
|
-
|
|
6138
|
-
//#endregion
|
|
6139
|
-
//#region node_modules/.pnpm/once@1.4.0/node_modules/once/once.js
|
|
6140
|
-
var require_once = __commonJS({ "node_modules/.pnpm/once@1.4.0/node_modules/once/once.js"(exports, module) {
|
|
6141
|
-
var wrappy = require_wrappy();
|
|
6142
|
-
module.exports = wrappy(once$2);
|
|
6143
|
-
module.exports.strict = wrappy(onceStrict);
|
|
6144
|
-
once$2.proto = once$2(function() {
|
|
6145
|
-
Object.defineProperty(Function.prototype, "once", {
|
|
6146
|
-
value: function() {
|
|
6147
|
-
return once$2(this);
|
|
6148
|
-
},
|
|
6149
|
-
configurable: true
|
|
6150
|
-
});
|
|
6151
|
-
Object.defineProperty(Function.prototype, "onceStrict", {
|
|
6152
|
-
value: function() {
|
|
6153
|
-
return onceStrict(this);
|
|
6154
|
-
},
|
|
6155
|
-
configurable: true
|
|
6156
|
-
});
|
|
6157
|
-
});
|
|
6158
|
-
function once$2(fn) {
|
|
6159
|
-
var f = function() {
|
|
6160
|
-
if (f.called) return f.value;
|
|
6161
|
-
f.called = true;
|
|
6162
|
-
return f.value = fn.apply(this, arguments);
|
|
6163
|
-
};
|
|
6164
|
-
f.called = false;
|
|
6165
|
-
return f;
|
|
6166
|
-
}
|
|
6167
|
-
function onceStrict(fn) {
|
|
6168
|
-
var f = function() {
|
|
6169
|
-
if (f.called) throw new Error(f.onceError);
|
|
6170
|
-
f.called = true;
|
|
6171
|
-
return f.value = fn.apply(this, arguments);
|
|
6172
|
-
};
|
|
6173
|
-
var name$1 = fn.name || "Function wrapped with `once`";
|
|
6174
|
-
f.onceError = name$1 + " shouldn't be called more than once";
|
|
6175
|
-
f.called = false;
|
|
6176
|
-
return f;
|
|
6177
|
-
}
|
|
6178
|
-
} });
|
|
6179
|
-
|
|
6180
|
-
//#endregion
|
|
6181
|
-
//#region node_modules/.pnpm/end-of-stream@1.4.4/node_modules/end-of-stream/index.js
|
|
6182
|
-
var require_end_of_stream = __commonJS({ "node_modules/.pnpm/end-of-stream@1.4.4/node_modules/end-of-stream/index.js"(exports, module) {
|
|
6183
|
-
var once$1 = require_once();
|
|
6184
|
-
var noop$2 = function() {};
|
|
6185
|
-
var isRequest$1 = function(stream) {
|
|
6186
|
-
return stream.setHeader && typeof stream.abort === "function";
|
|
6187
|
-
};
|
|
6188
|
-
var isChildProcess = function(stream) {
|
|
6189
|
-
return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3;
|
|
6190
|
-
};
|
|
6191
|
-
var eos$1 = function(stream, opts, callback) {
|
|
6192
|
-
if (typeof opts === "function") return eos$1(stream, null, opts);
|
|
6193
|
-
if (!opts) opts = {};
|
|
6194
|
-
callback = once$1(callback || noop$2);
|
|
6195
|
-
var ws = stream._writableState;
|
|
6196
|
-
var rs = stream._readableState;
|
|
6197
|
-
var readable = opts.readable || opts.readable !== false && stream.readable;
|
|
6198
|
-
var writable = opts.writable || opts.writable !== false && stream.writable;
|
|
6199
|
-
var cancelled = false;
|
|
6200
|
-
var onlegacyfinish = function() {
|
|
6201
|
-
if (!stream.writable) onfinish();
|
|
6202
|
-
};
|
|
6203
|
-
var onfinish = function() {
|
|
6204
|
-
writable = false;
|
|
6205
|
-
if (!readable) callback.call(stream);
|
|
6206
|
-
};
|
|
6207
|
-
var onend = function() {
|
|
6208
|
-
readable = false;
|
|
6209
|
-
if (!writable) callback.call(stream);
|
|
6210
|
-
};
|
|
6211
|
-
var onexit = function(exitCode) {
|
|
6212
|
-
callback.call(stream, exitCode ? new Error("exited with error code: " + exitCode) : null);
|
|
6213
|
-
};
|
|
6214
|
-
var onerror = function(err) {
|
|
6215
|
-
callback.call(stream, err);
|
|
6216
|
-
};
|
|
6217
|
-
var onclose = function() {
|
|
6218
|
-
process.nextTick(onclosenexttick);
|
|
6219
|
-
};
|
|
6220
|
-
var onclosenexttick = function() {
|
|
6221
|
-
if (cancelled) return;
|
|
6222
|
-
if (readable && !(rs && rs.ended && !rs.destroyed)) return callback.call(stream, new Error("premature close"));
|
|
6223
|
-
if (writable && !(ws && ws.ended && !ws.destroyed)) return callback.call(stream, new Error("premature close"));
|
|
6224
|
-
};
|
|
6225
|
-
var onrequest = function() {
|
|
6226
|
-
stream.req.on("finish", onfinish);
|
|
6227
|
-
};
|
|
6228
|
-
if (isRequest$1(stream)) {
|
|
6229
|
-
stream.on("complete", onfinish);
|
|
6230
|
-
stream.on("abort", onclose);
|
|
6231
|
-
if (stream.req) onrequest();
|
|
6232
|
-
else stream.on("request", onrequest);
|
|
6233
|
-
} else if (writable && !ws) {
|
|
6234
|
-
stream.on("end", onlegacyfinish);
|
|
6235
|
-
stream.on("close", onlegacyfinish);
|
|
6236
|
-
}
|
|
6237
|
-
if (isChildProcess(stream)) stream.on("exit", onexit);
|
|
6238
|
-
stream.on("end", onend);
|
|
6239
|
-
stream.on("finish", onfinish);
|
|
6240
|
-
if (opts.error !== false) stream.on("error", onerror);
|
|
6241
|
-
stream.on("close", onclose);
|
|
6242
|
-
return function() {
|
|
6243
|
-
cancelled = true;
|
|
6244
|
-
stream.removeListener("complete", onfinish);
|
|
6245
|
-
stream.removeListener("abort", onclose);
|
|
6246
|
-
stream.removeListener("request", onrequest);
|
|
6247
|
-
if (stream.req) stream.req.removeListener("finish", onfinish);
|
|
6248
|
-
stream.removeListener("end", onlegacyfinish);
|
|
6249
|
-
stream.removeListener("close", onlegacyfinish);
|
|
6250
|
-
stream.removeListener("finish", onfinish);
|
|
6251
|
-
stream.removeListener("exit", onexit);
|
|
6252
|
-
stream.removeListener("end", onend);
|
|
6253
|
-
stream.removeListener("error", onerror);
|
|
6254
|
-
stream.removeListener("close", onclose);
|
|
6255
|
-
};
|
|
6256
|
-
};
|
|
6257
|
-
module.exports = eos$1;
|
|
6258
|
-
} });
|
|
6259
|
-
|
|
6260
|
-
//#endregion
|
|
6261
|
-
//#region node_modules/.pnpm/pump@3.0.2/node_modules/pump/index.js
|
|
6262
|
-
var require_pump = __commonJS({ "node_modules/.pnpm/pump@3.0.2/node_modules/pump/index.js"(exports, module) {
|
|
6263
|
-
var once = require_once();
|
|
6264
|
-
var eos = require_end_of_stream();
|
|
6265
|
-
var fs$2;
|
|
6266
|
-
try {
|
|
6267
|
-
fs$2 = __require("fs");
|
|
6268
|
-
} catch (e) {}
|
|
6269
|
-
var noop$1 = function() {};
|
|
6270
|
-
var ancient = /^v?\.0/.test(process.version);
|
|
6271
|
-
var isFn = function(fn) {
|
|
6272
|
-
return typeof fn === "function";
|
|
6273
|
-
};
|
|
6274
|
-
var isFS = function(stream) {
|
|
6275
|
-
if (!ancient) return false;
|
|
6276
|
-
if (!fs$2) return false;
|
|
6277
|
-
return (stream instanceof (fs$2.ReadStream || noop$1) || stream instanceof (fs$2.WriteStream || noop$1)) && isFn(stream.close);
|
|
6278
|
-
};
|
|
6279
|
-
var isRequest = function(stream) {
|
|
6280
|
-
return stream.setHeader && isFn(stream.abort);
|
|
6281
|
-
};
|
|
6282
|
-
var destroyer = function(stream, reading, writing, callback) {
|
|
6283
|
-
callback = once(callback);
|
|
6284
|
-
var closed = false;
|
|
6285
|
-
stream.on("close", function() {
|
|
6286
|
-
closed = true;
|
|
6287
|
-
});
|
|
6288
|
-
eos(stream, {
|
|
6289
|
-
readable: reading,
|
|
6290
|
-
writable: writing
|
|
6291
|
-
}, function(err) {
|
|
6292
|
-
if (err) return callback(err);
|
|
6293
|
-
closed = true;
|
|
6294
|
-
callback();
|
|
6295
|
-
});
|
|
6296
|
-
var destroyed = false;
|
|
6297
|
-
return function(err) {
|
|
6298
|
-
if (closed) return;
|
|
6299
|
-
if (destroyed) return;
|
|
6300
|
-
destroyed = true;
|
|
6301
|
-
if (isFS(stream)) return stream.close(noop$1);
|
|
6302
|
-
if (isRequest(stream)) return stream.abort();
|
|
6303
|
-
if (isFn(stream.destroy)) return stream.destroy();
|
|
6304
|
-
callback(err || new Error("stream was destroyed"));
|
|
6305
|
-
};
|
|
6306
|
-
};
|
|
6307
|
-
var call = function(fn) {
|
|
6308
|
-
fn();
|
|
6309
|
-
};
|
|
6310
|
-
var pipe = function(from$2, to) {
|
|
6311
|
-
return from$2.pipe(to);
|
|
6312
|
-
};
|
|
6313
|
-
var pump$1 = function() {
|
|
6314
|
-
var streams = Array.prototype.slice.call(arguments);
|
|
6315
|
-
var callback = isFn(streams[streams.length - 1] || noop$1) && streams.pop() || noop$1;
|
|
6316
|
-
if (Array.isArray(streams[0])) streams = streams[0];
|
|
6317
|
-
if (streams.length < 2) throw new Error("pump requires two streams per minimum");
|
|
6318
|
-
var error;
|
|
6319
|
-
var destroys = streams.map(function(stream, i) {
|
|
6320
|
-
var reading = i < streams.length - 1;
|
|
6321
|
-
var writing = i > 0;
|
|
6322
|
-
return destroyer(stream, reading, writing, function(err) {
|
|
6323
|
-
if (!error) error = err;
|
|
6324
|
-
if (err) destroys.forEach(call);
|
|
6325
|
-
if (reading) return;
|
|
6326
|
-
destroys.forEach(call);
|
|
6327
|
-
callback(error);
|
|
6328
|
-
});
|
|
6329
|
-
});
|
|
6330
|
-
return streams.reduce(pipe);
|
|
6331
|
-
};
|
|
6332
|
-
module.exports = pump$1;
|
|
6333
|
-
} });
|
|
6334
|
-
|
|
6335
|
-
//#endregion
|
|
6336
|
-
//#region node_modules/.pnpm/tar-fs@3.0.8/node_modules/tar-fs/index.js
|
|
6337
|
-
var require_tar_fs = __commonJS({ "node_modules/.pnpm/tar-fs@3.0.8/node_modules/tar-fs/index.js"(exports) {
|
|
6338
|
-
const tar = require_tar_stream();
|
|
6339
|
-
const pump = require_pump();
|
|
6340
|
-
const fs$1 = __require("fs");
|
|
6341
|
-
const path$1 = __require("path");
|
|
6342
|
-
const win32 = (global.Bare?.platform || process.platform) === "win32";
|
|
6343
|
-
exports.pack = function pack(cwd, opts) {
|
|
6344
|
-
if (!cwd) cwd = ".";
|
|
6345
|
-
if (!opts) opts = {};
|
|
6346
|
-
const xfs = opts.fs || fs$1;
|
|
6347
|
-
const ignore = opts.ignore || opts.filter || noop;
|
|
6348
|
-
const mapStream = opts.mapStream || echo;
|
|
6349
|
-
const statNext = statAll(xfs, opts.dereference ? xfs.stat : xfs.lstat, cwd, ignore, opts.entries, opts.sort);
|
|
6350
|
-
const strict = opts.strict !== false;
|
|
6351
|
-
const umask = typeof opts.umask === "number" ? ~opts.umask : ~processUmask();
|
|
6352
|
-
const pack = opts.pack || tar.pack();
|
|
6353
|
-
const finish = opts.finish || noop;
|
|
6354
|
-
let map = opts.map || noop;
|
|
6355
|
-
let dmode = typeof opts.dmode === "number" ? opts.dmode : 0;
|
|
6356
|
-
let fmode = typeof opts.fmode === "number" ? opts.fmode : 0;
|
|
6357
|
-
if (opts.strip) map = strip(map, opts.strip);
|
|
6358
|
-
if (opts.readable) {
|
|
6359
|
-
dmode |= parseInt(555, 8);
|
|
6360
|
-
fmode |= parseInt(444, 8);
|
|
6361
|
-
}
|
|
6362
|
-
if (opts.writable) {
|
|
6363
|
-
dmode |= parseInt(333, 8);
|
|
6364
|
-
fmode |= parseInt(222, 8);
|
|
6365
|
-
}
|
|
6366
|
-
onnextentry();
|
|
6367
|
-
function onsymlink(filename, header) {
|
|
6368
|
-
xfs.readlink(path$1.join(cwd, filename), function(err, linkname) {
|
|
6369
|
-
if (err) return pack.destroy(err);
|
|
6370
|
-
header.linkname = normalize(linkname);
|
|
6371
|
-
pack.entry(header, onnextentry);
|
|
6372
|
-
});
|
|
6373
|
-
}
|
|
6374
|
-
function onstat(err, filename, stat) {
|
|
6375
|
-
if (pack.destroyed) return;
|
|
6376
|
-
if (err) return pack.destroy(err);
|
|
6377
|
-
if (!filename) {
|
|
6378
|
-
if (opts.finalize !== false) pack.finalize();
|
|
6379
|
-
return finish(pack);
|
|
6380
|
-
}
|
|
6381
|
-
if (stat.isSocket()) return onnextentry();
|
|
6382
|
-
let header = {
|
|
6383
|
-
name: normalize(filename),
|
|
6384
|
-
mode: (stat.mode | (stat.isDirectory() ? dmode : fmode)) & umask,
|
|
6385
|
-
mtime: stat.mtime,
|
|
6386
|
-
size: stat.size,
|
|
6387
|
-
type: "file",
|
|
6388
|
-
uid: stat.uid,
|
|
6389
|
-
gid: stat.gid
|
|
6390
|
-
};
|
|
6391
|
-
if (stat.isDirectory()) {
|
|
6392
|
-
header.size = 0;
|
|
6393
|
-
header.type = "directory";
|
|
6394
|
-
header = map(header) || header;
|
|
6395
|
-
return pack.entry(header, onnextentry);
|
|
6396
|
-
}
|
|
6397
|
-
if (stat.isSymbolicLink()) {
|
|
6398
|
-
header.size = 0;
|
|
6399
|
-
header.type = "symlink";
|
|
6400
|
-
header = map(header) || header;
|
|
6401
|
-
return onsymlink(filename, header);
|
|
6402
|
-
}
|
|
6403
|
-
header = map(header) || header;
|
|
6404
|
-
if (!stat.isFile()) {
|
|
6405
|
-
if (strict) return pack.destroy(new Error("unsupported type for " + filename));
|
|
6406
|
-
return onnextentry();
|
|
6407
|
-
}
|
|
6408
|
-
const entry = pack.entry(header, onnextentry);
|
|
6409
|
-
const rs = mapStream(xfs.createReadStream(path$1.join(cwd, filename), {
|
|
6410
|
-
start: 0,
|
|
6411
|
-
end: header.size > 0 ? header.size - 1 : header.size
|
|
6412
|
-
}), header);
|
|
6413
|
-
rs.on("error", function(err$1) {
|
|
6414
|
-
entry.destroy(err$1);
|
|
6415
|
-
});
|
|
6416
|
-
pump(rs, entry);
|
|
6417
|
-
}
|
|
6418
|
-
function onnextentry(err) {
|
|
6419
|
-
if (err) return pack.destroy(err);
|
|
6420
|
-
statNext(onstat);
|
|
6421
|
-
}
|
|
6422
|
-
return pack;
|
|
6423
|
-
};
|
|
6424
|
-
function head(list) {
|
|
6425
|
-
return list.length ? list[list.length - 1] : null;
|
|
6426
|
-
}
|
|
6427
|
-
function processGetuid() {
|
|
6428
|
-
return process.getuid ? process.getuid() : -1;
|
|
6429
|
-
}
|
|
6430
|
-
function processUmask() {
|
|
6431
|
-
return process.umask ? process.umask() : 0;
|
|
6432
|
-
}
|
|
6433
|
-
exports.extract = function extract$1(cwd, opts) {
|
|
6434
|
-
if (!cwd) cwd = ".";
|
|
6435
|
-
if (!opts) opts = {};
|
|
6436
|
-
cwd = path$1.resolve(cwd);
|
|
6437
|
-
const xfs = opts.fs || fs$1;
|
|
6438
|
-
const ignore = opts.ignore || opts.filter || noop;
|
|
6439
|
-
const mapStream = opts.mapStream || echo;
|
|
6440
|
-
const own = opts.chown !== false && !win32 && processGetuid() === 0;
|
|
6441
|
-
const extract$1 = opts.extract || tar.extract();
|
|
6442
|
-
const stack = [];
|
|
6443
|
-
const now = new Date();
|
|
6444
|
-
const umask = typeof opts.umask === "number" ? ~opts.umask : ~processUmask();
|
|
6445
|
-
const strict = opts.strict !== false;
|
|
6446
|
-
let map = opts.map || noop;
|
|
6447
|
-
let dmode = typeof opts.dmode === "number" ? opts.dmode : 0;
|
|
6448
|
-
let fmode = typeof opts.fmode === "number" ? opts.fmode : 0;
|
|
6449
|
-
if (opts.strip) map = strip(map, opts.strip);
|
|
6450
|
-
if (opts.readable) {
|
|
6451
|
-
dmode |= parseInt(555, 8);
|
|
6452
|
-
fmode |= parseInt(444, 8);
|
|
6453
|
-
}
|
|
6454
|
-
if (opts.writable) {
|
|
6455
|
-
dmode |= parseInt(333, 8);
|
|
6456
|
-
fmode |= parseInt(222, 8);
|
|
6457
|
-
}
|
|
6458
|
-
extract$1.on("entry", onentry);
|
|
6459
|
-
if (opts.finish) extract$1.on("finish", opts.finish);
|
|
6460
|
-
return extract$1;
|
|
6461
|
-
function onentry(header, stream, next) {
|
|
6462
|
-
header = map(header) || header;
|
|
6463
|
-
header.name = normalize(header.name);
|
|
6464
|
-
const name$1 = path$1.join(cwd, path$1.join("/", header.name));
|
|
6465
|
-
if (ignore(name$1, header)) {
|
|
6466
|
-
stream.resume();
|
|
6467
|
-
return next();
|
|
6468
|
-
}
|
|
6469
|
-
if (header.type === "directory") {
|
|
6470
|
-
stack.push([name$1, header.mtime]);
|
|
6471
|
-
return mkdirfix(name$1, {
|
|
6472
|
-
fs: xfs,
|
|
6473
|
-
own,
|
|
6474
|
-
uid: header.uid,
|
|
6475
|
-
gid: header.gid,
|
|
6476
|
-
mode: header.mode
|
|
6477
|
-
}, stat);
|
|
6478
|
-
}
|
|
6479
|
-
const dir = path$1.dirname(name$1);
|
|
6480
|
-
validate(xfs, dir, path$1.join(cwd, "."), function(err, valid) {
|
|
6481
|
-
if (err) return next(err);
|
|
6482
|
-
if (!valid) return next(new Error(dir + " is not a valid path"));
|
|
6483
|
-
mkdirfix(dir, {
|
|
6484
|
-
fs: xfs,
|
|
6485
|
-
own,
|
|
6486
|
-
uid: header.uid,
|
|
6487
|
-
gid: header.gid,
|
|
6488
|
-
mode: 493
|
|
6489
|
-
}, function(err$1) {
|
|
6490
|
-
if (err$1) return next(err$1);
|
|
6491
|
-
switch (header.type) {
|
|
6492
|
-
case "file": return onfile();
|
|
6493
|
-
case "link": return onlink();
|
|
6494
|
-
case "symlink": return onsymlink();
|
|
6495
|
-
}
|
|
6496
|
-
if (strict) return next(new Error("unsupported type for " + name$1 + " (" + header.type + ")"));
|
|
6497
|
-
stream.resume();
|
|
6498
|
-
next();
|
|
6499
|
-
});
|
|
6500
|
-
});
|
|
6501
|
-
function stat(err) {
|
|
6502
|
-
if (err) return next(err);
|
|
6503
|
-
utimes(name$1, header, function(err$1) {
|
|
6504
|
-
if (err$1) return next(err$1);
|
|
6505
|
-
if (win32) return next();
|
|
6506
|
-
chperm(name$1, header, next);
|
|
6507
|
-
});
|
|
6508
|
-
}
|
|
6509
|
-
function onsymlink() {
|
|
6510
|
-
if (win32) return next();
|
|
6511
|
-
xfs.unlink(name$1, function() {
|
|
6512
|
-
const dst = path$1.resolve(path$1.dirname(name$1), header.linkname);
|
|
6513
|
-
if (!inCwd(dst)) return next(new Error(name$1 + " is not a valid symlink"));
|
|
6514
|
-
xfs.symlink(header.linkname, name$1, stat);
|
|
6515
|
-
});
|
|
6516
|
-
}
|
|
6517
|
-
function onlink() {
|
|
6518
|
-
if (win32) return next();
|
|
6519
|
-
xfs.unlink(name$1, function() {
|
|
6520
|
-
const dst = path$1.join(cwd, path$1.join("/", header.linkname));
|
|
6521
|
-
xfs.link(dst, name$1, function(err) {
|
|
6522
|
-
if (err && err.code === "EPERM" && opts.hardlinkAsFilesFallback) {
|
|
6523
|
-
stream = xfs.createReadStream(dst);
|
|
6524
|
-
return onfile();
|
|
6525
|
-
}
|
|
6526
|
-
stat(err);
|
|
6527
|
-
});
|
|
6528
|
-
});
|
|
6529
|
-
}
|
|
6530
|
-
function inCwd(dst) {
|
|
6531
|
-
return dst.startsWith(cwd);
|
|
6532
|
-
}
|
|
6533
|
-
function onfile() {
|
|
6534
|
-
const ws = xfs.createWriteStream(name$1);
|
|
6535
|
-
const rs = mapStream(stream, header);
|
|
6536
|
-
ws.on("error", function(err) {
|
|
6537
|
-
rs.destroy(err);
|
|
6538
|
-
});
|
|
6539
|
-
pump(rs, ws, function(err) {
|
|
6540
|
-
if (err) return next(err);
|
|
6541
|
-
ws.on("close", stat);
|
|
6542
|
-
});
|
|
6543
|
-
}
|
|
6544
|
-
}
|
|
6545
|
-
function utimesParent(name$1, cb) {
|
|
6546
|
-
let top;
|
|
6547
|
-
while ((top = head(stack)) && name$1.slice(0, top[0].length) !== top[0]) stack.pop();
|
|
6548
|
-
if (!top) return cb();
|
|
6549
|
-
xfs.utimes(top[0], now, top[1], cb);
|
|
6550
|
-
}
|
|
6551
|
-
function utimes(name$1, header, cb) {
|
|
6552
|
-
if (opts.utimes === false) return cb();
|
|
6553
|
-
if (header.type === "directory") return xfs.utimes(name$1, now, header.mtime, cb);
|
|
6554
|
-
if (header.type === "symlink") return utimesParent(name$1, cb);
|
|
6555
|
-
xfs.utimes(name$1, now, header.mtime, function(err) {
|
|
6556
|
-
if (err) return cb(err);
|
|
6557
|
-
utimesParent(name$1, cb);
|
|
6558
|
-
});
|
|
6559
|
-
}
|
|
6560
|
-
function chperm(name$1, header, cb) {
|
|
6561
|
-
const link = header.type === "symlink";
|
|
6562
|
-
const chmod = link ? xfs.lchmod : xfs.chmod;
|
|
6563
|
-
const chown = link ? xfs.lchown : xfs.chown;
|
|
6564
|
-
if (!chmod) return cb();
|
|
6565
|
-
const mode = (header.mode | (header.type === "directory" ? dmode : fmode)) & umask;
|
|
6566
|
-
if (chown && own) chown.call(xfs, name$1, header.uid, header.gid, onchown);
|
|
6567
|
-
else onchown(null);
|
|
6568
|
-
function onchown(err) {
|
|
6569
|
-
if (err) return cb(err);
|
|
6570
|
-
if (!chmod) return cb();
|
|
6571
|
-
chmod.call(xfs, name$1, mode, cb);
|
|
6572
|
-
}
|
|
6573
|
-
}
|
|
6574
|
-
function mkdirfix(name$1, opts$1, cb) {
|
|
6575
|
-
xfs.stat(name$1, function(err) {
|
|
6576
|
-
if (!err) return cb(null);
|
|
6577
|
-
if (err.code !== "ENOENT") return cb(err);
|
|
6578
|
-
xfs.mkdir(name$1, {
|
|
6579
|
-
mode: opts$1.mode,
|
|
6580
|
-
recursive: true
|
|
6581
|
-
}, function(err$1, made) {
|
|
6582
|
-
if (err$1) return cb(err$1);
|
|
6583
|
-
chperm(name$1, opts$1, cb);
|
|
6584
|
-
});
|
|
6585
|
-
});
|
|
6586
|
-
}
|
|
6587
|
-
};
|
|
6588
|
-
function validate(fs$3, name$1, root, cb) {
|
|
6589
|
-
if (name$1 === root) return cb(null, true);
|
|
6590
|
-
fs$3.lstat(name$1, function(err, st) {
|
|
6591
|
-
if (err && err.code === "ENOENT") return validate(fs$3, path$1.join(name$1, ".."), root, cb);
|
|
6592
|
-
else if (err) return cb(err);
|
|
6593
|
-
cb(null, st.isDirectory());
|
|
6594
|
-
});
|
|
6595
|
-
}
|
|
6596
|
-
function noop() {}
|
|
6597
|
-
function echo(name$1) {
|
|
6598
|
-
return name$1;
|
|
6599
|
-
}
|
|
6600
|
-
function normalize(name$1) {
|
|
6601
|
-
return win32 ? name$1.replace(/\\/g, "/").replace(/[:?<>|]/g, "_") : name$1;
|
|
6602
|
-
}
|
|
6603
|
-
function statAll(fs$3, stat, cwd, ignore, entries, sort) {
|
|
6604
|
-
if (!entries) entries = ["."];
|
|
6605
|
-
const queue = entries.slice(0);
|
|
6606
|
-
return function loop(callback) {
|
|
6607
|
-
if (!queue.length) return callback(null);
|
|
6608
|
-
const next = queue.shift();
|
|
6609
|
-
const nextAbs = path$1.join(cwd, next);
|
|
6610
|
-
stat.call(fs$3, nextAbs, function(err, stat$1) {
|
|
6611
|
-
if (err) return callback(entries.indexOf(next) === -1 && err.code === "ENOENT" ? null : err);
|
|
6612
|
-
if (!stat$1.isDirectory()) return callback(null, next, stat$1);
|
|
6613
|
-
fs$3.readdir(nextAbs, function(err$1, files$1) {
|
|
6614
|
-
if (err$1) return callback(err$1);
|
|
6615
|
-
if (sort) files$1.sort();
|
|
6616
|
-
for (let i = 0; i < files$1.length; i++) if (!ignore(path$1.join(cwd, next, files$1[i]))) queue.push(path$1.join(next, files$1[i]));
|
|
6617
|
-
callback(null, next, stat$1);
|
|
6618
|
-
});
|
|
6619
|
-
});
|
|
6620
|
-
};
|
|
6621
|
-
}
|
|
6622
|
-
function strip(map, level) {
|
|
6623
|
-
return function(header) {
|
|
6624
|
-
header.name = header.name.split("/").slice(level).join("/");
|
|
6625
|
-
const linkname = header.linkname;
|
|
6626
|
-
if (linkname && (header.type === "link" || path$1.isAbsolute(linkname))) header.linkname = linkname.split("/").slice(level).join("/");
|
|
6627
|
-
return map(header);
|
|
6628
|
-
};
|
|
6629
|
-
}
|
|
6630
|
-
} });
|
|
6631
|
-
|
|
6632
3955
|
//#endregion
|
|
6633
3956
|
//#region packages/cli/commands/add/fetch-packages.ts
|
|
6634
|
-
var import_tar_fs = __toESM$1(require_tar_fs(), 1);
|
|
6635
3957
|
const NODE_MODULES = fileURLToPath(new URL("../node_modules", import.meta.url));
|
|
6636
3958
|
const REGISTRY = "https://registry.npmjs.org";
|
|
6637
3959
|
const Directive = {
|
|
@@ -6663,10 +3985,18 @@ async function downloadPackage(options$6) {
|
|
|
6663
3985
|
const tarballUrl = pkg.dist.tarball;
|
|
6664
3986
|
const data = await fetch(tarballUrl);
|
|
6665
3987
|
if (!data.body) throw new Error(`Unexpected response: '${tarballUrl}' responded with no body`);
|
|
6666
|
-
await pipeline(
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
3988
|
+
await pipeline(
|
|
3989
|
+
data.body,
|
|
3990
|
+
createGunzip()
|
|
3991
|
+
// extract(NODE_MODULES, {
|
|
3992
|
+
// map: (header) => {
|
|
3993
|
+
// // file paths from the tarball will always have a `package/` prefix,
|
|
3994
|
+
// // so we'll need to replace it with the name of the package
|
|
3995
|
+
// header.name = header.name.replace('package', pkg.name);
|
|
3996
|
+
// return header;
|
|
3997
|
+
// }
|
|
3998
|
+
// })
|
|
3999
|
+
);
|
|
6670
4000
|
const { default: details } = await import(pkg.name);
|
|
6671
4001
|
return details;
|
|
6672
4002
|
}
|
|
@@ -6753,7 +4083,7 @@ function getGlobalPreconditions(cwd, addons, addonSetupResult) {
|
|
|
6753
4083
|
|
|
6754
4084
|
//#endregion
|
|
6755
4085
|
//#region packages/cli/commands/add/index.ts
|
|
6756
|
-
var import_picocolors$2 = __toESM
|
|
4086
|
+
var import_picocolors$2 = __toESM(require_picocolors$1(), 1);
|
|
6757
4087
|
const aliases = officialAddons.map((c) => c.alias).filter((v) => v !== undefined);
|
|
6758
4088
|
const addonOptions = getAddonOptionFlags();
|
|
6759
4089
|
const communityDetails = [];
|
|
@@ -6984,7 +4314,8 @@ else if (official[addonId][id] !== undefined) throw new Error(`Incompatible '${a
|
|
|
6984
4314
|
}
|
|
6985
4315
|
}
|
|
6986
4316
|
let workspace = await createWorkspace({ cwd: options$6.cwd });
|
|
6987
|
-
const
|
|
4317
|
+
const setups = selectedAddons.length ? selectedAddons.map(({ addon }) => addon) : officialAddons;
|
|
4318
|
+
const addonSetupResults = setupAddons(setups, workspace);
|
|
6988
4319
|
if (selectedAddons.length === 0) {
|
|
6989
4320
|
const addonOptions$1 = officialAddons.filter(({ id }) => addonSetupResults[id].unsupported.length === 0).map(({ id, homepage: homepage$1, shortDescription }) => ({
|
|
6990
4321
|
label: id,
|
|
@@ -7233,7 +4564,7 @@ function getOptionChoices(details) {
|
|
|
7233
4564
|
|
|
7234
4565
|
//#endregion
|
|
7235
4566
|
//#region packages/cli/commands/create.ts
|
|
7236
|
-
var import_picocolors$1 = __toESM
|
|
4567
|
+
var import_picocolors$1 = __toESM(require_picocolors$1(), 1);
|
|
7237
4568
|
const langs = ["ts", "jsdoc"];
|
|
7238
4569
|
const langMap = {
|
|
7239
4570
|
ts: "typescript",
|
|
@@ -7245,7 +4576,7 @@ const langOption = new Option("--types <lang>", "add type checking").choices(lan
|
|
|
7245
4576
|
const templateOption = new Option("--template <type>", "template to scaffold").choices(templateChoices);
|
|
7246
4577
|
const ProjectPathSchema = optional(string());
|
|
7247
4578
|
const OptionsSchema = strictObject({
|
|
7248
|
-
types: pipe
|
|
4579
|
+
types: pipe(optional(union([picklist(langs), boolean()])), transform((lang) => langMap[String(lang)])),
|
|
7249
4580
|
addOns: boolean(),
|
|
7250
4581
|
install: union([boolean(), picklist(AGENT_NAMES)]),
|
|
7251
4582
|
template: optional(picklist(templateChoices))
|
|
@@ -7401,7 +4732,7 @@ function runMigrate(cwd, args) {
|
|
|
7401
4732
|
|
|
7402
4733
|
//#endregion
|
|
7403
4734
|
//#region packages/cli/commands/check.ts
|
|
7404
|
-
var import_picocolors = __toESM
|
|
4735
|
+
var import_picocolors = __toESM(require_picocolors$1(), 1);
|
|
7405
4736
|
const check = new Command("check").description("a CLI for checking your Svelte code").allowUnknownOption(true).allowExcessArguments(true).option("-C, --cwd <path>", "path to working directory", process$1.cwd()).configureHelp({ formatHelp() {
|
|
7406
4737
|
runCheck(process$1.cwd(), ["--help"]);
|
|
7407
4738
|
return "";
|