@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, n2 = Math.max(l2.length - 1, 0), e = t2 < 0 ? n2 : t2 > n2 ? 0 : t2;
|
|
466
|
+
return l2[e]?.disabled ? findCursor(e, o < 0 ? -1 : 1, l2) : e;
|
|
467
|
+
}
|
|
468
|
+
function isAccessible(n2) {
|
|
469
|
+
if (n2 !== void 0) return n2;
|
|
470
|
+
if (settings.accessible !== void 0) return settings.accessible;
|
|
471
|
+
const e = process.env.ACCESSIBLE;
|
|
472
|
+
return e !== void 0 && e !== "" && e !== "0" && e !== "false";
|
|
509
473
|
}
|
|
510
|
-
function
|
|
511
|
-
if (typeof
|
|
512
|
-
|
|
474
|
+
function isActionKey(n2, e) {
|
|
475
|
+
if (typeof n2 == "string")
|
|
476
|
+
return settings.aliases.get(n2) === e;
|
|
477
|
+
for (const s of n2)
|
|
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 n2 = 0; n2 < r2; n2++)
|
|
488
|
+
e[n2] !== t2[n2] && f.push(n2);
|
|
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: n2 = 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 c = String(f);
|
|
518
|
+
if (isActionKey([c, a2, w], "cancel")) {
|
|
519
|
+
n2 && 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, m2 = a2 === "return" ? -1 : 0;
|
|
524
|
+
l.moveCursor(r2, i2, m2, () => {
|
|
525
|
+
l.clearLine(r2, 1, () => {
|
|
526
|
+
e.once("keypress", t2);
|
|
544
527
|
});
|
|
545
528
|
});
|
|
546
529
|
};
|
|
547
|
-
return
|
|
548
|
-
|
|
530
|
+
return n2 && r2.write(import_sisteransi.cursor.hide), e.once("keypress", t2), () => {
|
|
531
|
+
e.off("keypress", t2), n2 && r2.write(import_sisteransi.cursor.show), e instanceof ReadStream && e.isTTY && !R && e.setRawMode(false), s.terminal = false, s.close();
|
|
549
532
|
};
|
|
550
533
|
}
|
|
551
|
-
function
|
|
552
|
-
const
|
|
553
|
-
return wrapAnsi(
|
|
554
|
-
|
|
534
|
+
function wrapTextWithPrefix(e, r2, o, n2 = 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((c, i2, m2) => {
|
|
541
|
+
const d = t2 ? t2(c, i2) : c;
|
|
542
|
+
return i2 === 0 ? `${n2}${d}` : i2 === m2.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 n2 = e["~standard"].validate(a2);
|
|
549
|
+
return n2 instanceof Promise ? n2.then((r2) => r2.issues?.at(0)?.message) : n2.issues?.at(0)?.message;
|
|
550
|
+
}
|
|
551
|
+
return e(a2);
|
|
552
|
+
}
|
|
553
|
+
var import_sisteransi, a$1, t, settings, R, CANCEL_SYMBOL, getColumns, getRows, y, r, a;
|
|
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: (n2, e) => `There are only ${n2} days in ${e}`,
|
|
598
|
+
afterMin: (n2) => `Date must be on or after ${n2.toISOString().slice(0, 10)}`,
|
|
599
|
+
beforeMax: (n2) => `Date must be on or before ${n2.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: n2, ...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 = n2, 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 n2 = e.lines.find((o) => o >= s);
|
|
752
|
+
if (n2 === 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, n2 - 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[n2]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, o.length - n2 - 1));
|
|
671
761
|
return;
|
|
672
762
|
} else if (e.lines.length > 1) {
|
|
673
|
-
if (
|
|
763
|
+
if (s < r2)
|
|
764
|
+
n2 = s;
|
|
674
765
|
else {
|
|
675
|
-
const
|
|
676
|
-
|
|
766
|
+
const h2 = n2 - 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(n2);
|
|
772
|
+
this.output.write(f.join(`
|
|
682
773
|
`)), this._prevFrame = t2;
|
|
683
774
|
return;
|
|
684
775
|
}
|
|
@@ -689,7 +780,7 @@ var init_dist3 = __esm({
|
|
|
689
780
|
}
|
|
690
781
|
}
|
|
691
782
|
};
|
|
692
|
-
|
|
783
|
+
r = class extends y {
|
|
693
784
|
get cursor() {
|
|
694
785
|
return this.value ? 0 : 1;
|
|
695
786
|
}
|
|
@@ -699,51 +790,55 @@ var init_dist3 = __esm({
|
|
|
699
790
|
constructor(t2) {
|
|
700
791
|
super(t2, false), this.value = !!t2.initialValue, this.on("userInput", () => {
|
|
701
792
|
this.value = this._value;
|
|
702
|
-
}), this.on("confirm", (
|
|
703
|
-
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value =
|
|
793
|
+
}), this.on("confirm", (i2) => {
|
|
794
|
+
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = i2, this.state = "submit", this.close();
|
|
704
795
|
}), this.on("cursor", () => {
|
|
705
796
|
this.value = !this.value;
|
|
706
797
|
});
|
|
707
798
|
}
|
|
708
799
|
};
|
|
709
|
-
|
|
800
|
+
a = class extends y {
|
|
710
801
|
options;
|
|
711
802
|
cursor = 0;
|
|
712
803
|
get _value() {
|
|
713
|
-
return this.options[this.cursor]
|
|
804
|
+
return this.options[this.cursor]?.value;
|
|
714
805
|
}
|
|
715
806
|
get _enabledOptions() {
|
|
716
|
-
return this.options.filter((
|
|
807
|
+
return this.options.filter((e) => e.disabled !== true);
|
|
717
808
|
}
|
|
718
809
|
toggleAll() {
|
|
719
|
-
const
|
|
720
|
-
this.value =
|
|
810
|
+
const e = this._enabledOptions, i2 = this.value !== void 0 && this.value.length === e.length;
|
|
811
|
+
this.value = i2 ? [] : e.map((t2) => t2.value);
|
|
721
812
|
}
|
|
722
813
|
toggleInvert() {
|
|
723
|
-
const
|
|
724
|
-
if (!
|
|
725
|
-
|
|
726
|
-
|
|
814
|
+
const e = this.value;
|
|
815
|
+
if (!e)
|
|
816
|
+
return;
|
|
817
|
+
const i2 = this._enabledOptions.filter((t2) => !e.includes(t2.value));
|
|
818
|
+
this.value = i2.map((t2) => t2.value);
|
|
727
819
|
}
|
|
728
820
|
toggleValue() {
|
|
729
821
|
this.value === void 0 && (this.value = []);
|
|
730
|
-
const
|
|
731
|
-
this.value =
|
|
732
|
-
}
|
|
733
|
-
constructor(
|
|
734
|
-
super(
|
|
735
|
-
const
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
822
|
+
const e = this.value.includes(this._value);
|
|
823
|
+
this.value = e ? this.value.filter((i2) => i2 !== this._value) : [...this.value, this._value];
|
|
824
|
+
}
|
|
825
|
+
constructor(e) {
|
|
826
|
+
super(e, false), this.options = e.options, this.value = [...e.initialValues ?? []];
|
|
827
|
+
const i2 = Math.max(
|
|
828
|
+
this.options.findIndex(({ value: t2 }) => t2 === e.cursorAt),
|
|
829
|
+
0
|
|
830
|
+
);
|
|
831
|
+
this.cursor = this.options[i2]?.disabled ? findCursor(i2, 1, this.options) : i2, this.on("key", (t2, l2) => {
|
|
832
|
+
l2.name === "a" && this.toggleAll(), l2.name === "i" && this.toggleInvert();
|
|
833
|
+
}), this.on("cursor", (t2) => {
|
|
834
|
+
switch (t2) {
|
|
740
835
|
case "left":
|
|
741
836
|
case "up":
|
|
742
|
-
this.cursor =
|
|
837
|
+
this.cursor = findCursor(this.cursor, -1, this.options);
|
|
743
838
|
break;
|
|
744
839
|
case "down":
|
|
745
840
|
case "right":
|
|
746
|
-
this.cursor =
|
|
841
|
+
this.cursor = findCursor(this.cursor, 1, this.options);
|
|
747
842
|
break;
|
|
748
843
|
case "space":
|
|
749
844
|
this.toggleValue();
|
|
@@ -755,307 +850,487 @@ var init_dist3 = __esm({
|
|
|
755
850
|
}
|
|
756
851
|
});
|
|
757
852
|
|
|
758
|
-
// node_modules/.bun/@clack+prompts@1.
|
|
759
|
-
import { styleText as
|
|
760
|
-
import
|
|
761
|
-
import { existsSync
|
|
762
|
-
import { dirname
|
|
763
|
-
function
|
|
764
|
-
|
|
853
|
+
// node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs
|
|
854
|
+
import { styleText as styleText2, stripVTControlCharacters } from "node:util";
|
|
855
|
+
import process$1 from "node:process";
|
|
856
|
+
import { existsSync, lstatSync, readdirSync } from "node:fs";
|
|
857
|
+
import { dirname, join } from "node:path";
|
|
858
|
+
function isUnicodeSupported() {
|
|
859
|
+
if (process$1.platform !== "win32") {
|
|
860
|
+
return process$1.env.TERM !== "linux";
|
|
861
|
+
}
|
|
862
|
+
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";
|
|
863
|
+
}
|
|
864
|
+
function formatInstructionFooter(o, e) {
|
|
865
|
+
const r2 = [`${e ? `${styleText2("cyan", S_BAR)} ` : ""}${o.join(" \u2022 ")}`];
|
|
866
|
+
return e && r2.push(styleText2("cyan", S_BAR_END)), r2;
|
|
765
867
|
}
|
|
766
|
-
var import_sisteransi2,
|
|
868
|
+
var import_sisteransi2, unicode, isCI, unicodeOr, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_BAR_START, S_BAR, S_BAR_END, S_BAR_START_RIGHT, S_BAR_END_RIGHT, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, S_PASSWORD_MASK, S_BAR_H, S_CORNER_TOP_RIGHT, S_CONNECT_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_BOTTOM_LEFT, S_CORNER_TOP_LEFT, S_INFO, S_SUCCESS, S_WARN, S_ERROR, symbol, symbolBar, I, limitOptions, confirm, MULTISELECT_INSTRUCTIONS, m, multiselect, log, cancel, intro, outro, W$1, C, note, W, spinner, u2, SELECT_INSTRUCTIONS, i;
|
|
767
869
|
var init_dist4 = __esm({
|
|
768
|
-
"node_modules/.bun/@clack+prompts@1.
|
|
870
|
+
"node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs"() {
|
|
769
871
|
init_utils2();
|
|
770
872
|
init_dist3();
|
|
771
873
|
init_dist3();
|
|
772
874
|
init_main();
|
|
773
875
|
init_dist2();
|
|
774
876
|
import_sisteransi2 = __toESM(require_src(), 1);
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
switch (
|
|
877
|
+
unicode = isUnicodeSupported();
|
|
878
|
+
isCI = () => process.env.CI === "true";
|
|
879
|
+
unicodeOr = (o, e) => unicode ? o : e;
|
|
880
|
+
S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
|
|
881
|
+
S_STEP_CANCEL = unicodeOr("\u25A0", "x");
|
|
882
|
+
S_STEP_ERROR = unicodeOr("\u25B2", "x");
|
|
883
|
+
S_STEP_SUBMIT = unicodeOr("\u25C7", "o");
|
|
884
|
+
S_BAR_START = unicodeOr("\u250C", "T");
|
|
885
|
+
S_BAR = unicodeOr("\u2502", "|");
|
|
886
|
+
S_BAR_END = unicodeOr("\u2514", "\u2014");
|
|
887
|
+
S_BAR_START_RIGHT = unicodeOr("\u2510", "T");
|
|
888
|
+
S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014");
|
|
889
|
+
S_RADIO_ACTIVE = unicodeOr("\u25CF", ">");
|
|
890
|
+
S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
|
|
891
|
+
S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
|
|
892
|
+
S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
|
|
893
|
+
S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
|
|
894
|
+
S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022");
|
|
895
|
+
S_BAR_H = unicodeOr("\u2500", "-");
|
|
896
|
+
S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+");
|
|
897
|
+
S_CONNECT_LEFT = unicodeOr("\u251C", "+");
|
|
898
|
+
S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+");
|
|
899
|
+
S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+");
|
|
900
|
+
S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+");
|
|
901
|
+
S_INFO = unicodeOr("\u25CF", "\u2022");
|
|
902
|
+
S_SUCCESS = unicodeOr("\u25C6", "*");
|
|
903
|
+
S_WARN = unicodeOr("\u25B2", "!");
|
|
904
|
+
S_ERROR = unicodeOr("\u25A0", "x");
|
|
905
|
+
symbol = (o) => {
|
|
906
|
+
switch (o) {
|
|
805
907
|
case "initial":
|
|
806
908
|
case "active":
|
|
807
|
-
return
|
|
909
|
+
return styleText2("cyan", S_STEP_ACTIVE);
|
|
808
910
|
case "cancel":
|
|
809
|
-
return
|
|
911
|
+
return styleText2("red", S_STEP_CANCEL);
|
|
810
912
|
case "error":
|
|
811
|
-
return
|
|
913
|
+
return styleText2("yellow", S_STEP_ERROR);
|
|
812
914
|
case "submit":
|
|
813
|
-
return
|
|
915
|
+
return styleText2("green", S_STEP_SUBMIT);
|
|
916
|
+
case "validating":
|
|
917
|
+
return styleText2("dim", S_STEP_ACTIVE);
|
|
814
918
|
}
|
|
815
919
|
};
|
|
816
|
-
|
|
817
|
-
switch (
|
|
920
|
+
symbolBar = (o) => {
|
|
921
|
+
switch (o) {
|
|
818
922
|
case "initial":
|
|
819
923
|
case "active":
|
|
820
|
-
return
|
|
924
|
+
return styleText2("cyan", S_BAR);
|
|
821
925
|
case "cancel":
|
|
822
|
-
return
|
|
926
|
+
return styleText2("red", S_BAR);
|
|
823
927
|
case "error":
|
|
824
|
-
return
|
|
928
|
+
return styleText2("yellow", S_BAR);
|
|
825
929
|
case "submit":
|
|
826
|
-
return
|
|
827
|
-
}
|
|
828
|
-
};
|
|
829
|
-
|
|
830
|
-
let
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
930
|
+
return styleText2("green", S_BAR);
|
|
931
|
+
}
|
|
932
|
+
};
|
|
933
|
+
I = (l2, e, w, p, b, C2 = false) => {
|
|
934
|
+
let r2 = e, O = 0;
|
|
935
|
+
if (C2)
|
|
936
|
+
for (let i2 = p - 1; i2 >= w; i2--) {
|
|
937
|
+
const m2 = l2[i2];
|
|
938
|
+
if (m2 && (r2 -= m2.length), O++, r2 <= b) break;
|
|
939
|
+
}
|
|
940
|
+
else
|
|
941
|
+
for (let i2 = w; i2 < p; i2++) {
|
|
942
|
+
const m2 = l2[i2];
|
|
943
|
+
if (m2 && (r2 -= m2.length), O++, r2 <= b) break;
|
|
944
|
+
}
|
|
945
|
+
return { lineCount: r2, removals: O };
|
|
946
|
+
};
|
|
947
|
+
limitOptions = ({
|
|
948
|
+
cursor: l2,
|
|
949
|
+
options: e,
|
|
950
|
+
style: w,
|
|
951
|
+
output: p = process.stdout,
|
|
952
|
+
maxItems: b = Number.POSITIVE_INFINITY,
|
|
953
|
+
columnPadding: C2 = 0,
|
|
954
|
+
rowPadding: r2 = 4
|
|
955
|
+
}) => {
|
|
956
|
+
const i2 = getColumns(p) - C2, m2 = getRows(p), M = styleText2("dim", "..."), v = Math.max(m2 - r2, 0), a2 = Math.max(Math.min(b, v), 5);
|
|
843
957
|
let f = 0;
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
958
|
+
l2 >= a2 - 3 && (f = Math.max(
|
|
959
|
+
Math.min(l2 - a2 + 3, e.length - a2),
|
|
960
|
+
0
|
|
961
|
+
));
|
|
962
|
+
let d = a2 < e.length && f > 0, c = a2 < e.length && f + a2 < e.length;
|
|
963
|
+
const W2 = Math.min(
|
|
964
|
+
f + a2,
|
|
965
|
+
e.length
|
|
966
|
+
), s = [];
|
|
967
|
+
let g = 0;
|
|
968
|
+
d && g++, c && g++;
|
|
969
|
+
const T = f + (d ? 1 : 0), y2 = W2 - (c ? 1 : 0);
|
|
970
|
+
for (let t2 = T; t2 < y2; t2++) {
|
|
971
|
+
const n2 = e[t2], o = n2 ? w(n2, t2 === l2) : "", h2 = wrapAnsi(o, i2, {
|
|
972
|
+
hard: true,
|
|
973
|
+
trim: false
|
|
974
|
+
}).split(`
|
|
848
975
|
`);
|
|
849
|
-
|
|
850
|
-
}
|
|
851
|
-
if (
|
|
852
|
-
let
|
|
853
|
-
const
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
976
|
+
s.push(h2), g += h2.length;
|
|
977
|
+
}
|
|
978
|
+
if (g > v) {
|
|
979
|
+
let t2 = 0, n2 = 0, o = g;
|
|
980
|
+
const h2 = l2 - T;
|
|
981
|
+
let u3 = v;
|
|
982
|
+
const L = () => I(s, o, 0, h2, u3), E = () => I(
|
|
983
|
+
s,
|
|
984
|
+
o,
|
|
985
|
+
h2 + 1,
|
|
986
|
+
s.length,
|
|
987
|
+
u3,
|
|
988
|
+
true
|
|
989
|
+
);
|
|
990
|
+
d ? ({ lineCount: o, removals: t2 } = L(), o > u3 && (c || (u3 -= 1), { lineCount: o, removals: n2 } = E())) : (c || (u3 -= 1), { lineCount: o, removals: n2 } = E(), o > u3 && (u3 -= 1, { lineCount: o, removals: t2 } = L())), t2 > 0 && (d = true, s.splice(0, t2)), n2 > 0 && (c = true, s.splice(s.length - n2, n2));
|
|
991
|
+
}
|
|
992
|
+
const x = [];
|
|
993
|
+
d && x.push(M);
|
|
994
|
+
for (const t2 of s)
|
|
995
|
+
for (const n2 of t2)
|
|
996
|
+
x.push(n2);
|
|
997
|
+
return c && x.push(M), x;
|
|
998
|
+
};
|
|
999
|
+
confirm = (i2) => {
|
|
1000
|
+
const a2 = i2.active ?? "Yes", s = i2.inactive ?? "No";
|
|
1001
|
+
return new r({
|
|
1002
|
+
active: a2,
|
|
1003
|
+
inactive: s,
|
|
1004
|
+
signal: i2.signal,
|
|
1005
|
+
input: i2.input,
|
|
1006
|
+
output: i2.output,
|
|
1007
|
+
initialValue: i2.initialValue ?? true,
|
|
1008
|
+
render() {
|
|
1009
|
+
const e = i2.withGuide ?? settings.withGuide, u3 = `${symbol(this.state)} `, l2 = e ? `${styleText2("gray", S_BAR)} ` : "", f = wrapTextWithPrefix(
|
|
1010
|
+
i2.output,
|
|
1011
|
+
i2.message,
|
|
1012
|
+
l2,
|
|
1013
|
+
u3
|
|
1014
|
+
), o = `${e ? `${styleText2("gray", S_BAR)}
|
|
1015
|
+
` : ""}${f}
|
|
1016
|
+
`, c = this.value ? a2 : s;
|
|
1017
|
+
switch (this.state) {
|
|
1018
|
+
case "submit": {
|
|
1019
|
+
const r2 = e ? `${styleText2("gray", S_BAR)} ` : "";
|
|
1020
|
+
return `${o}${r2}${styleText2("dim", c)}`;
|
|
1021
|
+
}
|
|
1022
|
+
case "cancel": {
|
|
1023
|
+
const r2 = e ? `${styleText2("gray", S_BAR)} ` : "";
|
|
1024
|
+
return `${o}${r2}${styleText2(["strikethrough", "dim"], c)}${e ? `
|
|
1025
|
+
${styleText2("gray", S_BAR)}` : ""}`;
|
|
1026
|
+
}
|
|
1027
|
+
default: {
|
|
1028
|
+
const r2 = e ? `${styleText2("cyan", S_BAR)} ` : "", g = e ? styleText2("cyan", S_BAR_END) : "";
|
|
1029
|
+
return `${o}${r2}${this.value ? `${styleText2("green", S_RADIO_ACTIVE)} ${a2}` : `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", a2)}`}${i2.vertical ? e ? `
|
|
1030
|
+
${styleText2("cyan", S_BAR)} ` : `
|
|
1031
|
+
` : ` ${styleText2("dim", "/")} `}${this.value ? `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", s)}` : `${styleText2("green", S_RADIO_ACTIVE)} ${s}`}
|
|
1032
|
+
${g}
|
|
1033
|
+
`;
|
|
1034
|
+
}
|
|
876
1035
|
}
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
1036
|
+
}
|
|
1037
|
+
}).prompt();
|
|
1038
|
+
};
|
|
1039
|
+
MULTISELECT_INSTRUCTIONS = [
|
|
1040
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
1041
|
+
`${styleText2("dim", "Space:")} select`,
|
|
1042
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
1043
|
+
];
|
|
1044
|
+
m = (i2, u3) => i2.split(`
|
|
1045
|
+
`).map((d) => u3(d)).join(`
|
|
1046
|
+
`);
|
|
1047
|
+
multiselect = (i2) => {
|
|
1048
|
+
const u3 = (t2, a2) => {
|
|
1049
|
+
const r2 = t2.label ?? String(t2.value);
|
|
1050
|
+
return a2 === "disabled" ? `${styleText2("gray", S_CHECKBOX_INACTIVE)} ${m(r2, (o) => styleText2(["strikethrough", "gray"], o))}${t2.hint ? ` ${styleText2("dim", `(${t2.hint ?? "disabled"})`)}` : ""}` : a2 === "active" ? `${styleText2("cyan", S_CHECKBOX_ACTIVE)} ${r2}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : a2 === "selected" ? `${styleText2("green", S_CHECKBOX_SELECTED)} ${m(r2, (o) => styleText2("dim", o))}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : a2 === "cancelled" ? `${m(r2, (o) => styleText2(["strikethrough", "dim"], o))}` : a2 === "active-selected" ? `${styleText2("green", S_CHECKBOX_SELECTED)} ${r2}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : a2 === "submitted" ? `${m(r2, (o) => styleText2("dim", o))}` : `${styleText2("dim", S_CHECKBOX_INACTIVE)} ${m(r2, (o) => styleText2("dim", o))}`;
|
|
1051
|
+
}, d = i2.required ?? true, v = i2.showInstructions ?? true;
|
|
1052
|
+
return new a({
|
|
1053
|
+
options: i2.options,
|
|
1054
|
+
signal: i2.signal,
|
|
1055
|
+
input: i2.input,
|
|
1056
|
+
output: i2.output,
|
|
1057
|
+
initialValues: i2.initialValues,
|
|
1058
|
+
required: d,
|
|
1059
|
+
cursorAt: i2.cursorAt,
|
|
1060
|
+
validate(t2) {
|
|
1061
|
+
if (d && (t2 === void 0 || t2.length === 0))
|
|
1062
|
+
return `Please select at least one option.
|
|
1063
|
+
${styleText2(
|
|
1064
|
+
"reset",
|
|
1065
|
+
styleText2(
|
|
1066
|
+
"dim",
|
|
1067
|
+
`Press ${styleText2(["gray", "bgWhite", "inverse"], " space ")} to select, ${styleText2(
|
|
1068
|
+
"gray",
|
|
1069
|
+
styleText2("bgWhite", styleText2("inverse", " enter "))
|
|
1070
|
+
)} to submit`
|
|
1071
|
+
)
|
|
1072
|
+
)}`;
|
|
1073
|
+
},
|
|
1074
|
+
render() {
|
|
1075
|
+
const t2 = i2.withGuide ?? settings.withGuide, a2 = wrapTextWithPrefix(
|
|
1076
|
+
i2.output,
|
|
1077
|
+
i2.message,
|
|
1078
|
+
t2 ? `${symbolBar(this.state)} ` : "",
|
|
1079
|
+
`${symbol(this.state)} `
|
|
1080
|
+
), r2 = `${t2 ? `${styleText2("gray", S_BAR)}
|
|
1081
|
+
` : ""}${a2}
|
|
1082
|
+
`, o = this.value ?? [], p = (n2, l2) => {
|
|
1083
|
+
if (n2.disabled)
|
|
1084
|
+
return u3(n2, "disabled");
|
|
1085
|
+
const s = o.includes(n2.value);
|
|
1086
|
+
return l2 && s ? u3(n2, "active-selected") : s ? u3(n2, "selected") : u3(n2, l2 ? "active" : "inactive");
|
|
1087
|
+
};
|
|
1088
|
+
switch (this.state) {
|
|
1089
|
+
case "submit": {
|
|
1090
|
+
const n2 = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u3(s, "submitted")).join(styleText2("dim", ", ")) || styleText2("dim", "none"), l2 = wrapTextWithPrefix(
|
|
1091
|
+
i2.output,
|
|
1092
|
+
n2,
|
|
1093
|
+
t2 ? `${styleText2("gray", S_BAR)} ` : ""
|
|
1094
|
+
);
|
|
1095
|
+
return `${r2}${l2}`;
|
|
1096
|
+
}
|
|
1097
|
+
case "cancel": {
|
|
1098
|
+
const n2 = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u3(s, "cancelled")).join(styleText2("dim", ", "));
|
|
1099
|
+
if (n2.trim() === "")
|
|
1100
|
+
return `${r2}${styleText2("gray", S_BAR)}`;
|
|
1101
|
+
const l2 = wrapTextWithPrefix(
|
|
1102
|
+
i2.output,
|
|
1103
|
+
n2,
|
|
1104
|
+
t2 ? `${styleText2("gray", S_BAR)} ` : ""
|
|
1105
|
+
);
|
|
1106
|
+
return `${r2}${l2}${t2 ? `
|
|
1107
|
+
${styleText2("gray", S_BAR)}` : ""}`;
|
|
1108
|
+
}
|
|
1109
|
+
case "error": {
|
|
1110
|
+
const n2 = t2 ? `${styleText2("yellow", S_BAR)} ` : "", l2 = this.error.split(`
|
|
1111
|
+
`).map(
|
|
1112
|
+
($, C2) => C2 === 0 ? `${t2 ? `${styleText2("yellow", S_BAR_END)} ` : ""}${styleText2("yellow", $)}` : ` ${$}`
|
|
1113
|
+
).join(`
|
|
1114
|
+
`), s = r2.split(`
|
|
1115
|
+
`).length, h2 = l2.split(`
|
|
1116
|
+
`).length + 1;
|
|
1117
|
+
return `${r2}${n2}${limitOptions({
|
|
1118
|
+
output: i2.output,
|
|
1119
|
+
options: this.options,
|
|
1120
|
+
cursor: this.cursor,
|
|
1121
|
+
maxItems: i2.maxItems,
|
|
1122
|
+
columnPadding: n2.length,
|
|
1123
|
+
rowPadding: s + h2,
|
|
1124
|
+
style: p
|
|
1125
|
+
}).join(`
|
|
1126
|
+
${n2}`)}
|
|
1127
|
+
${l2}
|
|
1128
|
+
`;
|
|
1129
|
+
}
|
|
1130
|
+
default: {
|
|
1131
|
+
const n2 = t2 ? `${styleText2("cyan", S_BAR)} ` : "", l2 = r2.split(`
|
|
1132
|
+
`).length, s = v ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, t2) : t2 ? [styleText2("cyan", S_BAR_END)] : [], h2 = s.join(`
|
|
1133
|
+
`), $ = s.length + 1;
|
|
1134
|
+
return `${r2}${n2}${limitOptions({
|
|
1135
|
+
output: i2.output,
|
|
1136
|
+
options: this.options,
|
|
1137
|
+
cursor: this.cursor,
|
|
1138
|
+
maxItems: i2.maxItems,
|
|
1139
|
+
columnPadding: n2.length,
|
|
1140
|
+
rowPadding: l2 + $,
|
|
1141
|
+
style: p
|
|
1142
|
+
}).join(`
|
|
1143
|
+
${n2}`)}
|
|
1144
|
+
${h2}
|
|
883
1145
|
`;
|
|
1146
|
+
}
|
|
884
1147
|
}
|
|
885
1148
|
}
|
|
886
|
-
}
|
|
1149
|
+
}).prompt();
|
|
887
1150
|
};
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
1151
|
+
log = {
|
|
1152
|
+
message: (s = [], {
|
|
1153
|
+
symbol: e = styleText2("gray", S_BAR),
|
|
1154
|
+
secondarySymbol: r2 = styleText2("gray", S_BAR),
|
|
1155
|
+
output: m2 = process.stdout,
|
|
1156
|
+
spacing: l2 = 1,
|
|
1157
|
+
withGuide: c
|
|
1158
|
+
} = {}) => {
|
|
1159
|
+
const t2 = [], o = c ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
|
|
1160
|
+
for (let i2 = 0; i2 < l2; i2++)
|
|
1161
|
+
t2.push(f);
|
|
1162
|
+
const g = Array.isArray(s) ? s : s.split(`
|
|
892
1163
|
`);
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
1164
|
+
if (g.length > 0) {
|
|
1165
|
+
const [i2, ...y2] = g;
|
|
1166
|
+
i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
|
|
1167
|
+
for (const p of y2)
|
|
1168
|
+
p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
|
|
1169
|
+
}
|
|
1170
|
+
m2.write(`${t2.join(`
|
|
899
1171
|
`)}
|
|
900
1172
|
`);
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
1173
|
+
},
|
|
1174
|
+
info: (s, e) => {
|
|
1175
|
+
log.message(s, { ...e, symbol: styleText2("blue", S_INFO) });
|
|
1176
|
+
},
|
|
1177
|
+
success: (s, e) => {
|
|
1178
|
+
log.message(s, { ...e, symbol: styleText2("green", S_SUCCESS) });
|
|
1179
|
+
},
|
|
1180
|
+
step: (s, e) => {
|
|
1181
|
+
log.message(s, { ...e, symbol: styleText2("green", S_STEP_SUBMIT) });
|
|
1182
|
+
},
|
|
1183
|
+
warn: (s, e) => {
|
|
1184
|
+
log.message(s, { ...e, symbol: styleText2("yellow", S_WARN) });
|
|
1185
|
+
},
|
|
1186
|
+
/** alias for `log.warn()`. */
|
|
1187
|
+
warning: (s, e) => {
|
|
1188
|
+
log.warn(s, e);
|
|
1189
|
+
},
|
|
1190
|
+
error: (s, e) => {
|
|
1191
|
+
log.message(s, { ...e, symbol: styleText2("red", S_ERROR) });
|
|
1192
|
+
}
|
|
1193
|
+
};
|
|
1194
|
+
cancel = (o = "", t2) => {
|
|
1195
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_END)} ` : "";
|
|
1196
|
+
i2.write(`${e}${styleText2("red", o)}
|
|
917
1197
|
|
|
918
1198
|
`);
|
|
919
1199
|
};
|
|
920
|
-
|
|
921
|
-
const
|
|
922
|
-
|
|
1200
|
+
intro = (o = "", t2) => {
|
|
1201
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_START)} ` : "";
|
|
1202
|
+
i2.write(`${e}${o}
|
|
923
1203
|
`);
|
|
924
1204
|
};
|
|
925
|
-
|
|
926
|
-
const
|
|
927
|
-
${
|
|
928
|
-
|
|
1205
|
+
outro = (o = "", t2) => {
|
|
1206
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR)}
|
|
1207
|
+
${styleText2("gray", S_BAR_END)} ` : "";
|
|
1208
|
+
i2.write(`${e}${o}
|
|
929
1209
|
|
|
930
1210
|
`);
|
|
931
1211
|
};
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
case "error": {
|
|
964
|
-
const a = r ? `${t("yellow", d2)} ` : "", l = this.error.split(`
|
|
965
|
-
`).map((p2, m) => m === 0 ? `${r ? `${t("yellow", E2)} ` : ""}${t("yellow", p2)}` : ` ${p2}`).join(`
|
|
966
|
-
`), $2 = n.split(`
|
|
967
|
-
`).length, y2 = l.split(`
|
|
968
|
-
`).length + 1;
|
|
969
|
-
return `${n}${a}${Y2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: a.length, rowPadding: $2 + y2, style: c2 }).join(`
|
|
970
|
-
${a}`)}
|
|
971
|
-
${l}
|
|
972
|
-
`;
|
|
973
|
-
}
|
|
974
|
-
default: {
|
|
975
|
-
const a = r ? `${t("cyan", d2)} ` : "", l = n.split(`
|
|
976
|
-
`).length, $2 = r ? 2 : 1;
|
|
977
|
-
return `${n}${a}${Y2({ output: e.output, options: this.options, cursor: this.cursor, maxItems: e.maxItems, columnPadding: a.length, rowPadding: l + $2, style: c2 }).join(`
|
|
978
|
-
${a}`)}
|
|
979
|
-
${r ? t("cyan", E2) : ""}
|
|
980
|
-
`;
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
} }).prompt();
|
|
984
|
-
};
|
|
985
|
-
ft = (e) => t("dim", e);
|
|
986
|
-
vt = (e, i, s) => {
|
|
987
|
-
const r = { hard: true, trim: false }, u2 = wrapAnsi(e, i, r).split(`
|
|
988
|
-
`), n = u2.reduce((a, l) => Math.max(dist_default2(l), a), 0), o = u2.map(s).reduce((a, l) => Math.max(dist_default2(l), a), 0), c2 = i - (o - n);
|
|
989
|
-
return wrapAnsi(e, c2, r);
|
|
990
|
-
};
|
|
991
|
-
wt = (e = "", i = "", s) => {
|
|
992
|
-
const r = s?.output ?? P2.stdout, u2 = s?.withGuide ?? u.withGuide, n = s?.format ?? ft, o = ["", ...vt(e, O(r) - 6, n).split(`
|
|
993
|
-
`).map(n), ""], c2 = dist_default2(i), a = Math.max(o.reduce((p2, m) => {
|
|
994
|
-
const g = dist_default2(m);
|
|
995
|
-
return g > p2 ? g : p2;
|
|
996
|
-
}, 0), c2) + 2, l = o.map((p2) => `${t("gray", d2)} ${p2}${" ".repeat(a - dist_default2(p2))}${t("gray", d2)}`).join(`
|
|
997
|
-
`), $2 = u2 ? `${t("gray", d2)}
|
|
998
|
-
` : "", y2 = u2 ? Ge : de;
|
|
999
|
-
r.write(`${$2}${t("green", F)} ${t("reset", i)} ${t("gray", se.repeat(Math.max(a - c2 - 1, 1)) + ce)}
|
|
1000
|
-
${l}
|
|
1001
|
-
${t("gray", y2 + se.repeat(a + 2) + $e)}
|
|
1002
|
-
`);
|
|
1212
|
+
W$1 = (o) => o;
|
|
1213
|
+
C = (o, e, s) => {
|
|
1214
|
+
const a2 = {
|
|
1215
|
+
hard: true,
|
|
1216
|
+
trim: false
|
|
1217
|
+
}, i2 = wrapAnsi(o, e, a2).split(`
|
|
1218
|
+
`), c = i2.reduce((n2, t2) => Math.max(dist_default2(t2), n2), 0), u3 = i2.map(s).reduce((n2, t2) => Math.max(dist_default2(t2), n2), 0), g = e - (u3 - c);
|
|
1219
|
+
return wrapAnsi(o, g, a2);
|
|
1220
|
+
};
|
|
1221
|
+
note = (o = "", e = "", s) => {
|
|
1222
|
+
const a2 = s?.output ?? process$1.stdout, i2 = s?.withGuide ?? settings.withGuide, c = s?.format ?? W$1, g = ["", ...C(o, getColumns(a2) - 6, c).split(`
|
|
1223
|
+
`).map(c), ""], n2 = dist_default2(e), t2 = Math.max(
|
|
1224
|
+
g.reduce((m2, F) => {
|
|
1225
|
+
const O = dist_default2(F);
|
|
1226
|
+
return O > m2 ? O : m2;
|
|
1227
|
+
}, 0),
|
|
1228
|
+
n2
|
|
1229
|
+
) + 2, h2 = g.map(
|
|
1230
|
+
(m2) => `${styleText2("gray", S_BAR)} ${m2}${" ".repeat(t2 - dist_default2(m2))}${styleText2("gray", S_BAR)}`
|
|
1231
|
+
).join(`
|
|
1232
|
+
`), T = i2 ? `${styleText2("gray", S_BAR)}
|
|
1233
|
+
` : "", l$1 = i2 ? S_CONNECT_LEFT : S_CORNER_BOTTOM_LEFT;
|
|
1234
|
+
a2.write(
|
|
1235
|
+
`${T}${styleText2("green", S_STEP_SUBMIT)} ${styleText2("reset", e)} ${styleText2(
|
|
1236
|
+
"gray",
|
|
1237
|
+
S_BAR_H.repeat(Math.max(t2 - n2 - 1, 1)) + S_CORNER_TOP_RIGHT
|
|
1238
|
+
)}
|
|
1239
|
+
${h2}
|
|
1240
|
+
${styleText2("gray", l$1 + S_BAR_H.repeat(t2 + 2) + S_CORNER_BOTTOM_RIGHT)}
|
|
1241
|
+
`
|
|
1242
|
+
);
|
|
1003
1243
|
};
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1244
|
+
W = (l2) => styleText2("magenta", l2);
|
|
1245
|
+
spinner = ({
|
|
1246
|
+
indicator: l2 = "dots",
|
|
1247
|
+
onCancel: h2,
|
|
1248
|
+
output: n2 = process.stdout,
|
|
1249
|
+
cancelMessage: G,
|
|
1250
|
+
errorMessage: O,
|
|
1251
|
+
frames: E = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
|
|
1252
|
+
delay: F = unicode ? 80 : 120,
|
|
1253
|
+
signal: m2,
|
|
1254
|
+
...I2
|
|
1255
|
+
} = {}) => {
|
|
1256
|
+
const u3 = isCI();
|
|
1257
|
+
let M, T, d = false, S = false, s = "", p, w = performance.now();
|
|
1258
|
+
const x = getColumns(n2), k = I2?.styleFrame ?? W, g = (e) => {
|
|
1259
|
+
const r2 = e > 1 ? O ?? settings.messages.error : G ?? settings.messages.cancel;
|
|
1260
|
+
S = e === 1, d && (a2(r2, e), S && typeof h2 == "function" && h2());
|
|
1261
|
+
}, f = () => g(2), i2 = () => g(1), A = () => {
|
|
1262
|
+
process.on("uncaughtExceptionMonitor", f), process.on("unhandledRejection", f), process.on("SIGINT", i2), process.on("SIGTERM", i2), process.on("exit", g), m2 && m2.addEventListener("abort", i2);
|
|
1263
|
+
}, H = () => {
|
|
1264
|
+
process.removeListener("uncaughtExceptionMonitor", f), process.removeListener("unhandledRejection", f), process.removeListener("SIGINT", i2), process.removeListener("SIGTERM", i2), process.removeListener("exit", g), m2 && m2.removeEventListener("abort", i2);
|
|
1265
|
+
}, y2 = () => {
|
|
1266
|
+
if (p === void 0) return;
|
|
1267
|
+
u3 && n2.write(`
|
|
1018
1268
|
`);
|
|
1019
|
-
const
|
|
1269
|
+
const r2 = wrapAnsi(p, x, {
|
|
1270
|
+
hard: true,
|
|
1271
|
+
trim: false
|
|
1272
|
+
}).split(`
|
|
1020
1273
|
`);
|
|
1021
|
-
|
|
1022
|
-
},
|
|
1023
|
-
const
|
|
1024
|
-
return
|
|
1025
|
-
},
|
|
1026
|
-
|
|
1274
|
+
r2.length > 1 && n2.write(import_sisteransi2.cursor.up(r2.length - 1)), n2.write(import_sisteransi2.cursor.to(0)), n2.write(import_sisteransi2.erase.down());
|
|
1275
|
+
}, C2 = (e) => e.replace(/\.+$/, ""), _ = (e) => {
|
|
1276
|
+
const r2 = (performance.now() - e) / 1e3, t2 = Math.floor(r2 / 60), o = Math.floor(r2 % 60);
|
|
1277
|
+
return t2 > 0 ? `[${t2}m ${o}s]` : `[${o}s]`;
|
|
1278
|
+
}, N = I2.withGuide ?? settings.withGuide, P = (e = "") => {
|
|
1279
|
+
d = true, M = block({ output: n2 }), s = C2(e), w = performance.now(), N && n2.write(`${styleText2("gray", S_BAR)}
|
|
1027
1280
|
`);
|
|
1028
|
-
let
|
|
1029
|
-
|
|
1030
|
-
if (
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1281
|
+
let r2 = 0, t2 = 0;
|
|
1282
|
+
A(), T = setInterval(() => {
|
|
1283
|
+
if (u3 && s === p)
|
|
1284
|
+
return;
|
|
1285
|
+
y2(), p = s;
|
|
1286
|
+
const o = k(E[r2]);
|
|
1287
|
+
let v;
|
|
1288
|
+
if (u3)
|
|
1289
|
+
v = `${o} ${s}...`;
|
|
1290
|
+
else if (l2 === "timer")
|
|
1291
|
+
v = `${o} ${s} ${_(w)}`;
|
|
1036
1292
|
else {
|
|
1037
|
-
const
|
|
1038
|
-
|
|
1039
|
-
}
|
|
1040
|
-
const
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1293
|
+
const B = ".".repeat(Math.floor(t2)).slice(0, 3);
|
|
1294
|
+
v = `${o} ${s}${B}`;
|
|
1295
|
+
}
|
|
1296
|
+
const j = wrapAnsi(v, x, {
|
|
1297
|
+
hard: true,
|
|
1298
|
+
trim: false
|
|
1299
|
+
});
|
|
1300
|
+
n2.write(j), r2 = r2 + 1 < E.length ? r2 + 1 : 0, t2 = t2 < 4 ? t2 + 0.125 : 0;
|
|
1301
|
+
}, F);
|
|
1302
|
+
}, a2 = (e = "", r2 = 0, t2 = false) => {
|
|
1303
|
+
if (!d) return;
|
|
1304
|
+
d = false, clearInterval(T), y2();
|
|
1305
|
+
const o = r2 === 0 ? styleText2("green", S_STEP_SUBMIT) : r2 === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
|
|
1306
|
+
s = e ?? s, t2 || (l2 === "timer" ? n2.write(`${o} ${s} ${_(w)}
|
|
1307
|
+
`) : n2.write(`${o} ${s}
|
|
1308
|
+
`)), H(), M();
|
|
1309
|
+
};
|
|
1310
|
+
return {
|
|
1311
|
+
start: P,
|
|
1312
|
+
stop: (e = "") => a2(e, 0),
|
|
1313
|
+
message: (e = "") => {
|
|
1314
|
+
s = C2(e ?? s);
|
|
1315
|
+
},
|
|
1316
|
+
cancel: (e = "") => a2(e, 1),
|
|
1317
|
+
error: (e = "") => a2(e, 2),
|
|
1318
|
+
clear: () => a2("", 0, true),
|
|
1319
|
+
get isCancelled() {
|
|
1320
|
+
return S;
|
|
1321
|
+
}
|
|
1050
1322
|
};
|
|
1051
|
-
return { start: ie, stop: (_2 = "") => W(_2, 0), message: (_2 = "") => {
|
|
1052
|
-
g = R2(_2 ?? g);
|
|
1053
|
-
}, cancel: (_2 = "") => W(_2, 1), error: (_2 = "") => W(_2, 2), clear: () => W("", 0, true), get isCancelled() {
|
|
1054
|
-
return m;
|
|
1055
|
-
} };
|
|
1056
1323
|
};
|
|
1057
|
-
|
|
1058
|
-
|
|
1324
|
+
u2 = {
|
|
1325
|
+
light: unicodeOr("\u2500", "-"),
|
|
1326
|
+
heavy: unicodeOr("\u2501", "="),
|
|
1327
|
+
block: unicodeOr("\u2588", "#")
|
|
1328
|
+
};
|
|
1329
|
+
SELECT_INSTRUCTIONS = [
|
|
1330
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
1331
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
1332
|
+
];
|
|
1333
|
+
i = `${styleText2("gray", S_BAR)} `;
|
|
1059
1334
|
}
|
|
1060
1335
|
});
|
|
1061
1336
|
|
|
@@ -1068,9 +1343,9 @@ function supportsColor() {
|
|
|
1068
1343
|
}
|
|
1069
1344
|
return process.stdout.isTTY === true;
|
|
1070
1345
|
}
|
|
1071
|
-
function colorize(
|
|
1072
|
-
if (!supportsColor()) return
|
|
1073
|
-
return `${color}${
|
|
1346
|
+
function colorize(text2, color) {
|
|
1347
|
+
if (!supportsColor()) return text2;
|
|
1348
|
+
return `${color}${text2}${colors.reset}`;
|
|
1074
1349
|
}
|
|
1075
1350
|
function stringify(value) {
|
|
1076
1351
|
if (typeof value === "string") return value;
|
|
@@ -1100,7 +1375,7 @@ function stringify(value) {
|
|
|
1100
1375
|
function formatMessage(...args) {
|
|
1101
1376
|
return args.map(stringify).join(" ");
|
|
1102
1377
|
}
|
|
1103
|
-
var colors, currentLogLevel,
|
|
1378
|
+
var colors, currentLogLevel, log2, error, warn, info, success;
|
|
1104
1379
|
var init_cli_output = __esm({
|
|
1105
1380
|
"packages/tooling/src/utils/cli-output.ts"() {
|
|
1106
1381
|
"use strict";
|
|
@@ -1133,7 +1408,7 @@ var init_cli_output = __esm({
|
|
|
1133
1408
|
currentLogLevel = envLevel;
|
|
1134
1409
|
}
|
|
1135
1410
|
}
|
|
1136
|
-
|
|
1411
|
+
log2 = {
|
|
1137
1412
|
/**
|
|
1138
1413
|
* Logs an error message (always shows unless Quiet level)
|
|
1139
1414
|
* Uses clack's log.error + explicit red color
|
|
@@ -1141,7 +1416,7 @@ var init_cli_output = __esm({
|
|
|
1141
1416
|
error(...args) {
|
|
1142
1417
|
if (currentLogLevel < 0 /* Quiet */) return;
|
|
1143
1418
|
const message = formatMessage(...args);
|
|
1144
|
-
|
|
1419
|
+
log.error(colorize(message, colors.brightRed));
|
|
1145
1420
|
},
|
|
1146
1421
|
/**
|
|
1147
1422
|
* Logs a warning message (shows at Normal level and above)
|
|
@@ -1150,7 +1425,7 @@ var init_cli_output = __esm({
|
|
|
1150
1425
|
warn(...args) {
|
|
1151
1426
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
1152
1427
|
const message = formatMessage(...args);
|
|
1153
|
-
|
|
1428
|
+
log.warn(colorize(message, colors.brightYellow));
|
|
1154
1429
|
},
|
|
1155
1430
|
/**
|
|
1156
1431
|
* Logs an info message (shows at Normal level and above)
|
|
@@ -1159,7 +1434,7 @@ var init_cli_output = __esm({
|
|
|
1159
1434
|
info(...args) {
|
|
1160
1435
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
1161
1436
|
const message = formatMessage(...args);
|
|
1162
|
-
|
|
1437
|
+
log.info(colorize(message, colors.brightCyan));
|
|
1163
1438
|
},
|
|
1164
1439
|
/**
|
|
1165
1440
|
* Logs a success message (shows at Normal level and above)
|
|
@@ -1168,7 +1443,7 @@ var init_cli_output = __esm({
|
|
|
1168
1443
|
success(...args) {
|
|
1169
1444
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
1170
1445
|
const message = formatMessage(...args);
|
|
1171
|
-
|
|
1446
|
+
log.success(colorize(message, colors.brightGreen));
|
|
1172
1447
|
},
|
|
1173
1448
|
/**
|
|
1174
1449
|
* Logs a debug message (only shows at Verbose level and above)
|
|
@@ -1177,7 +1452,7 @@ var init_cli_output = __esm({
|
|
|
1177
1452
|
debug(...args) {
|
|
1178
1453
|
if (currentLogLevel < 2 /* Verbose */) return;
|
|
1179
1454
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
1180
|
-
|
|
1455
|
+
log.message(
|
|
1181
1456
|
colorize(
|
|
1182
1457
|
`[${timeStamp}] \u{1F50D} DEBUG: ${formatMessage(...args)}`,
|
|
1183
1458
|
colors.gray
|
|
@@ -1191,7 +1466,7 @@ var init_cli_output = __esm({
|
|
|
1191
1466
|
trace(...args) {
|
|
1192
1467
|
if (currentLogLevel < 3 /* Debug */) return;
|
|
1193
1468
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
1194
|
-
|
|
1469
|
+
log.message(
|
|
1195
1470
|
colorize(
|
|
1196
1471
|
`[${timeStamp}] \u{1F52C} TRACE: ${formatMessage(...args)}`,
|
|
1197
1472
|
colors.gray
|
|
@@ -1199,10 +1474,10 @@ var init_cli_output = __esm({
|
|
|
1199
1474
|
);
|
|
1200
1475
|
}
|
|
1201
1476
|
};
|
|
1202
|
-
error =
|
|
1203
|
-
warn =
|
|
1204
|
-
info =
|
|
1205
|
-
success =
|
|
1477
|
+
error = log2.error.bind(log2);
|
|
1478
|
+
warn = log2.warn.bind(log2);
|
|
1479
|
+
info = log2.info.bind(log2);
|
|
1480
|
+
success = log2.success.bind(log2);
|
|
1206
1481
|
}
|
|
1207
1482
|
});
|
|
1208
1483
|
|
|
@@ -1562,9 +1837,9 @@ var require_is_glob = __commonJS({
|
|
|
1562
1837
|
index += 2;
|
|
1563
1838
|
var close = chars[open];
|
|
1564
1839
|
if (close) {
|
|
1565
|
-
var
|
|
1566
|
-
if (
|
|
1567
|
-
index =
|
|
1840
|
+
var n2 = str.indexOf(close, index);
|
|
1841
|
+
if (n2 !== -1) {
|
|
1842
|
+
index = n2 + 1;
|
|
1568
1843
|
}
|
|
1569
1844
|
}
|
|
1570
1845
|
if (str[index] === "!") {
|
|
@@ -1590,9 +1865,9 @@ var require_is_glob = __commonJS({
|
|
|
1590
1865
|
index += 2;
|
|
1591
1866
|
var close = chars[open];
|
|
1592
1867
|
if (close) {
|
|
1593
|
-
var
|
|
1594
|
-
if (
|
|
1595
|
-
index =
|
|
1868
|
+
var n2 = str.indexOf(close, index);
|
|
1869
|
+
if (n2 !== -1) {
|
|
1870
|
+
index = n2 + 1;
|
|
1596
1871
|
}
|
|
1597
1872
|
}
|
|
1598
1873
|
if (str[index] === "!") {
|
|
@@ -1670,8 +1945,8 @@ var require_utils = __commonJS({
|
|
|
1670
1945
|
if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
|
|
1671
1946
|
return (Number(max) - Number(min)) / Number(step) >= limit;
|
|
1672
1947
|
};
|
|
1673
|
-
exports.escapeNode = (
|
|
1674
|
-
const node =
|
|
1948
|
+
exports.escapeNode = (block2, n2 = 0, type) => {
|
|
1949
|
+
const node = block2.nodes[n2];
|
|
1675
1950
|
if (!node) return;
|
|
1676
1951
|
if (type && node.type === type || node.type === "open" || node.type === "close") {
|
|
1677
1952
|
if (node.escaped !== true) {
|
|
@@ -1688,15 +1963,15 @@ var require_utils = __commonJS({
|
|
|
1688
1963
|
}
|
|
1689
1964
|
return false;
|
|
1690
1965
|
};
|
|
1691
|
-
exports.isInvalidBrace = (
|
|
1692
|
-
if (
|
|
1693
|
-
if (
|
|
1694
|
-
if (
|
|
1695
|
-
|
|
1966
|
+
exports.isInvalidBrace = (block2) => {
|
|
1967
|
+
if (block2.type !== "brace") return false;
|
|
1968
|
+
if (block2.invalid === true || block2.dollar) return true;
|
|
1969
|
+
if (block2.commas >> 0 + block2.ranges >> 0 === 0) {
|
|
1970
|
+
block2.invalid = true;
|
|
1696
1971
|
return true;
|
|
1697
1972
|
}
|
|
1698
|
-
if (
|
|
1699
|
-
|
|
1973
|
+
if (block2.open !== true || block2.close !== true) {
|
|
1974
|
+
block2.invalid = true;
|
|
1700
1975
|
return true;
|
|
1701
1976
|
}
|
|
1702
1977
|
return false;
|
|
@@ -1715,8 +1990,8 @@ var require_utils = __commonJS({
|
|
|
1715
1990
|
exports.flatten = (...args) => {
|
|
1716
1991
|
const result = [];
|
|
1717
1992
|
const flat = (arr) => {
|
|
1718
|
-
for (let
|
|
1719
|
-
const ele = arr[
|
|
1993
|
+
for (let i2 = 0; i2 < arr.length; i2++) {
|
|
1994
|
+
const ele = arr[i2];
|
|
1720
1995
|
if (Array.isArray(ele)) {
|
|
1721
1996
|
flat(ele);
|
|
1722
1997
|
continue;
|
|
@@ -1810,9 +2085,9 @@ var require_to_regex_range = __commonJS({
|
|
|
1810
2085
|
if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
|
|
1811
2086
|
return toRegexRange.cache[cacheKey].result;
|
|
1812
2087
|
}
|
|
1813
|
-
let
|
|
2088
|
+
let a2 = Math.min(min, max);
|
|
1814
2089
|
let b = Math.max(min, max);
|
|
1815
|
-
if (Math.abs(
|
|
2090
|
+
if (Math.abs(a2 - b) === 1) {
|
|
1816
2091
|
let result = min + "|" + max;
|
|
1817
2092
|
if (opts.capture) {
|
|
1818
2093
|
return `(${result})`;
|
|
@@ -1823,20 +2098,20 @@ var require_to_regex_range = __commonJS({
|
|
|
1823
2098
|
return `(?:${result})`;
|
|
1824
2099
|
}
|
|
1825
2100
|
let isPadded = hasPadding(min) || hasPadding(max);
|
|
1826
|
-
let state = { min, max, a, b };
|
|
2101
|
+
let state = { min, max, a: a2, b };
|
|
1827
2102
|
let positives = [];
|
|
1828
2103
|
let negatives = [];
|
|
1829
2104
|
if (isPadded) {
|
|
1830
2105
|
state.isPadded = isPadded;
|
|
1831
2106
|
state.maxLen = String(state.max).length;
|
|
1832
2107
|
}
|
|
1833
|
-
if (
|
|
2108
|
+
if (a2 < 0) {
|
|
1834
2109
|
let newMin = b < 0 ? Math.abs(b) : 1;
|
|
1835
|
-
negatives = splitToPatterns(newMin, Math.abs(
|
|
1836
|
-
|
|
2110
|
+
negatives = splitToPatterns(newMin, Math.abs(a2), state, opts);
|
|
2111
|
+
a2 = state.a = 0;
|
|
1837
2112
|
}
|
|
1838
2113
|
if (b >= 0) {
|
|
1839
|
-
positives = splitToPatterns(
|
|
2114
|
+
positives = splitToPatterns(a2, b, state, opts);
|
|
1840
2115
|
}
|
|
1841
2116
|
state.negatives = negatives;
|
|
1842
2117
|
state.positives = positives;
|
|
@@ -1884,8 +2159,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1884
2159
|
let digits = zipped.length;
|
|
1885
2160
|
let pattern = "";
|
|
1886
2161
|
let count = 0;
|
|
1887
|
-
for (let
|
|
1888
|
-
let [startDigit, stopDigit] = zipped[
|
|
2162
|
+
for (let i2 = 0; i2 < digits; i2++) {
|
|
2163
|
+
let [startDigit, stopDigit] = zipped[i2];
|
|
1889
2164
|
if (startDigit === stopDigit) {
|
|
1890
2165
|
pattern += startDigit;
|
|
1891
2166
|
} else if (startDigit !== "0" || stopDigit !== "9") {
|
|
@@ -1904,8 +2179,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1904
2179
|
let tokens = [];
|
|
1905
2180
|
let start = min;
|
|
1906
2181
|
let prev;
|
|
1907
|
-
for (let
|
|
1908
|
-
let max2 = ranges[
|
|
2182
|
+
for (let i2 = 0; i2 < ranges.length; i2++) {
|
|
2183
|
+
let max2 = ranges[i2];
|
|
1909
2184
|
let obj = rangeToPattern(String(start), String(max2), options);
|
|
1910
2185
|
let zeros = "";
|
|
1911
2186
|
if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
|
|
@@ -1940,13 +2215,13 @@ var require_to_regex_range = __commonJS({
|
|
|
1940
2215
|
}
|
|
1941
2216
|
return result;
|
|
1942
2217
|
}
|
|
1943
|
-
function zip(
|
|
2218
|
+
function zip(a2, b) {
|
|
1944
2219
|
let arr = [];
|
|
1945
|
-
for (let
|
|
2220
|
+
for (let i2 = 0; i2 < a2.length; i2++) arr.push([a2[i2], b[i2]]);
|
|
1946
2221
|
return arr;
|
|
1947
2222
|
}
|
|
1948
|
-
function compare(
|
|
1949
|
-
return
|
|
2223
|
+
function compare(a2, b) {
|
|
2224
|
+
return a2 > b ? 1 : b > a2 ? -1 : 0;
|
|
1950
2225
|
}
|
|
1951
2226
|
function contains(arr, key, val) {
|
|
1952
2227
|
return arr.some((ele) => ele[key] === val);
|
|
@@ -1964,8 +2239,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1964
2239
|
}
|
|
1965
2240
|
return "";
|
|
1966
2241
|
}
|
|
1967
|
-
function toCharacterClass(
|
|
1968
|
-
return `[${
|
|
2242
|
+
function toCharacterClass(a2, b, options) {
|
|
2243
|
+
return `[${a2}${b - a2 === 1 ? "" : "-"}${b}]`;
|
|
1969
2244
|
}
|
|
1970
2245
|
function hasPadding(str) {
|
|
1971
2246
|
return /^-?(0+)\d/.test(str);
|
|
@@ -2044,8 +2319,8 @@ var require_fill_range = __commonJS({
|
|
|
2044
2319
|
return negative ? "-" + input : input;
|
|
2045
2320
|
};
|
|
2046
2321
|
var toSequence = (parts, options, maxLen) => {
|
|
2047
|
-
parts.negatives.sort((
|
|
2048
|
-
parts.positives.sort((
|
|
2322
|
+
parts.negatives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
2323
|
+
parts.positives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
2049
2324
|
let prefix = options.capture ? "" : "?:";
|
|
2050
2325
|
let positives = "";
|
|
2051
2326
|
let negatives = "";
|
|
@@ -2066,12 +2341,12 @@ var require_fill_range = __commonJS({
|
|
|
2066
2341
|
}
|
|
2067
2342
|
return result;
|
|
2068
2343
|
};
|
|
2069
|
-
var toRange = (
|
|
2344
|
+
var toRange = (a2, b, isNumbers, options) => {
|
|
2070
2345
|
if (isNumbers) {
|
|
2071
|
-
return toRegexRange(
|
|
2346
|
+
return toRegexRange(a2, b, { wrap: false, ...options });
|
|
2072
2347
|
}
|
|
2073
|
-
let start = String.fromCharCode(
|
|
2074
|
-
if (
|
|
2348
|
+
let start = String.fromCharCode(a2);
|
|
2349
|
+
if (a2 === b) return start;
|
|
2075
2350
|
let stop = String.fromCharCode(b);
|
|
2076
2351
|
return `[${start}-${stop}]`;
|
|
2077
2352
|
};
|
|
@@ -2097,15 +2372,15 @@ var require_fill_range = __commonJS({
|
|
|
2097
2372
|
return [];
|
|
2098
2373
|
};
|
|
2099
2374
|
var fillNumbers = (start, end, step = 1, options = {}) => {
|
|
2100
|
-
let
|
|
2375
|
+
let a2 = Number(start);
|
|
2101
2376
|
let b = Number(end);
|
|
2102
|
-
if (!Number.isInteger(
|
|
2377
|
+
if (!Number.isInteger(a2) || !Number.isInteger(b)) {
|
|
2103
2378
|
if (options.strictRanges === true) throw rangeError([start, end]);
|
|
2104
2379
|
return [];
|
|
2105
2380
|
}
|
|
2106
|
-
if (
|
|
2381
|
+
if (a2 === 0) a2 = 0;
|
|
2107
2382
|
if (b === 0) b = 0;
|
|
2108
|
-
let descending =
|
|
2383
|
+
let descending = a2 > b;
|
|
2109
2384
|
let startString = String(start);
|
|
2110
2385
|
let endString = String(end);
|
|
2111
2386
|
let stepString = String(step);
|
|
@@ -2121,13 +2396,13 @@ var require_fill_range = __commonJS({
|
|
|
2121
2396
|
let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
|
|
2122
2397
|
let range = [];
|
|
2123
2398
|
let index = 0;
|
|
2124
|
-
while (descending ?
|
|
2399
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
2125
2400
|
if (options.toRegex === true && step > 1) {
|
|
2126
|
-
push(
|
|
2401
|
+
push(a2);
|
|
2127
2402
|
} else {
|
|
2128
|
-
range.push(pad(format(
|
|
2403
|
+
range.push(pad(format(a2, index), maxLen, toNumber));
|
|
2129
2404
|
}
|
|
2130
|
-
|
|
2405
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
2131
2406
|
index++;
|
|
2132
2407
|
}
|
|
2133
2408
|
if (options.toRegex === true) {
|
|
@@ -2140,19 +2415,19 @@ var require_fill_range = __commonJS({
|
|
|
2140
2415
|
return invalidRange(start, end, options);
|
|
2141
2416
|
}
|
|
2142
2417
|
let format = options.transform || ((val) => String.fromCharCode(val));
|
|
2143
|
-
let
|
|
2418
|
+
let a2 = `${start}`.charCodeAt(0);
|
|
2144
2419
|
let b = `${end}`.charCodeAt(0);
|
|
2145
|
-
let descending =
|
|
2146
|
-
let min = Math.min(
|
|
2147
|
-
let max = Math.max(
|
|
2420
|
+
let descending = a2 > b;
|
|
2421
|
+
let min = Math.min(a2, b);
|
|
2422
|
+
let max = Math.max(a2, b);
|
|
2148
2423
|
if (options.toRegex && step === 1) {
|
|
2149
2424
|
return toRange(min, max, false, options);
|
|
2150
2425
|
}
|
|
2151
2426
|
let range = [];
|
|
2152
2427
|
let index = 0;
|
|
2153
|
-
while (descending ?
|
|
2154
|
-
range.push(format(
|
|
2155
|
-
|
|
2428
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
2429
|
+
range.push(format(a2, index));
|
|
2430
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
2156
2431
|
index++;
|
|
2157
2432
|
}
|
|
2158
2433
|
if (options.toRegex === true) {
|
|
@@ -2275,18 +2550,18 @@ var require_expand = __commonJS({
|
|
|
2275
2550
|
const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
|
|
2276
2551
|
const walk = (node, parent = {}) => {
|
|
2277
2552
|
node.queue = [];
|
|
2278
|
-
let
|
|
2279
|
-
let
|
|
2280
|
-
while (
|
|
2281
|
-
|
|
2282
|
-
|
|
2553
|
+
let p = parent;
|
|
2554
|
+
let q = parent.queue;
|
|
2555
|
+
while (p.type !== "brace" && p.type !== "root" && p.parent) {
|
|
2556
|
+
p = p.parent;
|
|
2557
|
+
q = p.queue;
|
|
2283
2558
|
}
|
|
2284
2559
|
if (node.invalid || node.dollar) {
|
|
2285
|
-
|
|
2560
|
+
q.push(append(q.pop(), stringify2(node, options)));
|
|
2286
2561
|
return;
|
|
2287
2562
|
}
|
|
2288
2563
|
if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
|
|
2289
|
-
|
|
2564
|
+
q.push(append(q.pop(), ["{}"]));
|
|
2290
2565
|
return;
|
|
2291
2566
|
}
|
|
2292
2567
|
if (node.nodes && node.ranges > 0) {
|
|
@@ -2298,26 +2573,26 @@ var require_expand = __commonJS({
|
|
|
2298
2573
|
if (range.length === 0) {
|
|
2299
2574
|
range = stringify2(node, options);
|
|
2300
2575
|
}
|
|
2301
|
-
|
|
2576
|
+
q.push(append(q.pop(), range));
|
|
2302
2577
|
node.nodes = [];
|
|
2303
2578
|
return;
|
|
2304
2579
|
}
|
|
2305
2580
|
const enclose = utils.encloseBrace(node);
|
|
2306
2581
|
let queue = node.queue;
|
|
2307
|
-
let
|
|
2308
|
-
while (
|
|
2309
|
-
|
|
2310
|
-
queue =
|
|
2582
|
+
let block2 = node;
|
|
2583
|
+
while (block2.type !== "brace" && block2.type !== "root" && block2.parent) {
|
|
2584
|
+
block2 = block2.parent;
|
|
2585
|
+
queue = block2.queue;
|
|
2311
2586
|
}
|
|
2312
|
-
for (let
|
|
2313
|
-
const child = node.nodes[
|
|
2587
|
+
for (let i2 = 0; i2 < node.nodes.length; i2++) {
|
|
2588
|
+
const child = node.nodes[i2];
|
|
2314
2589
|
if (child.type === "comma" && node.type === "brace") {
|
|
2315
|
-
if (
|
|
2590
|
+
if (i2 === 1) queue.push("");
|
|
2316
2591
|
queue.push("");
|
|
2317
2592
|
continue;
|
|
2318
2593
|
}
|
|
2319
2594
|
if (child.type === "close") {
|
|
2320
|
-
|
|
2595
|
+
q.push(append(q.pop(), queue, enclose));
|
|
2321
2596
|
continue;
|
|
2322
2597
|
}
|
|
2323
2598
|
if (child.value && child.type !== "open") {
|
|
@@ -2484,7 +2759,7 @@ var require_parse = __commonJS({
|
|
|
2484
2759
|
}
|
|
2485
2760
|
const ast = { type: "root", input, nodes: [] };
|
|
2486
2761
|
const stack = [ast];
|
|
2487
|
-
let
|
|
2762
|
+
let block2 = ast;
|
|
2488
2763
|
let prev = ast;
|
|
2489
2764
|
let brackets = 0;
|
|
2490
2765
|
const length = input.length;
|
|
@@ -2500,15 +2775,15 @@ var require_parse = __commonJS({
|
|
|
2500
2775
|
prev.value += node.value;
|
|
2501
2776
|
return;
|
|
2502
2777
|
}
|
|
2503
|
-
|
|
2504
|
-
node.parent =
|
|
2778
|
+
block2.nodes.push(node);
|
|
2779
|
+
node.parent = block2;
|
|
2505
2780
|
node.prev = prev;
|
|
2506
2781
|
prev = node;
|
|
2507
2782
|
return node;
|
|
2508
2783
|
};
|
|
2509
2784
|
push({ type: "bos" });
|
|
2510
2785
|
while (index < length) {
|
|
2511
|
-
|
|
2786
|
+
block2 = stack[stack.length - 1];
|
|
2512
2787
|
value = advance();
|
|
2513
2788
|
if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
|
|
2514
2789
|
continue;
|
|
@@ -2545,19 +2820,19 @@ var require_parse = __commonJS({
|
|
|
2545
2820
|
continue;
|
|
2546
2821
|
}
|
|
2547
2822
|
if (value === CHAR_LEFT_PARENTHESES) {
|
|
2548
|
-
|
|
2549
|
-
stack.push(
|
|
2823
|
+
block2 = push({ type: "paren", nodes: [] });
|
|
2824
|
+
stack.push(block2);
|
|
2550
2825
|
push({ type: "text", value });
|
|
2551
2826
|
continue;
|
|
2552
2827
|
}
|
|
2553
2828
|
if (value === CHAR_RIGHT_PARENTHESES) {
|
|
2554
|
-
if (
|
|
2829
|
+
if (block2.type !== "paren") {
|
|
2555
2830
|
push({ type: "text", value });
|
|
2556
2831
|
continue;
|
|
2557
2832
|
}
|
|
2558
|
-
|
|
2833
|
+
block2 = stack.pop();
|
|
2559
2834
|
push({ type: "text", value });
|
|
2560
|
-
|
|
2835
|
+
block2 = stack[stack.length - 1];
|
|
2561
2836
|
continue;
|
|
2562
2837
|
}
|
|
2563
2838
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
@@ -2582,7 +2857,7 @@ var require_parse = __commonJS({
|
|
|
2582
2857
|
}
|
|
2583
2858
|
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
2584
2859
|
depth++;
|
|
2585
|
-
const dollar = prev.value && prev.value.slice(-1) === "$" ||
|
|
2860
|
+
const dollar = prev.value && prev.value.slice(-1) === "$" || block2.dollar === true;
|
|
2586
2861
|
const brace = {
|
|
2587
2862
|
type: "brace",
|
|
2588
2863
|
open: true,
|
|
@@ -2593,52 +2868,52 @@ var require_parse = __commonJS({
|
|
|
2593
2868
|
ranges: 0,
|
|
2594
2869
|
nodes: []
|
|
2595
2870
|
};
|
|
2596
|
-
|
|
2597
|
-
stack.push(
|
|
2871
|
+
block2 = push(brace);
|
|
2872
|
+
stack.push(block2);
|
|
2598
2873
|
push({ type: "open", value });
|
|
2599
2874
|
continue;
|
|
2600
2875
|
}
|
|
2601
2876
|
if (value === CHAR_RIGHT_CURLY_BRACE) {
|
|
2602
|
-
if (
|
|
2877
|
+
if (block2.type !== "brace") {
|
|
2603
2878
|
push({ type: "text", value });
|
|
2604
2879
|
continue;
|
|
2605
2880
|
}
|
|
2606
2881
|
const type = "close";
|
|
2607
|
-
|
|
2608
|
-
|
|
2882
|
+
block2 = stack.pop();
|
|
2883
|
+
block2.close = true;
|
|
2609
2884
|
push({ type, value });
|
|
2610
2885
|
depth--;
|
|
2611
|
-
|
|
2886
|
+
block2 = stack[stack.length - 1];
|
|
2612
2887
|
continue;
|
|
2613
2888
|
}
|
|
2614
2889
|
if (value === CHAR_COMMA && depth > 0) {
|
|
2615
|
-
if (
|
|
2616
|
-
|
|
2617
|
-
const open =
|
|
2618
|
-
|
|
2890
|
+
if (block2.ranges > 0) {
|
|
2891
|
+
block2.ranges = 0;
|
|
2892
|
+
const open = block2.nodes.shift();
|
|
2893
|
+
block2.nodes = [open, { type: "text", value: stringify2(block2) }];
|
|
2619
2894
|
}
|
|
2620
2895
|
push({ type: "comma", value });
|
|
2621
|
-
|
|
2896
|
+
block2.commas++;
|
|
2622
2897
|
continue;
|
|
2623
2898
|
}
|
|
2624
|
-
if (value === CHAR_DOT && depth > 0 &&
|
|
2625
|
-
const siblings =
|
|
2899
|
+
if (value === CHAR_DOT && depth > 0 && block2.commas === 0) {
|
|
2900
|
+
const siblings = block2.nodes;
|
|
2626
2901
|
if (depth === 0 || siblings.length === 0) {
|
|
2627
2902
|
push({ type: "text", value });
|
|
2628
2903
|
continue;
|
|
2629
2904
|
}
|
|
2630
2905
|
if (prev.type === "dot") {
|
|
2631
|
-
|
|
2906
|
+
block2.range = [];
|
|
2632
2907
|
prev.value += value;
|
|
2633
2908
|
prev.type = "range";
|
|
2634
|
-
if (
|
|
2635
|
-
|
|
2636
|
-
|
|
2909
|
+
if (block2.nodes.length !== 3 && block2.nodes.length !== 5) {
|
|
2910
|
+
block2.invalid = true;
|
|
2911
|
+
block2.ranges = 0;
|
|
2637
2912
|
prev.type = "text";
|
|
2638
2913
|
continue;
|
|
2639
2914
|
}
|
|
2640
|
-
|
|
2641
|
-
|
|
2915
|
+
block2.ranges++;
|
|
2916
|
+
block2.args = [];
|
|
2642
2917
|
continue;
|
|
2643
2918
|
}
|
|
2644
2919
|
if (prev.type === "range") {
|
|
@@ -2646,7 +2921,7 @@ var require_parse = __commonJS({
|
|
|
2646
2921
|
const before = siblings[siblings.length - 1];
|
|
2647
2922
|
before.value += prev.value + value;
|
|
2648
2923
|
prev = before;
|
|
2649
|
-
|
|
2924
|
+
block2.ranges--;
|
|
2650
2925
|
continue;
|
|
2651
2926
|
}
|
|
2652
2927
|
push({ type: "dot", value });
|
|
@@ -2655,9 +2930,9 @@ var require_parse = __commonJS({
|
|
|
2655
2930
|
push({ type: "text", value });
|
|
2656
2931
|
}
|
|
2657
2932
|
do {
|
|
2658
|
-
|
|
2659
|
-
if (
|
|
2660
|
-
|
|
2933
|
+
block2 = stack.pop();
|
|
2934
|
+
if (block2.type !== "root") {
|
|
2935
|
+
block2.nodes.forEach((node) => {
|
|
2661
2936
|
if (!node.nodes) {
|
|
2662
2937
|
if (node.type === "open") node.isOpen = true;
|
|
2663
2938
|
if (node.type === "close") node.isClose = true;
|
|
@@ -2666,8 +2941,8 @@ var require_parse = __commonJS({
|
|
|
2666
2941
|
}
|
|
2667
2942
|
});
|
|
2668
2943
|
const parent = stack[stack.length - 1];
|
|
2669
|
-
const index2 = parent.nodes.indexOf(
|
|
2670
|
-
parent.nodes.splice(index2, 1, ...
|
|
2944
|
+
const index2 = parent.nodes.indexOf(block2);
|
|
2945
|
+
parent.nodes.splice(index2, 1, ...block2.nodes);
|
|
2671
2946
|
}
|
|
2672
2947
|
} while (stack.length > 0);
|
|
2673
2948
|
push({ type: "eos" });
|
|
@@ -3300,9 +3575,9 @@ var require_scan = __commonJS({
|
|
|
3300
3575
|
if (opts.parts === true || opts.tokens === true) {
|
|
3301
3576
|
let prevIndex;
|
|
3302
3577
|
for (let idx = 0; idx < slashes.length; idx++) {
|
|
3303
|
-
const
|
|
3304
|
-
const
|
|
3305
|
-
const value = input.slice(
|
|
3578
|
+
const n2 = prevIndex ? prevIndex + 1 : start;
|
|
3579
|
+
const i2 = slashes[idx];
|
|
3580
|
+
const value = input.slice(n2, i2);
|
|
3306
3581
|
if (opts.tokens) {
|
|
3307
3582
|
if (idx === 0 && start !== 0) {
|
|
3308
3583
|
tokens[idx].isPrefix = true;
|
|
@@ -3316,7 +3591,7 @@ var require_scan = __commonJS({
|
|
|
3316
3591
|
if (idx !== 0 || value !== "") {
|
|
3317
3592
|
parts.push(value);
|
|
3318
3593
|
}
|
|
3319
|
-
prevIndex =
|
|
3594
|
+
prevIndex = i2;
|
|
3320
3595
|
}
|
|
3321
3596
|
if (prevIndex && prevIndex + 1 < input.length) {
|
|
3322
3597
|
const value = input.slice(prevIndex + 1);
|
|
@@ -3445,15 +3720,15 @@ var require_parse2 = __commonJS({
|
|
|
3445
3720
|
};
|
|
3446
3721
|
var hasRepeatedCharPrefixOverlap = (branches) => {
|
|
3447
3722
|
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
3448
|
-
for (let
|
|
3449
|
-
for (let
|
|
3450
|
-
const
|
|
3451
|
-
const b = values[
|
|
3452
|
-
const char =
|
|
3453
|
-
if (!char ||
|
|
3723
|
+
for (let i2 = 0; i2 < values.length; i2++) {
|
|
3724
|
+
for (let j = i2 + 1; j < values.length; j++) {
|
|
3725
|
+
const a2 = values[i2];
|
|
3726
|
+
const b = values[j];
|
|
3727
|
+
const char = a2[0];
|
|
3728
|
+
if (!char || a2 !== char.repeat(a2.length) || b !== char.repeat(b.length)) {
|
|
3454
3729
|
continue;
|
|
3455
3730
|
}
|
|
3456
|
-
if (
|
|
3731
|
+
if (a2 === b || a2.startsWith(b) || b.startsWith(a2)) {
|
|
3457
3732
|
return true;
|
|
3458
3733
|
}
|
|
3459
3734
|
}
|
|
@@ -3468,8 +3743,8 @@ var require_parse2 = __commonJS({
|
|
|
3468
3743
|
let paren = 0;
|
|
3469
3744
|
let quote = 0;
|
|
3470
3745
|
let escaped = false;
|
|
3471
|
-
for (let
|
|
3472
|
-
const ch = pattern[
|
|
3746
|
+
for (let i2 = 1; i2 < pattern.length; i2++) {
|
|
3747
|
+
const ch = pattern[i2];
|
|
3473
3748
|
if (escaped === true) {
|
|
3474
3749
|
escaped = false;
|
|
3475
3750
|
continue;
|
|
@@ -3503,13 +3778,13 @@ var require_parse2 = __commonJS({
|
|
|
3503
3778
|
if (ch === ")") {
|
|
3504
3779
|
paren--;
|
|
3505
3780
|
if (paren === 0) {
|
|
3506
|
-
if (requireEnd === true &&
|
|
3781
|
+
if (requireEnd === true && i2 !== pattern.length - 1) {
|
|
3507
3782
|
return;
|
|
3508
3783
|
}
|
|
3509
3784
|
return {
|
|
3510
3785
|
type: pattern[0],
|
|
3511
|
-
body: pattern.slice(2,
|
|
3512
|
-
end:
|
|
3786
|
+
body: pattern.slice(2, i2),
|
|
3787
|
+
end: i2
|
|
3513
3788
|
};
|
|
3514
3789
|
}
|
|
3515
3790
|
}
|
|
@@ -3641,7 +3916,7 @@ var require_parse2 = __commonJS({
|
|
|
3641
3916
|
let prev = bos;
|
|
3642
3917
|
let value;
|
|
3643
3918
|
const eos = () => state.index === len - 1;
|
|
3644
|
-
const peek = state.peek = (
|
|
3919
|
+
const peek = state.peek = (n2 = 1) => input[state.index + n2];
|
|
3645
3920
|
const advance = state.advance = () => input[++state.index] || "";
|
|
3646
3921
|
const remaining = () => input.slice(state.index + 1);
|
|
3647
3922
|
const consume = (value2 = "", num = 0) => {
|
|
@@ -3722,10 +3997,10 @@ var require_parse2 = __commonJS({
|
|
|
3722
3997
|
open.type = "text";
|
|
3723
3998
|
open.value = literal;
|
|
3724
3999
|
open.output = safeOutput || utils.escapeRegex(literal);
|
|
3725
|
-
for (let
|
|
3726
|
-
tokens[
|
|
3727
|
-
tokens[
|
|
3728
|
-
delete tokens[
|
|
4000
|
+
for (let i2 = token.tokensIndex + 1; i2 < tokens.length; i2++) {
|
|
4001
|
+
tokens[i2].value = "";
|
|
4002
|
+
tokens[i2].output = "";
|
|
4003
|
+
delete tokens[i2].suffix;
|
|
3729
4004
|
}
|
|
3730
4005
|
state.output = token.output + open.output;
|
|
3731
4006
|
state.backtrack = true;
|
|
@@ -3756,10 +4031,10 @@ var require_parse2 = __commonJS({
|
|
|
3756
4031
|
};
|
|
3757
4032
|
if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
3758
4033
|
let backslashes = false;
|
|
3759
|
-
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (
|
|
4034
|
+
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m2, esc, chars, first, rest, index) => {
|
|
3760
4035
|
if (first === "\\") {
|
|
3761
4036
|
backslashes = true;
|
|
3762
|
-
return
|
|
4037
|
+
return m2;
|
|
3763
4038
|
}
|
|
3764
4039
|
if (first === "?") {
|
|
3765
4040
|
if (esc) {
|
|
@@ -3779,14 +4054,14 @@ var require_parse2 = __commonJS({
|
|
|
3779
4054
|
}
|
|
3780
4055
|
return star;
|
|
3781
4056
|
}
|
|
3782
|
-
return esc ?
|
|
4057
|
+
return esc ? m2 : `\\${m2}`;
|
|
3783
4058
|
});
|
|
3784
4059
|
if (backslashes === true) {
|
|
3785
4060
|
if (opts.unescape === true) {
|
|
3786
4061
|
output = output.replace(/\\/g, "");
|
|
3787
4062
|
} else {
|
|
3788
|
-
output = output.replace(/\\+/g, (
|
|
3789
|
-
return
|
|
4063
|
+
output = output.replace(/\\+/g, (m2) => {
|
|
4064
|
+
return m2.length % 2 === 0 ? "\\\\" : m2 ? "\\" : "";
|
|
3790
4065
|
});
|
|
3791
4066
|
}
|
|
3792
4067
|
}
|
|
@@ -3968,13 +4243,13 @@ var require_parse2 = __commonJS({
|
|
|
3968
4243
|
if (brace.dots === true) {
|
|
3969
4244
|
const arr = tokens.slice();
|
|
3970
4245
|
const range = [];
|
|
3971
|
-
for (let
|
|
4246
|
+
for (let i2 = arr.length - 1; i2 >= 0; i2--) {
|
|
3972
4247
|
tokens.pop();
|
|
3973
|
-
if (arr[
|
|
4248
|
+
if (arr[i2].type === "brace") {
|
|
3974
4249
|
break;
|
|
3975
4250
|
}
|
|
3976
|
-
if (arr[
|
|
3977
|
-
range.unshift(arr[
|
|
4251
|
+
if (arr[i2].type !== "dots") {
|
|
4252
|
+
range.unshift(arr[i2].value);
|
|
3978
4253
|
}
|
|
3979
4254
|
}
|
|
3980
4255
|
output = expandRange(range, opts);
|
|
@@ -4433,7 +4708,7 @@ var require_picomatch = __commonJS({
|
|
|
4433
4708
|
};
|
|
4434
4709
|
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
4435
4710
|
picomatch.parse = (pattern, options) => {
|
|
4436
|
-
if (Array.isArray(pattern)) return pattern.map((
|
|
4711
|
+
if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
|
|
4437
4712
|
return parse2(pattern, { ...options, fastpaths: false });
|
|
4438
4713
|
};
|
|
4439
4714
|
picomatch.scan = (input, options) => scan(input, options);
|
|
@@ -4517,8 +4792,8 @@ var require_micromatch = __commonJS({
|
|
|
4517
4792
|
options.onResult(state);
|
|
4518
4793
|
}
|
|
4519
4794
|
};
|
|
4520
|
-
for (let
|
|
4521
|
-
let isMatch = picomatch(String(patterns[
|
|
4795
|
+
for (let i2 = 0; i2 < patterns.length; i2++) {
|
|
4796
|
+
let isMatch = picomatch(String(patterns[i2]), { ...options, onResult }, true);
|
|
4522
4797
|
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
|
|
4523
4798
|
if (negated) negatives++;
|
|
4524
4799
|
for (let item of list) {
|
|
@@ -4540,7 +4815,7 @@ var require_micromatch = __commonJS({
|
|
|
4540
4815
|
throw new Error(`No matches found for "${patterns.join(", ")}"`);
|
|
4541
4816
|
}
|
|
4542
4817
|
if (options.nonull === true || options.nullglob === true) {
|
|
4543
|
-
return options.unescape ? patterns.map((
|
|
4818
|
+
return options.unescape ? patterns.map((p) => p.replace(/\\/g, "")) : patterns;
|
|
4544
4819
|
}
|
|
4545
4820
|
}
|
|
4546
4821
|
return matches;
|
|
@@ -4570,7 +4845,7 @@ var require_micromatch = __commonJS({
|
|
|
4570
4845
|
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
4571
4846
|
}
|
|
4572
4847
|
if (Array.isArray(pattern)) {
|
|
4573
|
-
return pattern.some((
|
|
4848
|
+
return pattern.some((p) => micromatch.contains(str, p, options));
|
|
4574
4849
|
}
|
|
4575
4850
|
if (typeof pattern === "string") {
|
|
4576
4851
|
if (isEmptyString(str) || isEmptyString(pattern)) {
|
|
@@ -4615,7 +4890,7 @@ var require_micromatch = __commonJS({
|
|
|
4615
4890
|
if (typeof str !== "string") {
|
|
4616
4891
|
throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
|
|
4617
4892
|
}
|
|
4618
|
-
return [].concat(patterns).every((
|
|
4893
|
+
return [].concat(patterns).every((p) => picomatch(p, options)(str));
|
|
4619
4894
|
};
|
|
4620
4895
|
micromatch.capture = (glob2, input, options) => {
|
|
4621
4896
|
let posix = utils.isWindows(options);
|
|
@@ -4766,7 +5041,7 @@ var require_pattern = __commonJS({
|
|
|
4766
5041
|
exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
|
4767
5042
|
function expandBraceExpansion(pattern) {
|
|
4768
5043
|
const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });
|
|
4769
|
-
patterns.sort((
|
|
5044
|
+
patterns.sort((a2, b) => a2.length - b.length);
|
|
4770
5045
|
return patterns.filter((pattern2) => pattern2 !== "");
|
|
4771
5046
|
}
|
|
4772
5047
|
exports.expandBraceExpansion = expandBraceExpansion;
|
|
@@ -4847,8 +5122,8 @@ var require_merge2 = __commonJS({
|
|
|
4847
5122
|
}
|
|
4848
5123
|
const mergedStream = PassThrough(options);
|
|
4849
5124
|
function addStream() {
|
|
4850
|
-
for (let
|
|
4851
|
-
streamsQueue.push(pauseStreams(arguments[
|
|
5125
|
+
for (let i2 = 0, len = arguments.length; i2 < len; i2++) {
|
|
5126
|
+
streamsQueue.push(pauseStreams(arguments[i2], options));
|
|
4852
5127
|
}
|
|
4853
5128
|
mergeStream();
|
|
4854
5129
|
return this;
|
|
@@ -4897,8 +5172,8 @@ var require_merge2 = __commonJS({
|
|
|
4897
5172
|
stream.pipe(mergedStream, { end: false });
|
|
4898
5173
|
stream.resume();
|
|
4899
5174
|
}
|
|
4900
|
-
for (let
|
|
4901
|
-
pipe(streams[
|
|
5175
|
+
for (let i2 = 0; i2 < streams.length; i2++) {
|
|
5176
|
+
pipe(streams[i2]);
|
|
4902
5177
|
}
|
|
4903
5178
|
next();
|
|
4904
5179
|
}
|
|
@@ -4929,8 +5204,8 @@ var require_merge2 = __commonJS({
|
|
|
4929
5204
|
}
|
|
4930
5205
|
streams.pause();
|
|
4931
5206
|
} else {
|
|
4932
|
-
for (let
|
|
4933
|
-
streams[
|
|
5207
|
+
for (let i2 = 0, len = streams.length; i2 < len; i2++) {
|
|
5208
|
+
streams[i2] = pauseStreams(streams[i2], options);
|
|
4934
5209
|
}
|
|
4935
5210
|
}
|
|
4936
5211
|
return streams;
|
|
@@ -5012,13 +5287,13 @@ var require_tasks = __commonJS({
|
|
|
5012
5287
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5013
5288
|
exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
|
|
5014
5289
|
var utils = require_utils3();
|
|
5015
|
-
function generate(input,
|
|
5016
|
-
const patterns = processPatterns(input,
|
|
5017
|
-
const ignore = processPatterns(
|
|
5290
|
+
function generate(input, settings2) {
|
|
5291
|
+
const patterns = processPatterns(input, settings2);
|
|
5292
|
+
const ignore = processPatterns(settings2.ignore, settings2);
|
|
5018
5293
|
const positivePatterns = getPositivePatterns(patterns);
|
|
5019
5294
|
const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
|
|
5020
|
-
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern,
|
|
5021
|
-
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern,
|
|
5295
|
+
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings2));
|
|
5296
|
+
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings2));
|
|
5022
5297
|
const staticTasks = convertPatternsToTasks(
|
|
5023
5298
|
staticPatterns,
|
|
5024
5299
|
negativePatterns,
|
|
@@ -5034,12 +5309,12 @@ var require_tasks = __commonJS({
|
|
|
5034
5309
|
return staticTasks.concat(dynamicTasks);
|
|
5035
5310
|
}
|
|
5036
5311
|
exports.generate = generate;
|
|
5037
|
-
function processPatterns(input,
|
|
5312
|
+
function processPatterns(input, settings2) {
|
|
5038
5313
|
let patterns = input;
|
|
5039
|
-
if (
|
|
5314
|
+
if (settings2.braceExpansion) {
|
|
5040
5315
|
patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);
|
|
5041
5316
|
}
|
|
5042
|
-
if (
|
|
5317
|
+
if (settings2.baseNameMatch) {
|
|
5043
5318
|
patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`);
|
|
5044
5319
|
}
|
|
5045
5320
|
return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));
|
|
@@ -5070,7 +5345,7 @@ var require_tasks = __commonJS({
|
|
|
5070
5345
|
}
|
|
5071
5346
|
exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
|
|
5072
5347
|
function groupPatternsByBaseDirectory(patterns) {
|
|
5073
|
-
const
|
|
5348
|
+
const group2 = {};
|
|
5074
5349
|
return patterns.reduce((collection, pattern) => {
|
|
5075
5350
|
const base = utils.pattern.getBaseDirectory(pattern);
|
|
5076
5351
|
if (base in collection) {
|
|
@@ -5079,7 +5354,7 @@ var require_tasks = __commonJS({
|
|
|
5079
5354
|
collection[base] = [pattern];
|
|
5080
5355
|
}
|
|
5081
5356
|
return collection;
|
|
5082
|
-
},
|
|
5357
|
+
}, group2);
|
|
5083
5358
|
}
|
|
5084
5359
|
exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
|
|
5085
5360
|
function convertPatternGroupsToTasks(positive, negative, dynamic) {
|
|
@@ -5108,26 +5383,26 @@ var require_async = __commonJS({
|
|
|
5108
5383
|
init_utils2();
|
|
5109
5384
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5110
5385
|
exports.read = void 0;
|
|
5111
|
-
function read2(path,
|
|
5112
|
-
|
|
5386
|
+
function read2(path, settings2, callback) {
|
|
5387
|
+
settings2.fs.lstat(path, (lstatError, lstat) => {
|
|
5113
5388
|
if (lstatError !== null) {
|
|
5114
5389
|
callFailureCallback(callback, lstatError);
|
|
5115
5390
|
return;
|
|
5116
5391
|
}
|
|
5117
|
-
if (!lstat.isSymbolicLink() || !
|
|
5392
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
5118
5393
|
callSuccessCallback(callback, lstat);
|
|
5119
5394
|
return;
|
|
5120
5395
|
}
|
|
5121
|
-
|
|
5396
|
+
settings2.fs.stat(path, (statError, stat) => {
|
|
5122
5397
|
if (statError !== null) {
|
|
5123
|
-
if (
|
|
5398
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5124
5399
|
callFailureCallback(callback, statError);
|
|
5125
5400
|
return;
|
|
5126
5401
|
}
|
|
5127
5402
|
callSuccessCallback(callback, lstat);
|
|
5128
5403
|
return;
|
|
5129
5404
|
}
|
|
5130
|
-
if (
|
|
5405
|
+
if (settings2.markSymbolicLink) {
|
|
5131
5406
|
stat.isSymbolicLink = () => true;
|
|
5132
5407
|
}
|
|
5133
5408
|
callSuccessCallback(callback, stat);
|
|
@@ -5151,19 +5426,19 @@ var require_sync = __commonJS({
|
|
|
5151
5426
|
init_utils2();
|
|
5152
5427
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5153
5428
|
exports.read = void 0;
|
|
5154
|
-
function read2(path,
|
|
5155
|
-
const lstat =
|
|
5156
|
-
if (!lstat.isSymbolicLink() || !
|
|
5429
|
+
function read2(path, settings2) {
|
|
5430
|
+
const lstat = settings2.fs.lstatSync(path);
|
|
5431
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
5157
5432
|
return lstat;
|
|
5158
5433
|
}
|
|
5159
5434
|
try {
|
|
5160
|
-
const stat =
|
|
5161
|
-
if (
|
|
5435
|
+
const stat = settings2.fs.statSync(path);
|
|
5436
|
+
if (settings2.markSymbolicLink) {
|
|
5162
5437
|
stat.isSymbolicLink = () => true;
|
|
5163
5438
|
}
|
|
5164
5439
|
return stat;
|
|
5165
5440
|
} catch (error2) {
|
|
5166
|
-
if (!
|
|
5441
|
+
if (!settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5167
5442
|
return lstat;
|
|
5168
5443
|
}
|
|
5169
5444
|
throw error2;
|
|
@@ -5240,8 +5515,8 @@ var require_out = __commonJS({
|
|
|
5240
5515
|
}
|
|
5241
5516
|
exports.stat = stat;
|
|
5242
5517
|
function statSync2(path, optionsOrSettings) {
|
|
5243
|
-
const
|
|
5244
|
-
return sync.read(path,
|
|
5518
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5519
|
+
return sync.read(path, settings2);
|
|
5245
5520
|
}
|
|
5246
5521
|
exports.statSync = statSync2;
|
|
5247
5522
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -5289,8 +5564,8 @@ var require_run_parallel = __commonJS({
|
|
|
5289
5564
|
if (isSync) queueMicrotask2(end);
|
|
5290
5565
|
else end();
|
|
5291
5566
|
}
|
|
5292
|
-
function each(
|
|
5293
|
-
results[
|
|
5567
|
+
function each(i2, err, result) {
|
|
5568
|
+
results[i2] = result;
|
|
5294
5569
|
if (--pending === 0 || err) {
|
|
5295
5570
|
done(err);
|
|
5296
5571
|
}
|
|
@@ -5304,9 +5579,9 @@ var require_run_parallel = __commonJS({
|
|
|
5304
5579
|
});
|
|
5305
5580
|
});
|
|
5306
5581
|
} else {
|
|
5307
|
-
tasks.forEach(function(task,
|
|
5582
|
+
tasks.forEach(function(task, i2) {
|
|
5308
5583
|
task(function(err, result) {
|
|
5309
|
-
each(
|
|
5584
|
+
each(i2, err, result);
|
|
5310
5585
|
});
|
|
5311
5586
|
});
|
|
5312
5587
|
}
|
|
@@ -5381,11 +5656,11 @@ var require_common = __commonJS({
|
|
|
5381
5656
|
init_utils2();
|
|
5382
5657
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5383
5658
|
exports.joinPathSegments = void 0;
|
|
5384
|
-
function joinPathSegments(
|
|
5385
|
-
if (
|
|
5386
|
-
return
|
|
5659
|
+
function joinPathSegments(a2, b, separator) {
|
|
5660
|
+
if (a2.endsWith(separator)) {
|
|
5661
|
+
return a2 + b;
|
|
5387
5662
|
}
|
|
5388
|
-
return
|
|
5663
|
+
return a2 + separator + b;
|
|
5389
5664
|
}
|
|
5390
5665
|
exports.joinPathSegments = joinPathSegments;
|
|
5391
5666
|
}
|
|
@@ -5403,16 +5678,16 @@ var require_async2 = __commonJS({
|
|
|
5403
5678
|
var constants_1 = require_constants3();
|
|
5404
5679
|
var utils = require_utils4();
|
|
5405
5680
|
var common = require_common();
|
|
5406
|
-
function read2(directory,
|
|
5407
|
-
if (!
|
|
5408
|
-
readdirWithFileTypes(directory,
|
|
5681
|
+
function read2(directory, settings2, callback) {
|
|
5682
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
5683
|
+
readdirWithFileTypes(directory, settings2, callback);
|
|
5409
5684
|
return;
|
|
5410
5685
|
}
|
|
5411
|
-
readdir(directory,
|
|
5686
|
+
readdir(directory, settings2, callback);
|
|
5412
5687
|
}
|
|
5413
5688
|
exports.read = read2;
|
|
5414
|
-
function readdirWithFileTypes(directory,
|
|
5415
|
-
|
|
5689
|
+
function readdirWithFileTypes(directory, settings2, callback) {
|
|
5690
|
+
settings2.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
|
|
5416
5691
|
if (readdirError !== null) {
|
|
5417
5692
|
callFailureCallback(callback, readdirError);
|
|
5418
5693
|
return;
|
|
@@ -5420,13 +5695,13 @@ var require_async2 = __commonJS({
|
|
|
5420
5695
|
const entries = dirents.map((dirent) => ({
|
|
5421
5696
|
dirent,
|
|
5422
5697
|
name: dirent.name,
|
|
5423
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
5698
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
5424
5699
|
}));
|
|
5425
|
-
if (!
|
|
5700
|
+
if (!settings2.followSymbolicLinks) {
|
|
5426
5701
|
callSuccessCallback(callback, entries);
|
|
5427
5702
|
return;
|
|
5428
5703
|
}
|
|
5429
|
-
const tasks = entries.map((entry) => makeRplTaskEntry(entry,
|
|
5704
|
+
const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings2));
|
|
5430
5705
|
rpl(tasks, (rplError, rplEntries) => {
|
|
5431
5706
|
if (rplError !== null) {
|
|
5432
5707
|
callFailureCallback(callback, rplError);
|
|
@@ -5437,15 +5712,15 @@ var require_async2 = __commonJS({
|
|
|
5437
5712
|
});
|
|
5438
5713
|
}
|
|
5439
5714
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
5440
|
-
function makeRplTaskEntry(entry,
|
|
5715
|
+
function makeRplTaskEntry(entry, settings2) {
|
|
5441
5716
|
return (done) => {
|
|
5442
5717
|
if (!entry.dirent.isSymbolicLink()) {
|
|
5443
5718
|
done(null, entry);
|
|
5444
5719
|
return;
|
|
5445
5720
|
}
|
|
5446
|
-
|
|
5721
|
+
settings2.fs.stat(entry.path, (statError, stats) => {
|
|
5447
5722
|
if (statError !== null) {
|
|
5448
|
-
if (
|
|
5723
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5449
5724
|
done(statError);
|
|
5450
5725
|
return;
|
|
5451
5726
|
}
|
|
@@ -5457,16 +5732,16 @@ var require_async2 = __commonJS({
|
|
|
5457
5732
|
});
|
|
5458
5733
|
};
|
|
5459
5734
|
}
|
|
5460
|
-
function readdir(directory,
|
|
5461
|
-
|
|
5735
|
+
function readdir(directory, settings2, callback) {
|
|
5736
|
+
settings2.fs.readdir(directory, (readdirError, names) => {
|
|
5462
5737
|
if (readdirError !== null) {
|
|
5463
5738
|
callFailureCallback(callback, readdirError);
|
|
5464
5739
|
return;
|
|
5465
5740
|
}
|
|
5466
5741
|
const tasks = names.map((name) => {
|
|
5467
|
-
const path = common.joinPathSegments(directory, name,
|
|
5742
|
+
const path = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
5468
5743
|
return (done) => {
|
|
5469
|
-
fsStat.stat(path,
|
|
5744
|
+
fsStat.stat(path, settings2.fsStatSettings, (error2, stats) => {
|
|
5470
5745
|
if (error2 !== null) {
|
|
5471
5746
|
done(error2);
|
|
5472
5747
|
return;
|
|
@@ -5476,7 +5751,7 @@ var require_async2 = __commonJS({
|
|
|
5476
5751
|
path,
|
|
5477
5752
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
5478
5753
|
};
|
|
5479
|
-
if (
|
|
5754
|
+
if (settings2.stats) {
|
|
5480
5755
|
entry.stats = stats;
|
|
5481
5756
|
}
|
|
5482
5757
|
done(null, entry);
|
|
@@ -5513,27 +5788,27 @@ var require_sync2 = __commonJS({
|
|
|
5513
5788
|
var constants_1 = require_constants3();
|
|
5514
5789
|
var utils = require_utils4();
|
|
5515
5790
|
var common = require_common();
|
|
5516
|
-
function read2(directory,
|
|
5517
|
-
if (!
|
|
5518
|
-
return readdirWithFileTypes(directory,
|
|
5791
|
+
function read2(directory, settings2) {
|
|
5792
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
5793
|
+
return readdirWithFileTypes(directory, settings2);
|
|
5519
5794
|
}
|
|
5520
|
-
return readdir(directory,
|
|
5795
|
+
return readdir(directory, settings2);
|
|
5521
5796
|
}
|
|
5522
5797
|
exports.read = read2;
|
|
5523
|
-
function readdirWithFileTypes(directory,
|
|
5524
|
-
const dirents =
|
|
5798
|
+
function readdirWithFileTypes(directory, settings2) {
|
|
5799
|
+
const dirents = settings2.fs.readdirSync(directory, { withFileTypes: true });
|
|
5525
5800
|
return dirents.map((dirent) => {
|
|
5526
5801
|
const entry = {
|
|
5527
5802
|
dirent,
|
|
5528
5803
|
name: dirent.name,
|
|
5529
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
5804
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
5530
5805
|
};
|
|
5531
|
-
if (entry.dirent.isSymbolicLink() &&
|
|
5806
|
+
if (entry.dirent.isSymbolicLink() && settings2.followSymbolicLinks) {
|
|
5532
5807
|
try {
|
|
5533
|
-
const stats =
|
|
5808
|
+
const stats = settings2.fs.statSync(entry.path);
|
|
5534
5809
|
entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
|
5535
5810
|
} catch (error2) {
|
|
5536
|
-
if (
|
|
5811
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5537
5812
|
throw error2;
|
|
5538
5813
|
}
|
|
5539
5814
|
}
|
|
@@ -5542,17 +5817,17 @@ var require_sync2 = __commonJS({
|
|
|
5542
5817
|
});
|
|
5543
5818
|
}
|
|
5544
5819
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
5545
|
-
function readdir(directory,
|
|
5546
|
-
const names =
|
|
5820
|
+
function readdir(directory, settings2) {
|
|
5821
|
+
const names = settings2.fs.readdirSync(directory);
|
|
5547
5822
|
return names.map((name) => {
|
|
5548
|
-
const entryPath = common.joinPathSegments(directory, name,
|
|
5549
|
-
const stats = fsStat.statSync(entryPath,
|
|
5823
|
+
const entryPath = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
5824
|
+
const stats = fsStat.statSync(entryPath, settings2.fsStatSettings);
|
|
5550
5825
|
const entry = {
|
|
5551
5826
|
name,
|
|
5552
5827
|
path: entryPath,
|
|
5553
5828
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
5554
5829
|
};
|
|
5555
|
-
if (
|
|
5830
|
+
if (settings2.stats) {
|
|
5556
5831
|
entry.stats = stats;
|
|
5557
5832
|
}
|
|
5558
5833
|
return entry;
|
|
@@ -5639,8 +5914,8 @@ var require_out2 = __commonJS({
|
|
|
5639
5914
|
}
|
|
5640
5915
|
exports.scandir = scandir;
|
|
5641
5916
|
function scandirSync(path, optionsOrSettings) {
|
|
5642
|
-
const
|
|
5643
|
-
return sync.read(path,
|
|
5917
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5918
|
+
return sync.read(path, settings2);
|
|
5644
5919
|
}
|
|
5645
5920
|
exports.scandirSync = scandirSync;
|
|
5646
5921
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -5921,7 +6196,7 @@ var require_queue = __commonJS({
|
|
|
5921
6196
|
queue.drained = drained;
|
|
5922
6197
|
return queue;
|
|
5923
6198
|
function push(value) {
|
|
5924
|
-
var
|
|
6199
|
+
var p = new Promise(function(resolve4, reject) {
|
|
5925
6200
|
pushCb(value, function(err, result) {
|
|
5926
6201
|
if (err) {
|
|
5927
6202
|
reject(err);
|
|
@@ -5930,11 +6205,11 @@ var require_queue = __commonJS({
|
|
|
5930
6205
|
resolve4(result);
|
|
5931
6206
|
});
|
|
5932
6207
|
});
|
|
5933
|
-
|
|
5934
|
-
return
|
|
6208
|
+
p.catch(noop);
|
|
6209
|
+
return p;
|
|
5935
6210
|
}
|
|
5936
6211
|
function unshift(value) {
|
|
5937
|
-
var
|
|
6212
|
+
var p = new Promise(function(resolve4, reject) {
|
|
5938
6213
|
unshiftCb(value, function(err, result) {
|
|
5939
6214
|
if (err) {
|
|
5940
6215
|
reject(err);
|
|
@@ -5943,11 +6218,11 @@ var require_queue = __commonJS({
|
|
|
5943
6218
|
resolve4(result);
|
|
5944
6219
|
});
|
|
5945
6220
|
});
|
|
5946
|
-
|
|
5947
|
-
return
|
|
6221
|
+
p.catch(noop);
|
|
6222
|
+
return p;
|
|
5948
6223
|
}
|
|
5949
6224
|
function drained() {
|
|
5950
|
-
var
|
|
6225
|
+
var p = new Promise(function(resolve4) {
|
|
5951
6226
|
process.nextTick(function() {
|
|
5952
6227
|
if (queue.idle()) {
|
|
5953
6228
|
resolve4();
|
|
@@ -5961,7 +6236,7 @@ var require_queue = __commonJS({
|
|
|
5961
6236
|
}
|
|
5962
6237
|
});
|
|
5963
6238
|
});
|
|
5964
|
-
return
|
|
6239
|
+
return p;
|
|
5965
6240
|
}
|
|
5966
6241
|
}
|
|
5967
6242
|
module.exports = fastqueue;
|
|
@@ -5976,11 +6251,11 @@ var require_common2 = __commonJS({
|
|
|
5976
6251
|
init_utils2();
|
|
5977
6252
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5978
6253
|
exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
|
|
5979
|
-
function isFatalError(
|
|
5980
|
-
if (
|
|
6254
|
+
function isFatalError(settings2, error2) {
|
|
6255
|
+
if (settings2.errorFilter === null) {
|
|
5981
6256
|
return true;
|
|
5982
6257
|
}
|
|
5983
|
-
return !
|
|
6258
|
+
return !settings2.errorFilter(error2);
|
|
5984
6259
|
}
|
|
5985
6260
|
exports.isFatalError = isFatalError;
|
|
5986
6261
|
function isAppliedFilter(filter, value) {
|
|
@@ -5991,14 +6266,14 @@ var require_common2 = __commonJS({
|
|
|
5991
6266
|
return filepath.split(/[/\\]/).join(separator);
|
|
5992
6267
|
}
|
|
5993
6268
|
exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
|
|
5994
|
-
function joinPathSegments(
|
|
5995
|
-
if (
|
|
6269
|
+
function joinPathSegments(a2, b, separator) {
|
|
6270
|
+
if (a2 === "") {
|
|
5996
6271
|
return b;
|
|
5997
6272
|
}
|
|
5998
|
-
if (
|
|
5999
|
-
return
|
|
6273
|
+
if (a2.endsWith(separator)) {
|
|
6274
|
+
return a2 + b;
|
|
6000
6275
|
}
|
|
6001
|
-
return
|
|
6276
|
+
return a2 + separator + b;
|
|
6002
6277
|
}
|
|
6003
6278
|
exports.joinPathSegments = joinPathSegments;
|
|
6004
6279
|
}
|
|
@@ -6345,14 +6620,14 @@ var require_out3 = __commonJS({
|
|
|
6345
6620
|
}
|
|
6346
6621
|
exports.walk = walk;
|
|
6347
6622
|
function walkSync(directory, optionsOrSettings) {
|
|
6348
|
-
const
|
|
6349
|
-
const provider = new sync_1.default(directory,
|
|
6623
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
6624
|
+
const provider = new sync_1.default(directory, settings2);
|
|
6350
6625
|
return provider.read();
|
|
6351
6626
|
}
|
|
6352
6627
|
exports.walkSync = walkSync;
|
|
6353
6628
|
function walkStream(directory, optionsOrSettings) {
|
|
6354
|
-
const
|
|
6355
|
-
const provider = new stream_1.default(directory,
|
|
6629
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
6630
|
+
const provider = new stream_1.default(directory, settings2);
|
|
6356
6631
|
return provider.read();
|
|
6357
6632
|
}
|
|
6358
6633
|
exports.walkStream = walkStream;
|
|
@@ -6438,8 +6713,8 @@ var require_stream3 = __commonJS({
|
|
|
6438
6713
|
done();
|
|
6439
6714
|
}).catch(done);
|
|
6440
6715
|
};
|
|
6441
|
-
for (let
|
|
6442
|
-
stream.write(
|
|
6716
|
+
for (let i2 = 0; i2 < filepaths.length; i2++) {
|
|
6717
|
+
stream.write(i2);
|
|
6443
6718
|
}
|
|
6444
6719
|
return stream;
|
|
6445
6720
|
}
|
|
@@ -7100,14 +7375,14 @@ var require_out4 = __commonJS({
|
|
|
7100
7375
|
function generateTasks(source, options) {
|
|
7101
7376
|
assertPatternsInput(source);
|
|
7102
7377
|
const patterns = [].concat(source);
|
|
7103
|
-
const
|
|
7104
|
-
return taskManager.generate(patterns,
|
|
7378
|
+
const settings2 = new settings_1.default(options);
|
|
7379
|
+
return taskManager.generate(patterns, settings2);
|
|
7105
7380
|
}
|
|
7106
7381
|
FastGlob2.generateTasks = generateTasks;
|
|
7107
7382
|
function isDynamicPattern(source, options) {
|
|
7108
7383
|
assertPatternsInput(source);
|
|
7109
|
-
const
|
|
7110
|
-
return utils.pattern.isDynamicPattern(source,
|
|
7384
|
+
const settings2 = new settings_1.default(options);
|
|
7385
|
+
return utils.pattern.isDynamicPattern(source, settings2);
|
|
7111
7386
|
}
|
|
7112
7387
|
FastGlob2.isDynamicPattern = isDynamicPattern;
|
|
7113
7388
|
function escapePath(source) {
|
|
@@ -7149,9 +7424,9 @@ var require_out4 = __commonJS({
|
|
|
7149
7424
|
})(FastGlob || (FastGlob = {}));
|
|
7150
7425
|
function getWorks(source, _Provider, options) {
|
|
7151
7426
|
const patterns = [].concat(source);
|
|
7152
|
-
const
|
|
7153
|
-
const tasks = taskManager.generate(patterns,
|
|
7154
|
-
const provider = new _Provider(
|
|
7427
|
+
const settings2 = new settings_1.default(options);
|
|
7428
|
+
const tasks = taskManager.generate(patterns, settings2);
|
|
7429
|
+
const provider = new _Provider(settings2);
|
|
7155
7430
|
return tasks.map(provider.read, provider);
|
|
7156
7431
|
}
|
|
7157
7432
|
function assertPatternsInput(input) {
|
|
@@ -7329,8 +7604,8 @@ import "node:fs";
|
|
|
7329
7604
|
import { createRequire } from "node:module";
|
|
7330
7605
|
import {
|
|
7331
7606
|
resolve,
|
|
7332
|
-
join,
|
|
7333
|
-
dirname,
|
|
7607
|
+
join as join2,
|
|
7608
|
+
dirname as dirname2,
|
|
7334
7609
|
relative,
|
|
7335
7610
|
normalize,
|
|
7336
7611
|
sep,
|
|
@@ -7344,7 +7619,7 @@ function safeExecuteAsync(fn, message) {
|
|
|
7344
7619
|
);
|
|
7345
7620
|
});
|
|
7346
7621
|
}
|
|
7347
|
-
var import_fast_glob, constants,
|
|
7622
|
+
var import_fast_glob, constants, log3, PACKAGE_PATHS, PathResolver;
|
|
7348
7623
|
var init_PathResolver = __esm({
|
|
7349
7624
|
"packages/core/config/utils/PathResolver.ts"() {
|
|
7350
7625
|
"use strict";
|
|
@@ -7357,7 +7632,7 @@ var init_PathResolver = __esm({
|
|
|
7357
7632
|
getPatternsFor: getPatternsFor || void 0,
|
|
7358
7633
|
I18N_PATHS: I18N_PATHS || void 0
|
|
7359
7634
|
};
|
|
7360
|
-
|
|
7635
|
+
log3 = {
|
|
7361
7636
|
error: (message, error2) => {
|
|
7362
7637
|
},
|
|
7363
7638
|
warn: (message, error2) => {
|
|
@@ -7478,7 +7753,7 @@ var init_PathResolver = __esm({
|
|
|
7478
7753
|
*/
|
|
7479
7754
|
getDirname(path) {
|
|
7480
7755
|
if (!path) return "";
|
|
7481
|
-
return this.normalizePath(
|
|
7756
|
+
return this.normalizePath(dirname2(path));
|
|
7482
7757
|
}
|
|
7483
7758
|
/**
|
|
7484
7759
|
* Resolve package path using Node's module resolution
|
|
@@ -7490,7 +7765,7 @@ var init_PathResolver = __esm({
|
|
|
7490
7765
|
resolvePackage(packageSpecifier, fromPath = null) {
|
|
7491
7766
|
try {
|
|
7492
7767
|
const basePath = fromPath || this.getAppRoot();
|
|
7493
|
-
const require3 = createRequire(
|
|
7768
|
+
const require3 = createRequire(join2(basePath, "package.json"));
|
|
7494
7769
|
const resolved = require3.resolve(packageSpecifier);
|
|
7495
7770
|
return this.normalizePath(resolved);
|
|
7496
7771
|
} catch (error2) {
|
|
@@ -7642,7 +7917,7 @@ var init_PathResolver = __esm({
|
|
|
7642
7917
|
return cleanContent;
|
|
7643
7918
|
} catch (error2) {
|
|
7644
7919
|
if (this.options.debug) {
|
|
7645
|
-
|
|
7920
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
7646
7921
|
}
|
|
7647
7922
|
return null;
|
|
7648
7923
|
}
|
|
@@ -7670,7 +7945,7 @@ var init_PathResolver = __esm({
|
|
|
7670
7945
|
return cleanContent;
|
|
7671
7946
|
} catch (error2) {
|
|
7672
7947
|
if (this.options.debug) {
|
|
7673
|
-
|
|
7948
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
7674
7949
|
}
|
|
7675
7950
|
return null;
|
|
7676
7951
|
}
|
|
@@ -7692,16 +7967,16 @@ var init_PathResolver = __esm({
|
|
|
7692
7967
|
verbose = false
|
|
7693
7968
|
} = options;
|
|
7694
7969
|
const normalizedPath = this.normalizePath(filePath);
|
|
7695
|
-
const dir = this.normalizePath(
|
|
7970
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
7696
7971
|
const fileExists = this.pathExists(normalizedPath);
|
|
7697
7972
|
if (fileExists && !overwrite) {
|
|
7698
7973
|
if (verbose) {
|
|
7699
|
-
|
|
7974
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
7700
7975
|
}
|
|
7701
7976
|
return false;
|
|
7702
7977
|
}
|
|
7703
7978
|
if (dryRun) {
|
|
7704
|
-
|
|
7979
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
7705
7980
|
return true;
|
|
7706
7981
|
}
|
|
7707
7982
|
try {
|
|
@@ -7726,7 +8001,7 @@ var init_PathResolver = __esm({
|
|
|
7726
8001
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
7727
8002
|
}
|
|
7728
8003
|
if (verbose) {
|
|
7729
|
-
|
|
8004
|
+
log3.info(
|
|
7730
8005
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
7731
8006
|
);
|
|
7732
8007
|
}
|
|
@@ -7753,16 +8028,16 @@ var init_PathResolver = __esm({
|
|
|
7753
8028
|
verbose = false
|
|
7754
8029
|
} = options;
|
|
7755
8030
|
const normalizedPath = this.normalizePath(filePath);
|
|
7756
|
-
const dir = this.normalizePath(
|
|
8031
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
7757
8032
|
const fileExists = this.pathExists(normalizedPath);
|
|
7758
8033
|
if (fileExists && !overwrite) {
|
|
7759
8034
|
if (verbose) {
|
|
7760
|
-
|
|
8035
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
7761
8036
|
}
|
|
7762
8037
|
return false;
|
|
7763
8038
|
}
|
|
7764
8039
|
if (dryRun) {
|
|
7765
|
-
|
|
8040
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
7766
8041
|
return true;
|
|
7767
8042
|
}
|
|
7768
8043
|
try {
|
|
@@ -7786,7 +8061,7 @@ var init_PathResolver = __esm({
|
|
|
7786
8061
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
7787
8062
|
}
|
|
7788
8063
|
if (verbose) {
|
|
7789
|
-
|
|
8064
|
+
log3.info(
|
|
7790
8065
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
7791
8066
|
);
|
|
7792
8067
|
}
|
|
@@ -7811,15 +8086,15 @@ var init_PathResolver = __esm({
|
|
|
7811
8086
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7812
8087
|
if (fileExists && !overwrite) {
|
|
7813
8088
|
if (verbose) {
|
|
7814
|
-
|
|
8089
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7815
8090
|
}
|
|
7816
8091
|
return false;
|
|
7817
8092
|
}
|
|
7818
8093
|
if (dryRun) {
|
|
7819
|
-
|
|
8094
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7820
8095
|
return true;
|
|
7821
8096
|
}
|
|
7822
|
-
const dir = this.normalizePath(
|
|
8097
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7823
8098
|
try {
|
|
7824
8099
|
await fs.promises.mkdir(dir, { recursive: true });
|
|
7825
8100
|
} catch (error2) {
|
|
@@ -7829,7 +8104,7 @@ var init_PathResolver = __esm({
|
|
|
7829
8104
|
return await safeExecuteAsync(async () => {
|
|
7830
8105
|
await fs.promises.copyFile(srcPath, normalizedDestPath);
|
|
7831
8106
|
if (verbose) {
|
|
7832
|
-
|
|
8107
|
+
log3.info(
|
|
7833
8108
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7834
8109
|
);
|
|
7835
8110
|
}
|
|
@@ -7853,15 +8128,15 @@ var init_PathResolver = __esm({
|
|
|
7853
8128
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7854
8129
|
if (fileExists && !overwrite) {
|
|
7855
8130
|
if (verbose) {
|
|
7856
|
-
|
|
8131
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7857
8132
|
}
|
|
7858
8133
|
return false;
|
|
7859
8134
|
}
|
|
7860
8135
|
if (dryRun) {
|
|
7861
|
-
|
|
8136
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7862
8137
|
return true;
|
|
7863
8138
|
}
|
|
7864
|
-
const dir = this.normalizePath(
|
|
8139
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7865
8140
|
try {
|
|
7866
8141
|
fs.mkdirSync(dir, { recursive: true });
|
|
7867
8142
|
} catch (error2) {
|
|
@@ -7870,7 +8145,7 @@ var init_PathResolver = __esm({
|
|
|
7870
8145
|
try {
|
|
7871
8146
|
fs.copyFileSync(srcPath, normalizedDestPath);
|
|
7872
8147
|
if (verbose) {
|
|
7873
|
-
|
|
8148
|
+
log3.info(
|
|
7874
8149
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7875
8150
|
);
|
|
7876
8151
|
}
|
|
@@ -7887,7 +8162,7 @@ var init_PathResolver = __esm({
|
|
|
7887
8162
|
return fs.existsSync(filePath);
|
|
7888
8163
|
} catch (error2) {
|
|
7889
8164
|
if (!silent) {
|
|
7890
|
-
|
|
8165
|
+
log3.error(`Error checking path existence: ${filePath}`, error2);
|
|
7891
8166
|
}
|
|
7892
8167
|
return false;
|
|
7893
8168
|
}
|
|
@@ -7913,7 +8188,7 @@ var init_PathResolver = __esm({
|
|
|
7913
8188
|
return fs.readdirSync(dirPath, options);
|
|
7914
8189
|
} catch (error2) {
|
|
7915
8190
|
if (this.options.debug) {
|
|
7916
|
-
|
|
8191
|
+
log3.warn(`Failed to read directory: ${dirPath}`, error2);
|
|
7917
8192
|
}
|
|
7918
8193
|
const isObjectOptions = options && typeof options === "object" && "withFileTypes" in options;
|
|
7919
8194
|
return isObjectOptions && options.withFileTypes ? [] : [];
|
|
@@ -7931,7 +8206,7 @@ var init_PathResolver = __esm({
|
|
|
7931
8206
|
return fs.statSync(filePath);
|
|
7932
8207
|
} catch (error2) {
|
|
7933
8208
|
if (this.options.debug) {
|
|
7934
|
-
|
|
8209
|
+
log3.warn(`Failed to stat file: ${filePath}`, error2);
|
|
7935
8210
|
}
|
|
7936
8211
|
return null;
|
|
7937
8212
|
}
|
|
@@ -7948,7 +8223,7 @@ var init_PathResolver = __esm({
|
|
|
7948
8223
|
return fs.lstatSync(filePath);
|
|
7949
8224
|
} catch (error2) {
|
|
7950
8225
|
if (this.options.debug) {
|
|
7951
|
-
|
|
8226
|
+
log3.warn(`Failed to lstat file: ${filePath}`, error2);
|
|
7952
8227
|
}
|
|
7953
8228
|
return null;
|
|
7954
8229
|
}
|
|
@@ -8037,7 +8312,7 @@ var init_PathResolver = __esm({
|
|
|
8037
8312
|
* @returns True if repoRoot is the monorepo (has packages directory)
|
|
8038
8313
|
*/
|
|
8039
8314
|
isMonorepo() {
|
|
8040
|
-
const packagesDir =
|
|
8315
|
+
const packagesDir = join2(this._repoRoot, "packages");
|
|
8041
8316
|
return this.pathExists(packagesDir);
|
|
8042
8317
|
}
|
|
8043
8318
|
/**
|
|
@@ -8054,7 +8329,7 @@ var init_PathResolver = __esm({
|
|
|
8054
8329
|
* Find files matching pattern within directory
|
|
8055
8330
|
*/
|
|
8056
8331
|
async findFiles(directory, pattern, options = {}) {
|
|
8057
|
-
const searchPattern = this.normalizePath(
|
|
8332
|
+
const searchPattern = this.normalizePath(join2(directory, pattern));
|
|
8058
8333
|
const appRoot = this.getAppRoot();
|
|
8059
8334
|
const normalizeAppRoot = this.normalizePath(appRoot);
|
|
8060
8335
|
const relativePattern = searchPattern.startsWith(normalizeAppRoot) ? searchPattern.slice(normalizeAppRoot.length + 1) : searchPattern;
|
|
@@ -8101,7 +8376,7 @@ var init_PathResolver = __esm({
|
|
|
8101
8376
|
return null;
|
|
8102
8377
|
}
|
|
8103
8378
|
const resolvedPath = this.normalizePath(
|
|
8104
|
-
|
|
8379
|
+
join2(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
|
|
8105
8380
|
);
|
|
8106
8381
|
const resolvedDir = resolvedPath.replace(/\/[^/]*\*.*$/, "");
|
|
8107
8382
|
if (this.pathExists(resolvedDir)) {
|
|
@@ -8297,13 +8572,13 @@ var init_PathResolver = __esm({
|
|
|
8297
8572
|
const maxLevels = this.options.maxLevels;
|
|
8298
8573
|
while (levelsChecked < maxLevels) {
|
|
8299
8574
|
const toolingPath = this.normalizePath(
|
|
8300
|
-
|
|
8575
|
+
join2(currentDir, PACKAGE_PATHS.TOOLING)
|
|
8301
8576
|
);
|
|
8302
|
-
const corePath = this.normalizePath(
|
|
8577
|
+
const corePath = this.normalizePath(join2(currentDir, PACKAGE_PATHS.CORE));
|
|
8303
8578
|
if (this.pathExists(toolingPath) && this.pathExists(corePath)) {
|
|
8304
8579
|
return currentDir;
|
|
8305
8580
|
}
|
|
8306
|
-
const appsDir =
|
|
8581
|
+
const appsDir = join2(currentDir, "apps");
|
|
8307
8582
|
if (this.pathExists(appsDir)) {
|
|
8308
8583
|
const appsDirStat = this.statSync(appsDir);
|
|
8309
8584
|
if (appsDirStat?.isDirectory()) {
|
|
@@ -8311,15 +8586,15 @@ var init_PathResolver = __esm({
|
|
|
8311
8586
|
}
|
|
8312
8587
|
}
|
|
8313
8588
|
const packageJsonPath = this.normalizePath(
|
|
8314
|
-
|
|
8589
|
+
join2(currentDir, "package.json")
|
|
8315
8590
|
);
|
|
8316
8591
|
if (this.pathExists(packageJsonPath)) {
|
|
8317
|
-
const parentDir2 = this.normalizePath(
|
|
8592
|
+
const parentDir2 = this.normalizePath(dirname2(currentDir));
|
|
8318
8593
|
if (parentDir2 === currentDir) {
|
|
8319
8594
|
return currentDir;
|
|
8320
8595
|
}
|
|
8321
8596
|
}
|
|
8322
|
-
const parentDir = this.normalizePath(
|
|
8597
|
+
const parentDir = this.normalizePath(dirname2(currentDir));
|
|
8323
8598
|
if (parentDir === currentDir) {
|
|
8324
8599
|
break;
|
|
8325
8600
|
}
|
|
@@ -8335,8 +8610,8 @@ var init_PathResolver = __esm({
|
|
|
8335
8610
|
// packages/tooling/src/utils/pathResolver.ts
|
|
8336
8611
|
import { createRequire as createRequire2 } from "node:module";
|
|
8337
8612
|
import {
|
|
8338
|
-
join as
|
|
8339
|
-
dirname as
|
|
8613
|
+
join as join3,
|
|
8614
|
+
dirname as dirname3,
|
|
8340
8615
|
basename as basename2,
|
|
8341
8616
|
extname as extname2,
|
|
8342
8617
|
relative as relative2,
|
|
@@ -8346,7 +8621,7 @@ import {
|
|
|
8346
8621
|
} from "node:path";
|
|
8347
8622
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
8348
8623
|
function getDirnameFromUrl(importMetaUrl) {
|
|
8349
|
-
return
|
|
8624
|
+
return dirname3(fileURLToPath2(importMetaUrl));
|
|
8350
8625
|
}
|
|
8351
8626
|
function detectExecutionMode() {
|
|
8352
8627
|
const fileUrlPath = fileURLToPath2(import.meta.url);
|
|
@@ -8362,7 +8637,7 @@ function getTemplatesRoot() {
|
|
|
8362
8637
|
const mode = detectExecutionMode();
|
|
8363
8638
|
if (mode === "development") {
|
|
8364
8639
|
const fileUrlPath = fileURLToPath2(import.meta.url);
|
|
8365
|
-
const frameworkRoot = normalizePath(
|
|
8640
|
+
const frameworkRoot = normalizePath(dirname3(fileUrlPath), "../../../..");
|
|
8366
8641
|
return normalizePath(frameworkRoot, PACKAGE_PATHS.CLI, "templates");
|
|
8367
8642
|
} else {
|
|
8368
8643
|
try {
|
|
@@ -8378,7 +8653,7 @@ function getTemplatesRoot() {
|
|
|
8378
8653
|
try {
|
|
8379
8654
|
const req = createRequire2(import.meta.url);
|
|
8380
8655
|
const cliPackageJsonPath = req.resolve("@donotdev/cli/package.json");
|
|
8381
|
-
const cliRoot2 = normalizePath(
|
|
8656
|
+
const cliRoot2 = normalizePath(dirname3(cliPackageJsonPath));
|
|
8382
8657
|
const templatesPath = normalizePath(cliRoot2, "templates");
|
|
8383
8658
|
if (pathExists(templatesPath)) {
|
|
8384
8659
|
return templatesPath;
|
|
@@ -8430,8 +8705,8 @@ async function glob(pattern, options = {}) {
|
|
|
8430
8705
|
const patterns = Array.isArray(pattern) ? pattern : [pattern];
|
|
8431
8706
|
const cwd = options.cwd || pathResolverInstance.getAppRoot() || process.cwd();
|
|
8432
8707
|
const normalizeCwd = pathResolverInstance.normalizePath(cwd);
|
|
8433
|
-
const relativePatterns = patterns.map((
|
|
8434
|
-
const normalizedPattern = pathResolverInstance.normalizePath(
|
|
8708
|
+
const relativePatterns = patterns.map((p) => {
|
|
8709
|
+
const normalizedPattern = pathResolverInstance.normalizePath(p);
|
|
8435
8710
|
if (normalizedPattern.startsWith(normalizeCwd)) {
|
|
8436
8711
|
return normalizedPattern.slice(normalizeCwd.length + 1);
|
|
8437
8712
|
}
|
|
@@ -8457,8 +8732,8 @@ function globSync(pattern, options = {}) {
|
|
|
8457
8732
|
const patterns = Array.isArray(pattern) ? pattern : [pattern];
|
|
8458
8733
|
const cwd = options.cwd || pathResolverInstance.getAppRoot() || process.cwd();
|
|
8459
8734
|
const normalizeCwd = pathResolverInstance.normalizePath(cwd);
|
|
8460
|
-
const relativePatterns = patterns.map((
|
|
8461
|
-
const normalizedPattern = pathResolverInstance.normalizePath(
|
|
8735
|
+
const relativePatterns = patterns.map((p) => {
|
|
8736
|
+
const normalizedPattern = pathResolverInstance.normalizePath(p);
|
|
8462
8737
|
if (normalizedPattern.startsWith(normalizeCwd)) {
|
|
8463
8738
|
return normalizedPattern.slice(normalizeCwd.length + 1);
|
|
8464
8739
|
}
|
|
@@ -8482,7 +8757,7 @@ function globSync(pattern, options = {}) {
|
|
|
8482
8757
|
globstar: true,
|
|
8483
8758
|
throwErrorOnBrokenSymbolicLink: options.throwErrorOnBrokenSymbolicLink
|
|
8484
8759
|
});
|
|
8485
|
-
return results.map((
|
|
8760
|
+
return results.map((p) => pathResolverInstance.normalizePath(p));
|
|
8486
8761
|
}
|
|
8487
8762
|
var pathResolverInstance, getRepoRoot, getAppRoot, resolveFrameworkPackage, normalizePath, pathExists, read, readSync, write, writeSync, removeSync, ensureDir, getRelativePathBetween, getDirname, joinPath;
|
|
8488
8763
|
var init_pathResolver = __esm({
|
|
@@ -8495,7 +8770,7 @@ var init_pathResolver = __esm({
|
|
|
8495
8770
|
getAppRoot = () => pathResolverInstance.getAppRoot();
|
|
8496
8771
|
resolveFrameworkPackage = (name, from) => pathResolverInstance.resolveFrameworkPackage(name, from || null);
|
|
8497
8772
|
normalizePath = (...pathSegments) => {
|
|
8498
|
-
return pathResolverInstance.normalizePath(
|
|
8773
|
+
return pathResolverInstance.normalizePath(join3(...pathSegments));
|
|
8499
8774
|
};
|
|
8500
8775
|
pathExists = (filePath, silent = false) => pathResolverInstance.pathExists(filePath, silent);
|
|
8501
8776
|
read = async (filePath, options) => pathResolverInstance.read(filePath, options);
|
|
@@ -8508,7 +8783,7 @@ var init_pathResolver = __esm({
|
|
|
8508
8783
|
return normalizePath(relative2(from, to));
|
|
8509
8784
|
};
|
|
8510
8785
|
getDirname = (filePath) => {
|
|
8511
|
-
return normalizePath(
|
|
8786
|
+
return normalizePath(dirname3(filePath));
|
|
8512
8787
|
};
|
|
8513
8788
|
joinPath = (...pathSegments) => {
|
|
8514
8789
|
return normalizePath(...pathSegments);
|
|
@@ -8520,7 +8795,7 @@ var init_pathResolver = __esm({
|
|
|
8520
8795
|
import { Buffer } from "node:buffer";
|
|
8521
8796
|
import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
8522
8797
|
import { createRequire as createRequire3 } from "node:module";
|
|
8523
|
-
import { dirname as
|
|
8798
|
+
import { dirname as dirname4, resolve as resolve3 } from "node:path";
|
|
8524
8799
|
import process from "node:process";
|
|
8525
8800
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
8526
8801
|
var require2, __filename, __dirname;
|
|
@@ -8529,7 +8804,7 @@ var init_utils2 = __esm({
|
|
|
8529
8804
|
"use strict";
|
|
8530
8805
|
require2 = createRequire3(import.meta.url);
|
|
8531
8806
|
__filename = fileURLToPath3(import.meta.url);
|
|
8532
|
-
__dirname =
|
|
8807
|
+
__dirname = dirname4(__filename);
|
|
8533
8808
|
if (typeof globalThis !== "undefined") {
|
|
8534
8809
|
globalThis.require = require2;
|
|
8535
8810
|
globalThis.__filename = __filename;
|
|
@@ -8545,12 +8820,12 @@ var init_utils2 = __esm({
|
|
|
8545
8820
|
|
|
8546
8821
|
// packages/tooling/src/utils/cli-input.ts
|
|
8547
8822
|
async function askForConfirmation(message, defaultValue = false) {
|
|
8548
|
-
const result = await
|
|
8823
|
+
const result = await confirm({
|
|
8549
8824
|
message,
|
|
8550
8825
|
initialValue: defaultValue
|
|
8551
8826
|
});
|
|
8552
|
-
if (
|
|
8553
|
-
|
|
8827
|
+
if (isCancel(result)) {
|
|
8828
|
+
cancel("Operation cancelled.");
|
|
8554
8829
|
process.exit(0);
|
|
8555
8830
|
}
|
|
8556
8831
|
return result;
|
|
@@ -8561,14 +8836,14 @@ async function askForMultiSelection(message, choices, defaultIndices = []) {
|
|
|
8561
8836
|
label: choice.title,
|
|
8562
8837
|
hint: choice.hint
|
|
8563
8838
|
}));
|
|
8564
|
-
const initialValues = defaultIndices.map((
|
|
8565
|
-
const result = await
|
|
8839
|
+
const initialValues = defaultIndices.map((i2) => choices[i2]?.value).filter(Boolean);
|
|
8840
|
+
const result = await multiselect({
|
|
8566
8841
|
message,
|
|
8567
8842
|
options,
|
|
8568
8843
|
initialValues: initialValues.length > 0 ? initialValues : void 0
|
|
8569
8844
|
});
|
|
8570
|
-
if (
|
|
8571
|
-
|
|
8845
|
+
if (isCancel(result)) {
|
|
8846
|
+
cancel("Operation cancelled.");
|
|
8572
8847
|
process.exit(0);
|
|
8573
8848
|
}
|
|
8574
8849
|
return result;
|
|
@@ -8658,25 +8933,25 @@ function clearMatrixCache() {
|
|
|
8658
8933
|
}
|
|
8659
8934
|
function flattenGroups(groups, options) {
|
|
8660
8935
|
const flat = {};
|
|
8661
|
-
for (const
|
|
8662
|
-
if (options?.skipRootExclude &&
|
|
8663
|
-
for (const [name, version] of Object.entries(
|
|
8936
|
+
for (const group2 of Object.values(groups)) {
|
|
8937
|
+
if (options?.skipRootExclude && group2.rootExclude) continue;
|
|
8938
|
+
for (const [name, version] of Object.entries(group2.packages ?? {})) {
|
|
8664
8939
|
flat[name] = version;
|
|
8665
8940
|
}
|
|
8666
8941
|
}
|
|
8667
8942
|
return flat;
|
|
8668
8943
|
}
|
|
8669
8944
|
function resolveGroup(groupName, matrix) {
|
|
8670
|
-
const
|
|
8671
|
-
if (!
|
|
8945
|
+
const group2 = matrix.groups[groupName];
|
|
8946
|
+
if (!group2) return {};
|
|
8672
8947
|
const result = {};
|
|
8673
|
-
if (
|
|
8674
|
-
for (const included of
|
|
8948
|
+
if (group2.includes) {
|
|
8949
|
+
for (const included of group2.includes) {
|
|
8675
8950
|
Object.assign(result, resolveGroup(included, matrix));
|
|
8676
8951
|
}
|
|
8677
8952
|
}
|
|
8678
|
-
if (
|
|
8679
|
-
Object.assign(result,
|
|
8953
|
+
if (group2.packages) {
|
|
8954
|
+
Object.assign(result, group2.packages);
|
|
8680
8955
|
}
|
|
8681
8956
|
return result;
|
|
8682
8957
|
}
|
|
@@ -8751,24 +9026,24 @@ function ensureCaretPrefix(version) {
|
|
|
8751
9026
|
return `^${version}`;
|
|
8752
9027
|
}
|
|
8753
9028
|
function compareVersions(current, expected) {
|
|
8754
|
-
const
|
|
9029
|
+
const c = normalizeVersion(current).split(".").map(Number);
|
|
8755
9030
|
const e = normalizeVersion(expected).split(".").map(Number);
|
|
8756
|
-
for (let
|
|
8757
|
-
const cv =
|
|
8758
|
-
const ev = e[
|
|
9031
|
+
for (let i2 = 0; i2 < Math.max(c.length, e.length); i2++) {
|
|
9032
|
+
const cv = c[i2] || 0;
|
|
9033
|
+
const ev = e[i2] || 0;
|
|
8759
9034
|
if (cv < ev)
|
|
8760
9035
|
return {
|
|
8761
9036
|
behind: true,
|
|
8762
9037
|
ahead: false,
|
|
8763
9038
|
equal: false,
|
|
8764
|
-
isMajor: (
|
|
9039
|
+
isMajor: (c[0] || 0) !== (e[0] || 0)
|
|
8765
9040
|
};
|
|
8766
9041
|
if (cv > ev)
|
|
8767
9042
|
return {
|
|
8768
9043
|
behind: false,
|
|
8769
9044
|
ahead: true,
|
|
8770
9045
|
equal: false,
|
|
8771
|
-
isMajor: (
|
|
9046
|
+
isMajor: (c[0] || 0) !== (e[0] || 0)
|
|
8772
9047
|
};
|
|
8773
9048
|
}
|
|
8774
9049
|
return { behind: false, ahead: false, equal: true, isMajor: false };
|
|
@@ -8794,8 +9069,8 @@ function syncDonotdevToMatrix(matrix, donotdevVersions, dryRun) {
|
|
|
8794
9069
|
for (const [pkgName, actualVersion] of Object.entries(donotdevVersions)) {
|
|
8795
9070
|
if (!pkgName.startsWith("@donotdev/")) continue;
|
|
8796
9071
|
if (INTERNAL_BUNDLED_PACKAGES.has(pkgName)) continue;
|
|
8797
|
-
const
|
|
8798
|
-
if (!
|
|
9072
|
+
const group2 = matrix.groups[pkgName];
|
|
9073
|
+
if (!group2) {
|
|
8799
9074
|
matrix.groups[pkgName] = {
|
|
8800
9075
|
description: `${pkgName.replace("@donotdev/", "").charAt(0).toUpperCase() + pkgName.replace("@donotdev/", "").slice(1)} package`,
|
|
8801
9076
|
packages: { [pkgName]: `^${actualVersion}` }
|
|
@@ -8803,7 +9078,7 @@ function syncDonotdevToMatrix(matrix, donotdevVersions, dryRun) {
|
|
|
8803
9078
|
changes.push({ pkg: pkgName, from: "N/A", to: `^${actualVersion}` });
|
|
8804
9079
|
continue;
|
|
8805
9080
|
}
|
|
8806
|
-
const packages =
|
|
9081
|
+
const packages = group2.packages ??= {};
|
|
8807
9082
|
const matrixVersion = packages[pkgName];
|
|
8808
9083
|
if (!matrixVersion) {
|
|
8809
9084
|
packages[pkgName] = `^${actualVersion}`;
|
|
@@ -9012,9 +9287,9 @@ function generatePackageJson(templateName, mode, options = {}) {
|
|
|
9012
9287
|
}
|
|
9013
9288
|
if (mode === "published") {
|
|
9014
9289
|
const overrides = {};
|
|
9015
|
-
for (const [groupName,
|
|
9290
|
+
for (const [groupName, group2] of Object.entries(matrix.groups || {})) {
|
|
9016
9291
|
if (groupName.startsWith("@donotdev/")) {
|
|
9017
|
-
const version =
|
|
9292
|
+
const version = group2.packages?.[groupName];
|
|
9018
9293
|
if (version) {
|
|
9019
9294
|
overrides[groupName] = version.replace(/^\^/, "");
|
|
9020
9295
|
}
|
|
@@ -9081,11 +9356,11 @@ function syncPackageJson(appName, destRoot, dryRun) {
|
|
|
9081
9356
|
const existing = parsePackageJson(packageJsonPath);
|
|
9082
9357
|
if (!existing) {
|
|
9083
9358
|
if (dryRun) {
|
|
9084
|
-
|
|
9359
|
+
log2.info(`[DRY RUN] Would regenerate: apps/${appName}/package.json`);
|
|
9085
9360
|
return true;
|
|
9086
9361
|
}
|
|
9087
9362
|
writePackageJson(packageJsonPath, newPkg);
|
|
9088
|
-
|
|
9363
|
+
log2.info(`Regenerated: apps/${appName}/package.json`);
|
|
9089
9364
|
return true;
|
|
9090
9365
|
}
|
|
9091
9366
|
let changed = false;
|
|
@@ -9104,22 +9379,22 @@ function syncPackageJson(appName, destRoot, dryRun) {
|
|
|
9104
9379
|
}
|
|
9105
9380
|
if (changed) {
|
|
9106
9381
|
if (dryRun) {
|
|
9107
|
-
|
|
9382
|
+
log2.info(
|
|
9108
9383
|
`[DRY RUN] Would update deps in: apps/${appName}/package.json`
|
|
9109
9384
|
);
|
|
9110
9385
|
} else {
|
|
9111
9386
|
writePackageJson(packageJsonPath, existing);
|
|
9112
|
-
|
|
9387
|
+
log2.info(`Updated deps: apps/${appName}/package.json`);
|
|
9113
9388
|
}
|
|
9114
9389
|
}
|
|
9115
9390
|
return changed;
|
|
9116
9391
|
}
|
|
9117
9392
|
if (dryRun) {
|
|
9118
|
-
|
|
9393
|
+
log2.info(`[DRY RUN] Would create: apps/${appName}/package.json`);
|
|
9119
9394
|
return true;
|
|
9120
9395
|
}
|
|
9121
9396
|
writePackageJson(packageJsonPath, newPkg);
|
|
9122
|
-
|
|
9397
|
+
log2.info(`Created: apps/${appName}/package.json`);
|
|
9123
9398
|
return true;
|
|
9124
9399
|
}
|
|
9125
9400
|
async function syncApp(appName, options = {}) {
|
|
@@ -9129,19 +9404,19 @@ async function syncApp(appName, options = {}) {
|
|
|
9129
9404
|
let errors = 0;
|
|
9130
9405
|
const appRoot = getAppRoot();
|
|
9131
9406
|
if (!appRoot) {
|
|
9132
|
-
|
|
9407
|
+
log2.error("Could not determine project root");
|
|
9133
9408
|
return { synced, preserved, errors: 1 };
|
|
9134
9409
|
}
|
|
9135
9410
|
const sourceRoot = getAppTemplateSource(appName);
|
|
9136
9411
|
if (!sourceRoot) {
|
|
9137
|
-
|
|
9412
|
+
log2.warn(
|
|
9138
9413
|
`Template for app-${appName} not found. Is @donotdev/cli installed?`
|
|
9139
9414
|
);
|
|
9140
9415
|
return { synced, preserved, errors: 1 };
|
|
9141
9416
|
}
|
|
9142
9417
|
const destRoot = normalizePath(joinPath(appRoot, "apps", appName));
|
|
9143
9418
|
if (!pathExists(destRoot)) {
|
|
9144
|
-
|
|
9419
|
+
log2.info(`apps/${appName}/ does not exist \u2014 creating from template`);
|
|
9145
9420
|
if (!dryRun) {
|
|
9146
9421
|
await ensureDir(destRoot);
|
|
9147
9422
|
}
|
|
@@ -9152,7 +9427,7 @@ async function syncApp(appName, options = {}) {
|
|
|
9152
9427
|
}
|
|
9153
9428
|
} catch (error2) {
|
|
9154
9429
|
errors++;
|
|
9155
|
-
|
|
9430
|
+
log2.error(
|
|
9156
9431
|
`Error generating package.json for apps/${appName}:`,
|
|
9157
9432
|
DoNotDevError.from(
|
|
9158
9433
|
error2,
|
|
@@ -9173,7 +9448,7 @@ async function syncApp(appName, options = {}) {
|
|
|
9173
9448
|
sourceRoot + "/",
|
|
9174
9449
|
""
|
|
9175
9450
|
);
|
|
9176
|
-
if (SKIP_PATTERNS.some((
|
|
9451
|
+
if (SKIP_PATTERNS.some((p) => relativePath.includes(p))) {
|
|
9177
9452
|
continue;
|
|
9178
9453
|
}
|
|
9179
9454
|
const destRelative = relativePath.endsWith(".example") ? relativePath.slice(0, -8) : relativePath;
|
|
@@ -9183,9 +9458,9 @@ async function syncApp(appName, options = {}) {
|
|
|
9183
9458
|
);
|
|
9184
9459
|
if (shouldPreserve && pathExists(destFile)) {
|
|
9185
9460
|
if (dryRun) {
|
|
9186
|
-
|
|
9461
|
+
log2.info(`[DRY RUN] Would preserve: apps/${appName}/${destRelative}`);
|
|
9187
9462
|
} else {
|
|
9188
|
-
|
|
9463
|
+
log2.info(`Preserving: apps/${appName}/${destRelative}`);
|
|
9189
9464
|
}
|
|
9190
9465
|
preserved++;
|
|
9191
9466
|
continue;
|
|
@@ -9198,17 +9473,17 @@ async function syncApp(appName, options = {}) {
|
|
|
9198
9473
|
if (existing === content) continue;
|
|
9199
9474
|
}
|
|
9200
9475
|
if (dryRun) {
|
|
9201
|
-
|
|
9476
|
+
log2.info(`[DRY RUN] Would sync: apps/${appName}/${destRelative}`);
|
|
9202
9477
|
} else {
|
|
9203
9478
|
await ensureDir(getDirname(destFile));
|
|
9204
9479
|
await write(destFile, content, { format: "text", overwrite: true });
|
|
9205
|
-
|
|
9480
|
+
log2.info(`Synced: apps/${appName}/${destRelative}`);
|
|
9206
9481
|
}
|
|
9207
9482
|
synced++;
|
|
9208
9483
|
}
|
|
9209
9484
|
} catch (error2) {
|
|
9210
9485
|
errors++;
|
|
9211
|
-
|
|
9486
|
+
log2.error(
|
|
9212
9487
|
`Error syncing app-${appName}:`,
|
|
9213
9488
|
DoNotDevError.from(
|
|
9214
9489
|
error2,
|
|
@@ -9276,11 +9551,11 @@ function getSourceTemplatesPath() {
|
|
|
9276
9551
|
"root-consumer"
|
|
9277
9552
|
);
|
|
9278
9553
|
if (pathExists(directPath)) {
|
|
9279
|
-
|
|
9554
|
+
log2.info("Found templates via node_modules lookup");
|
|
9280
9555
|
return normalizePath(directPath);
|
|
9281
9556
|
}
|
|
9282
9557
|
}
|
|
9283
|
-
|
|
9558
|
+
log2.warn(
|
|
9284
9559
|
"Could not find @donotdev/cli templates. Is @donotdev/cli installed?"
|
|
9285
9560
|
);
|
|
9286
9561
|
return null;
|
|
@@ -9292,16 +9567,16 @@ async function syncFile(sourcePath, destPath, preserveIfExists, appRoot) {
|
|
|
9292
9567
|
appRoot,
|
|
9293
9568
|
destPathWithoutExample
|
|
9294
9569
|
);
|
|
9295
|
-
|
|
9570
|
+
log2.info(`Preserving user-customized file: ${relativePath}`);
|
|
9296
9571
|
return false;
|
|
9297
9572
|
}
|
|
9298
9573
|
if (!pathExists(sourcePath)) {
|
|
9299
|
-
|
|
9574
|
+
log2.warn(`Source file not found: ${sourcePath}`);
|
|
9300
9575
|
return false;
|
|
9301
9576
|
}
|
|
9302
9577
|
const content = await read(sourcePath, { format: "text" });
|
|
9303
9578
|
if (!content) {
|
|
9304
|
-
|
|
9579
|
+
log2.warn(`Source file is empty: ${sourcePath}`);
|
|
9305
9580
|
return false;
|
|
9306
9581
|
}
|
|
9307
9582
|
if (pathExists(destPathWithoutExample)) {
|
|
@@ -9348,14 +9623,14 @@ async function syncTemplates(sourceRoot, destRoot, dryRun) {
|
|
|
9348
9623
|
normalizedDestRoot,
|
|
9349
9624
|
destWithoutExample
|
|
9350
9625
|
);
|
|
9351
|
-
|
|
9626
|
+
log2.info(`[DRY RUN] Would preserve: ${relativeDest}`);
|
|
9352
9627
|
preserved++;
|
|
9353
9628
|
} else {
|
|
9354
9629
|
const relativeDest = getRelativePathBetween(
|
|
9355
9630
|
normalizedDestRoot,
|
|
9356
9631
|
destWithoutExample
|
|
9357
9632
|
);
|
|
9358
|
-
|
|
9633
|
+
log2.info(`[DRY RUN] Would sync: ${relativeDest}`);
|
|
9359
9634
|
synced++;
|
|
9360
9635
|
}
|
|
9361
9636
|
} else {
|
|
@@ -9371,7 +9646,7 @@ async function syncTemplates(sourceRoot, destRoot, dryRun) {
|
|
|
9371
9646
|
normalizedDestRoot,
|
|
9372
9647
|
destWithoutExample
|
|
9373
9648
|
);
|
|
9374
|
-
|
|
9649
|
+
log2.info(`Synced: ${relativeDest}`);
|
|
9375
9650
|
} else if (shouldPreserve && pathExists(destWithoutExample)) {
|
|
9376
9651
|
preserved++;
|
|
9377
9652
|
}
|
|
@@ -9379,7 +9654,7 @@ async function syncTemplates(sourceRoot, destRoot, dryRun) {
|
|
|
9379
9654
|
}
|
|
9380
9655
|
} catch (error2) {
|
|
9381
9656
|
errors++;
|
|
9382
|
-
|
|
9657
|
+
log2.error(
|
|
9383
9658
|
`Error syncing pattern ${pattern}:`,
|
|
9384
9659
|
DoNotDevError.from(
|
|
9385
9660
|
error2,
|
|
@@ -9394,50 +9669,50 @@ async function syncTemplates(sourceRoot, destRoot, dryRun) {
|
|
|
9394
9669
|
async function syncDocumentation(options = {}) {
|
|
9395
9670
|
const { dryRun } = options;
|
|
9396
9671
|
if (dryRun) {
|
|
9397
|
-
|
|
9672
|
+
log2.info("\u{1F50D} DRY RUN MODE - No files will be modified");
|
|
9398
9673
|
}
|
|
9399
9674
|
const appRoot = getAppRoot();
|
|
9400
9675
|
if (!appRoot) {
|
|
9401
|
-
|
|
9676
|
+
log2.error("Could not determine project root");
|
|
9402
9677
|
return 1;
|
|
9403
9678
|
}
|
|
9404
9679
|
const sourceRoot = getSourceTemplatesPath();
|
|
9405
9680
|
if (!sourceRoot) {
|
|
9406
|
-
|
|
9407
|
-
|
|
9408
|
-
|
|
9409
|
-
|
|
9410
|
-
|
|
9411
|
-
|
|
9412
|
-
|
|
9413
|
-
|
|
9414
|
-
|
|
9681
|
+
log2.error("Could not find framework templates. Documentation sync failed.");
|
|
9682
|
+
log2.info("");
|
|
9683
|
+
log2.info(" Templates are looked up the same way as create-project:");
|
|
9684
|
+
log2.info(" \u2022 Published mode: node_modules/@donotdev/cli/templates");
|
|
9685
|
+
log2.info(" \u2022 Dev mode: packages/cli/templates (from monorepo)");
|
|
9686
|
+
log2.info("");
|
|
9687
|
+
log2.info(" To enable docs sync:");
|
|
9688
|
+
log2.info(" \u2022 Install @donotdev/cli: bun add -D @donotdev/cli");
|
|
9689
|
+
log2.info(" \u2022 Or run from framework monorepo (dev mode)");
|
|
9415
9690
|
return 1;
|
|
9416
9691
|
}
|
|
9417
|
-
|
|
9418
|
-
|
|
9692
|
+
log2.info(`Source templates: ${sourceRoot}`);
|
|
9693
|
+
log2.info(`Destination: ${appRoot}`);
|
|
9419
9694
|
const result = await syncTemplates(sourceRoot, appRoot, dryRun || false);
|
|
9420
9695
|
if (dryRun) {
|
|
9421
|
-
|
|
9696
|
+
log2.info(`
|
|
9422
9697
|
[DRY RUN] Would sync ${result.synced} file(s)`);
|
|
9423
9698
|
if (result.preserved > 0) {
|
|
9424
|
-
|
|
9699
|
+
log2.info(
|
|
9425
9700
|
`[DRY RUN] Would preserve ${result.preserved} user-customized file(s)`
|
|
9426
9701
|
);
|
|
9427
9702
|
}
|
|
9428
|
-
|
|
9703
|
+
log2.info("[DRY RUN] No files modified");
|
|
9429
9704
|
} else {
|
|
9430
9705
|
if (result.synced > 0) {
|
|
9431
|
-
|
|
9706
|
+
log2.success(`
|
|
9432
9707
|
\u2705 Synced ${result.synced} file(s) from framework`);
|
|
9433
9708
|
} else {
|
|
9434
|
-
|
|
9709
|
+
log2.info("\n\u2705 All documentation up to date");
|
|
9435
9710
|
}
|
|
9436
9711
|
if (result.preserved > 0) {
|
|
9437
|
-
|
|
9712
|
+
log2.info(`\u2139\uFE0F Preserved ${result.preserved} user-customized file(s)`);
|
|
9438
9713
|
}
|
|
9439
9714
|
if (result.errors > 0) {
|
|
9440
|
-
|
|
9715
|
+
log2.warn(`\u26A0\uFE0F ${result.errors} error(s) occurred during sync`);
|
|
9441
9716
|
return 1;
|
|
9442
9717
|
}
|
|
9443
9718
|
}
|
|
@@ -9505,22 +9780,22 @@ function padEnd(str, len) {
|
|
|
9505
9780
|
}
|
|
9506
9781
|
function formatUpdateTable(updates, appRoot) {
|
|
9507
9782
|
const seen = /* @__PURE__ */ new Map();
|
|
9508
|
-
for (const
|
|
9509
|
-
if (!seen.has(
|
|
9783
|
+
for (const u3 of updates) {
|
|
9784
|
+
if (!seen.has(u3.pkg) || u3.isMajor) seen.set(u3.pkg, u3);
|
|
9510
9785
|
}
|
|
9511
9786
|
const unique = Array.from(seen.values());
|
|
9512
|
-
const maxName = Math.max(...unique.map((
|
|
9513
|
-
const maxCurrent = Math.max(...unique.map((
|
|
9514
|
-
const lines = unique.map((
|
|
9515
|
-
const normalizedLatest = normalizeVersion(
|
|
9787
|
+
const maxName = Math.max(...unique.map((u3) => u3.pkg.length));
|
|
9788
|
+
const maxCurrent = Math.max(...unique.map((u3) => u3.current.length));
|
|
9789
|
+
const lines = unique.map((u3) => {
|
|
9790
|
+
const normalizedLatest = normalizeVersion(u3.latest);
|
|
9516
9791
|
const displayLatest = ensureCaretPrefix(normalizedLatest);
|
|
9517
|
-
const major =
|
|
9518
|
-
return ` ${padEnd(
|
|
9792
|
+
const major = u3.isMajor ? " MAJOR" : "";
|
|
9793
|
+
return ` ${padEnd(u3.pkg, maxName)} ${padEnd(u3.current, maxCurrent)} -> ${displayLatest}${major}`;
|
|
9519
9794
|
});
|
|
9520
9795
|
const affectedFiles = /* @__PURE__ */ new Set();
|
|
9521
|
-
for (const
|
|
9796
|
+
for (const u3 of updates) {
|
|
9522
9797
|
affectedFiles.add(
|
|
9523
|
-
appRoot ? getRelativePathBetween(appRoot,
|
|
9798
|
+
appRoot ? getRelativePathBetween(appRoot, u3.file) : u3.file
|
|
9524
9799
|
);
|
|
9525
9800
|
}
|
|
9526
9801
|
lines.push(` Affects: ${Array.from(affectedFiles).join(", ")}`);
|
|
@@ -9528,11 +9803,11 @@ function formatUpdateTable(updates, appRoot) {
|
|
|
9528
9803
|
}
|
|
9529
9804
|
function formatDeprecatedList(deprecated, appRoot) {
|
|
9530
9805
|
const lines = [];
|
|
9531
|
-
for (const
|
|
9532
|
-
lines.push(` ${
|
|
9533
|
-
const locs =
|
|
9534
|
-
const rel = appRoot ? getRelativePathBetween(appRoot,
|
|
9535
|
-
return `${rel} (${
|
|
9806
|
+
for (const d of deprecated) {
|
|
9807
|
+
lines.push(` ${d.name} \u2014 ${d.message}`);
|
|
9808
|
+
const locs = d.locations.map((l2) => {
|
|
9809
|
+
const rel = appRoot ? getRelativePathBetween(appRoot, l2.file) : l2.file;
|
|
9810
|
+
return `${rel} (${l2.field})`;
|
|
9536
9811
|
});
|
|
9537
9812
|
lines.push(` Found in: ${locs.join(", ")}`);
|
|
9538
9813
|
}
|
|
@@ -9541,23 +9816,23 @@ function formatDeprecatedList(deprecated, appRoot) {
|
|
|
9541
9816
|
function applyUpdates(updates, appRoot) {
|
|
9542
9817
|
const updatedFiles = /* @__PURE__ */ new Map();
|
|
9543
9818
|
let syncedPins = 0;
|
|
9544
|
-
for (const
|
|
9545
|
-
if (!updatedFiles.has(
|
|
9546
|
-
updatedFiles.set(
|
|
9819
|
+
for (const u3 of updates) {
|
|
9820
|
+
if (!updatedFiles.has(u3.file)) {
|
|
9821
|
+
updatedFiles.set(u3.file, /* @__PURE__ */ new Set());
|
|
9547
9822
|
}
|
|
9548
|
-
updatedFiles.get(
|
|
9823
|
+
updatedFiles.get(u3.file).add(`${u3.pkg}:${u3.field}`);
|
|
9549
9824
|
}
|
|
9550
9825
|
for (const [file, packageKeys] of updatedFiles) {
|
|
9551
9826
|
const pkg = parsePackageJson(file);
|
|
9552
9827
|
if (!pkg) {
|
|
9553
|
-
|
|
9828
|
+
log2.warn(`Could not parse ${file} \u2014 skipping`);
|
|
9554
9829
|
continue;
|
|
9555
9830
|
}
|
|
9556
9831
|
let changed = false;
|
|
9557
9832
|
for (const packageKey of packageKeys) {
|
|
9558
9833
|
const [pkgName, field] = packageKey.split(":");
|
|
9559
9834
|
const update = updates.find(
|
|
9560
|
-
(
|
|
9835
|
+
(u3) => u3.file === file && u3.pkg === pkgName && u3.field === field
|
|
9561
9836
|
);
|
|
9562
9837
|
if (!update) continue;
|
|
9563
9838
|
const deps = pkg[field];
|
|
@@ -9570,10 +9845,10 @@ function applyUpdates(updates, appRoot) {
|
|
|
9570
9845
|
for (const pinField of ["overrides", "resolutions"]) {
|
|
9571
9846
|
const pinDeps = pkg[pinField];
|
|
9572
9847
|
if (!pinDeps) continue;
|
|
9573
|
-
for (const
|
|
9574
|
-
if (
|
|
9575
|
-
const normalizedLatest = normalizeVersion(
|
|
9576
|
-
pinDeps[
|
|
9848
|
+
for (const u3 of updates) {
|
|
9849
|
+
if (u3.file === file && u3.pkg.startsWith("@donotdev/") && u3.field !== pinField && pinDeps[u3.pkg]) {
|
|
9850
|
+
const normalizedLatest = normalizeVersion(u3.latest);
|
|
9851
|
+
pinDeps[u3.pkg] = normalizedLatest;
|
|
9577
9852
|
changed = true;
|
|
9578
9853
|
syncedPins++;
|
|
9579
9854
|
}
|
|
@@ -9587,10 +9862,10 @@ function applyUpdates(updates, appRoot) {
|
|
|
9587
9862
|
}
|
|
9588
9863
|
function removeDeprecated(deprecated) {
|
|
9589
9864
|
const byFile = /* @__PURE__ */ new Map();
|
|
9590
|
-
for (const
|
|
9591
|
-
for (const loc of
|
|
9865
|
+
for (const d of deprecated) {
|
|
9866
|
+
for (const loc of d.locations) {
|
|
9592
9867
|
if (!byFile.has(loc.file)) byFile.set(loc.file, []);
|
|
9593
|
-
byFile.get(loc.file).push({ name:
|
|
9868
|
+
byFile.get(loc.file).push({ name: d.name, field: loc.field });
|
|
9594
9869
|
}
|
|
9595
9870
|
}
|
|
9596
9871
|
let removed = 0;
|
|
@@ -9634,11 +9909,11 @@ function runBunInstall(appRoot) {
|
|
|
9634
9909
|
}
|
|
9635
9910
|
async function main(options = {}) {
|
|
9636
9911
|
const { dryRun } = options;
|
|
9637
|
-
|
|
9638
|
-
if (dryRun)
|
|
9912
|
+
intro("Bump \u2014 Update packages and sync project");
|
|
9913
|
+
if (dryRun) log2.info("DRY RUN MODE \u2014 no files will be modified");
|
|
9639
9914
|
const appRoot = getAppRoot();
|
|
9640
9915
|
if (!appRoot) {
|
|
9641
|
-
|
|
9916
|
+
log2.error("Could not determine project root");
|
|
9642
9917
|
return 1;
|
|
9643
9918
|
}
|
|
9644
9919
|
let updatePackages = false;
|
|
@@ -9689,9 +9964,9 @@ async function main(options = {}) {
|
|
|
9689
9964
|
absolute: true
|
|
9690
9965
|
});
|
|
9691
9966
|
if (files.length === 0) {
|
|
9692
|
-
|
|
9967
|
+
log2.warn("No package.json files found");
|
|
9693
9968
|
} else {
|
|
9694
|
-
const s =
|
|
9969
|
+
const s = spinner();
|
|
9695
9970
|
s.start(`Scanning ${files.length} package.json file(s)...`);
|
|
9696
9971
|
const { frameworkPkgs, externalDeps, packageOccurrences } = detectProjectDeps(files);
|
|
9697
9972
|
s.message("Querying npm registry...");
|
|
@@ -9702,7 +9977,7 @@ async function main(options = {}) {
|
|
|
9702
9977
|
`Found ${frameworkPkgs.size} framework + ${externalDeps.size} external package(s)`
|
|
9703
9978
|
);
|
|
9704
9979
|
if (!matrixResult && externalDeps.size > 0) {
|
|
9705
|
-
|
|
9980
|
+
log2.info(
|
|
9706
9981
|
"Matrix not found \u2014 only @donotdev/* packages will be checked"
|
|
9707
9982
|
);
|
|
9708
9983
|
}
|
|
@@ -9766,34 +10041,34 @@ async function main(options = {}) {
|
|
|
9766
10041
|
}
|
|
9767
10042
|
const hasAnything = frameworkUpdates.length > 0 || externalMinorUpdates.length > 0 || majorUpdates.length > 0 || deprecatedPkgs.length > 0;
|
|
9768
10043
|
if (!hasAnything) {
|
|
9769
|
-
|
|
10044
|
+
log2.success("All packages up to date!");
|
|
9770
10045
|
} else {
|
|
9771
10046
|
if (frameworkUpdates.length > 0) {
|
|
9772
|
-
|
|
10047
|
+
note(
|
|
9773
10048
|
formatUpdateTable(frameworkUpdates, appRoot),
|
|
9774
|
-
`@donotdev/* updates (${new Set(frameworkUpdates.map((
|
|
10049
|
+
`@donotdev/* updates (${new Set(frameworkUpdates.map((u3) => u3.pkg)).size})`
|
|
9775
10050
|
);
|
|
9776
10051
|
}
|
|
9777
10052
|
if (deprecatedPkgs.length > 0) {
|
|
9778
|
-
|
|
10053
|
+
note(
|
|
9779
10054
|
formatDeprecatedList(deprecatedPkgs, appRoot),
|
|
9780
10055
|
`Deprecated packages (${deprecatedPkgs.length})`
|
|
9781
10056
|
);
|
|
9782
10057
|
}
|
|
9783
10058
|
if (externalMinorUpdates.length > 0) {
|
|
9784
|
-
|
|
10059
|
+
note(
|
|
9785
10060
|
formatUpdateTable(externalMinorUpdates, appRoot),
|
|
9786
|
-
`External dep updates (${new Set(externalMinorUpdates.map((
|
|
10061
|
+
`External dep updates (${new Set(externalMinorUpdates.map((u3) => u3.pkg)).size})`
|
|
9787
10062
|
);
|
|
9788
10063
|
}
|
|
9789
10064
|
if (majorUpdates.length > 0) {
|
|
9790
|
-
|
|
10065
|
+
note(
|
|
9791
10066
|
formatUpdateTable(majorUpdates, appRoot),
|
|
9792
|
-
`MAJOR updates (${new Set(majorUpdates.map((
|
|
10067
|
+
`MAJOR updates (${new Set(majorUpdates.map((u3) => u3.pkg)).size})`
|
|
9793
10068
|
);
|
|
9794
10069
|
}
|
|
9795
10070
|
if (dryRun) {
|
|
9796
|
-
|
|
10071
|
+
log2.info("[DRY RUN] No files modified");
|
|
9797
10072
|
} else {
|
|
9798
10073
|
const allUpdates = [];
|
|
9799
10074
|
const summary = [];
|
|
@@ -9819,13 +10094,13 @@ async function main(options = {}) {
|
|
|
9819
10094
|
if (apply) allUpdates.push(...externalMinorUpdates);
|
|
9820
10095
|
}
|
|
9821
10096
|
if (majorUpdates.length > 0) {
|
|
9822
|
-
for (const
|
|
9823
|
-
if (
|
|
9824
|
-
|
|
10097
|
+
for (const u3 of majorUpdates) {
|
|
10098
|
+
if (u3.migrationPath) {
|
|
10099
|
+
log2.info(`Migration guide for ${u3.pkg}: ${u3.migrationPath}`);
|
|
9825
10100
|
}
|
|
9826
|
-
if (
|
|
9827
|
-
for (const bc of
|
|
9828
|
-
|
|
10101
|
+
if (u3.breakingChanges?.length) {
|
|
10102
|
+
for (const bc of u3.breakingChanges) {
|
|
10103
|
+
log2.warn(`Breaking: ${bc}`);
|
|
9829
10104
|
}
|
|
9830
10105
|
}
|
|
9831
10106
|
}
|
|
@@ -9874,63 +10149,63 @@ async function main(options = {}) {
|
|
|
9874
10149
|
}
|
|
9875
10150
|
}
|
|
9876
10151
|
}
|
|
9877
|
-
|
|
10152
|
+
note(summary.map((s2) => ` ${s2}`).join("\n"), "Done");
|
|
9878
10153
|
const shouldInstall = await askForConfirmation(
|
|
9879
10154
|
"Run bun install now?",
|
|
9880
10155
|
true
|
|
9881
10156
|
);
|
|
9882
10157
|
if (shouldInstall) {
|
|
9883
|
-
const installSpinner =
|
|
10158
|
+
const installSpinner = spinner();
|
|
9884
10159
|
installSpinner.start("Running bun install...");
|
|
9885
10160
|
const ok = runBunInstall(appRoot);
|
|
9886
10161
|
if (ok) {
|
|
9887
10162
|
installSpinner.stop("bun install completed");
|
|
9888
10163
|
} else {
|
|
9889
10164
|
installSpinner.stop("bun install failed");
|
|
9890
|
-
|
|
10165
|
+
log2.warn(
|
|
9891
10166
|
"bun install failed \u2014 run it manually to see the error"
|
|
9892
10167
|
);
|
|
9893
10168
|
}
|
|
9894
10169
|
}
|
|
9895
10170
|
} else {
|
|
9896
|
-
|
|
10171
|
+
log2.info("No changes applied");
|
|
9897
10172
|
}
|
|
9898
10173
|
}
|
|
9899
10174
|
}
|
|
9900
10175
|
}
|
|
9901
10176
|
}
|
|
9902
10177
|
if (updateDocs) {
|
|
9903
|
-
|
|
10178
|
+
log2.info("Syncing framework documentation...");
|
|
9904
10179
|
const syncResult = await syncDocumentation({ dryRun });
|
|
9905
10180
|
if (syncResult !== 0 && !dryRun) {
|
|
9906
|
-
|
|
10181
|
+
log2.warn("Some documentation files could not be synced");
|
|
9907
10182
|
}
|
|
9908
10183
|
}
|
|
9909
10184
|
if (updateDemoApp) {
|
|
9910
|
-
|
|
10185
|
+
log2.info("Syncing demo app...");
|
|
9911
10186
|
const result = await syncApp("demo", { dryRun });
|
|
9912
10187
|
if (result.synced > 0) {
|
|
9913
|
-
|
|
10188
|
+
log2.success(`Synced ${result.synced} file(s) in apps/demo`);
|
|
9914
10189
|
} else if (result.errors === 0) {
|
|
9915
|
-
|
|
10190
|
+
log2.info("Demo app up to date");
|
|
9916
10191
|
}
|
|
9917
10192
|
if (result.preserved > 0) {
|
|
9918
|
-
|
|
10193
|
+
log2.info(`Preserved ${result.preserved} customized file(s)`);
|
|
9919
10194
|
}
|
|
9920
10195
|
}
|
|
9921
10196
|
if (updateCockpitApp) {
|
|
9922
|
-
|
|
10197
|
+
log2.info("Syncing cockpit app...");
|
|
9923
10198
|
const result = await syncApp("dndev", { dryRun });
|
|
9924
10199
|
if (result.synced > 0) {
|
|
9925
|
-
|
|
10200
|
+
log2.success(`Synced ${result.synced} file(s) in apps/dndev`);
|
|
9926
10201
|
} else if (result.errors === 0) {
|
|
9927
|
-
|
|
10202
|
+
log2.info("Cockpit app up to date");
|
|
9928
10203
|
}
|
|
9929
10204
|
if (result.preserved > 0) {
|
|
9930
|
-
|
|
10205
|
+
log2.info(`Preserved ${result.preserved} customized file(s)`);
|
|
9931
10206
|
}
|
|
9932
10207
|
}
|
|
9933
|
-
|
|
10208
|
+
outro("");
|
|
9934
10209
|
return 0;
|
|
9935
10210
|
}
|
|
9936
10211
|
export {
|