@donotdev/cli 0.1.44 → 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 +34 -22
- 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
- package/templates/app-next/src/app/layout.tsx.example +8 -0
- package/templates/app-next/src/app/not-found.tsx.example +6 -0
|
@@ -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;
|
|
134
|
-
}
|
|
135
|
-
ANSI_RE.lastIndex = index;
|
|
136
|
-
if (ANSI_RE.test(input)) {
|
|
137
|
-
if (width + ANSI_WIDTH > truncationLimit) {
|
|
138
|
-
truncationIndex = Math.min(truncationIndex, index);
|
|
139
|
-
}
|
|
140
|
-
if (width + ANSI_WIDTH > LIMIT) {
|
|
141
|
-
truncationEnabled = true;
|
|
142
|
-
break;
|
|
143
|
-
}
|
|
144
|
-
width += ANSI_WIDTH;
|
|
145
|
-
unmatchedStart = indexPrev;
|
|
146
|
-
unmatchedEnd = index;
|
|
147
|
-
index = indexPrev = ANSI_RE.lastIndex;
|
|
148
|
-
continue;
|
|
149
|
-
}
|
|
150
|
-
CONTROL_RE.lastIndex = index;
|
|
151
|
-
if (CONTROL_RE.test(input)) {
|
|
152
|
-
lengthExtra = CONTROL_RE.lastIndex - index;
|
|
153
|
-
widthExtra = lengthExtra * CONTROL_WIDTH;
|
|
154
|
-
if (width + widthExtra > truncationLimit) {
|
|
155
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
|
|
156
|
-
}
|
|
157
|
-
if (width + widthExtra > LIMIT) {
|
|
158
|
-
truncationEnabled = true;
|
|
159
|
-
break;
|
|
160
|
-
}
|
|
161
|
-
width += widthExtra;
|
|
162
|
-
unmatchedStart = indexPrev;
|
|
163
|
-
unmatchedEnd = index;
|
|
164
|
-
index = indexPrev = CONTROL_RE.lastIndex;
|
|
165
|
-
continue;
|
|
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;
|
|
130
|
+
if (index >= length) {
|
|
131
|
+
break outer;
|
|
183
132
|
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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;
|
|
509
467
|
}
|
|
510
|
-
function
|
|
511
|
-
if (
|
|
512
|
-
|
|
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";
|
|
473
|
+
}
|
|
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, 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,27 +780,28 @@ var init_dist3 = __esm({
|
|
|
689
780
|
}
|
|
690
781
|
}
|
|
691
782
|
};
|
|
692
|
-
|
|
783
|
+
n$1 = class n extends y {
|
|
693
784
|
options;
|
|
694
785
|
cursor = 0;
|
|
695
786
|
get _selectedValue() {
|
|
696
787
|
return this.options[this.cursor];
|
|
697
788
|
}
|
|
698
789
|
changeValue() {
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
790
|
+
const e = this._selectedValue;
|
|
791
|
+
this.value = e === void 0 ? void 0 : e.value;
|
|
792
|
+
}
|
|
793
|
+
constructor(e) {
|
|
794
|
+
super(e, false), this.options = e.options;
|
|
795
|
+
const o = this.options.findIndex(({ value: s }) => s === e.initialValue), t2 = o === -1 ? 0 : o;
|
|
796
|
+
this.cursor = this.options[t2]?.disabled ? findCursor(t2, 1, this.options) : t2, this.changeValue(), this.on("cursor", (s) => {
|
|
797
|
+
switch (s) {
|
|
706
798
|
case "left":
|
|
707
799
|
case "up":
|
|
708
|
-
this.cursor =
|
|
800
|
+
this.cursor = findCursor(this.cursor, -1, this.options);
|
|
709
801
|
break;
|
|
710
802
|
case "down":
|
|
711
803
|
case "right":
|
|
712
|
-
this.cursor =
|
|
804
|
+
this.cursor = findCursor(this.cursor, 1, this.options);
|
|
713
805
|
break;
|
|
714
806
|
}
|
|
715
807
|
this.changeValue();
|
|
@@ -719,253 +811,384 @@ var init_dist3 = __esm({
|
|
|
719
811
|
}
|
|
720
812
|
});
|
|
721
813
|
|
|
722
|
-
// node_modules/.bun/@clack+prompts@1.
|
|
723
|
-
import { styleText as
|
|
724
|
-
import
|
|
725
|
-
import { existsSync
|
|
726
|
-
import { dirname
|
|
727
|
-
function
|
|
728
|
-
|
|
814
|
+
// node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs
|
|
815
|
+
import { styleText as styleText2, stripVTControlCharacters } from "node:util";
|
|
816
|
+
import process$1 from "node:process";
|
|
817
|
+
import { existsSync, lstatSync, readdirSync } from "node:fs";
|
|
818
|
+
import { dirname, join } from "node:path";
|
|
819
|
+
function isUnicodeSupported() {
|
|
820
|
+
if (process$1.platform !== "win32") {
|
|
821
|
+
return process$1.env.TERM !== "linux";
|
|
822
|
+
}
|
|
823
|
+
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";
|
|
824
|
+
}
|
|
825
|
+
function formatInstructionFooter(o, e) {
|
|
826
|
+
const r2 = [`${e ? `${styleText2("cyan", S_BAR)} ` : ""}${o.join(" \u2022 ")}`];
|
|
827
|
+
return e && r2.push(styleText2("cyan", S_BAR_END)), r2;
|
|
729
828
|
}
|
|
730
|
-
var import_sisteransi2,
|
|
829
|
+
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, MULTISELECT_INSTRUCTIONS, log, cancel, intro, outro, W, spinner, u2, SELECT_INSTRUCTIONS, c, select, i;
|
|
731
830
|
var init_dist4 = __esm({
|
|
732
|
-
"node_modules/.bun/@clack+prompts@1.
|
|
831
|
+
"node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs"() {
|
|
733
832
|
init_utils2();
|
|
734
833
|
init_dist3();
|
|
735
834
|
init_dist3();
|
|
736
835
|
init_main();
|
|
737
836
|
init_dist2();
|
|
738
837
|
import_sisteransi2 = __toESM(require_src(), 1);
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
switch (
|
|
838
|
+
unicode = isUnicodeSupported();
|
|
839
|
+
isCI = () => process.env.CI === "true";
|
|
840
|
+
unicodeOr = (o, e) => unicode ? o : e;
|
|
841
|
+
S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
|
|
842
|
+
S_STEP_CANCEL = unicodeOr("\u25A0", "x");
|
|
843
|
+
S_STEP_ERROR = unicodeOr("\u25B2", "x");
|
|
844
|
+
S_STEP_SUBMIT = unicodeOr("\u25C7", "o");
|
|
845
|
+
S_BAR_START = unicodeOr("\u250C", "T");
|
|
846
|
+
S_BAR = unicodeOr("\u2502", "|");
|
|
847
|
+
S_BAR_END = unicodeOr("\u2514", "\u2014");
|
|
848
|
+
S_BAR_START_RIGHT = unicodeOr("\u2510", "T");
|
|
849
|
+
S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014");
|
|
850
|
+
S_RADIO_ACTIVE = unicodeOr("\u25CF", ">");
|
|
851
|
+
S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
|
|
852
|
+
S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
|
|
853
|
+
S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
|
|
854
|
+
S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
|
|
855
|
+
S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022");
|
|
856
|
+
S_BAR_H = unicodeOr("\u2500", "-");
|
|
857
|
+
S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+");
|
|
858
|
+
S_CONNECT_LEFT = unicodeOr("\u251C", "+");
|
|
859
|
+
S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+");
|
|
860
|
+
S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+");
|
|
861
|
+
S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+");
|
|
862
|
+
S_INFO = unicodeOr("\u25CF", "\u2022");
|
|
863
|
+
S_SUCCESS = unicodeOr("\u25C6", "*");
|
|
864
|
+
S_WARN = unicodeOr("\u25B2", "!");
|
|
865
|
+
S_ERROR = unicodeOr("\u25A0", "x");
|
|
866
|
+
symbol = (o) => {
|
|
867
|
+
switch (o) {
|
|
769
868
|
case "initial":
|
|
770
869
|
case "active":
|
|
771
|
-
return
|
|
870
|
+
return styleText2("cyan", S_STEP_ACTIVE);
|
|
772
871
|
case "cancel":
|
|
773
|
-
return
|
|
872
|
+
return styleText2("red", S_STEP_CANCEL);
|
|
774
873
|
case "error":
|
|
775
|
-
return
|
|
874
|
+
return styleText2("yellow", S_STEP_ERROR);
|
|
776
875
|
case "submit":
|
|
777
|
-
return
|
|
876
|
+
return styleText2("green", S_STEP_SUBMIT);
|
|
877
|
+
case "validating":
|
|
878
|
+
return styleText2("dim", S_STEP_ACTIVE);
|
|
778
879
|
}
|
|
779
880
|
};
|
|
780
|
-
|
|
781
|
-
switch (
|
|
881
|
+
symbolBar = (o) => {
|
|
882
|
+
switch (o) {
|
|
782
883
|
case "initial":
|
|
783
884
|
case "active":
|
|
784
|
-
return
|
|
885
|
+
return styleText2("cyan", S_BAR);
|
|
785
886
|
case "cancel":
|
|
786
|
-
return
|
|
887
|
+
return styleText2("red", S_BAR);
|
|
787
888
|
case "error":
|
|
788
|
-
return
|
|
889
|
+
return styleText2("yellow", S_BAR);
|
|
789
890
|
case "submit":
|
|
790
|
-
return
|
|
791
|
-
}
|
|
792
|
-
};
|
|
793
|
-
|
|
794
|
-
let
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
891
|
+
return styleText2("green", S_BAR);
|
|
892
|
+
}
|
|
893
|
+
};
|
|
894
|
+
I = (l2, e, w, p, b, C = false) => {
|
|
895
|
+
let r2 = e, O = 0;
|
|
896
|
+
if (C)
|
|
897
|
+
for (let i2 = p - 1; i2 >= w; i2--) {
|
|
898
|
+
const m = l2[i2];
|
|
899
|
+
if (m && (r2 -= m.length), O++, r2 <= b) break;
|
|
900
|
+
}
|
|
901
|
+
else
|
|
902
|
+
for (let i2 = w; i2 < p; i2++) {
|
|
903
|
+
const m = l2[i2];
|
|
904
|
+
if (m && (r2 -= m.length), O++, r2 <= b) break;
|
|
905
|
+
}
|
|
906
|
+
return { lineCount: r2, removals: O };
|
|
907
|
+
};
|
|
908
|
+
limitOptions = ({
|
|
909
|
+
cursor: l2,
|
|
910
|
+
options: e,
|
|
911
|
+
style: w,
|
|
912
|
+
output: p = process.stdout,
|
|
913
|
+
maxItems: b = Number.POSITIVE_INFINITY,
|
|
914
|
+
columnPadding: C = 0,
|
|
915
|
+
rowPadding: r2 = 4
|
|
916
|
+
}) => {
|
|
917
|
+
const i2 = getColumns(p) - C, m = getRows(p), M = styleText2("dim", "..."), v = Math.max(m - r2, 0), a2 = Math.max(Math.min(b, v), 5);
|
|
807
918
|
let f = 0;
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
919
|
+
l2 >= a2 - 3 && (f = Math.max(
|
|
920
|
+
Math.min(l2 - a2 + 3, e.length - a2),
|
|
921
|
+
0
|
|
922
|
+
));
|
|
923
|
+
let d = a2 < e.length && f > 0, c2 = a2 < e.length && f + a2 < e.length;
|
|
924
|
+
const W2 = Math.min(
|
|
925
|
+
f + a2,
|
|
926
|
+
e.length
|
|
927
|
+
), s = [];
|
|
928
|
+
let g = 0;
|
|
929
|
+
d && g++, c2 && g++;
|
|
930
|
+
const T = f + (d ? 1 : 0), y2 = W2 - (c2 ? 1 : 0);
|
|
931
|
+
for (let t2 = T; t2 < y2; t2++) {
|
|
932
|
+
const n3 = e[t2], o = n3 ? w(n3, t2 === l2) : "", h2 = wrapAnsi(o, i2, {
|
|
933
|
+
hard: true,
|
|
934
|
+
trim: false
|
|
935
|
+
}).split(`
|
|
812
936
|
`);
|
|
813
|
-
|
|
814
|
-
}
|
|
815
|
-
if (
|
|
816
|
-
let
|
|
817
|
-
const
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
937
|
+
s.push(h2), g += h2.length;
|
|
938
|
+
}
|
|
939
|
+
if (g > v) {
|
|
940
|
+
let t2 = 0, n3 = 0, o = g;
|
|
941
|
+
const h2 = l2 - T;
|
|
942
|
+
let u3 = v;
|
|
943
|
+
const L = () => I(s, o, 0, h2, u3), E = () => I(
|
|
944
|
+
s,
|
|
945
|
+
o,
|
|
946
|
+
h2 + 1,
|
|
947
|
+
s.length,
|
|
948
|
+
u3,
|
|
949
|
+
true
|
|
950
|
+
);
|
|
951
|
+
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));
|
|
952
|
+
}
|
|
953
|
+
const x = [];
|
|
954
|
+
d && x.push(M);
|
|
955
|
+
for (const t2 of s)
|
|
956
|
+
for (const n3 of t2)
|
|
957
|
+
x.push(n3);
|
|
958
|
+
return c2 && x.push(M), x;
|
|
959
|
+
};
|
|
960
|
+
MULTISELECT_INSTRUCTIONS = [
|
|
961
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
962
|
+
`${styleText2("dim", "Space:")} select`,
|
|
963
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
964
|
+
];
|
|
965
|
+
log = {
|
|
966
|
+
message: (s = [], {
|
|
967
|
+
symbol: e = styleText2("gray", S_BAR),
|
|
968
|
+
secondarySymbol: r2 = styleText2("gray", S_BAR),
|
|
969
|
+
output: m = process.stdout,
|
|
970
|
+
spacing: l2 = 1,
|
|
971
|
+
withGuide: c2
|
|
972
|
+
} = {}) => {
|
|
973
|
+
const t2 = [], o = c2 ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
|
|
974
|
+
for (let i2 = 0; i2 < l2; i2++)
|
|
975
|
+
t2.push(f);
|
|
976
|
+
const g = Array.isArray(s) ? s : s.split(`
|
|
829
977
|
`);
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
978
|
+
if (g.length > 0) {
|
|
979
|
+
const [i2, ...y2] = g;
|
|
980
|
+
i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
|
|
981
|
+
for (const p of y2)
|
|
982
|
+
p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
|
|
983
|
+
}
|
|
984
|
+
m.write(`${t2.join(`
|
|
836
985
|
`)}
|
|
837
986
|
`);
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
987
|
+
},
|
|
988
|
+
info: (s, e) => {
|
|
989
|
+
log.message(s, { ...e, symbol: styleText2("blue", S_INFO) });
|
|
990
|
+
},
|
|
991
|
+
success: (s, e) => {
|
|
992
|
+
log.message(s, { ...e, symbol: styleText2("green", S_SUCCESS) });
|
|
993
|
+
},
|
|
994
|
+
step: (s, e) => {
|
|
995
|
+
log.message(s, { ...e, symbol: styleText2("green", S_STEP_SUBMIT) });
|
|
996
|
+
},
|
|
997
|
+
warn: (s, e) => {
|
|
998
|
+
log.message(s, { ...e, symbol: styleText2("yellow", S_WARN) });
|
|
999
|
+
},
|
|
1000
|
+
/** alias for `log.warn()`. */
|
|
1001
|
+
warning: (s, e) => {
|
|
1002
|
+
log.warn(s, e);
|
|
1003
|
+
},
|
|
1004
|
+
error: (s, e) => {
|
|
1005
|
+
log.message(s, { ...e, symbol: styleText2("red", S_ERROR) });
|
|
1006
|
+
}
|
|
1007
|
+
};
|
|
1008
|
+
cancel = (o = "", t2) => {
|
|
1009
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_END)} ` : "";
|
|
1010
|
+
i2.write(`${e}${styleText2("red", o)}
|
|
854
1011
|
|
|
855
1012
|
`);
|
|
856
1013
|
};
|
|
857
|
-
|
|
858
|
-
const
|
|
859
|
-
|
|
1014
|
+
intro = (o = "", t2) => {
|
|
1015
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_START)} ` : "";
|
|
1016
|
+
i2.write(`${e}${o}
|
|
860
1017
|
`);
|
|
861
1018
|
};
|
|
862
|
-
|
|
863
|
-
const
|
|
864
|
-
${
|
|
865
|
-
|
|
1019
|
+
outro = (o = "", t2) => {
|
|
1020
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR)}
|
|
1021
|
+
${styleText2("gray", S_BAR_END)} ` : "";
|
|
1022
|
+
i2.write(`${e}${o}
|
|
866
1023
|
|
|
867
1024
|
`);
|
|
868
1025
|
};
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
1026
|
+
W = (l2) => styleText2("magenta", l2);
|
|
1027
|
+
spinner = ({
|
|
1028
|
+
indicator: l2 = "dots",
|
|
1029
|
+
onCancel: h2,
|
|
1030
|
+
output: n3 = process.stdout,
|
|
1031
|
+
cancelMessage: G,
|
|
1032
|
+
errorMessage: O,
|
|
1033
|
+
frames: E = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
|
|
1034
|
+
delay: F = unicode ? 80 : 120,
|
|
1035
|
+
signal: m,
|
|
1036
|
+
...I2
|
|
1037
|
+
} = {}) => {
|
|
1038
|
+
const u3 = isCI();
|
|
1039
|
+
let M, T, d = false, S = false, s = "", p, w = performance.now();
|
|
1040
|
+
const x = getColumns(n3), k = I2?.styleFrame ?? W, g = (e) => {
|
|
1041
|
+
const r2 = e > 1 ? O ?? settings.messages.error : G ?? settings.messages.cancel;
|
|
1042
|
+
S = e === 1, d && (a2(r2, e), S && typeof h2 == "function" && h2());
|
|
1043
|
+
}, f = () => g(2), i2 = () => g(1), A = () => {
|
|
1044
|
+
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);
|
|
1045
|
+
}, H = () => {
|
|
1046
|
+
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);
|
|
1047
|
+
}, y2 = () => {
|
|
1048
|
+
if (p === void 0) return;
|
|
1049
|
+
u3 && n3.write(`
|
|
883
1050
|
`);
|
|
884
|
-
const
|
|
1051
|
+
const r2 = wrapAnsi(p, x, {
|
|
1052
|
+
hard: true,
|
|
1053
|
+
trim: false
|
|
1054
|
+
}).split(`
|
|
885
1055
|
`);
|
|
886
|
-
|
|
887
|
-
},
|
|
888
|
-
const
|
|
889
|
-
return
|
|
890
|
-
},
|
|
891
|
-
|
|
1056
|
+
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());
|
|
1057
|
+
}, C = (e) => e.replace(/\.+$/, ""), _ = (e) => {
|
|
1058
|
+
const r2 = (performance.now() - e) / 1e3, t2 = Math.floor(r2 / 60), o = Math.floor(r2 % 60);
|
|
1059
|
+
return t2 > 0 ? `[${t2}m ${o}s]` : `[${o}s]`;
|
|
1060
|
+
}, N = I2.withGuide ?? settings.withGuide, P = (e = "") => {
|
|
1061
|
+
d = true, M = block({ output: n3 }), s = C(e), w = performance.now(), N && n3.write(`${styleText2("gray", S_BAR)}
|
|
892
1062
|
`);
|
|
893
|
-
let
|
|
894
|
-
|
|
895
|
-
if (
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
1063
|
+
let r2 = 0, t2 = 0;
|
|
1064
|
+
A(), T = setInterval(() => {
|
|
1065
|
+
if (u3 && s === p)
|
|
1066
|
+
return;
|
|
1067
|
+
y2(), p = s;
|
|
1068
|
+
const o = k(E[r2]);
|
|
1069
|
+
let v;
|
|
1070
|
+
if (u3)
|
|
1071
|
+
v = `${o} ${s}...`;
|
|
1072
|
+
else if (l2 === "timer")
|
|
1073
|
+
v = `${o} ${s} ${_(w)}`;
|
|
901
1074
|
else {
|
|
902
|
-
const
|
|
903
|
-
|
|
904
|
-
}
|
|
905
|
-
const
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
1075
|
+
const B = ".".repeat(Math.floor(t2)).slice(0, 3);
|
|
1076
|
+
v = `${o} ${s}${B}`;
|
|
1077
|
+
}
|
|
1078
|
+
const j = wrapAnsi(v, x, {
|
|
1079
|
+
hard: true,
|
|
1080
|
+
trim: false
|
|
1081
|
+
});
|
|
1082
|
+
n3.write(j), r2 = r2 + 1 < E.length ? r2 + 1 : 0, t2 = t2 < 4 ? t2 + 0.125 : 0;
|
|
1083
|
+
}, F);
|
|
1084
|
+
}, a2 = (e = "", r2 = 0, t2 = false) => {
|
|
1085
|
+
if (!d) return;
|
|
1086
|
+
d = false, clearInterval(T), y2();
|
|
1087
|
+
const o = r2 === 0 ? styleText2("green", S_STEP_SUBMIT) : r2 === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
|
|
1088
|
+
s = e ?? s, t2 || (l2 === "timer" ? n3.write(`${o} ${s} ${_(w)}
|
|
1089
|
+
`) : n3.write(`${o} ${s}
|
|
1090
|
+
`)), H(), M();
|
|
915
1091
|
};
|
|
916
|
-
return {
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
1092
|
+
return {
|
|
1093
|
+
start: P,
|
|
1094
|
+
stop: (e = "") => a2(e, 0),
|
|
1095
|
+
message: (e = "") => {
|
|
1096
|
+
s = C(e ?? s);
|
|
1097
|
+
},
|
|
1098
|
+
cancel: (e = "") => a2(e, 1),
|
|
1099
|
+
error: (e = "") => a2(e, 2),
|
|
1100
|
+
clear: () => a2("", 0, true),
|
|
1101
|
+
get isCancelled() {
|
|
1102
|
+
return S;
|
|
1103
|
+
}
|
|
1104
|
+
};
|
|
1105
|
+
};
|
|
1106
|
+
u2 = {
|
|
1107
|
+
light: unicodeOr("\u2500", "-"),
|
|
1108
|
+
heavy: unicodeOr("\u2501", "="),
|
|
1109
|
+
block: unicodeOr("\u2588", "#")
|
|
1110
|
+
};
|
|
1111
|
+
SELECT_INSTRUCTIONS = [
|
|
1112
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
1113
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
1114
|
+
];
|
|
1115
|
+
c = (t2, o) => t2.includes(`
|
|
1116
|
+
`) ? t2.split(`
|
|
1117
|
+
`).map((d) => o(d)).join(`
|
|
1118
|
+
`) : o(t2);
|
|
1119
|
+
select = (t2) => {
|
|
1120
|
+
const o = (n3, m) => {
|
|
1121
|
+
if (n3 === void 0)
|
|
1122
|
+
return "";
|
|
1123
|
+
const s = n3.label ?? String(n3.value);
|
|
1124
|
+
switch (m) {
|
|
931
1125
|
case "disabled":
|
|
932
|
-
return `${
|
|
1126
|
+
return `${styleText2("gray", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("gray", i2))}${n3.hint ? ` ${styleText2("dim", `(${n3.hint ?? "disabled"})`)}` : ""}`;
|
|
933
1127
|
case "selected":
|
|
934
|
-
return `${
|
|
1128
|
+
return `${c(s, (i2) => styleText2("dim", i2))}`;
|
|
935
1129
|
case "active":
|
|
936
|
-
return `${
|
|
1130
|
+
return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${n3.hint ? ` ${styleText2("dim", `(${n3.hint})`)}` : ""}`;
|
|
937
1131
|
case "cancelled":
|
|
938
|
-
return `${
|
|
1132
|
+
return `${c(s, (i2) => styleText2(["strikethrough", "dim"], i2))}`;
|
|
939
1133
|
default:
|
|
940
|
-
return `${
|
|
941
|
-
}
|
|
942
|
-
};
|
|
943
|
-
return new
|
|
944
|
-
|
|
945
|
-
|
|
1134
|
+
return `${styleText2("dim", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("dim", i2))}`;
|
|
1135
|
+
}
|
|
1136
|
+
}, d = t2.showInstructions ?? true;
|
|
1137
|
+
return new n$1({
|
|
1138
|
+
options: t2.options,
|
|
1139
|
+
signal: t2.signal,
|
|
1140
|
+
input: t2.input,
|
|
1141
|
+
output: t2.output,
|
|
1142
|
+
initialValue: t2.initialValue,
|
|
1143
|
+
render() {
|
|
1144
|
+
const n3 = t2.withGuide ?? settings.withGuide, m = `${symbol(this.state)} `, s = `${symbolBar(this.state)} `, i2 = wrapTextWithPrefix(
|
|
1145
|
+
t2.output,
|
|
1146
|
+
t2.message,
|
|
1147
|
+
s,
|
|
1148
|
+
m
|
|
1149
|
+
), u3 = `${n3 ? `${styleText2("gray", S_BAR)}
|
|
1150
|
+
` : ""}${i2}
|
|
946
1151
|
`;
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
${
|
|
1152
|
+
switch (this.state) {
|
|
1153
|
+
case "submit": {
|
|
1154
|
+
const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
|
|
1155
|
+
t2.output,
|
|
1156
|
+
o(this.options[this.cursor], "selected"),
|
|
1157
|
+
r2
|
|
1158
|
+
);
|
|
1159
|
+
return `${u3}${a2}`;
|
|
1160
|
+
}
|
|
1161
|
+
case "cancel": {
|
|
1162
|
+
const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
|
|
1163
|
+
t2.output,
|
|
1164
|
+
o(this.options[this.cursor], "cancelled"),
|
|
1165
|
+
r2
|
|
1166
|
+
);
|
|
1167
|
+
return `${u3}${a2}${n3 ? `
|
|
1168
|
+
${styleText2("gray", S_BAR)}` : ""}`;
|
|
1169
|
+
}
|
|
1170
|
+
default: {
|
|
1171
|
+
const r2 = n3 ? `${styleText2("cyan", S_BAR)} ` : "", a2 = u3.split(`
|
|
1172
|
+
`).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], b = p.join(`
|
|
1173
|
+
`), f = p.length + 1;
|
|
1174
|
+
return `${u3}${r2}${limitOptions({
|
|
1175
|
+
output: t2.output,
|
|
1176
|
+
cursor: this.cursor,
|
|
1177
|
+
options: this.options,
|
|
1178
|
+
maxItems: t2.maxItems,
|
|
1179
|
+
columnPadding: r2.length,
|
|
1180
|
+
rowPadding: a2 + f,
|
|
1181
|
+
style: (g, x) => o(g, g.disabled ? "disabled" : x ? "active" : "inactive")
|
|
1182
|
+
}).join(`
|
|
1183
|
+
${r2}`)}
|
|
1184
|
+
${b}
|
|
963
1185
|
`;
|
|
1186
|
+
}
|
|
964
1187
|
}
|
|
965
1188
|
}
|
|
966
|
-
}
|
|
1189
|
+
}).prompt();
|
|
967
1190
|
};
|
|
968
|
-
|
|
1191
|
+
i = `${styleText2("gray", S_BAR)} `;
|
|
969
1192
|
}
|
|
970
1193
|
});
|
|
971
1194
|
|
|
@@ -978,9 +1201,9 @@ function supportsColor() {
|
|
|
978
1201
|
}
|
|
979
1202
|
return process.stdout.isTTY === true;
|
|
980
1203
|
}
|
|
981
|
-
function colorize(
|
|
982
|
-
if (!supportsColor()) return
|
|
983
|
-
return `${color}${
|
|
1204
|
+
function colorize(text2, color) {
|
|
1205
|
+
if (!supportsColor()) return text2;
|
|
1206
|
+
return `${color}${text2}${colors.reset}`;
|
|
984
1207
|
}
|
|
985
1208
|
function stringify(value) {
|
|
986
1209
|
if (typeof value === "string") return value;
|
|
@@ -1010,7 +1233,7 @@ function stringify(value) {
|
|
|
1010
1233
|
function formatMessage(...args) {
|
|
1011
1234
|
return args.map(stringify).join(" ");
|
|
1012
1235
|
}
|
|
1013
|
-
var colors, currentLogLevel,
|
|
1236
|
+
var colors, currentLogLevel, log2, error, warn, info, success;
|
|
1014
1237
|
var init_cli_output = __esm({
|
|
1015
1238
|
"packages/tooling/src/utils/cli-output.ts"() {
|
|
1016
1239
|
"use strict";
|
|
@@ -1043,7 +1266,7 @@ var init_cli_output = __esm({
|
|
|
1043
1266
|
currentLogLevel = envLevel;
|
|
1044
1267
|
}
|
|
1045
1268
|
}
|
|
1046
|
-
|
|
1269
|
+
log2 = {
|
|
1047
1270
|
/**
|
|
1048
1271
|
* Logs an error message (always shows unless Quiet level)
|
|
1049
1272
|
* Uses clack's log.error + explicit red color
|
|
@@ -1051,7 +1274,7 @@ var init_cli_output = __esm({
|
|
|
1051
1274
|
error(...args) {
|
|
1052
1275
|
if (currentLogLevel < 0 /* Quiet */) return;
|
|
1053
1276
|
const message = formatMessage(...args);
|
|
1054
|
-
|
|
1277
|
+
log.error(colorize(message, colors.brightRed));
|
|
1055
1278
|
},
|
|
1056
1279
|
/**
|
|
1057
1280
|
* Logs a warning message (shows at Normal level and above)
|
|
@@ -1060,7 +1283,7 @@ var init_cli_output = __esm({
|
|
|
1060
1283
|
warn(...args) {
|
|
1061
1284
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
1062
1285
|
const message = formatMessage(...args);
|
|
1063
|
-
|
|
1286
|
+
log.warn(colorize(message, colors.brightYellow));
|
|
1064
1287
|
},
|
|
1065
1288
|
/**
|
|
1066
1289
|
* Logs an info message (shows at Normal level and above)
|
|
@@ -1069,7 +1292,7 @@ var init_cli_output = __esm({
|
|
|
1069
1292
|
info(...args) {
|
|
1070
1293
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
1071
1294
|
const message = formatMessage(...args);
|
|
1072
|
-
|
|
1295
|
+
log.info(colorize(message, colors.brightCyan));
|
|
1073
1296
|
},
|
|
1074
1297
|
/**
|
|
1075
1298
|
* Logs a success message (shows at Normal level and above)
|
|
@@ -1078,7 +1301,7 @@ var init_cli_output = __esm({
|
|
|
1078
1301
|
success(...args) {
|
|
1079
1302
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
1080
1303
|
const message = formatMessage(...args);
|
|
1081
|
-
|
|
1304
|
+
log.success(colorize(message, colors.brightGreen));
|
|
1082
1305
|
},
|
|
1083
1306
|
/**
|
|
1084
1307
|
* Logs a debug message (only shows at Verbose level and above)
|
|
@@ -1087,7 +1310,7 @@ var init_cli_output = __esm({
|
|
|
1087
1310
|
debug(...args) {
|
|
1088
1311
|
if (currentLogLevel < 2 /* Verbose */) return;
|
|
1089
1312
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
1090
|
-
|
|
1313
|
+
log.message(
|
|
1091
1314
|
colorize(
|
|
1092
1315
|
`[${timeStamp}] \u{1F50D} DEBUG: ${formatMessage(...args)}`,
|
|
1093
1316
|
colors.gray
|
|
@@ -1101,7 +1324,7 @@ var init_cli_output = __esm({
|
|
|
1101
1324
|
trace(...args) {
|
|
1102
1325
|
if (currentLogLevel < 3 /* Debug */) return;
|
|
1103
1326
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
1104
|
-
|
|
1327
|
+
log.message(
|
|
1105
1328
|
colorize(
|
|
1106
1329
|
`[${timeStamp}] \u{1F52C} TRACE: ${formatMessage(...args)}`,
|
|
1107
1330
|
colors.gray
|
|
@@ -1109,10 +1332,10 @@ var init_cli_output = __esm({
|
|
|
1109
1332
|
);
|
|
1110
1333
|
}
|
|
1111
1334
|
};
|
|
1112
|
-
error =
|
|
1113
|
-
warn =
|
|
1114
|
-
info =
|
|
1115
|
-
success =
|
|
1335
|
+
error = log2.error.bind(log2);
|
|
1336
|
+
warn = log2.warn.bind(log2);
|
|
1337
|
+
info = log2.info.bind(log2);
|
|
1338
|
+
success = log2.success.bind(log2);
|
|
1116
1339
|
}
|
|
1117
1340
|
});
|
|
1118
1341
|
|
|
@@ -1330,9 +1553,9 @@ var require_is_glob = __commonJS({
|
|
|
1330
1553
|
index += 2;
|
|
1331
1554
|
var close = chars[open];
|
|
1332
1555
|
if (close) {
|
|
1333
|
-
var
|
|
1334
|
-
if (
|
|
1335
|
-
index =
|
|
1556
|
+
var n3 = str.indexOf(close, index);
|
|
1557
|
+
if (n3 !== -1) {
|
|
1558
|
+
index = n3 + 1;
|
|
1336
1559
|
}
|
|
1337
1560
|
}
|
|
1338
1561
|
if (str[index] === "!") {
|
|
@@ -1358,9 +1581,9 @@ var require_is_glob = __commonJS({
|
|
|
1358
1581
|
index += 2;
|
|
1359
1582
|
var close = chars[open];
|
|
1360
1583
|
if (close) {
|
|
1361
|
-
var
|
|
1362
|
-
if (
|
|
1363
|
-
index =
|
|
1584
|
+
var n3 = str.indexOf(close, index);
|
|
1585
|
+
if (n3 !== -1) {
|
|
1586
|
+
index = n3 + 1;
|
|
1364
1587
|
}
|
|
1365
1588
|
}
|
|
1366
1589
|
if (str[index] === "!") {
|
|
@@ -1438,8 +1661,8 @@ var require_utils = __commonJS({
|
|
|
1438
1661
|
if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
|
|
1439
1662
|
return (Number(max) - Number(min)) / Number(step) >= limit;
|
|
1440
1663
|
};
|
|
1441
|
-
exports.escapeNode = (
|
|
1442
|
-
const node =
|
|
1664
|
+
exports.escapeNode = (block2, n3 = 0, type) => {
|
|
1665
|
+
const node = block2.nodes[n3];
|
|
1443
1666
|
if (!node) return;
|
|
1444
1667
|
if (type && node.type === type || node.type === "open" || node.type === "close") {
|
|
1445
1668
|
if (node.escaped !== true) {
|
|
@@ -1456,15 +1679,15 @@ var require_utils = __commonJS({
|
|
|
1456
1679
|
}
|
|
1457
1680
|
return false;
|
|
1458
1681
|
};
|
|
1459
|
-
exports.isInvalidBrace = (
|
|
1460
|
-
if (
|
|
1461
|
-
if (
|
|
1462
|
-
if (
|
|
1463
|
-
|
|
1682
|
+
exports.isInvalidBrace = (block2) => {
|
|
1683
|
+
if (block2.type !== "brace") return false;
|
|
1684
|
+
if (block2.invalid === true || block2.dollar) return true;
|
|
1685
|
+
if (block2.commas >> 0 + block2.ranges >> 0 === 0) {
|
|
1686
|
+
block2.invalid = true;
|
|
1464
1687
|
return true;
|
|
1465
1688
|
}
|
|
1466
|
-
if (
|
|
1467
|
-
|
|
1689
|
+
if (block2.open !== true || block2.close !== true) {
|
|
1690
|
+
block2.invalid = true;
|
|
1468
1691
|
return true;
|
|
1469
1692
|
}
|
|
1470
1693
|
return false;
|
|
@@ -1483,8 +1706,8 @@ var require_utils = __commonJS({
|
|
|
1483
1706
|
exports.flatten = (...args) => {
|
|
1484
1707
|
const result = [];
|
|
1485
1708
|
const flat = (arr) => {
|
|
1486
|
-
for (let
|
|
1487
|
-
const ele = arr[
|
|
1709
|
+
for (let i2 = 0; i2 < arr.length; i2++) {
|
|
1710
|
+
const ele = arr[i2];
|
|
1488
1711
|
if (Array.isArray(ele)) {
|
|
1489
1712
|
flat(ele);
|
|
1490
1713
|
continue;
|
|
@@ -1578,9 +1801,9 @@ var require_to_regex_range = __commonJS({
|
|
|
1578
1801
|
if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
|
|
1579
1802
|
return toRegexRange.cache[cacheKey].result;
|
|
1580
1803
|
}
|
|
1581
|
-
let
|
|
1804
|
+
let a2 = Math.min(min, max);
|
|
1582
1805
|
let b = Math.max(min, max);
|
|
1583
|
-
if (Math.abs(
|
|
1806
|
+
if (Math.abs(a2 - b) === 1) {
|
|
1584
1807
|
let result = min + "|" + max;
|
|
1585
1808
|
if (opts.capture) {
|
|
1586
1809
|
return `(${result})`;
|
|
@@ -1591,20 +1814,20 @@ var require_to_regex_range = __commonJS({
|
|
|
1591
1814
|
return `(?:${result})`;
|
|
1592
1815
|
}
|
|
1593
1816
|
let isPadded = hasPadding(min) || hasPadding(max);
|
|
1594
|
-
let state = { min, max, a, b };
|
|
1817
|
+
let state = { min, max, a: a2, b };
|
|
1595
1818
|
let positives = [];
|
|
1596
1819
|
let negatives = [];
|
|
1597
1820
|
if (isPadded) {
|
|
1598
1821
|
state.isPadded = isPadded;
|
|
1599
1822
|
state.maxLen = String(state.max).length;
|
|
1600
1823
|
}
|
|
1601
|
-
if (
|
|
1824
|
+
if (a2 < 0) {
|
|
1602
1825
|
let newMin = b < 0 ? Math.abs(b) : 1;
|
|
1603
|
-
negatives = splitToPatterns(newMin, Math.abs(
|
|
1604
|
-
|
|
1826
|
+
negatives = splitToPatterns(newMin, Math.abs(a2), state, opts);
|
|
1827
|
+
a2 = state.a = 0;
|
|
1605
1828
|
}
|
|
1606
1829
|
if (b >= 0) {
|
|
1607
|
-
positives = splitToPatterns(
|
|
1830
|
+
positives = splitToPatterns(a2, b, state, opts);
|
|
1608
1831
|
}
|
|
1609
1832
|
state.negatives = negatives;
|
|
1610
1833
|
state.positives = positives;
|
|
@@ -1652,8 +1875,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1652
1875
|
let digits = zipped.length;
|
|
1653
1876
|
let pattern = "";
|
|
1654
1877
|
let count = 0;
|
|
1655
|
-
for (let
|
|
1656
|
-
let [startDigit, stopDigit] = zipped[
|
|
1878
|
+
for (let i2 = 0; i2 < digits; i2++) {
|
|
1879
|
+
let [startDigit, stopDigit] = zipped[i2];
|
|
1657
1880
|
if (startDigit === stopDigit) {
|
|
1658
1881
|
pattern += startDigit;
|
|
1659
1882
|
} else if (startDigit !== "0" || stopDigit !== "9") {
|
|
@@ -1672,8 +1895,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1672
1895
|
let tokens = [];
|
|
1673
1896
|
let start = min;
|
|
1674
1897
|
let prev;
|
|
1675
|
-
for (let
|
|
1676
|
-
let max2 = ranges[
|
|
1898
|
+
for (let i2 = 0; i2 < ranges.length; i2++) {
|
|
1899
|
+
let max2 = ranges[i2];
|
|
1677
1900
|
let obj = rangeToPattern(String(start), String(max2), options);
|
|
1678
1901
|
let zeros = "";
|
|
1679
1902
|
if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
|
|
@@ -1708,13 +1931,13 @@ var require_to_regex_range = __commonJS({
|
|
|
1708
1931
|
}
|
|
1709
1932
|
return result;
|
|
1710
1933
|
}
|
|
1711
|
-
function zip(
|
|
1934
|
+
function zip(a2, b) {
|
|
1712
1935
|
let arr = [];
|
|
1713
|
-
for (let
|
|
1936
|
+
for (let i2 = 0; i2 < a2.length; i2++) arr.push([a2[i2], b[i2]]);
|
|
1714
1937
|
return arr;
|
|
1715
1938
|
}
|
|
1716
|
-
function compare(
|
|
1717
|
-
return
|
|
1939
|
+
function compare(a2, b) {
|
|
1940
|
+
return a2 > b ? 1 : b > a2 ? -1 : 0;
|
|
1718
1941
|
}
|
|
1719
1942
|
function contains(arr, key, val) {
|
|
1720
1943
|
return arr.some((ele) => ele[key] === val);
|
|
@@ -1732,8 +1955,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1732
1955
|
}
|
|
1733
1956
|
return "";
|
|
1734
1957
|
}
|
|
1735
|
-
function toCharacterClass(
|
|
1736
|
-
return `[${
|
|
1958
|
+
function toCharacterClass(a2, b, options) {
|
|
1959
|
+
return `[${a2}${b - a2 === 1 ? "" : "-"}${b}]`;
|
|
1737
1960
|
}
|
|
1738
1961
|
function hasPadding(str) {
|
|
1739
1962
|
return /^-?(0+)\d/.test(str);
|
|
@@ -1812,8 +2035,8 @@ var require_fill_range = __commonJS({
|
|
|
1812
2035
|
return negative ? "-" + input : input;
|
|
1813
2036
|
};
|
|
1814
2037
|
var toSequence = (parts, options, maxLen) => {
|
|
1815
|
-
parts.negatives.sort((
|
|
1816
|
-
parts.positives.sort((
|
|
2038
|
+
parts.negatives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
2039
|
+
parts.positives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
1817
2040
|
let prefix = options.capture ? "" : "?:";
|
|
1818
2041
|
let positives = "";
|
|
1819
2042
|
let negatives = "";
|
|
@@ -1834,12 +2057,12 @@ var require_fill_range = __commonJS({
|
|
|
1834
2057
|
}
|
|
1835
2058
|
return result;
|
|
1836
2059
|
};
|
|
1837
|
-
var toRange = (
|
|
2060
|
+
var toRange = (a2, b, isNumbers, options) => {
|
|
1838
2061
|
if (isNumbers) {
|
|
1839
|
-
return toRegexRange(
|
|
2062
|
+
return toRegexRange(a2, b, { wrap: false, ...options });
|
|
1840
2063
|
}
|
|
1841
|
-
let start = String.fromCharCode(
|
|
1842
|
-
if (
|
|
2064
|
+
let start = String.fromCharCode(a2);
|
|
2065
|
+
if (a2 === b) return start;
|
|
1843
2066
|
let stop = String.fromCharCode(b);
|
|
1844
2067
|
return `[${start}-${stop}]`;
|
|
1845
2068
|
};
|
|
@@ -1865,15 +2088,15 @@ var require_fill_range = __commonJS({
|
|
|
1865
2088
|
return [];
|
|
1866
2089
|
};
|
|
1867
2090
|
var fillNumbers = (start, end, step = 1, options = {}) => {
|
|
1868
|
-
let
|
|
2091
|
+
let a2 = Number(start);
|
|
1869
2092
|
let b = Number(end);
|
|
1870
|
-
if (!Number.isInteger(
|
|
2093
|
+
if (!Number.isInteger(a2) || !Number.isInteger(b)) {
|
|
1871
2094
|
if (options.strictRanges === true) throw rangeError([start, end]);
|
|
1872
2095
|
return [];
|
|
1873
2096
|
}
|
|
1874
|
-
if (
|
|
2097
|
+
if (a2 === 0) a2 = 0;
|
|
1875
2098
|
if (b === 0) b = 0;
|
|
1876
|
-
let descending =
|
|
2099
|
+
let descending = a2 > b;
|
|
1877
2100
|
let startString = String(start);
|
|
1878
2101
|
let endString = String(end);
|
|
1879
2102
|
let stepString = String(step);
|
|
@@ -1889,13 +2112,13 @@ var require_fill_range = __commonJS({
|
|
|
1889
2112
|
let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
|
|
1890
2113
|
let range = [];
|
|
1891
2114
|
let index = 0;
|
|
1892
|
-
while (descending ?
|
|
2115
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
1893
2116
|
if (options.toRegex === true && step > 1) {
|
|
1894
|
-
push(
|
|
2117
|
+
push(a2);
|
|
1895
2118
|
} else {
|
|
1896
|
-
range.push(pad(format(
|
|
2119
|
+
range.push(pad(format(a2, index), maxLen, toNumber));
|
|
1897
2120
|
}
|
|
1898
|
-
|
|
2121
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
1899
2122
|
index++;
|
|
1900
2123
|
}
|
|
1901
2124
|
if (options.toRegex === true) {
|
|
@@ -1908,19 +2131,19 @@ var require_fill_range = __commonJS({
|
|
|
1908
2131
|
return invalidRange(start, end, options);
|
|
1909
2132
|
}
|
|
1910
2133
|
let format = options.transform || ((val) => String.fromCharCode(val));
|
|
1911
|
-
let
|
|
2134
|
+
let a2 = `${start}`.charCodeAt(0);
|
|
1912
2135
|
let b = `${end}`.charCodeAt(0);
|
|
1913
|
-
let descending =
|
|
1914
|
-
let min = Math.min(
|
|
1915
|
-
let max = Math.max(
|
|
2136
|
+
let descending = a2 > b;
|
|
2137
|
+
let min = Math.min(a2, b);
|
|
2138
|
+
let max = Math.max(a2, b);
|
|
1916
2139
|
if (options.toRegex && step === 1) {
|
|
1917
2140
|
return toRange(min, max, false, options);
|
|
1918
2141
|
}
|
|
1919
2142
|
let range = [];
|
|
1920
2143
|
let index = 0;
|
|
1921
|
-
while (descending ?
|
|
1922
|
-
range.push(format(
|
|
1923
|
-
|
|
2144
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
2145
|
+
range.push(format(a2, index));
|
|
2146
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
1924
2147
|
index++;
|
|
1925
2148
|
}
|
|
1926
2149
|
if (options.toRegex === true) {
|
|
@@ -2043,18 +2266,18 @@ var require_expand = __commonJS({
|
|
|
2043
2266
|
const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
|
|
2044
2267
|
const walk = (node, parent = {}) => {
|
|
2045
2268
|
node.queue = [];
|
|
2046
|
-
let
|
|
2047
|
-
let
|
|
2048
|
-
while (
|
|
2049
|
-
|
|
2050
|
-
|
|
2269
|
+
let p = parent;
|
|
2270
|
+
let q = parent.queue;
|
|
2271
|
+
while (p.type !== "brace" && p.type !== "root" && p.parent) {
|
|
2272
|
+
p = p.parent;
|
|
2273
|
+
q = p.queue;
|
|
2051
2274
|
}
|
|
2052
2275
|
if (node.invalid || node.dollar) {
|
|
2053
|
-
|
|
2276
|
+
q.push(append(q.pop(), stringify2(node, options)));
|
|
2054
2277
|
return;
|
|
2055
2278
|
}
|
|
2056
2279
|
if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
|
|
2057
|
-
|
|
2280
|
+
q.push(append(q.pop(), ["{}"]));
|
|
2058
2281
|
return;
|
|
2059
2282
|
}
|
|
2060
2283
|
if (node.nodes && node.ranges > 0) {
|
|
@@ -2066,26 +2289,26 @@ var require_expand = __commonJS({
|
|
|
2066
2289
|
if (range.length === 0) {
|
|
2067
2290
|
range = stringify2(node, options);
|
|
2068
2291
|
}
|
|
2069
|
-
|
|
2292
|
+
q.push(append(q.pop(), range));
|
|
2070
2293
|
node.nodes = [];
|
|
2071
2294
|
return;
|
|
2072
2295
|
}
|
|
2073
2296
|
const enclose = utils.encloseBrace(node);
|
|
2074
2297
|
let queue = node.queue;
|
|
2075
|
-
let
|
|
2076
|
-
while (
|
|
2077
|
-
|
|
2078
|
-
queue =
|
|
2298
|
+
let block2 = node;
|
|
2299
|
+
while (block2.type !== "brace" && block2.type !== "root" && block2.parent) {
|
|
2300
|
+
block2 = block2.parent;
|
|
2301
|
+
queue = block2.queue;
|
|
2079
2302
|
}
|
|
2080
|
-
for (let
|
|
2081
|
-
const child = node.nodes[
|
|
2303
|
+
for (let i2 = 0; i2 < node.nodes.length; i2++) {
|
|
2304
|
+
const child = node.nodes[i2];
|
|
2082
2305
|
if (child.type === "comma" && node.type === "brace") {
|
|
2083
|
-
if (
|
|
2306
|
+
if (i2 === 1) queue.push("");
|
|
2084
2307
|
queue.push("");
|
|
2085
2308
|
continue;
|
|
2086
2309
|
}
|
|
2087
2310
|
if (child.type === "close") {
|
|
2088
|
-
|
|
2311
|
+
q.push(append(q.pop(), queue, enclose));
|
|
2089
2312
|
continue;
|
|
2090
2313
|
}
|
|
2091
2314
|
if (child.value && child.type !== "open") {
|
|
@@ -2252,7 +2475,7 @@ var require_parse = __commonJS({
|
|
|
2252
2475
|
}
|
|
2253
2476
|
const ast = { type: "root", input, nodes: [] };
|
|
2254
2477
|
const stack = [ast];
|
|
2255
|
-
let
|
|
2478
|
+
let block2 = ast;
|
|
2256
2479
|
let prev = ast;
|
|
2257
2480
|
let brackets = 0;
|
|
2258
2481
|
const length = input.length;
|
|
@@ -2268,15 +2491,15 @@ var require_parse = __commonJS({
|
|
|
2268
2491
|
prev.value += node.value;
|
|
2269
2492
|
return;
|
|
2270
2493
|
}
|
|
2271
|
-
|
|
2272
|
-
node.parent =
|
|
2494
|
+
block2.nodes.push(node);
|
|
2495
|
+
node.parent = block2;
|
|
2273
2496
|
node.prev = prev;
|
|
2274
2497
|
prev = node;
|
|
2275
2498
|
return node;
|
|
2276
2499
|
};
|
|
2277
2500
|
push({ type: "bos" });
|
|
2278
2501
|
while (index < length) {
|
|
2279
|
-
|
|
2502
|
+
block2 = stack[stack.length - 1];
|
|
2280
2503
|
value = advance();
|
|
2281
2504
|
if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
|
|
2282
2505
|
continue;
|
|
@@ -2313,19 +2536,19 @@ var require_parse = __commonJS({
|
|
|
2313
2536
|
continue;
|
|
2314
2537
|
}
|
|
2315
2538
|
if (value === CHAR_LEFT_PARENTHESES) {
|
|
2316
|
-
|
|
2317
|
-
stack.push(
|
|
2539
|
+
block2 = push({ type: "paren", nodes: [] });
|
|
2540
|
+
stack.push(block2);
|
|
2318
2541
|
push({ type: "text", value });
|
|
2319
2542
|
continue;
|
|
2320
2543
|
}
|
|
2321
2544
|
if (value === CHAR_RIGHT_PARENTHESES) {
|
|
2322
|
-
if (
|
|
2545
|
+
if (block2.type !== "paren") {
|
|
2323
2546
|
push({ type: "text", value });
|
|
2324
2547
|
continue;
|
|
2325
2548
|
}
|
|
2326
|
-
|
|
2549
|
+
block2 = stack.pop();
|
|
2327
2550
|
push({ type: "text", value });
|
|
2328
|
-
|
|
2551
|
+
block2 = stack[stack.length - 1];
|
|
2329
2552
|
continue;
|
|
2330
2553
|
}
|
|
2331
2554
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
@@ -2350,7 +2573,7 @@ var require_parse = __commonJS({
|
|
|
2350
2573
|
}
|
|
2351
2574
|
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
2352
2575
|
depth++;
|
|
2353
|
-
const dollar = prev.value && prev.value.slice(-1) === "$" ||
|
|
2576
|
+
const dollar = prev.value && prev.value.slice(-1) === "$" || block2.dollar === true;
|
|
2354
2577
|
const brace = {
|
|
2355
2578
|
type: "brace",
|
|
2356
2579
|
open: true,
|
|
@@ -2361,52 +2584,52 @@ var require_parse = __commonJS({
|
|
|
2361
2584
|
ranges: 0,
|
|
2362
2585
|
nodes: []
|
|
2363
2586
|
};
|
|
2364
|
-
|
|
2365
|
-
stack.push(
|
|
2587
|
+
block2 = push(brace);
|
|
2588
|
+
stack.push(block2);
|
|
2366
2589
|
push({ type: "open", value });
|
|
2367
2590
|
continue;
|
|
2368
2591
|
}
|
|
2369
2592
|
if (value === CHAR_RIGHT_CURLY_BRACE) {
|
|
2370
|
-
if (
|
|
2593
|
+
if (block2.type !== "brace") {
|
|
2371
2594
|
push({ type: "text", value });
|
|
2372
2595
|
continue;
|
|
2373
2596
|
}
|
|
2374
2597
|
const type = "close";
|
|
2375
|
-
|
|
2376
|
-
|
|
2598
|
+
block2 = stack.pop();
|
|
2599
|
+
block2.close = true;
|
|
2377
2600
|
push({ type, value });
|
|
2378
2601
|
depth--;
|
|
2379
|
-
|
|
2602
|
+
block2 = stack[stack.length - 1];
|
|
2380
2603
|
continue;
|
|
2381
2604
|
}
|
|
2382
2605
|
if (value === CHAR_COMMA && depth > 0) {
|
|
2383
|
-
if (
|
|
2384
|
-
|
|
2385
|
-
const open =
|
|
2386
|
-
|
|
2606
|
+
if (block2.ranges > 0) {
|
|
2607
|
+
block2.ranges = 0;
|
|
2608
|
+
const open = block2.nodes.shift();
|
|
2609
|
+
block2.nodes = [open, { type: "text", value: stringify2(block2) }];
|
|
2387
2610
|
}
|
|
2388
2611
|
push({ type: "comma", value });
|
|
2389
|
-
|
|
2612
|
+
block2.commas++;
|
|
2390
2613
|
continue;
|
|
2391
2614
|
}
|
|
2392
|
-
if (value === CHAR_DOT && depth > 0 &&
|
|
2393
|
-
const siblings =
|
|
2615
|
+
if (value === CHAR_DOT && depth > 0 && block2.commas === 0) {
|
|
2616
|
+
const siblings = block2.nodes;
|
|
2394
2617
|
if (depth === 0 || siblings.length === 0) {
|
|
2395
2618
|
push({ type: "text", value });
|
|
2396
2619
|
continue;
|
|
2397
2620
|
}
|
|
2398
2621
|
if (prev.type === "dot") {
|
|
2399
|
-
|
|
2622
|
+
block2.range = [];
|
|
2400
2623
|
prev.value += value;
|
|
2401
2624
|
prev.type = "range";
|
|
2402
|
-
if (
|
|
2403
|
-
|
|
2404
|
-
|
|
2625
|
+
if (block2.nodes.length !== 3 && block2.nodes.length !== 5) {
|
|
2626
|
+
block2.invalid = true;
|
|
2627
|
+
block2.ranges = 0;
|
|
2405
2628
|
prev.type = "text";
|
|
2406
2629
|
continue;
|
|
2407
2630
|
}
|
|
2408
|
-
|
|
2409
|
-
|
|
2631
|
+
block2.ranges++;
|
|
2632
|
+
block2.args = [];
|
|
2410
2633
|
continue;
|
|
2411
2634
|
}
|
|
2412
2635
|
if (prev.type === "range") {
|
|
@@ -2414,7 +2637,7 @@ var require_parse = __commonJS({
|
|
|
2414
2637
|
const before = siblings[siblings.length - 1];
|
|
2415
2638
|
before.value += prev.value + value;
|
|
2416
2639
|
prev = before;
|
|
2417
|
-
|
|
2640
|
+
block2.ranges--;
|
|
2418
2641
|
continue;
|
|
2419
2642
|
}
|
|
2420
2643
|
push({ type: "dot", value });
|
|
@@ -2423,9 +2646,9 @@ var require_parse = __commonJS({
|
|
|
2423
2646
|
push({ type: "text", value });
|
|
2424
2647
|
}
|
|
2425
2648
|
do {
|
|
2426
|
-
|
|
2427
|
-
if (
|
|
2428
|
-
|
|
2649
|
+
block2 = stack.pop();
|
|
2650
|
+
if (block2.type !== "root") {
|
|
2651
|
+
block2.nodes.forEach((node) => {
|
|
2429
2652
|
if (!node.nodes) {
|
|
2430
2653
|
if (node.type === "open") node.isOpen = true;
|
|
2431
2654
|
if (node.type === "close") node.isClose = true;
|
|
@@ -2434,8 +2657,8 @@ var require_parse = __commonJS({
|
|
|
2434
2657
|
}
|
|
2435
2658
|
});
|
|
2436
2659
|
const parent = stack[stack.length - 1];
|
|
2437
|
-
const index2 = parent.nodes.indexOf(
|
|
2438
|
-
parent.nodes.splice(index2, 1, ...
|
|
2660
|
+
const index2 = parent.nodes.indexOf(block2);
|
|
2661
|
+
parent.nodes.splice(index2, 1, ...block2.nodes);
|
|
2439
2662
|
}
|
|
2440
2663
|
} while (stack.length > 0);
|
|
2441
2664
|
push({ type: "eos" });
|
|
@@ -3068,9 +3291,9 @@ var require_scan = __commonJS({
|
|
|
3068
3291
|
if (opts.parts === true || opts.tokens === true) {
|
|
3069
3292
|
let prevIndex;
|
|
3070
3293
|
for (let idx = 0; idx < slashes.length; idx++) {
|
|
3071
|
-
const
|
|
3072
|
-
const
|
|
3073
|
-
const value = input.slice(
|
|
3294
|
+
const n3 = prevIndex ? prevIndex + 1 : start;
|
|
3295
|
+
const i2 = slashes[idx];
|
|
3296
|
+
const value = input.slice(n3, i2);
|
|
3074
3297
|
if (opts.tokens) {
|
|
3075
3298
|
if (idx === 0 && start !== 0) {
|
|
3076
3299
|
tokens[idx].isPrefix = true;
|
|
@@ -3084,7 +3307,7 @@ var require_scan = __commonJS({
|
|
|
3084
3307
|
if (idx !== 0 || value !== "") {
|
|
3085
3308
|
parts.push(value);
|
|
3086
3309
|
}
|
|
3087
|
-
prevIndex =
|
|
3310
|
+
prevIndex = i2;
|
|
3088
3311
|
}
|
|
3089
3312
|
if (prevIndex && prevIndex + 1 < input.length) {
|
|
3090
3313
|
const value = input.slice(prevIndex + 1);
|
|
@@ -3213,15 +3436,15 @@ var require_parse2 = __commonJS({
|
|
|
3213
3436
|
};
|
|
3214
3437
|
var hasRepeatedCharPrefixOverlap = (branches) => {
|
|
3215
3438
|
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
3216
|
-
for (let
|
|
3217
|
-
for (let
|
|
3218
|
-
const
|
|
3219
|
-
const b = values[
|
|
3220
|
-
const char =
|
|
3221
|
-
if (!char ||
|
|
3439
|
+
for (let i2 = 0; i2 < values.length; i2++) {
|
|
3440
|
+
for (let j = i2 + 1; j < values.length; j++) {
|
|
3441
|
+
const a2 = values[i2];
|
|
3442
|
+
const b = values[j];
|
|
3443
|
+
const char = a2[0];
|
|
3444
|
+
if (!char || a2 !== char.repeat(a2.length) || b !== char.repeat(b.length)) {
|
|
3222
3445
|
continue;
|
|
3223
3446
|
}
|
|
3224
|
-
if (
|
|
3447
|
+
if (a2 === b || a2.startsWith(b) || b.startsWith(a2)) {
|
|
3225
3448
|
return true;
|
|
3226
3449
|
}
|
|
3227
3450
|
}
|
|
@@ -3236,8 +3459,8 @@ var require_parse2 = __commonJS({
|
|
|
3236
3459
|
let paren = 0;
|
|
3237
3460
|
let quote = 0;
|
|
3238
3461
|
let escaped = false;
|
|
3239
|
-
for (let
|
|
3240
|
-
const ch = pattern[
|
|
3462
|
+
for (let i2 = 1; i2 < pattern.length; i2++) {
|
|
3463
|
+
const ch = pattern[i2];
|
|
3241
3464
|
if (escaped === true) {
|
|
3242
3465
|
escaped = false;
|
|
3243
3466
|
continue;
|
|
@@ -3271,13 +3494,13 @@ var require_parse2 = __commonJS({
|
|
|
3271
3494
|
if (ch === ")") {
|
|
3272
3495
|
paren--;
|
|
3273
3496
|
if (paren === 0) {
|
|
3274
|
-
if (requireEnd === true &&
|
|
3497
|
+
if (requireEnd === true && i2 !== pattern.length - 1) {
|
|
3275
3498
|
return;
|
|
3276
3499
|
}
|
|
3277
3500
|
return {
|
|
3278
3501
|
type: pattern[0],
|
|
3279
|
-
body: pattern.slice(2,
|
|
3280
|
-
end:
|
|
3502
|
+
body: pattern.slice(2, i2),
|
|
3503
|
+
end: i2
|
|
3281
3504
|
};
|
|
3282
3505
|
}
|
|
3283
3506
|
}
|
|
@@ -3409,7 +3632,7 @@ var require_parse2 = __commonJS({
|
|
|
3409
3632
|
let prev = bos;
|
|
3410
3633
|
let value;
|
|
3411
3634
|
const eos = () => state.index === len - 1;
|
|
3412
|
-
const peek = state.peek = (
|
|
3635
|
+
const peek = state.peek = (n3 = 1) => input[state.index + n3];
|
|
3413
3636
|
const advance = state.advance = () => input[++state.index] || "";
|
|
3414
3637
|
const remaining = () => input.slice(state.index + 1);
|
|
3415
3638
|
const consume = (value2 = "", num = 0) => {
|
|
@@ -3490,10 +3713,10 @@ var require_parse2 = __commonJS({
|
|
|
3490
3713
|
open.type = "text";
|
|
3491
3714
|
open.value = literal;
|
|
3492
3715
|
open.output = safeOutput || utils.escapeRegex(literal);
|
|
3493
|
-
for (let
|
|
3494
|
-
tokens[
|
|
3495
|
-
tokens[
|
|
3496
|
-
delete tokens[
|
|
3716
|
+
for (let i2 = token.tokensIndex + 1; i2 < tokens.length; i2++) {
|
|
3717
|
+
tokens[i2].value = "";
|
|
3718
|
+
tokens[i2].output = "";
|
|
3719
|
+
delete tokens[i2].suffix;
|
|
3497
3720
|
}
|
|
3498
3721
|
state.output = token.output + open.output;
|
|
3499
3722
|
state.backtrack = true;
|
|
@@ -3736,13 +3959,13 @@ var require_parse2 = __commonJS({
|
|
|
3736
3959
|
if (brace.dots === true) {
|
|
3737
3960
|
const arr = tokens.slice();
|
|
3738
3961
|
const range = [];
|
|
3739
|
-
for (let
|
|
3962
|
+
for (let i2 = arr.length - 1; i2 >= 0; i2--) {
|
|
3740
3963
|
tokens.pop();
|
|
3741
|
-
if (arr[
|
|
3964
|
+
if (arr[i2].type === "brace") {
|
|
3742
3965
|
break;
|
|
3743
3966
|
}
|
|
3744
|
-
if (arr[
|
|
3745
|
-
range.unshift(arr[
|
|
3967
|
+
if (arr[i2].type !== "dots") {
|
|
3968
|
+
range.unshift(arr[i2].value);
|
|
3746
3969
|
}
|
|
3747
3970
|
}
|
|
3748
3971
|
output = expandRange(range, opts);
|
|
@@ -4201,7 +4424,7 @@ var require_picomatch = __commonJS({
|
|
|
4201
4424
|
};
|
|
4202
4425
|
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
4203
4426
|
picomatch.parse = (pattern, options) => {
|
|
4204
|
-
if (Array.isArray(pattern)) return pattern.map((
|
|
4427
|
+
if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
|
|
4205
4428
|
return parse2(pattern, { ...options, fastpaths: false });
|
|
4206
4429
|
};
|
|
4207
4430
|
picomatch.scan = (input, options) => scan(input, options);
|
|
@@ -4285,8 +4508,8 @@ var require_micromatch = __commonJS({
|
|
|
4285
4508
|
options.onResult(state);
|
|
4286
4509
|
}
|
|
4287
4510
|
};
|
|
4288
|
-
for (let
|
|
4289
|
-
let isMatch = picomatch(String(patterns[
|
|
4511
|
+
for (let i2 = 0; i2 < patterns.length; i2++) {
|
|
4512
|
+
let isMatch = picomatch(String(patterns[i2]), { ...options, onResult }, true);
|
|
4290
4513
|
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
|
|
4291
4514
|
if (negated) negatives++;
|
|
4292
4515
|
for (let item of list) {
|
|
@@ -4308,7 +4531,7 @@ var require_micromatch = __commonJS({
|
|
|
4308
4531
|
throw new Error(`No matches found for "${patterns.join(", ")}"`);
|
|
4309
4532
|
}
|
|
4310
4533
|
if (options.nonull === true || options.nullglob === true) {
|
|
4311
|
-
return options.unescape ? patterns.map((
|
|
4534
|
+
return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
|
|
4312
4535
|
}
|
|
4313
4536
|
}
|
|
4314
4537
|
return matches;
|
|
@@ -4338,7 +4561,7 @@ var require_micromatch = __commonJS({
|
|
|
4338
4561
|
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
4339
4562
|
}
|
|
4340
4563
|
if (Array.isArray(pattern)) {
|
|
4341
|
-
return pattern.some((
|
|
4564
|
+
return pattern.some((p) => micromatch.contains(str, p, options));
|
|
4342
4565
|
}
|
|
4343
4566
|
if (typeof pattern === "string") {
|
|
4344
4567
|
if (isEmptyString(str) || isEmptyString(pattern)) {
|
|
@@ -4383,7 +4606,7 @@ var require_micromatch = __commonJS({
|
|
|
4383
4606
|
if (typeof str !== "string") {
|
|
4384
4607
|
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
4385
4608
|
}
|
|
4386
|
-
return [].concat(patterns).every((
|
|
4609
|
+
return [].concat(patterns).every((p) => picomatch(p, options)(str));
|
|
4387
4610
|
};
|
|
4388
4611
|
micromatch.capture = (glob2, input, options) => {
|
|
4389
4612
|
let posix = utils.isWindows(options);
|
|
@@ -4534,7 +4757,7 @@ var require_pattern = __commonJS({
|
|
|
4534
4757
|
exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
|
4535
4758
|
function expandBraceExpansion(pattern) {
|
|
4536
4759
|
const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });
|
|
4537
|
-
patterns.sort((
|
|
4760
|
+
patterns.sort((a2, b) => a2.length - b.length);
|
|
4538
4761
|
return patterns.filter((pattern2) => pattern2 !== "");
|
|
4539
4762
|
}
|
|
4540
4763
|
exports.expandBraceExpansion = expandBraceExpansion;
|
|
@@ -4615,8 +4838,8 @@ var require_merge2 = __commonJS({
|
|
|
4615
4838
|
}
|
|
4616
4839
|
const mergedStream = PassThrough(options);
|
|
4617
4840
|
function addStream() {
|
|
4618
|
-
for (let
|
|
4619
|
-
streamsQueue.push(pauseStreams(arguments[
|
|
4841
|
+
for (let i2 = 0, len = arguments.length; i2 < len; i2++) {
|
|
4842
|
+
streamsQueue.push(pauseStreams(arguments[i2], options));
|
|
4620
4843
|
}
|
|
4621
4844
|
mergeStream();
|
|
4622
4845
|
return this;
|
|
@@ -4665,8 +4888,8 @@ var require_merge2 = __commonJS({
|
|
|
4665
4888
|
stream.pipe(mergedStream, { end: false });
|
|
4666
4889
|
stream.resume();
|
|
4667
4890
|
}
|
|
4668
|
-
for (let
|
|
4669
|
-
pipe(streams[
|
|
4891
|
+
for (let i2 = 0; i2 < streams.length; i2++) {
|
|
4892
|
+
pipe(streams[i2]);
|
|
4670
4893
|
}
|
|
4671
4894
|
next();
|
|
4672
4895
|
}
|
|
@@ -4697,8 +4920,8 @@ var require_merge2 = __commonJS({
|
|
|
4697
4920
|
}
|
|
4698
4921
|
streams.pause();
|
|
4699
4922
|
} else {
|
|
4700
|
-
for (let
|
|
4701
|
-
streams[
|
|
4923
|
+
for (let i2 = 0, len = streams.length; i2 < len; i2++) {
|
|
4924
|
+
streams[i2] = pauseStreams(streams[i2], options);
|
|
4702
4925
|
}
|
|
4703
4926
|
}
|
|
4704
4927
|
return streams;
|
|
@@ -4780,13 +5003,13 @@ var require_tasks = __commonJS({
|
|
|
4780
5003
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4781
5004
|
exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
|
|
4782
5005
|
var utils = require_utils3();
|
|
4783
|
-
function generate(input,
|
|
4784
|
-
const patterns = processPatterns(input,
|
|
4785
|
-
const ignore = processPatterns(
|
|
5006
|
+
function generate(input, settings2) {
|
|
5007
|
+
const patterns = processPatterns(input, settings2);
|
|
5008
|
+
const ignore = processPatterns(settings2.ignore, settings2);
|
|
4786
5009
|
const positivePatterns = getPositivePatterns(patterns);
|
|
4787
5010
|
const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
|
|
4788
|
-
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern,
|
|
4789
|
-
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern,
|
|
5011
|
+
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings2));
|
|
5012
|
+
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings2));
|
|
4790
5013
|
const staticTasks = convertPatternsToTasks(
|
|
4791
5014
|
staticPatterns,
|
|
4792
5015
|
negativePatterns,
|
|
@@ -4802,12 +5025,12 @@ var require_tasks = __commonJS({
|
|
|
4802
5025
|
return staticTasks.concat(dynamicTasks);
|
|
4803
5026
|
}
|
|
4804
5027
|
exports.generate = generate;
|
|
4805
|
-
function processPatterns(input,
|
|
5028
|
+
function processPatterns(input, settings2) {
|
|
4806
5029
|
let patterns = input;
|
|
4807
|
-
if (
|
|
5030
|
+
if (settings2.braceExpansion) {
|
|
4808
5031
|
patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);
|
|
4809
5032
|
}
|
|
4810
|
-
if (
|
|
5033
|
+
if (settings2.baseNameMatch) {
|
|
4811
5034
|
patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`);
|
|
4812
5035
|
}
|
|
4813
5036
|
return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));
|
|
@@ -4838,7 +5061,7 @@ var require_tasks = __commonJS({
|
|
|
4838
5061
|
}
|
|
4839
5062
|
exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
|
|
4840
5063
|
function groupPatternsByBaseDirectory(patterns) {
|
|
4841
|
-
const
|
|
5064
|
+
const group2 = {};
|
|
4842
5065
|
return patterns.reduce((collection, pattern) => {
|
|
4843
5066
|
const base = utils.pattern.getBaseDirectory(pattern);
|
|
4844
5067
|
if (base in collection) {
|
|
@@ -4847,7 +5070,7 @@ var require_tasks = __commonJS({
|
|
|
4847
5070
|
collection[base] = [pattern];
|
|
4848
5071
|
}
|
|
4849
5072
|
return collection;
|
|
4850
|
-
},
|
|
5073
|
+
}, group2);
|
|
4851
5074
|
}
|
|
4852
5075
|
exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
|
|
4853
5076
|
function convertPatternGroupsToTasks(positive, negative, dynamic) {
|
|
@@ -4876,26 +5099,26 @@ var require_async = __commonJS({
|
|
|
4876
5099
|
init_utils2();
|
|
4877
5100
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4878
5101
|
exports.read = void 0;
|
|
4879
|
-
function read2(path,
|
|
4880
|
-
|
|
5102
|
+
function read2(path, settings2, callback) {
|
|
5103
|
+
settings2.fs.lstat(path, (lstatError, lstat) => {
|
|
4881
5104
|
if (lstatError !== null) {
|
|
4882
5105
|
callFailureCallback(callback, lstatError);
|
|
4883
5106
|
return;
|
|
4884
5107
|
}
|
|
4885
|
-
if (!lstat.isSymbolicLink() || !
|
|
5108
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
4886
5109
|
callSuccessCallback(callback, lstat);
|
|
4887
5110
|
return;
|
|
4888
5111
|
}
|
|
4889
|
-
|
|
5112
|
+
settings2.fs.stat(path, (statError, stat) => {
|
|
4890
5113
|
if (statError !== null) {
|
|
4891
|
-
if (
|
|
5114
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4892
5115
|
callFailureCallback(callback, statError);
|
|
4893
5116
|
return;
|
|
4894
5117
|
}
|
|
4895
5118
|
callSuccessCallback(callback, lstat);
|
|
4896
5119
|
return;
|
|
4897
5120
|
}
|
|
4898
|
-
if (
|
|
5121
|
+
if (settings2.markSymbolicLink) {
|
|
4899
5122
|
stat.isSymbolicLink = () => true;
|
|
4900
5123
|
}
|
|
4901
5124
|
callSuccessCallback(callback, stat);
|
|
@@ -4919,19 +5142,19 @@ var require_sync = __commonJS({
|
|
|
4919
5142
|
init_utils2();
|
|
4920
5143
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4921
5144
|
exports.read = void 0;
|
|
4922
|
-
function read2(path,
|
|
4923
|
-
const lstat =
|
|
4924
|
-
if (!lstat.isSymbolicLink() || !
|
|
5145
|
+
function read2(path, settings2) {
|
|
5146
|
+
const lstat = settings2.fs.lstatSync(path);
|
|
5147
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
4925
5148
|
return lstat;
|
|
4926
5149
|
}
|
|
4927
5150
|
try {
|
|
4928
|
-
const stat =
|
|
4929
|
-
if (
|
|
5151
|
+
const stat = settings2.fs.statSync(path);
|
|
5152
|
+
if (settings2.markSymbolicLink) {
|
|
4930
5153
|
stat.isSymbolicLink = () => true;
|
|
4931
5154
|
}
|
|
4932
5155
|
return stat;
|
|
4933
5156
|
} catch (error2) {
|
|
4934
|
-
if (!
|
|
5157
|
+
if (!settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4935
5158
|
return lstat;
|
|
4936
5159
|
}
|
|
4937
5160
|
throw error2;
|
|
@@ -5008,8 +5231,8 @@ var require_out = __commonJS({
|
|
|
5008
5231
|
}
|
|
5009
5232
|
exports.stat = stat;
|
|
5010
5233
|
function statSync2(path, optionsOrSettings) {
|
|
5011
|
-
const
|
|
5012
|
-
return sync.read(path,
|
|
5234
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5235
|
+
return sync.read(path, settings2);
|
|
5013
5236
|
}
|
|
5014
5237
|
exports.statSync = statSync2;
|
|
5015
5238
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -5057,8 +5280,8 @@ var require_run_parallel = __commonJS({
|
|
|
5057
5280
|
if (isSync) queueMicrotask2(end);
|
|
5058
5281
|
else end();
|
|
5059
5282
|
}
|
|
5060
|
-
function each(
|
|
5061
|
-
results[
|
|
5283
|
+
function each(i2, err, result) {
|
|
5284
|
+
results[i2] = result;
|
|
5062
5285
|
if (--pending === 0 || err) {
|
|
5063
5286
|
done(err);
|
|
5064
5287
|
}
|
|
@@ -5072,9 +5295,9 @@ var require_run_parallel = __commonJS({
|
|
|
5072
5295
|
});
|
|
5073
5296
|
});
|
|
5074
5297
|
} else {
|
|
5075
|
-
tasks.forEach(function(task,
|
|
5298
|
+
tasks.forEach(function(task, i2) {
|
|
5076
5299
|
task(function(err, result) {
|
|
5077
|
-
each(
|
|
5300
|
+
each(i2, err, result);
|
|
5078
5301
|
});
|
|
5079
5302
|
});
|
|
5080
5303
|
}
|
|
@@ -5149,11 +5372,11 @@ var require_common = __commonJS({
|
|
|
5149
5372
|
init_utils2();
|
|
5150
5373
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5151
5374
|
exports.joinPathSegments = void 0;
|
|
5152
|
-
function joinPathSegments(
|
|
5153
|
-
if (
|
|
5154
|
-
return
|
|
5375
|
+
function joinPathSegments(a2, b, separator) {
|
|
5376
|
+
if (a2.endsWith(separator)) {
|
|
5377
|
+
return a2 + b;
|
|
5155
5378
|
}
|
|
5156
|
-
return
|
|
5379
|
+
return a2 + separator + b;
|
|
5157
5380
|
}
|
|
5158
5381
|
exports.joinPathSegments = joinPathSegments;
|
|
5159
5382
|
}
|
|
@@ -5171,16 +5394,16 @@ var require_async2 = __commonJS({
|
|
|
5171
5394
|
var constants_1 = require_constants3();
|
|
5172
5395
|
var utils = require_utils4();
|
|
5173
5396
|
var common = require_common();
|
|
5174
|
-
function read2(directory,
|
|
5175
|
-
if (!
|
|
5176
|
-
readdirWithFileTypes(directory,
|
|
5397
|
+
function read2(directory, settings2, callback) {
|
|
5398
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
5399
|
+
readdirWithFileTypes(directory, settings2, callback);
|
|
5177
5400
|
return;
|
|
5178
5401
|
}
|
|
5179
|
-
readdir(directory,
|
|
5402
|
+
readdir(directory, settings2, callback);
|
|
5180
5403
|
}
|
|
5181
5404
|
exports.read = read2;
|
|
5182
|
-
function readdirWithFileTypes(directory,
|
|
5183
|
-
|
|
5405
|
+
function readdirWithFileTypes(directory, settings2, callback) {
|
|
5406
|
+
settings2.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
|
|
5184
5407
|
if (readdirError !== null) {
|
|
5185
5408
|
callFailureCallback(callback, readdirError);
|
|
5186
5409
|
return;
|
|
@@ -5188,13 +5411,13 @@ var require_async2 = __commonJS({
|
|
|
5188
5411
|
const entries = dirents.map((dirent) => ({
|
|
5189
5412
|
dirent,
|
|
5190
5413
|
name: dirent.name,
|
|
5191
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
5414
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
5192
5415
|
}));
|
|
5193
|
-
if (!
|
|
5416
|
+
if (!settings2.followSymbolicLinks) {
|
|
5194
5417
|
callSuccessCallback(callback, entries);
|
|
5195
5418
|
return;
|
|
5196
5419
|
}
|
|
5197
|
-
const tasks = entries.map((entry) => makeRplTaskEntry(entry,
|
|
5420
|
+
const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings2));
|
|
5198
5421
|
rpl(tasks, (rplError, rplEntries) => {
|
|
5199
5422
|
if (rplError !== null) {
|
|
5200
5423
|
callFailureCallback(callback, rplError);
|
|
@@ -5205,15 +5428,15 @@ var require_async2 = __commonJS({
|
|
|
5205
5428
|
});
|
|
5206
5429
|
}
|
|
5207
5430
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
5208
|
-
function makeRplTaskEntry(entry,
|
|
5431
|
+
function makeRplTaskEntry(entry, settings2) {
|
|
5209
5432
|
return (done) => {
|
|
5210
5433
|
if (!entry.dirent.isSymbolicLink()) {
|
|
5211
5434
|
done(null, entry);
|
|
5212
5435
|
return;
|
|
5213
5436
|
}
|
|
5214
|
-
|
|
5437
|
+
settings2.fs.stat(entry.path, (statError, stats) => {
|
|
5215
5438
|
if (statError !== null) {
|
|
5216
|
-
if (
|
|
5439
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5217
5440
|
done(statError);
|
|
5218
5441
|
return;
|
|
5219
5442
|
}
|
|
@@ -5225,16 +5448,16 @@ var require_async2 = __commonJS({
|
|
|
5225
5448
|
});
|
|
5226
5449
|
};
|
|
5227
5450
|
}
|
|
5228
|
-
function readdir(directory,
|
|
5229
|
-
|
|
5451
|
+
function readdir(directory, settings2, callback) {
|
|
5452
|
+
settings2.fs.readdir(directory, (readdirError, names) => {
|
|
5230
5453
|
if (readdirError !== null) {
|
|
5231
5454
|
callFailureCallback(callback, readdirError);
|
|
5232
5455
|
return;
|
|
5233
5456
|
}
|
|
5234
5457
|
const tasks = names.map((name) => {
|
|
5235
|
-
const path = common.joinPathSegments(directory, name,
|
|
5458
|
+
const path = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
5236
5459
|
return (done) => {
|
|
5237
|
-
fsStat.stat(path,
|
|
5460
|
+
fsStat.stat(path, settings2.fsStatSettings, (error2, stats) => {
|
|
5238
5461
|
if (error2 !== null) {
|
|
5239
5462
|
done(error2);
|
|
5240
5463
|
return;
|
|
@@ -5244,7 +5467,7 @@ var require_async2 = __commonJS({
|
|
|
5244
5467
|
path,
|
|
5245
5468
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
5246
5469
|
};
|
|
5247
|
-
if (
|
|
5470
|
+
if (settings2.stats) {
|
|
5248
5471
|
entry.stats = stats;
|
|
5249
5472
|
}
|
|
5250
5473
|
done(null, entry);
|
|
@@ -5281,27 +5504,27 @@ var require_sync2 = __commonJS({
|
|
|
5281
5504
|
var constants_1 = require_constants3();
|
|
5282
5505
|
var utils = require_utils4();
|
|
5283
5506
|
var common = require_common();
|
|
5284
|
-
function read2(directory,
|
|
5285
|
-
if (!
|
|
5286
|
-
return readdirWithFileTypes(directory,
|
|
5507
|
+
function read2(directory, settings2) {
|
|
5508
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
5509
|
+
return readdirWithFileTypes(directory, settings2);
|
|
5287
5510
|
}
|
|
5288
|
-
return readdir(directory,
|
|
5511
|
+
return readdir(directory, settings2);
|
|
5289
5512
|
}
|
|
5290
5513
|
exports.read = read2;
|
|
5291
|
-
function readdirWithFileTypes(directory,
|
|
5292
|
-
const dirents =
|
|
5514
|
+
function readdirWithFileTypes(directory, settings2) {
|
|
5515
|
+
const dirents = settings2.fs.readdirSync(directory, { withFileTypes: true });
|
|
5293
5516
|
return dirents.map((dirent) => {
|
|
5294
5517
|
const entry = {
|
|
5295
5518
|
dirent,
|
|
5296
5519
|
name: dirent.name,
|
|
5297
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
5520
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
5298
5521
|
};
|
|
5299
|
-
if (entry.dirent.isSymbolicLink() &&
|
|
5522
|
+
if (entry.dirent.isSymbolicLink() && settings2.followSymbolicLinks) {
|
|
5300
5523
|
try {
|
|
5301
|
-
const stats =
|
|
5524
|
+
const stats = settings2.fs.statSync(entry.path);
|
|
5302
5525
|
entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
|
5303
5526
|
} catch (error2) {
|
|
5304
|
-
if (
|
|
5527
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5305
5528
|
throw error2;
|
|
5306
5529
|
}
|
|
5307
5530
|
}
|
|
@@ -5310,17 +5533,17 @@ var require_sync2 = __commonJS({
|
|
|
5310
5533
|
});
|
|
5311
5534
|
}
|
|
5312
5535
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
5313
|
-
function readdir(directory,
|
|
5314
|
-
const names =
|
|
5536
|
+
function readdir(directory, settings2) {
|
|
5537
|
+
const names = settings2.fs.readdirSync(directory);
|
|
5315
5538
|
return names.map((name) => {
|
|
5316
|
-
const entryPath = common.joinPathSegments(directory, name,
|
|
5317
|
-
const stats = fsStat.statSync(entryPath,
|
|
5539
|
+
const entryPath = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
5540
|
+
const stats = fsStat.statSync(entryPath, settings2.fsStatSettings);
|
|
5318
5541
|
const entry = {
|
|
5319
5542
|
name,
|
|
5320
5543
|
path: entryPath,
|
|
5321
5544
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
5322
5545
|
};
|
|
5323
|
-
if (
|
|
5546
|
+
if (settings2.stats) {
|
|
5324
5547
|
entry.stats = stats;
|
|
5325
5548
|
}
|
|
5326
5549
|
return entry;
|
|
@@ -5407,8 +5630,8 @@ var require_out2 = __commonJS({
|
|
|
5407
5630
|
}
|
|
5408
5631
|
exports.scandir = scandir;
|
|
5409
5632
|
function scandirSync(path, optionsOrSettings) {
|
|
5410
|
-
const
|
|
5411
|
-
return sync.read(path,
|
|
5633
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5634
|
+
return sync.read(path, settings2);
|
|
5412
5635
|
}
|
|
5413
5636
|
exports.scandirSync = scandirSync;
|
|
5414
5637
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -5689,7 +5912,7 @@ var require_queue = __commonJS({
|
|
|
5689
5912
|
queue.drained = drained;
|
|
5690
5913
|
return queue;
|
|
5691
5914
|
function push(value) {
|
|
5692
|
-
var
|
|
5915
|
+
var p = new Promise(function(resolve4, reject) {
|
|
5693
5916
|
pushCb(value, function(err, result) {
|
|
5694
5917
|
if (err) {
|
|
5695
5918
|
reject(err);
|
|
@@ -5698,11 +5921,11 @@ var require_queue = __commonJS({
|
|
|
5698
5921
|
resolve4(result);
|
|
5699
5922
|
});
|
|
5700
5923
|
});
|
|
5701
|
-
|
|
5702
|
-
return
|
|
5924
|
+
p.catch(noop);
|
|
5925
|
+
return p;
|
|
5703
5926
|
}
|
|
5704
5927
|
function unshift(value) {
|
|
5705
|
-
var
|
|
5928
|
+
var p = new Promise(function(resolve4, reject) {
|
|
5706
5929
|
unshiftCb(value, function(err, result) {
|
|
5707
5930
|
if (err) {
|
|
5708
5931
|
reject(err);
|
|
@@ -5711,11 +5934,11 @@ var require_queue = __commonJS({
|
|
|
5711
5934
|
resolve4(result);
|
|
5712
5935
|
});
|
|
5713
5936
|
});
|
|
5714
|
-
|
|
5715
|
-
return
|
|
5937
|
+
p.catch(noop);
|
|
5938
|
+
return p;
|
|
5716
5939
|
}
|
|
5717
5940
|
function drained() {
|
|
5718
|
-
var
|
|
5941
|
+
var p = new Promise(function(resolve4) {
|
|
5719
5942
|
process.nextTick(function() {
|
|
5720
5943
|
if (queue.idle()) {
|
|
5721
5944
|
resolve4();
|
|
@@ -5729,7 +5952,7 @@ var require_queue = __commonJS({
|
|
|
5729
5952
|
}
|
|
5730
5953
|
});
|
|
5731
5954
|
});
|
|
5732
|
-
return
|
|
5955
|
+
return p;
|
|
5733
5956
|
}
|
|
5734
5957
|
}
|
|
5735
5958
|
module.exports = fastqueue;
|
|
@@ -5744,11 +5967,11 @@ var require_common2 = __commonJS({
|
|
|
5744
5967
|
init_utils2();
|
|
5745
5968
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5746
5969
|
exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
|
|
5747
|
-
function isFatalError(
|
|
5748
|
-
if (
|
|
5970
|
+
function isFatalError(settings2, error2) {
|
|
5971
|
+
if (settings2.errorFilter === null) {
|
|
5749
5972
|
return true;
|
|
5750
5973
|
}
|
|
5751
|
-
return !
|
|
5974
|
+
return !settings2.errorFilter(error2);
|
|
5752
5975
|
}
|
|
5753
5976
|
exports.isFatalError = isFatalError;
|
|
5754
5977
|
function isAppliedFilter(filter, value) {
|
|
@@ -5759,14 +5982,14 @@ var require_common2 = __commonJS({
|
|
|
5759
5982
|
return filepath.split(/[/\\]/).join(separator);
|
|
5760
5983
|
}
|
|
5761
5984
|
exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
|
|
5762
|
-
function joinPathSegments(
|
|
5763
|
-
if (
|
|
5985
|
+
function joinPathSegments(a2, b, separator) {
|
|
5986
|
+
if (a2 === "") {
|
|
5764
5987
|
return b;
|
|
5765
5988
|
}
|
|
5766
|
-
if (
|
|
5767
|
-
return
|
|
5989
|
+
if (a2.endsWith(separator)) {
|
|
5990
|
+
return a2 + b;
|
|
5768
5991
|
}
|
|
5769
|
-
return
|
|
5992
|
+
return a2 + separator + b;
|
|
5770
5993
|
}
|
|
5771
5994
|
exports.joinPathSegments = joinPathSegments;
|
|
5772
5995
|
}
|
|
@@ -6113,14 +6336,14 @@ var require_out3 = __commonJS({
|
|
|
6113
6336
|
}
|
|
6114
6337
|
exports.walk = walk;
|
|
6115
6338
|
function walkSync(directory, optionsOrSettings) {
|
|
6116
|
-
const
|
|
6117
|
-
const provider = new sync_1.default(directory,
|
|
6339
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
6340
|
+
const provider = new sync_1.default(directory, settings2);
|
|
6118
6341
|
return provider.read();
|
|
6119
6342
|
}
|
|
6120
6343
|
exports.walkSync = walkSync;
|
|
6121
6344
|
function walkStream(directory, optionsOrSettings) {
|
|
6122
|
-
const
|
|
6123
|
-
const provider = new stream_1.default(directory,
|
|
6345
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
6346
|
+
const provider = new stream_1.default(directory, settings2);
|
|
6124
6347
|
return provider.read();
|
|
6125
6348
|
}
|
|
6126
6349
|
exports.walkStream = walkStream;
|
|
@@ -6206,8 +6429,8 @@ var require_stream3 = __commonJS({
|
|
|
6206
6429
|
done();
|
|
6207
6430
|
}).catch(done);
|
|
6208
6431
|
};
|
|
6209
|
-
for (let
|
|
6210
|
-
stream.write(
|
|
6432
|
+
for (let i2 = 0; i2 < filepaths.length; i2++) {
|
|
6433
|
+
stream.write(i2);
|
|
6211
6434
|
}
|
|
6212
6435
|
return stream;
|
|
6213
6436
|
}
|
|
@@ -6868,14 +7091,14 @@ var require_out4 = __commonJS({
|
|
|
6868
7091
|
function generateTasks(source, options) {
|
|
6869
7092
|
assertPatternsInput(source);
|
|
6870
7093
|
const patterns = [].concat(source);
|
|
6871
|
-
const
|
|
6872
|
-
return taskManager.generate(patterns,
|
|
7094
|
+
const settings2 = new settings_1.default(options);
|
|
7095
|
+
return taskManager.generate(patterns, settings2);
|
|
6873
7096
|
}
|
|
6874
7097
|
FastGlob2.generateTasks = generateTasks;
|
|
6875
7098
|
function isDynamicPattern(source, options) {
|
|
6876
7099
|
assertPatternsInput(source);
|
|
6877
|
-
const
|
|
6878
|
-
return utils.pattern.isDynamicPattern(source,
|
|
7100
|
+
const settings2 = new settings_1.default(options);
|
|
7101
|
+
return utils.pattern.isDynamicPattern(source, settings2);
|
|
6879
7102
|
}
|
|
6880
7103
|
FastGlob2.isDynamicPattern = isDynamicPattern;
|
|
6881
7104
|
function escapePath(source) {
|
|
@@ -6917,9 +7140,9 @@ var require_out4 = __commonJS({
|
|
|
6917
7140
|
})(FastGlob || (FastGlob = {}));
|
|
6918
7141
|
function getWorks(source, _Provider, options) {
|
|
6919
7142
|
const patterns = [].concat(source);
|
|
6920
|
-
const
|
|
6921
|
-
const tasks = taskManager.generate(patterns,
|
|
6922
|
-
const provider = new _Provider(
|
|
7143
|
+
const settings2 = new settings_1.default(options);
|
|
7144
|
+
const tasks = taskManager.generate(patterns, settings2);
|
|
7145
|
+
const provider = new _Provider(settings2);
|
|
6923
7146
|
return tasks.map(provider.read, provider);
|
|
6924
7147
|
}
|
|
6925
7148
|
function assertPatternsInput(input) {
|
|
@@ -7097,8 +7320,8 @@ import "node:fs";
|
|
|
7097
7320
|
import { createRequire } from "node:module";
|
|
7098
7321
|
import {
|
|
7099
7322
|
resolve,
|
|
7100
|
-
join,
|
|
7101
|
-
dirname,
|
|
7323
|
+
join as join2,
|
|
7324
|
+
dirname as dirname2,
|
|
7102
7325
|
relative,
|
|
7103
7326
|
normalize,
|
|
7104
7327
|
sep,
|
|
@@ -7112,7 +7335,7 @@ function safeExecuteAsync(fn, message) {
|
|
|
7112
7335
|
);
|
|
7113
7336
|
});
|
|
7114
7337
|
}
|
|
7115
|
-
var import_fast_glob, constants,
|
|
7338
|
+
var import_fast_glob, constants, log3, PACKAGE_PATHS, PathResolver;
|
|
7116
7339
|
var init_PathResolver = __esm({
|
|
7117
7340
|
"packages/core/config/utils/PathResolver.ts"() {
|
|
7118
7341
|
"use strict";
|
|
@@ -7125,7 +7348,7 @@ var init_PathResolver = __esm({
|
|
|
7125
7348
|
getPatternsFor: getPatternsFor || void 0,
|
|
7126
7349
|
I18N_PATHS: I18N_PATHS || void 0
|
|
7127
7350
|
};
|
|
7128
|
-
|
|
7351
|
+
log3 = {
|
|
7129
7352
|
error: (message, error2) => {
|
|
7130
7353
|
},
|
|
7131
7354
|
warn: (message, error2) => {
|
|
@@ -7246,7 +7469,7 @@ var init_PathResolver = __esm({
|
|
|
7246
7469
|
*/
|
|
7247
7470
|
getDirname(path) {
|
|
7248
7471
|
if (!path) return "";
|
|
7249
|
-
return this.normalizePath(
|
|
7472
|
+
return this.normalizePath(dirname2(path));
|
|
7250
7473
|
}
|
|
7251
7474
|
/**
|
|
7252
7475
|
* Resolve package path using Node's module resolution
|
|
@@ -7258,7 +7481,7 @@ var init_PathResolver = __esm({
|
|
|
7258
7481
|
resolvePackage(packageSpecifier, fromPath = null) {
|
|
7259
7482
|
try {
|
|
7260
7483
|
const basePath = fromPath || this.getAppRoot();
|
|
7261
|
-
const require3 = createRequire(
|
|
7484
|
+
const require3 = createRequire(join2(basePath, "package.json"));
|
|
7262
7485
|
const resolved = require3.resolve(packageSpecifier);
|
|
7263
7486
|
return this.normalizePath(resolved);
|
|
7264
7487
|
} catch (error2) {
|
|
@@ -7410,7 +7633,7 @@ var init_PathResolver = __esm({
|
|
|
7410
7633
|
return cleanContent;
|
|
7411
7634
|
} catch (error2) {
|
|
7412
7635
|
if (this.options.debug) {
|
|
7413
|
-
|
|
7636
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
7414
7637
|
}
|
|
7415
7638
|
return null;
|
|
7416
7639
|
}
|
|
@@ -7438,7 +7661,7 @@ var init_PathResolver = __esm({
|
|
|
7438
7661
|
return cleanContent;
|
|
7439
7662
|
} catch (error2) {
|
|
7440
7663
|
if (this.options.debug) {
|
|
7441
|
-
|
|
7664
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
7442
7665
|
}
|
|
7443
7666
|
return null;
|
|
7444
7667
|
}
|
|
@@ -7460,16 +7683,16 @@ var init_PathResolver = __esm({
|
|
|
7460
7683
|
verbose = false
|
|
7461
7684
|
} = options;
|
|
7462
7685
|
const normalizedPath = this.normalizePath(filePath);
|
|
7463
|
-
const dir = this.normalizePath(
|
|
7686
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
7464
7687
|
const fileExists = this.pathExists(normalizedPath);
|
|
7465
7688
|
if (fileExists && !overwrite) {
|
|
7466
7689
|
if (verbose) {
|
|
7467
|
-
|
|
7690
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
7468
7691
|
}
|
|
7469
7692
|
return false;
|
|
7470
7693
|
}
|
|
7471
7694
|
if (dryRun) {
|
|
7472
|
-
|
|
7695
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
7473
7696
|
return true;
|
|
7474
7697
|
}
|
|
7475
7698
|
try {
|
|
@@ -7494,7 +7717,7 @@ var init_PathResolver = __esm({
|
|
|
7494
7717
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
7495
7718
|
}
|
|
7496
7719
|
if (verbose) {
|
|
7497
|
-
|
|
7720
|
+
log3.info(
|
|
7498
7721
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
7499
7722
|
);
|
|
7500
7723
|
}
|
|
@@ -7521,16 +7744,16 @@ var init_PathResolver = __esm({
|
|
|
7521
7744
|
verbose = false
|
|
7522
7745
|
} = options;
|
|
7523
7746
|
const normalizedPath = this.normalizePath(filePath);
|
|
7524
|
-
const dir = this.normalizePath(
|
|
7747
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
7525
7748
|
const fileExists = this.pathExists(normalizedPath);
|
|
7526
7749
|
if (fileExists && !overwrite) {
|
|
7527
7750
|
if (verbose) {
|
|
7528
|
-
|
|
7751
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
7529
7752
|
}
|
|
7530
7753
|
return false;
|
|
7531
7754
|
}
|
|
7532
7755
|
if (dryRun) {
|
|
7533
|
-
|
|
7756
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
7534
7757
|
return true;
|
|
7535
7758
|
}
|
|
7536
7759
|
try {
|
|
@@ -7554,7 +7777,7 @@ var init_PathResolver = __esm({
|
|
|
7554
7777
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
7555
7778
|
}
|
|
7556
7779
|
if (verbose) {
|
|
7557
|
-
|
|
7780
|
+
log3.info(
|
|
7558
7781
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
7559
7782
|
);
|
|
7560
7783
|
}
|
|
@@ -7579,15 +7802,15 @@ var init_PathResolver = __esm({
|
|
|
7579
7802
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7580
7803
|
if (fileExists && !overwrite) {
|
|
7581
7804
|
if (verbose) {
|
|
7582
|
-
|
|
7805
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7583
7806
|
}
|
|
7584
7807
|
return false;
|
|
7585
7808
|
}
|
|
7586
7809
|
if (dryRun) {
|
|
7587
|
-
|
|
7810
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7588
7811
|
return true;
|
|
7589
7812
|
}
|
|
7590
|
-
const dir = this.normalizePath(
|
|
7813
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7591
7814
|
try {
|
|
7592
7815
|
await fs.promises.mkdir(dir, { recursive: true });
|
|
7593
7816
|
} catch (error2) {
|
|
@@ -7597,7 +7820,7 @@ var init_PathResolver = __esm({
|
|
|
7597
7820
|
return await safeExecuteAsync(async () => {
|
|
7598
7821
|
await fs.promises.copyFile(srcPath, normalizedDestPath);
|
|
7599
7822
|
if (verbose) {
|
|
7600
|
-
|
|
7823
|
+
log3.info(
|
|
7601
7824
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7602
7825
|
);
|
|
7603
7826
|
}
|
|
@@ -7621,15 +7844,15 @@ var init_PathResolver = __esm({
|
|
|
7621
7844
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7622
7845
|
if (fileExists && !overwrite) {
|
|
7623
7846
|
if (verbose) {
|
|
7624
|
-
|
|
7847
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7625
7848
|
}
|
|
7626
7849
|
return false;
|
|
7627
7850
|
}
|
|
7628
7851
|
if (dryRun) {
|
|
7629
|
-
|
|
7852
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7630
7853
|
return true;
|
|
7631
7854
|
}
|
|
7632
|
-
const dir = this.normalizePath(
|
|
7855
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7633
7856
|
try {
|
|
7634
7857
|
fs.mkdirSync(dir, { recursive: true });
|
|
7635
7858
|
} catch (error2) {
|
|
@@ -7638,7 +7861,7 @@ var init_PathResolver = __esm({
|
|
|
7638
7861
|
try {
|
|
7639
7862
|
fs.copyFileSync(srcPath, normalizedDestPath);
|
|
7640
7863
|
if (verbose) {
|
|
7641
|
-
|
|
7864
|
+
log3.info(
|
|
7642
7865
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7643
7866
|
);
|
|
7644
7867
|
}
|
|
@@ -7655,7 +7878,7 @@ var init_PathResolver = __esm({
|
|
|
7655
7878
|
return fs.existsSync(filePath);
|
|
7656
7879
|
} catch (error2) {
|
|
7657
7880
|
if (!silent) {
|
|
7658
|
-
|
|
7881
|
+
log3.error(`Error checking path existence: ${filePath}`, error2);
|
|
7659
7882
|
}
|
|
7660
7883
|
return false;
|
|
7661
7884
|
}
|
|
@@ -7681,7 +7904,7 @@ var init_PathResolver = __esm({
|
|
|
7681
7904
|
return fs.readdirSync(dirPath, options);
|
|
7682
7905
|
} catch (error2) {
|
|
7683
7906
|
if (this.options.debug) {
|
|
7684
|
-
|
|
7907
|
+
log3.warn(`Failed to read directory: ${dirPath}`, error2);
|
|
7685
7908
|
}
|
|
7686
7909
|
const isObjectOptions = options && typeof options === "object" && "withFileTypes" in options;
|
|
7687
7910
|
return isObjectOptions && options.withFileTypes ? [] : [];
|
|
@@ -7699,7 +7922,7 @@ var init_PathResolver = __esm({
|
|
|
7699
7922
|
return fs.statSync(filePath);
|
|
7700
7923
|
} catch (error2) {
|
|
7701
7924
|
if (this.options.debug) {
|
|
7702
|
-
|
|
7925
|
+
log3.warn(`Failed to stat file: ${filePath}`, error2);
|
|
7703
7926
|
}
|
|
7704
7927
|
return null;
|
|
7705
7928
|
}
|
|
@@ -7716,7 +7939,7 @@ var init_PathResolver = __esm({
|
|
|
7716
7939
|
return fs.lstatSync(filePath);
|
|
7717
7940
|
} catch (error2) {
|
|
7718
7941
|
if (this.options.debug) {
|
|
7719
|
-
|
|
7942
|
+
log3.warn(`Failed to lstat file: ${filePath}`, error2);
|
|
7720
7943
|
}
|
|
7721
7944
|
return null;
|
|
7722
7945
|
}
|
|
@@ -7805,7 +8028,7 @@ var init_PathResolver = __esm({
|
|
|
7805
8028
|
* @returns True if repoRoot is the monorepo (has packages directory)
|
|
7806
8029
|
*/
|
|
7807
8030
|
isMonorepo() {
|
|
7808
|
-
const packagesDir =
|
|
8031
|
+
const packagesDir = join2(this._repoRoot, "packages");
|
|
7809
8032
|
return this.pathExists(packagesDir);
|
|
7810
8033
|
}
|
|
7811
8034
|
/**
|
|
@@ -7822,7 +8045,7 @@ var init_PathResolver = __esm({
|
|
|
7822
8045
|
* Find files matching pattern within directory
|
|
7823
8046
|
*/
|
|
7824
8047
|
async findFiles(directory, pattern, options = {}) {
|
|
7825
|
-
const searchPattern = this.normalizePath(
|
|
8048
|
+
const searchPattern = this.normalizePath(join2(directory, pattern));
|
|
7826
8049
|
const appRoot = this.getAppRoot();
|
|
7827
8050
|
const normalizeAppRoot = this.normalizePath(appRoot);
|
|
7828
8051
|
const relativePattern = searchPattern.startsWith(normalizeAppRoot) ? searchPattern.slice(normalizeAppRoot.length + 1) : searchPattern;
|
|
@@ -7869,7 +8092,7 @@ var init_PathResolver = __esm({
|
|
|
7869
8092
|
return null;
|
|
7870
8093
|
}
|
|
7871
8094
|
const resolvedPath = this.normalizePath(
|
|
7872
|
-
|
|
8095
|
+
join2(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
|
|
7873
8096
|
);
|
|
7874
8097
|
const resolvedDir = resolvedPath.replace(/\/[^/]*\*.*$/, "");
|
|
7875
8098
|
if (this.pathExists(resolvedDir)) {
|
|
@@ -8065,13 +8288,13 @@ var init_PathResolver = __esm({
|
|
|
8065
8288
|
const maxLevels = this.options.maxLevels;
|
|
8066
8289
|
while (levelsChecked < maxLevels) {
|
|
8067
8290
|
const toolingPath = this.normalizePath(
|
|
8068
|
-
|
|
8291
|
+
join2(currentDir, PACKAGE_PATHS.TOOLING)
|
|
8069
8292
|
);
|
|
8070
|
-
const corePath = this.normalizePath(
|
|
8293
|
+
const corePath = this.normalizePath(join2(currentDir, PACKAGE_PATHS.CORE));
|
|
8071
8294
|
if (this.pathExists(toolingPath) && this.pathExists(corePath)) {
|
|
8072
8295
|
return currentDir;
|
|
8073
8296
|
}
|
|
8074
|
-
const appsDir =
|
|
8297
|
+
const appsDir = join2(currentDir, "apps");
|
|
8075
8298
|
if (this.pathExists(appsDir)) {
|
|
8076
8299
|
const appsDirStat = this.statSync(appsDir);
|
|
8077
8300
|
if (appsDirStat?.isDirectory()) {
|
|
@@ -8079,15 +8302,15 @@ var init_PathResolver = __esm({
|
|
|
8079
8302
|
}
|
|
8080
8303
|
}
|
|
8081
8304
|
const packageJsonPath = this.normalizePath(
|
|
8082
|
-
|
|
8305
|
+
join2(currentDir, "package.json")
|
|
8083
8306
|
);
|
|
8084
8307
|
if (this.pathExists(packageJsonPath)) {
|
|
8085
|
-
const parentDir2 = this.normalizePath(
|
|
8308
|
+
const parentDir2 = this.normalizePath(dirname2(currentDir));
|
|
8086
8309
|
if (parentDir2 === currentDir) {
|
|
8087
8310
|
return currentDir;
|
|
8088
8311
|
}
|
|
8089
8312
|
}
|
|
8090
|
-
const parentDir = this.normalizePath(
|
|
8313
|
+
const parentDir = this.normalizePath(dirname2(currentDir));
|
|
8091
8314
|
if (parentDir === currentDir) {
|
|
8092
8315
|
break;
|
|
8093
8316
|
}
|
|
@@ -8103,8 +8326,8 @@ var init_PathResolver = __esm({
|
|
|
8103
8326
|
// packages/tooling/src/utils/pathResolver.ts
|
|
8104
8327
|
import { createRequire as createRequire2 } from "node:module";
|
|
8105
8328
|
import {
|
|
8106
|
-
join as
|
|
8107
|
-
dirname as
|
|
8329
|
+
join as join3,
|
|
8330
|
+
dirname as dirname3,
|
|
8108
8331
|
basename as basename2,
|
|
8109
8332
|
extname as extname2,
|
|
8110
8333
|
relative as relative2,
|
|
@@ -8114,7 +8337,7 @@ import {
|
|
|
8114
8337
|
} from "node:path";
|
|
8115
8338
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
8116
8339
|
function getDirnameFromUrl(importMetaUrl) {
|
|
8117
|
-
return
|
|
8340
|
+
return dirname3(fileURLToPath2(importMetaUrl));
|
|
8118
8341
|
}
|
|
8119
8342
|
function detectExecutionMode() {
|
|
8120
8343
|
const fileUrlPath = fileURLToPath2(import.meta.url);
|
|
@@ -8130,7 +8353,7 @@ function getTemplatesRoot() {
|
|
|
8130
8353
|
const mode = detectExecutionMode();
|
|
8131
8354
|
if (mode === "development") {
|
|
8132
8355
|
const fileUrlPath = fileURLToPath2(import.meta.url);
|
|
8133
|
-
const frameworkRoot = normalizePath(
|
|
8356
|
+
const frameworkRoot = normalizePath(dirname3(fileUrlPath), "../../../..");
|
|
8134
8357
|
return normalizePath(frameworkRoot, PACKAGE_PATHS.CLI, "templates");
|
|
8135
8358
|
} else {
|
|
8136
8359
|
try {
|
|
@@ -8146,7 +8369,7 @@ function getTemplatesRoot() {
|
|
|
8146
8369
|
try {
|
|
8147
8370
|
const req = createRequire2(import.meta.url);
|
|
8148
8371
|
const cliPackageJsonPath = req.resolve("@donotdev/cli/package.json");
|
|
8149
|
-
const cliRoot2 = normalizePath(
|
|
8372
|
+
const cliRoot2 = normalizePath(dirname3(cliPackageJsonPath));
|
|
8150
8373
|
const templatesPath = normalizePath(cliRoot2, "templates");
|
|
8151
8374
|
if (pathExists(templatesPath)) {
|
|
8152
8375
|
return templatesPath;
|
|
@@ -8198,8 +8421,8 @@ async function glob(pattern, options = {}) {
|
|
|
8198
8421
|
const patterns = Array.isArray(pattern) ? pattern : [pattern];
|
|
8199
8422
|
const cwd = options.cwd || pathResolverInstance.getAppRoot() || process.cwd();
|
|
8200
8423
|
const normalizeCwd = pathResolverInstance.normalizePath(cwd);
|
|
8201
|
-
const relativePatterns = patterns.map((
|
|
8202
|
-
const normalizedPattern = pathResolverInstance.normalizePath(
|
|
8424
|
+
const relativePatterns = patterns.map((p) => {
|
|
8425
|
+
const normalizedPattern = pathResolverInstance.normalizePath(p);
|
|
8203
8426
|
if (normalizedPattern.startsWith(normalizeCwd)) {
|
|
8204
8427
|
return normalizedPattern.slice(normalizeCwd.length + 1);
|
|
8205
8428
|
}
|
|
@@ -8230,7 +8453,7 @@ var init_pathResolver = __esm({
|
|
|
8230
8453
|
pathResolverInstance = PathResolver.getInstance({ debug: false });
|
|
8231
8454
|
resolveFrameworkPackage = (name, from) => pathResolverInstance.resolveFrameworkPackage(name, from || null);
|
|
8232
8455
|
normalizePath = (...pathSegments) => {
|
|
8233
|
-
return pathResolverInstance.normalizePath(
|
|
8456
|
+
return pathResolverInstance.normalizePath(join3(...pathSegments));
|
|
8234
8457
|
};
|
|
8235
8458
|
pathExists = (filePath, silent = false) => pathResolverInstance.pathExists(filePath, silent);
|
|
8236
8459
|
read = async (filePath, options) => pathResolverInstance.read(filePath, options);
|
|
@@ -8243,7 +8466,7 @@ var init_pathResolver = __esm({
|
|
|
8243
8466
|
return normalizePath(relative2(from, to));
|
|
8244
8467
|
};
|
|
8245
8468
|
getDirname = (filePath) => {
|
|
8246
|
-
return normalizePath(
|
|
8469
|
+
return normalizePath(dirname3(filePath));
|
|
8247
8470
|
};
|
|
8248
8471
|
joinPath = (...pathSegments) => {
|
|
8249
8472
|
return normalizePath(...pathSegments);
|
|
@@ -8255,7 +8478,7 @@ var init_pathResolver = __esm({
|
|
|
8255
8478
|
import { Buffer } from "node:buffer";
|
|
8256
8479
|
import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
8257
8480
|
import { createRequire as createRequire3 } from "node:module";
|
|
8258
|
-
import { dirname as
|
|
8481
|
+
import { dirname as dirname4, resolve as resolve3 } from "node:path";
|
|
8259
8482
|
import process from "node:process";
|
|
8260
8483
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
8261
8484
|
var require2, __filename, __dirname;
|
|
@@ -8264,7 +8487,7 @@ var init_utils2 = __esm({
|
|
|
8264
8487
|
"use strict";
|
|
8265
8488
|
require2 = createRequire3(import.meta.url);
|
|
8266
8489
|
__filename = fileURLToPath3(import.meta.url);
|
|
8267
|
-
__dirname =
|
|
8490
|
+
__dirname = dirname4(__filename);
|
|
8268
8491
|
if (typeof globalThis !== "undefined") {
|
|
8269
8492
|
globalThis.require = require2;
|
|
8270
8493
|
globalThis.__filename = __filename;
|
|
@@ -8285,13 +8508,13 @@ async function askForSelection(message, choices, defaultValue = 0) {
|
|
|
8285
8508
|
label: choice.title,
|
|
8286
8509
|
hint: choice.hint
|
|
8287
8510
|
}));
|
|
8288
|
-
const result = await
|
|
8511
|
+
const result = await select({
|
|
8289
8512
|
message,
|
|
8290
8513
|
options,
|
|
8291
8514
|
initialValue: choices[defaultValue]?.value
|
|
8292
8515
|
});
|
|
8293
|
-
if (
|
|
8294
|
-
|
|
8516
|
+
if (isCancel(result)) {
|
|
8517
|
+
cancel("Operation cancelled.");
|
|
8295
8518
|
process.exit(0);
|
|
8296
8519
|
}
|
|
8297
8520
|
return result;
|
|
@@ -8319,7 +8542,7 @@ init_cli_output();
|
|
|
8319
8542
|
init_pathResolver();
|
|
8320
8543
|
async function copyTemplateFiles(sourceDir, destDir, replacements) {
|
|
8321
8544
|
if (!pathExists(sourceDir)) {
|
|
8322
|
-
|
|
8545
|
+
log2.warn(`Warning: Template directory does not exist: ${sourceDir}`);
|
|
8323
8546
|
return;
|
|
8324
8547
|
}
|
|
8325
8548
|
const files = await glob("**/*", {
|
|
@@ -8389,8 +8612,8 @@ async function isTextFile(filePath) {
|
|
|
8389
8612
|
try {
|
|
8390
8613
|
const buffer = await read(filePath, { format: "buffer" });
|
|
8391
8614
|
if (buffer.length === 0) return true;
|
|
8392
|
-
for (let
|
|
8393
|
-
if (buffer[
|
|
8615
|
+
for (let i2 = 0; i2 < Math.min(buffer.length, 1e3); i2++) {
|
|
8616
|
+
if (buffer[i2] === 0) return false;
|
|
8394
8617
|
}
|
|
8395
8618
|
return true;
|
|
8396
8619
|
} catch {
|
|
@@ -8415,7 +8638,7 @@ async function replacePlaceholders(filePath, replacements) {
|
|
|
8415
8638
|
}
|
|
8416
8639
|
await write(filePath, content, { overwrite: true });
|
|
8417
8640
|
} catch (error2) {
|
|
8418
|
-
|
|
8641
|
+
log2.warn(
|
|
8419
8642
|
`Warning: Could not process file ${filePath}: ${error2.message || "Unknown error"}`
|
|
8420
8643
|
);
|
|
8421
8644
|
}
|
|
@@ -8522,16 +8745,16 @@ function loadMatrix(mode) {
|
|
|
8522
8745
|
return cachedMatrix;
|
|
8523
8746
|
}
|
|
8524
8747
|
function resolveGroup(groupName, matrix) {
|
|
8525
|
-
const
|
|
8526
|
-
if (!
|
|
8748
|
+
const group2 = matrix.groups[groupName];
|
|
8749
|
+
if (!group2) return {};
|
|
8527
8750
|
const result = {};
|
|
8528
|
-
if (
|
|
8529
|
-
for (const included of
|
|
8751
|
+
if (group2.includes) {
|
|
8752
|
+
for (const included of group2.includes) {
|
|
8530
8753
|
Object.assign(result, resolveGroup(included, matrix));
|
|
8531
8754
|
}
|
|
8532
8755
|
}
|
|
8533
|
-
if (
|
|
8534
|
-
Object.assign(result,
|
|
8756
|
+
if (group2.packages) {
|
|
8757
|
+
Object.assign(result, group2.packages);
|
|
8535
8758
|
}
|
|
8536
8759
|
return result;
|
|
8537
8760
|
}
|
|
@@ -8714,9 +8937,9 @@ function generatePackageJson(templateName, mode, options = {}) {
|
|
|
8714
8937
|
}
|
|
8715
8938
|
if (mode === "published") {
|
|
8716
8939
|
const overrides = {};
|
|
8717
|
-
for (const [groupName,
|
|
8940
|
+
for (const [groupName, group2] of Object.entries(matrix.groups || {})) {
|
|
8718
8941
|
if (groupName.startsWith("@donotdev/")) {
|
|
8719
|
-
const version =
|
|
8942
|
+
const version = group2.packages?.[groupName];
|
|
8720
8943
|
if (version) {
|
|
8721
8944
|
overrides[groupName] = version.replace(/^\^/, "");
|
|
8722
8945
|
}
|
|
@@ -8738,15 +8961,15 @@ init_cli_input();
|
|
|
8738
8961
|
init_cli_output();
|
|
8739
8962
|
init_pathResolver();
|
|
8740
8963
|
async function main(options) {
|
|
8741
|
-
|
|
8964
|
+
intro("get-demo");
|
|
8742
8965
|
const cwd = normalizePath(process.cwd());
|
|
8743
8966
|
const executionMode = detectExecutionMode();
|
|
8744
8967
|
const templatesRoot = getTemplatesRoot();
|
|
8745
8968
|
const demoTemplateDir = joinPath(templatesRoot, "app-demo");
|
|
8746
8969
|
const demoAppDir = joinPath(cwd, "apps", "demo");
|
|
8747
8970
|
if (!pathExists(demoTemplateDir)) {
|
|
8748
|
-
|
|
8749
|
-
|
|
8971
|
+
log2.error(`Demo template not found: ${demoTemplateDir}`);
|
|
8972
|
+
outro("Failed");
|
|
8750
8973
|
return;
|
|
8751
8974
|
}
|
|
8752
8975
|
if (pathExists(demoAppDir)) {
|
|
@@ -8762,13 +8985,13 @@ async function main(options) {
|
|
|
8762
8985
|
1
|
|
8763
8986
|
);
|
|
8764
8987
|
if (action === "cancel") {
|
|
8765
|
-
|
|
8988
|
+
outro("Cancelled");
|
|
8766
8989
|
return;
|
|
8767
8990
|
}
|
|
8768
8991
|
await remove(demoAppDir);
|
|
8769
8992
|
}
|
|
8770
8993
|
}
|
|
8771
|
-
const s =
|
|
8994
|
+
const s = spinner();
|
|
8772
8995
|
s.start("Copying demo app...");
|
|
8773
8996
|
const projectName = getProjectName(cwd);
|
|
8774
8997
|
const firebaseProjectId = projectName.toLowerCase().replace(/\s+/g, "-");
|
|
@@ -8810,11 +9033,11 @@ async function main(options) {
|
|
|
8810
9033
|
overwrite: true
|
|
8811
9034
|
});
|
|
8812
9035
|
s.stop("Demo app copied to apps/demo");
|
|
8813
|
-
|
|
8814
|
-
|
|
8815
|
-
|
|
8816
|
-
|
|
8817
|
-
|
|
9036
|
+
log2.info("");
|
|
9037
|
+
log2.info("Next steps:");
|
|
9038
|
+
log2.info(" bun install");
|
|
9039
|
+
log2.info(" cd apps/demo && dndev dev");
|
|
9040
|
+
outro("Done");
|
|
8818
9041
|
}
|
|
8819
9042
|
function getProjectName(cwd) {
|
|
8820
9043
|
try {
|