@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,17 +33,17 @@ 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@
|
|
36
|
+
// node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
|
|
37
37
|
var init_utils = __esm({
|
|
38
|
-
"node_modules/.bun/fast-string-truncated-width@
|
|
38
|
+
"node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js"() {
|
|
39
39
|
init_utils2();
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
|
|
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/index.js
|
|
44
44
|
var EMOJI_RE, MODIFIER_RE;
|
|
45
45
|
var init_dist = __esm({
|
|
46
|
-
"node_modules/.bun/fast-string-truncated-width@
|
|
46
|
+
"node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js"() {
|
|
47
47
|
init_utils2();
|
|
48
48
|
init_utils();
|
|
49
49
|
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");
|
|
@@ -51,18 +51,18 @@ var init_dist = __esm({
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
// node_modules/.bun/fast-string-width@
|
|
54
|
+
// node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
|
|
55
55
|
var init_dist2 = __esm({
|
|
56
|
-
"node_modules/.bun/fast-string-width@
|
|
56
|
+
"node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js"() {
|
|
57
57
|
init_utils2();
|
|
58
58
|
init_dist();
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
-
// node_modules/.bun/fast-wrap-ansi@0.
|
|
62
|
+
// node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js
|
|
63
63
|
var ANSI_ESCAPE_BELL, ANSI_CSI, ANSI_OSC, ANSI_ESCAPE_LINK, GROUP_REGEX;
|
|
64
64
|
var init_main = __esm({
|
|
65
|
-
"node_modules/.bun/fast-wrap-ansi@0.
|
|
65
|
+
"node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js"() {
|
|
66
66
|
init_utils2();
|
|
67
67
|
init_dist2();
|
|
68
68
|
ANSI_ESCAPE_BELL = "\x07";
|
|
@@ -81,17 +81,17 @@ var require_src = __commonJS({
|
|
|
81
81
|
var ESC = "\x1B";
|
|
82
82
|
var CSI = `${ESC}[`;
|
|
83
83
|
var beep = "\x07";
|
|
84
|
-
var
|
|
85
|
-
to(x,
|
|
86
|
-
if (!
|
|
87
|
-
return `${CSI}${
|
|
84
|
+
var cursor3 = {
|
|
85
|
+
to(x, y) {
|
|
86
|
+
if (!y) return `${CSI}${x + 1}G`;
|
|
87
|
+
return `${CSI}${y + 1};${x + 1}H`;
|
|
88
88
|
},
|
|
89
|
-
move(x,
|
|
89
|
+
move(x, y) {
|
|
90
90
|
let ret = "";
|
|
91
91
|
if (x < 0) ret += `${CSI}${-x}D`;
|
|
92
92
|
else if (x > 0) ret += `${CSI}${x}C`;
|
|
93
|
-
if (
|
|
94
|
-
else if (
|
|
93
|
+
if (y < 0) ret += `${CSI}${-y}A`;
|
|
94
|
+
else if (y > 0) ret += `${CSI}${y}B`;
|
|
95
95
|
return ret;
|
|
96
96
|
},
|
|
97
97
|
up: (count = 1) => `${CSI}${count}A`,
|
|
@@ -110,7 +110,7 @@ var require_src = __commonJS({
|
|
|
110
110
|
up: (count = 1) => `${CSI}S`.repeat(count),
|
|
111
111
|
down: (count = 1) => `${CSI}T`.repeat(count)
|
|
112
112
|
};
|
|
113
|
-
var
|
|
113
|
+
var erase3 = {
|
|
114
114
|
screen: `${CSI}2J`,
|
|
115
115
|
up: (count = 1) => `${CSI}1J`.repeat(count),
|
|
116
116
|
down: (count = 1) => `${CSI}J`.repeat(count),
|
|
@@ -119,106 +119,180 @@ var require_src = __commonJS({
|
|
|
119
119
|
lineStart: `${CSI}1K`,
|
|
120
120
|
lines(count) {
|
|
121
121
|
let clear = "";
|
|
122
|
-
for (let
|
|
123
|
-
clear += this.line + (
|
|
122
|
+
for (let i2 = 0; i2 < count; i2++)
|
|
123
|
+
clear += this.line + (i2 < count - 1 ? cursor3.up() : "");
|
|
124
124
|
if (count)
|
|
125
|
-
clear +=
|
|
125
|
+
clear += cursor3.left;
|
|
126
126
|
return clear;
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
|
-
module.exports = { cursor, scroll, erase, beep };
|
|
129
|
+
module.exports = { cursor: cursor3, scroll, erase: erase3, beep };
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
132
|
|
|
133
|
-
// node_modules/.bun/@clack+core@1.
|
|
134
|
-
import { styleText
|
|
135
|
-
import { stdout
|
|
136
|
-
import { ReadStream
|
|
137
|
-
var import_sisteransi,
|
|
133
|
+
// node_modules/.bun/@clack+core@1.5.0/node_modules/@clack/core/dist/index.mjs
|
|
134
|
+
import { styleText } from "node:util";
|
|
135
|
+
import { stdout, stdin } from "node:process";
|
|
136
|
+
import { ReadStream } from "node:tty";
|
|
137
|
+
var import_sisteransi, a$1, t, settings, R;
|
|
138
138
|
var init_dist3 = __esm({
|
|
139
|
-
"node_modules/.bun/@clack+core@1.
|
|
139
|
+
"node_modules/.bun/@clack+core@1.5.0/node_modules/@clack/core/dist/index.mjs"() {
|
|
140
140
|
init_utils2();
|
|
141
141
|
init_main();
|
|
142
142
|
import_sisteransi = __toESM(require_src(), 1);
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
144
|
+
t = [
|
|
145
|
+
"January",
|
|
146
|
+
"February",
|
|
147
|
+
"March",
|
|
148
|
+
"April",
|
|
149
|
+
"May",
|
|
150
|
+
"June",
|
|
151
|
+
"July",
|
|
152
|
+
"August",
|
|
153
|
+
"September",
|
|
154
|
+
"October",
|
|
155
|
+
"November",
|
|
156
|
+
"December"
|
|
157
|
+
];
|
|
158
|
+
settings = {
|
|
159
|
+
actions: new Set(a$1),
|
|
160
|
+
aliases: /* @__PURE__ */ new Map([
|
|
161
|
+
// vim support
|
|
162
|
+
["k", "up"],
|
|
163
|
+
["j", "down"],
|
|
164
|
+
["h", "left"],
|
|
165
|
+
["l", "right"],
|
|
166
|
+
["", "cancel"],
|
|
167
|
+
// opinionated defaults!
|
|
168
|
+
["escape", "cancel"]
|
|
169
|
+
]),
|
|
170
|
+
messages: {
|
|
171
|
+
cancel: "Canceled",
|
|
172
|
+
error: "Something went wrong"
|
|
173
|
+
},
|
|
174
|
+
withGuide: true,
|
|
175
|
+
accessible: void 0,
|
|
176
|
+
date: {
|
|
177
|
+
monthNames: [...t],
|
|
178
|
+
messages: {
|
|
179
|
+
required: "Please enter a valid date",
|
|
180
|
+
invalidMonth: "There are only 12 months in a year",
|
|
181
|
+
invalidDay: (n2, e) => `There are only ${n2} days in ${e}`,
|
|
182
|
+
afterMin: (n2) => `Date must be on or after ${n2.toISOString().slice(0, 10)}`,
|
|
183
|
+
beforeMax: (n2) => `Date must be on or before ${n2.toISOString().slice(0, 10)}`
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
R = globalThis.process.platform.startsWith("win");
|
|
147
188
|
}
|
|
148
189
|
});
|
|
149
190
|
|
|
150
|
-
// node_modules/.bun/@clack+prompts@1.
|
|
151
|
-
import { styleText as
|
|
152
|
-
import
|
|
153
|
-
import { existsSync
|
|
154
|
-
import { dirname
|
|
155
|
-
function
|
|
156
|
-
|
|
191
|
+
// node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs
|
|
192
|
+
import { styleText as styleText2, stripVTControlCharacters } from "node:util";
|
|
193
|
+
import process$1 from "node:process";
|
|
194
|
+
import { existsSync, lstatSync, readdirSync } from "node:fs";
|
|
195
|
+
import { dirname, join } from "node:path";
|
|
196
|
+
function isUnicodeSupported() {
|
|
197
|
+
if (process$1.platform !== "win32") {
|
|
198
|
+
return process$1.env.TERM !== "linux";
|
|
199
|
+
}
|
|
200
|
+
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";
|
|
157
201
|
}
|
|
158
|
-
var import_sisteransi2,
|
|
202
|
+
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, u2, SELECT_INSTRUCTIONS, i;
|
|
159
203
|
var init_dist4 = __esm({
|
|
160
|
-
"node_modules/.bun/@clack+prompts@1.
|
|
204
|
+
"node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs"() {
|
|
161
205
|
init_utils2();
|
|
162
206
|
init_dist3();
|
|
163
207
|
init_dist3();
|
|
164
208
|
init_main();
|
|
165
209
|
init_dist2();
|
|
166
210
|
import_sisteransi2 = __toESM(require_src(), 1);
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
211
|
+
unicode = isUnicodeSupported();
|
|
212
|
+
unicodeOr = (o, e) => unicode ? o : e;
|
|
213
|
+
S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
|
|
214
|
+
S_STEP_CANCEL = unicodeOr("\u25A0", "x");
|
|
215
|
+
S_STEP_ERROR = unicodeOr("\u25B2", "x");
|
|
216
|
+
S_STEP_SUBMIT = unicodeOr("\u25C7", "o");
|
|
217
|
+
S_BAR_START = unicodeOr("\u250C", "T");
|
|
218
|
+
S_BAR = unicodeOr("\u2502", "|");
|
|
219
|
+
S_BAR_END = unicodeOr("\u2514", "\u2014");
|
|
220
|
+
S_BAR_START_RIGHT = unicodeOr("\u2510", "T");
|
|
221
|
+
S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014");
|
|
222
|
+
S_RADIO_ACTIVE = unicodeOr("\u25CF", ">");
|
|
223
|
+
S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
|
|
224
|
+
S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
|
|
225
|
+
S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
|
|
226
|
+
S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
|
|
227
|
+
S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022");
|
|
228
|
+
S_BAR_H = unicodeOr("\u2500", "-");
|
|
229
|
+
S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+");
|
|
230
|
+
S_CONNECT_LEFT = unicodeOr("\u251C", "+");
|
|
231
|
+
S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+");
|
|
232
|
+
S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+");
|
|
233
|
+
S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+");
|
|
234
|
+
S_INFO = unicodeOr("\u25CF", "\u2022");
|
|
235
|
+
S_SUCCESS = unicodeOr("\u25C6", "*");
|
|
236
|
+
S_WARN = unicodeOr("\u25B2", "!");
|
|
237
|
+
S_ERROR = unicodeOr("\u25A0", "x");
|
|
238
|
+
MULTISELECT_INSTRUCTIONS = [
|
|
239
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
240
|
+
`${styleText2("dim", "Space:")} select`,
|
|
241
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
242
|
+
];
|
|
243
|
+
log = {
|
|
244
|
+
message: (s = [], {
|
|
245
|
+
symbol: e = styleText2("gray", S_BAR),
|
|
246
|
+
secondarySymbol: r2 = styleText2("gray", S_BAR),
|
|
247
|
+
output: m = process.stdout,
|
|
248
|
+
spacing: l = 1,
|
|
249
|
+
withGuide: c
|
|
250
|
+
} = {}) => {
|
|
251
|
+
const t2 = [], o = c ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
|
|
252
|
+
for (let i2 = 0; i2 < l; i2++)
|
|
253
|
+
t2.push(f);
|
|
254
|
+
const g = Array.isArray(s) ? s : s.split(`
|
|
198
255
|
`);
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
256
|
+
if (g.length > 0) {
|
|
257
|
+
const [i2, ...y] = g;
|
|
258
|
+
i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
|
|
259
|
+
for (const p of y)
|
|
260
|
+
p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
|
|
261
|
+
}
|
|
262
|
+
m.write(`${t2.join(`
|
|
205
263
|
`)}
|
|
206
264
|
`);
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
265
|
+
},
|
|
266
|
+
info: (s, e) => {
|
|
267
|
+
log.message(s, { ...e, symbol: styleText2("blue", S_INFO) });
|
|
268
|
+
},
|
|
269
|
+
success: (s, e) => {
|
|
270
|
+
log.message(s, { ...e, symbol: styleText2("green", S_SUCCESS) });
|
|
271
|
+
},
|
|
272
|
+
step: (s, e) => {
|
|
273
|
+
log.message(s, { ...e, symbol: styleText2("green", S_STEP_SUBMIT) });
|
|
274
|
+
},
|
|
275
|
+
warn: (s, e) => {
|
|
276
|
+
log.message(s, { ...e, symbol: styleText2("yellow", S_WARN) });
|
|
277
|
+
},
|
|
278
|
+
/** alias for `log.warn()`. */
|
|
279
|
+
warning: (s, e) => {
|
|
280
|
+
log.warn(s, e);
|
|
281
|
+
},
|
|
282
|
+
error: (s, e) => {
|
|
283
|
+
log.message(s, { ...e, symbol: styleText2("red", S_ERROR) });
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
u2 = {
|
|
287
|
+
light: unicodeOr("\u2500", "-"),
|
|
288
|
+
heavy: unicodeOr("\u2501", "="),
|
|
289
|
+
block: unicodeOr("\u2588", "#")
|
|
290
|
+
};
|
|
291
|
+
SELECT_INSTRUCTIONS = [
|
|
292
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
293
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
294
|
+
];
|
|
295
|
+
i = `${styleText2("gray", S_BAR)} `;
|
|
222
296
|
}
|
|
223
297
|
});
|
|
224
298
|
|
|
@@ -263,7 +337,7 @@ function stringify(value) {
|
|
|
263
337
|
function formatMessage(...args) {
|
|
264
338
|
return args.map(stringify).join(" ");
|
|
265
339
|
}
|
|
266
|
-
var colors, currentLogLevel,
|
|
340
|
+
var colors, currentLogLevel, log2, error, warn, info, success;
|
|
267
341
|
var init_cli_output = __esm({
|
|
268
342
|
"packages/tooling/src/utils/cli-output.ts"() {
|
|
269
343
|
"use strict";
|
|
@@ -296,7 +370,7 @@ var init_cli_output = __esm({
|
|
|
296
370
|
currentLogLevel = envLevel;
|
|
297
371
|
}
|
|
298
372
|
}
|
|
299
|
-
|
|
373
|
+
log2 = {
|
|
300
374
|
/**
|
|
301
375
|
* Logs an error message (always shows unless Quiet level)
|
|
302
376
|
* Uses clack's log.error + explicit red color
|
|
@@ -304,7 +378,7 @@ var init_cli_output = __esm({
|
|
|
304
378
|
error(...args) {
|
|
305
379
|
if (currentLogLevel < 0 /* Quiet */) return;
|
|
306
380
|
const message = formatMessage(...args);
|
|
307
|
-
|
|
381
|
+
log.error(colorize(message, colors.brightRed));
|
|
308
382
|
},
|
|
309
383
|
/**
|
|
310
384
|
* Logs a warning message (shows at Normal level and above)
|
|
@@ -313,7 +387,7 @@ var init_cli_output = __esm({
|
|
|
313
387
|
warn(...args) {
|
|
314
388
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
315
389
|
const message = formatMessage(...args);
|
|
316
|
-
|
|
390
|
+
log.warn(colorize(message, colors.brightYellow));
|
|
317
391
|
},
|
|
318
392
|
/**
|
|
319
393
|
* Logs an info message (shows at Normal level and above)
|
|
@@ -322,7 +396,7 @@ var init_cli_output = __esm({
|
|
|
322
396
|
info(...args) {
|
|
323
397
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
324
398
|
const message = formatMessage(...args);
|
|
325
|
-
|
|
399
|
+
log.info(colorize(message, colors.brightCyan));
|
|
326
400
|
},
|
|
327
401
|
/**
|
|
328
402
|
* Logs a success message (shows at Normal level and above)
|
|
@@ -331,7 +405,7 @@ var init_cli_output = __esm({
|
|
|
331
405
|
success(...args) {
|
|
332
406
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
333
407
|
const message = formatMessage(...args);
|
|
334
|
-
|
|
408
|
+
log.success(colorize(message, colors.brightGreen));
|
|
335
409
|
},
|
|
336
410
|
/**
|
|
337
411
|
* Logs a debug message (only shows at Verbose level and above)
|
|
@@ -340,7 +414,7 @@ var init_cli_output = __esm({
|
|
|
340
414
|
debug(...args) {
|
|
341
415
|
if (currentLogLevel < 2 /* Verbose */) return;
|
|
342
416
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
343
|
-
|
|
417
|
+
log.message(
|
|
344
418
|
colorize(
|
|
345
419
|
`[${timeStamp}] \u{1F50D} DEBUG: ${formatMessage(...args)}`,
|
|
346
420
|
colors.gray
|
|
@@ -354,7 +428,7 @@ var init_cli_output = __esm({
|
|
|
354
428
|
trace(...args) {
|
|
355
429
|
if (currentLogLevel < 3 /* Debug */) return;
|
|
356
430
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
357
|
-
|
|
431
|
+
log.message(
|
|
358
432
|
colorize(
|
|
359
433
|
`[${timeStamp}] \u{1F52C} TRACE: ${formatMessage(...args)}`,
|
|
360
434
|
colors.gray
|
|
@@ -362,10 +436,10 @@ var init_cli_output = __esm({
|
|
|
362
436
|
);
|
|
363
437
|
}
|
|
364
438
|
};
|
|
365
|
-
error =
|
|
366
|
-
warn =
|
|
367
|
-
info =
|
|
368
|
-
success =
|
|
439
|
+
error = log2.error.bind(log2);
|
|
440
|
+
warn = log2.warn.bind(log2);
|
|
441
|
+
info = log2.info.bind(log2);
|
|
442
|
+
success = log2.success.bind(log2);
|
|
369
443
|
}
|
|
370
444
|
});
|
|
371
445
|
|
|
@@ -725,9 +799,9 @@ var require_is_glob = __commonJS({
|
|
|
725
799
|
index += 2;
|
|
726
800
|
var close = chars[open];
|
|
727
801
|
if (close) {
|
|
728
|
-
var
|
|
729
|
-
if (
|
|
730
|
-
index =
|
|
802
|
+
var n2 = str.indexOf(close, index);
|
|
803
|
+
if (n2 !== -1) {
|
|
804
|
+
index = n2 + 1;
|
|
731
805
|
}
|
|
732
806
|
}
|
|
733
807
|
if (str[index] === "!") {
|
|
@@ -753,9 +827,9 @@ var require_is_glob = __commonJS({
|
|
|
753
827
|
index += 2;
|
|
754
828
|
var close = chars[open];
|
|
755
829
|
if (close) {
|
|
756
|
-
var
|
|
757
|
-
if (
|
|
758
|
-
index =
|
|
830
|
+
var n2 = str.indexOf(close, index);
|
|
831
|
+
if (n2 !== -1) {
|
|
832
|
+
index = n2 + 1;
|
|
759
833
|
}
|
|
760
834
|
}
|
|
761
835
|
if (str[index] === "!") {
|
|
@@ -833,8 +907,8 @@ var require_utils = __commonJS({
|
|
|
833
907
|
if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
|
|
834
908
|
return (Number(max) - Number(min)) / Number(step) >= limit;
|
|
835
909
|
};
|
|
836
|
-
exports.escapeNode = (
|
|
837
|
-
const node =
|
|
910
|
+
exports.escapeNode = (block2, n2 = 0, type) => {
|
|
911
|
+
const node = block2.nodes[n2];
|
|
838
912
|
if (!node) return;
|
|
839
913
|
if (type && node.type === type || node.type === "open" || node.type === "close") {
|
|
840
914
|
if (node.escaped !== true) {
|
|
@@ -851,15 +925,15 @@ var require_utils = __commonJS({
|
|
|
851
925
|
}
|
|
852
926
|
return false;
|
|
853
927
|
};
|
|
854
|
-
exports.isInvalidBrace = (
|
|
855
|
-
if (
|
|
856
|
-
if (
|
|
857
|
-
if (
|
|
858
|
-
|
|
928
|
+
exports.isInvalidBrace = (block2) => {
|
|
929
|
+
if (block2.type !== "brace") return false;
|
|
930
|
+
if (block2.invalid === true || block2.dollar) return true;
|
|
931
|
+
if (block2.commas >> 0 + block2.ranges >> 0 === 0) {
|
|
932
|
+
block2.invalid = true;
|
|
859
933
|
return true;
|
|
860
934
|
}
|
|
861
|
-
if (
|
|
862
|
-
|
|
935
|
+
if (block2.open !== true || block2.close !== true) {
|
|
936
|
+
block2.invalid = true;
|
|
863
937
|
return true;
|
|
864
938
|
}
|
|
865
939
|
return false;
|
|
@@ -878,8 +952,8 @@ var require_utils = __commonJS({
|
|
|
878
952
|
exports.flatten = (...args) => {
|
|
879
953
|
const result = [];
|
|
880
954
|
const flat = (arr) => {
|
|
881
|
-
for (let
|
|
882
|
-
const ele = arr[
|
|
955
|
+
for (let i2 = 0; i2 < arr.length; i2++) {
|
|
956
|
+
const ele = arr[i2];
|
|
883
957
|
if (Array.isArray(ele)) {
|
|
884
958
|
flat(ele);
|
|
885
959
|
continue;
|
|
@@ -973,9 +1047,9 @@ var require_to_regex_range = __commonJS({
|
|
|
973
1047
|
if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
|
|
974
1048
|
return toRegexRange.cache[cacheKey].result;
|
|
975
1049
|
}
|
|
976
|
-
let
|
|
1050
|
+
let a2 = Math.min(min, max);
|
|
977
1051
|
let b = Math.max(min, max);
|
|
978
|
-
if (Math.abs(
|
|
1052
|
+
if (Math.abs(a2 - b) === 1) {
|
|
979
1053
|
let result = min + "|" + max;
|
|
980
1054
|
if (opts.capture) {
|
|
981
1055
|
return `(${result})`;
|
|
@@ -986,20 +1060,20 @@ var require_to_regex_range = __commonJS({
|
|
|
986
1060
|
return `(?:${result})`;
|
|
987
1061
|
}
|
|
988
1062
|
let isPadded = hasPadding(min) || hasPadding(max);
|
|
989
|
-
let state = { min, max, a, b };
|
|
1063
|
+
let state = { min, max, a: a2, b };
|
|
990
1064
|
let positives = [];
|
|
991
1065
|
let negatives = [];
|
|
992
1066
|
if (isPadded) {
|
|
993
1067
|
state.isPadded = isPadded;
|
|
994
1068
|
state.maxLen = String(state.max).length;
|
|
995
1069
|
}
|
|
996
|
-
if (
|
|
1070
|
+
if (a2 < 0) {
|
|
997
1071
|
let newMin = b < 0 ? Math.abs(b) : 1;
|
|
998
|
-
negatives = splitToPatterns(newMin, Math.abs(
|
|
999
|
-
|
|
1072
|
+
negatives = splitToPatterns(newMin, Math.abs(a2), state, opts);
|
|
1073
|
+
a2 = state.a = 0;
|
|
1000
1074
|
}
|
|
1001
1075
|
if (b >= 0) {
|
|
1002
|
-
positives = splitToPatterns(
|
|
1076
|
+
positives = splitToPatterns(a2, b, state, opts);
|
|
1003
1077
|
}
|
|
1004
1078
|
state.negatives = negatives;
|
|
1005
1079
|
state.positives = positives;
|
|
@@ -1047,8 +1121,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1047
1121
|
let digits = zipped.length;
|
|
1048
1122
|
let pattern = "";
|
|
1049
1123
|
let count = 0;
|
|
1050
|
-
for (let
|
|
1051
|
-
let [startDigit, stopDigit] = zipped[
|
|
1124
|
+
for (let i2 = 0; i2 < digits; i2++) {
|
|
1125
|
+
let [startDigit, stopDigit] = zipped[i2];
|
|
1052
1126
|
if (startDigit === stopDigit) {
|
|
1053
1127
|
pattern += startDigit;
|
|
1054
1128
|
} else if (startDigit !== "0" || stopDigit !== "9") {
|
|
@@ -1067,8 +1141,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1067
1141
|
let tokens = [];
|
|
1068
1142
|
let start = min;
|
|
1069
1143
|
let prev;
|
|
1070
|
-
for (let
|
|
1071
|
-
let max2 = ranges[
|
|
1144
|
+
for (let i2 = 0; i2 < ranges.length; i2++) {
|
|
1145
|
+
let max2 = ranges[i2];
|
|
1072
1146
|
let obj = rangeToPattern(String(start), String(max2), options);
|
|
1073
1147
|
let zeros = "";
|
|
1074
1148
|
if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
|
|
@@ -1103,13 +1177,13 @@ var require_to_regex_range = __commonJS({
|
|
|
1103
1177
|
}
|
|
1104
1178
|
return result;
|
|
1105
1179
|
}
|
|
1106
|
-
function zip(
|
|
1180
|
+
function zip(a2, b) {
|
|
1107
1181
|
let arr = [];
|
|
1108
|
-
for (let
|
|
1182
|
+
for (let i2 = 0; i2 < a2.length; i2++) arr.push([a2[i2], b[i2]]);
|
|
1109
1183
|
return arr;
|
|
1110
1184
|
}
|
|
1111
|
-
function compare(
|
|
1112
|
-
return
|
|
1185
|
+
function compare(a2, b) {
|
|
1186
|
+
return a2 > b ? 1 : b > a2 ? -1 : 0;
|
|
1113
1187
|
}
|
|
1114
1188
|
function contains(arr, key, val) {
|
|
1115
1189
|
return arr.some((ele) => ele[key] === val);
|
|
@@ -1127,8 +1201,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1127
1201
|
}
|
|
1128
1202
|
return "";
|
|
1129
1203
|
}
|
|
1130
|
-
function toCharacterClass(
|
|
1131
|
-
return `[${
|
|
1204
|
+
function toCharacterClass(a2, b, options) {
|
|
1205
|
+
return `[${a2}${b - a2 === 1 ? "" : "-"}${b}]`;
|
|
1132
1206
|
}
|
|
1133
1207
|
function hasPadding(str) {
|
|
1134
1208
|
return /^-?(0+)\d/.test(str);
|
|
@@ -1207,8 +1281,8 @@ var require_fill_range = __commonJS({
|
|
|
1207
1281
|
return negative ? "-" + input : input;
|
|
1208
1282
|
};
|
|
1209
1283
|
var toSequence = (parts, options, maxLen) => {
|
|
1210
|
-
parts.negatives.sort((
|
|
1211
|
-
parts.positives.sort((
|
|
1284
|
+
parts.negatives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
1285
|
+
parts.positives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
1212
1286
|
let prefix = options.capture ? "" : "?:";
|
|
1213
1287
|
let positives = "";
|
|
1214
1288
|
let negatives = "";
|
|
@@ -1229,12 +1303,12 @@ var require_fill_range = __commonJS({
|
|
|
1229
1303
|
}
|
|
1230
1304
|
return result;
|
|
1231
1305
|
};
|
|
1232
|
-
var toRange = (
|
|
1306
|
+
var toRange = (a2, b, isNumbers, options) => {
|
|
1233
1307
|
if (isNumbers) {
|
|
1234
|
-
return toRegexRange(
|
|
1308
|
+
return toRegexRange(a2, b, { wrap: false, ...options });
|
|
1235
1309
|
}
|
|
1236
|
-
let start = String.fromCharCode(
|
|
1237
|
-
if (
|
|
1310
|
+
let start = String.fromCharCode(a2);
|
|
1311
|
+
if (a2 === b) return start;
|
|
1238
1312
|
let stop = String.fromCharCode(b);
|
|
1239
1313
|
return `[${start}-${stop}]`;
|
|
1240
1314
|
};
|
|
@@ -1260,15 +1334,15 @@ var require_fill_range = __commonJS({
|
|
|
1260
1334
|
return [];
|
|
1261
1335
|
};
|
|
1262
1336
|
var fillNumbers = (start, end, step = 1, options = {}) => {
|
|
1263
|
-
let
|
|
1337
|
+
let a2 = Number(start);
|
|
1264
1338
|
let b = Number(end);
|
|
1265
|
-
if (!Number.isInteger(
|
|
1339
|
+
if (!Number.isInteger(a2) || !Number.isInteger(b)) {
|
|
1266
1340
|
if (options.strictRanges === true) throw rangeError([start, end]);
|
|
1267
1341
|
return [];
|
|
1268
1342
|
}
|
|
1269
|
-
if (
|
|
1343
|
+
if (a2 === 0) a2 = 0;
|
|
1270
1344
|
if (b === 0) b = 0;
|
|
1271
|
-
let descending =
|
|
1345
|
+
let descending = a2 > b;
|
|
1272
1346
|
let startString = String(start);
|
|
1273
1347
|
let endString = String(end);
|
|
1274
1348
|
let stepString = String(step);
|
|
@@ -1284,13 +1358,13 @@ var require_fill_range = __commonJS({
|
|
|
1284
1358
|
let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
|
|
1285
1359
|
let range = [];
|
|
1286
1360
|
let index = 0;
|
|
1287
|
-
while (descending ?
|
|
1361
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
1288
1362
|
if (options.toRegex === true && step > 1) {
|
|
1289
|
-
push(
|
|
1363
|
+
push(a2);
|
|
1290
1364
|
} else {
|
|
1291
|
-
range.push(pad(format(
|
|
1365
|
+
range.push(pad(format(a2, index), maxLen, toNumber));
|
|
1292
1366
|
}
|
|
1293
|
-
|
|
1367
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
1294
1368
|
index++;
|
|
1295
1369
|
}
|
|
1296
1370
|
if (options.toRegex === true) {
|
|
@@ -1303,19 +1377,19 @@ var require_fill_range = __commonJS({
|
|
|
1303
1377
|
return invalidRange(start, end, options);
|
|
1304
1378
|
}
|
|
1305
1379
|
let format = options.transform || ((val) => String.fromCharCode(val));
|
|
1306
|
-
let
|
|
1380
|
+
let a2 = `${start}`.charCodeAt(0);
|
|
1307
1381
|
let b = `${end}`.charCodeAt(0);
|
|
1308
|
-
let descending =
|
|
1309
|
-
let min = Math.min(
|
|
1310
|
-
let max = Math.max(
|
|
1382
|
+
let descending = a2 > b;
|
|
1383
|
+
let min = Math.min(a2, b);
|
|
1384
|
+
let max = Math.max(a2, b);
|
|
1311
1385
|
if (options.toRegex && step === 1) {
|
|
1312
1386
|
return toRange(min, max, false, options);
|
|
1313
1387
|
}
|
|
1314
1388
|
let range = [];
|
|
1315
1389
|
let index = 0;
|
|
1316
|
-
while (descending ?
|
|
1317
|
-
range.push(format(
|
|
1318
|
-
|
|
1390
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
1391
|
+
range.push(format(a2, index));
|
|
1392
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
1319
1393
|
index++;
|
|
1320
1394
|
}
|
|
1321
1395
|
if (options.toRegex === true) {
|
|
@@ -1439,17 +1513,17 @@ var require_expand = __commonJS({
|
|
|
1439
1513
|
const walk = (node, parent = {}) => {
|
|
1440
1514
|
node.queue = [];
|
|
1441
1515
|
let p = parent;
|
|
1442
|
-
let
|
|
1516
|
+
let q = parent.queue;
|
|
1443
1517
|
while (p.type !== "brace" && p.type !== "root" && p.parent) {
|
|
1444
1518
|
p = p.parent;
|
|
1445
|
-
|
|
1519
|
+
q = p.queue;
|
|
1446
1520
|
}
|
|
1447
1521
|
if (node.invalid || node.dollar) {
|
|
1448
|
-
|
|
1522
|
+
q.push(append(q.pop(), stringify2(node, options)));
|
|
1449
1523
|
return;
|
|
1450
1524
|
}
|
|
1451
1525
|
if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
|
|
1452
|
-
|
|
1526
|
+
q.push(append(q.pop(), ["{}"]));
|
|
1453
1527
|
return;
|
|
1454
1528
|
}
|
|
1455
1529
|
if (node.nodes && node.ranges > 0) {
|
|
@@ -1461,26 +1535,26 @@ var require_expand = __commonJS({
|
|
|
1461
1535
|
if (range.length === 0) {
|
|
1462
1536
|
range = stringify2(node, options);
|
|
1463
1537
|
}
|
|
1464
|
-
|
|
1538
|
+
q.push(append(q.pop(), range));
|
|
1465
1539
|
node.nodes = [];
|
|
1466
1540
|
return;
|
|
1467
1541
|
}
|
|
1468
1542
|
const enclose = utils.encloseBrace(node);
|
|
1469
1543
|
let queue = node.queue;
|
|
1470
|
-
let
|
|
1471
|
-
while (
|
|
1472
|
-
|
|
1473
|
-
queue =
|
|
1544
|
+
let block2 = node;
|
|
1545
|
+
while (block2.type !== "brace" && block2.type !== "root" && block2.parent) {
|
|
1546
|
+
block2 = block2.parent;
|
|
1547
|
+
queue = block2.queue;
|
|
1474
1548
|
}
|
|
1475
|
-
for (let
|
|
1476
|
-
const child = node.nodes[
|
|
1549
|
+
for (let i2 = 0; i2 < node.nodes.length; i2++) {
|
|
1550
|
+
const child = node.nodes[i2];
|
|
1477
1551
|
if (child.type === "comma" && node.type === "brace") {
|
|
1478
|
-
if (
|
|
1552
|
+
if (i2 === 1) queue.push("");
|
|
1479
1553
|
queue.push("");
|
|
1480
1554
|
continue;
|
|
1481
1555
|
}
|
|
1482
1556
|
if (child.type === "close") {
|
|
1483
|
-
|
|
1557
|
+
q.push(append(q.pop(), queue, enclose));
|
|
1484
1558
|
continue;
|
|
1485
1559
|
}
|
|
1486
1560
|
if (child.value && child.type !== "open") {
|
|
@@ -1647,7 +1721,7 @@ var require_parse = __commonJS({
|
|
|
1647
1721
|
}
|
|
1648
1722
|
const ast = { type: "root", input, nodes: [] };
|
|
1649
1723
|
const stack = [ast];
|
|
1650
|
-
let
|
|
1724
|
+
let block2 = ast;
|
|
1651
1725
|
let prev = ast;
|
|
1652
1726
|
let brackets = 0;
|
|
1653
1727
|
const length = input.length;
|
|
@@ -1663,15 +1737,15 @@ var require_parse = __commonJS({
|
|
|
1663
1737
|
prev.value += node.value;
|
|
1664
1738
|
return;
|
|
1665
1739
|
}
|
|
1666
|
-
|
|
1667
|
-
node.parent =
|
|
1740
|
+
block2.nodes.push(node);
|
|
1741
|
+
node.parent = block2;
|
|
1668
1742
|
node.prev = prev;
|
|
1669
1743
|
prev = node;
|
|
1670
1744
|
return node;
|
|
1671
1745
|
};
|
|
1672
1746
|
push({ type: "bos" });
|
|
1673
1747
|
while (index < length) {
|
|
1674
|
-
|
|
1748
|
+
block2 = stack[stack.length - 1];
|
|
1675
1749
|
value = advance();
|
|
1676
1750
|
if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
|
|
1677
1751
|
continue;
|
|
@@ -1708,19 +1782,19 @@ var require_parse = __commonJS({
|
|
|
1708
1782
|
continue;
|
|
1709
1783
|
}
|
|
1710
1784
|
if (value === CHAR_LEFT_PARENTHESES) {
|
|
1711
|
-
|
|
1712
|
-
stack.push(
|
|
1785
|
+
block2 = push({ type: "paren", nodes: [] });
|
|
1786
|
+
stack.push(block2);
|
|
1713
1787
|
push({ type: "text", value });
|
|
1714
1788
|
continue;
|
|
1715
1789
|
}
|
|
1716
1790
|
if (value === CHAR_RIGHT_PARENTHESES) {
|
|
1717
|
-
if (
|
|
1791
|
+
if (block2.type !== "paren") {
|
|
1718
1792
|
push({ type: "text", value });
|
|
1719
1793
|
continue;
|
|
1720
1794
|
}
|
|
1721
|
-
|
|
1795
|
+
block2 = stack.pop();
|
|
1722
1796
|
push({ type: "text", value });
|
|
1723
|
-
|
|
1797
|
+
block2 = stack[stack.length - 1];
|
|
1724
1798
|
continue;
|
|
1725
1799
|
}
|
|
1726
1800
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
@@ -1745,7 +1819,7 @@ var require_parse = __commonJS({
|
|
|
1745
1819
|
}
|
|
1746
1820
|
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
1747
1821
|
depth++;
|
|
1748
|
-
const dollar = prev.value && prev.value.slice(-1) === "$" ||
|
|
1822
|
+
const dollar = prev.value && prev.value.slice(-1) === "$" || block2.dollar === true;
|
|
1749
1823
|
const brace = {
|
|
1750
1824
|
type: "brace",
|
|
1751
1825
|
open: true,
|
|
@@ -1756,52 +1830,52 @@ var require_parse = __commonJS({
|
|
|
1756
1830
|
ranges: 0,
|
|
1757
1831
|
nodes: []
|
|
1758
1832
|
};
|
|
1759
|
-
|
|
1760
|
-
stack.push(
|
|
1833
|
+
block2 = push(brace);
|
|
1834
|
+
stack.push(block2);
|
|
1761
1835
|
push({ type: "open", value });
|
|
1762
1836
|
continue;
|
|
1763
1837
|
}
|
|
1764
1838
|
if (value === CHAR_RIGHT_CURLY_BRACE) {
|
|
1765
|
-
if (
|
|
1839
|
+
if (block2.type !== "brace") {
|
|
1766
1840
|
push({ type: "text", value });
|
|
1767
1841
|
continue;
|
|
1768
1842
|
}
|
|
1769
1843
|
const type = "close";
|
|
1770
|
-
|
|
1771
|
-
|
|
1844
|
+
block2 = stack.pop();
|
|
1845
|
+
block2.close = true;
|
|
1772
1846
|
push({ type, value });
|
|
1773
1847
|
depth--;
|
|
1774
|
-
|
|
1848
|
+
block2 = stack[stack.length - 1];
|
|
1775
1849
|
continue;
|
|
1776
1850
|
}
|
|
1777
1851
|
if (value === CHAR_COMMA && depth > 0) {
|
|
1778
|
-
if (
|
|
1779
|
-
|
|
1780
|
-
const open =
|
|
1781
|
-
|
|
1852
|
+
if (block2.ranges > 0) {
|
|
1853
|
+
block2.ranges = 0;
|
|
1854
|
+
const open = block2.nodes.shift();
|
|
1855
|
+
block2.nodes = [open, { type: "text", value: stringify2(block2) }];
|
|
1782
1856
|
}
|
|
1783
1857
|
push({ type: "comma", value });
|
|
1784
|
-
|
|
1858
|
+
block2.commas++;
|
|
1785
1859
|
continue;
|
|
1786
1860
|
}
|
|
1787
|
-
if (value === CHAR_DOT && depth > 0 &&
|
|
1788
|
-
const siblings =
|
|
1861
|
+
if (value === CHAR_DOT && depth > 0 && block2.commas === 0) {
|
|
1862
|
+
const siblings = block2.nodes;
|
|
1789
1863
|
if (depth === 0 || siblings.length === 0) {
|
|
1790
1864
|
push({ type: "text", value });
|
|
1791
1865
|
continue;
|
|
1792
1866
|
}
|
|
1793
1867
|
if (prev.type === "dot") {
|
|
1794
|
-
|
|
1868
|
+
block2.range = [];
|
|
1795
1869
|
prev.value += value;
|
|
1796
1870
|
prev.type = "range";
|
|
1797
|
-
if (
|
|
1798
|
-
|
|
1799
|
-
|
|
1871
|
+
if (block2.nodes.length !== 3 && block2.nodes.length !== 5) {
|
|
1872
|
+
block2.invalid = true;
|
|
1873
|
+
block2.ranges = 0;
|
|
1800
1874
|
prev.type = "text";
|
|
1801
1875
|
continue;
|
|
1802
1876
|
}
|
|
1803
|
-
|
|
1804
|
-
|
|
1877
|
+
block2.ranges++;
|
|
1878
|
+
block2.args = [];
|
|
1805
1879
|
continue;
|
|
1806
1880
|
}
|
|
1807
1881
|
if (prev.type === "range") {
|
|
@@ -1809,7 +1883,7 @@ var require_parse = __commonJS({
|
|
|
1809
1883
|
const before = siblings[siblings.length - 1];
|
|
1810
1884
|
before.value += prev.value + value;
|
|
1811
1885
|
prev = before;
|
|
1812
|
-
|
|
1886
|
+
block2.ranges--;
|
|
1813
1887
|
continue;
|
|
1814
1888
|
}
|
|
1815
1889
|
push({ type: "dot", value });
|
|
@@ -1818,9 +1892,9 @@ var require_parse = __commonJS({
|
|
|
1818
1892
|
push({ type: "text", value });
|
|
1819
1893
|
}
|
|
1820
1894
|
do {
|
|
1821
|
-
|
|
1822
|
-
if (
|
|
1823
|
-
|
|
1895
|
+
block2 = stack.pop();
|
|
1896
|
+
if (block2.type !== "root") {
|
|
1897
|
+
block2.nodes.forEach((node) => {
|
|
1824
1898
|
if (!node.nodes) {
|
|
1825
1899
|
if (node.type === "open") node.isOpen = true;
|
|
1826
1900
|
if (node.type === "close") node.isClose = true;
|
|
@@ -1829,8 +1903,8 @@ var require_parse = __commonJS({
|
|
|
1829
1903
|
}
|
|
1830
1904
|
});
|
|
1831
1905
|
const parent = stack[stack.length - 1];
|
|
1832
|
-
const index2 = parent.nodes.indexOf(
|
|
1833
|
-
parent.nodes.splice(index2, 1, ...
|
|
1906
|
+
const index2 = parent.nodes.indexOf(block2);
|
|
1907
|
+
parent.nodes.splice(index2, 1, ...block2.nodes);
|
|
1834
1908
|
}
|
|
1835
1909
|
} while (stack.length > 0);
|
|
1836
1910
|
push({ type: "eos" });
|
|
@@ -2463,9 +2537,9 @@ var require_scan = __commonJS({
|
|
|
2463
2537
|
if (opts.parts === true || opts.tokens === true) {
|
|
2464
2538
|
let prevIndex;
|
|
2465
2539
|
for (let idx = 0; idx < slashes.length; idx++) {
|
|
2466
|
-
const
|
|
2467
|
-
const
|
|
2468
|
-
const value = input.slice(
|
|
2540
|
+
const n2 = prevIndex ? prevIndex + 1 : start;
|
|
2541
|
+
const i2 = slashes[idx];
|
|
2542
|
+
const value = input.slice(n2, i2);
|
|
2469
2543
|
if (opts.tokens) {
|
|
2470
2544
|
if (idx === 0 && start !== 0) {
|
|
2471
2545
|
tokens[idx].isPrefix = true;
|
|
@@ -2479,7 +2553,7 @@ var require_scan = __commonJS({
|
|
|
2479
2553
|
if (idx !== 0 || value !== "") {
|
|
2480
2554
|
parts.push(value);
|
|
2481
2555
|
}
|
|
2482
|
-
prevIndex =
|
|
2556
|
+
prevIndex = i2;
|
|
2483
2557
|
}
|
|
2484
2558
|
if (prevIndex && prevIndex + 1 < input.length) {
|
|
2485
2559
|
const value = input.slice(prevIndex + 1);
|
|
@@ -2608,15 +2682,15 @@ var require_parse2 = __commonJS({
|
|
|
2608
2682
|
};
|
|
2609
2683
|
var hasRepeatedCharPrefixOverlap = (branches) => {
|
|
2610
2684
|
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
2611
|
-
for (let
|
|
2612
|
-
for (let j =
|
|
2613
|
-
const
|
|
2685
|
+
for (let i2 = 0; i2 < values.length; i2++) {
|
|
2686
|
+
for (let j = i2 + 1; j < values.length; j++) {
|
|
2687
|
+
const a2 = values[i2];
|
|
2614
2688
|
const b = values[j];
|
|
2615
|
-
const char =
|
|
2616
|
-
if (!char ||
|
|
2689
|
+
const char = a2[0];
|
|
2690
|
+
if (!char || a2 !== char.repeat(a2.length) || b !== char.repeat(b.length)) {
|
|
2617
2691
|
continue;
|
|
2618
2692
|
}
|
|
2619
|
-
if (
|
|
2693
|
+
if (a2 === b || a2.startsWith(b) || b.startsWith(a2)) {
|
|
2620
2694
|
return true;
|
|
2621
2695
|
}
|
|
2622
2696
|
}
|
|
@@ -2631,8 +2705,8 @@ var require_parse2 = __commonJS({
|
|
|
2631
2705
|
let paren = 0;
|
|
2632
2706
|
let quote = 0;
|
|
2633
2707
|
let escaped = false;
|
|
2634
|
-
for (let
|
|
2635
|
-
const ch = pattern[
|
|
2708
|
+
for (let i2 = 1; i2 < pattern.length; i2++) {
|
|
2709
|
+
const ch = pattern[i2];
|
|
2636
2710
|
if (escaped === true) {
|
|
2637
2711
|
escaped = false;
|
|
2638
2712
|
continue;
|
|
@@ -2666,13 +2740,13 @@ var require_parse2 = __commonJS({
|
|
|
2666
2740
|
if (ch === ")") {
|
|
2667
2741
|
paren--;
|
|
2668
2742
|
if (paren === 0) {
|
|
2669
|
-
if (requireEnd === true &&
|
|
2743
|
+
if (requireEnd === true && i2 !== pattern.length - 1) {
|
|
2670
2744
|
return;
|
|
2671
2745
|
}
|
|
2672
2746
|
return {
|
|
2673
2747
|
type: pattern[0],
|
|
2674
|
-
body: pattern.slice(2,
|
|
2675
|
-
end:
|
|
2748
|
+
body: pattern.slice(2, i2),
|
|
2749
|
+
end: i2
|
|
2676
2750
|
};
|
|
2677
2751
|
}
|
|
2678
2752
|
}
|
|
@@ -2804,7 +2878,7 @@ var require_parse2 = __commonJS({
|
|
|
2804
2878
|
let prev = bos;
|
|
2805
2879
|
let value;
|
|
2806
2880
|
const eos = () => state.index === len - 1;
|
|
2807
|
-
const peek = state.peek = (
|
|
2881
|
+
const peek = state.peek = (n2 = 1) => input[state.index + n2];
|
|
2808
2882
|
const advance = state.advance = () => input[++state.index] || "";
|
|
2809
2883
|
const remaining = () => input.slice(state.index + 1);
|
|
2810
2884
|
const consume = (value2 = "", num = 0) => {
|
|
@@ -2885,10 +2959,10 @@ var require_parse2 = __commonJS({
|
|
|
2885
2959
|
open.type = "text";
|
|
2886
2960
|
open.value = literal;
|
|
2887
2961
|
open.output = safeOutput || utils.escapeRegex(literal);
|
|
2888
|
-
for (let
|
|
2889
|
-
tokens[
|
|
2890
|
-
tokens[
|
|
2891
|
-
delete tokens[
|
|
2962
|
+
for (let i2 = token.tokensIndex + 1; i2 < tokens.length; i2++) {
|
|
2963
|
+
tokens[i2].value = "";
|
|
2964
|
+
tokens[i2].output = "";
|
|
2965
|
+
delete tokens[i2].suffix;
|
|
2892
2966
|
}
|
|
2893
2967
|
state.output = token.output + open.output;
|
|
2894
2968
|
state.backtrack = true;
|
|
@@ -3131,13 +3205,13 @@ var require_parse2 = __commonJS({
|
|
|
3131
3205
|
if (brace.dots === true) {
|
|
3132
3206
|
const arr = tokens.slice();
|
|
3133
3207
|
const range = [];
|
|
3134
|
-
for (let
|
|
3208
|
+
for (let i2 = arr.length - 1; i2 >= 0; i2--) {
|
|
3135
3209
|
tokens.pop();
|
|
3136
|
-
if (arr[
|
|
3210
|
+
if (arr[i2].type === "brace") {
|
|
3137
3211
|
break;
|
|
3138
3212
|
}
|
|
3139
|
-
if (arr[
|
|
3140
|
-
range.unshift(arr[
|
|
3213
|
+
if (arr[i2].type !== "dots") {
|
|
3214
|
+
range.unshift(arr[i2].value);
|
|
3141
3215
|
}
|
|
3142
3216
|
}
|
|
3143
3217
|
output = expandRange(range, opts);
|
|
@@ -3680,8 +3754,8 @@ var require_micromatch = __commonJS({
|
|
|
3680
3754
|
options.onResult(state);
|
|
3681
3755
|
}
|
|
3682
3756
|
};
|
|
3683
|
-
for (let
|
|
3684
|
-
let isMatch = picomatch(String(patterns[
|
|
3757
|
+
for (let i2 = 0; i2 < patterns.length; i2++) {
|
|
3758
|
+
let isMatch = picomatch(String(patterns[i2]), { ...options, onResult }, true);
|
|
3685
3759
|
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
|
|
3686
3760
|
if (negated) negatives++;
|
|
3687
3761
|
for (let item of list) {
|
|
@@ -3929,7 +4003,7 @@ var require_pattern = __commonJS({
|
|
|
3929
4003
|
exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
|
3930
4004
|
function expandBraceExpansion(pattern) {
|
|
3931
4005
|
const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });
|
|
3932
|
-
patterns.sort((
|
|
4006
|
+
patterns.sort((a2, b) => a2.length - b.length);
|
|
3933
4007
|
return patterns.filter((pattern2) => pattern2 !== "");
|
|
3934
4008
|
}
|
|
3935
4009
|
exports.expandBraceExpansion = expandBraceExpansion;
|
|
@@ -4010,8 +4084,8 @@ var require_merge2 = __commonJS({
|
|
|
4010
4084
|
}
|
|
4011
4085
|
const mergedStream = PassThrough(options);
|
|
4012
4086
|
function addStream() {
|
|
4013
|
-
for (let
|
|
4014
|
-
streamsQueue.push(pauseStreams(arguments[
|
|
4087
|
+
for (let i2 = 0, len = arguments.length; i2 < len; i2++) {
|
|
4088
|
+
streamsQueue.push(pauseStreams(arguments[i2], options));
|
|
4015
4089
|
}
|
|
4016
4090
|
mergeStream();
|
|
4017
4091
|
return this;
|
|
@@ -4060,8 +4134,8 @@ var require_merge2 = __commonJS({
|
|
|
4060
4134
|
stream.pipe(mergedStream, { end: false });
|
|
4061
4135
|
stream.resume();
|
|
4062
4136
|
}
|
|
4063
|
-
for (let
|
|
4064
|
-
pipe(streams[
|
|
4137
|
+
for (let i2 = 0; i2 < streams.length; i2++) {
|
|
4138
|
+
pipe(streams[i2]);
|
|
4065
4139
|
}
|
|
4066
4140
|
next();
|
|
4067
4141
|
}
|
|
@@ -4092,8 +4166,8 @@ var require_merge2 = __commonJS({
|
|
|
4092
4166
|
}
|
|
4093
4167
|
streams.pause();
|
|
4094
4168
|
} else {
|
|
4095
|
-
for (let
|
|
4096
|
-
streams[
|
|
4169
|
+
for (let i2 = 0, len = streams.length; i2 < len; i2++) {
|
|
4170
|
+
streams[i2] = pauseStreams(streams[i2], options);
|
|
4097
4171
|
}
|
|
4098
4172
|
}
|
|
4099
4173
|
return streams;
|
|
@@ -4175,13 +4249,13 @@ var require_tasks = __commonJS({
|
|
|
4175
4249
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4176
4250
|
exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
|
|
4177
4251
|
var utils = require_utils3();
|
|
4178
|
-
function generate(input,
|
|
4179
|
-
const patterns = processPatterns(input,
|
|
4180
|
-
const ignore = processPatterns(
|
|
4252
|
+
function generate(input, settings2) {
|
|
4253
|
+
const patterns = processPatterns(input, settings2);
|
|
4254
|
+
const ignore = processPatterns(settings2.ignore, settings2);
|
|
4181
4255
|
const positivePatterns = getPositivePatterns(patterns);
|
|
4182
4256
|
const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
|
|
4183
|
-
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern,
|
|
4184
|
-
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern,
|
|
4257
|
+
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings2));
|
|
4258
|
+
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings2));
|
|
4185
4259
|
const staticTasks = convertPatternsToTasks(
|
|
4186
4260
|
staticPatterns,
|
|
4187
4261
|
negativePatterns,
|
|
@@ -4197,12 +4271,12 @@ var require_tasks = __commonJS({
|
|
|
4197
4271
|
return staticTasks.concat(dynamicTasks);
|
|
4198
4272
|
}
|
|
4199
4273
|
exports.generate = generate;
|
|
4200
|
-
function processPatterns(input,
|
|
4274
|
+
function processPatterns(input, settings2) {
|
|
4201
4275
|
let patterns = input;
|
|
4202
|
-
if (
|
|
4276
|
+
if (settings2.braceExpansion) {
|
|
4203
4277
|
patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);
|
|
4204
4278
|
}
|
|
4205
|
-
if (
|
|
4279
|
+
if (settings2.baseNameMatch) {
|
|
4206
4280
|
patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`);
|
|
4207
4281
|
}
|
|
4208
4282
|
return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));
|
|
@@ -4271,26 +4345,26 @@ var require_async = __commonJS({
|
|
|
4271
4345
|
init_utils2();
|
|
4272
4346
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4273
4347
|
exports.read = void 0;
|
|
4274
|
-
function read(path,
|
|
4275
|
-
|
|
4348
|
+
function read(path, settings2, callback) {
|
|
4349
|
+
settings2.fs.lstat(path, (lstatError, lstat) => {
|
|
4276
4350
|
if (lstatError !== null) {
|
|
4277
4351
|
callFailureCallback(callback, lstatError);
|
|
4278
4352
|
return;
|
|
4279
4353
|
}
|
|
4280
|
-
if (!lstat.isSymbolicLink() || !
|
|
4354
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
4281
4355
|
callSuccessCallback(callback, lstat);
|
|
4282
4356
|
return;
|
|
4283
4357
|
}
|
|
4284
|
-
|
|
4358
|
+
settings2.fs.stat(path, (statError, stat) => {
|
|
4285
4359
|
if (statError !== null) {
|
|
4286
|
-
if (
|
|
4360
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4287
4361
|
callFailureCallback(callback, statError);
|
|
4288
4362
|
return;
|
|
4289
4363
|
}
|
|
4290
4364
|
callSuccessCallback(callback, lstat);
|
|
4291
4365
|
return;
|
|
4292
4366
|
}
|
|
4293
|
-
if (
|
|
4367
|
+
if (settings2.markSymbolicLink) {
|
|
4294
4368
|
stat.isSymbolicLink = () => true;
|
|
4295
4369
|
}
|
|
4296
4370
|
callSuccessCallback(callback, stat);
|
|
@@ -4314,19 +4388,19 @@ var require_sync = __commonJS({
|
|
|
4314
4388
|
init_utils2();
|
|
4315
4389
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4316
4390
|
exports.read = void 0;
|
|
4317
|
-
function read(path,
|
|
4318
|
-
const lstat =
|
|
4319
|
-
if (!lstat.isSymbolicLink() || !
|
|
4391
|
+
function read(path, settings2) {
|
|
4392
|
+
const lstat = settings2.fs.lstatSync(path);
|
|
4393
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
4320
4394
|
return lstat;
|
|
4321
4395
|
}
|
|
4322
4396
|
try {
|
|
4323
|
-
const stat =
|
|
4324
|
-
if (
|
|
4397
|
+
const stat = settings2.fs.statSync(path);
|
|
4398
|
+
if (settings2.markSymbolicLink) {
|
|
4325
4399
|
stat.isSymbolicLink = () => true;
|
|
4326
4400
|
}
|
|
4327
4401
|
return stat;
|
|
4328
4402
|
} catch (error2) {
|
|
4329
|
-
if (!
|
|
4403
|
+
if (!settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4330
4404
|
return lstat;
|
|
4331
4405
|
}
|
|
4332
4406
|
throw error2;
|
|
@@ -4403,8 +4477,8 @@ var require_out = __commonJS({
|
|
|
4403
4477
|
}
|
|
4404
4478
|
exports.stat = stat;
|
|
4405
4479
|
function statSync2(path, optionsOrSettings) {
|
|
4406
|
-
const
|
|
4407
|
-
return sync.read(path,
|
|
4480
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
4481
|
+
return sync.read(path, settings2);
|
|
4408
4482
|
}
|
|
4409
4483
|
exports.statSync = statSync2;
|
|
4410
4484
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -4452,8 +4526,8 @@ var require_run_parallel = __commonJS({
|
|
|
4452
4526
|
if (isSync) queueMicrotask2(end);
|
|
4453
4527
|
else end();
|
|
4454
4528
|
}
|
|
4455
|
-
function each(
|
|
4456
|
-
results[
|
|
4529
|
+
function each(i2, err, result) {
|
|
4530
|
+
results[i2] = result;
|
|
4457
4531
|
if (--pending === 0 || err) {
|
|
4458
4532
|
done(err);
|
|
4459
4533
|
}
|
|
@@ -4467,9 +4541,9 @@ var require_run_parallel = __commonJS({
|
|
|
4467
4541
|
});
|
|
4468
4542
|
});
|
|
4469
4543
|
} else {
|
|
4470
|
-
tasks.forEach(function(task,
|
|
4544
|
+
tasks.forEach(function(task, i2) {
|
|
4471
4545
|
task(function(err, result) {
|
|
4472
|
-
each(
|
|
4546
|
+
each(i2, err, result);
|
|
4473
4547
|
});
|
|
4474
4548
|
});
|
|
4475
4549
|
}
|
|
@@ -4544,11 +4618,11 @@ var require_common = __commonJS({
|
|
|
4544
4618
|
init_utils2();
|
|
4545
4619
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4546
4620
|
exports.joinPathSegments = void 0;
|
|
4547
|
-
function joinPathSegments(
|
|
4548
|
-
if (
|
|
4549
|
-
return
|
|
4621
|
+
function joinPathSegments(a2, b, separator) {
|
|
4622
|
+
if (a2.endsWith(separator)) {
|
|
4623
|
+
return a2 + b;
|
|
4550
4624
|
}
|
|
4551
|
-
return
|
|
4625
|
+
return a2 + separator + b;
|
|
4552
4626
|
}
|
|
4553
4627
|
exports.joinPathSegments = joinPathSegments;
|
|
4554
4628
|
}
|
|
@@ -4566,16 +4640,16 @@ var require_async2 = __commonJS({
|
|
|
4566
4640
|
var constants_1 = require_constants3();
|
|
4567
4641
|
var utils = require_utils4();
|
|
4568
4642
|
var common = require_common();
|
|
4569
|
-
function read(directory,
|
|
4570
|
-
if (!
|
|
4571
|
-
readdirWithFileTypes(directory,
|
|
4643
|
+
function read(directory, settings2, callback) {
|
|
4644
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
4645
|
+
readdirWithFileTypes(directory, settings2, callback);
|
|
4572
4646
|
return;
|
|
4573
4647
|
}
|
|
4574
|
-
readdir(directory,
|
|
4648
|
+
readdir(directory, settings2, callback);
|
|
4575
4649
|
}
|
|
4576
4650
|
exports.read = read;
|
|
4577
|
-
function readdirWithFileTypes(directory,
|
|
4578
|
-
|
|
4651
|
+
function readdirWithFileTypes(directory, settings2, callback) {
|
|
4652
|
+
settings2.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
|
|
4579
4653
|
if (readdirError !== null) {
|
|
4580
4654
|
callFailureCallback(callback, readdirError);
|
|
4581
4655
|
return;
|
|
@@ -4583,13 +4657,13 @@ var require_async2 = __commonJS({
|
|
|
4583
4657
|
const entries = dirents.map((dirent) => ({
|
|
4584
4658
|
dirent,
|
|
4585
4659
|
name: dirent.name,
|
|
4586
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
4660
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
4587
4661
|
}));
|
|
4588
|
-
if (!
|
|
4662
|
+
if (!settings2.followSymbolicLinks) {
|
|
4589
4663
|
callSuccessCallback(callback, entries);
|
|
4590
4664
|
return;
|
|
4591
4665
|
}
|
|
4592
|
-
const tasks = entries.map((entry) => makeRplTaskEntry(entry,
|
|
4666
|
+
const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings2));
|
|
4593
4667
|
rpl(tasks, (rplError, rplEntries) => {
|
|
4594
4668
|
if (rplError !== null) {
|
|
4595
4669
|
callFailureCallback(callback, rplError);
|
|
@@ -4600,15 +4674,15 @@ var require_async2 = __commonJS({
|
|
|
4600
4674
|
});
|
|
4601
4675
|
}
|
|
4602
4676
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
4603
|
-
function makeRplTaskEntry(entry,
|
|
4677
|
+
function makeRplTaskEntry(entry, settings2) {
|
|
4604
4678
|
return (done) => {
|
|
4605
4679
|
if (!entry.dirent.isSymbolicLink()) {
|
|
4606
4680
|
done(null, entry);
|
|
4607
4681
|
return;
|
|
4608
4682
|
}
|
|
4609
|
-
|
|
4683
|
+
settings2.fs.stat(entry.path, (statError, stats) => {
|
|
4610
4684
|
if (statError !== null) {
|
|
4611
|
-
if (
|
|
4685
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4612
4686
|
done(statError);
|
|
4613
4687
|
return;
|
|
4614
4688
|
}
|
|
@@ -4620,16 +4694,16 @@ var require_async2 = __commonJS({
|
|
|
4620
4694
|
});
|
|
4621
4695
|
};
|
|
4622
4696
|
}
|
|
4623
|
-
function readdir(directory,
|
|
4624
|
-
|
|
4697
|
+
function readdir(directory, settings2, callback) {
|
|
4698
|
+
settings2.fs.readdir(directory, (readdirError, names) => {
|
|
4625
4699
|
if (readdirError !== null) {
|
|
4626
4700
|
callFailureCallback(callback, readdirError);
|
|
4627
4701
|
return;
|
|
4628
4702
|
}
|
|
4629
4703
|
const tasks = names.map((name) => {
|
|
4630
|
-
const path = common.joinPathSegments(directory, name,
|
|
4704
|
+
const path = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
4631
4705
|
return (done) => {
|
|
4632
|
-
fsStat.stat(path,
|
|
4706
|
+
fsStat.stat(path, settings2.fsStatSettings, (error2, stats) => {
|
|
4633
4707
|
if (error2 !== null) {
|
|
4634
4708
|
done(error2);
|
|
4635
4709
|
return;
|
|
@@ -4639,7 +4713,7 @@ var require_async2 = __commonJS({
|
|
|
4639
4713
|
path,
|
|
4640
4714
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
4641
4715
|
};
|
|
4642
|
-
if (
|
|
4716
|
+
if (settings2.stats) {
|
|
4643
4717
|
entry.stats = stats;
|
|
4644
4718
|
}
|
|
4645
4719
|
done(null, entry);
|
|
@@ -4676,27 +4750,27 @@ var require_sync2 = __commonJS({
|
|
|
4676
4750
|
var constants_1 = require_constants3();
|
|
4677
4751
|
var utils = require_utils4();
|
|
4678
4752
|
var common = require_common();
|
|
4679
|
-
function read(directory,
|
|
4680
|
-
if (!
|
|
4681
|
-
return readdirWithFileTypes(directory,
|
|
4753
|
+
function read(directory, settings2) {
|
|
4754
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
4755
|
+
return readdirWithFileTypes(directory, settings2);
|
|
4682
4756
|
}
|
|
4683
|
-
return readdir(directory,
|
|
4757
|
+
return readdir(directory, settings2);
|
|
4684
4758
|
}
|
|
4685
4759
|
exports.read = read;
|
|
4686
|
-
function readdirWithFileTypes(directory,
|
|
4687
|
-
const dirents =
|
|
4760
|
+
function readdirWithFileTypes(directory, settings2) {
|
|
4761
|
+
const dirents = settings2.fs.readdirSync(directory, { withFileTypes: true });
|
|
4688
4762
|
return dirents.map((dirent) => {
|
|
4689
4763
|
const entry = {
|
|
4690
4764
|
dirent,
|
|
4691
4765
|
name: dirent.name,
|
|
4692
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
4766
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
4693
4767
|
};
|
|
4694
|
-
if (entry.dirent.isSymbolicLink() &&
|
|
4768
|
+
if (entry.dirent.isSymbolicLink() && settings2.followSymbolicLinks) {
|
|
4695
4769
|
try {
|
|
4696
|
-
const stats =
|
|
4770
|
+
const stats = settings2.fs.statSync(entry.path);
|
|
4697
4771
|
entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
|
4698
4772
|
} catch (error2) {
|
|
4699
|
-
if (
|
|
4773
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4700
4774
|
throw error2;
|
|
4701
4775
|
}
|
|
4702
4776
|
}
|
|
@@ -4705,17 +4779,17 @@ var require_sync2 = __commonJS({
|
|
|
4705
4779
|
});
|
|
4706
4780
|
}
|
|
4707
4781
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
4708
|
-
function readdir(directory,
|
|
4709
|
-
const names =
|
|
4782
|
+
function readdir(directory, settings2) {
|
|
4783
|
+
const names = settings2.fs.readdirSync(directory);
|
|
4710
4784
|
return names.map((name) => {
|
|
4711
|
-
const entryPath = common.joinPathSegments(directory, name,
|
|
4712
|
-
const stats = fsStat.statSync(entryPath,
|
|
4785
|
+
const entryPath = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
4786
|
+
const stats = fsStat.statSync(entryPath, settings2.fsStatSettings);
|
|
4713
4787
|
const entry = {
|
|
4714
4788
|
name,
|
|
4715
4789
|
path: entryPath,
|
|
4716
4790
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
4717
4791
|
};
|
|
4718
|
-
if (
|
|
4792
|
+
if (settings2.stats) {
|
|
4719
4793
|
entry.stats = stats;
|
|
4720
4794
|
}
|
|
4721
4795
|
return entry;
|
|
@@ -4802,8 +4876,8 @@ var require_out2 = __commonJS({
|
|
|
4802
4876
|
}
|
|
4803
4877
|
exports.scandir = scandir;
|
|
4804
4878
|
function scandirSync(path, optionsOrSettings) {
|
|
4805
|
-
const
|
|
4806
|
-
return sync.read(path,
|
|
4879
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
4880
|
+
return sync.read(path, settings2);
|
|
4807
4881
|
}
|
|
4808
4882
|
exports.scandirSync = scandirSync;
|
|
4809
4883
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -5139,11 +5213,11 @@ var require_common2 = __commonJS({
|
|
|
5139
5213
|
init_utils2();
|
|
5140
5214
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5141
5215
|
exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
|
|
5142
|
-
function isFatalError(
|
|
5143
|
-
if (
|
|
5216
|
+
function isFatalError(settings2, error2) {
|
|
5217
|
+
if (settings2.errorFilter === null) {
|
|
5144
5218
|
return true;
|
|
5145
5219
|
}
|
|
5146
|
-
return !
|
|
5220
|
+
return !settings2.errorFilter(error2);
|
|
5147
5221
|
}
|
|
5148
5222
|
exports.isFatalError = isFatalError;
|
|
5149
5223
|
function isAppliedFilter(filter, value) {
|
|
@@ -5154,14 +5228,14 @@ var require_common2 = __commonJS({
|
|
|
5154
5228
|
return filepath.split(/[/\\]/).join(separator);
|
|
5155
5229
|
}
|
|
5156
5230
|
exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
|
|
5157
|
-
function joinPathSegments(
|
|
5158
|
-
if (
|
|
5231
|
+
function joinPathSegments(a2, b, separator) {
|
|
5232
|
+
if (a2 === "") {
|
|
5159
5233
|
return b;
|
|
5160
5234
|
}
|
|
5161
|
-
if (
|
|
5162
|
-
return
|
|
5235
|
+
if (a2.endsWith(separator)) {
|
|
5236
|
+
return a2 + b;
|
|
5163
5237
|
}
|
|
5164
|
-
return
|
|
5238
|
+
return a2 + separator + b;
|
|
5165
5239
|
}
|
|
5166
5240
|
exports.joinPathSegments = joinPathSegments;
|
|
5167
5241
|
}
|
|
@@ -5508,14 +5582,14 @@ var require_out3 = __commonJS({
|
|
|
5508
5582
|
}
|
|
5509
5583
|
exports.walk = walk;
|
|
5510
5584
|
function walkSync(directory, optionsOrSettings) {
|
|
5511
|
-
const
|
|
5512
|
-
const provider = new sync_1.default(directory,
|
|
5585
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5586
|
+
const provider = new sync_1.default(directory, settings2);
|
|
5513
5587
|
return provider.read();
|
|
5514
5588
|
}
|
|
5515
5589
|
exports.walkSync = walkSync;
|
|
5516
5590
|
function walkStream(directory, optionsOrSettings) {
|
|
5517
|
-
const
|
|
5518
|
-
const provider = new stream_1.default(directory,
|
|
5591
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5592
|
+
const provider = new stream_1.default(directory, settings2);
|
|
5519
5593
|
return provider.read();
|
|
5520
5594
|
}
|
|
5521
5595
|
exports.walkStream = walkStream;
|
|
@@ -5601,8 +5675,8 @@ var require_stream3 = __commonJS({
|
|
|
5601
5675
|
done();
|
|
5602
5676
|
}).catch(done);
|
|
5603
5677
|
};
|
|
5604
|
-
for (let
|
|
5605
|
-
stream.write(
|
|
5678
|
+
for (let i2 = 0; i2 < filepaths.length; i2++) {
|
|
5679
|
+
stream.write(i2);
|
|
5606
5680
|
}
|
|
5607
5681
|
return stream;
|
|
5608
5682
|
}
|
|
@@ -6263,14 +6337,14 @@ var require_out4 = __commonJS({
|
|
|
6263
6337
|
function generateTasks(source, options) {
|
|
6264
6338
|
assertPatternsInput(source);
|
|
6265
6339
|
const patterns = [].concat(source);
|
|
6266
|
-
const
|
|
6267
|
-
return taskManager.generate(patterns,
|
|
6340
|
+
const settings2 = new settings_1.default(options);
|
|
6341
|
+
return taskManager.generate(patterns, settings2);
|
|
6268
6342
|
}
|
|
6269
6343
|
FastGlob2.generateTasks = generateTasks;
|
|
6270
6344
|
function isDynamicPattern(source, options) {
|
|
6271
6345
|
assertPatternsInput(source);
|
|
6272
|
-
const
|
|
6273
|
-
return utils.pattern.isDynamicPattern(source,
|
|
6346
|
+
const settings2 = new settings_1.default(options);
|
|
6347
|
+
return utils.pattern.isDynamicPattern(source, settings2);
|
|
6274
6348
|
}
|
|
6275
6349
|
FastGlob2.isDynamicPattern = isDynamicPattern;
|
|
6276
6350
|
function escapePath(source) {
|
|
@@ -6312,9 +6386,9 @@ var require_out4 = __commonJS({
|
|
|
6312
6386
|
})(FastGlob || (FastGlob = {}));
|
|
6313
6387
|
function getWorks(source, _Provider, options) {
|
|
6314
6388
|
const patterns = [].concat(source);
|
|
6315
|
-
const
|
|
6316
|
-
const tasks = taskManager.generate(patterns,
|
|
6317
|
-
const provider = new _Provider(
|
|
6389
|
+
const settings2 = new settings_1.default(options);
|
|
6390
|
+
const tasks = taskManager.generate(patterns, settings2);
|
|
6391
|
+
const provider = new _Provider(settings2);
|
|
6318
6392
|
return tasks.map(provider.read, provider);
|
|
6319
6393
|
}
|
|
6320
6394
|
function assertPatternsInput(input) {
|
|
@@ -6492,8 +6566,8 @@ import "node:fs";
|
|
|
6492
6566
|
import { createRequire } from "node:module";
|
|
6493
6567
|
import {
|
|
6494
6568
|
resolve,
|
|
6495
|
-
join,
|
|
6496
|
-
dirname,
|
|
6569
|
+
join as join2,
|
|
6570
|
+
dirname as dirname2,
|
|
6497
6571
|
relative,
|
|
6498
6572
|
normalize,
|
|
6499
6573
|
sep,
|
|
@@ -6507,7 +6581,7 @@ function safeExecuteAsync(fn, message) {
|
|
|
6507
6581
|
);
|
|
6508
6582
|
});
|
|
6509
6583
|
}
|
|
6510
|
-
var import_fast_glob, constants,
|
|
6584
|
+
var import_fast_glob, constants, log3, PACKAGE_PATHS, PathResolver;
|
|
6511
6585
|
var init_PathResolver = __esm({
|
|
6512
6586
|
"packages/core/config/utils/PathResolver.ts"() {
|
|
6513
6587
|
"use strict";
|
|
@@ -6520,7 +6594,7 @@ var init_PathResolver = __esm({
|
|
|
6520
6594
|
getPatternsFor: getPatternsFor || void 0,
|
|
6521
6595
|
I18N_PATHS: I18N_PATHS || void 0
|
|
6522
6596
|
};
|
|
6523
|
-
|
|
6597
|
+
log3 = {
|
|
6524
6598
|
error: (message, error2) => {
|
|
6525
6599
|
},
|
|
6526
6600
|
warn: (message, error2) => {
|
|
@@ -6641,7 +6715,7 @@ var init_PathResolver = __esm({
|
|
|
6641
6715
|
*/
|
|
6642
6716
|
getDirname(path) {
|
|
6643
6717
|
if (!path) return "";
|
|
6644
|
-
return this.normalizePath(
|
|
6718
|
+
return this.normalizePath(dirname2(path));
|
|
6645
6719
|
}
|
|
6646
6720
|
/**
|
|
6647
6721
|
* Resolve package path using Node's module resolution
|
|
@@ -6653,7 +6727,7 @@ var init_PathResolver = __esm({
|
|
|
6653
6727
|
resolvePackage(packageSpecifier, fromPath = null) {
|
|
6654
6728
|
try {
|
|
6655
6729
|
const basePath = fromPath || this.getAppRoot();
|
|
6656
|
-
const require3 = createRequire(
|
|
6730
|
+
const require3 = createRequire(join2(basePath, "package.json"));
|
|
6657
6731
|
const resolved = require3.resolve(packageSpecifier);
|
|
6658
6732
|
return this.normalizePath(resolved);
|
|
6659
6733
|
} catch (error2) {
|
|
@@ -6805,7 +6879,7 @@ var init_PathResolver = __esm({
|
|
|
6805
6879
|
return cleanContent;
|
|
6806
6880
|
} catch (error2) {
|
|
6807
6881
|
if (this.options.debug) {
|
|
6808
|
-
|
|
6882
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
6809
6883
|
}
|
|
6810
6884
|
return null;
|
|
6811
6885
|
}
|
|
@@ -6833,7 +6907,7 @@ var init_PathResolver = __esm({
|
|
|
6833
6907
|
return cleanContent;
|
|
6834
6908
|
} catch (error2) {
|
|
6835
6909
|
if (this.options.debug) {
|
|
6836
|
-
|
|
6910
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
6837
6911
|
}
|
|
6838
6912
|
return null;
|
|
6839
6913
|
}
|
|
@@ -6855,16 +6929,16 @@ var init_PathResolver = __esm({
|
|
|
6855
6929
|
verbose = false
|
|
6856
6930
|
} = options;
|
|
6857
6931
|
const normalizedPath = this.normalizePath(filePath);
|
|
6858
|
-
const dir = this.normalizePath(
|
|
6932
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
6859
6933
|
const fileExists = this.pathExists(normalizedPath);
|
|
6860
6934
|
if (fileExists && !overwrite) {
|
|
6861
6935
|
if (verbose) {
|
|
6862
|
-
|
|
6936
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
6863
6937
|
}
|
|
6864
6938
|
return false;
|
|
6865
6939
|
}
|
|
6866
6940
|
if (dryRun) {
|
|
6867
|
-
|
|
6941
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
6868
6942
|
return true;
|
|
6869
6943
|
}
|
|
6870
6944
|
try {
|
|
@@ -6889,7 +6963,7 @@ var init_PathResolver = __esm({
|
|
|
6889
6963
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
6890
6964
|
}
|
|
6891
6965
|
if (verbose) {
|
|
6892
|
-
|
|
6966
|
+
log3.info(
|
|
6893
6967
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
6894
6968
|
);
|
|
6895
6969
|
}
|
|
@@ -6916,16 +6990,16 @@ var init_PathResolver = __esm({
|
|
|
6916
6990
|
verbose = false
|
|
6917
6991
|
} = options;
|
|
6918
6992
|
const normalizedPath = this.normalizePath(filePath);
|
|
6919
|
-
const dir = this.normalizePath(
|
|
6993
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
6920
6994
|
const fileExists = this.pathExists(normalizedPath);
|
|
6921
6995
|
if (fileExists && !overwrite) {
|
|
6922
6996
|
if (verbose) {
|
|
6923
|
-
|
|
6997
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
6924
6998
|
}
|
|
6925
6999
|
return false;
|
|
6926
7000
|
}
|
|
6927
7001
|
if (dryRun) {
|
|
6928
|
-
|
|
7002
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
6929
7003
|
return true;
|
|
6930
7004
|
}
|
|
6931
7005
|
try {
|
|
@@ -6949,7 +7023,7 @@ var init_PathResolver = __esm({
|
|
|
6949
7023
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
6950
7024
|
}
|
|
6951
7025
|
if (verbose) {
|
|
6952
|
-
|
|
7026
|
+
log3.info(
|
|
6953
7027
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
6954
7028
|
);
|
|
6955
7029
|
}
|
|
@@ -6974,15 +7048,15 @@ var init_PathResolver = __esm({
|
|
|
6974
7048
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
6975
7049
|
if (fileExists && !overwrite) {
|
|
6976
7050
|
if (verbose) {
|
|
6977
|
-
|
|
7051
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
6978
7052
|
}
|
|
6979
7053
|
return false;
|
|
6980
7054
|
}
|
|
6981
7055
|
if (dryRun) {
|
|
6982
|
-
|
|
7056
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
6983
7057
|
return true;
|
|
6984
7058
|
}
|
|
6985
|
-
const dir = this.normalizePath(
|
|
7059
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
6986
7060
|
try {
|
|
6987
7061
|
await fs.promises.mkdir(dir, { recursive: true });
|
|
6988
7062
|
} catch (error2) {
|
|
@@ -6992,7 +7066,7 @@ var init_PathResolver = __esm({
|
|
|
6992
7066
|
return await safeExecuteAsync(async () => {
|
|
6993
7067
|
await fs.promises.copyFile(srcPath, normalizedDestPath);
|
|
6994
7068
|
if (verbose) {
|
|
6995
|
-
|
|
7069
|
+
log3.info(
|
|
6996
7070
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
6997
7071
|
);
|
|
6998
7072
|
}
|
|
@@ -7016,15 +7090,15 @@ var init_PathResolver = __esm({
|
|
|
7016
7090
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7017
7091
|
if (fileExists && !overwrite) {
|
|
7018
7092
|
if (verbose) {
|
|
7019
|
-
|
|
7093
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7020
7094
|
}
|
|
7021
7095
|
return false;
|
|
7022
7096
|
}
|
|
7023
7097
|
if (dryRun) {
|
|
7024
|
-
|
|
7098
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7025
7099
|
return true;
|
|
7026
7100
|
}
|
|
7027
|
-
const dir = this.normalizePath(
|
|
7101
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7028
7102
|
try {
|
|
7029
7103
|
fs.mkdirSync(dir, { recursive: true });
|
|
7030
7104
|
} catch (error2) {
|
|
@@ -7033,7 +7107,7 @@ var init_PathResolver = __esm({
|
|
|
7033
7107
|
try {
|
|
7034
7108
|
fs.copyFileSync(srcPath, normalizedDestPath);
|
|
7035
7109
|
if (verbose) {
|
|
7036
|
-
|
|
7110
|
+
log3.info(
|
|
7037
7111
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7038
7112
|
);
|
|
7039
7113
|
}
|
|
@@ -7050,7 +7124,7 @@ var init_PathResolver = __esm({
|
|
|
7050
7124
|
return fs.existsSync(filePath);
|
|
7051
7125
|
} catch (error2) {
|
|
7052
7126
|
if (!silent) {
|
|
7053
|
-
|
|
7127
|
+
log3.error(`Error checking path existence: ${filePath}`, error2);
|
|
7054
7128
|
}
|
|
7055
7129
|
return false;
|
|
7056
7130
|
}
|
|
@@ -7076,7 +7150,7 @@ var init_PathResolver = __esm({
|
|
|
7076
7150
|
return fs.readdirSync(dirPath, options);
|
|
7077
7151
|
} catch (error2) {
|
|
7078
7152
|
if (this.options.debug) {
|
|
7079
|
-
|
|
7153
|
+
log3.warn(`Failed to read directory: ${dirPath}`, error2);
|
|
7080
7154
|
}
|
|
7081
7155
|
const isObjectOptions = options && typeof options === "object" && "withFileTypes" in options;
|
|
7082
7156
|
return isObjectOptions && options.withFileTypes ? [] : [];
|
|
@@ -7094,7 +7168,7 @@ var init_PathResolver = __esm({
|
|
|
7094
7168
|
return fs.statSync(filePath);
|
|
7095
7169
|
} catch (error2) {
|
|
7096
7170
|
if (this.options.debug) {
|
|
7097
|
-
|
|
7171
|
+
log3.warn(`Failed to stat file: ${filePath}`, error2);
|
|
7098
7172
|
}
|
|
7099
7173
|
return null;
|
|
7100
7174
|
}
|
|
@@ -7111,7 +7185,7 @@ var init_PathResolver = __esm({
|
|
|
7111
7185
|
return fs.lstatSync(filePath);
|
|
7112
7186
|
} catch (error2) {
|
|
7113
7187
|
if (this.options.debug) {
|
|
7114
|
-
|
|
7188
|
+
log3.warn(`Failed to lstat file: ${filePath}`, error2);
|
|
7115
7189
|
}
|
|
7116
7190
|
return null;
|
|
7117
7191
|
}
|
|
@@ -7200,7 +7274,7 @@ var init_PathResolver = __esm({
|
|
|
7200
7274
|
* @returns True if repoRoot is the monorepo (has packages directory)
|
|
7201
7275
|
*/
|
|
7202
7276
|
isMonorepo() {
|
|
7203
|
-
const packagesDir =
|
|
7277
|
+
const packagesDir = join2(this._repoRoot, "packages");
|
|
7204
7278
|
return this.pathExists(packagesDir);
|
|
7205
7279
|
}
|
|
7206
7280
|
/**
|
|
@@ -7217,7 +7291,7 @@ var init_PathResolver = __esm({
|
|
|
7217
7291
|
* Find files matching pattern within directory
|
|
7218
7292
|
*/
|
|
7219
7293
|
async findFiles(directory, pattern, options = {}) {
|
|
7220
|
-
const searchPattern = this.normalizePath(
|
|
7294
|
+
const searchPattern = this.normalizePath(join2(directory, pattern));
|
|
7221
7295
|
const appRoot = this.getAppRoot();
|
|
7222
7296
|
const normalizeAppRoot = this.normalizePath(appRoot);
|
|
7223
7297
|
const relativePattern = searchPattern.startsWith(normalizeAppRoot) ? searchPattern.slice(normalizeAppRoot.length + 1) : searchPattern;
|
|
@@ -7264,7 +7338,7 @@ var init_PathResolver = __esm({
|
|
|
7264
7338
|
return null;
|
|
7265
7339
|
}
|
|
7266
7340
|
const resolvedPath = this.normalizePath(
|
|
7267
|
-
|
|
7341
|
+
join2(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
|
|
7268
7342
|
);
|
|
7269
7343
|
const resolvedDir = resolvedPath.replace(/\/[^/]*\*.*$/, "");
|
|
7270
7344
|
if (this.pathExists(resolvedDir)) {
|
|
@@ -7460,13 +7534,13 @@ var init_PathResolver = __esm({
|
|
|
7460
7534
|
const maxLevels = this.options.maxLevels;
|
|
7461
7535
|
while (levelsChecked < maxLevels) {
|
|
7462
7536
|
const toolingPath = this.normalizePath(
|
|
7463
|
-
|
|
7537
|
+
join2(currentDir, PACKAGE_PATHS.TOOLING)
|
|
7464
7538
|
);
|
|
7465
|
-
const corePath = this.normalizePath(
|
|
7539
|
+
const corePath = this.normalizePath(join2(currentDir, PACKAGE_PATHS.CORE));
|
|
7466
7540
|
if (this.pathExists(toolingPath) && this.pathExists(corePath)) {
|
|
7467
7541
|
return currentDir;
|
|
7468
7542
|
}
|
|
7469
|
-
const appsDir =
|
|
7543
|
+
const appsDir = join2(currentDir, "apps");
|
|
7470
7544
|
if (this.pathExists(appsDir)) {
|
|
7471
7545
|
const appsDirStat = this.statSync(appsDir);
|
|
7472
7546
|
if (appsDirStat?.isDirectory()) {
|
|
@@ -7474,15 +7548,15 @@ var init_PathResolver = __esm({
|
|
|
7474
7548
|
}
|
|
7475
7549
|
}
|
|
7476
7550
|
const packageJsonPath = this.normalizePath(
|
|
7477
|
-
|
|
7551
|
+
join2(currentDir, "package.json")
|
|
7478
7552
|
);
|
|
7479
7553
|
if (this.pathExists(packageJsonPath)) {
|
|
7480
|
-
const parentDir2 = this.normalizePath(
|
|
7554
|
+
const parentDir2 = this.normalizePath(dirname2(currentDir));
|
|
7481
7555
|
if (parentDir2 === currentDir) {
|
|
7482
7556
|
return currentDir;
|
|
7483
7557
|
}
|
|
7484
7558
|
}
|
|
7485
|
-
const parentDir = this.normalizePath(
|
|
7559
|
+
const parentDir = this.normalizePath(dirname2(currentDir));
|
|
7486
7560
|
if (parentDir === currentDir) {
|
|
7487
7561
|
break;
|
|
7488
7562
|
}
|
|
@@ -7498,8 +7572,8 @@ var init_PathResolver = __esm({
|
|
|
7498
7572
|
// packages/tooling/src/utils/pathResolver.ts
|
|
7499
7573
|
import { createRequire as createRequire2 } from "node:module";
|
|
7500
7574
|
import {
|
|
7501
|
-
join as
|
|
7502
|
-
dirname as
|
|
7575
|
+
join as join3,
|
|
7576
|
+
dirname as dirname3,
|
|
7503
7577
|
basename as basename2,
|
|
7504
7578
|
extname as extname2,
|
|
7505
7579
|
relative as relative2,
|
|
@@ -7508,7 +7582,7 @@ import {
|
|
|
7508
7582
|
isAbsolute as pathIsAbsolute
|
|
7509
7583
|
} from "node:path";
|
|
7510
7584
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
7511
|
-
function
|
|
7585
|
+
function readdirSync3(dirPath, options) {
|
|
7512
7586
|
return pathResolverInstance.readdirSync(dirPath, options);
|
|
7513
7587
|
}
|
|
7514
7588
|
var pathResolverInstance, normalizePath, pathExists, readSync, writeSync, removeSync, getRelativePathBetween, getBasename, joinPath;
|
|
@@ -7519,7 +7593,7 @@ var init_pathResolver = __esm({
|
|
|
7519
7593
|
init_PathResolver();
|
|
7520
7594
|
pathResolverInstance = PathResolver.getInstance({ debug: false });
|
|
7521
7595
|
normalizePath = (...pathSegments) => {
|
|
7522
|
-
return pathResolverInstance.normalizePath(
|
|
7596
|
+
return pathResolverInstance.normalizePath(join3(...pathSegments));
|
|
7523
7597
|
};
|
|
7524
7598
|
pathExists = (filePath, silent = false) => pathResolverInstance.pathExists(filePath, silent);
|
|
7525
7599
|
readSync = (filePath, options) => pathResolverInstance.readSync(filePath, options);
|
|
@@ -7541,7 +7615,7 @@ var init_pathResolver = __esm({
|
|
|
7541
7615
|
import { Buffer } from "node:buffer";
|
|
7542
7616
|
import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
7543
7617
|
import { createRequire as createRequire3 } from "node:module";
|
|
7544
|
-
import { dirname as
|
|
7618
|
+
import { dirname as dirname4, resolve as resolve3 } from "node:path";
|
|
7545
7619
|
import process from "node:process";
|
|
7546
7620
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
7547
7621
|
var require2, __filename, __dirname;
|
|
@@ -7550,7 +7624,7 @@ var init_utils2 = __esm({
|
|
|
7550
7624
|
"use strict";
|
|
7551
7625
|
require2 = createRequire3(import.meta.url);
|
|
7552
7626
|
__filename = fileURLToPath3(import.meta.url);
|
|
7553
|
-
__dirname =
|
|
7627
|
+
__dirname = dirname4(__filename);
|
|
7554
7628
|
if (typeof globalThis !== "undefined") {
|
|
7555
7629
|
globalThis.require = require2;
|
|
7556
7630
|
globalThis.__filename = __filename;
|
|
@@ -7585,15 +7659,15 @@ async function main(options = {}) {
|
|
|
7585
7659
|
const verbose = options.verbose ?? false;
|
|
7586
7660
|
const rootDir = process.cwd();
|
|
7587
7661
|
if (dryRun) {
|
|
7588
|
-
|
|
7662
|
+
log2.info("DRY RUN MODE - No files will be modified");
|
|
7589
7663
|
}
|
|
7590
|
-
|
|
7664
|
+
log2.info("Starting format process...");
|
|
7591
7665
|
try {
|
|
7592
7666
|
const tsFiles = findTsFiles(rootDir);
|
|
7593
7667
|
const cssFiles = findCssFiles(rootDir);
|
|
7594
7668
|
if (verbose) {
|
|
7595
|
-
|
|
7596
|
-
|
|
7669
|
+
log2.debug(`Found ${tsFiles.length} TypeScript files`);
|
|
7670
|
+
log2.debug(`Found ${cssFiles.length} CSS files`);
|
|
7597
7671
|
}
|
|
7598
7672
|
let pathCommentStats = { updated: 0, skipped: 0, errors: 0 };
|
|
7599
7673
|
if (process.env.ADD_PATH_COMMENTS !== "false") {
|
|
@@ -7604,34 +7678,34 @@ async function main(options = {}) {
|
|
|
7604
7678
|
verbose
|
|
7605
7679
|
);
|
|
7606
7680
|
const totalHandled = pathCommentStats.updated + pathCommentStats.skipped;
|
|
7607
|
-
|
|
7681
|
+
log2.info(
|
|
7608
7682
|
`Path comments: ${totalHandled} files handled (${pathCommentStats.updated} updated, ${pathCommentStats.skipped} skipped)${pathCommentStats.errors > 0 ? `, ${pathCommentStats.errors} errors` : ""}`
|
|
7609
7683
|
);
|
|
7610
7684
|
} else {
|
|
7611
|
-
|
|
7685
|
+
log2.info("Skipping path comments (ADD_PATH_COMMENTS=false)");
|
|
7612
7686
|
}
|
|
7613
7687
|
let prettierStats = { formatted: 0, unchanged: 0, errors: 0 };
|
|
7614
7688
|
if (process.env.RUN_PRETTIER !== "false") {
|
|
7615
7689
|
prettierStats = await runPrettier(rootDir, dryRun, verbose);
|
|
7616
7690
|
if (prettierStats.errors > 0) {
|
|
7617
|
-
|
|
7691
|
+
log2.error(`Prettier: ${prettierStats.errors} errors`);
|
|
7618
7692
|
} else {
|
|
7619
7693
|
const totalHandled = prettierStats.formatted + prettierStats.unchanged;
|
|
7620
7694
|
if (totalHandled > 0) {
|
|
7621
|
-
|
|
7695
|
+
log2.info(
|
|
7622
7696
|
`Prettier: ${totalHandled} files handled (${prettierStats.formatted} formatted, ${prettierStats.unchanged} unchanged)`
|
|
7623
7697
|
);
|
|
7624
7698
|
} else {
|
|
7625
|
-
|
|
7699
|
+
log2.warn("Prettier ran but produced no stats (check output above)");
|
|
7626
7700
|
}
|
|
7627
7701
|
}
|
|
7628
7702
|
} else {
|
|
7629
|
-
|
|
7703
|
+
log2.info("Skipping Prettier (RUN_PRETTIER=false)");
|
|
7630
7704
|
}
|
|
7631
|
-
|
|
7705
|
+
log2.success("Format process completed successfully");
|
|
7632
7706
|
return 0;
|
|
7633
7707
|
} catch (err) {
|
|
7634
|
-
|
|
7708
|
+
log2.error(
|
|
7635
7709
|
"Format process failed:",
|
|
7636
7710
|
DoNotDevError.from(err, "Format process failed", "cli-execution-error")
|
|
7637
7711
|
);
|
|
@@ -7643,7 +7717,7 @@ function getGitignorePatterns(rootDir) {
|
|
|
7643
7717
|
const directoryPatterns = [];
|
|
7644
7718
|
const filePatterns = [];
|
|
7645
7719
|
if (pathExists(gitignorePath)) {
|
|
7646
|
-
|
|
7720
|
+
log2.debug(`Reading .gitignore from: ${gitignorePath}`);
|
|
7647
7721
|
const patterns = readSync(gitignorePath, { format: "text" }).split("\n").filter((line) => line.trim() !== "" && !line.startsWith("#"));
|
|
7648
7722
|
for (const pattern of patterns) {
|
|
7649
7723
|
const trimmedPattern = pattern.trim();
|
|
@@ -7680,7 +7754,7 @@ function getCommentFormat(file) {
|
|
|
7680
7754
|
async function addPathComments(files, rootDir, dryRun, verbose) {
|
|
7681
7755
|
const stats = { updated: 0, skipped: 0, errors: 0 };
|
|
7682
7756
|
if (verbose) {
|
|
7683
|
-
|
|
7757
|
+
log2.info(`Adding path comments to ${files.length} files...`);
|
|
7684
7758
|
}
|
|
7685
7759
|
for (const file of files) {
|
|
7686
7760
|
const relativePath = getRelativePathBetween(rootDir, file).replace(
|
|
@@ -7703,25 +7777,25 @@ async function addPathComments(files, rootDir, dryRun, verbose) {
|
|
|
7703
7777
|
}
|
|
7704
7778
|
stats.updated++;
|
|
7705
7779
|
if (verbose) {
|
|
7706
|
-
|
|
7780
|
+
log2.info(` \u2713 Added comment to empty file: ${relativePath}`);
|
|
7707
7781
|
}
|
|
7708
7782
|
continue;
|
|
7709
7783
|
}
|
|
7710
7784
|
let shebangLine = "";
|
|
7711
7785
|
let shebangIndex = -1;
|
|
7712
7786
|
if (!isCss) {
|
|
7713
|
-
for (let
|
|
7714
|
-
const line = contentLines[
|
|
7787
|
+
for (let i2 = 0; i2 < Math.min(4, contentLines.length); i2++) {
|
|
7788
|
+
const line = contentLines[i2];
|
|
7715
7789
|
if (line?.trim().startsWith("#!")) {
|
|
7716
7790
|
shebangLine = line;
|
|
7717
|
-
shebangIndex =
|
|
7791
|
+
shebangIndex = i2;
|
|
7718
7792
|
break;
|
|
7719
7793
|
}
|
|
7720
7794
|
}
|
|
7721
7795
|
if (shebangIndex > 0) {
|
|
7722
7796
|
contentLines.splice(shebangIndex, 1);
|
|
7723
7797
|
modified = true;
|
|
7724
|
-
|
|
7798
|
+
log2.debug(
|
|
7725
7799
|
`Fixed broken shebang in ${relativePath} (was at line ${shebangIndex + 1})`
|
|
7726
7800
|
);
|
|
7727
7801
|
} else if (shebangIndex === 0) {
|
|
@@ -7732,10 +7806,10 @@ async function addPathComments(files, rootDir, dryRun, verbose) {
|
|
|
7732
7806
|
let useClientLine = -1;
|
|
7733
7807
|
let useClientValue = "";
|
|
7734
7808
|
if (!isCss) {
|
|
7735
|
-
for (let
|
|
7736
|
-
const line = contentLines[
|
|
7809
|
+
for (let i2 = 0; i2 < contentLines.length; i2++) {
|
|
7810
|
+
const line = contentLines[i2]?.trim();
|
|
7737
7811
|
if (line === '"use client";' || line === "'use client';") {
|
|
7738
|
-
useClientLine =
|
|
7812
|
+
useClientLine = i2;
|
|
7739
7813
|
useClientValue = line;
|
|
7740
7814
|
break;
|
|
7741
7815
|
}
|
|
@@ -7749,15 +7823,15 @@ async function addPathComments(files, rootDir, dryRun, verbose) {
|
|
|
7749
7823
|
let pathCommentIndex = -1;
|
|
7750
7824
|
let pathCommentExists = false;
|
|
7751
7825
|
let pathCommentFormat = "";
|
|
7752
|
-
for (let
|
|
7753
|
-
const trimmed = contentLines[
|
|
7826
|
+
for (let i2 = 0; i2 < Math.min(3, contentLines.length); i2++) {
|
|
7827
|
+
const trimmed = contentLines[i2]?.trim();
|
|
7754
7828
|
if (trimmed === expectedPathComment) {
|
|
7755
|
-
pathCommentIndex =
|
|
7829
|
+
pathCommentIndex = i2;
|
|
7756
7830
|
pathCommentExists = true;
|
|
7757
7831
|
pathCommentFormat = isCss ? "css" : "ts";
|
|
7758
7832
|
break;
|
|
7759
7833
|
} else if (isCss && trimmed === expectedPathCommentInvalid) {
|
|
7760
|
-
pathCommentIndex =
|
|
7834
|
+
pathCommentIndex = i2;
|
|
7761
7835
|
pathCommentExists = true;
|
|
7762
7836
|
pathCommentFormat = "invalid";
|
|
7763
7837
|
break;
|
|
@@ -7776,9 +7850,9 @@ async function addPathComments(files, rootDir, dryRun, verbose) {
|
|
|
7776
7850
|
let jsDocEnd = -1;
|
|
7777
7851
|
if (!isCss && contentLines[0]?.trim().startsWith("/**")) {
|
|
7778
7852
|
jsDocStart = 0;
|
|
7779
|
-
for (let
|
|
7780
|
-
if (contentLines[
|
|
7781
|
-
jsDocEnd =
|
|
7853
|
+
for (let i2 = 0; i2 < contentLines.length; i2++) {
|
|
7854
|
+
if (contentLines[i2]?.trim().includes("*/")) {
|
|
7855
|
+
jsDocEnd = i2;
|
|
7782
7856
|
break;
|
|
7783
7857
|
}
|
|
7784
7858
|
}
|
|
@@ -7800,9 +7874,9 @@ async function addPathComments(files, rootDir, dryRun, verbose) {
|
|
|
7800
7874
|
const line = contentLines[0]?.trim();
|
|
7801
7875
|
if (format.close && line.startsWith(format.open)) {
|
|
7802
7876
|
let commentEnd = -1;
|
|
7803
|
-
for (let
|
|
7804
|
-
if (contentLines[
|
|
7805
|
-
commentEnd =
|
|
7877
|
+
for (let i2 = 0; i2 < contentLines.length; i2++) {
|
|
7878
|
+
if (contentLines[i2]?.includes(format.close)) {
|
|
7879
|
+
commentEnd = i2;
|
|
7806
7880
|
break;
|
|
7807
7881
|
}
|
|
7808
7882
|
}
|
|
@@ -7834,11 +7908,11 @@ async function addPathComments(files, rootDir, dryRun, verbose) {
|
|
|
7834
7908
|
}
|
|
7835
7909
|
stats.updated++;
|
|
7836
7910
|
if (verbose) {
|
|
7837
|
-
|
|
7911
|
+
log2.info(` \u2713 Updated header in: ${relativePath}`);
|
|
7838
7912
|
}
|
|
7839
7913
|
} catch (writeError) {
|
|
7840
7914
|
stats.errors++;
|
|
7841
|
-
|
|
7915
|
+
log2.error(
|
|
7842
7916
|
`Error writing file: ${relativePath}`,
|
|
7843
7917
|
DoNotDevError.from(
|
|
7844
7918
|
writeError,
|
|
@@ -7850,18 +7924,18 @@ async function addPathComments(files, rootDir, dryRun, verbose) {
|
|
|
7850
7924
|
} else {
|
|
7851
7925
|
stats.skipped++;
|
|
7852
7926
|
if (verbose) {
|
|
7853
|
-
|
|
7927
|
+
log2.debug(` \u25CB Skipped (no changes): ${relativePath}`);
|
|
7854
7928
|
}
|
|
7855
7929
|
}
|
|
7856
7930
|
} else {
|
|
7857
7931
|
stats.skipped++;
|
|
7858
7932
|
if (verbose) {
|
|
7859
|
-
|
|
7933
|
+
log2.debug(` \u25CB Skipped (path comment correct): ${relativePath}`);
|
|
7860
7934
|
}
|
|
7861
7935
|
}
|
|
7862
7936
|
} catch (err) {
|
|
7863
7937
|
stats.errors++;
|
|
7864
|
-
|
|
7938
|
+
log2.error(
|
|
7865
7939
|
`Error processing file: ${relativePath}`,
|
|
7866
7940
|
DoNotDevError.from(
|
|
7867
7941
|
err,
|
|
@@ -7876,7 +7950,7 @@ async function addPathComments(files, rootDir, dryRun, verbose) {
|
|
|
7876
7950
|
function findCssFiles(rootDir) {
|
|
7877
7951
|
const { directoryPatterns, filePatterns } = getGitignorePatterns(rootDir);
|
|
7878
7952
|
const result = [];
|
|
7879
|
-
|
|
7953
|
+
log2.debug(`Starting CSS directory scan from: ${rootDir}`);
|
|
7880
7954
|
const standardExcludes = [/node_modules/, /dist/, /lib/, /\.turbo/];
|
|
7881
7955
|
function shouldExclude(filePath) {
|
|
7882
7956
|
const relativePath = getRelativePathBetween(rootDir, filePath).replace(
|
|
@@ -7905,7 +7979,7 @@ function findCssFiles(rootDir) {
|
|
|
7905
7979
|
return;
|
|
7906
7980
|
}
|
|
7907
7981
|
try {
|
|
7908
|
-
const entries =
|
|
7982
|
+
const entries = readdirSync3(dirPath, { withFileTypes: true });
|
|
7909
7983
|
for (const entry of entries) {
|
|
7910
7984
|
try {
|
|
7911
7985
|
const fullPath = joinPath(dirPath, entry.name);
|
|
@@ -7915,24 +7989,24 @@ function findCssFiles(rootDir) {
|
|
|
7915
7989
|
result.push(fullPath);
|
|
7916
7990
|
}
|
|
7917
7991
|
} catch (error2) {
|
|
7918
|
-
|
|
7992
|
+
log2.debug(
|
|
7919
7993
|
`Error processing entry ${entry.name} in ${dirPath}:`,
|
|
7920
7994
|
error2
|
|
7921
7995
|
);
|
|
7922
7996
|
}
|
|
7923
7997
|
}
|
|
7924
7998
|
} catch (error2) {
|
|
7925
|
-
|
|
7999
|
+
log2.debug(`Error reading directory ${dirPath}:`, error2);
|
|
7926
8000
|
}
|
|
7927
8001
|
}
|
|
7928
8002
|
scanDir(rootDir);
|
|
7929
|
-
|
|
8003
|
+
log2.debug(`Found ${result.length} CSS files`);
|
|
7930
8004
|
return result;
|
|
7931
8005
|
}
|
|
7932
8006
|
function findTsFiles(rootDir) {
|
|
7933
8007
|
const { directoryPatterns, filePatterns } = getGitignorePatterns(rootDir);
|
|
7934
8008
|
const result = [];
|
|
7935
|
-
|
|
8009
|
+
log2.debug(`Starting directory scan from: ${rootDir}`);
|
|
7936
8010
|
const standardExcludes = [/node_modules/, /dist/, /lib/, /\.turbo/];
|
|
7937
8011
|
function shouldExclude(filePath) {
|
|
7938
8012
|
const relativePath = getRelativePathBetween(rootDir, filePath).replace(
|
|
@@ -7961,7 +8035,7 @@ function findTsFiles(rootDir) {
|
|
|
7961
8035
|
return;
|
|
7962
8036
|
}
|
|
7963
8037
|
try {
|
|
7964
|
-
const entries =
|
|
8038
|
+
const entries = readdirSync3(dirPath, { withFileTypes: true });
|
|
7965
8039
|
for (const entry of entries) {
|
|
7966
8040
|
try {
|
|
7967
8041
|
const fullPath = joinPath(dirPath, entry.name);
|
|
@@ -7971,26 +8045,26 @@ function findTsFiles(rootDir) {
|
|
|
7971
8045
|
result.push(fullPath);
|
|
7972
8046
|
}
|
|
7973
8047
|
} catch (error2) {
|
|
7974
|
-
|
|
8048
|
+
log2.debug(
|
|
7975
8049
|
`Error processing entry ${entry.name} in ${dirPath}:`,
|
|
7976
8050
|
error2
|
|
7977
8051
|
);
|
|
7978
8052
|
}
|
|
7979
8053
|
}
|
|
7980
8054
|
} catch (error2) {
|
|
7981
|
-
|
|
8055
|
+
log2.debug(`Error reading directory ${dirPath}:`, error2);
|
|
7982
8056
|
}
|
|
7983
8057
|
}
|
|
7984
8058
|
scanDir(rootDir);
|
|
7985
|
-
|
|
8059
|
+
log2.debug(`Found ${result.length} TypeScript files`);
|
|
7986
8060
|
if (result.length === 0) {
|
|
7987
|
-
|
|
8061
|
+
log2.debug(
|
|
7988
8062
|
"No files found! This could explain why nothing is being formatted."
|
|
7989
8063
|
);
|
|
7990
8064
|
} else if (result.length < 5) {
|
|
7991
|
-
|
|
8065
|
+
log2.debug("Files found:", result);
|
|
7992
8066
|
} else {
|
|
7993
|
-
|
|
8067
|
+
log2.debug("Sample files:", result.slice(0, 5));
|
|
7994
8068
|
}
|
|
7995
8069
|
return result;
|
|
7996
8070
|
}
|
|
@@ -8012,11 +8086,11 @@ async function findPrettierConfig(rootDir) {
|
|
|
8012
8086
|
];
|
|
8013
8087
|
for (const configPath of configs) {
|
|
8014
8088
|
if (pathExists(configPath)) {
|
|
8015
|
-
|
|
8089
|
+
log2.info(`Using ${getBasename(configPath)} configuration`);
|
|
8016
8090
|
return { configPath, isTemp: false };
|
|
8017
8091
|
}
|
|
8018
8092
|
}
|
|
8019
|
-
|
|
8093
|
+
log2.info("No Prettier config found, using DoNotDev defaults");
|
|
8020
8094
|
const tempConfigPath = joinPath(rootDir, TEMP_CONFIG_NAME);
|
|
8021
8095
|
writeSync(tempConfigPath, DEFAULT_PRETTIER_CONFIG, { format: "json" });
|
|
8022
8096
|
return { configPath: tempConfigPath, isTemp: true };
|
|
@@ -8024,7 +8098,7 @@ async function findPrettierConfig(rootDir) {
|
|
|
8024
8098
|
async function runPrettier(rootDir, dryRun, verbose) {
|
|
8025
8099
|
const stats = { formatted: 0, unchanged: 0, errors: 0 };
|
|
8026
8100
|
if (verbose) {
|
|
8027
|
-
|
|
8101
|
+
log2.info("Running Prettier on TypeScript files...");
|
|
8028
8102
|
}
|
|
8029
8103
|
let tempConfigPath = null;
|
|
8030
8104
|
try {
|
|
@@ -8042,7 +8116,7 @@ async function runPrettier(rootDir, dryRun, verbose) {
|
|
|
8042
8116
|
const absoluteConfigPath = normalizePath(configPath);
|
|
8043
8117
|
prettierArgs.push("--config", absoluteConfigPath);
|
|
8044
8118
|
if (!verbose) {
|
|
8045
|
-
|
|
8119
|
+
log2.info("Using Prettier config");
|
|
8046
8120
|
}
|
|
8047
8121
|
}
|
|
8048
8122
|
const prettierIgnorePath = joinPath(rootDir, ".prettierignore");
|
|
@@ -8052,10 +8126,10 @@ async function runPrettier(rootDir, dryRun, verbose) {
|
|
|
8052
8126
|
}
|
|
8053
8127
|
prettierArgs.push("**/*.{ts,tsx,js,json,css}");
|
|
8054
8128
|
if (verbose) {
|
|
8055
|
-
|
|
8129
|
+
log2.debug(`Running: bunx ${prettierArgs.join(" ")}`);
|
|
8056
8130
|
}
|
|
8057
8131
|
if (dryRun) {
|
|
8058
|
-
|
|
8132
|
+
log2.info("DRY RUN: Would run Prettier");
|
|
8059
8133
|
return stats;
|
|
8060
8134
|
}
|
|
8061
8135
|
const result = spawnSync("bunx", prettierArgs, {
|
|
@@ -8064,18 +8138,18 @@ async function runPrettier(rootDir, dryRun, verbose) {
|
|
|
8064
8138
|
encoding: "utf-8",
|
|
8065
8139
|
env: { ...process.env }
|
|
8066
8140
|
});
|
|
8067
|
-
const
|
|
8141
|
+
const stdout2 = result.stdout?.toString() || "";
|
|
8068
8142
|
const stderr = result.stderr?.toString() || "";
|
|
8069
|
-
const output =
|
|
8143
|
+
const output = stdout2 + (stderr ? `
|
|
8070
8144
|
${stderr}` : "");
|
|
8071
8145
|
if (result.status !== 0) {
|
|
8072
8146
|
stats.errors++;
|
|
8073
|
-
|
|
8074
|
-
if (
|
|
8075
|
-
|
|
8147
|
+
log2.error("Prettier failed");
|
|
8148
|
+
if (stdout2) {
|
|
8149
|
+
log2.error(stdout2);
|
|
8076
8150
|
}
|
|
8077
8151
|
if (stderr) {
|
|
8078
|
-
|
|
8152
|
+
log2.error(stderr);
|
|
8079
8153
|
}
|
|
8080
8154
|
throw new DoNotDevError(
|
|
8081
8155
|
"Prettier formatting failed",
|
|
@@ -8115,22 +8189,22 @@ ${stderr}` : "");
|
|
|
8115
8189
|
}
|
|
8116
8190
|
}
|
|
8117
8191
|
if (verbose) {
|
|
8118
|
-
|
|
8192
|
+
log2.debug("Prettier stdout:", stdout2);
|
|
8119
8193
|
if (stderr) {
|
|
8120
|
-
|
|
8194
|
+
log2.debug("Prettier stderr:", stderr);
|
|
8121
8195
|
}
|
|
8122
8196
|
}
|
|
8123
8197
|
if (stats.formatted === 0 && stats.unchanged === 0 && output.trim().length > 0) {
|
|
8124
|
-
|
|
8198
|
+
log2.warn(
|
|
8125
8199
|
"Prettier ran but produced no parseable stats. Output format may have changed."
|
|
8126
8200
|
);
|
|
8127
8201
|
if (!verbose) {
|
|
8128
|
-
|
|
8202
|
+
log2.info("Run with --verbose to see Prettier output");
|
|
8129
8203
|
}
|
|
8130
8204
|
}
|
|
8131
8205
|
} else {
|
|
8132
8206
|
if (verbose) {
|
|
8133
|
-
|
|
8207
|
+
log2.warn("Prettier produced no output (this may indicate an issue)");
|
|
8134
8208
|
}
|
|
8135
8209
|
}
|
|
8136
8210
|
return stats;
|