@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');
|
|
@@ -33,31 +33,40 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
33
|
mod
|
|
34
34
|
));
|
|
35
35
|
|
|
36
|
-
// node_modules/.bun/fast-string-truncated-width@
|
|
37
|
-
var
|
|
36
|
+
// node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
|
|
37
|
+
var getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji;
|
|
38
38
|
var init_utils = __esm({
|
|
39
|
-
"node_modules/.bun/fast-string-truncated-width@
|
|
39
|
+
"node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js"() {
|
|
40
40
|
init_utils2();
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
getCodePointsLength = /* @__PURE__ */ (() => {
|
|
42
|
+
const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
43
|
+
return (input) => {
|
|
44
|
+
let surrogatePairsNr = 0;
|
|
45
|
+
SURROGATE_PAIR_RE.lastIndex = 0;
|
|
46
|
+
while (SURROGATE_PAIR_RE.test(input)) {
|
|
47
|
+
surrogatePairsNr += 1;
|
|
48
|
+
}
|
|
49
|
+
return input.length - surrogatePairsNr;
|
|
50
|
+
};
|
|
51
|
+
})();
|
|
44
52
|
isFullWidth = (x) => {
|
|
45
53
|
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
46
54
|
};
|
|
47
|
-
|
|
48
|
-
return x
|
|
55
|
+
isWideNotCJKTNotEmoji = (x) => {
|
|
56
|
+
return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
49
57
|
};
|
|
50
58
|
}
|
|
51
59
|
});
|
|
52
60
|
|
|
53
|
-
// node_modules/.bun/fast-string-truncated-width@
|
|
54
|
-
var ANSI_RE, CONTROL_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
|
|
61
|
+
// node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
|
|
62
|
+
var ANSI_RE, CONTROL_RE, CJKT_WIDE_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
|
|
55
63
|
var init_dist = __esm({
|
|
56
|
-
"node_modules/.bun/fast-string-truncated-width@
|
|
64
|
+
"node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js"() {
|
|
57
65
|
init_utils2();
|
|
58
66
|
init_utils();
|
|
59
|
-
ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
|
|
67
|
+
ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
|
|
60
68
|
CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
69
|
+
CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
|
|
61
70
|
TAB_RE = /\t{1,1000}/y;
|
|
62
71
|
EMOJI_RE = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu");
|
|
63
72
|
LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
@@ -67,14 +76,21 @@ var init_dist = __esm({
|
|
|
67
76
|
const LIMIT = truncationOptions.limit ?? Infinity;
|
|
68
77
|
const ELLIPSIS = truncationOptions.ellipsis ?? "";
|
|
69
78
|
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
|
|
70
|
-
const ANSI_WIDTH =
|
|
79
|
+
const ANSI_WIDTH = 0;
|
|
71
80
|
const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
|
|
72
81
|
const TAB_WIDTH = widthOptions.tabWidth ?? 8;
|
|
73
|
-
const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
|
|
74
82
|
const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
|
|
75
|
-
const FULL_WIDTH_WIDTH =
|
|
83
|
+
const FULL_WIDTH_WIDTH = 2;
|
|
76
84
|
const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
|
|
77
|
-
const WIDE_WIDTH = widthOptions.wideWidth ??
|
|
85
|
+
const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
|
|
86
|
+
const PARSE_BLOCKS = [
|
|
87
|
+
[LATIN_RE, REGULAR_WIDTH],
|
|
88
|
+
[ANSI_RE, ANSI_WIDTH],
|
|
89
|
+
[CONTROL_RE, CONTROL_WIDTH],
|
|
90
|
+
[TAB_RE, TAB_WIDTH],
|
|
91
|
+
[EMOJI_RE, EMOJI_WIDTH],
|
|
92
|
+
[CJKT_WIDE_RE, WIDE_WIDTH]
|
|
93
|
+
];
|
|
78
94
|
let indexPrev = 0;
|
|
79
95
|
let index = 0;
|
|
80
96
|
let length = input.length;
|
|
@@ -94,10 +110,8 @@ var init_dist = __esm({
|
|
|
94
110
|
const codePoint = char.codePointAt(0) || 0;
|
|
95
111
|
if (isFullWidth(codePoint)) {
|
|
96
112
|
widthExtra = FULL_WIDTH_WIDTH;
|
|
97
|
-
} else if (
|
|
113
|
+
} else if (isWideNotCJKTNotEmoji(codePoint)) {
|
|
98
114
|
widthExtra = WIDE_WIDTH;
|
|
99
|
-
} else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) {
|
|
100
|
-
widthExtra = AMBIGUOUS_WIDTH;
|
|
101
115
|
} else {
|
|
102
116
|
widthExtra = REGULAR_WIDTH;
|
|
103
117
|
}
|
|
@@ -113,88 +127,28 @@ var init_dist = __esm({
|
|
|
113
127
|
}
|
|
114
128
|
unmatchedStart = unmatchedEnd = 0;
|
|
115
129
|
}
|
|
116
|
-
if (index >= length)
|
|
117
|
-
break;
|
|
118
|
-
LATIN_RE.lastIndex = index;
|
|
119
|
-
if (LATIN_RE.test(input)) {
|
|
120
|
-
lengthExtra = LATIN_RE.lastIndex - index;
|
|
121
|
-
widthExtra = lengthExtra * REGULAR_WIDTH;
|
|
122
|
-
if (width + widthExtra > truncationLimit) {
|
|
123
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
|
|
124
|
-
}
|
|
125
|
-
if (width + widthExtra > LIMIT) {
|
|
126
|
-
truncationEnabled = true;
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
|
-
width += widthExtra;
|
|
130
|
-
unmatchedStart = indexPrev;
|
|
131
|
-
unmatchedEnd = index;
|
|
132
|
-
index = indexPrev = LATIN_RE.lastIndex;
|
|
133
|
-
continue;
|
|
130
|
+
if (index >= length) {
|
|
131
|
+
break outer;
|
|
134
132
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
widthExtra = lengthExtra * CONTROL_WIDTH;
|
|
154
|
-
if (width + widthExtra > truncationLimit) {
|
|
155
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
|
|
156
|
-
}
|
|
157
|
-
if (width + widthExtra > LIMIT) {
|
|
158
|
-
truncationEnabled = true;
|
|
159
|
-
break;
|
|
160
|
-
}
|
|
161
|
-
width += widthExtra;
|
|
162
|
-
unmatchedStart = indexPrev;
|
|
163
|
-
unmatchedEnd = index;
|
|
164
|
-
index = indexPrev = CONTROL_RE.lastIndex;
|
|
165
|
-
continue;
|
|
166
|
-
}
|
|
167
|
-
TAB_RE.lastIndex = index;
|
|
168
|
-
if (TAB_RE.test(input)) {
|
|
169
|
-
lengthExtra = TAB_RE.lastIndex - index;
|
|
170
|
-
widthExtra = lengthExtra * TAB_WIDTH;
|
|
171
|
-
if (width + widthExtra > truncationLimit) {
|
|
172
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
|
|
173
|
-
}
|
|
174
|
-
if (width + widthExtra > LIMIT) {
|
|
175
|
-
truncationEnabled = true;
|
|
176
|
-
break;
|
|
177
|
-
}
|
|
178
|
-
width += widthExtra;
|
|
179
|
-
unmatchedStart = indexPrev;
|
|
180
|
-
unmatchedEnd = index;
|
|
181
|
-
index = indexPrev = TAB_RE.lastIndex;
|
|
182
|
-
continue;
|
|
183
|
-
}
|
|
184
|
-
EMOJI_RE.lastIndex = index;
|
|
185
|
-
if (EMOJI_RE.test(input)) {
|
|
186
|
-
if (width + EMOJI_WIDTH > truncationLimit) {
|
|
187
|
-
truncationIndex = Math.min(truncationIndex, index);
|
|
188
|
-
}
|
|
189
|
-
if (width + EMOJI_WIDTH > LIMIT) {
|
|
190
|
-
truncationEnabled = true;
|
|
191
|
-
break;
|
|
133
|
+
for (let i2 = 0, l2 = PARSE_BLOCKS.length; i2 < l2; i2++) {
|
|
134
|
+
const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i2];
|
|
135
|
+
BLOCK_RE.lastIndex = index;
|
|
136
|
+
if (BLOCK_RE.test(input)) {
|
|
137
|
+
lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
|
|
138
|
+
widthExtra = lengthExtra * BLOCK_WIDTH;
|
|
139
|
+
if (width + widthExtra > truncationLimit) {
|
|
140
|
+
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
|
|
141
|
+
}
|
|
142
|
+
if (width + widthExtra > LIMIT) {
|
|
143
|
+
truncationEnabled = true;
|
|
144
|
+
break outer;
|
|
145
|
+
}
|
|
146
|
+
width += widthExtra;
|
|
147
|
+
unmatchedStart = indexPrev;
|
|
148
|
+
unmatchedEnd = index;
|
|
149
|
+
index = indexPrev = BLOCK_RE.lastIndex;
|
|
150
|
+
continue outer;
|
|
192
151
|
}
|
|
193
|
-
width += EMOJI_WIDTH;
|
|
194
|
-
unmatchedStart = indexPrev;
|
|
195
|
-
unmatchedEnd = index;
|
|
196
|
-
index = indexPrev = EMOJI_RE.lastIndex;
|
|
197
|
-
continue;
|
|
198
152
|
}
|
|
199
153
|
index += 1;
|
|
200
154
|
}
|
|
@@ -209,10 +163,10 @@ var init_dist = __esm({
|
|
|
209
163
|
}
|
|
210
164
|
});
|
|
211
165
|
|
|
212
|
-
// node_modules/.bun/fast-string-width@
|
|
166
|
+
// node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
|
|
213
167
|
var NO_TRUNCATION2, fastStringWidth, dist_default2;
|
|
214
168
|
var init_dist2 = __esm({
|
|
215
|
-
"node_modules/.bun/fast-string-width@
|
|
169
|
+
"node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js"() {
|
|
216
170
|
init_utils2();
|
|
217
171
|
init_dist();
|
|
218
172
|
NO_TRUNCATION2 = {
|
|
@@ -227,13 +181,13 @@ var init_dist2 = __esm({
|
|
|
227
181
|
}
|
|
228
182
|
});
|
|
229
183
|
|
|
230
|
-
// node_modules/.bun/fast-wrap-ansi@0.
|
|
184
|
+
// node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js
|
|
231
185
|
function wrapAnsi(string, columns, options) {
|
|
232
186
|
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
|
|
233
187
|
}
|
|
234
188
|
var ESC, CSI, END_CODE, ANSI_ESCAPE_BELL, ANSI_CSI, ANSI_OSC, ANSI_SGR_TERMINATOR, ANSI_ESCAPE_LINK, GROUP_REGEX, getClosingCode, wrapAnsiCode, wrapAnsiHyperlink, wrapWord, stringVisibleTrimSpacesRight, exec, CRLF_OR_LF;
|
|
235
189
|
var init_main = __esm({
|
|
236
|
-
"node_modules/.bun/fast-wrap-ansi@0.
|
|
190
|
+
"node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js"() {
|
|
237
191
|
init_utils2();
|
|
238
192
|
init_dist2();
|
|
239
193
|
ESC = "\x1B";
|
|
@@ -397,16 +351,19 @@ var init_main = __esm({
|
|
|
397
351
|
}
|
|
398
352
|
const preString = rows.join("\n");
|
|
399
353
|
let inSurrogate = false;
|
|
400
|
-
for (let
|
|
401
|
-
const character = preString[
|
|
354
|
+
for (let i2 = 0; i2 < preString.length; i2++) {
|
|
355
|
+
const character = preString[i2];
|
|
402
356
|
returnValue += character;
|
|
403
357
|
if (!inSurrogate) {
|
|
404
358
|
inSurrogate = character >= "\uD800" && character <= "\uDBFF";
|
|
359
|
+
if (inSurrogate) {
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
405
362
|
} else {
|
|
406
|
-
|
|
363
|
+
inSurrogate = false;
|
|
407
364
|
}
|
|
408
365
|
if (character === ESC || character === CSI) {
|
|
409
|
-
GROUP_REGEX.lastIndex =
|
|
366
|
+
GROUP_REGEX.lastIndex = i2 + 1;
|
|
410
367
|
const groupsResult = GROUP_REGEX.exec(preString);
|
|
411
368
|
const groups = groupsResult?.groups;
|
|
412
369
|
if (groups?.code !== void 0) {
|
|
@@ -416,7 +373,7 @@ var init_main = __esm({
|
|
|
416
373
|
escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
417
374
|
}
|
|
418
375
|
}
|
|
419
|
-
if (preString[
|
|
376
|
+
if (preString[i2 + 1] === "\n") {
|
|
420
377
|
if (escapeUrl) {
|
|
421
378
|
returnValue += wrapAnsiHyperlink("");
|
|
422
379
|
}
|
|
@@ -447,7 +404,7 @@ var require_src = __commonJS({
|
|
|
447
404
|
var ESC2 = "\x1B";
|
|
448
405
|
var CSI2 = `${ESC2}[`;
|
|
449
406
|
var beep = "\x07";
|
|
450
|
-
var
|
|
407
|
+
var cursor3 = {
|
|
451
408
|
to(x, y2) {
|
|
452
409
|
if (!y2) return `${CSI2}${x + 1}G`;
|
|
453
410
|
return `${CSI2}${y2 + 1};${x + 1}H`;
|
|
@@ -476,7 +433,7 @@ var require_src = __commonJS({
|
|
|
476
433
|
up: (count = 1) => `${CSI2}S`.repeat(count),
|
|
477
434
|
down: (count = 1) => `${CSI2}T`.repeat(count)
|
|
478
435
|
};
|
|
479
|
-
var
|
|
436
|
+
var erase3 = {
|
|
480
437
|
screen: `${CSI2}2J`,
|
|
481
438
|
up: (count = 1) => `${CSI2}1J`.repeat(count),
|
|
482
439
|
down: (count = 1) => `${CSI2}J`.repeat(count),
|
|
@@ -485,89 +442,169 @@ var require_src = __commonJS({
|
|
|
485
442
|
lineStart: `${CSI2}1K`,
|
|
486
443
|
lines(count) {
|
|
487
444
|
let clear = "";
|
|
488
|
-
for (let
|
|
489
|
-
clear += this.line + (
|
|
445
|
+
for (let i2 = 0; i2 < count; i2++)
|
|
446
|
+
clear += this.line + (i2 < count - 1 ? cursor3.up() : "");
|
|
490
447
|
if (count)
|
|
491
|
-
clear +=
|
|
448
|
+
clear += cursor3.left;
|
|
492
449
|
return clear;
|
|
493
450
|
}
|
|
494
451
|
};
|
|
495
|
-
module.exports = { cursor, scroll, erase, beep };
|
|
452
|
+
module.exports = { cursor: cursor3, scroll, erase: erase3, beep };
|
|
496
453
|
}
|
|
497
454
|
});
|
|
498
455
|
|
|
499
|
-
// node_modules/.bun/@clack+core@1.
|
|
500
|
-
import { styleText
|
|
501
|
-
import { stdout
|
|
502
|
-
import * as
|
|
503
|
-
import
|
|
504
|
-
import { ReadStream
|
|
505
|
-
function
|
|
506
|
-
if (!
|
|
507
|
-
|
|
508
|
-
|
|
456
|
+
// node_modules/.bun/@clack+core@1.5.0/node_modules/@clack/core/dist/index.mjs
|
|
457
|
+
import { styleText } from "node:util";
|
|
458
|
+
import { stdout, stdin } from "node:process";
|
|
459
|
+
import * as l from "node:readline";
|
|
460
|
+
import l__default from "node:readline";
|
|
461
|
+
import { ReadStream } from "node:tty";
|
|
462
|
+
function findCursor(s, o, l2) {
|
|
463
|
+
if (!l2.some((r2) => !r2.disabled))
|
|
464
|
+
return s;
|
|
465
|
+
const t2 = s + o, n3 = Math.max(l2.length - 1, 0), e = t2 < 0 ? n3 : t2 > n3 ? 0 : t2;
|
|
466
|
+
return l2[e]?.disabled ? findCursor(e, o < 0 ? -1 : 1, l2) : e;
|
|
467
|
+
}
|
|
468
|
+
function isAccessible(n3) {
|
|
469
|
+
if (n3 !== void 0) return n3;
|
|
470
|
+
if (settings.accessible !== void 0) return settings.accessible;
|
|
471
|
+
const e = process.env.ACCESSIBLE;
|
|
472
|
+
return e !== void 0 && e !== "" && e !== "0" && e !== "false";
|
|
509
473
|
}
|
|
510
|
-
function
|
|
511
|
-
if (typeof
|
|
512
|
-
|
|
474
|
+
function isActionKey(n3, e) {
|
|
475
|
+
if (typeof n3 == "string")
|
|
476
|
+
return settings.aliases.get(n3) === e;
|
|
477
|
+
for (const s of n3)
|
|
478
|
+
if (s !== void 0 && isActionKey(s, e))
|
|
479
|
+
return true;
|
|
513
480
|
return false;
|
|
514
481
|
}
|
|
515
|
-
function
|
|
516
|
-
if (
|
|
517
|
-
const e =
|
|
518
|
-
`),
|
|
519
|
-
`),
|
|
520
|
-
for (let
|
|
521
|
-
|
|
482
|
+
function diffLines(i2, s) {
|
|
483
|
+
if (i2 === s) return;
|
|
484
|
+
const e = i2.split(`
|
|
485
|
+
`), t2 = s.split(`
|
|
486
|
+
`), r2 = Math.max(e.length, t2.length), f = [];
|
|
487
|
+
for (let n3 = 0; n3 < r2; n3++)
|
|
488
|
+
e[n3] !== t2[n3] && f.push(n3);
|
|
489
|
+
return {
|
|
490
|
+
lines: f,
|
|
491
|
+
numLinesBefore: e.length,
|
|
492
|
+
numLinesAfter: t2.length,
|
|
493
|
+
numLines: r2
|
|
494
|
+
};
|
|
522
495
|
}
|
|
523
|
-
function
|
|
524
|
-
return
|
|
496
|
+
function isCancel(e) {
|
|
497
|
+
return e === CANCEL_SYMBOL;
|
|
525
498
|
}
|
|
526
|
-
function
|
|
527
|
-
const
|
|
528
|
-
|
|
499
|
+
function setRawMode(e, r2) {
|
|
500
|
+
const o = e;
|
|
501
|
+
o.isTTY && o.setRawMode(r2);
|
|
529
502
|
}
|
|
530
|
-
function
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
503
|
+
function block({
|
|
504
|
+
input: e = stdin,
|
|
505
|
+
output: r2 = stdout,
|
|
506
|
+
overwrite: o = true,
|
|
507
|
+
hideCursor: n3 = true
|
|
508
|
+
} = {}) {
|
|
509
|
+
const s = l.createInterface({
|
|
510
|
+
input: e,
|
|
511
|
+
output: r2,
|
|
512
|
+
prompt: "",
|
|
513
|
+
tabSize: 1
|
|
514
|
+
});
|
|
515
|
+
l.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(true);
|
|
516
|
+
const t2 = (f, { name: a2, sequence: w }) => {
|
|
517
|
+
const c2 = String(f);
|
|
518
|
+
if (isActionKey([c2, a2, w], "cancel")) {
|
|
519
|
+
n3 && r2.write(import_sisteransi.cursor.show), process.exit(0);
|
|
537
520
|
return;
|
|
538
521
|
}
|
|
539
|
-
if (!
|
|
540
|
-
const
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
522
|
+
if (!o) return;
|
|
523
|
+
const i2 = a2 === "return" ? 0 : -1, m = a2 === "return" ? -1 : 0;
|
|
524
|
+
l.moveCursor(r2, i2, m, () => {
|
|
525
|
+
l.clearLine(r2, 1, () => {
|
|
526
|
+
e.once("keypress", t2);
|
|
544
527
|
});
|
|
545
528
|
});
|
|
546
529
|
};
|
|
547
|
-
return
|
|
548
|
-
|
|
530
|
+
return n3 && r2.write(import_sisteransi.cursor.hide), e.once("keypress", t2), () => {
|
|
531
|
+
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();
|
|
549
532
|
};
|
|
550
533
|
}
|
|
551
|
-
function
|
|
552
|
-
const
|
|
553
|
-
return wrapAnsi(
|
|
554
|
-
|
|
534
|
+
function wrapTextWithPrefix(e, r2, o, n3 = o, s = o, t2) {
|
|
535
|
+
const f = getColumns(e ?? stdout);
|
|
536
|
+
return wrapAnsi(r2, f - o.length, {
|
|
537
|
+
hard: true,
|
|
538
|
+
trim: false
|
|
539
|
+
}).split(`
|
|
540
|
+
`).map((c2, i2, m) => {
|
|
541
|
+
const d = t2 ? t2(c2, i2) : c2;
|
|
542
|
+
return i2 === 0 ? `${n3}${d}` : i2 === m.length - 1 ? `${s}${d}` : `${o}${d}`;
|
|
543
|
+
}).join(`
|
|
555
544
|
`);
|
|
556
545
|
}
|
|
557
|
-
|
|
546
|
+
function runValidation(e, a2) {
|
|
547
|
+
if ("~standard" in e) {
|
|
548
|
+
const n3 = e["~standard"].validate(a2);
|
|
549
|
+
return n3 instanceof Promise ? n3.then((r2) => r2.issues?.at(0)?.message) : n3.issues?.at(0)?.message;
|
|
550
|
+
}
|
|
551
|
+
return e(a2);
|
|
552
|
+
}
|
|
553
|
+
var import_sisteransi, a$1, t, settings, R, CANCEL_SYMBOL, getColumns, getRows, y, r, n$1;
|
|
558
554
|
var init_dist3 = __esm({
|
|
559
|
-
"node_modules/.bun/@clack+core@1.
|
|
555
|
+
"node_modules/.bun/@clack+core@1.5.0/node_modules/@clack/core/dist/index.mjs"() {
|
|
560
556
|
init_utils2();
|
|
561
557
|
init_main();
|
|
562
558
|
import_sisteransi = __toESM(require_src(), 1);
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
559
|
+
a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
560
|
+
t = [
|
|
561
|
+
"January",
|
|
562
|
+
"February",
|
|
563
|
+
"March",
|
|
564
|
+
"April",
|
|
565
|
+
"May",
|
|
566
|
+
"June",
|
|
567
|
+
"July",
|
|
568
|
+
"August",
|
|
569
|
+
"September",
|
|
570
|
+
"October",
|
|
571
|
+
"November",
|
|
572
|
+
"December"
|
|
573
|
+
];
|
|
574
|
+
settings = {
|
|
575
|
+
actions: new Set(a$1),
|
|
576
|
+
aliases: /* @__PURE__ */ new Map([
|
|
577
|
+
// vim support
|
|
578
|
+
["k", "up"],
|
|
579
|
+
["j", "down"],
|
|
580
|
+
["h", "left"],
|
|
581
|
+
["l", "right"],
|
|
582
|
+
["", "cancel"],
|
|
583
|
+
// opinionated defaults!
|
|
584
|
+
["escape", "cancel"]
|
|
585
|
+
]),
|
|
586
|
+
messages: {
|
|
587
|
+
cancel: "Canceled",
|
|
588
|
+
error: "Something went wrong"
|
|
589
|
+
},
|
|
590
|
+
withGuide: true,
|
|
591
|
+
accessible: void 0,
|
|
592
|
+
date: {
|
|
593
|
+
monthNames: [...t],
|
|
594
|
+
messages: {
|
|
595
|
+
required: "Please enter a valid date",
|
|
596
|
+
invalidMonth: "There are only 12 months in a year",
|
|
597
|
+
invalidDay: (n3, e) => `There are only ${n3} days in ${e}`,
|
|
598
|
+
afterMin: (n3) => `Date must be on or after ${n3.toISOString().slice(0, 10)}`,
|
|
599
|
+
beforeMax: (n3) => `Date must be on or before ${n3.toISOString().slice(0, 10)}`
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
};
|
|
603
|
+
R = globalThis.process.platform.startsWith("win");
|
|
604
|
+
CANCEL_SYMBOL = /* @__PURE__ */ Symbol("clack:cancel");
|
|
605
|
+
getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
|
|
606
|
+
getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
|
|
607
|
+
y = class {
|
|
571
608
|
input;
|
|
572
609
|
output;
|
|
573
610
|
_abortSignal;
|
|
@@ -582,46 +619,92 @@ var init_dist3 = __esm({
|
|
|
582
619
|
error = "";
|
|
583
620
|
value;
|
|
584
621
|
userInput = "";
|
|
622
|
+
/**
|
|
623
|
+
* Whether accessible (static, screen-reader friendly) output is enabled for
|
|
624
|
+
* this prompt, resolved from the `accessible` option, the global setting,
|
|
625
|
+
* and the `ACCESSIBLE` env var.
|
|
626
|
+
*/
|
|
627
|
+
get accessible() {
|
|
628
|
+
return isAccessible(this.opts.accessible);
|
|
629
|
+
}
|
|
585
630
|
constructor(t2, e = true) {
|
|
586
|
-
const { input:
|
|
587
|
-
this.opts =
|
|
631
|
+
const { input: i2 = stdin, output: s = stdout, render: r2, signal: n3, ...o } = t2;
|
|
632
|
+
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;
|
|
588
633
|
}
|
|
634
|
+
/**
|
|
635
|
+
* Unsubscribe all listeners
|
|
636
|
+
*/
|
|
589
637
|
unsubscribe() {
|
|
590
638
|
this._subscribers.clear();
|
|
591
639
|
}
|
|
640
|
+
/**
|
|
641
|
+
* Set a subscriber with opts
|
|
642
|
+
* @param event - The event name
|
|
643
|
+
*/
|
|
592
644
|
setSubscriber(t2, e) {
|
|
593
|
-
const
|
|
594
|
-
|
|
645
|
+
const i2 = this._subscribers.get(t2) ?? [];
|
|
646
|
+
i2.push(e), this._subscribers.set(t2, i2);
|
|
595
647
|
}
|
|
648
|
+
/**
|
|
649
|
+
* Subscribe to an event
|
|
650
|
+
* @param event - The event name
|
|
651
|
+
* @param cb - The callback
|
|
652
|
+
*/
|
|
596
653
|
on(t2, e) {
|
|
597
654
|
this.setSubscriber(t2, { cb: e });
|
|
598
655
|
}
|
|
656
|
+
/**
|
|
657
|
+
* Subscribe to an event once
|
|
658
|
+
* @param event - The event name
|
|
659
|
+
* @param cb - The callback
|
|
660
|
+
*/
|
|
599
661
|
once(t2, e) {
|
|
600
662
|
this.setSubscriber(t2, { cb: e, once: true });
|
|
601
663
|
}
|
|
664
|
+
/**
|
|
665
|
+
* Emit an event with data
|
|
666
|
+
* @param event - The event name
|
|
667
|
+
* @param data - The data to pass to the callback
|
|
668
|
+
*/
|
|
602
669
|
emit(t2, ...e) {
|
|
603
|
-
const
|
|
604
|
-
for (const
|
|
605
|
-
|
|
670
|
+
const i2 = this._subscribers.get(t2) ?? [], s = [];
|
|
671
|
+
for (const r2 of i2)
|
|
672
|
+
r2.cb(...e), r2.once && s.push(() => i2.splice(i2.indexOf(r2), 1));
|
|
673
|
+
for (const r2 of s)
|
|
674
|
+
r2();
|
|
606
675
|
}
|
|
607
676
|
prompt() {
|
|
608
677
|
return new Promise((t2) => {
|
|
609
678
|
if (this._abortSignal) {
|
|
610
|
-
if (this._abortSignal.aborted)
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
679
|
+
if (this._abortSignal.aborted)
|
|
680
|
+
return this.state = "cancel", this.close(), t2(CANCEL_SYMBOL);
|
|
681
|
+
this._abortSignal.addEventListener(
|
|
682
|
+
"abort",
|
|
683
|
+
() => {
|
|
684
|
+
this.state = "cancel", this.close();
|
|
685
|
+
},
|
|
686
|
+
{ once: true }
|
|
687
|
+
);
|
|
614
688
|
}
|
|
615
|
-
this.rl =
|
|
616
|
-
|
|
689
|
+
this.rl = l__default.createInterface({
|
|
690
|
+
input: this.input,
|
|
691
|
+
tabSize: 2,
|
|
692
|
+
prompt: "",
|
|
693
|
+
escapeCodeTimeout: 50,
|
|
694
|
+
terminal: true
|
|
695
|
+
}), 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", () => {
|
|
696
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(this.value);
|
|
617
697
|
}), this.once("cancel", () => {
|
|
618
|
-
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render),
|
|
698
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(CANCEL_SYMBOL);
|
|
619
699
|
});
|
|
620
700
|
});
|
|
621
701
|
}
|
|
622
702
|
_isActionKey(t2, e) {
|
|
623
703
|
return t2 === " ";
|
|
624
704
|
}
|
|
705
|
+
_shouldSubmit(t2, e) {
|
|
706
|
+
return true;
|
|
707
|
+
}
|
|
625
708
|
_setValue(t2) {
|
|
626
709
|
this.value = t2, this.emit("value", this.value);
|
|
627
710
|
}
|
|
@@ -631,19 +714,22 @@ var init_dist3 = __esm({
|
|
|
631
714
|
_clearUserInput() {
|
|
632
715
|
this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
|
|
633
716
|
}
|
|
634
|
-
onKeypress(t2, e) {
|
|
635
|
-
if (this.
|
|
636
|
-
if (this.
|
|
637
|
-
|
|
638
|
-
|
|
717
|
+
async onKeypress(t2, e) {
|
|
718
|
+
if (this.state !== "validating") {
|
|
719
|
+
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)) {
|
|
720
|
+
if (this.opts.validate) {
|
|
721
|
+
const i2 = runValidation(this.opts.validate, this.value);
|
|
722
|
+
let s;
|
|
723
|
+
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));
|
|
724
|
+
}
|
|
725
|
+
this.state !== "error" && (this.state = "submit");
|
|
639
726
|
}
|
|
640
|
-
this.state
|
|
727
|
+
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();
|
|
641
728
|
}
|
|
642
|
-
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();
|
|
643
729
|
}
|
|
644
730
|
close() {
|
|
645
731
|
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
646
|
-
`),
|
|
732
|
+
`), setRawMode(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
647
733
|
}
|
|
648
734
|
restoreCursor() {
|
|
649
735
|
const t2 = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
|
|
@@ -651,34 +737,39 @@ var init_dist3 = __esm({
|
|
|
651
737
|
this.output.write(import_sisteransi.cursor.move(-999, t2 * -1));
|
|
652
738
|
}
|
|
653
739
|
render() {
|
|
654
|
-
const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
|
|
740
|
+
const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
|
|
741
|
+
hard: true,
|
|
742
|
+
trim: false
|
|
743
|
+
});
|
|
655
744
|
if (t2 !== this._prevFrame) {
|
|
656
|
-
if (this.state === "initial")
|
|
745
|
+
if (this.state === "initial")
|
|
746
|
+
this.output.write(import_sisteransi.cursor.hide);
|
|
657
747
|
else {
|
|
658
|
-
const e =
|
|
748
|
+
const e = diffLines(this._prevFrame, t2), i2 = getRows(this.output);
|
|
659
749
|
if (this.restoreCursor(), e) {
|
|
660
|
-
const
|
|
661
|
-
let
|
|
662
|
-
if (
|
|
750
|
+
const s = Math.max(0, e.numLinesAfter - i2), r2 = Math.max(0, e.numLinesBefore - i2);
|
|
751
|
+
let n3 = e.lines.find((o) => o >= s);
|
|
752
|
+
if (n3 === void 0) {
|
|
663
753
|
this._prevFrame = t2;
|
|
664
754
|
return;
|
|
665
755
|
}
|
|
666
756
|
if (e.lines.length === 1) {
|
|
667
|
-
this.output.write(import_sisteransi.cursor.move(0,
|
|
668
|
-
const
|
|
757
|
+
this.output.write(import_sisteransi.cursor.move(0, n3 - r2)), this.output.write(import_sisteransi.erase.lines(1));
|
|
758
|
+
const o = t2.split(`
|
|
669
759
|
`);
|
|
670
|
-
this.output.write(
|
|
760
|
+
this.output.write(o[n3]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, o.length - n3 - 1));
|
|
671
761
|
return;
|
|
672
762
|
} else if (e.lines.length > 1) {
|
|
673
|
-
if (
|
|
763
|
+
if (s < r2)
|
|
764
|
+
n3 = s;
|
|
674
765
|
else {
|
|
675
|
-
const
|
|
676
|
-
|
|
766
|
+
const h2 = n3 - r2;
|
|
767
|
+
h2 > 0 && this.output.write(import_sisteransi.cursor.move(0, h2));
|
|
677
768
|
}
|
|
678
769
|
this.output.write(import_sisteransi.erase.down());
|
|
679
|
-
const
|
|
680
|
-
`).slice(
|
|
681
|
-
this.output.write(
|
|
770
|
+
const f = t2.split(`
|
|
771
|
+
`).slice(n3);
|
|
772
|
+
this.output.write(f.join(`
|
|
682
773
|
`)), this._prevFrame = t2;
|
|
683
774
|
return;
|
|
684
775
|
}
|
|
@@ -689,7 +780,7 @@ var init_dist3 = __esm({
|
|
|
689
780
|
}
|
|
690
781
|
}
|
|
691
782
|
};
|
|
692
|
-
|
|
783
|
+
r = class extends y {
|
|
693
784
|
get cursor() {
|
|
694
785
|
return this.value ? 0 : 1;
|
|
695
786
|
}
|
|
@@ -699,34 +790,35 @@ var init_dist3 = __esm({
|
|
|
699
790
|
constructor(t2) {
|
|
700
791
|
super(t2, false), this.value = !!t2.initialValue, this.on("userInput", () => {
|
|
701
792
|
this.value = this._value;
|
|
702
|
-
}), this.on("confirm", (
|
|
703
|
-
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value =
|
|
793
|
+
}), this.on("confirm", (i2) => {
|
|
794
|
+
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = i2, this.state = "submit", this.close();
|
|
704
795
|
}), this.on("cursor", () => {
|
|
705
796
|
this.value = !this.value;
|
|
706
797
|
});
|
|
707
798
|
}
|
|
708
799
|
};
|
|
709
|
-
|
|
800
|
+
n$1 = class n extends y {
|
|
710
801
|
options;
|
|
711
802
|
cursor = 0;
|
|
712
803
|
get _selectedValue() {
|
|
713
804
|
return this.options[this.cursor];
|
|
714
805
|
}
|
|
715
806
|
changeValue() {
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
807
|
+
const e = this._selectedValue;
|
|
808
|
+
this.value = e === void 0 ? void 0 : e.value;
|
|
809
|
+
}
|
|
810
|
+
constructor(e) {
|
|
811
|
+
super(e, false), this.options = e.options;
|
|
812
|
+
const o = this.options.findIndex(({ value: s }) => s === e.initialValue), t2 = o === -1 ? 0 : o;
|
|
813
|
+
this.cursor = this.options[t2]?.disabled ? findCursor(t2, 1, this.options) : t2, this.changeValue(), this.on("cursor", (s) => {
|
|
814
|
+
switch (s) {
|
|
723
815
|
case "left":
|
|
724
816
|
case "up":
|
|
725
|
-
this.cursor =
|
|
817
|
+
this.cursor = findCursor(this.cursor, -1, this.options);
|
|
726
818
|
break;
|
|
727
819
|
case "down":
|
|
728
820
|
case "right":
|
|
729
|
-
this.cursor =
|
|
821
|
+
this.cursor = findCursor(this.cursor, 1, this.options);
|
|
730
822
|
break;
|
|
731
823
|
}
|
|
732
824
|
this.changeValue();
|
|
@@ -736,299 +828,456 @@ var init_dist3 = __esm({
|
|
|
736
828
|
}
|
|
737
829
|
});
|
|
738
830
|
|
|
739
|
-
// node_modules/.bun/@clack+prompts@1.
|
|
740
|
-
import { styleText as
|
|
741
|
-
import
|
|
742
|
-
import { existsSync
|
|
743
|
-
import { dirname
|
|
744
|
-
function
|
|
745
|
-
|
|
831
|
+
// node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs
|
|
832
|
+
import { styleText as styleText2, stripVTControlCharacters } from "node:util";
|
|
833
|
+
import process$1 from "node:process";
|
|
834
|
+
import { existsSync, lstatSync, readdirSync } from "node:fs";
|
|
835
|
+
import { dirname, join } from "node:path";
|
|
836
|
+
function isUnicodeSupported() {
|
|
837
|
+
if (process$1.platform !== "win32") {
|
|
838
|
+
return process$1.env.TERM !== "linux";
|
|
839
|
+
}
|
|
840
|
+
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";
|
|
841
|
+
}
|
|
842
|
+
function formatInstructionFooter(o, e) {
|
|
843
|
+
const r2 = [`${e ? `${styleText2("cyan", S_BAR)} ` : ""}${o.join(" \u2022 ")}`];
|
|
844
|
+
return e && r2.push(styleText2("cyan", S_BAR_END)), r2;
|
|
746
845
|
}
|
|
747
|
-
var import_sisteransi2,
|
|
846
|
+
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;
|
|
748
847
|
var init_dist4 = __esm({
|
|
749
|
-
"node_modules/.bun/@clack+prompts@1.
|
|
848
|
+
"node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs"() {
|
|
750
849
|
init_utils2();
|
|
751
850
|
init_dist3();
|
|
752
851
|
init_dist3();
|
|
753
852
|
init_main();
|
|
754
853
|
init_dist2();
|
|
755
854
|
import_sisteransi2 = __toESM(require_src(), 1);
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
switch (
|
|
855
|
+
unicode = isUnicodeSupported();
|
|
856
|
+
isCI = () => process.env.CI === "true";
|
|
857
|
+
unicodeOr = (o, e) => unicode ? o : e;
|
|
858
|
+
S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
|
|
859
|
+
S_STEP_CANCEL = unicodeOr("\u25A0", "x");
|
|
860
|
+
S_STEP_ERROR = unicodeOr("\u25B2", "x");
|
|
861
|
+
S_STEP_SUBMIT = unicodeOr("\u25C7", "o");
|
|
862
|
+
S_BAR_START = unicodeOr("\u250C", "T");
|
|
863
|
+
S_BAR = unicodeOr("\u2502", "|");
|
|
864
|
+
S_BAR_END = unicodeOr("\u2514", "\u2014");
|
|
865
|
+
S_BAR_START_RIGHT = unicodeOr("\u2510", "T");
|
|
866
|
+
S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014");
|
|
867
|
+
S_RADIO_ACTIVE = unicodeOr("\u25CF", ">");
|
|
868
|
+
S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
|
|
869
|
+
S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
|
|
870
|
+
S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
|
|
871
|
+
S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
|
|
872
|
+
S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022");
|
|
873
|
+
S_BAR_H = unicodeOr("\u2500", "-");
|
|
874
|
+
S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+");
|
|
875
|
+
S_CONNECT_LEFT = unicodeOr("\u251C", "+");
|
|
876
|
+
S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+");
|
|
877
|
+
S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+");
|
|
878
|
+
S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+");
|
|
879
|
+
S_INFO = unicodeOr("\u25CF", "\u2022");
|
|
880
|
+
S_SUCCESS = unicodeOr("\u25C6", "*");
|
|
881
|
+
S_WARN = unicodeOr("\u25B2", "!");
|
|
882
|
+
S_ERROR = unicodeOr("\u25A0", "x");
|
|
883
|
+
symbol = (o) => {
|
|
884
|
+
switch (o) {
|
|
786
885
|
case "initial":
|
|
787
886
|
case "active":
|
|
788
|
-
return
|
|
887
|
+
return styleText2("cyan", S_STEP_ACTIVE);
|
|
789
888
|
case "cancel":
|
|
790
|
-
return
|
|
889
|
+
return styleText2("red", S_STEP_CANCEL);
|
|
791
890
|
case "error":
|
|
792
|
-
return
|
|
891
|
+
return styleText2("yellow", S_STEP_ERROR);
|
|
793
892
|
case "submit":
|
|
794
|
-
return
|
|
893
|
+
return styleText2("green", S_STEP_SUBMIT);
|
|
894
|
+
case "validating":
|
|
895
|
+
return styleText2("dim", S_STEP_ACTIVE);
|
|
795
896
|
}
|
|
796
897
|
};
|
|
797
|
-
|
|
798
|
-
switch (
|
|
898
|
+
symbolBar = (o) => {
|
|
899
|
+
switch (o) {
|
|
799
900
|
case "initial":
|
|
800
901
|
case "active":
|
|
801
|
-
return
|
|
902
|
+
return styleText2("cyan", S_BAR);
|
|
802
903
|
case "cancel":
|
|
803
|
-
return
|
|
904
|
+
return styleText2("red", S_BAR);
|
|
804
905
|
case "error":
|
|
805
|
-
return
|
|
906
|
+
return styleText2("yellow", S_BAR);
|
|
806
907
|
case "submit":
|
|
807
|
-
return
|
|
808
|
-
}
|
|
809
|
-
};
|
|
810
|
-
|
|
811
|
-
let
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
908
|
+
return styleText2("green", S_BAR);
|
|
909
|
+
}
|
|
910
|
+
};
|
|
911
|
+
I = (l2, e, w, p, b, C2 = false) => {
|
|
912
|
+
let r2 = e, O = 0;
|
|
913
|
+
if (C2)
|
|
914
|
+
for (let i2 = p - 1; i2 >= w; i2--) {
|
|
915
|
+
const m = l2[i2];
|
|
916
|
+
if (m && (r2 -= m.length), O++, r2 <= b) break;
|
|
917
|
+
}
|
|
918
|
+
else
|
|
919
|
+
for (let i2 = w; i2 < p; i2++) {
|
|
920
|
+
const m = l2[i2];
|
|
921
|
+
if (m && (r2 -= m.length), O++, r2 <= b) break;
|
|
922
|
+
}
|
|
923
|
+
return { lineCount: r2, removals: O };
|
|
924
|
+
};
|
|
925
|
+
limitOptions = ({
|
|
926
|
+
cursor: l2,
|
|
927
|
+
options: e,
|
|
928
|
+
style: w,
|
|
929
|
+
output: p = process.stdout,
|
|
930
|
+
maxItems: b = Number.POSITIVE_INFINITY,
|
|
931
|
+
columnPadding: C2 = 0,
|
|
932
|
+
rowPadding: r2 = 4
|
|
933
|
+
}) => {
|
|
934
|
+
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);
|
|
824
935
|
let f = 0;
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
936
|
+
l2 >= a2 - 3 && (f = Math.max(
|
|
937
|
+
Math.min(l2 - a2 + 3, e.length - a2),
|
|
938
|
+
0
|
|
939
|
+
));
|
|
940
|
+
let d = a2 < e.length && f > 0, c2 = a2 < e.length && f + a2 < e.length;
|
|
941
|
+
const W2 = Math.min(
|
|
942
|
+
f + a2,
|
|
943
|
+
e.length
|
|
944
|
+
), s = [];
|
|
945
|
+
let g = 0;
|
|
946
|
+
d && g++, c2 && g++;
|
|
947
|
+
const T = f + (d ? 1 : 0), y2 = W2 - (c2 ? 1 : 0);
|
|
948
|
+
for (let t2 = T; t2 < y2; t2++) {
|
|
949
|
+
const n3 = e[t2], o = n3 ? w(n3, t2 === l2) : "", h2 = wrapAnsi(o, i2, {
|
|
950
|
+
hard: true,
|
|
951
|
+
trim: false
|
|
952
|
+
}).split(`
|
|
829
953
|
`);
|
|
830
|
-
|
|
831
|
-
}
|
|
832
|
-
if (
|
|
833
|
-
let
|
|
834
|
-
const
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
954
|
+
s.push(h2), g += h2.length;
|
|
955
|
+
}
|
|
956
|
+
if (g > v) {
|
|
957
|
+
let t2 = 0, n3 = 0, o = g;
|
|
958
|
+
const h2 = l2 - T;
|
|
959
|
+
let u3 = v;
|
|
960
|
+
const L = () => I(s, o, 0, h2, u3), E = () => I(
|
|
961
|
+
s,
|
|
962
|
+
o,
|
|
963
|
+
h2 + 1,
|
|
964
|
+
s.length,
|
|
965
|
+
u3,
|
|
966
|
+
true
|
|
967
|
+
);
|
|
968
|
+
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));
|
|
969
|
+
}
|
|
970
|
+
const x = [];
|
|
971
|
+
d && x.push(M);
|
|
972
|
+
for (const t2 of s)
|
|
973
|
+
for (const n3 of t2)
|
|
974
|
+
x.push(n3);
|
|
975
|
+
return c2 && x.push(M), x;
|
|
976
|
+
};
|
|
977
|
+
confirm = (i2) => {
|
|
978
|
+
const a2 = i2.active ?? "Yes", s = i2.inactive ?? "No";
|
|
979
|
+
return new r({
|
|
980
|
+
active: a2,
|
|
981
|
+
inactive: s,
|
|
982
|
+
signal: i2.signal,
|
|
983
|
+
input: i2.input,
|
|
984
|
+
output: i2.output,
|
|
985
|
+
initialValue: i2.initialValue ?? true,
|
|
986
|
+
render() {
|
|
987
|
+
const e = i2.withGuide ?? settings.withGuide, u3 = `${symbol(this.state)} `, l2 = e ? `${styleText2("gray", S_BAR)} ` : "", f = wrapTextWithPrefix(
|
|
988
|
+
i2.output,
|
|
989
|
+
i2.message,
|
|
990
|
+
l2,
|
|
991
|
+
u3
|
|
992
|
+
), o = `${e ? `${styleText2("gray", S_BAR)}
|
|
993
|
+
` : ""}${f}
|
|
994
|
+
`, c2 = this.value ? a2 : s;
|
|
995
|
+
switch (this.state) {
|
|
996
|
+
case "submit": {
|
|
997
|
+
const r2 = e ? `${styleText2("gray", S_BAR)} ` : "";
|
|
998
|
+
return `${o}${r2}${styleText2("dim", c2)}`;
|
|
999
|
+
}
|
|
1000
|
+
case "cancel": {
|
|
1001
|
+
const r2 = e ? `${styleText2("gray", S_BAR)} ` : "";
|
|
1002
|
+
return `${o}${r2}${styleText2(["strikethrough", "dim"], c2)}${e ? `
|
|
1003
|
+
${styleText2("gray", S_BAR)}` : ""}`;
|
|
1004
|
+
}
|
|
1005
|
+
default: {
|
|
1006
|
+
const r2 = e ? `${styleText2("cyan", S_BAR)} ` : "", g = e ? styleText2("cyan", S_BAR_END) : "";
|
|
1007
|
+
return `${o}${r2}${this.value ? `${styleText2("green", S_RADIO_ACTIVE)} ${a2}` : `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", a2)}`}${i2.vertical ? e ? `
|
|
1008
|
+
${styleText2("cyan", S_BAR)} ` : `
|
|
1009
|
+
` : ` ${styleText2("dim", "/")} `}${this.value ? `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", s)}` : `${styleText2("green", S_RADIO_ACTIVE)} ${s}`}
|
|
1010
|
+
${g}
|
|
864
1011
|
`;
|
|
1012
|
+
}
|
|
865
1013
|
}
|
|
866
1014
|
}
|
|
867
|
-
}
|
|
1015
|
+
}).prompt();
|
|
868
1016
|
};
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
1017
|
+
MULTISELECT_INSTRUCTIONS = [
|
|
1018
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
1019
|
+
`${styleText2("dim", "Space:")} select`,
|
|
1020
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
1021
|
+
];
|
|
1022
|
+
log = {
|
|
1023
|
+
message: (s = [], {
|
|
1024
|
+
symbol: e = styleText2("gray", S_BAR),
|
|
1025
|
+
secondarySymbol: r2 = styleText2("gray", S_BAR),
|
|
1026
|
+
output: m = process.stdout,
|
|
1027
|
+
spacing: l2 = 1,
|
|
1028
|
+
withGuide: c2
|
|
1029
|
+
} = {}) => {
|
|
1030
|
+
const t2 = [], o = c2 ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
|
|
1031
|
+
for (let i2 = 0; i2 < l2; i2++)
|
|
1032
|
+
t2.push(f);
|
|
1033
|
+
const g = Array.isArray(s) ? s : s.split(`
|
|
873
1034
|
`);
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
1035
|
+
if (g.length > 0) {
|
|
1036
|
+
const [i2, ...y2] = g;
|
|
1037
|
+
i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
|
|
1038
|
+
for (const p of y2)
|
|
1039
|
+
p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
|
|
1040
|
+
}
|
|
1041
|
+
m.write(`${t2.join(`
|
|
880
1042
|
`)}
|
|
881
1043
|
`);
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
1044
|
+
},
|
|
1045
|
+
info: (s, e) => {
|
|
1046
|
+
log.message(s, { ...e, symbol: styleText2("blue", S_INFO) });
|
|
1047
|
+
},
|
|
1048
|
+
success: (s, e) => {
|
|
1049
|
+
log.message(s, { ...e, symbol: styleText2("green", S_SUCCESS) });
|
|
1050
|
+
},
|
|
1051
|
+
step: (s, e) => {
|
|
1052
|
+
log.message(s, { ...e, symbol: styleText2("green", S_STEP_SUBMIT) });
|
|
1053
|
+
},
|
|
1054
|
+
warn: (s, e) => {
|
|
1055
|
+
log.message(s, { ...e, symbol: styleText2("yellow", S_WARN) });
|
|
1056
|
+
},
|
|
1057
|
+
/** alias for `log.warn()`. */
|
|
1058
|
+
warning: (s, e) => {
|
|
1059
|
+
log.warn(s, e);
|
|
1060
|
+
},
|
|
1061
|
+
error: (s, e) => {
|
|
1062
|
+
log.message(s, { ...e, symbol: styleText2("red", S_ERROR) });
|
|
1063
|
+
}
|
|
1064
|
+
};
|
|
1065
|
+
cancel = (o = "", t2) => {
|
|
1066
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_END)} ` : "";
|
|
1067
|
+
i2.write(`${e}${styleText2("red", o)}
|
|
898
1068
|
|
|
899
1069
|
`);
|
|
900
1070
|
};
|
|
901
|
-
|
|
902
|
-
const
|
|
903
|
-
|
|
1071
|
+
intro = (o = "", t2) => {
|
|
1072
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_START)} ` : "";
|
|
1073
|
+
i2.write(`${e}${o}
|
|
904
1074
|
`);
|
|
905
1075
|
};
|
|
906
|
-
|
|
907
|
-
const
|
|
908
|
-
${
|
|
909
|
-
|
|
1076
|
+
outro = (o = "", t2) => {
|
|
1077
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR)}
|
|
1078
|
+
${styleText2("gray", S_BAR_END)} ` : "";
|
|
1079
|
+
i2.write(`${e}${o}
|
|
910
1080
|
|
|
911
1081
|
`);
|
|
912
1082
|
};
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
const
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
1083
|
+
W$1 = (o) => o;
|
|
1084
|
+
C = (o, e, s) => {
|
|
1085
|
+
const a2 = {
|
|
1086
|
+
hard: true,
|
|
1087
|
+
trim: false
|
|
1088
|
+
}, i2 = wrapAnsi(o, e, a2).split(`
|
|
1089
|
+
`), 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);
|
|
1090
|
+
return wrapAnsi(o, g, a2);
|
|
1091
|
+
};
|
|
1092
|
+
note = (o = "", e = "", s) => {
|
|
1093
|
+
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(`
|
|
1094
|
+
`).map(c2), ""], n3 = dist_default2(e), t2 = Math.max(
|
|
1095
|
+
g.reduce((m, F) => {
|
|
1096
|
+
const O = dist_default2(F);
|
|
1097
|
+
return O > m ? O : m;
|
|
1098
|
+
}, 0),
|
|
1099
|
+
n3
|
|
1100
|
+
) + 2, h2 = g.map(
|
|
1101
|
+
(m) => `${styleText2("gray", S_BAR)} ${m}${" ".repeat(t2 - dist_default2(m))}${styleText2("gray", S_BAR)}`
|
|
1102
|
+
).join(`
|
|
1103
|
+
`), T = i2 ? `${styleText2("gray", S_BAR)}
|
|
1104
|
+
` : "", l$1 = i2 ? S_CONNECT_LEFT : S_CORNER_BOTTOM_LEFT;
|
|
1105
|
+
a2.write(
|
|
1106
|
+
`${T}${styleText2("green", S_STEP_SUBMIT)} ${styleText2("reset", e)} ${styleText2(
|
|
1107
|
+
"gray",
|
|
1108
|
+
S_BAR_H.repeat(Math.max(t2 - n3 - 1, 1)) + S_CORNER_TOP_RIGHT
|
|
1109
|
+
)}
|
|
1110
|
+
${h2}
|
|
1111
|
+
${styleText2("gray", l$1 + S_BAR_H.repeat(t2 + 2) + S_CORNER_BOTTOM_RIGHT)}
|
|
1112
|
+
`
|
|
1113
|
+
);
|
|
931
1114
|
};
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
1115
|
+
W = (l2) => styleText2("magenta", l2);
|
|
1116
|
+
spinner = ({
|
|
1117
|
+
indicator: l2 = "dots",
|
|
1118
|
+
onCancel: h2,
|
|
1119
|
+
output: n3 = process.stdout,
|
|
1120
|
+
cancelMessage: G,
|
|
1121
|
+
errorMessage: O,
|
|
1122
|
+
frames: E = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
|
|
1123
|
+
delay: F = unicode ? 80 : 120,
|
|
1124
|
+
signal: m,
|
|
1125
|
+
...I2
|
|
1126
|
+
} = {}) => {
|
|
1127
|
+
const u3 = isCI();
|
|
1128
|
+
let M, T, d = false, S = false, s = "", p, w = performance.now();
|
|
1129
|
+
const x = getColumns(n3), k = I2?.styleFrame ?? W, g = (e) => {
|
|
1130
|
+
const r2 = e > 1 ? O ?? settings.messages.error : G ?? settings.messages.cancel;
|
|
1131
|
+
S = e === 1, d && (a2(r2, e), S && typeof h2 == "function" && h2());
|
|
1132
|
+
}, f = () => g(2), i2 = () => g(1), A = () => {
|
|
1133
|
+
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);
|
|
1134
|
+
}, H = () => {
|
|
1135
|
+
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);
|
|
1136
|
+
}, y2 = () => {
|
|
1137
|
+
if (p === void 0) return;
|
|
1138
|
+
u3 && n3.write(`
|
|
946
1139
|
`);
|
|
947
|
-
const
|
|
1140
|
+
const r2 = wrapAnsi(p, x, {
|
|
1141
|
+
hard: true,
|
|
1142
|
+
trim: false
|
|
1143
|
+
}).split(`
|
|
948
1144
|
`);
|
|
949
|
-
|
|
950
|
-
},
|
|
951
|
-
const
|
|
952
|
-
return
|
|
953
|
-
},
|
|
954
|
-
|
|
1145
|
+
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());
|
|
1146
|
+
}, C2 = (e) => e.replace(/\.+$/, ""), _ = (e) => {
|
|
1147
|
+
const r2 = (performance.now() - e) / 1e3, t2 = Math.floor(r2 / 60), o = Math.floor(r2 % 60);
|
|
1148
|
+
return t2 > 0 ? `[${t2}m ${o}s]` : `[${o}s]`;
|
|
1149
|
+
}, N = I2.withGuide ?? settings.withGuide, P = (e = "") => {
|
|
1150
|
+
d = true, M = block({ output: n3 }), s = C2(e), w = performance.now(), N && n3.write(`${styleText2("gray", S_BAR)}
|
|
955
1151
|
`);
|
|
956
|
-
let
|
|
957
|
-
|
|
958
|
-
if (
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
1152
|
+
let r2 = 0, t2 = 0;
|
|
1153
|
+
A(), T = setInterval(() => {
|
|
1154
|
+
if (u3 && s === p)
|
|
1155
|
+
return;
|
|
1156
|
+
y2(), p = s;
|
|
1157
|
+
const o = k(E[r2]);
|
|
1158
|
+
let v;
|
|
1159
|
+
if (u3)
|
|
1160
|
+
v = `${o} ${s}...`;
|
|
1161
|
+
else if (l2 === "timer")
|
|
1162
|
+
v = `${o} ${s} ${_(w)}`;
|
|
964
1163
|
else {
|
|
965
|
-
const
|
|
966
|
-
|
|
967
|
-
}
|
|
968
|
-
const
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
1164
|
+
const B = ".".repeat(Math.floor(t2)).slice(0, 3);
|
|
1165
|
+
v = `${o} ${s}${B}`;
|
|
1166
|
+
}
|
|
1167
|
+
const j = wrapAnsi(v, x, {
|
|
1168
|
+
hard: true,
|
|
1169
|
+
trim: false
|
|
1170
|
+
});
|
|
1171
|
+
n3.write(j), r2 = r2 + 1 < E.length ? r2 + 1 : 0, t2 = t2 < 4 ? t2 + 0.125 : 0;
|
|
1172
|
+
}, F);
|
|
1173
|
+
}, a2 = (e = "", r2 = 0, t2 = false) => {
|
|
1174
|
+
if (!d) return;
|
|
1175
|
+
d = false, clearInterval(T), y2();
|
|
1176
|
+
const o = r2 === 0 ? styleText2("green", S_STEP_SUBMIT) : r2 === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
|
|
1177
|
+
s = e ?? s, t2 || (l2 === "timer" ? n3.write(`${o} ${s} ${_(w)}
|
|
1178
|
+
`) : n3.write(`${o} ${s}
|
|
1179
|
+
`)), H(), M();
|
|
1180
|
+
};
|
|
1181
|
+
return {
|
|
1182
|
+
start: P,
|
|
1183
|
+
stop: (e = "") => a2(e, 0),
|
|
1184
|
+
message: (e = "") => {
|
|
1185
|
+
s = C2(e ?? s);
|
|
1186
|
+
},
|
|
1187
|
+
cancel: (e = "") => a2(e, 1),
|
|
1188
|
+
error: (e = "") => a2(e, 2),
|
|
1189
|
+
clear: () => a2("", 0, true),
|
|
1190
|
+
get isCancelled() {
|
|
1191
|
+
return S;
|
|
1192
|
+
}
|
|
978
1193
|
};
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
};
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
1194
|
+
};
|
|
1195
|
+
u2 = {
|
|
1196
|
+
light: unicodeOr("\u2500", "-"),
|
|
1197
|
+
heavy: unicodeOr("\u2501", "="),
|
|
1198
|
+
block: unicodeOr("\u2588", "#")
|
|
1199
|
+
};
|
|
1200
|
+
SELECT_INSTRUCTIONS = [
|
|
1201
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
1202
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
1203
|
+
];
|
|
1204
|
+
c = (t2, o) => t2.includes(`
|
|
1205
|
+
`) ? t2.split(`
|
|
1206
|
+
`).map((d) => o(d)).join(`
|
|
1207
|
+
`) : o(t2);
|
|
1208
|
+
select = (t2) => {
|
|
1209
|
+
const o = (n3, m) => {
|
|
1210
|
+
if (n3 === void 0)
|
|
1211
|
+
return "";
|
|
1212
|
+
const s = n3.label ?? String(n3.value);
|
|
1213
|
+
switch (m) {
|
|
994
1214
|
case "disabled":
|
|
995
|
-
return `${
|
|
1215
|
+
return `${styleText2("gray", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("gray", i2))}${n3.hint ? ` ${styleText2("dim", `(${n3.hint ?? "disabled"})`)}` : ""}`;
|
|
996
1216
|
case "selected":
|
|
997
|
-
return `${
|
|
1217
|
+
return `${c(s, (i2) => styleText2("dim", i2))}`;
|
|
998
1218
|
case "active":
|
|
999
|
-
return `${
|
|
1219
|
+
return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${n3.hint ? ` ${styleText2("dim", `(${n3.hint})`)}` : ""}`;
|
|
1000
1220
|
case "cancelled":
|
|
1001
|
-
return `${
|
|
1221
|
+
return `${c(s, (i2) => styleText2(["strikethrough", "dim"], i2))}`;
|
|
1002
1222
|
default:
|
|
1003
|
-
return `${
|
|
1004
|
-
}
|
|
1005
|
-
};
|
|
1006
|
-
return new
|
|
1007
|
-
|
|
1008
|
-
|
|
1223
|
+
return `${styleText2("dim", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("dim", i2))}`;
|
|
1224
|
+
}
|
|
1225
|
+
}, d = t2.showInstructions ?? true;
|
|
1226
|
+
return new n$1({
|
|
1227
|
+
options: t2.options,
|
|
1228
|
+
signal: t2.signal,
|
|
1229
|
+
input: t2.input,
|
|
1230
|
+
output: t2.output,
|
|
1231
|
+
initialValue: t2.initialValue,
|
|
1232
|
+
render() {
|
|
1233
|
+
const n3 = t2.withGuide ?? settings.withGuide, m = `${symbol(this.state)} `, s = `${symbolBar(this.state)} `, i2 = wrapTextWithPrefix(
|
|
1234
|
+
t2.output,
|
|
1235
|
+
t2.message,
|
|
1236
|
+
s,
|
|
1237
|
+
m
|
|
1238
|
+
), u3 = `${n3 ? `${styleText2("gray", S_BAR)}
|
|
1239
|
+
` : ""}${i2}
|
|
1009
1240
|
`;
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
${
|
|
1241
|
+
switch (this.state) {
|
|
1242
|
+
case "submit": {
|
|
1243
|
+
const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
|
|
1244
|
+
t2.output,
|
|
1245
|
+
o(this.options[this.cursor], "selected"),
|
|
1246
|
+
r2
|
|
1247
|
+
);
|
|
1248
|
+
return `${u3}${a2}`;
|
|
1249
|
+
}
|
|
1250
|
+
case "cancel": {
|
|
1251
|
+
const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
|
|
1252
|
+
t2.output,
|
|
1253
|
+
o(this.options[this.cursor], "cancelled"),
|
|
1254
|
+
r2
|
|
1255
|
+
);
|
|
1256
|
+
return `${u3}${a2}${n3 ? `
|
|
1257
|
+
${styleText2("gray", S_BAR)}` : ""}`;
|
|
1258
|
+
}
|
|
1259
|
+
default: {
|
|
1260
|
+
const r2 = n3 ? `${styleText2("cyan", S_BAR)} ` : "", a2 = u3.split(`
|
|
1261
|
+
`).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], b = p.join(`
|
|
1262
|
+
`), f = p.length + 1;
|
|
1263
|
+
return `${u3}${r2}${limitOptions({
|
|
1264
|
+
output: t2.output,
|
|
1265
|
+
cursor: this.cursor,
|
|
1266
|
+
options: this.options,
|
|
1267
|
+
maxItems: t2.maxItems,
|
|
1268
|
+
columnPadding: r2.length,
|
|
1269
|
+
rowPadding: a2 + f,
|
|
1270
|
+
style: (g, x) => o(g, g.disabled ? "disabled" : x ? "active" : "inactive")
|
|
1271
|
+
}).join(`
|
|
1272
|
+
${r2}`)}
|
|
1273
|
+
${b}
|
|
1026
1274
|
`;
|
|
1275
|
+
}
|
|
1027
1276
|
}
|
|
1028
1277
|
}
|
|
1029
|
-
}
|
|
1278
|
+
}).prompt();
|
|
1030
1279
|
};
|
|
1031
|
-
|
|
1280
|
+
i = `${styleText2("gray", S_BAR)} `;
|
|
1032
1281
|
}
|
|
1033
1282
|
});
|
|
1034
1283
|
|
|
@@ -1041,9 +1290,9 @@ function supportsColor() {
|
|
|
1041
1290
|
}
|
|
1042
1291
|
return process.stdout.isTTY === true;
|
|
1043
1292
|
}
|
|
1044
|
-
function colorize(
|
|
1045
|
-
if (!supportsColor()) return
|
|
1046
|
-
return `${color}${
|
|
1293
|
+
function colorize(text2, color) {
|
|
1294
|
+
if (!supportsColor()) return text2;
|
|
1295
|
+
return `${color}${text2}${colors.reset}`;
|
|
1047
1296
|
}
|
|
1048
1297
|
function stringify(value) {
|
|
1049
1298
|
if (typeof value === "string") return value;
|
|
@@ -1073,7 +1322,7 @@ function stringify(value) {
|
|
|
1073
1322
|
function formatMessage(...args) {
|
|
1074
1323
|
return args.map(stringify).join(" ");
|
|
1075
1324
|
}
|
|
1076
|
-
var colors, currentLogLevel,
|
|
1325
|
+
var colors, currentLogLevel, log2, error, warn, info, success;
|
|
1077
1326
|
var init_cli_output = __esm({
|
|
1078
1327
|
"packages/tooling/src/utils/cli-output.ts"() {
|
|
1079
1328
|
"use strict";
|
|
@@ -1106,7 +1355,7 @@ var init_cli_output = __esm({
|
|
|
1106
1355
|
currentLogLevel = envLevel;
|
|
1107
1356
|
}
|
|
1108
1357
|
}
|
|
1109
|
-
|
|
1358
|
+
log2 = {
|
|
1110
1359
|
/**
|
|
1111
1360
|
* Logs an error message (always shows unless Quiet level)
|
|
1112
1361
|
* Uses clack's log.error + explicit red color
|
|
@@ -1114,7 +1363,7 @@ var init_cli_output = __esm({
|
|
|
1114
1363
|
error(...args) {
|
|
1115
1364
|
if (currentLogLevel < 0 /* Quiet */) return;
|
|
1116
1365
|
const message = formatMessage(...args);
|
|
1117
|
-
|
|
1366
|
+
log.error(colorize(message, colors.brightRed));
|
|
1118
1367
|
},
|
|
1119
1368
|
/**
|
|
1120
1369
|
* Logs a warning message (shows at Normal level and above)
|
|
@@ -1123,7 +1372,7 @@ var init_cli_output = __esm({
|
|
|
1123
1372
|
warn(...args) {
|
|
1124
1373
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
1125
1374
|
const message = formatMessage(...args);
|
|
1126
|
-
|
|
1375
|
+
log.warn(colorize(message, colors.brightYellow));
|
|
1127
1376
|
},
|
|
1128
1377
|
/**
|
|
1129
1378
|
* Logs an info message (shows at Normal level and above)
|
|
@@ -1132,7 +1381,7 @@ var init_cli_output = __esm({
|
|
|
1132
1381
|
info(...args) {
|
|
1133
1382
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
1134
1383
|
const message = formatMessage(...args);
|
|
1135
|
-
|
|
1384
|
+
log.info(colorize(message, colors.brightCyan));
|
|
1136
1385
|
},
|
|
1137
1386
|
/**
|
|
1138
1387
|
* Logs a success message (shows at Normal level and above)
|
|
@@ -1141,7 +1390,7 @@ var init_cli_output = __esm({
|
|
|
1141
1390
|
success(...args) {
|
|
1142
1391
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
1143
1392
|
const message = formatMessage(...args);
|
|
1144
|
-
|
|
1393
|
+
log.success(colorize(message, colors.brightGreen));
|
|
1145
1394
|
},
|
|
1146
1395
|
/**
|
|
1147
1396
|
* Logs a debug message (only shows at Verbose level and above)
|
|
@@ -1150,7 +1399,7 @@ var init_cli_output = __esm({
|
|
|
1150
1399
|
debug(...args) {
|
|
1151
1400
|
if (currentLogLevel < 2 /* Verbose */) return;
|
|
1152
1401
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
1153
|
-
|
|
1402
|
+
log.message(
|
|
1154
1403
|
colorize(
|
|
1155
1404
|
`[${timeStamp}] \u{1F50D} DEBUG: ${formatMessage(...args)}`,
|
|
1156
1405
|
colors.gray
|
|
@@ -1164,7 +1413,7 @@ var init_cli_output = __esm({
|
|
|
1164
1413
|
trace(...args) {
|
|
1165
1414
|
if (currentLogLevel < 3 /* Debug */) return;
|
|
1166
1415
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
1167
|
-
|
|
1416
|
+
log.message(
|
|
1168
1417
|
colorize(
|
|
1169
1418
|
`[${timeStamp}] \u{1F52C} TRACE: ${formatMessage(...args)}`,
|
|
1170
1419
|
colors.gray
|
|
@@ -1172,10 +1421,10 @@ var init_cli_output = __esm({
|
|
|
1172
1421
|
);
|
|
1173
1422
|
}
|
|
1174
1423
|
};
|
|
1175
|
-
error =
|
|
1176
|
-
warn =
|
|
1177
|
-
info =
|
|
1178
|
-
success =
|
|
1424
|
+
error = log2.error.bind(log2);
|
|
1425
|
+
warn = log2.warn.bind(log2);
|
|
1426
|
+
info = log2.info.bind(log2);
|
|
1427
|
+
success = log2.success.bind(log2);
|
|
1179
1428
|
}
|
|
1180
1429
|
});
|
|
1181
1430
|
|
|
@@ -1535,9 +1784,9 @@ var require_is_glob = __commonJS({
|
|
|
1535
1784
|
index += 2;
|
|
1536
1785
|
var close = chars[open];
|
|
1537
1786
|
if (close) {
|
|
1538
|
-
var
|
|
1539
|
-
if (
|
|
1540
|
-
index =
|
|
1787
|
+
var n3 = str.indexOf(close, index);
|
|
1788
|
+
if (n3 !== -1) {
|
|
1789
|
+
index = n3 + 1;
|
|
1541
1790
|
}
|
|
1542
1791
|
}
|
|
1543
1792
|
if (str[index] === "!") {
|
|
@@ -1563,9 +1812,9 @@ var require_is_glob = __commonJS({
|
|
|
1563
1812
|
index += 2;
|
|
1564
1813
|
var close = chars[open];
|
|
1565
1814
|
if (close) {
|
|
1566
|
-
var
|
|
1567
|
-
if (
|
|
1568
|
-
index =
|
|
1815
|
+
var n3 = str.indexOf(close, index);
|
|
1816
|
+
if (n3 !== -1) {
|
|
1817
|
+
index = n3 + 1;
|
|
1569
1818
|
}
|
|
1570
1819
|
}
|
|
1571
1820
|
if (str[index] === "!") {
|
|
@@ -1643,8 +1892,8 @@ var require_utils = __commonJS({
|
|
|
1643
1892
|
if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
|
|
1644
1893
|
return (Number(max) - Number(min)) / Number(step) >= limit;
|
|
1645
1894
|
};
|
|
1646
|
-
exports.escapeNode = (
|
|
1647
|
-
const node =
|
|
1895
|
+
exports.escapeNode = (block2, n3 = 0, type) => {
|
|
1896
|
+
const node = block2.nodes[n3];
|
|
1648
1897
|
if (!node) return;
|
|
1649
1898
|
if (type && node.type === type || node.type === "open" || node.type === "close") {
|
|
1650
1899
|
if (node.escaped !== true) {
|
|
@@ -1661,15 +1910,15 @@ var require_utils = __commonJS({
|
|
|
1661
1910
|
}
|
|
1662
1911
|
return false;
|
|
1663
1912
|
};
|
|
1664
|
-
exports.isInvalidBrace = (
|
|
1665
|
-
if (
|
|
1666
|
-
if (
|
|
1667
|
-
if (
|
|
1668
|
-
|
|
1913
|
+
exports.isInvalidBrace = (block2) => {
|
|
1914
|
+
if (block2.type !== "brace") return false;
|
|
1915
|
+
if (block2.invalid === true || block2.dollar) return true;
|
|
1916
|
+
if (block2.commas >> 0 + block2.ranges >> 0 === 0) {
|
|
1917
|
+
block2.invalid = true;
|
|
1669
1918
|
return true;
|
|
1670
1919
|
}
|
|
1671
|
-
if (
|
|
1672
|
-
|
|
1920
|
+
if (block2.open !== true || block2.close !== true) {
|
|
1921
|
+
block2.invalid = true;
|
|
1673
1922
|
return true;
|
|
1674
1923
|
}
|
|
1675
1924
|
return false;
|
|
@@ -1688,8 +1937,8 @@ var require_utils = __commonJS({
|
|
|
1688
1937
|
exports.flatten = (...args) => {
|
|
1689
1938
|
const result = [];
|
|
1690
1939
|
const flat = (arr) => {
|
|
1691
|
-
for (let
|
|
1692
|
-
const ele = arr[
|
|
1940
|
+
for (let i2 = 0; i2 < arr.length; i2++) {
|
|
1941
|
+
const ele = arr[i2];
|
|
1693
1942
|
if (Array.isArray(ele)) {
|
|
1694
1943
|
flat(ele);
|
|
1695
1944
|
continue;
|
|
@@ -1783,9 +2032,9 @@ var require_to_regex_range = __commonJS({
|
|
|
1783
2032
|
if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
|
|
1784
2033
|
return toRegexRange.cache[cacheKey].result;
|
|
1785
2034
|
}
|
|
1786
|
-
let
|
|
2035
|
+
let a2 = Math.min(min, max);
|
|
1787
2036
|
let b = Math.max(min, max);
|
|
1788
|
-
if (Math.abs(
|
|
2037
|
+
if (Math.abs(a2 - b) === 1) {
|
|
1789
2038
|
let result = min + "|" + max;
|
|
1790
2039
|
if (opts.capture) {
|
|
1791
2040
|
return `(${result})`;
|
|
@@ -1796,20 +2045,20 @@ var require_to_regex_range = __commonJS({
|
|
|
1796
2045
|
return `(?:${result})`;
|
|
1797
2046
|
}
|
|
1798
2047
|
let isPadded = hasPadding(min) || hasPadding(max);
|
|
1799
|
-
let state = { min, max, a, b };
|
|
2048
|
+
let state = { min, max, a: a2, b };
|
|
1800
2049
|
let positives = [];
|
|
1801
2050
|
let negatives = [];
|
|
1802
2051
|
if (isPadded) {
|
|
1803
2052
|
state.isPadded = isPadded;
|
|
1804
2053
|
state.maxLen = String(state.max).length;
|
|
1805
2054
|
}
|
|
1806
|
-
if (
|
|
2055
|
+
if (a2 < 0) {
|
|
1807
2056
|
let newMin = b < 0 ? Math.abs(b) : 1;
|
|
1808
|
-
negatives = splitToPatterns(newMin, Math.abs(
|
|
1809
|
-
|
|
2057
|
+
negatives = splitToPatterns(newMin, Math.abs(a2), state, opts);
|
|
2058
|
+
a2 = state.a = 0;
|
|
1810
2059
|
}
|
|
1811
2060
|
if (b >= 0) {
|
|
1812
|
-
positives = splitToPatterns(
|
|
2061
|
+
positives = splitToPatterns(a2, b, state, opts);
|
|
1813
2062
|
}
|
|
1814
2063
|
state.negatives = negatives;
|
|
1815
2064
|
state.positives = positives;
|
|
@@ -1857,8 +2106,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1857
2106
|
let digits = zipped.length;
|
|
1858
2107
|
let pattern = "";
|
|
1859
2108
|
let count = 0;
|
|
1860
|
-
for (let
|
|
1861
|
-
let [startDigit, stopDigit] = zipped[
|
|
2109
|
+
for (let i2 = 0; i2 < digits; i2++) {
|
|
2110
|
+
let [startDigit, stopDigit] = zipped[i2];
|
|
1862
2111
|
if (startDigit === stopDigit) {
|
|
1863
2112
|
pattern += startDigit;
|
|
1864
2113
|
} else if (startDigit !== "0" || stopDigit !== "9") {
|
|
@@ -1877,8 +2126,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1877
2126
|
let tokens = [];
|
|
1878
2127
|
let start = min;
|
|
1879
2128
|
let prev;
|
|
1880
|
-
for (let
|
|
1881
|
-
let max2 = ranges[
|
|
2129
|
+
for (let i2 = 0; i2 < ranges.length; i2++) {
|
|
2130
|
+
let max2 = ranges[i2];
|
|
1882
2131
|
let obj = rangeToPattern(String(start), String(max2), options);
|
|
1883
2132
|
let zeros = "";
|
|
1884
2133
|
if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
|
|
@@ -1913,13 +2162,13 @@ var require_to_regex_range = __commonJS({
|
|
|
1913
2162
|
}
|
|
1914
2163
|
return result;
|
|
1915
2164
|
}
|
|
1916
|
-
function zip(
|
|
2165
|
+
function zip(a2, b) {
|
|
1917
2166
|
let arr = [];
|
|
1918
|
-
for (let
|
|
2167
|
+
for (let i2 = 0; i2 < a2.length; i2++) arr.push([a2[i2], b[i2]]);
|
|
1919
2168
|
return arr;
|
|
1920
2169
|
}
|
|
1921
|
-
function compare(
|
|
1922
|
-
return
|
|
2170
|
+
function compare(a2, b) {
|
|
2171
|
+
return a2 > b ? 1 : b > a2 ? -1 : 0;
|
|
1923
2172
|
}
|
|
1924
2173
|
function contains(arr, key, val) {
|
|
1925
2174
|
return arr.some((ele) => ele[key] === val);
|
|
@@ -1937,8 +2186,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1937
2186
|
}
|
|
1938
2187
|
return "";
|
|
1939
2188
|
}
|
|
1940
|
-
function toCharacterClass(
|
|
1941
|
-
return `[${
|
|
2189
|
+
function toCharacterClass(a2, b, options) {
|
|
2190
|
+
return `[${a2}${b - a2 === 1 ? "" : "-"}${b}]`;
|
|
1942
2191
|
}
|
|
1943
2192
|
function hasPadding(str) {
|
|
1944
2193
|
return /^-?(0+)\d/.test(str);
|
|
@@ -2017,8 +2266,8 @@ var require_fill_range = __commonJS({
|
|
|
2017
2266
|
return negative ? "-" + input : input;
|
|
2018
2267
|
};
|
|
2019
2268
|
var toSequence = (parts, options, maxLen) => {
|
|
2020
|
-
parts.negatives.sort((
|
|
2021
|
-
parts.positives.sort((
|
|
2269
|
+
parts.negatives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
2270
|
+
parts.positives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
2022
2271
|
let prefix = options.capture ? "" : "?:";
|
|
2023
2272
|
let positives = "";
|
|
2024
2273
|
let negatives = "";
|
|
@@ -2039,12 +2288,12 @@ var require_fill_range = __commonJS({
|
|
|
2039
2288
|
}
|
|
2040
2289
|
return result;
|
|
2041
2290
|
};
|
|
2042
|
-
var toRange = (
|
|
2291
|
+
var toRange = (a2, b, isNumbers, options) => {
|
|
2043
2292
|
if (isNumbers) {
|
|
2044
|
-
return toRegexRange(
|
|
2293
|
+
return toRegexRange(a2, b, { wrap: false, ...options });
|
|
2045
2294
|
}
|
|
2046
|
-
let start = String.fromCharCode(
|
|
2047
|
-
if (
|
|
2295
|
+
let start = String.fromCharCode(a2);
|
|
2296
|
+
if (a2 === b) return start;
|
|
2048
2297
|
let stop = String.fromCharCode(b);
|
|
2049
2298
|
return `[${start}-${stop}]`;
|
|
2050
2299
|
};
|
|
@@ -2070,15 +2319,15 @@ var require_fill_range = __commonJS({
|
|
|
2070
2319
|
return [];
|
|
2071
2320
|
};
|
|
2072
2321
|
var fillNumbers = (start, end, step = 1, options = {}) => {
|
|
2073
|
-
let
|
|
2322
|
+
let a2 = Number(start);
|
|
2074
2323
|
let b = Number(end);
|
|
2075
|
-
if (!Number.isInteger(
|
|
2324
|
+
if (!Number.isInteger(a2) || !Number.isInteger(b)) {
|
|
2076
2325
|
if (options.strictRanges === true) throw rangeError([start, end]);
|
|
2077
2326
|
return [];
|
|
2078
2327
|
}
|
|
2079
|
-
if (
|
|
2328
|
+
if (a2 === 0) a2 = 0;
|
|
2080
2329
|
if (b === 0) b = 0;
|
|
2081
|
-
let descending =
|
|
2330
|
+
let descending = a2 > b;
|
|
2082
2331
|
let startString = String(start);
|
|
2083
2332
|
let endString = String(end);
|
|
2084
2333
|
let stepString = String(step);
|
|
@@ -2094,13 +2343,13 @@ var require_fill_range = __commonJS({
|
|
|
2094
2343
|
let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
|
|
2095
2344
|
let range = [];
|
|
2096
2345
|
let index = 0;
|
|
2097
|
-
while (descending ?
|
|
2346
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
2098
2347
|
if (options.toRegex === true && step > 1) {
|
|
2099
|
-
push(
|
|
2348
|
+
push(a2);
|
|
2100
2349
|
} else {
|
|
2101
|
-
range.push(pad(format(
|
|
2350
|
+
range.push(pad(format(a2, index), maxLen, toNumber));
|
|
2102
2351
|
}
|
|
2103
|
-
|
|
2352
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
2104
2353
|
index++;
|
|
2105
2354
|
}
|
|
2106
2355
|
if (options.toRegex === true) {
|
|
@@ -2113,19 +2362,19 @@ var require_fill_range = __commonJS({
|
|
|
2113
2362
|
return invalidRange(start, end, options);
|
|
2114
2363
|
}
|
|
2115
2364
|
let format = options.transform || ((val) => String.fromCharCode(val));
|
|
2116
|
-
let
|
|
2365
|
+
let a2 = `${start}`.charCodeAt(0);
|
|
2117
2366
|
let b = `${end}`.charCodeAt(0);
|
|
2118
|
-
let descending =
|
|
2119
|
-
let min = Math.min(
|
|
2120
|
-
let max = Math.max(
|
|
2367
|
+
let descending = a2 > b;
|
|
2368
|
+
let min = Math.min(a2, b);
|
|
2369
|
+
let max = Math.max(a2, b);
|
|
2121
2370
|
if (options.toRegex && step === 1) {
|
|
2122
2371
|
return toRange(min, max, false, options);
|
|
2123
2372
|
}
|
|
2124
2373
|
let range = [];
|
|
2125
2374
|
let index = 0;
|
|
2126
|
-
while (descending ?
|
|
2127
|
-
range.push(format(
|
|
2128
|
-
|
|
2375
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
2376
|
+
range.push(format(a2, index));
|
|
2377
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
2129
2378
|
index++;
|
|
2130
2379
|
}
|
|
2131
2380
|
if (options.toRegex === true) {
|
|
@@ -2248,18 +2497,18 @@ var require_expand = __commonJS({
|
|
|
2248
2497
|
const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
|
|
2249
2498
|
const walk = (node, parent = {}) => {
|
|
2250
2499
|
node.queue = [];
|
|
2251
|
-
let
|
|
2252
|
-
let
|
|
2253
|
-
while (
|
|
2254
|
-
|
|
2255
|
-
|
|
2500
|
+
let p = parent;
|
|
2501
|
+
let q = parent.queue;
|
|
2502
|
+
while (p.type !== "brace" && p.type !== "root" && p.parent) {
|
|
2503
|
+
p = p.parent;
|
|
2504
|
+
q = p.queue;
|
|
2256
2505
|
}
|
|
2257
2506
|
if (node.invalid || node.dollar) {
|
|
2258
|
-
|
|
2507
|
+
q.push(append(q.pop(), stringify2(node, options)));
|
|
2259
2508
|
return;
|
|
2260
2509
|
}
|
|
2261
2510
|
if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
|
|
2262
|
-
|
|
2511
|
+
q.push(append(q.pop(), ["{}"]));
|
|
2263
2512
|
return;
|
|
2264
2513
|
}
|
|
2265
2514
|
if (node.nodes && node.ranges > 0) {
|
|
@@ -2271,26 +2520,26 @@ var require_expand = __commonJS({
|
|
|
2271
2520
|
if (range.length === 0) {
|
|
2272
2521
|
range = stringify2(node, options);
|
|
2273
2522
|
}
|
|
2274
|
-
|
|
2523
|
+
q.push(append(q.pop(), range));
|
|
2275
2524
|
node.nodes = [];
|
|
2276
2525
|
return;
|
|
2277
2526
|
}
|
|
2278
2527
|
const enclose = utils.encloseBrace(node);
|
|
2279
2528
|
let queue = node.queue;
|
|
2280
|
-
let
|
|
2281
|
-
while (
|
|
2282
|
-
|
|
2283
|
-
queue =
|
|
2529
|
+
let block2 = node;
|
|
2530
|
+
while (block2.type !== "brace" && block2.type !== "root" && block2.parent) {
|
|
2531
|
+
block2 = block2.parent;
|
|
2532
|
+
queue = block2.queue;
|
|
2284
2533
|
}
|
|
2285
|
-
for (let
|
|
2286
|
-
const child = node.nodes[
|
|
2534
|
+
for (let i2 = 0; i2 < node.nodes.length; i2++) {
|
|
2535
|
+
const child = node.nodes[i2];
|
|
2287
2536
|
if (child.type === "comma" && node.type === "brace") {
|
|
2288
|
-
if (
|
|
2537
|
+
if (i2 === 1) queue.push("");
|
|
2289
2538
|
queue.push("");
|
|
2290
2539
|
continue;
|
|
2291
2540
|
}
|
|
2292
2541
|
if (child.type === "close") {
|
|
2293
|
-
|
|
2542
|
+
q.push(append(q.pop(), queue, enclose));
|
|
2294
2543
|
continue;
|
|
2295
2544
|
}
|
|
2296
2545
|
if (child.value && child.type !== "open") {
|
|
@@ -2457,7 +2706,7 @@ var require_parse = __commonJS({
|
|
|
2457
2706
|
}
|
|
2458
2707
|
const ast = { type: "root", input, nodes: [] };
|
|
2459
2708
|
const stack = [ast];
|
|
2460
|
-
let
|
|
2709
|
+
let block2 = ast;
|
|
2461
2710
|
let prev = ast;
|
|
2462
2711
|
let brackets = 0;
|
|
2463
2712
|
const length = input.length;
|
|
@@ -2473,15 +2722,15 @@ var require_parse = __commonJS({
|
|
|
2473
2722
|
prev.value += node.value;
|
|
2474
2723
|
return;
|
|
2475
2724
|
}
|
|
2476
|
-
|
|
2477
|
-
node.parent =
|
|
2725
|
+
block2.nodes.push(node);
|
|
2726
|
+
node.parent = block2;
|
|
2478
2727
|
node.prev = prev;
|
|
2479
2728
|
prev = node;
|
|
2480
2729
|
return node;
|
|
2481
2730
|
};
|
|
2482
2731
|
push({ type: "bos" });
|
|
2483
2732
|
while (index < length) {
|
|
2484
|
-
|
|
2733
|
+
block2 = stack[stack.length - 1];
|
|
2485
2734
|
value = advance();
|
|
2486
2735
|
if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
|
|
2487
2736
|
continue;
|
|
@@ -2518,19 +2767,19 @@ var require_parse = __commonJS({
|
|
|
2518
2767
|
continue;
|
|
2519
2768
|
}
|
|
2520
2769
|
if (value === CHAR_LEFT_PARENTHESES) {
|
|
2521
|
-
|
|
2522
|
-
stack.push(
|
|
2770
|
+
block2 = push({ type: "paren", nodes: [] });
|
|
2771
|
+
stack.push(block2);
|
|
2523
2772
|
push({ type: "text", value });
|
|
2524
2773
|
continue;
|
|
2525
2774
|
}
|
|
2526
2775
|
if (value === CHAR_RIGHT_PARENTHESES) {
|
|
2527
|
-
if (
|
|
2776
|
+
if (block2.type !== "paren") {
|
|
2528
2777
|
push({ type: "text", value });
|
|
2529
2778
|
continue;
|
|
2530
2779
|
}
|
|
2531
|
-
|
|
2780
|
+
block2 = stack.pop();
|
|
2532
2781
|
push({ type: "text", value });
|
|
2533
|
-
|
|
2782
|
+
block2 = stack[stack.length - 1];
|
|
2534
2783
|
continue;
|
|
2535
2784
|
}
|
|
2536
2785
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
@@ -2555,7 +2804,7 @@ var require_parse = __commonJS({
|
|
|
2555
2804
|
}
|
|
2556
2805
|
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
2557
2806
|
depth++;
|
|
2558
|
-
const dollar = prev.value && prev.value.slice(-1) === "$" ||
|
|
2807
|
+
const dollar = prev.value && prev.value.slice(-1) === "$" || block2.dollar === true;
|
|
2559
2808
|
const brace = {
|
|
2560
2809
|
type: "brace",
|
|
2561
2810
|
open: true,
|
|
@@ -2566,52 +2815,52 @@ var require_parse = __commonJS({
|
|
|
2566
2815
|
ranges: 0,
|
|
2567
2816
|
nodes: []
|
|
2568
2817
|
};
|
|
2569
|
-
|
|
2570
|
-
stack.push(
|
|
2818
|
+
block2 = push(brace);
|
|
2819
|
+
stack.push(block2);
|
|
2571
2820
|
push({ type: "open", value });
|
|
2572
2821
|
continue;
|
|
2573
2822
|
}
|
|
2574
2823
|
if (value === CHAR_RIGHT_CURLY_BRACE) {
|
|
2575
|
-
if (
|
|
2824
|
+
if (block2.type !== "brace") {
|
|
2576
2825
|
push({ type: "text", value });
|
|
2577
2826
|
continue;
|
|
2578
2827
|
}
|
|
2579
2828
|
const type = "close";
|
|
2580
|
-
|
|
2581
|
-
|
|
2829
|
+
block2 = stack.pop();
|
|
2830
|
+
block2.close = true;
|
|
2582
2831
|
push({ type, value });
|
|
2583
2832
|
depth--;
|
|
2584
|
-
|
|
2833
|
+
block2 = stack[stack.length - 1];
|
|
2585
2834
|
continue;
|
|
2586
2835
|
}
|
|
2587
2836
|
if (value === CHAR_COMMA && depth > 0) {
|
|
2588
|
-
if (
|
|
2589
|
-
|
|
2590
|
-
const open =
|
|
2591
|
-
|
|
2837
|
+
if (block2.ranges > 0) {
|
|
2838
|
+
block2.ranges = 0;
|
|
2839
|
+
const open = block2.nodes.shift();
|
|
2840
|
+
block2.nodes = [open, { type: "text", value: stringify2(block2) }];
|
|
2592
2841
|
}
|
|
2593
2842
|
push({ type: "comma", value });
|
|
2594
|
-
|
|
2843
|
+
block2.commas++;
|
|
2595
2844
|
continue;
|
|
2596
2845
|
}
|
|
2597
|
-
if (value === CHAR_DOT && depth > 0 &&
|
|
2598
|
-
const siblings =
|
|
2846
|
+
if (value === CHAR_DOT && depth > 0 && block2.commas === 0) {
|
|
2847
|
+
const siblings = block2.nodes;
|
|
2599
2848
|
if (depth === 0 || siblings.length === 0) {
|
|
2600
2849
|
push({ type: "text", value });
|
|
2601
2850
|
continue;
|
|
2602
2851
|
}
|
|
2603
2852
|
if (prev.type === "dot") {
|
|
2604
|
-
|
|
2853
|
+
block2.range = [];
|
|
2605
2854
|
prev.value += value;
|
|
2606
2855
|
prev.type = "range";
|
|
2607
|
-
if (
|
|
2608
|
-
|
|
2609
|
-
|
|
2856
|
+
if (block2.nodes.length !== 3 && block2.nodes.length !== 5) {
|
|
2857
|
+
block2.invalid = true;
|
|
2858
|
+
block2.ranges = 0;
|
|
2610
2859
|
prev.type = "text";
|
|
2611
2860
|
continue;
|
|
2612
2861
|
}
|
|
2613
|
-
|
|
2614
|
-
|
|
2862
|
+
block2.ranges++;
|
|
2863
|
+
block2.args = [];
|
|
2615
2864
|
continue;
|
|
2616
2865
|
}
|
|
2617
2866
|
if (prev.type === "range") {
|
|
@@ -2619,7 +2868,7 @@ var require_parse = __commonJS({
|
|
|
2619
2868
|
const before = siblings[siblings.length - 1];
|
|
2620
2869
|
before.value += prev.value + value;
|
|
2621
2870
|
prev = before;
|
|
2622
|
-
|
|
2871
|
+
block2.ranges--;
|
|
2623
2872
|
continue;
|
|
2624
2873
|
}
|
|
2625
2874
|
push({ type: "dot", value });
|
|
@@ -2628,9 +2877,9 @@ var require_parse = __commonJS({
|
|
|
2628
2877
|
push({ type: "text", value });
|
|
2629
2878
|
}
|
|
2630
2879
|
do {
|
|
2631
|
-
|
|
2632
|
-
if (
|
|
2633
|
-
|
|
2880
|
+
block2 = stack.pop();
|
|
2881
|
+
if (block2.type !== "root") {
|
|
2882
|
+
block2.nodes.forEach((node) => {
|
|
2634
2883
|
if (!node.nodes) {
|
|
2635
2884
|
if (node.type === "open") node.isOpen = true;
|
|
2636
2885
|
if (node.type === "close") node.isClose = true;
|
|
@@ -2639,8 +2888,8 @@ var require_parse = __commonJS({
|
|
|
2639
2888
|
}
|
|
2640
2889
|
});
|
|
2641
2890
|
const parent = stack[stack.length - 1];
|
|
2642
|
-
const index2 = parent.nodes.indexOf(
|
|
2643
|
-
parent.nodes.splice(index2, 1, ...
|
|
2891
|
+
const index2 = parent.nodes.indexOf(block2);
|
|
2892
|
+
parent.nodes.splice(index2, 1, ...block2.nodes);
|
|
2644
2893
|
}
|
|
2645
2894
|
} while (stack.length > 0);
|
|
2646
2895
|
push({ type: "eos" });
|
|
@@ -3273,9 +3522,9 @@ var require_scan = __commonJS({
|
|
|
3273
3522
|
if (opts.parts === true || opts.tokens === true) {
|
|
3274
3523
|
let prevIndex;
|
|
3275
3524
|
for (let idx = 0; idx < slashes.length; idx++) {
|
|
3276
|
-
const
|
|
3277
|
-
const
|
|
3278
|
-
const value = input.slice(
|
|
3525
|
+
const n3 = prevIndex ? prevIndex + 1 : start;
|
|
3526
|
+
const i2 = slashes[idx];
|
|
3527
|
+
const value = input.slice(n3, i2);
|
|
3279
3528
|
if (opts.tokens) {
|
|
3280
3529
|
if (idx === 0 && start !== 0) {
|
|
3281
3530
|
tokens[idx].isPrefix = true;
|
|
@@ -3289,7 +3538,7 @@ var require_scan = __commonJS({
|
|
|
3289
3538
|
if (idx !== 0 || value !== "") {
|
|
3290
3539
|
parts.push(value);
|
|
3291
3540
|
}
|
|
3292
|
-
prevIndex =
|
|
3541
|
+
prevIndex = i2;
|
|
3293
3542
|
}
|
|
3294
3543
|
if (prevIndex && prevIndex + 1 < input.length) {
|
|
3295
3544
|
const value = input.slice(prevIndex + 1);
|
|
@@ -3418,15 +3667,15 @@ var require_parse2 = __commonJS({
|
|
|
3418
3667
|
};
|
|
3419
3668
|
var hasRepeatedCharPrefixOverlap = (branches) => {
|
|
3420
3669
|
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
3421
|
-
for (let
|
|
3422
|
-
for (let
|
|
3423
|
-
const
|
|
3424
|
-
const b = values[
|
|
3425
|
-
const char =
|
|
3426
|
-
if (!char ||
|
|
3670
|
+
for (let i2 = 0; i2 < values.length; i2++) {
|
|
3671
|
+
for (let j = i2 + 1; j < values.length; j++) {
|
|
3672
|
+
const a2 = values[i2];
|
|
3673
|
+
const b = values[j];
|
|
3674
|
+
const char = a2[0];
|
|
3675
|
+
if (!char || a2 !== char.repeat(a2.length) || b !== char.repeat(b.length)) {
|
|
3427
3676
|
continue;
|
|
3428
3677
|
}
|
|
3429
|
-
if (
|
|
3678
|
+
if (a2 === b || a2.startsWith(b) || b.startsWith(a2)) {
|
|
3430
3679
|
return true;
|
|
3431
3680
|
}
|
|
3432
3681
|
}
|
|
@@ -3441,8 +3690,8 @@ var require_parse2 = __commonJS({
|
|
|
3441
3690
|
let paren = 0;
|
|
3442
3691
|
let quote = 0;
|
|
3443
3692
|
let escaped = false;
|
|
3444
|
-
for (let
|
|
3445
|
-
const ch = pattern[
|
|
3693
|
+
for (let i2 = 1; i2 < pattern.length; i2++) {
|
|
3694
|
+
const ch = pattern[i2];
|
|
3446
3695
|
if (escaped === true) {
|
|
3447
3696
|
escaped = false;
|
|
3448
3697
|
continue;
|
|
@@ -3476,13 +3725,13 @@ var require_parse2 = __commonJS({
|
|
|
3476
3725
|
if (ch === ")") {
|
|
3477
3726
|
paren--;
|
|
3478
3727
|
if (paren === 0) {
|
|
3479
|
-
if (requireEnd === true &&
|
|
3728
|
+
if (requireEnd === true && i2 !== pattern.length - 1) {
|
|
3480
3729
|
return;
|
|
3481
3730
|
}
|
|
3482
3731
|
return {
|
|
3483
3732
|
type: pattern[0],
|
|
3484
|
-
body: pattern.slice(2,
|
|
3485
|
-
end:
|
|
3733
|
+
body: pattern.slice(2, i2),
|
|
3734
|
+
end: i2
|
|
3486
3735
|
};
|
|
3487
3736
|
}
|
|
3488
3737
|
}
|
|
@@ -3614,7 +3863,7 @@ var require_parse2 = __commonJS({
|
|
|
3614
3863
|
let prev = bos;
|
|
3615
3864
|
let value;
|
|
3616
3865
|
const eos = () => state.index === len - 1;
|
|
3617
|
-
const peek = state.peek = (
|
|
3866
|
+
const peek = state.peek = (n3 = 1) => input[state.index + n3];
|
|
3618
3867
|
const advance = state.advance = () => input[++state.index] || "";
|
|
3619
3868
|
const remaining = () => input.slice(state.index + 1);
|
|
3620
3869
|
const consume = (value2 = "", num = 0) => {
|
|
@@ -3695,10 +3944,10 @@ var require_parse2 = __commonJS({
|
|
|
3695
3944
|
open.type = "text";
|
|
3696
3945
|
open.value = literal;
|
|
3697
3946
|
open.output = safeOutput || utils.escapeRegex(literal);
|
|
3698
|
-
for (let
|
|
3699
|
-
tokens[
|
|
3700
|
-
tokens[
|
|
3701
|
-
delete tokens[
|
|
3947
|
+
for (let i2 = token.tokensIndex + 1; i2 < tokens.length; i2++) {
|
|
3948
|
+
tokens[i2].value = "";
|
|
3949
|
+
tokens[i2].output = "";
|
|
3950
|
+
delete tokens[i2].suffix;
|
|
3702
3951
|
}
|
|
3703
3952
|
state.output = token.output + open.output;
|
|
3704
3953
|
state.backtrack = true;
|
|
@@ -3941,13 +4190,13 @@ var require_parse2 = __commonJS({
|
|
|
3941
4190
|
if (brace.dots === true) {
|
|
3942
4191
|
const arr = tokens.slice();
|
|
3943
4192
|
const range = [];
|
|
3944
|
-
for (let
|
|
4193
|
+
for (let i2 = arr.length - 1; i2 >= 0; i2--) {
|
|
3945
4194
|
tokens.pop();
|
|
3946
|
-
if (arr[
|
|
4195
|
+
if (arr[i2].type === "brace") {
|
|
3947
4196
|
break;
|
|
3948
4197
|
}
|
|
3949
|
-
if (arr[
|
|
3950
|
-
range.unshift(arr[
|
|
4198
|
+
if (arr[i2].type !== "dots") {
|
|
4199
|
+
range.unshift(arr[i2].value);
|
|
3951
4200
|
}
|
|
3952
4201
|
}
|
|
3953
4202
|
output = expandRange(range, opts);
|
|
@@ -4406,7 +4655,7 @@ var require_picomatch = __commonJS({
|
|
|
4406
4655
|
};
|
|
4407
4656
|
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
4408
4657
|
picomatch.parse = (pattern, options) => {
|
|
4409
|
-
if (Array.isArray(pattern)) return pattern.map((
|
|
4658
|
+
if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
|
|
4410
4659
|
return parse2(pattern, { ...options, fastpaths: false });
|
|
4411
4660
|
};
|
|
4412
4661
|
picomatch.scan = (input, options) => scan(input, options);
|
|
@@ -4490,8 +4739,8 @@ var require_micromatch = __commonJS({
|
|
|
4490
4739
|
options.onResult(state);
|
|
4491
4740
|
}
|
|
4492
4741
|
};
|
|
4493
|
-
for (let
|
|
4494
|
-
let isMatch = picomatch(String(patterns[
|
|
4742
|
+
for (let i2 = 0; i2 < patterns.length; i2++) {
|
|
4743
|
+
let isMatch = picomatch(String(patterns[i2]), { ...options, onResult }, true);
|
|
4495
4744
|
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
|
|
4496
4745
|
if (negated) negatives++;
|
|
4497
4746
|
for (let item of list) {
|
|
@@ -4513,7 +4762,7 @@ var require_micromatch = __commonJS({
|
|
|
4513
4762
|
throw new Error(`No matches found for "${patterns.join(", ")}"`);
|
|
4514
4763
|
}
|
|
4515
4764
|
if (options.nonull === true || options.nullglob === true) {
|
|
4516
|
-
return options.unescape ? patterns.map((
|
|
4765
|
+
return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
|
|
4517
4766
|
}
|
|
4518
4767
|
}
|
|
4519
4768
|
return matches;
|
|
@@ -4543,7 +4792,7 @@ var require_micromatch = __commonJS({
|
|
|
4543
4792
|
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
4544
4793
|
}
|
|
4545
4794
|
if (Array.isArray(pattern)) {
|
|
4546
|
-
return pattern.some((
|
|
4795
|
+
return pattern.some((p) => micromatch.contains(str, p, options));
|
|
4547
4796
|
}
|
|
4548
4797
|
if (typeof pattern === "string") {
|
|
4549
4798
|
if (isEmptyString(str) || isEmptyString(pattern)) {
|
|
@@ -4588,7 +4837,7 @@ var require_micromatch = __commonJS({
|
|
|
4588
4837
|
if (typeof str !== "string") {
|
|
4589
4838
|
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
4590
4839
|
}
|
|
4591
|
-
return [].concat(patterns).every((
|
|
4840
|
+
return [].concat(patterns).every((p) => picomatch(p, options)(str));
|
|
4592
4841
|
};
|
|
4593
4842
|
micromatch.capture = (glob, input, options) => {
|
|
4594
4843
|
let posix = utils.isWindows(options);
|
|
@@ -4739,7 +4988,7 @@ var require_pattern = __commonJS({
|
|
|
4739
4988
|
exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
|
4740
4989
|
function expandBraceExpansion(pattern) {
|
|
4741
4990
|
const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });
|
|
4742
|
-
patterns.sort((
|
|
4991
|
+
patterns.sort((a2, b) => a2.length - b.length);
|
|
4743
4992
|
return patterns.filter((pattern2) => pattern2 !== "");
|
|
4744
4993
|
}
|
|
4745
4994
|
exports.expandBraceExpansion = expandBraceExpansion;
|
|
@@ -4820,8 +5069,8 @@ var require_merge2 = __commonJS({
|
|
|
4820
5069
|
}
|
|
4821
5070
|
const mergedStream = PassThrough(options);
|
|
4822
5071
|
function addStream() {
|
|
4823
|
-
for (let
|
|
4824
|
-
streamsQueue.push(pauseStreams(arguments[
|
|
5072
|
+
for (let i2 = 0, len = arguments.length; i2 < len; i2++) {
|
|
5073
|
+
streamsQueue.push(pauseStreams(arguments[i2], options));
|
|
4825
5074
|
}
|
|
4826
5075
|
mergeStream();
|
|
4827
5076
|
return this;
|
|
@@ -4870,8 +5119,8 @@ var require_merge2 = __commonJS({
|
|
|
4870
5119
|
stream.pipe(mergedStream, { end: false });
|
|
4871
5120
|
stream.resume();
|
|
4872
5121
|
}
|
|
4873
|
-
for (let
|
|
4874
|
-
pipe(streams[
|
|
5122
|
+
for (let i2 = 0; i2 < streams.length; i2++) {
|
|
5123
|
+
pipe(streams[i2]);
|
|
4875
5124
|
}
|
|
4876
5125
|
next();
|
|
4877
5126
|
}
|
|
@@ -4902,8 +5151,8 @@ var require_merge2 = __commonJS({
|
|
|
4902
5151
|
}
|
|
4903
5152
|
streams.pause();
|
|
4904
5153
|
} else {
|
|
4905
|
-
for (let
|
|
4906
|
-
streams[
|
|
5154
|
+
for (let i2 = 0, len = streams.length; i2 < len; i2++) {
|
|
5155
|
+
streams[i2] = pauseStreams(streams[i2], options);
|
|
4907
5156
|
}
|
|
4908
5157
|
}
|
|
4909
5158
|
return streams;
|
|
@@ -4985,13 +5234,13 @@ var require_tasks = __commonJS({
|
|
|
4985
5234
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4986
5235
|
exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
|
|
4987
5236
|
var utils = require_utils3();
|
|
4988
|
-
function generate(input,
|
|
4989
|
-
const patterns = processPatterns(input,
|
|
4990
|
-
const ignore = processPatterns(
|
|
5237
|
+
function generate(input, settings2) {
|
|
5238
|
+
const patterns = processPatterns(input, settings2);
|
|
5239
|
+
const ignore = processPatterns(settings2.ignore, settings2);
|
|
4991
5240
|
const positivePatterns = getPositivePatterns(patterns);
|
|
4992
5241
|
const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
|
|
4993
|
-
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern,
|
|
4994
|
-
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern,
|
|
5242
|
+
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings2));
|
|
5243
|
+
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings2));
|
|
4995
5244
|
const staticTasks = convertPatternsToTasks(
|
|
4996
5245
|
staticPatterns,
|
|
4997
5246
|
negativePatterns,
|
|
@@ -5007,12 +5256,12 @@ var require_tasks = __commonJS({
|
|
|
5007
5256
|
return staticTasks.concat(dynamicTasks);
|
|
5008
5257
|
}
|
|
5009
5258
|
exports.generate = generate;
|
|
5010
|
-
function processPatterns(input,
|
|
5259
|
+
function processPatterns(input, settings2) {
|
|
5011
5260
|
let patterns = input;
|
|
5012
|
-
if (
|
|
5261
|
+
if (settings2.braceExpansion) {
|
|
5013
5262
|
patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);
|
|
5014
5263
|
}
|
|
5015
|
-
if (
|
|
5264
|
+
if (settings2.baseNameMatch) {
|
|
5016
5265
|
patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`);
|
|
5017
5266
|
}
|
|
5018
5267
|
return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));
|
|
@@ -5043,7 +5292,7 @@ var require_tasks = __commonJS({
|
|
|
5043
5292
|
}
|
|
5044
5293
|
exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
|
|
5045
5294
|
function groupPatternsByBaseDirectory(patterns) {
|
|
5046
|
-
const
|
|
5295
|
+
const group2 = {};
|
|
5047
5296
|
return patterns.reduce((collection, pattern) => {
|
|
5048
5297
|
const base = utils.pattern.getBaseDirectory(pattern);
|
|
5049
5298
|
if (base in collection) {
|
|
@@ -5052,7 +5301,7 @@ var require_tasks = __commonJS({
|
|
|
5052
5301
|
collection[base] = [pattern];
|
|
5053
5302
|
}
|
|
5054
5303
|
return collection;
|
|
5055
|
-
},
|
|
5304
|
+
}, group2);
|
|
5056
5305
|
}
|
|
5057
5306
|
exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
|
|
5058
5307
|
function convertPatternGroupsToTasks(positive, negative, dynamic) {
|
|
@@ -5081,26 +5330,26 @@ var require_async = __commonJS({
|
|
|
5081
5330
|
init_utils2();
|
|
5082
5331
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5083
5332
|
exports.read = void 0;
|
|
5084
|
-
function read(path,
|
|
5085
|
-
|
|
5333
|
+
function read(path, settings2, callback) {
|
|
5334
|
+
settings2.fs.lstat(path, (lstatError, lstat) => {
|
|
5086
5335
|
if (lstatError !== null) {
|
|
5087
5336
|
callFailureCallback(callback, lstatError);
|
|
5088
5337
|
return;
|
|
5089
5338
|
}
|
|
5090
|
-
if (!lstat.isSymbolicLink() || !
|
|
5339
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
5091
5340
|
callSuccessCallback(callback, lstat);
|
|
5092
5341
|
return;
|
|
5093
5342
|
}
|
|
5094
|
-
|
|
5343
|
+
settings2.fs.stat(path, (statError, stat) => {
|
|
5095
5344
|
if (statError !== null) {
|
|
5096
|
-
if (
|
|
5345
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5097
5346
|
callFailureCallback(callback, statError);
|
|
5098
5347
|
return;
|
|
5099
5348
|
}
|
|
5100
5349
|
callSuccessCallback(callback, lstat);
|
|
5101
5350
|
return;
|
|
5102
5351
|
}
|
|
5103
|
-
if (
|
|
5352
|
+
if (settings2.markSymbolicLink) {
|
|
5104
5353
|
stat.isSymbolicLink = () => true;
|
|
5105
5354
|
}
|
|
5106
5355
|
callSuccessCallback(callback, stat);
|
|
@@ -5124,19 +5373,19 @@ var require_sync = __commonJS({
|
|
|
5124
5373
|
init_utils2();
|
|
5125
5374
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5126
5375
|
exports.read = void 0;
|
|
5127
|
-
function read(path,
|
|
5128
|
-
const lstat =
|
|
5129
|
-
if (!lstat.isSymbolicLink() || !
|
|
5376
|
+
function read(path, settings2) {
|
|
5377
|
+
const lstat = settings2.fs.lstatSync(path);
|
|
5378
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
5130
5379
|
return lstat;
|
|
5131
5380
|
}
|
|
5132
5381
|
try {
|
|
5133
|
-
const stat =
|
|
5134
|
-
if (
|
|
5382
|
+
const stat = settings2.fs.statSync(path);
|
|
5383
|
+
if (settings2.markSymbolicLink) {
|
|
5135
5384
|
stat.isSymbolicLink = () => true;
|
|
5136
5385
|
}
|
|
5137
5386
|
return stat;
|
|
5138
5387
|
} catch (error2) {
|
|
5139
|
-
if (!
|
|
5388
|
+
if (!settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5140
5389
|
return lstat;
|
|
5141
5390
|
}
|
|
5142
5391
|
throw error2;
|
|
@@ -5213,8 +5462,8 @@ var require_out = __commonJS({
|
|
|
5213
5462
|
}
|
|
5214
5463
|
exports.stat = stat;
|
|
5215
5464
|
function statSync3(path, optionsOrSettings) {
|
|
5216
|
-
const
|
|
5217
|
-
return sync.read(path,
|
|
5465
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5466
|
+
return sync.read(path, settings2);
|
|
5218
5467
|
}
|
|
5219
5468
|
exports.statSync = statSync3;
|
|
5220
5469
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -5262,8 +5511,8 @@ var require_run_parallel = __commonJS({
|
|
|
5262
5511
|
if (isSync) queueMicrotask2(end);
|
|
5263
5512
|
else end();
|
|
5264
5513
|
}
|
|
5265
|
-
function each(
|
|
5266
|
-
results[
|
|
5514
|
+
function each(i2, err, result) {
|
|
5515
|
+
results[i2] = result;
|
|
5267
5516
|
if (--pending === 0 || err) {
|
|
5268
5517
|
done(err);
|
|
5269
5518
|
}
|
|
@@ -5277,9 +5526,9 @@ var require_run_parallel = __commonJS({
|
|
|
5277
5526
|
});
|
|
5278
5527
|
});
|
|
5279
5528
|
} else {
|
|
5280
|
-
tasks.forEach(function(task,
|
|
5529
|
+
tasks.forEach(function(task, i2) {
|
|
5281
5530
|
task(function(err, result) {
|
|
5282
|
-
each(
|
|
5531
|
+
each(i2, err, result);
|
|
5283
5532
|
});
|
|
5284
5533
|
});
|
|
5285
5534
|
}
|
|
@@ -5354,11 +5603,11 @@ var require_common = __commonJS({
|
|
|
5354
5603
|
init_utils2();
|
|
5355
5604
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5356
5605
|
exports.joinPathSegments = void 0;
|
|
5357
|
-
function joinPathSegments(
|
|
5358
|
-
if (
|
|
5359
|
-
return
|
|
5606
|
+
function joinPathSegments(a2, b, separator) {
|
|
5607
|
+
if (a2.endsWith(separator)) {
|
|
5608
|
+
return a2 + b;
|
|
5360
5609
|
}
|
|
5361
|
-
return
|
|
5610
|
+
return a2 + separator + b;
|
|
5362
5611
|
}
|
|
5363
5612
|
exports.joinPathSegments = joinPathSegments;
|
|
5364
5613
|
}
|
|
@@ -5376,16 +5625,16 @@ var require_async2 = __commonJS({
|
|
|
5376
5625
|
var constants_1 = require_constants3();
|
|
5377
5626
|
var utils = require_utils4();
|
|
5378
5627
|
var common = require_common();
|
|
5379
|
-
function read(directory,
|
|
5380
|
-
if (!
|
|
5381
|
-
readdirWithFileTypes(directory,
|
|
5628
|
+
function read(directory, settings2, callback) {
|
|
5629
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
5630
|
+
readdirWithFileTypes(directory, settings2, callback);
|
|
5382
5631
|
return;
|
|
5383
5632
|
}
|
|
5384
|
-
readdir(directory,
|
|
5633
|
+
readdir(directory, settings2, callback);
|
|
5385
5634
|
}
|
|
5386
5635
|
exports.read = read;
|
|
5387
|
-
function readdirWithFileTypes(directory,
|
|
5388
|
-
|
|
5636
|
+
function readdirWithFileTypes(directory, settings2, callback) {
|
|
5637
|
+
settings2.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
|
|
5389
5638
|
if (readdirError !== null) {
|
|
5390
5639
|
callFailureCallback(callback, readdirError);
|
|
5391
5640
|
return;
|
|
@@ -5393,13 +5642,13 @@ var require_async2 = __commonJS({
|
|
|
5393
5642
|
const entries = dirents.map((dirent) => ({
|
|
5394
5643
|
dirent,
|
|
5395
5644
|
name: dirent.name,
|
|
5396
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
5645
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
5397
5646
|
}));
|
|
5398
|
-
if (!
|
|
5647
|
+
if (!settings2.followSymbolicLinks) {
|
|
5399
5648
|
callSuccessCallback(callback, entries);
|
|
5400
5649
|
return;
|
|
5401
5650
|
}
|
|
5402
|
-
const tasks = entries.map((entry) => makeRplTaskEntry(entry,
|
|
5651
|
+
const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings2));
|
|
5403
5652
|
rpl(tasks, (rplError, rplEntries) => {
|
|
5404
5653
|
if (rplError !== null) {
|
|
5405
5654
|
callFailureCallback(callback, rplError);
|
|
@@ -5410,15 +5659,15 @@ var require_async2 = __commonJS({
|
|
|
5410
5659
|
});
|
|
5411
5660
|
}
|
|
5412
5661
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
5413
|
-
function makeRplTaskEntry(entry,
|
|
5662
|
+
function makeRplTaskEntry(entry, settings2) {
|
|
5414
5663
|
return (done) => {
|
|
5415
5664
|
if (!entry.dirent.isSymbolicLink()) {
|
|
5416
5665
|
done(null, entry);
|
|
5417
5666
|
return;
|
|
5418
5667
|
}
|
|
5419
|
-
|
|
5668
|
+
settings2.fs.stat(entry.path, (statError, stats) => {
|
|
5420
5669
|
if (statError !== null) {
|
|
5421
|
-
if (
|
|
5670
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5422
5671
|
done(statError);
|
|
5423
5672
|
return;
|
|
5424
5673
|
}
|
|
@@ -5430,16 +5679,16 @@ var require_async2 = __commonJS({
|
|
|
5430
5679
|
});
|
|
5431
5680
|
};
|
|
5432
5681
|
}
|
|
5433
|
-
function readdir(directory,
|
|
5434
|
-
|
|
5682
|
+
function readdir(directory, settings2, callback) {
|
|
5683
|
+
settings2.fs.readdir(directory, (readdirError, names) => {
|
|
5435
5684
|
if (readdirError !== null) {
|
|
5436
5685
|
callFailureCallback(callback, readdirError);
|
|
5437
5686
|
return;
|
|
5438
5687
|
}
|
|
5439
5688
|
const tasks = names.map((name) => {
|
|
5440
|
-
const path = common.joinPathSegments(directory, name,
|
|
5689
|
+
const path = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
5441
5690
|
return (done) => {
|
|
5442
|
-
fsStat.stat(path,
|
|
5691
|
+
fsStat.stat(path, settings2.fsStatSettings, (error2, stats) => {
|
|
5443
5692
|
if (error2 !== null) {
|
|
5444
5693
|
done(error2);
|
|
5445
5694
|
return;
|
|
@@ -5449,7 +5698,7 @@ var require_async2 = __commonJS({
|
|
|
5449
5698
|
path,
|
|
5450
5699
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
5451
5700
|
};
|
|
5452
|
-
if (
|
|
5701
|
+
if (settings2.stats) {
|
|
5453
5702
|
entry.stats = stats;
|
|
5454
5703
|
}
|
|
5455
5704
|
done(null, entry);
|
|
@@ -5486,27 +5735,27 @@ var require_sync2 = __commonJS({
|
|
|
5486
5735
|
var constants_1 = require_constants3();
|
|
5487
5736
|
var utils = require_utils4();
|
|
5488
5737
|
var common = require_common();
|
|
5489
|
-
function read(directory,
|
|
5490
|
-
if (!
|
|
5491
|
-
return readdirWithFileTypes(directory,
|
|
5738
|
+
function read(directory, settings2) {
|
|
5739
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
5740
|
+
return readdirWithFileTypes(directory, settings2);
|
|
5492
5741
|
}
|
|
5493
|
-
return readdir(directory,
|
|
5742
|
+
return readdir(directory, settings2);
|
|
5494
5743
|
}
|
|
5495
5744
|
exports.read = read;
|
|
5496
|
-
function readdirWithFileTypes(directory,
|
|
5497
|
-
const dirents =
|
|
5745
|
+
function readdirWithFileTypes(directory, settings2) {
|
|
5746
|
+
const dirents = settings2.fs.readdirSync(directory, { withFileTypes: true });
|
|
5498
5747
|
return dirents.map((dirent) => {
|
|
5499
5748
|
const entry = {
|
|
5500
5749
|
dirent,
|
|
5501
5750
|
name: dirent.name,
|
|
5502
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
5751
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
5503
5752
|
};
|
|
5504
|
-
if (entry.dirent.isSymbolicLink() &&
|
|
5753
|
+
if (entry.dirent.isSymbolicLink() && settings2.followSymbolicLinks) {
|
|
5505
5754
|
try {
|
|
5506
|
-
const stats =
|
|
5755
|
+
const stats = settings2.fs.statSync(entry.path);
|
|
5507
5756
|
entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
|
5508
5757
|
} catch (error2) {
|
|
5509
|
-
if (
|
|
5758
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5510
5759
|
throw error2;
|
|
5511
5760
|
}
|
|
5512
5761
|
}
|
|
@@ -5515,17 +5764,17 @@ var require_sync2 = __commonJS({
|
|
|
5515
5764
|
});
|
|
5516
5765
|
}
|
|
5517
5766
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
5518
|
-
function readdir(directory,
|
|
5519
|
-
const names =
|
|
5767
|
+
function readdir(directory, settings2) {
|
|
5768
|
+
const names = settings2.fs.readdirSync(directory);
|
|
5520
5769
|
return names.map((name) => {
|
|
5521
|
-
const entryPath = common.joinPathSegments(directory, name,
|
|
5522
|
-
const stats = fsStat.statSync(entryPath,
|
|
5770
|
+
const entryPath = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
5771
|
+
const stats = fsStat.statSync(entryPath, settings2.fsStatSettings);
|
|
5523
5772
|
const entry = {
|
|
5524
5773
|
name,
|
|
5525
5774
|
path: entryPath,
|
|
5526
5775
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
5527
5776
|
};
|
|
5528
|
-
if (
|
|
5777
|
+
if (settings2.stats) {
|
|
5529
5778
|
entry.stats = stats;
|
|
5530
5779
|
}
|
|
5531
5780
|
return entry;
|
|
@@ -5612,8 +5861,8 @@ var require_out2 = __commonJS({
|
|
|
5612
5861
|
}
|
|
5613
5862
|
exports.scandir = scandir;
|
|
5614
5863
|
function scandirSync(path, optionsOrSettings) {
|
|
5615
|
-
const
|
|
5616
|
-
return sync.read(path,
|
|
5864
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5865
|
+
return sync.read(path, settings2);
|
|
5617
5866
|
}
|
|
5618
5867
|
exports.scandirSync = scandirSync;
|
|
5619
5868
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -5894,7 +6143,7 @@ var require_queue = __commonJS({
|
|
|
5894
6143
|
queue.drained = drained;
|
|
5895
6144
|
return queue;
|
|
5896
6145
|
function push(value) {
|
|
5897
|
-
var
|
|
6146
|
+
var p = new Promise(function(resolve4, reject) {
|
|
5898
6147
|
pushCb(value, function(err, result) {
|
|
5899
6148
|
if (err) {
|
|
5900
6149
|
reject(err);
|
|
@@ -5903,11 +6152,11 @@ var require_queue = __commonJS({
|
|
|
5903
6152
|
resolve4(result);
|
|
5904
6153
|
});
|
|
5905
6154
|
});
|
|
5906
|
-
|
|
5907
|
-
return
|
|
6155
|
+
p.catch(noop);
|
|
6156
|
+
return p;
|
|
5908
6157
|
}
|
|
5909
6158
|
function unshift(value) {
|
|
5910
|
-
var
|
|
6159
|
+
var p = new Promise(function(resolve4, reject) {
|
|
5911
6160
|
unshiftCb(value, function(err, result) {
|
|
5912
6161
|
if (err) {
|
|
5913
6162
|
reject(err);
|
|
@@ -5916,11 +6165,11 @@ var require_queue = __commonJS({
|
|
|
5916
6165
|
resolve4(result);
|
|
5917
6166
|
});
|
|
5918
6167
|
});
|
|
5919
|
-
|
|
5920
|
-
return
|
|
6168
|
+
p.catch(noop);
|
|
6169
|
+
return p;
|
|
5921
6170
|
}
|
|
5922
6171
|
function drained() {
|
|
5923
|
-
var
|
|
6172
|
+
var p = new Promise(function(resolve4) {
|
|
5924
6173
|
process.nextTick(function() {
|
|
5925
6174
|
if (queue.idle()) {
|
|
5926
6175
|
resolve4();
|
|
@@ -5934,7 +6183,7 @@ var require_queue = __commonJS({
|
|
|
5934
6183
|
}
|
|
5935
6184
|
});
|
|
5936
6185
|
});
|
|
5937
|
-
return
|
|
6186
|
+
return p;
|
|
5938
6187
|
}
|
|
5939
6188
|
}
|
|
5940
6189
|
module.exports = fastqueue;
|
|
@@ -5949,11 +6198,11 @@ var require_common2 = __commonJS({
|
|
|
5949
6198
|
init_utils2();
|
|
5950
6199
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5951
6200
|
exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
|
|
5952
|
-
function isFatalError(
|
|
5953
|
-
if (
|
|
6201
|
+
function isFatalError(settings2, error2) {
|
|
6202
|
+
if (settings2.errorFilter === null) {
|
|
5954
6203
|
return true;
|
|
5955
6204
|
}
|
|
5956
|
-
return !
|
|
6205
|
+
return !settings2.errorFilter(error2);
|
|
5957
6206
|
}
|
|
5958
6207
|
exports.isFatalError = isFatalError;
|
|
5959
6208
|
function isAppliedFilter(filter, value) {
|
|
@@ -5964,14 +6213,14 @@ var require_common2 = __commonJS({
|
|
|
5964
6213
|
return filepath.split(/[/\\]/).join(separator);
|
|
5965
6214
|
}
|
|
5966
6215
|
exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
|
|
5967
|
-
function joinPathSegments(
|
|
5968
|
-
if (
|
|
6216
|
+
function joinPathSegments(a2, b, separator) {
|
|
6217
|
+
if (a2 === "") {
|
|
5969
6218
|
return b;
|
|
5970
6219
|
}
|
|
5971
|
-
if (
|
|
5972
|
-
return
|
|
6220
|
+
if (a2.endsWith(separator)) {
|
|
6221
|
+
return a2 + b;
|
|
5973
6222
|
}
|
|
5974
|
-
return
|
|
6223
|
+
return a2 + separator + b;
|
|
5975
6224
|
}
|
|
5976
6225
|
exports.joinPathSegments = joinPathSegments;
|
|
5977
6226
|
}
|
|
@@ -6318,14 +6567,14 @@ var require_out3 = __commonJS({
|
|
|
6318
6567
|
}
|
|
6319
6568
|
exports.walk = walk;
|
|
6320
6569
|
function walkSync(directory, optionsOrSettings) {
|
|
6321
|
-
const
|
|
6322
|
-
const provider = new sync_1.default(directory,
|
|
6570
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
6571
|
+
const provider = new sync_1.default(directory, settings2);
|
|
6323
6572
|
return provider.read();
|
|
6324
6573
|
}
|
|
6325
6574
|
exports.walkSync = walkSync;
|
|
6326
6575
|
function walkStream(directory, optionsOrSettings) {
|
|
6327
|
-
const
|
|
6328
|
-
const provider = new stream_1.default(directory,
|
|
6576
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
6577
|
+
const provider = new stream_1.default(directory, settings2);
|
|
6329
6578
|
return provider.read();
|
|
6330
6579
|
}
|
|
6331
6580
|
exports.walkStream = walkStream;
|
|
@@ -6411,8 +6660,8 @@ var require_stream3 = __commonJS({
|
|
|
6411
6660
|
done();
|
|
6412
6661
|
}).catch(done);
|
|
6413
6662
|
};
|
|
6414
|
-
for (let
|
|
6415
|
-
stream.write(
|
|
6663
|
+
for (let i2 = 0; i2 < filepaths.length; i2++) {
|
|
6664
|
+
stream.write(i2);
|
|
6416
6665
|
}
|
|
6417
6666
|
return stream;
|
|
6418
6667
|
}
|
|
@@ -7073,14 +7322,14 @@ var require_out4 = __commonJS({
|
|
|
7073
7322
|
function generateTasks(source, options) {
|
|
7074
7323
|
assertPatternsInput(source);
|
|
7075
7324
|
const patterns = [].concat(source);
|
|
7076
|
-
const
|
|
7077
|
-
return taskManager.generate(patterns,
|
|
7325
|
+
const settings2 = new settings_1.default(options);
|
|
7326
|
+
return taskManager.generate(patterns, settings2);
|
|
7078
7327
|
}
|
|
7079
7328
|
FastGlob2.generateTasks = generateTasks;
|
|
7080
7329
|
function isDynamicPattern(source, options) {
|
|
7081
7330
|
assertPatternsInput(source);
|
|
7082
|
-
const
|
|
7083
|
-
return utils.pattern.isDynamicPattern(source,
|
|
7331
|
+
const settings2 = new settings_1.default(options);
|
|
7332
|
+
return utils.pattern.isDynamicPattern(source, settings2);
|
|
7084
7333
|
}
|
|
7085
7334
|
FastGlob2.isDynamicPattern = isDynamicPattern;
|
|
7086
7335
|
function escapePath(source) {
|
|
@@ -7122,9 +7371,9 @@ var require_out4 = __commonJS({
|
|
|
7122
7371
|
})(FastGlob || (FastGlob = {}));
|
|
7123
7372
|
function getWorks(source, _Provider, options) {
|
|
7124
7373
|
const patterns = [].concat(source);
|
|
7125
|
-
const
|
|
7126
|
-
const tasks = taskManager.generate(patterns,
|
|
7127
|
-
const provider = new _Provider(
|
|
7374
|
+
const settings2 = new settings_1.default(options);
|
|
7375
|
+
const tasks = taskManager.generate(patterns, settings2);
|
|
7376
|
+
const provider = new _Provider(settings2);
|
|
7128
7377
|
return tasks.map(provider.read, provider);
|
|
7129
7378
|
}
|
|
7130
7379
|
function assertPatternsInput(input) {
|
|
@@ -7302,8 +7551,8 @@ import "node:fs";
|
|
|
7302
7551
|
import { createRequire } from "node:module";
|
|
7303
7552
|
import {
|
|
7304
7553
|
resolve,
|
|
7305
|
-
join,
|
|
7306
|
-
dirname,
|
|
7554
|
+
join as join2,
|
|
7555
|
+
dirname as dirname2,
|
|
7307
7556
|
relative,
|
|
7308
7557
|
normalize,
|
|
7309
7558
|
sep,
|
|
@@ -7317,7 +7566,7 @@ function safeExecuteAsync(fn, message) {
|
|
|
7317
7566
|
);
|
|
7318
7567
|
});
|
|
7319
7568
|
}
|
|
7320
|
-
var import_fast_glob, constants,
|
|
7569
|
+
var import_fast_glob, constants, log3, PACKAGE_PATHS, PathResolver;
|
|
7321
7570
|
var init_PathResolver = __esm({
|
|
7322
7571
|
"packages/core/config/utils/PathResolver.ts"() {
|
|
7323
7572
|
"use strict";
|
|
@@ -7330,7 +7579,7 @@ var init_PathResolver = __esm({
|
|
|
7330
7579
|
getPatternsFor: getPatternsFor || void 0,
|
|
7331
7580
|
I18N_PATHS: I18N_PATHS || void 0
|
|
7332
7581
|
};
|
|
7333
|
-
|
|
7582
|
+
log3 = {
|
|
7334
7583
|
error: (message, error2) => {
|
|
7335
7584
|
},
|
|
7336
7585
|
warn: (message, error2) => {
|
|
@@ -7451,7 +7700,7 @@ var init_PathResolver = __esm({
|
|
|
7451
7700
|
*/
|
|
7452
7701
|
getDirname(path) {
|
|
7453
7702
|
if (!path) return "";
|
|
7454
|
-
return this.normalizePath(
|
|
7703
|
+
return this.normalizePath(dirname2(path));
|
|
7455
7704
|
}
|
|
7456
7705
|
/**
|
|
7457
7706
|
* Resolve package path using Node's module resolution
|
|
@@ -7463,7 +7712,7 @@ var init_PathResolver = __esm({
|
|
|
7463
7712
|
resolvePackage(packageSpecifier, fromPath = null) {
|
|
7464
7713
|
try {
|
|
7465
7714
|
const basePath = fromPath || this.getAppRoot();
|
|
7466
|
-
const require3 = createRequire(
|
|
7715
|
+
const require3 = createRequire(join2(basePath, "package.json"));
|
|
7467
7716
|
const resolved = require3.resolve(packageSpecifier);
|
|
7468
7717
|
return this.normalizePath(resolved);
|
|
7469
7718
|
} catch (error2) {
|
|
@@ -7615,7 +7864,7 @@ var init_PathResolver = __esm({
|
|
|
7615
7864
|
return cleanContent;
|
|
7616
7865
|
} catch (error2) {
|
|
7617
7866
|
if (this.options.debug) {
|
|
7618
|
-
|
|
7867
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
7619
7868
|
}
|
|
7620
7869
|
return null;
|
|
7621
7870
|
}
|
|
@@ -7643,7 +7892,7 @@ var init_PathResolver = __esm({
|
|
|
7643
7892
|
return cleanContent;
|
|
7644
7893
|
} catch (error2) {
|
|
7645
7894
|
if (this.options.debug) {
|
|
7646
|
-
|
|
7895
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
7647
7896
|
}
|
|
7648
7897
|
return null;
|
|
7649
7898
|
}
|
|
@@ -7665,16 +7914,16 @@ var init_PathResolver = __esm({
|
|
|
7665
7914
|
verbose = false
|
|
7666
7915
|
} = options;
|
|
7667
7916
|
const normalizedPath = this.normalizePath(filePath);
|
|
7668
|
-
const dir = this.normalizePath(
|
|
7917
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
7669
7918
|
const fileExists = this.pathExists(normalizedPath);
|
|
7670
7919
|
if (fileExists && !overwrite) {
|
|
7671
7920
|
if (verbose) {
|
|
7672
|
-
|
|
7921
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
7673
7922
|
}
|
|
7674
7923
|
return false;
|
|
7675
7924
|
}
|
|
7676
7925
|
if (dryRun) {
|
|
7677
|
-
|
|
7926
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
7678
7927
|
return true;
|
|
7679
7928
|
}
|
|
7680
7929
|
try {
|
|
@@ -7699,7 +7948,7 @@ var init_PathResolver = __esm({
|
|
|
7699
7948
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
7700
7949
|
}
|
|
7701
7950
|
if (verbose) {
|
|
7702
|
-
|
|
7951
|
+
log3.info(
|
|
7703
7952
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
7704
7953
|
);
|
|
7705
7954
|
}
|
|
@@ -7726,16 +7975,16 @@ var init_PathResolver = __esm({
|
|
|
7726
7975
|
verbose = false
|
|
7727
7976
|
} = options;
|
|
7728
7977
|
const normalizedPath = this.normalizePath(filePath);
|
|
7729
|
-
const dir = this.normalizePath(
|
|
7978
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
7730
7979
|
const fileExists = this.pathExists(normalizedPath);
|
|
7731
7980
|
if (fileExists && !overwrite) {
|
|
7732
7981
|
if (verbose) {
|
|
7733
|
-
|
|
7982
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
7734
7983
|
}
|
|
7735
7984
|
return false;
|
|
7736
7985
|
}
|
|
7737
7986
|
if (dryRun) {
|
|
7738
|
-
|
|
7987
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
7739
7988
|
return true;
|
|
7740
7989
|
}
|
|
7741
7990
|
try {
|
|
@@ -7759,7 +8008,7 @@ var init_PathResolver = __esm({
|
|
|
7759
8008
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
7760
8009
|
}
|
|
7761
8010
|
if (verbose) {
|
|
7762
|
-
|
|
8011
|
+
log3.info(
|
|
7763
8012
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
7764
8013
|
);
|
|
7765
8014
|
}
|
|
@@ -7784,15 +8033,15 @@ var init_PathResolver = __esm({
|
|
|
7784
8033
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7785
8034
|
if (fileExists && !overwrite) {
|
|
7786
8035
|
if (verbose) {
|
|
7787
|
-
|
|
8036
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7788
8037
|
}
|
|
7789
8038
|
return false;
|
|
7790
8039
|
}
|
|
7791
8040
|
if (dryRun) {
|
|
7792
|
-
|
|
8041
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7793
8042
|
return true;
|
|
7794
8043
|
}
|
|
7795
|
-
const dir = this.normalizePath(
|
|
8044
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7796
8045
|
try {
|
|
7797
8046
|
await fs.promises.mkdir(dir, { recursive: true });
|
|
7798
8047
|
} catch (error2) {
|
|
@@ -7802,7 +8051,7 @@ var init_PathResolver = __esm({
|
|
|
7802
8051
|
return await safeExecuteAsync(async () => {
|
|
7803
8052
|
await fs.promises.copyFile(srcPath, normalizedDestPath);
|
|
7804
8053
|
if (verbose) {
|
|
7805
|
-
|
|
8054
|
+
log3.info(
|
|
7806
8055
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7807
8056
|
);
|
|
7808
8057
|
}
|
|
@@ -7826,15 +8075,15 @@ var init_PathResolver = __esm({
|
|
|
7826
8075
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7827
8076
|
if (fileExists && !overwrite) {
|
|
7828
8077
|
if (verbose) {
|
|
7829
|
-
|
|
8078
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7830
8079
|
}
|
|
7831
8080
|
return false;
|
|
7832
8081
|
}
|
|
7833
8082
|
if (dryRun) {
|
|
7834
|
-
|
|
8083
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7835
8084
|
return true;
|
|
7836
8085
|
}
|
|
7837
|
-
const dir = this.normalizePath(
|
|
8086
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7838
8087
|
try {
|
|
7839
8088
|
fs.mkdirSync(dir, { recursive: true });
|
|
7840
8089
|
} catch (error2) {
|
|
@@ -7843,7 +8092,7 @@ var init_PathResolver = __esm({
|
|
|
7843
8092
|
try {
|
|
7844
8093
|
fs.copyFileSync(srcPath, normalizedDestPath);
|
|
7845
8094
|
if (verbose) {
|
|
7846
|
-
|
|
8095
|
+
log3.info(
|
|
7847
8096
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7848
8097
|
);
|
|
7849
8098
|
}
|
|
@@ -7860,7 +8109,7 @@ var init_PathResolver = __esm({
|
|
|
7860
8109
|
return fs.existsSync(filePath);
|
|
7861
8110
|
} catch (error2) {
|
|
7862
8111
|
if (!silent) {
|
|
7863
|
-
|
|
8112
|
+
log3.error(`Error checking path existence: ${filePath}`, error2);
|
|
7864
8113
|
}
|
|
7865
8114
|
return false;
|
|
7866
8115
|
}
|
|
@@ -7886,7 +8135,7 @@ var init_PathResolver = __esm({
|
|
|
7886
8135
|
return fs.readdirSync(dirPath, options);
|
|
7887
8136
|
} catch (error2) {
|
|
7888
8137
|
if (this.options.debug) {
|
|
7889
|
-
|
|
8138
|
+
log3.warn(`Failed to read directory: ${dirPath}`, error2);
|
|
7890
8139
|
}
|
|
7891
8140
|
const isObjectOptions = options && typeof options === "object" && "withFileTypes" in options;
|
|
7892
8141
|
return isObjectOptions && options.withFileTypes ? [] : [];
|
|
@@ -7904,7 +8153,7 @@ var init_PathResolver = __esm({
|
|
|
7904
8153
|
return fs.statSync(filePath);
|
|
7905
8154
|
} catch (error2) {
|
|
7906
8155
|
if (this.options.debug) {
|
|
7907
|
-
|
|
8156
|
+
log3.warn(`Failed to stat file: ${filePath}`, error2);
|
|
7908
8157
|
}
|
|
7909
8158
|
return null;
|
|
7910
8159
|
}
|
|
@@ -7921,7 +8170,7 @@ var init_PathResolver = __esm({
|
|
|
7921
8170
|
return fs.lstatSync(filePath);
|
|
7922
8171
|
} catch (error2) {
|
|
7923
8172
|
if (this.options.debug) {
|
|
7924
|
-
|
|
8173
|
+
log3.warn(`Failed to lstat file: ${filePath}`, error2);
|
|
7925
8174
|
}
|
|
7926
8175
|
return null;
|
|
7927
8176
|
}
|
|
@@ -8010,7 +8259,7 @@ var init_PathResolver = __esm({
|
|
|
8010
8259
|
* @returns True if repoRoot is the monorepo (has packages directory)
|
|
8011
8260
|
*/
|
|
8012
8261
|
isMonorepo() {
|
|
8013
|
-
const packagesDir =
|
|
8262
|
+
const packagesDir = join2(this._repoRoot, "packages");
|
|
8014
8263
|
return this.pathExists(packagesDir);
|
|
8015
8264
|
}
|
|
8016
8265
|
/**
|
|
@@ -8027,7 +8276,7 @@ var init_PathResolver = __esm({
|
|
|
8027
8276
|
* Find files matching pattern within directory
|
|
8028
8277
|
*/
|
|
8029
8278
|
async findFiles(directory, pattern, options = {}) {
|
|
8030
|
-
const searchPattern = this.normalizePath(
|
|
8279
|
+
const searchPattern = this.normalizePath(join2(directory, pattern));
|
|
8031
8280
|
const appRoot = this.getAppRoot();
|
|
8032
8281
|
const normalizeAppRoot = this.normalizePath(appRoot);
|
|
8033
8282
|
const relativePattern = searchPattern.startsWith(normalizeAppRoot) ? searchPattern.slice(normalizeAppRoot.length + 1) : searchPattern;
|
|
@@ -8074,7 +8323,7 @@ var init_PathResolver = __esm({
|
|
|
8074
8323
|
return null;
|
|
8075
8324
|
}
|
|
8076
8325
|
const resolvedPath = this.normalizePath(
|
|
8077
|
-
|
|
8326
|
+
join2(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
|
|
8078
8327
|
);
|
|
8079
8328
|
const resolvedDir = resolvedPath.replace(/\/[^/]*\*.*$/, "");
|
|
8080
8329
|
if (this.pathExists(resolvedDir)) {
|
|
@@ -8270,13 +8519,13 @@ var init_PathResolver = __esm({
|
|
|
8270
8519
|
const maxLevels = this.options.maxLevels;
|
|
8271
8520
|
while (levelsChecked < maxLevels) {
|
|
8272
8521
|
const toolingPath = this.normalizePath(
|
|
8273
|
-
|
|
8522
|
+
join2(currentDir, PACKAGE_PATHS.TOOLING)
|
|
8274
8523
|
);
|
|
8275
|
-
const corePath = this.normalizePath(
|
|
8524
|
+
const corePath = this.normalizePath(join2(currentDir, PACKAGE_PATHS.CORE));
|
|
8276
8525
|
if (this.pathExists(toolingPath) && this.pathExists(corePath)) {
|
|
8277
8526
|
return currentDir;
|
|
8278
8527
|
}
|
|
8279
|
-
const appsDir =
|
|
8528
|
+
const appsDir = join2(currentDir, "apps");
|
|
8280
8529
|
if (this.pathExists(appsDir)) {
|
|
8281
8530
|
const appsDirStat = this.statSync(appsDir);
|
|
8282
8531
|
if (appsDirStat?.isDirectory()) {
|
|
@@ -8284,15 +8533,15 @@ var init_PathResolver = __esm({
|
|
|
8284
8533
|
}
|
|
8285
8534
|
}
|
|
8286
8535
|
const packageJsonPath = this.normalizePath(
|
|
8287
|
-
|
|
8536
|
+
join2(currentDir, "package.json")
|
|
8288
8537
|
);
|
|
8289
8538
|
if (this.pathExists(packageJsonPath)) {
|
|
8290
|
-
const parentDir2 = this.normalizePath(
|
|
8539
|
+
const parentDir2 = this.normalizePath(dirname2(currentDir));
|
|
8291
8540
|
if (parentDir2 === currentDir) {
|
|
8292
8541
|
return currentDir;
|
|
8293
8542
|
}
|
|
8294
8543
|
}
|
|
8295
|
-
const parentDir = this.normalizePath(
|
|
8544
|
+
const parentDir = this.normalizePath(dirname2(currentDir));
|
|
8296
8545
|
if (parentDir === currentDir) {
|
|
8297
8546
|
break;
|
|
8298
8547
|
}
|
|
@@ -8308,8 +8557,8 @@ var init_PathResolver = __esm({
|
|
|
8308
8557
|
// packages/tooling/src/utils/pathResolver.ts
|
|
8309
8558
|
import { createRequire as createRequire2 } from "node:module";
|
|
8310
8559
|
import {
|
|
8311
|
-
join as
|
|
8312
|
-
dirname as
|
|
8560
|
+
join as join3,
|
|
8561
|
+
dirname as dirname3,
|
|
8313
8562
|
basename as basename2,
|
|
8314
8563
|
extname as extname2,
|
|
8315
8564
|
relative as relative2,
|
|
@@ -8318,7 +8567,7 @@ import {
|
|
|
8318
8567
|
isAbsolute as pathIsAbsolute
|
|
8319
8568
|
} from "node:path";
|
|
8320
8569
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
8321
|
-
function
|
|
8570
|
+
function readdirSync3(dirPath, options) {
|
|
8322
8571
|
return pathResolverInstance.readdirSync(dirPath, options);
|
|
8323
8572
|
}
|
|
8324
8573
|
var pathResolverInstance, getRepoRoot, getAppRoot, normalizePath, pathExists, readSync, write, statSync2, ensureDir, joinPath;
|
|
@@ -8331,7 +8580,7 @@ var init_pathResolver = __esm({
|
|
|
8331
8580
|
getRepoRoot = () => pathResolverInstance.getRepoRoot();
|
|
8332
8581
|
getAppRoot = () => pathResolverInstance.getAppRoot();
|
|
8333
8582
|
normalizePath = (...pathSegments) => {
|
|
8334
|
-
return pathResolverInstance.normalizePath(
|
|
8583
|
+
return pathResolverInstance.normalizePath(join3(...pathSegments));
|
|
8335
8584
|
};
|
|
8336
8585
|
pathExists = (filePath, silent = false) => pathResolverInstance.pathExists(filePath, silent);
|
|
8337
8586
|
readSync = (filePath, options) => pathResolverInstance.readSync(filePath, options);
|
|
@@ -8390,7 +8639,7 @@ var init_typed_file_operations = __esm({
|
|
|
8390
8639
|
import { Buffer } from "node:buffer";
|
|
8391
8640
|
import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
8392
8641
|
import { createRequire as createRequire3 } from "node:module";
|
|
8393
|
-
import { dirname as
|
|
8642
|
+
import { dirname as dirname4, resolve as resolve3 } from "node:path";
|
|
8394
8643
|
import process from "node:process";
|
|
8395
8644
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
8396
8645
|
var require2, __filename, __dirname;
|
|
@@ -8399,7 +8648,7 @@ var init_utils2 = __esm({
|
|
|
8399
8648
|
"use strict";
|
|
8400
8649
|
require2 = createRequire3(import.meta.url);
|
|
8401
8650
|
__filename = fileURLToPath3(import.meta.url);
|
|
8402
|
-
__dirname =
|
|
8651
|
+
__dirname = dirname4(__filename);
|
|
8403
8652
|
if (typeof globalThis !== "undefined") {
|
|
8404
8653
|
globalThis.require = require2;
|
|
8405
8654
|
globalThis.__filename = __filename;
|
|
@@ -8581,12 +8830,12 @@ var init_app_detection = __esm({
|
|
|
8581
8830
|
|
|
8582
8831
|
// packages/tooling/src/utils/cli-input.ts
|
|
8583
8832
|
async function askForConfirmation(message, defaultValue = false) {
|
|
8584
|
-
const result = await
|
|
8833
|
+
const result = await confirm({
|
|
8585
8834
|
message,
|
|
8586
8835
|
initialValue: defaultValue
|
|
8587
8836
|
});
|
|
8588
|
-
if (
|
|
8589
|
-
|
|
8837
|
+
if (isCancel(result)) {
|
|
8838
|
+
cancel("Operation cancelled.");
|
|
8590
8839
|
process.exit(0);
|
|
8591
8840
|
}
|
|
8592
8841
|
return result;
|
|
@@ -8597,13 +8846,13 @@ async function askForSelection(message, choices, defaultValue = 0) {
|
|
|
8597
8846
|
label: choice.title,
|
|
8598
8847
|
hint: choice.hint
|
|
8599
8848
|
}));
|
|
8600
|
-
const result = await
|
|
8849
|
+
const result = await select({
|
|
8601
8850
|
message,
|
|
8602
8851
|
options,
|
|
8603
8852
|
initialValue: choices[defaultValue]?.value
|
|
8604
8853
|
});
|
|
8605
|
-
if (
|
|
8606
|
-
|
|
8854
|
+
if (isCancel(result)) {
|
|
8855
|
+
cancel("Operation cancelled.");
|
|
8607
8856
|
process.exit(0);
|
|
8608
8857
|
}
|
|
8609
8858
|
return result;
|
|
@@ -8688,7 +8937,7 @@ function resolveSecret(name, projectRoot, opts) {
|
|
|
8688
8937
|
if (value) {
|
|
8689
8938
|
if (!opts?.silent && !warnedLegacy.has(name)) {
|
|
8690
8939
|
warnedLegacy.add(name);
|
|
8691
|
-
|
|
8940
|
+
log2.warn(
|
|
8692
8941
|
`${name} found in ${relPath} (legacy). Move it to .dndev.secrets at project root.`
|
|
8693
8942
|
);
|
|
8694
8943
|
}
|
|
@@ -8699,7 +8948,7 @@ function resolveSecret(name, projectRoot, opts) {
|
|
|
8699
8948
|
if (aliasValue) {
|
|
8700
8949
|
if (!opts?.silent && !warnedLegacy.has(name)) {
|
|
8701
8950
|
warnedLegacy.add(name);
|
|
8702
|
-
|
|
8951
|
+
log2.warn(
|
|
8703
8952
|
`${name} found in ${relPath} (legacy). Move it to .dndev.secrets at project root.`
|
|
8704
8953
|
);
|
|
8705
8954
|
}
|
|
@@ -8787,13 +9036,13 @@ function detectGitHubRepo() {
|
|
|
8787
9036
|
}
|
|
8788
9037
|
function setGitHubSecret(key, value, repo, dryRun = false) {
|
|
8789
9038
|
if (dryRun) {
|
|
8790
|
-
|
|
9039
|
+
log2.info(
|
|
8791
9040
|
`[DRY RUN] Would set GitHub secret: ${key}${repo ? ` (repo: ${repo})` : ""}`
|
|
8792
9041
|
);
|
|
8793
9042
|
return;
|
|
8794
9043
|
}
|
|
8795
9044
|
try {
|
|
8796
|
-
|
|
9045
|
+
log2.info(`Setting GitHub secret: ${key}${repo ? ` (repo: ${repo})` : ""}`);
|
|
8797
9046
|
const args = ["secret", "set", key];
|
|
8798
9047
|
if (repo) {
|
|
8799
9048
|
args.push("--repo", repo);
|
|
@@ -8808,8 +9057,8 @@ function setGitHubSecret(key, value, repo, dryRun = false) {
|
|
|
8808
9057
|
}
|
|
8809
9058
|
if (result.status !== 0) {
|
|
8810
9059
|
const stderr = result.stderr?.toString() || "";
|
|
8811
|
-
const
|
|
8812
|
-
const errorOutput = stderr ||
|
|
9060
|
+
const stdout2 = result.stdout?.toString() || "";
|
|
9061
|
+
const errorOutput = stderr || stdout2;
|
|
8813
9062
|
if (errorOutput.includes("not logged in") || errorOutput.includes("authentication")) {
|
|
8814
9063
|
throw new DoNotDevError(
|
|
8815
9064
|
`GitHub CLI authentication required. Run 'gh auth login' to authenticate.`,
|
|
@@ -8822,10 +9071,10 @@ function setGitHubSecret(key, value, repo, dryRun = false) {
|
|
|
8822
9071
|
${errorOutput}`
|
|
8823
9072
|
);
|
|
8824
9073
|
}
|
|
8825
|
-
|
|
9074
|
+
log2.success(`GitHub secret ${key} set successfully`);
|
|
8826
9075
|
} catch (err) {
|
|
8827
9076
|
if (err instanceof DoNotDevError) throw err;
|
|
8828
|
-
|
|
9077
|
+
log2.error(`Failed to set GitHub secret ${key}:`, err);
|
|
8829
9078
|
throw new DoNotDevError(
|
|
8830
9079
|
`Failed to set GitHub secret ${key}`,
|
|
8831
9080
|
"command-failed",
|
|
@@ -8844,7 +9093,7 @@ function uploadServiceAccountToGitHub(appDir, repo, dryRun = false, staging = fa
|
|
|
8844
9093
|
const secretName = staging ? "FIREBASE_SERVICE_ACCOUNT_STAGING" : "FIREBASE_SERVICE_ACCOUNT";
|
|
8845
9094
|
const filePath = joinPath(appDir, fileName);
|
|
8846
9095
|
if (!pathExists(filePath)) {
|
|
8847
|
-
|
|
9096
|
+
log2.debug(`No ${fileName} found in ${appDir}, skipping GitHub upload`);
|
|
8848
9097
|
return;
|
|
8849
9098
|
}
|
|
8850
9099
|
const contentRaw = readSync(filePath, { format: "text" });
|
|
@@ -8883,7 +9132,7 @@ function detectAvailableApps() {
|
|
|
8883
9132
|
if (!pathExists(appsDir)) {
|
|
8884
9133
|
return [];
|
|
8885
9134
|
}
|
|
8886
|
-
return
|
|
9135
|
+
return readdirSync3(appsDir).filter((item) => {
|
|
8887
9136
|
const itemPath = joinPath(appsDir, item);
|
|
8888
9137
|
const stat = statSync2(itemPath);
|
|
8889
9138
|
return stat?.isDirectory() === true;
|
|
@@ -8897,7 +9146,7 @@ function detectAvailableApps() {
|
|
|
8897
9146
|
}
|
|
8898
9147
|
function readStagingProject(startDir) {
|
|
8899
9148
|
let current = startDir;
|
|
8900
|
-
for (let
|
|
9149
|
+
for (let i2 = 0; i2 < 10; i2++) {
|
|
8901
9150
|
const firebasercPath = joinPath(current, ".firebaserc");
|
|
8902
9151
|
if (pathExists(firebasercPath)) {
|
|
8903
9152
|
try {
|
|
@@ -8920,8 +9169,8 @@ init_utils2();
|
|
|
8920
9169
|
import { execSync } from "node:child_process";
|
|
8921
9170
|
init_sync_secrets();
|
|
8922
9171
|
init_vercel_token();
|
|
8923
|
-
init_pathResolver();
|
|
8924
9172
|
init_app_detection();
|
|
9173
|
+
init_pathResolver();
|
|
8925
9174
|
init_secrets_resolver();
|
|
8926
9175
|
function isGhCliAvailable() {
|
|
8927
9176
|
try {
|
|
@@ -9089,7 +9338,7 @@ jobs:
|
|
|
9089
9338
|
}
|
|
9090
9339
|
function generateDeployWorkflow(providers, envSecretNames) {
|
|
9091
9340
|
const appName = providers.name;
|
|
9092
|
-
const envBlock = envSecretNames.filter((
|
|
9341
|
+
const envBlock = envSecretNames.filter((n3) => n3.startsWith("VITE_") || n3.startsWith("NEXT_PUBLIC_")).map((n3) => ` ${n3}: \${{ secrets.${n3} }}`).join("\n");
|
|
9093
9342
|
let steps = ` - name: Checkout repository
|
|
9094
9343
|
uses: actions/checkout@v4
|
|
9095
9344
|
|
|
@@ -9191,7 +9440,7 @@ ${steps}
|
|
|
9191
9440
|
}
|
|
9192
9441
|
function generateStagingWorkflow(providers, envSecretNames) {
|
|
9193
9442
|
const appName = providers.name;
|
|
9194
|
-
const envBlock = envSecretNames.filter((
|
|
9443
|
+
const envBlock = envSecretNames.filter((n3) => n3.startsWith("VITE_") || n3.startsWith("NEXT_PUBLIC_")).map((n3) => ` ${n3}: \${{ secrets.${n3} }}`).join("\n");
|
|
9195
9444
|
let steps = ` - name: Checkout repository
|
|
9196
9445
|
uses: actions/checkout@v4
|
|
9197
9446
|
|
|
@@ -9278,50 +9527,50 @@ ${steps}
|
|
|
9278
9527
|
}
|
|
9279
9528
|
async function main(options = {}) {
|
|
9280
9529
|
const dryRun = options.dryRun ?? false;
|
|
9281
|
-
|
|
9530
|
+
intro("CI/CD Setup");
|
|
9282
9531
|
if (!isGhCliAvailable()) {
|
|
9283
|
-
|
|
9532
|
+
log2.error(
|
|
9284
9533
|
"GitHub CLI (gh) is required.\nInstall: https://cli.github.com/\nThen: gh auth login"
|
|
9285
9534
|
);
|
|
9286
9535
|
return 1;
|
|
9287
9536
|
}
|
|
9288
9537
|
if (!isGhAuthenticated()) {
|
|
9289
|
-
|
|
9538
|
+
log2.error("GitHub CLI not authenticated.\nRun: gh auth login");
|
|
9290
9539
|
return 1;
|
|
9291
9540
|
}
|
|
9292
9541
|
const repo = detectGitHubRepo();
|
|
9293
9542
|
if (!repo) {
|
|
9294
|
-
|
|
9543
|
+
log2.error(
|
|
9295
9544
|
"Could not detect GitHub repository from git remote.\nEnsure a GitHub remote is configured."
|
|
9296
9545
|
);
|
|
9297
9546
|
return 1;
|
|
9298
9547
|
}
|
|
9299
9548
|
if (dryRun) {
|
|
9300
|
-
|
|
9549
|
+
log2.info("DRY RUN MODE \u2014 no secrets will be uploaded, no files written");
|
|
9301
9550
|
}
|
|
9302
9551
|
const projectRoot = getAppRoot();
|
|
9303
9552
|
let appName = options.app;
|
|
9304
9553
|
if (!appName) {
|
|
9305
9554
|
const availableApps = detectAvailableApps();
|
|
9306
9555
|
if (availableApps.length === 0) {
|
|
9307
|
-
|
|
9556
|
+
log2.error(
|
|
9308
9557
|
"No apps found with firebase.json, supabase/, or vercel.json.\nRun from a DoNotDev project with at least one configured app."
|
|
9309
9558
|
);
|
|
9310
9559
|
return 1;
|
|
9311
9560
|
}
|
|
9312
9561
|
if (availableApps.length === 1) {
|
|
9313
9562
|
appName = availableApps[0];
|
|
9314
|
-
|
|
9563
|
+
note(`Using app: ${appName}`, "Auto-detected");
|
|
9315
9564
|
} else {
|
|
9316
9565
|
appName = await askForSelection(
|
|
9317
9566
|
"Which app to set up CI/CD for?",
|
|
9318
|
-
availableApps.map((
|
|
9567
|
+
availableApps.map((a2) => ({ title: a2, value: a2 }))
|
|
9319
9568
|
);
|
|
9320
9569
|
}
|
|
9321
9570
|
}
|
|
9322
9571
|
const appDir = joinPath(projectRoot, "apps", appName);
|
|
9323
9572
|
if (!pathExists(appDir)) {
|
|
9324
|
-
|
|
9573
|
+
log2.error(`App directory not found: ${appDir}`);
|
|
9325
9574
|
return 1;
|
|
9326
9575
|
}
|
|
9327
9576
|
const providers = detectProvider(appDir);
|
|
@@ -9354,16 +9603,16 @@ async function main(options = {}) {
|
|
|
9354
9603
|
`Staging: ${config.hasStaging ? "yes" : "no"}`,
|
|
9355
9604
|
"",
|
|
9356
9605
|
`Workflows to generate:`,
|
|
9357
|
-
...workflows.map((
|
|
9606
|
+
...workflows.map((w) => ` - ${w}`),
|
|
9358
9607
|
"",
|
|
9359
9608
|
`Secrets to upload (${secrets.length}):`,
|
|
9360
9609
|
...secrets.map(
|
|
9361
9610
|
(s2) => ` ${s2.source === "MISSING" ? "(!) " : ""}${s2.name} \u2014 ${s2.source}`
|
|
9362
9611
|
)
|
|
9363
9612
|
];
|
|
9364
|
-
|
|
9613
|
+
note(planLines.join("\n"), "CI/CD Plan");
|
|
9365
9614
|
if (missingSecrets.length > 0) {
|
|
9366
|
-
|
|
9615
|
+
log2.warn(
|
|
9367
9616
|
`Missing secrets: ${missingSecrets.map((s2) => s2.name).join(", ")}
|
|
9368
9617
|
These will be skipped. Add them to .dndev.secrets or .env and re-run.`
|
|
9369
9618
|
);
|
|
@@ -9371,11 +9620,11 @@ These will be skipped. Add them to .dndev.secrets or .env and re-run.`
|
|
|
9371
9620
|
if (!dryRun) {
|
|
9372
9621
|
const confirmed = await askForConfirmation("Proceed with CI/CD setup?");
|
|
9373
9622
|
if (!confirmed) {
|
|
9374
|
-
|
|
9623
|
+
outro("Setup cancelled");
|
|
9375
9624
|
return 0;
|
|
9376
9625
|
}
|
|
9377
9626
|
}
|
|
9378
|
-
const s =
|
|
9627
|
+
const s = spinner();
|
|
9379
9628
|
const uploadableSecrets = secrets.filter(
|
|
9380
9629
|
(sec) => sec.value !== "" && sec.source !== "MISSING" && !sec.value.startsWith("__SERVICE_ACCOUNT")
|
|
9381
9630
|
);
|
|
@@ -9389,7 +9638,7 @@ These will be skipped. Add them to .dndev.secrets or .env and re-run.`
|
|
|
9389
9638
|
successCount++;
|
|
9390
9639
|
} catch (err) {
|
|
9391
9640
|
failCount++;
|
|
9392
|
-
|
|
9641
|
+
log2.error(
|
|
9393
9642
|
`Failed: ${sec.name} \u2014 ${err instanceof Error ? err.message : String(err)}`
|
|
9394
9643
|
);
|
|
9395
9644
|
}
|
|
@@ -9423,23 +9672,23 @@ These will be skipped. Add them to .dndev.secrets or .env and re-run.`
|
|
|
9423
9672
|
stagingYaml = generateStagingWorkflow(providers, secretNames);
|
|
9424
9673
|
}
|
|
9425
9674
|
if (dryRun) {
|
|
9426
|
-
|
|
9427
|
-
|
|
9428
|
-
|
|
9429
|
-
|
|
9675
|
+
log2.info("\n--- ci.yml ---");
|
|
9676
|
+
log2.info(ciYaml);
|
|
9677
|
+
log2.info("\n--- deploy.yml ---");
|
|
9678
|
+
log2.info(deployYaml);
|
|
9430
9679
|
if (stagingYaml) {
|
|
9431
|
-
|
|
9432
|
-
|
|
9680
|
+
log2.info("\n--- deploy-staging.yml ---");
|
|
9681
|
+
log2.info(stagingYaml);
|
|
9433
9682
|
}
|
|
9434
9683
|
} else {
|
|
9435
9684
|
ensureDir(workflowDir);
|
|
9436
9685
|
write(joinPath(workflowDir, "ci.yml"), ciYaml);
|
|
9437
|
-
|
|
9686
|
+
log2.success("Generated .github/workflows/ci.yml");
|
|
9438
9687
|
write(joinPath(workflowDir, "deploy.yml"), deployYaml);
|
|
9439
|
-
|
|
9688
|
+
log2.success("Generated .github/workflows/deploy.yml");
|
|
9440
9689
|
if (stagingYaml) {
|
|
9441
9690
|
write(joinPath(workflowDir, "deploy-staging.yml"), stagingYaml);
|
|
9442
|
-
|
|
9691
|
+
log2.success("Generated .github/workflows/deploy-staging.yml");
|
|
9443
9692
|
}
|
|
9444
9693
|
}
|
|
9445
9694
|
const nextSteps = [
|
|
@@ -9456,8 +9705,8 @@ These will be skipped. Add them to .dndev.secrets or .env and re-run.`
|
|
|
9456
9705
|
"Add GH_PAT to .dndev.secrets (needed for private dndev checkout in CI)"
|
|
9457
9706
|
);
|
|
9458
9707
|
}
|
|
9459
|
-
|
|
9460
|
-
|
|
9708
|
+
note(nextSteps.map((s2, i2) => `${i2 + 1}. ${s2}`).join("\n"), "Next Steps");
|
|
9709
|
+
outro(dryRun ? "CI/CD setup preview complete!" : "CI/CD setup complete!");
|
|
9461
9710
|
return 0;
|
|
9462
9711
|
}
|
|
9463
9712
|
export {
|