@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');
|
|
@@ -37,31 +37,40 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
37
37
|
mod
|
|
38
38
|
));
|
|
39
39
|
|
|
40
|
-
// node_modules/.bun/fast-string-truncated-width@
|
|
41
|
-
var
|
|
40
|
+
// node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
|
|
41
|
+
var getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji;
|
|
42
42
|
var init_utils = __esm({
|
|
43
|
-
"node_modules/.bun/fast-string-truncated-width@
|
|
43
|
+
"node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js"() {
|
|
44
44
|
init_utils2();
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
getCodePointsLength = /* @__PURE__ */ (() => {
|
|
46
|
+
const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
47
|
+
return (input) => {
|
|
48
|
+
let surrogatePairsNr = 0;
|
|
49
|
+
SURROGATE_PAIR_RE.lastIndex = 0;
|
|
50
|
+
while (SURROGATE_PAIR_RE.test(input)) {
|
|
51
|
+
surrogatePairsNr += 1;
|
|
52
|
+
}
|
|
53
|
+
return input.length - surrogatePairsNr;
|
|
54
|
+
};
|
|
55
|
+
})();
|
|
48
56
|
isFullWidth = (x) => {
|
|
49
57
|
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
50
58
|
};
|
|
51
|
-
|
|
52
|
-
return x
|
|
59
|
+
isWideNotCJKTNotEmoji = (x) => {
|
|
60
|
+
return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
53
61
|
};
|
|
54
62
|
}
|
|
55
63
|
});
|
|
56
64
|
|
|
57
|
-
// node_modules/.bun/fast-string-truncated-width@
|
|
58
|
-
var ANSI_RE, CONTROL_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
|
|
65
|
+
// node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
|
|
66
|
+
var ANSI_RE, CONTROL_RE, CJKT_WIDE_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
|
|
59
67
|
var init_dist = __esm({
|
|
60
|
-
"node_modules/.bun/fast-string-truncated-width@
|
|
68
|
+
"node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js"() {
|
|
61
69
|
init_utils2();
|
|
62
70
|
init_utils();
|
|
63
|
-
ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
|
|
71
|
+
ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
|
|
64
72
|
CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
73
|
+
CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
|
|
65
74
|
TAB_RE = /\t{1,1000}/y;
|
|
66
75
|
EMOJI_RE = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu");
|
|
67
76
|
LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
@@ -71,14 +80,21 @@ var init_dist = __esm({
|
|
|
71
80
|
const LIMIT = truncationOptions.limit ?? Infinity;
|
|
72
81
|
const ELLIPSIS = truncationOptions.ellipsis ?? "";
|
|
73
82
|
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
|
|
74
|
-
const ANSI_WIDTH =
|
|
83
|
+
const ANSI_WIDTH = 0;
|
|
75
84
|
const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
|
|
76
85
|
const TAB_WIDTH = widthOptions.tabWidth ?? 8;
|
|
77
|
-
const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
|
|
78
86
|
const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
|
|
79
|
-
const FULL_WIDTH_WIDTH =
|
|
87
|
+
const FULL_WIDTH_WIDTH = 2;
|
|
80
88
|
const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
|
|
81
|
-
const WIDE_WIDTH = widthOptions.wideWidth ??
|
|
89
|
+
const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
|
|
90
|
+
const PARSE_BLOCKS = [
|
|
91
|
+
[LATIN_RE, REGULAR_WIDTH],
|
|
92
|
+
[ANSI_RE, ANSI_WIDTH],
|
|
93
|
+
[CONTROL_RE, CONTROL_WIDTH],
|
|
94
|
+
[TAB_RE, TAB_WIDTH],
|
|
95
|
+
[EMOJI_RE, EMOJI_WIDTH],
|
|
96
|
+
[CJKT_WIDE_RE, WIDE_WIDTH]
|
|
97
|
+
];
|
|
82
98
|
let indexPrev = 0;
|
|
83
99
|
let index = 0;
|
|
84
100
|
let length = input.length;
|
|
@@ -98,10 +114,8 @@ var init_dist = __esm({
|
|
|
98
114
|
const codePoint = char.codePointAt(0) || 0;
|
|
99
115
|
if (isFullWidth(codePoint)) {
|
|
100
116
|
widthExtra = FULL_WIDTH_WIDTH;
|
|
101
|
-
} else if (
|
|
117
|
+
} else if (isWideNotCJKTNotEmoji(codePoint)) {
|
|
102
118
|
widthExtra = WIDE_WIDTH;
|
|
103
|
-
} else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) {
|
|
104
|
-
widthExtra = AMBIGUOUS_WIDTH;
|
|
105
119
|
} else {
|
|
106
120
|
widthExtra = REGULAR_WIDTH;
|
|
107
121
|
}
|
|
@@ -117,88 +131,28 @@ var init_dist = __esm({
|
|
|
117
131
|
}
|
|
118
132
|
unmatchedStart = unmatchedEnd = 0;
|
|
119
133
|
}
|
|
120
|
-
if (index >= length)
|
|
121
|
-
break;
|
|
122
|
-
LATIN_RE.lastIndex = index;
|
|
123
|
-
if (LATIN_RE.test(input)) {
|
|
124
|
-
lengthExtra = LATIN_RE.lastIndex - index;
|
|
125
|
-
widthExtra = lengthExtra * REGULAR_WIDTH;
|
|
126
|
-
if (width + widthExtra > truncationLimit) {
|
|
127
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
|
|
128
|
-
}
|
|
129
|
-
if (width + widthExtra > LIMIT) {
|
|
130
|
-
truncationEnabled = true;
|
|
131
|
-
break;
|
|
132
|
-
}
|
|
133
|
-
width += widthExtra;
|
|
134
|
-
unmatchedStart = indexPrev;
|
|
135
|
-
unmatchedEnd = index;
|
|
136
|
-
index = indexPrev = LATIN_RE.lastIndex;
|
|
137
|
-
continue;
|
|
138
|
-
}
|
|
139
|
-
ANSI_RE.lastIndex = index;
|
|
140
|
-
if (ANSI_RE.test(input)) {
|
|
141
|
-
if (width + ANSI_WIDTH > truncationLimit) {
|
|
142
|
-
truncationIndex = Math.min(truncationIndex, index);
|
|
143
|
-
}
|
|
144
|
-
if (width + ANSI_WIDTH > LIMIT) {
|
|
145
|
-
truncationEnabled = true;
|
|
146
|
-
break;
|
|
147
|
-
}
|
|
148
|
-
width += ANSI_WIDTH;
|
|
149
|
-
unmatchedStart = indexPrev;
|
|
150
|
-
unmatchedEnd = index;
|
|
151
|
-
index = indexPrev = ANSI_RE.lastIndex;
|
|
152
|
-
continue;
|
|
153
|
-
}
|
|
154
|
-
CONTROL_RE.lastIndex = index;
|
|
155
|
-
if (CONTROL_RE.test(input)) {
|
|
156
|
-
lengthExtra = CONTROL_RE.lastIndex - index;
|
|
157
|
-
widthExtra = lengthExtra * CONTROL_WIDTH;
|
|
158
|
-
if (width + widthExtra > truncationLimit) {
|
|
159
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
|
|
160
|
-
}
|
|
161
|
-
if (width + widthExtra > LIMIT) {
|
|
162
|
-
truncationEnabled = true;
|
|
163
|
-
break;
|
|
164
|
-
}
|
|
165
|
-
width += widthExtra;
|
|
166
|
-
unmatchedStart = indexPrev;
|
|
167
|
-
unmatchedEnd = index;
|
|
168
|
-
index = indexPrev = CONTROL_RE.lastIndex;
|
|
169
|
-
continue;
|
|
170
|
-
}
|
|
171
|
-
TAB_RE.lastIndex = index;
|
|
172
|
-
if (TAB_RE.test(input)) {
|
|
173
|
-
lengthExtra = TAB_RE.lastIndex - index;
|
|
174
|
-
widthExtra = lengthExtra * TAB_WIDTH;
|
|
175
|
-
if (width + widthExtra > truncationLimit) {
|
|
176
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
|
|
177
|
-
}
|
|
178
|
-
if (width + widthExtra > LIMIT) {
|
|
179
|
-
truncationEnabled = true;
|
|
180
|
-
break;
|
|
181
|
-
}
|
|
182
|
-
width += widthExtra;
|
|
183
|
-
unmatchedStart = indexPrev;
|
|
184
|
-
unmatchedEnd = index;
|
|
185
|
-
index = indexPrev = TAB_RE.lastIndex;
|
|
186
|
-
continue;
|
|
134
|
+
if (index >= length) {
|
|
135
|
+
break outer;
|
|
187
136
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
137
|
+
for (let i2 = 0, l = PARSE_BLOCKS.length; i2 < l; i2++) {
|
|
138
|
+
const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i2];
|
|
139
|
+
BLOCK_RE.lastIndex = index;
|
|
140
|
+
if (BLOCK_RE.test(input)) {
|
|
141
|
+
lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
|
|
142
|
+
widthExtra = lengthExtra * BLOCK_WIDTH;
|
|
143
|
+
if (width + widthExtra > truncationLimit) {
|
|
144
|
+
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
|
|
145
|
+
}
|
|
146
|
+
if (width + widthExtra > LIMIT) {
|
|
147
|
+
truncationEnabled = true;
|
|
148
|
+
break outer;
|
|
149
|
+
}
|
|
150
|
+
width += widthExtra;
|
|
151
|
+
unmatchedStart = indexPrev;
|
|
152
|
+
unmatchedEnd = index;
|
|
153
|
+
index = indexPrev = BLOCK_RE.lastIndex;
|
|
154
|
+
continue outer;
|
|
196
155
|
}
|
|
197
|
-
width += EMOJI_WIDTH;
|
|
198
|
-
unmatchedStart = indexPrev;
|
|
199
|
-
unmatchedEnd = index;
|
|
200
|
-
index = indexPrev = EMOJI_RE.lastIndex;
|
|
201
|
-
continue;
|
|
202
156
|
}
|
|
203
157
|
index += 1;
|
|
204
158
|
}
|
|
@@ -213,10 +167,10 @@ var init_dist = __esm({
|
|
|
213
167
|
}
|
|
214
168
|
});
|
|
215
169
|
|
|
216
|
-
// node_modules/.bun/fast-string-width@
|
|
170
|
+
// node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
|
|
217
171
|
var NO_TRUNCATION2, fastStringWidth, dist_default2;
|
|
218
172
|
var init_dist2 = __esm({
|
|
219
|
-
"node_modules/.bun/fast-string-width@
|
|
173
|
+
"node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js"() {
|
|
220
174
|
init_utils2();
|
|
221
175
|
init_dist();
|
|
222
176
|
NO_TRUNCATION2 = {
|
|
@@ -231,13 +185,13 @@ var init_dist2 = __esm({
|
|
|
231
185
|
}
|
|
232
186
|
});
|
|
233
187
|
|
|
234
|
-
// node_modules/.bun/fast-wrap-ansi@0.
|
|
188
|
+
// node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js
|
|
235
189
|
function wrapAnsi(string, columns, options) {
|
|
236
190
|
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
|
|
237
191
|
}
|
|
238
192
|
var ESC, CSI, END_CODE, ANSI_ESCAPE_BELL, ANSI_CSI, ANSI_OSC, ANSI_SGR_TERMINATOR, ANSI_ESCAPE_LINK, GROUP_REGEX, getClosingCode, wrapAnsiCode, wrapAnsiHyperlink, wrapWord, stringVisibleTrimSpacesRight, exec, CRLF_OR_LF;
|
|
239
193
|
var init_main = __esm({
|
|
240
|
-
"node_modules/.bun/fast-wrap-ansi@0.
|
|
194
|
+
"node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js"() {
|
|
241
195
|
init_utils2();
|
|
242
196
|
init_dist2();
|
|
243
197
|
ESC = "\x1B";
|
|
@@ -401,16 +355,19 @@ var init_main = __esm({
|
|
|
401
355
|
}
|
|
402
356
|
const preString = rows.join("\n");
|
|
403
357
|
let inSurrogate = false;
|
|
404
|
-
for (let
|
|
405
|
-
const character = preString[
|
|
358
|
+
for (let i2 = 0; i2 < preString.length; i2++) {
|
|
359
|
+
const character = preString[i2];
|
|
406
360
|
returnValue += character;
|
|
407
361
|
if (!inSurrogate) {
|
|
408
362
|
inSurrogate = character >= "\uD800" && character <= "\uDBFF";
|
|
363
|
+
if (inSurrogate) {
|
|
364
|
+
continue;
|
|
365
|
+
}
|
|
409
366
|
} else {
|
|
410
|
-
|
|
367
|
+
inSurrogate = false;
|
|
411
368
|
}
|
|
412
369
|
if (character === ESC || character === CSI) {
|
|
413
|
-
GROUP_REGEX.lastIndex =
|
|
370
|
+
GROUP_REGEX.lastIndex = i2 + 1;
|
|
414
371
|
const groupsResult = GROUP_REGEX.exec(preString);
|
|
415
372
|
const groups = groupsResult?.groups;
|
|
416
373
|
if (groups?.code !== void 0) {
|
|
@@ -420,7 +377,7 @@ var init_main = __esm({
|
|
|
420
377
|
escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
421
378
|
}
|
|
422
379
|
}
|
|
423
|
-
if (preString[
|
|
380
|
+
if (preString[i2 + 1] === "\n") {
|
|
424
381
|
if (escapeUrl) {
|
|
425
382
|
returnValue += wrapAnsiHyperlink("");
|
|
426
383
|
}
|
|
@@ -451,17 +408,17 @@ var require_src = __commonJS({
|
|
|
451
408
|
var ESC2 = "\x1B";
|
|
452
409
|
var CSI2 = `${ESC2}[`;
|
|
453
410
|
var beep = "\x07";
|
|
454
|
-
var
|
|
455
|
-
to(x,
|
|
456
|
-
if (!
|
|
457
|
-
return `${CSI2}${
|
|
411
|
+
var cursor3 = {
|
|
412
|
+
to(x, y) {
|
|
413
|
+
if (!y) return `${CSI2}${x + 1}G`;
|
|
414
|
+
return `${CSI2}${y + 1};${x + 1}H`;
|
|
458
415
|
},
|
|
459
|
-
move(x,
|
|
416
|
+
move(x, y) {
|
|
460
417
|
let ret = "";
|
|
461
418
|
if (x < 0) ret += `${CSI2}${-x}D`;
|
|
462
419
|
else if (x > 0) ret += `${CSI2}${x}C`;
|
|
463
|
-
if (
|
|
464
|
-
else if (
|
|
420
|
+
if (y < 0) ret += `${CSI2}${-y}A`;
|
|
421
|
+
else if (y > 0) ret += `${CSI2}${y}B`;
|
|
465
422
|
return ret;
|
|
466
423
|
},
|
|
467
424
|
up: (count = 1) => `${CSI2}${count}A`,
|
|
@@ -480,7 +437,7 @@ var require_src = __commonJS({
|
|
|
480
437
|
up: (count = 1) => `${CSI2}S`.repeat(count),
|
|
481
438
|
down: (count = 1) => `${CSI2}T`.repeat(count)
|
|
482
439
|
};
|
|
483
|
-
var
|
|
440
|
+
var erase3 = {
|
|
484
441
|
screen: `${CSI2}2J`,
|
|
485
442
|
up: (count = 1) => `${CSI2}1J`.repeat(count),
|
|
486
443
|
down: (count = 1) => `${CSI2}J`.repeat(count),
|
|
@@ -489,138 +446,225 @@ var require_src = __commonJS({
|
|
|
489
446
|
lineStart: `${CSI2}1K`,
|
|
490
447
|
lines(count) {
|
|
491
448
|
let clear = "";
|
|
492
|
-
for (let
|
|
493
|
-
clear += this.line + (
|
|
449
|
+
for (let i2 = 0; i2 < count; i2++)
|
|
450
|
+
clear += this.line + (i2 < count - 1 ? cursor3.up() : "");
|
|
494
451
|
if (count)
|
|
495
|
-
clear +=
|
|
452
|
+
clear += cursor3.left;
|
|
496
453
|
return clear;
|
|
497
454
|
}
|
|
498
455
|
};
|
|
499
|
-
module.exports = { cursor, scroll, erase, beep };
|
|
456
|
+
module.exports = { cursor: cursor3, scroll, erase: erase3, beep };
|
|
500
457
|
}
|
|
501
458
|
});
|
|
502
459
|
|
|
503
|
-
// node_modules/.bun/@clack+core@1.
|
|
504
|
-
import { styleText
|
|
505
|
-
import { stdout
|
|
506
|
-
import { ReadStream
|
|
507
|
-
var import_sisteransi,
|
|
460
|
+
// node_modules/.bun/@clack+core@1.5.0/node_modules/@clack/core/dist/index.mjs
|
|
461
|
+
import { styleText } from "node:util";
|
|
462
|
+
import { stdout, stdin } from "node:process";
|
|
463
|
+
import { ReadStream } from "node:tty";
|
|
464
|
+
var import_sisteransi, a$1, t, settings, R, getColumns;
|
|
508
465
|
var init_dist3 = __esm({
|
|
509
|
-
"node_modules/.bun/@clack+core@1.
|
|
466
|
+
"node_modules/.bun/@clack+core@1.5.0/node_modules/@clack/core/dist/index.mjs"() {
|
|
510
467
|
init_utils2();
|
|
511
468
|
init_main();
|
|
512
469
|
import_sisteransi = __toESM(require_src(), 1);
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
470
|
+
a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
471
|
+
t = [
|
|
472
|
+
"January",
|
|
473
|
+
"February",
|
|
474
|
+
"March",
|
|
475
|
+
"April",
|
|
476
|
+
"May",
|
|
477
|
+
"June",
|
|
478
|
+
"July",
|
|
479
|
+
"August",
|
|
480
|
+
"September",
|
|
481
|
+
"October",
|
|
482
|
+
"November",
|
|
483
|
+
"December"
|
|
484
|
+
];
|
|
485
|
+
settings = {
|
|
486
|
+
actions: new Set(a$1),
|
|
487
|
+
aliases: /* @__PURE__ */ new Map([
|
|
488
|
+
// vim support
|
|
489
|
+
["k", "up"],
|
|
490
|
+
["j", "down"],
|
|
491
|
+
["h", "left"],
|
|
492
|
+
["l", "right"],
|
|
493
|
+
["", "cancel"],
|
|
494
|
+
// opinionated defaults!
|
|
495
|
+
["escape", "cancel"]
|
|
496
|
+
]),
|
|
497
|
+
messages: {
|
|
498
|
+
cancel: "Canceled",
|
|
499
|
+
error: "Something went wrong"
|
|
500
|
+
},
|
|
501
|
+
withGuide: true,
|
|
502
|
+
accessible: void 0,
|
|
503
|
+
date: {
|
|
504
|
+
monthNames: [...t],
|
|
505
|
+
messages: {
|
|
506
|
+
required: "Please enter a valid date",
|
|
507
|
+
invalidMonth: "There are only 12 months in a year",
|
|
508
|
+
invalidDay: (n2, e) => `There are only ${n2} days in ${e}`,
|
|
509
|
+
afterMin: (n2) => `Date must be on or after ${n2.toISOString().slice(0, 10)}`,
|
|
510
|
+
beforeMax: (n2) => `Date must be on or before ${n2.toISOString().slice(0, 10)}`
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
R = globalThis.process.platform.startsWith("win");
|
|
515
|
+
getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
|
|
518
516
|
}
|
|
519
517
|
});
|
|
520
518
|
|
|
521
|
-
// node_modules/.bun/@clack+prompts@1.
|
|
522
|
-
import { styleText as
|
|
523
|
-
import
|
|
524
|
-
import { existsSync
|
|
525
|
-
import { dirname
|
|
526
|
-
function
|
|
527
|
-
|
|
519
|
+
// node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs
|
|
520
|
+
import { styleText as styleText2, stripVTControlCharacters } from "node:util";
|
|
521
|
+
import process$1 from "node:process";
|
|
522
|
+
import { existsSync, lstatSync, readdirSync } from "node:fs";
|
|
523
|
+
import { dirname, join } from "node:path";
|
|
524
|
+
function isUnicodeSupported() {
|
|
525
|
+
if (process$1.platform !== "win32") {
|
|
526
|
+
return process$1.env.TERM !== "linux";
|
|
527
|
+
}
|
|
528
|
+
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";
|
|
528
529
|
}
|
|
529
|
-
var import_sisteransi2,
|
|
530
|
+
var import_sisteransi2, unicode, 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$1, C, note, u2, SELECT_INSTRUCTIONS, i;
|
|
530
531
|
var init_dist4 = __esm({
|
|
531
|
-
"node_modules/.bun/@clack+prompts@1.
|
|
532
|
+
"node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs"() {
|
|
532
533
|
init_utils2();
|
|
533
534
|
init_dist3();
|
|
534
535
|
init_dist3();
|
|
535
536
|
init_main();
|
|
536
537
|
init_dist2();
|
|
537
538
|
import_sisteransi2 = __toESM(require_src(), 1);
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
539
|
+
unicode = isUnicodeSupported();
|
|
540
|
+
unicodeOr = (o, e) => unicode ? o : e;
|
|
541
|
+
S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
|
|
542
|
+
S_STEP_CANCEL = unicodeOr("\u25A0", "x");
|
|
543
|
+
S_STEP_ERROR = unicodeOr("\u25B2", "x");
|
|
544
|
+
S_STEP_SUBMIT = unicodeOr("\u25C7", "o");
|
|
545
|
+
S_BAR_START = unicodeOr("\u250C", "T");
|
|
546
|
+
S_BAR = unicodeOr("\u2502", "|");
|
|
547
|
+
S_BAR_END = unicodeOr("\u2514", "\u2014");
|
|
548
|
+
S_BAR_START_RIGHT = unicodeOr("\u2510", "T");
|
|
549
|
+
S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014");
|
|
550
|
+
S_RADIO_ACTIVE = unicodeOr("\u25CF", ">");
|
|
551
|
+
S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
|
|
552
|
+
S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
|
|
553
|
+
S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
|
|
554
|
+
S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
|
|
555
|
+
S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022");
|
|
556
|
+
S_BAR_H = unicodeOr("\u2500", "-");
|
|
557
|
+
S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+");
|
|
558
|
+
S_CONNECT_LEFT = unicodeOr("\u251C", "+");
|
|
559
|
+
S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+");
|
|
560
|
+
S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+");
|
|
561
|
+
S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+");
|
|
562
|
+
S_INFO = unicodeOr("\u25CF", "\u2022");
|
|
563
|
+
S_SUCCESS = unicodeOr("\u25C6", "*");
|
|
564
|
+
S_WARN = unicodeOr("\u25B2", "!");
|
|
565
|
+
S_ERROR = unicodeOr("\u25A0", "x");
|
|
566
|
+
MULTISELECT_INSTRUCTIONS = [
|
|
567
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
568
|
+
`${styleText2("dim", "Space:")} select`,
|
|
569
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
570
|
+
];
|
|
571
|
+
log = {
|
|
572
|
+
message: (s = [], {
|
|
573
|
+
symbol: e = styleText2("gray", S_BAR),
|
|
574
|
+
secondarySymbol: r2 = styleText2("gray", S_BAR),
|
|
575
|
+
output: m = process.stdout,
|
|
576
|
+
spacing: l = 1,
|
|
577
|
+
withGuide: c
|
|
578
|
+
} = {}) => {
|
|
579
|
+
const t2 = [], o = c ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
|
|
580
|
+
for (let i2 = 0; i2 < l; i2++)
|
|
581
|
+
t2.push(f);
|
|
582
|
+
const g = Array.isArray(s) ? s : s.split(`
|
|
569
583
|
`);
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
584
|
+
if (g.length > 0) {
|
|
585
|
+
const [i2, ...y] = g;
|
|
586
|
+
i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
|
|
587
|
+
for (const p of y)
|
|
588
|
+
p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
|
|
589
|
+
}
|
|
590
|
+
m.write(`${t2.join(`
|
|
576
591
|
`)}
|
|
577
592
|
`);
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
593
|
+
},
|
|
594
|
+
info: (s, e) => {
|
|
595
|
+
log.message(s, { ...e, symbol: styleText2("blue", S_INFO) });
|
|
596
|
+
},
|
|
597
|
+
success: (s, e) => {
|
|
598
|
+
log.message(s, { ...e, symbol: styleText2("green", S_SUCCESS) });
|
|
599
|
+
},
|
|
600
|
+
step: (s, e) => {
|
|
601
|
+
log.message(s, { ...e, symbol: styleText2("green", S_STEP_SUBMIT) });
|
|
602
|
+
},
|
|
603
|
+
warn: (s, e) => {
|
|
604
|
+
log.message(s, { ...e, symbol: styleText2("yellow", S_WARN) });
|
|
605
|
+
},
|
|
606
|
+
/** alias for `log.warn()`. */
|
|
607
|
+
warning: (s, e) => {
|
|
608
|
+
log.warn(s, e);
|
|
609
|
+
},
|
|
610
|
+
error: (s, e) => {
|
|
611
|
+
log.message(s, { ...e, symbol: styleText2("red", S_ERROR) });
|
|
612
|
+
}
|
|
613
|
+
};
|
|
614
|
+
intro = (o = "", t2) => {
|
|
615
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_START)} ` : "";
|
|
616
|
+
i2.write(`${e}${o}
|
|
594
617
|
`);
|
|
595
618
|
};
|
|
596
|
-
|
|
597
|
-
const
|
|
598
|
-
${
|
|
599
|
-
|
|
619
|
+
outro = (o = "", t2) => {
|
|
620
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR)}
|
|
621
|
+
${styleText2("gray", S_BAR_END)} ` : "";
|
|
622
|
+
i2.write(`${e}${o}
|
|
600
623
|
|
|
601
624
|
`);
|
|
602
625
|
};
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
const
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
626
|
+
W$1 = (o) => o;
|
|
627
|
+
C = (o, e, s) => {
|
|
628
|
+
const a2 = {
|
|
629
|
+
hard: true,
|
|
630
|
+
trim: false
|
|
631
|
+
}, i2 = wrapAnsi(o, e, a2).split(`
|
|
632
|
+
`), c = i2.reduce((n2, t2) => Math.max(dist_default2(t2), n2), 0), u3 = i2.map(s).reduce((n2, t2) => Math.max(dist_default2(t2), n2), 0), g = e - (u3 - c);
|
|
633
|
+
return wrapAnsi(o, g, a2);
|
|
634
|
+
};
|
|
635
|
+
note = (o = "", e = "", s) => {
|
|
636
|
+
const a2 = s?.output ?? process$1.stdout, i2 = s?.withGuide ?? settings.withGuide, c = s?.format ?? W$1, g = ["", ...C(o, getColumns(a2) - 6, c).split(`
|
|
637
|
+
`).map(c), ""], n2 = dist_default2(e), t2 = Math.max(
|
|
638
|
+
g.reduce((m, F) => {
|
|
639
|
+
const O = dist_default2(F);
|
|
640
|
+
return O > m ? O : m;
|
|
641
|
+
}, 0),
|
|
642
|
+
n2
|
|
643
|
+
) + 2, h2 = g.map(
|
|
644
|
+
(m) => `${styleText2("gray", S_BAR)} ${m}${" ".repeat(t2 - dist_default2(m))}${styleText2("gray", S_BAR)}`
|
|
645
|
+
).join(`
|
|
646
|
+
`), T = i2 ? `${styleText2("gray", S_BAR)}
|
|
647
|
+
` : "", l$1 = i2 ? S_CONNECT_LEFT : S_CORNER_BOTTOM_LEFT;
|
|
648
|
+
a2.write(
|
|
649
|
+
`${T}${styleText2("green", S_STEP_SUBMIT)} ${styleText2("reset", e)} ${styleText2(
|
|
650
|
+
"gray",
|
|
651
|
+
S_BAR_H.repeat(Math.max(t2 - n2 - 1, 1)) + S_CORNER_TOP_RIGHT
|
|
652
|
+
)}
|
|
653
|
+
${h2}
|
|
654
|
+
${styleText2("gray", l$1 + S_BAR_H.repeat(t2 + 2) + S_CORNER_BOTTOM_RIGHT)}
|
|
655
|
+
`
|
|
656
|
+
);
|
|
657
|
+
};
|
|
658
|
+
u2 = {
|
|
659
|
+
light: unicodeOr("\u2500", "-"),
|
|
660
|
+
heavy: unicodeOr("\u2501", "="),
|
|
661
|
+
block: unicodeOr("\u2588", "#")
|
|
621
662
|
};
|
|
622
|
-
|
|
623
|
-
|
|
663
|
+
SELECT_INSTRUCTIONS = [
|
|
664
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
665
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
666
|
+
];
|
|
667
|
+
i = `${styleText2("gray", S_BAR)} `;
|
|
624
668
|
}
|
|
625
669
|
});
|
|
626
670
|
|
|
@@ -665,7 +709,7 @@ function stringify(value) {
|
|
|
665
709
|
function formatMessage(...args) {
|
|
666
710
|
return args.map(stringify).join(" ");
|
|
667
711
|
}
|
|
668
|
-
var colors, currentLogLevel,
|
|
712
|
+
var colors, currentLogLevel, log2, error, warn, info, success;
|
|
669
713
|
var init_cli_output = __esm({
|
|
670
714
|
"packages/tooling/src/utils/cli-output.ts"() {
|
|
671
715
|
"use strict";
|
|
@@ -698,7 +742,7 @@ var init_cli_output = __esm({
|
|
|
698
742
|
currentLogLevel = envLevel;
|
|
699
743
|
}
|
|
700
744
|
}
|
|
701
|
-
|
|
745
|
+
log2 = {
|
|
702
746
|
/**
|
|
703
747
|
* Logs an error message (always shows unless Quiet level)
|
|
704
748
|
* Uses clack's log.error + explicit red color
|
|
@@ -706,7 +750,7 @@ var init_cli_output = __esm({
|
|
|
706
750
|
error(...args) {
|
|
707
751
|
if (currentLogLevel < 0 /* Quiet */) return;
|
|
708
752
|
const message = formatMessage(...args);
|
|
709
|
-
|
|
753
|
+
log.error(colorize(message, colors.brightRed));
|
|
710
754
|
},
|
|
711
755
|
/**
|
|
712
756
|
* Logs a warning message (shows at Normal level and above)
|
|
@@ -715,7 +759,7 @@ var init_cli_output = __esm({
|
|
|
715
759
|
warn(...args) {
|
|
716
760
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
717
761
|
const message = formatMessage(...args);
|
|
718
|
-
|
|
762
|
+
log.warn(colorize(message, colors.brightYellow));
|
|
719
763
|
},
|
|
720
764
|
/**
|
|
721
765
|
* Logs an info message (shows at Normal level and above)
|
|
@@ -724,7 +768,7 @@ var init_cli_output = __esm({
|
|
|
724
768
|
info(...args) {
|
|
725
769
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
726
770
|
const message = formatMessage(...args);
|
|
727
|
-
|
|
771
|
+
log.info(colorize(message, colors.brightCyan));
|
|
728
772
|
},
|
|
729
773
|
/**
|
|
730
774
|
* Logs a success message (shows at Normal level and above)
|
|
@@ -733,7 +777,7 @@ var init_cli_output = __esm({
|
|
|
733
777
|
success(...args) {
|
|
734
778
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
735
779
|
const message = formatMessage(...args);
|
|
736
|
-
|
|
780
|
+
log.success(colorize(message, colors.brightGreen));
|
|
737
781
|
},
|
|
738
782
|
/**
|
|
739
783
|
* Logs a debug message (only shows at Verbose level and above)
|
|
@@ -742,7 +786,7 @@ var init_cli_output = __esm({
|
|
|
742
786
|
debug(...args) {
|
|
743
787
|
if (currentLogLevel < 2 /* Verbose */) return;
|
|
744
788
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
745
|
-
|
|
789
|
+
log.message(
|
|
746
790
|
colorize(
|
|
747
791
|
`[${timeStamp}] \u{1F50D} DEBUG: ${formatMessage(...args)}`,
|
|
748
792
|
colors.gray
|
|
@@ -756,7 +800,7 @@ var init_cli_output = __esm({
|
|
|
756
800
|
trace(...args) {
|
|
757
801
|
if (currentLogLevel < 3 /* Debug */) return;
|
|
758
802
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
759
|
-
|
|
803
|
+
log.message(
|
|
760
804
|
colorize(
|
|
761
805
|
`[${timeStamp}] \u{1F52C} TRACE: ${formatMessage(...args)}`,
|
|
762
806
|
colors.gray
|
|
@@ -764,10 +808,10 @@ var init_cli_output = __esm({
|
|
|
764
808
|
);
|
|
765
809
|
}
|
|
766
810
|
};
|
|
767
|
-
error =
|
|
768
|
-
warn =
|
|
769
|
-
info =
|
|
770
|
-
success =
|
|
811
|
+
error = log2.error.bind(log2);
|
|
812
|
+
warn = log2.warn.bind(log2);
|
|
813
|
+
info = log2.info.bind(log2);
|
|
814
|
+
success = log2.success.bind(log2);
|
|
771
815
|
}
|
|
772
816
|
});
|
|
773
817
|
|
|
@@ -1127,9 +1171,9 @@ var require_is_glob = __commonJS({
|
|
|
1127
1171
|
index += 2;
|
|
1128
1172
|
var close = chars[open];
|
|
1129
1173
|
if (close) {
|
|
1130
|
-
var
|
|
1131
|
-
if (
|
|
1132
|
-
index =
|
|
1174
|
+
var n2 = str.indexOf(close, index);
|
|
1175
|
+
if (n2 !== -1) {
|
|
1176
|
+
index = n2 + 1;
|
|
1133
1177
|
}
|
|
1134
1178
|
}
|
|
1135
1179
|
if (str[index] === "!") {
|
|
@@ -1155,9 +1199,9 @@ var require_is_glob = __commonJS({
|
|
|
1155
1199
|
index += 2;
|
|
1156
1200
|
var close = chars[open];
|
|
1157
1201
|
if (close) {
|
|
1158
|
-
var
|
|
1159
|
-
if (
|
|
1160
|
-
index =
|
|
1202
|
+
var n2 = str.indexOf(close, index);
|
|
1203
|
+
if (n2 !== -1) {
|
|
1204
|
+
index = n2 + 1;
|
|
1161
1205
|
}
|
|
1162
1206
|
}
|
|
1163
1207
|
if (str[index] === "!") {
|
|
@@ -1235,8 +1279,8 @@ var require_utils = __commonJS({
|
|
|
1235
1279
|
if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
|
|
1236
1280
|
return (Number(max) - Number(min)) / Number(step) >= limit;
|
|
1237
1281
|
};
|
|
1238
|
-
exports.escapeNode = (
|
|
1239
|
-
const node =
|
|
1282
|
+
exports.escapeNode = (block2, n2 = 0, type) => {
|
|
1283
|
+
const node = block2.nodes[n2];
|
|
1240
1284
|
if (!node) return;
|
|
1241
1285
|
if (type && node.type === type || node.type === "open" || node.type === "close") {
|
|
1242
1286
|
if (node.escaped !== true) {
|
|
@@ -1253,15 +1297,15 @@ var require_utils = __commonJS({
|
|
|
1253
1297
|
}
|
|
1254
1298
|
return false;
|
|
1255
1299
|
};
|
|
1256
|
-
exports.isInvalidBrace = (
|
|
1257
|
-
if (
|
|
1258
|
-
if (
|
|
1259
|
-
if (
|
|
1260
|
-
|
|
1300
|
+
exports.isInvalidBrace = (block2) => {
|
|
1301
|
+
if (block2.type !== "brace") return false;
|
|
1302
|
+
if (block2.invalid === true || block2.dollar) return true;
|
|
1303
|
+
if (block2.commas >> 0 + block2.ranges >> 0 === 0) {
|
|
1304
|
+
block2.invalid = true;
|
|
1261
1305
|
return true;
|
|
1262
1306
|
}
|
|
1263
|
-
if (
|
|
1264
|
-
|
|
1307
|
+
if (block2.open !== true || block2.close !== true) {
|
|
1308
|
+
block2.invalid = true;
|
|
1265
1309
|
return true;
|
|
1266
1310
|
}
|
|
1267
1311
|
return false;
|
|
@@ -1280,8 +1324,8 @@ var require_utils = __commonJS({
|
|
|
1280
1324
|
exports.flatten = (...args) => {
|
|
1281
1325
|
const result = [];
|
|
1282
1326
|
const flat = (arr) => {
|
|
1283
|
-
for (let
|
|
1284
|
-
const ele = arr[
|
|
1327
|
+
for (let i2 = 0; i2 < arr.length; i2++) {
|
|
1328
|
+
const ele = arr[i2];
|
|
1285
1329
|
if (Array.isArray(ele)) {
|
|
1286
1330
|
flat(ele);
|
|
1287
1331
|
continue;
|
|
@@ -1375,9 +1419,9 @@ var require_to_regex_range = __commonJS({
|
|
|
1375
1419
|
if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
|
|
1376
1420
|
return toRegexRange.cache[cacheKey].result;
|
|
1377
1421
|
}
|
|
1378
|
-
let
|
|
1422
|
+
let a2 = Math.min(min, max);
|
|
1379
1423
|
let b = Math.max(min, max);
|
|
1380
|
-
if (Math.abs(
|
|
1424
|
+
if (Math.abs(a2 - b) === 1) {
|
|
1381
1425
|
let result = min + "|" + max;
|
|
1382
1426
|
if (opts.capture) {
|
|
1383
1427
|
return `(${result})`;
|
|
@@ -1388,20 +1432,20 @@ var require_to_regex_range = __commonJS({
|
|
|
1388
1432
|
return `(?:${result})`;
|
|
1389
1433
|
}
|
|
1390
1434
|
let isPadded = hasPadding(min) || hasPadding(max);
|
|
1391
|
-
let state = { min, max, a, b };
|
|
1435
|
+
let state = { min, max, a: a2, b };
|
|
1392
1436
|
let positives = [];
|
|
1393
1437
|
let negatives = [];
|
|
1394
1438
|
if (isPadded) {
|
|
1395
1439
|
state.isPadded = isPadded;
|
|
1396
1440
|
state.maxLen = String(state.max).length;
|
|
1397
1441
|
}
|
|
1398
|
-
if (
|
|
1442
|
+
if (a2 < 0) {
|
|
1399
1443
|
let newMin = b < 0 ? Math.abs(b) : 1;
|
|
1400
|
-
negatives = splitToPatterns(newMin, Math.abs(
|
|
1401
|
-
|
|
1444
|
+
negatives = splitToPatterns(newMin, Math.abs(a2), state, opts);
|
|
1445
|
+
a2 = state.a = 0;
|
|
1402
1446
|
}
|
|
1403
1447
|
if (b >= 0) {
|
|
1404
|
-
positives = splitToPatterns(
|
|
1448
|
+
positives = splitToPatterns(a2, b, state, opts);
|
|
1405
1449
|
}
|
|
1406
1450
|
state.negatives = negatives;
|
|
1407
1451
|
state.positives = positives;
|
|
@@ -1449,8 +1493,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1449
1493
|
let digits = zipped.length;
|
|
1450
1494
|
let pattern = "";
|
|
1451
1495
|
let count = 0;
|
|
1452
|
-
for (let
|
|
1453
|
-
let [startDigit, stopDigit] = zipped[
|
|
1496
|
+
for (let i2 = 0; i2 < digits; i2++) {
|
|
1497
|
+
let [startDigit, stopDigit] = zipped[i2];
|
|
1454
1498
|
if (startDigit === stopDigit) {
|
|
1455
1499
|
pattern += startDigit;
|
|
1456
1500
|
} else if (startDigit !== "0" || stopDigit !== "9") {
|
|
@@ -1469,8 +1513,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1469
1513
|
let tokens = [];
|
|
1470
1514
|
let start = min;
|
|
1471
1515
|
let prev;
|
|
1472
|
-
for (let
|
|
1473
|
-
let max2 = ranges[
|
|
1516
|
+
for (let i2 = 0; i2 < ranges.length; i2++) {
|
|
1517
|
+
let max2 = ranges[i2];
|
|
1474
1518
|
let obj = rangeToPattern(String(start), String(max2), options);
|
|
1475
1519
|
let zeros = "";
|
|
1476
1520
|
if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
|
|
@@ -1505,13 +1549,13 @@ var require_to_regex_range = __commonJS({
|
|
|
1505
1549
|
}
|
|
1506
1550
|
return result;
|
|
1507
1551
|
}
|
|
1508
|
-
function zip(
|
|
1552
|
+
function zip(a2, b) {
|
|
1509
1553
|
let arr = [];
|
|
1510
|
-
for (let
|
|
1554
|
+
for (let i2 = 0; i2 < a2.length; i2++) arr.push([a2[i2], b[i2]]);
|
|
1511
1555
|
return arr;
|
|
1512
1556
|
}
|
|
1513
|
-
function compare(
|
|
1514
|
-
return
|
|
1557
|
+
function compare(a2, b) {
|
|
1558
|
+
return a2 > b ? 1 : b > a2 ? -1 : 0;
|
|
1515
1559
|
}
|
|
1516
1560
|
function contains(arr, key, val) {
|
|
1517
1561
|
return arr.some((ele) => ele[key] === val);
|
|
@@ -1529,8 +1573,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1529
1573
|
}
|
|
1530
1574
|
return "";
|
|
1531
1575
|
}
|
|
1532
|
-
function toCharacterClass(
|
|
1533
|
-
return `[${
|
|
1576
|
+
function toCharacterClass(a2, b, options) {
|
|
1577
|
+
return `[${a2}${b - a2 === 1 ? "" : "-"}${b}]`;
|
|
1534
1578
|
}
|
|
1535
1579
|
function hasPadding(str) {
|
|
1536
1580
|
return /^-?(0+)\d/.test(str);
|
|
@@ -1609,8 +1653,8 @@ var require_fill_range = __commonJS({
|
|
|
1609
1653
|
return negative ? "-" + input : input;
|
|
1610
1654
|
};
|
|
1611
1655
|
var toSequence = (parts, options, maxLen) => {
|
|
1612
|
-
parts.negatives.sort((
|
|
1613
|
-
parts.positives.sort((
|
|
1656
|
+
parts.negatives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
1657
|
+
parts.positives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
1614
1658
|
let prefix = options.capture ? "" : "?:";
|
|
1615
1659
|
let positives = "";
|
|
1616
1660
|
let negatives = "";
|
|
@@ -1631,12 +1675,12 @@ var require_fill_range = __commonJS({
|
|
|
1631
1675
|
}
|
|
1632
1676
|
return result;
|
|
1633
1677
|
};
|
|
1634
|
-
var toRange = (
|
|
1678
|
+
var toRange = (a2, b, isNumbers, options) => {
|
|
1635
1679
|
if (isNumbers) {
|
|
1636
|
-
return toRegexRange(
|
|
1680
|
+
return toRegexRange(a2, b, { wrap: false, ...options });
|
|
1637
1681
|
}
|
|
1638
|
-
let start = String.fromCharCode(
|
|
1639
|
-
if (
|
|
1682
|
+
let start = String.fromCharCode(a2);
|
|
1683
|
+
if (a2 === b) return start;
|
|
1640
1684
|
let stop = String.fromCharCode(b);
|
|
1641
1685
|
return `[${start}-${stop}]`;
|
|
1642
1686
|
};
|
|
@@ -1662,15 +1706,15 @@ var require_fill_range = __commonJS({
|
|
|
1662
1706
|
return [];
|
|
1663
1707
|
};
|
|
1664
1708
|
var fillNumbers = (start, end, step = 1, options = {}) => {
|
|
1665
|
-
let
|
|
1709
|
+
let a2 = Number(start);
|
|
1666
1710
|
let b = Number(end);
|
|
1667
|
-
if (!Number.isInteger(
|
|
1711
|
+
if (!Number.isInteger(a2) || !Number.isInteger(b)) {
|
|
1668
1712
|
if (options.strictRanges === true) throw rangeError([start, end]);
|
|
1669
1713
|
return [];
|
|
1670
1714
|
}
|
|
1671
|
-
if (
|
|
1715
|
+
if (a2 === 0) a2 = 0;
|
|
1672
1716
|
if (b === 0) b = 0;
|
|
1673
|
-
let descending =
|
|
1717
|
+
let descending = a2 > b;
|
|
1674
1718
|
let startString = String(start);
|
|
1675
1719
|
let endString = String(end);
|
|
1676
1720
|
let stepString = String(step);
|
|
@@ -1686,13 +1730,13 @@ var require_fill_range = __commonJS({
|
|
|
1686
1730
|
let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
|
|
1687
1731
|
let range = [];
|
|
1688
1732
|
let index = 0;
|
|
1689
|
-
while (descending ?
|
|
1733
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
1690
1734
|
if (options.toRegex === true && step > 1) {
|
|
1691
|
-
push(
|
|
1735
|
+
push(a2);
|
|
1692
1736
|
} else {
|
|
1693
|
-
range.push(pad(format(
|
|
1737
|
+
range.push(pad(format(a2, index), maxLen, toNumber));
|
|
1694
1738
|
}
|
|
1695
|
-
|
|
1739
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
1696
1740
|
index++;
|
|
1697
1741
|
}
|
|
1698
1742
|
if (options.toRegex === true) {
|
|
@@ -1705,19 +1749,19 @@ var require_fill_range = __commonJS({
|
|
|
1705
1749
|
return invalidRange(start, end, options);
|
|
1706
1750
|
}
|
|
1707
1751
|
let format = options.transform || ((val) => String.fromCharCode(val));
|
|
1708
|
-
let
|
|
1752
|
+
let a2 = `${start}`.charCodeAt(0);
|
|
1709
1753
|
let b = `${end}`.charCodeAt(0);
|
|
1710
|
-
let descending =
|
|
1711
|
-
let min = Math.min(
|
|
1712
|
-
let max = Math.max(
|
|
1754
|
+
let descending = a2 > b;
|
|
1755
|
+
let min = Math.min(a2, b);
|
|
1756
|
+
let max = Math.max(a2, b);
|
|
1713
1757
|
if (options.toRegex && step === 1) {
|
|
1714
1758
|
return toRange(min, max, false, options);
|
|
1715
1759
|
}
|
|
1716
1760
|
let range = [];
|
|
1717
1761
|
let index = 0;
|
|
1718
|
-
while (descending ?
|
|
1719
|
-
range.push(format(
|
|
1720
|
-
|
|
1762
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
1763
|
+
range.push(format(a2, index));
|
|
1764
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
1721
1765
|
index++;
|
|
1722
1766
|
}
|
|
1723
1767
|
if (options.toRegex === true) {
|
|
@@ -1841,17 +1885,17 @@ var require_expand = __commonJS({
|
|
|
1841
1885
|
const walk = (node, parent = {}) => {
|
|
1842
1886
|
node.queue = [];
|
|
1843
1887
|
let p = parent;
|
|
1844
|
-
let
|
|
1888
|
+
let q = parent.queue;
|
|
1845
1889
|
while (p.type !== "brace" && p.type !== "root" && p.parent) {
|
|
1846
1890
|
p = p.parent;
|
|
1847
|
-
|
|
1891
|
+
q = p.queue;
|
|
1848
1892
|
}
|
|
1849
1893
|
if (node.invalid || node.dollar) {
|
|
1850
|
-
|
|
1894
|
+
q.push(append(q.pop(), stringify2(node, options)));
|
|
1851
1895
|
return;
|
|
1852
1896
|
}
|
|
1853
1897
|
if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
|
|
1854
|
-
|
|
1898
|
+
q.push(append(q.pop(), ["{}"]));
|
|
1855
1899
|
return;
|
|
1856
1900
|
}
|
|
1857
1901
|
if (node.nodes && node.ranges > 0) {
|
|
@@ -1863,26 +1907,26 @@ var require_expand = __commonJS({
|
|
|
1863
1907
|
if (range.length === 0) {
|
|
1864
1908
|
range = stringify2(node, options);
|
|
1865
1909
|
}
|
|
1866
|
-
|
|
1910
|
+
q.push(append(q.pop(), range));
|
|
1867
1911
|
node.nodes = [];
|
|
1868
1912
|
return;
|
|
1869
1913
|
}
|
|
1870
1914
|
const enclose = utils.encloseBrace(node);
|
|
1871
1915
|
let queue = node.queue;
|
|
1872
|
-
let
|
|
1873
|
-
while (
|
|
1874
|
-
|
|
1875
|
-
queue =
|
|
1916
|
+
let block2 = node;
|
|
1917
|
+
while (block2.type !== "brace" && block2.type !== "root" && block2.parent) {
|
|
1918
|
+
block2 = block2.parent;
|
|
1919
|
+
queue = block2.queue;
|
|
1876
1920
|
}
|
|
1877
|
-
for (let
|
|
1878
|
-
const child = node.nodes[
|
|
1921
|
+
for (let i2 = 0; i2 < node.nodes.length; i2++) {
|
|
1922
|
+
const child = node.nodes[i2];
|
|
1879
1923
|
if (child.type === "comma" && node.type === "brace") {
|
|
1880
|
-
if (
|
|
1924
|
+
if (i2 === 1) queue.push("");
|
|
1881
1925
|
queue.push("");
|
|
1882
1926
|
continue;
|
|
1883
1927
|
}
|
|
1884
1928
|
if (child.type === "close") {
|
|
1885
|
-
|
|
1929
|
+
q.push(append(q.pop(), queue, enclose));
|
|
1886
1930
|
continue;
|
|
1887
1931
|
}
|
|
1888
1932
|
if (child.value && child.type !== "open") {
|
|
@@ -2049,7 +2093,7 @@ var require_parse = __commonJS({
|
|
|
2049
2093
|
}
|
|
2050
2094
|
const ast = { type: "root", input, nodes: [] };
|
|
2051
2095
|
const stack = [ast];
|
|
2052
|
-
let
|
|
2096
|
+
let block2 = ast;
|
|
2053
2097
|
let prev = ast;
|
|
2054
2098
|
let brackets = 0;
|
|
2055
2099
|
const length = input.length;
|
|
@@ -2065,15 +2109,15 @@ var require_parse = __commonJS({
|
|
|
2065
2109
|
prev.value += node.value;
|
|
2066
2110
|
return;
|
|
2067
2111
|
}
|
|
2068
|
-
|
|
2069
|
-
node.parent =
|
|
2112
|
+
block2.nodes.push(node);
|
|
2113
|
+
node.parent = block2;
|
|
2070
2114
|
node.prev = prev;
|
|
2071
2115
|
prev = node;
|
|
2072
2116
|
return node;
|
|
2073
2117
|
};
|
|
2074
2118
|
push({ type: "bos" });
|
|
2075
2119
|
while (index < length) {
|
|
2076
|
-
|
|
2120
|
+
block2 = stack[stack.length - 1];
|
|
2077
2121
|
value = advance();
|
|
2078
2122
|
if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
|
|
2079
2123
|
continue;
|
|
@@ -2110,19 +2154,19 @@ var require_parse = __commonJS({
|
|
|
2110
2154
|
continue;
|
|
2111
2155
|
}
|
|
2112
2156
|
if (value === CHAR_LEFT_PARENTHESES) {
|
|
2113
|
-
|
|
2114
|
-
stack.push(
|
|
2157
|
+
block2 = push({ type: "paren", nodes: [] });
|
|
2158
|
+
stack.push(block2);
|
|
2115
2159
|
push({ type: "text", value });
|
|
2116
2160
|
continue;
|
|
2117
2161
|
}
|
|
2118
2162
|
if (value === CHAR_RIGHT_PARENTHESES) {
|
|
2119
|
-
if (
|
|
2163
|
+
if (block2.type !== "paren") {
|
|
2120
2164
|
push({ type: "text", value });
|
|
2121
2165
|
continue;
|
|
2122
2166
|
}
|
|
2123
|
-
|
|
2167
|
+
block2 = stack.pop();
|
|
2124
2168
|
push({ type: "text", value });
|
|
2125
|
-
|
|
2169
|
+
block2 = stack[stack.length - 1];
|
|
2126
2170
|
continue;
|
|
2127
2171
|
}
|
|
2128
2172
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
@@ -2147,7 +2191,7 @@ var require_parse = __commonJS({
|
|
|
2147
2191
|
}
|
|
2148
2192
|
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
2149
2193
|
depth++;
|
|
2150
|
-
const dollar = prev.value && prev.value.slice(-1) === "$" ||
|
|
2194
|
+
const dollar = prev.value && prev.value.slice(-1) === "$" || block2.dollar === true;
|
|
2151
2195
|
const brace = {
|
|
2152
2196
|
type: "brace",
|
|
2153
2197
|
open: true,
|
|
@@ -2158,52 +2202,52 @@ var require_parse = __commonJS({
|
|
|
2158
2202
|
ranges: 0,
|
|
2159
2203
|
nodes: []
|
|
2160
2204
|
};
|
|
2161
|
-
|
|
2162
|
-
stack.push(
|
|
2205
|
+
block2 = push(brace);
|
|
2206
|
+
stack.push(block2);
|
|
2163
2207
|
push({ type: "open", value });
|
|
2164
2208
|
continue;
|
|
2165
2209
|
}
|
|
2166
2210
|
if (value === CHAR_RIGHT_CURLY_BRACE) {
|
|
2167
|
-
if (
|
|
2211
|
+
if (block2.type !== "brace") {
|
|
2168
2212
|
push({ type: "text", value });
|
|
2169
2213
|
continue;
|
|
2170
2214
|
}
|
|
2171
2215
|
const type = "close";
|
|
2172
|
-
|
|
2173
|
-
|
|
2216
|
+
block2 = stack.pop();
|
|
2217
|
+
block2.close = true;
|
|
2174
2218
|
push({ type, value });
|
|
2175
2219
|
depth--;
|
|
2176
|
-
|
|
2220
|
+
block2 = stack[stack.length - 1];
|
|
2177
2221
|
continue;
|
|
2178
2222
|
}
|
|
2179
2223
|
if (value === CHAR_COMMA && depth > 0) {
|
|
2180
|
-
if (
|
|
2181
|
-
|
|
2182
|
-
const open =
|
|
2183
|
-
|
|
2224
|
+
if (block2.ranges > 0) {
|
|
2225
|
+
block2.ranges = 0;
|
|
2226
|
+
const open = block2.nodes.shift();
|
|
2227
|
+
block2.nodes = [open, { type: "text", value: stringify2(block2) }];
|
|
2184
2228
|
}
|
|
2185
2229
|
push({ type: "comma", value });
|
|
2186
|
-
|
|
2230
|
+
block2.commas++;
|
|
2187
2231
|
continue;
|
|
2188
2232
|
}
|
|
2189
|
-
if (value === CHAR_DOT && depth > 0 &&
|
|
2190
|
-
const siblings =
|
|
2233
|
+
if (value === CHAR_DOT && depth > 0 && block2.commas === 0) {
|
|
2234
|
+
const siblings = block2.nodes;
|
|
2191
2235
|
if (depth === 0 || siblings.length === 0) {
|
|
2192
2236
|
push({ type: "text", value });
|
|
2193
2237
|
continue;
|
|
2194
2238
|
}
|
|
2195
2239
|
if (prev.type === "dot") {
|
|
2196
|
-
|
|
2240
|
+
block2.range = [];
|
|
2197
2241
|
prev.value += value;
|
|
2198
2242
|
prev.type = "range";
|
|
2199
|
-
if (
|
|
2200
|
-
|
|
2201
|
-
|
|
2243
|
+
if (block2.nodes.length !== 3 && block2.nodes.length !== 5) {
|
|
2244
|
+
block2.invalid = true;
|
|
2245
|
+
block2.ranges = 0;
|
|
2202
2246
|
prev.type = "text";
|
|
2203
2247
|
continue;
|
|
2204
2248
|
}
|
|
2205
|
-
|
|
2206
|
-
|
|
2249
|
+
block2.ranges++;
|
|
2250
|
+
block2.args = [];
|
|
2207
2251
|
continue;
|
|
2208
2252
|
}
|
|
2209
2253
|
if (prev.type === "range") {
|
|
@@ -2211,7 +2255,7 @@ var require_parse = __commonJS({
|
|
|
2211
2255
|
const before = siblings[siblings.length - 1];
|
|
2212
2256
|
before.value += prev.value + value;
|
|
2213
2257
|
prev = before;
|
|
2214
|
-
|
|
2258
|
+
block2.ranges--;
|
|
2215
2259
|
continue;
|
|
2216
2260
|
}
|
|
2217
2261
|
push({ type: "dot", value });
|
|
@@ -2220,9 +2264,9 @@ var require_parse = __commonJS({
|
|
|
2220
2264
|
push({ type: "text", value });
|
|
2221
2265
|
}
|
|
2222
2266
|
do {
|
|
2223
|
-
|
|
2224
|
-
if (
|
|
2225
|
-
|
|
2267
|
+
block2 = stack.pop();
|
|
2268
|
+
if (block2.type !== "root") {
|
|
2269
|
+
block2.nodes.forEach((node) => {
|
|
2226
2270
|
if (!node.nodes) {
|
|
2227
2271
|
if (node.type === "open") node.isOpen = true;
|
|
2228
2272
|
if (node.type === "close") node.isClose = true;
|
|
@@ -2231,8 +2275,8 @@ var require_parse = __commonJS({
|
|
|
2231
2275
|
}
|
|
2232
2276
|
});
|
|
2233
2277
|
const parent = stack[stack.length - 1];
|
|
2234
|
-
const index2 = parent.nodes.indexOf(
|
|
2235
|
-
parent.nodes.splice(index2, 1, ...
|
|
2278
|
+
const index2 = parent.nodes.indexOf(block2);
|
|
2279
|
+
parent.nodes.splice(index2, 1, ...block2.nodes);
|
|
2236
2280
|
}
|
|
2237
2281
|
} while (stack.length > 0);
|
|
2238
2282
|
push({ type: "eos" });
|
|
@@ -2865,9 +2909,9 @@ var require_scan = __commonJS({
|
|
|
2865
2909
|
if (opts.parts === true || opts.tokens === true) {
|
|
2866
2910
|
let prevIndex;
|
|
2867
2911
|
for (let idx = 0; idx < slashes.length; idx++) {
|
|
2868
|
-
const
|
|
2869
|
-
const
|
|
2870
|
-
const value = input.slice(
|
|
2912
|
+
const n2 = prevIndex ? prevIndex + 1 : start;
|
|
2913
|
+
const i2 = slashes[idx];
|
|
2914
|
+
const value = input.slice(n2, i2);
|
|
2871
2915
|
if (opts.tokens) {
|
|
2872
2916
|
if (idx === 0 && start !== 0) {
|
|
2873
2917
|
tokens[idx].isPrefix = true;
|
|
@@ -2881,7 +2925,7 @@ var require_scan = __commonJS({
|
|
|
2881
2925
|
if (idx !== 0 || value !== "") {
|
|
2882
2926
|
parts.push(value);
|
|
2883
2927
|
}
|
|
2884
|
-
prevIndex =
|
|
2928
|
+
prevIndex = i2;
|
|
2885
2929
|
}
|
|
2886
2930
|
if (prevIndex && prevIndex + 1 < input.length) {
|
|
2887
2931
|
const value = input.slice(prevIndex + 1);
|
|
@@ -3010,15 +3054,15 @@ var require_parse2 = __commonJS({
|
|
|
3010
3054
|
};
|
|
3011
3055
|
var hasRepeatedCharPrefixOverlap = (branches) => {
|
|
3012
3056
|
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
3013
|
-
for (let
|
|
3014
|
-
for (let j =
|
|
3015
|
-
const
|
|
3057
|
+
for (let i2 = 0; i2 < values.length; i2++) {
|
|
3058
|
+
for (let j = i2 + 1; j < values.length; j++) {
|
|
3059
|
+
const a2 = values[i2];
|
|
3016
3060
|
const b = values[j];
|
|
3017
|
-
const char =
|
|
3018
|
-
if (!char ||
|
|
3061
|
+
const char = a2[0];
|
|
3062
|
+
if (!char || a2 !== char.repeat(a2.length) || b !== char.repeat(b.length)) {
|
|
3019
3063
|
continue;
|
|
3020
3064
|
}
|
|
3021
|
-
if (
|
|
3065
|
+
if (a2 === b || a2.startsWith(b) || b.startsWith(a2)) {
|
|
3022
3066
|
return true;
|
|
3023
3067
|
}
|
|
3024
3068
|
}
|
|
@@ -3033,8 +3077,8 @@ var require_parse2 = __commonJS({
|
|
|
3033
3077
|
let paren = 0;
|
|
3034
3078
|
let quote = 0;
|
|
3035
3079
|
let escaped = false;
|
|
3036
|
-
for (let
|
|
3037
|
-
const ch = pattern[
|
|
3080
|
+
for (let i2 = 1; i2 < pattern.length; i2++) {
|
|
3081
|
+
const ch = pattern[i2];
|
|
3038
3082
|
if (escaped === true) {
|
|
3039
3083
|
escaped = false;
|
|
3040
3084
|
continue;
|
|
@@ -3068,13 +3112,13 @@ var require_parse2 = __commonJS({
|
|
|
3068
3112
|
if (ch === ")") {
|
|
3069
3113
|
paren--;
|
|
3070
3114
|
if (paren === 0) {
|
|
3071
|
-
if (requireEnd === true &&
|
|
3115
|
+
if (requireEnd === true && i2 !== pattern.length - 1) {
|
|
3072
3116
|
return;
|
|
3073
3117
|
}
|
|
3074
3118
|
return {
|
|
3075
3119
|
type: pattern[0],
|
|
3076
|
-
body: pattern.slice(2,
|
|
3077
|
-
end:
|
|
3120
|
+
body: pattern.slice(2, i2),
|
|
3121
|
+
end: i2
|
|
3078
3122
|
};
|
|
3079
3123
|
}
|
|
3080
3124
|
}
|
|
@@ -3206,7 +3250,7 @@ var require_parse2 = __commonJS({
|
|
|
3206
3250
|
let prev = bos;
|
|
3207
3251
|
let value;
|
|
3208
3252
|
const eos = () => state.index === len - 1;
|
|
3209
|
-
const peek = state.peek = (
|
|
3253
|
+
const peek = state.peek = (n2 = 1) => input[state.index + n2];
|
|
3210
3254
|
const advance = state.advance = () => input[++state.index] || "";
|
|
3211
3255
|
const remaining = () => input.slice(state.index + 1);
|
|
3212
3256
|
const consume = (value2 = "", num = 0) => {
|
|
@@ -3287,10 +3331,10 @@ var require_parse2 = __commonJS({
|
|
|
3287
3331
|
open.type = "text";
|
|
3288
3332
|
open.value = literal;
|
|
3289
3333
|
open.output = safeOutput || utils.escapeRegex(literal);
|
|
3290
|
-
for (let
|
|
3291
|
-
tokens[
|
|
3292
|
-
tokens[
|
|
3293
|
-
delete tokens[
|
|
3334
|
+
for (let i2 = token.tokensIndex + 1; i2 < tokens.length; i2++) {
|
|
3335
|
+
tokens[i2].value = "";
|
|
3336
|
+
tokens[i2].output = "";
|
|
3337
|
+
delete tokens[i2].suffix;
|
|
3294
3338
|
}
|
|
3295
3339
|
state.output = token.output + open.output;
|
|
3296
3340
|
state.backtrack = true;
|
|
@@ -3533,13 +3577,13 @@ var require_parse2 = __commonJS({
|
|
|
3533
3577
|
if (brace.dots === true) {
|
|
3534
3578
|
const arr = tokens.slice();
|
|
3535
3579
|
const range = [];
|
|
3536
|
-
for (let
|
|
3580
|
+
for (let i2 = arr.length - 1; i2 >= 0; i2--) {
|
|
3537
3581
|
tokens.pop();
|
|
3538
|
-
if (arr[
|
|
3582
|
+
if (arr[i2].type === "brace") {
|
|
3539
3583
|
break;
|
|
3540
3584
|
}
|
|
3541
|
-
if (arr[
|
|
3542
|
-
range.unshift(arr[
|
|
3585
|
+
if (arr[i2].type !== "dots") {
|
|
3586
|
+
range.unshift(arr[i2].value);
|
|
3543
3587
|
}
|
|
3544
3588
|
}
|
|
3545
3589
|
output = expandRange(range, opts);
|
|
@@ -4082,8 +4126,8 @@ var require_micromatch = __commonJS({
|
|
|
4082
4126
|
options.onResult(state);
|
|
4083
4127
|
}
|
|
4084
4128
|
};
|
|
4085
|
-
for (let
|
|
4086
|
-
let isMatch = picomatch(String(patterns[
|
|
4129
|
+
for (let i2 = 0; i2 < patterns.length; i2++) {
|
|
4130
|
+
let isMatch = picomatch(String(patterns[i2]), { ...options, onResult }, true);
|
|
4087
4131
|
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
|
|
4088
4132
|
if (negated) negatives++;
|
|
4089
4133
|
for (let item of list) {
|
|
@@ -4331,7 +4375,7 @@ var require_pattern = __commonJS({
|
|
|
4331
4375
|
exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
|
4332
4376
|
function expandBraceExpansion(pattern) {
|
|
4333
4377
|
const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });
|
|
4334
|
-
patterns.sort((
|
|
4378
|
+
patterns.sort((a2, b) => a2.length - b.length);
|
|
4335
4379
|
return patterns.filter((pattern2) => pattern2 !== "");
|
|
4336
4380
|
}
|
|
4337
4381
|
exports.expandBraceExpansion = expandBraceExpansion;
|
|
@@ -4412,8 +4456,8 @@ var require_merge2 = __commonJS({
|
|
|
4412
4456
|
}
|
|
4413
4457
|
const mergedStream = PassThrough(options);
|
|
4414
4458
|
function addStream() {
|
|
4415
|
-
for (let
|
|
4416
|
-
streamsQueue.push(pauseStreams(arguments[
|
|
4459
|
+
for (let i2 = 0, len = arguments.length; i2 < len; i2++) {
|
|
4460
|
+
streamsQueue.push(pauseStreams(arguments[i2], options));
|
|
4417
4461
|
}
|
|
4418
4462
|
mergeStream();
|
|
4419
4463
|
return this;
|
|
@@ -4462,8 +4506,8 @@ var require_merge2 = __commonJS({
|
|
|
4462
4506
|
stream.pipe(mergedStream, { end: false });
|
|
4463
4507
|
stream.resume();
|
|
4464
4508
|
}
|
|
4465
|
-
for (let
|
|
4466
|
-
pipe(streams[
|
|
4509
|
+
for (let i2 = 0; i2 < streams.length; i2++) {
|
|
4510
|
+
pipe(streams[i2]);
|
|
4467
4511
|
}
|
|
4468
4512
|
next();
|
|
4469
4513
|
}
|
|
@@ -4494,8 +4538,8 @@ var require_merge2 = __commonJS({
|
|
|
4494
4538
|
}
|
|
4495
4539
|
streams.pause();
|
|
4496
4540
|
} else {
|
|
4497
|
-
for (let
|
|
4498
|
-
streams[
|
|
4541
|
+
for (let i2 = 0, len = streams.length; i2 < len; i2++) {
|
|
4542
|
+
streams[i2] = pauseStreams(streams[i2], options);
|
|
4499
4543
|
}
|
|
4500
4544
|
}
|
|
4501
4545
|
return streams;
|
|
@@ -4577,13 +4621,13 @@ var require_tasks = __commonJS({
|
|
|
4577
4621
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4578
4622
|
exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
|
|
4579
4623
|
var utils = require_utils3();
|
|
4580
|
-
function generate(input,
|
|
4581
|
-
const patterns = processPatterns(input,
|
|
4582
|
-
const ignore = processPatterns(
|
|
4624
|
+
function generate(input, settings2) {
|
|
4625
|
+
const patterns = processPatterns(input, settings2);
|
|
4626
|
+
const ignore = processPatterns(settings2.ignore, settings2);
|
|
4583
4627
|
const positivePatterns = getPositivePatterns(patterns);
|
|
4584
4628
|
const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
|
|
4585
|
-
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern,
|
|
4586
|
-
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern,
|
|
4629
|
+
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings2));
|
|
4630
|
+
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings2));
|
|
4587
4631
|
const staticTasks = convertPatternsToTasks(
|
|
4588
4632
|
staticPatterns,
|
|
4589
4633
|
negativePatterns,
|
|
@@ -4599,12 +4643,12 @@ var require_tasks = __commonJS({
|
|
|
4599
4643
|
return staticTasks.concat(dynamicTasks);
|
|
4600
4644
|
}
|
|
4601
4645
|
exports.generate = generate;
|
|
4602
|
-
function processPatterns(input,
|
|
4646
|
+
function processPatterns(input, settings2) {
|
|
4603
4647
|
let patterns = input;
|
|
4604
|
-
if (
|
|
4648
|
+
if (settings2.braceExpansion) {
|
|
4605
4649
|
patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);
|
|
4606
4650
|
}
|
|
4607
|
-
if (
|
|
4651
|
+
if (settings2.baseNameMatch) {
|
|
4608
4652
|
patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`);
|
|
4609
4653
|
}
|
|
4610
4654
|
return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));
|
|
@@ -4673,26 +4717,26 @@ var require_async = __commonJS({
|
|
|
4673
4717
|
init_utils2();
|
|
4674
4718
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4675
4719
|
exports.read = void 0;
|
|
4676
|
-
function read(path,
|
|
4677
|
-
|
|
4720
|
+
function read(path, settings2, callback) {
|
|
4721
|
+
settings2.fs.lstat(path, (lstatError, lstat) => {
|
|
4678
4722
|
if (lstatError !== null) {
|
|
4679
4723
|
callFailureCallback(callback, lstatError);
|
|
4680
4724
|
return;
|
|
4681
4725
|
}
|
|
4682
|
-
if (!lstat.isSymbolicLink() || !
|
|
4726
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
4683
4727
|
callSuccessCallback(callback, lstat);
|
|
4684
4728
|
return;
|
|
4685
4729
|
}
|
|
4686
|
-
|
|
4730
|
+
settings2.fs.stat(path, (statError, stat) => {
|
|
4687
4731
|
if (statError !== null) {
|
|
4688
|
-
if (
|
|
4732
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4689
4733
|
callFailureCallback(callback, statError);
|
|
4690
4734
|
return;
|
|
4691
4735
|
}
|
|
4692
4736
|
callSuccessCallback(callback, lstat);
|
|
4693
4737
|
return;
|
|
4694
4738
|
}
|
|
4695
|
-
if (
|
|
4739
|
+
if (settings2.markSymbolicLink) {
|
|
4696
4740
|
stat.isSymbolicLink = () => true;
|
|
4697
4741
|
}
|
|
4698
4742
|
callSuccessCallback(callback, stat);
|
|
@@ -4716,19 +4760,19 @@ var require_sync = __commonJS({
|
|
|
4716
4760
|
init_utils2();
|
|
4717
4761
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4718
4762
|
exports.read = void 0;
|
|
4719
|
-
function read(path,
|
|
4720
|
-
const lstat =
|
|
4721
|
-
if (!lstat.isSymbolicLink() || !
|
|
4763
|
+
function read(path, settings2) {
|
|
4764
|
+
const lstat = settings2.fs.lstatSync(path);
|
|
4765
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
4722
4766
|
return lstat;
|
|
4723
4767
|
}
|
|
4724
4768
|
try {
|
|
4725
|
-
const stat =
|
|
4726
|
-
if (
|
|
4769
|
+
const stat = settings2.fs.statSync(path);
|
|
4770
|
+
if (settings2.markSymbolicLink) {
|
|
4727
4771
|
stat.isSymbolicLink = () => true;
|
|
4728
4772
|
}
|
|
4729
4773
|
return stat;
|
|
4730
4774
|
} catch (error2) {
|
|
4731
|
-
if (!
|
|
4775
|
+
if (!settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4732
4776
|
return lstat;
|
|
4733
4777
|
}
|
|
4734
4778
|
throw error2;
|
|
@@ -4805,8 +4849,8 @@ var require_out = __commonJS({
|
|
|
4805
4849
|
}
|
|
4806
4850
|
exports.stat = stat;
|
|
4807
4851
|
function statSync3(path, optionsOrSettings) {
|
|
4808
|
-
const
|
|
4809
|
-
return sync.read(path,
|
|
4852
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
4853
|
+
return sync.read(path, settings2);
|
|
4810
4854
|
}
|
|
4811
4855
|
exports.statSync = statSync3;
|
|
4812
4856
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -4854,8 +4898,8 @@ var require_run_parallel = __commonJS({
|
|
|
4854
4898
|
if (isSync) queueMicrotask2(end);
|
|
4855
4899
|
else end();
|
|
4856
4900
|
}
|
|
4857
|
-
function each(
|
|
4858
|
-
results[
|
|
4901
|
+
function each(i2, err, result) {
|
|
4902
|
+
results[i2] = result;
|
|
4859
4903
|
if (--pending === 0 || err) {
|
|
4860
4904
|
done(err);
|
|
4861
4905
|
}
|
|
@@ -4869,9 +4913,9 @@ var require_run_parallel = __commonJS({
|
|
|
4869
4913
|
});
|
|
4870
4914
|
});
|
|
4871
4915
|
} else {
|
|
4872
|
-
tasks.forEach(function(task,
|
|
4916
|
+
tasks.forEach(function(task, i2) {
|
|
4873
4917
|
task(function(err, result) {
|
|
4874
|
-
each(
|
|
4918
|
+
each(i2, err, result);
|
|
4875
4919
|
});
|
|
4876
4920
|
});
|
|
4877
4921
|
}
|
|
@@ -4946,11 +4990,11 @@ var require_common = __commonJS({
|
|
|
4946
4990
|
init_utils2();
|
|
4947
4991
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4948
4992
|
exports.joinPathSegments = void 0;
|
|
4949
|
-
function joinPathSegments(
|
|
4950
|
-
if (
|
|
4951
|
-
return
|
|
4993
|
+
function joinPathSegments(a2, b, separator) {
|
|
4994
|
+
if (a2.endsWith(separator)) {
|
|
4995
|
+
return a2 + b;
|
|
4952
4996
|
}
|
|
4953
|
-
return
|
|
4997
|
+
return a2 + separator + b;
|
|
4954
4998
|
}
|
|
4955
4999
|
exports.joinPathSegments = joinPathSegments;
|
|
4956
5000
|
}
|
|
@@ -4968,16 +5012,16 @@ var require_async2 = __commonJS({
|
|
|
4968
5012
|
var constants_1 = require_constants3();
|
|
4969
5013
|
var utils = require_utils4();
|
|
4970
5014
|
var common = require_common();
|
|
4971
|
-
function read(directory,
|
|
4972
|
-
if (!
|
|
4973
|
-
readdirWithFileTypes(directory,
|
|
5015
|
+
function read(directory, settings2, callback) {
|
|
5016
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
5017
|
+
readdirWithFileTypes(directory, settings2, callback);
|
|
4974
5018
|
return;
|
|
4975
5019
|
}
|
|
4976
|
-
readdir(directory,
|
|
5020
|
+
readdir(directory, settings2, callback);
|
|
4977
5021
|
}
|
|
4978
5022
|
exports.read = read;
|
|
4979
|
-
function readdirWithFileTypes(directory,
|
|
4980
|
-
|
|
5023
|
+
function readdirWithFileTypes(directory, settings2, callback) {
|
|
5024
|
+
settings2.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
|
|
4981
5025
|
if (readdirError !== null) {
|
|
4982
5026
|
callFailureCallback(callback, readdirError);
|
|
4983
5027
|
return;
|
|
@@ -4985,13 +5029,13 @@ var require_async2 = __commonJS({
|
|
|
4985
5029
|
const entries = dirents.map((dirent) => ({
|
|
4986
5030
|
dirent,
|
|
4987
5031
|
name: dirent.name,
|
|
4988
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
5032
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
4989
5033
|
}));
|
|
4990
|
-
if (!
|
|
5034
|
+
if (!settings2.followSymbolicLinks) {
|
|
4991
5035
|
callSuccessCallback(callback, entries);
|
|
4992
5036
|
return;
|
|
4993
5037
|
}
|
|
4994
|
-
const tasks = entries.map((entry) => makeRplTaskEntry(entry,
|
|
5038
|
+
const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings2));
|
|
4995
5039
|
rpl(tasks, (rplError, rplEntries) => {
|
|
4996
5040
|
if (rplError !== null) {
|
|
4997
5041
|
callFailureCallback(callback, rplError);
|
|
@@ -5002,15 +5046,15 @@ var require_async2 = __commonJS({
|
|
|
5002
5046
|
});
|
|
5003
5047
|
}
|
|
5004
5048
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
5005
|
-
function makeRplTaskEntry(entry,
|
|
5049
|
+
function makeRplTaskEntry(entry, settings2) {
|
|
5006
5050
|
return (done) => {
|
|
5007
5051
|
if (!entry.dirent.isSymbolicLink()) {
|
|
5008
5052
|
done(null, entry);
|
|
5009
5053
|
return;
|
|
5010
5054
|
}
|
|
5011
|
-
|
|
5055
|
+
settings2.fs.stat(entry.path, (statError, stats) => {
|
|
5012
5056
|
if (statError !== null) {
|
|
5013
|
-
if (
|
|
5057
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5014
5058
|
done(statError);
|
|
5015
5059
|
return;
|
|
5016
5060
|
}
|
|
@@ -5022,16 +5066,16 @@ var require_async2 = __commonJS({
|
|
|
5022
5066
|
});
|
|
5023
5067
|
};
|
|
5024
5068
|
}
|
|
5025
|
-
function readdir(directory,
|
|
5026
|
-
|
|
5069
|
+
function readdir(directory, settings2, callback) {
|
|
5070
|
+
settings2.fs.readdir(directory, (readdirError, names) => {
|
|
5027
5071
|
if (readdirError !== null) {
|
|
5028
5072
|
callFailureCallback(callback, readdirError);
|
|
5029
5073
|
return;
|
|
5030
5074
|
}
|
|
5031
5075
|
const tasks = names.map((name) => {
|
|
5032
|
-
const path = common.joinPathSegments(directory, name,
|
|
5076
|
+
const path = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
5033
5077
|
return (done) => {
|
|
5034
|
-
fsStat.stat(path,
|
|
5078
|
+
fsStat.stat(path, settings2.fsStatSettings, (error2, stats) => {
|
|
5035
5079
|
if (error2 !== null) {
|
|
5036
5080
|
done(error2);
|
|
5037
5081
|
return;
|
|
@@ -5041,7 +5085,7 @@ var require_async2 = __commonJS({
|
|
|
5041
5085
|
path,
|
|
5042
5086
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
5043
5087
|
};
|
|
5044
|
-
if (
|
|
5088
|
+
if (settings2.stats) {
|
|
5045
5089
|
entry.stats = stats;
|
|
5046
5090
|
}
|
|
5047
5091
|
done(null, entry);
|
|
@@ -5078,27 +5122,27 @@ var require_sync2 = __commonJS({
|
|
|
5078
5122
|
var constants_1 = require_constants3();
|
|
5079
5123
|
var utils = require_utils4();
|
|
5080
5124
|
var common = require_common();
|
|
5081
|
-
function read(directory,
|
|
5082
|
-
if (!
|
|
5083
|
-
return readdirWithFileTypes(directory,
|
|
5125
|
+
function read(directory, settings2) {
|
|
5126
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
5127
|
+
return readdirWithFileTypes(directory, settings2);
|
|
5084
5128
|
}
|
|
5085
|
-
return readdir(directory,
|
|
5129
|
+
return readdir(directory, settings2);
|
|
5086
5130
|
}
|
|
5087
5131
|
exports.read = read;
|
|
5088
|
-
function readdirWithFileTypes(directory,
|
|
5089
|
-
const dirents =
|
|
5132
|
+
function readdirWithFileTypes(directory, settings2) {
|
|
5133
|
+
const dirents = settings2.fs.readdirSync(directory, { withFileTypes: true });
|
|
5090
5134
|
return dirents.map((dirent) => {
|
|
5091
5135
|
const entry = {
|
|
5092
5136
|
dirent,
|
|
5093
5137
|
name: dirent.name,
|
|
5094
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
5138
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
5095
5139
|
};
|
|
5096
|
-
if (entry.dirent.isSymbolicLink() &&
|
|
5140
|
+
if (entry.dirent.isSymbolicLink() && settings2.followSymbolicLinks) {
|
|
5097
5141
|
try {
|
|
5098
|
-
const stats =
|
|
5142
|
+
const stats = settings2.fs.statSync(entry.path);
|
|
5099
5143
|
entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
|
5100
5144
|
} catch (error2) {
|
|
5101
|
-
if (
|
|
5145
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
5102
5146
|
throw error2;
|
|
5103
5147
|
}
|
|
5104
5148
|
}
|
|
@@ -5107,17 +5151,17 @@ var require_sync2 = __commonJS({
|
|
|
5107
5151
|
});
|
|
5108
5152
|
}
|
|
5109
5153
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
5110
|
-
function readdir(directory,
|
|
5111
|
-
const names =
|
|
5154
|
+
function readdir(directory, settings2) {
|
|
5155
|
+
const names = settings2.fs.readdirSync(directory);
|
|
5112
5156
|
return names.map((name) => {
|
|
5113
|
-
const entryPath = common.joinPathSegments(directory, name,
|
|
5114
|
-
const stats = fsStat.statSync(entryPath,
|
|
5157
|
+
const entryPath = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
5158
|
+
const stats = fsStat.statSync(entryPath, settings2.fsStatSettings);
|
|
5115
5159
|
const entry = {
|
|
5116
5160
|
name,
|
|
5117
5161
|
path: entryPath,
|
|
5118
5162
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
5119
5163
|
};
|
|
5120
|
-
if (
|
|
5164
|
+
if (settings2.stats) {
|
|
5121
5165
|
entry.stats = stats;
|
|
5122
5166
|
}
|
|
5123
5167
|
return entry;
|
|
@@ -5204,8 +5248,8 @@ var require_out2 = __commonJS({
|
|
|
5204
5248
|
}
|
|
5205
5249
|
exports.scandir = scandir;
|
|
5206
5250
|
function scandirSync(path, optionsOrSettings) {
|
|
5207
|
-
const
|
|
5208
|
-
return sync.read(path,
|
|
5251
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5252
|
+
return sync.read(path, settings2);
|
|
5209
5253
|
}
|
|
5210
5254
|
exports.scandirSync = scandirSync;
|
|
5211
5255
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -5541,11 +5585,11 @@ var require_common2 = __commonJS({
|
|
|
5541
5585
|
init_utils2();
|
|
5542
5586
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5543
5587
|
exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
|
|
5544
|
-
function isFatalError(
|
|
5545
|
-
if (
|
|
5588
|
+
function isFatalError(settings2, error2) {
|
|
5589
|
+
if (settings2.errorFilter === null) {
|
|
5546
5590
|
return true;
|
|
5547
5591
|
}
|
|
5548
|
-
return !
|
|
5592
|
+
return !settings2.errorFilter(error2);
|
|
5549
5593
|
}
|
|
5550
5594
|
exports.isFatalError = isFatalError;
|
|
5551
5595
|
function isAppliedFilter(filter, value) {
|
|
@@ -5556,14 +5600,14 @@ var require_common2 = __commonJS({
|
|
|
5556
5600
|
return filepath.split(/[/\\]/).join(separator);
|
|
5557
5601
|
}
|
|
5558
5602
|
exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
|
|
5559
|
-
function joinPathSegments(
|
|
5560
|
-
if (
|
|
5603
|
+
function joinPathSegments(a2, b, separator) {
|
|
5604
|
+
if (a2 === "") {
|
|
5561
5605
|
return b;
|
|
5562
5606
|
}
|
|
5563
|
-
if (
|
|
5564
|
-
return
|
|
5607
|
+
if (a2.endsWith(separator)) {
|
|
5608
|
+
return a2 + b;
|
|
5565
5609
|
}
|
|
5566
|
-
return
|
|
5610
|
+
return a2 + separator + b;
|
|
5567
5611
|
}
|
|
5568
5612
|
exports.joinPathSegments = joinPathSegments;
|
|
5569
5613
|
}
|
|
@@ -5910,14 +5954,14 @@ var require_out3 = __commonJS({
|
|
|
5910
5954
|
}
|
|
5911
5955
|
exports.walk = walk;
|
|
5912
5956
|
function walkSync(directory, optionsOrSettings) {
|
|
5913
|
-
const
|
|
5914
|
-
const provider = new sync_1.default(directory,
|
|
5957
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5958
|
+
const provider = new sync_1.default(directory, settings2);
|
|
5915
5959
|
return provider.read();
|
|
5916
5960
|
}
|
|
5917
5961
|
exports.walkSync = walkSync;
|
|
5918
5962
|
function walkStream(directory, optionsOrSettings) {
|
|
5919
|
-
const
|
|
5920
|
-
const provider = new stream_1.default(directory,
|
|
5963
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5964
|
+
const provider = new stream_1.default(directory, settings2);
|
|
5921
5965
|
return provider.read();
|
|
5922
5966
|
}
|
|
5923
5967
|
exports.walkStream = walkStream;
|
|
@@ -6003,8 +6047,8 @@ var require_stream3 = __commonJS({
|
|
|
6003
6047
|
done();
|
|
6004
6048
|
}).catch(done);
|
|
6005
6049
|
};
|
|
6006
|
-
for (let
|
|
6007
|
-
stream.write(
|
|
6050
|
+
for (let i2 = 0; i2 < filepaths.length; i2++) {
|
|
6051
|
+
stream.write(i2);
|
|
6008
6052
|
}
|
|
6009
6053
|
return stream;
|
|
6010
6054
|
}
|
|
@@ -6665,14 +6709,14 @@ var require_out4 = __commonJS({
|
|
|
6665
6709
|
function generateTasks(source, options) {
|
|
6666
6710
|
assertPatternsInput(source);
|
|
6667
6711
|
const patterns = [].concat(source);
|
|
6668
|
-
const
|
|
6669
|
-
return taskManager.generate(patterns,
|
|
6712
|
+
const settings2 = new settings_1.default(options);
|
|
6713
|
+
return taskManager.generate(patterns, settings2);
|
|
6670
6714
|
}
|
|
6671
6715
|
FastGlob2.generateTasks = generateTasks;
|
|
6672
6716
|
function isDynamicPattern(source, options) {
|
|
6673
6717
|
assertPatternsInput(source);
|
|
6674
|
-
const
|
|
6675
|
-
return utils.pattern.isDynamicPattern(source,
|
|
6718
|
+
const settings2 = new settings_1.default(options);
|
|
6719
|
+
return utils.pattern.isDynamicPattern(source, settings2);
|
|
6676
6720
|
}
|
|
6677
6721
|
FastGlob2.isDynamicPattern = isDynamicPattern;
|
|
6678
6722
|
function escapePath(source) {
|
|
@@ -6714,9 +6758,9 @@ var require_out4 = __commonJS({
|
|
|
6714
6758
|
})(FastGlob || (FastGlob = {}));
|
|
6715
6759
|
function getWorks(source, _Provider, options) {
|
|
6716
6760
|
const patterns = [].concat(source);
|
|
6717
|
-
const
|
|
6718
|
-
const tasks = taskManager.generate(patterns,
|
|
6719
|
-
const provider = new _Provider(
|
|
6761
|
+
const settings2 = new settings_1.default(options);
|
|
6762
|
+
const tasks = taskManager.generate(patterns, settings2);
|
|
6763
|
+
const provider = new _Provider(settings2);
|
|
6720
6764
|
return tasks.map(provider.read, provider);
|
|
6721
6765
|
}
|
|
6722
6766
|
function assertPatternsInput(input) {
|
|
@@ -6894,8 +6938,8 @@ import "node:fs";
|
|
|
6894
6938
|
import { createRequire } from "node:module";
|
|
6895
6939
|
import {
|
|
6896
6940
|
resolve,
|
|
6897
|
-
join,
|
|
6898
|
-
dirname,
|
|
6941
|
+
join as join2,
|
|
6942
|
+
dirname as dirname2,
|
|
6899
6943
|
relative,
|
|
6900
6944
|
normalize,
|
|
6901
6945
|
sep,
|
|
@@ -6909,7 +6953,7 @@ function safeExecuteAsync(fn, message) {
|
|
|
6909
6953
|
);
|
|
6910
6954
|
});
|
|
6911
6955
|
}
|
|
6912
|
-
var import_fast_glob, constants,
|
|
6956
|
+
var import_fast_glob, constants, log3, PACKAGE_PATHS, PathResolver;
|
|
6913
6957
|
var init_PathResolver = __esm({
|
|
6914
6958
|
"packages/core/config/utils/PathResolver.ts"() {
|
|
6915
6959
|
"use strict";
|
|
@@ -6922,7 +6966,7 @@ var init_PathResolver = __esm({
|
|
|
6922
6966
|
getPatternsFor: getPatternsFor || void 0,
|
|
6923
6967
|
I18N_PATHS: I18N_PATHS || void 0
|
|
6924
6968
|
};
|
|
6925
|
-
|
|
6969
|
+
log3 = {
|
|
6926
6970
|
error: (message, error2) => {
|
|
6927
6971
|
},
|
|
6928
6972
|
warn: (message, error2) => {
|
|
@@ -7043,7 +7087,7 @@ var init_PathResolver = __esm({
|
|
|
7043
7087
|
*/
|
|
7044
7088
|
getDirname(path) {
|
|
7045
7089
|
if (!path) return "";
|
|
7046
|
-
return this.normalizePath(
|
|
7090
|
+
return this.normalizePath(dirname2(path));
|
|
7047
7091
|
}
|
|
7048
7092
|
/**
|
|
7049
7093
|
* Resolve package path using Node's module resolution
|
|
@@ -7055,7 +7099,7 @@ var init_PathResolver = __esm({
|
|
|
7055
7099
|
resolvePackage(packageSpecifier, fromPath = null) {
|
|
7056
7100
|
try {
|
|
7057
7101
|
const basePath = fromPath || this.getAppRoot();
|
|
7058
|
-
const require3 = createRequire(
|
|
7102
|
+
const require3 = createRequire(join2(basePath, "package.json"));
|
|
7059
7103
|
const resolved = require3.resolve(packageSpecifier);
|
|
7060
7104
|
return this.normalizePath(resolved);
|
|
7061
7105
|
} catch (error2) {
|
|
@@ -7207,7 +7251,7 @@ var init_PathResolver = __esm({
|
|
|
7207
7251
|
return cleanContent;
|
|
7208
7252
|
} catch (error2) {
|
|
7209
7253
|
if (this.options.debug) {
|
|
7210
|
-
|
|
7254
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
7211
7255
|
}
|
|
7212
7256
|
return null;
|
|
7213
7257
|
}
|
|
@@ -7235,7 +7279,7 @@ var init_PathResolver = __esm({
|
|
|
7235
7279
|
return cleanContent;
|
|
7236
7280
|
} catch (error2) {
|
|
7237
7281
|
if (this.options.debug) {
|
|
7238
|
-
|
|
7282
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
7239
7283
|
}
|
|
7240
7284
|
return null;
|
|
7241
7285
|
}
|
|
@@ -7257,16 +7301,16 @@ var init_PathResolver = __esm({
|
|
|
7257
7301
|
verbose = false
|
|
7258
7302
|
} = options;
|
|
7259
7303
|
const normalizedPath = this.normalizePath(filePath);
|
|
7260
|
-
const dir = this.normalizePath(
|
|
7304
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
7261
7305
|
const fileExists = this.pathExists(normalizedPath);
|
|
7262
7306
|
if (fileExists && !overwrite) {
|
|
7263
7307
|
if (verbose) {
|
|
7264
|
-
|
|
7308
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
7265
7309
|
}
|
|
7266
7310
|
return false;
|
|
7267
7311
|
}
|
|
7268
7312
|
if (dryRun) {
|
|
7269
|
-
|
|
7313
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
7270
7314
|
return true;
|
|
7271
7315
|
}
|
|
7272
7316
|
try {
|
|
@@ -7291,7 +7335,7 @@ var init_PathResolver = __esm({
|
|
|
7291
7335
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
7292
7336
|
}
|
|
7293
7337
|
if (verbose) {
|
|
7294
|
-
|
|
7338
|
+
log3.info(
|
|
7295
7339
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
7296
7340
|
);
|
|
7297
7341
|
}
|
|
@@ -7318,16 +7362,16 @@ var init_PathResolver = __esm({
|
|
|
7318
7362
|
verbose = false
|
|
7319
7363
|
} = options;
|
|
7320
7364
|
const normalizedPath = this.normalizePath(filePath);
|
|
7321
|
-
const dir = this.normalizePath(
|
|
7365
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
7322
7366
|
const fileExists = this.pathExists(normalizedPath);
|
|
7323
7367
|
if (fileExists && !overwrite) {
|
|
7324
7368
|
if (verbose) {
|
|
7325
|
-
|
|
7369
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
7326
7370
|
}
|
|
7327
7371
|
return false;
|
|
7328
7372
|
}
|
|
7329
7373
|
if (dryRun) {
|
|
7330
|
-
|
|
7374
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
7331
7375
|
return true;
|
|
7332
7376
|
}
|
|
7333
7377
|
try {
|
|
@@ -7351,7 +7395,7 @@ var init_PathResolver = __esm({
|
|
|
7351
7395
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
7352
7396
|
}
|
|
7353
7397
|
if (verbose) {
|
|
7354
|
-
|
|
7398
|
+
log3.info(
|
|
7355
7399
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
7356
7400
|
);
|
|
7357
7401
|
}
|
|
@@ -7376,15 +7420,15 @@ var init_PathResolver = __esm({
|
|
|
7376
7420
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7377
7421
|
if (fileExists && !overwrite) {
|
|
7378
7422
|
if (verbose) {
|
|
7379
|
-
|
|
7423
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7380
7424
|
}
|
|
7381
7425
|
return false;
|
|
7382
7426
|
}
|
|
7383
7427
|
if (dryRun) {
|
|
7384
|
-
|
|
7428
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7385
7429
|
return true;
|
|
7386
7430
|
}
|
|
7387
|
-
const dir = this.normalizePath(
|
|
7431
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7388
7432
|
try {
|
|
7389
7433
|
await fs.promises.mkdir(dir, { recursive: true });
|
|
7390
7434
|
} catch (error2) {
|
|
@@ -7394,7 +7438,7 @@ var init_PathResolver = __esm({
|
|
|
7394
7438
|
return await safeExecuteAsync(async () => {
|
|
7395
7439
|
await fs.promises.copyFile(srcPath, normalizedDestPath);
|
|
7396
7440
|
if (verbose) {
|
|
7397
|
-
|
|
7441
|
+
log3.info(
|
|
7398
7442
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7399
7443
|
);
|
|
7400
7444
|
}
|
|
@@ -7418,15 +7462,15 @@ var init_PathResolver = __esm({
|
|
|
7418
7462
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7419
7463
|
if (fileExists && !overwrite) {
|
|
7420
7464
|
if (verbose) {
|
|
7421
|
-
|
|
7465
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7422
7466
|
}
|
|
7423
7467
|
return false;
|
|
7424
7468
|
}
|
|
7425
7469
|
if (dryRun) {
|
|
7426
|
-
|
|
7470
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7427
7471
|
return true;
|
|
7428
7472
|
}
|
|
7429
|
-
const dir = this.normalizePath(
|
|
7473
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7430
7474
|
try {
|
|
7431
7475
|
fs.mkdirSync(dir, { recursive: true });
|
|
7432
7476
|
} catch (error2) {
|
|
@@ -7435,7 +7479,7 @@ var init_PathResolver = __esm({
|
|
|
7435
7479
|
try {
|
|
7436
7480
|
fs.copyFileSync(srcPath, normalizedDestPath);
|
|
7437
7481
|
if (verbose) {
|
|
7438
|
-
|
|
7482
|
+
log3.info(
|
|
7439
7483
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7440
7484
|
);
|
|
7441
7485
|
}
|
|
@@ -7452,7 +7496,7 @@ var init_PathResolver = __esm({
|
|
|
7452
7496
|
return fs.existsSync(filePath);
|
|
7453
7497
|
} catch (error2) {
|
|
7454
7498
|
if (!silent) {
|
|
7455
|
-
|
|
7499
|
+
log3.error(`Error checking path existence: ${filePath}`, error2);
|
|
7456
7500
|
}
|
|
7457
7501
|
return false;
|
|
7458
7502
|
}
|
|
@@ -7478,7 +7522,7 @@ var init_PathResolver = __esm({
|
|
|
7478
7522
|
return fs.readdirSync(dirPath, options);
|
|
7479
7523
|
} catch (error2) {
|
|
7480
7524
|
if (this.options.debug) {
|
|
7481
|
-
|
|
7525
|
+
log3.warn(`Failed to read directory: ${dirPath}`, error2);
|
|
7482
7526
|
}
|
|
7483
7527
|
const isObjectOptions = options && typeof options === "object" && "withFileTypes" in options;
|
|
7484
7528
|
return isObjectOptions && options.withFileTypes ? [] : [];
|
|
@@ -7496,7 +7540,7 @@ var init_PathResolver = __esm({
|
|
|
7496
7540
|
return fs.statSync(filePath);
|
|
7497
7541
|
} catch (error2) {
|
|
7498
7542
|
if (this.options.debug) {
|
|
7499
|
-
|
|
7543
|
+
log3.warn(`Failed to stat file: ${filePath}`, error2);
|
|
7500
7544
|
}
|
|
7501
7545
|
return null;
|
|
7502
7546
|
}
|
|
@@ -7513,7 +7557,7 @@ var init_PathResolver = __esm({
|
|
|
7513
7557
|
return fs.lstatSync(filePath);
|
|
7514
7558
|
} catch (error2) {
|
|
7515
7559
|
if (this.options.debug) {
|
|
7516
|
-
|
|
7560
|
+
log3.warn(`Failed to lstat file: ${filePath}`, error2);
|
|
7517
7561
|
}
|
|
7518
7562
|
return null;
|
|
7519
7563
|
}
|
|
@@ -7602,7 +7646,7 @@ var init_PathResolver = __esm({
|
|
|
7602
7646
|
* @returns True if repoRoot is the monorepo (has packages directory)
|
|
7603
7647
|
*/
|
|
7604
7648
|
isMonorepo() {
|
|
7605
|
-
const packagesDir =
|
|
7649
|
+
const packagesDir = join2(this._repoRoot, "packages");
|
|
7606
7650
|
return this.pathExists(packagesDir);
|
|
7607
7651
|
}
|
|
7608
7652
|
/**
|
|
@@ -7619,7 +7663,7 @@ var init_PathResolver = __esm({
|
|
|
7619
7663
|
* Find files matching pattern within directory
|
|
7620
7664
|
*/
|
|
7621
7665
|
async findFiles(directory, pattern, options = {}) {
|
|
7622
|
-
const searchPattern = this.normalizePath(
|
|
7666
|
+
const searchPattern = this.normalizePath(join2(directory, pattern));
|
|
7623
7667
|
const appRoot = this.getAppRoot();
|
|
7624
7668
|
const normalizeAppRoot = this.normalizePath(appRoot);
|
|
7625
7669
|
const relativePattern = searchPattern.startsWith(normalizeAppRoot) ? searchPattern.slice(normalizeAppRoot.length + 1) : searchPattern;
|
|
@@ -7666,7 +7710,7 @@ var init_PathResolver = __esm({
|
|
|
7666
7710
|
return null;
|
|
7667
7711
|
}
|
|
7668
7712
|
const resolvedPath = this.normalizePath(
|
|
7669
|
-
|
|
7713
|
+
join2(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
|
|
7670
7714
|
);
|
|
7671
7715
|
const resolvedDir = resolvedPath.replace(/\/[^/]*\*.*$/, "");
|
|
7672
7716
|
if (this.pathExists(resolvedDir)) {
|
|
@@ -7862,13 +7906,13 @@ var init_PathResolver = __esm({
|
|
|
7862
7906
|
const maxLevels = this.options.maxLevels;
|
|
7863
7907
|
while (levelsChecked < maxLevels) {
|
|
7864
7908
|
const toolingPath = this.normalizePath(
|
|
7865
|
-
|
|
7909
|
+
join2(currentDir, PACKAGE_PATHS.TOOLING)
|
|
7866
7910
|
);
|
|
7867
|
-
const corePath = this.normalizePath(
|
|
7911
|
+
const corePath = this.normalizePath(join2(currentDir, PACKAGE_PATHS.CORE));
|
|
7868
7912
|
if (this.pathExists(toolingPath) && this.pathExists(corePath)) {
|
|
7869
7913
|
return currentDir;
|
|
7870
7914
|
}
|
|
7871
|
-
const appsDir =
|
|
7915
|
+
const appsDir = join2(currentDir, "apps");
|
|
7872
7916
|
if (this.pathExists(appsDir)) {
|
|
7873
7917
|
const appsDirStat = this.statSync(appsDir);
|
|
7874
7918
|
if (appsDirStat?.isDirectory()) {
|
|
@@ -7876,15 +7920,15 @@ var init_PathResolver = __esm({
|
|
|
7876
7920
|
}
|
|
7877
7921
|
}
|
|
7878
7922
|
const packageJsonPath = this.normalizePath(
|
|
7879
|
-
|
|
7923
|
+
join2(currentDir, "package.json")
|
|
7880
7924
|
);
|
|
7881
7925
|
if (this.pathExists(packageJsonPath)) {
|
|
7882
|
-
const parentDir2 = this.normalizePath(
|
|
7926
|
+
const parentDir2 = this.normalizePath(dirname2(currentDir));
|
|
7883
7927
|
if (parentDir2 === currentDir) {
|
|
7884
7928
|
return currentDir;
|
|
7885
7929
|
}
|
|
7886
7930
|
}
|
|
7887
|
-
const parentDir = this.normalizePath(
|
|
7931
|
+
const parentDir = this.normalizePath(dirname2(currentDir));
|
|
7888
7932
|
if (parentDir === currentDir) {
|
|
7889
7933
|
break;
|
|
7890
7934
|
}
|
|
@@ -7900,8 +7944,8 @@ var init_PathResolver = __esm({
|
|
|
7900
7944
|
// packages/tooling/src/utils/pathResolver.ts
|
|
7901
7945
|
import { createRequire as createRequire2 } from "node:module";
|
|
7902
7946
|
import {
|
|
7903
|
-
join as
|
|
7904
|
-
dirname as
|
|
7947
|
+
join as join3,
|
|
7948
|
+
dirname as dirname3,
|
|
7905
7949
|
basename as basename2,
|
|
7906
7950
|
extname as extname2,
|
|
7907
7951
|
relative as relative2,
|
|
@@ -7910,7 +7954,7 @@ import {
|
|
|
7910
7954
|
isAbsolute as pathIsAbsolute
|
|
7911
7955
|
} from "node:path";
|
|
7912
7956
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
7913
|
-
function
|
|
7957
|
+
function readdirSync3(dirPath, options) {
|
|
7914
7958
|
return pathResolverInstance.readdirSync(dirPath, options);
|
|
7915
7959
|
}
|
|
7916
7960
|
var pathResolverInstance, normalizePath, pathExists, readSync, statSync2, joinPath;
|
|
@@ -7921,7 +7965,7 @@ var init_pathResolver = __esm({
|
|
|
7921
7965
|
init_PathResolver();
|
|
7922
7966
|
pathResolverInstance = PathResolver.getInstance({ debug: false });
|
|
7923
7967
|
normalizePath = (...pathSegments) => {
|
|
7924
|
-
return pathResolverInstance.normalizePath(
|
|
7968
|
+
return pathResolverInstance.normalizePath(join3(...pathSegments));
|
|
7925
7969
|
};
|
|
7926
7970
|
pathExists = (filePath, silent = false) => pathResolverInstance.pathExists(filePath, silent);
|
|
7927
7971
|
readSync = (filePath, options) => pathResolverInstance.readSync(filePath, options);
|
|
@@ -7964,7 +8008,7 @@ var init_typed_file_operations = __esm({
|
|
|
7964
8008
|
import { Buffer } from "node:buffer";
|
|
7965
8009
|
import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
7966
8010
|
import { createRequire as createRequire3 } from "node:module";
|
|
7967
|
-
import { dirname as
|
|
8011
|
+
import { dirname as dirname4, resolve as resolve3 } from "node:path";
|
|
7968
8012
|
import process from "node:process";
|
|
7969
8013
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
7970
8014
|
var require2, __filename, __dirname;
|
|
@@ -7973,7 +8017,7 @@ var init_utils2 = __esm({
|
|
|
7973
8017
|
"use strict";
|
|
7974
8018
|
require2 = createRequire3(import.meta.url);
|
|
7975
8019
|
__filename = fileURLToPath3(import.meta.url);
|
|
7976
|
-
__dirname =
|
|
8020
|
+
__dirname = dirname4(__filename);
|
|
7977
8021
|
if (typeof globalThis !== "undefined") {
|
|
7978
8022
|
globalThis.require = require2;
|
|
7979
8023
|
globalThis.__filename = __filename;
|
|
@@ -8001,7 +8045,7 @@ function detectApps(projectRoot) {
|
|
|
8001
8045
|
const appsDir = joinPath(projectRoot, "apps");
|
|
8002
8046
|
const appsDirStat = statSync2(appsDir);
|
|
8003
8047
|
if (pathExists(appsDir) && appsDirStat?.isDirectory()) {
|
|
8004
|
-
const appDirs =
|
|
8048
|
+
const appDirs = readdirSync3(appsDir, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name).sort();
|
|
8005
8049
|
for (const appDir of appDirs) {
|
|
8006
8050
|
const appPath = joinPath(appsDir, appDir);
|
|
8007
8051
|
const packageJsonPath = joinPath(appPath, "package.json");
|
|
@@ -8295,7 +8339,7 @@ function resolveSecret(name, projectRoot, opts) {
|
|
|
8295
8339
|
if (value) {
|
|
8296
8340
|
if (!opts?.silent && !warnedLegacy.has(name)) {
|
|
8297
8341
|
warnedLegacy.add(name);
|
|
8298
|
-
|
|
8342
|
+
log2.warn(
|
|
8299
8343
|
`${name} found in ${relPath} (legacy). Move it to .dndev.secrets at project root.`
|
|
8300
8344
|
);
|
|
8301
8345
|
}
|
|
@@ -8306,7 +8350,7 @@ function resolveSecret(name, projectRoot, opts) {
|
|
|
8306
8350
|
if (aliasValue) {
|
|
8307
8351
|
if (!opts?.silent && !warnedLegacy.has(name)) {
|
|
8308
8352
|
warnedLegacy.add(name);
|
|
8309
|
-
|
|
8353
|
+
log2.warn(
|
|
8310
8354
|
`${name} found in ${relPath} (legacy). Move it to .dndev.secrets at project root.`
|
|
8311
8355
|
);
|
|
8312
8356
|
}
|
|
@@ -8759,7 +8803,7 @@ var init_check_auth = __esm({
|
|
|
8759
8803
|
joinPath(ctx.appDir, "src", "config", "providers.ts"),
|
|
8760
8804
|
joinPath(ctx.appDir, "src", "lib", "providers.ts")
|
|
8761
8805
|
];
|
|
8762
|
-
const providerFile = candidates.find((
|
|
8806
|
+
const providerFile = candidates.find((c) => pathExists(c));
|
|
8763
8807
|
if (providerFile) {
|
|
8764
8808
|
results.push({
|
|
8765
8809
|
name: "Providers config",
|
|
@@ -8833,8 +8877,8 @@ init_utils2();
|
|
|
8833
8877
|
// packages/tooling/src/cli/doctor/doctor.ts
|
|
8834
8878
|
init_utils2();
|
|
8835
8879
|
init_app_detection();
|
|
8836
|
-
init_cli_output();
|
|
8837
8880
|
init_app_detection();
|
|
8881
|
+
init_cli_output();
|
|
8838
8882
|
var CHECK_REGISTRY = [
|
|
8839
8883
|
{ id: "env", load: async () => (await Promise.resolve().then(() => (init_check_env(), check_env_exports))).envCheck },
|
|
8840
8884
|
{
|
|
@@ -8870,7 +8914,7 @@ function renderResults(allResults, verbose, multiApp) {
|
|
|
8870
8914
|
}
|
|
8871
8915
|
lines.push("");
|
|
8872
8916
|
}
|
|
8873
|
-
|
|
8917
|
+
note(lines.join("\n"), "Health Check Results");
|
|
8874
8918
|
}
|
|
8875
8919
|
function buildDoctorContext(app, projectRoot, topology, options) {
|
|
8876
8920
|
const backendApp = findBackendApp(topology, app.name);
|
|
@@ -8884,7 +8928,7 @@ function buildDoctorContext(app, projectRoot, topology, options) {
|
|
|
8884
8928
|
};
|
|
8885
8929
|
}
|
|
8886
8930
|
async function main(options = {}) {
|
|
8887
|
-
|
|
8931
|
+
intro("DoNotDev Doctor");
|
|
8888
8932
|
const projectRoot = process.cwd();
|
|
8889
8933
|
const topology = analyzeProjectTopology(projectRoot);
|
|
8890
8934
|
let apps = topology.apps;
|
|
@@ -8894,10 +8938,10 @@ async function main(options = {}) {
|
|
|
8894
8938
|
const multiApp = apps.length > 1;
|
|
8895
8939
|
const registry = options.check ? CHECK_REGISTRY.filter((e) => e.id === options.check) : CHECK_REGISTRY;
|
|
8896
8940
|
if (options.check && registry.length === 0) {
|
|
8897
|
-
|
|
8941
|
+
log2.error(
|
|
8898
8942
|
`Unknown check: ${options.check}. Available: ${CHECK_REGISTRY.map((e) => e.id).join(", ")}`
|
|
8899
8943
|
);
|
|
8900
|
-
|
|
8944
|
+
outro("Doctor aborted.");
|
|
8901
8945
|
return 1;
|
|
8902
8946
|
}
|
|
8903
8947
|
const allResults = [];
|
|
@@ -8909,14 +8953,14 @@ async function main(options = {}) {
|
|
|
8909
8953
|
if (!check.isRelevant(ctx)) continue;
|
|
8910
8954
|
const results = await check.run(ctx);
|
|
8911
8955
|
allResults.push({ appName: app.name, checkName: check.name, results });
|
|
8912
|
-
if (results.some((
|
|
8956
|
+
if (results.some((r2) => r2.status === "fail")) {
|
|
8913
8957
|
hasFail = true;
|
|
8914
8958
|
}
|
|
8915
8959
|
}
|
|
8916
8960
|
}
|
|
8917
8961
|
if (allResults.length === 0) {
|
|
8918
|
-
|
|
8919
|
-
|
|
8962
|
+
log2.warn("No checks were relevant for this project.");
|
|
8963
|
+
outro("Nothing to check.");
|
|
8920
8964
|
return 0;
|
|
8921
8965
|
}
|
|
8922
8966
|
renderResults(allResults, options.verbose ?? false, multiApp);
|
|
@@ -8924,10 +8968,10 @@ async function main(options = {}) {
|
|
|
8924
8968
|
let warnings = 0;
|
|
8925
8969
|
let fails = 0;
|
|
8926
8970
|
for (const { results } of allResults) {
|
|
8927
|
-
for (const
|
|
8928
|
-
if (
|
|
8929
|
-
else if (
|
|
8930
|
-
else if (
|
|
8971
|
+
for (const r2 of results) {
|
|
8972
|
+
if (r2.status === "pass") passes++;
|
|
8973
|
+
else if (r2.status === "warn") warnings++;
|
|
8974
|
+
else if (r2.status === "fail") fails++;
|
|
8931
8975
|
}
|
|
8932
8976
|
}
|
|
8933
8977
|
const totalChecks = passes + warnings + fails;
|
|
@@ -8935,7 +8979,7 @@ async function main(options = {}) {
|
|
|
8935
8979
|
if (warnings > 0) summaryParts.push(`${warnings} warning(s)`);
|
|
8936
8980
|
if (fails > 0) summaryParts.push(`${fails} failure(s)`);
|
|
8937
8981
|
const exitCode = hasFail ? 1 : 0;
|
|
8938
|
-
|
|
8982
|
+
outro(
|
|
8939
8983
|
hasFail ? `Health check failed: ${summaryParts.join(", ")}` : `All clear: ${summaryParts.join(", ")}`
|
|
8940
8984
|
);
|
|
8941
8985
|
return exitCode;
|