@donotdev/cli 0.1.44 → 0.1.46
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/dependencies-matrix.json +34 -22
- package/dist/bin/commands/agent-setup.js +553 -509
- package/dist/bin/commands/build.js +1144 -908
- package/dist/bin/commands/bump.js +1206 -931
- package/dist/bin/commands/cacheout.js +464 -390
- package/dist/bin/commands/coach.js +467 -393
- package/dist/bin/commands/create-app.js +1118 -846
- package/dist/bin/commands/create-project.js +1158 -886
- package/dist/bin/commands/db.js +16351 -33069
- package/dist/bin/commands/deploy.js +2171 -1870
- package/dist/bin/commands/dev.js +833 -647
- package/dist/bin/commands/doctor.js +555 -511
- package/dist/bin/commands/emu.js +1014 -770
- package/dist/bin/commands/format.js +509 -435
- package/dist/bin/commands/get-demo.js +964 -741
- package/dist/bin/commands/make-admin.js +10368 -27067
- package/dist/bin/commands/preview.js +834 -648
- package/dist/bin/commands/seed.js +16352 -33070
- package/dist/bin/commands/setup-cicd.js +1050 -801
- package/dist/bin/commands/setup.js +1216 -944
- package/dist/bin/commands/staging.js +2171 -1870
- package/dist/bin/commands/sync-secrets.js +916 -717
- package/dist/bin/commands/type-check.js +654 -583
- package/dist/bin/commands/wai.js +454 -380
- package/dist/bin/dndev.js +2 -6
- package/dist/index.js +2582 -2223
- package/package.json +1 -1
- package/templates/app-next/src/app/layout.tsx.example +8 -0
- package/templates/app-next/src/app/not-found.tsx.example +6 -0
|
@@ -5,7 +5,7 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
-
get: (
|
|
8
|
+
get: (a2, b) => (typeof require !== "undefined" ? require : a2)[b]
|
|
9
9
|
}) : x)(function(x) {
|
|
10
10
|
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
11
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
@@ -37,31 +37,40 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
37
37
|
mod
|
|
38
38
|
));
|
|
39
39
|
|
|
40
|
-
// node_modules/.bun/fast-string-truncated-width@
|
|
41
|
-
var
|
|
40
|
+
// node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
|
|
41
|
+
var getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji;
|
|
42
42
|
var init_utils = __esm({
|
|
43
|
-
"node_modules/.bun/fast-string-truncated-width@
|
|
43
|
+
"node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js"() {
|
|
44
44
|
init_utils2();
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
getCodePointsLength = /* @__PURE__ */ (() => {
|
|
46
|
+
const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
47
|
+
return (input) => {
|
|
48
|
+
let surrogatePairsNr = 0;
|
|
49
|
+
SURROGATE_PAIR_RE.lastIndex = 0;
|
|
50
|
+
while (SURROGATE_PAIR_RE.test(input)) {
|
|
51
|
+
surrogatePairsNr += 1;
|
|
52
|
+
}
|
|
53
|
+
return input.length - surrogatePairsNr;
|
|
54
|
+
};
|
|
55
|
+
})();
|
|
48
56
|
isFullWidth = (x) => {
|
|
49
57
|
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
50
58
|
};
|
|
51
|
-
|
|
52
|
-
return x
|
|
59
|
+
isWideNotCJKTNotEmoji = (x) => {
|
|
60
|
+
return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
53
61
|
};
|
|
54
62
|
}
|
|
55
63
|
});
|
|
56
64
|
|
|
57
|
-
// node_modules/.bun/fast-string-truncated-width@
|
|
58
|
-
var ANSI_RE, CONTROL_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
|
|
65
|
+
// node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
|
|
66
|
+
var ANSI_RE, CONTROL_RE, CJKT_WIDE_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
|
|
59
67
|
var init_dist = __esm({
|
|
60
|
-
"node_modules/.bun/fast-string-truncated-width@
|
|
68
|
+
"node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js"() {
|
|
61
69
|
init_utils2();
|
|
62
70
|
init_utils();
|
|
63
|
-
ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
|
|
71
|
+
ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
|
|
64
72
|
CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
73
|
+
CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
|
|
65
74
|
TAB_RE = /\t{1,1000}/y;
|
|
66
75
|
EMOJI_RE = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu");
|
|
67
76
|
LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
@@ -71,14 +80,21 @@ var init_dist = __esm({
|
|
|
71
80
|
const LIMIT = truncationOptions.limit ?? Infinity;
|
|
72
81
|
const ELLIPSIS = truncationOptions.ellipsis ?? "";
|
|
73
82
|
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
|
|
74
|
-
const ANSI_WIDTH =
|
|
83
|
+
const ANSI_WIDTH = 0;
|
|
75
84
|
const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
|
|
76
85
|
const TAB_WIDTH = widthOptions.tabWidth ?? 8;
|
|
77
|
-
const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
|
|
78
86
|
const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
|
|
79
|
-
const FULL_WIDTH_WIDTH =
|
|
87
|
+
const FULL_WIDTH_WIDTH = 2;
|
|
80
88
|
const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
|
|
81
|
-
const WIDE_WIDTH = widthOptions.wideWidth ??
|
|
89
|
+
const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
|
|
90
|
+
const PARSE_BLOCKS = [
|
|
91
|
+
[LATIN_RE, REGULAR_WIDTH],
|
|
92
|
+
[ANSI_RE, ANSI_WIDTH],
|
|
93
|
+
[CONTROL_RE, CONTROL_WIDTH],
|
|
94
|
+
[TAB_RE, TAB_WIDTH],
|
|
95
|
+
[EMOJI_RE, EMOJI_WIDTH],
|
|
96
|
+
[CJKT_WIDE_RE, WIDE_WIDTH]
|
|
97
|
+
];
|
|
82
98
|
let indexPrev = 0;
|
|
83
99
|
let index = 0;
|
|
84
100
|
let length = input.length;
|
|
@@ -98,10 +114,8 @@ var init_dist = __esm({
|
|
|
98
114
|
const codePoint = char.codePointAt(0) || 0;
|
|
99
115
|
if (isFullWidth(codePoint)) {
|
|
100
116
|
widthExtra = FULL_WIDTH_WIDTH;
|
|
101
|
-
} else if (
|
|
117
|
+
} else if (isWideNotCJKTNotEmoji(codePoint)) {
|
|
102
118
|
widthExtra = WIDE_WIDTH;
|
|
103
|
-
} else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) {
|
|
104
|
-
widthExtra = AMBIGUOUS_WIDTH;
|
|
105
119
|
} else {
|
|
106
120
|
widthExtra = REGULAR_WIDTH;
|
|
107
121
|
}
|
|
@@ -117,88 +131,28 @@ var init_dist = __esm({
|
|
|
117
131
|
}
|
|
118
132
|
unmatchedStart = unmatchedEnd = 0;
|
|
119
133
|
}
|
|
120
|
-
if (index >= length)
|
|
121
|
-
break;
|
|
122
|
-
LATIN_RE.lastIndex = index;
|
|
123
|
-
if (LATIN_RE.test(input)) {
|
|
124
|
-
lengthExtra = LATIN_RE.lastIndex - index;
|
|
125
|
-
widthExtra = lengthExtra * REGULAR_WIDTH;
|
|
126
|
-
if (width + widthExtra > truncationLimit) {
|
|
127
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
|
|
128
|
-
}
|
|
129
|
-
if (width + widthExtra > LIMIT) {
|
|
130
|
-
truncationEnabled = true;
|
|
131
|
-
break;
|
|
132
|
-
}
|
|
133
|
-
width += widthExtra;
|
|
134
|
-
unmatchedStart = indexPrev;
|
|
135
|
-
unmatchedEnd = index;
|
|
136
|
-
index = indexPrev = LATIN_RE.lastIndex;
|
|
137
|
-
continue;
|
|
138
|
-
}
|
|
139
|
-
ANSI_RE.lastIndex = index;
|
|
140
|
-
if (ANSI_RE.test(input)) {
|
|
141
|
-
if (width + ANSI_WIDTH > truncationLimit) {
|
|
142
|
-
truncationIndex = Math.min(truncationIndex, index);
|
|
143
|
-
}
|
|
144
|
-
if (width + ANSI_WIDTH > LIMIT) {
|
|
145
|
-
truncationEnabled = true;
|
|
146
|
-
break;
|
|
147
|
-
}
|
|
148
|
-
width += ANSI_WIDTH;
|
|
149
|
-
unmatchedStart = indexPrev;
|
|
150
|
-
unmatchedEnd = index;
|
|
151
|
-
index = indexPrev = ANSI_RE.lastIndex;
|
|
152
|
-
continue;
|
|
153
|
-
}
|
|
154
|
-
CONTROL_RE.lastIndex = index;
|
|
155
|
-
if (CONTROL_RE.test(input)) {
|
|
156
|
-
lengthExtra = CONTROL_RE.lastIndex - index;
|
|
157
|
-
widthExtra = lengthExtra * CONTROL_WIDTH;
|
|
158
|
-
if (width + widthExtra > truncationLimit) {
|
|
159
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
|
|
160
|
-
}
|
|
161
|
-
if (width + widthExtra > LIMIT) {
|
|
162
|
-
truncationEnabled = true;
|
|
163
|
-
break;
|
|
164
|
-
}
|
|
165
|
-
width += widthExtra;
|
|
166
|
-
unmatchedStart = indexPrev;
|
|
167
|
-
unmatchedEnd = index;
|
|
168
|
-
index = indexPrev = CONTROL_RE.lastIndex;
|
|
169
|
-
continue;
|
|
134
|
+
if (index >= length) {
|
|
135
|
+
break outer;
|
|
170
136
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
if (EMOJI_RE.test(input)) {
|
|
190
|
-
if (width + EMOJI_WIDTH > truncationLimit) {
|
|
191
|
-
truncationIndex = Math.min(truncationIndex, index);
|
|
192
|
-
}
|
|
193
|
-
if (width + EMOJI_WIDTH > LIMIT) {
|
|
194
|
-
truncationEnabled = true;
|
|
195
|
-
break;
|
|
137
|
+
for (let i2 = 0, l2 = PARSE_BLOCKS.length; i2 < l2; i2++) {
|
|
138
|
+
const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i2];
|
|
139
|
+
BLOCK_RE.lastIndex = index;
|
|
140
|
+
if (BLOCK_RE.test(input)) {
|
|
141
|
+
lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
|
|
142
|
+
widthExtra = lengthExtra * BLOCK_WIDTH;
|
|
143
|
+
if (width + widthExtra > truncationLimit) {
|
|
144
|
+
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
|
|
145
|
+
}
|
|
146
|
+
if (width + widthExtra > LIMIT) {
|
|
147
|
+
truncationEnabled = true;
|
|
148
|
+
break outer;
|
|
149
|
+
}
|
|
150
|
+
width += widthExtra;
|
|
151
|
+
unmatchedStart = indexPrev;
|
|
152
|
+
unmatchedEnd = index;
|
|
153
|
+
index = indexPrev = BLOCK_RE.lastIndex;
|
|
154
|
+
continue outer;
|
|
196
155
|
}
|
|
197
|
-
width += EMOJI_WIDTH;
|
|
198
|
-
unmatchedStart = indexPrev;
|
|
199
|
-
unmatchedEnd = index;
|
|
200
|
-
index = indexPrev = EMOJI_RE.lastIndex;
|
|
201
|
-
continue;
|
|
202
156
|
}
|
|
203
157
|
index += 1;
|
|
204
158
|
}
|
|
@@ -213,10 +167,10 @@ var init_dist = __esm({
|
|
|
213
167
|
}
|
|
214
168
|
});
|
|
215
169
|
|
|
216
|
-
// node_modules/.bun/fast-string-width@
|
|
170
|
+
// node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
|
|
217
171
|
var NO_TRUNCATION2, fastStringWidth, dist_default2;
|
|
218
172
|
var init_dist2 = __esm({
|
|
219
|
-
"node_modules/.bun/fast-string-width@
|
|
173
|
+
"node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js"() {
|
|
220
174
|
init_utils2();
|
|
221
175
|
init_dist();
|
|
222
176
|
NO_TRUNCATION2 = {
|
|
@@ -231,13 +185,13 @@ var init_dist2 = __esm({
|
|
|
231
185
|
}
|
|
232
186
|
});
|
|
233
187
|
|
|
234
|
-
// node_modules/.bun/fast-wrap-ansi@0.
|
|
188
|
+
// node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js
|
|
235
189
|
function wrapAnsi(string, columns, options) {
|
|
236
190
|
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
|
|
237
191
|
}
|
|
238
192
|
var ESC, CSI, END_CODE, ANSI_ESCAPE_BELL, ANSI_CSI, ANSI_OSC, ANSI_SGR_TERMINATOR, ANSI_ESCAPE_LINK, GROUP_REGEX, getClosingCode, wrapAnsiCode, wrapAnsiHyperlink, wrapWord, stringVisibleTrimSpacesRight, exec, CRLF_OR_LF;
|
|
239
193
|
var init_main = __esm({
|
|
240
|
-
"node_modules/.bun/fast-wrap-ansi@0.
|
|
194
|
+
"node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js"() {
|
|
241
195
|
init_utils2();
|
|
242
196
|
init_dist2();
|
|
243
197
|
ESC = "\x1B";
|
|
@@ -401,16 +355,19 @@ var init_main = __esm({
|
|
|
401
355
|
}
|
|
402
356
|
const preString = rows.join("\n");
|
|
403
357
|
let inSurrogate = false;
|
|
404
|
-
for (let
|
|
405
|
-
const character = preString[
|
|
358
|
+
for (let i2 = 0; i2 < preString.length; i2++) {
|
|
359
|
+
const character = preString[i2];
|
|
406
360
|
returnValue += character;
|
|
407
361
|
if (!inSurrogate) {
|
|
408
362
|
inSurrogate = character >= "\uD800" && character <= "\uDBFF";
|
|
363
|
+
if (inSurrogate) {
|
|
364
|
+
continue;
|
|
365
|
+
}
|
|
409
366
|
} else {
|
|
410
|
-
|
|
367
|
+
inSurrogate = false;
|
|
411
368
|
}
|
|
412
369
|
if (character === ESC || character === CSI) {
|
|
413
|
-
GROUP_REGEX.lastIndex =
|
|
370
|
+
GROUP_REGEX.lastIndex = i2 + 1;
|
|
414
371
|
const groupsResult = GROUP_REGEX.exec(preString);
|
|
415
372
|
const groups = groupsResult?.groups;
|
|
416
373
|
if (groups?.code !== void 0) {
|
|
@@ -420,7 +377,7 @@ var init_main = __esm({
|
|
|
420
377
|
escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
421
378
|
}
|
|
422
379
|
}
|
|
423
|
-
if (preString[
|
|
380
|
+
if (preString[i2 + 1] === "\n") {
|
|
424
381
|
if (escapeUrl) {
|
|
425
382
|
returnValue += wrapAnsiHyperlink("");
|
|
426
383
|
}
|
|
@@ -451,7 +408,7 @@ var require_src = __commonJS({
|
|
|
451
408
|
var ESC2 = "\x1B";
|
|
452
409
|
var CSI2 = `${ESC2}[`;
|
|
453
410
|
var beep = "\x07";
|
|
454
|
-
var
|
|
411
|
+
var cursor3 = {
|
|
455
412
|
to(x, y2) {
|
|
456
413
|
if (!y2) return `${CSI2}${x + 1}G`;
|
|
457
414
|
return `${CSI2}${y2 + 1};${x + 1}H`;
|
|
@@ -480,7 +437,7 @@ var require_src = __commonJS({
|
|
|
480
437
|
up: (count = 1) => `${CSI2}S`.repeat(count),
|
|
481
438
|
down: (count = 1) => `${CSI2}T`.repeat(count)
|
|
482
439
|
};
|
|
483
|
-
var
|
|
440
|
+
var erase3 = {
|
|
484
441
|
screen: `${CSI2}2J`,
|
|
485
442
|
up: (count = 1) => `${CSI2}1J`.repeat(count),
|
|
486
443
|
down: (count = 1) => `${CSI2}J`.repeat(count),
|
|
@@ -489,89 +446,169 @@ var require_src = __commonJS({
|
|
|
489
446
|
lineStart: `${CSI2}1K`,
|
|
490
447
|
lines(count) {
|
|
491
448
|
let clear = "";
|
|
492
|
-
for (let
|
|
493
|
-
clear += this.line + (
|
|
449
|
+
for (let i2 = 0; i2 < count; i2++)
|
|
450
|
+
clear += this.line + (i2 < count - 1 ? cursor3.up() : "");
|
|
494
451
|
if (count)
|
|
495
|
-
clear +=
|
|
452
|
+
clear += cursor3.left;
|
|
496
453
|
return clear;
|
|
497
454
|
}
|
|
498
455
|
};
|
|
499
|
-
module.exports = { cursor, scroll, erase, beep };
|
|
456
|
+
module.exports = { cursor: cursor3, scroll, erase: erase3, beep };
|
|
500
457
|
}
|
|
501
458
|
});
|
|
502
459
|
|
|
503
|
-
// node_modules/.bun/@clack+core@1.
|
|
504
|
-
import { styleText
|
|
505
|
-
import { stdout
|
|
506
|
-
import * as
|
|
507
|
-
import
|
|
508
|
-
import { ReadStream
|
|
509
|
-
function
|
|
510
|
-
if (!
|
|
511
|
-
|
|
512
|
-
|
|
460
|
+
// node_modules/.bun/@clack+core@1.5.0/node_modules/@clack/core/dist/index.mjs
|
|
461
|
+
import { styleText } from "node:util";
|
|
462
|
+
import { stdout, stdin } from "node:process";
|
|
463
|
+
import * as l from "node:readline";
|
|
464
|
+
import l__default from "node:readline";
|
|
465
|
+
import { ReadStream } from "node:tty";
|
|
466
|
+
function findCursor(s, o, l2) {
|
|
467
|
+
if (!l2.some((r2) => !r2.disabled))
|
|
468
|
+
return s;
|
|
469
|
+
const t2 = s + o, n3 = Math.max(l2.length - 1, 0), e = t2 < 0 ? n3 : t2 > n3 ? 0 : t2;
|
|
470
|
+
return l2[e]?.disabled ? findCursor(e, o < 0 ? -1 : 1, l2) : e;
|
|
471
|
+
}
|
|
472
|
+
function isAccessible(n3) {
|
|
473
|
+
if (n3 !== void 0) return n3;
|
|
474
|
+
if (settings.accessible !== void 0) return settings.accessible;
|
|
475
|
+
const e = process.env.ACCESSIBLE;
|
|
476
|
+
return e !== void 0 && e !== "" && e !== "0" && e !== "false";
|
|
513
477
|
}
|
|
514
|
-
function
|
|
515
|
-
if (typeof
|
|
516
|
-
|
|
478
|
+
function isActionKey(n3, e) {
|
|
479
|
+
if (typeof n3 == "string")
|
|
480
|
+
return settings.aliases.get(n3) === e;
|
|
481
|
+
for (const s of n3)
|
|
482
|
+
if (s !== void 0 && isActionKey(s, e))
|
|
483
|
+
return true;
|
|
517
484
|
return false;
|
|
518
485
|
}
|
|
519
|
-
function
|
|
520
|
-
if (
|
|
521
|
-
const e =
|
|
522
|
-
`),
|
|
523
|
-
`),
|
|
524
|
-
for (let
|
|
525
|
-
|
|
486
|
+
function diffLines(i2, s) {
|
|
487
|
+
if (i2 === s) return;
|
|
488
|
+
const e = i2.split(`
|
|
489
|
+
`), t2 = s.split(`
|
|
490
|
+
`), r2 = Math.max(e.length, t2.length), f = [];
|
|
491
|
+
for (let n3 = 0; n3 < r2; n3++)
|
|
492
|
+
e[n3] !== t2[n3] && f.push(n3);
|
|
493
|
+
return {
|
|
494
|
+
lines: f,
|
|
495
|
+
numLinesBefore: e.length,
|
|
496
|
+
numLinesAfter: t2.length,
|
|
497
|
+
numLines: r2
|
|
498
|
+
};
|
|
526
499
|
}
|
|
527
|
-
function
|
|
528
|
-
return
|
|
500
|
+
function isCancel(e) {
|
|
501
|
+
return e === CANCEL_SYMBOL;
|
|
529
502
|
}
|
|
530
|
-
function
|
|
531
|
-
const
|
|
532
|
-
|
|
503
|
+
function setRawMode(e, r2) {
|
|
504
|
+
const o = e;
|
|
505
|
+
o.isTTY && o.setRawMode(r2);
|
|
533
506
|
}
|
|
534
|
-
function
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
507
|
+
function block({
|
|
508
|
+
input: e = stdin,
|
|
509
|
+
output: r2 = stdout,
|
|
510
|
+
overwrite: o = true,
|
|
511
|
+
hideCursor: n3 = true
|
|
512
|
+
} = {}) {
|
|
513
|
+
const s = l.createInterface({
|
|
514
|
+
input: e,
|
|
515
|
+
output: r2,
|
|
516
|
+
prompt: "",
|
|
517
|
+
tabSize: 1
|
|
518
|
+
});
|
|
519
|
+
l.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(true);
|
|
520
|
+
const t2 = (f, { name: a2, sequence: w }) => {
|
|
521
|
+
const c2 = String(f);
|
|
522
|
+
if (isActionKey([c2, a2, w], "cancel")) {
|
|
523
|
+
n3 && r2.write(import_sisteransi.cursor.show), process.exit(0);
|
|
541
524
|
return;
|
|
542
525
|
}
|
|
543
|
-
if (!
|
|
544
|
-
const
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
526
|
+
if (!o) return;
|
|
527
|
+
const i2 = a2 === "return" ? 0 : -1, m = a2 === "return" ? -1 : 0;
|
|
528
|
+
l.moveCursor(r2, i2, m, () => {
|
|
529
|
+
l.clearLine(r2, 1, () => {
|
|
530
|
+
e.once("keypress", t2);
|
|
548
531
|
});
|
|
549
532
|
});
|
|
550
533
|
};
|
|
551
|
-
return
|
|
552
|
-
|
|
534
|
+
return n3 && r2.write(import_sisteransi.cursor.hide), e.once("keypress", t2), () => {
|
|
535
|
+
e.off("keypress", t2), n3 && r2.write(import_sisteransi.cursor.show), e instanceof ReadStream && e.isTTY && !R && e.setRawMode(false), s.terminal = false, s.close();
|
|
553
536
|
};
|
|
554
537
|
}
|
|
555
|
-
function
|
|
556
|
-
const
|
|
557
|
-
return wrapAnsi(
|
|
558
|
-
|
|
538
|
+
function wrapTextWithPrefix(e, r2, o, n3 = o, s = o, t2) {
|
|
539
|
+
const f = getColumns(e ?? stdout);
|
|
540
|
+
return wrapAnsi(r2, f - o.length, {
|
|
541
|
+
hard: true,
|
|
542
|
+
trim: false
|
|
543
|
+
}).split(`
|
|
544
|
+
`).map((c2, i2, m) => {
|
|
545
|
+
const d = t2 ? t2(c2, i2) : c2;
|
|
546
|
+
return i2 === 0 ? `${n3}${d}` : i2 === m.length - 1 ? `${s}${d}` : `${o}${d}`;
|
|
547
|
+
}).join(`
|
|
559
548
|
`);
|
|
560
549
|
}
|
|
561
|
-
|
|
550
|
+
function runValidation(e, a2) {
|
|
551
|
+
if ("~standard" in e) {
|
|
552
|
+
const n3 = e["~standard"].validate(a2);
|
|
553
|
+
return n3 instanceof Promise ? n3.then((r2) => r2.issues?.at(0)?.message) : n3.issues?.at(0)?.message;
|
|
554
|
+
}
|
|
555
|
+
return e(a2);
|
|
556
|
+
}
|
|
557
|
+
var import_sisteransi, a$1, t, settings, R, CANCEL_SYMBOL, getColumns, getRows, y, n$1;
|
|
562
558
|
var init_dist3 = __esm({
|
|
563
|
-
"node_modules/.bun/@clack+core@1.
|
|
559
|
+
"node_modules/.bun/@clack+core@1.5.0/node_modules/@clack/core/dist/index.mjs"() {
|
|
564
560
|
init_utils2();
|
|
565
561
|
init_main();
|
|
566
562
|
import_sisteransi = __toESM(require_src(), 1);
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
563
|
+
a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
564
|
+
t = [
|
|
565
|
+
"January",
|
|
566
|
+
"February",
|
|
567
|
+
"March",
|
|
568
|
+
"April",
|
|
569
|
+
"May",
|
|
570
|
+
"June",
|
|
571
|
+
"July",
|
|
572
|
+
"August",
|
|
573
|
+
"September",
|
|
574
|
+
"October",
|
|
575
|
+
"November",
|
|
576
|
+
"December"
|
|
577
|
+
];
|
|
578
|
+
settings = {
|
|
579
|
+
actions: new Set(a$1),
|
|
580
|
+
aliases: /* @__PURE__ */ new Map([
|
|
581
|
+
// vim support
|
|
582
|
+
["k", "up"],
|
|
583
|
+
["j", "down"],
|
|
584
|
+
["h", "left"],
|
|
585
|
+
["l", "right"],
|
|
586
|
+
["", "cancel"],
|
|
587
|
+
// opinionated defaults!
|
|
588
|
+
["escape", "cancel"]
|
|
589
|
+
]),
|
|
590
|
+
messages: {
|
|
591
|
+
cancel: "Canceled",
|
|
592
|
+
error: "Something went wrong"
|
|
593
|
+
},
|
|
594
|
+
withGuide: true,
|
|
595
|
+
accessible: void 0,
|
|
596
|
+
date: {
|
|
597
|
+
monthNames: [...t],
|
|
598
|
+
messages: {
|
|
599
|
+
required: "Please enter a valid date",
|
|
600
|
+
invalidMonth: "There are only 12 months in a year",
|
|
601
|
+
invalidDay: (n3, e) => `There are only ${n3} days in ${e}`,
|
|
602
|
+
afterMin: (n3) => `Date must be on or after ${n3.toISOString().slice(0, 10)}`,
|
|
603
|
+
beforeMax: (n3) => `Date must be on or before ${n3.toISOString().slice(0, 10)}`
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
R = globalThis.process.platform.startsWith("win");
|
|
608
|
+
CANCEL_SYMBOL = /* @__PURE__ */ Symbol("clack:cancel");
|
|
609
|
+
getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
|
|
610
|
+
getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
|
|
611
|
+
y = class {
|
|
575
612
|
input;
|
|
576
613
|
output;
|
|
577
614
|
_abortSignal;
|
|
@@ -586,46 +623,92 @@ var init_dist3 = __esm({
|
|
|
586
623
|
error = "";
|
|
587
624
|
value;
|
|
588
625
|
userInput = "";
|
|
626
|
+
/**
|
|
627
|
+
* Whether accessible (static, screen-reader friendly) output is enabled for
|
|
628
|
+
* this prompt, resolved from the `accessible` option, the global setting,
|
|
629
|
+
* and the `ACCESSIBLE` env var.
|
|
630
|
+
*/
|
|
631
|
+
get accessible() {
|
|
632
|
+
return isAccessible(this.opts.accessible);
|
|
633
|
+
}
|
|
589
634
|
constructor(t2, e = true) {
|
|
590
|
-
const { input:
|
|
591
|
-
this.opts =
|
|
635
|
+
const { input: i2 = stdin, output: s = stdout, render: r2, signal: n3, ...o } = t2;
|
|
636
|
+
this.opts = o, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = r2.bind(this), this._track = e, this._abortSignal = n3, this.input = i2, this.output = s;
|
|
592
637
|
}
|
|
638
|
+
/**
|
|
639
|
+
* Unsubscribe all listeners
|
|
640
|
+
*/
|
|
593
641
|
unsubscribe() {
|
|
594
642
|
this._subscribers.clear();
|
|
595
643
|
}
|
|
644
|
+
/**
|
|
645
|
+
* Set a subscriber with opts
|
|
646
|
+
* @param event - The event name
|
|
647
|
+
*/
|
|
596
648
|
setSubscriber(t2, e) {
|
|
597
|
-
const
|
|
598
|
-
|
|
649
|
+
const i2 = this._subscribers.get(t2) ?? [];
|
|
650
|
+
i2.push(e), this._subscribers.set(t2, i2);
|
|
599
651
|
}
|
|
652
|
+
/**
|
|
653
|
+
* Subscribe to an event
|
|
654
|
+
* @param event - The event name
|
|
655
|
+
* @param cb - The callback
|
|
656
|
+
*/
|
|
600
657
|
on(t2, e) {
|
|
601
658
|
this.setSubscriber(t2, { cb: e });
|
|
602
659
|
}
|
|
660
|
+
/**
|
|
661
|
+
* Subscribe to an event once
|
|
662
|
+
* @param event - The event name
|
|
663
|
+
* @param cb - The callback
|
|
664
|
+
*/
|
|
603
665
|
once(t2, e) {
|
|
604
666
|
this.setSubscriber(t2, { cb: e, once: true });
|
|
605
667
|
}
|
|
668
|
+
/**
|
|
669
|
+
* Emit an event with data
|
|
670
|
+
* @param event - The event name
|
|
671
|
+
* @param data - The data to pass to the callback
|
|
672
|
+
*/
|
|
606
673
|
emit(t2, ...e) {
|
|
607
|
-
const
|
|
608
|
-
for (const
|
|
609
|
-
|
|
674
|
+
const i2 = this._subscribers.get(t2) ?? [], s = [];
|
|
675
|
+
for (const r2 of i2)
|
|
676
|
+
r2.cb(...e), r2.once && s.push(() => i2.splice(i2.indexOf(r2), 1));
|
|
677
|
+
for (const r2 of s)
|
|
678
|
+
r2();
|
|
610
679
|
}
|
|
611
680
|
prompt() {
|
|
612
681
|
return new Promise((t2) => {
|
|
613
682
|
if (this._abortSignal) {
|
|
614
|
-
if (this._abortSignal.aborted)
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
683
|
+
if (this._abortSignal.aborted)
|
|
684
|
+
return this.state = "cancel", this.close(), t2(CANCEL_SYMBOL);
|
|
685
|
+
this._abortSignal.addEventListener(
|
|
686
|
+
"abort",
|
|
687
|
+
() => {
|
|
688
|
+
this.state = "cancel", this.close();
|
|
689
|
+
},
|
|
690
|
+
{ once: true }
|
|
691
|
+
);
|
|
618
692
|
}
|
|
619
|
-
this.rl =
|
|
620
|
-
|
|
693
|
+
this.rl = l__default.createInterface({
|
|
694
|
+
input: this.input,
|
|
695
|
+
tabSize: 2,
|
|
696
|
+
prompt: "",
|
|
697
|
+
escapeCodeTimeout: 50,
|
|
698
|
+
terminal: true
|
|
699
|
+
}), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), setRawMode(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
700
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(this.value);
|
|
621
701
|
}), this.once("cancel", () => {
|
|
622
|
-
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render),
|
|
702
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(CANCEL_SYMBOL);
|
|
623
703
|
});
|
|
624
704
|
});
|
|
625
705
|
}
|
|
626
706
|
_isActionKey(t2, e) {
|
|
627
707
|
return t2 === " ";
|
|
628
708
|
}
|
|
709
|
+
_shouldSubmit(t2, e) {
|
|
710
|
+
return true;
|
|
711
|
+
}
|
|
629
712
|
_setValue(t2) {
|
|
630
713
|
this.value = t2, this.emit("value", this.value);
|
|
631
714
|
}
|
|
@@ -635,19 +718,22 @@ var init_dist3 = __esm({
|
|
|
635
718
|
_clearUserInput() {
|
|
636
719
|
this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
|
|
637
720
|
}
|
|
638
|
-
onKeypress(t2, e) {
|
|
639
|
-
if (this.
|
|
640
|
-
if (this.
|
|
641
|
-
|
|
642
|
-
|
|
721
|
+
async onKeypress(t2, e) {
|
|
722
|
+
if (this.state !== "validating") {
|
|
723
|
+
if (this._track && e.name !== "return" && (e.name && this._isActionKey(t2, e) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && settings.aliases.has(e.name) && this.emit("cursor", settings.aliases.get(e.name)), settings.actions.has(e.name) && this.emit("cursor", e.name)), t2 && (t2.toLowerCase() === "y" || t2.toLowerCase() === "n") && this.emit("confirm", t2.toLowerCase() === "y"), this.emit("key", t2, e), e?.name === "return" && this._shouldSubmit(t2, e)) {
|
|
724
|
+
if (this.opts.validate) {
|
|
725
|
+
const i2 = runValidation(this.opts.validate, this.value);
|
|
726
|
+
let s;
|
|
727
|
+
i2 instanceof Promise ? (this.state = "validating", this.render(), s = await i2) : s = i2, s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
|
|
728
|
+
}
|
|
729
|
+
this.state !== "error" && (this.state = "submit");
|
|
643
730
|
}
|
|
644
|
-
this.state
|
|
731
|
+
isActionKey([t2, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
645
732
|
}
|
|
646
|
-
V([t2, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
647
733
|
}
|
|
648
734
|
close() {
|
|
649
735
|
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
650
|
-
`),
|
|
736
|
+
`), setRawMode(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
651
737
|
}
|
|
652
738
|
restoreCursor() {
|
|
653
739
|
const t2 = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
|
|
@@ -655,34 +741,39 @@ var init_dist3 = __esm({
|
|
|
655
741
|
this.output.write(import_sisteransi.cursor.move(-999, t2 * -1));
|
|
656
742
|
}
|
|
657
743
|
render() {
|
|
658
|
-
const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
|
|
744
|
+
const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
|
|
745
|
+
hard: true,
|
|
746
|
+
trim: false
|
|
747
|
+
});
|
|
659
748
|
if (t2 !== this._prevFrame) {
|
|
660
|
-
if (this.state === "initial")
|
|
749
|
+
if (this.state === "initial")
|
|
750
|
+
this.output.write(import_sisteransi.cursor.hide);
|
|
661
751
|
else {
|
|
662
|
-
const e =
|
|
752
|
+
const e = diffLines(this._prevFrame, t2), i2 = getRows(this.output);
|
|
663
753
|
if (this.restoreCursor(), e) {
|
|
664
|
-
const
|
|
665
|
-
let
|
|
666
|
-
if (
|
|
754
|
+
const s = Math.max(0, e.numLinesAfter - i2), r2 = Math.max(0, e.numLinesBefore - i2);
|
|
755
|
+
let n3 = e.lines.find((o) => o >= s);
|
|
756
|
+
if (n3 === void 0) {
|
|
667
757
|
this._prevFrame = t2;
|
|
668
758
|
return;
|
|
669
759
|
}
|
|
670
760
|
if (e.lines.length === 1) {
|
|
671
|
-
this.output.write(import_sisteransi.cursor.move(0,
|
|
672
|
-
const
|
|
761
|
+
this.output.write(import_sisteransi.cursor.move(0, n3 - r2)), this.output.write(import_sisteransi.erase.lines(1));
|
|
762
|
+
const o = t2.split(`
|
|
673
763
|
`);
|
|
674
|
-
this.output.write(
|
|
764
|
+
this.output.write(o[n3]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, o.length - n3 - 1));
|
|
675
765
|
return;
|
|
676
766
|
} else if (e.lines.length > 1) {
|
|
677
|
-
if (
|
|
767
|
+
if (s < r2)
|
|
768
|
+
n3 = s;
|
|
678
769
|
else {
|
|
679
|
-
const
|
|
680
|
-
|
|
770
|
+
const h2 = n3 - r2;
|
|
771
|
+
h2 > 0 && this.output.write(import_sisteransi.cursor.move(0, h2));
|
|
681
772
|
}
|
|
682
773
|
this.output.write(import_sisteransi.erase.down());
|
|
683
|
-
const
|
|
684
|
-
`).slice(
|
|
685
|
-
this.output.write(
|
|
774
|
+
const f = t2.split(`
|
|
775
|
+
`).slice(n3);
|
|
776
|
+
this.output.write(f.join(`
|
|
686
777
|
`)), this._prevFrame = t2;
|
|
687
778
|
return;
|
|
688
779
|
}
|
|
@@ -693,27 +784,28 @@ var init_dist3 = __esm({
|
|
|
693
784
|
}
|
|
694
785
|
}
|
|
695
786
|
};
|
|
696
|
-
|
|
787
|
+
n$1 = class n extends y {
|
|
697
788
|
options;
|
|
698
789
|
cursor = 0;
|
|
699
790
|
get _selectedValue() {
|
|
700
791
|
return this.options[this.cursor];
|
|
701
792
|
}
|
|
702
793
|
changeValue() {
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
794
|
+
const e = this._selectedValue;
|
|
795
|
+
this.value = e === void 0 ? void 0 : e.value;
|
|
796
|
+
}
|
|
797
|
+
constructor(e) {
|
|
798
|
+
super(e, false), this.options = e.options;
|
|
799
|
+
const o = this.options.findIndex(({ value: s }) => s === e.initialValue), t2 = o === -1 ? 0 : o;
|
|
800
|
+
this.cursor = this.options[t2]?.disabled ? findCursor(t2, 1, this.options) : t2, this.changeValue(), this.on("cursor", (s) => {
|
|
801
|
+
switch (s) {
|
|
710
802
|
case "left":
|
|
711
803
|
case "up":
|
|
712
|
-
this.cursor =
|
|
804
|
+
this.cursor = findCursor(this.cursor, -1, this.options);
|
|
713
805
|
break;
|
|
714
806
|
case "down":
|
|
715
807
|
case "right":
|
|
716
|
-
this.cursor =
|
|
808
|
+
this.cursor = findCursor(this.cursor, 1, this.options);
|
|
717
809
|
break;
|
|
718
810
|
}
|
|
719
811
|
this.changeValue();
|
|
@@ -723,260 +815,404 @@ var init_dist3 = __esm({
|
|
|
723
815
|
}
|
|
724
816
|
});
|
|
725
817
|
|
|
726
|
-
// node_modules/.bun/@clack+prompts@1.
|
|
727
|
-
import { styleText as
|
|
728
|
-
import
|
|
729
|
-
import { existsSync
|
|
730
|
-
import { dirname
|
|
731
|
-
function
|
|
732
|
-
|
|
818
|
+
// node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs
|
|
819
|
+
import { styleText as styleText2, stripVTControlCharacters } from "node:util";
|
|
820
|
+
import process$1 from "node:process";
|
|
821
|
+
import { existsSync, lstatSync, readdirSync } from "node:fs";
|
|
822
|
+
import { dirname, join } from "node:path";
|
|
823
|
+
function isUnicodeSupported() {
|
|
824
|
+
if (process$1.platform !== "win32") {
|
|
825
|
+
return process$1.env.TERM !== "linux";
|
|
826
|
+
}
|
|
827
|
+
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";
|
|
733
828
|
}
|
|
734
|
-
|
|
829
|
+
function formatInstructionFooter(o, e) {
|
|
830
|
+
const r2 = [`${e ? `${styleText2("cyan", S_BAR)} ` : ""}${o.join(" \u2022 ")}`];
|
|
831
|
+
return e && r2.push(styleText2("cyan", S_BAR_END)), r2;
|
|
832
|
+
}
|
|
833
|
+
var import_sisteransi2, unicode, isCI, unicodeOr, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_BAR_START, S_BAR, S_BAR_END, S_BAR_START_RIGHT, S_BAR_END_RIGHT, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, S_PASSWORD_MASK, S_BAR_H, S_CORNER_TOP_RIGHT, S_CONNECT_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_BOTTOM_LEFT, S_CORNER_TOP_LEFT, S_INFO, S_SUCCESS, S_WARN, S_ERROR, symbol, symbolBar, I, limitOptions, MULTISELECT_INSTRUCTIONS, log, cancel, W$1, C, note, W, spinner, u2, SELECT_INSTRUCTIONS, c, select, i;
|
|
735
834
|
var init_dist4 = __esm({
|
|
736
|
-
"node_modules/.bun/@clack+prompts@1.
|
|
835
|
+
"node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs"() {
|
|
737
836
|
init_utils2();
|
|
738
837
|
init_dist3();
|
|
739
838
|
init_dist3();
|
|
740
839
|
init_main();
|
|
741
840
|
init_dist2();
|
|
742
841
|
import_sisteransi2 = __toESM(require_src(), 1);
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
switch (
|
|
842
|
+
unicode = isUnicodeSupported();
|
|
843
|
+
isCI = () => process.env.CI === "true";
|
|
844
|
+
unicodeOr = (o, e) => unicode ? o : e;
|
|
845
|
+
S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
|
|
846
|
+
S_STEP_CANCEL = unicodeOr("\u25A0", "x");
|
|
847
|
+
S_STEP_ERROR = unicodeOr("\u25B2", "x");
|
|
848
|
+
S_STEP_SUBMIT = unicodeOr("\u25C7", "o");
|
|
849
|
+
S_BAR_START = unicodeOr("\u250C", "T");
|
|
850
|
+
S_BAR = unicodeOr("\u2502", "|");
|
|
851
|
+
S_BAR_END = unicodeOr("\u2514", "\u2014");
|
|
852
|
+
S_BAR_START_RIGHT = unicodeOr("\u2510", "T");
|
|
853
|
+
S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014");
|
|
854
|
+
S_RADIO_ACTIVE = unicodeOr("\u25CF", ">");
|
|
855
|
+
S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
|
|
856
|
+
S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
|
|
857
|
+
S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
|
|
858
|
+
S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
|
|
859
|
+
S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022");
|
|
860
|
+
S_BAR_H = unicodeOr("\u2500", "-");
|
|
861
|
+
S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+");
|
|
862
|
+
S_CONNECT_LEFT = unicodeOr("\u251C", "+");
|
|
863
|
+
S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+");
|
|
864
|
+
S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+");
|
|
865
|
+
S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+");
|
|
866
|
+
S_INFO = unicodeOr("\u25CF", "\u2022");
|
|
867
|
+
S_SUCCESS = unicodeOr("\u25C6", "*");
|
|
868
|
+
S_WARN = unicodeOr("\u25B2", "!");
|
|
869
|
+
S_ERROR = unicodeOr("\u25A0", "x");
|
|
870
|
+
symbol = (o) => {
|
|
871
|
+
switch (o) {
|
|
773
872
|
case "initial":
|
|
774
873
|
case "active":
|
|
775
|
-
return
|
|
874
|
+
return styleText2("cyan", S_STEP_ACTIVE);
|
|
776
875
|
case "cancel":
|
|
777
|
-
return
|
|
876
|
+
return styleText2("red", S_STEP_CANCEL);
|
|
778
877
|
case "error":
|
|
779
|
-
return
|
|
878
|
+
return styleText2("yellow", S_STEP_ERROR);
|
|
780
879
|
case "submit":
|
|
781
|
-
return
|
|
880
|
+
return styleText2("green", S_STEP_SUBMIT);
|
|
881
|
+
case "validating":
|
|
882
|
+
return styleText2("dim", S_STEP_ACTIVE);
|
|
782
883
|
}
|
|
783
884
|
};
|
|
784
|
-
|
|
785
|
-
switch (
|
|
885
|
+
symbolBar = (o) => {
|
|
886
|
+
switch (o) {
|
|
786
887
|
case "initial":
|
|
787
888
|
case "active":
|
|
788
|
-
return
|
|
889
|
+
return styleText2("cyan", S_BAR);
|
|
789
890
|
case "cancel":
|
|
790
|
-
return
|
|
891
|
+
return styleText2("red", S_BAR);
|
|
791
892
|
case "error":
|
|
792
|
-
return
|
|
893
|
+
return styleText2("yellow", S_BAR);
|
|
793
894
|
case "submit":
|
|
794
|
-
return
|
|
795
|
-
}
|
|
796
|
-
};
|
|
797
|
-
|
|
798
|
-
let
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
895
|
+
return styleText2("green", S_BAR);
|
|
896
|
+
}
|
|
897
|
+
};
|
|
898
|
+
I = (l2, e, w, p, b, C2 = false) => {
|
|
899
|
+
let r2 = e, O = 0;
|
|
900
|
+
if (C2)
|
|
901
|
+
for (let i2 = p - 1; i2 >= w; i2--) {
|
|
902
|
+
const m = l2[i2];
|
|
903
|
+
if (m && (r2 -= m.length), O++, r2 <= b) break;
|
|
904
|
+
}
|
|
905
|
+
else
|
|
906
|
+
for (let i2 = w; i2 < p; i2++) {
|
|
907
|
+
const m = l2[i2];
|
|
908
|
+
if (m && (r2 -= m.length), O++, r2 <= b) break;
|
|
909
|
+
}
|
|
910
|
+
return { lineCount: r2, removals: O };
|
|
911
|
+
};
|
|
912
|
+
limitOptions = ({
|
|
913
|
+
cursor: l2,
|
|
914
|
+
options: e,
|
|
915
|
+
style: w,
|
|
916
|
+
output: p = process.stdout,
|
|
917
|
+
maxItems: b = Number.POSITIVE_INFINITY,
|
|
918
|
+
columnPadding: C2 = 0,
|
|
919
|
+
rowPadding: r2 = 4
|
|
920
|
+
}) => {
|
|
921
|
+
const i2 = getColumns(p) - C2, m = getRows(p), M = styleText2("dim", "..."), v = Math.max(m - r2, 0), a2 = Math.max(Math.min(b, v), 5);
|
|
811
922
|
let f = 0;
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
923
|
+
l2 >= a2 - 3 && (f = Math.max(
|
|
924
|
+
Math.min(l2 - a2 + 3, e.length - a2),
|
|
925
|
+
0
|
|
926
|
+
));
|
|
927
|
+
let d = a2 < e.length && f > 0, c2 = a2 < e.length && f + a2 < e.length;
|
|
928
|
+
const W2 = Math.min(
|
|
929
|
+
f + a2,
|
|
930
|
+
e.length
|
|
931
|
+
), s = [];
|
|
932
|
+
let g = 0;
|
|
933
|
+
d && g++, c2 && g++;
|
|
934
|
+
const T = f + (d ? 1 : 0), y2 = W2 - (c2 ? 1 : 0);
|
|
935
|
+
for (let t2 = T; t2 < y2; t2++) {
|
|
936
|
+
const n3 = e[t2], o = n3 ? w(n3, t2 === l2) : "", h2 = wrapAnsi(o, i2, {
|
|
937
|
+
hard: true,
|
|
938
|
+
trim: false
|
|
939
|
+
}).split(`
|
|
816
940
|
`);
|
|
817
|
-
|
|
818
|
-
}
|
|
819
|
-
if (
|
|
820
|
-
let
|
|
821
|
-
const
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
941
|
+
s.push(h2), g += h2.length;
|
|
942
|
+
}
|
|
943
|
+
if (g > v) {
|
|
944
|
+
let t2 = 0, n3 = 0, o = g;
|
|
945
|
+
const h2 = l2 - T;
|
|
946
|
+
let u3 = v;
|
|
947
|
+
const L = () => I(s, o, 0, h2, u3), E = () => I(
|
|
948
|
+
s,
|
|
949
|
+
o,
|
|
950
|
+
h2 + 1,
|
|
951
|
+
s.length,
|
|
952
|
+
u3,
|
|
953
|
+
true
|
|
954
|
+
);
|
|
955
|
+
d ? ({ lineCount: o, removals: t2 } = L(), o > u3 && (c2 || (u3 -= 1), { lineCount: o, removals: n3 } = E())) : (c2 || (u3 -= 1), { lineCount: o, removals: n3 } = E(), o > u3 && (u3 -= 1, { lineCount: o, removals: t2 } = L())), t2 > 0 && (d = true, s.splice(0, t2)), n3 > 0 && (c2 = true, s.splice(s.length - n3, n3));
|
|
956
|
+
}
|
|
957
|
+
const x = [];
|
|
958
|
+
d && x.push(M);
|
|
959
|
+
for (const t2 of s)
|
|
960
|
+
for (const n3 of t2)
|
|
961
|
+
x.push(n3);
|
|
962
|
+
return c2 && x.push(M), x;
|
|
963
|
+
};
|
|
964
|
+
MULTISELECT_INSTRUCTIONS = [
|
|
965
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
966
|
+
`${styleText2("dim", "Space:")} select`,
|
|
967
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
968
|
+
];
|
|
969
|
+
log = {
|
|
970
|
+
message: (s = [], {
|
|
971
|
+
symbol: e = styleText2("gray", S_BAR),
|
|
972
|
+
secondarySymbol: r2 = styleText2("gray", S_BAR),
|
|
973
|
+
output: m = process.stdout,
|
|
974
|
+
spacing: l2 = 1,
|
|
975
|
+
withGuide: c2
|
|
976
|
+
} = {}) => {
|
|
977
|
+
const t2 = [], o = c2 ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
|
|
978
|
+
for (let i2 = 0; i2 < l2; i2++)
|
|
979
|
+
t2.push(f);
|
|
980
|
+
const g = Array.isArray(s) ? s : s.split(`
|
|
833
981
|
`);
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
982
|
+
if (g.length > 0) {
|
|
983
|
+
const [i2, ...y2] = g;
|
|
984
|
+
i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
|
|
985
|
+
for (const p of y2)
|
|
986
|
+
p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
|
|
987
|
+
}
|
|
988
|
+
m.write(`${t2.join(`
|
|
840
989
|
`)}
|
|
841
990
|
`);
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
991
|
+
},
|
|
992
|
+
info: (s, e) => {
|
|
993
|
+
log.message(s, { ...e, symbol: styleText2("blue", S_INFO) });
|
|
994
|
+
},
|
|
995
|
+
success: (s, e) => {
|
|
996
|
+
log.message(s, { ...e, symbol: styleText2("green", S_SUCCESS) });
|
|
997
|
+
},
|
|
998
|
+
step: (s, e) => {
|
|
999
|
+
log.message(s, { ...e, symbol: styleText2("green", S_STEP_SUBMIT) });
|
|
1000
|
+
},
|
|
1001
|
+
warn: (s, e) => {
|
|
1002
|
+
log.message(s, { ...e, symbol: styleText2("yellow", S_WARN) });
|
|
1003
|
+
},
|
|
1004
|
+
/** alias for `log.warn()`. */
|
|
1005
|
+
warning: (s, e) => {
|
|
1006
|
+
log.warn(s, e);
|
|
1007
|
+
},
|
|
1008
|
+
error: (s, e) => {
|
|
1009
|
+
log.message(s, { ...e, symbol: styleText2("red", S_ERROR) });
|
|
1010
|
+
}
|
|
1011
|
+
};
|
|
1012
|
+
cancel = (o = "", t2) => {
|
|
1013
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_END)} ` : "";
|
|
1014
|
+
i2.write(`${e}${styleText2("red", o)}
|
|
858
1015
|
|
|
859
1016
|
`);
|
|
860
1017
|
};
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
const
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
1018
|
+
W$1 = (o) => o;
|
|
1019
|
+
C = (o, e, s) => {
|
|
1020
|
+
const a2 = {
|
|
1021
|
+
hard: true,
|
|
1022
|
+
trim: false
|
|
1023
|
+
}, i2 = wrapAnsi(o, e, a2).split(`
|
|
1024
|
+
`), c2 = i2.reduce((n3, t2) => Math.max(dist_default2(t2), n3), 0), u3 = i2.map(s).reduce((n3, t2) => Math.max(dist_default2(t2), n3), 0), g = e - (u3 - c2);
|
|
1025
|
+
return wrapAnsi(o, g, a2);
|
|
1026
|
+
};
|
|
1027
|
+
note = (o = "", e = "", s) => {
|
|
1028
|
+
const a2 = s?.output ?? process$1.stdout, i2 = s?.withGuide ?? settings.withGuide, c2 = s?.format ?? W$1, g = ["", ...C(o, getColumns(a2) - 6, c2).split(`
|
|
1029
|
+
`).map(c2), ""], n3 = dist_default2(e), t2 = Math.max(
|
|
1030
|
+
g.reduce((m, F) => {
|
|
1031
|
+
const O = dist_default2(F);
|
|
1032
|
+
return O > m ? O : m;
|
|
1033
|
+
}, 0),
|
|
1034
|
+
n3
|
|
1035
|
+
) + 2, h2 = g.map(
|
|
1036
|
+
(m) => `${styleText2("gray", S_BAR)} ${m}${" ".repeat(t2 - dist_default2(m))}${styleText2("gray", S_BAR)}`
|
|
1037
|
+
).join(`
|
|
1038
|
+
`), T = i2 ? `${styleText2("gray", S_BAR)}
|
|
1039
|
+
` : "", l$1 = i2 ? S_CONNECT_LEFT : S_CORNER_BOTTOM_LEFT;
|
|
1040
|
+
a2.write(
|
|
1041
|
+
`${T}${styleText2("green", S_STEP_SUBMIT)} ${styleText2("reset", e)} ${styleText2(
|
|
1042
|
+
"gray",
|
|
1043
|
+
S_BAR_H.repeat(Math.max(t2 - n3 - 1, 1)) + S_CORNER_TOP_RIGHT
|
|
1044
|
+
)}
|
|
1045
|
+
${h2}
|
|
1046
|
+
${styleText2("gray", l$1 + S_BAR_H.repeat(t2 + 2) + S_CORNER_BOTTOM_RIGHT)}
|
|
1047
|
+
`
|
|
1048
|
+
);
|
|
879
1049
|
};
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
1050
|
+
W = (l2) => styleText2("magenta", l2);
|
|
1051
|
+
spinner = ({
|
|
1052
|
+
indicator: l2 = "dots",
|
|
1053
|
+
onCancel: h2,
|
|
1054
|
+
output: n3 = process.stdout,
|
|
1055
|
+
cancelMessage: G,
|
|
1056
|
+
errorMessage: O,
|
|
1057
|
+
frames: E = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
|
|
1058
|
+
delay: F = unicode ? 80 : 120,
|
|
1059
|
+
signal: m,
|
|
1060
|
+
...I2
|
|
1061
|
+
} = {}) => {
|
|
1062
|
+
const u3 = isCI();
|
|
1063
|
+
let M, T, d = false, S = false, s = "", p, w = performance.now();
|
|
1064
|
+
const x = getColumns(n3), k = I2?.styleFrame ?? W, g = (e) => {
|
|
1065
|
+
const r2 = e > 1 ? O ?? settings.messages.error : G ?? settings.messages.cancel;
|
|
1066
|
+
S = e === 1, d && (a2(r2, e), S && typeof h2 == "function" && h2());
|
|
1067
|
+
}, f = () => g(2), i2 = () => g(1), A = () => {
|
|
1068
|
+
process.on("uncaughtExceptionMonitor", f), process.on("unhandledRejection", f), process.on("SIGINT", i2), process.on("SIGTERM", i2), process.on("exit", g), m && m.addEventListener("abort", i2);
|
|
1069
|
+
}, H = () => {
|
|
1070
|
+
process.removeListener("uncaughtExceptionMonitor", f), process.removeListener("unhandledRejection", f), process.removeListener("SIGINT", i2), process.removeListener("SIGTERM", i2), process.removeListener("exit", g), m && m.removeEventListener("abort", i2);
|
|
1071
|
+
}, y2 = () => {
|
|
1072
|
+
if (p === void 0) return;
|
|
1073
|
+
u3 && n3.write(`
|
|
894
1074
|
`);
|
|
895
|
-
const
|
|
1075
|
+
const r2 = wrapAnsi(p, x, {
|
|
1076
|
+
hard: true,
|
|
1077
|
+
trim: false
|
|
1078
|
+
}).split(`
|
|
896
1079
|
`);
|
|
897
|
-
|
|
898
|
-
},
|
|
899
|
-
const
|
|
900
|
-
return
|
|
901
|
-
},
|
|
902
|
-
|
|
1080
|
+
r2.length > 1 && n3.write(import_sisteransi2.cursor.up(r2.length - 1)), n3.write(import_sisteransi2.cursor.to(0)), n3.write(import_sisteransi2.erase.down());
|
|
1081
|
+
}, C2 = (e) => e.replace(/\.+$/, ""), _ = (e) => {
|
|
1082
|
+
const r2 = (performance.now() - e) / 1e3, t2 = Math.floor(r2 / 60), o = Math.floor(r2 % 60);
|
|
1083
|
+
return t2 > 0 ? `[${t2}m ${o}s]` : `[${o}s]`;
|
|
1084
|
+
}, N = I2.withGuide ?? settings.withGuide, P = (e = "") => {
|
|
1085
|
+
d = true, M = block({ output: n3 }), s = C2(e), w = performance.now(), N && n3.write(`${styleText2("gray", S_BAR)}
|
|
903
1086
|
`);
|
|
904
|
-
let
|
|
905
|
-
|
|
906
|
-
if (
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
1087
|
+
let r2 = 0, t2 = 0;
|
|
1088
|
+
A(), T = setInterval(() => {
|
|
1089
|
+
if (u3 && s === p)
|
|
1090
|
+
return;
|
|
1091
|
+
y2(), p = s;
|
|
1092
|
+
const o = k(E[r2]);
|
|
1093
|
+
let v;
|
|
1094
|
+
if (u3)
|
|
1095
|
+
v = `${o} ${s}...`;
|
|
1096
|
+
else if (l2 === "timer")
|
|
1097
|
+
v = `${o} ${s} ${_(w)}`;
|
|
912
1098
|
else {
|
|
913
|
-
const
|
|
914
|
-
|
|
915
|
-
}
|
|
916
|
-
const
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
1099
|
+
const B = ".".repeat(Math.floor(t2)).slice(0, 3);
|
|
1100
|
+
v = `${o} ${s}${B}`;
|
|
1101
|
+
}
|
|
1102
|
+
const j = wrapAnsi(v, x, {
|
|
1103
|
+
hard: true,
|
|
1104
|
+
trim: false
|
|
1105
|
+
});
|
|
1106
|
+
n3.write(j), r2 = r2 + 1 < E.length ? r2 + 1 : 0, t2 = t2 < 4 ? t2 + 0.125 : 0;
|
|
1107
|
+
}, F);
|
|
1108
|
+
}, a2 = (e = "", r2 = 0, t2 = false) => {
|
|
1109
|
+
if (!d) return;
|
|
1110
|
+
d = false, clearInterval(T), y2();
|
|
1111
|
+
const o = r2 === 0 ? styleText2("green", S_STEP_SUBMIT) : r2 === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
|
|
1112
|
+
s = e ?? s, t2 || (l2 === "timer" ? n3.write(`${o} ${s} ${_(w)}
|
|
1113
|
+
`) : n3.write(`${o} ${s}
|
|
1114
|
+
`)), H(), M();
|
|
926
1115
|
};
|
|
927
|
-
return {
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
1116
|
+
return {
|
|
1117
|
+
start: P,
|
|
1118
|
+
stop: (e = "") => a2(e, 0),
|
|
1119
|
+
message: (e = "") => {
|
|
1120
|
+
s = C2(e ?? s);
|
|
1121
|
+
},
|
|
1122
|
+
cancel: (e = "") => a2(e, 1),
|
|
1123
|
+
error: (e = "") => a2(e, 2),
|
|
1124
|
+
clear: () => a2("", 0, true),
|
|
1125
|
+
get isCancelled() {
|
|
1126
|
+
return S;
|
|
1127
|
+
}
|
|
1128
|
+
};
|
|
1129
|
+
};
|
|
1130
|
+
u2 = {
|
|
1131
|
+
light: unicodeOr("\u2500", "-"),
|
|
1132
|
+
heavy: unicodeOr("\u2501", "="),
|
|
1133
|
+
block: unicodeOr("\u2588", "#")
|
|
1134
|
+
};
|
|
1135
|
+
SELECT_INSTRUCTIONS = [
|
|
1136
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
1137
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
1138
|
+
];
|
|
1139
|
+
c = (t2, o) => t2.includes(`
|
|
1140
|
+
`) ? t2.split(`
|
|
1141
|
+
`).map((d) => o(d)).join(`
|
|
1142
|
+
`) : o(t2);
|
|
1143
|
+
select = (t2) => {
|
|
1144
|
+
const o = (n3, m) => {
|
|
1145
|
+
if (n3 === void 0)
|
|
1146
|
+
return "";
|
|
1147
|
+
const s = n3.label ?? String(n3.value);
|
|
1148
|
+
switch (m) {
|
|
942
1149
|
case "disabled":
|
|
943
|
-
return `${
|
|
1150
|
+
return `${styleText2("gray", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("gray", i2))}${n3.hint ? ` ${styleText2("dim", `(${n3.hint ?? "disabled"})`)}` : ""}`;
|
|
944
1151
|
case "selected":
|
|
945
|
-
return `${
|
|
1152
|
+
return `${c(s, (i2) => styleText2("dim", i2))}`;
|
|
946
1153
|
case "active":
|
|
947
|
-
return `${
|
|
1154
|
+
return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${n3.hint ? ` ${styleText2("dim", `(${n3.hint})`)}` : ""}`;
|
|
948
1155
|
case "cancelled":
|
|
949
|
-
return `${
|
|
1156
|
+
return `${c(s, (i2) => styleText2(["strikethrough", "dim"], i2))}`;
|
|
950
1157
|
default:
|
|
951
|
-
return `${
|
|
952
|
-
}
|
|
953
|
-
};
|
|
954
|
-
return new
|
|
955
|
-
|
|
956
|
-
|
|
1158
|
+
return `${styleText2("dim", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("dim", i2))}`;
|
|
1159
|
+
}
|
|
1160
|
+
}, d = t2.showInstructions ?? true;
|
|
1161
|
+
return new n$1({
|
|
1162
|
+
options: t2.options,
|
|
1163
|
+
signal: t2.signal,
|
|
1164
|
+
input: t2.input,
|
|
1165
|
+
output: t2.output,
|
|
1166
|
+
initialValue: t2.initialValue,
|
|
1167
|
+
render() {
|
|
1168
|
+
const n3 = t2.withGuide ?? settings.withGuide, m = `${symbol(this.state)} `, s = `${symbolBar(this.state)} `, i2 = wrapTextWithPrefix(
|
|
1169
|
+
t2.output,
|
|
1170
|
+
t2.message,
|
|
1171
|
+
s,
|
|
1172
|
+
m
|
|
1173
|
+
), u3 = `${n3 ? `${styleText2("gray", S_BAR)}
|
|
1174
|
+
` : ""}${i2}
|
|
957
1175
|
`;
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
${
|
|
1176
|
+
switch (this.state) {
|
|
1177
|
+
case "submit": {
|
|
1178
|
+
const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
|
|
1179
|
+
t2.output,
|
|
1180
|
+
o(this.options[this.cursor], "selected"),
|
|
1181
|
+
r2
|
|
1182
|
+
);
|
|
1183
|
+
return `${u3}${a2}`;
|
|
1184
|
+
}
|
|
1185
|
+
case "cancel": {
|
|
1186
|
+
const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
|
|
1187
|
+
t2.output,
|
|
1188
|
+
o(this.options[this.cursor], "cancelled"),
|
|
1189
|
+
r2
|
|
1190
|
+
);
|
|
1191
|
+
return `${u3}${a2}${n3 ? `
|
|
1192
|
+
${styleText2("gray", S_BAR)}` : ""}`;
|
|
1193
|
+
}
|
|
1194
|
+
default: {
|
|
1195
|
+
const r2 = n3 ? `${styleText2("cyan", S_BAR)} ` : "", a2 = u3.split(`
|
|
1196
|
+
`).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], b = p.join(`
|
|
1197
|
+
`), f = p.length + 1;
|
|
1198
|
+
return `${u3}${r2}${limitOptions({
|
|
1199
|
+
output: t2.output,
|
|
1200
|
+
cursor: this.cursor,
|
|
1201
|
+
options: this.options,
|
|
1202
|
+
maxItems: t2.maxItems,
|
|
1203
|
+
columnPadding: r2.length,
|
|
1204
|
+
rowPadding: a2 + f,
|
|
1205
|
+
style: (g, x) => o(g, g.disabled ? "disabled" : x ? "active" : "inactive")
|
|
1206
|
+
}).join(`
|
|
1207
|
+
${r2}`)}
|
|
1208
|
+
${b}
|
|
974
1209
|
`;
|
|
1210
|
+
}
|
|
975
1211
|
}
|
|
976
1212
|
}
|
|
977
|
-
}
|
|
1213
|
+
}).prompt();
|
|
978
1214
|
};
|
|
979
|
-
|
|
1215
|
+
i = `${styleText2("gray", S_BAR)} `;
|
|
980
1216
|
}
|
|
981
1217
|
});
|
|
982
1218
|
|
|
@@ -989,9 +1225,9 @@ function supportsColor() {
|
|
|
989
1225
|
}
|
|
990
1226
|
return process.stdout.isTTY === true;
|
|
991
1227
|
}
|
|
992
|
-
function colorize(
|
|
993
|
-
if (!supportsColor()) return
|
|
994
|
-
return `${color}${
|
|
1228
|
+
function colorize(text2, color) {
|
|
1229
|
+
if (!supportsColor()) return text2;
|
|
1230
|
+
return `${color}${text2}${colors.reset}`;
|
|
995
1231
|
}
|
|
996
1232
|
function stringify(value) {
|
|
997
1233
|
if (typeof value === "string") return value;
|
|
@@ -1021,7 +1257,7 @@ function stringify(value) {
|
|
|
1021
1257
|
function formatMessage(...args) {
|
|
1022
1258
|
return args.map(stringify).join(" ");
|
|
1023
1259
|
}
|
|
1024
|
-
var colors, currentLogLevel,
|
|
1260
|
+
var colors, currentLogLevel, log2, error, warn, info, success;
|
|
1025
1261
|
var init_cli_output = __esm({
|
|
1026
1262
|
"packages/tooling/src/utils/cli-output.ts"() {
|
|
1027
1263
|
"use strict";
|
|
@@ -1054,7 +1290,7 @@ var init_cli_output = __esm({
|
|
|
1054
1290
|
currentLogLevel = envLevel;
|
|
1055
1291
|
}
|
|
1056
1292
|
}
|
|
1057
|
-
|
|
1293
|
+
log2 = {
|
|
1058
1294
|
/**
|
|
1059
1295
|
* Logs an error message (always shows unless Quiet level)
|
|
1060
1296
|
* Uses clack's log.error + explicit red color
|
|
@@ -1062,7 +1298,7 @@ var init_cli_output = __esm({
|
|
|
1062
1298
|
error(...args) {
|
|
1063
1299
|
if (currentLogLevel < 0 /* Quiet */) return;
|
|
1064
1300
|
const message = formatMessage(...args);
|
|
1065
|
-
|
|
1301
|
+
log.error(colorize(message, colors.brightRed));
|
|
1066
1302
|
},
|
|
1067
1303
|
/**
|
|
1068
1304
|
* Logs a warning message (shows at Normal level and above)
|
|
@@ -1071,7 +1307,7 @@ var init_cli_output = __esm({
|
|
|
1071
1307
|
warn(...args) {
|
|
1072
1308
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
1073
1309
|
const message = formatMessage(...args);
|
|
1074
|
-
|
|
1310
|
+
log.warn(colorize(message, colors.brightYellow));
|
|
1075
1311
|
},
|
|
1076
1312
|
/**
|
|
1077
1313
|
* Logs an info message (shows at Normal level and above)
|
|
@@ -1080,7 +1316,7 @@ var init_cli_output = __esm({
|
|
|
1080
1316
|
info(...args) {
|
|
1081
1317
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
1082
1318
|
const message = formatMessage(...args);
|
|
1083
|
-
|
|
1319
|
+
log.info(colorize(message, colors.brightCyan));
|
|
1084
1320
|
},
|
|
1085
1321
|
/**
|
|
1086
1322
|
* Logs a success message (shows at Normal level and above)
|
|
@@ -1089,7 +1325,7 @@ var init_cli_output = __esm({
|
|
|
1089
1325
|
success(...args) {
|
|
1090
1326
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
1091
1327
|
const message = formatMessage(...args);
|
|
1092
|
-
|
|
1328
|
+
log.success(colorize(message, colors.brightGreen));
|
|
1093
1329
|
},
|
|
1094
1330
|
/**
|
|
1095
1331
|
* Logs a debug message (only shows at Verbose level and above)
|
|
@@ -1098,7 +1334,7 @@ var init_cli_output = __esm({
|
|
|
1098
1334
|
debug(...args) {
|
|
1099
1335
|
if (currentLogLevel < 2 /* Verbose */) return;
|
|
1100
1336
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
1101
|
-
|
|
1337
|
+
log.message(
|
|
1102
1338
|
colorize(
|
|
1103
1339
|
`[${timeStamp}] \u{1F50D} DEBUG: ${formatMessage(...args)}`,
|
|
1104
1340
|
colors.gray
|
|
@@ -1112,7 +1348,7 @@ var init_cli_output = __esm({
|
|
|
1112
1348
|
trace(...args) {
|
|
1113
1349
|
if (currentLogLevel < 3 /* Debug */) return;
|
|
1114
1350
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
1115
|
-
|
|
1351
|
+
log.message(
|
|
1116
1352
|
colorize(
|
|
1117
1353
|
`[${timeStamp}] \u{1F52C} TRACE: ${formatMessage(...args)}`,
|
|
1118
1354
|
colors.gray
|
|
@@ -1120,10 +1356,10 @@ var init_cli_output = __esm({
|
|
|
1120
1356
|
);
|
|
1121
1357
|
}
|
|
1122
1358
|
};
|
|
1123
|
-
error =
|
|
1124
|
-
warn =
|
|
1125
|
-
info =
|
|
1126
|
-
success =
|
|
1359
|
+
error = log2.error.bind(log2);
|
|
1360
|
+
warn = log2.warn.bind(log2);
|
|
1361
|
+
info = log2.info.bind(log2);
|
|
1362
|
+
success = log2.success.bind(log2);
|
|
1127
1363
|
}
|
|
1128
1364
|
});
|
|
1129
1365
|
|
|
@@ -1483,9 +1719,9 @@ var require_is_glob = __commonJS({
|
|
|
1483
1719
|
index += 2;
|
|
1484
1720
|
var close = chars[open];
|
|
1485
1721
|
if (close) {
|
|
1486
|
-
var
|
|
1487
|
-
if (
|
|
1488
|
-
index =
|
|
1722
|
+
var n3 = str.indexOf(close, index);
|
|
1723
|
+
if (n3 !== -1) {
|
|
1724
|
+
index = n3 + 1;
|
|
1489
1725
|
}
|
|
1490
1726
|
}
|
|
1491
1727
|
if (str[index] === "!") {
|
|
@@ -1511,9 +1747,9 @@ var require_is_glob = __commonJS({
|
|
|
1511
1747
|
index += 2;
|
|
1512
1748
|
var close = chars[open];
|
|
1513
1749
|
if (close) {
|
|
1514
|
-
var
|
|
1515
|
-
if (
|
|
1516
|
-
index =
|
|
1750
|
+
var n3 = str.indexOf(close, index);
|
|
1751
|
+
if (n3 !== -1) {
|
|
1752
|
+
index = n3 + 1;
|
|
1517
1753
|
}
|
|
1518
1754
|
}
|
|
1519
1755
|
if (str[index] === "!") {
|
|
@@ -1591,8 +1827,8 @@ var require_utils = __commonJS({
|
|
|
1591
1827
|
if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
|
|
1592
1828
|
return (Number(max) - Number(min)) / Number(step) >= limit;
|
|
1593
1829
|
};
|
|
1594
|
-
exports.escapeNode = (
|
|
1595
|
-
const node =
|
|
1830
|
+
exports.escapeNode = (block2, n3 = 0, type) => {
|
|
1831
|
+
const node = block2.nodes[n3];
|
|
1596
1832
|
if (!node) return;
|
|
1597
1833
|
if (type && node.type === type || node.type === "open" || node.type === "close") {
|
|
1598
1834
|
if (node.escaped !== true) {
|
|
@@ -1609,15 +1845,15 @@ var require_utils = __commonJS({
|
|
|
1609
1845
|
}
|
|
1610
1846
|
return false;
|
|
1611
1847
|
};
|
|
1612
|
-
exports.isInvalidBrace = (
|
|
1613
|
-
if (
|
|
1614
|
-
if (
|
|
1615
|
-
if (
|
|
1616
|
-
|
|
1848
|
+
exports.isInvalidBrace = (block2) => {
|
|
1849
|
+
if (block2.type !== "brace") return false;
|
|
1850
|
+
if (block2.invalid === true || block2.dollar) return true;
|
|
1851
|
+
if (block2.commas >> 0 + block2.ranges >> 0 === 0) {
|
|
1852
|
+
block2.invalid = true;
|
|
1617
1853
|
return true;
|
|
1618
1854
|
}
|
|
1619
|
-
if (
|
|
1620
|
-
|
|
1855
|
+
if (block2.open !== true || block2.close !== true) {
|
|
1856
|
+
block2.invalid = true;
|
|
1621
1857
|
return true;
|
|
1622
1858
|
}
|
|
1623
1859
|
return false;
|
|
@@ -1636,8 +1872,8 @@ var require_utils = __commonJS({
|
|
|
1636
1872
|
exports.flatten = (...args) => {
|
|
1637
1873
|
const result = [];
|
|
1638
1874
|
const flat = (arr) => {
|
|
1639
|
-
for (let
|
|
1640
|
-
const ele = arr[
|
|
1875
|
+
for (let i2 = 0; i2 < arr.length; i2++) {
|
|
1876
|
+
const ele = arr[i2];
|
|
1641
1877
|
if (Array.isArray(ele)) {
|
|
1642
1878
|
flat(ele);
|
|
1643
1879
|
continue;
|
|
@@ -1731,9 +1967,9 @@ var require_to_regex_range = __commonJS({
|
|
|
1731
1967
|
if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
|
|
1732
1968
|
return toRegexRange.cache[cacheKey].result;
|
|
1733
1969
|
}
|
|
1734
|
-
let
|
|
1970
|
+
let a2 = Math.min(min, max);
|
|
1735
1971
|
let b = Math.max(min, max);
|
|
1736
|
-
if (Math.abs(
|
|
1972
|
+
if (Math.abs(a2 - b) === 1) {
|
|
1737
1973
|
let result = min + "|" + max;
|
|
1738
1974
|
if (opts.capture) {
|
|
1739
1975
|
return `(${result})`;
|
|
@@ -1744,20 +1980,20 @@ var require_to_regex_range = __commonJS({
|
|
|
1744
1980
|
return `(?:${result})`;
|
|
1745
1981
|
}
|
|
1746
1982
|
let isPadded = hasPadding(min) || hasPadding(max);
|
|
1747
|
-
let state = { min, max, a, b };
|
|
1983
|
+
let state = { min, max, a: a2, b };
|
|
1748
1984
|
let positives = [];
|
|
1749
1985
|
let negatives = [];
|
|
1750
1986
|
if (isPadded) {
|
|
1751
1987
|
state.isPadded = isPadded;
|
|
1752
1988
|
state.maxLen = String(state.max).length;
|
|
1753
1989
|
}
|
|
1754
|
-
if (
|
|
1990
|
+
if (a2 < 0) {
|
|
1755
1991
|
let newMin = b < 0 ? Math.abs(b) : 1;
|
|
1756
|
-
negatives = splitToPatterns(newMin, Math.abs(
|
|
1757
|
-
|
|
1992
|
+
negatives = splitToPatterns(newMin, Math.abs(a2), state, opts);
|
|
1993
|
+
a2 = state.a = 0;
|
|
1758
1994
|
}
|
|
1759
1995
|
if (b >= 0) {
|
|
1760
|
-
positives = splitToPatterns(
|
|
1996
|
+
positives = splitToPatterns(a2, b, state, opts);
|
|
1761
1997
|
}
|
|
1762
1998
|
state.negatives = negatives;
|
|
1763
1999
|
state.positives = positives;
|
|
@@ -1805,8 +2041,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1805
2041
|
let digits = zipped.length;
|
|
1806
2042
|
let pattern = "";
|
|
1807
2043
|
let count = 0;
|
|
1808
|
-
for (let
|
|
1809
|
-
let [startDigit, stopDigit] = zipped[
|
|
2044
|
+
for (let i2 = 0; i2 < digits; i2++) {
|
|
2045
|
+
let [startDigit, stopDigit] = zipped[i2];
|
|
1810
2046
|
if (startDigit === stopDigit) {
|
|
1811
2047
|
pattern += startDigit;
|
|
1812
2048
|
} else if (startDigit !== "0" || stopDigit !== "9") {
|
|
@@ -1825,8 +2061,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1825
2061
|
let tokens = [];
|
|
1826
2062
|
let start = min;
|
|
1827
2063
|
let prev;
|
|
1828
|
-
for (let
|
|
1829
|
-
let max2 = ranges[
|
|
2064
|
+
for (let i2 = 0; i2 < ranges.length; i2++) {
|
|
2065
|
+
let max2 = ranges[i2];
|
|
1830
2066
|
let obj = rangeToPattern(String(start), String(max2), options);
|
|
1831
2067
|
let zeros = "";
|
|
1832
2068
|
if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
|
|
@@ -1861,13 +2097,13 @@ var require_to_regex_range = __commonJS({
|
|
|
1861
2097
|
}
|
|
1862
2098
|
return result;
|
|
1863
2099
|
}
|
|
1864
|
-
function zip(
|
|
2100
|
+
function zip(a2, b) {
|
|
1865
2101
|
let arr = [];
|
|
1866
|
-
for (let
|
|
2102
|
+
for (let i2 = 0; i2 < a2.length; i2++) arr.push([a2[i2], b[i2]]);
|
|
1867
2103
|
return arr;
|
|
1868
2104
|
}
|
|
1869
|
-
function compare(
|
|
1870
|
-
return
|
|
2105
|
+
function compare(a2, b) {
|
|
2106
|
+
return a2 > b ? 1 : b > a2 ? -1 : 0;
|
|
1871
2107
|
}
|
|
1872
2108
|
function contains(arr, key, val) {
|
|
1873
2109
|
return arr.some((ele) => ele[key] === val);
|
|
@@ -1885,8 +2121,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1885
2121
|
}
|
|
1886
2122
|
return "";
|
|
1887
2123
|
}
|
|
1888
|
-
function toCharacterClass(
|
|
1889
|
-
return `[${
|
|
2124
|
+
function toCharacterClass(a2, b, options) {
|
|
2125
|
+
return `[${a2}${b - a2 === 1 ? "" : "-"}${b}]`;
|
|
1890
2126
|
}
|
|
1891
2127
|
function hasPadding(str) {
|
|
1892
2128
|
return /^-?(0+)\d/.test(str);
|
|
@@ -1965,8 +2201,8 @@ var require_fill_range = __commonJS({
|
|
|
1965
2201
|
return negative ? "-" + input : input;
|
|
1966
2202
|
};
|
|
1967
2203
|
var toSequence = (parts, options, maxLen) => {
|
|
1968
|
-
parts.negatives.sort((
|
|
1969
|
-
parts.positives.sort((
|
|
2204
|
+
parts.negatives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
2205
|
+
parts.positives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
1970
2206
|
let prefix = options.capture ? "" : "?:";
|
|
1971
2207
|
let positives = "";
|
|
1972
2208
|
let negatives = "";
|
|
@@ -1987,12 +2223,12 @@ var require_fill_range = __commonJS({
|
|
|
1987
2223
|
}
|
|
1988
2224
|
return result;
|
|
1989
2225
|
};
|
|
1990
|
-
var toRange = (
|
|
2226
|
+
var toRange = (a2, b, isNumbers, options) => {
|
|
1991
2227
|
if (isNumbers) {
|
|
1992
|
-
return toRegexRange(
|
|
2228
|
+
return toRegexRange(a2, b, { wrap: false, ...options });
|
|
1993
2229
|
}
|
|
1994
|
-
let start = String.fromCharCode(
|
|
1995
|
-
if (
|
|
2230
|
+
let start = String.fromCharCode(a2);
|
|
2231
|
+
if (a2 === b) return start;
|
|
1996
2232
|
let stop = String.fromCharCode(b);
|
|
1997
2233
|
return `[${start}-${stop}]`;
|
|
1998
2234
|
};
|
|
@@ -2018,15 +2254,15 @@ var require_fill_range = __commonJS({
|
|
|
2018
2254
|
return [];
|
|
2019
2255
|
};
|
|
2020
2256
|
var fillNumbers = (start, end, step = 1, options = {}) => {
|
|
2021
|
-
let
|
|
2257
|
+
let a2 = Number(start);
|
|
2022
2258
|
let b = Number(end);
|
|
2023
|
-
if (!Number.isInteger(
|
|
2259
|
+
if (!Number.isInteger(a2) || !Number.isInteger(b)) {
|
|
2024
2260
|
if (options.strictRanges === true) throw rangeError([start, end]);
|
|
2025
2261
|
return [];
|
|
2026
2262
|
}
|
|
2027
|
-
if (
|
|
2263
|
+
if (a2 === 0) a2 = 0;
|
|
2028
2264
|
if (b === 0) b = 0;
|
|
2029
|
-
let descending =
|
|
2265
|
+
let descending = a2 > b;
|
|
2030
2266
|
let startString = String(start);
|
|
2031
2267
|
let endString = String(end);
|
|
2032
2268
|
let stepString = String(step);
|
|
@@ -2042,13 +2278,13 @@ var require_fill_range = __commonJS({
|
|
|
2042
2278
|
let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
|
|
2043
2279
|
let range = [];
|
|
2044
2280
|
let index = 0;
|
|
2045
|
-
while (descending ?
|
|
2281
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
2046
2282
|
if (options.toRegex === true && step > 1) {
|
|
2047
|
-
push(
|
|
2283
|
+
push(a2);
|
|
2048
2284
|
} else {
|
|
2049
|
-
range.push(pad(format(
|
|
2285
|
+
range.push(pad(format(a2, index), maxLen, toNumber));
|
|
2050
2286
|
}
|
|
2051
|
-
|
|
2287
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
2052
2288
|
index++;
|
|
2053
2289
|
}
|
|
2054
2290
|
if (options.toRegex === true) {
|
|
@@ -2061,19 +2297,19 @@ var require_fill_range = __commonJS({
|
|
|
2061
2297
|
return invalidRange(start, end, options);
|
|
2062
2298
|
}
|
|
2063
2299
|
let format = options.transform || ((val) => String.fromCharCode(val));
|
|
2064
|
-
let
|
|
2300
|
+
let a2 = `${start}`.charCodeAt(0);
|
|
2065
2301
|
let b = `${end}`.charCodeAt(0);
|
|
2066
|
-
let descending =
|
|
2067
|
-
let min = Math.min(
|
|
2068
|
-
let max = Math.max(
|
|
2302
|
+
let descending = a2 > b;
|
|
2303
|
+
let min = Math.min(a2, b);
|
|
2304
|
+
let max = Math.max(a2, b);
|
|
2069
2305
|
if (options.toRegex && step === 1) {
|
|
2070
2306
|
return toRange(min, max, false, options);
|
|
2071
2307
|
}
|
|
2072
2308
|
let range = [];
|
|
2073
2309
|
let index = 0;
|
|
2074
|
-
while (descending ?
|
|
2075
|
-
range.push(format(
|
|
2076
|
-
|
|
2310
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
2311
|
+
range.push(format(a2, index));
|
|
2312
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
2077
2313
|
index++;
|
|
2078
2314
|
}
|
|
2079
2315
|
if (options.toRegex === true) {
|
|
@@ -2196,18 +2432,18 @@ var require_expand = __commonJS({
|
|
|
2196
2432
|
const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
|
|
2197
2433
|
const walk = (node, parent = {}) => {
|
|
2198
2434
|
node.queue = [];
|
|
2199
|
-
let
|
|
2200
|
-
let
|
|
2201
|
-
while (
|
|
2202
|
-
|
|
2203
|
-
|
|
2435
|
+
let p = parent;
|
|
2436
|
+
let q = parent.queue;
|
|
2437
|
+
while (p.type !== "brace" && p.type !== "root" && p.parent) {
|
|
2438
|
+
p = p.parent;
|
|
2439
|
+
q = p.queue;
|
|
2204
2440
|
}
|
|
2205
2441
|
if (node.invalid || node.dollar) {
|
|
2206
|
-
|
|
2442
|
+
q.push(append(q.pop(), stringify2(node, options)));
|
|
2207
2443
|
return;
|
|
2208
2444
|
}
|
|
2209
2445
|
if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
|
|
2210
|
-
|
|
2446
|
+
q.push(append(q.pop(), ["{}"]));
|
|
2211
2447
|
return;
|
|
2212
2448
|
}
|
|
2213
2449
|
if (node.nodes && node.ranges > 0) {
|
|
@@ -2219,26 +2455,26 @@ var require_expand = __commonJS({
|
|
|
2219
2455
|
if (range.length === 0) {
|
|
2220
2456
|
range = stringify2(node, options);
|
|
2221
2457
|
}
|
|
2222
|
-
|
|
2458
|
+
q.push(append(q.pop(), range));
|
|
2223
2459
|
node.nodes = [];
|
|
2224
2460
|
return;
|
|
2225
2461
|
}
|
|
2226
2462
|
const enclose = utils.encloseBrace(node);
|
|
2227
2463
|
let queue = node.queue;
|
|
2228
|
-
let
|
|
2229
|
-
while (
|
|
2230
|
-
|
|
2231
|
-
queue =
|
|
2464
|
+
let block2 = node;
|
|
2465
|
+
while (block2.type !== "brace" && block2.type !== "root" && block2.parent) {
|
|
2466
|
+
block2 = block2.parent;
|
|
2467
|
+
queue = block2.queue;
|
|
2232
2468
|
}
|
|
2233
|
-
for (let
|
|
2234
|
-
const child = node.nodes[
|
|
2469
|
+
for (let i2 = 0; i2 < node.nodes.length; i2++) {
|
|
2470
|
+
const child = node.nodes[i2];
|
|
2235
2471
|
if (child.type === "comma" && node.type === "brace") {
|
|
2236
|
-
if (
|
|
2472
|
+
if (i2 === 1) queue.push("");
|
|
2237
2473
|
queue.push("");
|
|
2238
2474
|
continue;
|
|
2239
2475
|
}
|
|
2240
2476
|
if (child.type === "close") {
|
|
2241
|
-
|
|
2477
|
+
q.push(append(q.pop(), queue, enclose));
|
|
2242
2478
|
continue;
|
|
2243
2479
|
}
|
|
2244
2480
|
if (child.value && child.type !== "open") {
|
|
@@ -2405,7 +2641,7 @@ var require_parse = __commonJS({
|
|
|
2405
2641
|
}
|
|
2406
2642
|
const ast = { type: "root", input, nodes: [] };
|
|
2407
2643
|
const stack = [ast];
|
|
2408
|
-
let
|
|
2644
|
+
let block2 = ast;
|
|
2409
2645
|
let prev = ast;
|
|
2410
2646
|
let brackets = 0;
|
|
2411
2647
|
const length = input.length;
|
|
@@ -2421,15 +2657,15 @@ var require_parse = __commonJS({
|
|
|
2421
2657
|
prev.value += node.value;
|
|
2422
2658
|
return;
|
|
2423
2659
|
}
|
|
2424
|
-
|
|
2425
|
-
node.parent =
|
|
2660
|
+
block2.nodes.push(node);
|
|
2661
|
+
node.parent = block2;
|
|
2426
2662
|
node.prev = prev;
|
|
2427
2663
|
prev = node;
|
|
2428
2664
|
return node;
|
|
2429
2665
|
};
|
|
2430
2666
|
push({ type: "bos" });
|
|
2431
2667
|
while (index < length) {
|
|
2432
|
-
|
|
2668
|
+
block2 = stack[stack.length - 1];
|
|
2433
2669
|
value = advance();
|
|
2434
2670
|
if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
|
|
2435
2671
|
continue;
|
|
@@ -2466,19 +2702,19 @@ var require_parse = __commonJS({
|
|
|
2466
2702
|
continue;
|
|
2467
2703
|
}
|
|
2468
2704
|
if (value === CHAR_LEFT_PARENTHESES) {
|
|
2469
|
-
|
|
2470
|
-
stack.push(
|
|
2705
|
+
block2 = push({ type: "paren", nodes: [] });
|
|
2706
|
+
stack.push(block2);
|
|
2471
2707
|
push({ type: "text", value });
|
|
2472
2708
|
continue;
|
|
2473
2709
|
}
|
|
2474
2710
|
if (value === CHAR_RIGHT_PARENTHESES) {
|
|
2475
|
-
if (
|
|
2711
|
+
if (block2.type !== "paren") {
|
|
2476
2712
|
push({ type: "text", value });
|
|
2477
2713
|
continue;
|
|
2478
2714
|
}
|
|
2479
|
-
|
|
2715
|
+
block2 = stack.pop();
|
|
2480
2716
|
push({ type: "text", value });
|
|
2481
|
-
|
|
2717
|
+
block2 = stack[stack.length - 1];
|
|
2482
2718
|
continue;
|
|
2483
2719
|
}
|
|
2484
2720
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
@@ -2503,7 +2739,7 @@ var require_parse = __commonJS({
|
|
|
2503
2739
|
}
|
|
2504
2740
|
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
2505
2741
|
depth++;
|
|
2506
|
-
const dollar = prev.value && prev.value.slice(-1) === "$" ||
|
|
2742
|
+
const dollar = prev.value && prev.value.slice(-1) === "$" || block2.dollar === true;
|
|
2507
2743
|
const brace = {
|
|
2508
2744
|
type: "brace",
|
|
2509
2745
|
open: true,
|
|
@@ -2514,52 +2750,52 @@ var require_parse = __commonJS({
|
|
|
2514
2750
|
ranges: 0,
|
|
2515
2751
|
nodes: []
|
|
2516
2752
|
};
|
|
2517
|
-
|
|
2518
|
-
stack.push(
|
|
2753
|
+
block2 = push(brace);
|
|
2754
|
+
stack.push(block2);
|
|
2519
2755
|
push({ type: "open", value });
|
|
2520
2756
|
continue;
|
|
2521
2757
|
}
|
|
2522
2758
|
if (value === CHAR_RIGHT_CURLY_BRACE) {
|
|
2523
|
-
if (
|
|
2759
|
+
if (block2.type !== "brace") {
|
|
2524
2760
|
push({ type: "text", value });
|
|
2525
2761
|
continue;
|
|
2526
2762
|
}
|
|
2527
2763
|
const type = "close";
|
|
2528
|
-
|
|
2529
|
-
|
|
2764
|
+
block2 = stack.pop();
|
|
2765
|
+
block2.close = true;
|
|
2530
2766
|
push({ type, value });
|
|
2531
2767
|
depth--;
|
|
2532
|
-
|
|
2768
|
+
block2 = stack[stack.length - 1];
|
|
2533
2769
|
continue;
|
|
2534
2770
|
}
|
|
2535
2771
|
if (value === CHAR_COMMA && depth > 0) {
|
|
2536
|
-
if (
|
|
2537
|
-
|
|
2538
|
-
const open =
|
|
2539
|
-
|
|
2772
|
+
if (block2.ranges > 0) {
|
|
2773
|
+
block2.ranges = 0;
|
|
2774
|
+
const open = block2.nodes.shift();
|
|
2775
|
+
block2.nodes = [open, { type: "text", value: stringify2(block2) }];
|
|
2540
2776
|
}
|
|
2541
2777
|
push({ type: "comma", value });
|
|
2542
|
-
|
|
2778
|
+
block2.commas++;
|
|
2543
2779
|
continue;
|
|
2544
2780
|
}
|
|
2545
|
-
if (value === CHAR_DOT && depth > 0 &&
|
|
2546
|
-
const siblings =
|
|
2781
|
+
if (value === CHAR_DOT && depth > 0 && block2.commas === 0) {
|
|
2782
|
+
const siblings = block2.nodes;
|
|
2547
2783
|
if (depth === 0 || siblings.length === 0) {
|
|
2548
2784
|
push({ type: "text", value });
|
|
2549
2785
|
continue;
|
|
2550
2786
|
}
|
|
2551
2787
|
if (prev.type === "dot") {
|
|
2552
|
-
|
|
2788
|
+
block2.range = [];
|
|
2553
2789
|
prev.value += value;
|
|
2554
2790
|
prev.type = "range";
|
|
2555
|
-
if (
|
|
2556
|
-
|
|
2557
|
-
|
|
2791
|
+
if (block2.nodes.length !== 3 && block2.nodes.length !== 5) {
|
|
2792
|
+
block2.invalid = true;
|
|
2793
|
+
block2.ranges = 0;
|
|
2558
2794
|
prev.type = "text";
|
|
2559
2795
|
continue;
|
|
2560
2796
|
}
|
|
2561
|
-
|
|
2562
|
-
|
|
2797
|
+
block2.ranges++;
|
|
2798
|
+
block2.args = [];
|
|
2563
2799
|
continue;
|
|
2564
2800
|
}
|
|
2565
2801
|
if (prev.type === "range") {
|
|
@@ -2567,7 +2803,7 @@ var require_parse = __commonJS({
|
|
|
2567
2803
|
const before = siblings[siblings.length - 1];
|
|
2568
2804
|
before.value += prev.value + value;
|
|
2569
2805
|
prev = before;
|
|
2570
|
-
|
|
2806
|
+
block2.ranges--;
|
|
2571
2807
|
continue;
|
|
2572
2808
|
}
|
|
2573
2809
|
push({ type: "dot", value });
|
|
@@ -2576,9 +2812,9 @@ var require_parse = __commonJS({
|
|
|
2576
2812
|
push({ type: "text", value });
|
|
2577
2813
|
}
|
|
2578
2814
|
do {
|
|
2579
|
-
|
|
2580
|
-
if (
|
|
2581
|
-
|
|
2815
|
+
block2 = stack.pop();
|
|
2816
|
+
if (block2.type !== "root") {
|
|
2817
|
+
block2.nodes.forEach((node) => {
|
|
2582
2818
|
if (!node.nodes) {
|
|
2583
2819
|
if (node.type === "open") node.isOpen = true;
|
|
2584
2820
|
if (node.type === "close") node.isClose = true;
|
|
@@ -2587,8 +2823,8 @@ var require_parse = __commonJS({
|
|
|
2587
2823
|
}
|
|
2588
2824
|
});
|
|
2589
2825
|
const parent = stack[stack.length - 1];
|
|
2590
|
-
const index2 = parent.nodes.indexOf(
|
|
2591
|
-
parent.nodes.splice(index2, 1, ...
|
|
2826
|
+
const index2 = parent.nodes.indexOf(block2);
|
|
2827
|
+
parent.nodes.splice(index2, 1, ...block2.nodes);
|
|
2592
2828
|
}
|
|
2593
2829
|
} while (stack.length > 0);
|
|
2594
2830
|
push({ type: "eos" });
|
|
@@ -3221,9 +3457,9 @@ var require_scan = __commonJS({
|
|
|
3221
3457
|
if (opts.parts === true || opts.tokens === true) {
|
|
3222
3458
|
let prevIndex;
|
|
3223
3459
|
for (let idx = 0; idx < slashes.length; idx++) {
|
|
3224
|
-
const
|
|
3225
|
-
const
|
|
3226
|
-
const value = input.slice(
|
|
3460
|
+
const n3 = prevIndex ? prevIndex + 1 : start;
|
|
3461
|
+
const i2 = slashes[idx];
|
|
3462
|
+
const value = input.slice(n3, i2);
|
|
3227
3463
|
if (opts.tokens) {
|
|
3228
3464
|
if (idx === 0 && start !== 0) {
|
|
3229
3465
|
tokens[idx].isPrefix = true;
|
|
@@ -3237,7 +3473,7 @@ var require_scan = __commonJS({
|
|
|
3237
3473
|
if (idx !== 0 || value !== "") {
|
|
3238
3474
|
parts.push(value);
|
|
3239
3475
|
}
|
|
3240
|
-
prevIndex =
|
|
3476
|
+
prevIndex = i2;
|
|
3241
3477
|
}
|
|
3242
3478
|
if (prevIndex && prevIndex + 1 < input.length) {
|
|
3243
3479
|
const value = input.slice(prevIndex + 1);
|
|
@@ -3366,15 +3602,15 @@ var require_parse2 = __commonJS({
|
|
|
3366
3602
|
};
|
|
3367
3603
|
var hasRepeatedCharPrefixOverlap = (branches) => {
|
|
3368
3604
|
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
3369
|
-
for (let
|
|
3370
|
-
for (let
|
|
3371
|
-
const
|
|
3372
|
-
const b = values[
|
|
3373
|
-
const char =
|
|
3374
|
-
if (!char ||
|
|
3605
|
+
for (let i2 = 0; i2 < values.length; i2++) {
|
|
3606
|
+
for (let j = i2 + 1; j < values.length; j++) {
|
|
3607
|
+
const a2 = values[i2];
|
|
3608
|
+
const b = values[j];
|
|
3609
|
+
const char = a2[0];
|
|
3610
|
+
if (!char || a2 !== char.repeat(a2.length) || b !== char.repeat(b.length)) {
|
|
3375
3611
|
continue;
|
|
3376
3612
|
}
|
|
3377
|
-
if (
|
|
3613
|
+
if (a2 === b || a2.startsWith(b) || b.startsWith(a2)) {
|
|
3378
3614
|
return true;
|
|
3379
3615
|
}
|
|
3380
3616
|
}
|
|
@@ -3389,8 +3625,8 @@ var require_parse2 = __commonJS({
|
|
|
3389
3625
|
let paren = 0;
|
|
3390
3626
|
let quote = 0;
|
|
3391
3627
|
let escaped = false;
|
|
3392
|
-
for (let
|
|
3393
|
-
const ch = pattern[
|
|
3628
|
+
for (let i2 = 1; i2 < pattern.length; i2++) {
|
|
3629
|
+
const ch = pattern[i2];
|
|
3394
3630
|
if (escaped === true) {
|
|
3395
3631
|
escaped = false;
|
|
3396
3632
|
continue;
|
|
@@ -3424,13 +3660,13 @@ var require_parse2 = __commonJS({
|
|
|
3424
3660
|
if (ch === ")") {
|
|
3425
3661
|
paren--;
|
|
3426
3662
|
if (paren === 0) {
|
|
3427
|
-
if (requireEnd === true &&
|
|
3663
|
+
if (requireEnd === true && i2 !== pattern.length - 1) {
|
|
3428
3664
|
return;
|
|
3429
3665
|
}
|
|
3430
3666
|
return {
|
|
3431
3667
|
type: pattern[0],
|
|
3432
|
-
body: pattern.slice(2,
|
|
3433
|
-
end:
|
|
3668
|
+
body: pattern.slice(2, i2),
|
|
3669
|
+
end: i2
|
|
3434
3670
|
};
|
|
3435
3671
|
}
|
|
3436
3672
|
}
|
|
@@ -3562,7 +3798,7 @@ var require_parse2 = __commonJS({
|
|
|
3562
3798
|
let prev = bos;
|
|
3563
3799
|
let value;
|
|
3564
3800
|
const eos = () => state.index === len - 1;
|
|
3565
|
-
const peek = state.peek = (
|
|
3801
|
+
const peek = state.peek = (n3 = 1) => input[state.index + n3];
|
|
3566
3802
|
const advance = state.advance = () => input[++state.index] || "";
|
|
3567
3803
|
const remaining = () => input.slice(state.index + 1);
|
|
3568
3804
|
const consume = (value2 = "", num = 0) => {
|
|
@@ -3643,10 +3879,10 @@ var require_parse2 = __commonJS({
|
|
|
3643
3879
|
open.type = "text";
|
|
3644
3880
|
open.value = literal;
|
|
3645
3881
|
open.output = safeOutput || utils.escapeRegex(literal);
|
|
3646
|
-
for (let
|
|
3647
|
-
tokens[
|
|
3648
|
-
tokens[
|
|
3649
|
-
delete tokens[
|
|
3882
|
+
for (let i2 = token.tokensIndex + 1; i2 < tokens.length; i2++) {
|
|
3883
|
+
tokens[i2].value = "";
|
|
3884
|
+
tokens[i2].output = "";
|
|
3885
|
+
delete tokens[i2].suffix;
|
|
3650
3886
|
}
|
|
3651
3887
|
state.output = token.output + open.output;
|
|
3652
3888
|
state.backtrack = true;
|
|
@@ -3889,13 +4125,13 @@ var require_parse2 = __commonJS({
|
|
|
3889
4125
|
if (brace.dots === true) {
|
|
3890
4126
|
const arr = tokens.slice();
|
|
3891
4127
|
const range = [];
|
|
3892
|
-
for (let
|
|
4128
|
+
for (let i2 = arr.length - 1; i2 >= 0; i2--) {
|
|
3893
4129
|
tokens.pop();
|
|
3894
|
-
if (arr[
|
|
4130
|
+
if (arr[i2].type === "brace") {
|
|
3895
4131
|
break;
|
|
3896
4132
|
}
|
|
3897
|
-
if (arr[
|
|
3898
|
-
range.unshift(arr[
|
|
4133
|
+
if (arr[i2].type !== "dots") {
|
|
4134
|
+
range.unshift(arr[i2].value);
|
|
3899
4135
|
}
|
|
3900
4136
|
}
|
|
3901
4137
|
output = expandRange(range, opts);
|
|
@@ -4354,7 +4590,7 @@ var require_picomatch = __commonJS({
|
|
|
4354
4590
|
};
|
|
4355
4591
|
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
4356
4592
|
picomatch.parse = (pattern, options) => {
|
|
4357
|
-
if (Array.isArray(pattern)) return pattern.map((
|
|
4593
|
+
if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
|
|
4358
4594
|
return parse2(pattern, { ...options, fastpaths: false });
|
|
4359
4595
|
};
|
|
4360
4596
|
picomatch.scan = (input, options) => scan(input, options);
|
|
@@ -4438,8 +4674,8 @@ var require_micromatch = __commonJS({
|
|
|
4438
4674
|
options.onResult(state);
|
|
4439
4675
|
}
|
|
4440
4676
|
};
|
|
4441
|
-
for (let
|
|
4442
|
-
let isMatch = picomatch(String(patterns[
|
|
4677
|
+
for (let i2 = 0; i2 < patterns.length; i2++) {
|
|
4678
|
+
let isMatch = picomatch(String(patterns[i2]), { ...options, onResult }, true);
|
|
4443
4679
|
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
|
|
4444
4680
|
if (negated) negatives++;
|
|
4445
4681
|
for (let item of list) {
|
|
@@ -4461,7 +4697,7 @@ var require_micromatch = __commonJS({
|
|
|
4461
4697
|
throw new Error(`No matches found for "${patterns.join(", ")}"`);
|
|
4462
4698
|
}
|
|
4463
4699
|
if (options.nonull === true || options.nullglob === true) {
|
|
4464
|
-
return options.unescape ? patterns.map((
|
|
4700
|
+
return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
|
|
4465
4701
|
}
|
|
4466
4702
|
}
|
|
4467
4703
|
return matches;
|
|
@@ -4491,7 +4727,7 @@ var require_micromatch = __commonJS({
|
|
|
4491
4727
|
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
4492
4728
|
}
|
|
4493
4729
|
if (Array.isArray(pattern)) {
|
|
4494
|
-
return pattern.some((
|
|
4730
|
+
return pattern.some((p) => micromatch.contains(str, p, options));
|
|
4495
4731
|
}
|
|
4496
4732
|
if (typeof pattern === "string") {
|
|
4497
4733
|
if (isEmptyString(str) || isEmptyString(pattern)) {
|
|
@@ -4536,7 +4772,7 @@ var require_micromatch = __commonJS({
|
|
|
4536
4772
|
if (typeof str !== "string") {
|
|
4537
4773
|
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
4538
4774
|
}
|
|
4539
|
-
return [].concat(patterns).every((
|
|
4775
|
+
return [].concat(patterns).every((p) => picomatch(p, options)(str));
|
|
4540
4776
|
};
|
|
4541
4777
|
micromatch.capture = (glob, input, options) => {
|
|
4542
4778
|
let posix = utils.isWindows(options);
|
|
@@ -4687,7 +4923,7 @@ var require_pattern = __commonJS({
|
|
|
4687
4923
|
exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
|
4688
4924
|
function expandBraceExpansion(pattern) {
|
|
4689
4925
|
const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });
|
|
4690
|
-
patterns.sort((
|
|
4926
|
+
patterns.sort((a2, b) => a2.length - b.length);
|
|
4691
4927
|
return patterns.filter((pattern2) => pattern2 !== "");
|
|
4692
4928
|
}
|
|
4693
4929
|
exports.expandBraceExpansion = expandBraceExpansion;
|
|
@@ -4768,8 +5004,8 @@ var require_merge2 = __commonJS({
|
|
|
4768
5004
|
}
|
|
4769
5005
|
const mergedStream = PassThrough(options);
|
|
4770
5006
|
function addStream() {
|
|
4771
|
-
for (let
|
|
4772
|
-
streamsQueue.push(pauseStreams(arguments[
|
|
5007
|
+
for (let i2 = 0, len = arguments.length; i2 < len; i2++) {
|
|
5008
|
+
streamsQueue.push(pauseStreams(arguments[i2], options));
|
|
4773
5009
|
}
|
|
4774
5010
|
mergeStream();
|
|
4775
5011
|
return this;
|
|
@@ -4818,8 +5054,8 @@ var require_merge2 = __commonJS({
|
|
|
4818
5054
|
stream.pipe(mergedStream, { end: false });
|
|
4819
5055
|
stream.resume();
|
|
4820
5056
|
}
|
|
4821
|
-
for (let
|
|
4822
|
-
pipe(streams[
|
|
5057
|
+
for (let i2 = 0; i2 < streams.length; i2++) {
|
|
5058
|
+
pipe(streams[i2]);
|
|
4823
5059
|
}
|
|
4824
5060
|
next();
|
|
4825
5061
|
}
|
|
@@ -4850,8 +5086,8 @@ var require_merge2 = __commonJS({
|
|
|
4850
5086
|
}
|
|
4851
5087
|
streams.pause();
|
|
4852
5088
|
} else {
|
|
4853
|
-
for (let
|
|
4854
|
-
streams[
|
|
5089
|
+
for (let i2 = 0, len = streams.length; i2 < len; i2++) {
|
|
5090
|
+
streams[i2] = pauseStreams(streams[i2], options);
|
|
4855
5091
|
}
|
|
4856
5092
|
}
|
|
4857
5093
|
return streams;
|
|
@@ -4933,13 +5169,13 @@ var require_tasks = __commonJS({
|
|
|
4933
5169
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4934
5170
|
exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
|
|
4935
5171
|
var utils = require_utils3();
|
|
4936
|
-
function generate(input,
|
|
4937
|
-
const patterns = processPatterns(input,
|
|
4938
|
-
const ignore = processPatterns(
|
|
5172
|
+
function generate(input, settings2) {
|
|
5173
|
+
const patterns = processPatterns(input, settings2);
|
|
5174
|
+
const ignore = processPatterns(settings2.ignore, settings2);
|
|
4939
5175
|
const positivePatterns = getPositivePatterns(patterns);
|
|
4940
5176
|
const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
|
|
4941
|
-
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern,
|
|
4942
|
-
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern,
|
|
5177
|
+
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings2));
|
|
5178
|
+
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings2));
|
|
4943
5179
|
const staticTasks = convertPatternsToTasks(
|
|
4944
5180
|
staticPatterns,
|
|
4945
5181
|
negativePatterns,
|
|
@@ -4955,12 +5191,12 @@ var require_tasks = __commonJS({
|
|
|
4955
5191
|
return staticTasks.concat(dynamicTasks);
|
|
4956
5192
|
}
|
|
4957
5193
|
exports.generate = generate;
|
|
4958
|
-
function processPatterns(input,
|
|
5194
|
+
function processPatterns(input, settings2) {
|
|
4959
5195
|
let patterns = input;
|
|
4960
|
-
if (
|
|
5196
|
+
if (settings2.braceExpansion) {
|
|
4961
5197
|
patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);
|
|
4962
5198
|
}
|
|
4963
|
-
if (
|
|
5199
|
+
if (settings2.baseNameMatch) {
|
|
4964
5200
|
patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`);
|
|
4965
5201
|
}
|
|
4966
5202
|
return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));
|
|
@@ -4991,7 +5227,7 @@ var require_tasks = __commonJS({
|
|
|
4991
5227
|
}
|
|
4992
5228
|
exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
|
|
4993
5229
|
function groupPatternsByBaseDirectory(patterns) {
|
|
4994
|
-
const
|
|
5230
|
+
const group2 = {};
|
|
4995
5231
|
return patterns.reduce((collection, pattern) => {
|
|
4996
5232
|
const base = utils.pattern.getBaseDirectory(pattern);
|
|
4997
5233
|
if (base in collection) {
|
|
@@ -5000,7 +5236,7 @@ var require_tasks = __commonJS({
|
|
|
5000
5236
|
collection[base] = [pattern];
|
|
5001
5237
|
}
|
|
5002
5238
|
return collection;
|
|
5003
|
-
},
|
|
5239
|
+
}, group2);
|
|
5004
5240
|
}
|
|
5005
5241
|
exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
|
|
5006
5242
|
function convertPatternGroupsToTasks(positive, negative, dynamic) {
|
|
@@ -5029,26 +5265,26 @@ var require_async = __commonJS({
|
|
|
5029
5265
|
init_utils2();
|
|
5030
5266
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5031
5267
|
exports.read = void 0;
|
|
5032
|
-
function read(path,
|
|
5033
|
-
|
|
5268
|
+
function read(path, settings2, callback) {
|
|
5269
|
+
settings2.fs.lstat(path, (lstatError, lstat) => {
|
|
5034
5270
|
if (lstatError !== null) {
|
|
5035
5271
|
callFailureCallback(callback, lstatError);
|
|
5036
5272
|
return;
|
|
5037
5273
|
}
|
|
5038
|
-
if (!lstat.isSymbolicLink() || !
|
|
5274
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
5039
5275
|
callSuccessCallback(callback, lstat);
|
|
5040
5276
|
return;
|
|
5041
5277
|
}
|
|
5042
|
-
|
|
5278
|
+
settings2.fs.stat(path, (statError, stat) => {
|
|
5043
5279
|
if (statError !== null) {
|
|
5044
|
-
if (
|
|
5280
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5045
5281
|
callFailureCallback(callback, statError);
|
|
5046
5282
|
return;
|
|
5047
5283
|
}
|
|
5048
5284
|
callSuccessCallback(callback, lstat);
|
|
5049
5285
|
return;
|
|
5050
5286
|
}
|
|
5051
|
-
if (
|
|
5287
|
+
if (settings2.markSymbolicLink) {
|
|
5052
5288
|
stat.isSymbolicLink = () => true;
|
|
5053
5289
|
}
|
|
5054
5290
|
callSuccessCallback(callback, stat);
|
|
@@ -5072,19 +5308,19 @@ var require_sync = __commonJS({
|
|
|
5072
5308
|
init_utils2();
|
|
5073
5309
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5074
5310
|
exports.read = void 0;
|
|
5075
|
-
function read(path,
|
|
5076
|
-
const lstat =
|
|
5077
|
-
if (!lstat.isSymbolicLink() || !
|
|
5311
|
+
function read(path, settings2) {
|
|
5312
|
+
const lstat = settings2.fs.lstatSync(path);
|
|
5313
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
5078
5314
|
return lstat;
|
|
5079
5315
|
}
|
|
5080
5316
|
try {
|
|
5081
|
-
const stat =
|
|
5082
|
-
if (
|
|
5317
|
+
const stat = settings2.fs.statSync(path);
|
|
5318
|
+
if (settings2.markSymbolicLink) {
|
|
5083
5319
|
stat.isSymbolicLink = () => true;
|
|
5084
5320
|
}
|
|
5085
5321
|
return stat;
|
|
5086
5322
|
} catch (error2) {
|
|
5087
|
-
if (!
|
|
5323
|
+
if (!settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5088
5324
|
return lstat;
|
|
5089
5325
|
}
|
|
5090
5326
|
throw error2;
|
|
@@ -5161,8 +5397,8 @@ var require_out = __commonJS({
|
|
|
5161
5397
|
}
|
|
5162
5398
|
exports.stat = stat;
|
|
5163
5399
|
function statSync3(path, optionsOrSettings) {
|
|
5164
|
-
const
|
|
5165
|
-
return sync.read(path,
|
|
5400
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5401
|
+
return sync.read(path, settings2);
|
|
5166
5402
|
}
|
|
5167
5403
|
exports.statSync = statSync3;
|
|
5168
5404
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -5210,8 +5446,8 @@ var require_run_parallel = __commonJS({
|
|
|
5210
5446
|
if (isSync) queueMicrotask2(end);
|
|
5211
5447
|
else end();
|
|
5212
5448
|
}
|
|
5213
|
-
function each(
|
|
5214
|
-
results[
|
|
5449
|
+
function each(i2, err, result) {
|
|
5450
|
+
results[i2] = result;
|
|
5215
5451
|
if (--pending === 0 || err) {
|
|
5216
5452
|
done(err);
|
|
5217
5453
|
}
|
|
@@ -5225,9 +5461,9 @@ var require_run_parallel = __commonJS({
|
|
|
5225
5461
|
});
|
|
5226
5462
|
});
|
|
5227
5463
|
} else {
|
|
5228
|
-
tasks.forEach(function(task,
|
|
5464
|
+
tasks.forEach(function(task, i2) {
|
|
5229
5465
|
task(function(err, result) {
|
|
5230
|
-
each(
|
|
5466
|
+
each(i2, err, result);
|
|
5231
5467
|
});
|
|
5232
5468
|
});
|
|
5233
5469
|
}
|
|
@@ -5302,11 +5538,11 @@ var require_common = __commonJS({
|
|
|
5302
5538
|
init_utils2();
|
|
5303
5539
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5304
5540
|
exports.joinPathSegments = void 0;
|
|
5305
|
-
function joinPathSegments(
|
|
5306
|
-
if (
|
|
5307
|
-
return
|
|
5541
|
+
function joinPathSegments(a2, b, separator) {
|
|
5542
|
+
if (a2.endsWith(separator)) {
|
|
5543
|
+
return a2 + b;
|
|
5308
5544
|
}
|
|
5309
|
-
return
|
|
5545
|
+
return a2 + separator + b;
|
|
5310
5546
|
}
|
|
5311
5547
|
exports.joinPathSegments = joinPathSegments;
|
|
5312
5548
|
}
|
|
@@ -5324,16 +5560,16 @@ var require_async2 = __commonJS({
|
|
|
5324
5560
|
var constants_1 = require_constants3();
|
|
5325
5561
|
var utils = require_utils4();
|
|
5326
5562
|
var common = require_common();
|
|
5327
|
-
function read(directory,
|
|
5328
|
-
if (!
|
|
5329
|
-
readdirWithFileTypes(directory,
|
|
5563
|
+
function read(directory, settings2, callback) {
|
|
5564
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
5565
|
+
readdirWithFileTypes(directory, settings2, callback);
|
|
5330
5566
|
return;
|
|
5331
5567
|
}
|
|
5332
|
-
readdir(directory,
|
|
5568
|
+
readdir(directory, settings2, callback);
|
|
5333
5569
|
}
|
|
5334
5570
|
exports.read = read;
|
|
5335
|
-
function readdirWithFileTypes(directory,
|
|
5336
|
-
|
|
5571
|
+
function readdirWithFileTypes(directory, settings2, callback) {
|
|
5572
|
+
settings2.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
|
|
5337
5573
|
if (readdirError !== null) {
|
|
5338
5574
|
callFailureCallback(callback, readdirError);
|
|
5339
5575
|
return;
|
|
@@ -5341,13 +5577,13 @@ var require_async2 = __commonJS({
|
|
|
5341
5577
|
const entries = dirents.map((dirent) => ({
|
|
5342
5578
|
dirent,
|
|
5343
5579
|
name: dirent.name,
|
|
5344
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
5580
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
5345
5581
|
}));
|
|
5346
|
-
if (!
|
|
5582
|
+
if (!settings2.followSymbolicLinks) {
|
|
5347
5583
|
callSuccessCallback(callback, entries);
|
|
5348
5584
|
return;
|
|
5349
5585
|
}
|
|
5350
|
-
const tasks = entries.map((entry) => makeRplTaskEntry(entry,
|
|
5586
|
+
const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings2));
|
|
5351
5587
|
rpl(tasks, (rplError, rplEntries) => {
|
|
5352
5588
|
if (rplError !== null) {
|
|
5353
5589
|
callFailureCallback(callback, rplError);
|
|
@@ -5358,15 +5594,15 @@ var require_async2 = __commonJS({
|
|
|
5358
5594
|
});
|
|
5359
5595
|
}
|
|
5360
5596
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
5361
|
-
function makeRplTaskEntry(entry,
|
|
5597
|
+
function makeRplTaskEntry(entry, settings2) {
|
|
5362
5598
|
return (done) => {
|
|
5363
5599
|
if (!entry.dirent.isSymbolicLink()) {
|
|
5364
5600
|
done(null, entry);
|
|
5365
5601
|
return;
|
|
5366
5602
|
}
|
|
5367
|
-
|
|
5603
|
+
settings2.fs.stat(entry.path, (statError, stats) => {
|
|
5368
5604
|
if (statError !== null) {
|
|
5369
|
-
if (
|
|
5605
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5370
5606
|
done(statError);
|
|
5371
5607
|
return;
|
|
5372
5608
|
}
|
|
@@ -5378,16 +5614,16 @@ var require_async2 = __commonJS({
|
|
|
5378
5614
|
});
|
|
5379
5615
|
};
|
|
5380
5616
|
}
|
|
5381
|
-
function readdir(directory,
|
|
5382
|
-
|
|
5617
|
+
function readdir(directory, settings2, callback) {
|
|
5618
|
+
settings2.fs.readdir(directory, (readdirError, names) => {
|
|
5383
5619
|
if (readdirError !== null) {
|
|
5384
5620
|
callFailureCallback(callback, readdirError);
|
|
5385
5621
|
return;
|
|
5386
5622
|
}
|
|
5387
5623
|
const tasks = names.map((name) => {
|
|
5388
|
-
const path = common.joinPathSegments(directory, name,
|
|
5624
|
+
const path = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
5389
5625
|
return (done) => {
|
|
5390
|
-
fsStat.stat(path,
|
|
5626
|
+
fsStat.stat(path, settings2.fsStatSettings, (error2, stats) => {
|
|
5391
5627
|
if (error2 !== null) {
|
|
5392
5628
|
done(error2);
|
|
5393
5629
|
return;
|
|
@@ -5397,7 +5633,7 @@ var require_async2 = __commonJS({
|
|
|
5397
5633
|
path,
|
|
5398
5634
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
5399
5635
|
};
|
|
5400
|
-
if (
|
|
5636
|
+
if (settings2.stats) {
|
|
5401
5637
|
entry.stats = stats;
|
|
5402
5638
|
}
|
|
5403
5639
|
done(null, entry);
|
|
@@ -5434,27 +5670,27 @@ var require_sync2 = __commonJS({
|
|
|
5434
5670
|
var constants_1 = require_constants3();
|
|
5435
5671
|
var utils = require_utils4();
|
|
5436
5672
|
var common = require_common();
|
|
5437
|
-
function read(directory,
|
|
5438
|
-
if (!
|
|
5439
|
-
return readdirWithFileTypes(directory,
|
|
5673
|
+
function read(directory, settings2) {
|
|
5674
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
5675
|
+
return readdirWithFileTypes(directory, settings2);
|
|
5440
5676
|
}
|
|
5441
|
-
return readdir(directory,
|
|
5677
|
+
return readdir(directory, settings2);
|
|
5442
5678
|
}
|
|
5443
5679
|
exports.read = read;
|
|
5444
|
-
function readdirWithFileTypes(directory,
|
|
5445
|
-
const dirents =
|
|
5680
|
+
function readdirWithFileTypes(directory, settings2) {
|
|
5681
|
+
const dirents = settings2.fs.readdirSync(directory, { withFileTypes: true });
|
|
5446
5682
|
return dirents.map((dirent) => {
|
|
5447
5683
|
const entry = {
|
|
5448
5684
|
dirent,
|
|
5449
5685
|
name: dirent.name,
|
|
5450
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
5686
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
5451
5687
|
};
|
|
5452
|
-
if (entry.dirent.isSymbolicLink() &&
|
|
5688
|
+
if (entry.dirent.isSymbolicLink() && settings2.followSymbolicLinks) {
|
|
5453
5689
|
try {
|
|
5454
|
-
const stats =
|
|
5690
|
+
const stats = settings2.fs.statSync(entry.path);
|
|
5455
5691
|
entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
|
5456
5692
|
} catch (error2) {
|
|
5457
|
-
if (
|
|
5693
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5458
5694
|
throw error2;
|
|
5459
5695
|
}
|
|
5460
5696
|
}
|
|
@@ -5463,17 +5699,17 @@ var require_sync2 = __commonJS({
|
|
|
5463
5699
|
});
|
|
5464
5700
|
}
|
|
5465
5701
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
5466
|
-
function readdir(directory,
|
|
5467
|
-
const names =
|
|
5702
|
+
function readdir(directory, settings2) {
|
|
5703
|
+
const names = settings2.fs.readdirSync(directory);
|
|
5468
5704
|
return names.map((name) => {
|
|
5469
|
-
const entryPath = common.joinPathSegments(directory, name,
|
|
5470
|
-
const stats = fsStat.statSync(entryPath,
|
|
5705
|
+
const entryPath = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
5706
|
+
const stats = fsStat.statSync(entryPath, settings2.fsStatSettings);
|
|
5471
5707
|
const entry = {
|
|
5472
5708
|
name,
|
|
5473
5709
|
path: entryPath,
|
|
5474
5710
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
5475
5711
|
};
|
|
5476
|
-
if (
|
|
5712
|
+
if (settings2.stats) {
|
|
5477
5713
|
entry.stats = stats;
|
|
5478
5714
|
}
|
|
5479
5715
|
return entry;
|
|
@@ -5560,8 +5796,8 @@ var require_out2 = __commonJS({
|
|
|
5560
5796
|
}
|
|
5561
5797
|
exports.scandir = scandir;
|
|
5562
5798
|
function scandirSync(path, optionsOrSettings) {
|
|
5563
|
-
const
|
|
5564
|
-
return sync.read(path,
|
|
5799
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5800
|
+
return sync.read(path, settings2);
|
|
5565
5801
|
}
|
|
5566
5802
|
exports.scandirSync = scandirSync;
|
|
5567
5803
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -5842,7 +6078,7 @@ var require_queue = __commonJS({
|
|
|
5842
6078
|
queue.drained = drained;
|
|
5843
6079
|
return queue;
|
|
5844
6080
|
function push(value) {
|
|
5845
|
-
var
|
|
6081
|
+
var p = new Promise(function(resolve5, reject) {
|
|
5846
6082
|
pushCb(value, function(err, result) {
|
|
5847
6083
|
if (err) {
|
|
5848
6084
|
reject(err);
|
|
@@ -5851,11 +6087,11 @@ var require_queue = __commonJS({
|
|
|
5851
6087
|
resolve5(result);
|
|
5852
6088
|
});
|
|
5853
6089
|
});
|
|
5854
|
-
|
|
5855
|
-
return
|
|
6090
|
+
p.catch(noop);
|
|
6091
|
+
return p;
|
|
5856
6092
|
}
|
|
5857
6093
|
function unshift(value) {
|
|
5858
|
-
var
|
|
6094
|
+
var p = new Promise(function(resolve5, reject) {
|
|
5859
6095
|
unshiftCb(value, function(err, result) {
|
|
5860
6096
|
if (err) {
|
|
5861
6097
|
reject(err);
|
|
@@ -5864,11 +6100,11 @@ var require_queue = __commonJS({
|
|
|
5864
6100
|
resolve5(result);
|
|
5865
6101
|
});
|
|
5866
6102
|
});
|
|
5867
|
-
|
|
5868
|
-
return
|
|
6103
|
+
p.catch(noop);
|
|
6104
|
+
return p;
|
|
5869
6105
|
}
|
|
5870
6106
|
function drained() {
|
|
5871
|
-
var
|
|
6107
|
+
var p = new Promise(function(resolve5) {
|
|
5872
6108
|
process.nextTick(function() {
|
|
5873
6109
|
if (queue.idle()) {
|
|
5874
6110
|
resolve5();
|
|
@@ -5882,7 +6118,7 @@ var require_queue = __commonJS({
|
|
|
5882
6118
|
}
|
|
5883
6119
|
});
|
|
5884
6120
|
});
|
|
5885
|
-
return
|
|
6121
|
+
return p;
|
|
5886
6122
|
}
|
|
5887
6123
|
}
|
|
5888
6124
|
module.exports = fastqueue;
|
|
@@ -5897,11 +6133,11 @@ var require_common2 = __commonJS({
|
|
|
5897
6133
|
init_utils2();
|
|
5898
6134
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5899
6135
|
exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
|
|
5900
|
-
function isFatalError(
|
|
5901
|
-
if (
|
|
6136
|
+
function isFatalError(settings2, error2) {
|
|
6137
|
+
if (settings2.errorFilter === null) {
|
|
5902
6138
|
return true;
|
|
5903
6139
|
}
|
|
5904
|
-
return !
|
|
6140
|
+
return !settings2.errorFilter(error2);
|
|
5905
6141
|
}
|
|
5906
6142
|
exports.isFatalError = isFatalError;
|
|
5907
6143
|
function isAppliedFilter(filter, value) {
|
|
@@ -5912,14 +6148,14 @@ var require_common2 = __commonJS({
|
|
|
5912
6148
|
return filepath.split(/[/\\]/).join(separator);
|
|
5913
6149
|
}
|
|
5914
6150
|
exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
|
|
5915
|
-
function joinPathSegments(
|
|
5916
|
-
if (
|
|
6151
|
+
function joinPathSegments(a2, b, separator) {
|
|
6152
|
+
if (a2 === "") {
|
|
5917
6153
|
return b;
|
|
5918
6154
|
}
|
|
5919
|
-
if (
|
|
5920
|
-
return
|
|
6155
|
+
if (a2.endsWith(separator)) {
|
|
6156
|
+
return a2 + b;
|
|
5921
6157
|
}
|
|
5922
|
-
return
|
|
6158
|
+
return a2 + separator + b;
|
|
5923
6159
|
}
|
|
5924
6160
|
exports.joinPathSegments = joinPathSegments;
|
|
5925
6161
|
}
|
|
@@ -6266,14 +6502,14 @@ var require_out3 = __commonJS({
|
|
|
6266
6502
|
}
|
|
6267
6503
|
exports.walk = walk;
|
|
6268
6504
|
function walkSync(directory, optionsOrSettings) {
|
|
6269
|
-
const
|
|
6270
|
-
const provider = new sync_1.default(directory,
|
|
6505
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
6506
|
+
const provider = new sync_1.default(directory, settings2);
|
|
6271
6507
|
return provider.read();
|
|
6272
6508
|
}
|
|
6273
6509
|
exports.walkSync = walkSync;
|
|
6274
6510
|
function walkStream(directory, optionsOrSettings) {
|
|
6275
|
-
const
|
|
6276
|
-
const provider = new stream_1.default(directory,
|
|
6511
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
6512
|
+
const provider = new stream_1.default(directory, settings2);
|
|
6277
6513
|
return provider.read();
|
|
6278
6514
|
}
|
|
6279
6515
|
exports.walkStream = walkStream;
|
|
@@ -6359,8 +6595,8 @@ var require_stream3 = __commonJS({
|
|
|
6359
6595
|
done();
|
|
6360
6596
|
}).catch(done);
|
|
6361
6597
|
};
|
|
6362
|
-
for (let
|
|
6363
|
-
stream.write(
|
|
6598
|
+
for (let i2 = 0; i2 < filepaths.length; i2++) {
|
|
6599
|
+
stream.write(i2);
|
|
6364
6600
|
}
|
|
6365
6601
|
return stream;
|
|
6366
6602
|
}
|
|
@@ -7021,14 +7257,14 @@ var require_out4 = __commonJS({
|
|
|
7021
7257
|
function generateTasks(source, options) {
|
|
7022
7258
|
assertPatternsInput(source);
|
|
7023
7259
|
const patterns = [].concat(source);
|
|
7024
|
-
const
|
|
7025
|
-
return taskManager.generate(patterns,
|
|
7260
|
+
const settings2 = new settings_1.default(options);
|
|
7261
|
+
return taskManager.generate(patterns, settings2);
|
|
7026
7262
|
}
|
|
7027
7263
|
FastGlob2.generateTasks = generateTasks;
|
|
7028
7264
|
function isDynamicPattern(source, options) {
|
|
7029
7265
|
assertPatternsInput(source);
|
|
7030
|
-
const
|
|
7031
|
-
return utils.pattern.isDynamicPattern(source,
|
|
7266
|
+
const settings2 = new settings_1.default(options);
|
|
7267
|
+
return utils.pattern.isDynamicPattern(source, settings2);
|
|
7032
7268
|
}
|
|
7033
7269
|
FastGlob2.isDynamicPattern = isDynamicPattern;
|
|
7034
7270
|
function escapePath(source) {
|
|
@@ -7070,9 +7306,9 @@ var require_out4 = __commonJS({
|
|
|
7070
7306
|
})(FastGlob || (FastGlob = {}));
|
|
7071
7307
|
function getWorks(source, _Provider, options) {
|
|
7072
7308
|
const patterns = [].concat(source);
|
|
7073
|
-
const
|
|
7074
|
-
const tasks = taskManager.generate(patterns,
|
|
7075
|
-
const provider = new _Provider(
|
|
7309
|
+
const settings2 = new settings_1.default(options);
|
|
7310
|
+
const tasks = taskManager.generate(patterns, settings2);
|
|
7311
|
+
const provider = new _Provider(settings2);
|
|
7076
7312
|
return tasks.map(provider.read, provider);
|
|
7077
7313
|
}
|
|
7078
7314
|
function assertPatternsInput(input) {
|
|
@@ -7250,8 +7486,8 @@ import "node:fs";
|
|
|
7250
7486
|
import { createRequire } from "node:module";
|
|
7251
7487
|
import {
|
|
7252
7488
|
resolve,
|
|
7253
|
-
join,
|
|
7254
|
-
dirname,
|
|
7489
|
+
join as join2,
|
|
7490
|
+
dirname as dirname2,
|
|
7255
7491
|
relative,
|
|
7256
7492
|
normalize,
|
|
7257
7493
|
sep,
|
|
@@ -7265,7 +7501,7 @@ function safeExecuteAsync(fn, message) {
|
|
|
7265
7501
|
);
|
|
7266
7502
|
});
|
|
7267
7503
|
}
|
|
7268
|
-
var import_fast_glob, constants,
|
|
7504
|
+
var import_fast_glob, constants, log3, PACKAGE_PATHS, PathResolver;
|
|
7269
7505
|
var init_PathResolver = __esm({
|
|
7270
7506
|
"packages/core/config/utils/PathResolver.ts"() {
|
|
7271
7507
|
"use strict";
|
|
@@ -7278,7 +7514,7 @@ var init_PathResolver = __esm({
|
|
|
7278
7514
|
getPatternsFor: getPatternsFor || void 0,
|
|
7279
7515
|
I18N_PATHS: I18N_PATHS || void 0
|
|
7280
7516
|
};
|
|
7281
|
-
|
|
7517
|
+
log3 = {
|
|
7282
7518
|
error: (message, error2) => {
|
|
7283
7519
|
},
|
|
7284
7520
|
warn: (message, error2) => {
|
|
@@ -7399,7 +7635,7 @@ var init_PathResolver = __esm({
|
|
|
7399
7635
|
*/
|
|
7400
7636
|
getDirname(path) {
|
|
7401
7637
|
if (!path) return "";
|
|
7402
|
-
return this.normalizePath(
|
|
7638
|
+
return this.normalizePath(dirname2(path));
|
|
7403
7639
|
}
|
|
7404
7640
|
/**
|
|
7405
7641
|
* Resolve package path using Node's module resolution
|
|
@@ -7411,7 +7647,7 @@ var init_PathResolver = __esm({
|
|
|
7411
7647
|
resolvePackage(packageSpecifier, fromPath = null) {
|
|
7412
7648
|
try {
|
|
7413
7649
|
const basePath = fromPath || this.getAppRoot();
|
|
7414
|
-
const require3 = createRequire(
|
|
7650
|
+
const require3 = createRequire(join2(basePath, "package.json"));
|
|
7415
7651
|
const resolved = require3.resolve(packageSpecifier);
|
|
7416
7652
|
return this.normalizePath(resolved);
|
|
7417
7653
|
} catch (error2) {
|
|
@@ -7563,7 +7799,7 @@ var init_PathResolver = __esm({
|
|
|
7563
7799
|
return cleanContent;
|
|
7564
7800
|
} catch (error2) {
|
|
7565
7801
|
if (this.options.debug) {
|
|
7566
|
-
|
|
7802
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
7567
7803
|
}
|
|
7568
7804
|
return null;
|
|
7569
7805
|
}
|
|
@@ -7591,7 +7827,7 @@ var init_PathResolver = __esm({
|
|
|
7591
7827
|
return cleanContent;
|
|
7592
7828
|
} catch (error2) {
|
|
7593
7829
|
if (this.options.debug) {
|
|
7594
|
-
|
|
7830
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
7595
7831
|
}
|
|
7596
7832
|
return null;
|
|
7597
7833
|
}
|
|
@@ -7613,16 +7849,16 @@ var init_PathResolver = __esm({
|
|
|
7613
7849
|
verbose = false
|
|
7614
7850
|
} = options;
|
|
7615
7851
|
const normalizedPath = this.normalizePath(filePath);
|
|
7616
|
-
const dir = this.normalizePath(
|
|
7852
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
7617
7853
|
const fileExists = this.pathExists(normalizedPath);
|
|
7618
7854
|
if (fileExists && !overwrite) {
|
|
7619
7855
|
if (verbose) {
|
|
7620
|
-
|
|
7856
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
7621
7857
|
}
|
|
7622
7858
|
return false;
|
|
7623
7859
|
}
|
|
7624
7860
|
if (dryRun) {
|
|
7625
|
-
|
|
7861
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
7626
7862
|
return true;
|
|
7627
7863
|
}
|
|
7628
7864
|
try {
|
|
@@ -7647,7 +7883,7 @@ var init_PathResolver = __esm({
|
|
|
7647
7883
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
7648
7884
|
}
|
|
7649
7885
|
if (verbose) {
|
|
7650
|
-
|
|
7886
|
+
log3.info(
|
|
7651
7887
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
7652
7888
|
);
|
|
7653
7889
|
}
|
|
@@ -7674,16 +7910,16 @@ var init_PathResolver = __esm({
|
|
|
7674
7910
|
verbose = false
|
|
7675
7911
|
} = options;
|
|
7676
7912
|
const normalizedPath = this.normalizePath(filePath);
|
|
7677
|
-
const dir = this.normalizePath(
|
|
7913
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
7678
7914
|
const fileExists = this.pathExists(normalizedPath);
|
|
7679
7915
|
if (fileExists && !overwrite) {
|
|
7680
7916
|
if (verbose) {
|
|
7681
|
-
|
|
7917
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
7682
7918
|
}
|
|
7683
7919
|
return false;
|
|
7684
7920
|
}
|
|
7685
7921
|
if (dryRun) {
|
|
7686
|
-
|
|
7922
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
7687
7923
|
return true;
|
|
7688
7924
|
}
|
|
7689
7925
|
try {
|
|
@@ -7707,7 +7943,7 @@ var init_PathResolver = __esm({
|
|
|
7707
7943
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
7708
7944
|
}
|
|
7709
7945
|
if (verbose) {
|
|
7710
|
-
|
|
7946
|
+
log3.info(
|
|
7711
7947
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
7712
7948
|
);
|
|
7713
7949
|
}
|
|
@@ -7732,15 +7968,15 @@ var init_PathResolver = __esm({
|
|
|
7732
7968
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7733
7969
|
if (fileExists && !overwrite) {
|
|
7734
7970
|
if (verbose) {
|
|
7735
|
-
|
|
7971
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7736
7972
|
}
|
|
7737
7973
|
return false;
|
|
7738
7974
|
}
|
|
7739
7975
|
if (dryRun) {
|
|
7740
|
-
|
|
7976
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7741
7977
|
return true;
|
|
7742
7978
|
}
|
|
7743
|
-
const dir = this.normalizePath(
|
|
7979
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7744
7980
|
try {
|
|
7745
7981
|
await fs.promises.mkdir(dir, { recursive: true });
|
|
7746
7982
|
} catch (error2) {
|
|
@@ -7750,7 +7986,7 @@ var init_PathResolver = __esm({
|
|
|
7750
7986
|
return await safeExecuteAsync(async () => {
|
|
7751
7987
|
await fs.promises.copyFile(srcPath, normalizedDestPath);
|
|
7752
7988
|
if (verbose) {
|
|
7753
|
-
|
|
7989
|
+
log3.info(
|
|
7754
7990
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7755
7991
|
);
|
|
7756
7992
|
}
|
|
@@ -7774,15 +8010,15 @@ var init_PathResolver = __esm({
|
|
|
7774
8010
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7775
8011
|
if (fileExists && !overwrite) {
|
|
7776
8012
|
if (verbose) {
|
|
7777
|
-
|
|
8013
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7778
8014
|
}
|
|
7779
8015
|
return false;
|
|
7780
8016
|
}
|
|
7781
8017
|
if (dryRun) {
|
|
7782
|
-
|
|
8018
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7783
8019
|
return true;
|
|
7784
8020
|
}
|
|
7785
|
-
const dir = this.normalizePath(
|
|
8021
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7786
8022
|
try {
|
|
7787
8023
|
fs.mkdirSync(dir, { recursive: true });
|
|
7788
8024
|
} catch (error2) {
|
|
@@ -7791,7 +8027,7 @@ var init_PathResolver = __esm({
|
|
|
7791
8027
|
try {
|
|
7792
8028
|
fs.copyFileSync(srcPath, normalizedDestPath);
|
|
7793
8029
|
if (verbose) {
|
|
7794
|
-
|
|
8030
|
+
log3.info(
|
|
7795
8031
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7796
8032
|
);
|
|
7797
8033
|
}
|
|
@@ -7808,7 +8044,7 @@ var init_PathResolver = __esm({
|
|
|
7808
8044
|
return fs.existsSync(filePath);
|
|
7809
8045
|
} catch (error2) {
|
|
7810
8046
|
if (!silent) {
|
|
7811
|
-
|
|
8047
|
+
log3.error(`Error checking path existence: ${filePath}`, error2);
|
|
7812
8048
|
}
|
|
7813
8049
|
return false;
|
|
7814
8050
|
}
|
|
@@ -7834,7 +8070,7 @@ var init_PathResolver = __esm({
|
|
|
7834
8070
|
return fs.readdirSync(dirPath, options);
|
|
7835
8071
|
} catch (error2) {
|
|
7836
8072
|
if (this.options.debug) {
|
|
7837
|
-
|
|
8073
|
+
log3.warn(`Failed to read directory: ${dirPath}`, error2);
|
|
7838
8074
|
}
|
|
7839
8075
|
const isObjectOptions = options && typeof options === "object" && "withFileTypes" in options;
|
|
7840
8076
|
return isObjectOptions && options.withFileTypes ? [] : [];
|
|
@@ -7852,7 +8088,7 @@ var init_PathResolver = __esm({
|
|
|
7852
8088
|
return fs.statSync(filePath);
|
|
7853
8089
|
} catch (error2) {
|
|
7854
8090
|
if (this.options.debug) {
|
|
7855
|
-
|
|
8091
|
+
log3.warn(`Failed to stat file: ${filePath}`, error2);
|
|
7856
8092
|
}
|
|
7857
8093
|
return null;
|
|
7858
8094
|
}
|
|
@@ -7869,7 +8105,7 @@ var init_PathResolver = __esm({
|
|
|
7869
8105
|
return fs.lstatSync(filePath);
|
|
7870
8106
|
} catch (error2) {
|
|
7871
8107
|
if (this.options.debug) {
|
|
7872
|
-
|
|
8108
|
+
log3.warn(`Failed to lstat file: ${filePath}`, error2);
|
|
7873
8109
|
}
|
|
7874
8110
|
return null;
|
|
7875
8111
|
}
|
|
@@ -7958,7 +8194,7 @@ var init_PathResolver = __esm({
|
|
|
7958
8194
|
* @returns True if repoRoot is the monorepo (has packages directory)
|
|
7959
8195
|
*/
|
|
7960
8196
|
isMonorepo() {
|
|
7961
|
-
const packagesDir =
|
|
8197
|
+
const packagesDir = join2(this._repoRoot, "packages");
|
|
7962
8198
|
return this.pathExists(packagesDir);
|
|
7963
8199
|
}
|
|
7964
8200
|
/**
|
|
@@ -7975,7 +8211,7 @@ var init_PathResolver = __esm({
|
|
|
7975
8211
|
* Find files matching pattern within directory
|
|
7976
8212
|
*/
|
|
7977
8213
|
async findFiles(directory, pattern, options = {}) {
|
|
7978
|
-
const searchPattern = this.normalizePath(
|
|
8214
|
+
const searchPattern = this.normalizePath(join2(directory, pattern));
|
|
7979
8215
|
const appRoot = this.getAppRoot();
|
|
7980
8216
|
const normalizeAppRoot = this.normalizePath(appRoot);
|
|
7981
8217
|
const relativePattern = searchPattern.startsWith(normalizeAppRoot) ? searchPattern.slice(normalizeAppRoot.length + 1) : searchPattern;
|
|
@@ -8022,7 +8258,7 @@ var init_PathResolver = __esm({
|
|
|
8022
8258
|
return null;
|
|
8023
8259
|
}
|
|
8024
8260
|
const resolvedPath = this.normalizePath(
|
|
8025
|
-
|
|
8261
|
+
join2(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
|
|
8026
8262
|
);
|
|
8027
8263
|
const resolvedDir = resolvedPath.replace(/\/[^/]*\*.*$/, "");
|
|
8028
8264
|
if (this.pathExists(resolvedDir)) {
|
|
@@ -8218,13 +8454,13 @@ var init_PathResolver = __esm({
|
|
|
8218
8454
|
const maxLevels = this.options.maxLevels;
|
|
8219
8455
|
while (levelsChecked < maxLevels) {
|
|
8220
8456
|
const toolingPath = this.normalizePath(
|
|
8221
|
-
|
|
8457
|
+
join2(currentDir, PACKAGE_PATHS.TOOLING)
|
|
8222
8458
|
);
|
|
8223
|
-
const corePath = this.normalizePath(
|
|
8459
|
+
const corePath = this.normalizePath(join2(currentDir, PACKAGE_PATHS.CORE));
|
|
8224
8460
|
if (this.pathExists(toolingPath) && this.pathExists(corePath)) {
|
|
8225
8461
|
return currentDir;
|
|
8226
8462
|
}
|
|
8227
|
-
const appsDir =
|
|
8463
|
+
const appsDir = join2(currentDir, "apps");
|
|
8228
8464
|
if (this.pathExists(appsDir)) {
|
|
8229
8465
|
const appsDirStat = this.statSync(appsDir);
|
|
8230
8466
|
if (appsDirStat?.isDirectory()) {
|
|
@@ -8232,15 +8468,15 @@ var init_PathResolver = __esm({
|
|
|
8232
8468
|
}
|
|
8233
8469
|
}
|
|
8234
8470
|
const packageJsonPath = this.normalizePath(
|
|
8235
|
-
|
|
8471
|
+
join2(currentDir, "package.json")
|
|
8236
8472
|
);
|
|
8237
8473
|
if (this.pathExists(packageJsonPath)) {
|
|
8238
|
-
const parentDir2 = this.normalizePath(
|
|
8474
|
+
const parentDir2 = this.normalizePath(dirname2(currentDir));
|
|
8239
8475
|
if (parentDir2 === currentDir) {
|
|
8240
8476
|
return currentDir;
|
|
8241
8477
|
}
|
|
8242
8478
|
}
|
|
8243
|
-
const parentDir = this.normalizePath(
|
|
8479
|
+
const parentDir = this.normalizePath(dirname2(currentDir));
|
|
8244
8480
|
if (parentDir === currentDir) {
|
|
8245
8481
|
break;
|
|
8246
8482
|
}
|
|
@@ -8256,8 +8492,8 @@ var init_PathResolver = __esm({
|
|
|
8256
8492
|
// packages/tooling/src/utils/pathResolver.ts
|
|
8257
8493
|
import { createRequire as createRequire2 } from "node:module";
|
|
8258
8494
|
import {
|
|
8259
|
-
join as
|
|
8260
|
-
dirname as
|
|
8495
|
+
join as join3,
|
|
8496
|
+
dirname as dirname3,
|
|
8261
8497
|
basename as basename2,
|
|
8262
8498
|
extname as extname2,
|
|
8263
8499
|
relative as relative2,
|
|
@@ -8266,7 +8502,7 @@ import {
|
|
|
8266
8502
|
isAbsolute as pathIsAbsolute
|
|
8267
8503
|
} from "node:path";
|
|
8268
8504
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
8269
|
-
function
|
|
8505
|
+
function readdirSync3(dirPath, options) {
|
|
8270
8506
|
return pathResolverInstance.readdirSync(dirPath, options);
|
|
8271
8507
|
}
|
|
8272
8508
|
var pathResolverInstance, getRepoRoot, resolvePackage, normalizePath, pathExists, readSync, statSync2, joinPath;
|
|
@@ -8279,7 +8515,7 @@ var init_pathResolver = __esm({
|
|
|
8279
8515
|
getRepoRoot = () => pathResolverInstance.getRepoRoot();
|
|
8280
8516
|
resolvePackage = (spec, from) => pathResolverInstance.resolvePackage(spec, from || null);
|
|
8281
8517
|
normalizePath = (...pathSegments) => {
|
|
8282
|
-
return pathResolverInstance.normalizePath(
|
|
8518
|
+
return pathResolverInstance.normalizePath(join3(...pathSegments));
|
|
8283
8519
|
};
|
|
8284
8520
|
pathExists = (filePath, silent = false) => pathResolverInstance.pathExists(filePath, silent);
|
|
8285
8521
|
readSync = (filePath, options) => pathResolverInstance.readSync(filePath, options);
|
|
@@ -8340,7 +8576,7 @@ var init_typed_file_operations = __esm({
|
|
|
8340
8576
|
import { Buffer } from "node:buffer";
|
|
8341
8577
|
import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
8342
8578
|
import { createRequire as createRequire3 } from "node:module";
|
|
8343
|
-
import { dirname as
|
|
8579
|
+
import { dirname as dirname4, resolve as resolve3 } from "node:path";
|
|
8344
8580
|
import process from "node:process";
|
|
8345
8581
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
8346
8582
|
var require2, __filename, __dirname;
|
|
@@ -8349,7 +8585,7 @@ var init_utils2 = __esm({
|
|
|
8349
8585
|
"use strict";
|
|
8350
8586
|
require2 = createRequire3(import.meta.url);
|
|
8351
8587
|
__filename = fileURLToPath3(import.meta.url);
|
|
8352
|
-
__dirname =
|
|
8588
|
+
__dirname = dirname4(__filename);
|
|
8353
8589
|
if (typeof globalThis !== "undefined") {
|
|
8354
8590
|
globalThis.require = require2;
|
|
8355
8591
|
globalThis.__filename = __filename;
|
|
@@ -8381,7 +8617,7 @@ function detectApps(projectRoot) {
|
|
|
8381
8617
|
const appsDir = joinPath(projectRoot, "apps");
|
|
8382
8618
|
const appsDirStat = statSync2(appsDir);
|
|
8383
8619
|
if (pathExists(appsDir) && appsDirStat?.isDirectory()) {
|
|
8384
|
-
const appDirs =
|
|
8620
|
+
const appDirs = readdirSync3(appsDir, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name).sort();
|
|
8385
8621
|
for (const appDir of appDirs) {
|
|
8386
8622
|
const appPath = joinPath(appsDir, appDir);
|
|
8387
8623
|
const packageJsonPath = joinPath(appPath, "package.json");
|
|
@@ -8558,17 +8794,17 @@ var init_app_detection = __esm({
|
|
|
8558
8794
|
async function selectApp(projectRoot, appName) {
|
|
8559
8795
|
const apps = detectApps(projectRoot);
|
|
8560
8796
|
if (apps.length === 0) {
|
|
8561
|
-
|
|
8562
|
-
|
|
8797
|
+
log2.error("No apps found in this project.");
|
|
8798
|
+
log2.info('Run "dndev init" to create a new project.');
|
|
8563
8799
|
return null;
|
|
8564
8800
|
}
|
|
8565
8801
|
if (appName) {
|
|
8566
|
-
const app = apps.find((
|
|
8802
|
+
const app = apps.find((a2) => a2.name === appName);
|
|
8567
8803
|
if (!app) {
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
apps.forEach((
|
|
8571
|
-
|
|
8804
|
+
log2.warn(`App "${appName}" not found.`);
|
|
8805
|
+
log2.info("Available apps:");
|
|
8806
|
+
apps.forEach((a2) => log2.info(` - ${a2.name}`));
|
|
8807
|
+
log2.info("Please select from the list:");
|
|
8572
8808
|
} else {
|
|
8573
8809
|
return app;
|
|
8574
8810
|
}
|
|
@@ -8576,7 +8812,7 @@ async function selectApp(projectRoot, appName) {
|
|
|
8576
8812
|
if (apps.length === 1) {
|
|
8577
8813
|
return apps[0] || null;
|
|
8578
8814
|
}
|
|
8579
|
-
const selected = await
|
|
8815
|
+
const selected = await select({
|
|
8580
8816
|
message: "Select app:",
|
|
8581
8817
|
options: apps.map((app) => ({
|
|
8582
8818
|
value: app.name,
|
|
@@ -8586,7 +8822,7 @@ async function selectApp(projectRoot, appName) {
|
|
|
8586
8822
|
if (typeof selected !== "string") {
|
|
8587
8823
|
return null;
|
|
8588
8824
|
}
|
|
8589
|
-
return apps.find((
|
|
8825
|
+
return apps.find((a2) => a2.name === selected) || null;
|
|
8590
8826
|
}
|
|
8591
8827
|
var init_app_selector = __esm({
|
|
8592
8828
|
"packages/tooling/src/utils/app-selector.ts"() {
|
|
@@ -8605,13 +8841,13 @@ async function askForSelection(message, choices, defaultValue = 0) {
|
|
|
8605
8841
|
label: choice.title,
|
|
8606
8842
|
hint: choice.hint
|
|
8607
8843
|
}));
|
|
8608
|
-
const result = await
|
|
8844
|
+
const result = await select({
|
|
8609
8845
|
message,
|
|
8610
8846
|
options,
|
|
8611
8847
|
initialValue: choices[defaultValue]?.value
|
|
8612
8848
|
});
|
|
8613
|
-
if (
|
|
8614
|
-
|
|
8849
|
+
if (isCancel(result)) {
|
|
8850
|
+
cancel("Operation cancelled.");
|
|
8615
8851
|
process.exit(0);
|
|
8616
8852
|
}
|
|
8617
8853
|
return result;
|
|
@@ -8718,7 +8954,7 @@ var require_main = __commonJS({
|
|
|
8718
8954
|
case 5: {
|
|
8719
8955
|
let count = bb.read32();
|
|
8720
8956
|
let value2 = [];
|
|
8721
|
-
for (let
|
|
8957
|
+
for (let i2 = 0; i2 < count; i2++) {
|
|
8722
8958
|
value2.push(visit());
|
|
8723
8959
|
}
|
|
8724
8960
|
return value2;
|
|
@@ -8726,7 +8962,7 @@ var require_main = __commonJS({
|
|
|
8726
8962
|
case 6: {
|
|
8727
8963
|
let count = bb.read32();
|
|
8728
8964
|
let value2 = {};
|
|
8729
|
-
for (let
|
|
8965
|
+
for (let i2 = 0; i2 < count; i2++) {
|
|
8730
8966
|
value2[decodeUTF8(bb.read())] = visit();
|
|
8731
8967
|
}
|
|
8732
8968
|
return value2;
|
|
@@ -8800,11 +9036,11 @@ var require_main = __commonJS({
|
|
|
8800
9036
|
if (typeof TextEncoder !== "undefined" && typeof TextDecoder !== "undefined") {
|
|
8801
9037
|
let encoder = new TextEncoder();
|
|
8802
9038
|
let decoder = new TextDecoder();
|
|
8803
|
-
encodeUTF8 = (
|
|
9039
|
+
encodeUTF8 = (text2) => encoder.encode(text2);
|
|
8804
9040
|
decodeUTF8 = (bytes) => decoder.decode(bytes);
|
|
8805
9041
|
encodeInvariant = 'new TextEncoder().encode("")';
|
|
8806
9042
|
} else if (typeof Buffer !== "undefined") {
|
|
8807
|
-
encodeUTF8 = (
|
|
9043
|
+
encodeUTF8 = (text2) => Buffer.from(text2);
|
|
8808
9044
|
decodeUTF8 = (bytes) => {
|
|
8809
9045
|
let { buffer, byteOffset, byteLength } = bytes;
|
|
8810
9046
|
return Buffer.from(buffer, byteOffset, byteLength).toString();
|
|
@@ -8834,8 +9070,8 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8834
9070
|
const c2 = bytes[index];
|
|
8835
9071
|
let line = 1;
|
|
8836
9072
|
let column = 0;
|
|
8837
|
-
for (let
|
|
8838
|
-
if (bytes[
|
|
9073
|
+
for (let i2 = 0; i2 < index; i2++) {
|
|
9074
|
+
if (bytes[i2] === 10) {
|
|
8839
9075
|
line++;
|
|
8840
9076
|
column = 0;
|
|
8841
9077
|
} else {
|
|
@@ -8857,37 +9093,37 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8857
9093
|
let property = null;
|
|
8858
9094
|
let state = 0;
|
|
8859
9095
|
let object;
|
|
8860
|
-
let
|
|
8861
|
-
while (
|
|
8862
|
-
let c2 = bytes[
|
|
9096
|
+
let i2 = 0;
|
|
9097
|
+
while (i2 < length) {
|
|
9098
|
+
let c2 = bytes[i2++];
|
|
8863
9099
|
if (c2 <= 32) {
|
|
8864
9100
|
continue;
|
|
8865
9101
|
}
|
|
8866
9102
|
let value;
|
|
8867
9103
|
if (state === 2 && property === null && c2 !== 34 && c2 !== 125) {
|
|
8868
|
-
throwSyntaxError(bytes, --
|
|
9104
|
+
throwSyntaxError(bytes, --i2);
|
|
8869
9105
|
}
|
|
8870
9106
|
switch (c2) {
|
|
8871
9107
|
// True
|
|
8872
9108
|
case 116: {
|
|
8873
|
-
if (bytes[
|
|
8874
|
-
throwSyntaxError(bytes, --
|
|
9109
|
+
if (bytes[i2++] !== 114 || bytes[i2++] !== 117 || bytes[i2++] !== 101) {
|
|
9110
|
+
throwSyntaxError(bytes, --i2);
|
|
8875
9111
|
}
|
|
8876
9112
|
value = true;
|
|
8877
9113
|
break;
|
|
8878
9114
|
}
|
|
8879
9115
|
// False
|
|
8880
9116
|
case 102: {
|
|
8881
|
-
if (bytes[
|
|
8882
|
-
throwSyntaxError(bytes, --
|
|
9117
|
+
if (bytes[i2++] !== 97 || bytes[i2++] !== 108 || bytes[i2++] !== 115 || bytes[i2++] !== 101) {
|
|
9118
|
+
throwSyntaxError(bytes, --i2);
|
|
8883
9119
|
}
|
|
8884
9120
|
value = false;
|
|
8885
9121
|
break;
|
|
8886
9122
|
}
|
|
8887
9123
|
// Null
|
|
8888
9124
|
case 110: {
|
|
8889
|
-
if (bytes[
|
|
8890
|
-
throwSyntaxError(bytes, --
|
|
9125
|
+
if (bytes[i2++] !== 117 || bytes[i2++] !== 108 || bytes[i2++] !== 108) {
|
|
9126
|
+
throwSyntaxError(bytes, --i2);
|
|
8891
9127
|
}
|
|
8892
9128
|
value = null;
|
|
8893
9129
|
break;
|
|
@@ -8905,9 +9141,9 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8905
9141
|
case 55:
|
|
8906
9142
|
case 56:
|
|
8907
9143
|
case 57: {
|
|
8908
|
-
let index =
|
|
9144
|
+
let index = i2;
|
|
8909
9145
|
value = fromCharCode(c2);
|
|
8910
|
-
c2 = bytes[
|
|
9146
|
+
c2 = bytes[i2];
|
|
8911
9147
|
while (true) {
|
|
8912
9148
|
switch (c2) {
|
|
8913
9149
|
case 43:
|
|
@@ -8926,7 +9162,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8926
9162
|
case 101:
|
|
8927
9163
|
case 69: {
|
|
8928
9164
|
value += fromCharCode(c2);
|
|
8929
|
-
c2 = bytes[++
|
|
9165
|
+
c2 = bytes[++i2];
|
|
8930
9166
|
continue;
|
|
8931
9167
|
}
|
|
8932
9168
|
}
|
|
@@ -8942,14 +9178,14 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8942
9178
|
case 34: {
|
|
8943
9179
|
value = "";
|
|
8944
9180
|
while (true) {
|
|
8945
|
-
if (
|
|
9181
|
+
if (i2 >= length) {
|
|
8946
9182
|
throwSyntaxError(bytes, length);
|
|
8947
9183
|
}
|
|
8948
|
-
c2 = bytes[
|
|
9184
|
+
c2 = bytes[i2++];
|
|
8949
9185
|
if (c2 === 34) {
|
|
8950
9186
|
break;
|
|
8951
9187
|
} else if (c2 === 92) {
|
|
8952
|
-
switch (bytes[
|
|
9188
|
+
switch (bytes[i2++]) {
|
|
8953
9189
|
// Normal escape sequence
|
|
8954
9190
|
case 34:
|
|
8955
9191
|
value += '"';
|
|
@@ -8978,30 +9214,30 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
8978
9214
|
// Unicode escape sequence
|
|
8979
9215
|
case 117: {
|
|
8980
9216
|
let code = 0;
|
|
8981
|
-
for (let
|
|
8982
|
-
c2 = bytes[
|
|
9217
|
+
for (let j = 0; j < 4; j++) {
|
|
9218
|
+
c2 = bytes[i2++];
|
|
8983
9219
|
code <<= 4;
|
|
8984
9220
|
if (c2 >= 48 && c2 <= 57) code |= c2 - 48;
|
|
8985
9221
|
else if (c2 >= 97 && c2 <= 102) code |= c2 + (10 - 97);
|
|
8986
9222
|
else if (c2 >= 65 && c2 <= 70) code |= c2 + (10 - 65);
|
|
8987
|
-
else throwSyntaxError(bytes, --
|
|
9223
|
+
else throwSyntaxError(bytes, --i2);
|
|
8988
9224
|
}
|
|
8989
9225
|
value += fromCharCode(code);
|
|
8990
9226
|
break;
|
|
8991
9227
|
}
|
|
8992
9228
|
// Invalid escape sequence
|
|
8993
9229
|
default:
|
|
8994
|
-
throwSyntaxError(bytes, --
|
|
9230
|
+
throwSyntaxError(bytes, --i2);
|
|
8995
9231
|
break;
|
|
8996
9232
|
}
|
|
8997
9233
|
} else if (c2 <= 127) {
|
|
8998
9234
|
value += fromCharCode(c2);
|
|
8999
9235
|
} else if ((c2 & 224) === 192) {
|
|
9000
|
-
value += fromCharCode((c2 & 31) << 6 | bytes[
|
|
9236
|
+
value += fromCharCode((c2 & 31) << 6 | bytes[i2++] & 63);
|
|
9001
9237
|
} else if ((c2 & 240) === 224) {
|
|
9002
|
-
value += fromCharCode((c2 & 15) << 12 | (bytes[
|
|
9238
|
+
value += fromCharCode((c2 & 15) << 12 | (bytes[i2++] & 63) << 6 | bytes[i2++] & 63);
|
|
9003
9239
|
} else if ((c2 & 248) == 240) {
|
|
9004
|
-
let codePoint = (c2 & 7) << 18 | (bytes[
|
|
9240
|
+
let codePoint = (c2 & 7) << 18 | (bytes[i2++] & 63) << 12 | (bytes[i2++] & 63) << 6 | bytes[i2++] & 63;
|
|
9005
9241
|
if (codePoint > 65535) {
|
|
9006
9242
|
codePoint -= 65536;
|
|
9007
9243
|
value += fromCharCode(codePoint >> 10 & 1023 | 55296);
|
|
@@ -9038,7 +9274,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
9038
9274
|
// Array end
|
|
9039
9275
|
case 93: {
|
|
9040
9276
|
if (state !== 1) {
|
|
9041
|
-
throwSyntaxError(bytes, --
|
|
9277
|
+
throwSyntaxError(bytes, --i2);
|
|
9042
9278
|
}
|
|
9043
9279
|
value = object;
|
|
9044
9280
|
property = propertyStack.pop();
|
|
@@ -9049,7 +9285,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
9049
9285
|
// Object end
|
|
9050
9286
|
case 125: {
|
|
9051
9287
|
if (state !== 2) {
|
|
9052
|
-
throwSyntaxError(bytes, --
|
|
9288
|
+
throwSyntaxError(bytes, --i2);
|
|
9053
9289
|
}
|
|
9054
9290
|
value = object;
|
|
9055
9291
|
property = propertyStack.pop();
|
|
@@ -9058,16 +9294,16 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
9058
9294
|
break;
|
|
9059
9295
|
}
|
|
9060
9296
|
default: {
|
|
9061
|
-
throwSyntaxError(bytes, --
|
|
9297
|
+
throwSyntaxError(bytes, --i2);
|
|
9062
9298
|
}
|
|
9063
9299
|
}
|
|
9064
|
-
c2 = bytes[
|
|
9300
|
+
c2 = bytes[i2];
|
|
9065
9301
|
while (c2 <= 32) {
|
|
9066
|
-
c2 = bytes[++
|
|
9302
|
+
c2 = bytes[++i2];
|
|
9067
9303
|
}
|
|
9068
9304
|
switch (state) {
|
|
9069
9305
|
case 0: {
|
|
9070
|
-
if (
|
|
9306
|
+
if (i2 === length) {
|
|
9071
9307
|
return value;
|
|
9072
9308
|
}
|
|
9073
9309
|
break;
|
|
@@ -9075,7 +9311,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
9075
9311
|
case 1: {
|
|
9076
9312
|
object.push(value);
|
|
9077
9313
|
if (c2 === 44) {
|
|
9078
|
-
|
|
9314
|
+
i2++;
|
|
9079
9315
|
continue;
|
|
9080
9316
|
}
|
|
9081
9317
|
if (c2 === 93) {
|
|
@@ -9087,14 +9323,14 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
9087
9323
|
if (property === null) {
|
|
9088
9324
|
property = value;
|
|
9089
9325
|
if (c2 === 58) {
|
|
9090
|
-
|
|
9326
|
+
i2++;
|
|
9091
9327
|
continue;
|
|
9092
9328
|
}
|
|
9093
9329
|
} else {
|
|
9094
9330
|
object[property] = value;
|
|
9095
9331
|
property = null;
|
|
9096
9332
|
if (c2 === 44) {
|
|
9097
|
-
|
|
9333
|
+
i2++;
|
|
9098
9334
|
continue;
|
|
9099
9335
|
}
|
|
9100
9336
|
if (c2 === 125) {
|
|
@@ -9106,7 +9342,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
9106
9342
|
}
|
|
9107
9343
|
break;
|
|
9108
9344
|
}
|
|
9109
|
-
throwSyntaxError(bytes,
|
|
9345
|
+
throwSyntaxError(bytes, i2);
|
|
9110
9346
|
}
|
|
9111
9347
|
var quote = JSON.stringify;
|
|
9112
9348
|
var buildLogLevelDefault = "warning";
|
|
@@ -9316,7 +9552,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
9316
9552
|
let footer = getFlag(options, keys, "footer", mustBeObject);
|
|
9317
9553
|
let entryPoints = getFlag(options, keys, "entryPoints", mustBeEntryPoints);
|
|
9318
9554
|
let absWorkingDir = getFlag(options, keys, "absWorkingDir", mustBeString);
|
|
9319
|
-
let
|
|
9555
|
+
let stdin2 = getFlag(options, keys, "stdin", mustBeObject);
|
|
9320
9556
|
let write = (_a2 = getFlag(options, keys, "write", mustBeBoolean)) != null ? _a2 : writeDefault;
|
|
9321
9557
|
let allowOverwrite = getFlag(options, keys, "allowOverwrite", mustBeBoolean);
|
|
9322
9558
|
let mangleCache = getFlag(options, keys, "mangleCache", mustBeObject);
|
|
@@ -9374,18 +9610,18 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
9374
9610
|
}
|
|
9375
9611
|
if (entryPoints) {
|
|
9376
9612
|
if (Array.isArray(entryPoints)) {
|
|
9377
|
-
for (let
|
|
9378
|
-
let entryPoint = entryPoints[
|
|
9613
|
+
for (let i2 = 0, n3 = entryPoints.length; i2 < n3; i2++) {
|
|
9614
|
+
let entryPoint = entryPoints[i2];
|
|
9379
9615
|
if (typeof entryPoint === "object" && entryPoint !== null) {
|
|
9380
9616
|
let entryPointKeys = /* @__PURE__ */ Object.create(null);
|
|
9381
9617
|
let input = getFlag(entryPoint, entryPointKeys, "in", mustBeString);
|
|
9382
9618
|
let output = getFlag(entryPoint, entryPointKeys, "out", mustBeString);
|
|
9383
|
-
checkForInvalidFlags(entryPoint, entryPointKeys, "in entry point at index " +
|
|
9384
|
-
if (input === void 0) throw new Error('Missing property "in" for entry point at index ' +
|
|
9385
|
-
if (output === void 0) throw new Error('Missing property "out" for entry point at index ' +
|
|
9619
|
+
checkForInvalidFlags(entryPoint, entryPointKeys, "in entry point at index " + i2);
|
|
9620
|
+
if (input === void 0) throw new Error('Missing property "in" for entry point at index ' + i2);
|
|
9621
|
+
if (output === void 0) throw new Error('Missing property "out" for entry point at index ' + i2);
|
|
9386
9622
|
entries.push([output, input]);
|
|
9387
9623
|
} else {
|
|
9388
|
-
entries.push(["", validateStringValue(entryPoint, "entry point at index " +
|
|
9624
|
+
entries.push(["", validateStringValue(entryPoint, "entry point at index " + i2)]);
|
|
9389
9625
|
}
|
|
9390
9626
|
}
|
|
9391
9627
|
} else {
|
|
@@ -9394,13 +9630,13 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
9394
9630
|
}
|
|
9395
9631
|
}
|
|
9396
9632
|
}
|
|
9397
|
-
if (
|
|
9633
|
+
if (stdin2) {
|
|
9398
9634
|
let stdinKeys = /* @__PURE__ */ Object.create(null);
|
|
9399
|
-
let contents = getFlag(
|
|
9400
|
-
let resolveDir = getFlag(
|
|
9401
|
-
let sourcefile = getFlag(
|
|
9402
|
-
let loader2 = getFlag(
|
|
9403
|
-
checkForInvalidFlags(
|
|
9635
|
+
let contents = getFlag(stdin2, stdinKeys, "contents", mustBeStringOrUint8Array);
|
|
9636
|
+
let resolveDir = getFlag(stdin2, stdinKeys, "resolveDir", mustBeString);
|
|
9637
|
+
let sourcefile = getFlag(stdin2, stdinKeys, "sourcefile", mustBeString);
|
|
9638
|
+
let loader2 = getFlag(stdin2, stdinKeys, "loader", mustBeString);
|
|
9639
|
+
checkForInvalidFlags(stdin2, stdinKeys, 'in "stdin" object');
|
|
9404
9640
|
if (sourcefile) flags.push(`--sourcefile=${sourcefile}`);
|
|
9405
9641
|
if (loader2) flags.push(`--loader=${loader2}`);
|
|
9406
9642
|
if (resolveDir) stdinResolveDir = resolveDir;
|
|
@@ -9453,38 +9689,38 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
9453
9689
|
let responseCallbacks = {};
|
|
9454
9690
|
let nextRequestID = 0;
|
|
9455
9691
|
let nextBuildKey = 0;
|
|
9456
|
-
let
|
|
9692
|
+
let stdout2 = new Uint8Array(16 * 1024);
|
|
9457
9693
|
let stdoutUsed = 0;
|
|
9458
9694
|
let readFromStdout = (chunk) => {
|
|
9459
9695
|
let limit = stdoutUsed + chunk.length;
|
|
9460
|
-
if (limit >
|
|
9696
|
+
if (limit > stdout2.length) {
|
|
9461
9697
|
let swap = new Uint8Array(limit * 2);
|
|
9462
|
-
swap.set(
|
|
9463
|
-
|
|
9698
|
+
swap.set(stdout2);
|
|
9699
|
+
stdout2 = swap;
|
|
9464
9700
|
}
|
|
9465
|
-
|
|
9701
|
+
stdout2.set(chunk, stdoutUsed);
|
|
9466
9702
|
stdoutUsed += chunk.length;
|
|
9467
9703
|
let offset = 0;
|
|
9468
9704
|
while (offset + 4 <= stdoutUsed) {
|
|
9469
|
-
let length = readUInt32LE(
|
|
9705
|
+
let length = readUInt32LE(stdout2, offset);
|
|
9470
9706
|
if (offset + 4 + length > stdoutUsed) {
|
|
9471
9707
|
break;
|
|
9472
9708
|
}
|
|
9473
9709
|
offset += 4;
|
|
9474
|
-
handleIncomingPacket(
|
|
9710
|
+
handleIncomingPacket(stdout2.subarray(offset, offset + length));
|
|
9475
9711
|
offset += length;
|
|
9476
9712
|
}
|
|
9477
9713
|
if (offset > 0) {
|
|
9478
|
-
|
|
9714
|
+
stdout2.copyWithin(0, offset, stdoutUsed);
|
|
9479
9715
|
stdoutUsed -= offset;
|
|
9480
9716
|
}
|
|
9481
9717
|
};
|
|
9482
9718
|
let afterClose = (error2) => {
|
|
9483
9719
|
closeData.didClose = true;
|
|
9484
9720
|
if (error2) closeData.reason = ": " + (error2.message || error2);
|
|
9485
|
-
const
|
|
9721
|
+
const text2 = "The service was stopped" + closeData.reason;
|
|
9486
9722
|
for (let id in responseCallbacks) {
|
|
9487
|
-
responseCallbacks[id](
|
|
9723
|
+
responseCallbacks[id](text2, null);
|
|
9488
9724
|
}
|
|
9489
9725
|
responseCallbacks = {};
|
|
9490
9726
|
};
|
|
@@ -9968,15 +10204,15 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
9968
10204
|
let onLoadCallbacks = {};
|
|
9969
10205
|
let onDisposeCallbacks = [];
|
|
9970
10206
|
let nextCallbackID = 0;
|
|
9971
|
-
let
|
|
10207
|
+
let i2 = 0;
|
|
9972
10208
|
let requestPlugins = [];
|
|
9973
10209
|
let isSetupDone = false;
|
|
9974
10210
|
plugins = [...plugins];
|
|
9975
10211
|
for (let item of plugins) {
|
|
9976
10212
|
let keys = {};
|
|
9977
|
-
if (typeof item !== "object") throw new Error(`Plugin at index ${
|
|
10213
|
+
if (typeof item !== "object") throw new Error(`Plugin at index ${i2} must be an object`);
|
|
9978
10214
|
const name = getFlag(item, keys, "name", mustBeString);
|
|
9979
|
-
if (typeof name !== "string" || name === "") throw new Error(`Plugin at index ${
|
|
10215
|
+
if (typeof name !== "string" || name === "") throw new Error(`Plugin at index ${i2} is missing a name`);
|
|
9980
10216
|
try {
|
|
9981
10217
|
let setup = getFlag(item, keys, "setup", mustBeFunction);
|
|
9982
10218
|
if (typeof setup !== "function") throw new Error(`Plugin is missing a setup function`);
|
|
@@ -9988,7 +10224,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
9988
10224
|
onResolve: [],
|
|
9989
10225
|
onLoad: []
|
|
9990
10226
|
};
|
|
9991
|
-
|
|
10227
|
+
i2++;
|
|
9992
10228
|
let resolve5 = (path3, options = {}) => {
|
|
9993
10229
|
if (!isSetupDone) throw new Error('Cannot call "resolve" before plugin setup has completed');
|
|
9994
10230
|
if (typeof path3 !== "string") throw new Error(`The path to resolve must be a string`);
|
|
@@ -10084,7 +10320,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
10084
10320
|
requestCallbacks["on-start"] = async (id, request) => {
|
|
10085
10321
|
details.clear();
|
|
10086
10322
|
let response = { errors: [], warnings: [] };
|
|
10087
|
-
await Promise.all(onStartCallbacks.map(async ({ name, callback, note }) => {
|
|
10323
|
+
await Promise.all(onStartCallbacks.map(async ({ name, callback, note: note2 }) => {
|
|
10088
10324
|
try {
|
|
10089
10325
|
let result = await callback();
|
|
10090
10326
|
if (result != null) {
|
|
@@ -10097,16 +10333,16 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
10097
10333
|
if (warnings != null) response.warnings.push(...sanitizeMessages(warnings, "warnings", details, name, void 0));
|
|
10098
10334
|
}
|
|
10099
10335
|
} catch (e) {
|
|
10100
|
-
response.errors.push(extractErrorMessageV8(e, streamIn, details,
|
|
10336
|
+
response.errors.push(extractErrorMessageV8(e, streamIn, details, note2 && note2(), name));
|
|
10101
10337
|
}
|
|
10102
10338
|
}));
|
|
10103
10339
|
sendResponse(id, response);
|
|
10104
10340
|
};
|
|
10105
10341
|
requestCallbacks["on-resolve"] = async (id, request) => {
|
|
10106
|
-
let response = {}, name = "", callback,
|
|
10342
|
+
let response = {}, name = "", callback, note2;
|
|
10107
10343
|
for (let id2 of request.ids) {
|
|
10108
10344
|
try {
|
|
10109
|
-
({ name, callback, note } = onResolveCallbacks[id2]);
|
|
10345
|
+
({ name, callback, note: note2 } = onResolveCallbacks[id2]);
|
|
10110
10346
|
let result = await callback({
|
|
10111
10347
|
path: request.path,
|
|
10112
10348
|
importer: request.importer,
|
|
@@ -10146,17 +10382,17 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
10146
10382
|
break;
|
|
10147
10383
|
}
|
|
10148
10384
|
} catch (e) {
|
|
10149
|
-
response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details,
|
|
10385
|
+
response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note2 && note2(), name)] };
|
|
10150
10386
|
break;
|
|
10151
10387
|
}
|
|
10152
10388
|
}
|
|
10153
10389
|
sendResponse(id, response);
|
|
10154
10390
|
};
|
|
10155
10391
|
requestCallbacks["on-load"] = async (id, request) => {
|
|
10156
|
-
let response = {}, name = "", callback,
|
|
10392
|
+
let response = {}, name = "", callback, note2;
|
|
10157
10393
|
for (let id2 of request.ids) {
|
|
10158
10394
|
try {
|
|
10159
|
-
({ name, callback, note } = onLoadCallbacks[id2]);
|
|
10395
|
+
({ name, callback, note: note2 } = onLoadCallbacks[id2]);
|
|
10160
10396
|
let result = await callback({
|
|
10161
10397
|
path: request.path,
|
|
10162
10398
|
namespace: request.namespace,
|
|
@@ -10191,7 +10427,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
10191
10427
|
break;
|
|
10192
10428
|
}
|
|
10193
10429
|
} catch (e) {
|
|
10194
|
-
response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details,
|
|
10430
|
+
response = { id: id2, errors: [extractErrorMessageV8(e, streamIn, details, note2 && note2(), name)] };
|
|
10195
10431
|
break;
|
|
10196
10432
|
}
|
|
10197
10433
|
}
|
|
@@ -10203,7 +10439,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
10203
10439
|
(async () => {
|
|
10204
10440
|
const onEndErrors = [];
|
|
10205
10441
|
const onEndWarnings = [];
|
|
10206
|
-
for (const { name, callback, note } of onEndCallbacks) {
|
|
10442
|
+
for (const { name, callback, note: note2 } of onEndCallbacks) {
|
|
10207
10443
|
let newErrors;
|
|
10208
10444
|
let newWarnings;
|
|
10209
10445
|
try {
|
|
@@ -10218,7 +10454,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
10218
10454
|
if (warnings != null) newWarnings = sanitizeMessages(warnings, "warnings", details, name, void 0);
|
|
10219
10455
|
}
|
|
10220
10456
|
} catch (e) {
|
|
10221
|
-
newErrors = [extractErrorMessageV8(e, streamIn, details,
|
|
10457
|
+
newErrors = [extractErrorMessageV8(e, streamIn, details, note2 && note2(), name)];
|
|
10222
10458
|
}
|
|
10223
10459
|
if (newErrors) {
|
|
10224
10460
|
onEndErrors.push(...newErrors);
|
|
@@ -10271,43 +10507,43 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
10271
10507
|
};
|
|
10272
10508
|
}
|
|
10273
10509
|
function extractCallerV8(e, streamIn, ident) {
|
|
10274
|
-
let
|
|
10510
|
+
let note2;
|
|
10275
10511
|
let tried = false;
|
|
10276
10512
|
return () => {
|
|
10277
|
-
if (tried) return
|
|
10513
|
+
if (tried) return note2;
|
|
10278
10514
|
tried = true;
|
|
10279
10515
|
try {
|
|
10280
10516
|
let lines = (e.stack + "").split("\n");
|
|
10281
10517
|
lines.splice(1, 1);
|
|
10282
10518
|
let location = parseStackLinesV8(streamIn, lines, ident);
|
|
10283
10519
|
if (location) {
|
|
10284
|
-
|
|
10285
|
-
return
|
|
10520
|
+
note2 = { text: e.message, location };
|
|
10521
|
+
return note2;
|
|
10286
10522
|
}
|
|
10287
10523
|
} catch {
|
|
10288
10524
|
}
|
|
10289
10525
|
};
|
|
10290
10526
|
}
|
|
10291
|
-
function extractErrorMessageV8(e, streamIn, stash,
|
|
10292
|
-
let
|
|
10527
|
+
function extractErrorMessageV8(e, streamIn, stash, note2, pluginName) {
|
|
10528
|
+
let text2 = "Internal error";
|
|
10293
10529
|
let location = null;
|
|
10294
10530
|
try {
|
|
10295
|
-
|
|
10531
|
+
text2 = (e && e.message || e) + "";
|
|
10296
10532
|
} catch {
|
|
10297
10533
|
}
|
|
10298
10534
|
try {
|
|
10299
10535
|
location = parseStackLinesV8(streamIn, (e.stack + "").split("\n"), "");
|
|
10300
10536
|
} catch {
|
|
10301
10537
|
}
|
|
10302
|
-
return { id: "", pluginName, text, location, notes:
|
|
10538
|
+
return { id: "", pluginName, text: text2, location, notes: note2 ? [note2] : [], detail: stash ? stash.store(e) : -1 };
|
|
10303
10539
|
}
|
|
10304
10540
|
function parseStackLinesV8(streamIn, lines, ident) {
|
|
10305
|
-
let
|
|
10306
|
-
if (streamIn.readFileSync && !lines[0].startsWith(
|
|
10307
|
-
for (let
|
|
10308
|
-
let line = lines[
|
|
10309
|
-
if (!line.startsWith(
|
|
10310
|
-
line = line.slice(
|
|
10541
|
+
let at = " at ";
|
|
10542
|
+
if (streamIn.readFileSync && !lines[0].startsWith(at) && lines[1].startsWith(at)) {
|
|
10543
|
+
for (let i2 = 1; i2 < lines.length; i2++) {
|
|
10544
|
+
let line = lines[i2];
|
|
10545
|
+
if (!line.startsWith(at)) continue;
|
|
10546
|
+
line = line.slice(at.length);
|
|
10311
10547
|
while (true) {
|
|
10312
10548
|
let match = /^(?:new |async )?\S+ \((.*)\)$/.exec(line);
|
|
10313
10549
|
if (match) {
|
|
@@ -10346,10 +10582,10 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
10346
10582
|
}
|
|
10347
10583
|
return null;
|
|
10348
10584
|
}
|
|
10349
|
-
function failureErrorWithLog(
|
|
10585
|
+
function failureErrorWithLog(text2, errors, warnings) {
|
|
10350
10586
|
let limit = 5;
|
|
10351
|
-
|
|
10352
|
-
if (
|
|
10587
|
+
text2 += errors.length < 1 ? "" : ` with ${errors.length} error${errors.length < 2 ? "" : "s"}:` + errors.slice(0, limit + 1).map((e, i2) => {
|
|
10588
|
+
if (i2 === limit) return "\n...";
|
|
10353
10589
|
if (!e.location) return `
|
|
10354
10590
|
error: ${e.text}`;
|
|
10355
10591
|
let { file, line, column } = e.location;
|
|
@@ -10357,7 +10593,7 @@ error: ${e.text}`;
|
|
|
10357
10593
|
return `
|
|
10358
10594
|
${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`;
|
|
10359
10595
|
}).join("");
|
|
10360
|
-
let error2 = new Error(
|
|
10596
|
+
let error2 = new Error(text2);
|
|
10361
10597
|
for (const [key, value] of [["errors", errors], ["warnings", warnings]]) {
|
|
10362
10598
|
Object.defineProperty(error2, key, {
|
|
10363
10599
|
configurable: true,
|
|
@@ -10415,7 +10651,7 @@ ${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`;
|
|
|
10415
10651
|
let keys = {};
|
|
10416
10652
|
let id = getFlag(message, keys, "id", mustBeString);
|
|
10417
10653
|
let pluginName = getFlag(message, keys, "pluginName", mustBeString);
|
|
10418
|
-
let
|
|
10654
|
+
let text2 = getFlag(message, keys, "text", mustBeString);
|
|
10419
10655
|
let location = getFlag(message, keys, "location", mustBeObjectOrNull);
|
|
10420
10656
|
let notes = getFlag(message, keys, "notes", mustBeArray);
|
|
10421
10657
|
let detail = getFlag(message, keys, "detail", canBeAnything);
|
|
@@ -10423,11 +10659,11 @@ ${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`;
|
|
|
10423
10659
|
checkForInvalidFlags(message, keys, where);
|
|
10424
10660
|
let notesClone = [];
|
|
10425
10661
|
if (notes) {
|
|
10426
|
-
for (const
|
|
10662
|
+
for (const note2 of notes) {
|
|
10427
10663
|
let noteKeys = {};
|
|
10428
|
-
let noteText = getFlag(
|
|
10429
|
-
let noteLocation = getFlag(
|
|
10430
|
-
checkForInvalidFlags(
|
|
10664
|
+
let noteText = getFlag(note2, noteKeys, "text", mustBeString);
|
|
10665
|
+
let noteLocation = getFlag(note2, noteKeys, "location", mustBeObjectOrNull);
|
|
10666
|
+
checkForInvalidFlags(note2, noteKeys, where);
|
|
10431
10667
|
notesClone.push({
|
|
10432
10668
|
text: noteText || "",
|
|
10433
10669
|
location: sanitizeLocation(noteLocation, where, terminalWidth)
|
|
@@ -10437,7 +10673,7 @@ ${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`;
|
|
|
10437
10673
|
messagesClone.push({
|
|
10438
10674
|
id: id || "",
|
|
10439
10675
|
pluginName: pluginName || fallbackPluginName,
|
|
10440
|
-
text:
|
|
10676
|
+
text: text2 || "",
|
|
10441
10677
|
location: sanitizeLocation(location, where, terminalWidth),
|
|
10442
10678
|
notes: notesClone,
|
|
10443
10679
|
detail: stash ? stash.store(detail) : -1
|
|
@@ -10464,18 +10700,18 @@ ${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`;
|
|
|
10464
10700
|
return result;
|
|
10465
10701
|
}
|
|
10466
10702
|
function convertOutputFiles({ path: path3, contents, hash }) {
|
|
10467
|
-
let
|
|
10703
|
+
let text2 = null;
|
|
10468
10704
|
return {
|
|
10469
10705
|
path: path3,
|
|
10470
10706
|
contents,
|
|
10471
10707
|
hash,
|
|
10472
10708
|
get text() {
|
|
10473
10709
|
const binary = this.contents;
|
|
10474
|
-
if (
|
|
10710
|
+
if (text2 === null || binary !== contents) {
|
|
10475
10711
|
contents = binary;
|
|
10476
|
-
|
|
10712
|
+
text2 = decodeUTF8(binary);
|
|
10477
10713
|
}
|
|
10478
|
-
return
|
|
10714
|
+
return text2;
|
|
10479
10715
|
}
|
|
10480
10716
|
};
|
|
10481
10717
|
}
|
|
@@ -10485,13 +10721,13 @@ ${file}:${line}:${column}: ERROR: ${pluginText}${e.text}`;
|
|
|
10485
10721
|
return result;
|
|
10486
10722
|
}
|
|
10487
10723
|
function parseJSON(bytes) {
|
|
10488
|
-
let
|
|
10724
|
+
let text2;
|
|
10489
10725
|
try {
|
|
10490
|
-
|
|
10726
|
+
text2 = decodeUTF8(bytes);
|
|
10491
10727
|
} catch {
|
|
10492
10728
|
return JSON_parse(bytes);
|
|
10493
10729
|
}
|
|
10494
|
-
return JSON.parse(
|
|
10730
|
+
return JSON.parse(text2);
|
|
10495
10731
|
}
|
|
10496
10732
|
var fs3 = __require("fs");
|
|
10497
10733
|
var os = __require("os");
|
|
@@ -10890,13 +11126,13 @@ More information: The file containing the code for esbuild's JavaScript API (${_
|
|
|
10890
11126
|
});
|
|
10891
11127
|
child.stdin.on("error", afterClose);
|
|
10892
11128
|
child.on("error", afterClose);
|
|
10893
|
-
const
|
|
10894
|
-
const
|
|
10895
|
-
|
|
10896
|
-
|
|
11129
|
+
const stdin2 = child.stdin;
|
|
11130
|
+
const stdout2 = child.stdout;
|
|
11131
|
+
stdout2.on("data", readFromStdout);
|
|
11132
|
+
stdout2.on("end", afterClose);
|
|
10897
11133
|
stopService = () => {
|
|
10898
|
-
|
|
10899
|
-
|
|
11134
|
+
stdin2.destroy();
|
|
11135
|
+
stdout2.destroy();
|
|
10900
11136
|
child.kill();
|
|
10901
11137
|
initializeWasCalled = false;
|
|
10902
11138
|
longLivedService = void 0;
|
|
@@ -10904,11 +11140,11 @@ More information: The file containing the code for esbuild's JavaScript API (${_
|
|
|
10904
11140
|
};
|
|
10905
11141
|
let refCount = 0;
|
|
10906
11142
|
child.unref();
|
|
10907
|
-
if (
|
|
10908
|
-
|
|
11143
|
+
if (stdin2.unref) {
|
|
11144
|
+
stdin2.unref();
|
|
10909
11145
|
}
|
|
10910
|
-
if (
|
|
10911
|
-
|
|
11146
|
+
if (stdout2.unref) {
|
|
11147
|
+
stdout2.unref();
|
|
10912
11148
|
}
|
|
10913
11149
|
const refs = {
|
|
10914
11150
|
ref() {
|
|
@@ -10965,28 +11201,28 @@ More information: The file containing the code for esbuild's JavaScript API (${_
|
|
|
10965
11201
|
};
|
|
10966
11202
|
var runServiceSync = (callback) => {
|
|
10967
11203
|
let [command, args] = esbuildCommandAndArgs();
|
|
10968
|
-
let
|
|
11204
|
+
let stdin2 = new Uint8Array();
|
|
10969
11205
|
let { readFromStdout, afterClose, service } = createChannel({
|
|
10970
11206
|
writeToStdin(bytes) {
|
|
10971
|
-
if (
|
|
10972
|
-
|
|
11207
|
+
if (stdin2.length !== 0) throw new Error("Must run at most one command");
|
|
11208
|
+
stdin2 = bytes;
|
|
10973
11209
|
},
|
|
10974
11210
|
isSync: true,
|
|
10975
11211
|
hasFS: true,
|
|
10976
11212
|
esbuild: node_exports
|
|
10977
11213
|
});
|
|
10978
11214
|
callback(service);
|
|
10979
|
-
let
|
|
11215
|
+
let stdout2 = child_process.execFileSync(command, args.concat(`--service=${"0.27.7"}`), {
|
|
10980
11216
|
cwd: defaultWD,
|
|
10981
11217
|
windowsHide: true,
|
|
10982
|
-
input:
|
|
11218
|
+
input: stdin2,
|
|
10983
11219
|
// We don't know how large the output could be. If it's too large, the
|
|
10984
11220
|
// command will fail with ENOBUFS. Reserve 16mb for now since that feels
|
|
10985
11221
|
// like it should be enough. Also allow overriding this with an environment
|
|
10986
11222
|
// variable.
|
|
10987
11223
|
maxBuffer: +process.env.ESBUILD_MAX_BUFFER || 16 * 1024 * 1024
|
|
10988
11224
|
});
|
|
10989
|
-
readFromStdout(
|
|
11225
|
+
readFromStdout(stdout2);
|
|
10990
11226
|
afterClose(null);
|
|
10991
11227
|
};
|
|
10992
11228
|
var randomFileName = () => {
|
|
@@ -11010,10 +11246,10 @@ More information: The file containing the code for esbuild's JavaScript API (${_
|
|
|
11010
11246
|
execArgv: []
|
|
11011
11247
|
});
|
|
11012
11248
|
let nextID = 0;
|
|
11013
|
-
let fakeBuildError = (
|
|
11249
|
+
let fakeBuildError = (text2) => {
|
|
11014
11250
|
let error2 = new Error(`Build failed with 1 error:
|
|
11015
|
-
error: ${
|
|
11016
|
-
let errors = [{ id: "", pluginName: "", text, location: null, notes: [], detail: void 0 }];
|
|
11251
|
+
error: ${text2}`);
|
|
11252
|
+
let errors = [{ id: "", pluginName: "", text: text2, location: null, notes: [], detail: void 0 }];
|
|
11017
11253
|
error2.errors = errors;
|
|
11018
11254
|
error2.warnings = [];
|
|
11019
11255
|
return error2;
|
|
@@ -11131,13 +11367,13 @@ __export(bundle_edge_function_exports, {
|
|
|
11131
11367
|
buildSupabaseEdgeFunctions: () => buildSupabaseEdgeFunctions,
|
|
11132
11368
|
bundleEdgeFunction: () => bundleEdgeFunction
|
|
11133
11369
|
});
|
|
11134
|
-
import { resolve as resolve4, dirname as dirname4, join as join3 } from "node:path";
|
|
11135
11370
|
import fs2 from "node:fs";
|
|
11371
|
+
import { resolve as resolve4, dirname as dirname5, join as join4 } from "node:path";
|
|
11136
11372
|
function detectWorkspace() {
|
|
11137
11373
|
let currentDir = process.cwd();
|
|
11138
11374
|
const maxDepth = 10;
|
|
11139
|
-
for (let
|
|
11140
|
-
const packageJsonPath =
|
|
11375
|
+
for (let i2 = 0; i2 < maxDepth; i2++) {
|
|
11376
|
+
const packageJsonPath = join4(currentDir, "package.json");
|
|
11141
11377
|
if (fs2.existsSync(packageJsonPath)) {
|
|
11142
11378
|
try {
|
|
11143
11379
|
const packageJson = JSON.parse(
|
|
@@ -11145,20 +11381,20 @@ function detectWorkspace() {
|
|
|
11145
11381
|
);
|
|
11146
11382
|
const hasWorkspaces = Array.isArray(packageJson.workspaces);
|
|
11147
11383
|
const hasDndevPackages = hasWorkspaces && packageJson.workspaces.some(
|
|
11148
|
-
(
|
|
11384
|
+
(w) => w === "packages/**" || w.startsWith("packages/")
|
|
11149
11385
|
);
|
|
11150
|
-
const isDndevRepo = hasDndevPackages && (fs2.existsSync(
|
|
11386
|
+
const isDndevRepo = hasDndevPackages && (fs2.existsSync(join4(currentDir, "packages", "core")) || fs2.existsSync(join4(currentDir, "packages", "functions")));
|
|
11151
11387
|
if (isDndevRepo) {
|
|
11152
11388
|
return { type: "dndev", root: currentDir };
|
|
11153
11389
|
}
|
|
11154
11390
|
if (hasWorkspaces) {
|
|
11155
11391
|
const dndevPattern = packageJson.workspaces.find(
|
|
11156
|
-
(
|
|
11392
|
+
(w) => w.includes("dndev/packages")
|
|
11157
11393
|
);
|
|
11158
11394
|
if (dndevPattern) {
|
|
11159
11395
|
const dndevRelPath = dndevPattern.replace(/\/packages.*$/, "");
|
|
11160
11396
|
const dndevRoot = resolve4(currentDir, dndevRelPath);
|
|
11161
|
-
if (fs2.existsSync(
|
|
11397
|
+
if (fs2.existsSync(join4(dndevRoot, "packages", "core"))) {
|
|
11162
11398
|
return { type: "dndev", root: dndevRoot };
|
|
11163
11399
|
}
|
|
11164
11400
|
}
|
|
@@ -11166,14 +11402,14 @@ function detectWorkspace() {
|
|
|
11166
11402
|
} catch {
|
|
11167
11403
|
}
|
|
11168
11404
|
}
|
|
11169
|
-
const parentDir =
|
|
11405
|
+
const parentDir = dirname5(currentDir);
|
|
11170
11406
|
if (parentDir === currentDir) break;
|
|
11171
11407
|
currentDir = parentDir;
|
|
11172
11408
|
}
|
|
11173
11409
|
return { type: "npm", root: process.cwd() };
|
|
11174
11410
|
}
|
|
11175
11411
|
function readDenoImports(functionsDir) {
|
|
11176
|
-
const denoJsonPath =
|
|
11412
|
+
const denoJsonPath = join4(functionsDir, "deno.json");
|
|
11177
11413
|
if (!fs2.existsSync(denoJsonPath)) {
|
|
11178
11414
|
throw new Error(
|
|
11179
11415
|
`deno.json not found in ${functionsDir}. Required for edge function bundling.`
|
|
@@ -11194,7 +11430,7 @@ function resolvePackageExport(packageName, subpath, fromDir) {
|
|
|
11194
11430
|
if (!pkgDir) return null;
|
|
11195
11431
|
try {
|
|
11196
11432
|
const pkgJson = JSON.parse(
|
|
11197
|
-
fs2.readFileSync(
|
|
11433
|
+
fs2.readFileSync(join4(pkgDir, "package.json"), "utf8")
|
|
11198
11434
|
);
|
|
11199
11435
|
const exports = pkgJson.exports;
|
|
11200
11436
|
if (!exports) return null;
|
|
@@ -11371,34 +11607,34 @@ async function bundleEdgeFunction(options) {
|
|
|
11371
11607
|
const denoImports = readDenoImports(functionsDir);
|
|
11372
11608
|
const alias = {};
|
|
11373
11609
|
if (workspace.type === "dndev") {
|
|
11374
|
-
alias["@donotdev/types"] =
|
|
11610
|
+
alias["@donotdev/types"] = join4(
|
|
11375
11611
|
workspace.root,
|
|
11376
11612
|
"packages",
|
|
11377
11613
|
"core",
|
|
11378
11614
|
"types",
|
|
11379
11615
|
"src"
|
|
11380
11616
|
);
|
|
11381
|
-
alias["@donotdev/functions"] =
|
|
11617
|
+
alias["@donotdev/functions"] = join4(
|
|
11382
11618
|
workspace.root,
|
|
11383
11619
|
"packages",
|
|
11384
11620
|
"functions",
|
|
11385
11621
|
"src"
|
|
11386
11622
|
);
|
|
11387
|
-
alias["@donotdev/utils"] =
|
|
11623
|
+
alias["@donotdev/utils"] = join4(
|
|
11388
11624
|
workspace.root,
|
|
11389
11625
|
"packages",
|
|
11390
11626
|
"core",
|
|
11391
11627
|
"utils",
|
|
11392
11628
|
"src"
|
|
11393
11629
|
);
|
|
11394
|
-
alias["@donotdev/schemas"] =
|
|
11630
|
+
alias["@donotdev/schemas"] = join4(
|
|
11395
11631
|
workspace.root,
|
|
11396
11632
|
"packages",
|
|
11397
11633
|
"core",
|
|
11398
11634
|
"schemas",
|
|
11399
11635
|
"src"
|
|
11400
11636
|
);
|
|
11401
|
-
alias["@donotdev/core"] =
|
|
11637
|
+
alias["@donotdev/core"] = join4(workspace.root, "packages", "core");
|
|
11402
11638
|
}
|
|
11403
11639
|
const config = {
|
|
11404
11640
|
entryPoints: [entryPointPath],
|
|
@@ -11431,7 +11667,7 @@ ${errorMessages}`);
|
|
|
11431
11667
|
}
|
|
11432
11668
|
if (result.warnings.length > 0) {
|
|
11433
11669
|
for (const warning of result.warnings) {
|
|
11434
|
-
|
|
11670
|
+
log2.debug(`[bundle-edge] Warning: ${warning.text}`);
|
|
11435
11671
|
}
|
|
11436
11672
|
}
|
|
11437
11673
|
if (!result.outputFiles?.[0]) {
|
|
@@ -11440,45 +11676,45 @@ ${errorMessages}`);
|
|
|
11440
11676
|
return result.outputFiles[0].text;
|
|
11441
11677
|
}
|
|
11442
11678
|
async function buildSupabaseEdgeFunctions(functionsDir) {
|
|
11443
|
-
const buildDir =
|
|
11679
|
+
const buildDir = join4(functionsDir, ".build");
|
|
11444
11680
|
fs2.mkdirSync(buildDir, { recursive: true });
|
|
11445
11681
|
const entries = fs2.readdirSync(functionsDir).filter((item) => {
|
|
11446
|
-
const itemPath =
|
|
11682
|
+
const itemPath = join4(functionsDir, item);
|
|
11447
11683
|
if (!fs2.statSync(itemPath).isDirectory()) return false;
|
|
11448
11684
|
if (item === ".build") return false;
|
|
11449
|
-
return fs2.existsSync(
|
|
11685
|
+
return fs2.existsSync(join4(itemPath, "index.ts"));
|
|
11450
11686
|
});
|
|
11451
11687
|
if (entries.length === 0) {
|
|
11452
|
-
|
|
11688
|
+
log2.warn("No edge functions found (no index.ts in any subdirectory)");
|
|
11453
11689
|
return { success: true, functions: [], errors: [] };
|
|
11454
11690
|
}
|
|
11455
|
-
|
|
11691
|
+
log2.info(`Bundling ${entries.length} edge function(s)...`);
|
|
11456
11692
|
const results = [];
|
|
11457
11693
|
const errors = [];
|
|
11458
11694
|
for (const functionName of entries) {
|
|
11459
|
-
const entryPointPath =
|
|
11695
|
+
const entryPointPath = join4(functionsDir, functionName, "index.ts");
|
|
11460
11696
|
try {
|
|
11461
11697
|
const bundled = await bundleEdgeFunction({
|
|
11462
11698
|
entryPointPath,
|
|
11463
11699
|
functionsDir
|
|
11464
11700
|
});
|
|
11465
|
-
const outputPath =
|
|
11701
|
+
const outputPath = join4(buildDir, `${functionName}.js`);
|
|
11466
11702
|
fs2.writeFileSync(outputPath, bundled, "utf8");
|
|
11467
11703
|
const size = Buffer.byteLength(bundled, "utf8");
|
|
11468
11704
|
results.push({ name: functionName, outputPath, size });
|
|
11469
|
-
|
|
11705
|
+
log2.info(` ${functionName} \u2192 ${(size / 1024).toFixed(1)} KB`);
|
|
11470
11706
|
} catch (error2) {
|
|
11471
11707
|
const msg = error2 instanceof Error ? error2.message : String(error2);
|
|
11472
11708
|
errors.push(`${functionName}: ${msg}`);
|
|
11473
|
-
|
|
11709
|
+
log2.error(` ${functionName} \u2014 FAILED: ${msg}`);
|
|
11474
11710
|
}
|
|
11475
11711
|
}
|
|
11476
11712
|
if (errors.length > 0) {
|
|
11477
|
-
|
|
11713
|
+
log2.error(`
|
|
11478
11714
|
${errors.length} function(s) failed to bundle`);
|
|
11479
11715
|
return { success: false, functions: results, errors };
|
|
11480
11716
|
}
|
|
11481
|
-
|
|
11717
|
+
log2.info(`
|
|
11482
11718
|
All ${results.length} function(s) built to ${buildDir}`);
|
|
11483
11719
|
return { success: true, functions: results, errors: [] };
|
|
11484
11720
|
}
|
|
@@ -11505,13 +11741,6 @@ init_utils2();
|
|
|
11505
11741
|
|
|
11506
11742
|
// packages/tooling/src/apps/build.ts
|
|
11507
11743
|
init_utils2();
|
|
11508
|
-
init_app_detection();
|
|
11509
|
-
init_app_selector();
|
|
11510
|
-
init_cli_input();
|
|
11511
|
-
init_cli_output();
|
|
11512
|
-
init_errors();
|
|
11513
|
-
init_pathResolver();
|
|
11514
|
-
init_typed_file_operations();
|
|
11515
11744
|
import { execSync, spawnSync as spawnSync2 } from "node:child_process";
|
|
11516
11745
|
|
|
11517
11746
|
// packages/tooling/src/apps/deploy-utils.ts
|
|
@@ -11530,14 +11759,21 @@ function checkConfigPlaceholders(appDir) {
|
|
|
11530
11759
|
}
|
|
11531
11760
|
}
|
|
11532
11761
|
if (bad.length > 0) {
|
|
11533
|
-
|
|
11534
|
-
|
|
11762
|
+
log2.warn(`Unreplaced template placeholders found in: ${bad.join(", ")}`);
|
|
11763
|
+
log2.warn(` Fix manually or re-run "dndev init" to regenerate.
|
|
11535
11764
|
`);
|
|
11536
11765
|
}
|
|
11537
11766
|
return bad.length > 0;
|
|
11538
11767
|
}
|
|
11539
11768
|
|
|
11540
11769
|
// packages/tooling/src/apps/build.ts
|
|
11770
|
+
init_app_detection();
|
|
11771
|
+
init_app_selector();
|
|
11772
|
+
init_cli_input();
|
|
11773
|
+
init_cli_output();
|
|
11774
|
+
init_errors();
|
|
11775
|
+
init_pathResolver();
|
|
11776
|
+
init_typed_file_operations();
|
|
11541
11777
|
function validateFirebaseJson(appDir) {
|
|
11542
11778
|
const firebaseJsonPath = joinPath(appDir, "firebase.json");
|
|
11543
11779
|
if (!pathExists(firebaseJsonPath)) {
|
|
@@ -11600,8 +11836,8 @@ async function main(options = {}) {
|
|
|
11600
11836
|
const { appName: parsedAppName, buildType: parsedBuildType } = parseBuildArgs(args);
|
|
11601
11837
|
const debugMode = process.env.DEBUG === "true" || process.env.DEBUG === "1" || args.includes("--debug") || args.includes("-d");
|
|
11602
11838
|
if (debugMode) {
|
|
11603
|
-
|
|
11604
|
-
|
|
11839
|
+
log2.debug(` Args: ${args.join(" ")}`);
|
|
11840
|
+
log2.debug(
|
|
11605
11841
|
` Parsed app: ${parsedAppName || "none"}, build type: ${parsedBuildType || "none"}
|
|
11606
11842
|
`
|
|
11607
11843
|
);
|
|
@@ -11647,12 +11883,12 @@ async function main(options = {}) {
|
|
|
11647
11883
|
});
|
|
11648
11884
|
}
|
|
11649
11885
|
if (choices.length === 0) {
|
|
11650
|
-
|
|
11886
|
+
log2.error("No build targets found. App must have frontend or functions.");
|
|
11651
11887
|
throw new DoNotDevError("No build targets found", "validation-error");
|
|
11652
11888
|
}
|
|
11653
11889
|
if (choices.length === 1) {
|
|
11654
11890
|
buildType = choices[0].value;
|
|
11655
|
-
|
|
11891
|
+
note(`Building: ${choices[0].title}`, "Auto-selected");
|
|
11656
11892
|
} else {
|
|
11657
11893
|
buildType = await askForSelection(
|
|
11658
11894
|
"What would you like to build?",
|
|
@@ -11662,7 +11898,7 @@ async function main(options = {}) {
|
|
|
11662
11898
|
}
|
|
11663
11899
|
if (buildType === "frontend" || buildType === "both") {
|
|
11664
11900
|
if (!hasFrontend) {
|
|
11665
|
-
|
|
11901
|
+
log2.error(
|
|
11666
11902
|
"Frontend build requested but app has no frontend configuration."
|
|
11667
11903
|
);
|
|
11668
11904
|
throw new DoNotDevError(
|
|
@@ -11670,7 +11906,7 @@ async function main(options = {}) {
|
|
|
11670
11906
|
"validation-error"
|
|
11671
11907
|
);
|
|
11672
11908
|
}
|
|
11673
|
-
|
|
11909
|
+
log2.info(`Building ${app.name} frontend...
|
|
11674
11910
|
`);
|
|
11675
11911
|
const turboArgs = ["build", "--filter", app.packageName];
|
|
11676
11912
|
if (options.mode) {
|
|
@@ -11691,7 +11927,7 @@ async function main(options = {}) {
|
|
|
11691
11927
|
}
|
|
11692
11928
|
if (buildType === "functions" || buildType === "both") {
|
|
11693
11929
|
if (!hasFunc) {
|
|
11694
|
-
|
|
11930
|
+
log2.error(
|
|
11695
11931
|
"Functions build requested but app has no functions directory."
|
|
11696
11932
|
);
|
|
11697
11933
|
throw new DoNotDevError(
|
|
@@ -11701,13 +11937,13 @@ async function main(options = {}) {
|
|
|
11701
11937
|
}
|
|
11702
11938
|
const funcPath = getFunctionsPath(app);
|
|
11703
11939
|
if (!funcPath || !pathExists(funcPath)) {
|
|
11704
|
-
|
|
11940
|
+
log2.error(`Functions directory not found: ${funcPath}`);
|
|
11705
11941
|
throw new DoNotDevError(
|
|
11706
11942
|
`Functions directory not found: ${funcPath}`,
|
|
11707
11943
|
"file-not-found"
|
|
11708
11944
|
);
|
|
11709
11945
|
}
|
|
11710
|
-
|
|
11946
|
+
log2.info(`Building ${app.name} functions (${app.functions})...
|
|
11711
11947
|
`);
|
|
11712
11948
|
if (app.functions === "supabase") {
|
|
11713
11949
|
const { buildSupabaseEdgeFunctions: buildSupabaseEdgeFunctions2 } = await Promise.resolve().then(() => (init_bundle_edge_function(), bundle_edge_function_exports));
|
|
@@ -11719,7 +11955,7 @@ async function main(options = {}) {
|
|
|
11719
11955
|
);
|
|
11720
11956
|
}
|
|
11721
11957
|
} else {
|
|
11722
|
-
const s =
|
|
11958
|
+
const s = spinner();
|
|
11723
11959
|
s.start("Building functions...");
|
|
11724
11960
|
try {
|
|
11725
11961
|
execSync("bun run build", {
|
|
@@ -11737,7 +11973,7 @@ async function main(options = {}) {
|
|
|
11737
11973
|
}
|
|
11738
11974
|
}
|
|
11739
11975
|
}
|
|
11740
|
-
|
|
11976
|
+
log2.success(`Build complete for ${app.name}`);
|
|
11741
11977
|
return 0;
|
|
11742
11978
|
}
|
|
11743
11979
|
export {
|