@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
|
@@ -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 __export = (target, all) => {
|
|
20
29
|
for (var name in all)
|
|
@@ -37,31 +46,40 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
37
46
|
mod
|
|
38
47
|
));
|
|
39
48
|
|
|
40
|
-
// node_modules/.bun/fast-string-truncated-width@
|
|
41
|
-
var
|
|
49
|
+
// node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
|
|
50
|
+
var getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji;
|
|
42
51
|
var init_utils = __esm({
|
|
43
|
-
"node_modules/.bun/fast-string-truncated-width@
|
|
52
|
+
"node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js"() {
|
|
44
53
|
init_utils2();
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
54
|
+
getCodePointsLength = /* @__PURE__ */ (() => {
|
|
55
|
+
const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
56
|
+
return (input) => {
|
|
57
|
+
let surrogatePairsNr = 0;
|
|
58
|
+
SURROGATE_PAIR_RE.lastIndex = 0;
|
|
59
|
+
while (SURROGATE_PAIR_RE.test(input)) {
|
|
60
|
+
surrogatePairsNr += 1;
|
|
61
|
+
}
|
|
62
|
+
return input.length - surrogatePairsNr;
|
|
63
|
+
};
|
|
64
|
+
})();
|
|
48
65
|
isFullWidth = (x) => {
|
|
49
66
|
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
50
67
|
};
|
|
51
|
-
|
|
52
|
-
return x
|
|
68
|
+
isWideNotCJKTNotEmoji = (x) => {
|
|
69
|
+
return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
53
70
|
};
|
|
54
71
|
}
|
|
55
72
|
});
|
|
56
73
|
|
|
57
|
-
// node_modules/.bun/fast-string-truncated-width@
|
|
58
|
-
var ANSI_RE, CONTROL_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
|
|
74
|
+
// node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
|
|
75
|
+
var ANSI_RE, CONTROL_RE, CJKT_WIDE_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
|
|
59
76
|
var init_dist = __esm({
|
|
60
|
-
"node_modules/.bun/fast-string-truncated-width@
|
|
77
|
+
"node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js"() {
|
|
61
78
|
init_utils2();
|
|
62
79
|
init_utils();
|
|
63
|
-
ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
|
|
80
|
+
ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
|
|
64
81
|
CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
82
|
+
CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
|
|
65
83
|
TAB_RE = /\t{1,1000}/y;
|
|
66
84
|
EMOJI_RE = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu");
|
|
67
85
|
LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
@@ -71,14 +89,21 @@ var init_dist = __esm({
|
|
|
71
89
|
const LIMIT = truncationOptions.limit ?? Infinity;
|
|
72
90
|
const ELLIPSIS = truncationOptions.ellipsis ?? "";
|
|
73
91
|
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
|
|
74
|
-
const ANSI_WIDTH =
|
|
92
|
+
const ANSI_WIDTH = 0;
|
|
75
93
|
const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
|
|
76
94
|
const TAB_WIDTH = widthOptions.tabWidth ?? 8;
|
|
77
|
-
const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
|
|
78
95
|
const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
|
|
79
|
-
const FULL_WIDTH_WIDTH =
|
|
96
|
+
const FULL_WIDTH_WIDTH = 2;
|
|
80
97
|
const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
|
|
81
|
-
const WIDE_WIDTH = widthOptions.wideWidth ??
|
|
98
|
+
const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
|
|
99
|
+
const PARSE_BLOCKS = [
|
|
100
|
+
[LATIN_RE, REGULAR_WIDTH],
|
|
101
|
+
[ANSI_RE, ANSI_WIDTH],
|
|
102
|
+
[CONTROL_RE, CONTROL_WIDTH],
|
|
103
|
+
[TAB_RE, TAB_WIDTH],
|
|
104
|
+
[EMOJI_RE, EMOJI_WIDTH],
|
|
105
|
+
[CJKT_WIDE_RE, WIDE_WIDTH]
|
|
106
|
+
];
|
|
82
107
|
let indexPrev = 0;
|
|
83
108
|
let index = 0;
|
|
84
109
|
let length = input.length;
|
|
@@ -98,10 +123,8 @@ var init_dist = __esm({
|
|
|
98
123
|
const codePoint = char.codePointAt(0) || 0;
|
|
99
124
|
if (isFullWidth(codePoint)) {
|
|
100
125
|
widthExtra = FULL_WIDTH_WIDTH;
|
|
101
|
-
} else if (
|
|
126
|
+
} else if (isWideNotCJKTNotEmoji(codePoint)) {
|
|
102
127
|
widthExtra = WIDE_WIDTH;
|
|
103
|
-
} else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) {
|
|
104
|
-
widthExtra = AMBIGUOUS_WIDTH;
|
|
105
128
|
} else {
|
|
106
129
|
widthExtra = REGULAR_WIDTH;
|
|
107
130
|
}
|
|
@@ -117,88 +140,28 @@ var init_dist = __esm({
|
|
|
117
140
|
}
|
|
118
141
|
unmatchedStart = unmatchedEnd = 0;
|
|
119
142
|
}
|
|
120
|
-
if (index >= length)
|
|
121
|
-
break;
|
|
122
|
-
LATIN_RE.lastIndex = index;
|
|
123
|
-
if (LATIN_RE.test(input)) {
|
|
124
|
-
lengthExtra = LATIN_RE.lastIndex - index;
|
|
125
|
-
widthExtra = lengthExtra * REGULAR_WIDTH;
|
|
126
|
-
if (width + widthExtra > truncationLimit) {
|
|
127
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
|
|
128
|
-
}
|
|
129
|
-
if (width + widthExtra > LIMIT) {
|
|
130
|
-
truncationEnabled = true;
|
|
131
|
-
break;
|
|
132
|
-
}
|
|
133
|
-
width += widthExtra;
|
|
134
|
-
unmatchedStart = indexPrev;
|
|
135
|
-
unmatchedEnd = index;
|
|
136
|
-
index = indexPrev = LATIN_RE.lastIndex;
|
|
137
|
-
continue;
|
|
138
|
-
}
|
|
139
|
-
ANSI_RE.lastIndex = index;
|
|
140
|
-
if (ANSI_RE.test(input)) {
|
|
141
|
-
if (width + ANSI_WIDTH > truncationLimit) {
|
|
142
|
-
truncationIndex = Math.min(truncationIndex, index);
|
|
143
|
-
}
|
|
144
|
-
if (width + ANSI_WIDTH > LIMIT) {
|
|
145
|
-
truncationEnabled = true;
|
|
146
|
-
break;
|
|
147
|
-
}
|
|
148
|
-
width += ANSI_WIDTH;
|
|
149
|
-
unmatchedStart = indexPrev;
|
|
150
|
-
unmatchedEnd = index;
|
|
151
|
-
index = indexPrev = ANSI_RE.lastIndex;
|
|
152
|
-
continue;
|
|
153
|
-
}
|
|
154
|
-
CONTROL_RE.lastIndex = index;
|
|
155
|
-
if (CONTROL_RE.test(input)) {
|
|
156
|
-
lengthExtra = CONTROL_RE.lastIndex - index;
|
|
157
|
-
widthExtra = lengthExtra * CONTROL_WIDTH;
|
|
158
|
-
if (width + widthExtra > truncationLimit) {
|
|
159
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
|
|
160
|
-
}
|
|
161
|
-
if (width + widthExtra > LIMIT) {
|
|
162
|
-
truncationEnabled = true;
|
|
163
|
-
break;
|
|
164
|
-
}
|
|
165
|
-
width += widthExtra;
|
|
166
|
-
unmatchedStart = indexPrev;
|
|
167
|
-
unmatchedEnd = index;
|
|
168
|
-
index = indexPrev = CONTROL_RE.lastIndex;
|
|
169
|
-
continue;
|
|
170
|
-
}
|
|
171
|
-
TAB_RE.lastIndex = index;
|
|
172
|
-
if (TAB_RE.test(input)) {
|
|
173
|
-
lengthExtra = TAB_RE.lastIndex - index;
|
|
174
|
-
widthExtra = lengthExtra * TAB_WIDTH;
|
|
175
|
-
if (width + widthExtra > truncationLimit) {
|
|
176
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
|
|
177
|
-
}
|
|
178
|
-
if (width + widthExtra > LIMIT) {
|
|
179
|
-
truncationEnabled = true;
|
|
180
|
-
break;
|
|
181
|
-
}
|
|
182
|
-
width += widthExtra;
|
|
183
|
-
unmatchedStart = indexPrev;
|
|
184
|
-
unmatchedEnd = index;
|
|
185
|
-
index = indexPrev = TAB_RE.lastIndex;
|
|
186
|
-
continue;
|
|
143
|
+
if (index >= length) {
|
|
144
|
+
break outer;
|
|
187
145
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
146
|
+
for (let i2 = 0, l2 = PARSE_BLOCKS.length; i2 < l2; i2++) {
|
|
147
|
+
const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i2];
|
|
148
|
+
BLOCK_RE.lastIndex = index;
|
|
149
|
+
if (BLOCK_RE.test(input)) {
|
|
150
|
+
lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
|
|
151
|
+
widthExtra = lengthExtra * BLOCK_WIDTH;
|
|
152
|
+
if (width + widthExtra > truncationLimit) {
|
|
153
|
+
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
|
|
154
|
+
}
|
|
155
|
+
if (width + widthExtra > LIMIT) {
|
|
156
|
+
truncationEnabled = true;
|
|
157
|
+
break outer;
|
|
158
|
+
}
|
|
159
|
+
width += widthExtra;
|
|
160
|
+
unmatchedStart = indexPrev;
|
|
161
|
+
unmatchedEnd = index;
|
|
162
|
+
index = indexPrev = BLOCK_RE.lastIndex;
|
|
163
|
+
continue outer;
|
|
196
164
|
}
|
|
197
|
-
width += EMOJI_WIDTH;
|
|
198
|
-
unmatchedStart = indexPrev;
|
|
199
|
-
unmatchedEnd = index;
|
|
200
|
-
index = indexPrev = EMOJI_RE.lastIndex;
|
|
201
|
-
continue;
|
|
202
165
|
}
|
|
203
166
|
index += 1;
|
|
204
167
|
}
|
|
@@ -213,10 +176,10 @@ var init_dist = __esm({
|
|
|
213
176
|
}
|
|
214
177
|
});
|
|
215
178
|
|
|
216
|
-
// node_modules/.bun/fast-string-width@
|
|
179
|
+
// node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
|
|
217
180
|
var NO_TRUNCATION2, fastStringWidth, dist_default2;
|
|
218
181
|
var init_dist2 = __esm({
|
|
219
|
-
"node_modules/.bun/fast-string-width@
|
|
182
|
+
"node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js"() {
|
|
220
183
|
init_utils2();
|
|
221
184
|
init_dist();
|
|
222
185
|
NO_TRUNCATION2 = {
|
|
@@ -231,13 +194,13 @@ var init_dist2 = __esm({
|
|
|
231
194
|
}
|
|
232
195
|
});
|
|
233
196
|
|
|
234
|
-
// node_modules/.bun/fast-wrap-ansi@0.
|
|
197
|
+
// node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js
|
|
235
198
|
function wrapAnsi(string, columns, options) {
|
|
236
199
|
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
|
|
237
200
|
}
|
|
238
201
|
var ESC, CSI, END_CODE, ANSI_ESCAPE_BELL, ANSI_CSI, ANSI_OSC, ANSI_SGR_TERMINATOR, ANSI_ESCAPE_LINK, GROUP_REGEX, getClosingCode, wrapAnsiCode, wrapAnsiHyperlink, wrapWord, stringVisibleTrimSpacesRight, exec, CRLF_OR_LF;
|
|
239
202
|
var init_main = __esm({
|
|
240
|
-
"node_modules/.bun/fast-wrap-ansi@0.
|
|
203
|
+
"node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js"() {
|
|
241
204
|
init_utils2();
|
|
242
205
|
init_dist2();
|
|
243
206
|
ESC = "\x1B";
|
|
@@ -401,16 +364,19 @@ var init_main = __esm({
|
|
|
401
364
|
}
|
|
402
365
|
const preString = rows.join("\n");
|
|
403
366
|
let inSurrogate = false;
|
|
404
|
-
for (let
|
|
405
|
-
const character = preString[
|
|
367
|
+
for (let i2 = 0; i2 < preString.length; i2++) {
|
|
368
|
+
const character = preString[i2];
|
|
406
369
|
returnValue += character;
|
|
407
370
|
if (!inSurrogate) {
|
|
408
371
|
inSurrogate = character >= "\uD800" && character <= "\uDBFF";
|
|
372
|
+
if (inSurrogate) {
|
|
373
|
+
continue;
|
|
374
|
+
}
|
|
409
375
|
} else {
|
|
410
|
-
|
|
376
|
+
inSurrogate = false;
|
|
411
377
|
}
|
|
412
378
|
if (character === ESC || character === CSI) {
|
|
413
|
-
GROUP_REGEX.lastIndex =
|
|
379
|
+
GROUP_REGEX.lastIndex = i2 + 1;
|
|
414
380
|
const groupsResult = GROUP_REGEX.exec(preString);
|
|
415
381
|
const groups = groupsResult?.groups;
|
|
416
382
|
if (groups?.code !== void 0) {
|
|
@@ -420,7 +386,7 @@ var init_main = __esm({
|
|
|
420
386
|
escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
421
387
|
}
|
|
422
388
|
}
|
|
423
|
-
if (preString[
|
|
389
|
+
if (preString[i2 + 1] === "\n") {
|
|
424
390
|
if (escapeUrl) {
|
|
425
391
|
returnValue += wrapAnsiHyperlink("");
|
|
426
392
|
}
|
|
@@ -451,7 +417,7 @@ var require_src = __commonJS({
|
|
|
451
417
|
var ESC2 = "\x1B";
|
|
452
418
|
var CSI2 = `${ESC2}[`;
|
|
453
419
|
var beep = "\x07";
|
|
454
|
-
var
|
|
420
|
+
var cursor3 = {
|
|
455
421
|
to(x, y2) {
|
|
456
422
|
if (!y2) return `${CSI2}${x + 1}G`;
|
|
457
423
|
return `${CSI2}${y2 + 1};${x + 1}H`;
|
|
@@ -480,7 +446,7 @@ var require_src = __commonJS({
|
|
|
480
446
|
up: (count = 1) => `${CSI2}S`.repeat(count),
|
|
481
447
|
down: (count = 1) => `${CSI2}T`.repeat(count)
|
|
482
448
|
};
|
|
483
|
-
var
|
|
449
|
+
var erase3 = {
|
|
484
450
|
screen: `${CSI2}2J`,
|
|
485
451
|
up: (count = 1) => `${CSI2}1J`.repeat(count),
|
|
486
452
|
down: (count = 1) => `${CSI2}J`.repeat(count),
|
|
@@ -489,89 +455,169 @@ var require_src = __commonJS({
|
|
|
489
455
|
lineStart: `${CSI2}1K`,
|
|
490
456
|
lines(count) {
|
|
491
457
|
let clear = "";
|
|
492
|
-
for (let
|
|
493
|
-
clear += this.line + (
|
|
458
|
+
for (let i2 = 0; i2 < count; i2++)
|
|
459
|
+
clear += this.line + (i2 < count - 1 ? cursor3.up() : "");
|
|
494
460
|
if (count)
|
|
495
|
-
clear +=
|
|
461
|
+
clear += cursor3.left;
|
|
496
462
|
return clear;
|
|
497
463
|
}
|
|
498
464
|
};
|
|
499
|
-
module.exports = { cursor, scroll, erase, beep };
|
|
465
|
+
module.exports = { cursor: cursor3, scroll, erase: erase3, beep };
|
|
500
466
|
}
|
|
501
467
|
});
|
|
502
468
|
|
|
503
|
-
// node_modules/.bun/@clack+core@1.
|
|
504
|
-
import { styleText
|
|
505
|
-
import { stdout
|
|
506
|
-
import * as
|
|
507
|
-
import
|
|
508
|
-
import { ReadStream
|
|
509
|
-
function
|
|
510
|
-
if (!
|
|
511
|
-
|
|
512
|
-
|
|
469
|
+
// node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs
|
|
470
|
+
import { styleText } from "node:util";
|
|
471
|
+
import { stdout, stdin } from "node:process";
|
|
472
|
+
import * as l from "node:readline";
|
|
473
|
+
import l__default from "node:readline";
|
|
474
|
+
import { ReadStream } from "node:tty";
|
|
475
|
+
function findCursor(s, o, l2) {
|
|
476
|
+
if (!l2.some((r2) => !r2.disabled))
|
|
477
|
+
return s;
|
|
478
|
+
const t2 = s + o, n3 = Math.max(l2.length - 1, 0), e = t2 < 0 ? n3 : t2 > n3 ? 0 : t2;
|
|
479
|
+
return l2[e]?.disabled ? findCursor(e, o < 0 ? -1 : 1, l2) : e;
|
|
480
|
+
}
|
|
481
|
+
function isAccessible(n3) {
|
|
482
|
+
if (n3 !== void 0) return n3;
|
|
483
|
+
if (settings.accessible !== void 0) return settings.accessible;
|
|
484
|
+
const e = process.env.ACCESSIBLE;
|
|
485
|
+
return e !== void 0 && e !== "" && e !== "0" && e !== "false";
|
|
513
486
|
}
|
|
514
|
-
function
|
|
515
|
-
if (typeof
|
|
516
|
-
|
|
487
|
+
function isActionKey(n3, e) {
|
|
488
|
+
if (typeof n3 == "string")
|
|
489
|
+
return settings.aliases.get(n3) === e;
|
|
490
|
+
for (const s of n3)
|
|
491
|
+
if (s !== void 0 && isActionKey(s, e))
|
|
492
|
+
return true;
|
|
517
493
|
return false;
|
|
518
494
|
}
|
|
519
|
-
function
|
|
520
|
-
if (
|
|
521
|
-
const e =
|
|
522
|
-
`),
|
|
523
|
-
`),
|
|
524
|
-
for (let
|
|
525
|
-
|
|
495
|
+
function diffLines(i2, s) {
|
|
496
|
+
if (i2 === s) return;
|
|
497
|
+
const e = i2.split(`
|
|
498
|
+
`), t2 = s.split(`
|
|
499
|
+
`), r2 = Math.max(e.length, t2.length), f = [];
|
|
500
|
+
for (let n3 = 0; n3 < r2; n3++)
|
|
501
|
+
e[n3] !== t2[n3] && f.push(n3);
|
|
502
|
+
return {
|
|
503
|
+
lines: f,
|
|
504
|
+
numLinesBefore: e.length,
|
|
505
|
+
numLinesAfter: t2.length,
|
|
506
|
+
numLines: r2
|
|
507
|
+
};
|
|
526
508
|
}
|
|
527
|
-
function
|
|
528
|
-
return
|
|
509
|
+
function isCancel(e) {
|
|
510
|
+
return e === CANCEL_SYMBOL;
|
|
529
511
|
}
|
|
530
|
-
function
|
|
531
|
-
const
|
|
532
|
-
|
|
512
|
+
function setRawMode(e, r2) {
|
|
513
|
+
const o = e;
|
|
514
|
+
o.isTTY && o.setRawMode(r2);
|
|
533
515
|
}
|
|
534
|
-
function
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
516
|
+
function block({
|
|
517
|
+
input: e = stdin,
|
|
518
|
+
output: r2 = stdout,
|
|
519
|
+
overwrite: o = true,
|
|
520
|
+
hideCursor: n3 = true
|
|
521
|
+
} = {}) {
|
|
522
|
+
const s = l.createInterface({
|
|
523
|
+
input: e,
|
|
524
|
+
output: r2,
|
|
525
|
+
prompt: "",
|
|
526
|
+
tabSize: 1
|
|
527
|
+
});
|
|
528
|
+
l.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(true);
|
|
529
|
+
const t2 = (f, { name: a2, sequence: w }) => {
|
|
530
|
+
const c2 = String(f);
|
|
531
|
+
if (isActionKey([c2, a2, w], "cancel")) {
|
|
532
|
+
n3 && r2.write(import_sisteransi.cursor.show), process.exit(0);
|
|
541
533
|
return;
|
|
542
534
|
}
|
|
543
|
-
if (!
|
|
544
|
-
const
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
535
|
+
if (!o) return;
|
|
536
|
+
const i2 = a2 === "return" ? 0 : -1, m = a2 === "return" ? -1 : 0;
|
|
537
|
+
l.moveCursor(r2, i2, m, () => {
|
|
538
|
+
l.clearLine(r2, 1, () => {
|
|
539
|
+
e.once("keypress", t2);
|
|
548
540
|
});
|
|
549
541
|
});
|
|
550
542
|
};
|
|
551
|
-
return
|
|
552
|
-
|
|
543
|
+
return n3 && r2.write(import_sisteransi.cursor.hide), e.once("keypress", t2), () => {
|
|
544
|
+
e.off("keypress", t2), n3 && r2.write(import_sisteransi.cursor.show), e instanceof ReadStream && e.isTTY && !R && e.setRawMode(false), s.terminal = false, s.close();
|
|
553
545
|
};
|
|
554
546
|
}
|
|
555
|
-
function
|
|
556
|
-
const
|
|
557
|
-
return wrapAnsi(
|
|
558
|
-
|
|
547
|
+
function wrapTextWithPrefix(e, r2, o, n3 = o, s = o, t2) {
|
|
548
|
+
const f = getColumns(e ?? stdout);
|
|
549
|
+
return wrapAnsi(r2, f - o.length, {
|
|
550
|
+
hard: true,
|
|
551
|
+
trim: false
|
|
552
|
+
}).split(`
|
|
553
|
+
`).map((c2, i2, m) => {
|
|
554
|
+
const d = t2 ? t2(c2, i2) : c2;
|
|
555
|
+
return i2 === 0 ? `${n3}${d}` : i2 === m.length - 1 ? `${s}${d}` : `${o}${d}`;
|
|
556
|
+
}).join(`
|
|
559
557
|
`);
|
|
560
558
|
}
|
|
561
|
-
|
|
559
|
+
function runValidation(e, a2) {
|
|
560
|
+
if ("~standard" in e) {
|
|
561
|
+
const n3 = e["~standard"].validate(a2);
|
|
562
|
+
return n3 instanceof Promise ? n3.then((r2) => r2.issues?.at(0)?.message) : n3.issues?.at(0)?.message;
|
|
563
|
+
}
|
|
564
|
+
return e(a2);
|
|
565
|
+
}
|
|
566
|
+
var import_sisteransi, a$1, t, settings, R, CANCEL_SYMBOL, getColumns, getRows, y, r, n$1, n2;
|
|
562
567
|
var init_dist3 = __esm({
|
|
563
|
-
"node_modules/.bun/@clack+core@1.
|
|
568
|
+
"node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs"() {
|
|
564
569
|
init_utils2();
|
|
565
570
|
init_main();
|
|
566
571
|
import_sisteransi = __toESM(require_src(), 1);
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
572
|
+
a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
573
|
+
t = [
|
|
574
|
+
"January",
|
|
575
|
+
"February",
|
|
576
|
+
"March",
|
|
577
|
+
"April",
|
|
578
|
+
"May",
|
|
579
|
+
"June",
|
|
580
|
+
"July",
|
|
581
|
+
"August",
|
|
582
|
+
"September",
|
|
583
|
+
"October",
|
|
584
|
+
"November",
|
|
585
|
+
"December"
|
|
586
|
+
];
|
|
587
|
+
settings = {
|
|
588
|
+
actions: new Set(a$1),
|
|
589
|
+
aliases: /* @__PURE__ */ new Map([
|
|
590
|
+
// vim support
|
|
591
|
+
["k", "up"],
|
|
592
|
+
["j", "down"],
|
|
593
|
+
["h", "left"],
|
|
594
|
+
["l", "right"],
|
|
595
|
+
["", "cancel"],
|
|
596
|
+
// opinionated defaults!
|
|
597
|
+
["escape", "cancel"]
|
|
598
|
+
]),
|
|
599
|
+
messages: {
|
|
600
|
+
cancel: "Canceled",
|
|
601
|
+
error: "Something went wrong"
|
|
602
|
+
},
|
|
603
|
+
withGuide: true,
|
|
604
|
+
accessible: void 0,
|
|
605
|
+
date: {
|
|
606
|
+
monthNames: [...t],
|
|
607
|
+
messages: {
|
|
608
|
+
required: "Please enter a valid date",
|
|
609
|
+
invalidMonth: "There are only 12 months in a year",
|
|
610
|
+
invalidDay: (n3, e) => `There are only ${n3} days in ${e}`,
|
|
611
|
+
afterMin: (n3) => `Date must be on or after ${n3.toISOString().slice(0, 10)}`,
|
|
612
|
+
beforeMax: (n3) => `Date must be on or before ${n3.toISOString().slice(0, 10)}`
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
};
|
|
616
|
+
R = globalThis.process.platform.startsWith("win");
|
|
617
|
+
CANCEL_SYMBOL = /* @__PURE__ */ Symbol("clack:cancel");
|
|
618
|
+
getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
|
|
619
|
+
getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
|
|
620
|
+
y = class {
|
|
575
621
|
input;
|
|
576
622
|
output;
|
|
577
623
|
_abortSignal;
|
|
@@ -586,46 +632,92 @@ var init_dist3 = __esm({
|
|
|
586
632
|
error = "";
|
|
587
633
|
value;
|
|
588
634
|
userInput = "";
|
|
635
|
+
/**
|
|
636
|
+
* Whether accessible (static, screen-reader friendly) output is enabled for
|
|
637
|
+
* this prompt, resolved from the `accessible` option, the global setting,
|
|
638
|
+
* and the `ACCESSIBLE` env var.
|
|
639
|
+
*/
|
|
640
|
+
get accessible() {
|
|
641
|
+
return isAccessible(this.opts.accessible);
|
|
642
|
+
}
|
|
589
643
|
constructor(t2, e = true) {
|
|
590
|
-
const { input:
|
|
591
|
-
this.opts =
|
|
644
|
+
const { input: i2 = stdin, output: s = stdout, render: r2, signal: n3, ...o } = t2;
|
|
645
|
+
this.opts = o, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = r2.bind(this), this._track = e, this._abortSignal = n3, this.input = i2, this.output = s;
|
|
592
646
|
}
|
|
647
|
+
/**
|
|
648
|
+
* Unsubscribe all listeners
|
|
649
|
+
*/
|
|
593
650
|
unsubscribe() {
|
|
594
651
|
this._subscribers.clear();
|
|
595
652
|
}
|
|
653
|
+
/**
|
|
654
|
+
* Set a subscriber with opts
|
|
655
|
+
* @param event - The event name
|
|
656
|
+
*/
|
|
596
657
|
setSubscriber(t2, e) {
|
|
597
|
-
const
|
|
598
|
-
|
|
658
|
+
const i2 = this._subscribers.get(t2) ?? [];
|
|
659
|
+
i2.push(e), this._subscribers.set(t2, i2);
|
|
599
660
|
}
|
|
661
|
+
/**
|
|
662
|
+
* Subscribe to an event
|
|
663
|
+
* @param event - The event name
|
|
664
|
+
* @param cb - The callback
|
|
665
|
+
*/
|
|
600
666
|
on(t2, e) {
|
|
601
667
|
this.setSubscriber(t2, { cb: e });
|
|
602
668
|
}
|
|
669
|
+
/**
|
|
670
|
+
* Subscribe to an event once
|
|
671
|
+
* @param event - The event name
|
|
672
|
+
* @param cb - The callback
|
|
673
|
+
*/
|
|
603
674
|
once(t2, e) {
|
|
604
675
|
this.setSubscriber(t2, { cb: e, once: true });
|
|
605
676
|
}
|
|
677
|
+
/**
|
|
678
|
+
* Emit an event with data
|
|
679
|
+
* @param event - The event name
|
|
680
|
+
* @param data - The data to pass to the callback
|
|
681
|
+
*/
|
|
606
682
|
emit(t2, ...e) {
|
|
607
|
-
const
|
|
608
|
-
for (const
|
|
609
|
-
|
|
683
|
+
const i2 = this._subscribers.get(t2) ?? [], s = [];
|
|
684
|
+
for (const r2 of i2)
|
|
685
|
+
r2.cb(...e), r2.once && s.push(() => i2.splice(i2.indexOf(r2), 1));
|
|
686
|
+
for (const r2 of s)
|
|
687
|
+
r2();
|
|
610
688
|
}
|
|
611
689
|
prompt() {
|
|
612
690
|
return new Promise((t2) => {
|
|
613
691
|
if (this._abortSignal) {
|
|
614
|
-
if (this._abortSignal.aborted)
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
692
|
+
if (this._abortSignal.aborted)
|
|
693
|
+
return this.state = "cancel", this.close(), t2(CANCEL_SYMBOL);
|
|
694
|
+
this._abortSignal.addEventListener(
|
|
695
|
+
"abort",
|
|
696
|
+
() => {
|
|
697
|
+
this.state = "cancel", this.close();
|
|
698
|
+
},
|
|
699
|
+
{ once: true }
|
|
700
|
+
);
|
|
618
701
|
}
|
|
619
|
-
this.rl =
|
|
620
|
-
|
|
702
|
+
this.rl = l__default.createInterface({
|
|
703
|
+
input: this.input,
|
|
704
|
+
tabSize: 2,
|
|
705
|
+
prompt: "",
|
|
706
|
+
escapeCodeTimeout: 50,
|
|
707
|
+
terminal: true
|
|
708
|
+
}), 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", () => {
|
|
709
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(this.value);
|
|
621
710
|
}), this.once("cancel", () => {
|
|
622
|
-
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render),
|
|
711
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(CANCEL_SYMBOL);
|
|
623
712
|
});
|
|
624
713
|
});
|
|
625
714
|
}
|
|
626
715
|
_isActionKey(t2, e) {
|
|
627
716
|
return t2 === " ";
|
|
628
717
|
}
|
|
718
|
+
_shouldSubmit(t2, e) {
|
|
719
|
+
return true;
|
|
720
|
+
}
|
|
629
721
|
_setValue(t2) {
|
|
630
722
|
this.value = t2, this.emit("value", this.value);
|
|
631
723
|
}
|
|
@@ -635,19 +727,22 @@ var init_dist3 = __esm({
|
|
|
635
727
|
_clearUserInput() {
|
|
636
728
|
this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
|
|
637
729
|
}
|
|
638
|
-
onKeypress(t2, e) {
|
|
639
|
-
if (this.
|
|
640
|
-
if (this.
|
|
641
|
-
|
|
642
|
-
|
|
730
|
+
async onKeypress(t2, e) {
|
|
731
|
+
if (this.state !== "validating") {
|
|
732
|
+
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)) {
|
|
733
|
+
if (this.opts.validate) {
|
|
734
|
+
const i2 = runValidation(this.opts.validate, this.value);
|
|
735
|
+
let s;
|
|
736
|
+
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));
|
|
737
|
+
}
|
|
738
|
+
this.state !== "error" && (this.state = "submit");
|
|
643
739
|
}
|
|
644
|
-
this.state
|
|
740
|
+
isActionKey([t2, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
645
741
|
}
|
|
646
|
-
V([t2, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
647
742
|
}
|
|
648
743
|
close() {
|
|
649
744
|
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
650
|
-
`),
|
|
745
|
+
`), setRawMode(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
651
746
|
}
|
|
652
747
|
restoreCursor() {
|
|
653
748
|
const t2 = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
|
|
@@ -655,34 +750,39 @@ var init_dist3 = __esm({
|
|
|
655
750
|
this.output.write(import_sisteransi.cursor.move(-999, t2 * -1));
|
|
656
751
|
}
|
|
657
752
|
render() {
|
|
658
|
-
const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
|
|
753
|
+
const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
|
|
754
|
+
hard: true,
|
|
755
|
+
trim: false
|
|
756
|
+
});
|
|
659
757
|
if (t2 !== this._prevFrame) {
|
|
660
|
-
if (this.state === "initial")
|
|
758
|
+
if (this.state === "initial")
|
|
759
|
+
this.output.write(import_sisteransi.cursor.hide);
|
|
661
760
|
else {
|
|
662
|
-
const e =
|
|
761
|
+
const e = diffLines(this._prevFrame, t2), i2 = getRows(this.output);
|
|
663
762
|
if (this.restoreCursor(), e) {
|
|
664
|
-
const
|
|
665
|
-
let
|
|
666
|
-
if (
|
|
763
|
+
const s = Math.max(0, e.numLinesAfter - i2), r2 = Math.max(0, e.numLinesBefore - i2);
|
|
764
|
+
let n3 = e.lines.find((o) => o >= s);
|
|
765
|
+
if (n3 === void 0) {
|
|
667
766
|
this._prevFrame = t2;
|
|
668
767
|
return;
|
|
669
768
|
}
|
|
670
769
|
if (e.lines.length === 1) {
|
|
671
|
-
this.output.write(import_sisteransi.cursor.move(0,
|
|
672
|
-
const
|
|
770
|
+
this.output.write(import_sisteransi.cursor.move(0, n3 - r2)), this.output.write(import_sisteransi.erase.lines(1));
|
|
771
|
+
const o = t2.split(`
|
|
673
772
|
`);
|
|
674
|
-
this.output.write(
|
|
773
|
+
this.output.write(o[n3]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, o.length - n3 - 1));
|
|
675
774
|
return;
|
|
676
775
|
} else if (e.lines.length > 1) {
|
|
677
|
-
if (
|
|
776
|
+
if (s < r2)
|
|
777
|
+
n3 = s;
|
|
678
778
|
else {
|
|
679
|
-
const
|
|
680
|
-
|
|
779
|
+
const h2 = n3 - r2;
|
|
780
|
+
h2 > 0 && this.output.write(import_sisteransi.cursor.move(0, h2));
|
|
681
781
|
}
|
|
682
782
|
this.output.write(import_sisteransi.erase.down());
|
|
683
|
-
const
|
|
684
|
-
`).slice(
|
|
685
|
-
this.output.write(
|
|
783
|
+
const f = t2.split(`
|
|
784
|
+
`).slice(n3);
|
|
785
|
+
this.output.write(f.join(`
|
|
686
786
|
`)), this._prevFrame = t2;
|
|
687
787
|
return;
|
|
688
788
|
}
|
|
@@ -693,7 +793,7 @@ var init_dist3 = __esm({
|
|
|
693
793
|
}
|
|
694
794
|
}
|
|
695
795
|
};
|
|
696
|
-
|
|
796
|
+
r = class extends y {
|
|
697
797
|
get cursor() {
|
|
698
798
|
return this.value ? 0 : 1;
|
|
699
799
|
}
|
|
@@ -703,54 +803,60 @@ var init_dist3 = __esm({
|
|
|
703
803
|
constructor(t2) {
|
|
704
804
|
super(t2, false), this.value = !!t2.initialValue, this.on("userInput", () => {
|
|
705
805
|
this.value = this._value;
|
|
706
|
-
}), this.on("confirm", (
|
|
707
|
-
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value =
|
|
806
|
+
}), this.on("confirm", (i2) => {
|
|
807
|
+
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = i2, this.state = "submit", this.close();
|
|
708
808
|
}), this.on("cursor", () => {
|
|
709
809
|
this.value = !this.value;
|
|
710
810
|
});
|
|
711
811
|
}
|
|
712
812
|
};
|
|
713
|
-
|
|
813
|
+
n$1 = class n extends y {
|
|
714
814
|
options;
|
|
715
815
|
cursor = 0;
|
|
716
816
|
get _selectedValue() {
|
|
717
817
|
return this.options[this.cursor];
|
|
718
818
|
}
|
|
719
819
|
changeValue() {
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
820
|
+
const e = this._selectedValue;
|
|
821
|
+
this.value = e === void 0 ? void 0 : e.value;
|
|
822
|
+
}
|
|
823
|
+
constructor(e) {
|
|
824
|
+
super(e, false), this.options = e.options;
|
|
825
|
+
const o = this.options.findIndex(({ value: s }) => s === e.initialValue), t2 = o === -1 ? 0 : o;
|
|
826
|
+
this.cursor = this.options[t2]?.disabled ? findCursor(t2, 1, this.options) : t2, this.changeValue(), this.on("cursor", (s) => {
|
|
827
|
+
switch (s) {
|
|
727
828
|
case "left":
|
|
728
829
|
case "up":
|
|
729
|
-
this.cursor =
|
|
830
|
+
this.cursor = findCursor(this.cursor, -1, this.options);
|
|
730
831
|
break;
|
|
731
832
|
case "down":
|
|
732
833
|
case "right":
|
|
733
|
-
this.cursor =
|
|
834
|
+
this.cursor = findCursor(this.cursor, 1, this.options);
|
|
734
835
|
break;
|
|
735
836
|
}
|
|
736
837
|
this.changeValue();
|
|
737
838
|
});
|
|
738
839
|
}
|
|
739
840
|
};
|
|
740
|
-
|
|
841
|
+
n2 = class extends y {
|
|
741
842
|
get userInputWithCursor() {
|
|
742
|
-
if (this.state === "submit")
|
|
843
|
+
if (this.state === "submit")
|
|
844
|
+
return this.userInput;
|
|
743
845
|
const t2 = this.userInput;
|
|
744
|
-
if (this.cursor >= t2.length)
|
|
745
|
-
|
|
746
|
-
|
|
846
|
+
if (this.cursor >= t2.length)
|
|
847
|
+
return `${this.userInput}\u2588`;
|
|
848
|
+
const r2 = t2.slice(0, this.cursor), s = t2.slice(this.cursor, this.cursor + 1), e = t2.slice(this.cursor + 1);
|
|
849
|
+
return `${r2}${styleText("inverse", s)}${e}`;
|
|
747
850
|
}
|
|
748
851
|
get cursor() {
|
|
749
852
|
return this._cursor;
|
|
750
853
|
}
|
|
751
854
|
constructor(t2) {
|
|
752
|
-
super({
|
|
753
|
-
|
|
855
|
+
super({
|
|
856
|
+
...t2,
|
|
857
|
+
initialUserInput: t2.initialUserInput ?? t2.initialValue
|
|
858
|
+
}), this.on("userInput", (r2) => {
|
|
859
|
+
this._setValue(r2);
|
|
754
860
|
}), this.on("finalize", () => {
|
|
755
861
|
this.value || (this.value = t2.defaultValue), this.value === void 0 && (this.value = "");
|
|
756
862
|
});
|
|
@@ -759,328 +865,503 @@ var init_dist3 = __esm({
|
|
|
759
865
|
}
|
|
760
866
|
});
|
|
761
867
|
|
|
762
|
-
// node_modules/.bun/@clack+prompts@1.
|
|
763
|
-
import { styleText as
|
|
764
|
-
import
|
|
765
|
-
import { existsSync
|
|
766
|
-
import { dirname
|
|
767
|
-
function
|
|
768
|
-
|
|
868
|
+
// node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs
|
|
869
|
+
import { styleText as styleText2, stripVTControlCharacters } from "node:util";
|
|
870
|
+
import process$1 from "node:process";
|
|
871
|
+
import { existsSync, lstatSync, readdirSync } from "node:fs";
|
|
872
|
+
import { dirname, join } from "node:path";
|
|
873
|
+
function isUnicodeSupported() {
|
|
874
|
+
if (process$1.platform !== "win32") {
|
|
875
|
+
return process$1.env.TERM !== "linux";
|
|
876
|
+
}
|
|
877
|
+
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";
|
|
769
878
|
}
|
|
770
|
-
|
|
879
|
+
function formatInstructionFooter(o, e) {
|
|
880
|
+
const r2 = [`${e ? `${styleText2("cyan", S_BAR)} ` : ""}${o.join(" \u2022 ")}`];
|
|
881
|
+
return e && r2.push(styleText2("cyan", S_BAR_END)), r2;
|
|
882
|
+
}
|
|
883
|
+
var import_sisteransi2, unicode, isCI, unicodeOr, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_BAR_START, S_BAR, S_BAR_END, S_BAR_START_RIGHT, S_BAR_END_RIGHT, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, S_PASSWORD_MASK, S_BAR_H, S_CORNER_TOP_RIGHT, S_CONNECT_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_BOTTOM_LEFT, S_CORNER_TOP_LEFT, S_INFO, S_SUCCESS, S_WARN, S_ERROR, symbol, symbolBar, I, limitOptions, confirm, MULTISELECT_INSTRUCTIONS, log, cancel, intro, outro, W$1, C, note, W, spinner, u2, SELECT_INSTRUCTIONS, c, select, i, text;
|
|
771
884
|
var init_dist4 = __esm({
|
|
772
|
-
"node_modules/.bun/@clack+prompts@1.
|
|
885
|
+
"node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs"() {
|
|
773
886
|
init_utils2();
|
|
774
887
|
init_dist3();
|
|
775
888
|
init_dist3();
|
|
776
889
|
init_main();
|
|
777
890
|
init_dist2();
|
|
778
891
|
import_sisteransi2 = __toESM(require_src(), 1);
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
switch (
|
|
892
|
+
unicode = isUnicodeSupported();
|
|
893
|
+
isCI = () => process.env.CI === "true";
|
|
894
|
+
unicodeOr = (o, e) => unicode ? o : e;
|
|
895
|
+
S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
|
|
896
|
+
S_STEP_CANCEL = unicodeOr("\u25A0", "x");
|
|
897
|
+
S_STEP_ERROR = unicodeOr("\u25B2", "x");
|
|
898
|
+
S_STEP_SUBMIT = unicodeOr("\u25C7", "o");
|
|
899
|
+
S_BAR_START = unicodeOr("\u250C", "T");
|
|
900
|
+
S_BAR = unicodeOr("\u2502", "|");
|
|
901
|
+
S_BAR_END = unicodeOr("\u2514", "\u2014");
|
|
902
|
+
S_BAR_START_RIGHT = unicodeOr("\u2510", "T");
|
|
903
|
+
S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014");
|
|
904
|
+
S_RADIO_ACTIVE = unicodeOr("\u25CF", ">");
|
|
905
|
+
S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
|
|
906
|
+
S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
|
|
907
|
+
S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
|
|
908
|
+
S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
|
|
909
|
+
S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022");
|
|
910
|
+
S_BAR_H = unicodeOr("\u2500", "-");
|
|
911
|
+
S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+");
|
|
912
|
+
S_CONNECT_LEFT = unicodeOr("\u251C", "+");
|
|
913
|
+
S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+");
|
|
914
|
+
S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+");
|
|
915
|
+
S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+");
|
|
916
|
+
S_INFO = unicodeOr("\u25CF", "\u2022");
|
|
917
|
+
S_SUCCESS = unicodeOr("\u25C6", "*");
|
|
918
|
+
S_WARN = unicodeOr("\u25B2", "!");
|
|
919
|
+
S_ERROR = unicodeOr("\u25A0", "x");
|
|
920
|
+
symbol = (o) => {
|
|
921
|
+
switch (o) {
|
|
809
922
|
case "initial":
|
|
810
923
|
case "active":
|
|
811
|
-
return
|
|
924
|
+
return styleText2("cyan", S_STEP_ACTIVE);
|
|
812
925
|
case "cancel":
|
|
813
|
-
return
|
|
926
|
+
return styleText2("red", S_STEP_CANCEL);
|
|
814
927
|
case "error":
|
|
815
|
-
return
|
|
928
|
+
return styleText2("yellow", S_STEP_ERROR);
|
|
816
929
|
case "submit":
|
|
817
|
-
return
|
|
930
|
+
return styleText2("green", S_STEP_SUBMIT);
|
|
931
|
+
case "validating":
|
|
932
|
+
return styleText2("dim", S_STEP_ACTIVE);
|
|
818
933
|
}
|
|
819
934
|
};
|
|
820
|
-
|
|
821
|
-
switch (
|
|
935
|
+
symbolBar = (o) => {
|
|
936
|
+
switch (o) {
|
|
822
937
|
case "initial":
|
|
823
938
|
case "active":
|
|
824
|
-
return
|
|
939
|
+
return styleText2("cyan", S_BAR);
|
|
825
940
|
case "cancel":
|
|
826
|
-
return
|
|
941
|
+
return styleText2("red", S_BAR);
|
|
827
942
|
case "error":
|
|
828
|
-
return
|
|
943
|
+
return styleText2("yellow", S_BAR);
|
|
829
944
|
case "submit":
|
|
830
|
-
return
|
|
831
|
-
}
|
|
832
|
-
};
|
|
833
|
-
|
|
834
|
-
let
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
945
|
+
return styleText2("green", S_BAR);
|
|
946
|
+
}
|
|
947
|
+
};
|
|
948
|
+
I = (l2, e, w, p, b, C2 = false) => {
|
|
949
|
+
let r2 = e, O = 0;
|
|
950
|
+
if (C2)
|
|
951
|
+
for (let i2 = p - 1; i2 >= w; i2--) {
|
|
952
|
+
const m = l2[i2];
|
|
953
|
+
if (m && (r2 -= m.length), O++, r2 <= b) break;
|
|
954
|
+
}
|
|
955
|
+
else
|
|
956
|
+
for (let i2 = w; i2 < p; i2++) {
|
|
957
|
+
const m = l2[i2];
|
|
958
|
+
if (m && (r2 -= m.length), O++, r2 <= b) break;
|
|
959
|
+
}
|
|
960
|
+
return { lineCount: r2, removals: O };
|
|
961
|
+
};
|
|
962
|
+
limitOptions = ({
|
|
963
|
+
cursor: l2,
|
|
964
|
+
options: e,
|
|
965
|
+
style: w,
|
|
966
|
+
output: p = process.stdout,
|
|
967
|
+
maxItems: b = Number.POSITIVE_INFINITY,
|
|
968
|
+
columnPadding: C2 = 0,
|
|
969
|
+
rowPadding: r2 = 4
|
|
970
|
+
}) => {
|
|
971
|
+
const i2 = getColumns(p) - C2, m = getRows(p), M = styleText2("dim", "..."), v = Math.max(m - r2, 0), a2 = Math.max(Math.min(b, v), 5);
|
|
847
972
|
let f = 0;
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
973
|
+
l2 >= a2 - 3 && (f = Math.max(
|
|
974
|
+
Math.min(l2 - a2 + 3, e.length - a2),
|
|
975
|
+
0
|
|
976
|
+
));
|
|
977
|
+
let d = a2 < e.length && f > 0, c2 = a2 < e.length && f + a2 < e.length;
|
|
978
|
+
const W2 = Math.min(
|
|
979
|
+
f + a2,
|
|
980
|
+
e.length
|
|
981
|
+
), s = [];
|
|
982
|
+
let g = 0;
|
|
983
|
+
d && g++, c2 && g++;
|
|
984
|
+
const T = f + (d ? 1 : 0), y2 = W2 - (c2 ? 1 : 0);
|
|
985
|
+
for (let t2 = T; t2 < y2; t2++) {
|
|
986
|
+
const n3 = e[t2], o = n3 ? w(n3, t2 === l2) : "", h2 = wrapAnsi(o, i2, {
|
|
987
|
+
hard: true,
|
|
988
|
+
trim: false
|
|
989
|
+
}).split(`
|
|
852
990
|
`);
|
|
853
|
-
|
|
854
|
-
}
|
|
855
|
-
if (
|
|
856
|
-
let
|
|
857
|
-
const
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
991
|
+
s.push(h2), g += h2.length;
|
|
992
|
+
}
|
|
993
|
+
if (g > v) {
|
|
994
|
+
let t2 = 0, n3 = 0, o = g;
|
|
995
|
+
const h2 = l2 - T;
|
|
996
|
+
let u3 = v;
|
|
997
|
+
const L = () => I(s, o, 0, h2, u3), E = () => I(
|
|
998
|
+
s,
|
|
999
|
+
o,
|
|
1000
|
+
h2 + 1,
|
|
1001
|
+
s.length,
|
|
1002
|
+
u3,
|
|
1003
|
+
true
|
|
1004
|
+
);
|
|
1005
|
+
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));
|
|
1006
|
+
}
|
|
1007
|
+
const x = [];
|
|
1008
|
+
d && x.push(M);
|
|
1009
|
+
for (const t2 of s)
|
|
1010
|
+
for (const n3 of t2)
|
|
1011
|
+
x.push(n3);
|
|
1012
|
+
return c2 && x.push(M), x;
|
|
1013
|
+
};
|
|
1014
|
+
confirm = (e) => {
|
|
1015
|
+
const a2 = e.active ?? "Yes", o = e.inactive ?? "No";
|
|
1016
|
+
return new r({
|
|
1017
|
+
active: a2,
|
|
1018
|
+
inactive: o,
|
|
1019
|
+
signal: e.signal,
|
|
1020
|
+
input: e.input,
|
|
1021
|
+
output: e.output,
|
|
1022
|
+
initialValue: e.initialValue ?? true,
|
|
1023
|
+
render() {
|
|
1024
|
+
const i2 = e.withGuide ?? settings.withGuide, u3 = `${symbol(this.state)} `, l2 = i2 ? `${styleText2("gray", S_BAR)} ` : "", f = wrapTextWithPrefix(
|
|
1025
|
+
e.output,
|
|
1026
|
+
e.message,
|
|
1027
|
+
l2,
|
|
1028
|
+
u3
|
|
1029
|
+
), s = `${i2 ? `${styleText2("gray", S_BAR)}
|
|
1030
|
+
` : ""}${f}
|
|
1031
|
+
`, c2 = this.value ? a2 : o;
|
|
1032
|
+
switch (this.state) {
|
|
1033
|
+
case "submit": {
|
|
1034
|
+
const r2 = i2 ? `${styleText2("gray", S_BAR)} ` : "";
|
|
1035
|
+
return `${s}${r2}${styleText2("dim", c2)}`;
|
|
1036
|
+
}
|
|
1037
|
+
case "cancel": {
|
|
1038
|
+
const r2 = i2 ? `${styleText2("gray", S_BAR)} ` : "";
|
|
1039
|
+
return `${s}${r2}${styleText2(["strikethrough", "dim"], c2)}${i2 ? `
|
|
1040
|
+
${styleText2("gray", S_BAR)}` : ""}`;
|
|
1041
|
+
}
|
|
1042
|
+
default: {
|
|
1043
|
+
const r2 = i2 ? `${styleText2("cyan", S_BAR)} ` : "", g = i2 ? styleText2("cyan", S_BAR_END) : "";
|
|
1044
|
+
return `${s}${r2}${this.value ? `${styleText2("green", S_RADIO_ACTIVE)} ${a2}` : `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", a2)}`}${e.vertical ? i2 ? `
|
|
1045
|
+
${styleText2("cyan", S_BAR)} ` : `
|
|
1046
|
+
` : ` ${styleText2("dim", "/")} `}${this.value ? `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", o)}` : `${styleText2("green", S_RADIO_ACTIVE)} ${o}`}
|
|
1047
|
+
${g}
|
|
887
1048
|
`;
|
|
1049
|
+
}
|
|
888
1050
|
}
|
|
889
1051
|
}
|
|
890
|
-
}
|
|
1052
|
+
}).prompt();
|
|
891
1053
|
};
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
1054
|
+
MULTISELECT_INSTRUCTIONS = [
|
|
1055
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
1056
|
+
`${styleText2("dim", "Space:")} select`,
|
|
1057
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
1058
|
+
];
|
|
1059
|
+
log = {
|
|
1060
|
+
message: (s = [], {
|
|
1061
|
+
symbol: e = styleText2("gray", S_BAR),
|
|
1062
|
+
secondarySymbol: r2 = styleText2("gray", S_BAR),
|
|
1063
|
+
output: m = process.stdout,
|
|
1064
|
+
spacing: l2 = 1,
|
|
1065
|
+
withGuide: c2
|
|
1066
|
+
} = {}) => {
|
|
1067
|
+
const t2 = [], o = c2 ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
|
|
1068
|
+
for (let i2 = 0; i2 < l2; i2++)
|
|
1069
|
+
t2.push(f);
|
|
1070
|
+
const g = Array.isArray(s) ? s : s.split(`
|
|
896
1071
|
`);
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
1072
|
+
if (g.length > 0) {
|
|
1073
|
+
const [i2, ...y2] = g;
|
|
1074
|
+
i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
|
|
1075
|
+
for (const p of y2)
|
|
1076
|
+
p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
|
|
1077
|
+
}
|
|
1078
|
+
m.write(`${t2.join(`
|
|
903
1079
|
`)}
|
|
904
1080
|
`);
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
1081
|
+
},
|
|
1082
|
+
info: (s, e) => {
|
|
1083
|
+
log.message(s, { ...e, symbol: styleText2("blue", S_INFO) });
|
|
1084
|
+
},
|
|
1085
|
+
success: (s, e) => {
|
|
1086
|
+
log.message(s, { ...e, symbol: styleText2("green", S_SUCCESS) });
|
|
1087
|
+
},
|
|
1088
|
+
step: (s, e) => {
|
|
1089
|
+
log.message(s, { ...e, symbol: styleText2("green", S_STEP_SUBMIT) });
|
|
1090
|
+
},
|
|
1091
|
+
warn: (s, e) => {
|
|
1092
|
+
log.message(s, { ...e, symbol: styleText2("yellow", S_WARN) });
|
|
1093
|
+
},
|
|
1094
|
+
/** alias for `log.warn()`. */
|
|
1095
|
+
warning: (s, e) => {
|
|
1096
|
+
log.warn(s, e);
|
|
1097
|
+
},
|
|
1098
|
+
error: (s, e) => {
|
|
1099
|
+
log.message(s, { ...e, symbol: styleText2("red", S_ERROR) });
|
|
1100
|
+
}
|
|
1101
|
+
};
|
|
1102
|
+
cancel = (o = "", t2) => {
|
|
1103
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_END)} ` : "";
|
|
1104
|
+
i2.write(`${e}${styleText2("red", o)}
|
|
921
1105
|
|
|
922
1106
|
`);
|
|
923
1107
|
};
|
|
924
|
-
|
|
925
|
-
const
|
|
926
|
-
|
|
1108
|
+
intro = (o = "", t2) => {
|
|
1109
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_START)} ` : "";
|
|
1110
|
+
i2.write(`${e}${o}
|
|
927
1111
|
`);
|
|
928
1112
|
};
|
|
929
|
-
|
|
930
|
-
const
|
|
931
|
-
${
|
|
932
|
-
|
|
1113
|
+
outro = (o = "", t2) => {
|
|
1114
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR)}
|
|
1115
|
+
${styleText2("gray", S_BAR_END)} ` : "";
|
|
1116
|
+
i2.write(`${e}${o}
|
|
933
1117
|
|
|
934
1118
|
`);
|
|
935
1119
|
};
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
const
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
1120
|
+
W$1 = (o) => o;
|
|
1121
|
+
C = (o, e, s) => {
|
|
1122
|
+
const a2 = {
|
|
1123
|
+
hard: true,
|
|
1124
|
+
trim: false
|
|
1125
|
+
}, i2 = wrapAnsi(o, e, a2).split(`
|
|
1126
|
+
`), c2 = i2.reduce((n3, t2) => Math.max(dist_default2(t2), n3), 0), u3 = i2.map(s).reduce((n3, t2) => Math.max(dist_default2(t2), n3), 0), g = e - (u3 - c2);
|
|
1127
|
+
return wrapAnsi(o, g, a2);
|
|
1128
|
+
};
|
|
1129
|
+
note = (o = "", e = "", s) => {
|
|
1130
|
+
const a2 = s?.output ?? process$1.stdout, i2 = s?.withGuide ?? settings.withGuide, c2 = s?.format ?? W$1, g = ["", ...C(o, getColumns(a2) - 6, c2).split(`
|
|
1131
|
+
`).map(c2), ""], n3 = dist_default2(e), t2 = Math.max(
|
|
1132
|
+
g.reduce((m, F) => {
|
|
1133
|
+
const O = dist_default2(F);
|
|
1134
|
+
return O > m ? O : m;
|
|
1135
|
+
}, 0),
|
|
1136
|
+
n3
|
|
1137
|
+
) + 2, h2 = g.map(
|
|
1138
|
+
(m) => `${styleText2("gray", S_BAR)} ${m}${" ".repeat(t2 - dist_default2(m))}${styleText2("gray", S_BAR)}`
|
|
1139
|
+
).join(`
|
|
1140
|
+
`), T = i2 ? `${styleText2("gray", S_BAR)}
|
|
1141
|
+
` : "", l$1 = i2 ? S_CONNECT_LEFT : S_CORNER_BOTTOM_LEFT;
|
|
1142
|
+
a2.write(
|
|
1143
|
+
`${T}${styleText2("green", S_STEP_SUBMIT)} ${styleText2("reset", e)} ${styleText2(
|
|
1144
|
+
"gray",
|
|
1145
|
+
S_BAR_H.repeat(Math.max(t2 - n3 - 1, 1)) + S_CORNER_TOP_RIGHT
|
|
1146
|
+
)}
|
|
1147
|
+
${h2}
|
|
1148
|
+
${styleText2("gray", l$1 + S_BAR_H.repeat(t2 + 2) + S_CORNER_BOTTOM_RIGHT)}
|
|
1149
|
+
`
|
|
1150
|
+
);
|
|
954
1151
|
};
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
1152
|
+
W = (l2) => styleText2("magenta", l2);
|
|
1153
|
+
spinner = ({
|
|
1154
|
+
indicator: l2 = "dots",
|
|
1155
|
+
onCancel: h2,
|
|
1156
|
+
output: n3 = process.stdout,
|
|
1157
|
+
cancelMessage: G,
|
|
1158
|
+
errorMessage: O,
|
|
1159
|
+
frames: E = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
|
|
1160
|
+
delay: F = unicode ? 80 : 120,
|
|
1161
|
+
signal: m,
|
|
1162
|
+
...I2
|
|
1163
|
+
} = {}) => {
|
|
1164
|
+
const u3 = isCI();
|
|
1165
|
+
let M, T, d = false, S = false, s = "", p, w = performance.now();
|
|
1166
|
+
const x = getColumns(n3), k = I2?.styleFrame ?? W, g = (e) => {
|
|
1167
|
+
const r2 = e > 1 ? O ?? settings.messages.error : G ?? settings.messages.cancel;
|
|
1168
|
+
S = e === 1, d && (a2(r2, e), S && typeof h2 == "function" && h2());
|
|
1169
|
+
}, f = () => g(2), i2 = () => g(1), A = () => {
|
|
1170
|
+
process.on("uncaughtExceptionMonitor", f), process.on("unhandledRejection", f), process.on("SIGINT", i2), process.on("SIGTERM", i2), process.on("exit", g), m && m.addEventListener("abort", i2);
|
|
1171
|
+
}, H = () => {
|
|
1172
|
+
process.removeListener("uncaughtExceptionMonitor", f), process.removeListener("unhandledRejection", f), process.removeListener("SIGINT", i2), process.removeListener("SIGTERM", i2), process.removeListener("exit", g), m && m.removeEventListener("abort", i2);
|
|
1173
|
+
}, y2 = () => {
|
|
1174
|
+
if (p === void 0) return;
|
|
1175
|
+
u3 && n3.write(`
|
|
969
1176
|
`);
|
|
970
|
-
const
|
|
1177
|
+
const r2 = wrapAnsi(p, x, {
|
|
1178
|
+
hard: true,
|
|
1179
|
+
trim: false
|
|
1180
|
+
}).split(`
|
|
971
1181
|
`);
|
|
972
|
-
|
|
973
|
-
},
|
|
974
|
-
const
|
|
975
|
-
return
|
|
976
|
-
},
|
|
977
|
-
|
|
1182
|
+
r2.length > 1 && n3.write(import_sisteransi2.cursor.up(r2.length - 1)), n3.write(import_sisteransi2.cursor.to(0)), n3.write(import_sisteransi2.erase.down());
|
|
1183
|
+
}, C2 = (e) => e.replace(/\.+$/, ""), _ = (e) => {
|
|
1184
|
+
const r2 = (performance.now() - e) / 1e3, t2 = Math.floor(r2 / 60), o = Math.floor(r2 % 60);
|
|
1185
|
+
return t2 > 0 ? `[${t2}m ${o}s]` : `[${o}s]`;
|
|
1186
|
+
}, N = I2.withGuide ?? settings.withGuide, P = (e = "") => {
|
|
1187
|
+
d = true, M = block({ output: n3 }), s = C2(e), w = performance.now(), N && n3.write(`${styleText2("gray", S_BAR)}
|
|
978
1188
|
`);
|
|
979
|
-
let
|
|
980
|
-
|
|
981
|
-
if (
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
1189
|
+
let r2 = 0, t2 = 0;
|
|
1190
|
+
A(), T = setInterval(() => {
|
|
1191
|
+
if (u3 && s === p)
|
|
1192
|
+
return;
|
|
1193
|
+
y2(), p = s;
|
|
1194
|
+
const o = k(E[r2]);
|
|
1195
|
+
let v;
|
|
1196
|
+
if (u3)
|
|
1197
|
+
v = `${o} ${s}...`;
|
|
1198
|
+
else if (l2 === "timer")
|
|
1199
|
+
v = `${o} ${s} ${_(w)}`;
|
|
987
1200
|
else {
|
|
988
|
-
const
|
|
989
|
-
|
|
990
|
-
}
|
|
991
|
-
const
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1201
|
+
const B = ".".repeat(Math.floor(t2)).slice(0, 3);
|
|
1202
|
+
v = `${o} ${s}${B}`;
|
|
1203
|
+
}
|
|
1204
|
+
const j = wrapAnsi(v, x, {
|
|
1205
|
+
hard: true,
|
|
1206
|
+
trim: false
|
|
1207
|
+
});
|
|
1208
|
+
n3.write(j), r2 = r2 + 1 < E.length ? r2 + 1 : 0, t2 = t2 < 4 ? t2 + 0.125 : 0;
|
|
1209
|
+
}, F);
|
|
1210
|
+
}, a2 = (e = "", r2 = 0, t2 = false) => {
|
|
1211
|
+
if (!d) return;
|
|
1212
|
+
d = false, clearInterval(T), y2();
|
|
1213
|
+
const o = r2 === 0 ? styleText2("green", S_STEP_SUBMIT) : r2 === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
|
|
1214
|
+
s = e ?? s, t2 || (l2 === "timer" ? n3.write(`${o} ${s} ${_(w)}
|
|
1215
|
+
`) : n3.write(`${o} ${s}
|
|
1216
|
+
`)), H(), M();
|
|
1001
1217
|
};
|
|
1002
|
-
return {
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1218
|
+
return {
|
|
1219
|
+
start: P,
|
|
1220
|
+
stop: (e = "") => a2(e, 0),
|
|
1221
|
+
message: (e = "") => {
|
|
1222
|
+
s = C2(e ?? s);
|
|
1223
|
+
},
|
|
1224
|
+
cancel: (e = "") => a2(e, 1),
|
|
1225
|
+
error: (e = "") => a2(e, 2),
|
|
1226
|
+
clear: () => a2("", 0, true),
|
|
1227
|
+
get isCancelled() {
|
|
1228
|
+
return S;
|
|
1229
|
+
}
|
|
1230
|
+
};
|
|
1231
|
+
};
|
|
1232
|
+
u2 = {
|
|
1233
|
+
light: unicodeOr("\u2500", "-"),
|
|
1234
|
+
heavy: unicodeOr("\u2501", "="),
|
|
1235
|
+
block: unicodeOr("\u2588", "#")
|
|
1236
|
+
};
|
|
1237
|
+
SELECT_INSTRUCTIONS = [
|
|
1238
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
1239
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
1240
|
+
];
|
|
1241
|
+
c = (t2, o) => t2.includes(`
|
|
1242
|
+
`) ? t2.split(`
|
|
1243
|
+
`).map((d) => o(d)).join(`
|
|
1244
|
+
`) : o(t2);
|
|
1245
|
+
select = (t2) => {
|
|
1246
|
+
const o = (n3, m) => {
|
|
1247
|
+
if (n3 === void 0)
|
|
1248
|
+
return "";
|
|
1249
|
+
const s = n3.label ?? String(n3.value);
|
|
1250
|
+
switch (m) {
|
|
1017
1251
|
case "disabled":
|
|
1018
|
-
return `${
|
|
1252
|
+
return `${styleText2("gray", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("gray", i2))}${n3.hint ? ` ${styleText2("dim", `(${n3.hint ?? "disabled"})`)}` : ""}`;
|
|
1019
1253
|
case "selected":
|
|
1020
|
-
return `${
|
|
1254
|
+
return `${c(s, (i2) => styleText2("dim", i2))}`;
|
|
1021
1255
|
case "active":
|
|
1022
|
-
return `${
|
|
1256
|
+
return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${n3.hint ? ` ${styleText2("dim", `(${n3.hint})`)}` : ""}`;
|
|
1023
1257
|
case "cancelled":
|
|
1024
|
-
return `${
|
|
1258
|
+
return `${c(s, (i2) => styleText2(["strikethrough", "dim"], i2))}`;
|
|
1025
1259
|
default:
|
|
1026
|
-
return `${
|
|
1027
|
-
}
|
|
1028
|
-
};
|
|
1029
|
-
return new
|
|
1030
|
-
|
|
1031
|
-
|
|
1260
|
+
return `${styleText2("dim", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("dim", i2))}`;
|
|
1261
|
+
}
|
|
1262
|
+
}, d = t2.showInstructions ?? true;
|
|
1263
|
+
return new n$1({
|
|
1264
|
+
options: t2.options,
|
|
1265
|
+
signal: t2.signal,
|
|
1266
|
+
input: t2.input,
|
|
1267
|
+
output: t2.output,
|
|
1268
|
+
initialValue: t2.initialValue,
|
|
1269
|
+
render() {
|
|
1270
|
+
const n3 = t2.withGuide ?? settings.withGuide, m = `${symbol(this.state)} `, s = `${symbolBar(this.state)} `, i2 = wrapTextWithPrefix(
|
|
1271
|
+
t2.output,
|
|
1272
|
+
t2.message,
|
|
1273
|
+
s,
|
|
1274
|
+
m
|
|
1275
|
+
), u3 = `${n3 ? `${styleText2("gray", S_BAR)}
|
|
1276
|
+
` : ""}${i2}
|
|
1032
1277
|
`;
|
|
1278
|
+
switch (this.state) {
|
|
1279
|
+
case "submit": {
|
|
1280
|
+
const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
|
|
1281
|
+
t2.output,
|
|
1282
|
+
o(this.options[this.cursor], "selected"),
|
|
1283
|
+
r2
|
|
1284
|
+
);
|
|
1285
|
+
return `${u3}${a2}`;
|
|
1286
|
+
}
|
|
1287
|
+
case "cancel": {
|
|
1288
|
+
const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
|
|
1289
|
+
t2.output,
|
|
1290
|
+
o(this.options[this.cursor], "cancelled"),
|
|
1291
|
+
r2
|
|
1292
|
+
);
|
|
1293
|
+
return `${u3}${a2}${n3 ? `
|
|
1294
|
+
${styleText2("gray", S_BAR)}` : ""}`;
|
|
1295
|
+
}
|
|
1296
|
+
default: {
|
|
1297
|
+
const r2 = n3 ? `${styleText2("cyan", S_BAR)} ` : "", a2 = u3.split(`
|
|
1298
|
+
`).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], f = p.join(`
|
|
1299
|
+
`), b = p.length + 1;
|
|
1300
|
+
return `${u3}${r2}${limitOptions({
|
|
1301
|
+
output: t2.output,
|
|
1302
|
+
cursor: this.cursor,
|
|
1303
|
+
options: this.options,
|
|
1304
|
+
maxItems: t2.maxItems,
|
|
1305
|
+
columnPadding: r2.length,
|
|
1306
|
+
rowPadding: a2 + b,
|
|
1307
|
+
style: (g, x) => o(g, g.disabled ? "disabled" : x ? "active" : "inactive")
|
|
1308
|
+
}).join(`
|
|
1309
|
+
${r2}`)}
|
|
1310
|
+
${f}
|
|
1311
|
+
`;
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
}).prompt();
|
|
1316
|
+
};
|
|
1317
|
+
i = `${styleText2("gray", S_BAR)} `;
|
|
1318
|
+
text = (t2) => new n2({
|
|
1319
|
+
validate: t2.validate,
|
|
1320
|
+
placeholder: t2.placeholder,
|
|
1321
|
+
defaultValue: t2.defaultValue,
|
|
1322
|
+
initialValue: t2.initialValue,
|
|
1323
|
+
output: t2.output,
|
|
1324
|
+
signal: t2.signal,
|
|
1325
|
+
input: t2.input,
|
|
1326
|
+
render() {
|
|
1327
|
+
const r2 = t2?.withGuide ?? settings.withGuide, l2 = `${`${r2 ? `${styleText2("gray", S_BAR)}
|
|
1328
|
+
` : ""}${symbol(this.state)} `}${t2.message}
|
|
1329
|
+
`, d = t2.placeholder && t2.placeholder.length > 0 ? (
|
|
1330
|
+
// biome-ignore lint/style/noNonNullAssertion: guarded by placeholder.length > 0
|
|
1331
|
+
styleText2("inverse", t2.placeholder[0]) + styleText2("dim", t2.placeholder.slice(1))
|
|
1332
|
+
) : styleText2(["inverse", "hidden"], "_"), o = this.userInput ? this.userInputWithCursor : d, s = this.value ?? "";
|
|
1033
1333
|
switch (this.state) {
|
|
1334
|
+
case "validating": {
|
|
1335
|
+
const n3 = r2 ? `${styleText2("cyan", S_BAR)} ` : "", i2 = r2 ? styleText2("cyan", S_BAR_END) : "", c2 = styleText2("dim", o), $ = styleText2("dim", "Validating...");
|
|
1336
|
+
return `${l2}${n3}${c2}
|
|
1337
|
+
${i2} ${$}
|
|
1338
|
+
`;
|
|
1339
|
+
}
|
|
1340
|
+
case "error": {
|
|
1341
|
+
const n3 = this.error ? ` ${styleText2("yellow", this.error)}` : "", i2 = r2 ? `${styleText2("yellow", S_BAR)} ` : "", c2 = r2 ? styleText2("yellow", S_BAR_END) : "";
|
|
1342
|
+
return `${l2.trim()}
|
|
1343
|
+
${i2}${o}
|
|
1344
|
+
${c2}${n3}
|
|
1345
|
+
`;
|
|
1346
|
+
}
|
|
1034
1347
|
case "submit": {
|
|
1035
|
-
const
|
|
1036
|
-
return `${
|
|
1348
|
+
const n3 = s ? `${r2 ? " " : ""}${styleText2("dim", s)}` : "", i2 = r2 ? styleText2("gray", S_BAR) : "";
|
|
1349
|
+
return `${l2}${i2}${n3}`;
|
|
1037
1350
|
}
|
|
1038
1351
|
case "cancel": {
|
|
1039
|
-
const
|
|
1040
|
-
return `${
|
|
1041
|
-
${
|
|
1352
|
+
const n3 = s ? ` ${styleText2(["strikethrough", "dim"], s)}` : "", i2 = r2 ? styleText2("gray", S_BAR) : "";
|
|
1353
|
+
return `${l2}${i2}${n3}${s.trim() ? `
|
|
1354
|
+
${i2}` : ""}`;
|
|
1042
1355
|
}
|
|
1043
1356
|
default: {
|
|
1044
|
-
const
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
${c2}`)}
|
|
1048
|
-
${a}
|
|
1357
|
+
const n3 = r2 ? `${styleText2("cyan", S_BAR)} ` : "", i2 = r2 ? styleText2("cyan", S_BAR_END) : "";
|
|
1358
|
+
return `${l2}${n3}${o}
|
|
1359
|
+
${i2}
|
|
1049
1360
|
`;
|
|
1050
1361
|
}
|
|
1051
1362
|
}
|
|
1052
|
-
} }).prompt();
|
|
1053
|
-
};
|
|
1054
|
-
je = `${t("gray", d2)} `;
|
|
1055
|
-
Ot = (e) => new at({ validate: e.validate, placeholder: e.placeholder, defaultValue: e.defaultValue, initialValue: e.initialValue, output: e.output, signal: e.signal, input: e.input, render() {
|
|
1056
|
-
const i = e?.withGuide ?? u.withGuide, s = `${`${i ? `${t("gray", d2)}
|
|
1057
|
-
` : ""}${V2(this.state)} `}${e.message}
|
|
1058
|
-
`, r = e.placeholder ? t("inverse", e.placeholder[0]) + t("dim", e.placeholder.slice(1)) : t(["inverse", "hidden"], "_"), u2 = this.userInput ? this.userInputWithCursor : r, n = this.value ?? "";
|
|
1059
|
-
switch (this.state) {
|
|
1060
|
-
case "error": {
|
|
1061
|
-
const o = this.error ? ` ${t("yellow", this.error)}` : "", c2 = i ? `${t("yellow", d2)} ` : "", a = i ? t("yellow", E2) : "";
|
|
1062
|
-
return `${s.trim()}
|
|
1063
|
-
${c2}${u2}
|
|
1064
|
-
${a}${o}
|
|
1065
|
-
`;
|
|
1066
|
-
}
|
|
1067
|
-
case "submit": {
|
|
1068
|
-
const o = n ? ` ${t("dim", n)}` : "", c2 = i ? t("gray", d2) : "";
|
|
1069
|
-
return `${s}${c2}${o}`;
|
|
1070
|
-
}
|
|
1071
|
-
case "cancel": {
|
|
1072
|
-
const o = n ? ` ${t(["strikethrough", "dim"], n)}` : "", c2 = i ? t("gray", d2) : "";
|
|
1073
|
-
return `${s}${c2}${o}${n.trim() ? `
|
|
1074
|
-
${c2}` : ""}`;
|
|
1075
|
-
}
|
|
1076
|
-
default: {
|
|
1077
|
-
const o = i ? `${t("cyan", d2)} ` : "", c2 = i ? t("cyan", E2) : "";
|
|
1078
|
-
return `${s}${o}${u2}
|
|
1079
|
-
${c2}
|
|
1080
|
-
`;
|
|
1081
|
-
}
|
|
1082
1363
|
}
|
|
1083
|
-
}
|
|
1364
|
+
}).prompt();
|
|
1084
1365
|
}
|
|
1085
1366
|
});
|
|
1086
1367
|
|
|
@@ -1088,21 +1369,21 @@ ${c2}
|
|
|
1088
1369
|
var cli_output_exports = {};
|
|
1089
1370
|
__export(cli_output_exports, {
|
|
1090
1371
|
LogLevel: () => LogLevel,
|
|
1091
|
-
cancel: () =>
|
|
1372
|
+
cancel: () => cancel,
|
|
1092
1373
|
colorUtils: () => colorUtils,
|
|
1093
1374
|
displayDoNotDevError: () => displayDoNotDevError,
|
|
1094
1375
|
error: () => error,
|
|
1095
1376
|
getLogLevel: () => getLogLevel,
|
|
1096
1377
|
info: () => info,
|
|
1097
|
-
intro: () =>
|
|
1098
|
-
isCancel: () =>
|
|
1378
|
+
intro: () => intro,
|
|
1379
|
+
isCancel: () => isCancel,
|
|
1099
1380
|
isDebug: () => isDebug,
|
|
1100
1381
|
isVerbose: () => isVerbose,
|
|
1101
|
-
log: () =>
|
|
1102
|
-
note: () =>
|
|
1103
|
-
outro: () =>
|
|
1382
|
+
log: () => log2,
|
|
1383
|
+
note: () => note,
|
|
1384
|
+
outro: () => outro,
|
|
1104
1385
|
setLogLevel: () => setLogLevel,
|
|
1105
|
-
spinner: () =>
|
|
1386
|
+
spinner: () => spinner,
|
|
1106
1387
|
success: () => success,
|
|
1107
1388
|
warn: () => warn
|
|
1108
1389
|
});
|
|
@@ -1114,9 +1395,9 @@ function supportsColor() {
|
|
|
1114
1395
|
}
|
|
1115
1396
|
return process.stdout.isTTY === true;
|
|
1116
1397
|
}
|
|
1117
|
-
function colorize(
|
|
1118
|
-
if (!supportsColor()) return
|
|
1119
|
-
return `${color}${
|
|
1398
|
+
function colorize(text2, color) {
|
|
1399
|
+
if (!supportsColor()) return text2;
|
|
1400
|
+
return `${color}${text2}${colors.reset}`;
|
|
1120
1401
|
}
|
|
1121
1402
|
function setLogLevel(level) {
|
|
1122
1403
|
currentLogLevel = level;
|
|
@@ -1178,9 +1459,9 @@ ${contextStr}`;
|
|
|
1178
1459
|
|
|
1179
1460
|
Original error: ${originalMsg}`;
|
|
1180
1461
|
}
|
|
1181
|
-
|
|
1462
|
+
log.error(message);
|
|
1182
1463
|
}
|
|
1183
|
-
var colors, colorUtils, LogLevel, currentLogLevel,
|
|
1464
|
+
var colors, colorUtils, LogLevel, currentLogLevel, log2, error, warn, info, success;
|
|
1184
1465
|
var init_cli_output = __esm({
|
|
1185
1466
|
"packages/tooling/src/utils/cli-output.ts"() {
|
|
1186
1467
|
"use strict";
|
|
@@ -1225,7 +1506,7 @@ var init_cli_output = __esm({
|
|
|
1225
1506
|
currentLogLevel = envLevel;
|
|
1226
1507
|
}
|
|
1227
1508
|
}
|
|
1228
|
-
|
|
1509
|
+
log2 = {
|
|
1229
1510
|
/**
|
|
1230
1511
|
* Logs an error message (always shows unless Quiet level)
|
|
1231
1512
|
* Uses clack's log.error + explicit red color
|
|
@@ -1233,7 +1514,7 @@ var init_cli_output = __esm({
|
|
|
1233
1514
|
error(...args) {
|
|
1234
1515
|
if (currentLogLevel < 0 /* Quiet */) return;
|
|
1235
1516
|
const message = formatMessage(...args);
|
|
1236
|
-
|
|
1517
|
+
log.error(colorize(message, colors.brightRed));
|
|
1237
1518
|
},
|
|
1238
1519
|
/**
|
|
1239
1520
|
* Logs a warning message (shows at Normal level and above)
|
|
@@ -1242,7 +1523,7 @@ var init_cli_output = __esm({
|
|
|
1242
1523
|
warn(...args) {
|
|
1243
1524
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
1244
1525
|
const message = formatMessage(...args);
|
|
1245
|
-
|
|
1526
|
+
log.warn(colorize(message, colors.brightYellow));
|
|
1246
1527
|
},
|
|
1247
1528
|
/**
|
|
1248
1529
|
* Logs an info message (shows at Normal level and above)
|
|
@@ -1251,7 +1532,7 @@ var init_cli_output = __esm({
|
|
|
1251
1532
|
info(...args) {
|
|
1252
1533
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
1253
1534
|
const message = formatMessage(...args);
|
|
1254
|
-
|
|
1535
|
+
log.info(colorize(message, colors.brightCyan));
|
|
1255
1536
|
},
|
|
1256
1537
|
/**
|
|
1257
1538
|
* Logs a success message (shows at Normal level and above)
|
|
@@ -1260,7 +1541,7 @@ var init_cli_output = __esm({
|
|
|
1260
1541
|
success(...args) {
|
|
1261
1542
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
1262
1543
|
const message = formatMessage(...args);
|
|
1263
|
-
|
|
1544
|
+
log.success(colorize(message, colors.brightGreen));
|
|
1264
1545
|
},
|
|
1265
1546
|
/**
|
|
1266
1547
|
* Logs a debug message (only shows at Verbose level and above)
|
|
@@ -1269,7 +1550,7 @@ var init_cli_output = __esm({
|
|
|
1269
1550
|
debug(...args) {
|
|
1270
1551
|
if (currentLogLevel < 2 /* Verbose */) return;
|
|
1271
1552
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
1272
|
-
|
|
1553
|
+
log.message(
|
|
1273
1554
|
colorize(
|
|
1274
1555
|
`[${timeStamp}] \u{1F50D} DEBUG: ${formatMessage(...args)}`,
|
|
1275
1556
|
colors.gray
|
|
@@ -1283,7 +1564,7 @@ var init_cli_output = __esm({
|
|
|
1283
1564
|
trace(...args) {
|
|
1284
1565
|
if (currentLogLevel < 3 /* Debug */) return;
|
|
1285
1566
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
1286
|
-
|
|
1567
|
+
log.message(
|
|
1287
1568
|
colorize(
|
|
1288
1569
|
`[${timeStamp}] \u{1F52C} TRACE: ${formatMessage(...args)}`,
|
|
1289
1570
|
colors.gray
|
|
@@ -1291,10 +1572,10 @@ var init_cli_output = __esm({
|
|
|
1291
1572
|
);
|
|
1292
1573
|
}
|
|
1293
1574
|
};
|
|
1294
|
-
error =
|
|
1295
|
-
warn =
|
|
1296
|
-
info =
|
|
1297
|
-
success =
|
|
1575
|
+
error = log2.error.bind(log2);
|
|
1576
|
+
warn = log2.warn.bind(log2);
|
|
1577
|
+
info = log2.info.bind(log2);
|
|
1578
|
+
success = log2.success.bind(log2);
|
|
1298
1579
|
}
|
|
1299
1580
|
});
|
|
1300
1581
|
|
|
@@ -1512,9 +1793,9 @@ var require_is_glob = __commonJS({
|
|
|
1512
1793
|
index += 2;
|
|
1513
1794
|
var close = chars[open];
|
|
1514
1795
|
if (close) {
|
|
1515
|
-
var
|
|
1516
|
-
if (
|
|
1517
|
-
index =
|
|
1796
|
+
var n3 = str.indexOf(close, index);
|
|
1797
|
+
if (n3 !== -1) {
|
|
1798
|
+
index = n3 + 1;
|
|
1518
1799
|
}
|
|
1519
1800
|
}
|
|
1520
1801
|
if (str[index] === "!") {
|
|
@@ -1540,9 +1821,9 @@ var require_is_glob = __commonJS({
|
|
|
1540
1821
|
index += 2;
|
|
1541
1822
|
var close = chars[open];
|
|
1542
1823
|
if (close) {
|
|
1543
|
-
var
|
|
1544
|
-
if (
|
|
1545
|
-
index =
|
|
1824
|
+
var n3 = str.indexOf(close, index);
|
|
1825
|
+
if (n3 !== -1) {
|
|
1826
|
+
index = n3 + 1;
|
|
1546
1827
|
}
|
|
1547
1828
|
}
|
|
1548
1829
|
if (str[index] === "!") {
|
|
@@ -1620,8 +1901,8 @@ var require_utils = __commonJS({
|
|
|
1620
1901
|
if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
|
|
1621
1902
|
return (Number(max) - Number(min)) / Number(step) >= limit;
|
|
1622
1903
|
};
|
|
1623
|
-
exports.escapeNode = (
|
|
1624
|
-
const node =
|
|
1904
|
+
exports.escapeNode = (block2, n3 = 0, type) => {
|
|
1905
|
+
const node = block2.nodes[n3];
|
|
1625
1906
|
if (!node) return;
|
|
1626
1907
|
if (type && node.type === type || node.type === "open" || node.type === "close") {
|
|
1627
1908
|
if (node.escaped !== true) {
|
|
@@ -1638,15 +1919,15 @@ var require_utils = __commonJS({
|
|
|
1638
1919
|
}
|
|
1639
1920
|
return false;
|
|
1640
1921
|
};
|
|
1641
|
-
exports.isInvalidBrace = (
|
|
1642
|
-
if (
|
|
1643
|
-
if (
|
|
1644
|
-
if (
|
|
1645
|
-
|
|
1922
|
+
exports.isInvalidBrace = (block2) => {
|
|
1923
|
+
if (block2.type !== "brace") return false;
|
|
1924
|
+
if (block2.invalid === true || block2.dollar) return true;
|
|
1925
|
+
if (block2.commas >> 0 + block2.ranges >> 0 === 0) {
|
|
1926
|
+
block2.invalid = true;
|
|
1646
1927
|
return true;
|
|
1647
1928
|
}
|
|
1648
|
-
if (
|
|
1649
|
-
|
|
1929
|
+
if (block2.open !== true || block2.close !== true) {
|
|
1930
|
+
block2.invalid = true;
|
|
1650
1931
|
return true;
|
|
1651
1932
|
}
|
|
1652
1933
|
return false;
|
|
@@ -1665,8 +1946,8 @@ var require_utils = __commonJS({
|
|
|
1665
1946
|
exports.flatten = (...args) => {
|
|
1666
1947
|
const result = [];
|
|
1667
1948
|
const flat = (arr) => {
|
|
1668
|
-
for (let
|
|
1669
|
-
const ele = arr[
|
|
1949
|
+
for (let i2 = 0; i2 < arr.length; i2++) {
|
|
1950
|
+
const ele = arr[i2];
|
|
1670
1951
|
if (Array.isArray(ele)) {
|
|
1671
1952
|
flat(ele);
|
|
1672
1953
|
continue;
|
|
@@ -1760,9 +2041,9 @@ var require_to_regex_range = __commonJS({
|
|
|
1760
2041
|
if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
|
|
1761
2042
|
return toRegexRange.cache[cacheKey].result;
|
|
1762
2043
|
}
|
|
1763
|
-
let
|
|
2044
|
+
let a2 = Math.min(min, max);
|
|
1764
2045
|
let b = Math.max(min, max);
|
|
1765
|
-
if (Math.abs(
|
|
2046
|
+
if (Math.abs(a2 - b) === 1) {
|
|
1766
2047
|
let result = min + "|" + max;
|
|
1767
2048
|
if (opts.capture) {
|
|
1768
2049
|
return `(${result})`;
|
|
@@ -1773,20 +2054,20 @@ var require_to_regex_range = __commonJS({
|
|
|
1773
2054
|
return `(?:${result})`;
|
|
1774
2055
|
}
|
|
1775
2056
|
let isPadded = hasPadding(min) || hasPadding(max);
|
|
1776
|
-
let state = { min, max, a, b };
|
|
2057
|
+
let state = { min, max, a: a2, b };
|
|
1777
2058
|
let positives = [];
|
|
1778
2059
|
let negatives = [];
|
|
1779
2060
|
if (isPadded) {
|
|
1780
2061
|
state.isPadded = isPadded;
|
|
1781
2062
|
state.maxLen = String(state.max).length;
|
|
1782
2063
|
}
|
|
1783
|
-
if (
|
|
2064
|
+
if (a2 < 0) {
|
|
1784
2065
|
let newMin = b < 0 ? Math.abs(b) : 1;
|
|
1785
|
-
negatives = splitToPatterns(newMin, Math.abs(
|
|
1786
|
-
|
|
2066
|
+
negatives = splitToPatterns(newMin, Math.abs(a2), state, opts);
|
|
2067
|
+
a2 = state.a = 0;
|
|
1787
2068
|
}
|
|
1788
2069
|
if (b >= 0) {
|
|
1789
|
-
positives = splitToPatterns(
|
|
2070
|
+
positives = splitToPatterns(a2, b, state, opts);
|
|
1790
2071
|
}
|
|
1791
2072
|
state.negatives = negatives;
|
|
1792
2073
|
state.positives = positives;
|
|
@@ -1834,8 +2115,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1834
2115
|
let digits = zipped.length;
|
|
1835
2116
|
let pattern = "";
|
|
1836
2117
|
let count = 0;
|
|
1837
|
-
for (let
|
|
1838
|
-
let [startDigit, stopDigit] = zipped[
|
|
2118
|
+
for (let i2 = 0; i2 < digits; i2++) {
|
|
2119
|
+
let [startDigit, stopDigit] = zipped[i2];
|
|
1839
2120
|
if (startDigit === stopDigit) {
|
|
1840
2121
|
pattern += startDigit;
|
|
1841
2122
|
} else if (startDigit !== "0" || stopDigit !== "9") {
|
|
@@ -1854,8 +2135,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1854
2135
|
let tokens = [];
|
|
1855
2136
|
let start = min;
|
|
1856
2137
|
let prev;
|
|
1857
|
-
for (let
|
|
1858
|
-
let max2 = ranges[
|
|
2138
|
+
for (let i2 = 0; i2 < ranges.length; i2++) {
|
|
2139
|
+
let max2 = ranges[i2];
|
|
1859
2140
|
let obj = rangeToPattern(String(start), String(max2), options);
|
|
1860
2141
|
let zeros = "";
|
|
1861
2142
|
if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
|
|
@@ -1890,13 +2171,13 @@ var require_to_regex_range = __commonJS({
|
|
|
1890
2171
|
}
|
|
1891
2172
|
return result;
|
|
1892
2173
|
}
|
|
1893
|
-
function zip(
|
|
2174
|
+
function zip(a2, b) {
|
|
1894
2175
|
let arr = [];
|
|
1895
|
-
for (let
|
|
2176
|
+
for (let i2 = 0; i2 < a2.length; i2++) arr.push([a2[i2], b[i2]]);
|
|
1896
2177
|
return arr;
|
|
1897
2178
|
}
|
|
1898
|
-
function compare(
|
|
1899
|
-
return
|
|
2179
|
+
function compare(a2, b) {
|
|
2180
|
+
return a2 > b ? 1 : b > a2 ? -1 : 0;
|
|
1900
2181
|
}
|
|
1901
2182
|
function contains(arr, key, val) {
|
|
1902
2183
|
return arr.some((ele) => ele[key] === val);
|
|
@@ -1914,8 +2195,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1914
2195
|
}
|
|
1915
2196
|
return "";
|
|
1916
2197
|
}
|
|
1917
|
-
function toCharacterClass(
|
|
1918
|
-
return `[${
|
|
2198
|
+
function toCharacterClass(a2, b, options) {
|
|
2199
|
+
return `[${a2}${b - a2 === 1 ? "" : "-"}${b}]`;
|
|
1919
2200
|
}
|
|
1920
2201
|
function hasPadding(str) {
|
|
1921
2202
|
return /^-?(0+)\d/.test(str);
|
|
@@ -1994,8 +2275,8 @@ var require_fill_range = __commonJS({
|
|
|
1994
2275
|
return negative ? "-" + input : input;
|
|
1995
2276
|
};
|
|
1996
2277
|
var toSequence = (parts, options, maxLen) => {
|
|
1997
|
-
parts.negatives.sort((
|
|
1998
|
-
parts.positives.sort((
|
|
2278
|
+
parts.negatives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
2279
|
+
parts.positives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
1999
2280
|
let prefix = options.capture ? "" : "?:";
|
|
2000
2281
|
let positives = "";
|
|
2001
2282
|
let negatives = "";
|
|
@@ -2016,12 +2297,12 @@ var require_fill_range = __commonJS({
|
|
|
2016
2297
|
}
|
|
2017
2298
|
return result;
|
|
2018
2299
|
};
|
|
2019
|
-
var toRange = (
|
|
2300
|
+
var toRange = (a2, b, isNumbers, options) => {
|
|
2020
2301
|
if (isNumbers) {
|
|
2021
|
-
return toRegexRange(
|
|
2302
|
+
return toRegexRange(a2, b, { wrap: false, ...options });
|
|
2022
2303
|
}
|
|
2023
|
-
let start = String.fromCharCode(
|
|
2024
|
-
if (
|
|
2304
|
+
let start = String.fromCharCode(a2);
|
|
2305
|
+
if (a2 === b) return start;
|
|
2025
2306
|
let stop = String.fromCharCode(b);
|
|
2026
2307
|
return `[${start}-${stop}]`;
|
|
2027
2308
|
};
|
|
@@ -2047,15 +2328,15 @@ var require_fill_range = __commonJS({
|
|
|
2047
2328
|
return [];
|
|
2048
2329
|
};
|
|
2049
2330
|
var fillNumbers = (start, end, step = 1, options = {}) => {
|
|
2050
|
-
let
|
|
2331
|
+
let a2 = Number(start);
|
|
2051
2332
|
let b = Number(end);
|
|
2052
|
-
if (!Number.isInteger(
|
|
2333
|
+
if (!Number.isInteger(a2) || !Number.isInteger(b)) {
|
|
2053
2334
|
if (options.strictRanges === true) throw rangeError([start, end]);
|
|
2054
2335
|
return [];
|
|
2055
2336
|
}
|
|
2056
|
-
if (
|
|
2337
|
+
if (a2 === 0) a2 = 0;
|
|
2057
2338
|
if (b === 0) b = 0;
|
|
2058
|
-
let descending =
|
|
2339
|
+
let descending = a2 > b;
|
|
2059
2340
|
let startString = String(start);
|
|
2060
2341
|
let endString = String(end);
|
|
2061
2342
|
let stepString = String(step);
|
|
@@ -2071,13 +2352,13 @@ var require_fill_range = __commonJS({
|
|
|
2071
2352
|
let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
|
|
2072
2353
|
let range = [];
|
|
2073
2354
|
let index = 0;
|
|
2074
|
-
while (descending ?
|
|
2355
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
2075
2356
|
if (options.toRegex === true && step > 1) {
|
|
2076
|
-
push(
|
|
2357
|
+
push(a2);
|
|
2077
2358
|
} else {
|
|
2078
|
-
range.push(pad(format(
|
|
2359
|
+
range.push(pad(format(a2, index), maxLen, toNumber));
|
|
2079
2360
|
}
|
|
2080
|
-
|
|
2361
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
2081
2362
|
index++;
|
|
2082
2363
|
}
|
|
2083
2364
|
if (options.toRegex === true) {
|
|
@@ -2090,19 +2371,19 @@ var require_fill_range = __commonJS({
|
|
|
2090
2371
|
return invalidRange(start, end, options);
|
|
2091
2372
|
}
|
|
2092
2373
|
let format = options.transform || ((val) => String.fromCharCode(val));
|
|
2093
|
-
let
|
|
2374
|
+
let a2 = `${start}`.charCodeAt(0);
|
|
2094
2375
|
let b = `${end}`.charCodeAt(0);
|
|
2095
|
-
let descending =
|
|
2096
|
-
let min = Math.min(
|
|
2097
|
-
let max = Math.max(
|
|
2376
|
+
let descending = a2 > b;
|
|
2377
|
+
let min = Math.min(a2, b);
|
|
2378
|
+
let max = Math.max(a2, b);
|
|
2098
2379
|
if (options.toRegex && step === 1) {
|
|
2099
2380
|
return toRange(min, max, false, options);
|
|
2100
2381
|
}
|
|
2101
2382
|
let range = [];
|
|
2102
2383
|
let index = 0;
|
|
2103
|
-
while (descending ?
|
|
2104
|
-
range.push(format(
|
|
2105
|
-
|
|
2384
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
2385
|
+
range.push(format(a2, index));
|
|
2386
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
2106
2387
|
index++;
|
|
2107
2388
|
}
|
|
2108
2389
|
if (options.toRegex === true) {
|
|
@@ -2225,18 +2506,18 @@ var require_expand = __commonJS({
|
|
|
2225
2506
|
const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
|
|
2226
2507
|
const walk = (node, parent = {}) => {
|
|
2227
2508
|
node.queue = [];
|
|
2228
|
-
let
|
|
2229
|
-
let
|
|
2230
|
-
while (
|
|
2231
|
-
|
|
2232
|
-
|
|
2509
|
+
let p = parent;
|
|
2510
|
+
let q = parent.queue;
|
|
2511
|
+
while (p.type !== "brace" && p.type !== "root" && p.parent) {
|
|
2512
|
+
p = p.parent;
|
|
2513
|
+
q = p.queue;
|
|
2233
2514
|
}
|
|
2234
2515
|
if (node.invalid || node.dollar) {
|
|
2235
|
-
|
|
2516
|
+
q.push(append(q.pop(), stringify2(node, options)));
|
|
2236
2517
|
return;
|
|
2237
2518
|
}
|
|
2238
2519
|
if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
|
|
2239
|
-
|
|
2520
|
+
q.push(append(q.pop(), ["{}"]));
|
|
2240
2521
|
return;
|
|
2241
2522
|
}
|
|
2242
2523
|
if (node.nodes && node.ranges > 0) {
|
|
@@ -2248,26 +2529,26 @@ var require_expand = __commonJS({
|
|
|
2248
2529
|
if (range.length === 0) {
|
|
2249
2530
|
range = stringify2(node, options);
|
|
2250
2531
|
}
|
|
2251
|
-
|
|
2532
|
+
q.push(append(q.pop(), range));
|
|
2252
2533
|
node.nodes = [];
|
|
2253
2534
|
return;
|
|
2254
2535
|
}
|
|
2255
2536
|
const enclose = utils.encloseBrace(node);
|
|
2256
2537
|
let queue = node.queue;
|
|
2257
|
-
let
|
|
2258
|
-
while (
|
|
2259
|
-
|
|
2260
|
-
queue =
|
|
2538
|
+
let block2 = node;
|
|
2539
|
+
while (block2.type !== "brace" && block2.type !== "root" && block2.parent) {
|
|
2540
|
+
block2 = block2.parent;
|
|
2541
|
+
queue = block2.queue;
|
|
2261
2542
|
}
|
|
2262
|
-
for (let
|
|
2263
|
-
const child = node.nodes[
|
|
2543
|
+
for (let i2 = 0; i2 < node.nodes.length; i2++) {
|
|
2544
|
+
const child = node.nodes[i2];
|
|
2264
2545
|
if (child.type === "comma" && node.type === "brace") {
|
|
2265
|
-
if (
|
|
2546
|
+
if (i2 === 1) queue.push("");
|
|
2266
2547
|
queue.push("");
|
|
2267
2548
|
continue;
|
|
2268
2549
|
}
|
|
2269
2550
|
if (child.type === "close") {
|
|
2270
|
-
|
|
2551
|
+
q.push(append(q.pop(), queue, enclose));
|
|
2271
2552
|
continue;
|
|
2272
2553
|
}
|
|
2273
2554
|
if (child.value && child.type !== "open") {
|
|
@@ -2434,7 +2715,7 @@ var require_parse = __commonJS({
|
|
|
2434
2715
|
}
|
|
2435
2716
|
const ast = { type: "root", input, nodes: [] };
|
|
2436
2717
|
const stack = [ast];
|
|
2437
|
-
let
|
|
2718
|
+
let block2 = ast;
|
|
2438
2719
|
let prev = ast;
|
|
2439
2720
|
let brackets = 0;
|
|
2440
2721
|
const length = input.length;
|
|
@@ -2450,15 +2731,15 @@ var require_parse = __commonJS({
|
|
|
2450
2731
|
prev.value += node.value;
|
|
2451
2732
|
return;
|
|
2452
2733
|
}
|
|
2453
|
-
|
|
2454
|
-
node.parent =
|
|
2734
|
+
block2.nodes.push(node);
|
|
2735
|
+
node.parent = block2;
|
|
2455
2736
|
node.prev = prev;
|
|
2456
2737
|
prev = node;
|
|
2457
2738
|
return node;
|
|
2458
2739
|
};
|
|
2459
2740
|
push({ type: "bos" });
|
|
2460
2741
|
while (index < length) {
|
|
2461
|
-
|
|
2742
|
+
block2 = stack[stack.length - 1];
|
|
2462
2743
|
value = advance();
|
|
2463
2744
|
if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
|
|
2464
2745
|
continue;
|
|
@@ -2495,19 +2776,19 @@ var require_parse = __commonJS({
|
|
|
2495
2776
|
continue;
|
|
2496
2777
|
}
|
|
2497
2778
|
if (value === CHAR_LEFT_PARENTHESES) {
|
|
2498
|
-
|
|
2499
|
-
stack.push(
|
|
2779
|
+
block2 = push({ type: "paren", nodes: [] });
|
|
2780
|
+
stack.push(block2);
|
|
2500
2781
|
push({ type: "text", value });
|
|
2501
2782
|
continue;
|
|
2502
2783
|
}
|
|
2503
2784
|
if (value === CHAR_RIGHT_PARENTHESES) {
|
|
2504
|
-
if (
|
|
2785
|
+
if (block2.type !== "paren") {
|
|
2505
2786
|
push({ type: "text", value });
|
|
2506
2787
|
continue;
|
|
2507
2788
|
}
|
|
2508
|
-
|
|
2789
|
+
block2 = stack.pop();
|
|
2509
2790
|
push({ type: "text", value });
|
|
2510
|
-
|
|
2791
|
+
block2 = stack[stack.length - 1];
|
|
2511
2792
|
continue;
|
|
2512
2793
|
}
|
|
2513
2794
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
@@ -2532,7 +2813,7 @@ var require_parse = __commonJS({
|
|
|
2532
2813
|
}
|
|
2533
2814
|
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
2534
2815
|
depth++;
|
|
2535
|
-
const dollar = prev.value && prev.value.slice(-1) === "$" ||
|
|
2816
|
+
const dollar = prev.value && prev.value.slice(-1) === "$" || block2.dollar === true;
|
|
2536
2817
|
const brace = {
|
|
2537
2818
|
type: "brace",
|
|
2538
2819
|
open: true,
|
|
@@ -2543,52 +2824,52 @@ var require_parse = __commonJS({
|
|
|
2543
2824
|
ranges: 0,
|
|
2544
2825
|
nodes: []
|
|
2545
2826
|
};
|
|
2546
|
-
|
|
2547
|
-
stack.push(
|
|
2827
|
+
block2 = push(brace);
|
|
2828
|
+
stack.push(block2);
|
|
2548
2829
|
push({ type: "open", value });
|
|
2549
2830
|
continue;
|
|
2550
2831
|
}
|
|
2551
2832
|
if (value === CHAR_RIGHT_CURLY_BRACE) {
|
|
2552
|
-
if (
|
|
2833
|
+
if (block2.type !== "brace") {
|
|
2553
2834
|
push({ type: "text", value });
|
|
2554
2835
|
continue;
|
|
2555
2836
|
}
|
|
2556
2837
|
const type = "close";
|
|
2557
|
-
|
|
2558
|
-
|
|
2838
|
+
block2 = stack.pop();
|
|
2839
|
+
block2.close = true;
|
|
2559
2840
|
push({ type, value });
|
|
2560
2841
|
depth--;
|
|
2561
|
-
|
|
2842
|
+
block2 = stack[stack.length - 1];
|
|
2562
2843
|
continue;
|
|
2563
2844
|
}
|
|
2564
2845
|
if (value === CHAR_COMMA && depth > 0) {
|
|
2565
|
-
if (
|
|
2566
|
-
|
|
2567
|
-
const open =
|
|
2568
|
-
|
|
2846
|
+
if (block2.ranges > 0) {
|
|
2847
|
+
block2.ranges = 0;
|
|
2848
|
+
const open = block2.nodes.shift();
|
|
2849
|
+
block2.nodes = [open, { type: "text", value: stringify2(block2) }];
|
|
2569
2850
|
}
|
|
2570
2851
|
push({ type: "comma", value });
|
|
2571
|
-
|
|
2852
|
+
block2.commas++;
|
|
2572
2853
|
continue;
|
|
2573
2854
|
}
|
|
2574
|
-
if (value === CHAR_DOT && depth > 0 &&
|
|
2575
|
-
const siblings =
|
|
2855
|
+
if (value === CHAR_DOT && depth > 0 && block2.commas === 0) {
|
|
2856
|
+
const siblings = block2.nodes;
|
|
2576
2857
|
if (depth === 0 || siblings.length === 0) {
|
|
2577
2858
|
push({ type: "text", value });
|
|
2578
2859
|
continue;
|
|
2579
2860
|
}
|
|
2580
2861
|
if (prev.type === "dot") {
|
|
2581
|
-
|
|
2862
|
+
block2.range = [];
|
|
2582
2863
|
prev.value += value;
|
|
2583
2864
|
prev.type = "range";
|
|
2584
|
-
if (
|
|
2585
|
-
|
|
2586
|
-
|
|
2865
|
+
if (block2.nodes.length !== 3 && block2.nodes.length !== 5) {
|
|
2866
|
+
block2.invalid = true;
|
|
2867
|
+
block2.ranges = 0;
|
|
2587
2868
|
prev.type = "text";
|
|
2588
2869
|
continue;
|
|
2589
2870
|
}
|
|
2590
|
-
|
|
2591
|
-
|
|
2871
|
+
block2.ranges++;
|
|
2872
|
+
block2.args = [];
|
|
2592
2873
|
continue;
|
|
2593
2874
|
}
|
|
2594
2875
|
if (prev.type === "range") {
|
|
@@ -2596,7 +2877,7 @@ var require_parse = __commonJS({
|
|
|
2596
2877
|
const before = siblings[siblings.length - 1];
|
|
2597
2878
|
before.value += prev.value + value;
|
|
2598
2879
|
prev = before;
|
|
2599
|
-
|
|
2880
|
+
block2.ranges--;
|
|
2600
2881
|
continue;
|
|
2601
2882
|
}
|
|
2602
2883
|
push({ type: "dot", value });
|
|
@@ -2605,9 +2886,9 @@ var require_parse = __commonJS({
|
|
|
2605
2886
|
push({ type: "text", value });
|
|
2606
2887
|
}
|
|
2607
2888
|
do {
|
|
2608
|
-
|
|
2609
|
-
if (
|
|
2610
|
-
|
|
2889
|
+
block2 = stack.pop();
|
|
2890
|
+
if (block2.type !== "root") {
|
|
2891
|
+
block2.nodes.forEach((node) => {
|
|
2611
2892
|
if (!node.nodes) {
|
|
2612
2893
|
if (node.type === "open") node.isOpen = true;
|
|
2613
2894
|
if (node.type === "close") node.isClose = true;
|
|
@@ -2616,8 +2897,8 @@ var require_parse = __commonJS({
|
|
|
2616
2897
|
}
|
|
2617
2898
|
});
|
|
2618
2899
|
const parent = stack[stack.length - 1];
|
|
2619
|
-
const index2 = parent.nodes.indexOf(
|
|
2620
|
-
parent.nodes.splice(index2, 1, ...
|
|
2900
|
+
const index2 = parent.nodes.indexOf(block2);
|
|
2901
|
+
parent.nodes.splice(index2, 1, ...block2.nodes);
|
|
2621
2902
|
}
|
|
2622
2903
|
} while (stack.length > 0);
|
|
2623
2904
|
push({ type: "eos" });
|
|
@@ -3250,9 +3531,9 @@ var require_scan = __commonJS({
|
|
|
3250
3531
|
if (opts.parts === true || opts.tokens === true) {
|
|
3251
3532
|
let prevIndex;
|
|
3252
3533
|
for (let idx = 0; idx < slashes.length; idx++) {
|
|
3253
|
-
const
|
|
3254
|
-
const
|
|
3255
|
-
const value = input.slice(
|
|
3534
|
+
const n3 = prevIndex ? prevIndex + 1 : start;
|
|
3535
|
+
const i2 = slashes[idx];
|
|
3536
|
+
const value = input.slice(n3, i2);
|
|
3256
3537
|
if (opts.tokens) {
|
|
3257
3538
|
if (idx === 0 && start !== 0) {
|
|
3258
3539
|
tokens[idx].isPrefix = true;
|
|
@@ -3266,7 +3547,7 @@ var require_scan = __commonJS({
|
|
|
3266
3547
|
if (idx !== 0 || value !== "") {
|
|
3267
3548
|
parts.push(value);
|
|
3268
3549
|
}
|
|
3269
|
-
prevIndex =
|
|
3550
|
+
prevIndex = i2;
|
|
3270
3551
|
}
|
|
3271
3552
|
if (prevIndex && prevIndex + 1 < input.length) {
|
|
3272
3553
|
const value = input.slice(prevIndex + 1);
|
|
@@ -3395,15 +3676,15 @@ var require_parse2 = __commonJS({
|
|
|
3395
3676
|
};
|
|
3396
3677
|
var hasRepeatedCharPrefixOverlap = (branches) => {
|
|
3397
3678
|
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
3398
|
-
for (let
|
|
3399
|
-
for (let
|
|
3400
|
-
const
|
|
3401
|
-
const b = values[
|
|
3402
|
-
const char =
|
|
3403
|
-
if (!char ||
|
|
3679
|
+
for (let i2 = 0; i2 < values.length; i2++) {
|
|
3680
|
+
for (let j = i2 + 1; j < values.length; j++) {
|
|
3681
|
+
const a2 = values[i2];
|
|
3682
|
+
const b = values[j];
|
|
3683
|
+
const char = a2[0];
|
|
3684
|
+
if (!char || a2 !== char.repeat(a2.length) || b !== char.repeat(b.length)) {
|
|
3404
3685
|
continue;
|
|
3405
3686
|
}
|
|
3406
|
-
if (
|
|
3687
|
+
if (a2 === b || a2.startsWith(b) || b.startsWith(a2)) {
|
|
3407
3688
|
return true;
|
|
3408
3689
|
}
|
|
3409
3690
|
}
|
|
@@ -3418,8 +3699,8 @@ var require_parse2 = __commonJS({
|
|
|
3418
3699
|
let paren = 0;
|
|
3419
3700
|
let quote = 0;
|
|
3420
3701
|
let escaped = false;
|
|
3421
|
-
for (let
|
|
3422
|
-
const ch = pattern[
|
|
3702
|
+
for (let i2 = 1; i2 < pattern.length; i2++) {
|
|
3703
|
+
const ch = pattern[i2];
|
|
3423
3704
|
if (escaped === true) {
|
|
3424
3705
|
escaped = false;
|
|
3425
3706
|
continue;
|
|
@@ -3453,13 +3734,13 @@ var require_parse2 = __commonJS({
|
|
|
3453
3734
|
if (ch === ")") {
|
|
3454
3735
|
paren--;
|
|
3455
3736
|
if (paren === 0) {
|
|
3456
|
-
if (requireEnd === true &&
|
|
3737
|
+
if (requireEnd === true && i2 !== pattern.length - 1) {
|
|
3457
3738
|
return;
|
|
3458
3739
|
}
|
|
3459
3740
|
return {
|
|
3460
3741
|
type: pattern[0],
|
|
3461
|
-
body: pattern.slice(2,
|
|
3462
|
-
end:
|
|
3742
|
+
body: pattern.slice(2, i2),
|
|
3743
|
+
end: i2
|
|
3463
3744
|
};
|
|
3464
3745
|
}
|
|
3465
3746
|
}
|
|
@@ -3591,7 +3872,7 @@ var require_parse2 = __commonJS({
|
|
|
3591
3872
|
let prev = bos;
|
|
3592
3873
|
let value;
|
|
3593
3874
|
const eos = () => state.index === len - 1;
|
|
3594
|
-
const peek = state.peek = (
|
|
3875
|
+
const peek = state.peek = (n3 = 1) => input[state.index + n3];
|
|
3595
3876
|
const advance = state.advance = () => input[++state.index] || "";
|
|
3596
3877
|
const remaining = () => input.slice(state.index + 1);
|
|
3597
3878
|
const consume = (value2 = "", num = 0) => {
|
|
@@ -3672,10 +3953,10 @@ var require_parse2 = __commonJS({
|
|
|
3672
3953
|
open.type = "text";
|
|
3673
3954
|
open.value = literal;
|
|
3674
3955
|
open.output = safeOutput || utils.escapeRegex(literal);
|
|
3675
|
-
for (let
|
|
3676
|
-
tokens[
|
|
3677
|
-
tokens[
|
|
3678
|
-
delete tokens[
|
|
3956
|
+
for (let i2 = token.tokensIndex + 1; i2 < tokens.length; i2++) {
|
|
3957
|
+
tokens[i2].value = "";
|
|
3958
|
+
tokens[i2].output = "";
|
|
3959
|
+
delete tokens[i2].suffix;
|
|
3679
3960
|
}
|
|
3680
3961
|
state.output = token.output + open.output;
|
|
3681
3962
|
state.backtrack = true;
|
|
@@ -3918,13 +4199,13 @@ var require_parse2 = __commonJS({
|
|
|
3918
4199
|
if (brace.dots === true) {
|
|
3919
4200
|
const arr = tokens.slice();
|
|
3920
4201
|
const range = [];
|
|
3921
|
-
for (let
|
|
4202
|
+
for (let i2 = arr.length - 1; i2 >= 0; i2--) {
|
|
3922
4203
|
tokens.pop();
|
|
3923
|
-
if (arr[
|
|
4204
|
+
if (arr[i2].type === "brace") {
|
|
3924
4205
|
break;
|
|
3925
4206
|
}
|
|
3926
|
-
if (arr[
|
|
3927
|
-
range.unshift(arr[
|
|
4207
|
+
if (arr[i2].type !== "dots") {
|
|
4208
|
+
range.unshift(arr[i2].value);
|
|
3928
4209
|
}
|
|
3929
4210
|
}
|
|
3930
4211
|
output = expandRange(range, opts);
|
|
@@ -4383,7 +4664,7 @@ var require_picomatch = __commonJS({
|
|
|
4383
4664
|
};
|
|
4384
4665
|
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
4385
4666
|
picomatch.parse = (pattern, options) => {
|
|
4386
|
-
if (Array.isArray(pattern)) return pattern.map((
|
|
4667
|
+
if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
|
|
4387
4668
|
return parse2(pattern, { ...options, fastpaths: false });
|
|
4388
4669
|
};
|
|
4389
4670
|
picomatch.scan = (input, options) => scan(input, options);
|
|
@@ -4467,8 +4748,8 @@ var require_micromatch = __commonJS({
|
|
|
4467
4748
|
options.onResult(state);
|
|
4468
4749
|
}
|
|
4469
4750
|
};
|
|
4470
|
-
for (let
|
|
4471
|
-
let isMatch = picomatch(String(patterns[
|
|
4751
|
+
for (let i2 = 0; i2 < patterns.length; i2++) {
|
|
4752
|
+
let isMatch = picomatch(String(patterns[i2]), { ...options, onResult }, true);
|
|
4472
4753
|
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
|
|
4473
4754
|
if (negated) negatives++;
|
|
4474
4755
|
for (let item of list) {
|
|
@@ -4490,7 +4771,7 @@ var require_micromatch = __commonJS({
|
|
|
4490
4771
|
throw new Error(`No matches found for "${patterns.join(", ")}"`);
|
|
4491
4772
|
}
|
|
4492
4773
|
if (options.nonull === true || options.nullglob === true) {
|
|
4493
|
-
return options.unescape ? patterns.map((
|
|
4774
|
+
return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
|
|
4494
4775
|
}
|
|
4495
4776
|
}
|
|
4496
4777
|
return matches;
|
|
@@ -4520,7 +4801,7 @@ var require_micromatch = __commonJS({
|
|
|
4520
4801
|
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
4521
4802
|
}
|
|
4522
4803
|
if (Array.isArray(pattern)) {
|
|
4523
|
-
return pattern.some((
|
|
4804
|
+
return pattern.some((p) => micromatch.contains(str, p, options));
|
|
4524
4805
|
}
|
|
4525
4806
|
if (typeof pattern === "string") {
|
|
4526
4807
|
if (isEmptyString(str) || isEmptyString(pattern)) {
|
|
@@ -4565,7 +4846,7 @@ var require_micromatch = __commonJS({
|
|
|
4565
4846
|
if (typeof str !== "string") {
|
|
4566
4847
|
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
4567
4848
|
}
|
|
4568
|
-
return [].concat(patterns).every((
|
|
4849
|
+
return [].concat(patterns).every((p) => picomatch(p, options)(str));
|
|
4569
4850
|
};
|
|
4570
4851
|
micromatch.capture = (glob2, input, options) => {
|
|
4571
4852
|
let posix = utils.isWindows(options);
|
|
@@ -4716,7 +4997,7 @@ var require_pattern = __commonJS({
|
|
|
4716
4997
|
exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
|
4717
4998
|
function expandBraceExpansion(pattern) {
|
|
4718
4999
|
const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });
|
|
4719
|
-
patterns.sort((
|
|
5000
|
+
patterns.sort((a2, b) => a2.length - b.length);
|
|
4720
5001
|
return patterns.filter((pattern2) => pattern2 !== "");
|
|
4721
5002
|
}
|
|
4722
5003
|
exports.expandBraceExpansion = expandBraceExpansion;
|
|
@@ -4797,8 +5078,8 @@ var require_merge2 = __commonJS({
|
|
|
4797
5078
|
}
|
|
4798
5079
|
const mergedStream = PassThrough(options);
|
|
4799
5080
|
function addStream() {
|
|
4800
|
-
for (let
|
|
4801
|
-
streamsQueue.push(pauseStreams(arguments[
|
|
5081
|
+
for (let i2 = 0, len = arguments.length; i2 < len; i2++) {
|
|
5082
|
+
streamsQueue.push(pauseStreams(arguments[i2], options));
|
|
4802
5083
|
}
|
|
4803
5084
|
mergeStream();
|
|
4804
5085
|
return this;
|
|
@@ -4847,8 +5128,8 @@ var require_merge2 = __commonJS({
|
|
|
4847
5128
|
stream.pipe(mergedStream, { end: false });
|
|
4848
5129
|
stream.resume();
|
|
4849
5130
|
}
|
|
4850
|
-
for (let
|
|
4851
|
-
pipe(streams[
|
|
5131
|
+
for (let i2 = 0; i2 < streams.length; i2++) {
|
|
5132
|
+
pipe(streams[i2]);
|
|
4852
5133
|
}
|
|
4853
5134
|
next();
|
|
4854
5135
|
}
|
|
@@ -4879,8 +5160,8 @@ var require_merge2 = __commonJS({
|
|
|
4879
5160
|
}
|
|
4880
5161
|
streams.pause();
|
|
4881
5162
|
} else {
|
|
4882
|
-
for (let
|
|
4883
|
-
streams[
|
|
5163
|
+
for (let i2 = 0, len = streams.length; i2 < len; i2++) {
|
|
5164
|
+
streams[i2] = pauseStreams(streams[i2], options);
|
|
4884
5165
|
}
|
|
4885
5166
|
}
|
|
4886
5167
|
return streams;
|
|
@@ -4962,13 +5243,13 @@ var require_tasks = __commonJS({
|
|
|
4962
5243
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4963
5244
|
exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
|
|
4964
5245
|
var utils = require_utils3();
|
|
4965
|
-
function generate(input,
|
|
4966
|
-
const patterns = processPatterns(input,
|
|
4967
|
-
const ignore = processPatterns(
|
|
5246
|
+
function generate(input, settings2) {
|
|
5247
|
+
const patterns = processPatterns(input, settings2);
|
|
5248
|
+
const ignore = processPatterns(settings2.ignore, settings2);
|
|
4968
5249
|
const positivePatterns = getPositivePatterns(patterns);
|
|
4969
5250
|
const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
|
|
4970
|
-
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern,
|
|
4971
|
-
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern,
|
|
5251
|
+
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings2));
|
|
5252
|
+
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings2));
|
|
4972
5253
|
const staticTasks = convertPatternsToTasks(
|
|
4973
5254
|
staticPatterns,
|
|
4974
5255
|
negativePatterns,
|
|
@@ -4984,12 +5265,12 @@ var require_tasks = __commonJS({
|
|
|
4984
5265
|
return staticTasks.concat(dynamicTasks);
|
|
4985
5266
|
}
|
|
4986
5267
|
exports.generate = generate;
|
|
4987
|
-
function processPatterns(input,
|
|
5268
|
+
function processPatterns(input, settings2) {
|
|
4988
5269
|
let patterns = input;
|
|
4989
|
-
if (
|
|
5270
|
+
if (settings2.braceExpansion) {
|
|
4990
5271
|
patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);
|
|
4991
5272
|
}
|
|
4992
|
-
if (
|
|
5273
|
+
if (settings2.baseNameMatch) {
|
|
4993
5274
|
patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`);
|
|
4994
5275
|
}
|
|
4995
5276
|
return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));
|
|
@@ -5020,7 +5301,7 @@ var require_tasks = __commonJS({
|
|
|
5020
5301
|
}
|
|
5021
5302
|
exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
|
|
5022
5303
|
function groupPatternsByBaseDirectory(patterns) {
|
|
5023
|
-
const
|
|
5304
|
+
const group2 = {};
|
|
5024
5305
|
return patterns.reduce((collection, pattern) => {
|
|
5025
5306
|
const base = utils.pattern.getBaseDirectory(pattern);
|
|
5026
5307
|
if (base in collection) {
|
|
@@ -5029,7 +5310,7 @@ var require_tasks = __commonJS({
|
|
|
5029
5310
|
collection[base] = [pattern];
|
|
5030
5311
|
}
|
|
5031
5312
|
return collection;
|
|
5032
|
-
},
|
|
5313
|
+
}, group2);
|
|
5033
5314
|
}
|
|
5034
5315
|
exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
|
|
5035
5316
|
function convertPatternGroupsToTasks(positive, negative, dynamic) {
|
|
@@ -5058,26 +5339,26 @@ var require_async = __commonJS({
|
|
|
5058
5339
|
init_utils2();
|
|
5059
5340
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5060
5341
|
exports.read = void 0;
|
|
5061
|
-
function read2(path,
|
|
5062
|
-
|
|
5342
|
+
function read2(path, settings2, callback) {
|
|
5343
|
+
settings2.fs.lstat(path, (lstatError, lstat) => {
|
|
5063
5344
|
if (lstatError !== null) {
|
|
5064
5345
|
callFailureCallback(callback, lstatError);
|
|
5065
5346
|
return;
|
|
5066
5347
|
}
|
|
5067
|
-
if (!lstat.isSymbolicLink() || !
|
|
5348
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
5068
5349
|
callSuccessCallback(callback, lstat);
|
|
5069
5350
|
return;
|
|
5070
5351
|
}
|
|
5071
|
-
|
|
5352
|
+
settings2.fs.stat(path, (statError, stat) => {
|
|
5072
5353
|
if (statError !== null) {
|
|
5073
|
-
if (
|
|
5354
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5074
5355
|
callFailureCallback(callback, statError);
|
|
5075
5356
|
return;
|
|
5076
5357
|
}
|
|
5077
5358
|
callSuccessCallback(callback, lstat);
|
|
5078
5359
|
return;
|
|
5079
5360
|
}
|
|
5080
|
-
if (
|
|
5361
|
+
if (settings2.markSymbolicLink) {
|
|
5081
5362
|
stat.isSymbolicLink = () => true;
|
|
5082
5363
|
}
|
|
5083
5364
|
callSuccessCallback(callback, stat);
|
|
@@ -5101,19 +5382,19 @@ var require_sync = __commonJS({
|
|
|
5101
5382
|
init_utils2();
|
|
5102
5383
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5103
5384
|
exports.read = void 0;
|
|
5104
|
-
function read2(path,
|
|
5105
|
-
const lstat =
|
|
5106
|
-
if (!lstat.isSymbolicLink() || !
|
|
5385
|
+
function read2(path, settings2) {
|
|
5386
|
+
const lstat = settings2.fs.lstatSync(path);
|
|
5387
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
5107
5388
|
return lstat;
|
|
5108
5389
|
}
|
|
5109
5390
|
try {
|
|
5110
|
-
const stat =
|
|
5111
|
-
if (
|
|
5391
|
+
const stat = settings2.fs.statSync(path);
|
|
5392
|
+
if (settings2.markSymbolicLink) {
|
|
5112
5393
|
stat.isSymbolicLink = () => true;
|
|
5113
5394
|
}
|
|
5114
5395
|
return stat;
|
|
5115
5396
|
} catch (error2) {
|
|
5116
|
-
if (!
|
|
5397
|
+
if (!settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5117
5398
|
return lstat;
|
|
5118
5399
|
}
|
|
5119
5400
|
throw error2;
|
|
@@ -5190,8 +5471,8 @@ var require_out = __commonJS({
|
|
|
5190
5471
|
}
|
|
5191
5472
|
exports.stat = stat;
|
|
5192
5473
|
function statSync3(path, optionsOrSettings) {
|
|
5193
|
-
const
|
|
5194
|
-
return sync.read(path,
|
|
5474
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5475
|
+
return sync.read(path, settings2);
|
|
5195
5476
|
}
|
|
5196
5477
|
exports.statSync = statSync3;
|
|
5197
5478
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -5239,8 +5520,8 @@ var require_run_parallel = __commonJS({
|
|
|
5239
5520
|
if (isSync) queueMicrotask2(end);
|
|
5240
5521
|
else end();
|
|
5241
5522
|
}
|
|
5242
|
-
function each(
|
|
5243
|
-
results[
|
|
5523
|
+
function each(i2, err, result) {
|
|
5524
|
+
results[i2] = result;
|
|
5244
5525
|
if (--pending === 0 || err) {
|
|
5245
5526
|
done(err);
|
|
5246
5527
|
}
|
|
@@ -5254,9 +5535,9 @@ var require_run_parallel = __commonJS({
|
|
|
5254
5535
|
});
|
|
5255
5536
|
});
|
|
5256
5537
|
} else {
|
|
5257
|
-
tasks.forEach(function(task,
|
|
5538
|
+
tasks.forEach(function(task, i2) {
|
|
5258
5539
|
task(function(err, result) {
|
|
5259
|
-
each(
|
|
5540
|
+
each(i2, err, result);
|
|
5260
5541
|
});
|
|
5261
5542
|
});
|
|
5262
5543
|
}
|
|
@@ -5331,11 +5612,11 @@ var require_common = __commonJS({
|
|
|
5331
5612
|
init_utils2();
|
|
5332
5613
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5333
5614
|
exports.joinPathSegments = void 0;
|
|
5334
|
-
function joinPathSegments(
|
|
5335
|
-
if (
|
|
5336
|
-
return
|
|
5615
|
+
function joinPathSegments(a2, b, separator) {
|
|
5616
|
+
if (a2.endsWith(separator)) {
|
|
5617
|
+
return a2 + b;
|
|
5337
5618
|
}
|
|
5338
|
-
return
|
|
5619
|
+
return a2 + separator + b;
|
|
5339
5620
|
}
|
|
5340
5621
|
exports.joinPathSegments = joinPathSegments;
|
|
5341
5622
|
}
|
|
@@ -5353,16 +5634,16 @@ var require_async2 = __commonJS({
|
|
|
5353
5634
|
var constants_1 = require_constants3();
|
|
5354
5635
|
var utils = require_utils4();
|
|
5355
5636
|
var common = require_common();
|
|
5356
|
-
function read2(directory,
|
|
5357
|
-
if (!
|
|
5358
|
-
readdirWithFileTypes(directory,
|
|
5637
|
+
function read2(directory, settings2, callback) {
|
|
5638
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
5639
|
+
readdirWithFileTypes(directory, settings2, callback);
|
|
5359
5640
|
return;
|
|
5360
5641
|
}
|
|
5361
|
-
readdir2(directory,
|
|
5642
|
+
readdir2(directory, settings2, callback);
|
|
5362
5643
|
}
|
|
5363
5644
|
exports.read = read2;
|
|
5364
|
-
function readdirWithFileTypes(directory,
|
|
5365
|
-
|
|
5645
|
+
function readdirWithFileTypes(directory, settings2, callback) {
|
|
5646
|
+
settings2.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
|
|
5366
5647
|
if (readdirError !== null) {
|
|
5367
5648
|
callFailureCallback(callback, readdirError);
|
|
5368
5649
|
return;
|
|
@@ -5370,13 +5651,13 @@ var require_async2 = __commonJS({
|
|
|
5370
5651
|
const entries = dirents.map((dirent) => ({
|
|
5371
5652
|
dirent,
|
|
5372
5653
|
name: dirent.name,
|
|
5373
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
5654
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
5374
5655
|
}));
|
|
5375
|
-
if (!
|
|
5656
|
+
if (!settings2.followSymbolicLinks) {
|
|
5376
5657
|
callSuccessCallback(callback, entries);
|
|
5377
5658
|
return;
|
|
5378
5659
|
}
|
|
5379
|
-
const tasks = entries.map((entry) => makeRplTaskEntry(entry,
|
|
5660
|
+
const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings2));
|
|
5380
5661
|
rpl(tasks, (rplError, rplEntries) => {
|
|
5381
5662
|
if (rplError !== null) {
|
|
5382
5663
|
callFailureCallback(callback, rplError);
|
|
@@ -5387,15 +5668,15 @@ var require_async2 = __commonJS({
|
|
|
5387
5668
|
});
|
|
5388
5669
|
}
|
|
5389
5670
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
5390
|
-
function makeRplTaskEntry(entry,
|
|
5671
|
+
function makeRplTaskEntry(entry, settings2) {
|
|
5391
5672
|
return (done) => {
|
|
5392
5673
|
if (!entry.dirent.isSymbolicLink()) {
|
|
5393
5674
|
done(null, entry);
|
|
5394
5675
|
return;
|
|
5395
5676
|
}
|
|
5396
|
-
|
|
5677
|
+
settings2.fs.stat(entry.path, (statError, stats) => {
|
|
5397
5678
|
if (statError !== null) {
|
|
5398
|
-
if (
|
|
5679
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5399
5680
|
done(statError);
|
|
5400
5681
|
return;
|
|
5401
5682
|
}
|
|
@@ -5407,16 +5688,16 @@ var require_async2 = __commonJS({
|
|
|
5407
5688
|
});
|
|
5408
5689
|
};
|
|
5409
5690
|
}
|
|
5410
|
-
function readdir2(directory,
|
|
5411
|
-
|
|
5691
|
+
function readdir2(directory, settings2, callback) {
|
|
5692
|
+
settings2.fs.readdir(directory, (readdirError, names) => {
|
|
5412
5693
|
if (readdirError !== null) {
|
|
5413
5694
|
callFailureCallback(callback, readdirError);
|
|
5414
5695
|
return;
|
|
5415
5696
|
}
|
|
5416
5697
|
const tasks = names.map((name) => {
|
|
5417
|
-
const path = common.joinPathSegments(directory, name,
|
|
5698
|
+
const path = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
5418
5699
|
return (done) => {
|
|
5419
|
-
fsStat.stat(path,
|
|
5700
|
+
fsStat.stat(path, settings2.fsStatSettings, (error2, stats) => {
|
|
5420
5701
|
if (error2 !== null) {
|
|
5421
5702
|
done(error2);
|
|
5422
5703
|
return;
|
|
@@ -5426,7 +5707,7 @@ var require_async2 = __commonJS({
|
|
|
5426
5707
|
path,
|
|
5427
5708
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
5428
5709
|
};
|
|
5429
|
-
if (
|
|
5710
|
+
if (settings2.stats) {
|
|
5430
5711
|
entry.stats = stats;
|
|
5431
5712
|
}
|
|
5432
5713
|
done(null, entry);
|
|
@@ -5463,27 +5744,27 @@ var require_sync2 = __commonJS({
|
|
|
5463
5744
|
var constants_1 = require_constants3();
|
|
5464
5745
|
var utils = require_utils4();
|
|
5465
5746
|
var common = require_common();
|
|
5466
|
-
function read2(directory,
|
|
5467
|
-
if (!
|
|
5468
|
-
return readdirWithFileTypes(directory,
|
|
5747
|
+
function read2(directory, settings2) {
|
|
5748
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
5749
|
+
return readdirWithFileTypes(directory, settings2);
|
|
5469
5750
|
}
|
|
5470
|
-
return readdir2(directory,
|
|
5751
|
+
return readdir2(directory, settings2);
|
|
5471
5752
|
}
|
|
5472
5753
|
exports.read = read2;
|
|
5473
|
-
function readdirWithFileTypes(directory,
|
|
5474
|
-
const dirents =
|
|
5754
|
+
function readdirWithFileTypes(directory, settings2) {
|
|
5755
|
+
const dirents = settings2.fs.readdirSync(directory, { withFileTypes: true });
|
|
5475
5756
|
return dirents.map((dirent) => {
|
|
5476
5757
|
const entry = {
|
|
5477
5758
|
dirent,
|
|
5478
5759
|
name: dirent.name,
|
|
5479
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
5760
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
5480
5761
|
};
|
|
5481
|
-
if (entry.dirent.isSymbolicLink() &&
|
|
5762
|
+
if (entry.dirent.isSymbolicLink() && settings2.followSymbolicLinks) {
|
|
5482
5763
|
try {
|
|
5483
|
-
const stats =
|
|
5764
|
+
const stats = settings2.fs.statSync(entry.path);
|
|
5484
5765
|
entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
|
5485
5766
|
} catch (error2) {
|
|
5486
|
-
if (
|
|
5767
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5487
5768
|
throw error2;
|
|
5488
5769
|
}
|
|
5489
5770
|
}
|
|
@@ -5492,17 +5773,17 @@ var require_sync2 = __commonJS({
|
|
|
5492
5773
|
});
|
|
5493
5774
|
}
|
|
5494
5775
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
5495
|
-
function readdir2(directory,
|
|
5496
|
-
const names =
|
|
5776
|
+
function readdir2(directory, settings2) {
|
|
5777
|
+
const names = settings2.fs.readdirSync(directory);
|
|
5497
5778
|
return names.map((name) => {
|
|
5498
|
-
const entryPath = common.joinPathSegments(directory, name,
|
|
5499
|
-
const stats = fsStat.statSync(entryPath,
|
|
5779
|
+
const entryPath = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
5780
|
+
const stats = fsStat.statSync(entryPath, settings2.fsStatSettings);
|
|
5500
5781
|
const entry = {
|
|
5501
5782
|
name,
|
|
5502
5783
|
path: entryPath,
|
|
5503
5784
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
5504
5785
|
};
|
|
5505
|
-
if (
|
|
5786
|
+
if (settings2.stats) {
|
|
5506
5787
|
entry.stats = stats;
|
|
5507
5788
|
}
|
|
5508
5789
|
return entry;
|
|
@@ -5589,8 +5870,8 @@ var require_out2 = __commonJS({
|
|
|
5589
5870
|
}
|
|
5590
5871
|
exports.scandir = scandir;
|
|
5591
5872
|
function scandirSync(path, optionsOrSettings) {
|
|
5592
|
-
const
|
|
5593
|
-
return sync.read(path,
|
|
5873
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5874
|
+
return sync.read(path, settings2);
|
|
5594
5875
|
}
|
|
5595
5876
|
exports.scandirSync = scandirSync;
|
|
5596
5877
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -5634,9 +5915,9 @@ var require_reusify = __commonJS({
|
|
|
5634
5915
|
}
|
|
5635
5916
|
});
|
|
5636
5917
|
|
|
5637
|
-
// node_modules/.bun/fastq@1.20.
|
|
5918
|
+
// node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js
|
|
5638
5919
|
var require_queue = __commonJS({
|
|
5639
|
-
"node_modules/.bun/fastq@1.20.
|
|
5920
|
+
"node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js"(exports, module) {
|
|
5640
5921
|
"use strict";
|
|
5641
5922
|
init_utils2();
|
|
5642
5923
|
var reusify = require_reusify();
|
|
@@ -5816,11 +6097,12 @@ var require_queue = __commonJS({
|
|
|
5816
6097
|
current.value = null;
|
|
5817
6098
|
current.callback = noop;
|
|
5818
6099
|
current.errorHandler = null;
|
|
6100
|
+
current.next = null;
|
|
5819
6101
|
if (errorHandler2) {
|
|
5820
6102
|
errorHandler2(new Error("abort"), val);
|
|
5821
6103
|
}
|
|
5822
6104
|
callback.call(context2, new Error("abort"));
|
|
5823
|
-
|
|
6105
|
+
cache.release(current);
|
|
5824
6106
|
current = next;
|
|
5825
6107
|
}
|
|
5826
6108
|
self.drain = noop;
|
|
@@ -5871,7 +6153,7 @@ var require_queue = __commonJS({
|
|
|
5871
6153
|
queue.drained = drained;
|
|
5872
6154
|
return queue;
|
|
5873
6155
|
function push(value) {
|
|
5874
|
-
var
|
|
6156
|
+
var p = new Promise(function(resolve4, reject) {
|
|
5875
6157
|
pushCb(value, function(err, result) {
|
|
5876
6158
|
if (err) {
|
|
5877
6159
|
reject(err);
|
|
@@ -5880,11 +6162,11 @@ var require_queue = __commonJS({
|
|
|
5880
6162
|
resolve4(result);
|
|
5881
6163
|
});
|
|
5882
6164
|
});
|
|
5883
|
-
|
|
5884
|
-
return
|
|
6165
|
+
p.catch(noop);
|
|
6166
|
+
return p;
|
|
5885
6167
|
}
|
|
5886
6168
|
function unshift(value) {
|
|
5887
|
-
var
|
|
6169
|
+
var p = new Promise(function(resolve4, reject) {
|
|
5888
6170
|
unshiftCb(value, function(err, result) {
|
|
5889
6171
|
if (err) {
|
|
5890
6172
|
reject(err);
|
|
@@ -5893,11 +6175,11 @@ var require_queue = __commonJS({
|
|
|
5893
6175
|
resolve4(result);
|
|
5894
6176
|
});
|
|
5895
6177
|
});
|
|
5896
|
-
|
|
5897
|
-
return
|
|
6178
|
+
p.catch(noop);
|
|
6179
|
+
return p;
|
|
5898
6180
|
}
|
|
5899
6181
|
function drained() {
|
|
5900
|
-
var
|
|
6182
|
+
var p = new Promise(function(resolve4) {
|
|
5901
6183
|
process.nextTick(function() {
|
|
5902
6184
|
if (queue.idle()) {
|
|
5903
6185
|
resolve4();
|
|
@@ -5911,7 +6193,7 @@ var require_queue = __commonJS({
|
|
|
5911
6193
|
}
|
|
5912
6194
|
});
|
|
5913
6195
|
});
|
|
5914
|
-
return
|
|
6196
|
+
return p;
|
|
5915
6197
|
}
|
|
5916
6198
|
}
|
|
5917
6199
|
module.exports = fastqueue;
|
|
@@ -5926,11 +6208,11 @@ var require_common2 = __commonJS({
|
|
|
5926
6208
|
init_utils2();
|
|
5927
6209
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5928
6210
|
exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
|
|
5929
|
-
function isFatalError(
|
|
5930
|
-
if (
|
|
6211
|
+
function isFatalError(settings2, error2) {
|
|
6212
|
+
if (settings2.errorFilter === null) {
|
|
5931
6213
|
return true;
|
|
5932
6214
|
}
|
|
5933
|
-
return !
|
|
6215
|
+
return !settings2.errorFilter(error2);
|
|
5934
6216
|
}
|
|
5935
6217
|
exports.isFatalError = isFatalError;
|
|
5936
6218
|
function isAppliedFilter(filter, value) {
|
|
@@ -5941,14 +6223,14 @@ var require_common2 = __commonJS({
|
|
|
5941
6223
|
return filepath.split(/[/\\]/).join(separator);
|
|
5942
6224
|
}
|
|
5943
6225
|
exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
|
|
5944
|
-
function joinPathSegments(
|
|
5945
|
-
if (
|
|
6226
|
+
function joinPathSegments(a2, b, separator) {
|
|
6227
|
+
if (a2 === "") {
|
|
5946
6228
|
return b;
|
|
5947
6229
|
}
|
|
5948
|
-
if (
|
|
5949
|
-
return
|
|
6230
|
+
if (a2.endsWith(separator)) {
|
|
6231
|
+
return a2 + b;
|
|
5950
6232
|
}
|
|
5951
|
-
return
|
|
6233
|
+
return a2 + separator + b;
|
|
5952
6234
|
}
|
|
5953
6235
|
exports.joinPathSegments = joinPathSegments;
|
|
5954
6236
|
}
|
|
@@ -6295,14 +6577,14 @@ var require_out3 = __commonJS({
|
|
|
6295
6577
|
}
|
|
6296
6578
|
exports.walk = walk;
|
|
6297
6579
|
function walkSync(directory, optionsOrSettings) {
|
|
6298
|
-
const
|
|
6299
|
-
const provider = new sync_1.default(directory,
|
|
6580
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
6581
|
+
const provider = new sync_1.default(directory, settings2);
|
|
6300
6582
|
return provider.read();
|
|
6301
6583
|
}
|
|
6302
6584
|
exports.walkSync = walkSync;
|
|
6303
6585
|
function walkStream(directory, optionsOrSettings) {
|
|
6304
|
-
const
|
|
6305
|
-
const provider = new stream_1.default(directory,
|
|
6586
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
6587
|
+
const provider = new stream_1.default(directory, settings2);
|
|
6306
6588
|
return provider.read();
|
|
6307
6589
|
}
|
|
6308
6590
|
exports.walkStream = walkStream;
|
|
@@ -6388,8 +6670,8 @@ var require_stream3 = __commonJS({
|
|
|
6388
6670
|
done();
|
|
6389
6671
|
}).catch(done);
|
|
6390
6672
|
};
|
|
6391
|
-
for (let
|
|
6392
|
-
stream.write(
|
|
6673
|
+
for (let i2 = 0; i2 < filepaths.length; i2++) {
|
|
6674
|
+
stream.write(i2);
|
|
6393
6675
|
}
|
|
6394
6676
|
return stream;
|
|
6395
6677
|
}
|
|
@@ -7050,14 +7332,14 @@ var require_out4 = __commonJS({
|
|
|
7050
7332
|
function generateTasks(source, options) {
|
|
7051
7333
|
assertPatternsInput(source);
|
|
7052
7334
|
const patterns = [].concat(source);
|
|
7053
|
-
const
|
|
7054
|
-
return taskManager.generate(patterns,
|
|
7335
|
+
const settings2 = new settings_1.default(options);
|
|
7336
|
+
return taskManager.generate(patterns, settings2);
|
|
7055
7337
|
}
|
|
7056
7338
|
FastGlob2.generateTasks = generateTasks;
|
|
7057
7339
|
function isDynamicPattern(source, options) {
|
|
7058
7340
|
assertPatternsInput(source);
|
|
7059
|
-
const
|
|
7060
|
-
return utils.pattern.isDynamicPattern(source,
|
|
7341
|
+
const settings2 = new settings_1.default(options);
|
|
7342
|
+
return utils.pattern.isDynamicPattern(source, settings2);
|
|
7061
7343
|
}
|
|
7062
7344
|
FastGlob2.isDynamicPattern = isDynamicPattern;
|
|
7063
7345
|
function escapePath(source) {
|
|
@@ -7099,9 +7381,9 @@ var require_out4 = __commonJS({
|
|
|
7099
7381
|
})(FastGlob || (FastGlob = {}));
|
|
7100
7382
|
function getWorks(source, _Provider, options) {
|
|
7101
7383
|
const patterns = [].concat(source);
|
|
7102
|
-
const
|
|
7103
|
-
const tasks = taskManager.generate(patterns,
|
|
7104
|
-
const provider = new _Provider(
|
|
7384
|
+
const settings2 = new settings_1.default(options);
|
|
7385
|
+
const tasks = taskManager.generate(patterns, settings2);
|
|
7386
|
+
const provider = new _Provider(settings2);
|
|
7105
7387
|
return tasks.map(provider.read, provider);
|
|
7106
7388
|
}
|
|
7107
7389
|
function assertPatternsInput(input) {
|
|
@@ -7279,14 +7561,14 @@ import "node:fs";
|
|
|
7279
7561
|
import { createRequire } from "node:module";
|
|
7280
7562
|
import {
|
|
7281
7563
|
resolve,
|
|
7282
|
-
join,
|
|
7283
|
-
dirname,
|
|
7564
|
+
join as join2,
|
|
7565
|
+
dirname as dirname2,
|
|
7284
7566
|
relative,
|
|
7285
7567
|
normalize,
|
|
7286
7568
|
sep,
|
|
7287
7569
|
extname
|
|
7288
7570
|
} from "node:path";
|
|
7289
|
-
import "node:url";
|
|
7571
|
+
import { fileURLToPath } from "node:url";
|
|
7290
7572
|
function safeExecuteAsync(fn, message) {
|
|
7291
7573
|
return fn().catch((error2) => {
|
|
7292
7574
|
throw new Error(
|
|
@@ -7294,7 +7576,7 @@ function safeExecuteAsync(fn, message) {
|
|
|
7294
7576
|
);
|
|
7295
7577
|
});
|
|
7296
7578
|
}
|
|
7297
|
-
var import_fast_glob, constants,
|
|
7579
|
+
var import_fast_glob, constants, log3, PACKAGE_PATHS, PathResolver;
|
|
7298
7580
|
var init_PathResolver = __esm({
|
|
7299
7581
|
"packages/core/config/utils/PathResolver.ts"() {
|
|
7300
7582
|
"use strict";
|
|
@@ -7307,7 +7589,7 @@ var init_PathResolver = __esm({
|
|
|
7307
7589
|
getPatternsFor: getPatternsFor || void 0,
|
|
7308
7590
|
I18N_PATHS: I18N_PATHS || void 0
|
|
7309
7591
|
};
|
|
7310
|
-
|
|
7592
|
+
log3 = {
|
|
7311
7593
|
error: (message, error2) => {
|
|
7312
7594
|
},
|
|
7313
7595
|
warn: (message, error2) => {
|
|
@@ -7343,6 +7625,7 @@ var init_PathResolver = __esm({
|
|
|
7343
7625
|
options;
|
|
7344
7626
|
_repoRoot;
|
|
7345
7627
|
_appRoot = null;
|
|
7628
|
+
_writtenPaths = null;
|
|
7346
7629
|
/**
|
|
7347
7630
|
* Get or create singleton instance
|
|
7348
7631
|
* @param options - Configuration options
|
|
@@ -7428,7 +7711,7 @@ var init_PathResolver = __esm({
|
|
|
7428
7711
|
*/
|
|
7429
7712
|
getDirname(path) {
|
|
7430
7713
|
if (!path) return "";
|
|
7431
|
-
return this.normalizePath(
|
|
7714
|
+
return this.normalizePath(dirname2(path));
|
|
7432
7715
|
}
|
|
7433
7716
|
/**
|
|
7434
7717
|
* Resolve package path using Node's module resolution
|
|
@@ -7440,7 +7723,7 @@ var init_PathResolver = __esm({
|
|
|
7440
7723
|
resolvePackage(packageSpecifier, fromPath = null) {
|
|
7441
7724
|
try {
|
|
7442
7725
|
const basePath = fromPath || this.getAppRoot();
|
|
7443
|
-
const require3 = createRequire(
|
|
7726
|
+
const require3 = createRequire(join2(basePath, "package.json"));
|
|
7444
7727
|
const resolved = require3.resolve(packageSpecifier);
|
|
7445
7728
|
return this.normalizePath(resolved);
|
|
7446
7729
|
} catch (error2) {
|
|
@@ -7592,7 +7875,7 @@ var init_PathResolver = __esm({
|
|
|
7592
7875
|
return cleanContent;
|
|
7593
7876
|
} catch (error2) {
|
|
7594
7877
|
if (this.options.debug) {
|
|
7595
|
-
|
|
7878
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
7596
7879
|
}
|
|
7597
7880
|
return null;
|
|
7598
7881
|
}
|
|
@@ -7620,7 +7903,7 @@ var init_PathResolver = __esm({
|
|
|
7620
7903
|
return cleanContent;
|
|
7621
7904
|
} catch (error2) {
|
|
7622
7905
|
if (this.options.debug) {
|
|
7623
|
-
|
|
7906
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
7624
7907
|
}
|
|
7625
7908
|
return null;
|
|
7626
7909
|
}
|
|
@@ -7642,16 +7925,16 @@ var init_PathResolver = __esm({
|
|
|
7642
7925
|
verbose = false
|
|
7643
7926
|
} = options;
|
|
7644
7927
|
const normalizedPath = this.normalizePath(filePath);
|
|
7645
|
-
const dir = this.normalizePath(
|
|
7928
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
7646
7929
|
const fileExists = this.pathExists(normalizedPath);
|
|
7647
7930
|
if (fileExists && !overwrite) {
|
|
7648
7931
|
if (verbose) {
|
|
7649
|
-
|
|
7932
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
7650
7933
|
}
|
|
7651
7934
|
return false;
|
|
7652
7935
|
}
|
|
7653
7936
|
if (dryRun) {
|
|
7654
|
-
|
|
7937
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
7655
7938
|
return true;
|
|
7656
7939
|
}
|
|
7657
7940
|
try {
|
|
@@ -7661,22 +7944,23 @@ var init_PathResolver = __esm({
|
|
|
7661
7944
|
}
|
|
7662
7945
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
7663
7946
|
let writeContent;
|
|
7664
|
-
if (
|
|
7947
|
+
if (Buffer2.isBuffer(content)) {
|
|
7665
7948
|
writeContent = content;
|
|
7666
7949
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
7667
|
-
writeContent = JSON.stringify(content, null, 2)
|
|
7950
|
+
writeContent = `${JSON.stringify(content, null, 2)}
|
|
7951
|
+
`;
|
|
7668
7952
|
} else {
|
|
7669
7953
|
writeContent = String(content);
|
|
7670
7954
|
}
|
|
7671
7955
|
try {
|
|
7672
7956
|
return await safeExecuteAsync(async () => {
|
|
7673
|
-
if (
|
|
7957
|
+
if (Buffer2.isBuffer(writeContent)) {
|
|
7674
7958
|
await fs.promises.writeFile(normalizedPath, writeContent);
|
|
7675
7959
|
} else {
|
|
7676
7960
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
7677
7961
|
}
|
|
7678
7962
|
if (verbose) {
|
|
7679
|
-
|
|
7963
|
+
log3.info(
|
|
7680
7964
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
7681
7965
|
);
|
|
7682
7966
|
}
|
|
@@ -7703,16 +7987,16 @@ var init_PathResolver = __esm({
|
|
|
7703
7987
|
verbose = false
|
|
7704
7988
|
} = options;
|
|
7705
7989
|
const normalizedPath = this.normalizePath(filePath);
|
|
7706
|
-
const dir = this.normalizePath(
|
|
7990
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
7707
7991
|
const fileExists = this.pathExists(normalizedPath);
|
|
7708
7992
|
if (fileExists && !overwrite) {
|
|
7709
7993
|
if (verbose) {
|
|
7710
|
-
|
|
7994
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
7711
7995
|
}
|
|
7712
7996
|
return false;
|
|
7713
7997
|
}
|
|
7714
7998
|
if (dryRun) {
|
|
7715
|
-
|
|
7999
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
7716
8000
|
return true;
|
|
7717
8001
|
}
|
|
7718
8002
|
try {
|
|
@@ -7722,21 +8006,23 @@ var init_PathResolver = __esm({
|
|
|
7722
8006
|
}
|
|
7723
8007
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
7724
8008
|
let writeContent;
|
|
7725
|
-
if (
|
|
8009
|
+
if (Buffer2.isBuffer(content)) {
|
|
7726
8010
|
writeContent = content;
|
|
7727
8011
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
7728
|
-
writeContent = JSON.stringify(content, null, 2)
|
|
8012
|
+
writeContent = `${JSON.stringify(content, null, 2)}
|
|
8013
|
+
`;
|
|
7729
8014
|
} else {
|
|
7730
8015
|
writeContent = String(content);
|
|
7731
8016
|
}
|
|
7732
8017
|
try {
|
|
7733
|
-
if (
|
|
8018
|
+
if (Buffer2.isBuffer(writeContent)) {
|
|
7734
8019
|
fs.writeFileSync(normalizedPath, writeContent);
|
|
7735
8020
|
} else {
|
|
7736
8021
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
7737
8022
|
}
|
|
8023
|
+
this._writtenPaths?.add(normalizedPath);
|
|
7738
8024
|
if (verbose) {
|
|
7739
|
-
|
|
8025
|
+
log3.info(
|
|
7740
8026
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
7741
8027
|
);
|
|
7742
8028
|
}
|
|
@@ -7761,15 +8047,15 @@ var init_PathResolver = __esm({
|
|
|
7761
8047
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7762
8048
|
if (fileExists && !overwrite) {
|
|
7763
8049
|
if (verbose) {
|
|
7764
|
-
|
|
8050
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7765
8051
|
}
|
|
7766
8052
|
return false;
|
|
7767
8053
|
}
|
|
7768
8054
|
if (dryRun) {
|
|
7769
|
-
|
|
8055
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7770
8056
|
return true;
|
|
7771
8057
|
}
|
|
7772
|
-
const dir = this.normalizePath(
|
|
8058
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7773
8059
|
try {
|
|
7774
8060
|
await fs.promises.mkdir(dir, { recursive: true });
|
|
7775
8061
|
} catch (error2) {
|
|
@@ -7779,7 +8065,7 @@ var init_PathResolver = __esm({
|
|
|
7779
8065
|
return await safeExecuteAsync(async () => {
|
|
7780
8066
|
await fs.promises.copyFile(srcPath, normalizedDestPath);
|
|
7781
8067
|
if (verbose) {
|
|
7782
|
-
|
|
8068
|
+
log3.info(
|
|
7783
8069
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7784
8070
|
);
|
|
7785
8071
|
}
|
|
@@ -7803,15 +8089,15 @@ var init_PathResolver = __esm({
|
|
|
7803
8089
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7804
8090
|
if (fileExists && !overwrite) {
|
|
7805
8091
|
if (verbose) {
|
|
7806
|
-
|
|
8092
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7807
8093
|
}
|
|
7808
8094
|
return false;
|
|
7809
8095
|
}
|
|
7810
8096
|
if (dryRun) {
|
|
7811
|
-
|
|
8097
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7812
8098
|
return true;
|
|
7813
8099
|
}
|
|
7814
|
-
const dir = this.normalizePath(
|
|
8100
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7815
8101
|
try {
|
|
7816
8102
|
fs.mkdirSync(dir, { recursive: true });
|
|
7817
8103
|
} catch (error2) {
|
|
@@ -7819,8 +8105,9 @@ var init_PathResolver = __esm({
|
|
|
7819
8105
|
}
|
|
7820
8106
|
try {
|
|
7821
8107
|
fs.copyFileSync(srcPath, normalizedDestPath);
|
|
8108
|
+
this._writtenPaths?.add(normalizedDestPath);
|
|
7822
8109
|
if (verbose) {
|
|
7823
|
-
|
|
8110
|
+
log3.info(
|
|
7824
8111
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7825
8112
|
);
|
|
7826
8113
|
}
|
|
@@ -7837,7 +8124,7 @@ var init_PathResolver = __esm({
|
|
|
7837
8124
|
return fs.existsSync(filePath);
|
|
7838
8125
|
} catch (error2) {
|
|
7839
8126
|
if (!silent) {
|
|
7840
|
-
|
|
8127
|
+
log3.error(`Error checking path existence: ${filePath}`, error2);
|
|
7841
8128
|
}
|
|
7842
8129
|
return false;
|
|
7843
8130
|
}
|
|
@@ -7863,7 +8150,7 @@ var init_PathResolver = __esm({
|
|
|
7863
8150
|
return fs.readdirSync(dirPath, options);
|
|
7864
8151
|
} catch (error2) {
|
|
7865
8152
|
if (this.options.debug) {
|
|
7866
|
-
|
|
8153
|
+
log3.warn(`Failed to read directory: ${dirPath}`, error2);
|
|
7867
8154
|
}
|
|
7868
8155
|
const isObjectOptions = options && typeof options === "object" && "withFileTypes" in options;
|
|
7869
8156
|
return isObjectOptions && options.withFileTypes ? [] : [];
|
|
@@ -7881,11 +8168,29 @@ var init_PathResolver = __esm({
|
|
|
7881
8168
|
return fs.statSync(filePath);
|
|
7882
8169
|
} catch (error2) {
|
|
7883
8170
|
if (this.options.debug) {
|
|
7884
|
-
|
|
8171
|
+
log3.warn(`Failed to stat file: ${filePath}`, error2);
|
|
7885
8172
|
}
|
|
7886
8173
|
return null;
|
|
7887
8174
|
}
|
|
7888
8175
|
}
|
|
8176
|
+
/**
|
|
8177
|
+
* Resolve the real path of a file, following symlinks
|
|
8178
|
+
* @param filePath - Path to resolve
|
|
8179
|
+
* @returns Resolved real path
|
|
8180
|
+
*/
|
|
8181
|
+
realpathSync(filePath) {
|
|
8182
|
+
return fs.realpathSync(filePath);
|
|
8183
|
+
}
|
|
8184
|
+
/**
|
|
8185
|
+
* Watch a directory for changes
|
|
8186
|
+
* @param dirPath - Directory to watch
|
|
8187
|
+
* @param options - fs.watch options
|
|
8188
|
+
* @param callback - Callback for change events
|
|
8189
|
+
* @returns FSWatcher instance
|
|
8190
|
+
*/
|
|
8191
|
+
watch(dirPath, options, callback) {
|
|
8192
|
+
return fs.watch(dirPath, options, callback);
|
|
8193
|
+
}
|
|
7889
8194
|
/**
|
|
7890
8195
|
* Get file stats synchronously (follows symlinks)
|
|
7891
8196
|
* Returns null if file doesn't exist (graceful degradation)
|
|
@@ -7898,7 +8203,7 @@ var init_PathResolver = __esm({
|
|
|
7898
8203
|
return fs.lstatSync(filePath);
|
|
7899
8204
|
} catch (error2) {
|
|
7900
8205
|
if (this.options.debug) {
|
|
7901
|
-
|
|
8206
|
+
log3.warn(`Failed to lstat file: ${filePath}`, error2);
|
|
7902
8207
|
}
|
|
7903
8208
|
return null;
|
|
7904
8209
|
}
|
|
@@ -7965,6 +8270,28 @@ var init_PathResolver = __esm({
|
|
|
7965
8270
|
* Get app root (where vite.config.ts is, Vite's config.root)
|
|
7966
8271
|
* Falls back to repoRoot if not set
|
|
7967
8272
|
*/
|
|
8273
|
+
/**
|
|
8274
|
+
* Start recording every path written by writeSync/copySync.
|
|
8275
|
+
* Lets a generator know exactly which files the current run produced,
|
|
8276
|
+
* without comparing file timestamps to a clock.
|
|
8277
|
+
*/
|
|
8278
|
+
startWriteRecording() {
|
|
8279
|
+
this._writtenPaths = /* @__PURE__ */ new Set();
|
|
8280
|
+
}
|
|
8281
|
+
/**
|
|
8282
|
+
* Stop recording and return the normalized paths written since
|
|
8283
|
+
* startWriteRecording().
|
|
8284
|
+
*/
|
|
8285
|
+
stopWriteRecording() {
|
|
8286
|
+
if (!this._writtenPaths) {
|
|
8287
|
+
throw new Error(
|
|
8288
|
+
"stopWriteRecording() called without startWriteRecording()"
|
|
8289
|
+
);
|
|
8290
|
+
}
|
|
8291
|
+
const written = this._writtenPaths;
|
|
8292
|
+
this._writtenPaths = null;
|
|
8293
|
+
return written;
|
|
8294
|
+
}
|
|
7968
8295
|
getAppRoot() {
|
|
7969
8296
|
if (!this._appRoot) {
|
|
7970
8297
|
return this._repoRoot;
|
|
@@ -7987,7 +8314,7 @@ var init_PathResolver = __esm({
|
|
|
7987
8314
|
* @returns True if repoRoot is the monorepo (has packages directory)
|
|
7988
8315
|
*/
|
|
7989
8316
|
isMonorepo() {
|
|
7990
|
-
const packagesDir =
|
|
8317
|
+
const packagesDir = join2(this._repoRoot, "packages");
|
|
7991
8318
|
return this.pathExists(packagesDir);
|
|
7992
8319
|
}
|
|
7993
8320
|
/**
|
|
@@ -8004,7 +8331,7 @@ var init_PathResolver = __esm({
|
|
|
8004
8331
|
* Find files matching pattern within directory
|
|
8005
8332
|
*/
|
|
8006
8333
|
async findFiles(directory, pattern, options = {}) {
|
|
8007
|
-
const searchPattern = this.normalizePath(
|
|
8334
|
+
const searchPattern = this.normalizePath(join2(directory, pattern));
|
|
8008
8335
|
const appRoot = this.getAppRoot();
|
|
8009
8336
|
const normalizeAppRoot = this.normalizePath(appRoot);
|
|
8010
8337
|
const relativePattern = searchPattern.startsWith(normalizeAppRoot) ? searchPattern.slice(normalizeAppRoot.length + 1) : searchPattern;
|
|
@@ -8051,7 +8378,7 @@ var init_PathResolver = __esm({
|
|
|
8051
8378
|
return null;
|
|
8052
8379
|
}
|
|
8053
8380
|
const resolvedPath = this.normalizePath(
|
|
8054
|
-
|
|
8381
|
+
join2(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
|
|
8055
8382
|
);
|
|
8056
8383
|
const resolvedDir = resolvedPath.replace(/\/[^/]*\*.*$/, "");
|
|
8057
8384
|
if (this.pathExists(resolvedDir)) {
|
|
@@ -8222,6 +8549,15 @@ var init_PathResolver = __esm({
|
|
|
8222
8549
|
const cjsPath = this.getEmptyCjsModulePath();
|
|
8223
8550
|
return cjsPath.replace(/\.cjs$/, ".js");
|
|
8224
8551
|
}
|
|
8552
|
+
/**
|
|
8553
|
+
* Get absolute path to empty flag component module.
|
|
8554
|
+
* Returns `export default () => null;` — used by flag filtering plugins
|
|
8555
|
+
* to replace unused flag files at build time.
|
|
8556
|
+
*/
|
|
8557
|
+
getEmptyFlagModulePath() {
|
|
8558
|
+
const __dirname2 = dirname2(fileURLToPath(import.meta.url));
|
|
8559
|
+
return this.normalizePath(resolve(__dirname2, "emptyFlag.js"));
|
|
8560
|
+
}
|
|
8225
8561
|
/**
|
|
8226
8562
|
* Get absolute path to empty CJS module for esbuild pre-bundling.
|
|
8227
8563
|
* CJS because esbuild statically analyzes ESM exports — CJS has dynamic
|
|
@@ -8247,13 +8583,13 @@ var init_PathResolver = __esm({
|
|
|
8247
8583
|
const maxLevels = this.options.maxLevels;
|
|
8248
8584
|
while (levelsChecked < maxLevels) {
|
|
8249
8585
|
const toolingPath = this.normalizePath(
|
|
8250
|
-
|
|
8586
|
+
join2(currentDir, PACKAGE_PATHS.TOOLING)
|
|
8251
8587
|
);
|
|
8252
|
-
const corePath = this.normalizePath(
|
|
8588
|
+
const corePath = this.normalizePath(join2(currentDir, PACKAGE_PATHS.CORE));
|
|
8253
8589
|
if (this.pathExists(toolingPath) && this.pathExists(corePath)) {
|
|
8254
8590
|
return currentDir;
|
|
8255
8591
|
}
|
|
8256
|
-
const appsDir =
|
|
8592
|
+
const appsDir = join2(currentDir, "apps");
|
|
8257
8593
|
if (this.pathExists(appsDir)) {
|
|
8258
8594
|
const appsDirStat = this.statSync(appsDir);
|
|
8259
8595
|
if (appsDirStat?.isDirectory()) {
|
|
@@ -8261,15 +8597,15 @@ var init_PathResolver = __esm({
|
|
|
8261
8597
|
}
|
|
8262
8598
|
}
|
|
8263
8599
|
const packageJsonPath = this.normalizePath(
|
|
8264
|
-
|
|
8600
|
+
join2(currentDir, "package.json")
|
|
8265
8601
|
);
|
|
8266
8602
|
if (this.pathExists(packageJsonPath)) {
|
|
8267
|
-
const parentDir2 = this.normalizePath(
|
|
8603
|
+
const parentDir2 = this.normalizePath(dirname2(currentDir));
|
|
8268
8604
|
if (parentDir2 === currentDir) {
|
|
8269
8605
|
return currentDir;
|
|
8270
8606
|
}
|
|
8271
8607
|
}
|
|
8272
|
-
const parentDir = this.normalizePath(
|
|
8608
|
+
const parentDir = this.normalizePath(dirname2(currentDir));
|
|
8273
8609
|
if (parentDir === currentDir) {
|
|
8274
8610
|
break;
|
|
8275
8611
|
}
|
|
@@ -8320,7 +8656,7 @@ __export(pathResolver_exports, {
|
|
|
8320
8656
|
isWithinApp: () => isWithinApp,
|
|
8321
8657
|
isWithinRepoRoot: () => isWithinRepoRoot,
|
|
8322
8658
|
joinPath: () => joinPath,
|
|
8323
|
-
lstatSync: () =>
|
|
8659
|
+
lstatSync: () => lstatSync3,
|
|
8324
8660
|
normalizePath: () => normalizePath,
|
|
8325
8661
|
openFile: () => openFile,
|
|
8326
8662
|
pathExists: () => pathExists,
|
|
@@ -8328,7 +8664,7 @@ __export(pathResolver_exports, {
|
|
|
8328
8664
|
read: () => read,
|
|
8329
8665
|
readSync: () => readSync,
|
|
8330
8666
|
readdir: () => readdir,
|
|
8331
|
-
readdirSync: () =>
|
|
8667
|
+
readdirSync: () => readdirSync3,
|
|
8332
8668
|
remove: () => remove,
|
|
8333
8669
|
removeSync: () => removeSync,
|
|
8334
8670
|
resolveAppPath: () => resolveAppPath,
|
|
@@ -8345,8 +8681,8 @@ __export(pathResolver_exports, {
|
|
|
8345
8681
|
});
|
|
8346
8682
|
import { createRequire as createRequire2 } from "node:module";
|
|
8347
8683
|
import {
|
|
8348
|
-
join as
|
|
8349
|
-
dirname as
|
|
8684
|
+
join as join3,
|
|
8685
|
+
dirname as dirname3,
|
|
8350
8686
|
basename as basename2,
|
|
8351
8687
|
extname as extname2,
|
|
8352
8688
|
relative as relative2,
|
|
@@ -8355,11 +8691,11 @@ import {
|
|
|
8355
8691
|
isAbsolute as pathIsAbsolute
|
|
8356
8692
|
} from "node:path";
|
|
8357
8693
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
8358
|
-
function
|
|
8694
|
+
function readdirSync3(dirPath, options) {
|
|
8359
8695
|
return pathResolverInstance.readdirSync(dirPath, options);
|
|
8360
8696
|
}
|
|
8361
8697
|
function getDirnameFromUrl(importMetaUrl) {
|
|
8362
|
-
return
|
|
8698
|
+
return dirname3(fileURLToPath2(importMetaUrl));
|
|
8363
8699
|
}
|
|
8364
8700
|
function findNodeModulesDir(startDir) {
|
|
8365
8701
|
let currentDir = normalizePath(startDir);
|
|
@@ -8422,7 +8758,7 @@ function getTemplatesRoot() {
|
|
|
8422
8758
|
const mode = detectExecutionMode();
|
|
8423
8759
|
if (mode === "development") {
|
|
8424
8760
|
const fileUrlPath = fileURLToPath2(import.meta.url);
|
|
8425
|
-
const frameworkRoot = normalizePath(
|
|
8761
|
+
const frameworkRoot = normalizePath(dirname3(fileUrlPath), "../../../..");
|
|
8426
8762
|
return normalizePath(frameworkRoot, PACKAGE_PATHS.CLI, "templates");
|
|
8427
8763
|
} else {
|
|
8428
8764
|
try {
|
|
@@ -8438,7 +8774,7 @@ function getTemplatesRoot() {
|
|
|
8438
8774
|
try {
|
|
8439
8775
|
const req = createRequire2(import.meta.url);
|
|
8440
8776
|
const cliPackageJsonPath = req.resolve("@donotdev/cli/package.json");
|
|
8441
|
-
const cliRoot2 = normalizePath(
|
|
8777
|
+
const cliRoot2 = normalizePath(dirname3(cliPackageJsonPath));
|
|
8442
8778
|
const templatesPath = normalizePath(cliRoot2, "templates");
|
|
8443
8779
|
if (pathExists(templatesPath)) {
|
|
8444
8780
|
return templatesPath;
|
|
@@ -8490,20 +8826,20 @@ async function isBinaryFile(filePath) {
|
|
|
8490
8826
|
try {
|
|
8491
8827
|
let fileHandle = null;
|
|
8492
8828
|
try {
|
|
8493
|
-
const buffer =
|
|
8829
|
+
const buffer = Buffer2.alloc(4096);
|
|
8494
8830
|
const fs2 = await import("node:fs");
|
|
8495
8831
|
fileHandle = await fs2.promises.open(filePath, "r");
|
|
8496
8832
|
const { bytesRead } = await fileHandle.read(buffer, 0, 4096, 0);
|
|
8497
8833
|
if (bytesRead === 0) {
|
|
8498
8834
|
return false;
|
|
8499
8835
|
}
|
|
8500
|
-
for (let
|
|
8501
|
-
if (buffer[
|
|
8836
|
+
for (let i2 = 0; i2 < bytesRead; i2++) {
|
|
8837
|
+
if (buffer[i2] === 0) {
|
|
8502
8838
|
return true;
|
|
8503
8839
|
}
|
|
8504
8840
|
}
|
|
8505
|
-
for (let
|
|
8506
|
-
const byte = buffer[
|
|
8841
|
+
for (let i2 = 0; i2 < bytesRead; i2++) {
|
|
8842
|
+
const byte = buffer[i2];
|
|
8507
8843
|
if (byte && (byte < 9 || byte > 13 && byte < 32 && byte !== 27)) {
|
|
8508
8844
|
return true;
|
|
8509
8845
|
}
|
|
@@ -8515,8 +8851,8 @@ async function isBinaryFile(filePath) {
|
|
|
8515
8851
|
}
|
|
8516
8852
|
}
|
|
8517
8853
|
} catch (err) {
|
|
8518
|
-
const { log:
|
|
8519
|
-
|
|
8854
|
+
const { log: log4 } = await Promise.resolve().then(() => (init_cli_output(), cli_output_exports));
|
|
8855
|
+
log4.warn(`Error checking if file is binary: ${filePath}`, err);
|
|
8520
8856
|
return true;
|
|
8521
8857
|
}
|
|
8522
8858
|
}
|
|
@@ -8524,8 +8860,8 @@ async function glob(pattern, options = {}) {
|
|
|
8524
8860
|
const patterns = Array.isArray(pattern) ? pattern : [pattern];
|
|
8525
8861
|
const cwd = options.cwd || pathResolverInstance.getAppRoot() || process.cwd();
|
|
8526
8862
|
const normalizeCwd = pathResolverInstance.normalizePath(cwd);
|
|
8527
|
-
const relativePatterns = patterns.map((
|
|
8528
|
-
const normalizedPattern = pathResolverInstance.normalizePath(
|
|
8863
|
+
const relativePatterns = patterns.map((p) => {
|
|
8864
|
+
const normalizedPattern = pathResolverInstance.normalizePath(p);
|
|
8529
8865
|
if (normalizedPattern.startsWith(normalizeCwd)) {
|
|
8530
8866
|
return normalizedPattern.slice(normalizeCwd.length + 1);
|
|
8531
8867
|
}
|
|
@@ -8551,8 +8887,8 @@ function globSync(pattern, options = {}) {
|
|
|
8551
8887
|
const patterns = Array.isArray(pattern) ? pattern : [pattern];
|
|
8552
8888
|
const cwd = options.cwd || pathResolverInstance.getAppRoot() || process.cwd();
|
|
8553
8889
|
const normalizeCwd = pathResolverInstance.normalizePath(cwd);
|
|
8554
|
-
const relativePatterns = patterns.map((
|
|
8555
|
-
const normalizedPattern = pathResolverInstance.normalizePath(
|
|
8890
|
+
const relativePatterns = patterns.map((p) => {
|
|
8891
|
+
const normalizedPattern = pathResolverInstance.normalizePath(p);
|
|
8556
8892
|
if (normalizedPattern.startsWith(normalizeCwd)) {
|
|
8557
8893
|
return normalizedPattern.slice(normalizeCwd.length + 1);
|
|
8558
8894
|
}
|
|
@@ -8576,7 +8912,7 @@ function globSync(pattern, options = {}) {
|
|
|
8576
8912
|
globstar: true,
|
|
8577
8913
|
throwErrorOnBrokenSymbolicLink: options.throwErrorOnBrokenSymbolicLink
|
|
8578
8914
|
});
|
|
8579
|
-
return results.map((
|
|
8915
|
+
return results.map((p) => pathResolverInstance.normalizePath(p));
|
|
8580
8916
|
}
|
|
8581
8917
|
async function pathExistsAsync(filePath) {
|
|
8582
8918
|
try {
|
|
@@ -8595,7 +8931,7 @@ async function openFile(filePath, flags) {
|
|
|
8595
8931
|
function stripBom(content) {
|
|
8596
8932
|
return content.charCodeAt(0) === 65279 ? content.slice(1) : content;
|
|
8597
8933
|
}
|
|
8598
|
-
var pathResolverInstance, getPathResolver, getRepoRoot, getAppRoot, setAppRoot, resolvePackage, resolveFrameworkPackage, resolvePackageAsset, resolveAppPath, resolveRepoPath, resolvePath, normalizePath, getRelativePath, createImportPath, getFileInfo, pathExists, read, readSync, write, writeSync, copy, copySync, remove, removeSync, statSync2,
|
|
8934
|
+
var pathResolverInstance, getPathResolver, getRepoRoot, getAppRoot, setAppRoot, resolvePackage, resolveFrameworkPackage, resolvePackageAsset, resolveAppPath, resolveRepoPath, resolvePath, normalizePath, getRelativePath, createImportPath, getFileInfo, pathExists, read, readSync, write, writeSync, copy, copySync, remove, removeSync, statSync2, lstatSync3, ensureDir, ensureDirSync, readdir, isWithinApp, findFiles, clearPathCache, fromAppRoot, getRelativePathBetween, getDirname, getBasename, getExtname, getDirnameFromPath, isAbsolute, joinPath, isWithinRepoRoot;
|
|
8599
8935
|
var init_pathResolver = __esm({
|
|
8600
8936
|
"packages/tooling/src/utils/pathResolver.ts"() {
|
|
8601
8937
|
"use strict";
|
|
@@ -8613,7 +8949,7 @@ var init_pathResolver = __esm({
|
|
|
8613
8949
|
resolveRepoPath = (relativePath) => pathResolverInstance.resolveRepoPath(relativePath);
|
|
8614
8950
|
resolvePath = (relativePath, baseDir) => pathResolverInstance.resolvePath(relativePath, baseDir);
|
|
8615
8951
|
normalizePath = (...pathSegments) => {
|
|
8616
|
-
return pathResolverInstance.normalizePath(
|
|
8952
|
+
return pathResolverInstance.normalizePath(join3(...pathSegments));
|
|
8617
8953
|
};
|
|
8618
8954
|
getRelativePath = (absolutePath) => pathResolverInstance.getRelativePath(absolutePath);
|
|
8619
8955
|
createImportPath = (absolutePath) => pathResolverInstance.createImportPath(absolutePath);
|
|
@@ -8628,7 +8964,7 @@ var init_pathResolver = __esm({
|
|
|
8628
8964
|
remove = async (path) => pathResolverInstance.remove(path);
|
|
8629
8965
|
removeSync = (path) => pathResolverInstance.removeSync(path);
|
|
8630
8966
|
statSync2 = (filePath) => pathResolverInstance.statSync(filePath);
|
|
8631
|
-
|
|
8967
|
+
lstatSync3 = (filePath) => pathResolverInstance.lstatSync(filePath);
|
|
8632
8968
|
ensureDir = async (dirPath) => pathResolverInstance.ensureDir(dirPath);
|
|
8633
8969
|
ensureDirSync = (dirPath) => pathResolverInstance.ensureDirSync(dirPath);
|
|
8634
8970
|
readdir = async (dirPath, options) => pathResolverInstance.readdir(dirPath, options);
|
|
@@ -8636,13 +8972,13 @@ var init_pathResolver = __esm({
|
|
|
8636
8972
|
findFiles = async (directory, pattern, options = {}) => pathResolverInstance.findFiles(directory, pattern, options);
|
|
8637
8973
|
clearPathCache = () => pathResolverInstance.clearCache();
|
|
8638
8974
|
fromAppRoot = (...pathSegments) => {
|
|
8639
|
-
return pathResolverInstance.resolveAppPath(
|
|
8975
|
+
return pathResolverInstance.resolveAppPath(join3(...pathSegments));
|
|
8640
8976
|
};
|
|
8641
8977
|
getRelativePathBetween = (from, to) => {
|
|
8642
8978
|
return normalizePath(relative2(from, to));
|
|
8643
8979
|
};
|
|
8644
8980
|
getDirname = (filePath) => {
|
|
8645
|
-
return normalizePath(
|
|
8981
|
+
return normalizePath(dirname3(filePath));
|
|
8646
8982
|
};
|
|
8647
8983
|
getBasename = (filePath, ext) => {
|
|
8648
8984
|
return basename2(filePath, ext);
|
|
@@ -8651,7 +8987,7 @@ var init_pathResolver = __esm({
|
|
|
8651
8987
|
return extname2(filePath);
|
|
8652
8988
|
};
|
|
8653
8989
|
getDirnameFromPath = (filePath) => {
|
|
8654
|
-
return pathResolverInstance.normalizePath(
|
|
8990
|
+
return pathResolverInstance.normalizePath(dirname3(filePath));
|
|
8655
8991
|
};
|
|
8656
8992
|
isAbsolute = (filePath) => {
|
|
8657
8993
|
return pathIsAbsolute(filePath);
|
|
@@ -8675,10 +9011,10 @@ var init_pathResolver = __esm({
|
|
|
8675
9011
|
});
|
|
8676
9012
|
|
|
8677
9013
|
// packages/tooling/src/bundler/utils.ts
|
|
8678
|
-
import { Buffer } from "node:buffer";
|
|
9014
|
+
import { Buffer as Buffer2 } from "node:buffer";
|
|
8679
9015
|
import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
8680
9016
|
import { createRequire as createRequire3 } from "node:module";
|
|
8681
|
-
import { dirname as
|
|
9017
|
+
import { dirname as dirname4, resolve as resolve3 } from "node:path";
|
|
8682
9018
|
import process from "node:process";
|
|
8683
9019
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
8684
9020
|
var require2, __filename, __dirname;
|
|
@@ -8687,12 +9023,12 @@ var init_utils2 = __esm({
|
|
|
8687
9023
|
"use strict";
|
|
8688
9024
|
require2 = createRequire3(import.meta.url);
|
|
8689
9025
|
__filename = fileURLToPath3(import.meta.url);
|
|
8690
|
-
__dirname =
|
|
9026
|
+
__dirname = dirname4(__filename);
|
|
8691
9027
|
if (typeof globalThis !== "undefined") {
|
|
8692
9028
|
globalThis.require = require2;
|
|
8693
9029
|
globalThis.__filename = __filename;
|
|
8694
9030
|
globalThis.__dirname = __dirname;
|
|
8695
|
-
globalThis.Buffer =
|
|
9031
|
+
globalThis.Buffer = Buffer2;
|
|
8696
9032
|
globalThis.process = process;
|
|
8697
9033
|
if (typeof global === "undefined") {
|
|
8698
9034
|
globalThis.global = globalThis;
|
|
@@ -8703,24 +9039,24 @@ var init_utils2 = __esm({
|
|
|
8703
9039
|
|
|
8704
9040
|
// packages/tooling/src/utils/cli-input.ts
|
|
8705
9041
|
async function askForInput(message, defaultValue = "") {
|
|
8706
|
-
const result = await
|
|
9042
|
+
const result = await text({
|
|
8707
9043
|
message,
|
|
8708
9044
|
placeholder: defaultValue || void 0,
|
|
8709
9045
|
defaultValue: defaultValue || void 0
|
|
8710
9046
|
});
|
|
8711
|
-
if (
|
|
8712
|
-
|
|
9047
|
+
if (isCancel(result)) {
|
|
9048
|
+
cancel("Operation cancelled.");
|
|
8713
9049
|
process.exit(0);
|
|
8714
9050
|
}
|
|
8715
9051
|
return result;
|
|
8716
9052
|
}
|
|
8717
9053
|
async function askForConfirmation(message, defaultValue = false) {
|
|
8718
|
-
const result = await
|
|
9054
|
+
const result = await confirm({
|
|
8719
9055
|
message,
|
|
8720
9056
|
initialValue: defaultValue
|
|
8721
9057
|
});
|
|
8722
|
-
if (
|
|
8723
|
-
|
|
9058
|
+
if (isCancel(result)) {
|
|
9059
|
+
cancel("Operation cancelled.");
|
|
8724
9060
|
process.exit(0);
|
|
8725
9061
|
}
|
|
8726
9062
|
return result;
|
|
@@ -8731,13 +9067,13 @@ async function askForSelection(message, choices, defaultValue = 0) {
|
|
|
8731
9067
|
label: choice.title,
|
|
8732
9068
|
hint: choice.hint
|
|
8733
9069
|
}));
|
|
8734
|
-
const result = await
|
|
9070
|
+
const result = await select({
|
|
8735
9071
|
message,
|
|
8736
9072
|
options,
|
|
8737
9073
|
initialValue: choices[defaultValue]?.value
|
|
8738
9074
|
});
|
|
8739
|
-
if (
|
|
8740
|
-
|
|
9075
|
+
if (isCancel(result)) {
|
|
9076
|
+
cancel("Operation cancelled.");
|
|
8741
9077
|
process.exit(0);
|
|
8742
9078
|
}
|
|
8743
9079
|
return result;
|
|
@@ -8811,8 +9147,8 @@ async function isTextFile(filePath) {
|
|
|
8811
9147
|
try {
|
|
8812
9148
|
const buffer = await read(filePath, { format: "buffer" });
|
|
8813
9149
|
if (buffer.length === 0) return true;
|
|
8814
|
-
for (let
|
|
8815
|
-
if (buffer[
|
|
9150
|
+
for (let i2 = 0; i2 < Math.min(buffer.length, 1e3); i2++) {
|
|
9151
|
+
if (buffer[i2] === 0) return false;
|
|
8816
9152
|
}
|
|
8817
9153
|
return true;
|
|
8818
9154
|
} catch {
|
|
@@ -8837,7 +9173,7 @@ async function replacePlaceholders(filePath, replacements) {
|
|
|
8837
9173
|
}
|
|
8838
9174
|
await write(filePath, content, { overwrite: true });
|
|
8839
9175
|
} catch (error2) {
|
|
8840
|
-
|
|
9176
|
+
log2.warn(
|
|
8841
9177
|
`Warning: Could not process file ${filePath}: ${error2.message || "Unknown error"}`
|
|
8842
9178
|
);
|
|
8843
9179
|
}
|
|
@@ -8891,14 +9227,14 @@ function isReservedAppName(name) {
|
|
|
8891
9227
|
async function updateRootPackageJson(rootDir, appNames) {
|
|
8892
9228
|
const packageJsonPath = joinPath(rootDir, "package.json");
|
|
8893
9229
|
if (!pathExists(packageJsonPath)) {
|
|
8894
|
-
|
|
9230
|
+
log2.warn("Root package.json not found, skipping script updates");
|
|
8895
9231
|
return;
|
|
8896
9232
|
}
|
|
8897
9233
|
try {
|
|
8898
9234
|
const packageJson = await read(packageJsonPath, { format: "json" });
|
|
8899
9235
|
packageJson.scripts = packageJson.scripts || {};
|
|
8900
9236
|
} catch (error2) {
|
|
8901
|
-
|
|
9237
|
+
log2.warn(
|
|
8902
9238
|
`Warning: Could not update root package.json: ${error2.message || "Unknown error"}`
|
|
8903
9239
|
);
|
|
8904
9240
|
}
|
|
@@ -8968,16 +9304,16 @@ function loadMatrix(mode) {
|
|
|
8968
9304
|
return cachedMatrix;
|
|
8969
9305
|
}
|
|
8970
9306
|
function resolveGroup(groupName, matrix) {
|
|
8971
|
-
const
|
|
8972
|
-
if (!
|
|
9307
|
+
const group2 = matrix.groups[groupName];
|
|
9308
|
+
if (!group2) return {};
|
|
8973
9309
|
const result = {};
|
|
8974
|
-
if (
|
|
8975
|
-
for (const included of
|
|
9310
|
+
if (group2.includes) {
|
|
9311
|
+
for (const included of group2.includes) {
|
|
8976
9312
|
Object.assign(result, resolveGroup(included, matrix));
|
|
8977
9313
|
}
|
|
8978
9314
|
}
|
|
8979
|
-
if (
|
|
8980
|
-
Object.assign(result,
|
|
9315
|
+
if (group2.packages) {
|
|
9316
|
+
Object.assign(result, group2.packages);
|
|
8981
9317
|
}
|
|
8982
9318
|
return result;
|
|
8983
9319
|
}
|
|
@@ -9339,9 +9675,9 @@ function generatePackageJson(templateName, mode, options = {}) {
|
|
|
9339
9675
|
}
|
|
9340
9676
|
if (mode === "published") {
|
|
9341
9677
|
const overrides = {};
|
|
9342
|
-
for (const [groupName,
|
|
9678
|
+
for (const [groupName, group2] of Object.entries(matrix.groups || {})) {
|
|
9343
9679
|
if (groupName.startsWith("@donotdev/")) {
|
|
9344
|
-
const version =
|
|
9680
|
+
const version = group2.packages?.[groupName];
|
|
9345
9681
|
if (version) {
|
|
9346
9682
|
overrides[groupName] = version.replace(/^\^/, "");
|
|
9347
9683
|
}
|
|
@@ -9373,7 +9709,7 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9373
9709
|
workspaceRoot = workspaceRoot || currentDir;
|
|
9374
9710
|
}
|
|
9375
9711
|
templatesRoot = templatesRoot || getTemplatesRoot();
|
|
9376
|
-
|
|
9712
|
+
intro("\u{1F680} DoNotDev App Creator");
|
|
9377
9713
|
if (!appName) {
|
|
9378
9714
|
appName = await askForInput(
|
|
9379
9715
|
`App name - '${RESERVED_APP_NAMES.join("', '")}' reserved`,
|
|
@@ -9435,18 +9771,18 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9435
9771
|
1
|
|
9436
9772
|
);
|
|
9437
9773
|
if (action === "skip") {
|
|
9438
|
-
|
|
9774
|
+
log2.info(`\u23ED\uFE0F Skipping app: ${appName}`);
|
|
9439
9775
|
return;
|
|
9440
9776
|
}
|
|
9441
9777
|
if (action === "replace") {
|
|
9442
9778
|
await remove(appDir);
|
|
9443
9779
|
}
|
|
9444
9780
|
} else {
|
|
9445
|
-
|
|
9781
|
+
log2.info(`\u23ED\uFE0F App "${appName}" already exists, skipping.`);
|
|
9446
9782
|
return;
|
|
9447
9783
|
}
|
|
9448
9784
|
}
|
|
9449
|
-
const s =
|
|
9785
|
+
const s = spinner();
|
|
9450
9786
|
s.start(`Creating app: ${appName}`);
|
|
9451
9787
|
await ensureDir(appDir);
|
|
9452
9788
|
const builder = appTemplate;
|
|
@@ -9571,7 +9907,7 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9571
9907
|
joinPath(templatesRoot, functionsTemplateName)
|
|
9572
9908
|
);
|
|
9573
9909
|
if (!functionsTemplateExists) {
|
|
9574
|
-
|
|
9910
|
+
log2.warn(
|
|
9575
9911
|
`Functions template "${functionsTemplateName}" not found \u2014 skipping functions scaffolding.`
|
|
9576
9912
|
);
|
|
9577
9913
|
} else {
|
|
@@ -9635,7 +9971,7 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9635
9971
|
});
|
|
9636
9972
|
if (firebaseJson.hosting?.rewrites && Array.isArray(firebaseJson.hosting.rewrites)) {
|
|
9637
9973
|
firebaseJson.hosting.rewrites = firebaseJson.hosting.rewrites.filter(
|
|
9638
|
-
(
|
|
9974
|
+
(r2) => r2.destination !== "/index.html"
|
|
9639
9975
|
);
|
|
9640
9976
|
}
|
|
9641
9977
|
if (firebaseJson.hosting) {
|
|
@@ -9749,16 +10085,16 @@ async function createApp(appName, appConfig, workspaceRoot, templatesRoot) {
|
|
|
9749
10085
|
const appsDir = joinPath(workspaceRoot, "apps");
|
|
9750
10086
|
const allDirs = pathExists(appsDir) ? (await readdir(appsDir, {
|
|
9751
10087
|
withFileTypes: true
|
|
9752
|
-
})).filter((
|
|
10088
|
+
})).filter((d) => d.isDirectory()).map((d) => d.name).filter(isValidFileName) : [];
|
|
9753
10089
|
await updateRootPackageJson(workspaceRoot, allDirs);
|
|
9754
10090
|
}
|
|
9755
10091
|
if (isInteractive) {
|
|
9756
|
-
|
|
10092
|
+
outro("\u{1F389} App created successfully!");
|
|
9757
10093
|
const firebaseStep = row.functionsTemplate === "functions-firebase" ? `2. Set Firebase project: cd apps/${appName} && firebase use --add (or edit .firebaserc)
|
|
9758
10094
|
3. bun install
|
|
9759
10095
|
4. bun run dev` : `2. bun install
|
|
9760
10096
|
3. bun run dev`;
|
|
9761
|
-
|
|
10097
|
+
note(
|
|
9762
10098
|
`Next steps:
|
|
9763
10099
|
|
|
9764
10100
|
1. cd apps/${appName}
|
|
@@ -9806,7 +10142,7 @@ async function main(options) {
|
|
|
9806
10142
|
await createApp(options?.name);
|
|
9807
10143
|
}
|
|
9808
10144
|
} catch (error2) {
|
|
9809
|
-
|
|
10145
|
+
log2.error("\n\u274C Error creating app:", error2);
|
|
9810
10146
|
throw error2;
|
|
9811
10147
|
}
|
|
9812
10148
|
}
|