@donotdev/cli 0.1.45 → 0.1.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dependencies-matrix.json +9 -8
- package/dist/bin/commands/agent-setup.js +553 -509
- package/dist/bin/commands/build.js +1144 -908
- package/dist/bin/commands/bump.js +1206 -931
- package/dist/bin/commands/cacheout.js +464 -390
- package/dist/bin/commands/coach.js +467 -393
- package/dist/bin/commands/create-app.js +1118 -846
- package/dist/bin/commands/create-project.js +1158 -886
- package/dist/bin/commands/db.js +16351 -33069
- package/dist/bin/commands/deploy.js +2171 -1870
- package/dist/bin/commands/dev.js +833 -647
- package/dist/bin/commands/doctor.js +555 -511
- package/dist/bin/commands/emu.js +1014 -770
- package/dist/bin/commands/format.js +509 -435
- package/dist/bin/commands/get-demo.js +964 -741
- package/dist/bin/commands/make-admin.js +10368 -27067
- package/dist/bin/commands/preview.js +834 -648
- package/dist/bin/commands/seed.js +16352 -33070
- package/dist/bin/commands/setup-cicd.js +1050 -801
- package/dist/bin/commands/setup.js +1216 -944
- package/dist/bin/commands/staging.js +2171 -1870
- package/dist/bin/commands/sync-secrets.js +916 -717
- package/dist/bin/commands/type-check.js +654 -583
- package/dist/bin/commands/wai.js +454 -380
- package/dist/bin/dndev.js +2 -6
- package/dist/index.js +2582 -2223
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
-
get: (
|
|
8
|
+
get: (a2, b) => (typeof require !== "undefined" ? require : a2)[b]
|
|
9
9
|
}) : x)(function(x) {
|
|
10
10
|
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
11
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
@@ -37,31 +37,40 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
37
37
|
mod
|
|
38
38
|
));
|
|
39
39
|
|
|
40
|
-
// node_modules/.bun/fast-string-truncated-width@
|
|
41
|
-
var
|
|
40
|
+
// node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
|
|
41
|
+
var getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji;
|
|
42
42
|
var init_utils = __esm({
|
|
43
|
-
"node_modules/.bun/fast-string-truncated-width@
|
|
43
|
+
"node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js"() {
|
|
44
44
|
init_utils2();
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
getCodePointsLength = /* @__PURE__ */ (() => {
|
|
46
|
+
const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
47
|
+
return (input) => {
|
|
48
|
+
let surrogatePairsNr = 0;
|
|
49
|
+
SURROGATE_PAIR_RE.lastIndex = 0;
|
|
50
|
+
while (SURROGATE_PAIR_RE.test(input)) {
|
|
51
|
+
surrogatePairsNr += 1;
|
|
52
|
+
}
|
|
53
|
+
return input.length - surrogatePairsNr;
|
|
54
|
+
};
|
|
55
|
+
})();
|
|
48
56
|
isFullWidth = (x) => {
|
|
49
57
|
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
50
58
|
};
|
|
51
|
-
|
|
52
|
-
return x
|
|
59
|
+
isWideNotCJKTNotEmoji = (x) => {
|
|
60
|
+
return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
53
61
|
};
|
|
54
62
|
}
|
|
55
63
|
});
|
|
56
64
|
|
|
57
|
-
// node_modules/.bun/fast-string-truncated-width@
|
|
58
|
-
var ANSI_RE, CONTROL_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
|
|
65
|
+
// node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
|
|
66
|
+
var ANSI_RE, CONTROL_RE, CJKT_WIDE_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
|
|
59
67
|
var init_dist = __esm({
|
|
60
|
-
"node_modules/.bun/fast-string-truncated-width@
|
|
68
|
+
"node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js"() {
|
|
61
69
|
init_utils2();
|
|
62
70
|
init_utils();
|
|
63
|
-
ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
|
|
71
|
+
ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
|
|
64
72
|
CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
73
|
+
CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
|
|
65
74
|
TAB_RE = /\t{1,1000}/y;
|
|
66
75
|
EMOJI_RE = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu");
|
|
67
76
|
LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
@@ -71,14 +80,21 @@ var init_dist = __esm({
|
|
|
71
80
|
const LIMIT = truncationOptions.limit ?? Infinity;
|
|
72
81
|
const ELLIPSIS = truncationOptions.ellipsis ?? "";
|
|
73
82
|
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
|
|
74
|
-
const ANSI_WIDTH =
|
|
83
|
+
const ANSI_WIDTH = 0;
|
|
75
84
|
const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
|
|
76
85
|
const TAB_WIDTH = widthOptions.tabWidth ?? 8;
|
|
77
|
-
const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
|
|
78
86
|
const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
|
|
79
|
-
const FULL_WIDTH_WIDTH =
|
|
87
|
+
const FULL_WIDTH_WIDTH = 2;
|
|
80
88
|
const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
|
|
81
|
-
const WIDE_WIDTH = widthOptions.wideWidth ??
|
|
89
|
+
const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
|
|
90
|
+
const PARSE_BLOCKS = [
|
|
91
|
+
[LATIN_RE, REGULAR_WIDTH],
|
|
92
|
+
[ANSI_RE, ANSI_WIDTH],
|
|
93
|
+
[CONTROL_RE, CONTROL_WIDTH],
|
|
94
|
+
[TAB_RE, TAB_WIDTH],
|
|
95
|
+
[EMOJI_RE, EMOJI_WIDTH],
|
|
96
|
+
[CJKT_WIDE_RE, WIDE_WIDTH]
|
|
97
|
+
];
|
|
82
98
|
let indexPrev = 0;
|
|
83
99
|
let index = 0;
|
|
84
100
|
let length = input.length;
|
|
@@ -98,10 +114,8 @@ var init_dist = __esm({
|
|
|
98
114
|
const codePoint = char.codePointAt(0) || 0;
|
|
99
115
|
if (isFullWidth(codePoint)) {
|
|
100
116
|
widthExtra = FULL_WIDTH_WIDTH;
|
|
101
|
-
} else if (
|
|
117
|
+
} else if (isWideNotCJKTNotEmoji(codePoint)) {
|
|
102
118
|
widthExtra = WIDE_WIDTH;
|
|
103
|
-
} else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) {
|
|
104
|
-
widthExtra = AMBIGUOUS_WIDTH;
|
|
105
119
|
} else {
|
|
106
120
|
widthExtra = REGULAR_WIDTH;
|
|
107
121
|
}
|
|
@@ -117,88 +131,28 @@ var init_dist = __esm({
|
|
|
117
131
|
}
|
|
118
132
|
unmatchedStart = unmatchedEnd = 0;
|
|
119
133
|
}
|
|
120
|
-
if (index >= length)
|
|
121
|
-
break;
|
|
122
|
-
LATIN_RE.lastIndex = index;
|
|
123
|
-
if (LATIN_RE.test(input)) {
|
|
124
|
-
lengthExtra = LATIN_RE.lastIndex - index;
|
|
125
|
-
widthExtra = lengthExtra * REGULAR_WIDTH;
|
|
126
|
-
if (width + widthExtra > truncationLimit) {
|
|
127
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
|
|
128
|
-
}
|
|
129
|
-
if (width + widthExtra > LIMIT) {
|
|
130
|
-
truncationEnabled = true;
|
|
131
|
-
break;
|
|
132
|
-
}
|
|
133
|
-
width += widthExtra;
|
|
134
|
-
unmatchedStart = indexPrev;
|
|
135
|
-
unmatchedEnd = index;
|
|
136
|
-
index = indexPrev = LATIN_RE.lastIndex;
|
|
137
|
-
continue;
|
|
134
|
+
if (index >= length) {
|
|
135
|
+
break outer;
|
|
138
136
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
widthExtra = lengthExtra * CONTROL_WIDTH;
|
|
158
|
-
if (width + widthExtra > truncationLimit) {
|
|
159
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
|
|
160
|
-
}
|
|
161
|
-
if (width + widthExtra > LIMIT) {
|
|
162
|
-
truncationEnabled = true;
|
|
163
|
-
break;
|
|
164
|
-
}
|
|
165
|
-
width += widthExtra;
|
|
166
|
-
unmatchedStart = indexPrev;
|
|
167
|
-
unmatchedEnd = index;
|
|
168
|
-
index = indexPrev = CONTROL_RE.lastIndex;
|
|
169
|
-
continue;
|
|
170
|
-
}
|
|
171
|
-
TAB_RE.lastIndex = index;
|
|
172
|
-
if (TAB_RE.test(input)) {
|
|
173
|
-
lengthExtra = TAB_RE.lastIndex - index;
|
|
174
|
-
widthExtra = lengthExtra * TAB_WIDTH;
|
|
175
|
-
if (width + widthExtra > truncationLimit) {
|
|
176
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
|
|
177
|
-
}
|
|
178
|
-
if (width + widthExtra > LIMIT) {
|
|
179
|
-
truncationEnabled = true;
|
|
180
|
-
break;
|
|
181
|
-
}
|
|
182
|
-
width += widthExtra;
|
|
183
|
-
unmatchedStart = indexPrev;
|
|
184
|
-
unmatchedEnd = index;
|
|
185
|
-
index = indexPrev = TAB_RE.lastIndex;
|
|
186
|
-
continue;
|
|
187
|
-
}
|
|
188
|
-
EMOJI_RE.lastIndex = index;
|
|
189
|
-
if (EMOJI_RE.test(input)) {
|
|
190
|
-
if (width + EMOJI_WIDTH > truncationLimit) {
|
|
191
|
-
truncationIndex = Math.min(truncationIndex, index);
|
|
192
|
-
}
|
|
193
|
-
if (width + EMOJI_WIDTH > LIMIT) {
|
|
194
|
-
truncationEnabled = true;
|
|
195
|
-
break;
|
|
137
|
+
for (let i2 = 0, l2 = PARSE_BLOCKS.length; i2 < l2; i2++) {
|
|
138
|
+
const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i2];
|
|
139
|
+
BLOCK_RE.lastIndex = index;
|
|
140
|
+
if (BLOCK_RE.test(input)) {
|
|
141
|
+
lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
|
|
142
|
+
widthExtra = lengthExtra * BLOCK_WIDTH;
|
|
143
|
+
if (width + widthExtra > truncationLimit) {
|
|
144
|
+
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
|
|
145
|
+
}
|
|
146
|
+
if (width + widthExtra > LIMIT) {
|
|
147
|
+
truncationEnabled = true;
|
|
148
|
+
break outer;
|
|
149
|
+
}
|
|
150
|
+
width += widthExtra;
|
|
151
|
+
unmatchedStart = indexPrev;
|
|
152
|
+
unmatchedEnd = index;
|
|
153
|
+
index = indexPrev = BLOCK_RE.lastIndex;
|
|
154
|
+
continue outer;
|
|
196
155
|
}
|
|
197
|
-
width += EMOJI_WIDTH;
|
|
198
|
-
unmatchedStart = indexPrev;
|
|
199
|
-
unmatchedEnd = index;
|
|
200
|
-
index = indexPrev = EMOJI_RE.lastIndex;
|
|
201
|
-
continue;
|
|
202
156
|
}
|
|
203
157
|
index += 1;
|
|
204
158
|
}
|
|
@@ -213,10 +167,10 @@ var init_dist = __esm({
|
|
|
213
167
|
}
|
|
214
168
|
});
|
|
215
169
|
|
|
216
|
-
// node_modules/.bun/fast-string-width@
|
|
170
|
+
// node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
|
|
217
171
|
var NO_TRUNCATION2, fastStringWidth, dist_default2;
|
|
218
172
|
var init_dist2 = __esm({
|
|
219
|
-
"node_modules/.bun/fast-string-width@
|
|
173
|
+
"node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js"() {
|
|
220
174
|
init_utils2();
|
|
221
175
|
init_dist();
|
|
222
176
|
NO_TRUNCATION2 = {
|
|
@@ -231,13 +185,13 @@ var init_dist2 = __esm({
|
|
|
231
185
|
}
|
|
232
186
|
});
|
|
233
187
|
|
|
234
|
-
// node_modules/.bun/fast-wrap-ansi@0.
|
|
188
|
+
// node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js
|
|
235
189
|
function wrapAnsi(string, columns, options) {
|
|
236
190
|
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
|
|
237
191
|
}
|
|
238
192
|
var ESC, CSI, END_CODE, ANSI_ESCAPE_BELL, ANSI_CSI, ANSI_OSC, ANSI_SGR_TERMINATOR, ANSI_ESCAPE_LINK, GROUP_REGEX, getClosingCode, wrapAnsiCode, wrapAnsiHyperlink, wrapWord, stringVisibleTrimSpacesRight, exec, CRLF_OR_LF;
|
|
239
193
|
var init_main = __esm({
|
|
240
|
-
"node_modules/.bun/fast-wrap-ansi@0.
|
|
194
|
+
"node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js"() {
|
|
241
195
|
init_utils2();
|
|
242
196
|
init_dist2();
|
|
243
197
|
ESC = "\x1B";
|
|
@@ -401,16 +355,19 @@ var init_main = __esm({
|
|
|
401
355
|
}
|
|
402
356
|
const preString = rows.join("\n");
|
|
403
357
|
let inSurrogate = false;
|
|
404
|
-
for (let
|
|
405
|
-
const character = preString[
|
|
358
|
+
for (let i2 = 0; i2 < preString.length; i2++) {
|
|
359
|
+
const character = preString[i2];
|
|
406
360
|
returnValue += character;
|
|
407
361
|
if (!inSurrogate) {
|
|
408
362
|
inSurrogate = character >= "\uD800" && character <= "\uDBFF";
|
|
363
|
+
if (inSurrogate) {
|
|
364
|
+
continue;
|
|
365
|
+
}
|
|
409
366
|
} else {
|
|
410
|
-
|
|
367
|
+
inSurrogate = false;
|
|
411
368
|
}
|
|
412
369
|
if (character === ESC || character === CSI) {
|
|
413
|
-
GROUP_REGEX.lastIndex =
|
|
370
|
+
GROUP_REGEX.lastIndex = i2 + 1;
|
|
414
371
|
const groupsResult = GROUP_REGEX.exec(preString);
|
|
415
372
|
const groups = groupsResult?.groups;
|
|
416
373
|
if (groups?.code !== void 0) {
|
|
@@ -420,7 +377,7 @@ var init_main = __esm({
|
|
|
420
377
|
escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
421
378
|
}
|
|
422
379
|
}
|
|
423
|
-
if (preString[
|
|
380
|
+
if (preString[i2 + 1] === "\n") {
|
|
424
381
|
if (escapeUrl) {
|
|
425
382
|
returnValue += wrapAnsiHyperlink("");
|
|
426
383
|
}
|
|
@@ -451,7 +408,7 @@ var require_src = __commonJS({
|
|
|
451
408
|
var ESC2 = "\x1B";
|
|
452
409
|
var CSI2 = `${ESC2}[`;
|
|
453
410
|
var beep = "\x07";
|
|
454
|
-
var
|
|
411
|
+
var cursor3 = {
|
|
455
412
|
to(x, y2) {
|
|
456
413
|
if (!y2) return `${CSI2}${x + 1}G`;
|
|
457
414
|
return `${CSI2}${y2 + 1};${x + 1}H`;
|
|
@@ -480,7 +437,7 @@ var require_src = __commonJS({
|
|
|
480
437
|
up: (count = 1) => `${CSI2}S`.repeat(count),
|
|
481
438
|
down: (count = 1) => `${CSI2}T`.repeat(count)
|
|
482
439
|
};
|
|
483
|
-
var
|
|
440
|
+
var erase3 = {
|
|
484
441
|
screen: `${CSI2}2J`,
|
|
485
442
|
up: (count = 1) => `${CSI2}1J`.repeat(count),
|
|
486
443
|
down: (count = 1) => `${CSI2}J`.repeat(count),
|
|
@@ -489,89 +446,169 @@ var require_src = __commonJS({
|
|
|
489
446
|
lineStart: `${CSI2}1K`,
|
|
490
447
|
lines(count) {
|
|
491
448
|
let clear = "";
|
|
492
|
-
for (let
|
|
493
|
-
clear += this.line + (
|
|
449
|
+
for (let i2 = 0; i2 < count; i2++)
|
|
450
|
+
clear += this.line + (i2 < count - 1 ? cursor3.up() : "");
|
|
494
451
|
if (count)
|
|
495
|
-
clear +=
|
|
452
|
+
clear += cursor3.left;
|
|
496
453
|
return clear;
|
|
497
454
|
}
|
|
498
455
|
};
|
|
499
|
-
module.exports = { cursor, scroll, erase, beep };
|
|
456
|
+
module.exports = { cursor: cursor3, scroll, erase: erase3, beep };
|
|
500
457
|
}
|
|
501
458
|
});
|
|
502
459
|
|
|
503
|
-
// node_modules/.bun/@clack+core@1.
|
|
504
|
-
import { styleText
|
|
505
|
-
import { stdout
|
|
506
|
-
import * as
|
|
507
|
-
import
|
|
508
|
-
import { ReadStream
|
|
509
|
-
function
|
|
510
|
-
if (!
|
|
511
|
-
|
|
512
|
-
|
|
460
|
+
// node_modules/.bun/@clack+core@1.5.0/node_modules/@clack/core/dist/index.mjs
|
|
461
|
+
import { styleText } from "node:util";
|
|
462
|
+
import { stdout, stdin } from "node:process";
|
|
463
|
+
import * as l from "node:readline";
|
|
464
|
+
import l__default from "node:readline";
|
|
465
|
+
import { ReadStream } from "node:tty";
|
|
466
|
+
function findCursor(s, o, l2) {
|
|
467
|
+
if (!l2.some((r2) => !r2.disabled))
|
|
468
|
+
return s;
|
|
469
|
+
const t2 = s + o, n3 = Math.max(l2.length - 1, 0), e = t2 < 0 ? n3 : t2 > n3 ? 0 : t2;
|
|
470
|
+
return l2[e]?.disabled ? findCursor(e, o < 0 ? -1 : 1, l2) : e;
|
|
471
|
+
}
|
|
472
|
+
function isAccessible(n3) {
|
|
473
|
+
if (n3 !== void 0) return n3;
|
|
474
|
+
if (settings.accessible !== void 0) return settings.accessible;
|
|
475
|
+
const e = process.env.ACCESSIBLE;
|
|
476
|
+
return e !== void 0 && e !== "" && e !== "0" && e !== "false";
|
|
513
477
|
}
|
|
514
|
-
function
|
|
515
|
-
if (typeof
|
|
516
|
-
|
|
478
|
+
function isActionKey(n3, e) {
|
|
479
|
+
if (typeof n3 == "string")
|
|
480
|
+
return settings.aliases.get(n3) === e;
|
|
481
|
+
for (const s of n3)
|
|
482
|
+
if (s !== void 0 && isActionKey(s, e))
|
|
483
|
+
return true;
|
|
517
484
|
return false;
|
|
518
485
|
}
|
|
519
|
-
function
|
|
520
|
-
if (
|
|
521
|
-
const e =
|
|
522
|
-
`),
|
|
523
|
-
`),
|
|
524
|
-
for (let
|
|
525
|
-
|
|
486
|
+
function diffLines(i2, s) {
|
|
487
|
+
if (i2 === s) return;
|
|
488
|
+
const e = i2.split(`
|
|
489
|
+
`), t2 = s.split(`
|
|
490
|
+
`), r2 = Math.max(e.length, t2.length), f = [];
|
|
491
|
+
for (let n3 = 0; n3 < r2; n3++)
|
|
492
|
+
e[n3] !== t2[n3] && f.push(n3);
|
|
493
|
+
return {
|
|
494
|
+
lines: f,
|
|
495
|
+
numLinesBefore: e.length,
|
|
496
|
+
numLinesAfter: t2.length,
|
|
497
|
+
numLines: r2
|
|
498
|
+
};
|
|
526
499
|
}
|
|
527
|
-
function
|
|
528
|
-
return
|
|
500
|
+
function isCancel(e) {
|
|
501
|
+
return e === CANCEL_SYMBOL;
|
|
529
502
|
}
|
|
530
|
-
function
|
|
531
|
-
const
|
|
532
|
-
|
|
503
|
+
function setRawMode(e, r2) {
|
|
504
|
+
const o = e;
|
|
505
|
+
o.isTTY && o.setRawMode(r2);
|
|
533
506
|
}
|
|
534
|
-
function
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
507
|
+
function block({
|
|
508
|
+
input: e = stdin,
|
|
509
|
+
output: r2 = stdout,
|
|
510
|
+
overwrite: o = true,
|
|
511
|
+
hideCursor: n3 = true
|
|
512
|
+
} = {}) {
|
|
513
|
+
const s = l.createInterface({
|
|
514
|
+
input: e,
|
|
515
|
+
output: r2,
|
|
516
|
+
prompt: "",
|
|
517
|
+
tabSize: 1
|
|
518
|
+
});
|
|
519
|
+
l.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(true);
|
|
520
|
+
const t2 = (f, { name: a2, sequence: w }) => {
|
|
521
|
+
const c2 = String(f);
|
|
522
|
+
if (isActionKey([c2, a2, w], "cancel")) {
|
|
523
|
+
n3 && r2.write(import_sisteransi.cursor.show), process.exit(0);
|
|
541
524
|
return;
|
|
542
525
|
}
|
|
543
|
-
if (!
|
|
544
|
-
const
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
526
|
+
if (!o) return;
|
|
527
|
+
const i2 = a2 === "return" ? 0 : -1, m = a2 === "return" ? -1 : 0;
|
|
528
|
+
l.moveCursor(r2, i2, m, () => {
|
|
529
|
+
l.clearLine(r2, 1, () => {
|
|
530
|
+
e.once("keypress", t2);
|
|
548
531
|
});
|
|
549
532
|
});
|
|
550
533
|
};
|
|
551
|
-
return
|
|
552
|
-
|
|
534
|
+
return n3 && r2.write(import_sisteransi.cursor.hide), e.once("keypress", t2), () => {
|
|
535
|
+
e.off("keypress", t2), n3 && r2.write(import_sisteransi.cursor.show), e instanceof ReadStream && e.isTTY && !R && e.setRawMode(false), s.terminal = false, s.close();
|
|
553
536
|
};
|
|
554
537
|
}
|
|
555
|
-
function
|
|
556
|
-
const
|
|
557
|
-
return wrapAnsi(
|
|
558
|
-
|
|
538
|
+
function wrapTextWithPrefix(e, r2, o, n3 = o, s = o, t2) {
|
|
539
|
+
const f = getColumns(e ?? stdout);
|
|
540
|
+
return wrapAnsi(r2, f - o.length, {
|
|
541
|
+
hard: true,
|
|
542
|
+
trim: false
|
|
543
|
+
}).split(`
|
|
544
|
+
`).map((c2, i2, m) => {
|
|
545
|
+
const d = t2 ? t2(c2, i2) : c2;
|
|
546
|
+
return i2 === 0 ? `${n3}${d}` : i2 === m.length - 1 ? `${s}${d}` : `${o}${d}`;
|
|
547
|
+
}).join(`
|
|
559
548
|
`);
|
|
560
549
|
}
|
|
561
|
-
|
|
550
|
+
function runValidation(e, a2) {
|
|
551
|
+
if ("~standard" in e) {
|
|
552
|
+
const n3 = e["~standard"].validate(a2);
|
|
553
|
+
return n3 instanceof Promise ? n3.then((r2) => r2.issues?.at(0)?.message) : n3.issues?.at(0)?.message;
|
|
554
|
+
}
|
|
555
|
+
return e(a2);
|
|
556
|
+
}
|
|
557
|
+
var import_sisteransi, a$1, t, settings, R, CANCEL_SYMBOL, getColumns, getRows, y, r, n$1, n2;
|
|
562
558
|
var init_dist3 = __esm({
|
|
563
|
-
"node_modules/.bun/@clack+core@1.
|
|
559
|
+
"node_modules/.bun/@clack+core@1.5.0/node_modules/@clack/core/dist/index.mjs"() {
|
|
564
560
|
init_utils2();
|
|
565
561
|
init_main();
|
|
566
562
|
import_sisteransi = __toESM(require_src(), 1);
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
563
|
+
a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
564
|
+
t = [
|
|
565
|
+
"January",
|
|
566
|
+
"February",
|
|
567
|
+
"March",
|
|
568
|
+
"April",
|
|
569
|
+
"May",
|
|
570
|
+
"June",
|
|
571
|
+
"July",
|
|
572
|
+
"August",
|
|
573
|
+
"September",
|
|
574
|
+
"October",
|
|
575
|
+
"November",
|
|
576
|
+
"December"
|
|
577
|
+
];
|
|
578
|
+
settings = {
|
|
579
|
+
actions: new Set(a$1),
|
|
580
|
+
aliases: /* @__PURE__ */ new Map([
|
|
581
|
+
// vim support
|
|
582
|
+
["k", "up"],
|
|
583
|
+
["j", "down"],
|
|
584
|
+
["h", "left"],
|
|
585
|
+
["l", "right"],
|
|
586
|
+
["", "cancel"],
|
|
587
|
+
// opinionated defaults!
|
|
588
|
+
["escape", "cancel"]
|
|
589
|
+
]),
|
|
590
|
+
messages: {
|
|
591
|
+
cancel: "Canceled",
|
|
592
|
+
error: "Something went wrong"
|
|
593
|
+
},
|
|
594
|
+
withGuide: true,
|
|
595
|
+
accessible: void 0,
|
|
596
|
+
date: {
|
|
597
|
+
monthNames: [...t],
|
|
598
|
+
messages: {
|
|
599
|
+
required: "Please enter a valid date",
|
|
600
|
+
invalidMonth: "There are only 12 months in a year",
|
|
601
|
+
invalidDay: (n3, e) => `There are only ${n3} days in ${e}`,
|
|
602
|
+
afterMin: (n3) => `Date must be on or after ${n3.toISOString().slice(0, 10)}`,
|
|
603
|
+
beforeMax: (n3) => `Date must be on or before ${n3.toISOString().slice(0, 10)}`
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
R = globalThis.process.platform.startsWith("win");
|
|
608
|
+
CANCEL_SYMBOL = /* @__PURE__ */ Symbol("clack:cancel");
|
|
609
|
+
getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
|
|
610
|
+
getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
|
|
611
|
+
y = class {
|
|
575
612
|
input;
|
|
576
613
|
output;
|
|
577
614
|
_abortSignal;
|
|
@@ -586,46 +623,92 @@ var init_dist3 = __esm({
|
|
|
586
623
|
error = "";
|
|
587
624
|
value;
|
|
588
625
|
userInput = "";
|
|
626
|
+
/**
|
|
627
|
+
* Whether accessible (static, screen-reader friendly) output is enabled for
|
|
628
|
+
* this prompt, resolved from the `accessible` option, the global setting,
|
|
629
|
+
* and the `ACCESSIBLE` env var.
|
|
630
|
+
*/
|
|
631
|
+
get accessible() {
|
|
632
|
+
return isAccessible(this.opts.accessible);
|
|
633
|
+
}
|
|
589
634
|
constructor(t2, e = true) {
|
|
590
|
-
const { input:
|
|
591
|
-
this.opts =
|
|
635
|
+
const { input: i2 = stdin, output: s = stdout, render: r2, signal: n3, ...o } = t2;
|
|
636
|
+
this.opts = o, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = r2.bind(this), this._track = e, this._abortSignal = n3, this.input = i2, this.output = s;
|
|
592
637
|
}
|
|
638
|
+
/**
|
|
639
|
+
* Unsubscribe all listeners
|
|
640
|
+
*/
|
|
593
641
|
unsubscribe() {
|
|
594
642
|
this._subscribers.clear();
|
|
595
643
|
}
|
|
644
|
+
/**
|
|
645
|
+
* Set a subscriber with opts
|
|
646
|
+
* @param event - The event name
|
|
647
|
+
*/
|
|
596
648
|
setSubscriber(t2, e) {
|
|
597
|
-
const
|
|
598
|
-
|
|
649
|
+
const i2 = this._subscribers.get(t2) ?? [];
|
|
650
|
+
i2.push(e), this._subscribers.set(t2, i2);
|
|
599
651
|
}
|
|
652
|
+
/**
|
|
653
|
+
* Subscribe to an event
|
|
654
|
+
* @param event - The event name
|
|
655
|
+
* @param cb - The callback
|
|
656
|
+
*/
|
|
600
657
|
on(t2, e) {
|
|
601
658
|
this.setSubscriber(t2, { cb: e });
|
|
602
659
|
}
|
|
660
|
+
/**
|
|
661
|
+
* Subscribe to an event once
|
|
662
|
+
* @param event - The event name
|
|
663
|
+
* @param cb - The callback
|
|
664
|
+
*/
|
|
603
665
|
once(t2, e) {
|
|
604
666
|
this.setSubscriber(t2, { cb: e, once: true });
|
|
605
667
|
}
|
|
668
|
+
/**
|
|
669
|
+
* Emit an event with data
|
|
670
|
+
* @param event - The event name
|
|
671
|
+
* @param data - The data to pass to the callback
|
|
672
|
+
*/
|
|
606
673
|
emit(t2, ...e) {
|
|
607
|
-
const
|
|
608
|
-
for (const
|
|
609
|
-
|
|
674
|
+
const i2 = this._subscribers.get(t2) ?? [], s = [];
|
|
675
|
+
for (const r2 of i2)
|
|
676
|
+
r2.cb(...e), r2.once && s.push(() => i2.splice(i2.indexOf(r2), 1));
|
|
677
|
+
for (const r2 of s)
|
|
678
|
+
r2();
|
|
610
679
|
}
|
|
611
680
|
prompt() {
|
|
612
681
|
return new Promise((t2) => {
|
|
613
682
|
if (this._abortSignal) {
|
|
614
|
-
if (this._abortSignal.aborted)
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
683
|
+
if (this._abortSignal.aborted)
|
|
684
|
+
return this.state = "cancel", this.close(), t2(CANCEL_SYMBOL);
|
|
685
|
+
this._abortSignal.addEventListener(
|
|
686
|
+
"abort",
|
|
687
|
+
() => {
|
|
688
|
+
this.state = "cancel", this.close();
|
|
689
|
+
},
|
|
690
|
+
{ once: true }
|
|
691
|
+
);
|
|
618
692
|
}
|
|
619
|
-
this.rl =
|
|
620
|
-
|
|
693
|
+
this.rl = l__default.createInterface({
|
|
694
|
+
input: this.input,
|
|
695
|
+
tabSize: 2,
|
|
696
|
+
prompt: "",
|
|
697
|
+
escapeCodeTimeout: 50,
|
|
698
|
+
terminal: true
|
|
699
|
+
}), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), setRawMode(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
700
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(this.value);
|
|
621
701
|
}), this.once("cancel", () => {
|
|
622
|
-
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render),
|
|
702
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(CANCEL_SYMBOL);
|
|
623
703
|
});
|
|
624
704
|
});
|
|
625
705
|
}
|
|
626
706
|
_isActionKey(t2, e) {
|
|
627
707
|
return t2 === " ";
|
|
628
708
|
}
|
|
709
|
+
_shouldSubmit(t2, e) {
|
|
710
|
+
return true;
|
|
711
|
+
}
|
|
629
712
|
_setValue(t2) {
|
|
630
713
|
this.value = t2, this.emit("value", this.value);
|
|
631
714
|
}
|
|
@@ -635,19 +718,22 @@ var init_dist3 = __esm({
|
|
|
635
718
|
_clearUserInput() {
|
|
636
719
|
this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
|
|
637
720
|
}
|
|
638
|
-
onKeypress(t2, e) {
|
|
639
|
-
if (this.
|
|
640
|
-
if (this.
|
|
641
|
-
|
|
642
|
-
|
|
721
|
+
async onKeypress(t2, e) {
|
|
722
|
+
if (this.state !== "validating") {
|
|
723
|
+
if (this._track && e.name !== "return" && (e.name && this._isActionKey(t2, e) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && settings.aliases.has(e.name) && this.emit("cursor", settings.aliases.get(e.name)), settings.actions.has(e.name) && this.emit("cursor", e.name)), t2 && (t2.toLowerCase() === "y" || t2.toLowerCase() === "n") && this.emit("confirm", t2.toLowerCase() === "y"), this.emit("key", t2, e), e?.name === "return" && this._shouldSubmit(t2, e)) {
|
|
724
|
+
if (this.opts.validate) {
|
|
725
|
+
const i2 = runValidation(this.opts.validate, this.value);
|
|
726
|
+
let s;
|
|
727
|
+
i2 instanceof Promise ? (this.state = "validating", this.render(), s = await i2) : s = i2, s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
|
|
728
|
+
}
|
|
729
|
+
this.state !== "error" && (this.state = "submit");
|
|
643
730
|
}
|
|
644
|
-
this.state
|
|
731
|
+
isActionKey([t2, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
645
732
|
}
|
|
646
|
-
V([t2, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
647
733
|
}
|
|
648
734
|
close() {
|
|
649
735
|
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
650
|
-
`),
|
|
736
|
+
`), setRawMode(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
651
737
|
}
|
|
652
738
|
restoreCursor() {
|
|
653
739
|
const t2 = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
|
|
@@ -655,34 +741,39 @@ var init_dist3 = __esm({
|
|
|
655
741
|
this.output.write(import_sisteransi.cursor.move(-999, t2 * -1));
|
|
656
742
|
}
|
|
657
743
|
render() {
|
|
658
|
-
const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
|
|
744
|
+
const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
|
|
745
|
+
hard: true,
|
|
746
|
+
trim: false
|
|
747
|
+
});
|
|
659
748
|
if (t2 !== this._prevFrame) {
|
|
660
|
-
if (this.state === "initial")
|
|
749
|
+
if (this.state === "initial")
|
|
750
|
+
this.output.write(import_sisteransi.cursor.hide);
|
|
661
751
|
else {
|
|
662
|
-
const e =
|
|
752
|
+
const e = diffLines(this._prevFrame, t2), i2 = getRows(this.output);
|
|
663
753
|
if (this.restoreCursor(), e) {
|
|
664
|
-
const
|
|
665
|
-
let
|
|
666
|
-
if (
|
|
754
|
+
const s = Math.max(0, e.numLinesAfter - i2), r2 = Math.max(0, e.numLinesBefore - i2);
|
|
755
|
+
let n3 = e.lines.find((o) => o >= s);
|
|
756
|
+
if (n3 === void 0) {
|
|
667
757
|
this._prevFrame = t2;
|
|
668
758
|
return;
|
|
669
759
|
}
|
|
670
760
|
if (e.lines.length === 1) {
|
|
671
|
-
this.output.write(import_sisteransi.cursor.move(0,
|
|
672
|
-
const
|
|
761
|
+
this.output.write(import_sisteransi.cursor.move(0, n3 - r2)), this.output.write(import_sisteransi.erase.lines(1));
|
|
762
|
+
const o = t2.split(`
|
|
673
763
|
`);
|
|
674
|
-
this.output.write(
|
|
764
|
+
this.output.write(o[n3]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, o.length - n3 - 1));
|
|
675
765
|
return;
|
|
676
766
|
} else if (e.lines.length > 1) {
|
|
677
|
-
if (
|
|
767
|
+
if (s < r2)
|
|
768
|
+
n3 = s;
|
|
678
769
|
else {
|
|
679
|
-
const
|
|
680
|
-
|
|
770
|
+
const h2 = n3 - r2;
|
|
771
|
+
h2 > 0 && this.output.write(import_sisteransi.cursor.move(0, h2));
|
|
681
772
|
}
|
|
682
773
|
this.output.write(import_sisteransi.erase.down());
|
|
683
|
-
const
|
|
684
|
-
`).slice(
|
|
685
|
-
this.output.write(
|
|
774
|
+
const f = t2.split(`
|
|
775
|
+
`).slice(n3);
|
|
776
|
+
this.output.write(f.join(`
|
|
686
777
|
`)), this._prevFrame = t2;
|
|
687
778
|
return;
|
|
688
779
|
}
|
|
@@ -693,7 +784,7 @@ var init_dist3 = __esm({
|
|
|
693
784
|
}
|
|
694
785
|
}
|
|
695
786
|
};
|
|
696
|
-
|
|
787
|
+
r = class extends y {
|
|
697
788
|
get cursor() {
|
|
698
789
|
return this.value ? 0 : 1;
|
|
699
790
|
}
|
|
@@ -703,54 +794,60 @@ var init_dist3 = __esm({
|
|
|
703
794
|
constructor(t2) {
|
|
704
795
|
super(t2, false), this.value = !!t2.initialValue, this.on("userInput", () => {
|
|
705
796
|
this.value = this._value;
|
|
706
|
-
}), this.on("confirm", (
|
|
707
|
-
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value =
|
|
797
|
+
}), this.on("confirm", (i2) => {
|
|
798
|
+
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = i2, this.state = "submit", this.close();
|
|
708
799
|
}), this.on("cursor", () => {
|
|
709
800
|
this.value = !this.value;
|
|
710
801
|
});
|
|
711
802
|
}
|
|
712
803
|
};
|
|
713
|
-
|
|
804
|
+
n$1 = class n extends y {
|
|
714
805
|
options;
|
|
715
806
|
cursor = 0;
|
|
716
807
|
get _selectedValue() {
|
|
717
808
|
return this.options[this.cursor];
|
|
718
809
|
}
|
|
719
810
|
changeValue() {
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
811
|
+
const e = this._selectedValue;
|
|
812
|
+
this.value = e === void 0 ? void 0 : e.value;
|
|
813
|
+
}
|
|
814
|
+
constructor(e) {
|
|
815
|
+
super(e, false), this.options = e.options;
|
|
816
|
+
const o = this.options.findIndex(({ value: s }) => s === e.initialValue), t2 = o === -1 ? 0 : o;
|
|
817
|
+
this.cursor = this.options[t2]?.disabled ? findCursor(t2, 1, this.options) : t2, this.changeValue(), this.on("cursor", (s) => {
|
|
818
|
+
switch (s) {
|
|
727
819
|
case "left":
|
|
728
820
|
case "up":
|
|
729
|
-
this.cursor =
|
|
821
|
+
this.cursor = findCursor(this.cursor, -1, this.options);
|
|
730
822
|
break;
|
|
731
823
|
case "down":
|
|
732
824
|
case "right":
|
|
733
|
-
this.cursor =
|
|
825
|
+
this.cursor = findCursor(this.cursor, 1, this.options);
|
|
734
826
|
break;
|
|
735
827
|
}
|
|
736
828
|
this.changeValue();
|
|
737
829
|
});
|
|
738
830
|
}
|
|
739
831
|
};
|
|
740
|
-
|
|
832
|
+
n2 = class extends y {
|
|
741
833
|
get userInputWithCursor() {
|
|
742
|
-
if (this.state === "submit")
|
|
834
|
+
if (this.state === "submit")
|
|
835
|
+
return this.userInput;
|
|
743
836
|
const t2 = this.userInput;
|
|
744
|
-
if (this.cursor >= t2.length)
|
|
745
|
-
|
|
746
|
-
|
|
837
|
+
if (this.cursor >= t2.length)
|
|
838
|
+
return `${this.userInput}\u2588`;
|
|
839
|
+
const r2 = t2.slice(0, this.cursor), s = t2.slice(this.cursor, this.cursor + 1), e = t2.slice(this.cursor + 1);
|
|
840
|
+
return `${r2}${styleText("inverse", s)}${e}`;
|
|
747
841
|
}
|
|
748
842
|
get cursor() {
|
|
749
843
|
return this._cursor;
|
|
750
844
|
}
|
|
751
845
|
constructor(t2) {
|
|
752
|
-
super({
|
|
753
|
-
|
|
846
|
+
super({
|
|
847
|
+
...t2,
|
|
848
|
+
initialUserInput: t2.initialUserInput ?? t2.initialValue
|
|
849
|
+
}), this.on("userInput", (r2) => {
|
|
850
|
+
this._setValue(r2);
|
|
754
851
|
}), this.on("finalize", () => {
|
|
755
852
|
this.value || (this.value = t2.defaultValue), this.value === void 0 && (this.value = "");
|
|
756
853
|
});
|
|
@@ -759,328 +856,503 @@ var init_dist3 = __esm({
|
|
|
759
856
|
}
|
|
760
857
|
});
|
|
761
858
|
|
|
762
|
-
// node_modules/.bun/@clack+prompts@1.
|
|
763
|
-
import { styleText as
|
|
764
|
-
import
|
|
765
|
-
import { existsSync
|
|
766
|
-
import { dirname
|
|
767
|
-
function
|
|
768
|
-
|
|
859
|
+
// node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs
|
|
860
|
+
import { styleText as styleText2, stripVTControlCharacters } from "node:util";
|
|
861
|
+
import process$1 from "node:process";
|
|
862
|
+
import { existsSync, lstatSync, readdirSync } from "node:fs";
|
|
863
|
+
import { dirname, join } from "node:path";
|
|
864
|
+
function isUnicodeSupported() {
|
|
865
|
+
if (process$1.platform !== "win32") {
|
|
866
|
+
return process$1.env.TERM !== "linux";
|
|
867
|
+
}
|
|
868
|
+
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";
|
|
869
|
+
}
|
|
870
|
+
function formatInstructionFooter(o, e) {
|
|
871
|
+
const r2 = [`${e ? `${styleText2("cyan", S_BAR)} ` : ""}${o.join(" \u2022 ")}`];
|
|
872
|
+
return e && r2.push(styleText2("cyan", S_BAR_END)), r2;
|
|
769
873
|
}
|
|
770
|
-
var import_sisteransi2,
|
|
874
|
+
var import_sisteransi2, unicode, isCI, unicodeOr, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_BAR_START, S_BAR, S_BAR_END, S_BAR_START_RIGHT, S_BAR_END_RIGHT, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, S_PASSWORD_MASK, S_BAR_H, S_CORNER_TOP_RIGHT, S_CONNECT_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_BOTTOM_LEFT, S_CORNER_TOP_LEFT, S_INFO, S_SUCCESS, S_WARN, S_ERROR, symbol, symbolBar, I, limitOptions, confirm, MULTISELECT_INSTRUCTIONS, log, cancel, intro, outro, W$1, C, note, W, spinner, u2, SELECT_INSTRUCTIONS, c, select, i, text;
|
|
771
875
|
var init_dist4 = __esm({
|
|
772
|
-
"node_modules/.bun/@clack+prompts@1.
|
|
876
|
+
"node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs"() {
|
|
773
877
|
init_utils2();
|
|
774
878
|
init_dist3();
|
|
775
879
|
init_dist3();
|
|
776
880
|
init_main();
|
|
777
881
|
init_dist2();
|
|
778
882
|
import_sisteransi2 = __toESM(require_src(), 1);
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
switch (
|
|
883
|
+
unicode = isUnicodeSupported();
|
|
884
|
+
isCI = () => process.env.CI === "true";
|
|
885
|
+
unicodeOr = (o, e) => unicode ? o : e;
|
|
886
|
+
S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
|
|
887
|
+
S_STEP_CANCEL = unicodeOr("\u25A0", "x");
|
|
888
|
+
S_STEP_ERROR = unicodeOr("\u25B2", "x");
|
|
889
|
+
S_STEP_SUBMIT = unicodeOr("\u25C7", "o");
|
|
890
|
+
S_BAR_START = unicodeOr("\u250C", "T");
|
|
891
|
+
S_BAR = unicodeOr("\u2502", "|");
|
|
892
|
+
S_BAR_END = unicodeOr("\u2514", "\u2014");
|
|
893
|
+
S_BAR_START_RIGHT = unicodeOr("\u2510", "T");
|
|
894
|
+
S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014");
|
|
895
|
+
S_RADIO_ACTIVE = unicodeOr("\u25CF", ">");
|
|
896
|
+
S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
|
|
897
|
+
S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
|
|
898
|
+
S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
|
|
899
|
+
S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
|
|
900
|
+
S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022");
|
|
901
|
+
S_BAR_H = unicodeOr("\u2500", "-");
|
|
902
|
+
S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+");
|
|
903
|
+
S_CONNECT_LEFT = unicodeOr("\u251C", "+");
|
|
904
|
+
S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+");
|
|
905
|
+
S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+");
|
|
906
|
+
S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+");
|
|
907
|
+
S_INFO = unicodeOr("\u25CF", "\u2022");
|
|
908
|
+
S_SUCCESS = unicodeOr("\u25C6", "*");
|
|
909
|
+
S_WARN = unicodeOr("\u25B2", "!");
|
|
910
|
+
S_ERROR = unicodeOr("\u25A0", "x");
|
|
911
|
+
symbol = (o) => {
|
|
912
|
+
switch (o) {
|
|
809
913
|
case "initial":
|
|
810
914
|
case "active":
|
|
811
|
-
return
|
|
915
|
+
return styleText2("cyan", S_STEP_ACTIVE);
|
|
812
916
|
case "cancel":
|
|
813
|
-
return
|
|
917
|
+
return styleText2("red", S_STEP_CANCEL);
|
|
814
918
|
case "error":
|
|
815
|
-
return
|
|
919
|
+
return styleText2("yellow", S_STEP_ERROR);
|
|
816
920
|
case "submit":
|
|
817
|
-
return
|
|
921
|
+
return styleText2("green", S_STEP_SUBMIT);
|
|
922
|
+
case "validating":
|
|
923
|
+
return styleText2("dim", S_STEP_ACTIVE);
|
|
818
924
|
}
|
|
819
925
|
};
|
|
820
|
-
|
|
821
|
-
switch (
|
|
926
|
+
symbolBar = (o) => {
|
|
927
|
+
switch (o) {
|
|
822
928
|
case "initial":
|
|
823
929
|
case "active":
|
|
824
|
-
return
|
|
930
|
+
return styleText2("cyan", S_BAR);
|
|
825
931
|
case "cancel":
|
|
826
|
-
return
|
|
932
|
+
return styleText2("red", S_BAR);
|
|
827
933
|
case "error":
|
|
828
|
-
return
|
|
934
|
+
return styleText2("yellow", S_BAR);
|
|
829
935
|
case "submit":
|
|
830
|
-
return
|
|
831
|
-
}
|
|
832
|
-
};
|
|
833
|
-
|
|
834
|
-
let
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
936
|
+
return styleText2("green", S_BAR);
|
|
937
|
+
}
|
|
938
|
+
};
|
|
939
|
+
I = (l2, e, w, p, b, C2 = false) => {
|
|
940
|
+
let r2 = e, O = 0;
|
|
941
|
+
if (C2)
|
|
942
|
+
for (let i2 = p - 1; i2 >= w; i2--) {
|
|
943
|
+
const m = l2[i2];
|
|
944
|
+
if (m && (r2 -= m.length), O++, r2 <= b) break;
|
|
945
|
+
}
|
|
946
|
+
else
|
|
947
|
+
for (let i2 = w; i2 < p; i2++) {
|
|
948
|
+
const m = l2[i2];
|
|
949
|
+
if (m && (r2 -= m.length), O++, r2 <= b) break;
|
|
950
|
+
}
|
|
951
|
+
return { lineCount: r2, removals: O };
|
|
952
|
+
};
|
|
953
|
+
limitOptions = ({
|
|
954
|
+
cursor: l2,
|
|
955
|
+
options: e,
|
|
956
|
+
style: w,
|
|
957
|
+
output: p = process.stdout,
|
|
958
|
+
maxItems: b = Number.POSITIVE_INFINITY,
|
|
959
|
+
columnPadding: C2 = 0,
|
|
960
|
+
rowPadding: r2 = 4
|
|
961
|
+
}) => {
|
|
962
|
+
const i2 = getColumns(p) - C2, m = getRows(p), M = styleText2("dim", "..."), v = Math.max(m - r2, 0), a2 = Math.max(Math.min(b, v), 5);
|
|
847
963
|
let f = 0;
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
964
|
+
l2 >= a2 - 3 && (f = Math.max(
|
|
965
|
+
Math.min(l2 - a2 + 3, e.length - a2),
|
|
966
|
+
0
|
|
967
|
+
));
|
|
968
|
+
let d = a2 < e.length && f > 0, c2 = a2 < e.length && f + a2 < e.length;
|
|
969
|
+
const W2 = Math.min(
|
|
970
|
+
f + a2,
|
|
971
|
+
e.length
|
|
972
|
+
), s = [];
|
|
973
|
+
let g = 0;
|
|
974
|
+
d && g++, c2 && g++;
|
|
975
|
+
const T = f + (d ? 1 : 0), y2 = W2 - (c2 ? 1 : 0);
|
|
976
|
+
for (let t2 = T; t2 < y2; t2++) {
|
|
977
|
+
const n3 = e[t2], o = n3 ? w(n3, t2 === l2) : "", h2 = wrapAnsi(o, i2, {
|
|
978
|
+
hard: true,
|
|
979
|
+
trim: false
|
|
980
|
+
}).split(`
|
|
852
981
|
`);
|
|
853
|
-
|
|
854
|
-
}
|
|
855
|
-
if (
|
|
856
|
-
let
|
|
857
|
-
const
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
982
|
+
s.push(h2), g += h2.length;
|
|
983
|
+
}
|
|
984
|
+
if (g > v) {
|
|
985
|
+
let t2 = 0, n3 = 0, o = g;
|
|
986
|
+
const h2 = l2 - T;
|
|
987
|
+
let u3 = v;
|
|
988
|
+
const L = () => I(s, o, 0, h2, u3), E = () => I(
|
|
989
|
+
s,
|
|
990
|
+
o,
|
|
991
|
+
h2 + 1,
|
|
992
|
+
s.length,
|
|
993
|
+
u3,
|
|
994
|
+
true
|
|
995
|
+
);
|
|
996
|
+
d ? ({ lineCount: o, removals: t2 } = L(), o > u3 && (c2 || (u3 -= 1), { lineCount: o, removals: n3 } = E())) : (c2 || (u3 -= 1), { lineCount: o, removals: n3 } = E(), o > u3 && (u3 -= 1, { lineCount: o, removals: t2 } = L())), t2 > 0 && (d = true, s.splice(0, t2)), n3 > 0 && (c2 = true, s.splice(s.length - n3, n3));
|
|
997
|
+
}
|
|
998
|
+
const x = [];
|
|
999
|
+
d && x.push(M);
|
|
1000
|
+
for (const t2 of s)
|
|
1001
|
+
for (const n3 of t2)
|
|
1002
|
+
x.push(n3);
|
|
1003
|
+
return c2 && x.push(M), x;
|
|
1004
|
+
};
|
|
1005
|
+
confirm = (i2) => {
|
|
1006
|
+
const a2 = i2.active ?? "Yes", s = i2.inactive ?? "No";
|
|
1007
|
+
return new r({
|
|
1008
|
+
active: a2,
|
|
1009
|
+
inactive: s,
|
|
1010
|
+
signal: i2.signal,
|
|
1011
|
+
input: i2.input,
|
|
1012
|
+
output: i2.output,
|
|
1013
|
+
initialValue: i2.initialValue ?? true,
|
|
1014
|
+
render() {
|
|
1015
|
+
const e = i2.withGuide ?? settings.withGuide, u3 = `${symbol(this.state)} `, l2 = e ? `${styleText2("gray", S_BAR)} ` : "", f = wrapTextWithPrefix(
|
|
1016
|
+
i2.output,
|
|
1017
|
+
i2.message,
|
|
1018
|
+
l2,
|
|
1019
|
+
u3
|
|
1020
|
+
), o = `${e ? `${styleText2("gray", S_BAR)}
|
|
1021
|
+
` : ""}${f}
|
|
1022
|
+
`, c2 = this.value ? a2 : s;
|
|
1023
|
+
switch (this.state) {
|
|
1024
|
+
case "submit": {
|
|
1025
|
+
const r2 = e ? `${styleText2("gray", S_BAR)} ` : "";
|
|
1026
|
+
return `${o}${r2}${styleText2("dim", c2)}`;
|
|
1027
|
+
}
|
|
1028
|
+
case "cancel": {
|
|
1029
|
+
const r2 = e ? `${styleText2("gray", S_BAR)} ` : "";
|
|
1030
|
+
return `${o}${r2}${styleText2(["strikethrough", "dim"], c2)}${e ? `
|
|
1031
|
+
${styleText2("gray", S_BAR)}` : ""}`;
|
|
1032
|
+
}
|
|
1033
|
+
default: {
|
|
1034
|
+
const r2 = e ? `${styleText2("cyan", S_BAR)} ` : "", g = e ? styleText2("cyan", S_BAR_END) : "";
|
|
1035
|
+
return `${o}${r2}${this.value ? `${styleText2("green", S_RADIO_ACTIVE)} ${a2}` : `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", a2)}`}${i2.vertical ? e ? `
|
|
1036
|
+
${styleText2("cyan", S_BAR)} ` : `
|
|
1037
|
+
` : ` ${styleText2("dim", "/")} `}${this.value ? `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", s)}` : `${styleText2("green", S_RADIO_ACTIVE)} ${s}`}
|
|
1038
|
+
${g}
|
|
887
1039
|
`;
|
|
1040
|
+
}
|
|
888
1041
|
}
|
|
889
1042
|
}
|
|
890
|
-
}
|
|
1043
|
+
}).prompt();
|
|
891
1044
|
};
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
1045
|
+
MULTISELECT_INSTRUCTIONS = [
|
|
1046
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
1047
|
+
`${styleText2("dim", "Space:")} select`,
|
|
1048
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
1049
|
+
];
|
|
1050
|
+
log = {
|
|
1051
|
+
message: (s = [], {
|
|
1052
|
+
symbol: e = styleText2("gray", S_BAR),
|
|
1053
|
+
secondarySymbol: r2 = styleText2("gray", S_BAR),
|
|
1054
|
+
output: m = process.stdout,
|
|
1055
|
+
spacing: l2 = 1,
|
|
1056
|
+
withGuide: c2
|
|
1057
|
+
} = {}) => {
|
|
1058
|
+
const t2 = [], o = c2 ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
|
|
1059
|
+
for (let i2 = 0; i2 < l2; i2++)
|
|
1060
|
+
t2.push(f);
|
|
1061
|
+
const g = Array.isArray(s) ? s : s.split(`
|
|
896
1062
|
`);
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
1063
|
+
if (g.length > 0) {
|
|
1064
|
+
const [i2, ...y2] = g;
|
|
1065
|
+
i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
|
|
1066
|
+
for (const p of y2)
|
|
1067
|
+
p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
|
|
1068
|
+
}
|
|
1069
|
+
m.write(`${t2.join(`
|
|
903
1070
|
`)}
|
|
904
1071
|
`);
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
1072
|
+
},
|
|
1073
|
+
info: (s, e) => {
|
|
1074
|
+
log.message(s, { ...e, symbol: styleText2("blue", S_INFO) });
|
|
1075
|
+
},
|
|
1076
|
+
success: (s, e) => {
|
|
1077
|
+
log.message(s, { ...e, symbol: styleText2("green", S_SUCCESS) });
|
|
1078
|
+
},
|
|
1079
|
+
step: (s, e) => {
|
|
1080
|
+
log.message(s, { ...e, symbol: styleText2("green", S_STEP_SUBMIT) });
|
|
1081
|
+
},
|
|
1082
|
+
warn: (s, e) => {
|
|
1083
|
+
log.message(s, { ...e, symbol: styleText2("yellow", S_WARN) });
|
|
1084
|
+
},
|
|
1085
|
+
/** alias for `log.warn()`. */
|
|
1086
|
+
warning: (s, e) => {
|
|
1087
|
+
log.warn(s, e);
|
|
1088
|
+
},
|
|
1089
|
+
error: (s, e) => {
|
|
1090
|
+
log.message(s, { ...e, symbol: styleText2("red", S_ERROR) });
|
|
1091
|
+
}
|
|
1092
|
+
};
|
|
1093
|
+
cancel = (o = "", t2) => {
|
|
1094
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_END)} ` : "";
|
|
1095
|
+
i2.write(`${e}${styleText2("red", o)}
|
|
921
1096
|
|
|
922
1097
|
`);
|
|
923
1098
|
};
|
|
924
|
-
|
|
925
|
-
const
|
|
926
|
-
|
|
1099
|
+
intro = (o = "", t2) => {
|
|
1100
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_START)} ` : "";
|
|
1101
|
+
i2.write(`${e}${o}
|
|
927
1102
|
`);
|
|
928
1103
|
};
|
|
929
|
-
|
|
930
|
-
const
|
|
931
|
-
${
|
|
932
|
-
|
|
1104
|
+
outro = (o = "", t2) => {
|
|
1105
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR)}
|
|
1106
|
+
${styleText2("gray", S_BAR_END)} ` : "";
|
|
1107
|
+
i2.write(`${e}${o}
|
|
933
1108
|
|
|
934
1109
|
`);
|
|
935
1110
|
};
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
const
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
1111
|
+
W$1 = (o) => o;
|
|
1112
|
+
C = (o, e, s) => {
|
|
1113
|
+
const a2 = {
|
|
1114
|
+
hard: true,
|
|
1115
|
+
trim: false
|
|
1116
|
+
}, i2 = wrapAnsi(o, e, a2).split(`
|
|
1117
|
+
`), c2 = i2.reduce((n3, t2) => Math.max(dist_default2(t2), n3), 0), u3 = i2.map(s).reduce((n3, t2) => Math.max(dist_default2(t2), n3), 0), g = e - (u3 - c2);
|
|
1118
|
+
return wrapAnsi(o, g, a2);
|
|
1119
|
+
};
|
|
1120
|
+
note = (o = "", e = "", s) => {
|
|
1121
|
+
const a2 = s?.output ?? process$1.stdout, i2 = s?.withGuide ?? settings.withGuide, c2 = s?.format ?? W$1, g = ["", ...C(o, getColumns(a2) - 6, c2).split(`
|
|
1122
|
+
`).map(c2), ""], n3 = dist_default2(e), t2 = Math.max(
|
|
1123
|
+
g.reduce((m, F) => {
|
|
1124
|
+
const O = dist_default2(F);
|
|
1125
|
+
return O > m ? O : m;
|
|
1126
|
+
}, 0),
|
|
1127
|
+
n3
|
|
1128
|
+
) + 2, h2 = g.map(
|
|
1129
|
+
(m) => `${styleText2("gray", S_BAR)} ${m}${" ".repeat(t2 - dist_default2(m))}${styleText2("gray", S_BAR)}`
|
|
1130
|
+
).join(`
|
|
1131
|
+
`), T = i2 ? `${styleText2("gray", S_BAR)}
|
|
1132
|
+
` : "", l$1 = i2 ? S_CONNECT_LEFT : S_CORNER_BOTTOM_LEFT;
|
|
1133
|
+
a2.write(
|
|
1134
|
+
`${T}${styleText2("green", S_STEP_SUBMIT)} ${styleText2("reset", e)} ${styleText2(
|
|
1135
|
+
"gray",
|
|
1136
|
+
S_BAR_H.repeat(Math.max(t2 - n3 - 1, 1)) + S_CORNER_TOP_RIGHT
|
|
1137
|
+
)}
|
|
1138
|
+
${h2}
|
|
1139
|
+
${styleText2("gray", l$1 + S_BAR_H.repeat(t2 + 2) + S_CORNER_BOTTOM_RIGHT)}
|
|
1140
|
+
`
|
|
1141
|
+
);
|
|
954
1142
|
};
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
1143
|
+
W = (l2) => styleText2("magenta", l2);
|
|
1144
|
+
spinner = ({
|
|
1145
|
+
indicator: l2 = "dots",
|
|
1146
|
+
onCancel: h2,
|
|
1147
|
+
output: n3 = process.stdout,
|
|
1148
|
+
cancelMessage: G,
|
|
1149
|
+
errorMessage: O,
|
|
1150
|
+
frames: E = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
|
|
1151
|
+
delay: F = unicode ? 80 : 120,
|
|
1152
|
+
signal: m,
|
|
1153
|
+
...I2
|
|
1154
|
+
} = {}) => {
|
|
1155
|
+
const u3 = isCI();
|
|
1156
|
+
let M, T, d = false, S = false, s = "", p, w = performance.now();
|
|
1157
|
+
const x = getColumns(n3), k = I2?.styleFrame ?? W, g = (e) => {
|
|
1158
|
+
const r2 = e > 1 ? O ?? settings.messages.error : G ?? settings.messages.cancel;
|
|
1159
|
+
S = e === 1, d && (a2(r2, e), S && typeof h2 == "function" && h2());
|
|
1160
|
+
}, f = () => g(2), i2 = () => g(1), A = () => {
|
|
1161
|
+
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);
|
|
1162
|
+
}, H = () => {
|
|
1163
|
+
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);
|
|
1164
|
+
}, y2 = () => {
|
|
1165
|
+
if (p === void 0) return;
|
|
1166
|
+
u3 && n3.write(`
|
|
969
1167
|
`);
|
|
970
|
-
const
|
|
1168
|
+
const r2 = wrapAnsi(p, x, {
|
|
1169
|
+
hard: true,
|
|
1170
|
+
trim: false
|
|
1171
|
+
}).split(`
|
|
971
1172
|
`);
|
|
972
|
-
|
|
973
|
-
},
|
|
974
|
-
const
|
|
975
|
-
return
|
|
976
|
-
},
|
|
977
|
-
|
|
1173
|
+
r2.length > 1 && n3.write(import_sisteransi2.cursor.up(r2.length - 1)), n3.write(import_sisteransi2.cursor.to(0)), n3.write(import_sisteransi2.erase.down());
|
|
1174
|
+
}, C2 = (e) => e.replace(/\.+$/, ""), _ = (e) => {
|
|
1175
|
+
const r2 = (performance.now() - e) / 1e3, t2 = Math.floor(r2 / 60), o = Math.floor(r2 % 60);
|
|
1176
|
+
return t2 > 0 ? `[${t2}m ${o}s]` : `[${o}s]`;
|
|
1177
|
+
}, N = I2.withGuide ?? settings.withGuide, P = (e = "") => {
|
|
1178
|
+
d = true, M = block({ output: n3 }), s = C2(e), w = performance.now(), N && n3.write(`${styleText2("gray", S_BAR)}
|
|
978
1179
|
`);
|
|
979
|
-
let
|
|
980
|
-
|
|
981
|
-
if (
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
1180
|
+
let r2 = 0, t2 = 0;
|
|
1181
|
+
A(), T = setInterval(() => {
|
|
1182
|
+
if (u3 && s === p)
|
|
1183
|
+
return;
|
|
1184
|
+
y2(), p = s;
|
|
1185
|
+
const o = k(E[r2]);
|
|
1186
|
+
let v;
|
|
1187
|
+
if (u3)
|
|
1188
|
+
v = `${o} ${s}...`;
|
|
1189
|
+
else if (l2 === "timer")
|
|
1190
|
+
v = `${o} ${s} ${_(w)}`;
|
|
987
1191
|
else {
|
|
988
|
-
const
|
|
989
|
-
|
|
990
|
-
}
|
|
991
|
-
const
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1192
|
+
const B = ".".repeat(Math.floor(t2)).slice(0, 3);
|
|
1193
|
+
v = `${o} ${s}${B}`;
|
|
1194
|
+
}
|
|
1195
|
+
const j = wrapAnsi(v, x, {
|
|
1196
|
+
hard: true,
|
|
1197
|
+
trim: false
|
|
1198
|
+
});
|
|
1199
|
+
n3.write(j), r2 = r2 + 1 < E.length ? r2 + 1 : 0, t2 = t2 < 4 ? t2 + 0.125 : 0;
|
|
1200
|
+
}, F);
|
|
1201
|
+
}, a2 = (e = "", r2 = 0, t2 = false) => {
|
|
1202
|
+
if (!d) return;
|
|
1203
|
+
d = false, clearInterval(T), y2();
|
|
1204
|
+
const o = r2 === 0 ? styleText2("green", S_STEP_SUBMIT) : r2 === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
|
|
1205
|
+
s = e ?? s, t2 || (l2 === "timer" ? n3.write(`${o} ${s} ${_(w)}
|
|
1206
|
+
`) : n3.write(`${o} ${s}
|
|
1207
|
+
`)), H(), M();
|
|
1001
1208
|
};
|
|
1002
|
-
return {
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1209
|
+
return {
|
|
1210
|
+
start: P,
|
|
1211
|
+
stop: (e = "") => a2(e, 0),
|
|
1212
|
+
message: (e = "") => {
|
|
1213
|
+
s = C2(e ?? s);
|
|
1214
|
+
},
|
|
1215
|
+
cancel: (e = "") => a2(e, 1),
|
|
1216
|
+
error: (e = "") => a2(e, 2),
|
|
1217
|
+
clear: () => a2("", 0, true),
|
|
1218
|
+
get isCancelled() {
|
|
1219
|
+
return S;
|
|
1220
|
+
}
|
|
1221
|
+
};
|
|
1222
|
+
};
|
|
1223
|
+
u2 = {
|
|
1224
|
+
light: unicodeOr("\u2500", "-"),
|
|
1225
|
+
heavy: unicodeOr("\u2501", "="),
|
|
1226
|
+
block: unicodeOr("\u2588", "#")
|
|
1227
|
+
};
|
|
1228
|
+
SELECT_INSTRUCTIONS = [
|
|
1229
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
1230
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
1231
|
+
];
|
|
1232
|
+
c = (t2, o) => t2.includes(`
|
|
1233
|
+
`) ? t2.split(`
|
|
1234
|
+
`).map((d) => o(d)).join(`
|
|
1235
|
+
`) : o(t2);
|
|
1236
|
+
select = (t2) => {
|
|
1237
|
+
const o = (n3, m) => {
|
|
1238
|
+
if (n3 === void 0)
|
|
1239
|
+
return "";
|
|
1240
|
+
const s = n3.label ?? String(n3.value);
|
|
1241
|
+
switch (m) {
|
|
1017
1242
|
case "disabled":
|
|
1018
|
-
return `${
|
|
1243
|
+
return `${styleText2("gray", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("gray", i2))}${n3.hint ? ` ${styleText2("dim", `(${n3.hint ?? "disabled"})`)}` : ""}`;
|
|
1019
1244
|
case "selected":
|
|
1020
|
-
return `${
|
|
1245
|
+
return `${c(s, (i2) => styleText2("dim", i2))}`;
|
|
1021
1246
|
case "active":
|
|
1022
|
-
return `${
|
|
1247
|
+
return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${n3.hint ? ` ${styleText2("dim", `(${n3.hint})`)}` : ""}`;
|
|
1023
1248
|
case "cancelled":
|
|
1024
|
-
return `${
|
|
1249
|
+
return `${c(s, (i2) => styleText2(["strikethrough", "dim"], i2))}`;
|
|
1025
1250
|
default:
|
|
1026
|
-
return `${
|
|
1027
|
-
}
|
|
1028
|
-
};
|
|
1029
|
-
return new
|
|
1030
|
-
|
|
1031
|
-
|
|
1251
|
+
return `${styleText2("dim", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("dim", i2))}`;
|
|
1252
|
+
}
|
|
1253
|
+
}, d = t2.showInstructions ?? true;
|
|
1254
|
+
return new n$1({
|
|
1255
|
+
options: t2.options,
|
|
1256
|
+
signal: t2.signal,
|
|
1257
|
+
input: t2.input,
|
|
1258
|
+
output: t2.output,
|
|
1259
|
+
initialValue: t2.initialValue,
|
|
1260
|
+
render() {
|
|
1261
|
+
const n3 = t2.withGuide ?? settings.withGuide, m = `${symbol(this.state)} `, s = `${symbolBar(this.state)} `, i2 = wrapTextWithPrefix(
|
|
1262
|
+
t2.output,
|
|
1263
|
+
t2.message,
|
|
1264
|
+
s,
|
|
1265
|
+
m
|
|
1266
|
+
), u3 = `${n3 ? `${styleText2("gray", S_BAR)}
|
|
1267
|
+
` : ""}${i2}
|
|
1268
|
+
`;
|
|
1269
|
+
switch (this.state) {
|
|
1270
|
+
case "submit": {
|
|
1271
|
+
const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
|
|
1272
|
+
t2.output,
|
|
1273
|
+
o(this.options[this.cursor], "selected"),
|
|
1274
|
+
r2
|
|
1275
|
+
);
|
|
1276
|
+
return `${u3}${a2}`;
|
|
1277
|
+
}
|
|
1278
|
+
case "cancel": {
|
|
1279
|
+
const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
|
|
1280
|
+
t2.output,
|
|
1281
|
+
o(this.options[this.cursor], "cancelled"),
|
|
1282
|
+
r2
|
|
1283
|
+
);
|
|
1284
|
+
return `${u3}${a2}${n3 ? `
|
|
1285
|
+
${styleText2("gray", S_BAR)}` : ""}`;
|
|
1286
|
+
}
|
|
1287
|
+
default: {
|
|
1288
|
+
const r2 = n3 ? `${styleText2("cyan", S_BAR)} ` : "", a2 = u3.split(`
|
|
1289
|
+
`).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], b = p.join(`
|
|
1290
|
+
`), f = p.length + 1;
|
|
1291
|
+
return `${u3}${r2}${limitOptions({
|
|
1292
|
+
output: t2.output,
|
|
1293
|
+
cursor: this.cursor,
|
|
1294
|
+
options: this.options,
|
|
1295
|
+
maxItems: t2.maxItems,
|
|
1296
|
+
columnPadding: r2.length,
|
|
1297
|
+
rowPadding: a2 + f,
|
|
1298
|
+
style: (g, x) => o(g, g.disabled ? "disabled" : x ? "active" : "inactive")
|
|
1299
|
+
}).join(`
|
|
1300
|
+
${r2}`)}
|
|
1301
|
+
${b}
|
|
1032
1302
|
`;
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
}).prompt();
|
|
1307
|
+
};
|
|
1308
|
+
i = `${styleText2("gray", S_BAR)} `;
|
|
1309
|
+
text = (t2) => new n2({
|
|
1310
|
+
validate: t2.validate,
|
|
1311
|
+
placeholder: t2.placeholder,
|
|
1312
|
+
defaultValue: t2.defaultValue,
|
|
1313
|
+
initialValue: t2.initialValue,
|
|
1314
|
+
output: t2.output,
|
|
1315
|
+
signal: t2.signal,
|
|
1316
|
+
input: t2.input,
|
|
1317
|
+
render() {
|
|
1318
|
+
const r2 = t2?.withGuide ?? settings.withGuide, l2 = `${`${r2 ? `${styleText2("gray", S_BAR)}
|
|
1319
|
+
` : ""}${symbol(this.state)} `}${t2.message}
|
|
1320
|
+
`, d = t2.placeholder && t2.placeholder.length > 0 ? (
|
|
1321
|
+
// biome-ignore lint/style/noNonNullAssertion: guarded by placeholder.length > 0
|
|
1322
|
+
styleText2("inverse", t2.placeholder[0]) + styleText2("dim", t2.placeholder.slice(1))
|
|
1323
|
+
) : styleText2(["inverse", "hidden"], "_"), o = this.userInput ? this.userInputWithCursor : d, s = this.value ?? "";
|
|
1033
1324
|
switch (this.state) {
|
|
1325
|
+
case "validating": {
|
|
1326
|
+
const n3 = r2 ? `${styleText2("cyan", S_BAR)} ` : "", i2 = r2 ? styleText2("cyan", S_BAR_END) : "", c2 = styleText2("dim", o), $ = styleText2("dim", "Validating...");
|
|
1327
|
+
return `${l2}${n3}${c2}
|
|
1328
|
+
${i2} ${$}
|
|
1329
|
+
`;
|
|
1330
|
+
}
|
|
1331
|
+
case "error": {
|
|
1332
|
+
const n3 = this.error ? ` ${styleText2("yellow", this.error)}` : "", i2 = r2 ? `${styleText2("yellow", S_BAR)} ` : "", c2 = r2 ? styleText2("yellow", S_BAR_END) : "";
|
|
1333
|
+
return `${l2.trim()}
|
|
1334
|
+
${i2}${o}
|
|
1335
|
+
${c2}${n3}
|
|
1336
|
+
`;
|
|
1337
|
+
}
|
|
1034
1338
|
case "submit": {
|
|
1035
|
-
const
|
|
1036
|
-
return `${
|
|
1339
|
+
const n3 = s ? `${r2 ? " " : ""}${styleText2("dim", s)}` : "", i2 = r2 ? styleText2("gray", S_BAR) : "";
|
|
1340
|
+
return `${l2}${i2}${n3}`;
|
|
1037
1341
|
}
|
|
1038
1342
|
case "cancel": {
|
|
1039
|
-
const
|
|
1040
|
-
return `${
|
|
1041
|
-
${
|
|
1343
|
+
const n3 = s ? ` ${styleText2(["strikethrough", "dim"], s)}` : "", i2 = r2 ? styleText2("gray", S_BAR) : "";
|
|
1344
|
+
return `${l2}${i2}${n3}${s.trim() ? `
|
|
1345
|
+
${i2}` : ""}`;
|
|
1042
1346
|
}
|
|
1043
1347
|
default: {
|
|
1044
|
-
const
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
${c2}`)}
|
|
1048
|
-
${a}
|
|
1348
|
+
const n3 = r2 ? `${styleText2("cyan", S_BAR)} ` : "", i2 = r2 ? styleText2("cyan", S_BAR_END) : "";
|
|
1349
|
+
return `${l2}${n3}${o}
|
|
1350
|
+
${i2}
|
|
1049
1351
|
`;
|
|
1050
1352
|
}
|
|
1051
1353
|
}
|
|
1052
|
-
} }).prompt();
|
|
1053
|
-
};
|
|
1054
|
-
je = `${t("gray", d2)} `;
|
|
1055
|
-
Ot = (e) => new at({ validate: e.validate, placeholder: e.placeholder, defaultValue: e.defaultValue, initialValue: e.initialValue, output: e.output, signal: e.signal, input: e.input, render() {
|
|
1056
|
-
const i = e?.withGuide ?? u.withGuide, s = `${`${i ? `${t("gray", d2)}
|
|
1057
|
-
` : ""}${V2(this.state)} `}${e.message}
|
|
1058
|
-
`, r = e.placeholder ? t("inverse", e.placeholder[0]) + t("dim", e.placeholder.slice(1)) : t(["inverse", "hidden"], "_"), u2 = this.userInput ? this.userInputWithCursor : r, n = this.value ?? "";
|
|
1059
|
-
switch (this.state) {
|
|
1060
|
-
case "error": {
|
|
1061
|
-
const o = this.error ? ` ${t("yellow", this.error)}` : "", c2 = i ? `${t("yellow", d2)} ` : "", a = i ? t("yellow", E2) : "";
|
|
1062
|
-
return `${s.trim()}
|
|
1063
|
-
${c2}${u2}
|
|
1064
|
-
${a}${o}
|
|
1065
|
-
`;
|
|
1066
|
-
}
|
|
1067
|
-
case "submit": {
|
|
1068
|
-
const o = n ? ` ${t("dim", n)}` : "", c2 = i ? t("gray", d2) : "";
|
|
1069
|
-
return `${s}${c2}${o}`;
|
|
1070
|
-
}
|
|
1071
|
-
case "cancel": {
|
|
1072
|
-
const o = n ? ` ${t(["strikethrough", "dim"], n)}` : "", c2 = i ? t("gray", d2) : "";
|
|
1073
|
-
return `${s}${c2}${o}${n.trim() ? `
|
|
1074
|
-
${c2}` : ""}`;
|
|
1075
|
-
}
|
|
1076
|
-
default: {
|
|
1077
|
-
const o = i ? `${t("cyan", d2)} ` : "", c2 = i ? t("cyan", E2) : "";
|
|
1078
|
-
return `${s}${o}${u2}
|
|
1079
|
-
${c2}
|
|
1080
|
-
`;
|
|
1081
|
-
}
|
|
1082
1354
|
}
|
|
1083
|
-
}
|
|
1355
|
+
}).prompt();
|
|
1084
1356
|
}
|
|
1085
1357
|
});
|
|
1086
1358
|
|
|
@@ -1093,9 +1365,9 @@ function supportsColor() {
|
|
|
1093
1365
|
}
|
|
1094
1366
|
return process.stdout.isTTY === true;
|
|
1095
1367
|
}
|
|
1096
|
-
function colorize(
|
|
1097
|
-
if (!supportsColor()) return
|
|
1098
|
-
return `${color}${
|
|
1368
|
+
function colorize(text2, color) {
|
|
1369
|
+
if (!supportsColor()) return text2;
|
|
1370
|
+
return `${color}${text2}${colors.reset}`;
|
|
1099
1371
|
}
|
|
1100
1372
|
function stringify(value) {
|
|
1101
1373
|
if (typeof value === "string") return value;
|
|
@@ -1125,7 +1397,7 @@ function stringify(value) {
|
|
|
1125
1397
|
function formatMessage(...args) {
|
|
1126
1398
|
return args.map(stringify).join(" ");
|
|
1127
1399
|
}
|
|
1128
|
-
var colors, currentLogLevel,
|
|
1400
|
+
var colors, currentLogLevel, log2, error, warn, info, success;
|
|
1129
1401
|
var init_cli_output = __esm({
|
|
1130
1402
|
"packages/tooling/src/utils/cli-output.ts"() {
|
|
1131
1403
|
"use strict";
|
|
@@ -1158,7 +1430,7 @@ var init_cli_output = __esm({
|
|
|
1158
1430
|
currentLogLevel = envLevel;
|
|
1159
1431
|
}
|
|
1160
1432
|
}
|
|
1161
|
-
|
|
1433
|
+
log2 = {
|
|
1162
1434
|
/**
|
|
1163
1435
|
* Logs an error message (always shows unless Quiet level)
|
|
1164
1436
|
* Uses clack's log.error + explicit red color
|
|
@@ -1166,7 +1438,7 @@ var init_cli_output = __esm({
|
|
|
1166
1438
|
error(...args) {
|
|
1167
1439
|
if (currentLogLevel < 0 /* Quiet */) return;
|
|
1168
1440
|
const message = formatMessage(...args);
|
|
1169
|
-
|
|
1441
|
+
log.error(colorize(message, colors.brightRed));
|
|
1170
1442
|
},
|
|
1171
1443
|
/**
|
|
1172
1444
|
* Logs a warning message (shows at Normal level and above)
|
|
@@ -1175,7 +1447,7 @@ var init_cli_output = __esm({
|
|
|
1175
1447
|
warn(...args) {
|
|
1176
1448
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
1177
1449
|
const message = formatMessage(...args);
|
|
1178
|
-
|
|
1450
|
+
log.warn(colorize(message, colors.brightYellow));
|
|
1179
1451
|
},
|
|
1180
1452
|
/**
|
|
1181
1453
|
* Logs an info message (shows at Normal level and above)
|
|
@@ -1184,7 +1456,7 @@ var init_cli_output = __esm({
|
|
|
1184
1456
|
info(...args) {
|
|
1185
1457
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
1186
1458
|
const message = formatMessage(...args);
|
|
1187
|
-
|
|
1459
|
+
log.info(colorize(message, colors.brightCyan));
|
|
1188
1460
|
},
|
|
1189
1461
|
/**
|
|
1190
1462
|
* Logs a success message (shows at Normal level and above)
|
|
@@ -1193,7 +1465,7 @@ var init_cli_output = __esm({
|
|
|
1193
1465
|
success(...args) {
|
|
1194
1466
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
1195
1467
|
const message = formatMessage(...args);
|
|
1196
|
-
|
|
1468
|
+
log.success(colorize(message, colors.brightGreen));
|
|
1197
1469
|
},
|
|
1198
1470
|
/**
|
|
1199
1471
|
* Logs a debug message (only shows at Verbose level and above)
|
|
@@ -1202,7 +1474,7 @@ var init_cli_output = __esm({
|
|
|
1202
1474
|
debug(...args) {
|
|
1203
1475
|
if (currentLogLevel < 2 /* Verbose */) return;
|
|
1204
1476
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
1205
|
-
|
|
1477
|
+
log.message(
|
|
1206
1478
|
colorize(
|
|
1207
1479
|
`[${timeStamp}] \u{1F50D} DEBUG: ${formatMessage(...args)}`,
|
|
1208
1480
|
colors.gray
|
|
@@ -1216,7 +1488,7 @@ var init_cli_output = __esm({
|
|
|
1216
1488
|
trace(...args) {
|
|
1217
1489
|
if (currentLogLevel < 3 /* Debug */) return;
|
|
1218
1490
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
1219
|
-
|
|
1491
|
+
log.message(
|
|
1220
1492
|
colorize(
|
|
1221
1493
|
`[${timeStamp}] \u{1F52C} TRACE: ${formatMessage(...args)}`,
|
|
1222
1494
|
colors.gray
|
|
@@ -1224,10 +1496,10 @@ var init_cli_output = __esm({
|
|
|
1224
1496
|
);
|
|
1225
1497
|
}
|
|
1226
1498
|
};
|
|
1227
|
-
error =
|
|
1228
|
-
warn =
|
|
1229
|
-
info =
|
|
1230
|
-
success =
|
|
1499
|
+
error = log2.error.bind(log2);
|
|
1500
|
+
warn = log2.warn.bind(log2);
|
|
1501
|
+
info = log2.info.bind(log2);
|
|
1502
|
+
success = log2.success.bind(log2);
|
|
1231
1503
|
}
|
|
1232
1504
|
});
|
|
1233
1505
|
|
|
@@ -1594,9 +1866,9 @@ var require_is_glob = __commonJS({
|
|
|
1594
1866
|
index += 2;
|
|
1595
1867
|
var close = chars[open];
|
|
1596
1868
|
if (close) {
|
|
1597
|
-
var
|
|
1598
|
-
if (
|
|
1599
|
-
index =
|
|
1869
|
+
var n3 = str.indexOf(close, index);
|
|
1870
|
+
if (n3 !== -1) {
|
|
1871
|
+
index = n3 + 1;
|
|
1600
1872
|
}
|
|
1601
1873
|
}
|
|
1602
1874
|
if (str[index] === "!") {
|
|
@@ -1622,9 +1894,9 @@ var require_is_glob = __commonJS({
|
|
|
1622
1894
|
index += 2;
|
|
1623
1895
|
var close = chars[open];
|
|
1624
1896
|
if (close) {
|
|
1625
|
-
var
|
|
1626
|
-
if (
|
|
1627
|
-
index =
|
|
1897
|
+
var n3 = str.indexOf(close, index);
|
|
1898
|
+
if (n3 !== -1) {
|
|
1899
|
+
index = n3 + 1;
|
|
1628
1900
|
}
|
|
1629
1901
|
}
|
|
1630
1902
|
if (str[index] === "!") {
|
|
@@ -1702,8 +1974,8 @@ var require_utils = __commonJS({
|
|
|
1702
1974
|
if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
|
|
1703
1975
|
return (Number(max) - Number(min)) / Number(step) >= limit;
|
|
1704
1976
|
};
|
|
1705
|
-
exports.escapeNode = (
|
|
1706
|
-
const node =
|
|
1977
|
+
exports.escapeNode = (block2, n3 = 0, type) => {
|
|
1978
|
+
const node = block2.nodes[n3];
|
|
1707
1979
|
if (!node) return;
|
|
1708
1980
|
if (type && node.type === type || node.type === "open" || node.type === "close") {
|
|
1709
1981
|
if (node.escaped !== true) {
|
|
@@ -1720,15 +1992,15 @@ var require_utils = __commonJS({
|
|
|
1720
1992
|
}
|
|
1721
1993
|
return false;
|
|
1722
1994
|
};
|
|
1723
|
-
exports.isInvalidBrace = (
|
|
1724
|
-
if (
|
|
1725
|
-
if (
|
|
1726
|
-
if (
|
|
1727
|
-
|
|
1995
|
+
exports.isInvalidBrace = (block2) => {
|
|
1996
|
+
if (block2.type !== "brace") return false;
|
|
1997
|
+
if (block2.invalid === true || block2.dollar) return true;
|
|
1998
|
+
if (block2.commas >> 0 + block2.ranges >> 0 === 0) {
|
|
1999
|
+
block2.invalid = true;
|
|
1728
2000
|
return true;
|
|
1729
2001
|
}
|
|
1730
|
-
if (
|
|
1731
|
-
|
|
2002
|
+
if (block2.open !== true || block2.close !== true) {
|
|
2003
|
+
block2.invalid = true;
|
|
1732
2004
|
return true;
|
|
1733
2005
|
}
|
|
1734
2006
|
return false;
|
|
@@ -1747,8 +2019,8 @@ var require_utils = __commonJS({
|
|
|
1747
2019
|
exports.flatten = (...args) => {
|
|
1748
2020
|
const result = [];
|
|
1749
2021
|
const flat = (arr) => {
|
|
1750
|
-
for (let
|
|
1751
|
-
const ele = arr[
|
|
2022
|
+
for (let i2 = 0; i2 < arr.length; i2++) {
|
|
2023
|
+
const ele = arr[i2];
|
|
1752
2024
|
if (Array.isArray(ele)) {
|
|
1753
2025
|
flat(ele);
|
|
1754
2026
|
continue;
|
|
@@ -1842,9 +2114,9 @@ var require_to_regex_range = __commonJS({
|
|
|
1842
2114
|
if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
|
|
1843
2115
|
return toRegexRange.cache[cacheKey].result;
|
|
1844
2116
|
}
|
|
1845
|
-
let
|
|
2117
|
+
let a2 = Math.min(min, max);
|
|
1846
2118
|
let b = Math.max(min, max);
|
|
1847
|
-
if (Math.abs(
|
|
2119
|
+
if (Math.abs(a2 - b) === 1) {
|
|
1848
2120
|
let result = min + "|" + max;
|
|
1849
2121
|
if (opts.capture) {
|
|
1850
2122
|
return `(${result})`;
|
|
@@ -1855,20 +2127,20 @@ var require_to_regex_range = __commonJS({
|
|
|
1855
2127
|
return `(?:${result})`;
|
|
1856
2128
|
}
|
|
1857
2129
|
let isPadded = hasPadding(min) || hasPadding(max);
|
|
1858
|
-
let state = { min, max, a, b };
|
|
2130
|
+
let state = { min, max, a: a2, b };
|
|
1859
2131
|
let positives = [];
|
|
1860
2132
|
let negatives = [];
|
|
1861
2133
|
if (isPadded) {
|
|
1862
2134
|
state.isPadded = isPadded;
|
|
1863
2135
|
state.maxLen = String(state.max).length;
|
|
1864
2136
|
}
|
|
1865
|
-
if (
|
|
2137
|
+
if (a2 < 0) {
|
|
1866
2138
|
let newMin = b < 0 ? Math.abs(b) : 1;
|
|
1867
|
-
negatives = splitToPatterns(newMin, Math.abs(
|
|
1868
|
-
|
|
2139
|
+
negatives = splitToPatterns(newMin, Math.abs(a2), state, opts);
|
|
2140
|
+
a2 = state.a = 0;
|
|
1869
2141
|
}
|
|
1870
2142
|
if (b >= 0) {
|
|
1871
|
-
positives = splitToPatterns(
|
|
2143
|
+
positives = splitToPatterns(a2, b, state, opts);
|
|
1872
2144
|
}
|
|
1873
2145
|
state.negatives = negatives;
|
|
1874
2146
|
state.positives = positives;
|
|
@@ -1916,8 +2188,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1916
2188
|
let digits = zipped.length;
|
|
1917
2189
|
let pattern = "";
|
|
1918
2190
|
let count = 0;
|
|
1919
|
-
for (let
|
|
1920
|
-
let [startDigit, stopDigit] = zipped[
|
|
2191
|
+
for (let i2 = 0; i2 < digits; i2++) {
|
|
2192
|
+
let [startDigit, stopDigit] = zipped[i2];
|
|
1921
2193
|
if (startDigit === stopDigit) {
|
|
1922
2194
|
pattern += startDigit;
|
|
1923
2195
|
} else if (startDigit !== "0" || stopDigit !== "9") {
|
|
@@ -1936,8 +2208,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1936
2208
|
let tokens = [];
|
|
1937
2209
|
let start = min;
|
|
1938
2210
|
let prev;
|
|
1939
|
-
for (let
|
|
1940
|
-
let max2 = ranges[
|
|
2211
|
+
for (let i2 = 0; i2 < ranges.length; i2++) {
|
|
2212
|
+
let max2 = ranges[i2];
|
|
1941
2213
|
let obj = rangeToPattern(String(start), String(max2), options);
|
|
1942
2214
|
let zeros = "";
|
|
1943
2215
|
if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
|
|
@@ -1972,13 +2244,13 @@ var require_to_regex_range = __commonJS({
|
|
|
1972
2244
|
}
|
|
1973
2245
|
return result;
|
|
1974
2246
|
}
|
|
1975
|
-
function zip(
|
|
2247
|
+
function zip(a2, b) {
|
|
1976
2248
|
let arr = [];
|
|
1977
|
-
for (let
|
|
2249
|
+
for (let i2 = 0; i2 < a2.length; i2++) arr.push([a2[i2], b[i2]]);
|
|
1978
2250
|
return arr;
|
|
1979
2251
|
}
|
|
1980
|
-
function compare(
|
|
1981
|
-
return
|
|
2252
|
+
function compare(a2, b) {
|
|
2253
|
+
return a2 > b ? 1 : b > a2 ? -1 : 0;
|
|
1982
2254
|
}
|
|
1983
2255
|
function contains(arr, key, val) {
|
|
1984
2256
|
return arr.some((ele) => ele[key] === val);
|
|
@@ -1996,8 +2268,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1996
2268
|
}
|
|
1997
2269
|
return "";
|
|
1998
2270
|
}
|
|
1999
|
-
function toCharacterClass(
|
|
2000
|
-
return `[${
|
|
2271
|
+
function toCharacterClass(a2, b, options) {
|
|
2272
|
+
return `[${a2}${b - a2 === 1 ? "" : "-"}${b}]`;
|
|
2001
2273
|
}
|
|
2002
2274
|
function hasPadding(str) {
|
|
2003
2275
|
return /^-?(0+)\d/.test(str);
|
|
@@ -2076,8 +2348,8 @@ var require_fill_range = __commonJS({
|
|
|
2076
2348
|
return negative ? "-" + input : input;
|
|
2077
2349
|
};
|
|
2078
2350
|
var toSequence = (parts, options, maxLen) => {
|
|
2079
|
-
parts.negatives.sort((
|
|
2080
|
-
parts.positives.sort((
|
|
2351
|
+
parts.negatives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
2352
|
+
parts.positives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
2081
2353
|
let prefix = options.capture ? "" : "?:";
|
|
2082
2354
|
let positives = "";
|
|
2083
2355
|
let negatives = "";
|
|
@@ -2098,12 +2370,12 @@ var require_fill_range = __commonJS({
|
|
|
2098
2370
|
}
|
|
2099
2371
|
return result;
|
|
2100
2372
|
};
|
|
2101
|
-
var toRange = (
|
|
2373
|
+
var toRange = (a2, b, isNumbers, options) => {
|
|
2102
2374
|
if (isNumbers) {
|
|
2103
|
-
return toRegexRange(
|
|
2375
|
+
return toRegexRange(a2, b, { wrap: false, ...options });
|
|
2104
2376
|
}
|
|
2105
|
-
let start = String.fromCharCode(
|
|
2106
|
-
if (
|
|
2377
|
+
let start = String.fromCharCode(a2);
|
|
2378
|
+
if (a2 === b) return start;
|
|
2107
2379
|
let stop = String.fromCharCode(b);
|
|
2108
2380
|
return `[${start}-${stop}]`;
|
|
2109
2381
|
};
|
|
@@ -2129,15 +2401,15 @@ var require_fill_range = __commonJS({
|
|
|
2129
2401
|
return [];
|
|
2130
2402
|
};
|
|
2131
2403
|
var fillNumbers = (start, end, step = 1, options = {}) => {
|
|
2132
|
-
let
|
|
2404
|
+
let a2 = Number(start);
|
|
2133
2405
|
let b = Number(end);
|
|
2134
|
-
if (!Number.isInteger(
|
|
2406
|
+
if (!Number.isInteger(a2) || !Number.isInteger(b)) {
|
|
2135
2407
|
if (options.strictRanges === true) throw rangeError([start, end]);
|
|
2136
2408
|
return [];
|
|
2137
2409
|
}
|
|
2138
|
-
if (
|
|
2410
|
+
if (a2 === 0) a2 = 0;
|
|
2139
2411
|
if (b === 0) b = 0;
|
|
2140
|
-
let descending =
|
|
2412
|
+
let descending = a2 > b;
|
|
2141
2413
|
let startString = String(start);
|
|
2142
2414
|
let endString = String(end);
|
|
2143
2415
|
let stepString = String(step);
|
|
@@ -2153,13 +2425,13 @@ var require_fill_range = __commonJS({
|
|
|
2153
2425
|
let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
|
|
2154
2426
|
let range = [];
|
|
2155
2427
|
let index = 0;
|
|
2156
|
-
while (descending ?
|
|
2428
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
2157
2429
|
if (options.toRegex === true && step > 1) {
|
|
2158
|
-
push(
|
|
2430
|
+
push(a2);
|
|
2159
2431
|
} else {
|
|
2160
|
-
range.push(pad(format(
|
|
2432
|
+
range.push(pad(format(a2, index), maxLen, toNumber));
|
|
2161
2433
|
}
|
|
2162
|
-
|
|
2434
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
2163
2435
|
index++;
|
|
2164
2436
|
}
|
|
2165
2437
|
if (options.toRegex === true) {
|
|
@@ -2172,19 +2444,19 @@ var require_fill_range = __commonJS({
|
|
|
2172
2444
|
return invalidRange(start, end, options);
|
|
2173
2445
|
}
|
|
2174
2446
|
let format = options.transform || ((val) => String.fromCharCode(val));
|
|
2175
|
-
let
|
|
2447
|
+
let a2 = `${start}`.charCodeAt(0);
|
|
2176
2448
|
let b = `${end}`.charCodeAt(0);
|
|
2177
|
-
let descending =
|
|
2178
|
-
let min = Math.min(
|
|
2179
|
-
let max = Math.max(
|
|
2449
|
+
let descending = a2 > b;
|
|
2450
|
+
let min = Math.min(a2, b);
|
|
2451
|
+
let max = Math.max(a2, b);
|
|
2180
2452
|
if (options.toRegex && step === 1) {
|
|
2181
2453
|
return toRange(min, max, false, options);
|
|
2182
2454
|
}
|
|
2183
2455
|
let range = [];
|
|
2184
2456
|
let index = 0;
|
|
2185
|
-
while (descending ?
|
|
2186
|
-
range.push(format(
|
|
2187
|
-
|
|
2457
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
2458
|
+
range.push(format(a2, index));
|
|
2459
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
2188
2460
|
index++;
|
|
2189
2461
|
}
|
|
2190
2462
|
if (options.toRegex === true) {
|
|
@@ -2307,18 +2579,18 @@ var require_expand = __commonJS({
|
|
|
2307
2579
|
const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
|
|
2308
2580
|
const walk = (node, parent = {}) => {
|
|
2309
2581
|
node.queue = [];
|
|
2310
|
-
let
|
|
2311
|
-
let
|
|
2312
|
-
while (
|
|
2313
|
-
|
|
2314
|
-
|
|
2582
|
+
let p = parent;
|
|
2583
|
+
let q = parent.queue;
|
|
2584
|
+
while (p.type !== "brace" && p.type !== "root" && p.parent) {
|
|
2585
|
+
p = p.parent;
|
|
2586
|
+
q = p.queue;
|
|
2315
2587
|
}
|
|
2316
2588
|
if (node.invalid || node.dollar) {
|
|
2317
|
-
|
|
2589
|
+
q.push(append(q.pop(), stringify2(node, options)));
|
|
2318
2590
|
return;
|
|
2319
2591
|
}
|
|
2320
2592
|
if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
|
|
2321
|
-
|
|
2593
|
+
q.push(append(q.pop(), ["{}"]));
|
|
2322
2594
|
return;
|
|
2323
2595
|
}
|
|
2324
2596
|
if (node.nodes && node.ranges > 0) {
|
|
@@ -2330,26 +2602,26 @@ var require_expand = __commonJS({
|
|
|
2330
2602
|
if (range.length === 0) {
|
|
2331
2603
|
range = stringify2(node, options);
|
|
2332
2604
|
}
|
|
2333
|
-
|
|
2605
|
+
q.push(append(q.pop(), range));
|
|
2334
2606
|
node.nodes = [];
|
|
2335
2607
|
return;
|
|
2336
2608
|
}
|
|
2337
2609
|
const enclose = utils.encloseBrace(node);
|
|
2338
2610
|
let queue = node.queue;
|
|
2339
|
-
let
|
|
2340
|
-
while (
|
|
2341
|
-
|
|
2342
|
-
queue =
|
|
2611
|
+
let block2 = node;
|
|
2612
|
+
while (block2.type !== "brace" && block2.type !== "root" && block2.parent) {
|
|
2613
|
+
block2 = block2.parent;
|
|
2614
|
+
queue = block2.queue;
|
|
2343
2615
|
}
|
|
2344
|
-
for (let
|
|
2345
|
-
const child = node.nodes[
|
|
2616
|
+
for (let i2 = 0; i2 < node.nodes.length; i2++) {
|
|
2617
|
+
const child = node.nodes[i2];
|
|
2346
2618
|
if (child.type === "comma" && node.type === "brace") {
|
|
2347
|
-
if (
|
|
2619
|
+
if (i2 === 1) queue.push("");
|
|
2348
2620
|
queue.push("");
|
|
2349
2621
|
continue;
|
|
2350
2622
|
}
|
|
2351
2623
|
if (child.type === "close") {
|
|
2352
|
-
|
|
2624
|
+
q.push(append(q.pop(), queue, enclose));
|
|
2353
2625
|
continue;
|
|
2354
2626
|
}
|
|
2355
2627
|
if (child.value && child.type !== "open") {
|
|
@@ -2516,7 +2788,7 @@ var require_parse = __commonJS({
|
|
|
2516
2788
|
}
|
|
2517
2789
|
const ast = { type: "root", input, nodes: [] };
|
|
2518
2790
|
const stack = [ast];
|
|
2519
|
-
let
|
|
2791
|
+
let block2 = ast;
|
|
2520
2792
|
let prev = ast;
|
|
2521
2793
|
let brackets = 0;
|
|
2522
2794
|
const length = input.length;
|
|
@@ -2532,15 +2804,15 @@ var require_parse = __commonJS({
|
|
|
2532
2804
|
prev.value += node.value;
|
|
2533
2805
|
return;
|
|
2534
2806
|
}
|
|
2535
|
-
|
|
2536
|
-
node.parent =
|
|
2807
|
+
block2.nodes.push(node);
|
|
2808
|
+
node.parent = block2;
|
|
2537
2809
|
node.prev = prev;
|
|
2538
2810
|
prev = node;
|
|
2539
2811
|
return node;
|
|
2540
2812
|
};
|
|
2541
2813
|
push({ type: "bos" });
|
|
2542
2814
|
while (index < length) {
|
|
2543
|
-
|
|
2815
|
+
block2 = stack[stack.length - 1];
|
|
2544
2816
|
value = advance();
|
|
2545
2817
|
if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
|
|
2546
2818
|
continue;
|
|
@@ -2577,19 +2849,19 @@ var require_parse = __commonJS({
|
|
|
2577
2849
|
continue;
|
|
2578
2850
|
}
|
|
2579
2851
|
if (value === CHAR_LEFT_PARENTHESES) {
|
|
2580
|
-
|
|
2581
|
-
stack.push(
|
|
2852
|
+
block2 = push({ type: "paren", nodes: [] });
|
|
2853
|
+
stack.push(block2);
|
|
2582
2854
|
push({ type: "text", value });
|
|
2583
2855
|
continue;
|
|
2584
2856
|
}
|
|
2585
2857
|
if (value === CHAR_RIGHT_PARENTHESES) {
|
|
2586
|
-
if (
|
|
2858
|
+
if (block2.type !== "paren") {
|
|
2587
2859
|
push({ type: "text", value });
|
|
2588
2860
|
continue;
|
|
2589
2861
|
}
|
|
2590
|
-
|
|
2862
|
+
block2 = stack.pop();
|
|
2591
2863
|
push({ type: "text", value });
|
|
2592
|
-
|
|
2864
|
+
block2 = stack[stack.length - 1];
|
|
2593
2865
|
continue;
|
|
2594
2866
|
}
|
|
2595
2867
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
@@ -2614,7 +2886,7 @@ var require_parse = __commonJS({
|
|
|
2614
2886
|
}
|
|
2615
2887
|
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
2616
2888
|
depth++;
|
|
2617
|
-
const dollar = prev.value && prev.value.slice(-1) === "$" ||
|
|
2889
|
+
const dollar = prev.value && prev.value.slice(-1) === "$" || block2.dollar === true;
|
|
2618
2890
|
const brace = {
|
|
2619
2891
|
type: "brace",
|
|
2620
2892
|
open: true,
|
|
@@ -2625,52 +2897,52 @@ var require_parse = __commonJS({
|
|
|
2625
2897
|
ranges: 0,
|
|
2626
2898
|
nodes: []
|
|
2627
2899
|
};
|
|
2628
|
-
|
|
2629
|
-
stack.push(
|
|
2900
|
+
block2 = push(brace);
|
|
2901
|
+
stack.push(block2);
|
|
2630
2902
|
push({ type: "open", value });
|
|
2631
2903
|
continue;
|
|
2632
2904
|
}
|
|
2633
2905
|
if (value === CHAR_RIGHT_CURLY_BRACE) {
|
|
2634
|
-
if (
|
|
2906
|
+
if (block2.type !== "brace") {
|
|
2635
2907
|
push({ type: "text", value });
|
|
2636
2908
|
continue;
|
|
2637
2909
|
}
|
|
2638
2910
|
const type = "close";
|
|
2639
|
-
|
|
2640
|
-
|
|
2911
|
+
block2 = stack.pop();
|
|
2912
|
+
block2.close = true;
|
|
2641
2913
|
push({ type, value });
|
|
2642
2914
|
depth--;
|
|
2643
|
-
|
|
2915
|
+
block2 = stack[stack.length - 1];
|
|
2644
2916
|
continue;
|
|
2645
2917
|
}
|
|
2646
2918
|
if (value === CHAR_COMMA && depth > 0) {
|
|
2647
|
-
if (
|
|
2648
|
-
|
|
2649
|
-
const open =
|
|
2650
|
-
|
|
2919
|
+
if (block2.ranges > 0) {
|
|
2920
|
+
block2.ranges = 0;
|
|
2921
|
+
const open = block2.nodes.shift();
|
|
2922
|
+
block2.nodes = [open, { type: "text", value: stringify2(block2) }];
|
|
2651
2923
|
}
|
|
2652
2924
|
push({ type: "comma", value });
|
|
2653
|
-
|
|
2925
|
+
block2.commas++;
|
|
2654
2926
|
continue;
|
|
2655
2927
|
}
|
|
2656
|
-
if (value === CHAR_DOT && depth > 0 &&
|
|
2657
|
-
const siblings =
|
|
2928
|
+
if (value === CHAR_DOT && depth > 0 && block2.commas === 0) {
|
|
2929
|
+
const siblings = block2.nodes;
|
|
2658
2930
|
if (depth === 0 || siblings.length === 0) {
|
|
2659
2931
|
push({ type: "text", value });
|
|
2660
2932
|
continue;
|
|
2661
2933
|
}
|
|
2662
2934
|
if (prev.type === "dot") {
|
|
2663
|
-
|
|
2935
|
+
block2.range = [];
|
|
2664
2936
|
prev.value += value;
|
|
2665
2937
|
prev.type = "range";
|
|
2666
|
-
if (
|
|
2667
|
-
|
|
2668
|
-
|
|
2938
|
+
if (block2.nodes.length !== 3 && block2.nodes.length !== 5) {
|
|
2939
|
+
block2.invalid = true;
|
|
2940
|
+
block2.ranges = 0;
|
|
2669
2941
|
prev.type = "text";
|
|
2670
2942
|
continue;
|
|
2671
2943
|
}
|
|
2672
|
-
|
|
2673
|
-
|
|
2944
|
+
block2.ranges++;
|
|
2945
|
+
block2.args = [];
|
|
2674
2946
|
continue;
|
|
2675
2947
|
}
|
|
2676
2948
|
if (prev.type === "range") {
|
|
@@ -2678,7 +2950,7 @@ var require_parse = __commonJS({
|
|
|
2678
2950
|
const before = siblings[siblings.length - 1];
|
|
2679
2951
|
before.value += prev.value + value;
|
|
2680
2952
|
prev = before;
|
|
2681
|
-
|
|
2953
|
+
block2.ranges--;
|
|
2682
2954
|
continue;
|
|
2683
2955
|
}
|
|
2684
2956
|
push({ type: "dot", value });
|
|
@@ -2687,9 +2959,9 @@ var require_parse = __commonJS({
|
|
|
2687
2959
|
push({ type: "text", value });
|
|
2688
2960
|
}
|
|
2689
2961
|
do {
|
|
2690
|
-
|
|
2691
|
-
if (
|
|
2692
|
-
|
|
2962
|
+
block2 = stack.pop();
|
|
2963
|
+
if (block2.type !== "root") {
|
|
2964
|
+
block2.nodes.forEach((node) => {
|
|
2693
2965
|
if (!node.nodes) {
|
|
2694
2966
|
if (node.type === "open") node.isOpen = true;
|
|
2695
2967
|
if (node.type === "close") node.isClose = true;
|
|
@@ -2698,8 +2970,8 @@ var require_parse = __commonJS({
|
|
|
2698
2970
|
}
|
|
2699
2971
|
});
|
|
2700
2972
|
const parent = stack[stack.length - 1];
|
|
2701
|
-
const index2 = parent.nodes.indexOf(
|
|
2702
|
-
parent.nodes.splice(index2, 1, ...
|
|
2973
|
+
const index2 = parent.nodes.indexOf(block2);
|
|
2974
|
+
parent.nodes.splice(index2, 1, ...block2.nodes);
|
|
2703
2975
|
}
|
|
2704
2976
|
} while (stack.length > 0);
|
|
2705
2977
|
push({ type: "eos" });
|
|
@@ -3332,9 +3604,9 @@ var require_scan = __commonJS({
|
|
|
3332
3604
|
if (opts.parts === true || opts.tokens === true) {
|
|
3333
3605
|
let prevIndex;
|
|
3334
3606
|
for (let idx = 0; idx < slashes.length; idx++) {
|
|
3335
|
-
const
|
|
3336
|
-
const
|
|
3337
|
-
const value = input.slice(
|
|
3607
|
+
const n3 = prevIndex ? prevIndex + 1 : start;
|
|
3608
|
+
const i2 = slashes[idx];
|
|
3609
|
+
const value = input.slice(n3, i2);
|
|
3338
3610
|
if (opts.tokens) {
|
|
3339
3611
|
if (idx === 0 && start !== 0) {
|
|
3340
3612
|
tokens[idx].isPrefix = true;
|
|
@@ -3348,7 +3620,7 @@ var require_scan = __commonJS({
|
|
|
3348
3620
|
if (idx !== 0 || value !== "") {
|
|
3349
3621
|
parts.push(value);
|
|
3350
3622
|
}
|
|
3351
|
-
prevIndex =
|
|
3623
|
+
prevIndex = i2;
|
|
3352
3624
|
}
|
|
3353
3625
|
if (prevIndex && prevIndex + 1 < input.length) {
|
|
3354
3626
|
const value = input.slice(prevIndex + 1);
|
|
@@ -3477,15 +3749,15 @@ var require_parse2 = __commonJS({
|
|
|
3477
3749
|
};
|
|
3478
3750
|
var hasRepeatedCharPrefixOverlap = (branches) => {
|
|
3479
3751
|
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
3480
|
-
for (let
|
|
3481
|
-
for (let
|
|
3482
|
-
const
|
|
3483
|
-
const b = values[
|
|
3484
|
-
const char =
|
|
3485
|
-
if (!char ||
|
|
3752
|
+
for (let i2 = 0; i2 < values.length; i2++) {
|
|
3753
|
+
for (let j = i2 + 1; j < values.length; j++) {
|
|
3754
|
+
const a2 = values[i2];
|
|
3755
|
+
const b = values[j];
|
|
3756
|
+
const char = a2[0];
|
|
3757
|
+
if (!char || a2 !== char.repeat(a2.length) || b !== char.repeat(b.length)) {
|
|
3486
3758
|
continue;
|
|
3487
3759
|
}
|
|
3488
|
-
if (
|
|
3760
|
+
if (a2 === b || a2.startsWith(b) || b.startsWith(a2)) {
|
|
3489
3761
|
return true;
|
|
3490
3762
|
}
|
|
3491
3763
|
}
|
|
@@ -3500,8 +3772,8 @@ var require_parse2 = __commonJS({
|
|
|
3500
3772
|
let paren = 0;
|
|
3501
3773
|
let quote = 0;
|
|
3502
3774
|
let escaped = false;
|
|
3503
|
-
for (let
|
|
3504
|
-
const ch = pattern[
|
|
3775
|
+
for (let i2 = 1; i2 < pattern.length; i2++) {
|
|
3776
|
+
const ch = pattern[i2];
|
|
3505
3777
|
if (escaped === true) {
|
|
3506
3778
|
escaped = false;
|
|
3507
3779
|
continue;
|
|
@@ -3535,13 +3807,13 @@ var require_parse2 = __commonJS({
|
|
|
3535
3807
|
if (ch === ")") {
|
|
3536
3808
|
paren--;
|
|
3537
3809
|
if (paren === 0) {
|
|
3538
|
-
if (requireEnd === true &&
|
|
3810
|
+
if (requireEnd === true && i2 !== pattern.length - 1) {
|
|
3539
3811
|
return;
|
|
3540
3812
|
}
|
|
3541
3813
|
return {
|
|
3542
3814
|
type: pattern[0],
|
|
3543
|
-
body: pattern.slice(2,
|
|
3544
|
-
end:
|
|
3815
|
+
body: pattern.slice(2, i2),
|
|
3816
|
+
end: i2
|
|
3545
3817
|
};
|
|
3546
3818
|
}
|
|
3547
3819
|
}
|
|
@@ -3673,7 +3945,7 @@ var require_parse2 = __commonJS({
|
|
|
3673
3945
|
let prev = bos;
|
|
3674
3946
|
let value;
|
|
3675
3947
|
const eos = () => state.index === len - 1;
|
|
3676
|
-
const peek = state.peek = (
|
|
3948
|
+
const peek = state.peek = (n3 = 1) => input[state.index + n3];
|
|
3677
3949
|
const advance = state.advance = () => input[++state.index] || "";
|
|
3678
3950
|
const remaining = () => input.slice(state.index + 1);
|
|
3679
3951
|
const consume = (value2 = "", num = 0) => {
|
|
@@ -3754,10 +4026,10 @@ var require_parse2 = __commonJS({
|
|
|
3754
4026
|
open.type = "text";
|
|
3755
4027
|
open.value = literal;
|
|
3756
4028
|
open.output = safeOutput || utils.escapeRegex(literal);
|
|
3757
|
-
for (let
|
|
3758
|
-
tokens[
|
|
3759
|
-
tokens[
|
|
3760
|
-
delete tokens[
|
|
4029
|
+
for (let i2 = token.tokensIndex + 1; i2 < tokens.length; i2++) {
|
|
4030
|
+
tokens[i2].value = "";
|
|
4031
|
+
tokens[i2].output = "";
|
|
4032
|
+
delete tokens[i2].suffix;
|
|
3761
4033
|
}
|
|
3762
4034
|
state.output = token.output + open.output;
|
|
3763
4035
|
state.backtrack = true;
|
|
@@ -4000,13 +4272,13 @@ var require_parse2 = __commonJS({
|
|
|
4000
4272
|
if (brace.dots === true) {
|
|
4001
4273
|
const arr = tokens.slice();
|
|
4002
4274
|
const range = [];
|
|
4003
|
-
for (let
|
|
4275
|
+
for (let i2 = arr.length - 1; i2 >= 0; i2--) {
|
|
4004
4276
|
tokens.pop();
|
|
4005
|
-
if (arr[
|
|
4277
|
+
if (arr[i2].type === "brace") {
|
|
4006
4278
|
break;
|
|
4007
4279
|
}
|
|
4008
|
-
if (arr[
|
|
4009
|
-
range.unshift(arr[
|
|
4280
|
+
if (arr[i2].type !== "dots") {
|
|
4281
|
+
range.unshift(arr[i2].value);
|
|
4010
4282
|
}
|
|
4011
4283
|
}
|
|
4012
4284
|
output = expandRange(range, opts);
|
|
@@ -4465,7 +4737,7 @@ var require_picomatch = __commonJS({
|
|
|
4465
4737
|
};
|
|
4466
4738
|
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
4467
4739
|
picomatch.parse = (pattern, options) => {
|
|
4468
|
-
if (Array.isArray(pattern)) return pattern.map((
|
|
4740
|
+
if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
|
|
4469
4741
|
return parse2(pattern, { ...options, fastpaths: false });
|
|
4470
4742
|
};
|
|
4471
4743
|
picomatch.scan = (input, options) => scan(input, options);
|
|
@@ -4549,8 +4821,8 @@ var require_micromatch = __commonJS({
|
|
|
4549
4821
|
options.onResult(state);
|
|
4550
4822
|
}
|
|
4551
4823
|
};
|
|
4552
|
-
for (let
|
|
4553
|
-
let isMatch = picomatch(String(patterns[
|
|
4824
|
+
for (let i2 = 0; i2 < patterns.length; i2++) {
|
|
4825
|
+
let isMatch = picomatch(String(patterns[i2]), { ...options, onResult }, true);
|
|
4554
4826
|
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
|
|
4555
4827
|
if (negated) negatives++;
|
|
4556
4828
|
for (let item of list) {
|
|
@@ -4572,7 +4844,7 @@ var require_micromatch = __commonJS({
|
|
|
4572
4844
|
throw new Error(`No matches found for "${patterns.join(", ")}"`);
|
|
4573
4845
|
}
|
|
4574
4846
|
if (options.nonull === true || options.nullglob === true) {
|
|
4575
|
-
return options.unescape ? patterns.map((
|
|
4847
|
+
return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
|
|
4576
4848
|
}
|
|
4577
4849
|
}
|
|
4578
4850
|
return matches;
|
|
@@ -4602,7 +4874,7 @@ var require_micromatch = __commonJS({
|
|
|
4602
4874
|
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
4603
4875
|
}
|
|
4604
4876
|
if (Array.isArray(pattern)) {
|
|
4605
|
-
return pattern.some((
|
|
4877
|
+
return pattern.some((p) => micromatch.contains(str, p, options));
|
|
4606
4878
|
}
|
|
4607
4879
|
if (typeof pattern === "string") {
|
|
4608
4880
|
if (isEmptyString(str) || isEmptyString(pattern)) {
|
|
@@ -4647,7 +4919,7 @@ var require_micromatch = __commonJS({
|
|
|
4647
4919
|
if (typeof str !== "string") {
|
|
4648
4920
|
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
4649
4921
|
}
|
|
4650
|
-
return [].concat(patterns).every((
|
|
4922
|
+
return [].concat(patterns).every((p) => picomatch(p, options)(str));
|
|
4651
4923
|
};
|
|
4652
4924
|
micromatch.capture = (glob2, input, options) => {
|
|
4653
4925
|
let posix = utils.isWindows(options);
|
|
@@ -4798,7 +5070,7 @@ var require_pattern = __commonJS({
|
|
|
4798
5070
|
exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
|
4799
5071
|
function expandBraceExpansion(pattern) {
|
|
4800
5072
|
const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });
|
|
4801
|
-
patterns.sort((
|
|
5073
|
+
patterns.sort((a2, b) => a2.length - b.length);
|
|
4802
5074
|
return patterns.filter((pattern2) => pattern2 !== "");
|
|
4803
5075
|
}
|
|
4804
5076
|
exports.expandBraceExpansion = expandBraceExpansion;
|
|
@@ -4879,8 +5151,8 @@ var require_merge2 = __commonJS({
|
|
|
4879
5151
|
}
|
|
4880
5152
|
const mergedStream = PassThrough(options);
|
|
4881
5153
|
function addStream() {
|
|
4882
|
-
for (let
|
|
4883
|
-
streamsQueue.push(pauseStreams(arguments[
|
|
5154
|
+
for (let i2 = 0, len = arguments.length; i2 < len; i2++) {
|
|
5155
|
+
streamsQueue.push(pauseStreams(arguments[i2], options));
|
|
4884
5156
|
}
|
|
4885
5157
|
mergeStream();
|
|
4886
5158
|
return this;
|
|
@@ -4929,8 +5201,8 @@ var require_merge2 = __commonJS({
|
|
|
4929
5201
|
stream.pipe(mergedStream, { end: false });
|
|
4930
5202
|
stream.resume();
|
|
4931
5203
|
}
|
|
4932
|
-
for (let
|
|
4933
|
-
pipe(streams[
|
|
5204
|
+
for (let i2 = 0; i2 < streams.length; i2++) {
|
|
5205
|
+
pipe(streams[i2]);
|
|
4934
5206
|
}
|
|
4935
5207
|
next();
|
|
4936
5208
|
}
|
|
@@ -4961,8 +5233,8 @@ var require_merge2 = __commonJS({
|
|
|
4961
5233
|
}
|
|
4962
5234
|
streams.pause();
|
|
4963
5235
|
} else {
|
|
4964
|
-
for (let
|
|
4965
|
-
streams[
|
|
5236
|
+
for (let i2 = 0, len = streams.length; i2 < len; i2++) {
|
|
5237
|
+
streams[i2] = pauseStreams(streams[i2], options);
|
|
4966
5238
|
}
|
|
4967
5239
|
}
|
|
4968
5240
|
return streams;
|
|
@@ -5044,13 +5316,13 @@ var require_tasks = __commonJS({
|
|
|
5044
5316
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5045
5317
|
exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
|
|
5046
5318
|
var utils = require_utils3();
|
|
5047
|
-
function generate(input,
|
|
5048
|
-
const patterns = processPatterns(input,
|
|
5049
|
-
const ignore = processPatterns(
|
|
5319
|
+
function generate(input, settings2) {
|
|
5320
|
+
const patterns = processPatterns(input, settings2);
|
|
5321
|
+
const ignore = processPatterns(settings2.ignore, settings2);
|
|
5050
5322
|
const positivePatterns = getPositivePatterns(patterns);
|
|
5051
5323
|
const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
|
|
5052
|
-
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern,
|
|
5053
|
-
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern,
|
|
5324
|
+
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings2));
|
|
5325
|
+
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings2));
|
|
5054
5326
|
const staticTasks = convertPatternsToTasks(
|
|
5055
5327
|
staticPatterns,
|
|
5056
5328
|
negativePatterns,
|
|
@@ -5066,12 +5338,12 @@ var require_tasks = __commonJS({
|
|
|
5066
5338
|
return staticTasks.concat(dynamicTasks);
|
|
5067
5339
|
}
|
|
5068
5340
|
exports.generate = generate;
|
|
5069
|
-
function processPatterns(input,
|
|
5341
|
+
function processPatterns(input, settings2) {
|
|
5070
5342
|
let patterns = input;
|
|
5071
|
-
if (
|
|
5343
|
+
if (settings2.braceExpansion) {
|
|
5072
5344
|
patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);
|
|
5073
5345
|
}
|
|
5074
|
-
if (
|
|
5346
|
+
if (settings2.baseNameMatch) {
|
|
5075
5347
|
patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`);
|
|
5076
5348
|
}
|
|
5077
5349
|
return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));
|
|
@@ -5102,7 +5374,7 @@ var require_tasks = __commonJS({
|
|
|
5102
5374
|
}
|
|
5103
5375
|
exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
|
|
5104
5376
|
function groupPatternsByBaseDirectory(patterns) {
|
|
5105
|
-
const
|
|
5377
|
+
const group2 = {};
|
|
5106
5378
|
return patterns.reduce((collection, pattern) => {
|
|
5107
5379
|
const base = utils.pattern.getBaseDirectory(pattern);
|
|
5108
5380
|
if (base in collection) {
|
|
@@ -5111,7 +5383,7 @@ var require_tasks = __commonJS({
|
|
|
5111
5383
|
collection[base] = [pattern];
|
|
5112
5384
|
}
|
|
5113
5385
|
return collection;
|
|
5114
|
-
},
|
|
5386
|
+
}, group2);
|
|
5115
5387
|
}
|
|
5116
5388
|
exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
|
|
5117
5389
|
function convertPatternGroupsToTasks(positive, negative, dynamic) {
|
|
@@ -5140,26 +5412,26 @@ var require_async = __commonJS({
|
|
|
5140
5412
|
init_utils2();
|
|
5141
5413
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5142
5414
|
exports.read = void 0;
|
|
5143
|
-
function read2(path,
|
|
5144
|
-
|
|
5415
|
+
function read2(path, settings2, callback) {
|
|
5416
|
+
settings2.fs.lstat(path, (lstatError, lstat) => {
|
|
5145
5417
|
if (lstatError !== null) {
|
|
5146
5418
|
callFailureCallback(callback, lstatError);
|
|
5147
5419
|
return;
|
|
5148
5420
|
}
|
|
5149
|
-
if (!lstat.isSymbolicLink() || !
|
|
5421
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
5150
5422
|
callSuccessCallback(callback, lstat);
|
|
5151
5423
|
return;
|
|
5152
5424
|
}
|
|
5153
|
-
|
|
5425
|
+
settings2.fs.stat(path, (statError, stat) => {
|
|
5154
5426
|
if (statError !== null) {
|
|
5155
|
-
if (
|
|
5427
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5156
5428
|
callFailureCallback(callback, statError);
|
|
5157
5429
|
return;
|
|
5158
5430
|
}
|
|
5159
5431
|
callSuccessCallback(callback, lstat);
|
|
5160
5432
|
return;
|
|
5161
5433
|
}
|
|
5162
|
-
if (
|
|
5434
|
+
if (settings2.markSymbolicLink) {
|
|
5163
5435
|
stat.isSymbolicLink = () => true;
|
|
5164
5436
|
}
|
|
5165
5437
|
callSuccessCallback(callback, stat);
|
|
@@ -5183,19 +5455,19 @@ var require_sync = __commonJS({
|
|
|
5183
5455
|
init_utils2();
|
|
5184
5456
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5185
5457
|
exports.read = void 0;
|
|
5186
|
-
function read2(path,
|
|
5187
|
-
const lstat =
|
|
5188
|
-
if (!lstat.isSymbolicLink() || !
|
|
5458
|
+
function read2(path, settings2) {
|
|
5459
|
+
const lstat = settings2.fs.lstatSync(path);
|
|
5460
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
5189
5461
|
return lstat;
|
|
5190
5462
|
}
|
|
5191
5463
|
try {
|
|
5192
|
-
const stat =
|
|
5193
|
-
if (
|
|
5464
|
+
const stat = settings2.fs.statSync(path);
|
|
5465
|
+
if (settings2.markSymbolicLink) {
|
|
5194
5466
|
stat.isSymbolicLink = () => true;
|
|
5195
5467
|
}
|
|
5196
5468
|
return stat;
|
|
5197
5469
|
} catch (error2) {
|
|
5198
|
-
if (!
|
|
5470
|
+
if (!settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5199
5471
|
return lstat;
|
|
5200
5472
|
}
|
|
5201
5473
|
throw error2;
|
|
@@ -5272,8 +5544,8 @@ var require_out = __commonJS({
|
|
|
5272
5544
|
}
|
|
5273
5545
|
exports.stat = stat;
|
|
5274
5546
|
function statSync3(path, optionsOrSettings) {
|
|
5275
|
-
const
|
|
5276
|
-
return sync.read(path,
|
|
5547
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5548
|
+
return sync.read(path, settings2);
|
|
5277
5549
|
}
|
|
5278
5550
|
exports.statSync = statSync3;
|
|
5279
5551
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -5321,8 +5593,8 @@ var require_run_parallel = __commonJS({
|
|
|
5321
5593
|
if (isSync) queueMicrotask2(end);
|
|
5322
5594
|
else end();
|
|
5323
5595
|
}
|
|
5324
|
-
function each(
|
|
5325
|
-
results[
|
|
5596
|
+
function each(i2, err, result) {
|
|
5597
|
+
results[i2] = result;
|
|
5326
5598
|
if (--pending === 0 || err) {
|
|
5327
5599
|
done(err);
|
|
5328
5600
|
}
|
|
@@ -5336,9 +5608,9 @@ var require_run_parallel = __commonJS({
|
|
|
5336
5608
|
});
|
|
5337
5609
|
});
|
|
5338
5610
|
} else {
|
|
5339
|
-
tasks.forEach(function(task,
|
|
5611
|
+
tasks.forEach(function(task, i2) {
|
|
5340
5612
|
task(function(err, result) {
|
|
5341
|
-
each(
|
|
5613
|
+
each(i2, err, result);
|
|
5342
5614
|
});
|
|
5343
5615
|
});
|
|
5344
5616
|
}
|
|
@@ -5413,11 +5685,11 @@ var require_common = __commonJS({
|
|
|
5413
5685
|
init_utils2();
|
|
5414
5686
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5415
5687
|
exports.joinPathSegments = void 0;
|
|
5416
|
-
function joinPathSegments(
|
|
5417
|
-
if (
|
|
5418
|
-
return
|
|
5688
|
+
function joinPathSegments(a2, b, separator) {
|
|
5689
|
+
if (a2.endsWith(separator)) {
|
|
5690
|
+
return a2 + b;
|
|
5419
5691
|
}
|
|
5420
|
-
return
|
|
5692
|
+
return a2 + separator + b;
|
|
5421
5693
|
}
|
|
5422
5694
|
exports.joinPathSegments = joinPathSegments;
|
|
5423
5695
|
}
|
|
@@ -5435,16 +5707,16 @@ var require_async2 = __commonJS({
|
|
|
5435
5707
|
var constants_1 = require_constants3();
|
|
5436
5708
|
var utils = require_utils4();
|
|
5437
5709
|
var common = require_common();
|
|
5438
|
-
function read2(directory,
|
|
5439
|
-
if (!
|
|
5440
|
-
readdirWithFileTypes(directory,
|
|
5710
|
+
function read2(directory, settings2, callback) {
|
|
5711
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
5712
|
+
readdirWithFileTypes(directory, settings2, callback);
|
|
5441
5713
|
return;
|
|
5442
5714
|
}
|
|
5443
|
-
readdir(directory,
|
|
5715
|
+
readdir(directory, settings2, callback);
|
|
5444
5716
|
}
|
|
5445
5717
|
exports.read = read2;
|
|
5446
|
-
function readdirWithFileTypes(directory,
|
|
5447
|
-
|
|
5718
|
+
function readdirWithFileTypes(directory, settings2, callback) {
|
|
5719
|
+
settings2.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
|
|
5448
5720
|
if (readdirError !== null) {
|
|
5449
5721
|
callFailureCallback(callback, readdirError);
|
|
5450
5722
|
return;
|
|
@@ -5452,13 +5724,13 @@ var require_async2 = __commonJS({
|
|
|
5452
5724
|
const entries = dirents.map((dirent) => ({
|
|
5453
5725
|
dirent,
|
|
5454
5726
|
name: dirent.name,
|
|
5455
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
5727
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
5456
5728
|
}));
|
|
5457
|
-
if (!
|
|
5729
|
+
if (!settings2.followSymbolicLinks) {
|
|
5458
5730
|
callSuccessCallback(callback, entries);
|
|
5459
5731
|
return;
|
|
5460
5732
|
}
|
|
5461
|
-
const tasks = entries.map((entry) => makeRplTaskEntry(entry,
|
|
5733
|
+
const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings2));
|
|
5462
5734
|
rpl(tasks, (rplError, rplEntries) => {
|
|
5463
5735
|
if (rplError !== null) {
|
|
5464
5736
|
callFailureCallback(callback, rplError);
|
|
@@ -5469,15 +5741,15 @@ var require_async2 = __commonJS({
|
|
|
5469
5741
|
});
|
|
5470
5742
|
}
|
|
5471
5743
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
5472
|
-
function makeRplTaskEntry(entry,
|
|
5744
|
+
function makeRplTaskEntry(entry, settings2) {
|
|
5473
5745
|
return (done) => {
|
|
5474
5746
|
if (!entry.dirent.isSymbolicLink()) {
|
|
5475
5747
|
done(null, entry);
|
|
5476
5748
|
return;
|
|
5477
5749
|
}
|
|
5478
|
-
|
|
5750
|
+
settings2.fs.stat(entry.path, (statError, stats) => {
|
|
5479
5751
|
if (statError !== null) {
|
|
5480
|
-
if (
|
|
5752
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5481
5753
|
done(statError);
|
|
5482
5754
|
return;
|
|
5483
5755
|
}
|
|
@@ -5489,16 +5761,16 @@ var require_async2 = __commonJS({
|
|
|
5489
5761
|
});
|
|
5490
5762
|
};
|
|
5491
5763
|
}
|
|
5492
|
-
function readdir(directory,
|
|
5493
|
-
|
|
5764
|
+
function readdir(directory, settings2, callback) {
|
|
5765
|
+
settings2.fs.readdir(directory, (readdirError, names) => {
|
|
5494
5766
|
if (readdirError !== null) {
|
|
5495
5767
|
callFailureCallback(callback, readdirError);
|
|
5496
5768
|
return;
|
|
5497
5769
|
}
|
|
5498
5770
|
const tasks = names.map((name) => {
|
|
5499
|
-
const path = common.joinPathSegments(directory, name,
|
|
5771
|
+
const path = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
5500
5772
|
return (done) => {
|
|
5501
|
-
fsStat.stat(path,
|
|
5773
|
+
fsStat.stat(path, settings2.fsStatSettings, (error2, stats) => {
|
|
5502
5774
|
if (error2 !== null) {
|
|
5503
5775
|
done(error2);
|
|
5504
5776
|
return;
|
|
@@ -5508,7 +5780,7 @@ var require_async2 = __commonJS({
|
|
|
5508
5780
|
path,
|
|
5509
5781
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
5510
5782
|
};
|
|
5511
|
-
if (
|
|
5783
|
+
if (settings2.stats) {
|
|
5512
5784
|
entry.stats = stats;
|
|
5513
5785
|
}
|
|
5514
5786
|
done(null, entry);
|
|
@@ -5545,27 +5817,27 @@ var require_sync2 = __commonJS({
|
|
|
5545
5817
|
var constants_1 = require_constants3();
|
|
5546
5818
|
var utils = require_utils4();
|
|
5547
5819
|
var common = require_common();
|
|
5548
|
-
function read2(directory,
|
|
5549
|
-
if (!
|
|
5550
|
-
return readdirWithFileTypes(directory,
|
|
5820
|
+
function read2(directory, settings2) {
|
|
5821
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
5822
|
+
return readdirWithFileTypes(directory, settings2);
|
|
5551
5823
|
}
|
|
5552
|
-
return readdir(directory,
|
|
5824
|
+
return readdir(directory, settings2);
|
|
5553
5825
|
}
|
|
5554
5826
|
exports.read = read2;
|
|
5555
|
-
function readdirWithFileTypes(directory,
|
|
5556
|
-
const dirents =
|
|
5827
|
+
function readdirWithFileTypes(directory, settings2) {
|
|
5828
|
+
const dirents = settings2.fs.readdirSync(directory, { withFileTypes: true });
|
|
5557
5829
|
return dirents.map((dirent) => {
|
|
5558
5830
|
const entry = {
|
|
5559
5831
|
dirent,
|
|
5560
5832
|
name: dirent.name,
|
|
5561
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
5833
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
5562
5834
|
};
|
|
5563
|
-
if (entry.dirent.isSymbolicLink() &&
|
|
5835
|
+
if (entry.dirent.isSymbolicLink() && settings2.followSymbolicLinks) {
|
|
5564
5836
|
try {
|
|
5565
|
-
const stats =
|
|
5837
|
+
const stats = settings2.fs.statSync(entry.path);
|
|
5566
5838
|
entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
|
5567
5839
|
} catch (error2) {
|
|
5568
|
-
if (
|
|
5840
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5569
5841
|
throw error2;
|
|
5570
5842
|
}
|
|
5571
5843
|
}
|
|
@@ -5574,17 +5846,17 @@ var require_sync2 = __commonJS({
|
|
|
5574
5846
|
});
|
|
5575
5847
|
}
|
|
5576
5848
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
5577
|
-
function readdir(directory,
|
|
5578
|
-
const names =
|
|
5849
|
+
function readdir(directory, settings2) {
|
|
5850
|
+
const names = settings2.fs.readdirSync(directory);
|
|
5579
5851
|
return names.map((name) => {
|
|
5580
|
-
const entryPath = common.joinPathSegments(directory, name,
|
|
5581
|
-
const stats = fsStat.statSync(entryPath,
|
|
5852
|
+
const entryPath = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
5853
|
+
const stats = fsStat.statSync(entryPath, settings2.fsStatSettings);
|
|
5582
5854
|
const entry = {
|
|
5583
5855
|
name,
|
|
5584
5856
|
path: entryPath,
|
|
5585
5857
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
5586
5858
|
};
|
|
5587
|
-
if (
|
|
5859
|
+
if (settings2.stats) {
|
|
5588
5860
|
entry.stats = stats;
|
|
5589
5861
|
}
|
|
5590
5862
|
return entry;
|
|
@@ -5671,8 +5943,8 @@ var require_out2 = __commonJS({
|
|
|
5671
5943
|
}
|
|
5672
5944
|
exports.scandir = scandir;
|
|
5673
5945
|
function scandirSync(path, optionsOrSettings) {
|
|
5674
|
-
const
|
|
5675
|
-
return sync.read(path,
|
|
5946
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5947
|
+
return sync.read(path, settings2);
|
|
5676
5948
|
}
|
|
5677
5949
|
exports.scandirSync = scandirSync;
|
|
5678
5950
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -5953,7 +6225,7 @@ var require_queue = __commonJS({
|
|
|
5953
6225
|
queue.drained = drained;
|
|
5954
6226
|
return queue;
|
|
5955
6227
|
function push(value) {
|
|
5956
|
-
var
|
|
6228
|
+
var p = new Promise(function(resolve4, reject) {
|
|
5957
6229
|
pushCb(value, function(err, result) {
|
|
5958
6230
|
if (err) {
|
|
5959
6231
|
reject(err);
|
|
@@ -5962,11 +6234,11 @@ var require_queue = __commonJS({
|
|
|
5962
6234
|
resolve4(result);
|
|
5963
6235
|
});
|
|
5964
6236
|
});
|
|
5965
|
-
|
|
5966
|
-
return
|
|
6237
|
+
p.catch(noop);
|
|
6238
|
+
return p;
|
|
5967
6239
|
}
|
|
5968
6240
|
function unshift(value) {
|
|
5969
|
-
var
|
|
6241
|
+
var p = new Promise(function(resolve4, reject) {
|
|
5970
6242
|
unshiftCb(value, function(err, result) {
|
|
5971
6243
|
if (err) {
|
|
5972
6244
|
reject(err);
|
|
@@ -5975,11 +6247,11 @@ var require_queue = __commonJS({
|
|
|
5975
6247
|
resolve4(result);
|
|
5976
6248
|
});
|
|
5977
6249
|
});
|
|
5978
|
-
|
|
5979
|
-
return
|
|
6250
|
+
p.catch(noop);
|
|
6251
|
+
return p;
|
|
5980
6252
|
}
|
|
5981
6253
|
function drained() {
|
|
5982
|
-
var
|
|
6254
|
+
var p = new Promise(function(resolve4) {
|
|
5983
6255
|
process.nextTick(function() {
|
|
5984
6256
|
if (queue.idle()) {
|
|
5985
6257
|
resolve4();
|
|
@@ -5993,7 +6265,7 @@ var require_queue = __commonJS({
|
|
|
5993
6265
|
}
|
|
5994
6266
|
});
|
|
5995
6267
|
});
|
|
5996
|
-
return
|
|
6268
|
+
return p;
|
|
5997
6269
|
}
|
|
5998
6270
|
}
|
|
5999
6271
|
module.exports = fastqueue;
|
|
@@ -6008,11 +6280,11 @@ var require_common2 = __commonJS({
|
|
|
6008
6280
|
init_utils2();
|
|
6009
6281
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6010
6282
|
exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
|
|
6011
|
-
function isFatalError(
|
|
6012
|
-
if (
|
|
6283
|
+
function isFatalError(settings2, error2) {
|
|
6284
|
+
if (settings2.errorFilter === null) {
|
|
6013
6285
|
return true;
|
|
6014
6286
|
}
|
|
6015
|
-
return !
|
|
6287
|
+
return !settings2.errorFilter(error2);
|
|
6016
6288
|
}
|
|
6017
6289
|
exports.isFatalError = isFatalError;
|
|
6018
6290
|
function isAppliedFilter(filter, value) {
|
|
@@ -6023,14 +6295,14 @@ var require_common2 = __commonJS({
|
|
|
6023
6295
|
return filepath.split(/[/\\]/).join(separator);
|
|
6024
6296
|
}
|
|
6025
6297
|
exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
|
|
6026
|
-
function joinPathSegments(
|
|
6027
|
-
if (
|
|
6298
|
+
function joinPathSegments(a2, b, separator) {
|
|
6299
|
+
if (a2 === "") {
|
|
6028
6300
|
return b;
|
|
6029
6301
|
}
|
|
6030
|
-
if (
|
|
6031
|
-
return
|
|
6302
|
+
if (a2.endsWith(separator)) {
|
|
6303
|
+
return a2 + b;
|
|
6032
6304
|
}
|
|
6033
|
-
return
|
|
6305
|
+
return a2 + separator + b;
|
|
6034
6306
|
}
|
|
6035
6307
|
exports.joinPathSegments = joinPathSegments;
|
|
6036
6308
|
}
|
|
@@ -6377,14 +6649,14 @@ var require_out3 = __commonJS({
|
|
|
6377
6649
|
}
|
|
6378
6650
|
exports.walk = walk;
|
|
6379
6651
|
function walkSync(directory, optionsOrSettings) {
|
|
6380
|
-
const
|
|
6381
|
-
const provider = new sync_1.default(directory,
|
|
6652
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
6653
|
+
const provider = new sync_1.default(directory, settings2);
|
|
6382
6654
|
return provider.read();
|
|
6383
6655
|
}
|
|
6384
6656
|
exports.walkSync = walkSync;
|
|
6385
6657
|
function walkStream(directory, optionsOrSettings) {
|
|
6386
|
-
const
|
|
6387
|
-
const provider = new stream_1.default(directory,
|
|
6658
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
6659
|
+
const provider = new stream_1.default(directory, settings2);
|
|
6388
6660
|
return provider.read();
|
|
6389
6661
|
}
|
|
6390
6662
|
exports.walkStream = walkStream;
|
|
@@ -6470,8 +6742,8 @@ var require_stream3 = __commonJS({
|
|
|
6470
6742
|
done();
|
|
6471
6743
|
}).catch(done);
|
|
6472
6744
|
};
|
|
6473
|
-
for (let
|
|
6474
|
-
stream.write(
|
|
6745
|
+
for (let i2 = 0; i2 < filepaths.length; i2++) {
|
|
6746
|
+
stream.write(i2);
|
|
6475
6747
|
}
|
|
6476
6748
|
return stream;
|
|
6477
6749
|
}
|
|
@@ -7132,14 +7404,14 @@ var require_out4 = __commonJS({
|
|
|
7132
7404
|
function generateTasks(source, options) {
|
|
7133
7405
|
assertPatternsInput(source);
|
|
7134
7406
|
const patterns = [].concat(source);
|
|
7135
|
-
const
|
|
7136
|
-
return taskManager.generate(patterns,
|
|
7407
|
+
const settings2 = new settings_1.default(options);
|
|
7408
|
+
return taskManager.generate(patterns, settings2);
|
|
7137
7409
|
}
|
|
7138
7410
|
FastGlob2.generateTasks = generateTasks;
|
|
7139
7411
|
function isDynamicPattern(source, options) {
|
|
7140
7412
|
assertPatternsInput(source);
|
|
7141
|
-
const
|
|
7142
|
-
return utils.pattern.isDynamicPattern(source,
|
|
7413
|
+
const settings2 = new settings_1.default(options);
|
|
7414
|
+
return utils.pattern.isDynamicPattern(source, settings2);
|
|
7143
7415
|
}
|
|
7144
7416
|
FastGlob2.isDynamicPattern = isDynamicPattern;
|
|
7145
7417
|
function escapePath(source) {
|
|
@@ -7181,9 +7453,9 @@ var require_out4 = __commonJS({
|
|
|
7181
7453
|
})(FastGlob || (FastGlob = {}));
|
|
7182
7454
|
function getWorks(source, _Provider, options) {
|
|
7183
7455
|
const patterns = [].concat(source);
|
|
7184
|
-
const
|
|
7185
|
-
const tasks = taskManager.generate(patterns,
|
|
7186
|
-
const provider = new _Provider(
|
|
7456
|
+
const settings2 = new settings_1.default(options);
|
|
7457
|
+
const tasks = taskManager.generate(patterns, settings2);
|
|
7458
|
+
const provider = new _Provider(settings2);
|
|
7187
7459
|
return tasks.map(provider.read, provider);
|
|
7188
7460
|
}
|
|
7189
7461
|
function assertPatternsInput(input) {
|
|
@@ -7361,8 +7633,8 @@ import "node:fs";
|
|
|
7361
7633
|
import { createRequire } from "node:module";
|
|
7362
7634
|
import {
|
|
7363
7635
|
resolve,
|
|
7364
|
-
join,
|
|
7365
|
-
dirname,
|
|
7636
|
+
join as join2,
|
|
7637
|
+
dirname as dirname2,
|
|
7366
7638
|
relative,
|
|
7367
7639
|
normalize,
|
|
7368
7640
|
sep,
|
|
@@ -7376,7 +7648,7 @@ function safeExecuteAsync2(fn, message) {
|
|
|
7376
7648
|
);
|
|
7377
7649
|
});
|
|
7378
7650
|
}
|
|
7379
|
-
var import_fast_glob, constants,
|
|
7651
|
+
var import_fast_glob, constants, log3, PACKAGE_PATHS, PathResolver;
|
|
7380
7652
|
var init_PathResolver = __esm({
|
|
7381
7653
|
"packages/core/config/utils/PathResolver.ts"() {
|
|
7382
7654
|
"use strict";
|
|
@@ -7389,7 +7661,7 @@ var init_PathResolver = __esm({
|
|
|
7389
7661
|
getPatternsFor: getPatternsFor || void 0,
|
|
7390
7662
|
I18N_PATHS: I18N_PATHS || void 0
|
|
7391
7663
|
};
|
|
7392
|
-
|
|
7664
|
+
log3 = {
|
|
7393
7665
|
error: (message, error2) => {
|
|
7394
7666
|
},
|
|
7395
7667
|
warn: (message, error2) => {
|
|
@@ -7510,7 +7782,7 @@ var init_PathResolver = __esm({
|
|
|
7510
7782
|
*/
|
|
7511
7783
|
getDirname(path) {
|
|
7512
7784
|
if (!path) return "";
|
|
7513
|
-
return this.normalizePath(
|
|
7785
|
+
return this.normalizePath(dirname2(path));
|
|
7514
7786
|
}
|
|
7515
7787
|
/**
|
|
7516
7788
|
* Resolve package path using Node's module resolution
|
|
@@ -7522,7 +7794,7 @@ var init_PathResolver = __esm({
|
|
|
7522
7794
|
resolvePackage(packageSpecifier, fromPath = null) {
|
|
7523
7795
|
try {
|
|
7524
7796
|
const basePath = fromPath || this.getAppRoot();
|
|
7525
|
-
const require3 = createRequire(
|
|
7797
|
+
const require3 = createRequire(join2(basePath, "package.json"));
|
|
7526
7798
|
const resolved = require3.resolve(packageSpecifier);
|
|
7527
7799
|
return this.normalizePath(resolved);
|
|
7528
7800
|
} catch (error2) {
|
|
@@ -7674,7 +7946,7 @@ var init_PathResolver = __esm({
|
|
|
7674
7946
|
return cleanContent;
|
|
7675
7947
|
} catch (error2) {
|
|
7676
7948
|
if (this.options.debug) {
|
|
7677
|
-
|
|
7949
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
7678
7950
|
}
|
|
7679
7951
|
return null;
|
|
7680
7952
|
}
|
|
@@ -7702,7 +7974,7 @@ var init_PathResolver = __esm({
|
|
|
7702
7974
|
return cleanContent;
|
|
7703
7975
|
} catch (error2) {
|
|
7704
7976
|
if (this.options.debug) {
|
|
7705
|
-
|
|
7977
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
7706
7978
|
}
|
|
7707
7979
|
return null;
|
|
7708
7980
|
}
|
|
@@ -7724,16 +7996,16 @@ var init_PathResolver = __esm({
|
|
|
7724
7996
|
verbose = false
|
|
7725
7997
|
} = options;
|
|
7726
7998
|
const normalizedPath = this.normalizePath(filePath);
|
|
7727
|
-
const dir = this.normalizePath(
|
|
7999
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
7728
8000
|
const fileExists = this.pathExists(normalizedPath);
|
|
7729
8001
|
if (fileExists && !overwrite) {
|
|
7730
8002
|
if (verbose) {
|
|
7731
|
-
|
|
8003
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
7732
8004
|
}
|
|
7733
8005
|
return false;
|
|
7734
8006
|
}
|
|
7735
8007
|
if (dryRun) {
|
|
7736
|
-
|
|
8008
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
7737
8009
|
return true;
|
|
7738
8010
|
}
|
|
7739
8011
|
try {
|
|
@@ -7758,7 +8030,7 @@ var init_PathResolver = __esm({
|
|
|
7758
8030
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
7759
8031
|
}
|
|
7760
8032
|
if (verbose) {
|
|
7761
|
-
|
|
8033
|
+
log3.info(
|
|
7762
8034
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
7763
8035
|
);
|
|
7764
8036
|
}
|
|
@@ -7785,16 +8057,16 @@ var init_PathResolver = __esm({
|
|
|
7785
8057
|
verbose = false
|
|
7786
8058
|
} = options;
|
|
7787
8059
|
const normalizedPath = this.normalizePath(filePath);
|
|
7788
|
-
const dir = this.normalizePath(
|
|
8060
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
7789
8061
|
const fileExists = this.pathExists(normalizedPath);
|
|
7790
8062
|
if (fileExists && !overwrite) {
|
|
7791
8063
|
if (verbose) {
|
|
7792
|
-
|
|
8064
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
7793
8065
|
}
|
|
7794
8066
|
return false;
|
|
7795
8067
|
}
|
|
7796
8068
|
if (dryRun) {
|
|
7797
|
-
|
|
8069
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
7798
8070
|
return true;
|
|
7799
8071
|
}
|
|
7800
8072
|
try {
|
|
@@ -7818,7 +8090,7 @@ var init_PathResolver = __esm({
|
|
|
7818
8090
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
7819
8091
|
}
|
|
7820
8092
|
if (verbose) {
|
|
7821
|
-
|
|
8093
|
+
log3.info(
|
|
7822
8094
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
7823
8095
|
);
|
|
7824
8096
|
}
|
|
@@ -7843,15 +8115,15 @@ var init_PathResolver = __esm({
|
|
|
7843
8115
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7844
8116
|
if (fileExists && !overwrite) {
|
|
7845
8117
|
if (verbose) {
|
|
7846
|
-
|
|
8118
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7847
8119
|
}
|
|
7848
8120
|
return false;
|
|
7849
8121
|
}
|
|
7850
8122
|
if (dryRun) {
|
|
7851
|
-
|
|
8123
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7852
8124
|
return true;
|
|
7853
8125
|
}
|
|
7854
|
-
const dir = this.normalizePath(
|
|
8126
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7855
8127
|
try {
|
|
7856
8128
|
await fs.promises.mkdir(dir, { recursive: true });
|
|
7857
8129
|
} catch (error2) {
|
|
@@ -7861,7 +8133,7 @@ var init_PathResolver = __esm({
|
|
|
7861
8133
|
return await safeExecuteAsync2(async () => {
|
|
7862
8134
|
await fs.promises.copyFile(srcPath, normalizedDestPath);
|
|
7863
8135
|
if (verbose) {
|
|
7864
|
-
|
|
8136
|
+
log3.info(
|
|
7865
8137
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7866
8138
|
);
|
|
7867
8139
|
}
|
|
@@ -7885,15 +8157,15 @@ var init_PathResolver = __esm({
|
|
|
7885
8157
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7886
8158
|
if (fileExists && !overwrite) {
|
|
7887
8159
|
if (verbose) {
|
|
7888
|
-
|
|
8160
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7889
8161
|
}
|
|
7890
8162
|
return false;
|
|
7891
8163
|
}
|
|
7892
8164
|
if (dryRun) {
|
|
7893
|
-
|
|
8165
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7894
8166
|
return true;
|
|
7895
8167
|
}
|
|
7896
|
-
const dir = this.normalizePath(
|
|
8168
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7897
8169
|
try {
|
|
7898
8170
|
fs.mkdirSync(dir, { recursive: true });
|
|
7899
8171
|
} catch (error2) {
|
|
@@ -7902,7 +8174,7 @@ var init_PathResolver = __esm({
|
|
|
7902
8174
|
try {
|
|
7903
8175
|
fs.copyFileSync(srcPath, normalizedDestPath);
|
|
7904
8176
|
if (verbose) {
|
|
7905
|
-
|
|
8177
|
+
log3.info(
|
|
7906
8178
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7907
8179
|
);
|
|
7908
8180
|
}
|
|
@@ -7919,7 +8191,7 @@ var init_PathResolver = __esm({
|
|
|
7919
8191
|
return fs.existsSync(filePath);
|
|
7920
8192
|
} catch (error2) {
|
|
7921
8193
|
if (!silent) {
|
|
7922
|
-
|
|
8194
|
+
log3.error(`Error checking path existence: ${filePath}`, error2);
|
|
7923
8195
|
}
|
|
7924
8196
|
return false;
|
|
7925
8197
|
}
|
|
@@ -7945,7 +8217,7 @@ var init_PathResolver = __esm({
|
|
|
7945
8217
|
return fs.readdirSync(dirPath, options);
|
|
7946
8218
|
} catch (error2) {
|
|
7947
8219
|
if (this.options.debug) {
|
|
7948
|
-
|
|
8220
|
+
log3.warn(`Failed to read directory: ${dirPath}`, error2);
|
|
7949
8221
|
}
|
|
7950
8222
|
const isObjectOptions = options && typeof options === "object" && "withFileTypes" in options;
|
|
7951
8223
|
return isObjectOptions && options.withFileTypes ? [] : [];
|
|
@@ -7963,7 +8235,7 @@ var init_PathResolver = __esm({
|
|
|
7963
8235
|
return fs.statSync(filePath);
|
|
7964
8236
|
} catch (error2) {
|
|
7965
8237
|
if (this.options.debug) {
|
|
7966
|
-
|
|
8238
|
+
log3.warn(`Failed to stat file: ${filePath}`, error2);
|
|
7967
8239
|
}
|
|
7968
8240
|
return null;
|
|
7969
8241
|
}
|
|
@@ -7980,7 +8252,7 @@ var init_PathResolver = __esm({
|
|
|
7980
8252
|
return fs.lstatSync(filePath);
|
|
7981
8253
|
} catch (error2) {
|
|
7982
8254
|
if (this.options.debug) {
|
|
7983
|
-
|
|
8255
|
+
log3.warn(`Failed to lstat file: ${filePath}`, error2);
|
|
7984
8256
|
}
|
|
7985
8257
|
return null;
|
|
7986
8258
|
}
|
|
@@ -8069,7 +8341,7 @@ var init_PathResolver = __esm({
|
|
|
8069
8341
|
* @returns True if repoRoot is the monorepo (has packages directory)
|
|
8070
8342
|
*/
|
|
8071
8343
|
isMonorepo() {
|
|
8072
|
-
const packagesDir =
|
|
8344
|
+
const packagesDir = join2(this._repoRoot, "packages");
|
|
8073
8345
|
return this.pathExists(packagesDir);
|
|
8074
8346
|
}
|
|
8075
8347
|
/**
|
|
@@ -8086,7 +8358,7 @@ var init_PathResolver = __esm({
|
|
|
8086
8358
|
* Find files matching pattern within directory
|
|
8087
8359
|
*/
|
|
8088
8360
|
async findFiles(directory, pattern, options = {}) {
|
|
8089
|
-
const searchPattern = this.normalizePath(
|
|
8361
|
+
const searchPattern = this.normalizePath(join2(directory, pattern));
|
|
8090
8362
|
const appRoot = this.getAppRoot();
|
|
8091
8363
|
const normalizeAppRoot = this.normalizePath(appRoot);
|
|
8092
8364
|
const relativePattern = searchPattern.startsWith(normalizeAppRoot) ? searchPattern.slice(normalizeAppRoot.length + 1) : searchPattern;
|
|
@@ -8133,7 +8405,7 @@ var init_PathResolver = __esm({
|
|
|
8133
8405
|
return null;
|
|
8134
8406
|
}
|
|
8135
8407
|
const resolvedPath = this.normalizePath(
|
|
8136
|
-
|
|
8408
|
+
join2(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
|
|
8137
8409
|
);
|
|
8138
8410
|
const resolvedDir = resolvedPath.replace(/\/[^/]*\*.*$/, "");
|
|
8139
8411
|
if (this.pathExists(resolvedDir)) {
|
|
@@ -8329,13 +8601,13 @@ var init_PathResolver = __esm({
|
|
|
8329
8601
|
const maxLevels = this.options.maxLevels;
|
|
8330
8602
|
while (levelsChecked < maxLevels) {
|
|
8331
8603
|
const toolingPath = this.normalizePath(
|
|
8332
|
-
|
|
8604
|
+
join2(currentDir, PACKAGE_PATHS.TOOLING)
|
|
8333
8605
|
);
|
|
8334
|
-
const corePath = this.normalizePath(
|
|
8606
|
+
const corePath = this.normalizePath(join2(currentDir, PACKAGE_PATHS.CORE));
|
|
8335
8607
|
if (this.pathExists(toolingPath) && this.pathExists(corePath)) {
|
|
8336
8608
|
return currentDir;
|
|
8337
8609
|
}
|
|
8338
|
-
const appsDir =
|
|
8610
|
+
const appsDir = join2(currentDir, "apps");
|
|
8339
8611
|
if (this.pathExists(appsDir)) {
|
|
8340
8612
|
const appsDirStat = this.statSync(appsDir);
|
|
8341
8613
|
if (appsDirStat?.isDirectory()) {
|
|
@@ -8343,15 +8615,15 @@ var init_PathResolver = __esm({
|
|
|
8343
8615
|
}
|
|
8344
8616
|
}
|
|
8345
8617
|
const packageJsonPath = this.normalizePath(
|
|
8346
|
-
|
|
8618
|
+
join2(currentDir, "package.json")
|
|
8347
8619
|
);
|
|
8348
8620
|
if (this.pathExists(packageJsonPath)) {
|
|
8349
|
-
const parentDir2 = this.normalizePath(
|
|
8621
|
+
const parentDir2 = this.normalizePath(dirname2(currentDir));
|
|
8350
8622
|
if (parentDir2 === currentDir) {
|
|
8351
8623
|
return currentDir;
|
|
8352
8624
|
}
|
|
8353
8625
|
}
|
|
8354
|
-
const parentDir = this.normalizePath(
|
|
8626
|
+
const parentDir = this.normalizePath(dirname2(currentDir));
|
|
8355
8627
|
if (parentDir === currentDir) {
|
|
8356
8628
|
break;
|
|
8357
8629
|
}
|
|
@@ -8367,8 +8639,8 @@ var init_PathResolver = __esm({
|
|
|
8367
8639
|
// packages/tooling/src/utils/pathResolver.ts
|
|
8368
8640
|
import { createRequire as createRequire2 } from "node:module";
|
|
8369
8641
|
import {
|
|
8370
|
-
join as
|
|
8371
|
-
dirname as
|
|
8642
|
+
join as join3,
|
|
8643
|
+
dirname as dirname3,
|
|
8372
8644
|
basename as basename2,
|
|
8373
8645
|
extname as extname2,
|
|
8374
8646
|
relative as relative2,
|
|
@@ -8377,11 +8649,11 @@ import {
|
|
|
8377
8649
|
isAbsolute as pathIsAbsolute
|
|
8378
8650
|
} from "node:path";
|
|
8379
8651
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
8380
|
-
function
|
|
8652
|
+
function readdirSync3(dirPath, options) {
|
|
8381
8653
|
return pathResolverInstance.readdirSync(dirPath, options);
|
|
8382
8654
|
}
|
|
8383
8655
|
function getDirnameFromUrl(importMetaUrl) {
|
|
8384
|
-
return
|
|
8656
|
+
return dirname3(fileURLToPath2(importMetaUrl));
|
|
8385
8657
|
}
|
|
8386
8658
|
function detectExecutionMode() {
|
|
8387
8659
|
const fileUrlPath = fileURLToPath2(import.meta.url);
|
|
@@ -8397,7 +8669,7 @@ function getTemplatesRoot() {
|
|
|
8397
8669
|
const mode = detectExecutionMode();
|
|
8398
8670
|
if (mode === "development") {
|
|
8399
8671
|
const fileUrlPath = fileURLToPath2(import.meta.url);
|
|
8400
|
-
const frameworkRoot = normalizePath(
|
|
8672
|
+
const frameworkRoot = normalizePath(dirname3(fileUrlPath), "../../../..");
|
|
8401
8673
|
return normalizePath(frameworkRoot, PACKAGE_PATHS.CLI, "templates");
|
|
8402
8674
|
} else {
|
|
8403
8675
|
try {
|
|
@@ -8413,7 +8685,7 @@ function getTemplatesRoot() {
|
|
|
8413
8685
|
try {
|
|
8414
8686
|
const req = createRequire2(import.meta.url);
|
|
8415
8687
|
const cliPackageJsonPath = req.resolve("@donotdev/cli/package.json");
|
|
8416
|
-
const cliRoot2 = normalizePath(
|
|
8688
|
+
const cliRoot2 = normalizePath(dirname3(cliPackageJsonPath));
|
|
8417
8689
|
const templatesPath = normalizePath(cliRoot2, "templates");
|
|
8418
8690
|
if (pathExists(templatesPath)) {
|
|
8419
8691
|
return templatesPath;
|
|
@@ -8465,8 +8737,8 @@ async function glob(pattern, options = {}) {
|
|
|
8465
8737
|
const patterns = Array.isArray(pattern) ? pattern : [pattern];
|
|
8466
8738
|
const cwd = options.cwd || pathResolverInstance.getAppRoot() || process.cwd();
|
|
8467
8739
|
const normalizeCwd = pathResolverInstance.normalizePath(cwd);
|
|
8468
|
-
const relativePatterns = patterns.map((
|
|
8469
|
-
const normalizedPattern = pathResolverInstance.normalizePath(
|
|
8740
|
+
const relativePatterns = patterns.map((p) => {
|
|
8741
|
+
const normalizedPattern = pathResolverInstance.normalizePath(p);
|
|
8470
8742
|
if (normalizedPattern.startsWith(normalizeCwd)) {
|
|
8471
8743
|
return normalizedPattern.slice(normalizeCwd.length + 1);
|
|
8472
8744
|
}
|
|
@@ -8502,7 +8774,7 @@ var init_pathResolver = __esm({
|
|
|
8502
8774
|
getRepoRoot = () => pathResolverInstance.getRepoRoot();
|
|
8503
8775
|
resolveFrameworkPackage = (name, from) => pathResolverInstance.resolveFrameworkPackage(name, from || null);
|
|
8504
8776
|
normalizePath = (...pathSegments) => {
|
|
8505
|
-
return pathResolverInstance.normalizePath(
|
|
8777
|
+
return pathResolverInstance.normalizePath(join3(...pathSegments));
|
|
8506
8778
|
};
|
|
8507
8779
|
pathExists = (filePath, silent = false) => pathResolverInstance.pathExists(filePath, silent);
|
|
8508
8780
|
read = async (filePath, options) => pathResolverInstance.read(filePath, options);
|
|
@@ -8515,13 +8787,13 @@ var init_pathResolver = __esm({
|
|
|
8515
8787
|
ensureDir = async (dirPath) => pathResolverInstance.ensureDir(dirPath);
|
|
8516
8788
|
findFiles = async (directory, pattern, options = {}) => pathResolverInstance.findFiles(directory, pattern, options);
|
|
8517
8789
|
fromAppRoot = (...pathSegments) => {
|
|
8518
|
-
return pathResolverInstance.resolveAppPath(
|
|
8790
|
+
return pathResolverInstance.resolveAppPath(join3(...pathSegments));
|
|
8519
8791
|
};
|
|
8520
8792
|
getRelativePathBetween = (from, to) => {
|
|
8521
8793
|
return normalizePath(relative2(from, to));
|
|
8522
8794
|
};
|
|
8523
8795
|
getDirname = (filePath) => {
|
|
8524
|
-
return normalizePath(
|
|
8796
|
+
return normalizePath(dirname3(filePath));
|
|
8525
8797
|
};
|
|
8526
8798
|
getBasename = (filePath, ext) => {
|
|
8527
8799
|
return basename2(filePath, ext);
|
|
@@ -8564,7 +8836,7 @@ var init_typed_file_operations = __esm({
|
|
|
8564
8836
|
import { Buffer } from "node:buffer";
|
|
8565
8837
|
import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
8566
8838
|
import { createRequire as createRequire3 } from "node:module";
|
|
8567
|
-
import { dirname as
|
|
8839
|
+
import { dirname as dirname4, resolve as resolve3 } from "node:path";
|
|
8568
8840
|
import process from "node:process";
|
|
8569
8841
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
8570
8842
|
var require2, __filename, __dirname;
|
|
@@ -8573,7 +8845,7 @@ var init_utils2 = __esm({
|
|
|
8573
8845
|
"use strict";
|
|
8574
8846
|
require2 = createRequire3(import.meta.url);
|
|
8575
8847
|
__filename = fileURLToPath3(import.meta.url);
|
|
8576
|
-
__dirname =
|
|
8848
|
+
__dirname = dirname4(__filename);
|
|
8577
8849
|
if (typeof globalThis !== "undefined") {
|
|
8578
8850
|
globalThis.require = require2;
|
|
8579
8851
|
globalThis.__filename = __filename;
|
|
@@ -8601,7 +8873,7 @@ function detectApps(projectRoot) {
|
|
|
8601
8873
|
const appsDir = joinPath(projectRoot, "apps");
|
|
8602
8874
|
const appsDirStat = statSync2(appsDir);
|
|
8603
8875
|
if (pathExists(appsDir) && appsDirStat?.isDirectory()) {
|
|
8604
|
-
const appDirs =
|
|
8876
|
+
const appDirs = readdirSync3(appsDir, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name).sort();
|
|
8605
8877
|
for (const appDir of appDirs) {
|
|
8606
8878
|
const appPath = joinPath(appsDir, appDir);
|
|
8607
8879
|
const packageJsonPath = joinPath(appPath, "package.json");
|
|
@@ -8827,17 +9099,17 @@ var init_app_detection = __esm({
|
|
|
8827
9099
|
async function selectApp(projectRoot, appName) {
|
|
8828
9100
|
const apps = detectApps(projectRoot);
|
|
8829
9101
|
if (apps.length === 0) {
|
|
8830
|
-
|
|
8831
|
-
|
|
9102
|
+
log2.error("No apps found in this project.");
|
|
9103
|
+
log2.info('Run "dndev init" to create a new project.');
|
|
8832
9104
|
return null;
|
|
8833
9105
|
}
|
|
8834
9106
|
if (appName) {
|
|
8835
|
-
const app = apps.find((
|
|
9107
|
+
const app = apps.find((a2) => a2.name === appName);
|
|
8836
9108
|
if (!app) {
|
|
8837
|
-
|
|
8838
|
-
|
|
8839
|
-
apps.forEach((
|
|
8840
|
-
|
|
9109
|
+
log2.warn(`App "${appName}" not found.`);
|
|
9110
|
+
log2.info("Available apps:");
|
|
9111
|
+
apps.forEach((a2) => log2.info(` - ${a2.name}`));
|
|
9112
|
+
log2.info("Please select from the list:");
|
|
8841
9113
|
} else {
|
|
8842
9114
|
return app;
|
|
8843
9115
|
}
|
|
@@ -8845,7 +9117,7 @@ async function selectApp(projectRoot, appName) {
|
|
|
8845
9117
|
if (apps.length === 1) {
|
|
8846
9118
|
return apps[0] || null;
|
|
8847
9119
|
}
|
|
8848
|
-
const selected = await
|
|
9120
|
+
const selected = await select({
|
|
8849
9121
|
message: "Select app:",
|
|
8850
9122
|
options: apps.map((app) => ({
|
|
8851
9123
|
value: app.name,
|
|
@@ -8855,7 +9127,7 @@ async function selectApp(projectRoot, appName) {
|
|
|
8855
9127
|
if (typeof selected !== "string") {
|
|
8856
9128
|
return null;
|
|
8857
9129
|
}
|
|
8858
|
-
return apps.find((
|
|
9130
|
+
return apps.find((a2) => a2.name === selected) || null;
|
|
8859
9131
|
}
|
|
8860
9132
|
var init_app_selector = __esm({
|
|
8861
9133
|
"packages/tooling/src/utils/app-selector.ts"() {
|
|
@@ -8869,24 +9141,24 @@ var init_app_selector = __esm({
|
|
|
8869
9141
|
|
|
8870
9142
|
// packages/tooling/src/utils/cli-input.ts
|
|
8871
9143
|
async function askForInput(message, defaultValue = "") {
|
|
8872
|
-
const result = await
|
|
9144
|
+
const result = await text({
|
|
8873
9145
|
message,
|
|
8874
9146
|
placeholder: defaultValue || void 0,
|
|
8875
9147
|
defaultValue: defaultValue || void 0
|
|
8876
9148
|
});
|
|
8877
|
-
if (
|
|
8878
|
-
|
|
9149
|
+
if (isCancel(result)) {
|
|
9150
|
+
cancel("Operation cancelled.");
|
|
8879
9151
|
process.exit(0);
|
|
8880
9152
|
}
|
|
8881
9153
|
return result;
|
|
8882
9154
|
}
|
|
8883
9155
|
async function askForConfirmation(message, defaultValue = false) {
|
|
8884
|
-
const result = await
|
|
9156
|
+
const result = await confirm({
|
|
8885
9157
|
message,
|
|
8886
9158
|
initialValue: defaultValue
|
|
8887
9159
|
});
|
|
8888
|
-
if (
|
|
8889
|
-
|
|
9160
|
+
if (isCancel(result)) {
|
|
9161
|
+
cancel("Operation cancelled.");
|
|
8890
9162
|
process.exit(0);
|
|
8891
9163
|
}
|
|
8892
9164
|
return result;
|
|
@@ -8897,13 +9169,13 @@ async function askForSelection(message, choices, defaultValue = 0) {
|
|
|
8897
9169
|
label: choice.title,
|
|
8898
9170
|
hint: choice.hint
|
|
8899
9171
|
}));
|
|
8900
|
-
const result = await
|
|
9172
|
+
const result = await select({
|
|
8901
9173
|
message,
|
|
8902
9174
|
options,
|
|
8903
9175
|
initialValue: choices[defaultValue]?.value
|
|
8904
9176
|
});
|
|
8905
|
-
if (
|
|
8906
|
-
|
|
9177
|
+
if (isCancel(result)) {
|
|
9178
|
+
cancel("Operation cancelled.");
|
|
8907
9179
|
process.exit(0);
|
|
8908
9180
|
}
|
|
8909
9181
|
return result;
|
|
@@ -8994,9 +9266,9 @@ async function validateToken(token) {
|
|
|
8994
9266
|
return { username: data.user.username, email: data.user.email };
|
|
8995
9267
|
}
|
|
8996
9268
|
async function fetchProjectDetails(token, projectId, orgId) {
|
|
8997
|
-
const
|
|
9269
|
+
const q = orgId ? `?teamId=${encodeURIComponent(orgId)}` : "";
|
|
8998
9270
|
const res = await fetch(
|
|
8999
|
-
`${VERCEL_API}/v9/projects/${encodeURIComponent(projectId)}${
|
|
9271
|
+
`${VERCEL_API}/v9/projects/${encodeURIComponent(projectId)}${q}`,
|
|
9000
9272
|
{
|
|
9001
9273
|
headers: { Authorization: `Bearer ${token}` }
|
|
9002
9274
|
}
|
|
@@ -9113,7 +9385,7 @@ function resolveSecret(name, projectRoot, opts) {
|
|
|
9113
9385
|
if (value) {
|
|
9114
9386
|
if (!opts?.silent && !warnedLegacy.has(name)) {
|
|
9115
9387
|
warnedLegacy.add(name);
|
|
9116
|
-
|
|
9388
|
+
log2.warn(
|
|
9117
9389
|
`${name} found in ${relPath} (legacy). Move it to .dndev.secrets at project root.`
|
|
9118
9390
|
);
|
|
9119
9391
|
}
|
|
@@ -9124,7 +9396,7 @@ function resolveSecret(name, projectRoot, opts) {
|
|
|
9124
9396
|
if (aliasValue) {
|
|
9125
9397
|
if (!opts?.silent && !warnedLegacy.has(name)) {
|
|
9126
9398
|
warnedLegacy.add(name);
|
|
9127
|
-
|
|
9399
|
+
log2.warn(
|
|
9128
9400
|
`${name} found in ${relPath} (legacy). Move it to .dndev.secrets at project root.`
|
|
9129
9401
|
);
|
|
9130
9402
|
}
|
|
@@ -9267,24 +9539,24 @@ function isFirebaseInstalled() {
|
|
|
9267
9539
|
}
|
|
9268
9540
|
async function checkPrerequisites() {
|
|
9269
9541
|
if (!isFirebaseInstalled()) {
|
|
9270
|
-
|
|
9271
|
-
|
|
9542
|
+
log2.error("Firebase CLI is not installed.");
|
|
9543
|
+
log2.info("Install it with: bun install -g firebase-tools");
|
|
9272
9544
|
process.exit(1);
|
|
9273
9545
|
}
|
|
9274
9546
|
if (!isFirebaseLoggedIn()) {
|
|
9275
|
-
|
|
9547
|
+
log2.warn("Not logged into Firebase. Running firebase login...");
|
|
9276
9548
|
const result = spawnSync("firebase login", {
|
|
9277
9549
|
stdio: "inherit",
|
|
9278
9550
|
shell: true
|
|
9279
9551
|
});
|
|
9280
9552
|
if (result.status !== 0) {
|
|
9281
|
-
|
|
9553
|
+
log2.error("Firebase login failed.");
|
|
9282
9554
|
process.exit(1);
|
|
9283
9555
|
}
|
|
9284
9556
|
}
|
|
9285
9557
|
}
|
|
9286
9558
|
async function selectOrCreateProject() {
|
|
9287
|
-
const s =
|
|
9559
|
+
const s = spinner();
|
|
9288
9560
|
s.start("Fetching Firebase projects...");
|
|
9289
9561
|
const data = firebaseJson(["projects:list"]);
|
|
9290
9562
|
if (data.status !== "success" || !Array.isArray(data.result) || !data.result.length) {
|
|
@@ -9296,9 +9568,9 @@ async function selectOrCreateProject() {
|
|
|
9296
9568
|
if (!createNew) process.exit(0);
|
|
9297
9569
|
return await createProject();
|
|
9298
9570
|
}
|
|
9299
|
-
const projects = (Array.isArray(data.result) ? data.result : []).map((
|
|
9300
|
-
if (
|
|
9301
|
-
const project =
|
|
9571
|
+
const projects = (Array.isArray(data.result) ? data.result : []).map((p) => {
|
|
9572
|
+
if (p && typeof p === "object" && "projectId" in p) {
|
|
9573
|
+
const project = p;
|
|
9302
9574
|
return {
|
|
9303
9575
|
projectId: project.projectId,
|
|
9304
9576
|
displayName: project.displayName || project.projectId
|
|
@@ -9308,9 +9580,9 @@ async function selectOrCreateProject() {
|
|
|
9308
9580
|
});
|
|
9309
9581
|
s.stop(`Found ${projects.length} project(s).`);
|
|
9310
9582
|
const choices = [
|
|
9311
|
-
...projects.map((
|
|
9312
|
-
title: `${
|
|
9313
|
-
value:
|
|
9583
|
+
...projects.map((p) => ({
|
|
9584
|
+
title: `${p.displayName} (${p.projectId})`,
|
|
9585
|
+
value: p.projectId
|
|
9314
9586
|
})),
|
|
9315
9587
|
{ title: "+ Create new project", value: "__create__" }
|
|
9316
9588
|
];
|
|
@@ -9318,7 +9590,7 @@ async function selectOrCreateProject() {
|
|
|
9318
9590
|
if (selected === "__create__") {
|
|
9319
9591
|
return await createProject();
|
|
9320
9592
|
}
|
|
9321
|
-
return projects.find((
|
|
9593
|
+
return projects.find((p) => p.projectId === selected);
|
|
9322
9594
|
}
|
|
9323
9595
|
async function createProject() {
|
|
9324
9596
|
const projectId = await askForInput(
|
|
@@ -9326,7 +9598,7 @@ async function createProject() {
|
|
|
9326
9598
|
""
|
|
9327
9599
|
);
|
|
9328
9600
|
const displayName = await askForInput("Display name", projectId);
|
|
9329
|
-
const s =
|
|
9601
|
+
const s = spinner();
|
|
9330
9602
|
s.start(`Creating Firebase project "${projectId}"...`);
|
|
9331
9603
|
try {
|
|
9332
9604
|
const data = firebaseJson([
|
|
@@ -9337,19 +9609,19 @@ async function createProject() {
|
|
|
9337
9609
|
]);
|
|
9338
9610
|
if (data.status !== "success") {
|
|
9339
9611
|
s.stop("Failed to create project.");
|
|
9340
|
-
|
|
9612
|
+
log2.error(data.error || "Unknown error");
|
|
9341
9613
|
process.exit(1);
|
|
9342
9614
|
}
|
|
9343
9615
|
s.stop(`Project "${projectId}" created.`);
|
|
9344
9616
|
} catch (err) {
|
|
9345
9617
|
s.stop("Failed to create project.");
|
|
9346
|
-
|
|
9618
|
+
log2.error(getErrorMessage(err));
|
|
9347
9619
|
process.exit(1);
|
|
9348
9620
|
}
|
|
9349
9621
|
return { projectId, displayName };
|
|
9350
9622
|
}
|
|
9351
9623
|
async function ensureWebApp(projectId) {
|
|
9352
|
-
const s =
|
|
9624
|
+
const s = spinner();
|
|
9353
9625
|
s.start("Getting web app config...");
|
|
9354
9626
|
try {
|
|
9355
9627
|
const data = firebaseJson([
|
|
@@ -9373,12 +9645,12 @@ async function ensureWebApp(projectId) {
|
|
|
9373
9645
|
projectId
|
|
9374
9646
|
]);
|
|
9375
9647
|
if (createResult.status !== "success") {
|
|
9376
|
-
|
|
9648
|
+
log2.error(
|
|
9377
9649
|
"Failed to create web app: " + (createResult.error || "Unknown error")
|
|
9378
9650
|
);
|
|
9379
9651
|
process.exit(1);
|
|
9380
9652
|
}
|
|
9381
|
-
const s2 =
|
|
9653
|
+
const s2 = spinner();
|
|
9382
9654
|
s2.start("Retrieving SDK config...");
|
|
9383
9655
|
await new Promise((resolve4) => setTimeout(resolve4, 2e3));
|
|
9384
9656
|
const configData = firebaseJson([
|
|
@@ -9389,7 +9661,7 @@ async function ensureWebApp(projectId) {
|
|
|
9389
9661
|
]);
|
|
9390
9662
|
if (configData.status !== "success" || !configData.result || typeof configData.result !== "object" || !("sdkConfig" in configData.result)) {
|
|
9391
9663
|
s2.stop("Failed to retrieve SDK config.");
|
|
9392
|
-
|
|
9664
|
+
log2.error(
|
|
9393
9665
|
"Could not get SDK config. Try running this command again in a minute."
|
|
9394
9666
|
);
|
|
9395
9667
|
process.exit(1);
|
|
@@ -9441,13 +9713,13 @@ function writeEnvFile(appDir, config, framework) {
|
|
|
9441
9713
|
`${prefix}FIREBASE_FUNCTIONS_REGION=europe-west1`
|
|
9442
9714
|
];
|
|
9443
9715
|
const content = [
|
|
9444
|
-
...preserved.filter((
|
|
9716
|
+
...preserved.filter((l2) => l2.trim() !== ""),
|
|
9445
9717
|
"",
|
|
9446
9718
|
...firebaseBlock,
|
|
9447
9719
|
""
|
|
9448
9720
|
].join("\n");
|
|
9449
9721
|
write(envPath, content);
|
|
9450
|
-
|
|
9722
|
+
log2.success(`Written Firebase config to ${envPath}`);
|
|
9451
9723
|
}
|
|
9452
9724
|
function updateFirebaserc(projectRoot, projectId) {
|
|
9453
9725
|
const rcPath = joinPath(projectRoot, ".firebaserc");
|
|
@@ -9467,7 +9739,7 @@ function updateFirebaserc(projectRoot, projectId) {
|
|
|
9467
9739
|
if (!rc.projects) rc.projects = {};
|
|
9468
9740
|
rc.projects.default = projectId;
|
|
9469
9741
|
write(rcPath, JSON.stringify(rc, null, 2) + "\n");
|
|
9470
|
-
|
|
9742
|
+
log2.success(`Updated .firebaserc with project "${projectId}"`);
|
|
9471
9743
|
}
|
|
9472
9744
|
function updateFirebaseJson(projectRoot, projectId) {
|
|
9473
9745
|
const fjPath = joinPath(projectRoot, "firebase.json");
|
|
@@ -9477,11 +9749,11 @@ function updateFirebaseJson(projectRoot, projectId) {
|
|
|
9477
9749
|
content = content.replace(/\{\{YOUR_FIREBASE_PROJECT_ID\}\}/g, projectId);
|
|
9478
9750
|
content = content.replace(/\{\{firebaseProjectId\}\}/g, projectId);
|
|
9479
9751
|
write(fjPath, content);
|
|
9480
|
-
|
|
9752
|
+
log2.success("Updated firebase.json with project ID");
|
|
9481
9753
|
}
|
|
9482
9754
|
}
|
|
9483
9755
|
async function main(options = {}) {
|
|
9484
|
-
|
|
9756
|
+
intro("Firebase Setup");
|
|
9485
9757
|
await checkPrerequisites();
|
|
9486
9758
|
const projectRoot = process.cwd();
|
|
9487
9759
|
let appDir = projectRoot;
|
|
@@ -9498,12 +9770,12 @@ async function main(options = {}) {
|
|
|
9498
9770
|
}
|
|
9499
9771
|
}
|
|
9500
9772
|
const project = await selectOrCreateProject();
|
|
9501
|
-
|
|
9773
|
+
log2.info(`Using Firebase project: ${project.projectId}`);
|
|
9502
9774
|
const sdkConfig = await ensureWebApp(project.projectId);
|
|
9503
9775
|
writeEnvFile(appDir, sdkConfig, framework);
|
|
9504
9776
|
updateFirebaserc(projectRoot, project.projectId);
|
|
9505
9777
|
updateFirebaseJson(projectRoot, project.projectId);
|
|
9506
|
-
|
|
9778
|
+
note(
|
|
9507
9779
|
[
|
|
9508
9780
|
`Go to the Firebase Console:`,
|
|
9509
9781
|
`https://console.firebase.google.com/project/${project.projectId}/settings/serviceaccounts/adminsdk`,
|
|
@@ -9516,7 +9788,7 @@ async function main(options = {}) {
|
|
|
9516
9788
|
].join("\n"),
|
|
9517
9789
|
"Download Service Account Key"
|
|
9518
9790
|
);
|
|
9519
|
-
|
|
9791
|
+
note(
|
|
9520
9792
|
[
|
|
9521
9793
|
`Enable these services in the Firebase Console:`,
|
|
9522
9794
|
``,
|
|
@@ -9534,7 +9806,7 @@ async function main(options = {}) {
|
|
|
9534
9806
|
].join("\n"),
|
|
9535
9807
|
"Enable Firebase Services"
|
|
9536
9808
|
);
|
|
9537
|
-
|
|
9809
|
+
note(
|
|
9538
9810
|
[
|
|
9539
9811
|
`Project: ${project.projectId}`,
|
|
9540
9812
|
`App .env: ${appDir}/.env (Firebase config written)`,
|
|
@@ -9550,7 +9822,7 @@ async function main(options = {}) {
|
|
|
9550
9822
|
].join("\n"),
|
|
9551
9823
|
"Setup Complete"
|
|
9552
9824
|
);
|
|
9553
|
-
|
|
9825
|
+
outro(
|
|
9554
9826
|
"Firebase setup done. Complete the manual steps above, then run dndev emu start."
|
|
9555
9827
|
);
|
|
9556
9828
|
}
|
|
@@ -9595,7 +9867,7 @@ var init_firebase = __esm({
|
|
|
9595
9867
|
try {
|
|
9596
9868
|
const project = await selectOrCreateProject();
|
|
9597
9869
|
projectId = project.projectId;
|
|
9598
|
-
|
|
9870
|
+
log2.info(`Using Firebase project: ${projectId}`);
|
|
9599
9871
|
steps.push({
|
|
9600
9872
|
name: "Project selection",
|
|
9601
9873
|
status: "success",
|
|
@@ -9669,7 +9941,7 @@ var init_firebase = __esm({
|
|
|
9669
9941
|
message: getErrorMessage(err)
|
|
9670
9942
|
});
|
|
9671
9943
|
}
|
|
9672
|
-
|
|
9944
|
+
note(
|
|
9673
9945
|
[
|
|
9674
9946
|
`Go to the Firebase Console:`,
|
|
9675
9947
|
`https://console.firebase.google.com/project/${projectId}/settings/serviceaccounts/adminsdk`,
|
|
@@ -9688,7 +9960,7 @@ var init_firebase = __esm({
|
|
|
9688
9960
|
message: "Download from Firebase Console",
|
|
9689
9961
|
coachingTopic: "firebase-service-account"
|
|
9690
9962
|
});
|
|
9691
|
-
|
|
9963
|
+
note(
|
|
9692
9964
|
[
|
|
9693
9965
|
`Enable these services in the Firebase Console:`,
|
|
9694
9966
|
``,
|
|
@@ -9746,7 +10018,7 @@ async function cleanupOldEntityMigrations(supabaseDir, latestFile) {
|
|
|
9746
10018
|
} catch {
|
|
9747
10019
|
}
|
|
9748
10020
|
}
|
|
9749
|
-
|
|
10021
|
+
log2.info(`Cleaned up ${toRemove.length} old entity migration file(s)`);
|
|
9750
10022
|
}
|
|
9751
10023
|
async function executeMigration(options) {
|
|
9752
10024
|
const { supabaseDir, supabaseUrl, accessToken } = options;
|
|
@@ -9757,7 +10029,7 @@ async function executeMigration(options) {
|
|
|
9757
10029
|
if (!pathExists(migrationsDir)) {
|
|
9758
10030
|
throw new Error(`Migrations directory not found: ${migrationsDir}`);
|
|
9759
10031
|
}
|
|
9760
|
-
const sqlFiles =
|
|
10032
|
+
const sqlFiles = readdirSync3(migrationsDir).filter((f) => f.endsWith(".sql")).sort().map((f) => joinPath(migrationsDir, f));
|
|
9761
10033
|
if (sqlFiles.length === 0) {
|
|
9762
10034
|
throw new Error(`No .sql files found in ${migrationsDir}`);
|
|
9763
10035
|
}
|
|
@@ -9780,7 +10052,7 @@ async function executeMigration(options) {
|
|
|
9780
10052
|
Ensure SUPABASE_ACCESS_TOKEN is valid. Get one from: https://supabase.com/dashboard/account/tokens`
|
|
9781
10053
|
);
|
|
9782
10054
|
}
|
|
9783
|
-
|
|
10055
|
+
log2.info("Migrations executed via Supabase Management API");
|
|
9784
10056
|
}
|
|
9785
10057
|
var init_supabase_management = __esm({
|
|
9786
10058
|
"packages/tooling/src/utils/supabase-management.ts"() {
|
|
@@ -9848,7 +10120,7 @@ var init_base_generator = __esm({
|
|
|
9848
10120
|
* @author AMBROISE PARK Consulting
|
|
9849
10121
|
*/
|
|
9850
10122
|
async run() {
|
|
9851
|
-
|
|
10123
|
+
note(`Running ${this.name} Generator`);
|
|
9852
10124
|
const result = {
|
|
9853
10125
|
filesGenerated: 0,
|
|
9854
10126
|
filesSkipped: 0,
|
|
@@ -9860,20 +10132,20 @@ var init_base_generator = __esm({
|
|
|
9860
10132
|
try {
|
|
9861
10133
|
await this.setup(result);
|
|
9862
10134
|
const entityFiles = await this.findEntityFiles();
|
|
9863
|
-
|
|
10135
|
+
log2.info("Parsing entities...");
|
|
9864
10136
|
const foundEntities = [];
|
|
9865
10137
|
for (const entityFile of entityFiles) {
|
|
9866
10138
|
try {
|
|
9867
10139
|
const entityName = await this.processEntityFile(entityFile, result);
|
|
9868
10140
|
if (entityName) foundEntities.push(entityName);
|
|
9869
10141
|
} catch (err) {
|
|
9870
|
-
|
|
10142
|
+
log2.error(`Error processing entity file ${entityFile}:`, err);
|
|
9871
10143
|
result.messages?.push(
|
|
9872
10144
|
`Error processing entity file ${entityFile}: ${err instanceof Error ? err.message : String(err)}`
|
|
9873
10145
|
);
|
|
9874
10146
|
}
|
|
9875
10147
|
}
|
|
9876
|
-
|
|
10148
|
+
log2.info(
|
|
9877
10149
|
`Found ${foundEntities.length} entities: ${foundEntities.join(", ")}`
|
|
9878
10150
|
);
|
|
9879
10151
|
await this.generateAdditionalFiles(result);
|
|
@@ -9882,7 +10154,7 @@ var init_base_generator = __esm({
|
|
|
9882
10154
|
result.success = true;
|
|
9883
10155
|
return result;
|
|
9884
10156
|
} catch (err) {
|
|
9885
|
-
|
|
10157
|
+
log2.error(`Failed to run ${this.name} generator:`, err);
|
|
9886
10158
|
result.messages?.push(
|
|
9887
10159
|
`Failed to run generator: ${err instanceof Error ? err.message : String(err)}`
|
|
9888
10160
|
);
|
|
@@ -9926,7 +10198,7 @@ var init_base_generator = __esm({
|
|
|
9926
10198
|
const allFiles = [];
|
|
9927
10199
|
for (const dir of this.entityDirs) {
|
|
9928
10200
|
if (!pathExists(dir)) {
|
|
9929
|
-
|
|
10201
|
+
log2.warn(`Entity directory does not exist: ${dir}`);
|
|
9930
10202
|
continue;
|
|
9931
10203
|
}
|
|
9932
10204
|
try {
|
|
@@ -9937,7 +10209,7 @@ var init_base_generator = __esm({
|
|
|
9937
10209
|
});
|
|
9938
10210
|
allFiles.push(...filteredFiles);
|
|
9939
10211
|
} catch (err) {
|
|
9940
|
-
|
|
10212
|
+
log2.warn(`Could not find files in ${dir}:`, err);
|
|
9941
10213
|
}
|
|
9942
10214
|
}
|
|
9943
10215
|
return allFiles;
|
|
@@ -9971,14 +10243,14 @@ var init_base_generator = __esm({
|
|
|
9971
10243
|
const fileExists = pathExists(normalizedPath);
|
|
9972
10244
|
if (fileExists && !this.overwrite) {
|
|
9973
10245
|
if (this.verbose) {
|
|
9974
|
-
|
|
10246
|
+
log2.info(`Skipping existing file: ${normalizedPath}`);
|
|
9975
10247
|
}
|
|
9976
10248
|
result.filesSkipped++;
|
|
9977
10249
|
result.skippedFiles.push(normalizedPath);
|
|
9978
10250
|
return false;
|
|
9979
10251
|
}
|
|
9980
10252
|
if (this.dryRun) {
|
|
9981
|
-
|
|
10253
|
+
log2.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
9982
10254
|
result.filesGenerated++;
|
|
9983
10255
|
result.generatedFiles.push(normalizedPath);
|
|
9984
10256
|
return true;
|
|
@@ -9994,7 +10266,7 @@ var init_base_generator = __esm({
|
|
|
9994
10266
|
);
|
|
9995
10267
|
if (writeResult) {
|
|
9996
10268
|
if (this.verbose) {
|
|
9997
|
-
|
|
10269
|
+
log2.info(
|
|
9998
10270
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
9999
10271
|
);
|
|
10000
10272
|
}
|
|
@@ -10053,7 +10325,7 @@ var init_base_generator = __esm({
|
|
|
10053
10325
|
);
|
|
10054
10326
|
}
|
|
10055
10327
|
try {
|
|
10056
|
-
return templateContent.replace(/\$\{([^}]+)\}/g, (
|
|
10328
|
+
return templateContent.replace(/\$\{([^}]+)\}/g, (_, key) => {
|
|
10057
10329
|
try {
|
|
10058
10330
|
const value = new Function(
|
|
10059
10331
|
...Object.keys(mergedContext),
|
|
@@ -10109,14 +10381,14 @@ var init_base_generator = __esm({
|
|
|
10109
10381
|
const fileExists = pathExists(normalizedOutputPath);
|
|
10110
10382
|
if (fileExists && !this.overwrite) {
|
|
10111
10383
|
if (this.verbose) {
|
|
10112
|
-
|
|
10384
|
+
log2.info(`Skipping existing file: ${normalizedOutputPath}`);
|
|
10113
10385
|
}
|
|
10114
10386
|
result.filesSkipped++;
|
|
10115
10387
|
result.skippedFiles.push(normalizedOutputPath);
|
|
10116
10388
|
return false;
|
|
10117
10389
|
}
|
|
10118
10390
|
if (this.dryRun) {
|
|
10119
|
-
|
|
10391
|
+
log2.info(`[DRY RUN] Would copy file: ${normalizedOutputPath}`);
|
|
10120
10392
|
result.filesGenerated++;
|
|
10121
10393
|
result.generatedFiles.push(normalizedOutputPath);
|
|
10122
10394
|
return true;
|
|
@@ -10132,7 +10404,7 @@ var init_base_generator = __esm({
|
|
|
10132
10404
|
);
|
|
10133
10405
|
if (copyResult) {
|
|
10134
10406
|
if (this.verbose) {
|
|
10135
|
-
|
|
10407
|
+
log2.info(
|
|
10136
10408
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedOutputPath}`
|
|
10137
10409
|
);
|
|
10138
10410
|
}
|
|
@@ -10182,7 +10454,7 @@ var init_base_generator = __esm({
|
|
|
10182
10454
|
dot: true
|
|
10183
10455
|
});
|
|
10184
10456
|
if (files.length === 0) {
|
|
10185
|
-
|
|
10457
|
+
log2.warn(`No files found in template directory: ${templateDirPath}`);
|
|
10186
10458
|
return false;
|
|
10187
10459
|
}
|
|
10188
10460
|
let anyFilesCopied = false;
|
|
@@ -10210,7 +10482,7 @@ var init_base_generator = __esm({
|
|
|
10210
10482
|
const written = await this.writeFile(outputFilePath, content, result);
|
|
10211
10483
|
anyFilesCopied = anyFilesCopied || written;
|
|
10212
10484
|
} catch (err) {
|
|
10213
|
-
|
|
10485
|
+
log2.warn(`Error rendering template file ${file}:`, err);
|
|
10214
10486
|
const copied = await this.copyTemplateFile(
|
|
10215
10487
|
joinPath(templateDirPath, file),
|
|
10216
10488
|
outputFilePath,
|
|
@@ -10238,13 +10510,13 @@ var init_base_generator = __esm({
|
|
|
10238
10510
|
const buffer = Buffer.alloc(4096);
|
|
10239
10511
|
await fd.read(buffer, 0, 4096, 0);
|
|
10240
10512
|
await fd.close();
|
|
10241
|
-
for (let
|
|
10242
|
-
if (buffer[
|
|
10513
|
+
for (let i2 = 0; i2 < buffer.length; i2++) {
|
|
10514
|
+
if (buffer[i2] === 0) {
|
|
10243
10515
|
return true;
|
|
10244
10516
|
}
|
|
10245
10517
|
}
|
|
10246
|
-
for (let
|
|
10247
|
-
const byte = buffer[
|
|
10518
|
+
for (let i2 = 0; i2 < buffer.length; i2++) {
|
|
10519
|
+
const byte = buffer[i2];
|
|
10248
10520
|
if (byte !== void 0 && (byte < 9 || byte > 13 && byte < 32 && byte !== 27)) {
|
|
10249
10521
|
return true;
|
|
10250
10522
|
}
|
|
@@ -10348,28 +10620,28 @@ var init_base_generator = __esm({
|
|
|
10348
10620
|
* @author AMBROISE PARK Consulting
|
|
10349
10621
|
*/
|
|
10350
10622
|
logSummary(result) {
|
|
10351
|
-
|
|
10623
|
+
note(`${this.name} Generator Summary`);
|
|
10352
10624
|
if (this.dryRun) {
|
|
10353
|
-
|
|
10625
|
+
log2.info("DRY RUN - No files were actually written");
|
|
10354
10626
|
}
|
|
10355
|
-
|
|
10356
|
-
|
|
10627
|
+
log2.info(`Generated ${result.filesGenerated} files`);
|
|
10628
|
+
log2.info(`Skipped ${result.filesSkipped} files`);
|
|
10357
10629
|
if (this.verbose && result.generatedFiles.length > 0) {
|
|
10358
|
-
|
|
10630
|
+
log2.info("Generated files:");
|
|
10359
10631
|
result.generatedFiles.forEach((file) => {
|
|
10360
|
-
|
|
10632
|
+
log2.info(` - ${file}`);
|
|
10361
10633
|
});
|
|
10362
10634
|
}
|
|
10363
10635
|
if (this.verbose && result.skippedFiles.length > 0) {
|
|
10364
|
-
|
|
10636
|
+
log2.info("Skipped files:");
|
|
10365
10637
|
result.skippedFiles.forEach((file) => {
|
|
10366
|
-
|
|
10638
|
+
log2.info(` - ${file}`);
|
|
10367
10639
|
});
|
|
10368
10640
|
}
|
|
10369
10641
|
if (result.messages && result.messages.length > 0) {
|
|
10370
|
-
|
|
10642
|
+
log2.info("Messages:");
|
|
10371
10643
|
result.messages.forEach((message) => {
|
|
10372
|
-
|
|
10644
|
+
log2.info(` - ${message}`);
|
|
10373
10645
|
});
|
|
10374
10646
|
}
|
|
10375
10647
|
}
|
|
@@ -10394,7 +10666,7 @@ function roleToSqlCondition(role) {
|
|
|
10394
10666
|
case "super":
|
|
10395
10667
|
return "(auth.jwt()->'app_metadata'->>'role') = 'super'";
|
|
10396
10668
|
default:
|
|
10397
|
-
|
|
10669
|
+
log2.warn(
|
|
10398
10670
|
`Unknown access role "${role}" \u2014 defaulting to deny (false). Use guest|user|admin|super.`
|
|
10399
10671
|
);
|
|
10400
10672
|
return "false";
|
|
@@ -10453,7 +10725,7 @@ async function main2() {
|
|
|
10453
10725
|
const result = await generator.run();
|
|
10454
10726
|
if (!result.success) process.exit(1);
|
|
10455
10727
|
} catch (err) {
|
|
10456
|
-
|
|
10728
|
+
log2.error("SQL generator failed:", err);
|
|
10457
10729
|
process.exit(1);
|
|
10458
10730
|
}
|
|
10459
10731
|
}
|
|
@@ -10548,7 +10820,7 @@ var init_sql_generator = __esm({
|
|
|
10548
10820
|
try {
|
|
10549
10821
|
entityModule = await this.importModule(entityFilePath);
|
|
10550
10822
|
} catch (err) {
|
|
10551
|
-
|
|
10823
|
+
log2.error(`Failed to import entity from ${entityFilePath}:`, err);
|
|
10552
10824
|
return null;
|
|
10553
10825
|
}
|
|
10554
10826
|
const entity = this.extractEntityFromModule(entityModule, entityFileName);
|
|
@@ -10564,7 +10836,7 @@ var init_sql_generator = __esm({
|
|
|
10564
10836
|
extractEntityFromModule(entityModule, fileName) {
|
|
10565
10837
|
const expectedName = fileName + "Entity";
|
|
10566
10838
|
if (entityModule[expectedName]) return entityModule[expectedName];
|
|
10567
|
-
const entityName = fileName.replace(/[-_](\w)/g, (
|
|
10839
|
+
const entityName = fileName.replace(/[-_](\w)/g, (_, c2) => c2.toUpperCase()).replace(/^\w/, (c2) => c2.toUpperCase());
|
|
10568
10840
|
if (entityModule[entityName]) return entityModule[entityName];
|
|
10569
10841
|
for (const key of Object.keys(entityModule)) {
|
|
10570
10842
|
const potential = entityModule[key];
|
|
@@ -10789,17 +11061,17 @@ ${triggerSql}
|
|
|
10789
11061
|
parts.push(auditFunc);
|
|
10790
11062
|
for (const { entity } of entities) {
|
|
10791
11063
|
const tn = entity.collection;
|
|
10792
|
-
const
|
|
11064
|
+
const q = this.safeTableName(tn);
|
|
10793
11065
|
parts.push(`
|
|
10794
|
-
DROP TRIGGER IF EXISTS ${tn}_updated_at ON ${
|
|
11066
|
+
DROP TRIGGER IF EXISTS ${tn}_updated_at ON ${q};
|
|
10795
11067
|
CREATE TRIGGER ${tn}_updated_at
|
|
10796
|
-
BEFORE UPDATE ON ${
|
|
11068
|
+
BEFORE UPDATE ON ${q}
|
|
10797
11069
|
FOR EACH ROW
|
|
10798
11070
|
EXECUTE PROCEDURE set_updated_at();
|
|
10799
11071
|
|
|
10800
|
-
DROP TRIGGER IF EXISTS ${tn}_audit ON ${
|
|
11072
|
+
DROP TRIGGER IF EXISTS ${tn}_audit ON ${q};
|
|
10801
11073
|
CREATE TRIGGER ${tn}_audit
|
|
10802
|
-
BEFORE INSERT OR UPDATE ON ${
|
|
11074
|
+
BEFORE INSERT OR UPDATE ON ${q}
|
|
10803
11075
|
FOR EACH ROW
|
|
10804
11076
|
EXECUTE PROCEDURE set_audit_fields();
|
|
10805
11077
|
`);
|
|
@@ -10816,7 +11088,7 @@ CREATE TRIGGER ${tn}_audit
|
|
|
10816
11088
|
};
|
|
10817
11089
|
if (import.meta.url === `file://${normalizePath(process.argv[1] || "")}`) {
|
|
10818
11090
|
main2().catch((err) => {
|
|
10819
|
-
|
|
11091
|
+
log2.error("Unhandled error:", err);
|
|
10820
11092
|
process.exit(1);
|
|
10821
11093
|
});
|
|
10822
11094
|
}
|
|
@@ -10872,13 +11144,13 @@ function writeEnvFile2(appDir, supabaseUrl, supabasePublicKey, framework) {
|
|
|
10872
11144
|
`${prefix}${keyVar}=${supabasePublicKey}`
|
|
10873
11145
|
];
|
|
10874
11146
|
const content = [
|
|
10875
|
-
...preserved.filter((
|
|
11147
|
+
...preserved.filter((l2) => l2.trim() !== ""),
|
|
10876
11148
|
"",
|
|
10877
11149
|
...supabaseBlock,
|
|
10878
11150
|
""
|
|
10879
11151
|
].join("\n");
|
|
10880
11152
|
writeSync(envPath, content);
|
|
10881
|
-
|
|
11153
|
+
log2.success(`Written Supabase config to ${envPath}`);
|
|
10882
11154
|
}
|
|
10883
11155
|
function isValidSupabaseUrl(url) {
|
|
10884
11156
|
try {
|
|
@@ -10970,16 +11242,16 @@ async function generateCrudFunction(supabaseDir, projectRoot) {
|
|
|
10970
11242
|
`import * as entities from '${relativePath}';`
|
|
10971
11243
|
);
|
|
10972
11244
|
} else {
|
|
10973
|
-
|
|
11245
|
+
log2.warn(
|
|
10974
11246
|
"Entities directory not found. CRUD function will need manual entity import."
|
|
10975
11247
|
);
|
|
10976
11248
|
}
|
|
10977
11249
|
const crudFunctionPath = joinPath(crudDir, "index.ts");
|
|
10978
11250
|
write(crudFunctionPath, templateContent);
|
|
10979
|
-
|
|
11251
|
+
log2.success(`Generated CRUD Edge Function: ${crudFunctionPath}`);
|
|
10980
11252
|
}
|
|
10981
11253
|
async function main3(options = {}) {
|
|
10982
|
-
|
|
11254
|
+
intro("Supabase Setup");
|
|
10983
11255
|
const projectRoot = process.cwd();
|
|
10984
11256
|
let appDir = projectRoot;
|
|
10985
11257
|
let framework = "vite";
|
|
@@ -10999,8 +11271,8 @@ async function main3(options = {}) {
|
|
|
10999
11271
|
if (!existingConfig) {
|
|
11000
11272
|
const prefix = framework === "nextjs" ? "NEXT_PUBLIC_" : "VITE_";
|
|
11001
11273
|
const envPath = joinPath(appDir, ".env");
|
|
11002
|
-
|
|
11003
|
-
|
|
11274
|
+
log2.error("Missing Supabase credentials.");
|
|
11275
|
+
note(
|
|
11004
11276
|
[
|
|
11005
11277
|
`Fill in ${envPath}:`,
|
|
11006
11278
|
` ${prefix}SUPABASE_URL=https://your-project.supabase.co`,
|
|
@@ -11012,17 +11284,17 @@ async function main3(options = {}) {
|
|
|
11012
11284
|
].join("\n"),
|
|
11013
11285
|
"Missing Public Credentials"
|
|
11014
11286
|
);
|
|
11015
|
-
|
|
11287
|
+
outro("Setup aborted.");
|
|
11016
11288
|
return;
|
|
11017
11289
|
}
|
|
11018
11290
|
const supabaseUrl = existingConfig.url;
|
|
11019
|
-
|
|
11291
|
+
log2.success(`Supabase URL: ${supabaseUrl}`);
|
|
11020
11292
|
const secretKey = detectSecretKey(appDir);
|
|
11021
11293
|
const accessToken = resolveSecret("SUPABASE_ACCESS_TOKEN", projectRoot, { appDir })?.value ?? null;
|
|
11022
|
-
if (secretKey)
|
|
11023
|
-
else
|
|
11024
|
-
if (accessToken)
|
|
11025
|
-
else
|
|
11294
|
+
if (secretKey) log2.success("Secret key detected");
|
|
11295
|
+
else log2.error("Missing SUPABASE_SECRET_KEY");
|
|
11296
|
+
if (accessToken) log2.success("Access token detected");
|
|
11297
|
+
else log2.error("Missing SUPABASE_ACCESS_TOKEN");
|
|
11026
11298
|
if (!secretKey || !accessToken) {
|
|
11027
11299
|
const missing = [];
|
|
11028
11300
|
if (!secretKey) missing.push(" SUPABASE_SECRET_KEY=your-service-role-key");
|
|
@@ -11030,7 +11302,7 @@ async function main3(options = {}) {
|
|
|
11030
11302
|
missing.push(
|
|
11031
11303
|
" SUPABASE_ACCESS_TOKEN=sbp_... (from https://supabase.com/dashboard/account/tokens)"
|
|
11032
11304
|
);
|
|
11033
|
-
|
|
11305
|
+
note(
|
|
11034
11306
|
[
|
|
11035
11307
|
"Fill in .dndev.secrets at project root:",
|
|
11036
11308
|
...missing,
|
|
@@ -11039,7 +11311,7 @@ async function main3(options = {}) {
|
|
|
11039
11311
|
].join("\n"),
|
|
11040
11312
|
"Missing Credentials"
|
|
11041
11313
|
);
|
|
11042
|
-
|
|
11314
|
+
outro("Setup aborted.");
|
|
11043
11315
|
return;
|
|
11044
11316
|
}
|
|
11045
11317
|
const entitiesDir = joinPath(projectRoot, "entities");
|
|
@@ -11060,34 +11332,34 @@ async function main3(options = {}) {
|
|
|
11060
11332
|
outputDir: joinPath(supabaseDir, "migrations"),
|
|
11061
11333
|
singleFile: true
|
|
11062
11334
|
});
|
|
11063
|
-
const s =
|
|
11335
|
+
const s = spinner();
|
|
11064
11336
|
s.start("Generating SQL migrations from entities...");
|
|
11065
11337
|
const result = await generator.run();
|
|
11066
11338
|
if (result.success) {
|
|
11067
11339
|
s.stop("SQL migrations generated successfully");
|
|
11068
|
-
|
|
11340
|
+
log2.success(`Generated ${result.filesGenerated} migration file(s)`);
|
|
11069
11341
|
sqlGenerated = true;
|
|
11070
11342
|
generatedEntityFile = result.generatedFiles[0] ?? null;
|
|
11071
11343
|
for (const f of result.generatedFiles) {
|
|
11072
|
-
|
|
11344
|
+
log2.info(` \u2192 ${f}`);
|
|
11073
11345
|
}
|
|
11074
11346
|
} else {
|
|
11075
11347
|
s.stop("Failed to generate SQL migrations");
|
|
11076
11348
|
}
|
|
11077
11349
|
} catch (error2) {
|
|
11078
|
-
|
|
11350
|
+
log2.error(
|
|
11079
11351
|
`SQL generation failed: ${error2 instanceof Error ? error2.message : String(error2)}`
|
|
11080
11352
|
);
|
|
11081
11353
|
}
|
|
11082
11354
|
}
|
|
11083
11355
|
} else {
|
|
11084
|
-
|
|
11356
|
+
log2.info("No entities directory found. Skipping SQL generation.");
|
|
11085
11357
|
}
|
|
11086
11358
|
if (sqlGenerated && generatedEntityFile) {
|
|
11087
11359
|
try {
|
|
11088
11360
|
await cleanupOldEntityMigrations(supabaseDir, generatedEntityFile);
|
|
11089
11361
|
} catch (error2) {
|
|
11090
|
-
|
|
11362
|
+
log2.warn(
|
|
11091
11363
|
`Could not clean old entity migrations: ${error2 instanceof Error ? error2.message : String(error2)}`
|
|
11092
11364
|
);
|
|
11093
11365
|
}
|
|
@@ -11098,7 +11370,7 @@ async function main3(options = {}) {
|
|
|
11098
11370
|
true
|
|
11099
11371
|
);
|
|
11100
11372
|
if (shouldPush) {
|
|
11101
|
-
const s =
|
|
11373
|
+
const s = spinner();
|
|
11102
11374
|
s.start("Pushing migrations...");
|
|
11103
11375
|
try {
|
|
11104
11376
|
await executeMigration({ supabaseDir, supabaseUrl, accessToken });
|
|
@@ -11106,14 +11378,14 @@ async function main3(options = {}) {
|
|
|
11106
11378
|
migrationsPushed = true;
|
|
11107
11379
|
} catch (error2) {
|
|
11108
11380
|
s.stop("Failed to push migrations");
|
|
11109
|
-
|
|
11110
|
-
|
|
11381
|
+
log2.error(`${error2 instanceof Error ? error2.message : String(error2)}`);
|
|
11382
|
+
log2.info("Apply manually via the Supabase Dashboard SQL Editor.");
|
|
11111
11383
|
}
|
|
11112
11384
|
}
|
|
11113
11385
|
try {
|
|
11114
11386
|
await generateCrudFunction(supabaseDir, projectRoot);
|
|
11115
11387
|
} catch (error2) {
|
|
11116
|
-
|
|
11388
|
+
log2.warn(
|
|
11117
11389
|
`Could not patch CRUD function: ${error2 instanceof Error ? error2.message : String(error2)}`
|
|
11118
11390
|
);
|
|
11119
11391
|
}
|
|
@@ -11129,7 +11401,7 @@ async function main3(options = {}) {
|
|
|
11129
11401
|
steps.push("\u274C Migration push failed (see error above)");
|
|
11130
11402
|
const hasErrors = steps.some((s) => s.startsWith("\u274C"));
|
|
11131
11403
|
const title = hasErrors ? "Setup Incomplete" : "Setup Complete";
|
|
11132
|
-
|
|
11404
|
+
note(
|
|
11133
11405
|
[
|
|
11134
11406
|
`Project URL: ${supabaseUrl}`,
|
|
11135
11407
|
"",
|
|
@@ -11143,7 +11415,7 @@ async function main3(options = {}) {
|
|
|
11143
11415
|
].join("\n"),
|
|
11144
11416
|
title
|
|
11145
11417
|
);
|
|
11146
|
-
|
|
11418
|
+
outro(
|
|
11147
11419
|
hasErrors ? "Setup incomplete \u2014 see errors above." : "Supabase setup done."
|
|
11148
11420
|
);
|
|
11149
11421
|
}
|
|
@@ -11211,7 +11483,7 @@ var init_supabase = __esm({
|
|
|
11211
11483
|
outputDir: joinPath(supabaseDir, "migrations"),
|
|
11212
11484
|
singleFile: true
|
|
11213
11485
|
});
|
|
11214
|
-
const s =
|
|
11486
|
+
const s = spinner();
|
|
11215
11487
|
s.start("Generating SQL from entities...");
|
|
11216
11488
|
const result = await generator.run();
|
|
11217
11489
|
if (result.success) {
|
|
@@ -11252,7 +11524,7 @@ var init_supabase = __esm({
|
|
|
11252
11524
|
}
|
|
11253
11525
|
const migrationsDir = joinPath(supabaseDir, "migrations");
|
|
11254
11526
|
if (pathExists(migrationsDir)) {
|
|
11255
|
-
const s =
|
|
11527
|
+
const s = spinner();
|
|
11256
11528
|
s.start("Pushing migrations...");
|
|
11257
11529
|
try {
|
|
11258
11530
|
await executeMigration({
|
|
@@ -11330,8 +11602,8 @@ var init_vercel = __esm({
|
|
|
11330
11602
|
for (const varName of result.missing) {
|
|
11331
11603
|
const target = varName === "VERCEL_TOKEN" ? ".dndev.secrets" : `apps/<app>/.env`;
|
|
11332
11604
|
const where = varName === "VERCEL_TOKEN" ? "https://vercel.com/account/tokens" : "Vercel Dashboard > Project > Settings > General";
|
|
11333
|
-
|
|
11334
|
-
|
|
11605
|
+
log2.error(`Missing ${varName} \u2014 add to ${target}`);
|
|
11606
|
+
log2.info(` Find it at: ${where}`);
|
|
11335
11607
|
steps.push({
|
|
11336
11608
|
name: varName,
|
|
11337
11609
|
status: "failed",
|
|
@@ -11352,7 +11624,7 @@ var init_vercel = __esm({
|
|
|
11352
11624
|
});
|
|
11353
11625
|
try {
|
|
11354
11626
|
const user = await validateToken(token);
|
|
11355
|
-
|
|
11627
|
+
log2.success(
|
|
11356
11628
|
`Token valid \u2014 logged in as ${user.username} (${user.email})`
|
|
11357
11629
|
);
|
|
11358
11630
|
steps.push({
|
|
@@ -11362,7 +11634,7 @@ var init_vercel = __esm({
|
|
|
11362
11634
|
});
|
|
11363
11635
|
} catch (err) {
|
|
11364
11636
|
const msg = err instanceof DoNotDevError ? err.message : "Token validation failed";
|
|
11365
|
-
|
|
11637
|
+
log2.error(msg);
|
|
11366
11638
|
steps.push({
|
|
11367
11639
|
name: "Token validation",
|
|
11368
11640
|
status: "failed",
|
|
@@ -11378,9 +11650,9 @@ var init_vercel = __esm({
|
|
|
11378
11650
|
const account = await detectAccountType(token);
|
|
11379
11651
|
if (account.hasTeams) {
|
|
11380
11652
|
const teamNames = account.teams.map((t2) => t2.name).join(", ");
|
|
11381
|
-
|
|
11653
|
+
log2.info(`Account type: Team/Pro (teams: ${teamNames})`);
|
|
11382
11654
|
if (!orgId) {
|
|
11383
|
-
|
|
11655
|
+
log2.warn(
|
|
11384
11656
|
"Team account detected but VERCEL_ORG_ID is not set. Add your Team ID to apps/<app>/.env as VERCEL_ORG_ID."
|
|
11385
11657
|
);
|
|
11386
11658
|
steps.push({
|
|
@@ -11396,9 +11668,9 @@ var init_vercel = __esm({
|
|
|
11396
11668
|
});
|
|
11397
11669
|
}
|
|
11398
11670
|
} else {
|
|
11399
|
-
|
|
11671
|
+
log2.info("Account type: Hobby/Free (no teams)");
|
|
11400
11672
|
if (orgId) {
|
|
11401
|
-
|
|
11673
|
+
log2.warn(
|
|
11402
11674
|
"Hobby account detected but VERCEL_ORG_ID is set. This causes 403 errors. Remove VERCEL_ORG_ID from apps/<app>/.env."
|
|
11403
11675
|
);
|
|
11404
11676
|
steps.push({
|
|
@@ -11416,7 +11688,7 @@ var init_vercel = __esm({
|
|
|
11416
11688
|
}
|
|
11417
11689
|
} catch (err) {
|
|
11418
11690
|
const msg = err instanceof DoNotDevError ? err.message : "Account type detection failed";
|
|
11419
|
-
|
|
11691
|
+
log2.warn(msg);
|
|
11420
11692
|
steps.push({
|
|
11421
11693
|
name: "Account type",
|
|
11422
11694
|
status: "needs-manual",
|
|
@@ -11425,7 +11697,7 @@ var init_vercel = __esm({
|
|
|
11425
11697
|
}
|
|
11426
11698
|
try {
|
|
11427
11699
|
const project = await validateProject(token, projectId, orgId);
|
|
11428
|
-
|
|
11700
|
+
log2.success(`Project accessible: ${project.projectName}`);
|
|
11429
11701
|
steps.push({
|
|
11430
11702
|
name: "Project access",
|
|
11431
11703
|
status: "success",
|
|
@@ -11433,7 +11705,7 @@ var init_vercel = __esm({
|
|
|
11433
11705
|
});
|
|
11434
11706
|
} catch (err) {
|
|
11435
11707
|
const msg = err instanceof DoNotDevError ? err.message : "Project validation failed";
|
|
11436
|
-
|
|
11708
|
+
log2.error(msg);
|
|
11437
11709
|
steps.push({
|
|
11438
11710
|
name: "Project access",
|
|
11439
11711
|
status: "failed",
|
|
@@ -11636,22 +11908,22 @@ function printAllValidationResults(results, multiApp) {
|
|
|
11636
11908
|
}
|
|
11637
11909
|
}
|
|
11638
11910
|
if (allMissing.length === 0) {
|
|
11639
|
-
|
|
11911
|
+
log2.success("Credentials OK");
|
|
11640
11912
|
return true;
|
|
11641
11913
|
}
|
|
11642
11914
|
for (const { appName, m } of allMissing) {
|
|
11643
11915
|
const prefix = multiApp ? `${appName}: ` : "";
|
|
11644
11916
|
const detail = m.status === "empty" ? `empty in ${m.envFile}` : m.status === "no_env_file" ? `env file not found: ${m.envFile}` : `missing \u2014 ${m.envFile}`;
|
|
11645
|
-
|
|
11917
|
+
log2.error(` ${prefix}${m.varName} (${detail})`);
|
|
11646
11918
|
}
|
|
11647
|
-
|
|
11919
|
+
log2.warn(`Run 'dndev coach' to see where to get them.`);
|
|
11648
11920
|
return false;
|
|
11649
11921
|
}
|
|
11650
11922
|
|
|
11651
11923
|
// packages/tooling/src/cli/setup/setup.ts
|
|
11652
|
-
init_cli_output();
|
|
11653
11924
|
init_app_detection();
|
|
11654
11925
|
init_app_detection();
|
|
11926
|
+
init_cli_output();
|
|
11655
11927
|
var WIZARD_REGISTRY = {
|
|
11656
11928
|
firebase: async () => (await Promise.resolve().then(() => (init_firebase(), firebase_exports))).firebaseWizard,
|
|
11657
11929
|
supabase: async () => (await Promise.resolve().then(() => (init_supabase(), supabase_exports))).supabaseWizard,
|
|
@@ -11667,12 +11939,12 @@ var STATUS_ICONS = {
|
|
|
11667
11939
|
function renderResults(results, multiApp) {
|
|
11668
11940
|
for (const { appName, result } of results) {
|
|
11669
11941
|
if (multiApp) {
|
|
11670
|
-
|
|
11942
|
+
log2.info(`
|
|
11671
11943
|
${appName} \u2014 ${result.provider}:`);
|
|
11672
11944
|
}
|
|
11673
11945
|
for (const step of result.steps) {
|
|
11674
11946
|
const icon = STATUS_ICONS[step.status];
|
|
11675
|
-
|
|
11947
|
+
log2.info(` ${icon} ${step.name}: ${step.message}`);
|
|
11676
11948
|
}
|
|
11677
11949
|
}
|
|
11678
11950
|
}
|
|
@@ -11690,7 +11962,7 @@ function buildSetupContext(app, projectRoot, topology, options) {
|
|
|
11690
11962
|
}
|
|
11691
11963
|
async function main4(options = {}) {
|
|
11692
11964
|
const projectRoot = process.cwd();
|
|
11693
|
-
|
|
11965
|
+
intro("DoNotDev Setup");
|
|
11694
11966
|
const topology = analyzeProjectTopology(projectRoot);
|
|
11695
11967
|
let apps = topology.apps;
|
|
11696
11968
|
if (apps.length === 0) {
|
|
@@ -11700,7 +11972,7 @@ async function main4(options = {}) {
|
|
|
11700
11972
|
const validationResults = validateAllApps(apps, topology, projectRoot);
|
|
11701
11973
|
const allValid = printAllValidationResults(validationResults, multiApp);
|
|
11702
11974
|
if (!allValid) {
|
|
11703
|
-
|
|
11975
|
+
outro("Fix missing values, then re-run.");
|
|
11704
11976
|
return 1;
|
|
11705
11977
|
}
|
|
11706
11978
|
const allResults = [];
|
|
@@ -11710,8 +11982,8 @@ async function main4(options = {}) {
|
|
|
11710
11982
|
if (options.provider) {
|
|
11711
11983
|
const id = options.provider.toLowerCase();
|
|
11712
11984
|
if (!WIZARD_REGISTRY[id]) {
|
|
11713
|
-
|
|
11714
|
-
|
|
11985
|
+
log2.error(`Unknown provider: ${options.provider}`);
|
|
11986
|
+
outro("Setup aborted.");
|
|
11715
11987
|
return 1;
|
|
11716
11988
|
}
|
|
11717
11989
|
const wizard = await WIZARD_REGISTRY[id]();
|
|
@@ -11736,15 +12008,15 @@ async function main4(options = {}) {
|
|
|
11736
12008
|
}
|
|
11737
12009
|
}
|
|
11738
12010
|
if (allResults.length === 0) {
|
|
11739
|
-
|
|
11740
|
-
|
|
12011
|
+
log2.warn("No providers detected. Run: dndev setup <provider>");
|
|
12012
|
+
outro("Nothing to set up.");
|
|
11741
12013
|
return 0;
|
|
11742
12014
|
}
|
|
11743
12015
|
renderResults(allResults, multiApp);
|
|
11744
12016
|
const hasFailures = allResults.some(
|
|
11745
|
-
(
|
|
12017
|
+
(r2) => r2.result.overallStatus === "failed"
|
|
11746
12018
|
);
|
|
11747
|
-
|
|
12019
|
+
outro(
|
|
11748
12020
|
hasFailures ? "Setup incomplete \u2014 see errors above." : "Setup complete."
|
|
11749
12021
|
);
|
|
11750
12022
|
return hasFailures ? 1 : 0;
|