@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,17 +404,17 @@ var require_src = __commonJS({
|
|
|
447
404
|
var ESC2 = "\x1B";
|
|
448
405
|
var CSI2 = `${ESC2}[`;
|
|
449
406
|
var beep = "\x07";
|
|
450
|
-
var
|
|
451
|
-
to(x,
|
|
452
|
-
if (!
|
|
453
|
-
return `${CSI2}${
|
|
407
|
+
var cursor3 = {
|
|
408
|
+
to(x, y) {
|
|
409
|
+
if (!y) return `${CSI2}${x + 1}G`;
|
|
410
|
+
return `${CSI2}${y + 1};${x + 1}H`;
|
|
454
411
|
},
|
|
455
|
-
move(x,
|
|
412
|
+
move(x, y) {
|
|
456
413
|
let ret = "";
|
|
457
414
|
if (x < 0) ret += `${CSI2}${-x}D`;
|
|
458
415
|
else if (x > 0) ret += `${CSI2}${x}C`;
|
|
459
|
-
if (
|
|
460
|
-
else if (
|
|
416
|
+
if (y < 0) ret += `${CSI2}${-y}A`;
|
|
417
|
+
else if (y > 0) ret += `${CSI2}${y}B`;
|
|
461
418
|
return ret;
|
|
462
419
|
},
|
|
463
420
|
up: (count = 1) => `${CSI2}${count}A`,
|
|
@@ -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,200 +442,314 @@ 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 { ReadStream
|
|
504
|
-
function
|
|
505
|
-
if (typeof
|
|
506
|
-
|
|
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 { ReadStream } from "node:tty";
|
|
461
|
+
function isActionKey(n2, e) {
|
|
462
|
+
if (typeof n2 == "string")
|
|
463
|
+
return settings.aliases.get(n2) === e;
|
|
464
|
+
for (const s of n2)
|
|
465
|
+
if (s !== void 0 && isActionKey(s, e))
|
|
466
|
+
return true;
|
|
507
467
|
return false;
|
|
508
468
|
}
|
|
509
|
-
function
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
469
|
+
function block({
|
|
470
|
+
input: e = stdin,
|
|
471
|
+
output: r2 = stdout,
|
|
472
|
+
overwrite: o = true,
|
|
473
|
+
hideCursor: n2 = true
|
|
474
|
+
} = {}) {
|
|
475
|
+
const s = l.createInterface({
|
|
476
|
+
input: e,
|
|
477
|
+
output: r2,
|
|
478
|
+
prompt: "",
|
|
479
|
+
tabSize: 1
|
|
480
|
+
});
|
|
481
|
+
l.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(true);
|
|
482
|
+
const t2 = (f, { name: a2, sequence: w }) => {
|
|
483
|
+
const c = String(f);
|
|
484
|
+
if (isActionKey([c, a2, w], "cancel")) {
|
|
485
|
+
n2 && r2.write(import_sisteransi.cursor.show), process.exit(0);
|
|
516
486
|
return;
|
|
517
487
|
}
|
|
518
|
-
if (!
|
|
519
|
-
const
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
488
|
+
if (!o) return;
|
|
489
|
+
const i2 = a2 === "return" ? 0 : -1, m = a2 === "return" ? -1 : 0;
|
|
490
|
+
l.moveCursor(r2, i2, m, () => {
|
|
491
|
+
l.clearLine(r2, 1, () => {
|
|
492
|
+
e.once("keypress", t2);
|
|
523
493
|
});
|
|
524
494
|
});
|
|
525
495
|
};
|
|
526
|
-
return
|
|
527
|
-
|
|
496
|
+
return n2 && r2.write(import_sisteransi.cursor.hide), e.once("keypress", t2), () => {
|
|
497
|
+
e.off("keypress", t2), n2 && r2.write(import_sisteransi.cursor.show), e instanceof ReadStream && e.isTTY && !R && e.setRawMode(false), s.terminal = false, s.close();
|
|
528
498
|
};
|
|
529
499
|
}
|
|
530
|
-
var import_sisteransi,
|
|
500
|
+
var import_sisteransi, a$1, t, settings, R, getColumns;
|
|
531
501
|
var init_dist3 = __esm({
|
|
532
|
-
"node_modules/.bun/@clack+core@1.
|
|
502
|
+
"node_modules/.bun/@clack+core@1.5.0/node_modules/@clack/core/dist/index.mjs"() {
|
|
533
503
|
init_utils2();
|
|
534
504
|
init_main();
|
|
535
505
|
import_sisteransi = __toESM(require_src(), 1);
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
506
|
+
a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
507
|
+
t = [
|
|
508
|
+
"January",
|
|
509
|
+
"February",
|
|
510
|
+
"March",
|
|
511
|
+
"April",
|
|
512
|
+
"May",
|
|
513
|
+
"June",
|
|
514
|
+
"July",
|
|
515
|
+
"August",
|
|
516
|
+
"September",
|
|
517
|
+
"October",
|
|
518
|
+
"November",
|
|
519
|
+
"December"
|
|
520
|
+
];
|
|
521
|
+
settings = {
|
|
522
|
+
actions: new Set(a$1),
|
|
523
|
+
aliases: /* @__PURE__ */ new Map([
|
|
524
|
+
// vim support
|
|
525
|
+
["k", "up"],
|
|
526
|
+
["j", "down"],
|
|
527
|
+
["h", "left"],
|
|
528
|
+
["l", "right"],
|
|
529
|
+
["", "cancel"],
|
|
530
|
+
// opinionated defaults!
|
|
531
|
+
["escape", "cancel"]
|
|
532
|
+
]),
|
|
533
|
+
messages: {
|
|
534
|
+
cancel: "Canceled",
|
|
535
|
+
error: "Something went wrong"
|
|
536
|
+
},
|
|
537
|
+
withGuide: true,
|
|
538
|
+
accessible: void 0,
|
|
539
|
+
date: {
|
|
540
|
+
monthNames: [...t],
|
|
541
|
+
messages: {
|
|
542
|
+
required: "Please enter a valid date",
|
|
543
|
+
invalidMonth: "There are only 12 months in a year",
|
|
544
|
+
invalidDay: (n2, e) => `There are only ${n2} days in ${e}`,
|
|
545
|
+
afterMin: (n2) => `Date must be on or after ${n2.toISOString().slice(0, 10)}`,
|
|
546
|
+
beforeMax: (n2) => `Date must be on or before ${n2.toISOString().slice(0, 10)}`
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
};
|
|
550
|
+
R = globalThis.process.platform.startsWith("win");
|
|
551
|
+
getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
|
|
541
552
|
}
|
|
542
553
|
});
|
|
543
554
|
|
|
544
|
-
// node_modules/.bun/@clack+prompts@1.
|
|
545
|
-
import { styleText as
|
|
546
|
-
import
|
|
547
|
-
import { existsSync
|
|
548
|
-
import { dirname
|
|
549
|
-
function
|
|
550
|
-
|
|
555
|
+
// node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs
|
|
556
|
+
import { styleText as styleText2, stripVTControlCharacters } from "node:util";
|
|
557
|
+
import process$1 from "node:process";
|
|
558
|
+
import { existsSync, lstatSync, readdirSync } from "node:fs";
|
|
559
|
+
import { dirname, join } from "node:path";
|
|
560
|
+
function isUnicodeSupported() {
|
|
561
|
+
if (process$1.platform !== "win32") {
|
|
562
|
+
return process$1.env.TERM !== "linux";
|
|
563
|
+
}
|
|
564
|
+
return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
551
565
|
}
|
|
552
|
-
var import_sisteransi2,
|
|
566
|
+
var import_sisteransi2, unicode, isCI, unicodeOr, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_BAR_START, S_BAR, S_BAR_END, S_BAR_START_RIGHT, S_BAR_END_RIGHT, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, S_PASSWORD_MASK, S_BAR_H, S_CORNER_TOP_RIGHT, S_CONNECT_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_BOTTOM_LEFT, S_CORNER_TOP_LEFT, S_INFO, S_SUCCESS, S_WARN, S_ERROR, MULTISELECT_INSTRUCTIONS, log, intro, outro, W, spinner, u2, SELECT_INSTRUCTIONS, i;
|
|
553
567
|
var init_dist4 = __esm({
|
|
554
|
-
"node_modules/.bun/@clack+prompts@1.
|
|
568
|
+
"node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs"() {
|
|
555
569
|
init_utils2();
|
|
556
570
|
init_dist3();
|
|
557
571
|
init_dist3();
|
|
558
572
|
init_main();
|
|
559
573
|
init_dist2();
|
|
560
574
|
import_sisteransi2 = __toESM(require_src(), 1);
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
575
|
+
unicode = isUnicodeSupported();
|
|
576
|
+
isCI = () => process.env.CI === "true";
|
|
577
|
+
unicodeOr = (o, e) => unicode ? o : e;
|
|
578
|
+
S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
|
|
579
|
+
S_STEP_CANCEL = unicodeOr("\u25A0", "x");
|
|
580
|
+
S_STEP_ERROR = unicodeOr("\u25B2", "x");
|
|
581
|
+
S_STEP_SUBMIT = unicodeOr("\u25C7", "o");
|
|
582
|
+
S_BAR_START = unicodeOr("\u250C", "T");
|
|
583
|
+
S_BAR = unicodeOr("\u2502", "|");
|
|
584
|
+
S_BAR_END = unicodeOr("\u2514", "\u2014");
|
|
585
|
+
S_BAR_START_RIGHT = unicodeOr("\u2510", "T");
|
|
586
|
+
S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014");
|
|
587
|
+
S_RADIO_ACTIVE = unicodeOr("\u25CF", ">");
|
|
588
|
+
S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
|
|
589
|
+
S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
|
|
590
|
+
S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
|
|
591
|
+
S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
|
|
592
|
+
S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022");
|
|
593
|
+
S_BAR_H = unicodeOr("\u2500", "-");
|
|
594
|
+
S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+");
|
|
595
|
+
S_CONNECT_LEFT = unicodeOr("\u251C", "+");
|
|
596
|
+
S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+");
|
|
597
|
+
S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+");
|
|
598
|
+
S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+");
|
|
599
|
+
S_INFO = unicodeOr("\u25CF", "\u2022");
|
|
600
|
+
S_SUCCESS = unicodeOr("\u25C6", "*");
|
|
601
|
+
S_WARN = unicodeOr("\u25B2", "!");
|
|
602
|
+
S_ERROR = unicodeOr("\u25A0", "x");
|
|
603
|
+
MULTISELECT_INSTRUCTIONS = [
|
|
604
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
605
|
+
`${styleText2("dim", "Space:")} select`,
|
|
606
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
607
|
+
];
|
|
608
|
+
log = {
|
|
609
|
+
message: (s = [], {
|
|
610
|
+
symbol: e = styleText2("gray", S_BAR),
|
|
611
|
+
secondarySymbol: r2 = styleText2("gray", S_BAR),
|
|
612
|
+
output: m = process.stdout,
|
|
613
|
+
spacing: l2 = 1,
|
|
614
|
+
withGuide: c
|
|
615
|
+
} = {}) => {
|
|
616
|
+
const t2 = [], o = c ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
|
|
617
|
+
for (let i2 = 0; i2 < l2; i2++)
|
|
618
|
+
t2.push(f);
|
|
619
|
+
const g = Array.isArray(s) ? s : s.split(`
|
|
593
620
|
`);
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
621
|
+
if (g.length > 0) {
|
|
622
|
+
const [i2, ...y] = g;
|
|
623
|
+
i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
|
|
624
|
+
for (const p of y)
|
|
625
|
+
p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
|
|
626
|
+
}
|
|
627
|
+
m.write(`${t2.join(`
|
|
600
628
|
`)}
|
|
601
629
|
`);
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
630
|
+
},
|
|
631
|
+
info: (s, e) => {
|
|
632
|
+
log.message(s, { ...e, symbol: styleText2("blue", S_INFO) });
|
|
633
|
+
},
|
|
634
|
+
success: (s, e) => {
|
|
635
|
+
log.message(s, { ...e, symbol: styleText2("green", S_SUCCESS) });
|
|
636
|
+
},
|
|
637
|
+
step: (s, e) => {
|
|
638
|
+
log.message(s, { ...e, symbol: styleText2("green", S_STEP_SUBMIT) });
|
|
639
|
+
},
|
|
640
|
+
warn: (s, e) => {
|
|
641
|
+
log.message(s, { ...e, symbol: styleText2("yellow", S_WARN) });
|
|
642
|
+
},
|
|
643
|
+
/** alias for `log.warn()`. */
|
|
644
|
+
warning: (s, e) => {
|
|
645
|
+
log.warn(s, e);
|
|
646
|
+
},
|
|
647
|
+
error: (s, e) => {
|
|
648
|
+
log.message(s, { ...e, symbol: styleText2("red", S_ERROR) });
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
intro = (o = "", t2) => {
|
|
652
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_START)} ` : "";
|
|
653
|
+
i2.write(`${e}${o}
|
|
618
654
|
`);
|
|
619
655
|
};
|
|
620
|
-
|
|
621
|
-
const
|
|
622
|
-
${
|
|
623
|
-
|
|
656
|
+
outro = (o = "", t2) => {
|
|
657
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR)}
|
|
658
|
+
${styleText2("gray", S_BAR_END)} ` : "";
|
|
659
|
+
i2.write(`${e}${o}
|
|
624
660
|
|
|
625
661
|
`);
|
|
626
662
|
};
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
663
|
+
W = (l2) => styleText2("magenta", l2);
|
|
664
|
+
spinner = ({
|
|
665
|
+
indicator: l2 = "dots",
|
|
666
|
+
onCancel: h2,
|
|
667
|
+
output: n2 = process.stdout,
|
|
668
|
+
cancelMessage: G,
|
|
669
|
+
errorMessage: O,
|
|
670
|
+
frames: E = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
|
|
671
|
+
delay: F = unicode ? 80 : 120,
|
|
672
|
+
signal: m,
|
|
673
|
+
...I
|
|
674
|
+
} = {}) => {
|
|
675
|
+
const u3 = isCI();
|
|
676
|
+
let M, T, d = false, S = false, s = "", p, w = performance.now();
|
|
677
|
+
const x = getColumns(n2), k = I?.styleFrame ?? W, g = (e) => {
|
|
678
|
+
const r2 = e > 1 ? O ?? settings.messages.error : G ?? settings.messages.cancel;
|
|
679
|
+
S = e === 1, d && (a2(r2, e), S && typeof h2 == "function" && h2());
|
|
680
|
+
}, f = () => g(2), i2 = () => g(1), A = () => {
|
|
681
|
+
process.on("uncaughtExceptionMonitor", f), process.on("unhandledRejection", f), process.on("SIGINT", i2), process.on("SIGTERM", i2), process.on("exit", g), m && m.addEventListener("abort", i2);
|
|
682
|
+
}, H = () => {
|
|
683
|
+
process.removeListener("uncaughtExceptionMonitor", f), process.removeListener("unhandledRejection", f), process.removeListener("SIGINT", i2), process.removeListener("SIGTERM", i2), process.removeListener("exit", g), m && m.removeEventListener("abort", i2);
|
|
684
|
+
}, y = () => {
|
|
685
|
+
if (p === void 0) return;
|
|
686
|
+
u3 && n2.write(`
|
|
641
687
|
`);
|
|
642
|
-
const
|
|
688
|
+
const r2 = wrapAnsi(p, x, {
|
|
689
|
+
hard: true,
|
|
690
|
+
trim: false
|
|
691
|
+
}).split(`
|
|
643
692
|
`);
|
|
644
|
-
|
|
645
|
-
},
|
|
646
|
-
const
|
|
647
|
-
return
|
|
648
|
-
},
|
|
649
|
-
|
|
693
|
+
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());
|
|
694
|
+
}, C = (e) => e.replace(/\.+$/, ""), _ = (e) => {
|
|
695
|
+
const r2 = (performance.now() - e) / 1e3, t2 = Math.floor(r2 / 60), o = Math.floor(r2 % 60);
|
|
696
|
+
return t2 > 0 ? `[${t2}m ${o}s]` : `[${o}s]`;
|
|
697
|
+
}, N = I.withGuide ?? settings.withGuide, P = (e = "") => {
|
|
698
|
+
d = true, M = block({ output: n2 }), s = C(e), w = performance.now(), N && n2.write(`${styleText2("gray", S_BAR)}
|
|
650
699
|
`);
|
|
651
|
-
let
|
|
652
|
-
|
|
653
|
-
if (
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
700
|
+
let r2 = 0, t2 = 0;
|
|
701
|
+
A(), T = setInterval(() => {
|
|
702
|
+
if (u3 && s === p)
|
|
703
|
+
return;
|
|
704
|
+
y(), p = s;
|
|
705
|
+
const o = k(E[r2]);
|
|
706
|
+
let v;
|
|
707
|
+
if (u3)
|
|
708
|
+
v = `${o} ${s}...`;
|
|
709
|
+
else if (l2 === "timer")
|
|
710
|
+
v = `${o} ${s} ${_(w)}`;
|
|
659
711
|
else {
|
|
660
|
-
const
|
|
661
|
-
|
|
662
|
-
}
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
712
|
+
const B = ".".repeat(Math.floor(t2)).slice(0, 3);
|
|
713
|
+
v = `${o} ${s}${B}`;
|
|
714
|
+
}
|
|
715
|
+
const j = wrapAnsi(v, x, {
|
|
716
|
+
hard: true,
|
|
717
|
+
trim: false
|
|
718
|
+
});
|
|
719
|
+
n2.write(j), r2 = r2 + 1 < E.length ? r2 + 1 : 0, t2 = t2 < 4 ? t2 + 0.125 : 0;
|
|
720
|
+
}, F);
|
|
721
|
+
}, a2 = (e = "", r2 = 0, t2 = false) => {
|
|
722
|
+
if (!d) return;
|
|
723
|
+
d = false, clearInterval(T), y();
|
|
724
|
+
const o = r2 === 0 ? styleText2("green", S_STEP_SUBMIT) : r2 === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
|
|
725
|
+
s = e ?? s, t2 || (l2 === "timer" ? n2.write(`${o} ${s} ${_(w)}
|
|
726
|
+
`) : n2.write(`${o} ${s}
|
|
727
|
+
`)), H(), M();
|
|
673
728
|
};
|
|
674
|
-
return {
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
729
|
+
return {
|
|
730
|
+
start: P,
|
|
731
|
+
stop: (e = "") => a2(e, 0),
|
|
732
|
+
message: (e = "") => {
|
|
733
|
+
s = C(e ?? s);
|
|
734
|
+
},
|
|
735
|
+
cancel: (e = "") => a2(e, 1),
|
|
736
|
+
error: (e = "") => a2(e, 2),
|
|
737
|
+
clear: () => a2("", 0, true),
|
|
738
|
+
get isCancelled() {
|
|
739
|
+
return S;
|
|
740
|
+
}
|
|
741
|
+
};
|
|
742
|
+
};
|
|
743
|
+
u2 = {
|
|
744
|
+
light: unicodeOr("\u2500", "-"),
|
|
745
|
+
heavy: unicodeOr("\u2501", "="),
|
|
746
|
+
block: unicodeOr("\u2588", "#")
|
|
747
|
+
};
|
|
748
|
+
SELECT_INSTRUCTIONS = [
|
|
749
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
750
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
751
|
+
];
|
|
752
|
+
i = `${styleText2("gray", S_BAR)} `;
|
|
682
753
|
}
|
|
683
754
|
});
|
|
684
755
|
|
|
@@ -743,9 +814,9 @@ ${contextStr}`;
|
|
|
743
814
|
|
|
744
815
|
Original error: ${originalMsg}`;
|
|
745
816
|
}
|
|
746
|
-
|
|
817
|
+
log.error(message);
|
|
747
818
|
}
|
|
748
|
-
var colors, colorUtils, currentLogLevel,
|
|
819
|
+
var colors, colorUtils, currentLogLevel, log2, error, warn, info, success;
|
|
749
820
|
var init_cli_output = __esm({
|
|
750
821
|
"packages/tooling/src/utils/cli-output.ts"() {
|
|
751
822
|
"use strict";
|
|
@@ -783,7 +854,7 @@ var init_cli_output = __esm({
|
|
|
783
854
|
currentLogLevel = envLevel;
|
|
784
855
|
}
|
|
785
856
|
}
|
|
786
|
-
|
|
857
|
+
log2 = {
|
|
787
858
|
/**
|
|
788
859
|
* Logs an error message (always shows unless Quiet level)
|
|
789
860
|
* Uses clack's log.error + explicit red color
|
|
@@ -791,7 +862,7 @@ var init_cli_output = __esm({
|
|
|
791
862
|
error(...args) {
|
|
792
863
|
if (currentLogLevel < 0 /* Quiet */) return;
|
|
793
864
|
const message = formatMessage(...args);
|
|
794
|
-
|
|
865
|
+
log.error(colorize(message, colors.brightRed));
|
|
795
866
|
},
|
|
796
867
|
/**
|
|
797
868
|
* Logs a warning message (shows at Normal level and above)
|
|
@@ -800,7 +871,7 @@ var init_cli_output = __esm({
|
|
|
800
871
|
warn(...args) {
|
|
801
872
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
802
873
|
const message = formatMessage(...args);
|
|
803
|
-
|
|
874
|
+
log.warn(colorize(message, colors.brightYellow));
|
|
804
875
|
},
|
|
805
876
|
/**
|
|
806
877
|
* Logs an info message (shows at Normal level and above)
|
|
@@ -809,7 +880,7 @@ var init_cli_output = __esm({
|
|
|
809
880
|
info(...args) {
|
|
810
881
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
811
882
|
const message = formatMessage(...args);
|
|
812
|
-
|
|
883
|
+
log.info(colorize(message, colors.brightCyan));
|
|
813
884
|
},
|
|
814
885
|
/**
|
|
815
886
|
* Logs a success message (shows at Normal level and above)
|
|
@@ -818,7 +889,7 @@ var init_cli_output = __esm({
|
|
|
818
889
|
success(...args) {
|
|
819
890
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
820
891
|
const message = formatMessage(...args);
|
|
821
|
-
|
|
892
|
+
log.success(colorize(message, colors.brightGreen));
|
|
822
893
|
},
|
|
823
894
|
/**
|
|
824
895
|
* Logs a debug message (only shows at Verbose level and above)
|
|
@@ -827,7 +898,7 @@ var init_cli_output = __esm({
|
|
|
827
898
|
debug(...args) {
|
|
828
899
|
if (currentLogLevel < 2 /* Verbose */) return;
|
|
829
900
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
830
|
-
|
|
901
|
+
log.message(
|
|
831
902
|
colorize(
|
|
832
903
|
`[${timeStamp}] \u{1F50D} DEBUG: ${formatMessage(...args)}`,
|
|
833
904
|
colors.gray
|
|
@@ -841,7 +912,7 @@ var init_cli_output = __esm({
|
|
|
841
912
|
trace(...args) {
|
|
842
913
|
if (currentLogLevel < 3 /* Debug */) return;
|
|
843
914
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
844
|
-
|
|
915
|
+
log.message(
|
|
845
916
|
colorize(
|
|
846
917
|
`[${timeStamp}] \u{1F52C} TRACE: ${formatMessage(...args)}`,
|
|
847
918
|
colors.gray
|
|
@@ -849,10 +920,10 @@ var init_cli_output = __esm({
|
|
|
849
920
|
);
|
|
850
921
|
}
|
|
851
922
|
};
|
|
852
|
-
error =
|
|
853
|
-
warn =
|
|
854
|
-
info =
|
|
855
|
-
success =
|
|
923
|
+
error = log2.error.bind(log2);
|
|
924
|
+
warn = log2.warn.bind(log2);
|
|
925
|
+
info = log2.info.bind(log2);
|
|
926
|
+
success = log2.success.bind(log2);
|
|
856
927
|
}
|
|
857
928
|
});
|
|
858
929
|
|
|
@@ -1212,9 +1283,9 @@ var require_is_glob = __commonJS({
|
|
|
1212
1283
|
index += 2;
|
|
1213
1284
|
var close = chars[open];
|
|
1214
1285
|
if (close) {
|
|
1215
|
-
var
|
|
1216
|
-
if (
|
|
1217
|
-
index =
|
|
1286
|
+
var n2 = str.indexOf(close, index);
|
|
1287
|
+
if (n2 !== -1) {
|
|
1288
|
+
index = n2 + 1;
|
|
1218
1289
|
}
|
|
1219
1290
|
}
|
|
1220
1291
|
if (str[index] === "!") {
|
|
@@ -1240,9 +1311,9 @@ var require_is_glob = __commonJS({
|
|
|
1240
1311
|
index += 2;
|
|
1241
1312
|
var close = chars[open];
|
|
1242
1313
|
if (close) {
|
|
1243
|
-
var
|
|
1244
|
-
if (
|
|
1245
|
-
index =
|
|
1314
|
+
var n2 = str.indexOf(close, index);
|
|
1315
|
+
if (n2 !== -1) {
|
|
1316
|
+
index = n2 + 1;
|
|
1246
1317
|
}
|
|
1247
1318
|
}
|
|
1248
1319
|
if (str[index] === "!") {
|
|
@@ -1320,8 +1391,8 @@ var require_utils = __commonJS({
|
|
|
1320
1391
|
if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
|
|
1321
1392
|
return (Number(max) - Number(min)) / Number(step) >= limit;
|
|
1322
1393
|
};
|
|
1323
|
-
exports.escapeNode = (
|
|
1324
|
-
const node =
|
|
1394
|
+
exports.escapeNode = (block2, n2 = 0, type) => {
|
|
1395
|
+
const node = block2.nodes[n2];
|
|
1325
1396
|
if (!node) return;
|
|
1326
1397
|
if (type && node.type === type || node.type === "open" || node.type === "close") {
|
|
1327
1398
|
if (node.escaped !== true) {
|
|
@@ -1338,15 +1409,15 @@ var require_utils = __commonJS({
|
|
|
1338
1409
|
}
|
|
1339
1410
|
return false;
|
|
1340
1411
|
};
|
|
1341
|
-
exports.isInvalidBrace = (
|
|
1342
|
-
if (
|
|
1343
|
-
if (
|
|
1344
|
-
if (
|
|
1345
|
-
|
|
1412
|
+
exports.isInvalidBrace = (block2) => {
|
|
1413
|
+
if (block2.type !== "brace") return false;
|
|
1414
|
+
if (block2.invalid === true || block2.dollar) return true;
|
|
1415
|
+
if (block2.commas >> 0 + block2.ranges >> 0 === 0) {
|
|
1416
|
+
block2.invalid = true;
|
|
1346
1417
|
return true;
|
|
1347
1418
|
}
|
|
1348
|
-
if (
|
|
1349
|
-
|
|
1419
|
+
if (block2.open !== true || block2.close !== true) {
|
|
1420
|
+
block2.invalid = true;
|
|
1350
1421
|
return true;
|
|
1351
1422
|
}
|
|
1352
1423
|
return false;
|
|
@@ -1365,8 +1436,8 @@ var require_utils = __commonJS({
|
|
|
1365
1436
|
exports.flatten = (...args) => {
|
|
1366
1437
|
const result = [];
|
|
1367
1438
|
const flat = (arr) => {
|
|
1368
|
-
for (let
|
|
1369
|
-
const ele = arr[
|
|
1439
|
+
for (let i2 = 0; i2 < arr.length; i2++) {
|
|
1440
|
+
const ele = arr[i2];
|
|
1370
1441
|
if (Array.isArray(ele)) {
|
|
1371
1442
|
flat(ele);
|
|
1372
1443
|
continue;
|
|
@@ -1460,9 +1531,9 @@ var require_to_regex_range = __commonJS({
|
|
|
1460
1531
|
if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
|
|
1461
1532
|
return toRegexRange.cache[cacheKey].result;
|
|
1462
1533
|
}
|
|
1463
|
-
let
|
|
1534
|
+
let a2 = Math.min(min, max);
|
|
1464
1535
|
let b = Math.max(min, max);
|
|
1465
|
-
if (Math.abs(
|
|
1536
|
+
if (Math.abs(a2 - b) === 1) {
|
|
1466
1537
|
let result = min + "|" + max;
|
|
1467
1538
|
if (opts.capture) {
|
|
1468
1539
|
return `(${result})`;
|
|
@@ -1473,20 +1544,20 @@ var require_to_regex_range = __commonJS({
|
|
|
1473
1544
|
return `(?:${result})`;
|
|
1474
1545
|
}
|
|
1475
1546
|
let isPadded = hasPadding(min) || hasPadding(max);
|
|
1476
|
-
let state = { min, max, a, b };
|
|
1547
|
+
let state = { min, max, a: a2, b };
|
|
1477
1548
|
let positives = [];
|
|
1478
1549
|
let negatives = [];
|
|
1479
1550
|
if (isPadded) {
|
|
1480
1551
|
state.isPadded = isPadded;
|
|
1481
1552
|
state.maxLen = String(state.max).length;
|
|
1482
1553
|
}
|
|
1483
|
-
if (
|
|
1554
|
+
if (a2 < 0) {
|
|
1484
1555
|
let newMin = b < 0 ? Math.abs(b) : 1;
|
|
1485
|
-
negatives = splitToPatterns(newMin, Math.abs(
|
|
1486
|
-
|
|
1556
|
+
negatives = splitToPatterns(newMin, Math.abs(a2), state, opts);
|
|
1557
|
+
a2 = state.a = 0;
|
|
1487
1558
|
}
|
|
1488
1559
|
if (b >= 0) {
|
|
1489
|
-
positives = splitToPatterns(
|
|
1560
|
+
positives = splitToPatterns(a2, b, state, opts);
|
|
1490
1561
|
}
|
|
1491
1562
|
state.negatives = negatives;
|
|
1492
1563
|
state.positives = positives;
|
|
@@ -1534,8 +1605,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1534
1605
|
let digits = zipped.length;
|
|
1535
1606
|
let pattern = "";
|
|
1536
1607
|
let count = 0;
|
|
1537
|
-
for (let
|
|
1538
|
-
let [startDigit, stopDigit] = zipped[
|
|
1608
|
+
for (let i2 = 0; i2 < digits; i2++) {
|
|
1609
|
+
let [startDigit, stopDigit] = zipped[i2];
|
|
1539
1610
|
if (startDigit === stopDigit) {
|
|
1540
1611
|
pattern += startDigit;
|
|
1541
1612
|
} else if (startDigit !== "0" || stopDigit !== "9") {
|
|
@@ -1554,8 +1625,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1554
1625
|
let tokens = [];
|
|
1555
1626
|
let start = min;
|
|
1556
1627
|
let prev;
|
|
1557
|
-
for (let
|
|
1558
|
-
let max2 = ranges[
|
|
1628
|
+
for (let i2 = 0; i2 < ranges.length; i2++) {
|
|
1629
|
+
let max2 = ranges[i2];
|
|
1559
1630
|
let obj = rangeToPattern(String(start), String(max2), options);
|
|
1560
1631
|
let zeros = "";
|
|
1561
1632
|
if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
|
|
@@ -1590,13 +1661,13 @@ var require_to_regex_range = __commonJS({
|
|
|
1590
1661
|
}
|
|
1591
1662
|
return result;
|
|
1592
1663
|
}
|
|
1593
|
-
function zip(
|
|
1664
|
+
function zip(a2, b) {
|
|
1594
1665
|
let arr = [];
|
|
1595
|
-
for (let
|
|
1666
|
+
for (let i2 = 0; i2 < a2.length; i2++) arr.push([a2[i2], b[i2]]);
|
|
1596
1667
|
return arr;
|
|
1597
1668
|
}
|
|
1598
|
-
function compare(
|
|
1599
|
-
return
|
|
1669
|
+
function compare(a2, b) {
|
|
1670
|
+
return a2 > b ? 1 : b > a2 ? -1 : 0;
|
|
1600
1671
|
}
|
|
1601
1672
|
function contains(arr, key, val) {
|
|
1602
1673
|
return arr.some((ele) => ele[key] === val);
|
|
@@ -1614,8 +1685,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1614
1685
|
}
|
|
1615
1686
|
return "";
|
|
1616
1687
|
}
|
|
1617
|
-
function toCharacterClass(
|
|
1618
|
-
return `[${
|
|
1688
|
+
function toCharacterClass(a2, b, options) {
|
|
1689
|
+
return `[${a2}${b - a2 === 1 ? "" : "-"}${b}]`;
|
|
1619
1690
|
}
|
|
1620
1691
|
function hasPadding(str) {
|
|
1621
1692
|
return /^-?(0+)\d/.test(str);
|
|
@@ -1694,8 +1765,8 @@ var require_fill_range = __commonJS({
|
|
|
1694
1765
|
return negative ? "-" + input : input;
|
|
1695
1766
|
};
|
|
1696
1767
|
var toSequence = (parts, options, maxLen) => {
|
|
1697
|
-
parts.negatives.sort((
|
|
1698
|
-
parts.positives.sort((
|
|
1768
|
+
parts.negatives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
1769
|
+
parts.positives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
1699
1770
|
let prefix = options.capture ? "" : "?:";
|
|
1700
1771
|
let positives = "";
|
|
1701
1772
|
let negatives = "";
|
|
@@ -1716,12 +1787,12 @@ var require_fill_range = __commonJS({
|
|
|
1716
1787
|
}
|
|
1717
1788
|
return result;
|
|
1718
1789
|
};
|
|
1719
|
-
var toRange = (
|
|
1790
|
+
var toRange = (a2, b, isNumbers, options) => {
|
|
1720
1791
|
if (isNumbers) {
|
|
1721
|
-
return toRegexRange(
|
|
1792
|
+
return toRegexRange(a2, b, { wrap: false, ...options });
|
|
1722
1793
|
}
|
|
1723
|
-
let start = String.fromCharCode(
|
|
1724
|
-
if (
|
|
1794
|
+
let start = String.fromCharCode(a2);
|
|
1795
|
+
if (a2 === b) return start;
|
|
1725
1796
|
let stop = String.fromCharCode(b);
|
|
1726
1797
|
return `[${start}-${stop}]`;
|
|
1727
1798
|
};
|
|
@@ -1747,15 +1818,15 @@ var require_fill_range = __commonJS({
|
|
|
1747
1818
|
return [];
|
|
1748
1819
|
};
|
|
1749
1820
|
var fillNumbers = (start, end, step = 1, options = {}) => {
|
|
1750
|
-
let
|
|
1821
|
+
let a2 = Number(start);
|
|
1751
1822
|
let b = Number(end);
|
|
1752
|
-
if (!Number.isInteger(
|
|
1823
|
+
if (!Number.isInteger(a2) || !Number.isInteger(b)) {
|
|
1753
1824
|
if (options.strictRanges === true) throw rangeError([start, end]);
|
|
1754
1825
|
return [];
|
|
1755
1826
|
}
|
|
1756
|
-
if (
|
|
1827
|
+
if (a2 === 0) a2 = 0;
|
|
1757
1828
|
if (b === 0) b = 0;
|
|
1758
|
-
let descending =
|
|
1829
|
+
let descending = a2 > b;
|
|
1759
1830
|
let startString = String(start);
|
|
1760
1831
|
let endString = String(end);
|
|
1761
1832
|
let stepString = String(step);
|
|
@@ -1771,13 +1842,13 @@ var require_fill_range = __commonJS({
|
|
|
1771
1842
|
let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
|
|
1772
1843
|
let range = [];
|
|
1773
1844
|
let index = 0;
|
|
1774
|
-
while (descending ?
|
|
1845
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
1775
1846
|
if (options.toRegex === true && step > 1) {
|
|
1776
|
-
push(
|
|
1847
|
+
push(a2);
|
|
1777
1848
|
} else {
|
|
1778
|
-
range.push(pad(format(
|
|
1849
|
+
range.push(pad(format(a2, index), maxLen, toNumber));
|
|
1779
1850
|
}
|
|
1780
|
-
|
|
1851
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
1781
1852
|
index++;
|
|
1782
1853
|
}
|
|
1783
1854
|
if (options.toRegex === true) {
|
|
@@ -1790,19 +1861,19 @@ var require_fill_range = __commonJS({
|
|
|
1790
1861
|
return invalidRange(start, end, options);
|
|
1791
1862
|
}
|
|
1792
1863
|
let format = options.transform || ((val) => String.fromCharCode(val));
|
|
1793
|
-
let
|
|
1864
|
+
let a2 = `${start}`.charCodeAt(0);
|
|
1794
1865
|
let b = `${end}`.charCodeAt(0);
|
|
1795
|
-
let descending =
|
|
1796
|
-
let min = Math.min(
|
|
1797
|
-
let max = Math.max(
|
|
1866
|
+
let descending = a2 > b;
|
|
1867
|
+
let min = Math.min(a2, b);
|
|
1868
|
+
let max = Math.max(a2, b);
|
|
1798
1869
|
if (options.toRegex && step === 1) {
|
|
1799
1870
|
return toRange(min, max, false, options);
|
|
1800
1871
|
}
|
|
1801
1872
|
let range = [];
|
|
1802
1873
|
let index = 0;
|
|
1803
|
-
while (descending ?
|
|
1804
|
-
range.push(format(
|
|
1805
|
-
|
|
1874
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
1875
|
+
range.push(format(a2, index));
|
|
1876
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
1806
1877
|
index++;
|
|
1807
1878
|
}
|
|
1808
1879
|
if (options.toRegex === true) {
|
|
@@ -1926,17 +1997,17 @@ var require_expand = __commonJS({
|
|
|
1926
1997
|
const walk = (node, parent = {}) => {
|
|
1927
1998
|
node.queue = [];
|
|
1928
1999
|
let p = parent;
|
|
1929
|
-
let
|
|
2000
|
+
let q = parent.queue;
|
|
1930
2001
|
while (p.type !== "brace" && p.type !== "root" && p.parent) {
|
|
1931
2002
|
p = p.parent;
|
|
1932
|
-
|
|
2003
|
+
q = p.queue;
|
|
1933
2004
|
}
|
|
1934
2005
|
if (node.invalid || node.dollar) {
|
|
1935
|
-
|
|
2006
|
+
q.push(append(q.pop(), stringify2(node, options)));
|
|
1936
2007
|
return;
|
|
1937
2008
|
}
|
|
1938
2009
|
if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
|
|
1939
|
-
|
|
2010
|
+
q.push(append(q.pop(), ["{}"]));
|
|
1940
2011
|
return;
|
|
1941
2012
|
}
|
|
1942
2013
|
if (node.nodes && node.ranges > 0) {
|
|
@@ -1948,26 +2019,26 @@ var require_expand = __commonJS({
|
|
|
1948
2019
|
if (range.length === 0) {
|
|
1949
2020
|
range = stringify2(node, options);
|
|
1950
2021
|
}
|
|
1951
|
-
|
|
2022
|
+
q.push(append(q.pop(), range));
|
|
1952
2023
|
node.nodes = [];
|
|
1953
2024
|
return;
|
|
1954
2025
|
}
|
|
1955
2026
|
const enclose = utils.encloseBrace(node);
|
|
1956
2027
|
let queue = node.queue;
|
|
1957
|
-
let
|
|
1958
|
-
while (
|
|
1959
|
-
|
|
1960
|
-
queue =
|
|
2028
|
+
let block2 = node;
|
|
2029
|
+
while (block2.type !== "brace" && block2.type !== "root" && block2.parent) {
|
|
2030
|
+
block2 = block2.parent;
|
|
2031
|
+
queue = block2.queue;
|
|
1961
2032
|
}
|
|
1962
|
-
for (let
|
|
1963
|
-
const child = node.nodes[
|
|
2033
|
+
for (let i2 = 0; i2 < node.nodes.length; i2++) {
|
|
2034
|
+
const child = node.nodes[i2];
|
|
1964
2035
|
if (child.type === "comma" && node.type === "brace") {
|
|
1965
|
-
if (
|
|
2036
|
+
if (i2 === 1) queue.push("");
|
|
1966
2037
|
queue.push("");
|
|
1967
2038
|
continue;
|
|
1968
2039
|
}
|
|
1969
2040
|
if (child.type === "close") {
|
|
1970
|
-
|
|
2041
|
+
q.push(append(q.pop(), queue, enclose));
|
|
1971
2042
|
continue;
|
|
1972
2043
|
}
|
|
1973
2044
|
if (child.value && child.type !== "open") {
|
|
@@ -2134,7 +2205,7 @@ var require_parse = __commonJS({
|
|
|
2134
2205
|
}
|
|
2135
2206
|
const ast = { type: "root", input, nodes: [] };
|
|
2136
2207
|
const stack = [ast];
|
|
2137
|
-
let
|
|
2208
|
+
let block2 = ast;
|
|
2138
2209
|
let prev = ast;
|
|
2139
2210
|
let brackets = 0;
|
|
2140
2211
|
const length = input.length;
|
|
@@ -2150,15 +2221,15 @@ var require_parse = __commonJS({
|
|
|
2150
2221
|
prev.value += node.value;
|
|
2151
2222
|
return;
|
|
2152
2223
|
}
|
|
2153
|
-
|
|
2154
|
-
node.parent =
|
|
2224
|
+
block2.nodes.push(node);
|
|
2225
|
+
node.parent = block2;
|
|
2155
2226
|
node.prev = prev;
|
|
2156
2227
|
prev = node;
|
|
2157
2228
|
return node;
|
|
2158
2229
|
};
|
|
2159
2230
|
push({ type: "bos" });
|
|
2160
2231
|
while (index < length) {
|
|
2161
|
-
|
|
2232
|
+
block2 = stack[stack.length - 1];
|
|
2162
2233
|
value = advance();
|
|
2163
2234
|
if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
|
|
2164
2235
|
continue;
|
|
@@ -2195,19 +2266,19 @@ var require_parse = __commonJS({
|
|
|
2195
2266
|
continue;
|
|
2196
2267
|
}
|
|
2197
2268
|
if (value === CHAR_LEFT_PARENTHESES) {
|
|
2198
|
-
|
|
2199
|
-
stack.push(
|
|
2269
|
+
block2 = push({ type: "paren", nodes: [] });
|
|
2270
|
+
stack.push(block2);
|
|
2200
2271
|
push({ type: "text", value });
|
|
2201
2272
|
continue;
|
|
2202
2273
|
}
|
|
2203
2274
|
if (value === CHAR_RIGHT_PARENTHESES) {
|
|
2204
|
-
if (
|
|
2275
|
+
if (block2.type !== "paren") {
|
|
2205
2276
|
push({ type: "text", value });
|
|
2206
2277
|
continue;
|
|
2207
2278
|
}
|
|
2208
|
-
|
|
2279
|
+
block2 = stack.pop();
|
|
2209
2280
|
push({ type: "text", value });
|
|
2210
|
-
|
|
2281
|
+
block2 = stack[stack.length - 1];
|
|
2211
2282
|
continue;
|
|
2212
2283
|
}
|
|
2213
2284
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
@@ -2232,7 +2303,7 @@ var require_parse = __commonJS({
|
|
|
2232
2303
|
}
|
|
2233
2304
|
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
2234
2305
|
depth++;
|
|
2235
|
-
const dollar = prev.value && prev.value.slice(-1) === "$" ||
|
|
2306
|
+
const dollar = prev.value && prev.value.slice(-1) === "$" || block2.dollar === true;
|
|
2236
2307
|
const brace = {
|
|
2237
2308
|
type: "brace",
|
|
2238
2309
|
open: true,
|
|
@@ -2243,52 +2314,52 @@ var require_parse = __commonJS({
|
|
|
2243
2314
|
ranges: 0,
|
|
2244
2315
|
nodes: []
|
|
2245
2316
|
};
|
|
2246
|
-
|
|
2247
|
-
stack.push(
|
|
2317
|
+
block2 = push(brace);
|
|
2318
|
+
stack.push(block2);
|
|
2248
2319
|
push({ type: "open", value });
|
|
2249
2320
|
continue;
|
|
2250
2321
|
}
|
|
2251
2322
|
if (value === CHAR_RIGHT_CURLY_BRACE) {
|
|
2252
|
-
if (
|
|
2323
|
+
if (block2.type !== "brace") {
|
|
2253
2324
|
push({ type: "text", value });
|
|
2254
2325
|
continue;
|
|
2255
2326
|
}
|
|
2256
2327
|
const type = "close";
|
|
2257
|
-
|
|
2258
|
-
|
|
2328
|
+
block2 = stack.pop();
|
|
2329
|
+
block2.close = true;
|
|
2259
2330
|
push({ type, value });
|
|
2260
2331
|
depth--;
|
|
2261
|
-
|
|
2332
|
+
block2 = stack[stack.length - 1];
|
|
2262
2333
|
continue;
|
|
2263
2334
|
}
|
|
2264
2335
|
if (value === CHAR_COMMA && depth > 0) {
|
|
2265
|
-
if (
|
|
2266
|
-
|
|
2267
|
-
const open =
|
|
2268
|
-
|
|
2336
|
+
if (block2.ranges > 0) {
|
|
2337
|
+
block2.ranges = 0;
|
|
2338
|
+
const open = block2.nodes.shift();
|
|
2339
|
+
block2.nodes = [open, { type: "text", value: stringify2(block2) }];
|
|
2269
2340
|
}
|
|
2270
2341
|
push({ type: "comma", value });
|
|
2271
|
-
|
|
2342
|
+
block2.commas++;
|
|
2272
2343
|
continue;
|
|
2273
2344
|
}
|
|
2274
|
-
if (value === CHAR_DOT && depth > 0 &&
|
|
2275
|
-
const siblings =
|
|
2345
|
+
if (value === CHAR_DOT && depth > 0 && block2.commas === 0) {
|
|
2346
|
+
const siblings = block2.nodes;
|
|
2276
2347
|
if (depth === 0 || siblings.length === 0) {
|
|
2277
2348
|
push({ type: "text", value });
|
|
2278
2349
|
continue;
|
|
2279
2350
|
}
|
|
2280
2351
|
if (prev.type === "dot") {
|
|
2281
|
-
|
|
2352
|
+
block2.range = [];
|
|
2282
2353
|
prev.value += value;
|
|
2283
2354
|
prev.type = "range";
|
|
2284
|
-
if (
|
|
2285
|
-
|
|
2286
|
-
|
|
2355
|
+
if (block2.nodes.length !== 3 && block2.nodes.length !== 5) {
|
|
2356
|
+
block2.invalid = true;
|
|
2357
|
+
block2.ranges = 0;
|
|
2287
2358
|
prev.type = "text";
|
|
2288
2359
|
continue;
|
|
2289
2360
|
}
|
|
2290
|
-
|
|
2291
|
-
|
|
2361
|
+
block2.ranges++;
|
|
2362
|
+
block2.args = [];
|
|
2292
2363
|
continue;
|
|
2293
2364
|
}
|
|
2294
2365
|
if (prev.type === "range") {
|
|
@@ -2296,7 +2367,7 @@ var require_parse = __commonJS({
|
|
|
2296
2367
|
const before = siblings[siblings.length - 1];
|
|
2297
2368
|
before.value += prev.value + value;
|
|
2298
2369
|
prev = before;
|
|
2299
|
-
|
|
2370
|
+
block2.ranges--;
|
|
2300
2371
|
continue;
|
|
2301
2372
|
}
|
|
2302
2373
|
push({ type: "dot", value });
|
|
@@ -2305,9 +2376,9 @@ var require_parse = __commonJS({
|
|
|
2305
2376
|
push({ type: "text", value });
|
|
2306
2377
|
}
|
|
2307
2378
|
do {
|
|
2308
|
-
|
|
2309
|
-
if (
|
|
2310
|
-
|
|
2379
|
+
block2 = stack.pop();
|
|
2380
|
+
if (block2.type !== "root") {
|
|
2381
|
+
block2.nodes.forEach((node) => {
|
|
2311
2382
|
if (!node.nodes) {
|
|
2312
2383
|
if (node.type === "open") node.isOpen = true;
|
|
2313
2384
|
if (node.type === "close") node.isClose = true;
|
|
@@ -2316,8 +2387,8 @@ var require_parse = __commonJS({
|
|
|
2316
2387
|
}
|
|
2317
2388
|
});
|
|
2318
2389
|
const parent = stack[stack.length - 1];
|
|
2319
|
-
const index2 = parent.nodes.indexOf(
|
|
2320
|
-
parent.nodes.splice(index2, 1, ...
|
|
2390
|
+
const index2 = parent.nodes.indexOf(block2);
|
|
2391
|
+
parent.nodes.splice(index2, 1, ...block2.nodes);
|
|
2321
2392
|
}
|
|
2322
2393
|
} while (stack.length > 0);
|
|
2323
2394
|
push({ type: "eos" });
|
|
@@ -2950,9 +3021,9 @@ var require_scan = __commonJS({
|
|
|
2950
3021
|
if (opts.parts === true || opts.tokens === true) {
|
|
2951
3022
|
let prevIndex;
|
|
2952
3023
|
for (let idx = 0; idx < slashes.length; idx++) {
|
|
2953
|
-
const
|
|
2954
|
-
const
|
|
2955
|
-
const value = input.slice(
|
|
3024
|
+
const n2 = prevIndex ? prevIndex + 1 : start;
|
|
3025
|
+
const i2 = slashes[idx];
|
|
3026
|
+
const value = input.slice(n2, i2);
|
|
2956
3027
|
if (opts.tokens) {
|
|
2957
3028
|
if (idx === 0 && start !== 0) {
|
|
2958
3029
|
tokens[idx].isPrefix = true;
|
|
@@ -2966,7 +3037,7 @@ var require_scan = __commonJS({
|
|
|
2966
3037
|
if (idx !== 0 || value !== "") {
|
|
2967
3038
|
parts.push(value);
|
|
2968
3039
|
}
|
|
2969
|
-
prevIndex =
|
|
3040
|
+
prevIndex = i2;
|
|
2970
3041
|
}
|
|
2971
3042
|
if (prevIndex && prevIndex + 1 < input.length) {
|
|
2972
3043
|
const value = input.slice(prevIndex + 1);
|
|
@@ -3095,15 +3166,15 @@ var require_parse2 = __commonJS({
|
|
|
3095
3166
|
};
|
|
3096
3167
|
var hasRepeatedCharPrefixOverlap = (branches) => {
|
|
3097
3168
|
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
3098
|
-
for (let
|
|
3099
|
-
for (let j =
|
|
3100
|
-
const
|
|
3169
|
+
for (let i2 = 0; i2 < values.length; i2++) {
|
|
3170
|
+
for (let j = i2 + 1; j < values.length; j++) {
|
|
3171
|
+
const a2 = values[i2];
|
|
3101
3172
|
const b = values[j];
|
|
3102
|
-
const char =
|
|
3103
|
-
if (!char ||
|
|
3173
|
+
const char = a2[0];
|
|
3174
|
+
if (!char || a2 !== char.repeat(a2.length) || b !== char.repeat(b.length)) {
|
|
3104
3175
|
continue;
|
|
3105
3176
|
}
|
|
3106
|
-
if (
|
|
3177
|
+
if (a2 === b || a2.startsWith(b) || b.startsWith(a2)) {
|
|
3107
3178
|
return true;
|
|
3108
3179
|
}
|
|
3109
3180
|
}
|
|
@@ -3118,8 +3189,8 @@ var require_parse2 = __commonJS({
|
|
|
3118
3189
|
let paren = 0;
|
|
3119
3190
|
let quote = 0;
|
|
3120
3191
|
let escaped = false;
|
|
3121
|
-
for (let
|
|
3122
|
-
const ch = pattern[
|
|
3192
|
+
for (let i2 = 1; i2 < pattern.length; i2++) {
|
|
3193
|
+
const ch = pattern[i2];
|
|
3123
3194
|
if (escaped === true) {
|
|
3124
3195
|
escaped = false;
|
|
3125
3196
|
continue;
|
|
@@ -3153,13 +3224,13 @@ var require_parse2 = __commonJS({
|
|
|
3153
3224
|
if (ch === ")") {
|
|
3154
3225
|
paren--;
|
|
3155
3226
|
if (paren === 0) {
|
|
3156
|
-
if (requireEnd === true &&
|
|
3227
|
+
if (requireEnd === true && i2 !== pattern.length - 1) {
|
|
3157
3228
|
return;
|
|
3158
3229
|
}
|
|
3159
3230
|
return {
|
|
3160
3231
|
type: pattern[0],
|
|
3161
|
-
body: pattern.slice(2,
|
|
3162
|
-
end:
|
|
3232
|
+
body: pattern.slice(2, i2),
|
|
3233
|
+
end: i2
|
|
3163
3234
|
};
|
|
3164
3235
|
}
|
|
3165
3236
|
}
|
|
@@ -3291,7 +3362,7 @@ var require_parse2 = __commonJS({
|
|
|
3291
3362
|
let prev = bos;
|
|
3292
3363
|
let value;
|
|
3293
3364
|
const eos = () => state.index === len - 1;
|
|
3294
|
-
const peek = state.peek = (
|
|
3365
|
+
const peek = state.peek = (n2 = 1) => input[state.index + n2];
|
|
3295
3366
|
const advance = state.advance = () => input[++state.index] || "";
|
|
3296
3367
|
const remaining = () => input.slice(state.index + 1);
|
|
3297
3368
|
const consume = (value2 = "", num = 0) => {
|
|
@@ -3372,10 +3443,10 @@ var require_parse2 = __commonJS({
|
|
|
3372
3443
|
open.type = "text";
|
|
3373
3444
|
open.value = literal;
|
|
3374
3445
|
open.output = safeOutput || utils.escapeRegex(literal);
|
|
3375
|
-
for (let
|
|
3376
|
-
tokens[
|
|
3377
|
-
tokens[
|
|
3378
|
-
delete tokens[
|
|
3446
|
+
for (let i2 = token.tokensIndex + 1; i2 < tokens.length; i2++) {
|
|
3447
|
+
tokens[i2].value = "";
|
|
3448
|
+
tokens[i2].output = "";
|
|
3449
|
+
delete tokens[i2].suffix;
|
|
3379
3450
|
}
|
|
3380
3451
|
state.output = token.output + open.output;
|
|
3381
3452
|
state.backtrack = true;
|
|
@@ -3618,13 +3689,13 @@ var require_parse2 = __commonJS({
|
|
|
3618
3689
|
if (brace.dots === true) {
|
|
3619
3690
|
const arr = tokens.slice();
|
|
3620
3691
|
const range = [];
|
|
3621
|
-
for (let
|
|
3692
|
+
for (let i2 = arr.length - 1; i2 >= 0; i2--) {
|
|
3622
3693
|
tokens.pop();
|
|
3623
|
-
if (arr[
|
|
3694
|
+
if (arr[i2].type === "brace") {
|
|
3624
3695
|
break;
|
|
3625
3696
|
}
|
|
3626
|
-
if (arr[
|
|
3627
|
-
range.unshift(arr[
|
|
3697
|
+
if (arr[i2].type !== "dots") {
|
|
3698
|
+
range.unshift(arr[i2].value);
|
|
3628
3699
|
}
|
|
3629
3700
|
}
|
|
3630
3701
|
output = expandRange(range, opts);
|
|
@@ -4167,8 +4238,8 @@ var require_micromatch = __commonJS({
|
|
|
4167
4238
|
options.onResult(state);
|
|
4168
4239
|
}
|
|
4169
4240
|
};
|
|
4170
|
-
for (let
|
|
4171
|
-
let isMatch = picomatch(String(patterns[
|
|
4241
|
+
for (let i2 = 0; i2 < patterns.length; i2++) {
|
|
4242
|
+
let isMatch = picomatch(String(patterns[i2]), { ...options, onResult }, true);
|
|
4172
4243
|
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
|
|
4173
4244
|
if (negated) negatives++;
|
|
4174
4245
|
for (let item of list) {
|
|
@@ -4416,7 +4487,7 @@ var require_pattern = __commonJS({
|
|
|
4416
4487
|
exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
|
4417
4488
|
function expandBraceExpansion(pattern) {
|
|
4418
4489
|
const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });
|
|
4419
|
-
patterns.sort((
|
|
4490
|
+
patterns.sort((a2, b) => a2.length - b.length);
|
|
4420
4491
|
return patterns.filter((pattern2) => pattern2 !== "");
|
|
4421
4492
|
}
|
|
4422
4493
|
exports.expandBraceExpansion = expandBraceExpansion;
|
|
@@ -4497,8 +4568,8 @@ var require_merge2 = __commonJS({
|
|
|
4497
4568
|
}
|
|
4498
4569
|
const mergedStream = PassThrough(options);
|
|
4499
4570
|
function addStream() {
|
|
4500
|
-
for (let
|
|
4501
|
-
streamsQueue.push(pauseStreams(arguments[
|
|
4571
|
+
for (let i2 = 0, len = arguments.length; i2 < len; i2++) {
|
|
4572
|
+
streamsQueue.push(pauseStreams(arguments[i2], options));
|
|
4502
4573
|
}
|
|
4503
4574
|
mergeStream();
|
|
4504
4575
|
return this;
|
|
@@ -4547,8 +4618,8 @@ var require_merge2 = __commonJS({
|
|
|
4547
4618
|
stream.pipe(mergedStream, { end: false });
|
|
4548
4619
|
stream.resume();
|
|
4549
4620
|
}
|
|
4550
|
-
for (let
|
|
4551
|
-
pipe(streams[
|
|
4621
|
+
for (let i2 = 0; i2 < streams.length; i2++) {
|
|
4622
|
+
pipe(streams[i2]);
|
|
4552
4623
|
}
|
|
4553
4624
|
next();
|
|
4554
4625
|
}
|
|
@@ -4579,8 +4650,8 @@ var require_merge2 = __commonJS({
|
|
|
4579
4650
|
}
|
|
4580
4651
|
streams.pause();
|
|
4581
4652
|
} else {
|
|
4582
|
-
for (let
|
|
4583
|
-
streams[
|
|
4653
|
+
for (let i2 = 0, len = streams.length; i2 < len; i2++) {
|
|
4654
|
+
streams[i2] = pauseStreams(streams[i2], options);
|
|
4584
4655
|
}
|
|
4585
4656
|
}
|
|
4586
4657
|
return streams;
|
|
@@ -4662,13 +4733,13 @@ var require_tasks = __commonJS({
|
|
|
4662
4733
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4663
4734
|
exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
|
|
4664
4735
|
var utils = require_utils3();
|
|
4665
|
-
function generate(input,
|
|
4666
|
-
const patterns = processPatterns(input,
|
|
4667
|
-
const ignore = processPatterns(
|
|
4736
|
+
function generate(input, settings2) {
|
|
4737
|
+
const patterns = processPatterns(input, settings2);
|
|
4738
|
+
const ignore = processPatterns(settings2.ignore, settings2);
|
|
4668
4739
|
const positivePatterns = getPositivePatterns(patterns);
|
|
4669
4740
|
const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
|
|
4670
|
-
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern,
|
|
4671
|
-
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern,
|
|
4741
|
+
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings2));
|
|
4742
|
+
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings2));
|
|
4672
4743
|
const staticTasks = convertPatternsToTasks(
|
|
4673
4744
|
staticPatterns,
|
|
4674
4745
|
negativePatterns,
|
|
@@ -4684,12 +4755,12 @@ var require_tasks = __commonJS({
|
|
|
4684
4755
|
return staticTasks.concat(dynamicTasks);
|
|
4685
4756
|
}
|
|
4686
4757
|
exports.generate = generate;
|
|
4687
|
-
function processPatterns(input,
|
|
4758
|
+
function processPatterns(input, settings2) {
|
|
4688
4759
|
let patterns = input;
|
|
4689
|
-
if (
|
|
4760
|
+
if (settings2.braceExpansion) {
|
|
4690
4761
|
patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);
|
|
4691
4762
|
}
|
|
4692
|
-
if (
|
|
4763
|
+
if (settings2.baseNameMatch) {
|
|
4693
4764
|
patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`);
|
|
4694
4765
|
}
|
|
4695
4766
|
return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));
|
|
@@ -4758,26 +4829,26 @@ var require_async = __commonJS({
|
|
|
4758
4829
|
init_utils2();
|
|
4759
4830
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4760
4831
|
exports.read = void 0;
|
|
4761
|
-
function read(path,
|
|
4762
|
-
|
|
4832
|
+
function read(path, settings2, callback) {
|
|
4833
|
+
settings2.fs.lstat(path, (lstatError, lstat) => {
|
|
4763
4834
|
if (lstatError !== null) {
|
|
4764
4835
|
callFailureCallback(callback, lstatError);
|
|
4765
4836
|
return;
|
|
4766
4837
|
}
|
|
4767
|
-
if (!lstat.isSymbolicLink() || !
|
|
4838
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
4768
4839
|
callSuccessCallback(callback, lstat);
|
|
4769
4840
|
return;
|
|
4770
4841
|
}
|
|
4771
|
-
|
|
4842
|
+
settings2.fs.stat(path, (statError, stat) => {
|
|
4772
4843
|
if (statError !== null) {
|
|
4773
|
-
if (
|
|
4844
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4774
4845
|
callFailureCallback(callback, statError);
|
|
4775
4846
|
return;
|
|
4776
4847
|
}
|
|
4777
4848
|
callSuccessCallback(callback, lstat);
|
|
4778
4849
|
return;
|
|
4779
4850
|
}
|
|
4780
|
-
if (
|
|
4851
|
+
if (settings2.markSymbolicLink) {
|
|
4781
4852
|
stat.isSymbolicLink = () => true;
|
|
4782
4853
|
}
|
|
4783
4854
|
callSuccessCallback(callback, stat);
|
|
@@ -4801,19 +4872,19 @@ var require_sync = __commonJS({
|
|
|
4801
4872
|
init_utils2();
|
|
4802
4873
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4803
4874
|
exports.read = void 0;
|
|
4804
|
-
function read(path,
|
|
4805
|
-
const lstat =
|
|
4806
|
-
if (!lstat.isSymbolicLink() || !
|
|
4875
|
+
function read(path, settings2) {
|
|
4876
|
+
const lstat = settings2.fs.lstatSync(path);
|
|
4877
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
4807
4878
|
return lstat;
|
|
4808
4879
|
}
|
|
4809
4880
|
try {
|
|
4810
|
-
const stat =
|
|
4811
|
-
if (
|
|
4881
|
+
const stat = settings2.fs.statSync(path);
|
|
4882
|
+
if (settings2.markSymbolicLink) {
|
|
4812
4883
|
stat.isSymbolicLink = () => true;
|
|
4813
4884
|
}
|
|
4814
4885
|
return stat;
|
|
4815
4886
|
} catch (error2) {
|
|
4816
|
-
if (!
|
|
4887
|
+
if (!settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4817
4888
|
return lstat;
|
|
4818
4889
|
}
|
|
4819
4890
|
throw error2;
|
|
@@ -4890,8 +4961,8 @@ var require_out = __commonJS({
|
|
|
4890
4961
|
}
|
|
4891
4962
|
exports.stat = stat;
|
|
4892
4963
|
function statSync2(path, optionsOrSettings) {
|
|
4893
|
-
const
|
|
4894
|
-
return sync.read(path,
|
|
4964
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
4965
|
+
return sync.read(path, settings2);
|
|
4895
4966
|
}
|
|
4896
4967
|
exports.statSync = statSync2;
|
|
4897
4968
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -4939,8 +5010,8 @@ var require_run_parallel = __commonJS({
|
|
|
4939
5010
|
if (isSync) queueMicrotask2(end);
|
|
4940
5011
|
else end();
|
|
4941
5012
|
}
|
|
4942
|
-
function each(
|
|
4943
|
-
results[
|
|
5013
|
+
function each(i2, err, result) {
|
|
5014
|
+
results[i2] = result;
|
|
4944
5015
|
if (--pending === 0 || err) {
|
|
4945
5016
|
done(err);
|
|
4946
5017
|
}
|
|
@@ -4954,9 +5025,9 @@ var require_run_parallel = __commonJS({
|
|
|
4954
5025
|
});
|
|
4955
5026
|
});
|
|
4956
5027
|
} else {
|
|
4957
|
-
tasks.forEach(function(task,
|
|
5028
|
+
tasks.forEach(function(task, i2) {
|
|
4958
5029
|
task(function(err, result) {
|
|
4959
|
-
each(
|
|
5030
|
+
each(i2, err, result);
|
|
4960
5031
|
});
|
|
4961
5032
|
});
|
|
4962
5033
|
}
|
|
@@ -5031,11 +5102,11 @@ var require_common = __commonJS({
|
|
|
5031
5102
|
init_utils2();
|
|
5032
5103
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5033
5104
|
exports.joinPathSegments = void 0;
|
|
5034
|
-
function joinPathSegments(
|
|
5035
|
-
if (
|
|
5036
|
-
return
|
|
5105
|
+
function joinPathSegments(a2, b, separator) {
|
|
5106
|
+
if (a2.endsWith(separator)) {
|
|
5107
|
+
return a2 + b;
|
|
5037
5108
|
}
|
|
5038
|
-
return
|
|
5109
|
+
return a2 + separator + b;
|
|
5039
5110
|
}
|
|
5040
5111
|
exports.joinPathSegments = joinPathSegments;
|
|
5041
5112
|
}
|
|
@@ -5053,16 +5124,16 @@ var require_async2 = __commonJS({
|
|
|
5053
5124
|
var constants_1 = require_constants3();
|
|
5054
5125
|
var utils = require_utils4();
|
|
5055
5126
|
var common = require_common();
|
|
5056
|
-
function read(directory,
|
|
5057
|
-
if (!
|
|
5058
|
-
readdirWithFileTypes(directory,
|
|
5127
|
+
function read(directory, settings2, callback) {
|
|
5128
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
5129
|
+
readdirWithFileTypes(directory, settings2, callback);
|
|
5059
5130
|
return;
|
|
5060
5131
|
}
|
|
5061
|
-
readdir(directory,
|
|
5132
|
+
readdir(directory, settings2, callback);
|
|
5062
5133
|
}
|
|
5063
5134
|
exports.read = read;
|
|
5064
|
-
function readdirWithFileTypes(directory,
|
|
5065
|
-
|
|
5135
|
+
function readdirWithFileTypes(directory, settings2, callback) {
|
|
5136
|
+
settings2.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
|
|
5066
5137
|
if (readdirError !== null) {
|
|
5067
5138
|
callFailureCallback(callback, readdirError);
|
|
5068
5139
|
return;
|
|
@@ -5070,13 +5141,13 @@ var require_async2 = __commonJS({
|
|
|
5070
5141
|
const entries = dirents.map((dirent) => ({
|
|
5071
5142
|
dirent,
|
|
5072
5143
|
name: dirent.name,
|
|
5073
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
5144
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
5074
5145
|
}));
|
|
5075
|
-
if (!
|
|
5146
|
+
if (!settings2.followSymbolicLinks) {
|
|
5076
5147
|
callSuccessCallback(callback, entries);
|
|
5077
5148
|
return;
|
|
5078
5149
|
}
|
|
5079
|
-
const tasks = entries.map((entry) => makeRplTaskEntry(entry,
|
|
5150
|
+
const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings2));
|
|
5080
5151
|
rpl(tasks, (rplError, rplEntries) => {
|
|
5081
5152
|
if (rplError !== null) {
|
|
5082
5153
|
callFailureCallback(callback, rplError);
|
|
@@ -5087,15 +5158,15 @@ var require_async2 = __commonJS({
|
|
|
5087
5158
|
});
|
|
5088
5159
|
}
|
|
5089
5160
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
5090
|
-
function makeRplTaskEntry(entry,
|
|
5161
|
+
function makeRplTaskEntry(entry, settings2) {
|
|
5091
5162
|
return (done) => {
|
|
5092
5163
|
if (!entry.dirent.isSymbolicLink()) {
|
|
5093
5164
|
done(null, entry);
|
|
5094
5165
|
return;
|
|
5095
5166
|
}
|
|
5096
|
-
|
|
5167
|
+
settings2.fs.stat(entry.path, (statError, stats) => {
|
|
5097
5168
|
if (statError !== null) {
|
|
5098
|
-
if (
|
|
5169
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5099
5170
|
done(statError);
|
|
5100
5171
|
return;
|
|
5101
5172
|
}
|
|
@@ -5107,16 +5178,16 @@ var require_async2 = __commonJS({
|
|
|
5107
5178
|
});
|
|
5108
5179
|
};
|
|
5109
5180
|
}
|
|
5110
|
-
function readdir(directory,
|
|
5111
|
-
|
|
5181
|
+
function readdir(directory, settings2, callback) {
|
|
5182
|
+
settings2.fs.readdir(directory, (readdirError, names) => {
|
|
5112
5183
|
if (readdirError !== null) {
|
|
5113
5184
|
callFailureCallback(callback, readdirError);
|
|
5114
5185
|
return;
|
|
5115
5186
|
}
|
|
5116
5187
|
const tasks = names.map((name) => {
|
|
5117
|
-
const path = common.joinPathSegments(directory, name,
|
|
5188
|
+
const path = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
5118
5189
|
return (done) => {
|
|
5119
|
-
fsStat.stat(path,
|
|
5190
|
+
fsStat.stat(path, settings2.fsStatSettings, (error2, stats) => {
|
|
5120
5191
|
if (error2 !== null) {
|
|
5121
5192
|
done(error2);
|
|
5122
5193
|
return;
|
|
@@ -5126,7 +5197,7 @@ var require_async2 = __commonJS({
|
|
|
5126
5197
|
path,
|
|
5127
5198
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
5128
5199
|
};
|
|
5129
|
-
if (
|
|
5200
|
+
if (settings2.stats) {
|
|
5130
5201
|
entry.stats = stats;
|
|
5131
5202
|
}
|
|
5132
5203
|
done(null, entry);
|
|
@@ -5163,27 +5234,27 @@ var require_sync2 = __commonJS({
|
|
|
5163
5234
|
var constants_1 = require_constants3();
|
|
5164
5235
|
var utils = require_utils4();
|
|
5165
5236
|
var common = require_common();
|
|
5166
|
-
function read(directory,
|
|
5167
|
-
if (!
|
|
5168
|
-
return readdirWithFileTypes(directory,
|
|
5237
|
+
function read(directory, settings2) {
|
|
5238
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
5239
|
+
return readdirWithFileTypes(directory, settings2);
|
|
5169
5240
|
}
|
|
5170
|
-
return readdir(directory,
|
|
5241
|
+
return readdir(directory, settings2);
|
|
5171
5242
|
}
|
|
5172
5243
|
exports.read = read;
|
|
5173
|
-
function readdirWithFileTypes(directory,
|
|
5174
|
-
const dirents =
|
|
5244
|
+
function readdirWithFileTypes(directory, settings2) {
|
|
5245
|
+
const dirents = settings2.fs.readdirSync(directory, { withFileTypes: true });
|
|
5175
5246
|
return dirents.map((dirent) => {
|
|
5176
5247
|
const entry = {
|
|
5177
5248
|
dirent,
|
|
5178
5249
|
name: dirent.name,
|
|
5179
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
5250
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
5180
5251
|
};
|
|
5181
|
-
if (entry.dirent.isSymbolicLink() &&
|
|
5252
|
+
if (entry.dirent.isSymbolicLink() && settings2.followSymbolicLinks) {
|
|
5182
5253
|
try {
|
|
5183
|
-
const stats =
|
|
5254
|
+
const stats = settings2.fs.statSync(entry.path);
|
|
5184
5255
|
entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
|
5185
5256
|
} catch (error2) {
|
|
5186
|
-
if (
|
|
5257
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5187
5258
|
throw error2;
|
|
5188
5259
|
}
|
|
5189
5260
|
}
|
|
@@ -5192,17 +5263,17 @@ var require_sync2 = __commonJS({
|
|
|
5192
5263
|
});
|
|
5193
5264
|
}
|
|
5194
5265
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
5195
|
-
function readdir(directory,
|
|
5196
|
-
const names =
|
|
5266
|
+
function readdir(directory, settings2) {
|
|
5267
|
+
const names = settings2.fs.readdirSync(directory);
|
|
5197
5268
|
return names.map((name) => {
|
|
5198
|
-
const entryPath = common.joinPathSegments(directory, name,
|
|
5199
|
-
const stats = fsStat.statSync(entryPath,
|
|
5269
|
+
const entryPath = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
5270
|
+
const stats = fsStat.statSync(entryPath, settings2.fsStatSettings);
|
|
5200
5271
|
const entry = {
|
|
5201
5272
|
name,
|
|
5202
5273
|
path: entryPath,
|
|
5203
5274
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
5204
5275
|
};
|
|
5205
|
-
if (
|
|
5276
|
+
if (settings2.stats) {
|
|
5206
5277
|
entry.stats = stats;
|
|
5207
5278
|
}
|
|
5208
5279
|
return entry;
|
|
@@ -5289,8 +5360,8 @@ var require_out2 = __commonJS({
|
|
|
5289
5360
|
}
|
|
5290
5361
|
exports.scandir = scandir;
|
|
5291
5362
|
function scandirSync(path, optionsOrSettings) {
|
|
5292
|
-
const
|
|
5293
|
-
return sync.read(path,
|
|
5363
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5364
|
+
return sync.read(path, settings2);
|
|
5294
5365
|
}
|
|
5295
5366
|
exports.scandirSync = scandirSync;
|
|
5296
5367
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -5626,11 +5697,11 @@ var require_common2 = __commonJS({
|
|
|
5626
5697
|
init_utils2();
|
|
5627
5698
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5628
5699
|
exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
|
|
5629
|
-
function isFatalError(
|
|
5630
|
-
if (
|
|
5700
|
+
function isFatalError(settings2, error2) {
|
|
5701
|
+
if (settings2.errorFilter === null) {
|
|
5631
5702
|
return true;
|
|
5632
5703
|
}
|
|
5633
|
-
return !
|
|
5704
|
+
return !settings2.errorFilter(error2);
|
|
5634
5705
|
}
|
|
5635
5706
|
exports.isFatalError = isFatalError;
|
|
5636
5707
|
function isAppliedFilter(filter, value) {
|
|
@@ -5641,14 +5712,14 @@ var require_common2 = __commonJS({
|
|
|
5641
5712
|
return filepath.split(/[/\\]/).join(separator);
|
|
5642
5713
|
}
|
|
5643
5714
|
exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
|
|
5644
|
-
function joinPathSegments(
|
|
5645
|
-
if (
|
|
5715
|
+
function joinPathSegments(a2, b, separator) {
|
|
5716
|
+
if (a2 === "") {
|
|
5646
5717
|
return b;
|
|
5647
5718
|
}
|
|
5648
|
-
if (
|
|
5649
|
-
return
|
|
5719
|
+
if (a2.endsWith(separator)) {
|
|
5720
|
+
return a2 + b;
|
|
5650
5721
|
}
|
|
5651
|
-
return
|
|
5722
|
+
return a2 + separator + b;
|
|
5652
5723
|
}
|
|
5653
5724
|
exports.joinPathSegments = joinPathSegments;
|
|
5654
5725
|
}
|
|
@@ -5995,14 +6066,14 @@ var require_out3 = __commonJS({
|
|
|
5995
6066
|
}
|
|
5996
6067
|
exports.walk = walk;
|
|
5997
6068
|
function walkSync(directory, optionsOrSettings) {
|
|
5998
|
-
const
|
|
5999
|
-
const provider = new sync_1.default(directory,
|
|
6069
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
6070
|
+
const provider = new sync_1.default(directory, settings2);
|
|
6000
6071
|
return provider.read();
|
|
6001
6072
|
}
|
|
6002
6073
|
exports.walkSync = walkSync;
|
|
6003
6074
|
function walkStream(directory, optionsOrSettings) {
|
|
6004
|
-
const
|
|
6005
|
-
const provider = new stream_1.default(directory,
|
|
6075
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
6076
|
+
const provider = new stream_1.default(directory, settings2);
|
|
6006
6077
|
return provider.read();
|
|
6007
6078
|
}
|
|
6008
6079
|
exports.walkStream = walkStream;
|
|
@@ -6088,8 +6159,8 @@ var require_stream3 = __commonJS({
|
|
|
6088
6159
|
done();
|
|
6089
6160
|
}).catch(done);
|
|
6090
6161
|
};
|
|
6091
|
-
for (let
|
|
6092
|
-
stream.write(
|
|
6162
|
+
for (let i2 = 0; i2 < filepaths.length; i2++) {
|
|
6163
|
+
stream.write(i2);
|
|
6093
6164
|
}
|
|
6094
6165
|
return stream;
|
|
6095
6166
|
}
|
|
@@ -6750,14 +6821,14 @@ var require_out4 = __commonJS({
|
|
|
6750
6821
|
function generateTasks(source, options) {
|
|
6751
6822
|
assertPatternsInput(source);
|
|
6752
6823
|
const patterns = [].concat(source);
|
|
6753
|
-
const
|
|
6754
|
-
return taskManager.generate(patterns,
|
|
6824
|
+
const settings2 = new settings_1.default(options);
|
|
6825
|
+
return taskManager.generate(patterns, settings2);
|
|
6755
6826
|
}
|
|
6756
6827
|
FastGlob2.generateTasks = generateTasks;
|
|
6757
6828
|
function isDynamicPattern(source, options) {
|
|
6758
6829
|
assertPatternsInput(source);
|
|
6759
|
-
const
|
|
6760
|
-
return utils.pattern.isDynamicPattern(source,
|
|
6830
|
+
const settings2 = new settings_1.default(options);
|
|
6831
|
+
return utils.pattern.isDynamicPattern(source, settings2);
|
|
6761
6832
|
}
|
|
6762
6833
|
FastGlob2.isDynamicPattern = isDynamicPattern;
|
|
6763
6834
|
function escapePath(source) {
|
|
@@ -6799,9 +6870,9 @@ var require_out4 = __commonJS({
|
|
|
6799
6870
|
})(FastGlob || (FastGlob = {}));
|
|
6800
6871
|
function getWorks(source, _Provider, options) {
|
|
6801
6872
|
const patterns = [].concat(source);
|
|
6802
|
-
const
|
|
6803
|
-
const tasks = taskManager.generate(patterns,
|
|
6804
|
-
const provider = new _Provider(
|
|
6873
|
+
const settings2 = new settings_1.default(options);
|
|
6874
|
+
const tasks = taskManager.generate(patterns, settings2);
|
|
6875
|
+
const provider = new _Provider(settings2);
|
|
6805
6876
|
return tasks.map(provider.read, provider);
|
|
6806
6877
|
}
|
|
6807
6878
|
function assertPatternsInput(input) {
|
|
@@ -6979,8 +7050,8 @@ import "node:fs";
|
|
|
6979
7050
|
import { createRequire } from "node:module";
|
|
6980
7051
|
import {
|
|
6981
7052
|
resolve,
|
|
6982
|
-
join,
|
|
6983
|
-
dirname,
|
|
7053
|
+
join as join2,
|
|
7054
|
+
dirname as dirname2,
|
|
6984
7055
|
relative,
|
|
6985
7056
|
normalize,
|
|
6986
7057
|
sep,
|
|
@@ -6994,7 +7065,7 @@ function safeExecuteAsync(fn, message) {
|
|
|
6994
7065
|
);
|
|
6995
7066
|
});
|
|
6996
7067
|
}
|
|
6997
|
-
var import_fast_glob, constants,
|
|
7068
|
+
var import_fast_glob, constants, log3, PACKAGE_PATHS, PathResolver;
|
|
6998
7069
|
var init_PathResolver = __esm({
|
|
6999
7070
|
"packages/core/config/utils/PathResolver.ts"() {
|
|
7000
7071
|
"use strict";
|
|
@@ -7007,7 +7078,7 @@ var init_PathResolver = __esm({
|
|
|
7007
7078
|
getPatternsFor: getPatternsFor || void 0,
|
|
7008
7079
|
I18N_PATHS: I18N_PATHS || void 0
|
|
7009
7080
|
};
|
|
7010
|
-
|
|
7081
|
+
log3 = {
|
|
7011
7082
|
error: (message, error2) => {
|
|
7012
7083
|
},
|
|
7013
7084
|
warn: (message, error2) => {
|
|
@@ -7128,7 +7199,7 @@ var init_PathResolver = __esm({
|
|
|
7128
7199
|
*/
|
|
7129
7200
|
getDirname(path) {
|
|
7130
7201
|
if (!path) return "";
|
|
7131
|
-
return this.normalizePath(
|
|
7202
|
+
return this.normalizePath(dirname2(path));
|
|
7132
7203
|
}
|
|
7133
7204
|
/**
|
|
7134
7205
|
* Resolve package path using Node's module resolution
|
|
@@ -7140,7 +7211,7 @@ var init_PathResolver = __esm({
|
|
|
7140
7211
|
resolvePackage(packageSpecifier, fromPath = null) {
|
|
7141
7212
|
try {
|
|
7142
7213
|
const basePath = fromPath || this.getAppRoot();
|
|
7143
|
-
const require3 = createRequire(
|
|
7214
|
+
const require3 = createRequire(join2(basePath, "package.json"));
|
|
7144
7215
|
const resolved = require3.resolve(packageSpecifier);
|
|
7145
7216
|
return this.normalizePath(resolved);
|
|
7146
7217
|
} catch (error2) {
|
|
@@ -7292,7 +7363,7 @@ var init_PathResolver = __esm({
|
|
|
7292
7363
|
return cleanContent;
|
|
7293
7364
|
} catch (error2) {
|
|
7294
7365
|
if (this.options.debug) {
|
|
7295
|
-
|
|
7366
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
7296
7367
|
}
|
|
7297
7368
|
return null;
|
|
7298
7369
|
}
|
|
@@ -7320,7 +7391,7 @@ var init_PathResolver = __esm({
|
|
|
7320
7391
|
return cleanContent;
|
|
7321
7392
|
} catch (error2) {
|
|
7322
7393
|
if (this.options.debug) {
|
|
7323
|
-
|
|
7394
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
7324
7395
|
}
|
|
7325
7396
|
return null;
|
|
7326
7397
|
}
|
|
@@ -7342,16 +7413,16 @@ var init_PathResolver = __esm({
|
|
|
7342
7413
|
verbose = false
|
|
7343
7414
|
} = options;
|
|
7344
7415
|
const normalizedPath = this.normalizePath(filePath);
|
|
7345
|
-
const dir = this.normalizePath(
|
|
7416
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
7346
7417
|
const fileExists = this.pathExists(normalizedPath);
|
|
7347
7418
|
if (fileExists && !overwrite) {
|
|
7348
7419
|
if (verbose) {
|
|
7349
|
-
|
|
7420
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
7350
7421
|
}
|
|
7351
7422
|
return false;
|
|
7352
7423
|
}
|
|
7353
7424
|
if (dryRun) {
|
|
7354
|
-
|
|
7425
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
7355
7426
|
return true;
|
|
7356
7427
|
}
|
|
7357
7428
|
try {
|
|
@@ -7376,7 +7447,7 @@ var init_PathResolver = __esm({
|
|
|
7376
7447
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
7377
7448
|
}
|
|
7378
7449
|
if (verbose) {
|
|
7379
|
-
|
|
7450
|
+
log3.info(
|
|
7380
7451
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
7381
7452
|
);
|
|
7382
7453
|
}
|
|
@@ -7403,16 +7474,16 @@ var init_PathResolver = __esm({
|
|
|
7403
7474
|
verbose = false
|
|
7404
7475
|
} = options;
|
|
7405
7476
|
const normalizedPath = this.normalizePath(filePath);
|
|
7406
|
-
const dir = this.normalizePath(
|
|
7477
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
7407
7478
|
const fileExists = this.pathExists(normalizedPath);
|
|
7408
7479
|
if (fileExists && !overwrite) {
|
|
7409
7480
|
if (verbose) {
|
|
7410
|
-
|
|
7481
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
7411
7482
|
}
|
|
7412
7483
|
return false;
|
|
7413
7484
|
}
|
|
7414
7485
|
if (dryRun) {
|
|
7415
|
-
|
|
7486
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
7416
7487
|
return true;
|
|
7417
7488
|
}
|
|
7418
7489
|
try {
|
|
@@ -7436,7 +7507,7 @@ var init_PathResolver = __esm({
|
|
|
7436
7507
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
7437
7508
|
}
|
|
7438
7509
|
if (verbose) {
|
|
7439
|
-
|
|
7510
|
+
log3.info(
|
|
7440
7511
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
7441
7512
|
);
|
|
7442
7513
|
}
|
|
@@ -7461,15 +7532,15 @@ var init_PathResolver = __esm({
|
|
|
7461
7532
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7462
7533
|
if (fileExists && !overwrite) {
|
|
7463
7534
|
if (verbose) {
|
|
7464
|
-
|
|
7535
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7465
7536
|
}
|
|
7466
7537
|
return false;
|
|
7467
7538
|
}
|
|
7468
7539
|
if (dryRun) {
|
|
7469
|
-
|
|
7540
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7470
7541
|
return true;
|
|
7471
7542
|
}
|
|
7472
|
-
const dir = this.normalizePath(
|
|
7543
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7473
7544
|
try {
|
|
7474
7545
|
await fs.promises.mkdir(dir, { recursive: true });
|
|
7475
7546
|
} catch (error2) {
|
|
@@ -7479,7 +7550,7 @@ var init_PathResolver = __esm({
|
|
|
7479
7550
|
return await safeExecuteAsync(async () => {
|
|
7480
7551
|
await fs.promises.copyFile(srcPath, normalizedDestPath);
|
|
7481
7552
|
if (verbose) {
|
|
7482
|
-
|
|
7553
|
+
log3.info(
|
|
7483
7554
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7484
7555
|
);
|
|
7485
7556
|
}
|
|
@@ -7503,15 +7574,15 @@ var init_PathResolver = __esm({
|
|
|
7503
7574
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7504
7575
|
if (fileExists && !overwrite) {
|
|
7505
7576
|
if (verbose) {
|
|
7506
|
-
|
|
7577
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7507
7578
|
}
|
|
7508
7579
|
return false;
|
|
7509
7580
|
}
|
|
7510
7581
|
if (dryRun) {
|
|
7511
|
-
|
|
7582
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7512
7583
|
return true;
|
|
7513
7584
|
}
|
|
7514
|
-
const dir = this.normalizePath(
|
|
7585
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7515
7586
|
try {
|
|
7516
7587
|
fs.mkdirSync(dir, { recursive: true });
|
|
7517
7588
|
} catch (error2) {
|
|
@@ -7520,7 +7591,7 @@ var init_PathResolver = __esm({
|
|
|
7520
7591
|
try {
|
|
7521
7592
|
fs.copyFileSync(srcPath, normalizedDestPath);
|
|
7522
7593
|
if (verbose) {
|
|
7523
|
-
|
|
7594
|
+
log3.info(
|
|
7524
7595
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7525
7596
|
);
|
|
7526
7597
|
}
|
|
@@ -7537,7 +7608,7 @@ var init_PathResolver = __esm({
|
|
|
7537
7608
|
return fs.existsSync(filePath);
|
|
7538
7609
|
} catch (error2) {
|
|
7539
7610
|
if (!silent) {
|
|
7540
|
-
|
|
7611
|
+
log3.error(`Error checking path existence: ${filePath}`, error2);
|
|
7541
7612
|
}
|
|
7542
7613
|
return false;
|
|
7543
7614
|
}
|
|
@@ -7563,7 +7634,7 @@ var init_PathResolver = __esm({
|
|
|
7563
7634
|
return fs.readdirSync(dirPath, options);
|
|
7564
7635
|
} catch (error2) {
|
|
7565
7636
|
if (this.options.debug) {
|
|
7566
|
-
|
|
7637
|
+
log3.warn(`Failed to read directory: ${dirPath}`, error2);
|
|
7567
7638
|
}
|
|
7568
7639
|
const isObjectOptions = options && typeof options === "object" && "withFileTypes" in options;
|
|
7569
7640
|
return isObjectOptions && options.withFileTypes ? [] : [];
|
|
@@ -7581,7 +7652,7 @@ var init_PathResolver = __esm({
|
|
|
7581
7652
|
return fs.statSync(filePath);
|
|
7582
7653
|
} catch (error2) {
|
|
7583
7654
|
if (this.options.debug) {
|
|
7584
|
-
|
|
7655
|
+
log3.warn(`Failed to stat file: ${filePath}`, error2);
|
|
7585
7656
|
}
|
|
7586
7657
|
return null;
|
|
7587
7658
|
}
|
|
@@ -7598,7 +7669,7 @@ var init_PathResolver = __esm({
|
|
|
7598
7669
|
return fs.lstatSync(filePath);
|
|
7599
7670
|
} catch (error2) {
|
|
7600
7671
|
if (this.options.debug) {
|
|
7601
|
-
|
|
7672
|
+
log3.warn(`Failed to lstat file: ${filePath}`, error2);
|
|
7602
7673
|
}
|
|
7603
7674
|
return null;
|
|
7604
7675
|
}
|
|
@@ -7687,7 +7758,7 @@ var init_PathResolver = __esm({
|
|
|
7687
7758
|
* @returns True if repoRoot is the monorepo (has packages directory)
|
|
7688
7759
|
*/
|
|
7689
7760
|
isMonorepo() {
|
|
7690
|
-
const packagesDir =
|
|
7761
|
+
const packagesDir = join2(this._repoRoot, "packages");
|
|
7691
7762
|
return this.pathExists(packagesDir);
|
|
7692
7763
|
}
|
|
7693
7764
|
/**
|
|
@@ -7704,7 +7775,7 @@ var init_PathResolver = __esm({
|
|
|
7704
7775
|
* Find files matching pattern within directory
|
|
7705
7776
|
*/
|
|
7706
7777
|
async findFiles(directory, pattern, options = {}) {
|
|
7707
|
-
const searchPattern = this.normalizePath(
|
|
7778
|
+
const searchPattern = this.normalizePath(join2(directory, pattern));
|
|
7708
7779
|
const appRoot = this.getAppRoot();
|
|
7709
7780
|
const normalizeAppRoot = this.normalizePath(appRoot);
|
|
7710
7781
|
const relativePattern = searchPattern.startsWith(normalizeAppRoot) ? searchPattern.slice(normalizeAppRoot.length + 1) : searchPattern;
|
|
@@ -7751,7 +7822,7 @@ var init_PathResolver = __esm({
|
|
|
7751
7822
|
return null;
|
|
7752
7823
|
}
|
|
7753
7824
|
const resolvedPath = this.normalizePath(
|
|
7754
|
-
|
|
7825
|
+
join2(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
|
|
7755
7826
|
);
|
|
7756
7827
|
const resolvedDir = resolvedPath.replace(/\/[^/]*\*.*$/, "");
|
|
7757
7828
|
if (this.pathExists(resolvedDir)) {
|
|
@@ -7947,13 +8018,13 @@ var init_PathResolver = __esm({
|
|
|
7947
8018
|
const maxLevels = this.options.maxLevels;
|
|
7948
8019
|
while (levelsChecked < maxLevels) {
|
|
7949
8020
|
const toolingPath = this.normalizePath(
|
|
7950
|
-
|
|
8021
|
+
join2(currentDir, PACKAGE_PATHS.TOOLING)
|
|
7951
8022
|
);
|
|
7952
|
-
const corePath = this.normalizePath(
|
|
8023
|
+
const corePath = this.normalizePath(join2(currentDir, PACKAGE_PATHS.CORE));
|
|
7953
8024
|
if (this.pathExists(toolingPath) && this.pathExists(corePath)) {
|
|
7954
8025
|
return currentDir;
|
|
7955
8026
|
}
|
|
7956
|
-
const appsDir =
|
|
8027
|
+
const appsDir = join2(currentDir, "apps");
|
|
7957
8028
|
if (this.pathExists(appsDir)) {
|
|
7958
8029
|
const appsDirStat = this.statSync(appsDir);
|
|
7959
8030
|
if (appsDirStat?.isDirectory()) {
|
|
@@ -7961,15 +8032,15 @@ var init_PathResolver = __esm({
|
|
|
7961
8032
|
}
|
|
7962
8033
|
}
|
|
7963
8034
|
const packageJsonPath = this.normalizePath(
|
|
7964
|
-
|
|
8035
|
+
join2(currentDir, "package.json")
|
|
7965
8036
|
);
|
|
7966
8037
|
if (this.pathExists(packageJsonPath)) {
|
|
7967
|
-
const parentDir2 = this.normalizePath(
|
|
8038
|
+
const parentDir2 = this.normalizePath(dirname2(currentDir));
|
|
7968
8039
|
if (parentDir2 === currentDir) {
|
|
7969
8040
|
return currentDir;
|
|
7970
8041
|
}
|
|
7971
8042
|
}
|
|
7972
|
-
const parentDir = this.normalizePath(
|
|
8043
|
+
const parentDir = this.normalizePath(dirname2(currentDir));
|
|
7973
8044
|
if (parentDir === currentDir) {
|
|
7974
8045
|
break;
|
|
7975
8046
|
}
|
|
@@ -7985,8 +8056,8 @@ var init_PathResolver = __esm({
|
|
|
7985
8056
|
// packages/tooling/src/utils/pathResolver.ts
|
|
7986
8057
|
import { createRequire as createRequire2 } from "node:module";
|
|
7987
8058
|
import {
|
|
7988
|
-
join as
|
|
7989
|
-
dirname as
|
|
8059
|
+
join as join3,
|
|
8060
|
+
dirname as dirname3,
|
|
7990
8061
|
basename as basename2,
|
|
7991
8062
|
extname as extname2,
|
|
7992
8063
|
relative as relative2,
|
|
@@ -8035,14 +8106,14 @@ var init_pathResolver = __esm({
|
|
|
8035
8106
|
pathResolverInstance = PathResolver.getInstance({ debug: false });
|
|
8036
8107
|
getRepoRoot = () => pathResolverInstance.getRepoRoot();
|
|
8037
8108
|
normalizePath = (...pathSegments) => {
|
|
8038
|
-
return pathResolverInstance.normalizePath(
|
|
8109
|
+
return pathResolverInstance.normalizePath(join3(...pathSegments));
|
|
8039
8110
|
};
|
|
8040
8111
|
pathExists = (filePath, silent = false) => pathResolverInstance.pathExists(filePath, silent);
|
|
8041
8112
|
readSync = (filePath, options) => pathResolverInstance.readSync(filePath, options);
|
|
8042
8113
|
writeSync = (filePath, content, options) => pathResolverInstance.writeSync(filePath, content, options);
|
|
8043
8114
|
removeSync = (path) => pathResolverInstance.removeSync(path);
|
|
8044
8115
|
getDirname = (filePath) => {
|
|
8045
|
-
return normalizePath(
|
|
8116
|
+
return normalizePath(dirname3(filePath));
|
|
8046
8117
|
};
|
|
8047
8118
|
joinPath = (...pathSegments) => {
|
|
8048
8119
|
return normalizePath(...pathSegments);
|
|
@@ -8054,7 +8125,7 @@ var init_pathResolver = __esm({
|
|
|
8054
8125
|
import { Buffer } from "node:buffer";
|
|
8055
8126
|
import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
8056
8127
|
import { createRequire as createRequire3 } from "node:module";
|
|
8057
|
-
import { dirname as
|
|
8128
|
+
import { dirname as dirname4, resolve as resolve3 } from "node:path";
|
|
8058
8129
|
import process from "node:process";
|
|
8059
8130
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
8060
8131
|
var require2, __filename, __dirname;
|
|
@@ -8063,7 +8134,7 @@ var init_utils2 = __esm({
|
|
|
8063
8134
|
"use strict";
|
|
8064
8135
|
require2 = createRequire3(import.meta.url);
|
|
8065
8136
|
__filename = fileURLToPath3(import.meta.url);
|
|
8066
|
-
__dirname =
|
|
8137
|
+
__dirname = dirname4(__filename);
|
|
8067
8138
|
if (typeof globalThis !== "undefined") {
|
|
8068
8139
|
globalThis.require = require2;
|
|
8069
8140
|
globalThis.__filename = __filename;
|
|
@@ -8205,24 +8276,24 @@ function discoverPackages(repoRoot, filter) {
|
|
|
8205
8276
|
continue;
|
|
8206
8277
|
}
|
|
8207
8278
|
}
|
|
8208
|
-
return packages.sort((
|
|
8279
|
+
return packages.sort((a2, b) => a2.name.localeCompare(b.name));
|
|
8209
8280
|
}
|
|
8210
8281
|
function parseTypeScriptErrors(output) {
|
|
8211
8282
|
const lines = output.split("\n");
|
|
8212
8283
|
const errorLines = [];
|
|
8213
8284
|
const errorPattern = /error TS\d+/;
|
|
8214
8285
|
let errorCount = 0;
|
|
8215
|
-
for (let
|
|
8216
|
-
const line = lines[
|
|
8286
|
+
for (let i2 = 0; i2 < lines.length; i2++) {
|
|
8287
|
+
const line = lines[i2];
|
|
8217
8288
|
if (!line) continue;
|
|
8218
8289
|
if (errorPattern.test(line)) {
|
|
8219
8290
|
errorCount++;
|
|
8220
8291
|
errorLines.push(line);
|
|
8221
|
-
if (
|
|
8222
|
-
const nextLine = lines[
|
|
8292
|
+
if (i2 + 1 < lines.length) {
|
|
8293
|
+
const nextLine = lines[i2 + 1];
|
|
8223
8294
|
if (nextLine && (nextLine.trim().startsWith("~") || /^\s+/.test(nextLine))) {
|
|
8224
8295
|
errorLines.push(nextLine);
|
|
8225
|
-
|
|
8296
|
+
i2++;
|
|
8226
8297
|
}
|
|
8227
8298
|
}
|
|
8228
8299
|
} else if (
|
|
@@ -8239,7 +8310,7 @@ function parseTypeScriptErrors(output) {
|
|
|
8239
8310
|
}
|
|
8240
8311
|
function typeCheckPackage(pkg, repoRoot, verbose, progressSpinner) {
|
|
8241
8312
|
return new Promise((resolve4) => {
|
|
8242
|
-
let
|
|
8313
|
+
let stdout2 = "";
|
|
8243
8314
|
let stderr = "";
|
|
8244
8315
|
let hasStarted = false;
|
|
8245
8316
|
const child = spawn("bun", ["run", "type-check"], {
|
|
@@ -8256,12 +8327,12 @@ function typeCheckPackage(pkg, repoRoot, verbose, progressSpinner) {
|
|
|
8256
8327
|
}
|
|
8257
8328
|
}
|
|
8258
8329
|
const text = data.toString("utf8");
|
|
8259
|
-
|
|
8330
|
+
stdout2 += text;
|
|
8260
8331
|
if (verbose) {
|
|
8261
8332
|
const lines = text.split("\n");
|
|
8262
8333
|
for (const line of lines) {
|
|
8263
8334
|
if (line.trim() && (line.includes("error TS") || line.includes("error:"))) {
|
|
8264
|
-
|
|
8335
|
+
log2.error(` ${line.trim()}`);
|
|
8265
8336
|
}
|
|
8266
8337
|
}
|
|
8267
8338
|
}
|
|
@@ -8272,12 +8343,12 @@ function typeCheckPackage(pkg, repoRoot, verbose, progressSpinner) {
|
|
|
8272
8343
|
if (verbose) {
|
|
8273
8344
|
const trimmed = text.trim();
|
|
8274
8345
|
if (trimmed && !trimmed.startsWith("$ ") && !trimmed.match(/^bun run /)) {
|
|
8275
|
-
|
|
8346
|
+
log2.error(` ${trimmed}`);
|
|
8276
8347
|
}
|
|
8277
8348
|
}
|
|
8278
8349
|
});
|
|
8279
8350
|
child.on("close", (code) => {
|
|
8280
|
-
const allOutput =
|
|
8351
|
+
const allOutput = stdout2 + (stderr ? `
|
|
8281
8352
|
${stderr}` : "");
|
|
8282
8353
|
const { errorCount, errorLines } = parseTypeScriptErrors(allOutput);
|
|
8283
8354
|
resolve4({
|
|
@@ -8306,7 +8377,7 @@ async function main(options = {}) {
|
|
|
8306
8377
|
};
|
|
8307
8378
|
try {
|
|
8308
8379
|
if (isTTY) {
|
|
8309
|
-
|
|
8380
|
+
intro("\u{1F50D} DoNotDev Type Check");
|
|
8310
8381
|
}
|
|
8311
8382
|
logToFile("\u{1F50D} DoNotDev Type Check\n");
|
|
8312
8383
|
const debug = options.debug ?? options.verbose ?? false;
|
|
@@ -8319,21 +8390,21 @@ async function main(options = {}) {
|
|
|
8319
8390
|
);
|
|
8320
8391
|
}
|
|
8321
8392
|
if (debug) {
|
|
8322
|
-
|
|
8393
|
+
log2.debug(` Working directory: ${repoRoot}
|
|
8323
8394
|
`);
|
|
8324
8395
|
if (options.package) {
|
|
8325
|
-
|
|
8396
|
+
log2.debug(` Package filter: ${options.package}
|
|
8326
8397
|
`);
|
|
8327
8398
|
}
|
|
8328
8399
|
}
|
|
8329
8400
|
const packages = discoverPackages(repoRoot, options.package);
|
|
8330
8401
|
if (packages.length === 0) {
|
|
8331
8402
|
if (isTTY) {
|
|
8332
|
-
|
|
8403
|
+
log2.warn("No packages with type-check script found.");
|
|
8333
8404
|
if (options.package) {
|
|
8334
|
-
|
|
8405
|
+
log2.warn(` Filter: ${options.package}`);
|
|
8335
8406
|
}
|
|
8336
|
-
|
|
8407
|
+
outro("No packages to type-check");
|
|
8337
8408
|
} else {
|
|
8338
8409
|
process.stdout.write("RESULT: 0 passed, 0 failed, 0 total errors\n");
|
|
8339
8410
|
}
|
|
@@ -8342,15 +8413,15 @@ async function main(options = {}) {
|
|
|
8342
8413
|
logToFile(`Found ${packages.length} package(s) to type-check
|
|
8343
8414
|
|
|
8344
8415
|
`);
|
|
8345
|
-
|
|
8346
|
-
|
|
8416
|
+
log2.info(`Found ${packages.length} package(s) to type-check`);
|
|
8417
|
+
log2.info("Checking for direct imports from private core packages...");
|
|
8347
8418
|
const violations = checkPrivateCoreImports(repoRoot, packages);
|
|
8348
8419
|
if (violations.length > 0) {
|
|
8349
|
-
|
|
8420
|
+
log2.error(
|
|
8350
8421
|
`
|
|
8351
8422
|
\u274C Found ${violations.length} violation(s) importing from private core packages:`
|
|
8352
8423
|
);
|
|
8353
|
-
|
|
8424
|
+
log2.error(
|
|
8354
8425
|
" Packages must import from @donotdev/core, not from private child packages.\n"
|
|
8355
8426
|
);
|
|
8356
8427
|
const violationsByPackage = /* @__PURE__ */ new Map();
|
|
@@ -8363,20 +8434,20 @@ async function main(options = {}) {
|
|
|
8363
8434
|
violationsByPackage.get(pkg).push(violation);
|
|
8364
8435
|
}
|
|
8365
8436
|
for (const [pkg, pkgViolations] of violationsByPackage) {
|
|
8366
|
-
|
|
8437
|
+
log2.error(`
|
|
8367
8438
|
${pkg}:`);
|
|
8368
8439
|
for (const violation of pkgViolations) {
|
|
8369
|
-
|
|
8440
|
+
log2.error(
|
|
8370
8441
|
` ${violation.file}:${violation.line} - imports from ${violation.package}`
|
|
8371
8442
|
);
|
|
8372
8443
|
if (verbose) {
|
|
8373
|
-
|
|
8444
|
+
log2.error(` ${violation.importLine}`);
|
|
8374
8445
|
}
|
|
8375
8446
|
}
|
|
8376
8447
|
}
|
|
8377
|
-
|
|
8448
|
+
log2.error("\n Private core packages (use @donotdev/core instead):");
|
|
8378
8449
|
for (const pkg of PRIVATE_CORE_PACKAGES) {
|
|
8379
|
-
|
|
8450
|
+
log2.error(` - ${pkg}`);
|
|
8380
8451
|
}
|
|
8381
8452
|
logToFile(
|
|
8382
8453
|
`
|
|
@@ -8388,7 +8459,7 @@ ${violations.map(
|
|
|
8388
8459
|
`
|
|
8389
8460
|
);
|
|
8390
8461
|
if (isTTY) {
|
|
8391
|
-
|
|
8462
|
+
outro("Type-check failed: direct imports from private core packages");
|
|
8392
8463
|
} else {
|
|
8393
8464
|
process.stdout.write("RESULT: 0 passed, 0 failed, 0 total errors\n");
|
|
8394
8465
|
process.stdout.write(
|
|
@@ -8397,15 +8468,15 @@ ${violations.map(
|
|
|
8397
8468
|
}
|
|
8398
8469
|
return 1;
|
|
8399
8470
|
}
|
|
8400
|
-
|
|
8471
|
+
log2.info("\u2713 No direct imports from private core packages found");
|
|
8401
8472
|
const results = [];
|
|
8402
|
-
for (let
|
|
8403
|
-
const pkg = packages[
|
|
8473
|
+
for (let i2 = 0; i2 < packages.length; i2++) {
|
|
8474
|
+
const pkg = packages[i2];
|
|
8404
8475
|
if (!pkg) continue;
|
|
8405
|
-
const progress = `${
|
|
8476
|
+
const progress = `${i2 + 1}/${packages.length}`;
|
|
8406
8477
|
let result;
|
|
8407
8478
|
if (isTTY) {
|
|
8408
|
-
const s =
|
|
8479
|
+
const s = spinner();
|
|
8409
8480
|
s.start(`[${progress}] Type-checking ${pkg.name}...`);
|
|
8410
8481
|
result = await typeCheckPackage(pkg, repoRoot, verbose, s);
|
|
8411
8482
|
if (result.success) {
|
|
@@ -8448,9 +8519,9 @@ ${violations.map(
|
|
|
8448
8519
|
logToFile(result.output);
|
|
8449
8520
|
logToFile("\n");
|
|
8450
8521
|
}
|
|
8451
|
-
const failed = results.filter((
|
|
8452
|
-
const passed = results.filter((
|
|
8453
|
-
const totalErrors = results.reduce((sum,
|
|
8522
|
+
const failed = results.filter((r2) => !r2.success);
|
|
8523
|
+
const passed = results.filter((r2) => r2.success);
|
|
8524
|
+
const totalErrors = results.reduce((sum, r2) => sum + r2.errorCount, 0);
|
|
8454
8525
|
if (!isTTY) {
|
|
8455
8526
|
process.stdout.write(
|
|
8456
8527
|
`RESULT: ${passed.length} passed, ${failed.length} failed, ${totalErrors} total errors
|
|
@@ -8491,13 +8562,13 @@ ${output}
|
|
|
8491
8562
|
].join(EOL2);
|
|
8492
8563
|
writeSync(logFilePath2, logContent, { overwrite: true });
|
|
8493
8564
|
if (isTTY) {
|
|
8494
|
-
|
|
8565
|
+
log2.info(`Errors logged to: ${logFilePath2}`);
|
|
8495
8566
|
} else {
|
|
8496
8567
|
process.stdout.write(`LOG: ${logFilePath2}
|
|
8497
8568
|
`);
|
|
8498
8569
|
}
|
|
8499
8570
|
if (isTTY) {
|
|
8500
|
-
|
|
8571
|
+
outro("Type-check completed with errors");
|
|
8501
8572
|
}
|
|
8502
8573
|
return 1;
|
|
8503
8574
|
}
|
|
@@ -8507,7 +8578,7 @@ ${output}
|
|
|
8507
8578
|
removeSync(logFilePath);
|
|
8508
8579
|
}
|
|
8509
8580
|
if (isTTY) {
|
|
8510
|
-
|
|
8581
|
+
outro("All packages type-checked successfully!");
|
|
8511
8582
|
}
|
|
8512
8583
|
return 0;
|
|
8513
8584
|
} catch (error2) {
|
|
@@ -8536,7 +8607,7 @@ ${output}
|
|
|
8536
8607
|
].join(EOL2);
|
|
8537
8608
|
writeSync(logFilePath, logContent, { overwrite: true });
|
|
8538
8609
|
if (process.stdout.isTTY) {
|
|
8539
|
-
|
|
8610
|
+
log2.info(`Error log saved to: ${logFilePath}`);
|
|
8540
8611
|
}
|
|
8541
8612
|
}
|
|
8542
8613
|
throw doNotDevError;
|