@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 __copyProps = (to, from, except, desc) => {
|
|
20
29
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
@@ -33,31 +42,40 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
42
|
mod
|
|
34
43
|
));
|
|
35
44
|
|
|
36
|
-
// node_modules/.bun/fast-string-truncated-width@
|
|
37
|
-
var
|
|
45
|
+
// node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
|
|
46
|
+
var getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji;
|
|
38
47
|
var init_utils = __esm({
|
|
39
|
-
"node_modules/.bun/fast-string-truncated-width@
|
|
48
|
+
"node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js"() {
|
|
40
49
|
init_utils2();
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
50
|
+
getCodePointsLength = /* @__PURE__ */ (() => {
|
|
51
|
+
const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
52
|
+
return (input) => {
|
|
53
|
+
let surrogatePairsNr = 0;
|
|
54
|
+
SURROGATE_PAIR_RE.lastIndex = 0;
|
|
55
|
+
while (SURROGATE_PAIR_RE.test(input)) {
|
|
56
|
+
surrogatePairsNr += 1;
|
|
57
|
+
}
|
|
58
|
+
return input.length - surrogatePairsNr;
|
|
59
|
+
};
|
|
60
|
+
})();
|
|
44
61
|
isFullWidth = (x) => {
|
|
45
62
|
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
46
63
|
};
|
|
47
|
-
|
|
48
|
-
return x
|
|
64
|
+
isWideNotCJKTNotEmoji = (x) => {
|
|
65
|
+
return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
49
66
|
};
|
|
50
67
|
}
|
|
51
68
|
});
|
|
52
69
|
|
|
53
|
-
// node_modules/.bun/fast-string-truncated-width@
|
|
54
|
-
var ANSI_RE, CONTROL_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
|
|
70
|
+
// node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
|
|
71
|
+
var ANSI_RE, CONTROL_RE, CJKT_WIDE_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
|
|
55
72
|
var init_dist = __esm({
|
|
56
|
-
"node_modules/.bun/fast-string-truncated-width@
|
|
73
|
+
"node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js"() {
|
|
57
74
|
init_utils2();
|
|
58
75
|
init_utils();
|
|
59
|
-
ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
|
|
76
|
+
ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
|
|
60
77
|
CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
78
|
+
CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
|
|
61
79
|
TAB_RE = /\t{1,1000}/y;
|
|
62
80
|
EMOJI_RE = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu");
|
|
63
81
|
LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
@@ -67,14 +85,21 @@ var init_dist = __esm({
|
|
|
67
85
|
const LIMIT = truncationOptions.limit ?? Infinity;
|
|
68
86
|
const ELLIPSIS = truncationOptions.ellipsis ?? "";
|
|
69
87
|
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
|
|
70
|
-
const ANSI_WIDTH =
|
|
88
|
+
const ANSI_WIDTH = 0;
|
|
71
89
|
const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
|
|
72
90
|
const TAB_WIDTH = widthOptions.tabWidth ?? 8;
|
|
73
|
-
const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
|
|
74
91
|
const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
|
|
75
|
-
const FULL_WIDTH_WIDTH =
|
|
92
|
+
const FULL_WIDTH_WIDTH = 2;
|
|
76
93
|
const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
|
|
77
|
-
const WIDE_WIDTH = widthOptions.wideWidth ??
|
|
94
|
+
const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
|
|
95
|
+
const PARSE_BLOCKS = [
|
|
96
|
+
[LATIN_RE, REGULAR_WIDTH],
|
|
97
|
+
[ANSI_RE, ANSI_WIDTH],
|
|
98
|
+
[CONTROL_RE, CONTROL_WIDTH],
|
|
99
|
+
[TAB_RE, TAB_WIDTH],
|
|
100
|
+
[EMOJI_RE, EMOJI_WIDTH],
|
|
101
|
+
[CJKT_WIDE_RE, WIDE_WIDTH]
|
|
102
|
+
];
|
|
78
103
|
let indexPrev = 0;
|
|
79
104
|
let index = 0;
|
|
80
105
|
let length = input.length;
|
|
@@ -94,10 +119,8 @@ var init_dist = __esm({
|
|
|
94
119
|
const codePoint = char.codePointAt(0) || 0;
|
|
95
120
|
if (isFullWidth(codePoint)) {
|
|
96
121
|
widthExtra = FULL_WIDTH_WIDTH;
|
|
97
|
-
} else if (
|
|
122
|
+
} else if (isWideNotCJKTNotEmoji(codePoint)) {
|
|
98
123
|
widthExtra = WIDE_WIDTH;
|
|
99
|
-
} else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) {
|
|
100
|
-
widthExtra = AMBIGUOUS_WIDTH;
|
|
101
124
|
} else {
|
|
102
125
|
widthExtra = REGULAR_WIDTH;
|
|
103
126
|
}
|
|
@@ -113,88 +136,28 @@ var init_dist = __esm({
|
|
|
113
136
|
}
|
|
114
137
|
unmatchedStart = unmatchedEnd = 0;
|
|
115
138
|
}
|
|
116
|
-
if (index >= length)
|
|
117
|
-
break;
|
|
118
|
-
LATIN_RE.lastIndex = index;
|
|
119
|
-
if (LATIN_RE.test(input)) {
|
|
120
|
-
lengthExtra = LATIN_RE.lastIndex - index;
|
|
121
|
-
widthExtra = lengthExtra * REGULAR_WIDTH;
|
|
122
|
-
if (width + widthExtra > truncationLimit) {
|
|
123
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
|
|
124
|
-
}
|
|
125
|
-
if (width + widthExtra > LIMIT) {
|
|
126
|
-
truncationEnabled = true;
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
|
-
width += widthExtra;
|
|
130
|
-
unmatchedStart = indexPrev;
|
|
131
|
-
unmatchedEnd = index;
|
|
132
|
-
index = indexPrev = LATIN_RE.lastIndex;
|
|
133
|
-
continue;
|
|
139
|
+
if (index >= length) {
|
|
140
|
+
break outer;
|
|
134
141
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
widthExtra = lengthExtra * CONTROL_WIDTH;
|
|
154
|
-
if (width + widthExtra > truncationLimit) {
|
|
155
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
|
|
156
|
-
}
|
|
157
|
-
if (width + widthExtra > LIMIT) {
|
|
158
|
-
truncationEnabled = true;
|
|
159
|
-
break;
|
|
160
|
-
}
|
|
161
|
-
width += widthExtra;
|
|
162
|
-
unmatchedStart = indexPrev;
|
|
163
|
-
unmatchedEnd = index;
|
|
164
|
-
index = indexPrev = CONTROL_RE.lastIndex;
|
|
165
|
-
continue;
|
|
166
|
-
}
|
|
167
|
-
TAB_RE.lastIndex = index;
|
|
168
|
-
if (TAB_RE.test(input)) {
|
|
169
|
-
lengthExtra = TAB_RE.lastIndex - index;
|
|
170
|
-
widthExtra = lengthExtra * TAB_WIDTH;
|
|
171
|
-
if (width + widthExtra > truncationLimit) {
|
|
172
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
|
|
173
|
-
}
|
|
174
|
-
if (width + widthExtra > LIMIT) {
|
|
175
|
-
truncationEnabled = true;
|
|
176
|
-
break;
|
|
177
|
-
}
|
|
178
|
-
width += widthExtra;
|
|
179
|
-
unmatchedStart = indexPrev;
|
|
180
|
-
unmatchedEnd = index;
|
|
181
|
-
index = indexPrev = TAB_RE.lastIndex;
|
|
182
|
-
continue;
|
|
183
|
-
}
|
|
184
|
-
EMOJI_RE.lastIndex = index;
|
|
185
|
-
if (EMOJI_RE.test(input)) {
|
|
186
|
-
if (width + EMOJI_WIDTH > truncationLimit) {
|
|
187
|
-
truncationIndex = Math.min(truncationIndex, index);
|
|
188
|
-
}
|
|
189
|
-
if (width + EMOJI_WIDTH > LIMIT) {
|
|
190
|
-
truncationEnabled = true;
|
|
191
|
-
break;
|
|
142
|
+
for (let i2 = 0, l2 = PARSE_BLOCKS.length; i2 < l2; i2++) {
|
|
143
|
+
const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i2];
|
|
144
|
+
BLOCK_RE.lastIndex = index;
|
|
145
|
+
if (BLOCK_RE.test(input)) {
|
|
146
|
+
lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
|
|
147
|
+
widthExtra = lengthExtra * BLOCK_WIDTH;
|
|
148
|
+
if (width + widthExtra > truncationLimit) {
|
|
149
|
+
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
|
|
150
|
+
}
|
|
151
|
+
if (width + widthExtra > LIMIT) {
|
|
152
|
+
truncationEnabled = true;
|
|
153
|
+
break outer;
|
|
154
|
+
}
|
|
155
|
+
width += widthExtra;
|
|
156
|
+
unmatchedStart = indexPrev;
|
|
157
|
+
unmatchedEnd = index;
|
|
158
|
+
index = indexPrev = BLOCK_RE.lastIndex;
|
|
159
|
+
continue outer;
|
|
192
160
|
}
|
|
193
|
-
width += EMOJI_WIDTH;
|
|
194
|
-
unmatchedStart = indexPrev;
|
|
195
|
-
unmatchedEnd = index;
|
|
196
|
-
index = indexPrev = EMOJI_RE.lastIndex;
|
|
197
|
-
continue;
|
|
198
161
|
}
|
|
199
162
|
index += 1;
|
|
200
163
|
}
|
|
@@ -209,10 +172,10 @@ var init_dist = __esm({
|
|
|
209
172
|
}
|
|
210
173
|
});
|
|
211
174
|
|
|
212
|
-
// node_modules/.bun/fast-string-width@
|
|
175
|
+
// node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
|
|
213
176
|
var NO_TRUNCATION2, fastStringWidth, dist_default2;
|
|
214
177
|
var init_dist2 = __esm({
|
|
215
|
-
"node_modules/.bun/fast-string-width@
|
|
178
|
+
"node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js"() {
|
|
216
179
|
init_utils2();
|
|
217
180
|
init_dist();
|
|
218
181
|
NO_TRUNCATION2 = {
|
|
@@ -227,13 +190,13 @@ var init_dist2 = __esm({
|
|
|
227
190
|
}
|
|
228
191
|
});
|
|
229
192
|
|
|
230
|
-
// node_modules/.bun/fast-wrap-ansi@0.
|
|
193
|
+
// node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js
|
|
231
194
|
function wrapAnsi(string, columns, options) {
|
|
232
195
|
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
|
|
233
196
|
}
|
|
234
197
|
var ESC, CSI, END_CODE, ANSI_ESCAPE_BELL, ANSI_CSI, ANSI_OSC, ANSI_SGR_TERMINATOR, ANSI_ESCAPE_LINK, GROUP_REGEX, getClosingCode, wrapAnsiCode, wrapAnsiHyperlink, wrapWord, stringVisibleTrimSpacesRight, exec, CRLF_OR_LF;
|
|
235
198
|
var init_main = __esm({
|
|
236
|
-
"node_modules/.bun/fast-wrap-ansi@0.
|
|
199
|
+
"node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js"() {
|
|
237
200
|
init_utils2();
|
|
238
201
|
init_dist2();
|
|
239
202
|
ESC = "\x1B";
|
|
@@ -397,16 +360,19 @@ var init_main = __esm({
|
|
|
397
360
|
}
|
|
398
361
|
const preString = rows.join("\n");
|
|
399
362
|
let inSurrogate = false;
|
|
400
|
-
for (let
|
|
401
|
-
const character = preString[
|
|
363
|
+
for (let i2 = 0; i2 < preString.length; i2++) {
|
|
364
|
+
const character = preString[i2];
|
|
402
365
|
returnValue += character;
|
|
403
366
|
if (!inSurrogate) {
|
|
404
367
|
inSurrogate = character >= "\uD800" && character <= "\uDBFF";
|
|
368
|
+
if (inSurrogate) {
|
|
369
|
+
continue;
|
|
370
|
+
}
|
|
405
371
|
} else {
|
|
406
|
-
|
|
372
|
+
inSurrogate = false;
|
|
407
373
|
}
|
|
408
374
|
if (character === ESC || character === CSI) {
|
|
409
|
-
GROUP_REGEX.lastIndex =
|
|
375
|
+
GROUP_REGEX.lastIndex = i2 + 1;
|
|
410
376
|
const groupsResult = GROUP_REGEX.exec(preString);
|
|
411
377
|
const groups = groupsResult?.groups;
|
|
412
378
|
if (groups?.code !== void 0) {
|
|
@@ -416,7 +382,7 @@ var init_main = __esm({
|
|
|
416
382
|
escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
417
383
|
}
|
|
418
384
|
}
|
|
419
|
-
if (preString[
|
|
385
|
+
if (preString[i2 + 1] === "\n") {
|
|
420
386
|
if (escapeUrl) {
|
|
421
387
|
returnValue += wrapAnsiHyperlink("");
|
|
422
388
|
}
|
|
@@ -447,17 +413,17 @@ var require_src = __commonJS({
|
|
|
447
413
|
var ESC2 = "\x1B";
|
|
448
414
|
var CSI2 = `${ESC2}[`;
|
|
449
415
|
var beep = "\x07";
|
|
450
|
-
var
|
|
451
|
-
to(x,
|
|
452
|
-
if (!
|
|
453
|
-
return `${CSI2}${
|
|
416
|
+
var cursor3 = {
|
|
417
|
+
to(x, y) {
|
|
418
|
+
if (!y) return `${CSI2}${x + 1}G`;
|
|
419
|
+
return `${CSI2}${y + 1};${x + 1}H`;
|
|
454
420
|
},
|
|
455
|
-
move(x,
|
|
421
|
+
move(x, y) {
|
|
456
422
|
let ret = "";
|
|
457
423
|
if (x < 0) ret += `${CSI2}${-x}D`;
|
|
458
424
|
else if (x > 0) ret += `${CSI2}${x}C`;
|
|
459
|
-
if (
|
|
460
|
-
else if (
|
|
425
|
+
if (y < 0) ret += `${CSI2}${-y}A`;
|
|
426
|
+
else if (y > 0) ret += `${CSI2}${y}B`;
|
|
461
427
|
return ret;
|
|
462
428
|
},
|
|
463
429
|
up: (count = 1) => `${CSI2}${count}A`,
|
|
@@ -476,7 +442,7 @@ var require_src = __commonJS({
|
|
|
476
442
|
up: (count = 1) => `${CSI2}S`.repeat(count),
|
|
477
443
|
down: (count = 1) => `${CSI2}T`.repeat(count)
|
|
478
444
|
};
|
|
479
|
-
var
|
|
445
|
+
var erase3 = {
|
|
480
446
|
screen: `${CSI2}2J`,
|
|
481
447
|
up: (count = 1) => `${CSI2}1J`.repeat(count),
|
|
482
448
|
down: (count = 1) => `${CSI2}J`.repeat(count),
|
|
@@ -485,200 +451,314 @@ var require_src = __commonJS({
|
|
|
485
451
|
lineStart: `${CSI2}1K`,
|
|
486
452
|
lines(count) {
|
|
487
453
|
let clear = "";
|
|
488
|
-
for (let
|
|
489
|
-
clear += this.line + (
|
|
454
|
+
for (let i2 = 0; i2 < count; i2++)
|
|
455
|
+
clear += this.line + (i2 < count - 1 ? cursor3.up() : "");
|
|
490
456
|
if (count)
|
|
491
|
-
clear +=
|
|
457
|
+
clear += cursor3.left;
|
|
492
458
|
return clear;
|
|
493
459
|
}
|
|
494
460
|
};
|
|
495
|
-
module.exports = { cursor, scroll, erase, beep };
|
|
461
|
+
module.exports = { cursor: cursor3, scroll, erase: erase3, beep };
|
|
496
462
|
}
|
|
497
463
|
});
|
|
498
464
|
|
|
499
|
-
// node_modules/.bun/@clack+core@1.
|
|
500
|
-
import { styleText
|
|
501
|
-
import { stdout
|
|
502
|
-
import * as
|
|
503
|
-
import { ReadStream
|
|
504
|
-
function
|
|
505
|
-
if (typeof
|
|
506
|
-
|
|
465
|
+
// node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs
|
|
466
|
+
import { styleText } from "node:util";
|
|
467
|
+
import { stdout, stdin } from "node:process";
|
|
468
|
+
import * as l from "node:readline";
|
|
469
|
+
import { ReadStream } from "node:tty";
|
|
470
|
+
function isActionKey(n2, e) {
|
|
471
|
+
if (typeof n2 == "string")
|
|
472
|
+
return settings.aliases.get(n2) === e;
|
|
473
|
+
for (const s of n2)
|
|
474
|
+
if (s !== void 0 && isActionKey(s, e))
|
|
475
|
+
return true;
|
|
507
476
|
return false;
|
|
508
477
|
}
|
|
509
|
-
function
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
478
|
+
function block({
|
|
479
|
+
input: e = stdin,
|
|
480
|
+
output: r2 = stdout,
|
|
481
|
+
overwrite: o = true,
|
|
482
|
+
hideCursor: n2 = true
|
|
483
|
+
} = {}) {
|
|
484
|
+
const s = l.createInterface({
|
|
485
|
+
input: e,
|
|
486
|
+
output: r2,
|
|
487
|
+
prompt: "",
|
|
488
|
+
tabSize: 1
|
|
489
|
+
});
|
|
490
|
+
l.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(true);
|
|
491
|
+
const t2 = (f, { name: a2, sequence: w }) => {
|
|
492
|
+
const c = String(f);
|
|
493
|
+
if (isActionKey([c, a2, w], "cancel")) {
|
|
494
|
+
n2 && r2.write(import_sisteransi.cursor.show), process.exit(0);
|
|
516
495
|
return;
|
|
517
496
|
}
|
|
518
|
-
if (!
|
|
519
|
-
const
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
497
|
+
if (!o) return;
|
|
498
|
+
const i2 = a2 === "return" ? 0 : -1, m = a2 === "return" ? -1 : 0;
|
|
499
|
+
l.moveCursor(r2, i2, m, () => {
|
|
500
|
+
l.clearLine(r2, 1, () => {
|
|
501
|
+
e.once("keypress", t2);
|
|
523
502
|
});
|
|
524
503
|
});
|
|
525
504
|
};
|
|
526
|
-
return
|
|
527
|
-
|
|
505
|
+
return n2 && r2.write(import_sisteransi.cursor.hide), e.once("keypress", t2), () => {
|
|
506
|
+
e.off("keypress", t2), n2 && r2.write(import_sisteransi.cursor.show), e instanceof ReadStream && e.isTTY && !R && e.setRawMode(false), s.terminal = false, s.close();
|
|
528
507
|
};
|
|
529
508
|
}
|
|
530
|
-
var import_sisteransi,
|
|
509
|
+
var import_sisteransi, a$1, t, settings, R, getColumns;
|
|
531
510
|
var init_dist3 = __esm({
|
|
532
|
-
"node_modules/.bun/@clack+core@1.
|
|
511
|
+
"node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs"() {
|
|
533
512
|
init_utils2();
|
|
534
513
|
init_main();
|
|
535
514
|
import_sisteransi = __toESM(require_src(), 1);
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
515
|
+
a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
516
|
+
t = [
|
|
517
|
+
"January",
|
|
518
|
+
"February",
|
|
519
|
+
"March",
|
|
520
|
+
"April",
|
|
521
|
+
"May",
|
|
522
|
+
"June",
|
|
523
|
+
"July",
|
|
524
|
+
"August",
|
|
525
|
+
"September",
|
|
526
|
+
"October",
|
|
527
|
+
"November",
|
|
528
|
+
"December"
|
|
529
|
+
];
|
|
530
|
+
settings = {
|
|
531
|
+
actions: new Set(a$1),
|
|
532
|
+
aliases: /* @__PURE__ */ new Map([
|
|
533
|
+
// vim support
|
|
534
|
+
["k", "up"],
|
|
535
|
+
["j", "down"],
|
|
536
|
+
["h", "left"],
|
|
537
|
+
["l", "right"],
|
|
538
|
+
["", "cancel"],
|
|
539
|
+
// opinionated defaults!
|
|
540
|
+
["escape", "cancel"]
|
|
541
|
+
]),
|
|
542
|
+
messages: {
|
|
543
|
+
cancel: "Canceled",
|
|
544
|
+
error: "Something went wrong"
|
|
545
|
+
},
|
|
546
|
+
withGuide: true,
|
|
547
|
+
accessible: void 0,
|
|
548
|
+
date: {
|
|
549
|
+
monthNames: [...t],
|
|
550
|
+
messages: {
|
|
551
|
+
required: "Please enter a valid date",
|
|
552
|
+
invalidMonth: "There are only 12 months in a year",
|
|
553
|
+
invalidDay: (n2, e) => `There are only ${n2} days in ${e}`,
|
|
554
|
+
afterMin: (n2) => `Date must be on or after ${n2.toISOString().slice(0, 10)}`,
|
|
555
|
+
beforeMax: (n2) => `Date must be on or before ${n2.toISOString().slice(0, 10)}`
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
};
|
|
559
|
+
R = globalThis.process.platform.startsWith("win");
|
|
560
|
+
getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
|
|
541
561
|
}
|
|
542
562
|
});
|
|
543
563
|
|
|
544
|
-
// node_modules/.bun/@clack+prompts@1.
|
|
545
|
-
import { styleText as
|
|
546
|
-
import
|
|
547
|
-
import { existsSync
|
|
548
|
-
import { dirname
|
|
549
|
-
function
|
|
550
|
-
|
|
564
|
+
// node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs
|
|
565
|
+
import { styleText as styleText2, stripVTControlCharacters } from "node:util";
|
|
566
|
+
import process$1 from "node:process";
|
|
567
|
+
import { existsSync, lstatSync, readdirSync } from "node:fs";
|
|
568
|
+
import { dirname, join } from "node:path";
|
|
569
|
+
function isUnicodeSupported() {
|
|
570
|
+
if (process$1.platform !== "win32") {
|
|
571
|
+
return process$1.env.TERM !== "linux";
|
|
572
|
+
}
|
|
573
|
+
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";
|
|
551
574
|
}
|
|
552
|
-
var import_sisteransi2,
|
|
575
|
+
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, MULTISELECT_INSTRUCTIONS, log, intro, outro, W, spinner, u2, SELECT_INSTRUCTIONS, i;
|
|
553
576
|
var init_dist4 = __esm({
|
|
554
|
-
"node_modules/.bun/@clack+prompts@1.
|
|
577
|
+
"node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs"() {
|
|
555
578
|
init_utils2();
|
|
556
579
|
init_dist3();
|
|
557
580
|
init_dist3();
|
|
558
581
|
init_main();
|
|
559
582
|
init_dist2();
|
|
560
583
|
import_sisteransi2 = __toESM(require_src(), 1);
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
584
|
+
unicode = isUnicodeSupported();
|
|
585
|
+
isCI = () => process.env.CI === "true";
|
|
586
|
+
unicodeOr = (o, e) => unicode ? o : e;
|
|
587
|
+
S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
|
|
588
|
+
S_STEP_CANCEL = unicodeOr("\u25A0", "x");
|
|
589
|
+
S_STEP_ERROR = unicodeOr("\u25B2", "x");
|
|
590
|
+
S_STEP_SUBMIT = unicodeOr("\u25C7", "o");
|
|
591
|
+
S_BAR_START = unicodeOr("\u250C", "T");
|
|
592
|
+
S_BAR = unicodeOr("\u2502", "|");
|
|
593
|
+
S_BAR_END = unicodeOr("\u2514", "\u2014");
|
|
594
|
+
S_BAR_START_RIGHT = unicodeOr("\u2510", "T");
|
|
595
|
+
S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014");
|
|
596
|
+
S_RADIO_ACTIVE = unicodeOr("\u25CF", ">");
|
|
597
|
+
S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
|
|
598
|
+
S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
|
|
599
|
+
S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
|
|
600
|
+
S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
|
|
601
|
+
S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022");
|
|
602
|
+
S_BAR_H = unicodeOr("\u2500", "-");
|
|
603
|
+
S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+");
|
|
604
|
+
S_CONNECT_LEFT = unicodeOr("\u251C", "+");
|
|
605
|
+
S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+");
|
|
606
|
+
S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+");
|
|
607
|
+
S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+");
|
|
608
|
+
S_INFO = unicodeOr("\u25CF", "\u2022");
|
|
609
|
+
S_SUCCESS = unicodeOr("\u25C6", "*");
|
|
610
|
+
S_WARN = unicodeOr("\u25B2", "!");
|
|
611
|
+
S_ERROR = unicodeOr("\u25A0", "x");
|
|
612
|
+
MULTISELECT_INSTRUCTIONS = [
|
|
613
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
614
|
+
`${styleText2("dim", "Space:")} select`,
|
|
615
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
616
|
+
];
|
|
617
|
+
log = {
|
|
618
|
+
message: (s = [], {
|
|
619
|
+
symbol: e = styleText2("gray", S_BAR),
|
|
620
|
+
secondarySymbol: r2 = styleText2("gray", S_BAR),
|
|
621
|
+
output: m = process.stdout,
|
|
622
|
+
spacing: l2 = 1,
|
|
623
|
+
withGuide: c
|
|
624
|
+
} = {}) => {
|
|
625
|
+
const t2 = [], o = c ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
|
|
626
|
+
for (let i2 = 0; i2 < l2; i2++)
|
|
627
|
+
t2.push(f);
|
|
628
|
+
const g = Array.isArray(s) ? s : s.split(`
|
|
593
629
|
`);
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
630
|
+
if (g.length > 0) {
|
|
631
|
+
const [i2, ...y] = g;
|
|
632
|
+
i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
|
|
633
|
+
for (const p of y)
|
|
634
|
+
p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
|
|
635
|
+
}
|
|
636
|
+
m.write(`${t2.join(`
|
|
600
637
|
`)}
|
|
601
638
|
`);
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
639
|
+
},
|
|
640
|
+
info: (s, e) => {
|
|
641
|
+
log.message(s, { ...e, symbol: styleText2("blue", S_INFO) });
|
|
642
|
+
},
|
|
643
|
+
success: (s, e) => {
|
|
644
|
+
log.message(s, { ...e, symbol: styleText2("green", S_SUCCESS) });
|
|
645
|
+
},
|
|
646
|
+
step: (s, e) => {
|
|
647
|
+
log.message(s, { ...e, symbol: styleText2("green", S_STEP_SUBMIT) });
|
|
648
|
+
},
|
|
649
|
+
warn: (s, e) => {
|
|
650
|
+
log.message(s, { ...e, symbol: styleText2("yellow", S_WARN) });
|
|
651
|
+
},
|
|
652
|
+
/** alias for `log.warn()`. */
|
|
653
|
+
warning: (s, e) => {
|
|
654
|
+
log.warn(s, e);
|
|
655
|
+
},
|
|
656
|
+
error: (s, e) => {
|
|
657
|
+
log.message(s, { ...e, symbol: styleText2("red", S_ERROR) });
|
|
658
|
+
}
|
|
659
|
+
};
|
|
660
|
+
intro = (o = "", t2) => {
|
|
661
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_START)} ` : "";
|
|
662
|
+
i2.write(`${e}${o}
|
|
618
663
|
`);
|
|
619
664
|
};
|
|
620
|
-
|
|
621
|
-
const
|
|
622
|
-
${
|
|
623
|
-
|
|
665
|
+
outro = (o = "", t2) => {
|
|
666
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR)}
|
|
667
|
+
${styleText2("gray", S_BAR_END)} ` : "";
|
|
668
|
+
i2.write(`${e}${o}
|
|
624
669
|
|
|
625
670
|
`);
|
|
626
671
|
};
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
672
|
+
W = (l2) => styleText2("magenta", l2);
|
|
673
|
+
spinner = ({
|
|
674
|
+
indicator: l2 = "dots",
|
|
675
|
+
onCancel: h2,
|
|
676
|
+
output: n2 = process.stdout,
|
|
677
|
+
cancelMessage: G,
|
|
678
|
+
errorMessage: O,
|
|
679
|
+
frames: E = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
|
|
680
|
+
delay: F = unicode ? 80 : 120,
|
|
681
|
+
signal: m,
|
|
682
|
+
...I
|
|
683
|
+
} = {}) => {
|
|
684
|
+
const u3 = isCI();
|
|
685
|
+
let M, T, d = false, S = false, s = "", p, w = performance.now();
|
|
686
|
+
const x = getColumns(n2), k = I?.styleFrame ?? W, g = (e) => {
|
|
687
|
+
const r2 = e > 1 ? O ?? settings.messages.error : G ?? settings.messages.cancel;
|
|
688
|
+
S = e === 1, d && (a2(r2, e), S && typeof h2 == "function" && h2());
|
|
689
|
+
}, f = () => g(2), i2 = () => g(1), A = () => {
|
|
690
|
+
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);
|
|
691
|
+
}, H = () => {
|
|
692
|
+
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);
|
|
693
|
+
}, y = () => {
|
|
694
|
+
if (p === void 0) return;
|
|
695
|
+
u3 && n2.write(`
|
|
641
696
|
`);
|
|
642
|
-
const
|
|
697
|
+
const r2 = wrapAnsi(p, x, {
|
|
698
|
+
hard: true,
|
|
699
|
+
trim: false
|
|
700
|
+
}).split(`
|
|
643
701
|
`);
|
|
644
|
-
|
|
645
|
-
},
|
|
646
|
-
const
|
|
647
|
-
return
|
|
648
|
-
},
|
|
649
|
-
|
|
702
|
+
r2.length > 1 && n2.write(import_sisteransi2.cursor.up(r2.length - 1)), n2.write(import_sisteransi2.cursor.to(0)), n2.write(import_sisteransi2.erase.down());
|
|
703
|
+
}, C = (e) => e.replace(/\.+$/, ""), _ = (e) => {
|
|
704
|
+
const r2 = (performance.now() - e) / 1e3, t2 = Math.floor(r2 / 60), o = Math.floor(r2 % 60);
|
|
705
|
+
return t2 > 0 ? `[${t2}m ${o}s]` : `[${o}s]`;
|
|
706
|
+
}, N = I.withGuide ?? settings.withGuide, P = (e = "") => {
|
|
707
|
+
d = true, M = block({ output: n2 }), s = C(e), w = performance.now(), N && n2.write(`${styleText2("gray", S_BAR)}
|
|
650
708
|
`);
|
|
651
|
-
let
|
|
652
|
-
|
|
653
|
-
if (
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
709
|
+
let r2 = 0, t2 = 0;
|
|
710
|
+
A(), T = setInterval(() => {
|
|
711
|
+
if (u3 && s === p)
|
|
712
|
+
return;
|
|
713
|
+
y(), p = s;
|
|
714
|
+
const o = k(E[r2]);
|
|
715
|
+
let v;
|
|
716
|
+
if (u3)
|
|
717
|
+
v = `${o} ${s}...`;
|
|
718
|
+
else if (l2 === "timer")
|
|
719
|
+
v = `${o} ${s} ${_(w)}`;
|
|
659
720
|
else {
|
|
660
|
-
const
|
|
661
|
-
|
|
662
|
-
}
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
721
|
+
const B = ".".repeat(Math.floor(t2)).slice(0, 3);
|
|
722
|
+
v = `${o} ${s}${B}`;
|
|
723
|
+
}
|
|
724
|
+
const j = wrapAnsi(v, x, {
|
|
725
|
+
hard: true,
|
|
726
|
+
trim: false
|
|
727
|
+
});
|
|
728
|
+
n2.write(j), r2 = r2 + 1 < E.length ? r2 + 1 : 0, t2 = t2 < 4 ? t2 + 0.125 : 0;
|
|
729
|
+
}, F);
|
|
730
|
+
}, a2 = (e = "", r2 = 0, t2 = false) => {
|
|
731
|
+
if (!d) return;
|
|
732
|
+
d = false, clearInterval(T), y();
|
|
733
|
+
const o = r2 === 0 ? styleText2("green", S_STEP_SUBMIT) : r2 === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
|
|
734
|
+
s = e ?? s, t2 || (l2 === "timer" ? n2.write(`${o} ${s} ${_(w)}
|
|
735
|
+
`) : n2.write(`${o} ${s}
|
|
736
|
+
`)), H(), M();
|
|
737
|
+
};
|
|
738
|
+
return {
|
|
739
|
+
start: P,
|
|
740
|
+
stop: (e = "") => a2(e, 0),
|
|
741
|
+
message: (e = "") => {
|
|
742
|
+
s = C(e ?? s);
|
|
743
|
+
},
|
|
744
|
+
cancel: (e = "") => a2(e, 1),
|
|
745
|
+
error: (e = "") => a2(e, 2),
|
|
746
|
+
clear: () => a2("", 0, true),
|
|
747
|
+
get isCancelled() {
|
|
748
|
+
return S;
|
|
749
|
+
}
|
|
673
750
|
};
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
};
|
|
680
|
-
|
|
681
|
-
|
|
751
|
+
};
|
|
752
|
+
u2 = {
|
|
753
|
+
light: unicodeOr("\u2500", "-"),
|
|
754
|
+
heavy: unicodeOr("\u2501", "="),
|
|
755
|
+
block: unicodeOr("\u2588", "#")
|
|
756
|
+
};
|
|
757
|
+
SELECT_INSTRUCTIONS = [
|
|
758
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
759
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
760
|
+
];
|
|
761
|
+
i = `${styleText2("gray", S_BAR)} `;
|
|
682
762
|
}
|
|
683
763
|
});
|
|
684
764
|
|
|
@@ -743,9 +823,9 @@ ${contextStr}`;
|
|
|
743
823
|
|
|
744
824
|
Original error: ${originalMsg}`;
|
|
745
825
|
}
|
|
746
|
-
|
|
826
|
+
log.error(message);
|
|
747
827
|
}
|
|
748
|
-
var colors, colorUtils, currentLogLevel,
|
|
828
|
+
var colors, colorUtils, currentLogLevel, log2, error, warn, info, success;
|
|
749
829
|
var init_cli_output = __esm({
|
|
750
830
|
"packages/tooling/src/utils/cli-output.ts"() {
|
|
751
831
|
"use strict";
|
|
@@ -783,7 +863,7 @@ var init_cli_output = __esm({
|
|
|
783
863
|
currentLogLevel = envLevel;
|
|
784
864
|
}
|
|
785
865
|
}
|
|
786
|
-
|
|
866
|
+
log2 = {
|
|
787
867
|
/**
|
|
788
868
|
* Logs an error message (always shows unless Quiet level)
|
|
789
869
|
* Uses clack's log.error + explicit red color
|
|
@@ -791,7 +871,7 @@ var init_cli_output = __esm({
|
|
|
791
871
|
error(...args) {
|
|
792
872
|
if (currentLogLevel < 0 /* Quiet */) return;
|
|
793
873
|
const message = formatMessage(...args);
|
|
794
|
-
|
|
874
|
+
log.error(colorize(message, colors.brightRed));
|
|
795
875
|
},
|
|
796
876
|
/**
|
|
797
877
|
* Logs a warning message (shows at Normal level and above)
|
|
@@ -800,7 +880,7 @@ var init_cli_output = __esm({
|
|
|
800
880
|
warn(...args) {
|
|
801
881
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
802
882
|
const message = formatMessage(...args);
|
|
803
|
-
|
|
883
|
+
log.warn(colorize(message, colors.brightYellow));
|
|
804
884
|
},
|
|
805
885
|
/**
|
|
806
886
|
* Logs an info message (shows at Normal level and above)
|
|
@@ -809,7 +889,7 @@ var init_cli_output = __esm({
|
|
|
809
889
|
info(...args) {
|
|
810
890
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
811
891
|
const message = formatMessage(...args);
|
|
812
|
-
|
|
892
|
+
log.info(colorize(message, colors.brightCyan));
|
|
813
893
|
},
|
|
814
894
|
/**
|
|
815
895
|
* Logs a success message (shows at Normal level and above)
|
|
@@ -818,7 +898,7 @@ var init_cli_output = __esm({
|
|
|
818
898
|
success(...args) {
|
|
819
899
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
820
900
|
const message = formatMessage(...args);
|
|
821
|
-
|
|
901
|
+
log.success(colorize(message, colors.brightGreen));
|
|
822
902
|
},
|
|
823
903
|
/**
|
|
824
904
|
* Logs a debug message (only shows at Verbose level and above)
|
|
@@ -827,7 +907,7 @@ var init_cli_output = __esm({
|
|
|
827
907
|
debug(...args) {
|
|
828
908
|
if (currentLogLevel < 2 /* Verbose */) return;
|
|
829
909
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
830
|
-
|
|
910
|
+
log.message(
|
|
831
911
|
colorize(
|
|
832
912
|
`[${timeStamp}] \u{1F50D} DEBUG: ${formatMessage(...args)}`,
|
|
833
913
|
colors.gray
|
|
@@ -841,7 +921,7 @@ var init_cli_output = __esm({
|
|
|
841
921
|
trace(...args) {
|
|
842
922
|
if (currentLogLevel < 3 /* Debug */) return;
|
|
843
923
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
844
|
-
|
|
924
|
+
log.message(
|
|
845
925
|
colorize(
|
|
846
926
|
`[${timeStamp}] \u{1F52C} TRACE: ${formatMessage(...args)}`,
|
|
847
927
|
colors.gray
|
|
@@ -849,10 +929,10 @@ var init_cli_output = __esm({
|
|
|
849
929
|
);
|
|
850
930
|
}
|
|
851
931
|
};
|
|
852
|
-
error =
|
|
853
|
-
warn =
|
|
854
|
-
info =
|
|
855
|
-
success =
|
|
932
|
+
error = log2.error.bind(log2);
|
|
933
|
+
warn = log2.warn.bind(log2);
|
|
934
|
+
info = log2.info.bind(log2);
|
|
935
|
+
success = log2.success.bind(log2);
|
|
856
936
|
}
|
|
857
937
|
});
|
|
858
938
|
|
|
@@ -1212,9 +1292,9 @@ var require_is_glob = __commonJS({
|
|
|
1212
1292
|
index += 2;
|
|
1213
1293
|
var close = chars[open];
|
|
1214
1294
|
if (close) {
|
|
1215
|
-
var
|
|
1216
|
-
if (
|
|
1217
|
-
index =
|
|
1295
|
+
var n2 = str.indexOf(close, index);
|
|
1296
|
+
if (n2 !== -1) {
|
|
1297
|
+
index = n2 + 1;
|
|
1218
1298
|
}
|
|
1219
1299
|
}
|
|
1220
1300
|
if (str[index] === "!") {
|
|
@@ -1240,9 +1320,9 @@ var require_is_glob = __commonJS({
|
|
|
1240
1320
|
index += 2;
|
|
1241
1321
|
var close = chars[open];
|
|
1242
1322
|
if (close) {
|
|
1243
|
-
var
|
|
1244
|
-
if (
|
|
1245
|
-
index =
|
|
1323
|
+
var n2 = str.indexOf(close, index);
|
|
1324
|
+
if (n2 !== -1) {
|
|
1325
|
+
index = n2 + 1;
|
|
1246
1326
|
}
|
|
1247
1327
|
}
|
|
1248
1328
|
if (str[index] === "!") {
|
|
@@ -1320,8 +1400,8 @@ var require_utils = __commonJS({
|
|
|
1320
1400
|
if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
|
|
1321
1401
|
return (Number(max) - Number(min)) / Number(step) >= limit;
|
|
1322
1402
|
};
|
|
1323
|
-
exports.escapeNode = (
|
|
1324
|
-
const node =
|
|
1403
|
+
exports.escapeNode = (block2, n2 = 0, type) => {
|
|
1404
|
+
const node = block2.nodes[n2];
|
|
1325
1405
|
if (!node) return;
|
|
1326
1406
|
if (type && node.type === type || node.type === "open" || node.type === "close") {
|
|
1327
1407
|
if (node.escaped !== true) {
|
|
@@ -1338,15 +1418,15 @@ var require_utils = __commonJS({
|
|
|
1338
1418
|
}
|
|
1339
1419
|
return false;
|
|
1340
1420
|
};
|
|
1341
|
-
exports.isInvalidBrace = (
|
|
1342
|
-
if (
|
|
1343
|
-
if (
|
|
1344
|
-
if (
|
|
1345
|
-
|
|
1421
|
+
exports.isInvalidBrace = (block2) => {
|
|
1422
|
+
if (block2.type !== "brace") return false;
|
|
1423
|
+
if (block2.invalid === true || block2.dollar) return true;
|
|
1424
|
+
if (block2.commas >> 0 + block2.ranges >> 0 === 0) {
|
|
1425
|
+
block2.invalid = true;
|
|
1346
1426
|
return true;
|
|
1347
1427
|
}
|
|
1348
|
-
if (
|
|
1349
|
-
|
|
1428
|
+
if (block2.open !== true || block2.close !== true) {
|
|
1429
|
+
block2.invalid = true;
|
|
1350
1430
|
return true;
|
|
1351
1431
|
}
|
|
1352
1432
|
return false;
|
|
@@ -1365,8 +1445,8 @@ var require_utils = __commonJS({
|
|
|
1365
1445
|
exports.flatten = (...args) => {
|
|
1366
1446
|
const result = [];
|
|
1367
1447
|
const flat = (arr) => {
|
|
1368
|
-
for (let
|
|
1369
|
-
const ele = arr[
|
|
1448
|
+
for (let i2 = 0; i2 < arr.length; i2++) {
|
|
1449
|
+
const ele = arr[i2];
|
|
1370
1450
|
if (Array.isArray(ele)) {
|
|
1371
1451
|
flat(ele);
|
|
1372
1452
|
continue;
|
|
@@ -1460,9 +1540,9 @@ var require_to_regex_range = __commonJS({
|
|
|
1460
1540
|
if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
|
|
1461
1541
|
return toRegexRange.cache[cacheKey].result;
|
|
1462
1542
|
}
|
|
1463
|
-
let
|
|
1543
|
+
let a2 = Math.min(min, max);
|
|
1464
1544
|
let b = Math.max(min, max);
|
|
1465
|
-
if (Math.abs(
|
|
1545
|
+
if (Math.abs(a2 - b) === 1) {
|
|
1466
1546
|
let result = min + "|" + max;
|
|
1467
1547
|
if (opts.capture) {
|
|
1468
1548
|
return `(${result})`;
|
|
@@ -1473,20 +1553,20 @@ var require_to_regex_range = __commonJS({
|
|
|
1473
1553
|
return `(?:${result})`;
|
|
1474
1554
|
}
|
|
1475
1555
|
let isPadded = hasPadding(min) || hasPadding(max);
|
|
1476
|
-
let state = { min, max, a, b };
|
|
1556
|
+
let state = { min, max, a: a2, b };
|
|
1477
1557
|
let positives = [];
|
|
1478
1558
|
let negatives = [];
|
|
1479
1559
|
if (isPadded) {
|
|
1480
1560
|
state.isPadded = isPadded;
|
|
1481
1561
|
state.maxLen = String(state.max).length;
|
|
1482
1562
|
}
|
|
1483
|
-
if (
|
|
1563
|
+
if (a2 < 0) {
|
|
1484
1564
|
let newMin = b < 0 ? Math.abs(b) : 1;
|
|
1485
|
-
negatives = splitToPatterns(newMin, Math.abs(
|
|
1486
|
-
|
|
1565
|
+
negatives = splitToPatterns(newMin, Math.abs(a2), state, opts);
|
|
1566
|
+
a2 = state.a = 0;
|
|
1487
1567
|
}
|
|
1488
1568
|
if (b >= 0) {
|
|
1489
|
-
positives = splitToPatterns(
|
|
1569
|
+
positives = splitToPatterns(a2, b, state, opts);
|
|
1490
1570
|
}
|
|
1491
1571
|
state.negatives = negatives;
|
|
1492
1572
|
state.positives = positives;
|
|
@@ -1534,8 +1614,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1534
1614
|
let digits = zipped.length;
|
|
1535
1615
|
let pattern = "";
|
|
1536
1616
|
let count = 0;
|
|
1537
|
-
for (let
|
|
1538
|
-
let [startDigit, stopDigit] = zipped[
|
|
1617
|
+
for (let i2 = 0; i2 < digits; i2++) {
|
|
1618
|
+
let [startDigit, stopDigit] = zipped[i2];
|
|
1539
1619
|
if (startDigit === stopDigit) {
|
|
1540
1620
|
pattern += startDigit;
|
|
1541
1621
|
} else if (startDigit !== "0" || stopDigit !== "9") {
|
|
@@ -1554,8 +1634,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1554
1634
|
let tokens = [];
|
|
1555
1635
|
let start = min;
|
|
1556
1636
|
let prev;
|
|
1557
|
-
for (let
|
|
1558
|
-
let max2 = ranges[
|
|
1637
|
+
for (let i2 = 0; i2 < ranges.length; i2++) {
|
|
1638
|
+
let max2 = ranges[i2];
|
|
1559
1639
|
let obj = rangeToPattern(String(start), String(max2), options);
|
|
1560
1640
|
let zeros = "";
|
|
1561
1641
|
if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
|
|
@@ -1590,13 +1670,13 @@ var require_to_regex_range = __commonJS({
|
|
|
1590
1670
|
}
|
|
1591
1671
|
return result;
|
|
1592
1672
|
}
|
|
1593
|
-
function zip(
|
|
1673
|
+
function zip(a2, b) {
|
|
1594
1674
|
let arr = [];
|
|
1595
|
-
for (let
|
|
1675
|
+
for (let i2 = 0; i2 < a2.length; i2++) arr.push([a2[i2], b[i2]]);
|
|
1596
1676
|
return arr;
|
|
1597
1677
|
}
|
|
1598
|
-
function compare(
|
|
1599
|
-
return
|
|
1678
|
+
function compare(a2, b) {
|
|
1679
|
+
return a2 > b ? 1 : b > a2 ? -1 : 0;
|
|
1600
1680
|
}
|
|
1601
1681
|
function contains(arr, key, val) {
|
|
1602
1682
|
return arr.some((ele) => ele[key] === val);
|
|
@@ -1614,8 +1694,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1614
1694
|
}
|
|
1615
1695
|
return "";
|
|
1616
1696
|
}
|
|
1617
|
-
function toCharacterClass(
|
|
1618
|
-
return `[${
|
|
1697
|
+
function toCharacterClass(a2, b, options) {
|
|
1698
|
+
return `[${a2}${b - a2 === 1 ? "" : "-"}${b}]`;
|
|
1619
1699
|
}
|
|
1620
1700
|
function hasPadding(str) {
|
|
1621
1701
|
return /^-?(0+)\d/.test(str);
|
|
@@ -1694,8 +1774,8 @@ var require_fill_range = __commonJS({
|
|
|
1694
1774
|
return negative ? "-" + input : input;
|
|
1695
1775
|
};
|
|
1696
1776
|
var toSequence = (parts, options, maxLen) => {
|
|
1697
|
-
parts.negatives.sort((
|
|
1698
|
-
parts.positives.sort((
|
|
1777
|
+
parts.negatives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
1778
|
+
parts.positives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
1699
1779
|
let prefix = options.capture ? "" : "?:";
|
|
1700
1780
|
let positives = "";
|
|
1701
1781
|
let negatives = "";
|
|
@@ -1716,12 +1796,12 @@ var require_fill_range = __commonJS({
|
|
|
1716
1796
|
}
|
|
1717
1797
|
return result;
|
|
1718
1798
|
};
|
|
1719
|
-
var toRange = (
|
|
1799
|
+
var toRange = (a2, b, isNumbers, options) => {
|
|
1720
1800
|
if (isNumbers) {
|
|
1721
|
-
return toRegexRange(
|
|
1801
|
+
return toRegexRange(a2, b, { wrap: false, ...options });
|
|
1722
1802
|
}
|
|
1723
|
-
let start = String.fromCharCode(
|
|
1724
|
-
if (
|
|
1803
|
+
let start = String.fromCharCode(a2);
|
|
1804
|
+
if (a2 === b) return start;
|
|
1725
1805
|
let stop = String.fromCharCode(b);
|
|
1726
1806
|
return `[${start}-${stop}]`;
|
|
1727
1807
|
};
|
|
@@ -1747,15 +1827,15 @@ var require_fill_range = __commonJS({
|
|
|
1747
1827
|
return [];
|
|
1748
1828
|
};
|
|
1749
1829
|
var fillNumbers = (start, end, step = 1, options = {}) => {
|
|
1750
|
-
let
|
|
1830
|
+
let a2 = Number(start);
|
|
1751
1831
|
let b = Number(end);
|
|
1752
|
-
if (!Number.isInteger(
|
|
1832
|
+
if (!Number.isInteger(a2) || !Number.isInteger(b)) {
|
|
1753
1833
|
if (options.strictRanges === true) throw rangeError([start, end]);
|
|
1754
1834
|
return [];
|
|
1755
1835
|
}
|
|
1756
|
-
if (
|
|
1836
|
+
if (a2 === 0) a2 = 0;
|
|
1757
1837
|
if (b === 0) b = 0;
|
|
1758
|
-
let descending =
|
|
1838
|
+
let descending = a2 > b;
|
|
1759
1839
|
let startString = String(start);
|
|
1760
1840
|
let endString = String(end);
|
|
1761
1841
|
let stepString = String(step);
|
|
@@ -1771,13 +1851,13 @@ var require_fill_range = __commonJS({
|
|
|
1771
1851
|
let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
|
|
1772
1852
|
let range = [];
|
|
1773
1853
|
let index = 0;
|
|
1774
|
-
while (descending ?
|
|
1854
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
1775
1855
|
if (options.toRegex === true && step > 1) {
|
|
1776
|
-
push(
|
|
1856
|
+
push(a2);
|
|
1777
1857
|
} else {
|
|
1778
|
-
range.push(pad(format(
|
|
1858
|
+
range.push(pad(format(a2, index), maxLen, toNumber));
|
|
1779
1859
|
}
|
|
1780
|
-
|
|
1860
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
1781
1861
|
index++;
|
|
1782
1862
|
}
|
|
1783
1863
|
if (options.toRegex === true) {
|
|
@@ -1790,19 +1870,19 @@ var require_fill_range = __commonJS({
|
|
|
1790
1870
|
return invalidRange(start, end, options);
|
|
1791
1871
|
}
|
|
1792
1872
|
let format = options.transform || ((val) => String.fromCharCode(val));
|
|
1793
|
-
let
|
|
1873
|
+
let a2 = `${start}`.charCodeAt(0);
|
|
1794
1874
|
let b = `${end}`.charCodeAt(0);
|
|
1795
|
-
let descending =
|
|
1796
|
-
let min = Math.min(
|
|
1797
|
-
let max = Math.max(
|
|
1875
|
+
let descending = a2 > b;
|
|
1876
|
+
let min = Math.min(a2, b);
|
|
1877
|
+
let max = Math.max(a2, b);
|
|
1798
1878
|
if (options.toRegex && step === 1) {
|
|
1799
1879
|
return toRange(min, max, false, options);
|
|
1800
1880
|
}
|
|
1801
1881
|
let range = [];
|
|
1802
1882
|
let index = 0;
|
|
1803
|
-
while (descending ?
|
|
1804
|
-
range.push(format(
|
|
1805
|
-
|
|
1883
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
1884
|
+
range.push(format(a2, index));
|
|
1885
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
1806
1886
|
index++;
|
|
1807
1887
|
}
|
|
1808
1888
|
if (options.toRegex === true) {
|
|
@@ -1926,17 +2006,17 @@ var require_expand = __commonJS({
|
|
|
1926
2006
|
const walk = (node, parent = {}) => {
|
|
1927
2007
|
node.queue = [];
|
|
1928
2008
|
let p = parent;
|
|
1929
|
-
let
|
|
2009
|
+
let q = parent.queue;
|
|
1930
2010
|
while (p.type !== "brace" && p.type !== "root" && p.parent) {
|
|
1931
2011
|
p = p.parent;
|
|
1932
|
-
|
|
2012
|
+
q = p.queue;
|
|
1933
2013
|
}
|
|
1934
2014
|
if (node.invalid || node.dollar) {
|
|
1935
|
-
|
|
2015
|
+
q.push(append(q.pop(), stringify2(node, options)));
|
|
1936
2016
|
return;
|
|
1937
2017
|
}
|
|
1938
2018
|
if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
|
|
1939
|
-
|
|
2019
|
+
q.push(append(q.pop(), ["{}"]));
|
|
1940
2020
|
return;
|
|
1941
2021
|
}
|
|
1942
2022
|
if (node.nodes && node.ranges > 0) {
|
|
@@ -1948,26 +2028,26 @@ var require_expand = __commonJS({
|
|
|
1948
2028
|
if (range.length === 0) {
|
|
1949
2029
|
range = stringify2(node, options);
|
|
1950
2030
|
}
|
|
1951
|
-
|
|
2031
|
+
q.push(append(q.pop(), range));
|
|
1952
2032
|
node.nodes = [];
|
|
1953
2033
|
return;
|
|
1954
2034
|
}
|
|
1955
2035
|
const enclose = utils.encloseBrace(node);
|
|
1956
2036
|
let queue = node.queue;
|
|
1957
|
-
let
|
|
1958
|
-
while (
|
|
1959
|
-
|
|
1960
|
-
queue =
|
|
2037
|
+
let block2 = node;
|
|
2038
|
+
while (block2.type !== "brace" && block2.type !== "root" && block2.parent) {
|
|
2039
|
+
block2 = block2.parent;
|
|
2040
|
+
queue = block2.queue;
|
|
1961
2041
|
}
|
|
1962
|
-
for (let
|
|
1963
|
-
const child = node.nodes[
|
|
2042
|
+
for (let i2 = 0; i2 < node.nodes.length; i2++) {
|
|
2043
|
+
const child = node.nodes[i2];
|
|
1964
2044
|
if (child.type === "comma" && node.type === "brace") {
|
|
1965
|
-
if (
|
|
2045
|
+
if (i2 === 1) queue.push("");
|
|
1966
2046
|
queue.push("");
|
|
1967
2047
|
continue;
|
|
1968
2048
|
}
|
|
1969
2049
|
if (child.type === "close") {
|
|
1970
|
-
|
|
2050
|
+
q.push(append(q.pop(), queue, enclose));
|
|
1971
2051
|
continue;
|
|
1972
2052
|
}
|
|
1973
2053
|
if (child.value && child.type !== "open") {
|
|
@@ -2134,7 +2214,7 @@ var require_parse = __commonJS({
|
|
|
2134
2214
|
}
|
|
2135
2215
|
const ast = { type: "root", input, nodes: [] };
|
|
2136
2216
|
const stack = [ast];
|
|
2137
|
-
let
|
|
2217
|
+
let block2 = ast;
|
|
2138
2218
|
let prev = ast;
|
|
2139
2219
|
let brackets = 0;
|
|
2140
2220
|
const length = input.length;
|
|
@@ -2150,15 +2230,15 @@ var require_parse = __commonJS({
|
|
|
2150
2230
|
prev.value += node.value;
|
|
2151
2231
|
return;
|
|
2152
2232
|
}
|
|
2153
|
-
|
|
2154
|
-
node.parent =
|
|
2233
|
+
block2.nodes.push(node);
|
|
2234
|
+
node.parent = block2;
|
|
2155
2235
|
node.prev = prev;
|
|
2156
2236
|
prev = node;
|
|
2157
2237
|
return node;
|
|
2158
2238
|
};
|
|
2159
2239
|
push({ type: "bos" });
|
|
2160
2240
|
while (index < length) {
|
|
2161
|
-
|
|
2241
|
+
block2 = stack[stack.length - 1];
|
|
2162
2242
|
value = advance();
|
|
2163
2243
|
if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
|
|
2164
2244
|
continue;
|
|
@@ -2195,19 +2275,19 @@ var require_parse = __commonJS({
|
|
|
2195
2275
|
continue;
|
|
2196
2276
|
}
|
|
2197
2277
|
if (value === CHAR_LEFT_PARENTHESES) {
|
|
2198
|
-
|
|
2199
|
-
stack.push(
|
|
2278
|
+
block2 = push({ type: "paren", nodes: [] });
|
|
2279
|
+
stack.push(block2);
|
|
2200
2280
|
push({ type: "text", value });
|
|
2201
2281
|
continue;
|
|
2202
2282
|
}
|
|
2203
2283
|
if (value === CHAR_RIGHT_PARENTHESES) {
|
|
2204
|
-
if (
|
|
2284
|
+
if (block2.type !== "paren") {
|
|
2205
2285
|
push({ type: "text", value });
|
|
2206
2286
|
continue;
|
|
2207
2287
|
}
|
|
2208
|
-
|
|
2288
|
+
block2 = stack.pop();
|
|
2209
2289
|
push({ type: "text", value });
|
|
2210
|
-
|
|
2290
|
+
block2 = stack[stack.length - 1];
|
|
2211
2291
|
continue;
|
|
2212
2292
|
}
|
|
2213
2293
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
@@ -2232,7 +2312,7 @@ var require_parse = __commonJS({
|
|
|
2232
2312
|
}
|
|
2233
2313
|
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
2234
2314
|
depth++;
|
|
2235
|
-
const dollar = prev.value && prev.value.slice(-1) === "$" ||
|
|
2315
|
+
const dollar = prev.value && prev.value.slice(-1) === "$" || block2.dollar === true;
|
|
2236
2316
|
const brace = {
|
|
2237
2317
|
type: "brace",
|
|
2238
2318
|
open: true,
|
|
@@ -2243,52 +2323,52 @@ var require_parse = __commonJS({
|
|
|
2243
2323
|
ranges: 0,
|
|
2244
2324
|
nodes: []
|
|
2245
2325
|
};
|
|
2246
|
-
|
|
2247
|
-
stack.push(
|
|
2326
|
+
block2 = push(brace);
|
|
2327
|
+
stack.push(block2);
|
|
2248
2328
|
push({ type: "open", value });
|
|
2249
2329
|
continue;
|
|
2250
2330
|
}
|
|
2251
2331
|
if (value === CHAR_RIGHT_CURLY_BRACE) {
|
|
2252
|
-
if (
|
|
2332
|
+
if (block2.type !== "brace") {
|
|
2253
2333
|
push({ type: "text", value });
|
|
2254
2334
|
continue;
|
|
2255
2335
|
}
|
|
2256
2336
|
const type = "close";
|
|
2257
|
-
|
|
2258
|
-
|
|
2337
|
+
block2 = stack.pop();
|
|
2338
|
+
block2.close = true;
|
|
2259
2339
|
push({ type, value });
|
|
2260
2340
|
depth--;
|
|
2261
|
-
|
|
2341
|
+
block2 = stack[stack.length - 1];
|
|
2262
2342
|
continue;
|
|
2263
2343
|
}
|
|
2264
2344
|
if (value === CHAR_COMMA && depth > 0) {
|
|
2265
|
-
if (
|
|
2266
|
-
|
|
2267
|
-
const open =
|
|
2268
|
-
|
|
2345
|
+
if (block2.ranges > 0) {
|
|
2346
|
+
block2.ranges = 0;
|
|
2347
|
+
const open = block2.nodes.shift();
|
|
2348
|
+
block2.nodes = [open, { type: "text", value: stringify2(block2) }];
|
|
2269
2349
|
}
|
|
2270
2350
|
push({ type: "comma", value });
|
|
2271
|
-
|
|
2351
|
+
block2.commas++;
|
|
2272
2352
|
continue;
|
|
2273
2353
|
}
|
|
2274
|
-
if (value === CHAR_DOT && depth > 0 &&
|
|
2275
|
-
const siblings =
|
|
2354
|
+
if (value === CHAR_DOT && depth > 0 && block2.commas === 0) {
|
|
2355
|
+
const siblings = block2.nodes;
|
|
2276
2356
|
if (depth === 0 || siblings.length === 0) {
|
|
2277
2357
|
push({ type: "text", value });
|
|
2278
2358
|
continue;
|
|
2279
2359
|
}
|
|
2280
2360
|
if (prev.type === "dot") {
|
|
2281
|
-
|
|
2361
|
+
block2.range = [];
|
|
2282
2362
|
prev.value += value;
|
|
2283
2363
|
prev.type = "range";
|
|
2284
|
-
if (
|
|
2285
|
-
|
|
2286
|
-
|
|
2364
|
+
if (block2.nodes.length !== 3 && block2.nodes.length !== 5) {
|
|
2365
|
+
block2.invalid = true;
|
|
2366
|
+
block2.ranges = 0;
|
|
2287
2367
|
prev.type = "text";
|
|
2288
2368
|
continue;
|
|
2289
2369
|
}
|
|
2290
|
-
|
|
2291
|
-
|
|
2370
|
+
block2.ranges++;
|
|
2371
|
+
block2.args = [];
|
|
2292
2372
|
continue;
|
|
2293
2373
|
}
|
|
2294
2374
|
if (prev.type === "range") {
|
|
@@ -2296,7 +2376,7 @@ var require_parse = __commonJS({
|
|
|
2296
2376
|
const before = siblings[siblings.length - 1];
|
|
2297
2377
|
before.value += prev.value + value;
|
|
2298
2378
|
prev = before;
|
|
2299
|
-
|
|
2379
|
+
block2.ranges--;
|
|
2300
2380
|
continue;
|
|
2301
2381
|
}
|
|
2302
2382
|
push({ type: "dot", value });
|
|
@@ -2305,9 +2385,9 @@ var require_parse = __commonJS({
|
|
|
2305
2385
|
push({ type: "text", value });
|
|
2306
2386
|
}
|
|
2307
2387
|
do {
|
|
2308
|
-
|
|
2309
|
-
if (
|
|
2310
|
-
|
|
2388
|
+
block2 = stack.pop();
|
|
2389
|
+
if (block2.type !== "root") {
|
|
2390
|
+
block2.nodes.forEach((node) => {
|
|
2311
2391
|
if (!node.nodes) {
|
|
2312
2392
|
if (node.type === "open") node.isOpen = true;
|
|
2313
2393
|
if (node.type === "close") node.isClose = true;
|
|
@@ -2316,8 +2396,8 @@ var require_parse = __commonJS({
|
|
|
2316
2396
|
}
|
|
2317
2397
|
});
|
|
2318
2398
|
const parent = stack[stack.length - 1];
|
|
2319
|
-
const index2 = parent.nodes.indexOf(
|
|
2320
|
-
parent.nodes.splice(index2, 1, ...
|
|
2399
|
+
const index2 = parent.nodes.indexOf(block2);
|
|
2400
|
+
parent.nodes.splice(index2, 1, ...block2.nodes);
|
|
2321
2401
|
}
|
|
2322
2402
|
} while (stack.length > 0);
|
|
2323
2403
|
push({ type: "eos" });
|
|
@@ -2950,9 +3030,9 @@ var require_scan = __commonJS({
|
|
|
2950
3030
|
if (opts.parts === true || opts.tokens === true) {
|
|
2951
3031
|
let prevIndex;
|
|
2952
3032
|
for (let idx = 0; idx < slashes.length; idx++) {
|
|
2953
|
-
const
|
|
2954
|
-
const
|
|
2955
|
-
const value = input.slice(
|
|
3033
|
+
const n2 = prevIndex ? prevIndex + 1 : start;
|
|
3034
|
+
const i2 = slashes[idx];
|
|
3035
|
+
const value = input.slice(n2, i2);
|
|
2956
3036
|
if (opts.tokens) {
|
|
2957
3037
|
if (idx === 0 && start !== 0) {
|
|
2958
3038
|
tokens[idx].isPrefix = true;
|
|
@@ -2966,7 +3046,7 @@ var require_scan = __commonJS({
|
|
|
2966
3046
|
if (idx !== 0 || value !== "") {
|
|
2967
3047
|
parts.push(value);
|
|
2968
3048
|
}
|
|
2969
|
-
prevIndex =
|
|
3049
|
+
prevIndex = i2;
|
|
2970
3050
|
}
|
|
2971
3051
|
if (prevIndex && prevIndex + 1 < input.length) {
|
|
2972
3052
|
const value = input.slice(prevIndex + 1);
|
|
@@ -3095,15 +3175,15 @@ var require_parse2 = __commonJS({
|
|
|
3095
3175
|
};
|
|
3096
3176
|
var hasRepeatedCharPrefixOverlap = (branches) => {
|
|
3097
3177
|
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
3098
|
-
for (let
|
|
3099
|
-
for (let j =
|
|
3100
|
-
const
|
|
3178
|
+
for (let i2 = 0; i2 < values.length; i2++) {
|
|
3179
|
+
for (let j = i2 + 1; j < values.length; j++) {
|
|
3180
|
+
const a2 = values[i2];
|
|
3101
3181
|
const b = values[j];
|
|
3102
|
-
const char =
|
|
3103
|
-
if (!char ||
|
|
3182
|
+
const char = a2[0];
|
|
3183
|
+
if (!char || a2 !== char.repeat(a2.length) || b !== char.repeat(b.length)) {
|
|
3104
3184
|
continue;
|
|
3105
3185
|
}
|
|
3106
|
-
if (
|
|
3186
|
+
if (a2 === b || a2.startsWith(b) || b.startsWith(a2)) {
|
|
3107
3187
|
return true;
|
|
3108
3188
|
}
|
|
3109
3189
|
}
|
|
@@ -3118,8 +3198,8 @@ var require_parse2 = __commonJS({
|
|
|
3118
3198
|
let paren = 0;
|
|
3119
3199
|
let quote = 0;
|
|
3120
3200
|
let escaped = false;
|
|
3121
|
-
for (let
|
|
3122
|
-
const ch = pattern[
|
|
3201
|
+
for (let i2 = 1; i2 < pattern.length; i2++) {
|
|
3202
|
+
const ch = pattern[i2];
|
|
3123
3203
|
if (escaped === true) {
|
|
3124
3204
|
escaped = false;
|
|
3125
3205
|
continue;
|
|
@@ -3153,13 +3233,13 @@ var require_parse2 = __commonJS({
|
|
|
3153
3233
|
if (ch === ")") {
|
|
3154
3234
|
paren--;
|
|
3155
3235
|
if (paren === 0) {
|
|
3156
|
-
if (requireEnd === true &&
|
|
3236
|
+
if (requireEnd === true && i2 !== pattern.length - 1) {
|
|
3157
3237
|
return;
|
|
3158
3238
|
}
|
|
3159
3239
|
return {
|
|
3160
3240
|
type: pattern[0],
|
|
3161
|
-
body: pattern.slice(2,
|
|
3162
|
-
end:
|
|
3241
|
+
body: pattern.slice(2, i2),
|
|
3242
|
+
end: i2
|
|
3163
3243
|
};
|
|
3164
3244
|
}
|
|
3165
3245
|
}
|
|
@@ -3291,7 +3371,7 @@ var require_parse2 = __commonJS({
|
|
|
3291
3371
|
let prev = bos;
|
|
3292
3372
|
let value;
|
|
3293
3373
|
const eos = () => state.index === len - 1;
|
|
3294
|
-
const peek = state.peek = (
|
|
3374
|
+
const peek = state.peek = (n2 = 1) => input[state.index + n2];
|
|
3295
3375
|
const advance = state.advance = () => input[++state.index] || "";
|
|
3296
3376
|
const remaining = () => input.slice(state.index + 1);
|
|
3297
3377
|
const consume = (value2 = "", num = 0) => {
|
|
@@ -3372,10 +3452,10 @@ var require_parse2 = __commonJS({
|
|
|
3372
3452
|
open.type = "text";
|
|
3373
3453
|
open.value = literal;
|
|
3374
3454
|
open.output = safeOutput || utils.escapeRegex(literal);
|
|
3375
|
-
for (let
|
|
3376
|
-
tokens[
|
|
3377
|
-
tokens[
|
|
3378
|
-
delete tokens[
|
|
3455
|
+
for (let i2 = token.tokensIndex + 1; i2 < tokens.length; i2++) {
|
|
3456
|
+
tokens[i2].value = "";
|
|
3457
|
+
tokens[i2].output = "";
|
|
3458
|
+
delete tokens[i2].suffix;
|
|
3379
3459
|
}
|
|
3380
3460
|
state.output = token.output + open.output;
|
|
3381
3461
|
state.backtrack = true;
|
|
@@ -3618,13 +3698,13 @@ var require_parse2 = __commonJS({
|
|
|
3618
3698
|
if (brace.dots === true) {
|
|
3619
3699
|
const arr = tokens.slice();
|
|
3620
3700
|
const range = [];
|
|
3621
|
-
for (let
|
|
3701
|
+
for (let i2 = arr.length - 1; i2 >= 0; i2--) {
|
|
3622
3702
|
tokens.pop();
|
|
3623
|
-
if (arr[
|
|
3703
|
+
if (arr[i2].type === "brace") {
|
|
3624
3704
|
break;
|
|
3625
3705
|
}
|
|
3626
|
-
if (arr[
|
|
3627
|
-
range.unshift(arr[
|
|
3706
|
+
if (arr[i2].type !== "dots") {
|
|
3707
|
+
range.unshift(arr[i2].value);
|
|
3628
3708
|
}
|
|
3629
3709
|
}
|
|
3630
3710
|
output = expandRange(range, opts);
|
|
@@ -4167,8 +4247,8 @@ var require_micromatch = __commonJS({
|
|
|
4167
4247
|
options.onResult(state);
|
|
4168
4248
|
}
|
|
4169
4249
|
};
|
|
4170
|
-
for (let
|
|
4171
|
-
let isMatch = picomatch(String(patterns[
|
|
4250
|
+
for (let i2 = 0; i2 < patterns.length; i2++) {
|
|
4251
|
+
let isMatch = picomatch(String(patterns[i2]), { ...options, onResult }, true);
|
|
4172
4252
|
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
|
|
4173
4253
|
if (negated) negatives++;
|
|
4174
4254
|
for (let item of list) {
|
|
@@ -4416,7 +4496,7 @@ var require_pattern = __commonJS({
|
|
|
4416
4496
|
exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
|
4417
4497
|
function expandBraceExpansion(pattern) {
|
|
4418
4498
|
const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });
|
|
4419
|
-
patterns.sort((
|
|
4499
|
+
patterns.sort((a2, b) => a2.length - b.length);
|
|
4420
4500
|
return patterns.filter((pattern2) => pattern2 !== "");
|
|
4421
4501
|
}
|
|
4422
4502
|
exports.expandBraceExpansion = expandBraceExpansion;
|
|
@@ -4497,8 +4577,8 @@ var require_merge2 = __commonJS({
|
|
|
4497
4577
|
}
|
|
4498
4578
|
const mergedStream = PassThrough(options);
|
|
4499
4579
|
function addStream() {
|
|
4500
|
-
for (let
|
|
4501
|
-
streamsQueue.push(pauseStreams(arguments[
|
|
4580
|
+
for (let i2 = 0, len = arguments.length; i2 < len; i2++) {
|
|
4581
|
+
streamsQueue.push(pauseStreams(arguments[i2], options));
|
|
4502
4582
|
}
|
|
4503
4583
|
mergeStream();
|
|
4504
4584
|
return this;
|
|
@@ -4547,8 +4627,8 @@ var require_merge2 = __commonJS({
|
|
|
4547
4627
|
stream.pipe(mergedStream, { end: false });
|
|
4548
4628
|
stream.resume();
|
|
4549
4629
|
}
|
|
4550
|
-
for (let
|
|
4551
|
-
pipe(streams[
|
|
4630
|
+
for (let i2 = 0; i2 < streams.length; i2++) {
|
|
4631
|
+
pipe(streams[i2]);
|
|
4552
4632
|
}
|
|
4553
4633
|
next();
|
|
4554
4634
|
}
|
|
@@ -4579,8 +4659,8 @@ var require_merge2 = __commonJS({
|
|
|
4579
4659
|
}
|
|
4580
4660
|
streams.pause();
|
|
4581
4661
|
} else {
|
|
4582
|
-
for (let
|
|
4583
|
-
streams[
|
|
4662
|
+
for (let i2 = 0, len = streams.length; i2 < len; i2++) {
|
|
4663
|
+
streams[i2] = pauseStreams(streams[i2], options);
|
|
4584
4664
|
}
|
|
4585
4665
|
}
|
|
4586
4666
|
return streams;
|
|
@@ -4662,13 +4742,13 @@ var require_tasks = __commonJS({
|
|
|
4662
4742
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4663
4743
|
exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
|
|
4664
4744
|
var utils = require_utils3();
|
|
4665
|
-
function generate(input,
|
|
4666
|
-
const patterns = processPatterns(input,
|
|
4667
|
-
const ignore = processPatterns(
|
|
4745
|
+
function generate(input, settings2) {
|
|
4746
|
+
const patterns = processPatterns(input, settings2);
|
|
4747
|
+
const ignore = processPatterns(settings2.ignore, settings2);
|
|
4668
4748
|
const positivePatterns = getPositivePatterns(patterns);
|
|
4669
4749
|
const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
|
|
4670
|
-
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern,
|
|
4671
|
-
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern,
|
|
4750
|
+
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings2));
|
|
4751
|
+
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings2));
|
|
4672
4752
|
const staticTasks = convertPatternsToTasks(
|
|
4673
4753
|
staticPatterns,
|
|
4674
4754
|
negativePatterns,
|
|
@@ -4684,12 +4764,12 @@ var require_tasks = __commonJS({
|
|
|
4684
4764
|
return staticTasks.concat(dynamicTasks);
|
|
4685
4765
|
}
|
|
4686
4766
|
exports.generate = generate;
|
|
4687
|
-
function processPatterns(input,
|
|
4767
|
+
function processPatterns(input, settings2) {
|
|
4688
4768
|
let patterns = input;
|
|
4689
|
-
if (
|
|
4769
|
+
if (settings2.braceExpansion) {
|
|
4690
4770
|
patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);
|
|
4691
4771
|
}
|
|
4692
|
-
if (
|
|
4772
|
+
if (settings2.baseNameMatch) {
|
|
4693
4773
|
patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`);
|
|
4694
4774
|
}
|
|
4695
4775
|
return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));
|
|
@@ -4758,26 +4838,26 @@ var require_async = __commonJS({
|
|
|
4758
4838
|
init_utils2();
|
|
4759
4839
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4760
4840
|
exports.read = void 0;
|
|
4761
|
-
function read(path,
|
|
4762
|
-
|
|
4841
|
+
function read(path, settings2, callback) {
|
|
4842
|
+
settings2.fs.lstat(path, (lstatError, lstat) => {
|
|
4763
4843
|
if (lstatError !== null) {
|
|
4764
4844
|
callFailureCallback(callback, lstatError);
|
|
4765
4845
|
return;
|
|
4766
4846
|
}
|
|
4767
|
-
if (!lstat.isSymbolicLink() || !
|
|
4847
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
4768
4848
|
callSuccessCallback(callback, lstat);
|
|
4769
4849
|
return;
|
|
4770
4850
|
}
|
|
4771
|
-
|
|
4851
|
+
settings2.fs.stat(path, (statError, stat) => {
|
|
4772
4852
|
if (statError !== null) {
|
|
4773
|
-
if (
|
|
4853
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4774
4854
|
callFailureCallback(callback, statError);
|
|
4775
4855
|
return;
|
|
4776
4856
|
}
|
|
4777
4857
|
callSuccessCallback(callback, lstat);
|
|
4778
4858
|
return;
|
|
4779
4859
|
}
|
|
4780
|
-
if (
|
|
4860
|
+
if (settings2.markSymbolicLink) {
|
|
4781
4861
|
stat.isSymbolicLink = () => true;
|
|
4782
4862
|
}
|
|
4783
4863
|
callSuccessCallback(callback, stat);
|
|
@@ -4801,19 +4881,19 @@ var require_sync = __commonJS({
|
|
|
4801
4881
|
init_utils2();
|
|
4802
4882
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4803
4883
|
exports.read = void 0;
|
|
4804
|
-
function read(path,
|
|
4805
|
-
const lstat =
|
|
4806
|
-
if (!lstat.isSymbolicLink() || !
|
|
4884
|
+
function read(path, settings2) {
|
|
4885
|
+
const lstat = settings2.fs.lstatSync(path);
|
|
4886
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
4807
4887
|
return lstat;
|
|
4808
4888
|
}
|
|
4809
4889
|
try {
|
|
4810
|
-
const stat =
|
|
4811
|
-
if (
|
|
4890
|
+
const stat = settings2.fs.statSync(path);
|
|
4891
|
+
if (settings2.markSymbolicLink) {
|
|
4812
4892
|
stat.isSymbolicLink = () => true;
|
|
4813
4893
|
}
|
|
4814
4894
|
return stat;
|
|
4815
4895
|
} catch (error2) {
|
|
4816
|
-
if (!
|
|
4896
|
+
if (!settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4817
4897
|
return lstat;
|
|
4818
4898
|
}
|
|
4819
4899
|
throw error2;
|
|
@@ -4890,8 +4970,8 @@ var require_out = __commonJS({
|
|
|
4890
4970
|
}
|
|
4891
4971
|
exports.stat = stat;
|
|
4892
4972
|
function statSync2(path, optionsOrSettings) {
|
|
4893
|
-
const
|
|
4894
|
-
return sync.read(path,
|
|
4973
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
4974
|
+
return sync.read(path, settings2);
|
|
4895
4975
|
}
|
|
4896
4976
|
exports.statSync = statSync2;
|
|
4897
4977
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -4939,8 +5019,8 @@ var require_run_parallel = __commonJS({
|
|
|
4939
5019
|
if (isSync) queueMicrotask2(end);
|
|
4940
5020
|
else end();
|
|
4941
5021
|
}
|
|
4942
|
-
function each(
|
|
4943
|
-
results[
|
|
5022
|
+
function each(i2, err, result) {
|
|
5023
|
+
results[i2] = result;
|
|
4944
5024
|
if (--pending === 0 || err) {
|
|
4945
5025
|
done(err);
|
|
4946
5026
|
}
|
|
@@ -4954,9 +5034,9 @@ var require_run_parallel = __commonJS({
|
|
|
4954
5034
|
});
|
|
4955
5035
|
});
|
|
4956
5036
|
} else {
|
|
4957
|
-
tasks.forEach(function(task,
|
|
5037
|
+
tasks.forEach(function(task, i2) {
|
|
4958
5038
|
task(function(err, result) {
|
|
4959
|
-
each(
|
|
5039
|
+
each(i2, err, result);
|
|
4960
5040
|
});
|
|
4961
5041
|
});
|
|
4962
5042
|
}
|
|
@@ -5031,11 +5111,11 @@ var require_common = __commonJS({
|
|
|
5031
5111
|
init_utils2();
|
|
5032
5112
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5033
5113
|
exports.joinPathSegments = void 0;
|
|
5034
|
-
function joinPathSegments(
|
|
5035
|
-
if (
|
|
5036
|
-
return
|
|
5114
|
+
function joinPathSegments(a2, b, separator) {
|
|
5115
|
+
if (a2.endsWith(separator)) {
|
|
5116
|
+
return a2 + b;
|
|
5037
5117
|
}
|
|
5038
|
-
return
|
|
5118
|
+
return a2 + separator + b;
|
|
5039
5119
|
}
|
|
5040
5120
|
exports.joinPathSegments = joinPathSegments;
|
|
5041
5121
|
}
|
|
@@ -5053,16 +5133,16 @@ var require_async2 = __commonJS({
|
|
|
5053
5133
|
var constants_1 = require_constants3();
|
|
5054
5134
|
var utils = require_utils4();
|
|
5055
5135
|
var common = require_common();
|
|
5056
|
-
function read(directory,
|
|
5057
|
-
if (!
|
|
5058
|
-
readdirWithFileTypes(directory,
|
|
5136
|
+
function read(directory, settings2, callback) {
|
|
5137
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
5138
|
+
readdirWithFileTypes(directory, settings2, callback);
|
|
5059
5139
|
return;
|
|
5060
5140
|
}
|
|
5061
|
-
readdir(directory,
|
|
5141
|
+
readdir(directory, settings2, callback);
|
|
5062
5142
|
}
|
|
5063
5143
|
exports.read = read;
|
|
5064
|
-
function readdirWithFileTypes(directory,
|
|
5065
|
-
|
|
5144
|
+
function readdirWithFileTypes(directory, settings2, callback) {
|
|
5145
|
+
settings2.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
|
|
5066
5146
|
if (readdirError !== null) {
|
|
5067
5147
|
callFailureCallback(callback, readdirError);
|
|
5068
5148
|
return;
|
|
@@ -5070,13 +5150,13 @@ var require_async2 = __commonJS({
|
|
|
5070
5150
|
const entries = dirents.map((dirent) => ({
|
|
5071
5151
|
dirent,
|
|
5072
5152
|
name: dirent.name,
|
|
5073
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
5153
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
5074
5154
|
}));
|
|
5075
|
-
if (!
|
|
5155
|
+
if (!settings2.followSymbolicLinks) {
|
|
5076
5156
|
callSuccessCallback(callback, entries);
|
|
5077
5157
|
return;
|
|
5078
5158
|
}
|
|
5079
|
-
const tasks = entries.map((entry) => makeRplTaskEntry(entry,
|
|
5159
|
+
const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings2));
|
|
5080
5160
|
rpl(tasks, (rplError, rplEntries) => {
|
|
5081
5161
|
if (rplError !== null) {
|
|
5082
5162
|
callFailureCallback(callback, rplError);
|
|
@@ -5087,15 +5167,15 @@ var require_async2 = __commonJS({
|
|
|
5087
5167
|
});
|
|
5088
5168
|
}
|
|
5089
5169
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
5090
|
-
function makeRplTaskEntry(entry,
|
|
5170
|
+
function makeRplTaskEntry(entry, settings2) {
|
|
5091
5171
|
return (done) => {
|
|
5092
5172
|
if (!entry.dirent.isSymbolicLink()) {
|
|
5093
5173
|
done(null, entry);
|
|
5094
5174
|
return;
|
|
5095
5175
|
}
|
|
5096
|
-
|
|
5176
|
+
settings2.fs.stat(entry.path, (statError, stats) => {
|
|
5097
5177
|
if (statError !== null) {
|
|
5098
|
-
if (
|
|
5178
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5099
5179
|
done(statError);
|
|
5100
5180
|
return;
|
|
5101
5181
|
}
|
|
@@ -5107,16 +5187,16 @@ var require_async2 = __commonJS({
|
|
|
5107
5187
|
});
|
|
5108
5188
|
};
|
|
5109
5189
|
}
|
|
5110
|
-
function readdir(directory,
|
|
5111
|
-
|
|
5190
|
+
function readdir(directory, settings2, callback) {
|
|
5191
|
+
settings2.fs.readdir(directory, (readdirError, names) => {
|
|
5112
5192
|
if (readdirError !== null) {
|
|
5113
5193
|
callFailureCallback(callback, readdirError);
|
|
5114
5194
|
return;
|
|
5115
5195
|
}
|
|
5116
5196
|
const tasks = names.map((name) => {
|
|
5117
|
-
const path = common.joinPathSegments(directory, name,
|
|
5197
|
+
const path = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
5118
5198
|
return (done) => {
|
|
5119
|
-
fsStat.stat(path,
|
|
5199
|
+
fsStat.stat(path, settings2.fsStatSettings, (error2, stats) => {
|
|
5120
5200
|
if (error2 !== null) {
|
|
5121
5201
|
done(error2);
|
|
5122
5202
|
return;
|
|
@@ -5126,7 +5206,7 @@ var require_async2 = __commonJS({
|
|
|
5126
5206
|
path,
|
|
5127
5207
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
5128
5208
|
};
|
|
5129
|
-
if (
|
|
5209
|
+
if (settings2.stats) {
|
|
5130
5210
|
entry.stats = stats;
|
|
5131
5211
|
}
|
|
5132
5212
|
done(null, entry);
|
|
@@ -5163,27 +5243,27 @@ var require_sync2 = __commonJS({
|
|
|
5163
5243
|
var constants_1 = require_constants3();
|
|
5164
5244
|
var utils = require_utils4();
|
|
5165
5245
|
var common = require_common();
|
|
5166
|
-
function read(directory,
|
|
5167
|
-
if (!
|
|
5168
|
-
return readdirWithFileTypes(directory,
|
|
5246
|
+
function read(directory, settings2) {
|
|
5247
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
5248
|
+
return readdirWithFileTypes(directory, settings2);
|
|
5169
5249
|
}
|
|
5170
|
-
return readdir(directory,
|
|
5250
|
+
return readdir(directory, settings2);
|
|
5171
5251
|
}
|
|
5172
5252
|
exports.read = read;
|
|
5173
|
-
function readdirWithFileTypes(directory,
|
|
5174
|
-
const dirents =
|
|
5253
|
+
function readdirWithFileTypes(directory, settings2) {
|
|
5254
|
+
const dirents = settings2.fs.readdirSync(directory, { withFileTypes: true });
|
|
5175
5255
|
return dirents.map((dirent) => {
|
|
5176
5256
|
const entry = {
|
|
5177
5257
|
dirent,
|
|
5178
5258
|
name: dirent.name,
|
|
5179
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
5259
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
5180
5260
|
};
|
|
5181
|
-
if (entry.dirent.isSymbolicLink() &&
|
|
5261
|
+
if (entry.dirent.isSymbolicLink() && settings2.followSymbolicLinks) {
|
|
5182
5262
|
try {
|
|
5183
|
-
const stats =
|
|
5263
|
+
const stats = settings2.fs.statSync(entry.path);
|
|
5184
5264
|
entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
|
5185
5265
|
} catch (error2) {
|
|
5186
|
-
if (
|
|
5266
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5187
5267
|
throw error2;
|
|
5188
5268
|
}
|
|
5189
5269
|
}
|
|
@@ -5192,17 +5272,17 @@ var require_sync2 = __commonJS({
|
|
|
5192
5272
|
});
|
|
5193
5273
|
}
|
|
5194
5274
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
5195
|
-
function readdir(directory,
|
|
5196
|
-
const names =
|
|
5275
|
+
function readdir(directory, settings2) {
|
|
5276
|
+
const names = settings2.fs.readdirSync(directory);
|
|
5197
5277
|
return names.map((name) => {
|
|
5198
|
-
const entryPath = common.joinPathSegments(directory, name,
|
|
5199
|
-
const stats = fsStat.statSync(entryPath,
|
|
5278
|
+
const entryPath = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
5279
|
+
const stats = fsStat.statSync(entryPath, settings2.fsStatSettings);
|
|
5200
5280
|
const entry = {
|
|
5201
5281
|
name,
|
|
5202
5282
|
path: entryPath,
|
|
5203
5283
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
5204
5284
|
};
|
|
5205
|
-
if (
|
|
5285
|
+
if (settings2.stats) {
|
|
5206
5286
|
entry.stats = stats;
|
|
5207
5287
|
}
|
|
5208
5288
|
return entry;
|
|
@@ -5289,8 +5369,8 @@ var require_out2 = __commonJS({
|
|
|
5289
5369
|
}
|
|
5290
5370
|
exports.scandir = scandir;
|
|
5291
5371
|
function scandirSync(path, optionsOrSettings) {
|
|
5292
|
-
const
|
|
5293
|
-
return sync.read(path,
|
|
5372
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5373
|
+
return sync.read(path, settings2);
|
|
5294
5374
|
}
|
|
5295
5375
|
exports.scandirSync = scandirSync;
|
|
5296
5376
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -5334,9 +5414,9 @@ var require_reusify = __commonJS({
|
|
|
5334
5414
|
}
|
|
5335
5415
|
});
|
|
5336
5416
|
|
|
5337
|
-
// node_modules/.bun/fastq@1.20.
|
|
5417
|
+
// node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js
|
|
5338
5418
|
var require_queue = __commonJS({
|
|
5339
|
-
"node_modules/.bun/fastq@1.20.
|
|
5419
|
+
"node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js"(exports, module) {
|
|
5340
5420
|
"use strict";
|
|
5341
5421
|
init_utils2();
|
|
5342
5422
|
var reusify = require_reusify();
|
|
@@ -5516,11 +5596,12 @@ var require_queue = __commonJS({
|
|
|
5516
5596
|
current.value = null;
|
|
5517
5597
|
current.callback = noop;
|
|
5518
5598
|
current.errorHandler = null;
|
|
5599
|
+
current.next = null;
|
|
5519
5600
|
if (errorHandler2) {
|
|
5520
5601
|
errorHandler2(new Error("abort"), val);
|
|
5521
5602
|
}
|
|
5522
5603
|
callback.call(context2, new Error("abort"));
|
|
5523
|
-
|
|
5604
|
+
cache.release(current);
|
|
5524
5605
|
current = next;
|
|
5525
5606
|
}
|
|
5526
5607
|
self.drain = noop;
|
|
@@ -5626,11 +5707,11 @@ var require_common2 = __commonJS({
|
|
|
5626
5707
|
init_utils2();
|
|
5627
5708
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5628
5709
|
exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
|
|
5629
|
-
function isFatalError(
|
|
5630
|
-
if (
|
|
5710
|
+
function isFatalError(settings2, error2) {
|
|
5711
|
+
if (settings2.errorFilter === null) {
|
|
5631
5712
|
return true;
|
|
5632
5713
|
}
|
|
5633
|
-
return !
|
|
5714
|
+
return !settings2.errorFilter(error2);
|
|
5634
5715
|
}
|
|
5635
5716
|
exports.isFatalError = isFatalError;
|
|
5636
5717
|
function isAppliedFilter(filter, value) {
|
|
@@ -5641,14 +5722,14 @@ var require_common2 = __commonJS({
|
|
|
5641
5722
|
return filepath.split(/[/\\]/).join(separator);
|
|
5642
5723
|
}
|
|
5643
5724
|
exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
|
|
5644
|
-
function joinPathSegments(
|
|
5645
|
-
if (
|
|
5725
|
+
function joinPathSegments(a2, b, separator) {
|
|
5726
|
+
if (a2 === "") {
|
|
5646
5727
|
return b;
|
|
5647
5728
|
}
|
|
5648
|
-
if (
|
|
5649
|
-
return
|
|
5729
|
+
if (a2.endsWith(separator)) {
|
|
5730
|
+
return a2 + b;
|
|
5650
5731
|
}
|
|
5651
|
-
return
|
|
5732
|
+
return a2 + separator + b;
|
|
5652
5733
|
}
|
|
5653
5734
|
exports.joinPathSegments = joinPathSegments;
|
|
5654
5735
|
}
|
|
@@ -5995,14 +6076,14 @@ var require_out3 = __commonJS({
|
|
|
5995
6076
|
}
|
|
5996
6077
|
exports.walk = walk;
|
|
5997
6078
|
function walkSync(directory, optionsOrSettings) {
|
|
5998
|
-
const
|
|
5999
|
-
const provider = new sync_1.default(directory,
|
|
6079
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
6080
|
+
const provider = new sync_1.default(directory, settings2);
|
|
6000
6081
|
return provider.read();
|
|
6001
6082
|
}
|
|
6002
6083
|
exports.walkSync = walkSync;
|
|
6003
6084
|
function walkStream(directory, optionsOrSettings) {
|
|
6004
|
-
const
|
|
6005
|
-
const provider = new stream_1.default(directory,
|
|
6085
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
6086
|
+
const provider = new stream_1.default(directory, settings2);
|
|
6006
6087
|
return provider.read();
|
|
6007
6088
|
}
|
|
6008
6089
|
exports.walkStream = walkStream;
|
|
@@ -6088,8 +6169,8 @@ var require_stream3 = __commonJS({
|
|
|
6088
6169
|
done();
|
|
6089
6170
|
}).catch(done);
|
|
6090
6171
|
};
|
|
6091
|
-
for (let
|
|
6092
|
-
stream.write(
|
|
6172
|
+
for (let i2 = 0; i2 < filepaths.length; i2++) {
|
|
6173
|
+
stream.write(i2);
|
|
6093
6174
|
}
|
|
6094
6175
|
return stream;
|
|
6095
6176
|
}
|
|
@@ -6750,14 +6831,14 @@ var require_out4 = __commonJS({
|
|
|
6750
6831
|
function generateTasks(source, options) {
|
|
6751
6832
|
assertPatternsInput(source);
|
|
6752
6833
|
const patterns = [].concat(source);
|
|
6753
|
-
const
|
|
6754
|
-
return taskManager.generate(patterns,
|
|
6834
|
+
const settings2 = new settings_1.default(options);
|
|
6835
|
+
return taskManager.generate(patterns, settings2);
|
|
6755
6836
|
}
|
|
6756
6837
|
FastGlob2.generateTasks = generateTasks;
|
|
6757
6838
|
function isDynamicPattern(source, options) {
|
|
6758
6839
|
assertPatternsInput(source);
|
|
6759
|
-
const
|
|
6760
|
-
return utils.pattern.isDynamicPattern(source,
|
|
6840
|
+
const settings2 = new settings_1.default(options);
|
|
6841
|
+
return utils.pattern.isDynamicPattern(source, settings2);
|
|
6761
6842
|
}
|
|
6762
6843
|
FastGlob2.isDynamicPattern = isDynamicPattern;
|
|
6763
6844
|
function escapePath(source) {
|
|
@@ -6799,9 +6880,9 @@ var require_out4 = __commonJS({
|
|
|
6799
6880
|
})(FastGlob || (FastGlob = {}));
|
|
6800
6881
|
function getWorks(source, _Provider, options) {
|
|
6801
6882
|
const patterns = [].concat(source);
|
|
6802
|
-
const
|
|
6803
|
-
const tasks = taskManager.generate(patterns,
|
|
6804
|
-
const provider = new _Provider(
|
|
6883
|
+
const settings2 = new settings_1.default(options);
|
|
6884
|
+
const tasks = taskManager.generate(patterns, settings2);
|
|
6885
|
+
const provider = new _Provider(settings2);
|
|
6805
6886
|
return tasks.map(provider.read, provider);
|
|
6806
6887
|
}
|
|
6807
6888
|
function assertPatternsInput(input) {
|
|
@@ -6979,14 +7060,14 @@ import "node:fs";
|
|
|
6979
7060
|
import { createRequire } from "node:module";
|
|
6980
7061
|
import {
|
|
6981
7062
|
resolve,
|
|
6982
|
-
join,
|
|
6983
|
-
dirname,
|
|
7063
|
+
join as join2,
|
|
7064
|
+
dirname as dirname2,
|
|
6984
7065
|
relative,
|
|
6985
7066
|
normalize,
|
|
6986
7067
|
sep,
|
|
6987
7068
|
extname
|
|
6988
7069
|
} from "node:path";
|
|
6989
|
-
import "node:url";
|
|
7070
|
+
import { fileURLToPath } from "node:url";
|
|
6990
7071
|
function safeExecuteAsync(fn, message) {
|
|
6991
7072
|
return fn().catch((error2) => {
|
|
6992
7073
|
throw new Error(
|
|
@@ -6994,7 +7075,7 @@ function safeExecuteAsync(fn, message) {
|
|
|
6994
7075
|
);
|
|
6995
7076
|
});
|
|
6996
7077
|
}
|
|
6997
|
-
var import_fast_glob, constants,
|
|
7078
|
+
var import_fast_glob, constants, log3, PACKAGE_PATHS, PathResolver;
|
|
6998
7079
|
var init_PathResolver = __esm({
|
|
6999
7080
|
"packages/core/config/utils/PathResolver.ts"() {
|
|
7000
7081
|
"use strict";
|
|
@@ -7007,7 +7088,7 @@ var init_PathResolver = __esm({
|
|
|
7007
7088
|
getPatternsFor: getPatternsFor || void 0,
|
|
7008
7089
|
I18N_PATHS: I18N_PATHS || void 0
|
|
7009
7090
|
};
|
|
7010
|
-
|
|
7091
|
+
log3 = {
|
|
7011
7092
|
error: (message, error2) => {
|
|
7012
7093
|
},
|
|
7013
7094
|
warn: (message, error2) => {
|
|
@@ -7043,6 +7124,7 @@ var init_PathResolver = __esm({
|
|
|
7043
7124
|
options;
|
|
7044
7125
|
_repoRoot;
|
|
7045
7126
|
_appRoot = null;
|
|
7127
|
+
_writtenPaths = null;
|
|
7046
7128
|
/**
|
|
7047
7129
|
* Get or create singleton instance
|
|
7048
7130
|
* @param options - Configuration options
|
|
@@ -7128,7 +7210,7 @@ var init_PathResolver = __esm({
|
|
|
7128
7210
|
*/
|
|
7129
7211
|
getDirname(path) {
|
|
7130
7212
|
if (!path) return "";
|
|
7131
|
-
return this.normalizePath(
|
|
7213
|
+
return this.normalizePath(dirname2(path));
|
|
7132
7214
|
}
|
|
7133
7215
|
/**
|
|
7134
7216
|
* Resolve package path using Node's module resolution
|
|
@@ -7140,7 +7222,7 @@ var init_PathResolver = __esm({
|
|
|
7140
7222
|
resolvePackage(packageSpecifier, fromPath = null) {
|
|
7141
7223
|
try {
|
|
7142
7224
|
const basePath = fromPath || this.getAppRoot();
|
|
7143
|
-
const require3 = createRequire(
|
|
7225
|
+
const require3 = createRequire(join2(basePath, "package.json"));
|
|
7144
7226
|
const resolved = require3.resolve(packageSpecifier);
|
|
7145
7227
|
return this.normalizePath(resolved);
|
|
7146
7228
|
} catch (error2) {
|
|
@@ -7292,7 +7374,7 @@ var init_PathResolver = __esm({
|
|
|
7292
7374
|
return cleanContent;
|
|
7293
7375
|
} catch (error2) {
|
|
7294
7376
|
if (this.options.debug) {
|
|
7295
|
-
|
|
7377
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
7296
7378
|
}
|
|
7297
7379
|
return null;
|
|
7298
7380
|
}
|
|
@@ -7320,7 +7402,7 @@ var init_PathResolver = __esm({
|
|
|
7320
7402
|
return cleanContent;
|
|
7321
7403
|
} catch (error2) {
|
|
7322
7404
|
if (this.options.debug) {
|
|
7323
|
-
|
|
7405
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
7324
7406
|
}
|
|
7325
7407
|
return null;
|
|
7326
7408
|
}
|
|
@@ -7342,16 +7424,16 @@ var init_PathResolver = __esm({
|
|
|
7342
7424
|
verbose = false
|
|
7343
7425
|
} = options;
|
|
7344
7426
|
const normalizedPath = this.normalizePath(filePath);
|
|
7345
|
-
const dir = this.normalizePath(
|
|
7427
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
7346
7428
|
const fileExists = this.pathExists(normalizedPath);
|
|
7347
7429
|
if (fileExists && !overwrite) {
|
|
7348
7430
|
if (verbose) {
|
|
7349
|
-
|
|
7431
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
7350
7432
|
}
|
|
7351
7433
|
return false;
|
|
7352
7434
|
}
|
|
7353
7435
|
if (dryRun) {
|
|
7354
|
-
|
|
7436
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
7355
7437
|
return true;
|
|
7356
7438
|
}
|
|
7357
7439
|
try {
|
|
@@ -7361,22 +7443,23 @@ var init_PathResolver = __esm({
|
|
|
7361
7443
|
}
|
|
7362
7444
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
7363
7445
|
let writeContent;
|
|
7364
|
-
if (
|
|
7446
|
+
if (Buffer2.isBuffer(content)) {
|
|
7365
7447
|
writeContent = content;
|
|
7366
7448
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
7367
|
-
writeContent = JSON.stringify(content, null, 2)
|
|
7449
|
+
writeContent = `${JSON.stringify(content, null, 2)}
|
|
7450
|
+
`;
|
|
7368
7451
|
} else {
|
|
7369
7452
|
writeContent = String(content);
|
|
7370
7453
|
}
|
|
7371
7454
|
try {
|
|
7372
7455
|
return await safeExecuteAsync(async () => {
|
|
7373
|
-
if (
|
|
7456
|
+
if (Buffer2.isBuffer(writeContent)) {
|
|
7374
7457
|
await fs.promises.writeFile(normalizedPath, writeContent);
|
|
7375
7458
|
} else {
|
|
7376
7459
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
7377
7460
|
}
|
|
7378
7461
|
if (verbose) {
|
|
7379
|
-
|
|
7462
|
+
log3.info(
|
|
7380
7463
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
7381
7464
|
);
|
|
7382
7465
|
}
|
|
@@ -7403,16 +7486,16 @@ var init_PathResolver = __esm({
|
|
|
7403
7486
|
verbose = false
|
|
7404
7487
|
} = options;
|
|
7405
7488
|
const normalizedPath = this.normalizePath(filePath);
|
|
7406
|
-
const dir = this.normalizePath(
|
|
7489
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
7407
7490
|
const fileExists = this.pathExists(normalizedPath);
|
|
7408
7491
|
if (fileExists && !overwrite) {
|
|
7409
7492
|
if (verbose) {
|
|
7410
|
-
|
|
7493
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
7411
7494
|
}
|
|
7412
7495
|
return false;
|
|
7413
7496
|
}
|
|
7414
7497
|
if (dryRun) {
|
|
7415
|
-
|
|
7498
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
7416
7499
|
return true;
|
|
7417
7500
|
}
|
|
7418
7501
|
try {
|
|
@@ -7422,21 +7505,23 @@ var init_PathResolver = __esm({
|
|
|
7422
7505
|
}
|
|
7423
7506
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
7424
7507
|
let writeContent;
|
|
7425
|
-
if (
|
|
7508
|
+
if (Buffer2.isBuffer(content)) {
|
|
7426
7509
|
writeContent = content;
|
|
7427
7510
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
7428
|
-
writeContent = JSON.stringify(content, null, 2)
|
|
7511
|
+
writeContent = `${JSON.stringify(content, null, 2)}
|
|
7512
|
+
`;
|
|
7429
7513
|
} else {
|
|
7430
7514
|
writeContent = String(content);
|
|
7431
7515
|
}
|
|
7432
7516
|
try {
|
|
7433
|
-
if (
|
|
7517
|
+
if (Buffer2.isBuffer(writeContent)) {
|
|
7434
7518
|
fs.writeFileSync(normalizedPath, writeContent);
|
|
7435
7519
|
} else {
|
|
7436
7520
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
7437
7521
|
}
|
|
7522
|
+
this._writtenPaths?.add(normalizedPath);
|
|
7438
7523
|
if (verbose) {
|
|
7439
|
-
|
|
7524
|
+
log3.info(
|
|
7440
7525
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
7441
7526
|
);
|
|
7442
7527
|
}
|
|
@@ -7461,15 +7546,15 @@ var init_PathResolver = __esm({
|
|
|
7461
7546
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7462
7547
|
if (fileExists && !overwrite) {
|
|
7463
7548
|
if (verbose) {
|
|
7464
|
-
|
|
7549
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7465
7550
|
}
|
|
7466
7551
|
return false;
|
|
7467
7552
|
}
|
|
7468
7553
|
if (dryRun) {
|
|
7469
|
-
|
|
7554
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7470
7555
|
return true;
|
|
7471
7556
|
}
|
|
7472
|
-
const dir = this.normalizePath(
|
|
7557
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7473
7558
|
try {
|
|
7474
7559
|
await fs.promises.mkdir(dir, { recursive: true });
|
|
7475
7560
|
} catch (error2) {
|
|
@@ -7479,7 +7564,7 @@ var init_PathResolver = __esm({
|
|
|
7479
7564
|
return await safeExecuteAsync(async () => {
|
|
7480
7565
|
await fs.promises.copyFile(srcPath, normalizedDestPath);
|
|
7481
7566
|
if (verbose) {
|
|
7482
|
-
|
|
7567
|
+
log3.info(
|
|
7483
7568
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7484
7569
|
);
|
|
7485
7570
|
}
|
|
@@ -7503,15 +7588,15 @@ var init_PathResolver = __esm({
|
|
|
7503
7588
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7504
7589
|
if (fileExists && !overwrite) {
|
|
7505
7590
|
if (verbose) {
|
|
7506
|
-
|
|
7591
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7507
7592
|
}
|
|
7508
7593
|
return false;
|
|
7509
7594
|
}
|
|
7510
7595
|
if (dryRun) {
|
|
7511
|
-
|
|
7596
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7512
7597
|
return true;
|
|
7513
7598
|
}
|
|
7514
|
-
const dir = this.normalizePath(
|
|
7599
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7515
7600
|
try {
|
|
7516
7601
|
fs.mkdirSync(dir, { recursive: true });
|
|
7517
7602
|
} catch (error2) {
|
|
@@ -7519,8 +7604,9 @@ var init_PathResolver = __esm({
|
|
|
7519
7604
|
}
|
|
7520
7605
|
try {
|
|
7521
7606
|
fs.copyFileSync(srcPath, normalizedDestPath);
|
|
7607
|
+
this._writtenPaths?.add(normalizedDestPath);
|
|
7522
7608
|
if (verbose) {
|
|
7523
|
-
|
|
7609
|
+
log3.info(
|
|
7524
7610
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7525
7611
|
);
|
|
7526
7612
|
}
|
|
@@ -7537,7 +7623,7 @@ var init_PathResolver = __esm({
|
|
|
7537
7623
|
return fs.existsSync(filePath);
|
|
7538
7624
|
} catch (error2) {
|
|
7539
7625
|
if (!silent) {
|
|
7540
|
-
|
|
7626
|
+
log3.error(`Error checking path existence: ${filePath}`, error2);
|
|
7541
7627
|
}
|
|
7542
7628
|
return false;
|
|
7543
7629
|
}
|
|
@@ -7563,7 +7649,7 @@ var init_PathResolver = __esm({
|
|
|
7563
7649
|
return fs.readdirSync(dirPath, options);
|
|
7564
7650
|
} catch (error2) {
|
|
7565
7651
|
if (this.options.debug) {
|
|
7566
|
-
|
|
7652
|
+
log3.warn(`Failed to read directory: ${dirPath}`, error2);
|
|
7567
7653
|
}
|
|
7568
7654
|
const isObjectOptions = options && typeof options === "object" && "withFileTypes" in options;
|
|
7569
7655
|
return isObjectOptions && options.withFileTypes ? [] : [];
|
|
@@ -7581,11 +7667,29 @@ var init_PathResolver = __esm({
|
|
|
7581
7667
|
return fs.statSync(filePath);
|
|
7582
7668
|
} catch (error2) {
|
|
7583
7669
|
if (this.options.debug) {
|
|
7584
|
-
|
|
7670
|
+
log3.warn(`Failed to stat file: ${filePath}`, error2);
|
|
7585
7671
|
}
|
|
7586
7672
|
return null;
|
|
7587
7673
|
}
|
|
7588
7674
|
}
|
|
7675
|
+
/**
|
|
7676
|
+
* Resolve the real path of a file, following symlinks
|
|
7677
|
+
* @param filePath - Path to resolve
|
|
7678
|
+
* @returns Resolved real path
|
|
7679
|
+
*/
|
|
7680
|
+
realpathSync(filePath) {
|
|
7681
|
+
return fs.realpathSync(filePath);
|
|
7682
|
+
}
|
|
7683
|
+
/**
|
|
7684
|
+
* Watch a directory for changes
|
|
7685
|
+
* @param dirPath - Directory to watch
|
|
7686
|
+
* @param options - fs.watch options
|
|
7687
|
+
* @param callback - Callback for change events
|
|
7688
|
+
* @returns FSWatcher instance
|
|
7689
|
+
*/
|
|
7690
|
+
watch(dirPath, options, callback) {
|
|
7691
|
+
return fs.watch(dirPath, options, callback);
|
|
7692
|
+
}
|
|
7589
7693
|
/**
|
|
7590
7694
|
* Get file stats synchronously (follows symlinks)
|
|
7591
7695
|
* Returns null if file doesn't exist (graceful degradation)
|
|
@@ -7598,7 +7702,7 @@ var init_PathResolver = __esm({
|
|
|
7598
7702
|
return fs.lstatSync(filePath);
|
|
7599
7703
|
} catch (error2) {
|
|
7600
7704
|
if (this.options.debug) {
|
|
7601
|
-
|
|
7705
|
+
log3.warn(`Failed to lstat file: ${filePath}`, error2);
|
|
7602
7706
|
}
|
|
7603
7707
|
return null;
|
|
7604
7708
|
}
|
|
@@ -7665,6 +7769,28 @@ var init_PathResolver = __esm({
|
|
|
7665
7769
|
* Get app root (where vite.config.ts is, Vite's config.root)
|
|
7666
7770
|
* Falls back to repoRoot if not set
|
|
7667
7771
|
*/
|
|
7772
|
+
/**
|
|
7773
|
+
* Start recording every path written by writeSync/copySync.
|
|
7774
|
+
* Lets a generator know exactly which files the current run produced,
|
|
7775
|
+
* without comparing file timestamps to a clock.
|
|
7776
|
+
*/
|
|
7777
|
+
startWriteRecording() {
|
|
7778
|
+
this._writtenPaths = /* @__PURE__ */ new Set();
|
|
7779
|
+
}
|
|
7780
|
+
/**
|
|
7781
|
+
* Stop recording and return the normalized paths written since
|
|
7782
|
+
* startWriteRecording().
|
|
7783
|
+
*/
|
|
7784
|
+
stopWriteRecording() {
|
|
7785
|
+
if (!this._writtenPaths) {
|
|
7786
|
+
throw new Error(
|
|
7787
|
+
"stopWriteRecording() called without startWriteRecording()"
|
|
7788
|
+
);
|
|
7789
|
+
}
|
|
7790
|
+
const written = this._writtenPaths;
|
|
7791
|
+
this._writtenPaths = null;
|
|
7792
|
+
return written;
|
|
7793
|
+
}
|
|
7668
7794
|
getAppRoot() {
|
|
7669
7795
|
if (!this._appRoot) {
|
|
7670
7796
|
return this._repoRoot;
|
|
@@ -7687,7 +7813,7 @@ var init_PathResolver = __esm({
|
|
|
7687
7813
|
* @returns True if repoRoot is the monorepo (has packages directory)
|
|
7688
7814
|
*/
|
|
7689
7815
|
isMonorepo() {
|
|
7690
|
-
const packagesDir =
|
|
7816
|
+
const packagesDir = join2(this._repoRoot, "packages");
|
|
7691
7817
|
return this.pathExists(packagesDir);
|
|
7692
7818
|
}
|
|
7693
7819
|
/**
|
|
@@ -7704,7 +7830,7 @@ var init_PathResolver = __esm({
|
|
|
7704
7830
|
* Find files matching pattern within directory
|
|
7705
7831
|
*/
|
|
7706
7832
|
async findFiles(directory, pattern, options = {}) {
|
|
7707
|
-
const searchPattern = this.normalizePath(
|
|
7833
|
+
const searchPattern = this.normalizePath(join2(directory, pattern));
|
|
7708
7834
|
const appRoot = this.getAppRoot();
|
|
7709
7835
|
const normalizeAppRoot = this.normalizePath(appRoot);
|
|
7710
7836
|
const relativePattern = searchPattern.startsWith(normalizeAppRoot) ? searchPattern.slice(normalizeAppRoot.length + 1) : searchPattern;
|
|
@@ -7751,7 +7877,7 @@ var init_PathResolver = __esm({
|
|
|
7751
7877
|
return null;
|
|
7752
7878
|
}
|
|
7753
7879
|
const resolvedPath = this.normalizePath(
|
|
7754
|
-
|
|
7880
|
+
join2(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
|
|
7755
7881
|
);
|
|
7756
7882
|
const resolvedDir = resolvedPath.replace(/\/[^/]*\*.*$/, "");
|
|
7757
7883
|
if (this.pathExists(resolvedDir)) {
|
|
@@ -7922,6 +8048,15 @@ var init_PathResolver = __esm({
|
|
|
7922
8048
|
const cjsPath = this.getEmptyCjsModulePath();
|
|
7923
8049
|
return cjsPath.replace(/\.cjs$/, ".js");
|
|
7924
8050
|
}
|
|
8051
|
+
/**
|
|
8052
|
+
* Get absolute path to empty flag component module.
|
|
8053
|
+
* Returns `export default () => null;` — used by flag filtering plugins
|
|
8054
|
+
* to replace unused flag files at build time.
|
|
8055
|
+
*/
|
|
8056
|
+
getEmptyFlagModulePath() {
|
|
8057
|
+
const __dirname2 = dirname2(fileURLToPath(import.meta.url));
|
|
8058
|
+
return this.normalizePath(resolve(__dirname2, "emptyFlag.js"));
|
|
8059
|
+
}
|
|
7925
8060
|
/**
|
|
7926
8061
|
* Get absolute path to empty CJS module for esbuild pre-bundling.
|
|
7927
8062
|
* CJS because esbuild statically analyzes ESM exports — CJS has dynamic
|
|
@@ -7947,13 +8082,13 @@ var init_PathResolver = __esm({
|
|
|
7947
8082
|
const maxLevels = this.options.maxLevels;
|
|
7948
8083
|
while (levelsChecked < maxLevels) {
|
|
7949
8084
|
const toolingPath = this.normalizePath(
|
|
7950
|
-
|
|
8085
|
+
join2(currentDir, PACKAGE_PATHS.TOOLING)
|
|
7951
8086
|
);
|
|
7952
|
-
const corePath = this.normalizePath(
|
|
8087
|
+
const corePath = this.normalizePath(join2(currentDir, PACKAGE_PATHS.CORE));
|
|
7953
8088
|
if (this.pathExists(toolingPath) && this.pathExists(corePath)) {
|
|
7954
8089
|
return currentDir;
|
|
7955
8090
|
}
|
|
7956
|
-
const appsDir =
|
|
8091
|
+
const appsDir = join2(currentDir, "apps");
|
|
7957
8092
|
if (this.pathExists(appsDir)) {
|
|
7958
8093
|
const appsDirStat = this.statSync(appsDir);
|
|
7959
8094
|
if (appsDirStat?.isDirectory()) {
|
|
@@ -7961,15 +8096,15 @@ var init_PathResolver = __esm({
|
|
|
7961
8096
|
}
|
|
7962
8097
|
}
|
|
7963
8098
|
const packageJsonPath = this.normalizePath(
|
|
7964
|
-
|
|
8099
|
+
join2(currentDir, "package.json")
|
|
7965
8100
|
);
|
|
7966
8101
|
if (this.pathExists(packageJsonPath)) {
|
|
7967
|
-
const parentDir2 = this.normalizePath(
|
|
8102
|
+
const parentDir2 = this.normalizePath(dirname2(currentDir));
|
|
7968
8103
|
if (parentDir2 === currentDir) {
|
|
7969
8104
|
return currentDir;
|
|
7970
8105
|
}
|
|
7971
8106
|
}
|
|
7972
|
-
const parentDir = this.normalizePath(
|
|
8107
|
+
const parentDir = this.normalizePath(dirname2(currentDir));
|
|
7973
8108
|
if (parentDir === currentDir) {
|
|
7974
8109
|
break;
|
|
7975
8110
|
}
|
|
@@ -7985,8 +8120,8 @@ var init_PathResolver = __esm({
|
|
|
7985
8120
|
// packages/tooling/src/utils/pathResolver.ts
|
|
7986
8121
|
import { createRequire as createRequire2 } from "node:module";
|
|
7987
8122
|
import {
|
|
7988
|
-
join as
|
|
7989
|
-
dirname as
|
|
8123
|
+
join as join3,
|
|
8124
|
+
dirname as dirname3,
|
|
7990
8125
|
basename as basename2,
|
|
7991
8126
|
extname as extname2,
|
|
7992
8127
|
relative as relative2,
|
|
@@ -8035,14 +8170,14 @@ var init_pathResolver = __esm({
|
|
|
8035
8170
|
pathResolverInstance = PathResolver.getInstance({ debug: false });
|
|
8036
8171
|
getRepoRoot = () => pathResolverInstance.getRepoRoot();
|
|
8037
8172
|
normalizePath = (...pathSegments) => {
|
|
8038
|
-
return pathResolverInstance.normalizePath(
|
|
8173
|
+
return pathResolverInstance.normalizePath(join3(...pathSegments));
|
|
8039
8174
|
};
|
|
8040
8175
|
pathExists = (filePath, silent = false) => pathResolverInstance.pathExists(filePath, silent);
|
|
8041
8176
|
readSync = (filePath, options) => pathResolverInstance.readSync(filePath, options);
|
|
8042
8177
|
writeSync = (filePath, content, options) => pathResolverInstance.writeSync(filePath, content, options);
|
|
8043
8178
|
removeSync = (path) => pathResolverInstance.removeSync(path);
|
|
8044
8179
|
getDirname = (filePath) => {
|
|
8045
|
-
return normalizePath(
|
|
8180
|
+
return normalizePath(dirname3(filePath));
|
|
8046
8181
|
};
|
|
8047
8182
|
joinPath = (...pathSegments) => {
|
|
8048
8183
|
return normalizePath(...pathSegments);
|
|
@@ -8051,10 +8186,10 @@ var init_pathResolver = __esm({
|
|
|
8051
8186
|
});
|
|
8052
8187
|
|
|
8053
8188
|
// packages/tooling/src/bundler/utils.ts
|
|
8054
|
-
import { Buffer } from "node:buffer";
|
|
8189
|
+
import { Buffer as Buffer2 } from "node:buffer";
|
|
8055
8190
|
import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
8056
8191
|
import { createRequire as createRequire3 } from "node:module";
|
|
8057
|
-
import { dirname as
|
|
8192
|
+
import { dirname as dirname4, resolve as resolve3 } from "node:path";
|
|
8058
8193
|
import process from "node:process";
|
|
8059
8194
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
8060
8195
|
var require2, __filename, __dirname;
|
|
@@ -8063,12 +8198,12 @@ var init_utils2 = __esm({
|
|
|
8063
8198
|
"use strict";
|
|
8064
8199
|
require2 = createRequire3(import.meta.url);
|
|
8065
8200
|
__filename = fileURLToPath3(import.meta.url);
|
|
8066
|
-
__dirname =
|
|
8201
|
+
__dirname = dirname4(__filename);
|
|
8067
8202
|
if (typeof globalThis !== "undefined") {
|
|
8068
8203
|
globalThis.require = require2;
|
|
8069
8204
|
globalThis.__filename = __filename;
|
|
8070
8205
|
globalThis.__dirname = __dirname;
|
|
8071
|
-
globalThis.Buffer =
|
|
8206
|
+
globalThis.Buffer = Buffer2;
|
|
8072
8207
|
globalThis.process = process;
|
|
8073
8208
|
if (typeof global === "undefined") {
|
|
8074
8209
|
globalThis.global = globalThis;
|
|
@@ -8205,24 +8340,24 @@ function discoverPackages(repoRoot, filter) {
|
|
|
8205
8340
|
continue;
|
|
8206
8341
|
}
|
|
8207
8342
|
}
|
|
8208
|
-
return packages.sort((
|
|
8343
|
+
return packages.sort((a2, b) => a2.name.localeCompare(b.name));
|
|
8209
8344
|
}
|
|
8210
8345
|
function parseTypeScriptErrors(output) {
|
|
8211
8346
|
const lines = output.split("\n");
|
|
8212
8347
|
const errorLines = [];
|
|
8213
8348
|
const errorPattern = /error TS\d+/;
|
|
8214
8349
|
let errorCount = 0;
|
|
8215
|
-
for (let
|
|
8216
|
-
const line = lines[
|
|
8350
|
+
for (let i2 = 0; i2 < lines.length; i2++) {
|
|
8351
|
+
const line = lines[i2];
|
|
8217
8352
|
if (!line) continue;
|
|
8218
8353
|
if (errorPattern.test(line)) {
|
|
8219
8354
|
errorCount++;
|
|
8220
8355
|
errorLines.push(line);
|
|
8221
|
-
if (
|
|
8222
|
-
const nextLine = lines[
|
|
8356
|
+
if (i2 + 1 < lines.length) {
|
|
8357
|
+
const nextLine = lines[i2 + 1];
|
|
8223
8358
|
if (nextLine && (nextLine.trim().startsWith("~") || /^\s+/.test(nextLine))) {
|
|
8224
8359
|
errorLines.push(nextLine);
|
|
8225
|
-
|
|
8360
|
+
i2++;
|
|
8226
8361
|
}
|
|
8227
8362
|
}
|
|
8228
8363
|
} else if (
|
|
@@ -8239,7 +8374,7 @@ function parseTypeScriptErrors(output) {
|
|
|
8239
8374
|
}
|
|
8240
8375
|
function typeCheckPackage(pkg, repoRoot, verbose, progressSpinner) {
|
|
8241
8376
|
return new Promise((resolve4) => {
|
|
8242
|
-
let
|
|
8377
|
+
let stdout2 = "";
|
|
8243
8378
|
let stderr = "";
|
|
8244
8379
|
let hasStarted = false;
|
|
8245
8380
|
const child = spawn("bun", ["run", "type-check"], {
|
|
@@ -8256,12 +8391,12 @@ function typeCheckPackage(pkg, repoRoot, verbose, progressSpinner) {
|
|
|
8256
8391
|
}
|
|
8257
8392
|
}
|
|
8258
8393
|
const text = data.toString("utf8");
|
|
8259
|
-
|
|
8394
|
+
stdout2 += text;
|
|
8260
8395
|
if (verbose) {
|
|
8261
8396
|
const lines = text.split("\n");
|
|
8262
8397
|
for (const line of lines) {
|
|
8263
8398
|
if (line.trim() && (line.includes("error TS") || line.includes("error:"))) {
|
|
8264
|
-
|
|
8399
|
+
log2.error(` ${line.trim()}`);
|
|
8265
8400
|
}
|
|
8266
8401
|
}
|
|
8267
8402
|
}
|
|
@@ -8272,12 +8407,12 @@ function typeCheckPackage(pkg, repoRoot, verbose, progressSpinner) {
|
|
|
8272
8407
|
if (verbose) {
|
|
8273
8408
|
const trimmed = text.trim();
|
|
8274
8409
|
if (trimmed && !trimmed.startsWith("$ ") && !trimmed.match(/^bun run /)) {
|
|
8275
|
-
|
|
8410
|
+
log2.error(` ${trimmed}`);
|
|
8276
8411
|
}
|
|
8277
8412
|
}
|
|
8278
8413
|
});
|
|
8279
8414
|
child.on("close", (code) => {
|
|
8280
|
-
const allOutput =
|
|
8415
|
+
const allOutput = stdout2 + (stderr ? `
|
|
8281
8416
|
${stderr}` : "");
|
|
8282
8417
|
const { errorCount, errorLines } = parseTypeScriptErrors(allOutput);
|
|
8283
8418
|
resolve4({
|
|
@@ -8306,7 +8441,7 @@ async function main(options = {}) {
|
|
|
8306
8441
|
};
|
|
8307
8442
|
try {
|
|
8308
8443
|
if (isTTY) {
|
|
8309
|
-
|
|
8444
|
+
intro("\u{1F50D} DoNotDev Type Check");
|
|
8310
8445
|
}
|
|
8311
8446
|
logToFile("\u{1F50D} DoNotDev Type Check\n");
|
|
8312
8447
|
const debug = options.debug ?? options.verbose ?? false;
|
|
@@ -8319,21 +8454,21 @@ async function main(options = {}) {
|
|
|
8319
8454
|
);
|
|
8320
8455
|
}
|
|
8321
8456
|
if (debug) {
|
|
8322
|
-
|
|
8457
|
+
log2.debug(` Working directory: ${repoRoot}
|
|
8323
8458
|
`);
|
|
8324
8459
|
if (options.package) {
|
|
8325
|
-
|
|
8460
|
+
log2.debug(` Package filter: ${options.package}
|
|
8326
8461
|
`);
|
|
8327
8462
|
}
|
|
8328
8463
|
}
|
|
8329
8464
|
const packages = discoverPackages(repoRoot, options.package);
|
|
8330
8465
|
if (packages.length === 0) {
|
|
8331
8466
|
if (isTTY) {
|
|
8332
|
-
|
|
8467
|
+
log2.warn("No packages with type-check script found.");
|
|
8333
8468
|
if (options.package) {
|
|
8334
|
-
|
|
8469
|
+
log2.warn(` Filter: ${options.package}`);
|
|
8335
8470
|
}
|
|
8336
|
-
|
|
8471
|
+
outro("No packages to type-check");
|
|
8337
8472
|
} else {
|
|
8338
8473
|
process.stdout.write("RESULT: 0 passed, 0 failed, 0 total errors\n");
|
|
8339
8474
|
}
|
|
@@ -8342,15 +8477,15 @@ async function main(options = {}) {
|
|
|
8342
8477
|
logToFile(`Found ${packages.length} package(s) to type-check
|
|
8343
8478
|
|
|
8344
8479
|
`);
|
|
8345
|
-
|
|
8346
|
-
|
|
8480
|
+
log2.info(`Found ${packages.length} package(s) to type-check`);
|
|
8481
|
+
log2.info("Checking for direct imports from private core packages...");
|
|
8347
8482
|
const violations = checkPrivateCoreImports(repoRoot, packages);
|
|
8348
8483
|
if (violations.length > 0) {
|
|
8349
|
-
|
|
8484
|
+
log2.error(
|
|
8350
8485
|
`
|
|
8351
8486
|
\u274C Found ${violations.length} violation(s) importing from private core packages:`
|
|
8352
8487
|
);
|
|
8353
|
-
|
|
8488
|
+
log2.error(
|
|
8354
8489
|
" Packages must import from @donotdev/core, not from private child packages.\n"
|
|
8355
8490
|
);
|
|
8356
8491
|
const violationsByPackage = /* @__PURE__ */ new Map();
|
|
@@ -8363,20 +8498,20 @@ async function main(options = {}) {
|
|
|
8363
8498
|
violationsByPackage.get(pkg).push(violation);
|
|
8364
8499
|
}
|
|
8365
8500
|
for (const [pkg, pkgViolations] of violationsByPackage) {
|
|
8366
|
-
|
|
8501
|
+
log2.error(`
|
|
8367
8502
|
${pkg}:`);
|
|
8368
8503
|
for (const violation of pkgViolations) {
|
|
8369
|
-
|
|
8504
|
+
log2.error(
|
|
8370
8505
|
` ${violation.file}:${violation.line} - imports from ${violation.package}`
|
|
8371
8506
|
);
|
|
8372
8507
|
if (verbose) {
|
|
8373
|
-
|
|
8508
|
+
log2.error(` ${violation.importLine}`);
|
|
8374
8509
|
}
|
|
8375
8510
|
}
|
|
8376
8511
|
}
|
|
8377
|
-
|
|
8512
|
+
log2.error("\n Private core packages (use @donotdev/core instead):");
|
|
8378
8513
|
for (const pkg of PRIVATE_CORE_PACKAGES) {
|
|
8379
|
-
|
|
8514
|
+
log2.error(` - ${pkg}`);
|
|
8380
8515
|
}
|
|
8381
8516
|
logToFile(
|
|
8382
8517
|
`
|
|
@@ -8388,7 +8523,7 @@ ${violations.map(
|
|
|
8388
8523
|
`
|
|
8389
8524
|
);
|
|
8390
8525
|
if (isTTY) {
|
|
8391
|
-
|
|
8526
|
+
outro("Type-check failed: direct imports from private core packages");
|
|
8392
8527
|
} else {
|
|
8393
8528
|
process.stdout.write("RESULT: 0 passed, 0 failed, 0 total errors\n");
|
|
8394
8529
|
process.stdout.write(
|
|
@@ -8397,15 +8532,15 @@ ${violations.map(
|
|
|
8397
8532
|
}
|
|
8398
8533
|
return 1;
|
|
8399
8534
|
}
|
|
8400
|
-
|
|
8535
|
+
log2.info("\u2713 No direct imports from private core packages found");
|
|
8401
8536
|
const results = [];
|
|
8402
|
-
for (let
|
|
8403
|
-
const pkg = packages[
|
|
8537
|
+
for (let i2 = 0; i2 < packages.length; i2++) {
|
|
8538
|
+
const pkg = packages[i2];
|
|
8404
8539
|
if (!pkg) continue;
|
|
8405
|
-
const progress = `${
|
|
8540
|
+
const progress = `${i2 + 1}/${packages.length}`;
|
|
8406
8541
|
let result;
|
|
8407
8542
|
if (isTTY) {
|
|
8408
|
-
const s =
|
|
8543
|
+
const s = spinner();
|
|
8409
8544
|
s.start(`[${progress}] Type-checking ${pkg.name}...`);
|
|
8410
8545
|
result = await typeCheckPackage(pkg, repoRoot, verbose, s);
|
|
8411
8546
|
if (result.success) {
|
|
@@ -8448,9 +8583,9 @@ ${violations.map(
|
|
|
8448
8583
|
logToFile(result.output);
|
|
8449
8584
|
logToFile("\n");
|
|
8450
8585
|
}
|
|
8451
|
-
const failed = results.filter((
|
|
8452
|
-
const passed = results.filter((
|
|
8453
|
-
const totalErrors = results.reduce((sum,
|
|
8586
|
+
const failed = results.filter((r2) => !r2.success);
|
|
8587
|
+
const passed = results.filter((r2) => r2.success);
|
|
8588
|
+
const totalErrors = results.reduce((sum, r2) => sum + r2.errorCount, 0);
|
|
8454
8589
|
if (!isTTY) {
|
|
8455
8590
|
process.stdout.write(
|
|
8456
8591
|
`RESULT: ${passed.length} passed, ${failed.length} failed, ${totalErrors} total errors
|
|
@@ -8491,13 +8626,13 @@ ${output}
|
|
|
8491
8626
|
].join(EOL2);
|
|
8492
8627
|
writeSync(logFilePath2, logContent, { overwrite: true });
|
|
8493
8628
|
if (isTTY) {
|
|
8494
|
-
|
|
8629
|
+
log2.info(`Errors logged to: ${logFilePath2}`);
|
|
8495
8630
|
} else {
|
|
8496
8631
|
process.stdout.write(`LOG: ${logFilePath2}
|
|
8497
8632
|
`);
|
|
8498
8633
|
}
|
|
8499
8634
|
if (isTTY) {
|
|
8500
|
-
|
|
8635
|
+
outro("Type-check completed with errors");
|
|
8501
8636
|
}
|
|
8502
8637
|
return 1;
|
|
8503
8638
|
}
|
|
@@ -8507,7 +8642,7 @@ ${output}
|
|
|
8507
8642
|
removeSync(logFilePath);
|
|
8508
8643
|
}
|
|
8509
8644
|
if (isTTY) {
|
|
8510
|
-
|
|
8645
|
+
outro("All packages type-checked successfully!");
|
|
8511
8646
|
}
|
|
8512
8647
|
return 0;
|
|
8513
8648
|
} catch (error2) {
|
|
@@ -8536,7 +8671,7 @@ ${output}
|
|
|
8536
8671
|
].join(EOL2);
|
|
8537
8672
|
writeSync(logFilePath, logContent, { overwrite: true });
|
|
8538
8673
|
if (process.stdout.isTTY) {
|
|
8539
|
-
|
|
8674
|
+
log2.info(`Error log saved to: ${logFilePath}`);
|
|
8540
8675
|
}
|
|
8541
8676
|
}
|
|
8542
8677
|
throw doNotDevError;
|