@donotdev/cli 0.1.45 → 0.1.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dependencies-matrix.json +9 -8
- package/dist/bin/commands/agent-setup.js +553 -509
- package/dist/bin/commands/build.js +1144 -908
- package/dist/bin/commands/bump.js +1206 -931
- package/dist/bin/commands/cacheout.js +464 -390
- package/dist/bin/commands/coach.js +467 -393
- package/dist/bin/commands/create-app.js +1118 -846
- package/dist/bin/commands/create-project.js +1158 -886
- package/dist/bin/commands/db.js +16351 -33069
- package/dist/bin/commands/deploy.js +2171 -1870
- package/dist/bin/commands/dev.js +833 -647
- package/dist/bin/commands/doctor.js +555 -511
- package/dist/bin/commands/emu.js +1014 -770
- package/dist/bin/commands/format.js +509 -435
- package/dist/bin/commands/get-demo.js +964 -741
- package/dist/bin/commands/make-admin.js +10368 -27067
- package/dist/bin/commands/preview.js +834 -648
- package/dist/bin/commands/seed.js +16352 -33070
- package/dist/bin/commands/setup-cicd.js +1050 -801
- package/dist/bin/commands/setup.js +1216 -944
- package/dist/bin/commands/staging.js +2171 -1870
- package/dist/bin/commands/sync-secrets.js +916 -717
- package/dist/bin/commands/type-check.js +654 -583
- package/dist/bin/commands/wai.js +454 -380
- package/dist/bin/dndev.js +2 -6
- package/dist/index.js +2582 -2223
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
-
get: (
|
|
8
|
+
get: (a2, b) => (typeof require !== "undefined" ? require : a2)[b]
|
|
9
9
|
}) : x)(function(x) {
|
|
10
10
|
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
11
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
@@ -33,31 +33,40 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
33
|
mod
|
|
34
34
|
));
|
|
35
35
|
|
|
36
|
-
// node_modules/.bun/fast-string-truncated-width@
|
|
37
|
-
var
|
|
36
|
+
// node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
|
|
37
|
+
var getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji;
|
|
38
38
|
var init_utils = __esm({
|
|
39
|
-
"node_modules/.bun/fast-string-truncated-width@
|
|
39
|
+
"node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js"() {
|
|
40
40
|
init_utils2();
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
getCodePointsLength = /* @__PURE__ */ (() => {
|
|
42
|
+
const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
43
|
+
return (input) => {
|
|
44
|
+
let surrogatePairsNr = 0;
|
|
45
|
+
SURROGATE_PAIR_RE.lastIndex = 0;
|
|
46
|
+
while (SURROGATE_PAIR_RE.test(input)) {
|
|
47
|
+
surrogatePairsNr += 1;
|
|
48
|
+
}
|
|
49
|
+
return input.length - surrogatePairsNr;
|
|
50
|
+
};
|
|
51
|
+
})();
|
|
44
52
|
isFullWidth = (x) => {
|
|
45
53
|
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
46
54
|
};
|
|
47
|
-
|
|
48
|
-
return x
|
|
55
|
+
isWideNotCJKTNotEmoji = (x) => {
|
|
56
|
+
return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
49
57
|
};
|
|
50
58
|
}
|
|
51
59
|
});
|
|
52
60
|
|
|
53
|
-
// node_modules/.bun/fast-string-truncated-width@
|
|
54
|
-
var ANSI_RE, CONTROL_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
|
|
61
|
+
// node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
|
|
62
|
+
var ANSI_RE, CONTROL_RE, CJKT_WIDE_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
|
|
55
63
|
var init_dist = __esm({
|
|
56
|
-
"node_modules/.bun/fast-string-truncated-width@
|
|
64
|
+
"node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js"() {
|
|
57
65
|
init_utils2();
|
|
58
66
|
init_utils();
|
|
59
|
-
ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
|
|
67
|
+
ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
|
|
60
68
|
CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
69
|
+
CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
|
|
61
70
|
TAB_RE = /\t{1,1000}/y;
|
|
62
71
|
EMOJI_RE = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu");
|
|
63
72
|
LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
@@ -67,14 +76,21 @@ var init_dist = __esm({
|
|
|
67
76
|
const LIMIT = truncationOptions.limit ?? Infinity;
|
|
68
77
|
const ELLIPSIS = truncationOptions.ellipsis ?? "";
|
|
69
78
|
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
|
|
70
|
-
const ANSI_WIDTH =
|
|
79
|
+
const ANSI_WIDTH = 0;
|
|
71
80
|
const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
|
|
72
81
|
const TAB_WIDTH = widthOptions.tabWidth ?? 8;
|
|
73
|
-
const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
|
|
74
82
|
const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
|
|
75
|
-
const FULL_WIDTH_WIDTH =
|
|
83
|
+
const FULL_WIDTH_WIDTH = 2;
|
|
76
84
|
const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
|
|
77
|
-
const WIDE_WIDTH = widthOptions.wideWidth ??
|
|
85
|
+
const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
|
|
86
|
+
const PARSE_BLOCKS = [
|
|
87
|
+
[LATIN_RE, REGULAR_WIDTH],
|
|
88
|
+
[ANSI_RE, ANSI_WIDTH],
|
|
89
|
+
[CONTROL_RE, CONTROL_WIDTH],
|
|
90
|
+
[TAB_RE, TAB_WIDTH],
|
|
91
|
+
[EMOJI_RE, EMOJI_WIDTH],
|
|
92
|
+
[CJKT_WIDE_RE, WIDE_WIDTH]
|
|
93
|
+
];
|
|
78
94
|
let indexPrev = 0;
|
|
79
95
|
let index = 0;
|
|
80
96
|
let length = input.length;
|
|
@@ -94,10 +110,8 @@ var init_dist = __esm({
|
|
|
94
110
|
const codePoint = char.codePointAt(0) || 0;
|
|
95
111
|
if (isFullWidth(codePoint)) {
|
|
96
112
|
widthExtra = FULL_WIDTH_WIDTH;
|
|
97
|
-
} else if (
|
|
113
|
+
} else if (isWideNotCJKTNotEmoji(codePoint)) {
|
|
98
114
|
widthExtra = WIDE_WIDTH;
|
|
99
|
-
} else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) {
|
|
100
|
-
widthExtra = AMBIGUOUS_WIDTH;
|
|
101
115
|
} else {
|
|
102
116
|
widthExtra = REGULAR_WIDTH;
|
|
103
117
|
}
|
|
@@ -113,88 +127,28 @@ var init_dist = __esm({
|
|
|
113
127
|
}
|
|
114
128
|
unmatchedStart = unmatchedEnd = 0;
|
|
115
129
|
}
|
|
116
|
-
if (index >= length)
|
|
117
|
-
break;
|
|
118
|
-
LATIN_RE.lastIndex = index;
|
|
119
|
-
if (LATIN_RE.test(input)) {
|
|
120
|
-
lengthExtra = LATIN_RE.lastIndex - index;
|
|
121
|
-
widthExtra = lengthExtra * REGULAR_WIDTH;
|
|
122
|
-
if (width + widthExtra > truncationLimit) {
|
|
123
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
|
|
124
|
-
}
|
|
125
|
-
if (width + widthExtra > LIMIT) {
|
|
126
|
-
truncationEnabled = true;
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
|
-
width += widthExtra;
|
|
130
|
-
unmatchedStart = indexPrev;
|
|
131
|
-
unmatchedEnd = index;
|
|
132
|
-
index = indexPrev = LATIN_RE.lastIndex;
|
|
133
|
-
continue;
|
|
134
|
-
}
|
|
135
|
-
ANSI_RE.lastIndex = index;
|
|
136
|
-
if (ANSI_RE.test(input)) {
|
|
137
|
-
if (width + ANSI_WIDTH > truncationLimit) {
|
|
138
|
-
truncationIndex = Math.min(truncationIndex, index);
|
|
139
|
-
}
|
|
140
|
-
if (width + ANSI_WIDTH > LIMIT) {
|
|
141
|
-
truncationEnabled = true;
|
|
142
|
-
break;
|
|
143
|
-
}
|
|
144
|
-
width += ANSI_WIDTH;
|
|
145
|
-
unmatchedStart = indexPrev;
|
|
146
|
-
unmatchedEnd = index;
|
|
147
|
-
index = indexPrev = ANSI_RE.lastIndex;
|
|
148
|
-
continue;
|
|
149
|
-
}
|
|
150
|
-
CONTROL_RE.lastIndex = index;
|
|
151
|
-
if (CONTROL_RE.test(input)) {
|
|
152
|
-
lengthExtra = CONTROL_RE.lastIndex - index;
|
|
153
|
-
widthExtra = lengthExtra * CONTROL_WIDTH;
|
|
154
|
-
if (width + widthExtra > truncationLimit) {
|
|
155
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
|
|
156
|
-
}
|
|
157
|
-
if (width + widthExtra > LIMIT) {
|
|
158
|
-
truncationEnabled = true;
|
|
159
|
-
break;
|
|
160
|
-
}
|
|
161
|
-
width += widthExtra;
|
|
162
|
-
unmatchedStart = indexPrev;
|
|
163
|
-
unmatchedEnd = index;
|
|
164
|
-
index = indexPrev = CONTROL_RE.lastIndex;
|
|
165
|
-
continue;
|
|
166
|
-
}
|
|
167
|
-
TAB_RE.lastIndex = index;
|
|
168
|
-
if (TAB_RE.test(input)) {
|
|
169
|
-
lengthExtra = TAB_RE.lastIndex - index;
|
|
170
|
-
widthExtra = lengthExtra * TAB_WIDTH;
|
|
171
|
-
if (width + widthExtra > truncationLimit) {
|
|
172
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
|
|
173
|
-
}
|
|
174
|
-
if (width + widthExtra > LIMIT) {
|
|
175
|
-
truncationEnabled = true;
|
|
176
|
-
break;
|
|
177
|
-
}
|
|
178
|
-
width += widthExtra;
|
|
179
|
-
unmatchedStart = indexPrev;
|
|
180
|
-
unmatchedEnd = index;
|
|
181
|
-
index = indexPrev = TAB_RE.lastIndex;
|
|
182
|
-
continue;
|
|
130
|
+
if (index >= length) {
|
|
131
|
+
break outer;
|
|
183
132
|
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
133
|
+
for (let i2 = 0, l = PARSE_BLOCKS.length; i2 < l; i2++) {
|
|
134
|
+
const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i2];
|
|
135
|
+
BLOCK_RE.lastIndex = index;
|
|
136
|
+
if (BLOCK_RE.test(input)) {
|
|
137
|
+
lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
|
|
138
|
+
widthExtra = lengthExtra * BLOCK_WIDTH;
|
|
139
|
+
if (width + widthExtra > truncationLimit) {
|
|
140
|
+
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
|
|
141
|
+
}
|
|
142
|
+
if (width + widthExtra > LIMIT) {
|
|
143
|
+
truncationEnabled = true;
|
|
144
|
+
break outer;
|
|
145
|
+
}
|
|
146
|
+
width += widthExtra;
|
|
147
|
+
unmatchedStart = indexPrev;
|
|
148
|
+
unmatchedEnd = index;
|
|
149
|
+
index = indexPrev = BLOCK_RE.lastIndex;
|
|
150
|
+
continue outer;
|
|
192
151
|
}
|
|
193
|
-
width += EMOJI_WIDTH;
|
|
194
|
-
unmatchedStart = indexPrev;
|
|
195
|
-
unmatchedEnd = index;
|
|
196
|
-
index = indexPrev = EMOJI_RE.lastIndex;
|
|
197
|
-
continue;
|
|
198
152
|
}
|
|
199
153
|
index += 1;
|
|
200
154
|
}
|
|
@@ -209,10 +163,10 @@ var init_dist = __esm({
|
|
|
209
163
|
}
|
|
210
164
|
});
|
|
211
165
|
|
|
212
|
-
// node_modules/.bun/fast-string-width@
|
|
166
|
+
// node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
|
|
213
167
|
var NO_TRUNCATION2, fastStringWidth, dist_default2;
|
|
214
168
|
var init_dist2 = __esm({
|
|
215
|
-
"node_modules/.bun/fast-string-width@
|
|
169
|
+
"node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js"() {
|
|
216
170
|
init_utils2();
|
|
217
171
|
init_dist();
|
|
218
172
|
NO_TRUNCATION2 = {
|
|
@@ -227,13 +181,13 @@ var init_dist2 = __esm({
|
|
|
227
181
|
}
|
|
228
182
|
});
|
|
229
183
|
|
|
230
|
-
// node_modules/.bun/fast-wrap-ansi@0.
|
|
184
|
+
// node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js
|
|
231
185
|
function wrapAnsi(string, columns, options) {
|
|
232
186
|
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
|
|
233
187
|
}
|
|
234
188
|
var ESC, CSI, END_CODE, ANSI_ESCAPE_BELL, ANSI_CSI, ANSI_OSC, ANSI_SGR_TERMINATOR, ANSI_ESCAPE_LINK, GROUP_REGEX, getClosingCode, wrapAnsiCode, wrapAnsiHyperlink, wrapWord, stringVisibleTrimSpacesRight, exec, CRLF_OR_LF;
|
|
235
189
|
var init_main = __esm({
|
|
236
|
-
"node_modules/.bun/fast-wrap-ansi@0.
|
|
190
|
+
"node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js"() {
|
|
237
191
|
init_utils2();
|
|
238
192
|
init_dist2();
|
|
239
193
|
ESC = "\x1B";
|
|
@@ -397,16 +351,19 @@ var init_main = __esm({
|
|
|
397
351
|
}
|
|
398
352
|
const preString = rows.join("\n");
|
|
399
353
|
let inSurrogate = false;
|
|
400
|
-
for (let
|
|
401
|
-
const character = preString[
|
|
354
|
+
for (let i2 = 0; i2 < preString.length; i2++) {
|
|
355
|
+
const character = preString[i2];
|
|
402
356
|
returnValue += character;
|
|
403
357
|
if (!inSurrogate) {
|
|
404
358
|
inSurrogate = character >= "\uD800" && character <= "\uDBFF";
|
|
359
|
+
if (inSurrogate) {
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
405
362
|
} else {
|
|
406
|
-
|
|
363
|
+
inSurrogate = false;
|
|
407
364
|
}
|
|
408
365
|
if (character === ESC || character === CSI) {
|
|
409
|
-
GROUP_REGEX.lastIndex =
|
|
366
|
+
GROUP_REGEX.lastIndex = i2 + 1;
|
|
410
367
|
const groupsResult = GROUP_REGEX.exec(preString);
|
|
411
368
|
const groups = groupsResult?.groups;
|
|
412
369
|
if (groups?.code !== void 0) {
|
|
@@ -416,7 +373,7 @@ var init_main = __esm({
|
|
|
416
373
|
escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
417
374
|
}
|
|
418
375
|
}
|
|
419
|
-
if (preString[
|
|
376
|
+
if (preString[i2 + 1] === "\n") {
|
|
420
377
|
if (escapeUrl) {
|
|
421
378
|
returnValue += wrapAnsiHyperlink("");
|
|
422
379
|
}
|
|
@@ -447,17 +404,17 @@ var require_src = __commonJS({
|
|
|
447
404
|
var ESC2 = "\x1B";
|
|
448
405
|
var CSI2 = `${ESC2}[`;
|
|
449
406
|
var beep = "\x07";
|
|
450
|
-
var
|
|
451
|
-
to(x,
|
|
452
|
-
if (!
|
|
453
|
-
return `${CSI2}${
|
|
407
|
+
var cursor3 = {
|
|
408
|
+
to(x, y) {
|
|
409
|
+
if (!y) return `${CSI2}${x + 1}G`;
|
|
410
|
+
return `${CSI2}${y + 1};${x + 1}H`;
|
|
454
411
|
},
|
|
455
|
-
move(x,
|
|
412
|
+
move(x, y) {
|
|
456
413
|
let ret = "";
|
|
457
414
|
if (x < 0) ret += `${CSI2}${-x}D`;
|
|
458
415
|
else if (x > 0) ret += `${CSI2}${x}C`;
|
|
459
|
-
if (
|
|
460
|
-
else if (
|
|
416
|
+
if (y < 0) ret += `${CSI2}${-y}A`;
|
|
417
|
+
else if (y > 0) ret += `${CSI2}${y}B`;
|
|
461
418
|
return ret;
|
|
462
419
|
},
|
|
463
420
|
up: (count = 1) => `${CSI2}${count}A`,
|
|
@@ -476,7 +433,7 @@ var require_src = __commonJS({
|
|
|
476
433
|
up: (count = 1) => `${CSI2}S`.repeat(count),
|
|
477
434
|
down: (count = 1) => `${CSI2}T`.repeat(count)
|
|
478
435
|
};
|
|
479
|
-
var
|
|
436
|
+
var erase3 = {
|
|
480
437
|
screen: `${CSI2}2J`,
|
|
481
438
|
up: (count = 1) => `${CSI2}1J`.repeat(count),
|
|
482
439
|
down: (count = 1) => `${CSI2}J`.repeat(count),
|
|
@@ -485,138 +442,225 @@ var require_src = __commonJS({
|
|
|
485
442
|
lineStart: `${CSI2}1K`,
|
|
486
443
|
lines(count) {
|
|
487
444
|
let clear = "";
|
|
488
|
-
for (let
|
|
489
|
-
clear += this.line + (
|
|
445
|
+
for (let i2 = 0; i2 < count; i2++)
|
|
446
|
+
clear += this.line + (i2 < count - 1 ? cursor3.up() : "");
|
|
490
447
|
if (count)
|
|
491
|
-
clear +=
|
|
448
|
+
clear += cursor3.left;
|
|
492
449
|
return clear;
|
|
493
450
|
}
|
|
494
451
|
};
|
|
495
|
-
module.exports = { cursor, scroll, erase, beep };
|
|
452
|
+
module.exports = { cursor: cursor3, scroll, erase: erase3, beep };
|
|
496
453
|
}
|
|
497
454
|
});
|
|
498
455
|
|
|
499
|
-
// node_modules/.bun/@clack+core@1.
|
|
500
|
-
import { styleText
|
|
501
|
-
import { stdout
|
|
502
|
-
import { ReadStream
|
|
503
|
-
var import_sisteransi,
|
|
456
|
+
// node_modules/.bun/@clack+core@1.5.0/node_modules/@clack/core/dist/index.mjs
|
|
457
|
+
import { styleText } from "node:util";
|
|
458
|
+
import { stdout, stdin } from "node:process";
|
|
459
|
+
import { ReadStream } from "node:tty";
|
|
460
|
+
var import_sisteransi, a$1, t, settings, R, getColumns;
|
|
504
461
|
var init_dist3 = __esm({
|
|
505
|
-
"node_modules/.bun/@clack+core@1.
|
|
462
|
+
"node_modules/.bun/@clack+core@1.5.0/node_modules/@clack/core/dist/index.mjs"() {
|
|
506
463
|
init_utils2();
|
|
507
464
|
init_main();
|
|
508
465
|
import_sisteransi = __toESM(require_src(), 1);
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
466
|
+
a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
467
|
+
t = [
|
|
468
|
+
"January",
|
|
469
|
+
"February",
|
|
470
|
+
"March",
|
|
471
|
+
"April",
|
|
472
|
+
"May",
|
|
473
|
+
"June",
|
|
474
|
+
"July",
|
|
475
|
+
"August",
|
|
476
|
+
"September",
|
|
477
|
+
"October",
|
|
478
|
+
"November",
|
|
479
|
+
"December"
|
|
480
|
+
];
|
|
481
|
+
settings = {
|
|
482
|
+
actions: new Set(a$1),
|
|
483
|
+
aliases: /* @__PURE__ */ new Map([
|
|
484
|
+
// vim support
|
|
485
|
+
["k", "up"],
|
|
486
|
+
["j", "down"],
|
|
487
|
+
["h", "left"],
|
|
488
|
+
["l", "right"],
|
|
489
|
+
["", "cancel"],
|
|
490
|
+
// opinionated defaults!
|
|
491
|
+
["escape", "cancel"]
|
|
492
|
+
]),
|
|
493
|
+
messages: {
|
|
494
|
+
cancel: "Canceled",
|
|
495
|
+
error: "Something went wrong"
|
|
496
|
+
},
|
|
497
|
+
withGuide: true,
|
|
498
|
+
accessible: void 0,
|
|
499
|
+
date: {
|
|
500
|
+
monthNames: [...t],
|
|
501
|
+
messages: {
|
|
502
|
+
required: "Please enter a valid date",
|
|
503
|
+
invalidMonth: "There are only 12 months in a year",
|
|
504
|
+
invalidDay: (n2, e) => `There are only ${n2} days in ${e}`,
|
|
505
|
+
afterMin: (n2) => `Date must be on or after ${n2.toISOString().slice(0, 10)}`,
|
|
506
|
+
beforeMax: (n2) => `Date must be on or before ${n2.toISOString().slice(0, 10)}`
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
};
|
|
510
|
+
R = globalThis.process.platform.startsWith("win");
|
|
511
|
+
getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
|
|
514
512
|
}
|
|
515
513
|
});
|
|
516
514
|
|
|
517
|
-
// node_modules/.bun/@clack+prompts@1.
|
|
518
|
-
import { styleText as
|
|
519
|
-
import
|
|
520
|
-
import { existsSync
|
|
521
|
-
import { dirname
|
|
522
|
-
function
|
|
523
|
-
|
|
515
|
+
// node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs
|
|
516
|
+
import { styleText as styleText2, stripVTControlCharacters } from "node:util";
|
|
517
|
+
import process$1 from "node:process";
|
|
518
|
+
import { existsSync, lstatSync, readdirSync } from "node:fs";
|
|
519
|
+
import { dirname, join } from "node:path";
|
|
520
|
+
function isUnicodeSupported() {
|
|
521
|
+
if (process$1.platform !== "win32") {
|
|
522
|
+
return process$1.env.TERM !== "linux";
|
|
523
|
+
}
|
|
524
|
+
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";
|
|
524
525
|
}
|
|
525
|
-
var import_sisteransi2,
|
|
526
|
+
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;
|
|
526
527
|
var init_dist4 = __esm({
|
|
527
|
-
"node_modules/.bun/@clack+prompts@1.
|
|
528
|
+
"node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs"() {
|
|
528
529
|
init_utils2();
|
|
529
530
|
init_dist3();
|
|
530
531
|
init_dist3();
|
|
531
532
|
init_main();
|
|
532
533
|
init_dist2();
|
|
533
534
|
import_sisteransi2 = __toESM(require_src(), 1);
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
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
|
-
|
|
535
|
+
unicode = isUnicodeSupported();
|
|
536
|
+
unicodeOr = (o, e) => unicode ? o : e;
|
|
537
|
+
S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
|
|
538
|
+
S_STEP_CANCEL = unicodeOr("\u25A0", "x");
|
|
539
|
+
S_STEP_ERROR = unicodeOr("\u25B2", "x");
|
|
540
|
+
S_STEP_SUBMIT = unicodeOr("\u25C7", "o");
|
|
541
|
+
S_BAR_START = unicodeOr("\u250C", "T");
|
|
542
|
+
S_BAR = unicodeOr("\u2502", "|");
|
|
543
|
+
S_BAR_END = unicodeOr("\u2514", "\u2014");
|
|
544
|
+
S_BAR_START_RIGHT = unicodeOr("\u2510", "T");
|
|
545
|
+
S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014");
|
|
546
|
+
S_RADIO_ACTIVE = unicodeOr("\u25CF", ">");
|
|
547
|
+
S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
|
|
548
|
+
S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
|
|
549
|
+
S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
|
|
550
|
+
S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
|
|
551
|
+
S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022");
|
|
552
|
+
S_BAR_H = unicodeOr("\u2500", "-");
|
|
553
|
+
S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+");
|
|
554
|
+
S_CONNECT_LEFT = unicodeOr("\u251C", "+");
|
|
555
|
+
S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+");
|
|
556
|
+
S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+");
|
|
557
|
+
S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+");
|
|
558
|
+
S_INFO = unicodeOr("\u25CF", "\u2022");
|
|
559
|
+
S_SUCCESS = unicodeOr("\u25C6", "*");
|
|
560
|
+
S_WARN = unicodeOr("\u25B2", "!");
|
|
561
|
+
S_ERROR = unicodeOr("\u25A0", "x");
|
|
562
|
+
MULTISELECT_INSTRUCTIONS = [
|
|
563
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
564
|
+
`${styleText2("dim", "Space:")} select`,
|
|
565
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
566
|
+
];
|
|
567
|
+
log = {
|
|
568
|
+
message: (s = [], {
|
|
569
|
+
symbol: e = styleText2("gray", S_BAR),
|
|
570
|
+
secondarySymbol: r2 = styleText2("gray", S_BAR),
|
|
571
|
+
output: m = process.stdout,
|
|
572
|
+
spacing: l = 1,
|
|
573
|
+
withGuide: c
|
|
574
|
+
} = {}) => {
|
|
575
|
+
const t2 = [], o = c ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
|
|
576
|
+
for (let i2 = 0; i2 < l; i2++)
|
|
577
|
+
t2.push(f);
|
|
578
|
+
const g = Array.isArray(s) ? s : s.split(`
|
|
565
579
|
`);
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
580
|
+
if (g.length > 0) {
|
|
581
|
+
const [i2, ...y] = g;
|
|
582
|
+
i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
|
|
583
|
+
for (const p of y)
|
|
584
|
+
p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
|
|
585
|
+
}
|
|
586
|
+
m.write(`${t2.join(`
|
|
572
587
|
`)}
|
|
573
588
|
`);
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
589
|
+
},
|
|
590
|
+
info: (s, e) => {
|
|
591
|
+
log.message(s, { ...e, symbol: styleText2("blue", S_INFO) });
|
|
592
|
+
},
|
|
593
|
+
success: (s, e) => {
|
|
594
|
+
log.message(s, { ...e, symbol: styleText2("green", S_SUCCESS) });
|
|
595
|
+
},
|
|
596
|
+
step: (s, e) => {
|
|
597
|
+
log.message(s, { ...e, symbol: styleText2("green", S_STEP_SUBMIT) });
|
|
598
|
+
},
|
|
599
|
+
warn: (s, e) => {
|
|
600
|
+
log.message(s, { ...e, symbol: styleText2("yellow", S_WARN) });
|
|
601
|
+
},
|
|
602
|
+
/** alias for `log.warn()`. */
|
|
603
|
+
warning: (s, e) => {
|
|
604
|
+
log.warn(s, e);
|
|
605
|
+
},
|
|
606
|
+
error: (s, e) => {
|
|
607
|
+
log.message(s, { ...e, symbol: styleText2("red", S_ERROR) });
|
|
608
|
+
}
|
|
609
|
+
};
|
|
610
|
+
intro = (o = "", t2) => {
|
|
611
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_START)} ` : "";
|
|
612
|
+
i2.write(`${e}${o}
|
|
590
613
|
`);
|
|
591
614
|
};
|
|
592
|
-
|
|
593
|
-
const
|
|
594
|
-
${
|
|
595
|
-
|
|
615
|
+
outro = (o = "", t2) => {
|
|
616
|
+
const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR)}
|
|
617
|
+
${styleText2("gray", S_BAR_END)} ` : "";
|
|
618
|
+
i2.write(`${e}${o}
|
|
596
619
|
|
|
597
620
|
`);
|
|
598
621
|
};
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
const
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
622
|
+
W$1 = (o) => o;
|
|
623
|
+
C = (o, e, s) => {
|
|
624
|
+
const a2 = {
|
|
625
|
+
hard: true,
|
|
626
|
+
trim: false
|
|
627
|
+
}, i2 = wrapAnsi(o, e, a2).split(`
|
|
628
|
+
`), 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);
|
|
629
|
+
return wrapAnsi(o, g, a2);
|
|
630
|
+
};
|
|
631
|
+
note = (o = "", e = "", s) => {
|
|
632
|
+
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(`
|
|
633
|
+
`).map(c), ""], n2 = dist_default2(e), t2 = Math.max(
|
|
634
|
+
g.reduce((m, F) => {
|
|
635
|
+
const O = dist_default2(F);
|
|
636
|
+
return O > m ? O : m;
|
|
637
|
+
}, 0),
|
|
638
|
+
n2
|
|
639
|
+
) + 2, h2 = g.map(
|
|
640
|
+
(m) => `${styleText2("gray", S_BAR)} ${m}${" ".repeat(t2 - dist_default2(m))}${styleText2("gray", S_BAR)}`
|
|
641
|
+
).join(`
|
|
642
|
+
`), T = i2 ? `${styleText2("gray", S_BAR)}
|
|
643
|
+
` : "", l$1 = i2 ? S_CONNECT_LEFT : S_CORNER_BOTTOM_LEFT;
|
|
644
|
+
a2.write(
|
|
645
|
+
`${T}${styleText2("green", S_STEP_SUBMIT)} ${styleText2("reset", e)} ${styleText2(
|
|
646
|
+
"gray",
|
|
647
|
+
S_BAR_H.repeat(Math.max(t2 - n2 - 1, 1)) + S_CORNER_TOP_RIGHT
|
|
648
|
+
)}
|
|
649
|
+
${h2}
|
|
650
|
+
${styleText2("gray", l$1 + S_BAR_H.repeat(t2 + 2) + S_CORNER_BOTTOM_RIGHT)}
|
|
651
|
+
`
|
|
652
|
+
);
|
|
653
|
+
};
|
|
654
|
+
u2 = {
|
|
655
|
+
light: unicodeOr("\u2500", "-"),
|
|
656
|
+
heavy: unicodeOr("\u2501", "="),
|
|
657
|
+
block: unicodeOr("\u2588", "#")
|
|
617
658
|
};
|
|
618
|
-
|
|
619
|
-
|
|
659
|
+
SELECT_INSTRUCTIONS = [
|
|
660
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
661
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
662
|
+
];
|
|
663
|
+
i = `${styleText2("gray", S_BAR)} `;
|
|
620
664
|
}
|
|
621
665
|
});
|
|
622
666
|
|
|
@@ -661,7 +705,7 @@ function stringify(value) {
|
|
|
661
705
|
function formatMessage(...args) {
|
|
662
706
|
return args.map(stringify).join(" ");
|
|
663
707
|
}
|
|
664
|
-
var colors, currentLogLevel,
|
|
708
|
+
var colors, currentLogLevel, log2, error, warn, info, success;
|
|
665
709
|
var init_cli_output = __esm({
|
|
666
710
|
"packages/tooling/src/utils/cli-output.ts"() {
|
|
667
711
|
"use strict";
|
|
@@ -694,7 +738,7 @@ var init_cli_output = __esm({
|
|
|
694
738
|
currentLogLevel = envLevel;
|
|
695
739
|
}
|
|
696
740
|
}
|
|
697
|
-
|
|
741
|
+
log2 = {
|
|
698
742
|
/**
|
|
699
743
|
* Logs an error message (always shows unless Quiet level)
|
|
700
744
|
* Uses clack's log.error + explicit red color
|
|
@@ -702,7 +746,7 @@ var init_cli_output = __esm({
|
|
|
702
746
|
error(...args) {
|
|
703
747
|
if (currentLogLevel < 0 /* Quiet */) return;
|
|
704
748
|
const message = formatMessage(...args);
|
|
705
|
-
|
|
749
|
+
log.error(colorize(message, colors.brightRed));
|
|
706
750
|
},
|
|
707
751
|
/**
|
|
708
752
|
* Logs a warning message (shows at Normal level and above)
|
|
@@ -711,7 +755,7 @@ var init_cli_output = __esm({
|
|
|
711
755
|
warn(...args) {
|
|
712
756
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
713
757
|
const message = formatMessage(...args);
|
|
714
|
-
|
|
758
|
+
log.warn(colorize(message, colors.brightYellow));
|
|
715
759
|
},
|
|
716
760
|
/**
|
|
717
761
|
* Logs an info message (shows at Normal level and above)
|
|
@@ -720,7 +764,7 @@ var init_cli_output = __esm({
|
|
|
720
764
|
info(...args) {
|
|
721
765
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
722
766
|
const message = formatMessage(...args);
|
|
723
|
-
|
|
767
|
+
log.info(colorize(message, colors.brightCyan));
|
|
724
768
|
},
|
|
725
769
|
/**
|
|
726
770
|
* Logs a success message (shows at Normal level and above)
|
|
@@ -729,7 +773,7 @@ var init_cli_output = __esm({
|
|
|
729
773
|
success(...args) {
|
|
730
774
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
731
775
|
const message = formatMessage(...args);
|
|
732
|
-
|
|
776
|
+
log.success(colorize(message, colors.brightGreen));
|
|
733
777
|
},
|
|
734
778
|
/**
|
|
735
779
|
* Logs a debug message (only shows at Verbose level and above)
|
|
@@ -738,7 +782,7 @@ var init_cli_output = __esm({
|
|
|
738
782
|
debug(...args) {
|
|
739
783
|
if (currentLogLevel < 2 /* Verbose */) return;
|
|
740
784
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
741
|
-
|
|
785
|
+
log.message(
|
|
742
786
|
colorize(
|
|
743
787
|
`[${timeStamp}] \u{1F50D} DEBUG: ${formatMessage(...args)}`,
|
|
744
788
|
colors.gray
|
|
@@ -752,7 +796,7 @@ var init_cli_output = __esm({
|
|
|
752
796
|
trace(...args) {
|
|
753
797
|
if (currentLogLevel < 3 /* Debug */) return;
|
|
754
798
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
755
|
-
|
|
799
|
+
log.message(
|
|
756
800
|
colorize(
|
|
757
801
|
`[${timeStamp}] \u{1F52C} TRACE: ${formatMessage(...args)}`,
|
|
758
802
|
colors.gray
|
|
@@ -760,10 +804,10 @@ var init_cli_output = __esm({
|
|
|
760
804
|
);
|
|
761
805
|
}
|
|
762
806
|
};
|
|
763
|
-
error =
|
|
764
|
-
warn =
|
|
765
|
-
info =
|
|
766
|
-
success =
|
|
807
|
+
error = log2.error.bind(log2);
|
|
808
|
+
warn = log2.warn.bind(log2);
|
|
809
|
+
info = log2.info.bind(log2);
|
|
810
|
+
success = log2.success.bind(log2);
|
|
767
811
|
}
|
|
768
812
|
});
|
|
769
813
|
|
|
@@ -981,9 +1025,9 @@ var require_is_glob = __commonJS({
|
|
|
981
1025
|
index += 2;
|
|
982
1026
|
var close = chars[open];
|
|
983
1027
|
if (close) {
|
|
984
|
-
var
|
|
985
|
-
if (
|
|
986
|
-
index =
|
|
1028
|
+
var n2 = str.indexOf(close, index);
|
|
1029
|
+
if (n2 !== -1) {
|
|
1030
|
+
index = n2 + 1;
|
|
987
1031
|
}
|
|
988
1032
|
}
|
|
989
1033
|
if (str[index] === "!") {
|
|
@@ -1009,9 +1053,9 @@ var require_is_glob = __commonJS({
|
|
|
1009
1053
|
index += 2;
|
|
1010
1054
|
var close = chars[open];
|
|
1011
1055
|
if (close) {
|
|
1012
|
-
var
|
|
1013
|
-
if (
|
|
1014
|
-
index =
|
|
1056
|
+
var n2 = str.indexOf(close, index);
|
|
1057
|
+
if (n2 !== -1) {
|
|
1058
|
+
index = n2 + 1;
|
|
1015
1059
|
}
|
|
1016
1060
|
}
|
|
1017
1061
|
if (str[index] === "!") {
|
|
@@ -1089,8 +1133,8 @@ var require_utils = __commonJS({
|
|
|
1089
1133
|
if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
|
|
1090
1134
|
return (Number(max) - Number(min)) / Number(step) >= limit;
|
|
1091
1135
|
};
|
|
1092
|
-
exports.escapeNode = (
|
|
1093
|
-
const node =
|
|
1136
|
+
exports.escapeNode = (block2, n2 = 0, type) => {
|
|
1137
|
+
const node = block2.nodes[n2];
|
|
1094
1138
|
if (!node) return;
|
|
1095
1139
|
if (type && node.type === type || node.type === "open" || node.type === "close") {
|
|
1096
1140
|
if (node.escaped !== true) {
|
|
@@ -1107,15 +1151,15 @@ var require_utils = __commonJS({
|
|
|
1107
1151
|
}
|
|
1108
1152
|
return false;
|
|
1109
1153
|
};
|
|
1110
|
-
exports.isInvalidBrace = (
|
|
1111
|
-
if (
|
|
1112
|
-
if (
|
|
1113
|
-
if (
|
|
1114
|
-
|
|
1154
|
+
exports.isInvalidBrace = (block2) => {
|
|
1155
|
+
if (block2.type !== "brace") return false;
|
|
1156
|
+
if (block2.invalid === true || block2.dollar) return true;
|
|
1157
|
+
if (block2.commas >> 0 + block2.ranges >> 0 === 0) {
|
|
1158
|
+
block2.invalid = true;
|
|
1115
1159
|
return true;
|
|
1116
1160
|
}
|
|
1117
|
-
if (
|
|
1118
|
-
|
|
1161
|
+
if (block2.open !== true || block2.close !== true) {
|
|
1162
|
+
block2.invalid = true;
|
|
1119
1163
|
return true;
|
|
1120
1164
|
}
|
|
1121
1165
|
return false;
|
|
@@ -1134,8 +1178,8 @@ var require_utils = __commonJS({
|
|
|
1134
1178
|
exports.flatten = (...args) => {
|
|
1135
1179
|
const result = [];
|
|
1136
1180
|
const flat = (arr) => {
|
|
1137
|
-
for (let
|
|
1138
|
-
const ele = arr[
|
|
1181
|
+
for (let i2 = 0; i2 < arr.length; i2++) {
|
|
1182
|
+
const ele = arr[i2];
|
|
1139
1183
|
if (Array.isArray(ele)) {
|
|
1140
1184
|
flat(ele);
|
|
1141
1185
|
continue;
|
|
@@ -1229,9 +1273,9 @@ var require_to_regex_range = __commonJS({
|
|
|
1229
1273
|
if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
|
|
1230
1274
|
return toRegexRange.cache[cacheKey].result;
|
|
1231
1275
|
}
|
|
1232
|
-
let
|
|
1276
|
+
let a2 = Math.min(min, max);
|
|
1233
1277
|
let b = Math.max(min, max);
|
|
1234
|
-
if (Math.abs(
|
|
1278
|
+
if (Math.abs(a2 - b) === 1) {
|
|
1235
1279
|
let result = min + "|" + max;
|
|
1236
1280
|
if (opts.capture) {
|
|
1237
1281
|
return `(${result})`;
|
|
@@ -1242,20 +1286,20 @@ var require_to_regex_range = __commonJS({
|
|
|
1242
1286
|
return `(?:${result})`;
|
|
1243
1287
|
}
|
|
1244
1288
|
let isPadded = hasPadding(min) || hasPadding(max);
|
|
1245
|
-
let state = { min, max, a, b };
|
|
1289
|
+
let state = { min, max, a: a2, b };
|
|
1246
1290
|
let positives = [];
|
|
1247
1291
|
let negatives = [];
|
|
1248
1292
|
if (isPadded) {
|
|
1249
1293
|
state.isPadded = isPadded;
|
|
1250
1294
|
state.maxLen = String(state.max).length;
|
|
1251
1295
|
}
|
|
1252
|
-
if (
|
|
1296
|
+
if (a2 < 0) {
|
|
1253
1297
|
let newMin = b < 0 ? Math.abs(b) : 1;
|
|
1254
|
-
negatives = splitToPatterns(newMin, Math.abs(
|
|
1255
|
-
|
|
1298
|
+
negatives = splitToPatterns(newMin, Math.abs(a2), state, opts);
|
|
1299
|
+
a2 = state.a = 0;
|
|
1256
1300
|
}
|
|
1257
1301
|
if (b >= 0) {
|
|
1258
|
-
positives = splitToPatterns(
|
|
1302
|
+
positives = splitToPatterns(a2, b, state, opts);
|
|
1259
1303
|
}
|
|
1260
1304
|
state.negatives = negatives;
|
|
1261
1305
|
state.positives = positives;
|
|
@@ -1303,8 +1347,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1303
1347
|
let digits = zipped.length;
|
|
1304
1348
|
let pattern = "";
|
|
1305
1349
|
let count = 0;
|
|
1306
|
-
for (let
|
|
1307
|
-
let [startDigit, stopDigit] = zipped[
|
|
1350
|
+
for (let i2 = 0; i2 < digits; i2++) {
|
|
1351
|
+
let [startDigit, stopDigit] = zipped[i2];
|
|
1308
1352
|
if (startDigit === stopDigit) {
|
|
1309
1353
|
pattern += startDigit;
|
|
1310
1354
|
} else if (startDigit !== "0" || stopDigit !== "9") {
|
|
@@ -1323,8 +1367,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1323
1367
|
let tokens = [];
|
|
1324
1368
|
let start = min;
|
|
1325
1369
|
let prev;
|
|
1326
|
-
for (let
|
|
1327
|
-
let max2 = ranges[
|
|
1370
|
+
for (let i2 = 0; i2 < ranges.length; i2++) {
|
|
1371
|
+
let max2 = ranges[i2];
|
|
1328
1372
|
let obj = rangeToPattern(String(start), String(max2), options);
|
|
1329
1373
|
let zeros = "";
|
|
1330
1374
|
if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
|
|
@@ -1359,13 +1403,13 @@ var require_to_regex_range = __commonJS({
|
|
|
1359
1403
|
}
|
|
1360
1404
|
return result;
|
|
1361
1405
|
}
|
|
1362
|
-
function zip(
|
|
1406
|
+
function zip(a2, b) {
|
|
1363
1407
|
let arr = [];
|
|
1364
|
-
for (let
|
|
1408
|
+
for (let i2 = 0; i2 < a2.length; i2++) arr.push([a2[i2], b[i2]]);
|
|
1365
1409
|
return arr;
|
|
1366
1410
|
}
|
|
1367
|
-
function compare(
|
|
1368
|
-
return
|
|
1411
|
+
function compare(a2, b) {
|
|
1412
|
+
return a2 > b ? 1 : b > a2 ? -1 : 0;
|
|
1369
1413
|
}
|
|
1370
1414
|
function contains(arr, key, val) {
|
|
1371
1415
|
return arr.some((ele) => ele[key] === val);
|
|
@@ -1383,8 +1427,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1383
1427
|
}
|
|
1384
1428
|
return "";
|
|
1385
1429
|
}
|
|
1386
|
-
function toCharacterClass(
|
|
1387
|
-
return `[${
|
|
1430
|
+
function toCharacterClass(a2, b, options) {
|
|
1431
|
+
return `[${a2}${b - a2 === 1 ? "" : "-"}${b}]`;
|
|
1388
1432
|
}
|
|
1389
1433
|
function hasPadding(str) {
|
|
1390
1434
|
return /^-?(0+)\d/.test(str);
|
|
@@ -1463,8 +1507,8 @@ var require_fill_range = __commonJS({
|
|
|
1463
1507
|
return negative ? "-" + input : input;
|
|
1464
1508
|
};
|
|
1465
1509
|
var toSequence = (parts, options, maxLen) => {
|
|
1466
|
-
parts.negatives.sort((
|
|
1467
|
-
parts.positives.sort((
|
|
1510
|
+
parts.negatives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
1511
|
+
parts.positives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
1468
1512
|
let prefix = options.capture ? "" : "?:";
|
|
1469
1513
|
let positives = "";
|
|
1470
1514
|
let negatives = "";
|
|
@@ -1485,12 +1529,12 @@ var require_fill_range = __commonJS({
|
|
|
1485
1529
|
}
|
|
1486
1530
|
return result;
|
|
1487
1531
|
};
|
|
1488
|
-
var toRange = (
|
|
1532
|
+
var toRange = (a2, b, isNumbers, options) => {
|
|
1489
1533
|
if (isNumbers) {
|
|
1490
|
-
return toRegexRange(
|
|
1534
|
+
return toRegexRange(a2, b, { wrap: false, ...options });
|
|
1491
1535
|
}
|
|
1492
|
-
let start = String.fromCharCode(
|
|
1493
|
-
if (
|
|
1536
|
+
let start = String.fromCharCode(a2);
|
|
1537
|
+
if (a2 === b) return start;
|
|
1494
1538
|
let stop = String.fromCharCode(b);
|
|
1495
1539
|
return `[${start}-${stop}]`;
|
|
1496
1540
|
};
|
|
@@ -1516,15 +1560,15 @@ var require_fill_range = __commonJS({
|
|
|
1516
1560
|
return [];
|
|
1517
1561
|
};
|
|
1518
1562
|
var fillNumbers = (start, end, step = 1, options = {}) => {
|
|
1519
|
-
let
|
|
1563
|
+
let a2 = Number(start);
|
|
1520
1564
|
let b = Number(end);
|
|
1521
|
-
if (!Number.isInteger(
|
|
1565
|
+
if (!Number.isInteger(a2) || !Number.isInteger(b)) {
|
|
1522
1566
|
if (options.strictRanges === true) throw rangeError([start, end]);
|
|
1523
1567
|
return [];
|
|
1524
1568
|
}
|
|
1525
|
-
if (
|
|
1569
|
+
if (a2 === 0) a2 = 0;
|
|
1526
1570
|
if (b === 0) b = 0;
|
|
1527
|
-
let descending =
|
|
1571
|
+
let descending = a2 > b;
|
|
1528
1572
|
let startString = String(start);
|
|
1529
1573
|
let endString = String(end);
|
|
1530
1574
|
let stepString = String(step);
|
|
@@ -1540,13 +1584,13 @@ var require_fill_range = __commonJS({
|
|
|
1540
1584
|
let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
|
|
1541
1585
|
let range = [];
|
|
1542
1586
|
let index = 0;
|
|
1543
|
-
while (descending ?
|
|
1587
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
1544
1588
|
if (options.toRegex === true && step > 1) {
|
|
1545
|
-
push(
|
|
1589
|
+
push(a2);
|
|
1546
1590
|
} else {
|
|
1547
|
-
range.push(pad(format(
|
|
1591
|
+
range.push(pad(format(a2, index), maxLen, toNumber));
|
|
1548
1592
|
}
|
|
1549
|
-
|
|
1593
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
1550
1594
|
index++;
|
|
1551
1595
|
}
|
|
1552
1596
|
if (options.toRegex === true) {
|
|
@@ -1559,19 +1603,19 @@ var require_fill_range = __commonJS({
|
|
|
1559
1603
|
return invalidRange(start, end, options);
|
|
1560
1604
|
}
|
|
1561
1605
|
let format = options.transform || ((val) => String.fromCharCode(val));
|
|
1562
|
-
let
|
|
1606
|
+
let a2 = `${start}`.charCodeAt(0);
|
|
1563
1607
|
let b = `${end}`.charCodeAt(0);
|
|
1564
|
-
let descending =
|
|
1565
|
-
let min = Math.min(
|
|
1566
|
-
let max = Math.max(
|
|
1608
|
+
let descending = a2 > b;
|
|
1609
|
+
let min = Math.min(a2, b);
|
|
1610
|
+
let max = Math.max(a2, b);
|
|
1567
1611
|
if (options.toRegex && step === 1) {
|
|
1568
1612
|
return toRange(min, max, false, options);
|
|
1569
1613
|
}
|
|
1570
1614
|
let range = [];
|
|
1571
1615
|
let index = 0;
|
|
1572
|
-
while (descending ?
|
|
1573
|
-
range.push(format(
|
|
1574
|
-
|
|
1616
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
1617
|
+
range.push(format(a2, index));
|
|
1618
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
1575
1619
|
index++;
|
|
1576
1620
|
}
|
|
1577
1621
|
if (options.toRegex === true) {
|
|
@@ -1695,17 +1739,17 @@ var require_expand = __commonJS({
|
|
|
1695
1739
|
const walk = (node, parent = {}) => {
|
|
1696
1740
|
node.queue = [];
|
|
1697
1741
|
let p = parent;
|
|
1698
|
-
let
|
|
1742
|
+
let q = parent.queue;
|
|
1699
1743
|
while (p.type !== "brace" && p.type !== "root" && p.parent) {
|
|
1700
1744
|
p = p.parent;
|
|
1701
|
-
|
|
1745
|
+
q = p.queue;
|
|
1702
1746
|
}
|
|
1703
1747
|
if (node.invalid || node.dollar) {
|
|
1704
|
-
|
|
1748
|
+
q.push(append(q.pop(), stringify2(node, options)));
|
|
1705
1749
|
return;
|
|
1706
1750
|
}
|
|
1707
1751
|
if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
|
|
1708
|
-
|
|
1752
|
+
q.push(append(q.pop(), ["{}"]));
|
|
1709
1753
|
return;
|
|
1710
1754
|
}
|
|
1711
1755
|
if (node.nodes && node.ranges > 0) {
|
|
@@ -1717,26 +1761,26 @@ var require_expand = __commonJS({
|
|
|
1717
1761
|
if (range.length === 0) {
|
|
1718
1762
|
range = stringify2(node, options);
|
|
1719
1763
|
}
|
|
1720
|
-
|
|
1764
|
+
q.push(append(q.pop(), range));
|
|
1721
1765
|
node.nodes = [];
|
|
1722
1766
|
return;
|
|
1723
1767
|
}
|
|
1724
1768
|
const enclose = utils.encloseBrace(node);
|
|
1725
1769
|
let queue = node.queue;
|
|
1726
|
-
let
|
|
1727
|
-
while (
|
|
1728
|
-
|
|
1729
|
-
queue =
|
|
1770
|
+
let block2 = node;
|
|
1771
|
+
while (block2.type !== "brace" && block2.type !== "root" && block2.parent) {
|
|
1772
|
+
block2 = block2.parent;
|
|
1773
|
+
queue = block2.queue;
|
|
1730
1774
|
}
|
|
1731
|
-
for (let
|
|
1732
|
-
const child = node.nodes[
|
|
1775
|
+
for (let i2 = 0; i2 < node.nodes.length; i2++) {
|
|
1776
|
+
const child = node.nodes[i2];
|
|
1733
1777
|
if (child.type === "comma" && node.type === "brace") {
|
|
1734
|
-
if (
|
|
1778
|
+
if (i2 === 1) queue.push("");
|
|
1735
1779
|
queue.push("");
|
|
1736
1780
|
continue;
|
|
1737
1781
|
}
|
|
1738
1782
|
if (child.type === "close") {
|
|
1739
|
-
|
|
1783
|
+
q.push(append(q.pop(), queue, enclose));
|
|
1740
1784
|
continue;
|
|
1741
1785
|
}
|
|
1742
1786
|
if (child.value && child.type !== "open") {
|
|
@@ -1903,7 +1947,7 @@ var require_parse = __commonJS({
|
|
|
1903
1947
|
}
|
|
1904
1948
|
const ast = { type: "root", input, nodes: [] };
|
|
1905
1949
|
const stack = [ast];
|
|
1906
|
-
let
|
|
1950
|
+
let block2 = ast;
|
|
1907
1951
|
let prev = ast;
|
|
1908
1952
|
let brackets = 0;
|
|
1909
1953
|
const length = input.length;
|
|
@@ -1919,15 +1963,15 @@ var require_parse = __commonJS({
|
|
|
1919
1963
|
prev.value += node.value;
|
|
1920
1964
|
return;
|
|
1921
1965
|
}
|
|
1922
|
-
|
|
1923
|
-
node.parent =
|
|
1966
|
+
block2.nodes.push(node);
|
|
1967
|
+
node.parent = block2;
|
|
1924
1968
|
node.prev = prev;
|
|
1925
1969
|
prev = node;
|
|
1926
1970
|
return node;
|
|
1927
1971
|
};
|
|
1928
1972
|
push({ type: "bos" });
|
|
1929
1973
|
while (index < length) {
|
|
1930
|
-
|
|
1974
|
+
block2 = stack[stack.length - 1];
|
|
1931
1975
|
value = advance();
|
|
1932
1976
|
if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
|
|
1933
1977
|
continue;
|
|
@@ -1964,19 +2008,19 @@ var require_parse = __commonJS({
|
|
|
1964
2008
|
continue;
|
|
1965
2009
|
}
|
|
1966
2010
|
if (value === CHAR_LEFT_PARENTHESES) {
|
|
1967
|
-
|
|
1968
|
-
stack.push(
|
|
2011
|
+
block2 = push({ type: "paren", nodes: [] });
|
|
2012
|
+
stack.push(block2);
|
|
1969
2013
|
push({ type: "text", value });
|
|
1970
2014
|
continue;
|
|
1971
2015
|
}
|
|
1972
2016
|
if (value === CHAR_RIGHT_PARENTHESES) {
|
|
1973
|
-
if (
|
|
2017
|
+
if (block2.type !== "paren") {
|
|
1974
2018
|
push({ type: "text", value });
|
|
1975
2019
|
continue;
|
|
1976
2020
|
}
|
|
1977
|
-
|
|
2021
|
+
block2 = stack.pop();
|
|
1978
2022
|
push({ type: "text", value });
|
|
1979
|
-
|
|
2023
|
+
block2 = stack[stack.length - 1];
|
|
1980
2024
|
continue;
|
|
1981
2025
|
}
|
|
1982
2026
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
@@ -2001,7 +2045,7 @@ var require_parse = __commonJS({
|
|
|
2001
2045
|
}
|
|
2002
2046
|
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
2003
2047
|
depth++;
|
|
2004
|
-
const dollar = prev.value && prev.value.slice(-1) === "$" ||
|
|
2048
|
+
const dollar = prev.value && prev.value.slice(-1) === "$" || block2.dollar === true;
|
|
2005
2049
|
const brace = {
|
|
2006
2050
|
type: "brace",
|
|
2007
2051
|
open: true,
|
|
@@ -2012,52 +2056,52 @@ var require_parse = __commonJS({
|
|
|
2012
2056
|
ranges: 0,
|
|
2013
2057
|
nodes: []
|
|
2014
2058
|
};
|
|
2015
|
-
|
|
2016
|
-
stack.push(
|
|
2059
|
+
block2 = push(brace);
|
|
2060
|
+
stack.push(block2);
|
|
2017
2061
|
push({ type: "open", value });
|
|
2018
2062
|
continue;
|
|
2019
2063
|
}
|
|
2020
2064
|
if (value === CHAR_RIGHT_CURLY_BRACE) {
|
|
2021
|
-
if (
|
|
2065
|
+
if (block2.type !== "brace") {
|
|
2022
2066
|
push({ type: "text", value });
|
|
2023
2067
|
continue;
|
|
2024
2068
|
}
|
|
2025
2069
|
const type = "close";
|
|
2026
|
-
|
|
2027
|
-
|
|
2070
|
+
block2 = stack.pop();
|
|
2071
|
+
block2.close = true;
|
|
2028
2072
|
push({ type, value });
|
|
2029
2073
|
depth--;
|
|
2030
|
-
|
|
2074
|
+
block2 = stack[stack.length - 1];
|
|
2031
2075
|
continue;
|
|
2032
2076
|
}
|
|
2033
2077
|
if (value === CHAR_COMMA && depth > 0) {
|
|
2034
|
-
if (
|
|
2035
|
-
|
|
2036
|
-
const open =
|
|
2037
|
-
|
|
2078
|
+
if (block2.ranges > 0) {
|
|
2079
|
+
block2.ranges = 0;
|
|
2080
|
+
const open = block2.nodes.shift();
|
|
2081
|
+
block2.nodes = [open, { type: "text", value: stringify2(block2) }];
|
|
2038
2082
|
}
|
|
2039
2083
|
push({ type: "comma", value });
|
|
2040
|
-
|
|
2084
|
+
block2.commas++;
|
|
2041
2085
|
continue;
|
|
2042
2086
|
}
|
|
2043
|
-
if (value === CHAR_DOT && depth > 0 &&
|
|
2044
|
-
const siblings =
|
|
2087
|
+
if (value === CHAR_DOT && depth > 0 && block2.commas === 0) {
|
|
2088
|
+
const siblings = block2.nodes;
|
|
2045
2089
|
if (depth === 0 || siblings.length === 0) {
|
|
2046
2090
|
push({ type: "text", value });
|
|
2047
2091
|
continue;
|
|
2048
2092
|
}
|
|
2049
2093
|
if (prev.type === "dot") {
|
|
2050
|
-
|
|
2094
|
+
block2.range = [];
|
|
2051
2095
|
prev.value += value;
|
|
2052
2096
|
prev.type = "range";
|
|
2053
|
-
if (
|
|
2054
|
-
|
|
2055
|
-
|
|
2097
|
+
if (block2.nodes.length !== 3 && block2.nodes.length !== 5) {
|
|
2098
|
+
block2.invalid = true;
|
|
2099
|
+
block2.ranges = 0;
|
|
2056
2100
|
prev.type = "text";
|
|
2057
2101
|
continue;
|
|
2058
2102
|
}
|
|
2059
|
-
|
|
2060
|
-
|
|
2103
|
+
block2.ranges++;
|
|
2104
|
+
block2.args = [];
|
|
2061
2105
|
continue;
|
|
2062
2106
|
}
|
|
2063
2107
|
if (prev.type === "range") {
|
|
@@ -2065,7 +2109,7 @@ var require_parse = __commonJS({
|
|
|
2065
2109
|
const before = siblings[siblings.length - 1];
|
|
2066
2110
|
before.value += prev.value + value;
|
|
2067
2111
|
prev = before;
|
|
2068
|
-
|
|
2112
|
+
block2.ranges--;
|
|
2069
2113
|
continue;
|
|
2070
2114
|
}
|
|
2071
2115
|
push({ type: "dot", value });
|
|
@@ -2074,9 +2118,9 @@ var require_parse = __commonJS({
|
|
|
2074
2118
|
push({ type: "text", value });
|
|
2075
2119
|
}
|
|
2076
2120
|
do {
|
|
2077
|
-
|
|
2078
|
-
if (
|
|
2079
|
-
|
|
2121
|
+
block2 = stack.pop();
|
|
2122
|
+
if (block2.type !== "root") {
|
|
2123
|
+
block2.nodes.forEach((node) => {
|
|
2080
2124
|
if (!node.nodes) {
|
|
2081
2125
|
if (node.type === "open") node.isOpen = true;
|
|
2082
2126
|
if (node.type === "close") node.isClose = true;
|
|
@@ -2085,8 +2129,8 @@ var require_parse = __commonJS({
|
|
|
2085
2129
|
}
|
|
2086
2130
|
});
|
|
2087
2131
|
const parent = stack[stack.length - 1];
|
|
2088
|
-
const index2 = parent.nodes.indexOf(
|
|
2089
|
-
parent.nodes.splice(index2, 1, ...
|
|
2132
|
+
const index2 = parent.nodes.indexOf(block2);
|
|
2133
|
+
parent.nodes.splice(index2, 1, ...block2.nodes);
|
|
2090
2134
|
}
|
|
2091
2135
|
} while (stack.length > 0);
|
|
2092
2136
|
push({ type: "eos" });
|
|
@@ -2719,9 +2763,9 @@ var require_scan = __commonJS({
|
|
|
2719
2763
|
if (opts.parts === true || opts.tokens === true) {
|
|
2720
2764
|
let prevIndex;
|
|
2721
2765
|
for (let idx = 0; idx < slashes.length; idx++) {
|
|
2722
|
-
const
|
|
2723
|
-
const
|
|
2724
|
-
const value = input.slice(
|
|
2766
|
+
const n2 = prevIndex ? prevIndex + 1 : start;
|
|
2767
|
+
const i2 = slashes[idx];
|
|
2768
|
+
const value = input.slice(n2, i2);
|
|
2725
2769
|
if (opts.tokens) {
|
|
2726
2770
|
if (idx === 0 && start !== 0) {
|
|
2727
2771
|
tokens[idx].isPrefix = true;
|
|
@@ -2735,7 +2779,7 @@ var require_scan = __commonJS({
|
|
|
2735
2779
|
if (idx !== 0 || value !== "") {
|
|
2736
2780
|
parts.push(value);
|
|
2737
2781
|
}
|
|
2738
|
-
prevIndex =
|
|
2782
|
+
prevIndex = i2;
|
|
2739
2783
|
}
|
|
2740
2784
|
if (prevIndex && prevIndex + 1 < input.length) {
|
|
2741
2785
|
const value = input.slice(prevIndex + 1);
|
|
@@ -2864,15 +2908,15 @@ var require_parse2 = __commonJS({
|
|
|
2864
2908
|
};
|
|
2865
2909
|
var hasRepeatedCharPrefixOverlap = (branches) => {
|
|
2866
2910
|
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
2867
|
-
for (let
|
|
2868
|
-
for (let j =
|
|
2869
|
-
const
|
|
2911
|
+
for (let i2 = 0; i2 < values.length; i2++) {
|
|
2912
|
+
for (let j = i2 + 1; j < values.length; j++) {
|
|
2913
|
+
const a2 = values[i2];
|
|
2870
2914
|
const b = values[j];
|
|
2871
|
-
const char =
|
|
2872
|
-
if (!char ||
|
|
2915
|
+
const char = a2[0];
|
|
2916
|
+
if (!char || a2 !== char.repeat(a2.length) || b !== char.repeat(b.length)) {
|
|
2873
2917
|
continue;
|
|
2874
2918
|
}
|
|
2875
|
-
if (
|
|
2919
|
+
if (a2 === b || a2.startsWith(b) || b.startsWith(a2)) {
|
|
2876
2920
|
return true;
|
|
2877
2921
|
}
|
|
2878
2922
|
}
|
|
@@ -2887,8 +2931,8 @@ var require_parse2 = __commonJS({
|
|
|
2887
2931
|
let paren = 0;
|
|
2888
2932
|
let quote = 0;
|
|
2889
2933
|
let escaped = false;
|
|
2890
|
-
for (let
|
|
2891
|
-
const ch = pattern[
|
|
2934
|
+
for (let i2 = 1; i2 < pattern.length; i2++) {
|
|
2935
|
+
const ch = pattern[i2];
|
|
2892
2936
|
if (escaped === true) {
|
|
2893
2937
|
escaped = false;
|
|
2894
2938
|
continue;
|
|
@@ -2922,13 +2966,13 @@ var require_parse2 = __commonJS({
|
|
|
2922
2966
|
if (ch === ")") {
|
|
2923
2967
|
paren--;
|
|
2924
2968
|
if (paren === 0) {
|
|
2925
|
-
if (requireEnd === true &&
|
|
2969
|
+
if (requireEnd === true && i2 !== pattern.length - 1) {
|
|
2926
2970
|
return;
|
|
2927
2971
|
}
|
|
2928
2972
|
return {
|
|
2929
2973
|
type: pattern[0],
|
|
2930
|
-
body: pattern.slice(2,
|
|
2931
|
-
end:
|
|
2974
|
+
body: pattern.slice(2, i2),
|
|
2975
|
+
end: i2
|
|
2932
2976
|
};
|
|
2933
2977
|
}
|
|
2934
2978
|
}
|
|
@@ -3060,7 +3104,7 @@ var require_parse2 = __commonJS({
|
|
|
3060
3104
|
let prev = bos;
|
|
3061
3105
|
let value;
|
|
3062
3106
|
const eos = () => state.index === len - 1;
|
|
3063
|
-
const peek = state.peek = (
|
|
3107
|
+
const peek = state.peek = (n2 = 1) => input[state.index + n2];
|
|
3064
3108
|
const advance = state.advance = () => input[++state.index] || "";
|
|
3065
3109
|
const remaining = () => input.slice(state.index + 1);
|
|
3066
3110
|
const consume = (value2 = "", num = 0) => {
|
|
@@ -3141,10 +3185,10 @@ var require_parse2 = __commonJS({
|
|
|
3141
3185
|
open.type = "text";
|
|
3142
3186
|
open.value = literal;
|
|
3143
3187
|
open.output = safeOutput || utils.escapeRegex(literal);
|
|
3144
|
-
for (let
|
|
3145
|
-
tokens[
|
|
3146
|
-
tokens[
|
|
3147
|
-
delete tokens[
|
|
3188
|
+
for (let i2 = token.tokensIndex + 1; i2 < tokens.length; i2++) {
|
|
3189
|
+
tokens[i2].value = "";
|
|
3190
|
+
tokens[i2].output = "";
|
|
3191
|
+
delete tokens[i2].suffix;
|
|
3148
3192
|
}
|
|
3149
3193
|
state.output = token.output + open.output;
|
|
3150
3194
|
state.backtrack = true;
|
|
@@ -3387,13 +3431,13 @@ var require_parse2 = __commonJS({
|
|
|
3387
3431
|
if (brace.dots === true) {
|
|
3388
3432
|
const arr = tokens.slice();
|
|
3389
3433
|
const range = [];
|
|
3390
|
-
for (let
|
|
3434
|
+
for (let i2 = arr.length - 1; i2 >= 0; i2--) {
|
|
3391
3435
|
tokens.pop();
|
|
3392
|
-
if (arr[
|
|
3436
|
+
if (arr[i2].type === "brace") {
|
|
3393
3437
|
break;
|
|
3394
3438
|
}
|
|
3395
|
-
if (arr[
|
|
3396
|
-
range.unshift(arr[
|
|
3439
|
+
if (arr[i2].type !== "dots") {
|
|
3440
|
+
range.unshift(arr[i2].value);
|
|
3397
3441
|
}
|
|
3398
3442
|
}
|
|
3399
3443
|
output = expandRange(range, opts);
|
|
@@ -3936,8 +3980,8 @@ var require_micromatch = __commonJS({
|
|
|
3936
3980
|
options.onResult(state);
|
|
3937
3981
|
}
|
|
3938
3982
|
};
|
|
3939
|
-
for (let
|
|
3940
|
-
let isMatch = picomatch(String(patterns[
|
|
3983
|
+
for (let i2 = 0; i2 < patterns.length; i2++) {
|
|
3984
|
+
let isMatch = picomatch(String(patterns[i2]), { ...options, onResult }, true);
|
|
3941
3985
|
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
|
|
3942
3986
|
if (negated) negatives++;
|
|
3943
3987
|
for (let item of list) {
|
|
@@ -4185,7 +4229,7 @@ var require_pattern = __commonJS({
|
|
|
4185
4229
|
exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
|
4186
4230
|
function expandBraceExpansion(pattern) {
|
|
4187
4231
|
const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });
|
|
4188
|
-
patterns.sort((
|
|
4232
|
+
patterns.sort((a2, b) => a2.length - b.length);
|
|
4189
4233
|
return patterns.filter((pattern2) => pattern2 !== "");
|
|
4190
4234
|
}
|
|
4191
4235
|
exports.expandBraceExpansion = expandBraceExpansion;
|
|
@@ -4266,8 +4310,8 @@ var require_merge2 = __commonJS({
|
|
|
4266
4310
|
}
|
|
4267
4311
|
const mergedStream = PassThrough(options);
|
|
4268
4312
|
function addStream() {
|
|
4269
|
-
for (let
|
|
4270
|
-
streamsQueue.push(pauseStreams(arguments[
|
|
4313
|
+
for (let i2 = 0, len = arguments.length; i2 < len; i2++) {
|
|
4314
|
+
streamsQueue.push(pauseStreams(arguments[i2], options));
|
|
4271
4315
|
}
|
|
4272
4316
|
mergeStream();
|
|
4273
4317
|
return this;
|
|
@@ -4316,8 +4360,8 @@ var require_merge2 = __commonJS({
|
|
|
4316
4360
|
stream.pipe(mergedStream, { end: false });
|
|
4317
4361
|
stream.resume();
|
|
4318
4362
|
}
|
|
4319
|
-
for (let
|
|
4320
|
-
pipe(streams[
|
|
4363
|
+
for (let i2 = 0; i2 < streams.length; i2++) {
|
|
4364
|
+
pipe(streams[i2]);
|
|
4321
4365
|
}
|
|
4322
4366
|
next();
|
|
4323
4367
|
}
|
|
@@ -4348,8 +4392,8 @@ var require_merge2 = __commonJS({
|
|
|
4348
4392
|
}
|
|
4349
4393
|
streams.pause();
|
|
4350
4394
|
} else {
|
|
4351
|
-
for (let
|
|
4352
|
-
streams[
|
|
4395
|
+
for (let i2 = 0, len = streams.length; i2 < len; i2++) {
|
|
4396
|
+
streams[i2] = pauseStreams(streams[i2], options);
|
|
4353
4397
|
}
|
|
4354
4398
|
}
|
|
4355
4399
|
return streams;
|
|
@@ -4431,13 +4475,13 @@ var require_tasks = __commonJS({
|
|
|
4431
4475
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4432
4476
|
exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
|
|
4433
4477
|
var utils = require_utils3();
|
|
4434
|
-
function generate(input,
|
|
4435
|
-
const patterns = processPatterns(input,
|
|
4436
|
-
const ignore = processPatterns(
|
|
4478
|
+
function generate(input, settings2) {
|
|
4479
|
+
const patterns = processPatterns(input, settings2);
|
|
4480
|
+
const ignore = processPatterns(settings2.ignore, settings2);
|
|
4437
4481
|
const positivePatterns = getPositivePatterns(patterns);
|
|
4438
4482
|
const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
|
|
4439
|
-
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern,
|
|
4440
|
-
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern,
|
|
4483
|
+
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings2));
|
|
4484
|
+
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings2));
|
|
4441
4485
|
const staticTasks = convertPatternsToTasks(
|
|
4442
4486
|
staticPatterns,
|
|
4443
4487
|
negativePatterns,
|
|
@@ -4453,12 +4497,12 @@ var require_tasks = __commonJS({
|
|
|
4453
4497
|
return staticTasks.concat(dynamicTasks);
|
|
4454
4498
|
}
|
|
4455
4499
|
exports.generate = generate;
|
|
4456
|
-
function processPatterns(input,
|
|
4500
|
+
function processPatterns(input, settings2) {
|
|
4457
4501
|
let patterns = input;
|
|
4458
|
-
if (
|
|
4502
|
+
if (settings2.braceExpansion) {
|
|
4459
4503
|
patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);
|
|
4460
4504
|
}
|
|
4461
|
-
if (
|
|
4505
|
+
if (settings2.baseNameMatch) {
|
|
4462
4506
|
patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`);
|
|
4463
4507
|
}
|
|
4464
4508
|
return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));
|
|
@@ -4527,26 +4571,26 @@ var require_async = __commonJS({
|
|
|
4527
4571
|
init_utils2();
|
|
4528
4572
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4529
4573
|
exports.read = void 0;
|
|
4530
|
-
function read(path,
|
|
4531
|
-
|
|
4574
|
+
function read(path, settings2, callback) {
|
|
4575
|
+
settings2.fs.lstat(path, (lstatError, lstat) => {
|
|
4532
4576
|
if (lstatError !== null) {
|
|
4533
4577
|
callFailureCallback(callback, lstatError);
|
|
4534
4578
|
return;
|
|
4535
4579
|
}
|
|
4536
|
-
if (!lstat.isSymbolicLink() || !
|
|
4580
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
4537
4581
|
callSuccessCallback(callback, lstat);
|
|
4538
4582
|
return;
|
|
4539
4583
|
}
|
|
4540
|
-
|
|
4584
|
+
settings2.fs.stat(path, (statError, stat) => {
|
|
4541
4585
|
if (statError !== null) {
|
|
4542
|
-
if (
|
|
4586
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4543
4587
|
callFailureCallback(callback, statError);
|
|
4544
4588
|
return;
|
|
4545
4589
|
}
|
|
4546
4590
|
callSuccessCallback(callback, lstat);
|
|
4547
4591
|
return;
|
|
4548
4592
|
}
|
|
4549
|
-
if (
|
|
4593
|
+
if (settings2.markSymbolicLink) {
|
|
4550
4594
|
stat.isSymbolicLink = () => true;
|
|
4551
4595
|
}
|
|
4552
4596
|
callSuccessCallback(callback, stat);
|
|
@@ -4570,19 +4614,19 @@ var require_sync = __commonJS({
|
|
|
4570
4614
|
init_utils2();
|
|
4571
4615
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4572
4616
|
exports.read = void 0;
|
|
4573
|
-
function read(path,
|
|
4574
|
-
const lstat =
|
|
4575
|
-
if (!lstat.isSymbolicLink() || !
|
|
4617
|
+
function read(path, settings2) {
|
|
4618
|
+
const lstat = settings2.fs.lstatSync(path);
|
|
4619
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
4576
4620
|
return lstat;
|
|
4577
4621
|
}
|
|
4578
4622
|
try {
|
|
4579
|
-
const stat =
|
|
4580
|
-
if (
|
|
4623
|
+
const stat = settings2.fs.statSync(path);
|
|
4624
|
+
if (settings2.markSymbolicLink) {
|
|
4581
4625
|
stat.isSymbolicLink = () => true;
|
|
4582
4626
|
}
|
|
4583
4627
|
return stat;
|
|
4584
4628
|
} catch (error2) {
|
|
4585
|
-
if (!
|
|
4629
|
+
if (!settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4586
4630
|
return lstat;
|
|
4587
4631
|
}
|
|
4588
4632
|
throw error2;
|
|
@@ -4659,8 +4703,8 @@ var require_out = __commonJS({
|
|
|
4659
4703
|
}
|
|
4660
4704
|
exports.stat = stat;
|
|
4661
4705
|
function statSync2(path, optionsOrSettings) {
|
|
4662
|
-
const
|
|
4663
|
-
return sync.read(path,
|
|
4706
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
4707
|
+
return sync.read(path, settings2);
|
|
4664
4708
|
}
|
|
4665
4709
|
exports.statSync = statSync2;
|
|
4666
4710
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -4708,8 +4752,8 @@ var require_run_parallel = __commonJS({
|
|
|
4708
4752
|
if (isSync) queueMicrotask2(end);
|
|
4709
4753
|
else end();
|
|
4710
4754
|
}
|
|
4711
|
-
function each(
|
|
4712
|
-
results[
|
|
4755
|
+
function each(i2, err, result) {
|
|
4756
|
+
results[i2] = result;
|
|
4713
4757
|
if (--pending === 0 || err) {
|
|
4714
4758
|
done(err);
|
|
4715
4759
|
}
|
|
@@ -4723,9 +4767,9 @@ var require_run_parallel = __commonJS({
|
|
|
4723
4767
|
});
|
|
4724
4768
|
});
|
|
4725
4769
|
} else {
|
|
4726
|
-
tasks.forEach(function(task,
|
|
4770
|
+
tasks.forEach(function(task, i2) {
|
|
4727
4771
|
task(function(err, result) {
|
|
4728
|
-
each(
|
|
4772
|
+
each(i2, err, result);
|
|
4729
4773
|
});
|
|
4730
4774
|
});
|
|
4731
4775
|
}
|
|
@@ -4800,11 +4844,11 @@ var require_common = __commonJS({
|
|
|
4800
4844
|
init_utils2();
|
|
4801
4845
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4802
4846
|
exports.joinPathSegments = void 0;
|
|
4803
|
-
function joinPathSegments(
|
|
4804
|
-
if (
|
|
4805
|
-
return
|
|
4847
|
+
function joinPathSegments(a2, b, separator) {
|
|
4848
|
+
if (a2.endsWith(separator)) {
|
|
4849
|
+
return a2 + b;
|
|
4806
4850
|
}
|
|
4807
|
-
return
|
|
4851
|
+
return a2 + separator + b;
|
|
4808
4852
|
}
|
|
4809
4853
|
exports.joinPathSegments = joinPathSegments;
|
|
4810
4854
|
}
|
|
@@ -4822,16 +4866,16 @@ var require_async2 = __commonJS({
|
|
|
4822
4866
|
var constants_1 = require_constants3();
|
|
4823
4867
|
var utils = require_utils4();
|
|
4824
4868
|
var common = require_common();
|
|
4825
|
-
function read(directory,
|
|
4826
|
-
if (!
|
|
4827
|
-
readdirWithFileTypes(directory,
|
|
4869
|
+
function read(directory, settings2, callback) {
|
|
4870
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
4871
|
+
readdirWithFileTypes(directory, settings2, callback);
|
|
4828
4872
|
return;
|
|
4829
4873
|
}
|
|
4830
|
-
readdir(directory,
|
|
4874
|
+
readdir(directory, settings2, callback);
|
|
4831
4875
|
}
|
|
4832
4876
|
exports.read = read;
|
|
4833
|
-
function readdirWithFileTypes(directory,
|
|
4834
|
-
|
|
4877
|
+
function readdirWithFileTypes(directory, settings2, callback) {
|
|
4878
|
+
settings2.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
|
|
4835
4879
|
if (readdirError !== null) {
|
|
4836
4880
|
callFailureCallback(callback, readdirError);
|
|
4837
4881
|
return;
|
|
@@ -4839,13 +4883,13 @@ var require_async2 = __commonJS({
|
|
|
4839
4883
|
const entries = dirents.map((dirent) => ({
|
|
4840
4884
|
dirent,
|
|
4841
4885
|
name: dirent.name,
|
|
4842
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
4886
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
4843
4887
|
}));
|
|
4844
|
-
if (!
|
|
4888
|
+
if (!settings2.followSymbolicLinks) {
|
|
4845
4889
|
callSuccessCallback(callback, entries);
|
|
4846
4890
|
return;
|
|
4847
4891
|
}
|
|
4848
|
-
const tasks = entries.map((entry) => makeRplTaskEntry(entry,
|
|
4892
|
+
const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings2));
|
|
4849
4893
|
rpl(tasks, (rplError, rplEntries) => {
|
|
4850
4894
|
if (rplError !== null) {
|
|
4851
4895
|
callFailureCallback(callback, rplError);
|
|
@@ -4856,15 +4900,15 @@ var require_async2 = __commonJS({
|
|
|
4856
4900
|
});
|
|
4857
4901
|
}
|
|
4858
4902
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
4859
|
-
function makeRplTaskEntry(entry,
|
|
4903
|
+
function makeRplTaskEntry(entry, settings2) {
|
|
4860
4904
|
return (done) => {
|
|
4861
4905
|
if (!entry.dirent.isSymbolicLink()) {
|
|
4862
4906
|
done(null, entry);
|
|
4863
4907
|
return;
|
|
4864
4908
|
}
|
|
4865
|
-
|
|
4909
|
+
settings2.fs.stat(entry.path, (statError, stats) => {
|
|
4866
4910
|
if (statError !== null) {
|
|
4867
|
-
if (
|
|
4911
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4868
4912
|
done(statError);
|
|
4869
4913
|
return;
|
|
4870
4914
|
}
|
|
@@ -4876,16 +4920,16 @@ var require_async2 = __commonJS({
|
|
|
4876
4920
|
});
|
|
4877
4921
|
};
|
|
4878
4922
|
}
|
|
4879
|
-
function readdir(directory,
|
|
4880
|
-
|
|
4923
|
+
function readdir(directory, settings2, callback) {
|
|
4924
|
+
settings2.fs.readdir(directory, (readdirError, names) => {
|
|
4881
4925
|
if (readdirError !== null) {
|
|
4882
4926
|
callFailureCallback(callback, readdirError);
|
|
4883
4927
|
return;
|
|
4884
4928
|
}
|
|
4885
4929
|
const tasks = names.map((name) => {
|
|
4886
|
-
const path = common.joinPathSegments(directory, name,
|
|
4930
|
+
const path = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
4887
4931
|
return (done) => {
|
|
4888
|
-
fsStat.stat(path,
|
|
4932
|
+
fsStat.stat(path, settings2.fsStatSettings, (error2, stats) => {
|
|
4889
4933
|
if (error2 !== null) {
|
|
4890
4934
|
done(error2);
|
|
4891
4935
|
return;
|
|
@@ -4895,7 +4939,7 @@ var require_async2 = __commonJS({
|
|
|
4895
4939
|
path,
|
|
4896
4940
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
4897
4941
|
};
|
|
4898
|
-
if (
|
|
4942
|
+
if (settings2.stats) {
|
|
4899
4943
|
entry.stats = stats;
|
|
4900
4944
|
}
|
|
4901
4945
|
done(null, entry);
|
|
@@ -4932,27 +4976,27 @@ var require_sync2 = __commonJS({
|
|
|
4932
4976
|
var constants_1 = require_constants3();
|
|
4933
4977
|
var utils = require_utils4();
|
|
4934
4978
|
var common = require_common();
|
|
4935
|
-
function read(directory,
|
|
4936
|
-
if (!
|
|
4937
|
-
return readdirWithFileTypes(directory,
|
|
4979
|
+
function read(directory, settings2) {
|
|
4980
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
4981
|
+
return readdirWithFileTypes(directory, settings2);
|
|
4938
4982
|
}
|
|
4939
|
-
return readdir(directory,
|
|
4983
|
+
return readdir(directory, settings2);
|
|
4940
4984
|
}
|
|
4941
4985
|
exports.read = read;
|
|
4942
|
-
function readdirWithFileTypes(directory,
|
|
4943
|
-
const dirents =
|
|
4986
|
+
function readdirWithFileTypes(directory, settings2) {
|
|
4987
|
+
const dirents = settings2.fs.readdirSync(directory, { withFileTypes: true });
|
|
4944
4988
|
return dirents.map((dirent) => {
|
|
4945
4989
|
const entry = {
|
|
4946
4990
|
dirent,
|
|
4947
4991
|
name: dirent.name,
|
|
4948
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
4992
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
4949
4993
|
};
|
|
4950
|
-
if (entry.dirent.isSymbolicLink() &&
|
|
4994
|
+
if (entry.dirent.isSymbolicLink() && settings2.followSymbolicLinks) {
|
|
4951
4995
|
try {
|
|
4952
|
-
const stats =
|
|
4996
|
+
const stats = settings2.fs.statSync(entry.path);
|
|
4953
4997
|
entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
|
4954
4998
|
} catch (error2) {
|
|
4955
|
-
if (
|
|
4999
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4956
5000
|
throw error2;
|
|
4957
5001
|
}
|
|
4958
5002
|
}
|
|
@@ -4961,17 +5005,17 @@ var require_sync2 = __commonJS({
|
|
|
4961
5005
|
});
|
|
4962
5006
|
}
|
|
4963
5007
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
4964
|
-
function readdir(directory,
|
|
4965
|
-
const names =
|
|
5008
|
+
function readdir(directory, settings2) {
|
|
5009
|
+
const names = settings2.fs.readdirSync(directory);
|
|
4966
5010
|
return names.map((name) => {
|
|
4967
|
-
const entryPath = common.joinPathSegments(directory, name,
|
|
4968
|
-
const stats = fsStat.statSync(entryPath,
|
|
5011
|
+
const entryPath = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
5012
|
+
const stats = fsStat.statSync(entryPath, settings2.fsStatSettings);
|
|
4969
5013
|
const entry = {
|
|
4970
5014
|
name,
|
|
4971
5015
|
path: entryPath,
|
|
4972
5016
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
4973
5017
|
};
|
|
4974
|
-
if (
|
|
5018
|
+
if (settings2.stats) {
|
|
4975
5019
|
entry.stats = stats;
|
|
4976
5020
|
}
|
|
4977
5021
|
return entry;
|
|
@@ -5058,8 +5102,8 @@ var require_out2 = __commonJS({
|
|
|
5058
5102
|
}
|
|
5059
5103
|
exports.scandir = scandir;
|
|
5060
5104
|
function scandirSync(path, optionsOrSettings) {
|
|
5061
|
-
const
|
|
5062
|
-
return sync.read(path,
|
|
5105
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5106
|
+
return sync.read(path, settings2);
|
|
5063
5107
|
}
|
|
5064
5108
|
exports.scandirSync = scandirSync;
|
|
5065
5109
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -5395,11 +5439,11 @@ var require_common2 = __commonJS({
|
|
|
5395
5439
|
init_utils2();
|
|
5396
5440
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5397
5441
|
exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
|
|
5398
|
-
function isFatalError(
|
|
5399
|
-
if (
|
|
5442
|
+
function isFatalError(settings2, error2) {
|
|
5443
|
+
if (settings2.errorFilter === null) {
|
|
5400
5444
|
return true;
|
|
5401
5445
|
}
|
|
5402
|
-
return !
|
|
5446
|
+
return !settings2.errorFilter(error2);
|
|
5403
5447
|
}
|
|
5404
5448
|
exports.isFatalError = isFatalError;
|
|
5405
5449
|
function isAppliedFilter(filter, value) {
|
|
@@ -5410,14 +5454,14 @@ var require_common2 = __commonJS({
|
|
|
5410
5454
|
return filepath.split(/[/\\]/).join(separator);
|
|
5411
5455
|
}
|
|
5412
5456
|
exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
|
|
5413
|
-
function joinPathSegments(
|
|
5414
|
-
if (
|
|
5457
|
+
function joinPathSegments(a2, b, separator) {
|
|
5458
|
+
if (a2 === "") {
|
|
5415
5459
|
return b;
|
|
5416
5460
|
}
|
|
5417
|
-
if (
|
|
5418
|
-
return
|
|
5461
|
+
if (a2.endsWith(separator)) {
|
|
5462
|
+
return a2 + b;
|
|
5419
5463
|
}
|
|
5420
|
-
return
|
|
5464
|
+
return a2 + separator + b;
|
|
5421
5465
|
}
|
|
5422
5466
|
exports.joinPathSegments = joinPathSegments;
|
|
5423
5467
|
}
|
|
@@ -5764,14 +5808,14 @@ var require_out3 = __commonJS({
|
|
|
5764
5808
|
}
|
|
5765
5809
|
exports.walk = walk;
|
|
5766
5810
|
function walkSync(directory, optionsOrSettings) {
|
|
5767
|
-
const
|
|
5768
|
-
const provider = new sync_1.default(directory,
|
|
5811
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5812
|
+
const provider = new sync_1.default(directory, settings2);
|
|
5769
5813
|
return provider.read();
|
|
5770
5814
|
}
|
|
5771
5815
|
exports.walkSync = walkSync;
|
|
5772
5816
|
function walkStream(directory, optionsOrSettings) {
|
|
5773
|
-
const
|
|
5774
|
-
const provider = new stream_1.default(directory,
|
|
5817
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5818
|
+
const provider = new stream_1.default(directory, settings2);
|
|
5775
5819
|
return provider.read();
|
|
5776
5820
|
}
|
|
5777
5821
|
exports.walkStream = walkStream;
|
|
@@ -5857,8 +5901,8 @@ var require_stream3 = __commonJS({
|
|
|
5857
5901
|
done();
|
|
5858
5902
|
}).catch(done);
|
|
5859
5903
|
};
|
|
5860
|
-
for (let
|
|
5861
|
-
stream.write(
|
|
5904
|
+
for (let i2 = 0; i2 < filepaths.length; i2++) {
|
|
5905
|
+
stream.write(i2);
|
|
5862
5906
|
}
|
|
5863
5907
|
return stream;
|
|
5864
5908
|
}
|
|
@@ -6519,14 +6563,14 @@ var require_out4 = __commonJS({
|
|
|
6519
6563
|
function generateTasks(source, options) {
|
|
6520
6564
|
assertPatternsInput(source);
|
|
6521
6565
|
const patterns = [].concat(source);
|
|
6522
|
-
const
|
|
6523
|
-
return taskManager.generate(patterns,
|
|
6566
|
+
const settings2 = new settings_1.default(options);
|
|
6567
|
+
return taskManager.generate(patterns, settings2);
|
|
6524
6568
|
}
|
|
6525
6569
|
FastGlob2.generateTasks = generateTasks;
|
|
6526
6570
|
function isDynamicPattern(source, options) {
|
|
6527
6571
|
assertPatternsInput(source);
|
|
6528
|
-
const
|
|
6529
|
-
return utils.pattern.isDynamicPattern(source,
|
|
6572
|
+
const settings2 = new settings_1.default(options);
|
|
6573
|
+
return utils.pattern.isDynamicPattern(source, settings2);
|
|
6530
6574
|
}
|
|
6531
6575
|
FastGlob2.isDynamicPattern = isDynamicPattern;
|
|
6532
6576
|
function escapePath(source) {
|
|
@@ -6568,9 +6612,9 @@ var require_out4 = __commonJS({
|
|
|
6568
6612
|
})(FastGlob || (FastGlob = {}));
|
|
6569
6613
|
function getWorks(source, _Provider, options) {
|
|
6570
6614
|
const patterns = [].concat(source);
|
|
6571
|
-
const
|
|
6572
|
-
const tasks = taskManager.generate(patterns,
|
|
6573
|
-
const provider = new _Provider(
|
|
6615
|
+
const settings2 = new settings_1.default(options);
|
|
6616
|
+
const tasks = taskManager.generate(patterns, settings2);
|
|
6617
|
+
const provider = new _Provider(settings2);
|
|
6574
6618
|
return tasks.map(provider.read, provider);
|
|
6575
6619
|
}
|
|
6576
6620
|
function assertPatternsInput(input) {
|
|
@@ -6748,8 +6792,8 @@ import "node:fs";
|
|
|
6748
6792
|
import { createRequire } from "node:module";
|
|
6749
6793
|
import {
|
|
6750
6794
|
resolve,
|
|
6751
|
-
join,
|
|
6752
|
-
dirname,
|
|
6795
|
+
join as join2,
|
|
6796
|
+
dirname as dirname2,
|
|
6753
6797
|
relative,
|
|
6754
6798
|
normalize,
|
|
6755
6799
|
sep,
|
|
@@ -6763,7 +6807,7 @@ function safeExecuteAsync(fn, message) {
|
|
|
6763
6807
|
);
|
|
6764
6808
|
});
|
|
6765
6809
|
}
|
|
6766
|
-
var import_fast_glob, constants,
|
|
6810
|
+
var import_fast_glob, constants, log3, PACKAGE_PATHS, PathResolver;
|
|
6767
6811
|
var init_PathResolver = __esm({
|
|
6768
6812
|
"packages/core/config/utils/PathResolver.ts"() {
|
|
6769
6813
|
"use strict";
|
|
@@ -6776,7 +6820,7 @@ var init_PathResolver = __esm({
|
|
|
6776
6820
|
getPatternsFor: getPatternsFor || void 0,
|
|
6777
6821
|
I18N_PATHS: I18N_PATHS || void 0
|
|
6778
6822
|
};
|
|
6779
|
-
|
|
6823
|
+
log3 = {
|
|
6780
6824
|
error: (message, error2) => {
|
|
6781
6825
|
},
|
|
6782
6826
|
warn: (message, error2) => {
|
|
@@ -6897,7 +6941,7 @@ var init_PathResolver = __esm({
|
|
|
6897
6941
|
*/
|
|
6898
6942
|
getDirname(path) {
|
|
6899
6943
|
if (!path) return "";
|
|
6900
|
-
return this.normalizePath(
|
|
6944
|
+
return this.normalizePath(dirname2(path));
|
|
6901
6945
|
}
|
|
6902
6946
|
/**
|
|
6903
6947
|
* Resolve package path using Node's module resolution
|
|
@@ -6909,7 +6953,7 @@ var init_PathResolver = __esm({
|
|
|
6909
6953
|
resolvePackage(packageSpecifier, fromPath = null) {
|
|
6910
6954
|
try {
|
|
6911
6955
|
const basePath = fromPath || this.getAppRoot();
|
|
6912
|
-
const require3 = createRequire(
|
|
6956
|
+
const require3 = createRequire(join2(basePath, "package.json"));
|
|
6913
6957
|
const resolved = require3.resolve(packageSpecifier);
|
|
6914
6958
|
return this.normalizePath(resolved);
|
|
6915
6959
|
} catch (error2) {
|
|
@@ -7061,7 +7105,7 @@ var init_PathResolver = __esm({
|
|
|
7061
7105
|
return cleanContent;
|
|
7062
7106
|
} catch (error2) {
|
|
7063
7107
|
if (this.options.debug) {
|
|
7064
|
-
|
|
7108
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
7065
7109
|
}
|
|
7066
7110
|
return null;
|
|
7067
7111
|
}
|
|
@@ -7089,7 +7133,7 @@ var init_PathResolver = __esm({
|
|
|
7089
7133
|
return cleanContent;
|
|
7090
7134
|
} catch (error2) {
|
|
7091
7135
|
if (this.options.debug) {
|
|
7092
|
-
|
|
7136
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
7093
7137
|
}
|
|
7094
7138
|
return null;
|
|
7095
7139
|
}
|
|
@@ -7111,16 +7155,16 @@ var init_PathResolver = __esm({
|
|
|
7111
7155
|
verbose = false
|
|
7112
7156
|
} = options;
|
|
7113
7157
|
const normalizedPath = this.normalizePath(filePath);
|
|
7114
|
-
const dir = this.normalizePath(
|
|
7158
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
7115
7159
|
const fileExists = this.pathExists(normalizedPath);
|
|
7116
7160
|
if (fileExists && !overwrite) {
|
|
7117
7161
|
if (verbose) {
|
|
7118
|
-
|
|
7162
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
7119
7163
|
}
|
|
7120
7164
|
return false;
|
|
7121
7165
|
}
|
|
7122
7166
|
if (dryRun) {
|
|
7123
|
-
|
|
7167
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
7124
7168
|
return true;
|
|
7125
7169
|
}
|
|
7126
7170
|
try {
|
|
@@ -7145,7 +7189,7 @@ var init_PathResolver = __esm({
|
|
|
7145
7189
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
7146
7190
|
}
|
|
7147
7191
|
if (verbose) {
|
|
7148
|
-
|
|
7192
|
+
log3.info(
|
|
7149
7193
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
7150
7194
|
);
|
|
7151
7195
|
}
|
|
@@ -7172,16 +7216,16 @@ var init_PathResolver = __esm({
|
|
|
7172
7216
|
verbose = false
|
|
7173
7217
|
} = options;
|
|
7174
7218
|
const normalizedPath = this.normalizePath(filePath);
|
|
7175
|
-
const dir = this.normalizePath(
|
|
7219
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
7176
7220
|
const fileExists = this.pathExists(normalizedPath);
|
|
7177
7221
|
if (fileExists && !overwrite) {
|
|
7178
7222
|
if (verbose) {
|
|
7179
|
-
|
|
7223
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
7180
7224
|
}
|
|
7181
7225
|
return false;
|
|
7182
7226
|
}
|
|
7183
7227
|
if (dryRun) {
|
|
7184
|
-
|
|
7228
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
7185
7229
|
return true;
|
|
7186
7230
|
}
|
|
7187
7231
|
try {
|
|
@@ -7205,7 +7249,7 @@ var init_PathResolver = __esm({
|
|
|
7205
7249
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
7206
7250
|
}
|
|
7207
7251
|
if (verbose) {
|
|
7208
|
-
|
|
7252
|
+
log3.info(
|
|
7209
7253
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
7210
7254
|
);
|
|
7211
7255
|
}
|
|
@@ -7230,15 +7274,15 @@ var init_PathResolver = __esm({
|
|
|
7230
7274
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7231
7275
|
if (fileExists && !overwrite) {
|
|
7232
7276
|
if (verbose) {
|
|
7233
|
-
|
|
7277
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7234
7278
|
}
|
|
7235
7279
|
return false;
|
|
7236
7280
|
}
|
|
7237
7281
|
if (dryRun) {
|
|
7238
|
-
|
|
7282
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7239
7283
|
return true;
|
|
7240
7284
|
}
|
|
7241
|
-
const dir = this.normalizePath(
|
|
7285
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7242
7286
|
try {
|
|
7243
7287
|
await fs.promises.mkdir(dir, { recursive: true });
|
|
7244
7288
|
} catch (error2) {
|
|
@@ -7248,7 +7292,7 @@ var init_PathResolver = __esm({
|
|
|
7248
7292
|
return await safeExecuteAsync(async () => {
|
|
7249
7293
|
await fs.promises.copyFile(srcPath, normalizedDestPath);
|
|
7250
7294
|
if (verbose) {
|
|
7251
|
-
|
|
7295
|
+
log3.info(
|
|
7252
7296
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7253
7297
|
);
|
|
7254
7298
|
}
|
|
@@ -7272,15 +7316,15 @@ var init_PathResolver = __esm({
|
|
|
7272
7316
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7273
7317
|
if (fileExists && !overwrite) {
|
|
7274
7318
|
if (verbose) {
|
|
7275
|
-
|
|
7319
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7276
7320
|
}
|
|
7277
7321
|
return false;
|
|
7278
7322
|
}
|
|
7279
7323
|
if (dryRun) {
|
|
7280
|
-
|
|
7324
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7281
7325
|
return true;
|
|
7282
7326
|
}
|
|
7283
|
-
const dir = this.normalizePath(
|
|
7327
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7284
7328
|
try {
|
|
7285
7329
|
fs.mkdirSync(dir, { recursive: true });
|
|
7286
7330
|
} catch (error2) {
|
|
@@ -7289,7 +7333,7 @@ var init_PathResolver = __esm({
|
|
|
7289
7333
|
try {
|
|
7290
7334
|
fs.copyFileSync(srcPath, normalizedDestPath);
|
|
7291
7335
|
if (verbose) {
|
|
7292
|
-
|
|
7336
|
+
log3.info(
|
|
7293
7337
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7294
7338
|
);
|
|
7295
7339
|
}
|
|
@@ -7306,7 +7350,7 @@ var init_PathResolver = __esm({
|
|
|
7306
7350
|
return fs.existsSync(filePath);
|
|
7307
7351
|
} catch (error2) {
|
|
7308
7352
|
if (!silent) {
|
|
7309
|
-
|
|
7353
|
+
log3.error(`Error checking path existence: ${filePath}`, error2);
|
|
7310
7354
|
}
|
|
7311
7355
|
return false;
|
|
7312
7356
|
}
|
|
@@ -7332,7 +7376,7 @@ var init_PathResolver = __esm({
|
|
|
7332
7376
|
return fs.readdirSync(dirPath, options);
|
|
7333
7377
|
} catch (error2) {
|
|
7334
7378
|
if (this.options.debug) {
|
|
7335
|
-
|
|
7379
|
+
log3.warn(`Failed to read directory: ${dirPath}`, error2);
|
|
7336
7380
|
}
|
|
7337
7381
|
const isObjectOptions = options && typeof options === "object" && "withFileTypes" in options;
|
|
7338
7382
|
return isObjectOptions && options.withFileTypes ? [] : [];
|
|
@@ -7350,7 +7394,7 @@ var init_PathResolver = __esm({
|
|
|
7350
7394
|
return fs.statSync(filePath);
|
|
7351
7395
|
} catch (error2) {
|
|
7352
7396
|
if (this.options.debug) {
|
|
7353
|
-
|
|
7397
|
+
log3.warn(`Failed to stat file: ${filePath}`, error2);
|
|
7354
7398
|
}
|
|
7355
7399
|
return null;
|
|
7356
7400
|
}
|
|
@@ -7367,7 +7411,7 @@ var init_PathResolver = __esm({
|
|
|
7367
7411
|
return fs.lstatSync(filePath);
|
|
7368
7412
|
} catch (error2) {
|
|
7369
7413
|
if (this.options.debug) {
|
|
7370
|
-
|
|
7414
|
+
log3.warn(`Failed to lstat file: ${filePath}`, error2);
|
|
7371
7415
|
}
|
|
7372
7416
|
return null;
|
|
7373
7417
|
}
|
|
@@ -7456,7 +7500,7 @@ var init_PathResolver = __esm({
|
|
|
7456
7500
|
* @returns True if repoRoot is the monorepo (has packages directory)
|
|
7457
7501
|
*/
|
|
7458
7502
|
isMonorepo() {
|
|
7459
|
-
const packagesDir =
|
|
7503
|
+
const packagesDir = join2(this._repoRoot, "packages");
|
|
7460
7504
|
return this.pathExists(packagesDir);
|
|
7461
7505
|
}
|
|
7462
7506
|
/**
|
|
@@ -7473,7 +7517,7 @@ var init_PathResolver = __esm({
|
|
|
7473
7517
|
* Find files matching pattern within directory
|
|
7474
7518
|
*/
|
|
7475
7519
|
async findFiles(directory, pattern, options = {}) {
|
|
7476
|
-
const searchPattern = this.normalizePath(
|
|
7520
|
+
const searchPattern = this.normalizePath(join2(directory, pattern));
|
|
7477
7521
|
const appRoot = this.getAppRoot();
|
|
7478
7522
|
const normalizeAppRoot = this.normalizePath(appRoot);
|
|
7479
7523
|
const relativePattern = searchPattern.startsWith(normalizeAppRoot) ? searchPattern.slice(normalizeAppRoot.length + 1) : searchPattern;
|
|
@@ -7520,7 +7564,7 @@ var init_PathResolver = __esm({
|
|
|
7520
7564
|
return null;
|
|
7521
7565
|
}
|
|
7522
7566
|
const resolvedPath = this.normalizePath(
|
|
7523
|
-
|
|
7567
|
+
join2(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
|
|
7524
7568
|
);
|
|
7525
7569
|
const resolvedDir = resolvedPath.replace(/\/[^/]*\*.*$/, "");
|
|
7526
7570
|
if (this.pathExists(resolvedDir)) {
|
|
@@ -7716,13 +7760,13 @@ var init_PathResolver = __esm({
|
|
|
7716
7760
|
const maxLevels = this.options.maxLevels;
|
|
7717
7761
|
while (levelsChecked < maxLevels) {
|
|
7718
7762
|
const toolingPath = this.normalizePath(
|
|
7719
|
-
|
|
7763
|
+
join2(currentDir, PACKAGE_PATHS.TOOLING)
|
|
7720
7764
|
);
|
|
7721
|
-
const corePath = this.normalizePath(
|
|
7765
|
+
const corePath = this.normalizePath(join2(currentDir, PACKAGE_PATHS.CORE));
|
|
7722
7766
|
if (this.pathExists(toolingPath) && this.pathExists(corePath)) {
|
|
7723
7767
|
return currentDir;
|
|
7724
7768
|
}
|
|
7725
|
-
const appsDir =
|
|
7769
|
+
const appsDir = join2(currentDir, "apps");
|
|
7726
7770
|
if (this.pathExists(appsDir)) {
|
|
7727
7771
|
const appsDirStat = this.statSync(appsDir);
|
|
7728
7772
|
if (appsDirStat?.isDirectory()) {
|
|
@@ -7730,15 +7774,15 @@ var init_PathResolver = __esm({
|
|
|
7730
7774
|
}
|
|
7731
7775
|
}
|
|
7732
7776
|
const packageJsonPath = this.normalizePath(
|
|
7733
|
-
|
|
7777
|
+
join2(currentDir, "package.json")
|
|
7734
7778
|
);
|
|
7735
7779
|
if (this.pathExists(packageJsonPath)) {
|
|
7736
|
-
const parentDir2 = this.normalizePath(
|
|
7780
|
+
const parentDir2 = this.normalizePath(dirname2(currentDir));
|
|
7737
7781
|
if (parentDir2 === currentDir) {
|
|
7738
7782
|
return currentDir;
|
|
7739
7783
|
}
|
|
7740
7784
|
}
|
|
7741
|
-
const parentDir = this.normalizePath(
|
|
7785
|
+
const parentDir = this.normalizePath(dirname2(currentDir));
|
|
7742
7786
|
if (parentDir === currentDir) {
|
|
7743
7787
|
break;
|
|
7744
7788
|
}
|
|
@@ -7754,8 +7798,8 @@ var init_PathResolver = __esm({
|
|
|
7754
7798
|
// packages/tooling/src/utils/pathResolver.ts
|
|
7755
7799
|
import { createRequire as createRequire2 } from "node:module";
|
|
7756
7800
|
import {
|
|
7757
|
-
join as
|
|
7758
|
-
dirname as
|
|
7801
|
+
join as join3,
|
|
7802
|
+
dirname as dirname3,
|
|
7759
7803
|
basename as basename2,
|
|
7760
7804
|
extname as extname2,
|
|
7761
7805
|
relative as relative2,
|
|
@@ -7772,14 +7816,14 @@ var init_pathResolver = __esm({
|
|
|
7772
7816
|
init_PathResolver();
|
|
7773
7817
|
pathResolverInstance = PathResolver.getInstance({ debug: false });
|
|
7774
7818
|
normalizePath = (...pathSegments) => {
|
|
7775
|
-
return pathResolverInstance.normalizePath(
|
|
7819
|
+
return pathResolverInstance.normalizePath(join3(...pathSegments));
|
|
7776
7820
|
};
|
|
7777
7821
|
pathExists = (filePath, silent = false) => pathResolverInstance.pathExists(filePath, silent);
|
|
7778
7822
|
readSync = (filePath, options) => pathResolverInstance.readSync(filePath, options);
|
|
7779
7823
|
writeSync = (filePath, content, options) => pathResolverInstance.writeSync(filePath, content, options);
|
|
7780
7824
|
ensureDirSync = (dirPath) => pathResolverInstance.ensureDirSync(dirPath);
|
|
7781
7825
|
getDirname = (filePath) => {
|
|
7782
|
-
return normalizePath(
|
|
7826
|
+
return normalizePath(dirname3(filePath));
|
|
7783
7827
|
};
|
|
7784
7828
|
joinPath = (...pathSegments) => {
|
|
7785
7829
|
return normalizePath(...pathSegments);
|
|
@@ -7791,7 +7835,7 @@ var init_pathResolver = __esm({
|
|
|
7791
7835
|
import { Buffer } from "node:buffer";
|
|
7792
7836
|
import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
7793
7837
|
import { createRequire as createRequire3 } from "node:module";
|
|
7794
|
-
import { dirname as
|
|
7838
|
+
import { dirname as dirname4, resolve as resolve3 } from "node:path";
|
|
7795
7839
|
import process from "node:process";
|
|
7796
7840
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
7797
7841
|
var require2, __filename, __dirname;
|
|
@@ -7800,7 +7844,7 @@ var init_utils2 = __esm({
|
|
|
7800
7844
|
"use strict";
|
|
7801
7845
|
require2 = createRequire3(import.meta.url);
|
|
7802
7846
|
__filename = fileURLToPath3(import.meta.url);
|
|
7803
|
-
__dirname =
|
|
7847
|
+
__dirname = dirname4(__filename);
|
|
7804
7848
|
if (typeof globalThis !== "undefined") {
|
|
7805
7849
|
globalThis.require = require2;
|
|
7806
7850
|
globalThis.__filename = __filename;
|
|
@@ -7845,51 +7889,51 @@ function writeJsonConfig(filePath, data) {
|
|
|
7845
7889
|
writeSync(filePath, data, { overwrite: true });
|
|
7846
7890
|
}
|
|
7847
7891
|
async function main(options = {}) {
|
|
7848
|
-
|
|
7892
|
+
intro("DoNotDev Agent Setup");
|
|
7849
7893
|
const cwd = process.cwd();
|
|
7850
7894
|
const isWindows = process.platform === "win32";
|
|
7851
7895
|
const isMac = process.platform === "darwin";
|
|
7852
7896
|
const homeDir = process.env.HOME || process.env.USERPROFILE || "";
|
|
7853
7897
|
const mcpJsonPath = joinPath(cwd, ".mcp.json");
|
|
7854
7898
|
if (options.dryRun) {
|
|
7855
|
-
|
|
7899
|
+
note(`[DRY RUN] Would write ${mcpJsonPath}`, "Claude Code");
|
|
7856
7900
|
} else {
|
|
7857
7901
|
try {
|
|
7858
7902
|
const config = readJsonConfig(mcpJsonPath, { mcpServers: {} });
|
|
7859
7903
|
config.mcpServers = config.mcpServers || {};
|
|
7860
7904
|
config.mcpServers.donotdev = mcpConfig;
|
|
7861
7905
|
writeJsonConfig(mcpJsonPath, config);
|
|
7862
|
-
|
|
7906
|
+
log2.success(".mcp.json configured (Claude Code).");
|
|
7863
7907
|
} catch (e) {
|
|
7864
|
-
|
|
7908
|
+
log2.error(`Failed to configure .mcp.json: ${e.message}`);
|
|
7865
7909
|
}
|
|
7866
7910
|
}
|
|
7867
7911
|
const cursorMcpPath = joinPath(cwd, ".cursor", "mcp.json");
|
|
7868
7912
|
if (options.dryRun) {
|
|
7869
|
-
|
|
7913
|
+
note(`[DRY RUN] Would write ${cursorMcpPath}`, "Cursor");
|
|
7870
7914
|
} else {
|
|
7871
7915
|
try {
|
|
7872
7916
|
const config = readJsonConfig(cursorMcpPath, { mcpServers: {} });
|
|
7873
7917
|
config.mcpServers = config.mcpServers || {};
|
|
7874
7918
|
config.mcpServers.donotdev = mcpConfig;
|
|
7875
7919
|
writeJsonConfig(cursorMcpPath, config);
|
|
7876
|
-
|
|
7920
|
+
log2.success(".cursor/mcp.json configured (Cursor).");
|
|
7877
7921
|
} catch (e) {
|
|
7878
|
-
|
|
7922
|
+
log2.error(`Failed to configure Cursor: ${e.message}`);
|
|
7879
7923
|
}
|
|
7880
7924
|
}
|
|
7881
7925
|
const geminiConfigPath = joinPath(cwd, ".gemini", "settings.json");
|
|
7882
7926
|
if (options.dryRun) {
|
|
7883
|
-
|
|
7927
|
+
note(`[DRY RUN] Would write ${geminiConfigPath}`, "Gemini");
|
|
7884
7928
|
} else {
|
|
7885
7929
|
try {
|
|
7886
7930
|
const config = readJsonConfig(geminiConfigPath, { mcpServers: {} });
|
|
7887
7931
|
config.mcpServers = config.mcpServers || {};
|
|
7888
7932
|
config.mcpServers.donotdev = { ...mcpConfig, trust: true };
|
|
7889
7933
|
writeJsonConfig(geminiConfigPath, config);
|
|
7890
|
-
|
|
7934
|
+
log2.success(".gemini/settings.json configured (Gemini).");
|
|
7891
7935
|
} catch (e) {
|
|
7892
|
-
|
|
7936
|
+
log2.error(`Failed to configure Gemini: ${e.message}`);
|
|
7893
7937
|
}
|
|
7894
7938
|
}
|
|
7895
7939
|
const claudeConfigPath = isWindows ? joinPath(
|
|
@@ -7905,24 +7949,24 @@ async function main(options = {}) {
|
|
|
7905
7949
|
) : null;
|
|
7906
7950
|
if (claudeConfigPath) {
|
|
7907
7951
|
if (options.dryRun) {
|
|
7908
|
-
|
|
7952
|
+
note(`[DRY RUN] Would update ${claudeConfigPath}`, "Claude Desktop");
|
|
7909
7953
|
} else {
|
|
7910
7954
|
try {
|
|
7911
7955
|
const config = readJsonConfig(claudeConfigPath, { mcpServers: {} });
|
|
7912
7956
|
config.mcpServers = config.mcpServers || {};
|
|
7913
7957
|
config.mcpServers.donotdev = mcpConfig;
|
|
7914
7958
|
writeJsonConfig(claudeConfigPath, config);
|
|
7915
|
-
|
|
7959
|
+
log2.success("Claude Desktop configured (global).");
|
|
7916
7960
|
} catch (e) {
|
|
7917
|
-
|
|
7961
|
+
log2.error(`Failed to configure Claude Desktop: ${e.message}`);
|
|
7918
7962
|
}
|
|
7919
7963
|
}
|
|
7920
7964
|
}
|
|
7921
|
-
|
|
7965
|
+
note(
|
|
7922
7966
|
'1. Restart your IDE (Cursor, VS Code, etc.)\n2. Tell your AI agent: "Read AGENTS.md and build my app"\n3. The agent handles the rest.',
|
|
7923
7967
|
"Next Steps"
|
|
7924
7968
|
);
|
|
7925
|
-
|
|
7969
|
+
outro("Agent setup complete.");
|
|
7926
7970
|
}
|
|
7927
7971
|
export {
|
|
7928
7972
|
main
|