@donotdev/cli 0.1.45 → 0.2.0
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 +191 -150
- package/dist/bin/commands/agent-setup.js +632 -524
- package/dist/bin/commands/build.js +1239 -935
- package/dist/bin/commands/bump.js +1285 -946
- package/dist/bin/commands/cacheout.js +543 -405
- package/dist/bin/commands/coach.js +546 -408
- package/dist/bin/commands/create-app.js +1198 -862
- package/dist/bin/commands/create-project.js +1238 -902
- package/dist/bin/commands/db.js +139128 -93775
- package/dist/bin/commands/deploy.js +2308 -1936
- package/dist/bin/commands/dev.js +912 -662
- package/dist/bin/commands/doctor.js +634 -526
- package/dist/bin/commands/emu.js +1093 -785
- package/dist/bin/commands/format.js +588 -450
- package/dist/bin/commands/get-demo.js +1043 -756
- package/dist/bin/commands/make-admin.js +20974 -38424
- package/dist/bin/commands/preview.js +913 -663
- package/dist/bin/commands/seed.js +139129 -93776
- package/dist/bin/commands/setup-cicd.js +1130 -817
- package/dist/bin/commands/setup.js +1299 -960
- package/dist/bin/commands/staging.js +2308 -1936
- package/dist/bin/commands/sync-secrets.js +996 -733
- package/dist/bin/commands/type-check.js +733 -598
- package/dist/bin/commands/wai.js +533 -395
- package/dist/bin/dndev.js +9 -8
- package/dist/index.js +2720 -2290
- package/package.json +3 -3
- package/templates/app-next/src/app/ClientLayout.tsx.example +11 -1
- package/templates/app-next/src/app/layout.tsx.example +19 -1
- package/templates/functions-firebase/src/billing/handleStripeWebhook.ts.example +8 -18
- package/templates/functions-firebase/src/billing/index.ts.example +0 -1
- package/templates/functions-firebase/src/billing/refreshSubscriptionStatus.ts.example +4 -8
- package/templates/functions-firebase/src/index.ts.example +0 -1
- package/templates/functions-supabase/supabase/config.toml.example +4 -0
- package/templates/functions-supabase/supabase/functions/stripe-webhook/index.ts.example +12 -0
- package/templates/functions-supabase/supabase/migrations/20250101000005_webhook_events.sql +133 -0
- package/templates/functions-vercel/.env.example +9 -0
- package/templates/functions-vercel/src/api/billing/handleStripeWebhook.ts.example +12 -14
- package/templates/functions-vercel/src/api/billing/refreshSubscriptionStatus.ts.example +4 -14
- package/templates/overlay-supabase/src/config/providers.ts.example +2 -2
- package/templates/root-consumer/.claude/hooks/guard-write.sh.example +32 -0
- package/templates/root-consumer/.claude/hooks/record-lookup.sh.example +22 -0
- package/templates/root-consumer/.claude/rules/definition-of-done.md.example +7 -0
- package/templates/root-consumer/.claude/rules/framework.md.example +6 -0
- package/templates/root-consumer/.claude/settings.json.example +11 -1
- package/templates/functions-firebase/src/billing/processPaymentSuccess.ts.example +0 -14
- package/templates/functions-vercel/src/api/billing/processPaymentSuccess.ts.example +0 -20
package/dist/bin/commands/dev.js
CHANGED
|
@@ -5,16 +5,25 @@ 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');
|
|
12
12
|
});
|
|
13
|
-
var __esm = (fn, res) => function __init() {
|
|
14
|
-
|
|
13
|
+
var __esm = (fn, res, err) => function __init() {
|
|
14
|
+
if (err) throw err[0];
|
|
15
|
+
try {
|
|
16
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
17
|
+
} catch (e) {
|
|
18
|
+
throw err = [e], e;
|
|
19
|
+
}
|
|
15
20
|
};
|
|
16
21
|
var __commonJS = (cb, mod) => function __require2() {
|
|
17
|
-
|
|
22
|
+
try {
|
|
23
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
24
|
+
} catch (e) {
|
|
25
|
+
throw mod = 0, e;
|
|
26
|
+
}
|
|
18
27
|
};
|
|
19
28
|
var __copyProps = (to, from, except, desc) => {
|
|
20
29
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
@@ -33,31 +42,40 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
42
|
mod
|
|
34
43
|
));
|
|
35
44
|
|
|
36
|
-
// node_modules/.bun/fast-string-truncated-width@
|
|
37
|
-
var
|
|
45
|
+
// node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
|
|
46
|
+
var getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji;
|
|
38
47
|
var init_utils = __esm({
|
|
39
|
-
"node_modules/.bun/fast-string-truncated-width@
|
|
48
|
+
"node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js"() {
|
|
40
49
|
init_utils2();
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
50
|
+
getCodePointsLength = /* @__PURE__ */ (() => {
|
|
51
|
+
const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
52
|
+
return (input) => {
|
|
53
|
+
let surrogatePairsNr = 0;
|
|
54
|
+
SURROGATE_PAIR_RE.lastIndex = 0;
|
|
55
|
+
while (SURROGATE_PAIR_RE.test(input)) {
|
|
56
|
+
surrogatePairsNr += 1;
|
|
57
|
+
}
|
|
58
|
+
return input.length - surrogatePairsNr;
|
|
59
|
+
};
|
|
60
|
+
})();
|
|
44
61
|
isFullWidth = (x) => {
|
|
45
62
|
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
46
63
|
};
|
|
47
|
-
|
|
48
|
-
return x
|
|
64
|
+
isWideNotCJKTNotEmoji = (x) => {
|
|
65
|
+
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;
|
|
49
66
|
};
|
|
50
67
|
}
|
|
51
68
|
});
|
|
52
69
|
|
|
53
|
-
// node_modules/.bun/fast-string-truncated-width@
|
|
54
|
-
var ANSI_RE, CONTROL_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
|
|
70
|
+
// node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
|
|
71
|
+
var ANSI_RE, CONTROL_RE, CJKT_WIDE_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
|
|
55
72
|
var init_dist = __esm({
|
|
56
|
-
"node_modules/.bun/fast-string-truncated-width@
|
|
73
|
+
"node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js"() {
|
|
57
74
|
init_utils2();
|
|
58
75
|
init_utils();
|
|
59
|
-
ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
|
|
76
|
+
ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
|
|
60
77
|
CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
78
|
+
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;
|
|
61
79
|
TAB_RE = /\t{1,1000}/y;
|
|
62
80
|
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");
|
|
63
81
|
LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
@@ -67,14 +85,21 @@ var init_dist = __esm({
|
|
|
67
85
|
const LIMIT = truncationOptions.limit ?? Infinity;
|
|
68
86
|
const ELLIPSIS = truncationOptions.ellipsis ?? "";
|
|
69
87
|
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
|
|
70
|
-
const ANSI_WIDTH =
|
|
88
|
+
const ANSI_WIDTH = 0;
|
|
71
89
|
const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
|
|
72
90
|
const TAB_WIDTH = widthOptions.tabWidth ?? 8;
|
|
73
|
-
const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
|
|
74
91
|
const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
|
|
75
|
-
const FULL_WIDTH_WIDTH =
|
|
92
|
+
const FULL_WIDTH_WIDTH = 2;
|
|
76
93
|
const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
|
|
77
|
-
const WIDE_WIDTH = widthOptions.wideWidth ??
|
|
94
|
+
const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
|
|
95
|
+
const PARSE_BLOCKS = [
|
|
96
|
+
[LATIN_RE, REGULAR_WIDTH],
|
|
97
|
+
[ANSI_RE, ANSI_WIDTH],
|
|
98
|
+
[CONTROL_RE, CONTROL_WIDTH],
|
|
99
|
+
[TAB_RE, TAB_WIDTH],
|
|
100
|
+
[EMOJI_RE, EMOJI_WIDTH],
|
|
101
|
+
[CJKT_WIDE_RE, WIDE_WIDTH]
|
|
102
|
+
];
|
|
78
103
|
let indexPrev = 0;
|
|
79
104
|
let index = 0;
|
|
80
105
|
let length = input.length;
|
|
@@ -94,10 +119,8 @@ var init_dist = __esm({
|
|
|
94
119
|
const codePoint = char.codePointAt(0) || 0;
|
|
95
120
|
if (isFullWidth(codePoint)) {
|
|
96
121
|
widthExtra = FULL_WIDTH_WIDTH;
|
|
97
|
-
} else if (
|
|
122
|
+
} else if (isWideNotCJKTNotEmoji(codePoint)) {
|
|
98
123
|
widthExtra = WIDE_WIDTH;
|
|
99
|
-
} else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) {
|
|
100
|
-
widthExtra = AMBIGUOUS_WIDTH;
|
|
101
124
|
} else {
|
|
102
125
|
widthExtra = REGULAR_WIDTH;
|
|
103
126
|
}
|
|
@@ -113,88 +136,28 @@ var init_dist = __esm({
|
|
|
113
136
|
}
|
|
114
137
|
unmatchedStart = unmatchedEnd = 0;
|
|
115
138
|
}
|
|
116
|
-
if (index >= length)
|
|
117
|
-
break;
|
|
118
|
-
LATIN_RE.lastIndex = index;
|
|
119
|
-
if (LATIN_RE.test(input)) {
|
|
120
|
-
lengthExtra = LATIN_RE.lastIndex - index;
|
|
121
|
-
widthExtra = lengthExtra * REGULAR_WIDTH;
|
|
122
|
-
if (width + widthExtra > truncationLimit) {
|
|
123
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
|
|
124
|
-
}
|
|
125
|
-
if (width + widthExtra > LIMIT) {
|
|
126
|
-
truncationEnabled = true;
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
|
-
width += widthExtra;
|
|
130
|
-
unmatchedStart = indexPrev;
|
|
131
|
-
unmatchedEnd = index;
|
|
132
|
-
index = indexPrev = LATIN_RE.lastIndex;
|
|
133
|
-
continue;
|
|
134
|
-
}
|
|
135
|
-
ANSI_RE.lastIndex = index;
|
|
136
|
-
if (ANSI_RE.test(input)) {
|
|
137
|
-
if (width + ANSI_WIDTH > truncationLimit) {
|
|
138
|
-
truncationIndex = Math.min(truncationIndex, index);
|
|
139
|
-
}
|
|
140
|
-
if (width + ANSI_WIDTH > LIMIT) {
|
|
141
|
-
truncationEnabled = true;
|
|
142
|
-
break;
|
|
143
|
-
}
|
|
144
|
-
width += ANSI_WIDTH;
|
|
145
|
-
unmatchedStart = indexPrev;
|
|
146
|
-
unmatchedEnd = index;
|
|
147
|
-
index = indexPrev = ANSI_RE.lastIndex;
|
|
148
|
-
continue;
|
|
149
|
-
}
|
|
150
|
-
CONTROL_RE.lastIndex = index;
|
|
151
|
-
if (CONTROL_RE.test(input)) {
|
|
152
|
-
lengthExtra = CONTROL_RE.lastIndex - index;
|
|
153
|
-
widthExtra = lengthExtra * CONTROL_WIDTH;
|
|
154
|
-
if (width + widthExtra > truncationLimit) {
|
|
155
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
|
|
156
|
-
}
|
|
157
|
-
if (width + widthExtra > LIMIT) {
|
|
158
|
-
truncationEnabled = true;
|
|
159
|
-
break;
|
|
160
|
-
}
|
|
161
|
-
width += widthExtra;
|
|
162
|
-
unmatchedStart = indexPrev;
|
|
163
|
-
unmatchedEnd = index;
|
|
164
|
-
index = indexPrev = CONTROL_RE.lastIndex;
|
|
165
|
-
continue;
|
|
139
|
+
if (index >= length) {
|
|
140
|
+
break outer;
|
|
166
141
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
if (EMOJI_RE.test(input)) {
|
|
186
|
-
if (width + EMOJI_WIDTH > truncationLimit) {
|
|
187
|
-
truncationIndex = Math.min(truncationIndex, index);
|
|
188
|
-
}
|
|
189
|
-
if (width + EMOJI_WIDTH > LIMIT) {
|
|
190
|
-
truncationEnabled = true;
|
|
191
|
-
break;
|
|
142
|
+
for (let i2 = 0, l = PARSE_BLOCKS.length; i2 < l; i2++) {
|
|
143
|
+
const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i2];
|
|
144
|
+
BLOCK_RE.lastIndex = index;
|
|
145
|
+
if (BLOCK_RE.test(input)) {
|
|
146
|
+
lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
|
|
147
|
+
widthExtra = lengthExtra * BLOCK_WIDTH;
|
|
148
|
+
if (width + widthExtra > truncationLimit) {
|
|
149
|
+
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
|
|
150
|
+
}
|
|
151
|
+
if (width + widthExtra > LIMIT) {
|
|
152
|
+
truncationEnabled = true;
|
|
153
|
+
break outer;
|
|
154
|
+
}
|
|
155
|
+
width += widthExtra;
|
|
156
|
+
unmatchedStart = indexPrev;
|
|
157
|
+
unmatchedEnd = index;
|
|
158
|
+
index = indexPrev = BLOCK_RE.lastIndex;
|
|
159
|
+
continue outer;
|
|
192
160
|
}
|
|
193
|
-
width += EMOJI_WIDTH;
|
|
194
|
-
unmatchedStart = indexPrev;
|
|
195
|
-
unmatchedEnd = index;
|
|
196
|
-
index = indexPrev = EMOJI_RE.lastIndex;
|
|
197
|
-
continue;
|
|
198
161
|
}
|
|
199
162
|
index += 1;
|
|
200
163
|
}
|
|
@@ -209,10 +172,10 @@ var init_dist = __esm({
|
|
|
209
172
|
}
|
|
210
173
|
});
|
|
211
174
|
|
|
212
|
-
// node_modules/.bun/fast-string-width@
|
|
175
|
+
// node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
|
|
213
176
|
var NO_TRUNCATION2, fastStringWidth, dist_default2;
|
|
214
177
|
var init_dist2 = __esm({
|
|
215
|
-
"node_modules/.bun/fast-string-width@
|
|
178
|
+
"node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js"() {
|
|
216
179
|
init_utils2();
|
|
217
180
|
init_dist();
|
|
218
181
|
NO_TRUNCATION2 = {
|
|
@@ -227,13 +190,13 @@ var init_dist2 = __esm({
|
|
|
227
190
|
}
|
|
228
191
|
});
|
|
229
192
|
|
|
230
|
-
// node_modules/.bun/fast-wrap-ansi@0.
|
|
193
|
+
// node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js
|
|
231
194
|
function wrapAnsi(string, columns, options) {
|
|
232
195
|
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
|
|
233
196
|
}
|
|
234
197
|
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;
|
|
235
198
|
var init_main = __esm({
|
|
236
|
-
"node_modules/.bun/fast-wrap-ansi@0.
|
|
199
|
+
"node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js"() {
|
|
237
200
|
init_utils2();
|
|
238
201
|
init_dist2();
|
|
239
202
|
ESC = "\x1B";
|
|
@@ -397,16 +360,19 @@ var init_main = __esm({
|
|
|
397
360
|
}
|
|
398
361
|
const preString = rows.join("\n");
|
|
399
362
|
let inSurrogate = false;
|
|
400
|
-
for (let
|
|
401
|
-
const character = preString[
|
|
363
|
+
for (let i2 = 0; i2 < preString.length; i2++) {
|
|
364
|
+
const character = preString[i2];
|
|
402
365
|
returnValue += character;
|
|
403
366
|
if (!inSurrogate) {
|
|
404
367
|
inSurrogate = character >= "\uD800" && character <= "\uDBFF";
|
|
368
|
+
if (inSurrogate) {
|
|
369
|
+
continue;
|
|
370
|
+
}
|
|
405
371
|
} else {
|
|
406
|
-
|
|
372
|
+
inSurrogate = false;
|
|
407
373
|
}
|
|
408
374
|
if (character === ESC || character === CSI) {
|
|
409
|
-
GROUP_REGEX.lastIndex =
|
|
375
|
+
GROUP_REGEX.lastIndex = i2 + 1;
|
|
410
376
|
const groupsResult = GROUP_REGEX.exec(preString);
|
|
411
377
|
const groups = groupsResult?.groups;
|
|
412
378
|
if (groups?.code !== void 0) {
|
|
@@ -416,7 +382,7 @@ var init_main = __esm({
|
|
|
416
382
|
escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
417
383
|
}
|
|
418
384
|
}
|
|
419
|
-
if (preString[
|
|
385
|
+
if (preString[i2 + 1] === "\n") {
|
|
420
386
|
if (escapeUrl) {
|
|
421
387
|
returnValue += wrapAnsiHyperlink("");
|
|
422
388
|
}
|
|
@@ -447,7 +413,7 @@ var require_src = __commonJS({
|
|
|
447
413
|
var ESC2 = "\x1B";
|
|
448
414
|
var CSI2 = `${ESC2}[`;
|
|
449
415
|
var beep = "\x07";
|
|
450
|
-
var
|
|
416
|
+
var cursor3 = {
|
|
451
417
|
to(x, y2) {
|
|
452
418
|
if (!y2) return `${CSI2}${x + 1}G`;
|
|
453
419
|
return `${CSI2}${y2 + 1};${x + 1}H`;
|
|
@@ -476,7 +442,7 @@ var require_src = __commonJS({
|
|
|
476
442
|
up: (count = 1) => `${CSI2}S`.repeat(count),
|
|
477
443
|
down: (count = 1) => `${CSI2}T`.repeat(count)
|
|
478
444
|
};
|
|
479
|
-
var
|
|
445
|
+
var erase3 = {
|
|
480
446
|
screen: `${CSI2}2J`,
|
|
481
447
|
up: (count = 1) => `${CSI2}1J`.repeat(count),
|
|
482
448
|
down: (count = 1) => `${CSI2}J`.repeat(count),
|
|
@@ -485,64 +451,134 @@ var require_src = __commonJS({
|
|
|
485
451
|
lineStart: `${CSI2}1K`,
|
|
486
452
|
lines(count) {
|
|
487
453
|
let clear = "";
|
|
488
|
-
for (let
|
|
489
|
-
clear += this.line + (
|
|
454
|
+
for (let i2 = 0; i2 < count; i2++)
|
|
455
|
+
clear += this.line + (i2 < count - 1 ? cursor3.up() : "");
|
|
490
456
|
if (count)
|
|
491
|
-
clear +=
|
|
457
|
+
clear += cursor3.left;
|
|
492
458
|
return clear;
|
|
493
459
|
}
|
|
494
460
|
};
|
|
495
|
-
module.exports = { cursor, scroll, erase, beep };
|
|
461
|
+
module.exports = { cursor: cursor3, scroll, erase: erase3, beep };
|
|
496
462
|
}
|
|
497
463
|
});
|
|
498
464
|
|
|
499
|
-
// node_modules/.bun/@clack+core@1.
|
|
500
|
-
import { styleText
|
|
501
|
-
import { stdout
|
|
502
|
-
import
|
|
503
|
-
import { ReadStream
|
|
504
|
-
function
|
|
505
|
-
if (!
|
|
506
|
-
|
|
507
|
-
|
|
465
|
+
// node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs
|
|
466
|
+
import { styleText } from "node:util";
|
|
467
|
+
import { stdout, stdin } from "node:process";
|
|
468
|
+
import l__default from "node:readline";
|
|
469
|
+
import { ReadStream } from "node:tty";
|
|
470
|
+
function findCursor(s, o, l) {
|
|
471
|
+
if (!l.some((r2) => !r2.disabled))
|
|
472
|
+
return s;
|
|
473
|
+
const t2 = s + o, n3 = Math.max(l.length - 1, 0), e = t2 < 0 ? n3 : t2 > n3 ? 0 : t2;
|
|
474
|
+
return l[e]?.disabled ? findCursor(e, o < 0 ? -1 : 1, l) : e;
|
|
508
475
|
}
|
|
509
|
-
function
|
|
510
|
-
if (
|
|
511
|
-
|
|
476
|
+
function isAccessible(n3) {
|
|
477
|
+
if (n3 !== void 0) return n3;
|
|
478
|
+
if (settings.accessible !== void 0) return settings.accessible;
|
|
479
|
+
const e = process.env.ACCESSIBLE;
|
|
480
|
+
return e !== void 0 && e !== "" && e !== "0" && e !== "false";
|
|
481
|
+
}
|
|
482
|
+
function isActionKey(n3, e) {
|
|
483
|
+
if (typeof n3 == "string")
|
|
484
|
+
return settings.aliases.get(n3) === e;
|
|
485
|
+
for (const s of n3)
|
|
486
|
+
if (s !== void 0 && isActionKey(s, e))
|
|
487
|
+
return true;
|
|
512
488
|
return false;
|
|
513
489
|
}
|
|
514
|
-
function
|
|
515
|
-
if (
|
|
516
|
-
const e =
|
|
517
|
-
`),
|
|
518
|
-
`),
|
|
519
|
-
for (let
|
|
520
|
-
|
|
490
|
+
function diffLines(i2, s) {
|
|
491
|
+
if (i2 === s) return;
|
|
492
|
+
const e = i2.split(`
|
|
493
|
+
`), t2 = s.split(`
|
|
494
|
+
`), r2 = Math.max(e.length, t2.length), f = [];
|
|
495
|
+
for (let n3 = 0; n3 < r2; n3++)
|
|
496
|
+
e[n3] !== t2[n3] && f.push(n3);
|
|
497
|
+
return {
|
|
498
|
+
lines: f,
|
|
499
|
+
numLinesBefore: e.length,
|
|
500
|
+
numLinesAfter: t2.length,
|
|
501
|
+
numLines: r2
|
|
502
|
+
};
|
|
521
503
|
}
|
|
522
|
-
function
|
|
523
|
-
const
|
|
524
|
-
|
|
504
|
+
function setRawMode(e, r2) {
|
|
505
|
+
const o = e;
|
|
506
|
+
o.isTTY && o.setRawMode(r2);
|
|
525
507
|
}
|
|
526
|
-
function
|
|
527
|
-
const
|
|
528
|
-
return wrapAnsi(
|
|
529
|
-
|
|
508
|
+
function wrapTextWithPrefix(e, r2, o, n3 = o, s = o, t2) {
|
|
509
|
+
const f = getColumns(e ?? stdout);
|
|
510
|
+
return wrapAnsi(r2, f - o.length, {
|
|
511
|
+
hard: true,
|
|
512
|
+
trim: false
|
|
513
|
+
}).split(`
|
|
514
|
+
`).map((c2, i2, m) => {
|
|
515
|
+
const d = t2 ? t2(c2, i2) : c2;
|
|
516
|
+
return i2 === 0 ? `${n3}${d}` : i2 === m.length - 1 ? `${s}${d}` : `${o}${d}`;
|
|
517
|
+
}).join(`
|
|
530
518
|
`);
|
|
531
519
|
}
|
|
532
|
-
|
|
520
|
+
function runValidation(e, a2) {
|
|
521
|
+
if ("~standard" in e) {
|
|
522
|
+
const n3 = e["~standard"].validate(a2);
|
|
523
|
+
return n3 instanceof Promise ? n3.then((r2) => r2.issues?.at(0)?.message) : n3.issues?.at(0)?.message;
|
|
524
|
+
}
|
|
525
|
+
return e(a2);
|
|
526
|
+
}
|
|
527
|
+
var import_sisteransi, a$1, t, settings, R, CANCEL_SYMBOL, getColumns, getRows, y, n$1;
|
|
533
528
|
var init_dist3 = __esm({
|
|
534
|
-
"node_modules/.bun/@clack+core@1.
|
|
529
|
+
"node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs"() {
|
|
535
530
|
init_utils2();
|
|
536
531
|
init_main();
|
|
537
532
|
import_sisteransi = __toESM(require_src(), 1);
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
533
|
+
a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
534
|
+
t = [
|
|
535
|
+
"January",
|
|
536
|
+
"February",
|
|
537
|
+
"March",
|
|
538
|
+
"April",
|
|
539
|
+
"May",
|
|
540
|
+
"June",
|
|
541
|
+
"July",
|
|
542
|
+
"August",
|
|
543
|
+
"September",
|
|
544
|
+
"October",
|
|
545
|
+
"November",
|
|
546
|
+
"December"
|
|
547
|
+
];
|
|
548
|
+
settings = {
|
|
549
|
+
actions: new Set(a$1),
|
|
550
|
+
aliases: /* @__PURE__ */ new Map([
|
|
551
|
+
// vim support
|
|
552
|
+
["k", "up"],
|
|
553
|
+
["j", "down"],
|
|
554
|
+
["h", "left"],
|
|
555
|
+
["l", "right"],
|
|
556
|
+
["", "cancel"],
|
|
557
|
+
// opinionated defaults!
|
|
558
|
+
["escape", "cancel"]
|
|
559
|
+
]),
|
|
560
|
+
messages: {
|
|
561
|
+
cancel: "Canceled",
|
|
562
|
+
error: "Something went wrong"
|
|
563
|
+
},
|
|
564
|
+
withGuide: true,
|
|
565
|
+
accessible: void 0,
|
|
566
|
+
date: {
|
|
567
|
+
monthNames: [...t],
|
|
568
|
+
messages: {
|
|
569
|
+
required: "Please enter a valid date",
|
|
570
|
+
invalidMonth: "There are only 12 months in a year",
|
|
571
|
+
invalidDay: (n3, e) => `There are only ${n3} days in ${e}`,
|
|
572
|
+
afterMin: (n3) => `Date must be on or after ${n3.toISOString().slice(0, 10)}`,
|
|
573
|
+
beforeMax: (n3) => `Date must be on or before ${n3.toISOString().slice(0, 10)}`
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
R = globalThis.process.platform.startsWith("win");
|
|
578
|
+
CANCEL_SYMBOL = /* @__PURE__ */ Symbol("clack:cancel");
|
|
579
|
+
getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
|
|
580
|
+
getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
|
|
581
|
+
y = class {
|
|
546
582
|
input;
|
|
547
583
|
output;
|
|
548
584
|
_abortSignal;
|
|
@@ -557,46 +593,92 @@ var init_dist3 = __esm({
|
|
|
557
593
|
error = "";
|
|
558
594
|
value;
|
|
559
595
|
userInput = "";
|
|
596
|
+
/**
|
|
597
|
+
* Whether accessible (static, screen-reader friendly) output is enabled for
|
|
598
|
+
* this prompt, resolved from the `accessible` option, the global setting,
|
|
599
|
+
* and the `ACCESSIBLE` env var.
|
|
600
|
+
*/
|
|
601
|
+
get accessible() {
|
|
602
|
+
return isAccessible(this.opts.accessible);
|
|
603
|
+
}
|
|
560
604
|
constructor(t2, e = true) {
|
|
561
|
-
const { input:
|
|
562
|
-
this.opts =
|
|
605
|
+
const { input: i2 = stdin, output: s = stdout, render: r2, signal: n3, ...o } = t2;
|
|
606
|
+
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;
|
|
563
607
|
}
|
|
608
|
+
/**
|
|
609
|
+
* Unsubscribe all listeners
|
|
610
|
+
*/
|
|
564
611
|
unsubscribe() {
|
|
565
612
|
this._subscribers.clear();
|
|
566
613
|
}
|
|
614
|
+
/**
|
|
615
|
+
* Set a subscriber with opts
|
|
616
|
+
* @param event - The event name
|
|
617
|
+
*/
|
|
567
618
|
setSubscriber(t2, e) {
|
|
568
|
-
const
|
|
569
|
-
|
|
619
|
+
const i2 = this._subscribers.get(t2) ?? [];
|
|
620
|
+
i2.push(e), this._subscribers.set(t2, i2);
|
|
570
621
|
}
|
|
622
|
+
/**
|
|
623
|
+
* Subscribe to an event
|
|
624
|
+
* @param event - The event name
|
|
625
|
+
* @param cb - The callback
|
|
626
|
+
*/
|
|
571
627
|
on(t2, e) {
|
|
572
628
|
this.setSubscriber(t2, { cb: e });
|
|
573
629
|
}
|
|
630
|
+
/**
|
|
631
|
+
* Subscribe to an event once
|
|
632
|
+
* @param event - The event name
|
|
633
|
+
* @param cb - The callback
|
|
634
|
+
*/
|
|
574
635
|
once(t2, e) {
|
|
575
636
|
this.setSubscriber(t2, { cb: e, once: true });
|
|
576
637
|
}
|
|
638
|
+
/**
|
|
639
|
+
* Emit an event with data
|
|
640
|
+
* @param event - The event name
|
|
641
|
+
* @param data - The data to pass to the callback
|
|
642
|
+
*/
|
|
577
643
|
emit(t2, ...e) {
|
|
578
|
-
const
|
|
579
|
-
for (const
|
|
580
|
-
|
|
644
|
+
const i2 = this._subscribers.get(t2) ?? [], s = [];
|
|
645
|
+
for (const r2 of i2)
|
|
646
|
+
r2.cb(...e), r2.once && s.push(() => i2.splice(i2.indexOf(r2), 1));
|
|
647
|
+
for (const r2 of s)
|
|
648
|
+
r2();
|
|
581
649
|
}
|
|
582
650
|
prompt() {
|
|
583
651
|
return new Promise((t2) => {
|
|
584
652
|
if (this._abortSignal) {
|
|
585
|
-
if (this._abortSignal.aborted)
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
653
|
+
if (this._abortSignal.aborted)
|
|
654
|
+
return this.state = "cancel", this.close(), t2(CANCEL_SYMBOL);
|
|
655
|
+
this._abortSignal.addEventListener(
|
|
656
|
+
"abort",
|
|
657
|
+
() => {
|
|
658
|
+
this.state = "cancel", this.close();
|
|
659
|
+
},
|
|
660
|
+
{ once: true }
|
|
661
|
+
);
|
|
589
662
|
}
|
|
590
|
-
this.rl =
|
|
591
|
-
|
|
663
|
+
this.rl = l__default.createInterface({
|
|
664
|
+
input: this.input,
|
|
665
|
+
tabSize: 2,
|
|
666
|
+
prompt: "",
|
|
667
|
+
escapeCodeTimeout: 50,
|
|
668
|
+
terminal: true
|
|
669
|
+
}), 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", () => {
|
|
670
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(this.value);
|
|
592
671
|
}), this.once("cancel", () => {
|
|
593
|
-
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render),
|
|
672
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(CANCEL_SYMBOL);
|
|
594
673
|
});
|
|
595
674
|
});
|
|
596
675
|
}
|
|
597
676
|
_isActionKey(t2, e) {
|
|
598
677
|
return t2 === " ";
|
|
599
678
|
}
|
|
679
|
+
_shouldSubmit(t2, e) {
|
|
680
|
+
return true;
|
|
681
|
+
}
|
|
600
682
|
_setValue(t2) {
|
|
601
683
|
this.value = t2, this.emit("value", this.value);
|
|
602
684
|
}
|
|
@@ -606,19 +688,22 @@ var init_dist3 = __esm({
|
|
|
606
688
|
_clearUserInput() {
|
|
607
689
|
this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
|
|
608
690
|
}
|
|
609
|
-
onKeypress(t2, e) {
|
|
610
|
-
if (this.
|
|
611
|
-
if (this.
|
|
612
|
-
|
|
613
|
-
|
|
691
|
+
async onKeypress(t2, e) {
|
|
692
|
+
if (this.state !== "validating") {
|
|
693
|
+
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)) {
|
|
694
|
+
if (this.opts.validate) {
|
|
695
|
+
const i2 = runValidation(this.opts.validate, this.value);
|
|
696
|
+
let s;
|
|
697
|
+
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));
|
|
698
|
+
}
|
|
699
|
+
this.state !== "error" && (this.state = "submit");
|
|
614
700
|
}
|
|
615
|
-
this.state
|
|
701
|
+
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();
|
|
616
702
|
}
|
|
617
|
-
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();
|
|
618
703
|
}
|
|
619
704
|
close() {
|
|
620
705
|
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
621
|
-
`),
|
|
706
|
+
`), setRawMode(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
622
707
|
}
|
|
623
708
|
restoreCursor() {
|
|
624
709
|
const t2 = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
|
|
@@ -626,34 +711,39 @@ var init_dist3 = __esm({
|
|
|
626
711
|
this.output.write(import_sisteransi.cursor.move(-999, t2 * -1));
|
|
627
712
|
}
|
|
628
713
|
render() {
|
|
629
|
-
const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
|
|
714
|
+
const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
|
|
715
|
+
hard: true,
|
|
716
|
+
trim: false
|
|
717
|
+
});
|
|
630
718
|
if (t2 !== this._prevFrame) {
|
|
631
|
-
if (this.state === "initial")
|
|
719
|
+
if (this.state === "initial")
|
|
720
|
+
this.output.write(import_sisteransi.cursor.hide);
|
|
632
721
|
else {
|
|
633
|
-
const e =
|
|
722
|
+
const e = diffLines(this._prevFrame, t2), i2 = getRows(this.output);
|
|
634
723
|
if (this.restoreCursor(), e) {
|
|
635
|
-
const
|
|
636
|
-
let
|
|
637
|
-
if (
|
|
724
|
+
const s = Math.max(0, e.numLinesAfter - i2), r2 = Math.max(0, e.numLinesBefore - i2);
|
|
725
|
+
let n3 = e.lines.find((o) => o >= s);
|
|
726
|
+
if (n3 === void 0) {
|
|
638
727
|
this._prevFrame = t2;
|
|
639
728
|
return;
|
|
640
729
|
}
|
|
641
730
|
if (e.lines.length === 1) {
|
|
642
|
-
this.output.write(import_sisteransi.cursor.move(0,
|
|
643
|
-
const
|
|
731
|
+
this.output.write(import_sisteransi.cursor.move(0, n3 - r2)), this.output.write(import_sisteransi.erase.lines(1));
|
|
732
|
+
const o = t2.split(`
|
|
644
733
|
`);
|
|
645
|
-
this.output.write(
|
|
734
|
+
this.output.write(o[n3]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, o.length - n3 - 1));
|
|
646
735
|
return;
|
|
647
736
|
} else if (e.lines.length > 1) {
|
|
648
|
-
if (
|
|
737
|
+
if (s < r2)
|
|
738
|
+
n3 = s;
|
|
649
739
|
else {
|
|
650
|
-
const
|
|
651
|
-
|
|
740
|
+
const h2 = n3 - r2;
|
|
741
|
+
h2 > 0 && this.output.write(import_sisteransi.cursor.move(0, h2));
|
|
652
742
|
}
|
|
653
743
|
this.output.write(import_sisteransi.erase.down());
|
|
654
|
-
const
|
|
655
|
-
`).slice(
|
|
656
|
-
this.output.write(
|
|
744
|
+
const f = t2.split(`
|
|
745
|
+
`).slice(n3);
|
|
746
|
+
this.output.write(f.join(`
|
|
657
747
|
`)), this._prevFrame = t2;
|
|
658
748
|
return;
|
|
659
749
|
}
|
|
@@ -664,27 +754,28 @@ var init_dist3 = __esm({
|
|
|
664
754
|
}
|
|
665
755
|
}
|
|
666
756
|
};
|
|
667
|
-
|
|
757
|
+
n$1 = class n extends y {
|
|
668
758
|
options;
|
|
669
759
|
cursor = 0;
|
|
670
760
|
get _selectedValue() {
|
|
671
761
|
return this.options[this.cursor];
|
|
672
762
|
}
|
|
673
763
|
changeValue() {
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
764
|
+
const e = this._selectedValue;
|
|
765
|
+
this.value = e === void 0 ? void 0 : e.value;
|
|
766
|
+
}
|
|
767
|
+
constructor(e) {
|
|
768
|
+
super(e, false), this.options = e.options;
|
|
769
|
+
const o = this.options.findIndex(({ value: s }) => s === e.initialValue), t2 = o === -1 ? 0 : o;
|
|
770
|
+
this.cursor = this.options[t2]?.disabled ? findCursor(t2, 1, this.options) : t2, this.changeValue(), this.on("cursor", (s) => {
|
|
771
|
+
switch (s) {
|
|
681
772
|
case "left":
|
|
682
773
|
case "up":
|
|
683
|
-
this.cursor =
|
|
774
|
+
this.cursor = findCursor(this.cursor, -1, this.options);
|
|
684
775
|
break;
|
|
685
776
|
case "down":
|
|
686
777
|
case "right":
|
|
687
|
-
this.cursor =
|
|
778
|
+
this.cursor = findCursor(this.cursor, 1, this.options);
|
|
688
779
|
break;
|
|
689
780
|
}
|
|
690
781
|
this.changeValue();
|
|
@@ -694,181 +785,285 @@ var init_dist3 = __esm({
|
|
|
694
785
|
}
|
|
695
786
|
});
|
|
696
787
|
|
|
697
|
-
// node_modules/.bun/@clack+prompts@1.
|
|
698
|
-
import { styleText as
|
|
699
|
-
import
|
|
700
|
-
import { existsSync
|
|
701
|
-
import { dirname
|
|
702
|
-
function
|
|
703
|
-
|
|
788
|
+
// node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs
|
|
789
|
+
import { styleText as styleText2, stripVTControlCharacters } from "node:util";
|
|
790
|
+
import process$1 from "node:process";
|
|
791
|
+
import { existsSync, lstatSync, readdirSync } from "node:fs";
|
|
792
|
+
import { dirname, join } from "node:path";
|
|
793
|
+
function isUnicodeSupported() {
|
|
794
|
+
if (process$1.platform !== "win32") {
|
|
795
|
+
return process$1.env.TERM !== "linux";
|
|
796
|
+
}
|
|
797
|
+
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";
|
|
704
798
|
}
|
|
705
|
-
|
|
799
|
+
function formatInstructionFooter(o, e) {
|
|
800
|
+
const r2 = [`${e ? `${styleText2("cyan", S_BAR)} ` : ""}${o.join(" \u2022 ")}`];
|
|
801
|
+
return e && r2.push(styleText2("cyan", S_BAR_END)), r2;
|
|
802
|
+
}
|
|
803
|
+
var import_sisteransi2, unicode, 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, u2, SELECT_INSTRUCTIONS, c, select, i;
|
|
706
804
|
var init_dist4 = __esm({
|
|
707
|
-
"node_modules/.bun/@clack+prompts@1.
|
|
805
|
+
"node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs"() {
|
|
708
806
|
init_utils2();
|
|
709
807
|
init_dist3();
|
|
710
808
|
init_dist3();
|
|
711
809
|
init_main();
|
|
712
810
|
init_dist2();
|
|
713
811
|
import_sisteransi2 = __toESM(require_src(), 1);
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
switch (
|
|
812
|
+
unicode = isUnicodeSupported();
|
|
813
|
+
unicodeOr = (o, e) => unicode ? o : e;
|
|
814
|
+
S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
|
|
815
|
+
S_STEP_CANCEL = unicodeOr("\u25A0", "x");
|
|
816
|
+
S_STEP_ERROR = unicodeOr("\u25B2", "x");
|
|
817
|
+
S_STEP_SUBMIT = unicodeOr("\u25C7", "o");
|
|
818
|
+
S_BAR_START = unicodeOr("\u250C", "T");
|
|
819
|
+
S_BAR = unicodeOr("\u2502", "|");
|
|
820
|
+
S_BAR_END = unicodeOr("\u2514", "\u2014");
|
|
821
|
+
S_BAR_START_RIGHT = unicodeOr("\u2510", "T");
|
|
822
|
+
S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014");
|
|
823
|
+
S_RADIO_ACTIVE = unicodeOr("\u25CF", ">");
|
|
824
|
+
S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
|
|
825
|
+
S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
|
|
826
|
+
S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
|
|
827
|
+
S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
|
|
828
|
+
S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022");
|
|
829
|
+
S_BAR_H = unicodeOr("\u2500", "-");
|
|
830
|
+
S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+");
|
|
831
|
+
S_CONNECT_LEFT = unicodeOr("\u251C", "+");
|
|
832
|
+
S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+");
|
|
833
|
+
S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+");
|
|
834
|
+
S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+");
|
|
835
|
+
S_INFO = unicodeOr("\u25CF", "\u2022");
|
|
836
|
+
S_SUCCESS = unicodeOr("\u25C6", "*");
|
|
837
|
+
S_WARN = unicodeOr("\u25B2", "!");
|
|
838
|
+
S_ERROR = unicodeOr("\u25A0", "x");
|
|
839
|
+
symbol = (o) => {
|
|
840
|
+
switch (o) {
|
|
743
841
|
case "initial":
|
|
744
842
|
case "active":
|
|
745
|
-
return
|
|
843
|
+
return styleText2("cyan", S_STEP_ACTIVE);
|
|
746
844
|
case "cancel":
|
|
747
|
-
return
|
|
845
|
+
return styleText2("red", S_STEP_CANCEL);
|
|
748
846
|
case "error":
|
|
749
|
-
return
|
|
847
|
+
return styleText2("yellow", S_STEP_ERROR);
|
|
750
848
|
case "submit":
|
|
751
|
-
return
|
|
849
|
+
return styleText2("green", S_STEP_SUBMIT);
|
|
850
|
+
case "validating":
|
|
851
|
+
return styleText2("dim", S_STEP_ACTIVE);
|
|
752
852
|
}
|
|
753
853
|
};
|
|
754
|
-
|
|
755
|
-
switch (
|
|
854
|
+
symbolBar = (o) => {
|
|
855
|
+
switch (o) {
|
|
756
856
|
case "initial":
|
|
757
857
|
case "active":
|
|
758
|
-
return
|
|
858
|
+
return styleText2("cyan", S_BAR);
|
|
759
859
|
case "cancel":
|
|
760
|
-
return
|
|
860
|
+
return styleText2("red", S_BAR);
|
|
761
861
|
case "error":
|
|
762
|
-
return
|
|
862
|
+
return styleText2("yellow", S_BAR);
|
|
763
863
|
case "submit":
|
|
764
|
-
return
|
|
765
|
-
}
|
|
766
|
-
};
|
|
767
|
-
|
|
768
|
-
let
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
864
|
+
return styleText2("green", S_BAR);
|
|
865
|
+
}
|
|
866
|
+
};
|
|
867
|
+
I = (l, e, w, p, b, C = false) => {
|
|
868
|
+
let r2 = e, O = 0;
|
|
869
|
+
if (C)
|
|
870
|
+
for (let i2 = p - 1; i2 >= w; i2--) {
|
|
871
|
+
const m = l[i2];
|
|
872
|
+
if (m && (r2 -= m.length), O++, r2 <= b) break;
|
|
873
|
+
}
|
|
874
|
+
else
|
|
875
|
+
for (let i2 = w; i2 < p; i2++) {
|
|
876
|
+
const m = l[i2];
|
|
877
|
+
if (m && (r2 -= m.length), O++, r2 <= b) break;
|
|
878
|
+
}
|
|
879
|
+
return { lineCount: r2, removals: O };
|
|
880
|
+
};
|
|
881
|
+
limitOptions = ({
|
|
882
|
+
cursor: l,
|
|
883
|
+
options: e,
|
|
884
|
+
style: w,
|
|
885
|
+
output: p = process.stdout,
|
|
886
|
+
maxItems: b = Number.POSITIVE_INFINITY,
|
|
887
|
+
columnPadding: C = 0,
|
|
888
|
+
rowPadding: r2 = 4
|
|
889
|
+
}) => {
|
|
890
|
+
const i2 = getColumns(p) - C, m = getRows(p), M = styleText2("dim", "..."), v = Math.max(m - r2, 0), a2 = Math.max(Math.min(b, v), 5);
|
|
781
891
|
let f = 0;
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
892
|
+
l >= a2 - 3 && (f = Math.max(
|
|
893
|
+
Math.min(l - a2 + 3, e.length - a2),
|
|
894
|
+
0
|
|
895
|
+
));
|
|
896
|
+
let d = a2 < e.length && f > 0, c2 = a2 < e.length && f + a2 < e.length;
|
|
897
|
+
const W = Math.min(
|
|
898
|
+
f + a2,
|
|
899
|
+
e.length
|
|
900
|
+
), s = [];
|
|
901
|
+
let g = 0;
|
|
902
|
+
d && g++, c2 && g++;
|
|
903
|
+
const T = f + (d ? 1 : 0), y2 = W - (c2 ? 1 : 0);
|
|
904
|
+
for (let t2 = T; t2 < y2; t2++) {
|
|
905
|
+
const n3 = e[t2], o = n3 ? w(n3, t2 === l) : "", h2 = wrapAnsi(o, i2, {
|
|
906
|
+
hard: true,
|
|
907
|
+
trim: false
|
|
908
|
+
}).split(`
|
|
786
909
|
`);
|
|
787
|
-
|
|
788
|
-
}
|
|
789
|
-
if (
|
|
790
|
-
let
|
|
791
|
-
const
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
910
|
+
s.push(h2), g += h2.length;
|
|
911
|
+
}
|
|
912
|
+
if (g > v) {
|
|
913
|
+
let t2 = 0, n3 = 0, o = g;
|
|
914
|
+
const h2 = l - T;
|
|
915
|
+
let u3 = v;
|
|
916
|
+
const L = () => I(s, o, 0, h2, u3), E = () => I(
|
|
917
|
+
s,
|
|
918
|
+
o,
|
|
919
|
+
h2 + 1,
|
|
920
|
+
s.length,
|
|
921
|
+
u3,
|
|
922
|
+
true
|
|
923
|
+
);
|
|
924
|
+
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));
|
|
925
|
+
}
|
|
926
|
+
const x = [];
|
|
927
|
+
d && x.push(M);
|
|
928
|
+
for (const t2 of s)
|
|
929
|
+
for (const n3 of t2)
|
|
930
|
+
x.push(n3);
|
|
931
|
+
return c2 && x.push(M), x;
|
|
932
|
+
};
|
|
933
|
+
MULTISELECT_INSTRUCTIONS = [
|
|
934
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
935
|
+
`${styleText2("dim", "Space:")} select`,
|
|
936
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
937
|
+
];
|
|
938
|
+
log = {
|
|
939
|
+
message: (s = [], {
|
|
940
|
+
symbol: e = styleText2("gray", S_BAR),
|
|
941
|
+
secondarySymbol: r2 = styleText2("gray", S_BAR),
|
|
942
|
+
output: m = process.stdout,
|
|
943
|
+
spacing: l = 1,
|
|
944
|
+
withGuide: c2
|
|
945
|
+
} = {}) => {
|
|
946
|
+
const t2 = [], o = c2 ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
|
|
947
|
+
for (let i2 = 0; i2 < l; i2++)
|
|
948
|
+
t2.push(f);
|
|
949
|
+
const g = Array.isArray(s) ? s : s.split(`
|
|
803
950
|
`);
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
951
|
+
if (g.length > 0) {
|
|
952
|
+
const [i2, ...y2] = g;
|
|
953
|
+
i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
|
|
954
|
+
for (const p of y2)
|
|
955
|
+
p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
|
|
956
|
+
}
|
|
957
|
+
m.write(`${t2.join(`
|
|
810
958
|
`)}
|
|
811
959
|
`);
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
960
|
+
},
|
|
961
|
+
info: (s, e) => {
|
|
962
|
+
log.message(s, { ...e, symbol: styleText2("blue", S_INFO) });
|
|
963
|
+
},
|
|
964
|
+
success: (s, e) => {
|
|
965
|
+
log.message(s, { ...e, symbol: styleText2("green", S_SUCCESS) });
|
|
966
|
+
},
|
|
967
|
+
step: (s, e) => {
|
|
968
|
+
log.message(s, { ...e, symbol: styleText2("green", S_STEP_SUBMIT) });
|
|
969
|
+
},
|
|
970
|
+
warn: (s, e) => {
|
|
971
|
+
log.message(s, { ...e, symbol: styleText2("yellow", S_WARN) });
|
|
972
|
+
},
|
|
973
|
+
/** alias for `log.warn()`. */
|
|
974
|
+
warning: (s, e) => {
|
|
975
|
+
log.warn(s, e);
|
|
976
|
+
},
|
|
977
|
+
error: (s, e) => {
|
|
978
|
+
log.message(s, { ...e, symbol: styleText2("red", S_ERROR) });
|
|
979
|
+
}
|
|
980
|
+
};
|
|
981
|
+
u2 = {
|
|
982
|
+
light: unicodeOr("\u2500", "-"),
|
|
983
|
+
heavy: unicodeOr("\u2501", "="),
|
|
984
|
+
block: unicodeOr("\u2588", "#")
|
|
985
|
+
};
|
|
986
|
+
SELECT_INSTRUCTIONS = [
|
|
987
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
988
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
989
|
+
];
|
|
990
|
+
c = (t2, o) => t2.includes(`
|
|
991
|
+
`) ? t2.split(`
|
|
992
|
+
`).map((d) => o(d)).join(`
|
|
993
|
+
`) : o(t2);
|
|
994
|
+
select = (t2) => {
|
|
995
|
+
const o = (n3, m) => {
|
|
996
|
+
if (n3 === void 0)
|
|
997
|
+
return "";
|
|
998
|
+
const s = n3.label ?? String(n3.value);
|
|
999
|
+
switch (m) {
|
|
834
1000
|
case "disabled":
|
|
835
|
-
return `${
|
|
1001
|
+
return `${styleText2("gray", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("gray", i2))}${n3.hint ? ` ${styleText2("dim", `(${n3.hint ?? "disabled"})`)}` : ""}`;
|
|
836
1002
|
case "selected":
|
|
837
|
-
return `${
|
|
1003
|
+
return `${c(s, (i2) => styleText2("dim", i2))}`;
|
|
838
1004
|
case "active":
|
|
839
|
-
return `${
|
|
1005
|
+
return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${n3.hint ? ` ${styleText2("dim", `(${n3.hint})`)}` : ""}`;
|
|
840
1006
|
case "cancelled":
|
|
841
|
-
return `${
|
|
1007
|
+
return `${c(s, (i2) => styleText2(["strikethrough", "dim"], i2))}`;
|
|
842
1008
|
default:
|
|
843
|
-
return `${
|
|
844
|
-
}
|
|
845
|
-
};
|
|
846
|
-
return new
|
|
847
|
-
|
|
848
|
-
|
|
1009
|
+
return `${styleText2("dim", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("dim", i2))}`;
|
|
1010
|
+
}
|
|
1011
|
+
}, d = t2.showInstructions ?? true;
|
|
1012
|
+
return new n$1({
|
|
1013
|
+
options: t2.options,
|
|
1014
|
+
signal: t2.signal,
|
|
1015
|
+
input: t2.input,
|
|
1016
|
+
output: t2.output,
|
|
1017
|
+
initialValue: t2.initialValue,
|
|
1018
|
+
render() {
|
|
1019
|
+
const n3 = t2.withGuide ?? settings.withGuide, m = `${symbol(this.state)} `, s = `${symbolBar(this.state)} `, i2 = wrapTextWithPrefix(
|
|
1020
|
+
t2.output,
|
|
1021
|
+
t2.message,
|
|
1022
|
+
s,
|
|
1023
|
+
m
|
|
1024
|
+
), u3 = `${n3 ? `${styleText2("gray", S_BAR)}
|
|
1025
|
+
` : ""}${i2}
|
|
849
1026
|
`;
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
${
|
|
1027
|
+
switch (this.state) {
|
|
1028
|
+
case "submit": {
|
|
1029
|
+
const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
|
|
1030
|
+
t2.output,
|
|
1031
|
+
o(this.options[this.cursor], "selected"),
|
|
1032
|
+
r2
|
|
1033
|
+
);
|
|
1034
|
+
return `${u3}${a2}`;
|
|
1035
|
+
}
|
|
1036
|
+
case "cancel": {
|
|
1037
|
+
const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
|
|
1038
|
+
t2.output,
|
|
1039
|
+
o(this.options[this.cursor], "cancelled"),
|
|
1040
|
+
r2
|
|
1041
|
+
);
|
|
1042
|
+
return `${u3}${a2}${n3 ? `
|
|
1043
|
+
${styleText2("gray", S_BAR)}` : ""}`;
|
|
1044
|
+
}
|
|
1045
|
+
default: {
|
|
1046
|
+
const r2 = n3 ? `${styleText2("cyan", S_BAR)} ` : "", a2 = u3.split(`
|
|
1047
|
+
`).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], f = p.join(`
|
|
1048
|
+
`), b = p.length + 1;
|
|
1049
|
+
return `${u3}${r2}${limitOptions({
|
|
1050
|
+
output: t2.output,
|
|
1051
|
+
cursor: this.cursor,
|
|
1052
|
+
options: this.options,
|
|
1053
|
+
maxItems: t2.maxItems,
|
|
1054
|
+
columnPadding: r2.length,
|
|
1055
|
+
rowPadding: a2 + b,
|
|
1056
|
+
style: (g, x) => o(g, g.disabled ? "disabled" : x ? "active" : "inactive")
|
|
1057
|
+
}).join(`
|
|
1058
|
+
${r2}`)}
|
|
1059
|
+
${f}
|
|
866
1060
|
`;
|
|
1061
|
+
}
|
|
867
1062
|
}
|
|
868
1063
|
}
|
|
869
|
-
}
|
|
1064
|
+
}).prompt();
|
|
870
1065
|
};
|
|
871
|
-
|
|
1066
|
+
i = `${styleText2("gray", S_BAR)} `;
|
|
872
1067
|
}
|
|
873
1068
|
});
|
|
874
1069
|
|
|
@@ -913,7 +1108,7 @@ function stringify(value) {
|
|
|
913
1108
|
function formatMessage(...args) {
|
|
914
1109
|
return args.map(stringify).join(" ");
|
|
915
1110
|
}
|
|
916
|
-
var colors, currentLogLevel,
|
|
1111
|
+
var colors, currentLogLevel, log2, error, warn, info, success;
|
|
917
1112
|
var init_cli_output = __esm({
|
|
918
1113
|
"packages/tooling/src/utils/cli-output.ts"() {
|
|
919
1114
|
"use strict";
|
|
@@ -946,7 +1141,7 @@ var init_cli_output = __esm({
|
|
|
946
1141
|
currentLogLevel = envLevel;
|
|
947
1142
|
}
|
|
948
1143
|
}
|
|
949
|
-
|
|
1144
|
+
log2 = {
|
|
950
1145
|
/**
|
|
951
1146
|
* Logs an error message (always shows unless Quiet level)
|
|
952
1147
|
* Uses clack's log.error + explicit red color
|
|
@@ -954,7 +1149,7 @@ var init_cli_output = __esm({
|
|
|
954
1149
|
error(...args) {
|
|
955
1150
|
if (currentLogLevel < 0 /* Quiet */) return;
|
|
956
1151
|
const message = formatMessage(...args);
|
|
957
|
-
|
|
1152
|
+
log.error(colorize(message, colors.brightRed));
|
|
958
1153
|
},
|
|
959
1154
|
/**
|
|
960
1155
|
* Logs a warning message (shows at Normal level and above)
|
|
@@ -963,7 +1158,7 @@ var init_cli_output = __esm({
|
|
|
963
1158
|
warn(...args) {
|
|
964
1159
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
965
1160
|
const message = formatMessage(...args);
|
|
966
|
-
|
|
1161
|
+
log.warn(colorize(message, colors.brightYellow));
|
|
967
1162
|
},
|
|
968
1163
|
/**
|
|
969
1164
|
* Logs an info message (shows at Normal level and above)
|
|
@@ -972,7 +1167,7 @@ var init_cli_output = __esm({
|
|
|
972
1167
|
info(...args) {
|
|
973
1168
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
974
1169
|
const message = formatMessage(...args);
|
|
975
|
-
|
|
1170
|
+
log.info(colorize(message, colors.brightCyan));
|
|
976
1171
|
},
|
|
977
1172
|
/**
|
|
978
1173
|
* Logs a success message (shows at Normal level and above)
|
|
@@ -981,7 +1176,7 @@ var init_cli_output = __esm({
|
|
|
981
1176
|
success(...args) {
|
|
982
1177
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
983
1178
|
const message = formatMessage(...args);
|
|
984
|
-
|
|
1179
|
+
log.success(colorize(message, colors.brightGreen));
|
|
985
1180
|
},
|
|
986
1181
|
/**
|
|
987
1182
|
* Logs a debug message (only shows at Verbose level and above)
|
|
@@ -990,7 +1185,7 @@ var init_cli_output = __esm({
|
|
|
990
1185
|
debug(...args) {
|
|
991
1186
|
if (currentLogLevel < 2 /* Verbose */) return;
|
|
992
1187
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
993
|
-
|
|
1188
|
+
log.message(
|
|
994
1189
|
colorize(
|
|
995
1190
|
`[${timeStamp}] \u{1F50D} DEBUG: ${formatMessage(...args)}`,
|
|
996
1191
|
colors.gray
|
|
@@ -1004,7 +1199,7 @@ var init_cli_output = __esm({
|
|
|
1004
1199
|
trace(...args) {
|
|
1005
1200
|
if (currentLogLevel < 3 /* Debug */) return;
|
|
1006
1201
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
1007
|
-
|
|
1202
|
+
log.message(
|
|
1008
1203
|
colorize(
|
|
1009
1204
|
`[${timeStamp}] \u{1F52C} TRACE: ${formatMessage(...args)}`,
|
|
1010
1205
|
colors.gray
|
|
@@ -1012,10 +1207,10 @@ var init_cli_output = __esm({
|
|
|
1012
1207
|
);
|
|
1013
1208
|
}
|
|
1014
1209
|
};
|
|
1015
|
-
error =
|
|
1016
|
-
warn =
|
|
1017
|
-
info =
|
|
1018
|
-
success =
|
|
1210
|
+
error = log2.error.bind(log2);
|
|
1211
|
+
warn = log2.warn.bind(log2);
|
|
1212
|
+
info = log2.info.bind(log2);
|
|
1213
|
+
success = log2.success.bind(log2);
|
|
1019
1214
|
}
|
|
1020
1215
|
});
|
|
1021
1216
|
|
|
@@ -1375,9 +1570,9 @@ var require_is_glob = __commonJS({
|
|
|
1375
1570
|
index += 2;
|
|
1376
1571
|
var close = chars[open];
|
|
1377
1572
|
if (close) {
|
|
1378
|
-
var
|
|
1379
|
-
if (
|
|
1380
|
-
index =
|
|
1573
|
+
var n3 = str.indexOf(close, index);
|
|
1574
|
+
if (n3 !== -1) {
|
|
1575
|
+
index = n3 + 1;
|
|
1381
1576
|
}
|
|
1382
1577
|
}
|
|
1383
1578
|
if (str[index] === "!") {
|
|
@@ -1403,9 +1598,9 @@ var require_is_glob = __commonJS({
|
|
|
1403
1598
|
index += 2;
|
|
1404
1599
|
var close = chars[open];
|
|
1405
1600
|
if (close) {
|
|
1406
|
-
var
|
|
1407
|
-
if (
|
|
1408
|
-
index =
|
|
1601
|
+
var n3 = str.indexOf(close, index);
|
|
1602
|
+
if (n3 !== -1) {
|
|
1603
|
+
index = n3 + 1;
|
|
1409
1604
|
}
|
|
1410
1605
|
}
|
|
1411
1606
|
if (str[index] === "!") {
|
|
@@ -1483,8 +1678,8 @@ var require_utils = __commonJS({
|
|
|
1483
1678
|
if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
|
|
1484
1679
|
return (Number(max) - Number(min)) / Number(step) >= limit;
|
|
1485
1680
|
};
|
|
1486
|
-
exports.escapeNode = (
|
|
1487
|
-
const node =
|
|
1681
|
+
exports.escapeNode = (block2, n3 = 0, type) => {
|
|
1682
|
+
const node = block2.nodes[n3];
|
|
1488
1683
|
if (!node) return;
|
|
1489
1684
|
if (type && node.type === type || node.type === "open" || node.type === "close") {
|
|
1490
1685
|
if (node.escaped !== true) {
|
|
@@ -1501,15 +1696,15 @@ var require_utils = __commonJS({
|
|
|
1501
1696
|
}
|
|
1502
1697
|
return false;
|
|
1503
1698
|
};
|
|
1504
|
-
exports.isInvalidBrace = (
|
|
1505
|
-
if (
|
|
1506
|
-
if (
|
|
1507
|
-
if (
|
|
1508
|
-
|
|
1699
|
+
exports.isInvalidBrace = (block2) => {
|
|
1700
|
+
if (block2.type !== "brace") return false;
|
|
1701
|
+
if (block2.invalid === true || block2.dollar) return true;
|
|
1702
|
+
if (block2.commas >> 0 + block2.ranges >> 0 === 0) {
|
|
1703
|
+
block2.invalid = true;
|
|
1509
1704
|
return true;
|
|
1510
1705
|
}
|
|
1511
|
-
if (
|
|
1512
|
-
|
|
1706
|
+
if (block2.open !== true || block2.close !== true) {
|
|
1707
|
+
block2.invalid = true;
|
|
1513
1708
|
return true;
|
|
1514
1709
|
}
|
|
1515
1710
|
return false;
|
|
@@ -1528,8 +1723,8 @@ var require_utils = __commonJS({
|
|
|
1528
1723
|
exports.flatten = (...args) => {
|
|
1529
1724
|
const result = [];
|
|
1530
1725
|
const flat = (arr) => {
|
|
1531
|
-
for (let
|
|
1532
|
-
const ele = arr[
|
|
1726
|
+
for (let i2 = 0; i2 < arr.length; i2++) {
|
|
1727
|
+
const ele = arr[i2];
|
|
1533
1728
|
if (Array.isArray(ele)) {
|
|
1534
1729
|
flat(ele);
|
|
1535
1730
|
continue;
|
|
@@ -1623,9 +1818,9 @@ var require_to_regex_range = __commonJS({
|
|
|
1623
1818
|
if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
|
|
1624
1819
|
return toRegexRange.cache[cacheKey].result;
|
|
1625
1820
|
}
|
|
1626
|
-
let
|
|
1821
|
+
let a2 = Math.min(min, max);
|
|
1627
1822
|
let b = Math.max(min, max);
|
|
1628
|
-
if (Math.abs(
|
|
1823
|
+
if (Math.abs(a2 - b) === 1) {
|
|
1629
1824
|
let result = min + "|" + max;
|
|
1630
1825
|
if (opts.capture) {
|
|
1631
1826
|
return `(${result})`;
|
|
@@ -1636,20 +1831,20 @@ var require_to_regex_range = __commonJS({
|
|
|
1636
1831
|
return `(?:${result})`;
|
|
1637
1832
|
}
|
|
1638
1833
|
let isPadded = hasPadding(min) || hasPadding(max);
|
|
1639
|
-
let state = { min, max, a, b };
|
|
1834
|
+
let state = { min, max, a: a2, b };
|
|
1640
1835
|
let positives = [];
|
|
1641
1836
|
let negatives = [];
|
|
1642
1837
|
if (isPadded) {
|
|
1643
1838
|
state.isPadded = isPadded;
|
|
1644
1839
|
state.maxLen = String(state.max).length;
|
|
1645
1840
|
}
|
|
1646
|
-
if (
|
|
1841
|
+
if (a2 < 0) {
|
|
1647
1842
|
let newMin = b < 0 ? Math.abs(b) : 1;
|
|
1648
|
-
negatives = splitToPatterns(newMin, Math.abs(
|
|
1649
|
-
|
|
1843
|
+
negatives = splitToPatterns(newMin, Math.abs(a2), state, opts);
|
|
1844
|
+
a2 = state.a = 0;
|
|
1650
1845
|
}
|
|
1651
1846
|
if (b >= 0) {
|
|
1652
|
-
positives = splitToPatterns(
|
|
1847
|
+
positives = splitToPatterns(a2, b, state, opts);
|
|
1653
1848
|
}
|
|
1654
1849
|
state.negatives = negatives;
|
|
1655
1850
|
state.positives = positives;
|
|
@@ -1697,8 +1892,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1697
1892
|
let digits = zipped.length;
|
|
1698
1893
|
let pattern = "";
|
|
1699
1894
|
let count = 0;
|
|
1700
|
-
for (let
|
|
1701
|
-
let [startDigit, stopDigit] = zipped[
|
|
1895
|
+
for (let i2 = 0; i2 < digits; i2++) {
|
|
1896
|
+
let [startDigit, stopDigit] = zipped[i2];
|
|
1702
1897
|
if (startDigit === stopDigit) {
|
|
1703
1898
|
pattern += startDigit;
|
|
1704
1899
|
} else if (startDigit !== "0" || stopDigit !== "9") {
|
|
@@ -1717,8 +1912,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1717
1912
|
let tokens = [];
|
|
1718
1913
|
let start = min;
|
|
1719
1914
|
let prev;
|
|
1720
|
-
for (let
|
|
1721
|
-
let max2 = ranges[
|
|
1915
|
+
for (let i2 = 0; i2 < ranges.length; i2++) {
|
|
1916
|
+
let max2 = ranges[i2];
|
|
1722
1917
|
let obj = rangeToPattern(String(start), String(max2), options);
|
|
1723
1918
|
let zeros = "";
|
|
1724
1919
|
if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
|
|
@@ -1753,13 +1948,13 @@ var require_to_regex_range = __commonJS({
|
|
|
1753
1948
|
}
|
|
1754
1949
|
return result;
|
|
1755
1950
|
}
|
|
1756
|
-
function zip(
|
|
1951
|
+
function zip(a2, b) {
|
|
1757
1952
|
let arr = [];
|
|
1758
|
-
for (let
|
|
1953
|
+
for (let i2 = 0; i2 < a2.length; i2++) arr.push([a2[i2], b[i2]]);
|
|
1759
1954
|
return arr;
|
|
1760
1955
|
}
|
|
1761
|
-
function compare(
|
|
1762
|
-
return
|
|
1956
|
+
function compare(a2, b) {
|
|
1957
|
+
return a2 > b ? 1 : b > a2 ? -1 : 0;
|
|
1763
1958
|
}
|
|
1764
1959
|
function contains(arr, key, val) {
|
|
1765
1960
|
return arr.some((ele) => ele[key] === val);
|
|
@@ -1777,8 +1972,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1777
1972
|
}
|
|
1778
1973
|
return "";
|
|
1779
1974
|
}
|
|
1780
|
-
function toCharacterClass(
|
|
1781
|
-
return `[${
|
|
1975
|
+
function toCharacterClass(a2, b, options) {
|
|
1976
|
+
return `[${a2}${b - a2 === 1 ? "" : "-"}${b}]`;
|
|
1782
1977
|
}
|
|
1783
1978
|
function hasPadding(str) {
|
|
1784
1979
|
return /^-?(0+)\d/.test(str);
|
|
@@ -1857,8 +2052,8 @@ var require_fill_range = __commonJS({
|
|
|
1857
2052
|
return negative ? "-" + input : input;
|
|
1858
2053
|
};
|
|
1859
2054
|
var toSequence = (parts, options, maxLen) => {
|
|
1860
|
-
parts.negatives.sort((
|
|
1861
|
-
parts.positives.sort((
|
|
2055
|
+
parts.negatives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
2056
|
+
parts.positives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
1862
2057
|
let prefix = options.capture ? "" : "?:";
|
|
1863
2058
|
let positives = "";
|
|
1864
2059
|
let negatives = "";
|
|
@@ -1879,12 +2074,12 @@ var require_fill_range = __commonJS({
|
|
|
1879
2074
|
}
|
|
1880
2075
|
return result;
|
|
1881
2076
|
};
|
|
1882
|
-
var toRange = (
|
|
2077
|
+
var toRange = (a2, b, isNumbers, options) => {
|
|
1883
2078
|
if (isNumbers) {
|
|
1884
|
-
return toRegexRange(
|
|
2079
|
+
return toRegexRange(a2, b, { wrap: false, ...options });
|
|
1885
2080
|
}
|
|
1886
|
-
let start = String.fromCharCode(
|
|
1887
|
-
if (
|
|
2081
|
+
let start = String.fromCharCode(a2);
|
|
2082
|
+
if (a2 === b) return start;
|
|
1888
2083
|
let stop = String.fromCharCode(b);
|
|
1889
2084
|
return `[${start}-${stop}]`;
|
|
1890
2085
|
};
|
|
@@ -1910,15 +2105,15 @@ var require_fill_range = __commonJS({
|
|
|
1910
2105
|
return [];
|
|
1911
2106
|
};
|
|
1912
2107
|
var fillNumbers = (start, end, step = 1, options = {}) => {
|
|
1913
|
-
let
|
|
2108
|
+
let a2 = Number(start);
|
|
1914
2109
|
let b = Number(end);
|
|
1915
|
-
if (!Number.isInteger(
|
|
2110
|
+
if (!Number.isInteger(a2) || !Number.isInteger(b)) {
|
|
1916
2111
|
if (options.strictRanges === true) throw rangeError([start, end]);
|
|
1917
2112
|
return [];
|
|
1918
2113
|
}
|
|
1919
|
-
if (
|
|
2114
|
+
if (a2 === 0) a2 = 0;
|
|
1920
2115
|
if (b === 0) b = 0;
|
|
1921
|
-
let descending =
|
|
2116
|
+
let descending = a2 > b;
|
|
1922
2117
|
let startString = String(start);
|
|
1923
2118
|
let endString = String(end);
|
|
1924
2119
|
let stepString = String(step);
|
|
@@ -1934,13 +2129,13 @@ var require_fill_range = __commonJS({
|
|
|
1934
2129
|
let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
|
|
1935
2130
|
let range = [];
|
|
1936
2131
|
let index = 0;
|
|
1937
|
-
while (descending ?
|
|
2132
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
1938
2133
|
if (options.toRegex === true && step > 1) {
|
|
1939
|
-
push(
|
|
2134
|
+
push(a2);
|
|
1940
2135
|
} else {
|
|
1941
|
-
range.push(pad(format(
|
|
2136
|
+
range.push(pad(format(a2, index), maxLen, toNumber));
|
|
1942
2137
|
}
|
|
1943
|
-
|
|
2138
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
1944
2139
|
index++;
|
|
1945
2140
|
}
|
|
1946
2141
|
if (options.toRegex === true) {
|
|
@@ -1953,19 +2148,19 @@ var require_fill_range = __commonJS({
|
|
|
1953
2148
|
return invalidRange(start, end, options);
|
|
1954
2149
|
}
|
|
1955
2150
|
let format = options.transform || ((val) => String.fromCharCode(val));
|
|
1956
|
-
let
|
|
2151
|
+
let a2 = `${start}`.charCodeAt(0);
|
|
1957
2152
|
let b = `${end}`.charCodeAt(0);
|
|
1958
|
-
let descending =
|
|
1959
|
-
let min = Math.min(
|
|
1960
|
-
let max = Math.max(
|
|
2153
|
+
let descending = a2 > b;
|
|
2154
|
+
let min = Math.min(a2, b);
|
|
2155
|
+
let max = Math.max(a2, b);
|
|
1961
2156
|
if (options.toRegex && step === 1) {
|
|
1962
2157
|
return toRange(min, max, false, options);
|
|
1963
2158
|
}
|
|
1964
2159
|
let range = [];
|
|
1965
2160
|
let index = 0;
|
|
1966
|
-
while (descending ?
|
|
1967
|
-
range.push(format(
|
|
1968
|
-
|
|
2161
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
2162
|
+
range.push(format(a2, index));
|
|
2163
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
1969
2164
|
index++;
|
|
1970
2165
|
}
|
|
1971
2166
|
if (options.toRegex === true) {
|
|
@@ -2088,18 +2283,18 @@ var require_expand = __commonJS({
|
|
|
2088
2283
|
const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
|
|
2089
2284
|
const walk = (node, parent = {}) => {
|
|
2090
2285
|
node.queue = [];
|
|
2091
|
-
let
|
|
2092
|
-
let
|
|
2093
|
-
while (
|
|
2094
|
-
|
|
2095
|
-
|
|
2286
|
+
let p = parent;
|
|
2287
|
+
let q = parent.queue;
|
|
2288
|
+
while (p.type !== "brace" && p.type !== "root" && p.parent) {
|
|
2289
|
+
p = p.parent;
|
|
2290
|
+
q = p.queue;
|
|
2096
2291
|
}
|
|
2097
2292
|
if (node.invalid || node.dollar) {
|
|
2098
|
-
|
|
2293
|
+
q.push(append(q.pop(), stringify2(node, options)));
|
|
2099
2294
|
return;
|
|
2100
2295
|
}
|
|
2101
2296
|
if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
|
|
2102
|
-
|
|
2297
|
+
q.push(append(q.pop(), ["{}"]));
|
|
2103
2298
|
return;
|
|
2104
2299
|
}
|
|
2105
2300
|
if (node.nodes && node.ranges > 0) {
|
|
@@ -2111,26 +2306,26 @@ var require_expand = __commonJS({
|
|
|
2111
2306
|
if (range.length === 0) {
|
|
2112
2307
|
range = stringify2(node, options);
|
|
2113
2308
|
}
|
|
2114
|
-
|
|
2309
|
+
q.push(append(q.pop(), range));
|
|
2115
2310
|
node.nodes = [];
|
|
2116
2311
|
return;
|
|
2117
2312
|
}
|
|
2118
2313
|
const enclose = utils.encloseBrace(node);
|
|
2119
2314
|
let queue = node.queue;
|
|
2120
|
-
let
|
|
2121
|
-
while (
|
|
2122
|
-
|
|
2123
|
-
queue =
|
|
2315
|
+
let block2 = node;
|
|
2316
|
+
while (block2.type !== "brace" && block2.type !== "root" && block2.parent) {
|
|
2317
|
+
block2 = block2.parent;
|
|
2318
|
+
queue = block2.queue;
|
|
2124
2319
|
}
|
|
2125
|
-
for (let
|
|
2126
|
-
const child = node.nodes[
|
|
2320
|
+
for (let i2 = 0; i2 < node.nodes.length; i2++) {
|
|
2321
|
+
const child = node.nodes[i2];
|
|
2127
2322
|
if (child.type === "comma" && node.type === "brace") {
|
|
2128
|
-
if (
|
|
2323
|
+
if (i2 === 1) queue.push("");
|
|
2129
2324
|
queue.push("");
|
|
2130
2325
|
continue;
|
|
2131
2326
|
}
|
|
2132
2327
|
if (child.type === "close") {
|
|
2133
|
-
|
|
2328
|
+
q.push(append(q.pop(), queue, enclose));
|
|
2134
2329
|
continue;
|
|
2135
2330
|
}
|
|
2136
2331
|
if (child.value && child.type !== "open") {
|
|
@@ -2297,7 +2492,7 @@ var require_parse = __commonJS({
|
|
|
2297
2492
|
}
|
|
2298
2493
|
const ast = { type: "root", input, nodes: [] };
|
|
2299
2494
|
const stack = [ast];
|
|
2300
|
-
let
|
|
2495
|
+
let block2 = ast;
|
|
2301
2496
|
let prev = ast;
|
|
2302
2497
|
let brackets = 0;
|
|
2303
2498
|
const length = input.length;
|
|
@@ -2313,15 +2508,15 @@ var require_parse = __commonJS({
|
|
|
2313
2508
|
prev.value += node.value;
|
|
2314
2509
|
return;
|
|
2315
2510
|
}
|
|
2316
|
-
|
|
2317
|
-
node.parent =
|
|
2511
|
+
block2.nodes.push(node);
|
|
2512
|
+
node.parent = block2;
|
|
2318
2513
|
node.prev = prev;
|
|
2319
2514
|
prev = node;
|
|
2320
2515
|
return node;
|
|
2321
2516
|
};
|
|
2322
2517
|
push({ type: "bos" });
|
|
2323
2518
|
while (index < length) {
|
|
2324
|
-
|
|
2519
|
+
block2 = stack[stack.length - 1];
|
|
2325
2520
|
value = advance();
|
|
2326
2521
|
if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
|
|
2327
2522
|
continue;
|
|
@@ -2358,19 +2553,19 @@ var require_parse = __commonJS({
|
|
|
2358
2553
|
continue;
|
|
2359
2554
|
}
|
|
2360
2555
|
if (value === CHAR_LEFT_PARENTHESES) {
|
|
2361
|
-
|
|
2362
|
-
stack.push(
|
|
2556
|
+
block2 = push({ type: "paren", nodes: [] });
|
|
2557
|
+
stack.push(block2);
|
|
2363
2558
|
push({ type: "text", value });
|
|
2364
2559
|
continue;
|
|
2365
2560
|
}
|
|
2366
2561
|
if (value === CHAR_RIGHT_PARENTHESES) {
|
|
2367
|
-
if (
|
|
2562
|
+
if (block2.type !== "paren") {
|
|
2368
2563
|
push({ type: "text", value });
|
|
2369
2564
|
continue;
|
|
2370
2565
|
}
|
|
2371
|
-
|
|
2566
|
+
block2 = stack.pop();
|
|
2372
2567
|
push({ type: "text", value });
|
|
2373
|
-
|
|
2568
|
+
block2 = stack[stack.length - 1];
|
|
2374
2569
|
continue;
|
|
2375
2570
|
}
|
|
2376
2571
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
@@ -2395,7 +2590,7 @@ var require_parse = __commonJS({
|
|
|
2395
2590
|
}
|
|
2396
2591
|
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
2397
2592
|
depth++;
|
|
2398
|
-
const dollar = prev.value && prev.value.slice(-1) === "$" ||
|
|
2593
|
+
const dollar = prev.value && prev.value.slice(-1) === "$" || block2.dollar === true;
|
|
2399
2594
|
const brace = {
|
|
2400
2595
|
type: "brace",
|
|
2401
2596
|
open: true,
|
|
@@ -2406,52 +2601,52 @@ var require_parse = __commonJS({
|
|
|
2406
2601
|
ranges: 0,
|
|
2407
2602
|
nodes: []
|
|
2408
2603
|
};
|
|
2409
|
-
|
|
2410
|
-
stack.push(
|
|
2604
|
+
block2 = push(brace);
|
|
2605
|
+
stack.push(block2);
|
|
2411
2606
|
push({ type: "open", value });
|
|
2412
2607
|
continue;
|
|
2413
2608
|
}
|
|
2414
2609
|
if (value === CHAR_RIGHT_CURLY_BRACE) {
|
|
2415
|
-
if (
|
|
2610
|
+
if (block2.type !== "brace") {
|
|
2416
2611
|
push({ type: "text", value });
|
|
2417
2612
|
continue;
|
|
2418
2613
|
}
|
|
2419
2614
|
const type = "close";
|
|
2420
|
-
|
|
2421
|
-
|
|
2615
|
+
block2 = stack.pop();
|
|
2616
|
+
block2.close = true;
|
|
2422
2617
|
push({ type, value });
|
|
2423
2618
|
depth--;
|
|
2424
|
-
|
|
2619
|
+
block2 = stack[stack.length - 1];
|
|
2425
2620
|
continue;
|
|
2426
2621
|
}
|
|
2427
2622
|
if (value === CHAR_COMMA && depth > 0) {
|
|
2428
|
-
if (
|
|
2429
|
-
|
|
2430
|
-
const open =
|
|
2431
|
-
|
|
2623
|
+
if (block2.ranges > 0) {
|
|
2624
|
+
block2.ranges = 0;
|
|
2625
|
+
const open = block2.nodes.shift();
|
|
2626
|
+
block2.nodes = [open, { type: "text", value: stringify2(block2) }];
|
|
2432
2627
|
}
|
|
2433
2628
|
push({ type: "comma", value });
|
|
2434
|
-
|
|
2629
|
+
block2.commas++;
|
|
2435
2630
|
continue;
|
|
2436
2631
|
}
|
|
2437
|
-
if (value === CHAR_DOT && depth > 0 &&
|
|
2438
|
-
const siblings =
|
|
2632
|
+
if (value === CHAR_DOT && depth > 0 && block2.commas === 0) {
|
|
2633
|
+
const siblings = block2.nodes;
|
|
2439
2634
|
if (depth === 0 || siblings.length === 0) {
|
|
2440
2635
|
push({ type: "text", value });
|
|
2441
2636
|
continue;
|
|
2442
2637
|
}
|
|
2443
2638
|
if (prev.type === "dot") {
|
|
2444
|
-
|
|
2639
|
+
block2.range = [];
|
|
2445
2640
|
prev.value += value;
|
|
2446
2641
|
prev.type = "range";
|
|
2447
|
-
if (
|
|
2448
|
-
|
|
2449
|
-
|
|
2642
|
+
if (block2.nodes.length !== 3 && block2.nodes.length !== 5) {
|
|
2643
|
+
block2.invalid = true;
|
|
2644
|
+
block2.ranges = 0;
|
|
2450
2645
|
prev.type = "text";
|
|
2451
2646
|
continue;
|
|
2452
2647
|
}
|
|
2453
|
-
|
|
2454
|
-
|
|
2648
|
+
block2.ranges++;
|
|
2649
|
+
block2.args = [];
|
|
2455
2650
|
continue;
|
|
2456
2651
|
}
|
|
2457
2652
|
if (prev.type === "range") {
|
|
@@ -2459,7 +2654,7 @@ var require_parse = __commonJS({
|
|
|
2459
2654
|
const before = siblings[siblings.length - 1];
|
|
2460
2655
|
before.value += prev.value + value;
|
|
2461
2656
|
prev = before;
|
|
2462
|
-
|
|
2657
|
+
block2.ranges--;
|
|
2463
2658
|
continue;
|
|
2464
2659
|
}
|
|
2465
2660
|
push({ type: "dot", value });
|
|
@@ -2468,9 +2663,9 @@ var require_parse = __commonJS({
|
|
|
2468
2663
|
push({ type: "text", value });
|
|
2469
2664
|
}
|
|
2470
2665
|
do {
|
|
2471
|
-
|
|
2472
|
-
if (
|
|
2473
|
-
|
|
2666
|
+
block2 = stack.pop();
|
|
2667
|
+
if (block2.type !== "root") {
|
|
2668
|
+
block2.nodes.forEach((node) => {
|
|
2474
2669
|
if (!node.nodes) {
|
|
2475
2670
|
if (node.type === "open") node.isOpen = true;
|
|
2476
2671
|
if (node.type === "close") node.isClose = true;
|
|
@@ -2479,8 +2674,8 @@ var require_parse = __commonJS({
|
|
|
2479
2674
|
}
|
|
2480
2675
|
});
|
|
2481
2676
|
const parent = stack[stack.length - 1];
|
|
2482
|
-
const index2 = parent.nodes.indexOf(
|
|
2483
|
-
parent.nodes.splice(index2, 1, ...
|
|
2677
|
+
const index2 = parent.nodes.indexOf(block2);
|
|
2678
|
+
parent.nodes.splice(index2, 1, ...block2.nodes);
|
|
2484
2679
|
}
|
|
2485
2680
|
} while (stack.length > 0);
|
|
2486
2681
|
push({ type: "eos" });
|
|
@@ -3113,9 +3308,9 @@ var require_scan = __commonJS({
|
|
|
3113
3308
|
if (opts.parts === true || opts.tokens === true) {
|
|
3114
3309
|
let prevIndex;
|
|
3115
3310
|
for (let idx = 0; idx < slashes.length; idx++) {
|
|
3116
|
-
const
|
|
3117
|
-
const
|
|
3118
|
-
const value = input.slice(
|
|
3311
|
+
const n3 = prevIndex ? prevIndex + 1 : start;
|
|
3312
|
+
const i2 = slashes[idx];
|
|
3313
|
+
const value = input.slice(n3, i2);
|
|
3119
3314
|
if (opts.tokens) {
|
|
3120
3315
|
if (idx === 0 && start !== 0) {
|
|
3121
3316
|
tokens[idx].isPrefix = true;
|
|
@@ -3129,7 +3324,7 @@ var require_scan = __commonJS({
|
|
|
3129
3324
|
if (idx !== 0 || value !== "") {
|
|
3130
3325
|
parts.push(value);
|
|
3131
3326
|
}
|
|
3132
|
-
prevIndex =
|
|
3327
|
+
prevIndex = i2;
|
|
3133
3328
|
}
|
|
3134
3329
|
if (prevIndex && prevIndex + 1 < input.length) {
|
|
3135
3330
|
const value = input.slice(prevIndex + 1);
|
|
@@ -3258,15 +3453,15 @@ var require_parse2 = __commonJS({
|
|
|
3258
3453
|
};
|
|
3259
3454
|
var hasRepeatedCharPrefixOverlap = (branches) => {
|
|
3260
3455
|
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
3261
|
-
for (let
|
|
3262
|
-
for (let
|
|
3263
|
-
const
|
|
3264
|
-
const b = values[
|
|
3265
|
-
const char =
|
|
3266
|
-
if (!char ||
|
|
3456
|
+
for (let i2 = 0; i2 < values.length; i2++) {
|
|
3457
|
+
for (let j = i2 + 1; j < values.length; j++) {
|
|
3458
|
+
const a2 = values[i2];
|
|
3459
|
+
const b = values[j];
|
|
3460
|
+
const char = a2[0];
|
|
3461
|
+
if (!char || a2 !== char.repeat(a2.length) || b !== char.repeat(b.length)) {
|
|
3267
3462
|
continue;
|
|
3268
3463
|
}
|
|
3269
|
-
if (
|
|
3464
|
+
if (a2 === b || a2.startsWith(b) || b.startsWith(a2)) {
|
|
3270
3465
|
return true;
|
|
3271
3466
|
}
|
|
3272
3467
|
}
|
|
@@ -3281,8 +3476,8 @@ var require_parse2 = __commonJS({
|
|
|
3281
3476
|
let paren = 0;
|
|
3282
3477
|
let quote = 0;
|
|
3283
3478
|
let escaped = false;
|
|
3284
|
-
for (let
|
|
3285
|
-
const ch = pattern[
|
|
3479
|
+
for (let i2 = 1; i2 < pattern.length; i2++) {
|
|
3480
|
+
const ch = pattern[i2];
|
|
3286
3481
|
if (escaped === true) {
|
|
3287
3482
|
escaped = false;
|
|
3288
3483
|
continue;
|
|
@@ -3316,13 +3511,13 @@ var require_parse2 = __commonJS({
|
|
|
3316
3511
|
if (ch === ")") {
|
|
3317
3512
|
paren--;
|
|
3318
3513
|
if (paren === 0) {
|
|
3319
|
-
if (requireEnd === true &&
|
|
3514
|
+
if (requireEnd === true && i2 !== pattern.length - 1) {
|
|
3320
3515
|
return;
|
|
3321
3516
|
}
|
|
3322
3517
|
return {
|
|
3323
3518
|
type: pattern[0],
|
|
3324
|
-
body: pattern.slice(2,
|
|
3325
|
-
end:
|
|
3519
|
+
body: pattern.slice(2, i2),
|
|
3520
|
+
end: i2
|
|
3326
3521
|
};
|
|
3327
3522
|
}
|
|
3328
3523
|
}
|
|
@@ -3454,7 +3649,7 @@ var require_parse2 = __commonJS({
|
|
|
3454
3649
|
let prev = bos;
|
|
3455
3650
|
let value;
|
|
3456
3651
|
const eos = () => state.index === len - 1;
|
|
3457
|
-
const peek = state.peek = (
|
|
3652
|
+
const peek = state.peek = (n3 = 1) => input[state.index + n3];
|
|
3458
3653
|
const advance = state.advance = () => input[++state.index] || "";
|
|
3459
3654
|
const remaining = () => input.slice(state.index + 1);
|
|
3460
3655
|
const consume = (value2 = "", num = 0) => {
|
|
@@ -3535,10 +3730,10 @@ var require_parse2 = __commonJS({
|
|
|
3535
3730
|
open.type = "text";
|
|
3536
3731
|
open.value = literal;
|
|
3537
3732
|
open.output = safeOutput || utils.escapeRegex(literal);
|
|
3538
|
-
for (let
|
|
3539
|
-
tokens[
|
|
3540
|
-
tokens[
|
|
3541
|
-
delete tokens[
|
|
3733
|
+
for (let i2 = token.tokensIndex + 1; i2 < tokens.length; i2++) {
|
|
3734
|
+
tokens[i2].value = "";
|
|
3735
|
+
tokens[i2].output = "";
|
|
3736
|
+
delete tokens[i2].suffix;
|
|
3542
3737
|
}
|
|
3543
3738
|
state.output = token.output + open.output;
|
|
3544
3739
|
state.backtrack = true;
|
|
@@ -3781,13 +3976,13 @@ var require_parse2 = __commonJS({
|
|
|
3781
3976
|
if (brace.dots === true) {
|
|
3782
3977
|
const arr = tokens.slice();
|
|
3783
3978
|
const range = [];
|
|
3784
|
-
for (let
|
|
3979
|
+
for (let i2 = arr.length - 1; i2 >= 0; i2--) {
|
|
3785
3980
|
tokens.pop();
|
|
3786
|
-
if (arr[
|
|
3981
|
+
if (arr[i2].type === "brace") {
|
|
3787
3982
|
break;
|
|
3788
3983
|
}
|
|
3789
|
-
if (arr[
|
|
3790
|
-
range.unshift(arr[
|
|
3984
|
+
if (arr[i2].type !== "dots") {
|
|
3985
|
+
range.unshift(arr[i2].value);
|
|
3791
3986
|
}
|
|
3792
3987
|
}
|
|
3793
3988
|
output = expandRange(range, opts);
|
|
@@ -4246,7 +4441,7 @@ var require_picomatch = __commonJS({
|
|
|
4246
4441
|
};
|
|
4247
4442
|
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
4248
4443
|
picomatch.parse = (pattern, options) => {
|
|
4249
|
-
if (Array.isArray(pattern)) return pattern.map((
|
|
4444
|
+
if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
|
|
4250
4445
|
return parse2(pattern, { ...options, fastpaths: false });
|
|
4251
4446
|
};
|
|
4252
4447
|
picomatch.scan = (input, options) => scan(input, options);
|
|
@@ -4330,8 +4525,8 @@ var require_micromatch = __commonJS({
|
|
|
4330
4525
|
options.onResult(state);
|
|
4331
4526
|
}
|
|
4332
4527
|
};
|
|
4333
|
-
for (let
|
|
4334
|
-
let isMatch = picomatch(String(patterns[
|
|
4528
|
+
for (let i2 = 0; i2 < patterns.length; i2++) {
|
|
4529
|
+
let isMatch = picomatch(String(patterns[i2]), { ...options, onResult }, true);
|
|
4335
4530
|
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
|
|
4336
4531
|
if (negated) negatives++;
|
|
4337
4532
|
for (let item of list) {
|
|
@@ -4353,7 +4548,7 @@ var require_micromatch = __commonJS({
|
|
|
4353
4548
|
throw new Error(`No matches found for "${patterns.join(", ")}"`);
|
|
4354
4549
|
}
|
|
4355
4550
|
if (options.nonull === true || options.nullglob === true) {
|
|
4356
|
-
return options.unescape ? patterns.map((
|
|
4551
|
+
return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
|
|
4357
4552
|
}
|
|
4358
4553
|
}
|
|
4359
4554
|
return matches;
|
|
@@ -4383,7 +4578,7 @@ var require_micromatch = __commonJS({
|
|
|
4383
4578
|
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
4384
4579
|
}
|
|
4385
4580
|
if (Array.isArray(pattern)) {
|
|
4386
|
-
return pattern.some((
|
|
4581
|
+
return pattern.some((p) => micromatch.contains(str, p, options));
|
|
4387
4582
|
}
|
|
4388
4583
|
if (typeof pattern === "string") {
|
|
4389
4584
|
if (isEmptyString(str) || isEmptyString(pattern)) {
|
|
@@ -4428,7 +4623,7 @@ var require_micromatch = __commonJS({
|
|
|
4428
4623
|
if (typeof str !== "string") {
|
|
4429
4624
|
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
4430
4625
|
}
|
|
4431
|
-
return [].concat(patterns).every((
|
|
4626
|
+
return [].concat(patterns).every((p) => picomatch(p, options)(str));
|
|
4432
4627
|
};
|
|
4433
4628
|
micromatch.capture = (glob, input, options) => {
|
|
4434
4629
|
let posix = utils.isWindows(options);
|
|
@@ -4579,7 +4774,7 @@ var require_pattern = __commonJS({
|
|
|
4579
4774
|
exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
|
4580
4775
|
function expandBraceExpansion(pattern) {
|
|
4581
4776
|
const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });
|
|
4582
|
-
patterns.sort((
|
|
4777
|
+
patterns.sort((a2, b) => a2.length - b.length);
|
|
4583
4778
|
return patterns.filter((pattern2) => pattern2 !== "");
|
|
4584
4779
|
}
|
|
4585
4780
|
exports.expandBraceExpansion = expandBraceExpansion;
|
|
@@ -4660,8 +4855,8 @@ var require_merge2 = __commonJS({
|
|
|
4660
4855
|
}
|
|
4661
4856
|
const mergedStream = PassThrough(options);
|
|
4662
4857
|
function addStream() {
|
|
4663
|
-
for (let
|
|
4664
|
-
streamsQueue.push(pauseStreams(arguments[
|
|
4858
|
+
for (let i2 = 0, len = arguments.length; i2 < len; i2++) {
|
|
4859
|
+
streamsQueue.push(pauseStreams(arguments[i2], options));
|
|
4665
4860
|
}
|
|
4666
4861
|
mergeStream();
|
|
4667
4862
|
return this;
|
|
@@ -4710,8 +4905,8 @@ var require_merge2 = __commonJS({
|
|
|
4710
4905
|
stream.pipe(mergedStream, { end: false });
|
|
4711
4906
|
stream.resume();
|
|
4712
4907
|
}
|
|
4713
|
-
for (let
|
|
4714
|
-
pipe(streams[
|
|
4908
|
+
for (let i2 = 0; i2 < streams.length; i2++) {
|
|
4909
|
+
pipe(streams[i2]);
|
|
4715
4910
|
}
|
|
4716
4911
|
next();
|
|
4717
4912
|
}
|
|
@@ -4742,8 +4937,8 @@ var require_merge2 = __commonJS({
|
|
|
4742
4937
|
}
|
|
4743
4938
|
streams.pause();
|
|
4744
4939
|
} else {
|
|
4745
|
-
for (let
|
|
4746
|
-
streams[
|
|
4940
|
+
for (let i2 = 0, len = streams.length; i2 < len; i2++) {
|
|
4941
|
+
streams[i2] = pauseStreams(streams[i2], options);
|
|
4747
4942
|
}
|
|
4748
4943
|
}
|
|
4749
4944
|
return streams;
|
|
@@ -4825,13 +5020,13 @@ var require_tasks = __commonJS({
|
|
|
4825
5020
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4826
5021
|
exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
|
|
4827
5022
|
var utils = require_utils3();
|
|
4828
|
-
function generate(input,
|
|
4829
|
-
const patterns = processPatterns(input,
|
|
4830
|
-
const ignore = processPatterns(
|
|
5023
|
+
function generate(input, settings2) {
|
|
5024
|
+
const patterns = processPatterns(input, settings2);
|
|
5025
|
+
const ignore = processPatterns(settings2.ignore, settings2);
|
|
4831
5026
|
const positivePatterns = getPositivePatterns(patterns);
|
|
4832
5027
|
const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
|
|
4833
|
-
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern,
|
|
4834
|
-
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern,
|
|
5028
|
+
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings2));
|
|
5029
|
+
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings2));
|
|
4835
5030
|
const staticTasks = convertPatternsToTasks(
|
|
4836
5031
|
staticPatterns,
|
|
4837
5032
|
negativePatterns,
|
|
@@ -4847,12 +5042,12 @@ var require_tasks = __commonJS({
|
|
|
4847
5042
|
return staticTasks.concat(dynamicTasks);
|
|
4848
5043
|
}
|
|
4849
5044
|
exports.generate = generate;
|
|
4850
|
-
function processPatterns(input,
|
|
5045
|
+
function processPatterns(input, settings2) {
|
|
4851
5046
|
let patterns = input;
|
|
4852
|
-
if (
|
|
5047
|
+
if (settings2.braceExpansion) {
|
|
4853
5048
|
patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);
|
|
4854
5049
|
}
|
|
4855
|
-
if (
|
|
5050
|
+
if (settings2.baseNameMatch) {
|
|
4856
5051
|
patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`);
|
|
4857
5052
|
}
|
|
4858
5053
|
return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));
|
|
@@ -4921,26 +5116,26 @@ var require_async = __commonJS({
|
|
|
4921
5116
|
init_utils2();
|
|
4922
5117
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4923
5118
|
exports.read = void 0;
|
|
4924
|
-
function read(path,
|
|
4925
|
-
|
|
5119
|
+
function read(path, settings2, callback) {
|
|
5120
|
+
settings2.fs.lstat(path, (lstatError, lstat) => {
|
|
4926
5121
|
if (lstatError !== null) {
|
|
4927
5122
|
callFailureCallback(callback, lstatError);
|
|
4928
5123
|
return;
|
|
4929
5124
|
}
|
|
4930
|
-
if (!lstat.isSymbolicLink() || !
|
|
5125
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
4931
5126
|
callSuccessCallback(callback, lstat);
|
|
4932
5127
|
return;
|
|
4933
5128
|
}
|
|
4934
|
-
|
|
5129
|
+
settings2.fs.stat(path, (statError, stat) => {
|
|
4935
5130
|
if (statError !== null) {
|
|
4936
|
-
if (
|
|
5131
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4937
5132
|
callFailureCallback(callback, statError);
|
|
4938
5133
|
return;
|
|
4939
5134
|
}
|
|
4940
5135
|
callSuccessCallback(callback, lstat);
|
|
4941
5136
|
return;
|
|
4942
5137
|
}
|
|
4943
|
-
if (
|
|
5138
|
+
if (settings2.markSymbolicLink) {
|
|
4944
5139
|
stat.isSymbolicLink = () => true;
|
|
4945
5140
|
}
|
|
4946
5141
|
callSuccessCallback(callback, stat);
|
|
@@ -4964,19 +5159,19 @@ var require_sync = __commonJS({
|
|
|
4964
5159
|
init_utils2();
|
|
4965
5160
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4966
5161
|
exports.read = void 0;
|
|
4967
|
-
function read(path,
|
|
4968
|
-
const lstat =
|
|
4969
|
-
if (!lstat.isSymbolicLink() || !
|
|
5162
|
+
function read(path, settings2) {
|
|
5163
|
+
const lstat = settings2.fs.lstatSync(path);
|
|
5164
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
4970
5165
|
return lstat;
|
|
4971
5166
|
}
|
|
4972
5167
|
try {
|
|
4973
|
-
const stat =
|
|
4974
|
-
if (
|
|
5168
|
+
const stat = settings2.fs.statSync(path);
|
|
5169
|
+
if (settings2.markSymbolicLink) {
|
|
4975
5170
|
stat.isSymbolicLink = () => true;
|
|
4976
5171
|
}
|
|
4977
5172
|
return stat;
|
|
4978
5173
|
} catch (error2) {
|
|
4979
|
-
if (!
|
|
5174
|
+
if (!settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4980
5175
|
return lstat;
|
|
4981
5176
|
}
|
|
4982
5177
|
throw error2;
|
|
@@ -5053,8 +5248,8 @@ var require_out = __commonJS({
|
|
|
5053
5248
|
}
|
|
5054
5249
|
exports.stat = stat;
|
|
5055
5250
|
function statSync3(path, optionsOrSettings) {
|
|
5056
|
-
const
|
|
5057
|
-
return sync.read(path,
|
|
5251
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5252
|
+
return sync.read(path, settings2);
|
|
5058
5253
|
}
|
|
5059
5254
|
exports.statSync = statSync3;
|
|
5060
5255
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -5102,8 +5297,8 @@ var require_run_parallel = __commonJS({
|
|
|
5102
5297
|
if (isSync) queueMicrotask2(end);
|
|
5103
5298
|
else end();
|
|
5104
5299
|
}
|
|
5105
|
-
function each(
|
|
5106
|
-
results[
|
|
5300
|
+
function each(i2, err, result) {
|
|
5301
|
+
results[i2] = result;
|
|
5107
5302
|
if (--pending === 0 || err) {
|
|
5108
5303
|
done(err);
|
|
5109
5304
|
}
|
|
@@ -5117,9 +5312,9 @@ var require_run_parallel = __commonJS({
|
|
|
5117
5312
|
});
|
|
5118
5313
|
});
|
|
5119
5314
|
} else {
|
|
5120
|
-
tasks.forEach(function(task,
|
|
5315
|
+
tasks.forEach(function(task, i2) {
|
|
5121
5316
|
task(function(err, result) {
|
|
5122
|
-
each(
|
|
5317
|
+
each(i2, err, result);
|
|
5123
5318
|
});
|
|
5124
5319
|
});
|
|
5125
5320
|
}
|
|
@@ -5194,11 +5389,11 @@ var require_common = __commonJS({
|
|
|
5194
5389
|
init_utils2();
|
|
5195
5390
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5196
5391
|
exports.joinPathSegments = void 0;
|
|
5197
|
-
function joinPathSegments(
|
|
5198
|
-
if (
|
|
5199
|
-
return
|
|
5392
|
+
function joinPathSegments(a2, b, separator) {
|
|
5393
|
+
if (a2.endsWith(separator)) {
|
|
5394
|
+
return a2 + b;
|
|
5200
5395
|
}
|
|
5201
|
-
return
|
|
5396
|
+
return a2 + separator + b;
|
|
5202
5397
|
}
|
|
5203
5398
|
exports.joinPathSegments = joinPathSegments;
|
|
5204
5399
|
}
|
|
@@ -5216,16 +5411,16 @@ var require_async2 = __commonJS({
|
|
|
5216
5411
|
var constants_1 = require_constants3();
|
|
5217
5412
|
var utils = require_utils4();
|
|
5218
5413
|
var common = require_common();
|
|
5219
|
-
function read(directory,
|
|
5220
|
-
if (!
|
|
5221
|
-
readdirWithFileTypes(directory,
|
|
5414
|
+
function read(directory, settings2, callback) {
|
|
5415
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
5416
|
+
readdirWithFileTypes(directory, settings2, callback);
|
|
5222
5417
|
return;
|
|
5223
5418
|
}
|
|
5224
|
-
readdir(directory,
|
|
5419
|
+
readdir(directory, settings2, callback);
|
|
5225
5420
|
}
|
|
5226
5421
|
exports.read = read;
|
|
5227
|
-
function readdirWithFileTypes(directory,
|
|
5228
|
-
|
|
5422
|
+
function readdirWithFileTypes(directory, settings2, callback) {
|
|
5423
|
+
settings2.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
|
|
5229
5424
|
if (readdirError !== null) {
|
|
5230
5425
|
callFailureCallback(callback, readdirError);
|
|
5231
5426
|
return;
|
|
@@ -5233,13 +5428,13 @@ var require_async2 = __commonJS({
|
|
|
5233
5428
|
const entries = dirents.map((dirent) => ({
|
|
5234
5429
|
dirent,
|
|
5235
5430
|
name: dirent.name,
|
|
5236
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
5431
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
5237
5432
|
}));
|
|
5238
|
-
if (!
|
|
5433
|
+
if (!settings2.followSymbolicLinks) {
|
|
5239
5434
|
callSuccessCallback(callback, entries);
|
|
5240
5435
|
return;
|
|
5241
5436
|
}
|
|
5242
|
-
const tasks = entries.map((entry) => makeRplTaskEntry(entry,
|
|
5437
|
+
const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings2));
|
|
5243
5438
|
rpl(tasks, (rplError, rplEntries) => {
|
|
5244
5439
|
if (rplError !== null) {
|
|
5245
5440
|
callFailureCallback(callback, rplError);
|
|
@@ -5250,15 +5445,15 @@ var require_async2 = __commonJS({
|
|
|
5250
5445
|
});
|
|
5251
5446
|
}
|
|
5252
5447
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
5253
|
-
function makeRplTaskEntry(entry,
|
|
5448
|
+
function makeRplTaskEntry(entry, settings2) {
|
|
5254
5449
|
return (done) => {
|
|
5255
5450
|
if (!entry.dirent.isSymbolicLink()) {
|
|
5256
5451
|
done(null, entry);
|
|
5257
5452
|
return;
|
|
5258
5453
|
}
|
|
5259
|
-
|
|
5454
|
+
settings2.fs.stat(entry.path, (statError, stats) => {
|
|
5260
5455
|
if (statError !== null) {
|
|
5261
|
-
if (
|
|
5456
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5262
5457
|
done(statError);
|
|
5263
5458
|
return;
|
|
5264
5459
|
}
|
|
@@ -5270,16 +5465,16 @@ var require_async2 = __commonJS({
|
|
|
5270
5465
|
});
|
|
5271
5466
|
};
|
|
5272
5467
|
}
|
|
5273
|
-
function readdir(directory,
|
|
5274
|
-
|
|
5468
|
+
function readdir(directory, settings2, callback) {
|
|
5469
|
+
settings2.fs.readdir(directory, (readdirError, names) => {
|
|
5275
5470
|
if (readdirError !== null) {
|
|
5276
5471
|
callFailureCallback(callback, readdirError);
|
|
5277
5472
|
return;
|
|
5278
5473
|
}
|
|
5279
5474
|
const tasks = names.map((name) => {
|
|
5280
|
-
const path = common.joinPathSegments(directory, name,
|
|
5475
|
+
const path = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
5281
5476
|
return (done) => {
|
|
5282
|
-
fsStat.stat(path,
|
|
5477
|
+
fsStat.stat(path, settings2.fsStatSettings, (error2, stats) => {
|
|
5283
5478
|
if (error2 !== null) {
|
|
5284
5479
|
done(error2);
|
|
5285
5480
|
return;
|
|
@@ -5289,7 +5484,7 @@ var require_async2 = __commonJS({
|
|
|
5289
5484
|
path,
|
|
5290
5485
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
5291
5486
|
};
|
|
5292
|
-
if (
|
|
5487
|
+
if (settings2.stats) {
|
|
5293
5488
|
entry.stats = stats;
|
|
5294
5489
|
}
|
|
5295
5490
|
done(null, entry);
|
|
@@ -5326,27 +5521,27 @@ var require_sync2 = __commonJS({
|
|
|
5326
5521
|
var constants_1 = require_constants3();
|
|
5327
5522
|
var utils = require_utils4();
|
|
5328
5523
|
var common = require_common();
|
|
5329
|
-
function read(directory,
|
|
5330
|
-
if (!
|
|
5331
|
-
return readdirWithFileTypes(directory,
|
|
5524
|
+
function read(directory, settings2) {
|
|
5525
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
5526
|
+
return readdirWithFileTypes(directory, settings2);
|
|
5332
5527
|
}
|
|
5333
|
-
return readdir(directory,
|
|
5528
|
+
return readdir(directory, settings2);
|
|
5334
5529
|
}
|
|
5335
5530
|
exports.read = read;
|
|
5336
|
-
function readdirWithFileTypes(directory,
|
|
5337
|
-
const dirents =
|
|
5531
|
+
function readdirWithFileTypes(directory, settings2) {
|
|
5532
|
+
const dirents = settings2.fs.readdirSync(directory, { withFileTypes: true });
|
|
5338
5533
|
return dirents.map((dirent) => {
|
|
5339
5534
|
const entry = {
|
|
5340
5535
|
dirent,
|
|
5341
5536
|
name: dirent.name,
|
|
5342
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
5537
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
5343
5538
|
};
|
|
5344
|
-
if (entry.dirent.isSymbolicLink() &&
|
|
5539
|
+
if (entry.dirent.isSymbolicLink() && settings2.followSymbolicLinks) {
|
|
5345
5540
|
try {
|
|
5346
|
-
const stats =
|
|
5541
|
+
const stats = settings2.fs.statSync(entry.path);
|
|
5347
5542
|
entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
|
5348
5543
|
} catch (error2) {
|
|
5349
|
-
if (
|
|
5544
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5350
5545
|
throw error2;
|
|
5351
5546
|
}
|
|
5352
5547
|
}
|
|
@@ -5355,17 +5550,17 @@ var require_sync2 = __commonJS({
|
|
|
5355
5550
|
});
|
|
5356
5551
|
}
|
|
5357
5552
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
5358
|
-
function readdir(directory,
|
|
5359
|
-
const names =
|
|
5553
|
+
function readdir(directory, settings2) {
|
|
5554
|
+
const names = settings2.fs.readdirSync(directory);
|
|
5360
5555
|
return names.map((name) => {
|
|
5361
|
-
const entryPath = common.joinPathSegments(directory, name,
|
|
5362
|
-
const stats = fsStat.statSync(entryPath,
|
|
5556
|
+
const entryPath = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
5557
|
+
const stats = fsStat.statSync(entryPath, settings2.fsStatSettings);
|
|
5363
5558
|
const entry = {
|
|
5364
5559
|
name,
|
|
5365
5560
|
path: entryPath,
|
|
5366
5561
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
5367
5562
|
};
|
|
5368
|
-
if (
|
|
5563
|
+
if (settings2.stats) {
|
|
5369
5564
|
entry.stats = stats;
|
|
5370
5565
|
}
|
|
5371
5566
|
return entry;
|
|
@@ -5452,8 +5647,8 @@ var require_out2 = __commonJS({
|
|
|
5452
5647
|
}
|
|
5453
5648
|
exports.scandir = scandir;
|
|
5454
5649
|
function scandirSync(path, optionsOrSettings) {
|
|
5455
|
-
const
|
|
5456
|
-
return sync.read(path,
|
|
5650
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5651
|
+
return sync.read(path, settings2);
|
|
5457
5652
|
}
|
|
5458
5653
|
exports.scandirSync = scandirSync;
|
|
5459
5654
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -5497,9 +5692,9 @@ var require_reusify = __commonJS({
|
|
|
5497
5692
|
}
|
|
5498
5693
|
});
|
|
5499
5694
|
|
|
5500
|
-
// node_modules/.bun/fastq@1.20.
|
|
5695
|
+
// node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js
|
|
5501
5696
|
var require_queue = __commonJS({
|
|
5502
|
-
"node_modules/.bun/fastq@1.20.
|
|
5697
|
+
"node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js"(exports, module) {
|
|
5503
5698
|
"use strict";
|
|
5504
5699
|
init_utils2();
|
|
5505
5700
|
var reusify = require_reusify();
|
|
@@ -5679,11 +5874,12 @@ var require_queue = __commonJS({
|
|
|
5679
5874
|
current.value = null;
|
|
5680
5875
|
current.callback = noop;
|
|
5681
5876
|
current.errorHandler = null;
|
|
5877
|
+
current.next = null;
|
|
5682
5878
|
if (errorHandler2) {
|
|
5683
5879
|
errorHandler2(new Error("abort"), val);
|
|
5684
5880
|
}
|
|
5685
5881
|
callback.call(context2, new Error("abort"));
|
|
5686
|
-
|
|
5882
|
+
cache.release(current);
|
|
5687
5883
|
current = next;
|
|
5688
5884
|
}
|
|
5689
5885
|
self.drain = noop;
|
|
@@ -5734,7 +5930,7 @@ var require_queue = __commonJS({
|
|
|
5734
5930
|
queue.drained = drained;
|
|
5735
5931
|
return queue;
|
|
5736
5932
|
function push(value) {
|
|
5737
|
-
var
|
|
5933
|
+
var p = new Promise(function(resolve4, reject) {
|
|
5738
5934
|
pushCb(value, function(err, result) {
|
|
5739
5935
|
if (err) {
|
|
5740
5936
|
reject(err);
|
|
@@ -5743,11 +5939,11 @@ var require_queue = __commonJS({
|
|
|
5743
5939
|
resolve4(result);
|
|
5744
5940
|
});
|
|
5745
5941
|
});
|
|
5746
|
-
|
|
5747
|
-
return
|
|
5942
|
+
p.catch(noop);
|
|
5943
|
+
return p;
|
|
5748
5944
|
}
|
|
5749
5945
|
function unshift(value) {
|
|
5750
|
-
var
|
|
5946
|
+
var p = new Promise(function(resolve4, reject) {
|
|
5751
5947
|
unshiftCb(value, function(err, result) {
|
|
5752
5948
|
if (err) {
|
|
5753
5949
|
reject(err);
|
|
@@ -5756,11 +5952,11 @@ var require_queue = __commonJS({
|
|
|
5756
5952
|
resolve4(result);
|
|
5757
5953
|
});
|
|
5758
5954
|
});
|
|
5759
|
-
|
|
5760
|
-
return
|
|
5955
|
+
p.catch(noop);
|
|
5956
|
+
return p;
|
|
5761
5957
|
}
|
|
5762
5958
|
function drained() {
|
|
5763
|
-
var
|
|
5959
|
+
var p = new Promise(function(resolve4) {
|
|
5764
5960
|
process.nextTick(function() {
|
|
5765
5961
|
if (queue.idle()) {
|
|
5766
5962
|
resolve4();
|
|
@@ -5774,7 +5970,7 @@ var require_queue = __commonJS({
|
|
|
5774
5970
|
}
|
|
5775
5971
|
});
|
|
5776
5972
|
});
|
|
5777
|
-
return
|
|
5973
|
+
return p;
|
|
5778
5974
|
}
|
|
5779
5975
|
}
|
|
5780
5976
|
module.exports = fastqueue;
|
|
@@ -5789,11 +5985,11 @@ var require_common2 = __commonJS({
|
|
|
5789
5985
|
init_utils2();
|
|
5790
5986
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5791
5987
|
exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
|
|
5792
|
-
function isFatalError(
|
|
5793
|
-
if (
|
|
5988
|
+
function isFatalError(settings2, error2) {
|
|
5989
|
+
if (settings2.errorFilter === null) {
|
|
5794
5990
|
return true;
|
|
5795
5991
|
}
|
|
5796
|
-
return !
|
|
5992
|
+
return !settings2.errorFilter(error2);
|
|
5797
5993
|
}
|
|
5798
5994
|
exports.isFatalError = isFatalError;
|
|
5799
5995
|
function isAppliedFilter(filter, value) {
|
|
@@ -5804,14 +6000,14 @@ var require_common2 = __commonJS({
|
|
|
5804
6000
|
return filepath.split(/[/\\]/).join(separator);
|
|
5805
6001
|
}
|
|
5806
6002
|
exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
|
|
5807
|
-
function joinPathSegments(
|
|
5808
|
-
if (
|
|
6003
|
+
function joinPathSegments(a2, b, separator) {
|
|
6004
|
+
if (a2 === "") {
|
|
5809
6005
|
return b;
|
|
5810
6006
|
}
|
|
5811
|
-
if (
|
|
5812
|
-
return
|
|
6007
|
+
if (a2.endsWith(separator)) {
|
|
6008
|
+
return a2 + b;
|
|
5813
6009
|
}
|
|
5814
|
-
return
|
|
6010
|
+
return a2 + separator + b;
|
|
5815
6011
|
}
|
|
5816
6012
|
exports.joinPathSegments = joinPathSegments;
|
|
5817
6013
|
}
|
|
@@ -6158,14 +6354,14 @@ var require_out3 = __commonJS({
|
|
|
6158
6354
|
}
|
|
6159
6355
|
exports.walk = walk;
|
|
6160
6356
|
function walkSync(directory, optionsOrSettings) {
|
|
6161
|
-
const
|
|
6162
|
-
const provider = new sync_1.default(directory,
|
|
6357
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
6358
|
+
const provider = new sync_1.default(directory, settings2);
|
|
6163
6359
|
return provider.read();
|
|
6164
6360
|
}
|
|
6165
6361
|
exports.walkSync = walkSync;
|
|
6166
6362
|
function walkStream(directory, optionsOrSettings) {
|
|
6167
|
-
const
|
|
6168
|
-
const provider = new stream_1.default(directory,
|
|
6363
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
6364
|
+
const provider = new stream_1.default(directory, settings2);
|
|
6169
6365
|
return provider.read();
|
|
6170
6366
|
}
|
|
6171
6367
|
exports.walkStream = walkStream;
|
|
@@ -6251,8 +6447,8 @@ var require_stream3 = __commonJS({
|
|
|
6251
6447
|
done();
|
|
6252
6448
|
}).catch(done);
|
|
6253
6449
|
};
|
|
6254
|
-
for (let
|
|
6255
|
-
stream.write(
|
|
6450
|
+
for (let i2 = 0; i2 < filepaths.length; i2++) {
|
|
6451
|
+
stream.write(i2);
|
|
6256
6452
|
}
|
|
6257
6453
|
return stream;
|
|
6258
6454
|
}
|
|
@@ -6913,14 +7109,14 @@ var require_out4 = __commonJS({
|
|
|
6913
7109
|
function generateTasks(source, options) {
|
|
6914
7110
|
assertPatternsInput(source);
|
|
6915
7111
|
const patterns = [].concat(source);
|
|
6916
|
-
const
|
|
6917
|
-
return taskManager.generate(patterns,
|
|
7112
|
+
const settings2 = new settings_1.default(options);
|
|
7113
|
+
return taskManager.generate(patterns, settings2);
|
|
6918
7114
|
}
|
|
6919
7115
|
FastGlob2.generateTasks = generateTasks;
|
|
6920
7116
|
function isDynamicPattern(source, options) {
|
|
6921
7117
|
assertPatternsInput(source);
|
|
6922
|
-
const
|
|
6923
|
-
return utils.pattern.isDynamicPattern(source,
|
|
7118
|
+
const settings2 = new settings_1.default(options);
|
|
7119
|
+
return utils.pattern.isDynamicPattern(source, settings2);
|
|
6924
7120
|
}
|
|
6925
7121
|
FastGlob2.isDynamicPattern = isDynamicPattern;
|
|
6926
7122
|
function escapePath(source) {
|
|
@@ -6962,9 +7158,9 @@ var require_out4 = __commonJS({
|
|
|
6962
7158
|
})(FastGlob || (FastGlob = {}));
|
|
6963
7159
|
function getWorks(source, _Provider, options) {
|
|
6964
7160
|
const patterns = [].concat(source);
|
|
6965
|
-
const
|
|
6966
|
-
const tasks = taskManager.generate(patterns,
|
|
6967
|
-
const provider = new _Provider(
|
|
7161
|
+
const settings2 = new settings_1.default(options);
|
|
7162
|
+
const tasks = taskManager.generate(patterns, settings2);
|
|
7163
|
+
const provider = new _Provider(settings2);
|
|
6968
7164
|
return tasks.map(provider.read, provider);
|
|
6969
7165
|
}
|
|
6970
7166
|
function assertPatternsInput(input) {
|
|
@@ -7142,14 +7338,14 @@ import "node:fs";
|
|
|
7142
7338
|
import { createRequire } from "node:module";
|
|
7143
7339
|
import {
|
|
7144
7340
|
resolve,
|
|
7145
|
-
join,
|
|
7146
|
-
dirname,
|
|
7341
|
+
join as join2,
|
|
7342
|
+
dirname as dirname2,
|
|
7147
7343
|
relative,
|
|
7148
7344
|
normalize,
|
|
7149
7345
|
sep,
|
|
7150
7346
|
extname
|
|
7151
7347
|
} from "node:path";
|
|
7152
|
-
import "node:url";
|
|
7348
|
+
import { fileURLToPath } from "node:url";
|
|
7153
7349
|
function safeExecuteAsync(fn, message) {
|
|
7154
7350
|
return fn().catch((error2) => {
|
|
7155
7351
|
throw new Error(
|
|
@@ -7157,7 +7353,7 @@ function safeExecuteAsync(fn, message) {
|
|
|
7157
7353
|
);
|
|
7158
7354
|
});
|
|
7159
7355
|
}
|
|
7160
|
-
var import_fast_glob, constants,
|
|
7356
|
+
var import_fast_glob, constants, log3, PACKAGE_PATHS, PathResolver;
|
|
7161
7357
|
var init_PathResolver = __esm({
|
|
7162
7358
|
"packages/core/config/utils/PathResolver.ts"() {
|
|
7163
7359
|
"use strict";
|
|
@@ -7170,7 +7366,7 @@ var init_PathResolver = __esm({
|
|
|
7170
7366
|
getPatternsFor: getPatternsFor || void 0,
|
|
7171
7367
|
I18N_PATHS: I18N_PATHS || void 0
|
|
7172
7368
|
};
|
|
7173
|
-
|
|
7369
|
+
log3 = {
|
|
7174
7370
|
error: (message, error2) => {
|
|
7175
7371
|
},
|
|
7176
7372
|
warn: (message, error2) => {
|
|
@@ -7206,6 +7402,7 @@ var init_PathResolver = __esm({
|
|
|
7206
7402
|
options;
|
|
7207
7403
|
_repoRoot;
|
|
7208
7404
|
_appRoot = null;
|
|
7405
|
+
_writtenPaths = null;
|
|
7209
7406
|
/**
|
|
7210
7407
|
* Get or create singleton instance
|
|
7211
7408
|
* @param options - Configuration options
|
|
@@ -7291,7 +7488,7 @@ var init_PathResolver = __esm({
|
|
|
7291
7488
|
*/
|
|
7292
7489
|
getDirname(path) {
|
|
7293
7490
|
if (!path) return "";
|
|
7294
|
-
return this.normalizePath(
|
|
7491
|
+
return this.normalizePath(dirname2(path));
|
|
7295
7492
|
}
|
|
7296
7493
|
/**
|
|
7297
7494
|
* Resolve package path using Node's module resolution
|
|
@@ -7303,7 +7500,7 @@ var init_PathResolver = __esm({
|
|
|
7303
7500
|
resolvePackage(packageSpecifier, fromPath = null) {
|
|
7304
7501
|
try {
|
|
7305
7502
|
const basePath = fromPath || this.getAppRoot();
|
|
7306
|
-
const require3 = createRequire(
|
|
7503
|
+
const require3 = createRequire(join2(basePath, "package.json"));
|
|
7307
7504
|
const resolved = require3.resolve(packageSpecifier);
|
|
7308
7505
|
return this.normalizePath(resolved);
|
|
7309
7506
|
} catch (error2) {
|
|
@@ -7455,7 +7652,7 @@ var init_PathResolver = __esm({
|
|
|
7455
7652
|
return cleanContent;
|
|
7456
7653
|
} catch (error2) {
|
|
7457
7654
|
if (this.options.debug) {
|
|
7458
|
-
|
|
7655
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
7459
7656
|
}
|
|
7460
7657
|
return null;
|
|
7461
7658
|
}
|
|
@@ -7483,7 +7680,7 @@ var init_PathResolver = __esm({
|
|
|
7483
7680
|
return cleanContent;
|
|
7484
7681
|
} catch (error2) {
|
|
7485
7682
|
if (this.options.debug) {
|
|
7486
|
-
|
|
7683
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
7487
7684
|
}
|
|
7488
7685
|
return null;
|
|
7489
7686
|
}
|
|
@@ -7505,16 +7702,16 @@ var init_PathResolver = __esm({
|
|
|
7505
7702
|
verbose = false
|
|
7506
7703
|
} = options;
|
|
7507
7704
|
const normalizedPath = this.normalizePath(filePath);
|
|
7508
|
-
const dir = this.normalizePath(
|
|
7705
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
7509
7706
|
const fileExists = this.pathExists(normalizedPath);
|
|
7510
7707
|
if (fileExists && !overwrite) {
|
|
7511
7708
|
if (verbose) {
|
|
7512
|
-
|
|
7709
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
7513
7710
|
}
|
|
7514
7711
|
return false;
|
|
7515
7712
|
}
|
|
7516
7713
|
if (dryRun) {
|
|
7517
|
-
|
|
7714
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
7518
7715
|
return true;
|
|
7519
7716
|
}
|
|
7520
7717
|
try {
|
|
@@ -7524,22 +7721,23 @@ var init_PathResolver = __esm({
|
|
|
7524
7721
|
}
|
|
7525
7722
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
7526
7723
|
let writeContent;
|
|
7527
|
-
if (
|
|
7724
|
+
if (Buffer2.isBuffer(content)) {
|
|
7528
7725
|
writeContent = content;
|
|
7529
7726
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
7530
|
-
writeContent = JSON.stringify(content, null, 2)
|
|
7727
|
+
writeContent = `${JSON.stringify(content, null, 2)}
|
|
7728
|
+
`;
|
|
7531
7729
|
} else {
|
|
7532
7730
|
writeContent = String(content);
|
|
7533
7731
|
}
|
|
7534
7732
|
try {
|
|
7535
7733
|
return await safeExecuteAsync(async () => {
|
|
7536
|
-
if (
|
|
7734
|
+
if (Buffer2.isBuffer(writeContent)) {
|
|
7537
7735
|
await fs.promises.writeFile(normalizedPath, writeContent);
|
|
7538
7736
|
} else {
|
|
7539
7737
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
7540
7738
|
}
|
|
7541
7739
|
if (verbose) {
|
|
7542
|
-
|
|
7740
|
+
log3.info(
|
|
7543
7741
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
7544
7742
|
);
|
|
7545
7743
|
}
|
|
@@ -7566,16 +7764,16 @@ var init_PathResolver = __esm({
|
|
|
7566
7764
|
verbose = false
|
|
7567
7765
|
} = options;
|
|
7568
7766
|
const normalizedPath = this.normalizePath(filePath);
|
|
7569
|
-
const dir = this.normalizePath(
|
|
7767
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
7570
7768
|
const fileExists = this.pathExists(normalizedPath);
|
|
7571
7769
|
if (fileExists && !overwrite) {
|
|
7572
7770
|
if (verbose) {
|
|
7573
|
-
|
|
7771
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
7574
7772
|
}
|
|
7575
7773
|
return false;
|
|
7576
7774
|
}
|
|
7577
7775
|
if (dryRun) {
|
|
7578
|
-
|
|
7776
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
7579
7777
|
return true;
|
|
7580
7778
|
}
|
|
7581
7779
|
try {
|
|
@@ -7585,21 +7783,23 @@ var init_PathResolver = __esm({
|
|
|
7585
7783
|
}
|
|
7586
7784
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
7587
7785
|
let writeContent;
|
|
7588
|
-
if (
|
|
7786
|
+
if (Buffer2.isBuffer(content)) {
|
|
7589
7787
|
writeContent = content;
|
|
7590
7788
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
7591
|
-
writeContent = JSON.stringify(content, null, 2)
|
|
7789
|
+
writeContent = `${JSON.stringify(content, null, 2)}
|
|
7790
|
+
`;
|
|
7592
7791
|
} else {
|
|
7593
7792
|
writeContent = String(content);
|
|
7594
7793
|
}
|
|
7595
7794
|
try {
|
|
7596
|
-
if (
|
|
7795
|
+
if (Buffer2.isBuffer(writeContent)) {
|
|
7597
7796
|
fs.writeFileSync(normalizedPath, writeContent);
|
|
7598
7797
|
} else {
|
|
7599
7798
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
7600
7799
|
}
|
|
7800
|
+
this._writtenPaths?.add(normalizedPath);
|
|
7601
7801
|
if (verbose) {
|
|
7602
|
-
|
|
7802
|
+
log3.info(
|
|
7603
7803
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
7604
7804
|
);
|
|
7605
7805
|
}
|
|
@@ -7624,15 +7824,15 @@ var init_PathResolver = __esm({
|
|
|
7624
7824
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7625
7825
|
if (fileExists && !overwrite) {
|
|
7626
7826
|
if (verbose) {
|
|
7627
|
-
|
|
7827
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7628
7828
|
}
|
|
7629
7829
|
return false;
|
|
7630
7830
|
}
|
|
7631
7831
|
if (dryRun) {
|
|
7632
|
-
|
|
7832
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7633
7833
|
return true;
|
|
7634
7834
|
}
|
|
7635
|
-
const dir = this.normalizePath(
|
|
7835
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7636
7836
|
try {
|
|
7637
7837
|
await fs.promises.mkdir(dir, { recursive: true });
|
|
7638
7838
|
} catch (error2) {
|
|
@@ -7642,7 +7842,7 @@ var init_PathResolver = __esm({
|
|
|
7642
7842
|
return await safeExecuteAsync(async () => {
|
|
7643
7843
|
await fs.promises.copyFile(srcPath, normalizedDestPath);
|
|
7644
7844
|
if (verbose) {
|
|
7645
|
-
|
|
7845
|
+
log3.info(
|
|
7646
7846
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7647
7847
|
);
|
|
7648
7848
|
}
|
|
@@ -7666,15 +7866,15 @@ var init_PathResolver = __esm({
|
|
|
7666
7866
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7667
7867
|
if (fileExists && !overwrite) {
|
|
7668
7868
|
if (verbose) {
|
|
7669
|
-
|
|
7869
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7670
7870
|
}
|
|
7671
7871
|
return false;
|
|
7672
7872
|
}
|
|
7673
7873
|
if (dryRun) {
|
|
7674
|
-
|
|
7874
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7675
7875
|
return true;
|
|
7676
7876
|
}
|
|
7677
|
-
const dir = this.normalizePath(
|
|
7877
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7678
7878
|
try {
|
|
7679
7879
|
fs.mkdirSync(dir, { recursive: true });
|
|
7680
7880
|
} catch (error2) {
|
|
@@ -7682,8 +7882,9 @@ var init_PathResolver = __esm({
|
|
|
7682
7882
|
}
|
|
7683
7883
|
try {
|
|
7684
7884
|
fs.copyFileSync(srcPath, normalizedDestPath);
|
|
7885
|
+
this._writtenPaths?.add(normalizedDestPath);
|
|
7685
7886
|
if (verbose) {
|
|
7686
|
-
|
|
7887
|
+
log3.info(
|
|
7687
7888
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7688
7889
|
);
|
|
7689
7890
|
}
|
|
@@ -7700,7 +7901,7 @@ var init_PathResolver = __esm({
|
|
|
7700
7901
|
return fs.existsSync(filePath);
|
|
7701
7902
|
} catch (error2) {
|
|
7702
7903
|
if (!silent) {
|
|
7703
|
-
|
|
7904
|
+
log3.error(`Error checking path existence: ${filePath}`, error2);
|
|
7704
7905
|
}
|
|
7705
7906
|
return false;
|
|
7706
7907
|
}
|
|
@@ -7726,7 +7927,7 @@ var init_PathResolver = __esm({
|
|
|
7726
7927
|
return fs.readdirSync(dirPath, options);
|
|
7727
7928
|
} catch (error2) {
|
|
7728
7929
|
if (this.options.debug) {
|
|
7729
|
-
|
|
7930
|
+
log3.warn(`Failed to read directory: ${dirPath}`, error2);
|
|
7730
7931
|
}
|
|
7731
7932
|
const isObjectOptions = options && typeof options === "object" && "withFileTypes" in options;
|
|
7732
7933
|
return isObjectOptions && options.withFileTypes ? [] : [];
|
|
@@ -7744,11 +7945,29 @@ var init_PathResolver = __esm({
|
|
|
7744
7945
|
return fs.statSync(filePath);
|
|
7745
7946
|
} catch (error2) {
|
|
7746
7947
|
if (this.options.debug) {
|
|
7747
|
-
|
|
7948
|
+
log3.warn(`Failed to stat file: ${filePath}`, error2);
|
|
7748
7949
|
}
|
|
7749
7950
|
return null;
|
|
7750
7951
|
}
|
|
7751
7952
|
}
|
|
7953
|
+
/**
|
|
7954
|
+
* Resolve the real path of a file, following symlinks
|
|
7955
|
+
* @param filePath - Path to resolve
|
|
7956
|
+
* @returns Resolved real path
|
|
7957
|
+
*/
|
|
7958
|
+
realpathSync(filePath) {
|
|
7959
|
+
return fs.realpathSync(filePath);
|
|
7960
|
+
}
|
|
7961
|
+
/**
|
|
7962
|
+
* Watch a directory for changes
|
|
7963
|
+
* @param dirPath - Directory to watch
|
|
7964
|
+
* @param options - fs.watch options
|
|
7965
|
+
* @param callback - Callback for change events
|
|
7966
|
+
* @returns FSWatcher instance
|
|
7967
|
+
*/
|
|
7968
|
+
watch(dirPath, options, callback) {
|
|
7969
|
+
return fs.watch(dirPath, options, callback);
|
|
7970
|
+
}
|
|
7752
7971
|
/**
|
|
7753
7972
|
* Get file stats synchronously (follows symlinks)
|
|
7754
7973
|
* Returns null if file doesn't exist (graceful degradation)
|
|
@@ -7761,7 +7980,7 @@ var init_PathResolver = __esm({
|
|
|
7761
7980
|
return fs.lstatSync(filePath);
|
|
7762
7981
|
} catch (error2) {
|
|
7763
7982
|
if (this.options.debug) {
|
|
7764
|
-
|
|
7983
|
+
log3.warn(`Failed to lstat file: ${filePath}`, error2);
|
|
7765
7984
|
}
|
|
7766
7985
|
return null;
|
|
7767
7986
|
}
|
|
@@ -7828,6 +8047,28 @@ var init_PathResolver = __esm({
|
|
|
7828
8047
|
* Get app root (where vite.config.ts is, Vite's config.root)
|
|
7829
8048
|
* Falls back to repoRoot if not set
|
|
7830
8049
|
*/
|
|
8050
|
+
/**
|
|
8051
|
+
* Start recording every path written by writeSync/copySync.
|
|
8052
|
+
* Lets a generator know exactly which files the current run produced,
|
|
8053
|
+
* without comparing file timestamps to a clock.
|
|
8054
|
+
*/
|
|
8055
|
+
startWriteRecording() {
|
|
8056
|
+
this._writtenPaths = /* @__PURE__ */ new Set();
|
|
8057
|
+
}
|
|
8058
|
+
/**
|
|
8059
|
+
* Stop recording and return the normalized paths written since
|
|
8060
|
+
* startWriteRecording().
|
|
8061
|
+
*/
|
|
8062
|
+
stopWriteRecording() {
|
|
8063
|
+
if (!this._writtenPaths) {
|
|
8064
|
+
throw new Error(
|
|
8065
|
+
"stopWriteRecording() called without startWriteRecording()"
|
|
8066
|
+
);
|
|
8067
|
+
}
|
|
8068
|
+
const written = this._writtenPaths;
|
|
8069
|
+
this._writtenPaths = null;
|
|
8070
|
+
return written;
|
|
8071
|
+
}
|
|
7831
8072
|
getAppRoot() {
|
|
7832
8073
|
if (!this._appRoot) {
|
|
7833
8074
|
return this._repoRoot;
|
|
@@ -7850,7 +8091,7 @@ var init_PathResolver = __esm({
|
|
|
7850
8091
|
* @returns True if repoRoot is the monorepo (has packages directory)
|
|
7851
8092
|
*/
|
|
7852
8093
|
isMonorepo() {
|
|
7853
|
-
const packagesDir =
|
|
8094
|
+
const packagesDir = join2(this._repoRoot, "packages");
|
|
7854
8095
|
return this.pathExists(packagesDir);
|
|
7855
8096
|
}
|
|
7856
8097
|
/**
|
|
@@ -7867,7 +8108,7 @@ var init_PathResolver = __esm({
|
|
|
7867
8108
|
* Find files matching pattern within directory
|
|
7868
8109
|
*/
|
|
7869
8110
|
async findFiles(directory, pattern, options = {}) {
|
|
7870
|
-
const searchPattern = this.normalizePath(
|
|
8111
|
+
const searchPattern = this.normalizePath(join2(directory, pattern));
|
|
7871
8112
|
const appRoot = this.getAppRoot();
|
|
7872
8113
|
const normalizeAppRoot = this.normalizePath(appRoot);
|
|
7873
8114
|
const relativePattern = searchPattern.startsWith(normalizeAppRoot) ? searchPattern.slice(normalizeAppRoot.length + 1) : searchPattern;
|
|
@@ -7914,7 +8155,7 @@ var init_PathResolver = __esm({
|
|
|
7914
8155
|
return null;
|
|
7915
8156
|
}
|
|
7916
8157
|
const resolvedPath = this.normalizePath(
|
|
7917
|
-
|
|
8158
|
+
join2(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
|
|
7918
8159
|
);
|
|
7919
8160
|
const resolvedDir = resolvedPath.replace(/\/[^/]*\*.*$/, "");
|
|
7920
8161
|
if (this.pathExists(resolvedDir)) {
|
|
@@ -8085,6 +8326,15 @@ var init_PathResolver = __esm({
|
|
|
8085
8326
|
const cjsPath = this.getEmptyCjsModulePath();
|
|
8086
8327
|
return cjsPath.replace(/\.cjs$/, ".js");
|
|
8087
8328
|
}
|
|
8329
|
+
/**
|
|
8330
|
+
* Get absolute path to empty flag component module.
|
|
8331
|
+
* Returns `export default () => null;` — used by flag filtering plugins
|
|
8332
|
+
* to replace unused flag files at build time.
|
|
8333
|
+
*/
|
|
8334
|
+
getEmptyFlagModulePath() {
|
|
8335
|
+
const __dirname2 = dirname2(fileURLToPath(import.meta.url));
|
|
8336
|
+
return this.normalizePath(resolve(__dirname2, "emptyFlag.js"));
|
|
8337
|
+
}
|
|
8088
8338
|
/**
|
|
8089
8339
|
* Get absolute path to empty CJS module for esbuild pre-bundling.
|
|
8090
8340
|
* CJS because esbuild statically analyzes ESM exports — CJS has dynamic
|
|
@@ -8110,13 +8360,13 @@ var init_PathResolver = __esm({
|
|
|
8110
8360
|
const maxLevels = this.options.maxLevels;
|
|
8111
8361
|
while (levelsChecked < maxLevels) {
|
|
8112
8362
|
const toolingPath = this.normalizePath(
|
|
8113
|
-
|
|
8363
|
+
join2(currentDir, PACKAGE_PATHS.TOOLING)
|
|
8114
8364
|
);
|
|
8115
|
-
const corePath = this.normalizePath(
|
|
8365
|
+
const corePath = this.normalizePath(join2(currentDir, PACKAGE_PATHS.CORE));
|
|
8116
8366
|
if (this.pathExists(toolingPath) && this.pathExists(corePath)) {
|
|
8117
8367
|
return currentDir;
|
|
8118
8368
|
}
|
|
8119
|
-
const appsDir =
|
|
8369
|
+
const appsDir = join2(currentDir, "apps");
|
|
8120
8370
|
if (this.pathExists(appsDir)) {
|
|
8121
8371
|
const appsDirStat = this.statSync(appsDir);
|
|
8122
8372
|
if (appsDirStat?.isDirectory()) {
|
|
@@ -8124,15 +8374,15 @@ var init_PathResolver = __esm({
|
|
|
8124
8374
|
}
|
|
8125
8375
|
}
|
|
8126
8376
|
const packageJsonPath = this.normalizePath(
|
|
8127
|
-
|
|
8377
|
+
join2(currentDir, "package.json")
|
|
8128
8378
|
);
|
|
8129
8379
|
if (this.pathExists(packageJsonPath)) {
|
|
8130
|
-
const parentDir2 = this.normalizePath(
|
|
8380
|
+
const parentDir2 = this.normalizePath(dirname2(currentDir));
|
|
8131
8381
|
if (parentDir2 === currentDir) {
|
|
8132
8382
|
return currentDir;
|
|
8133
8383
|
}
|
|
8134
8384
|
}
|
|
8135
|
-
const parentDir = this.normalizePath(
|
|
8385
|
+
const parentDir = this.normalizePath(dirname2(currentDir));
|
|
8136
8386
|
if (parentDir === currentDir) {
|
|
8137
8387
|
break;
|
|
8138
8388
|
}
|
|
@@ -8148,8 +8398,8 @@ var init_PathResolver = __esm({
|
|
|
8148
8398
|
// packages/tooling/src/utils/pathResolver.ts
|
|
8149
8399
|
import { createRequire as createRequire2 } from "node:module";
|
|
8150
8400
|
import {
|
|
8151
|
-
join as
|
|
8152
|
-
dirname as
|
|
8401
|
+
join as join3,
|
|
8402
|
+
dirname as dirname3,
|
|
8153
8403
|
basename as basename2,
|
|
8154
8404
|
extname as extname2,
|
|
8155
8405
|
relative as relative2,
|
|
@@ -8158,7 +8408,7 @@ import {
|
|
|
8158
8408
|
isAbsolute as pathIsAbsolute
|
|
8159
8409
|
} from "node:path";
|
|
8160
8410
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
8161
|
-
function
|
|
8411
|
+
function readdirSync3(dirPath, options) {
|
|
8162
8412
|
return pathResolverInstance.readdirSync(dirPath, options);
|
|
8163
8413
|
}
|
|
8164
8414
|
var pathResolverInstance, getRepoRoot, normalizePath, pathExists, readSync, statSync2, joinPath;
|
|
@@ -8170,7 +8420,7 @@ var init_pathResolver = __esm({
|
|
|
8170
8420
|
pathResolverInstance = PathResolver.getInstance({ debug: false });
|
|
8171
8421
|
getRepoRoot = () => pathResolverInstance.getRepoRoot();
|
|
8172
8422
|
normalizePath = (...pathSegments) => {
|
|
8173
|
-
return pathResolverInstance.normalizePath(
|
|
8423
|
+
return pathResolverInstance.normalizePath(join3(...pathSegments));
|
|
8174
8424
|
};
|
|
8175
8425
|
pathExists = (filePath, silent = false) => pathResolverInstance.pathExists(filePath, silent);
|
|
8176
8426
|
readSync = (filePath, options) => pathResolverInstance.readSync(filePath, options);
|
|
@@ -8210,10 +8460,10 @@ var init_typed_file_operations = __esm({
|
|
|
8210
8460
|
});
|
|
8211
8461
|
|
|
8212
8462
|
// packages/tooling/src/bundler/utils.ts
|
|
8213
|
-
import { Buffer } from "node:buffer";
|
|
8463
|
+
import { Buffer as Buffer2 } from "node:buffer";
|
|
8214
8464
|
import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
8215
8465
|
import { createRequire as createRequire3 } from "node:module";
|
|
8216
|
-
import { dirname as
|
|
8466
|
+
import { dirname as dirname4, resolve as resolve3 } from "node:path";
|
|
8217
8467
|
import process from "node:process";
|
|
8218
8468
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
8219
8469
|
var require2, __filename, __dirname;
|
|
@@ -8222,12 +8472,12 @@ var init_utils2 = __esm({
|
|
|
8222
8472
|
"use strict";
|
|
8223
8473
|
require2 = createRequire3(import.meta.url);
|
|
8224
8474
|
__filename = fileURLToPath3(import.meta.url);
|
|
8225
|
-
__dirname =
|
|
8475
|
+
__dirname = dirname4(__filename);
|
|
8226
8476
|
if (typeof globalThis !== "undefined") {
|
|
8227
8477
|
globalThis.require = require2;
|
|
8228
8478
|
globalThis.__filename = __filename;
|
|
8229
8479
|
globalThis.__dirname = __dirname;
|
|
8230
|
-
globalThis.Buffer =
|
|
8480
|
+
globalThis.Buffer = Buffer2;
|
|
8231
8481
|
globalThis.process = process;
|
|
8232
8482
|
if (typeof global === "undefined") {
|
|
8233
8483
|
globalThis.global = globalThis;
|
|
@@ -8242,7 +8492,7 @@ function detectApps(projectRoot) {
|
|
|
8242
8492
|
const appsDir = joinPath(projectRoot, "apps");
|
|
8243
8493
|
const appsDirStat = statSync2(appsDir);
|
|
8244
8494
|
if (pathExists(appsDir) && appsDirStat?.isDirectory()) {
|
|
8245
|
-
const appDirs =
|
|
8495
|
+
const appDirs = readdirSync3(appsDir, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name).sort();
|
|
8246
8496
|
for (const appDir of appDirs) {
|
|
8247
8497
|
const appPath = joinPath(appsDir, appDir);
|
|
8248
8498
|
const packageJsonPath = joinPath(appPath, "package.json");
|
|
@@ -8419,17 +8669,17 @@ var init_app_detection = __esm({
|
|
|
8419
8669
|
async function selectApp(projectRoot, appName) {
|
|
8420
8670
|
const apps = detectApps(projectRoot);
|
|
8421
8671
|
if (apps.length === 0) {
|
|
8422
|
-
|
|
8423
|
-
|
|
8672
|
+
log2.error("No apps found in this project.");
|
|
8673
|
+
log2.info('Run "dndev init" to create a new project.');
|
|
8424
8674
|
return null;
|
|
8425
8675
|
}
|
|
8426
8676
|
if (appName) {
|
|
8427
|
-
const app = apps.find((
|
|
8677
|
+
const app = apps.find((a2) => a2.name === appName);
|
|
8428
8678
|
if (!app) {
|
|
8429
|
-
|
|
8430
|
-
|
|
8431
|
-
apps.forEach((
|
|
8432
|
-
|
|
8679
|
+
log2.warn(`App "${appName}" not found.`);
|
|
8680
|
+
log2.info("Available apps:");
|
|
8681
|
+
apps.forEach((a2) => log2.info(` - ${a2.name}`));
|
|
8682
|
+
log2.info("Please select from the list:");
|
|
8433
8683
|
} else {
|
|
8434
8684
|
return app;
|
|
8435
8685
|
}
|
|
@@ -8437,7 +8687,7 @@ async function selectApp(projectRoot, appName) {
|
|
|
8437
8687
|
if (apps.length === 1) {
|
|
8438
8688
|
return apps[0] || null;
|
|
8439
8689
|
}
|
|
8440
|
-
const selected = await
|
|
8690
|
+
const selected = await select({
|
|
8441
8691
|
message: "Select app:",
|
|
8442
8692
|
options: apps.map((app) => ({
|
|
8443
8693
|
value: app.name,
|
|
@@ -8447,7 +8697,7 @@ async function selectApp(projectRoot, appName) {
|
|
|
8447
8697
|
if (typeof selected !== "string") {
|
|
8448
8698
|
return null;
|
|
8449
8699
|
}
|
|
8450
|
-
return apps.find((
|
|
8700
|
+
return apps.find((a2) => a2.name === selected) || null;
|
|
8451
8701
|
}
|
|
8452
8702
|
var init_app_selector = __esm({
|
|
8453
8703
|
"packages/tooling/src/utils/app-selector.ts"() {
|
|
@@ -8520,7 +8770,7 @@ async function main() {
|
|
|
8520
8770
|
if (!app) {
|
|
8521
8771
|
return 1;
|
|
8522
8772
|
}
|
|
8523
|
-
|
|
8773
|
+
log2.info(`Starting dev server for ${app.name}...
|
|
8524
8774
|
`);
|
|
8525
8775
|
const turboArgs = ["dev", "--filter", app.packageName];
|
|
8526
8776
|
const isWindows = platform2() === "win32";
|
|
@@ -8535,7 +8785,7 @@ async function main() {
|
|
|
8535
8785
|
);
|
|
8536
8786
|
const cleanup = (signal) => {
|
|
8537
8787
|
if (!childProcess.pid) return;
|
|
8538
|
-
|
|
8788
|
+
log2.debug(`Received ${signal}, cleaning up processes...`);
|
|
8539
8789
|
if (isWindows) {
|
|
8540
8790
|
try {
|
|
8541
8791
|
execSync2(`taskkill /F /T /PID ${childProcess.pid}`, {
|
|
@@ -8563,7 +8813,7 @@ async function main() {
|
|
|
8563
8813
|
for (const signal of signals) {
|
|
8564
8814
|
const handler = () => {
|
|
8565
8815
|
cleanup(signal);
|
|
8566
|
-
handlers.forEach((
|
|
8816
|
+
handlers.forEach((h2) => h2());
|
|
8567
8817
|
process.exit(SIGNAL_EXIT_CODES[signal] ?? 130);
|
|
8568
8818
|
};
|
|
8569
8819
|
process.on(signal, handler);
|
|
@@ -8571,17 +8821,17 @@ async function main() {
|
|
|
8571
8821
|
}
|
|
8572
8822
|
return new Promise((resolve4) => {
|
|
8573
8823
|
childProcess.on("exit", (code, signal) => {
|
|
8574
|
-
handlers.forEach((
|
|
8824
|
+
handlers.forEach((h2) => h2());
|
|
8575
8825
|
if (signal) {
|
|
8576
|
-
|
|
8826
|
+
log2.debug(`Process killed by signal: ${signal}`);
|
|
8577
8827
|
resolve4(SIGNAL_EXIT_CODES[signal] ?? 130);
|
|
8578
8828
|
} else {
|
|
8579
8829
|
resolve4(code ?? 0);
|
|
8580
8830
|
}
|
|
8581
8831
|
});
|
|
8582
8832
|
childProcess.on("error", (error2) => {
|
|
8583
|
-
handlers.forEach((
|
|
8584
|
-
|
|
8833
|
+
handlers.forEach((h2) => h2());
|
|
8834
|
+
log2.error(`Failed to start dev server: ${error2.message}`);
|
|
8585
8835
|
resolve4(1);
|
|
8586
8836
|
});
|
|
8587
8837
|
});
|