@donotdev/cli 0.1.45 → 0.2.0
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 +191 -150
- package/dist/bin/commands/agent-setup.js +632 -524
- package/dist/bin/commands/build.js +1239 -935
- package/dist/bin/commands/bump.js +1285 -946
- package/dist/bin/commands/cacheout.js +543 -405
- package/dist/bin/commands/coach.js +546 -408
- package/dist/bin/commands/create-app.js +1198 -862
- package/dist/bin/commands/create-project.js +1238 -902
- package/dist/bin/commands/db.js +139128 -93775
- package/dist/bin/commands/deploy.js +2308 -1936
- package/dist/bin/commands/dev.js +912 -662
- package/dist/bin/commands/doctor.js +634 -526
- package/dist/bin/commands/emu.js +1093 -785
- package/dist/bin/commands/format.js +588 -450
- package/dist/bin/commands/get-demo.js +1043 -756
- package/dist/bin/commands/make-admin.js +20974 -38424
- package/dist/bin/commands/preview.js +913 -663
- package/dist/bin/commands/seed.js +139129 -93776
- package/dist/bin/commands/setup-cicd.js +1130 -817
- package/dist/bin/commands/setup.js +1299 -960
- package/dist/bin/commands/staging.js +2308 -1936
- package/dist/bin/commands/sync-secrets.js +996 -733
- package/dist/bin/commands/type-check.js +733 -598
- package/dist/bin/commands/wai.js +533 -395
- package/dist/bin/dndev.js +9 -8
- package/dist/index.js +2720 -2290
- package/package.json +3 -3
- package/templates/app-next/src/app/ClientLayout.tsx.example +11 -1
- package/templates/app-next/src/app/layout.tsx.example +19 -1
- package/templates/functions-firebase/src/billing/handleStripeWebhook.ts.example +8 -18
- package/templates/functions-firebase/src/billing/index.ts.example +0 -1
- package/templates/functions-firebase/src/billing/refreshSubscriptionStatus.ts.example +4 -8
- package/templates/functions-firebase/src/index.ts.example +0 -1
- package/templates/functions-supabase/supabase/config.toml.example +4 -0
- package/templates/functions-supabase/supabase/functions/stripe-webhook/index.ts.example +12 -0
- package/templates/functions-supabase/supabase/migrations/20250101000005_webhook_events.sql +133 -0
- package/templates/functions-vercel/.env.example +9 -0
- package/templates/functions-vercel/src/api/billing/handleStripeWebhook.ts.example +12 -14
- package/templates/functions-vercel/src/api/billing/refreshSubscriptionStatus.ts.example +4 -14
- package/templates/overlay-supabase/src/config/providers.ts.example +2 -2
- package/templates/root-consumer/.claude/hooks/guard-write.sh.example +32 -0
- package/templates/root-consumer/.claude/hooks/record-lookup.sh.example +22 -0
- package/templates/root-consumer/.claude/rules/definition-of-done.md.example +7 -0
- package/templates/root-consumer/.claude/rules/framework.md.example +6 -0
- package/templates/root-consumer/.claude/settings.json.example +11 -1
- package/templates/functions-firebase/src/billing/processPaymentSuccess.ts.example +0 -14
- package/templates/functions-vercel/src/api/billing/processPaymentSuccess.ts.example +0 -20
|
@@ -5,16 +5,25 @@ 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');
|
|
12
12
|
});
|
|
13
|
-
var __esm = (fn, res) => function __init() {
|
|
14
|
-
|
|
13
|
+
var __esm = (fn, res, err) => function __init() {
|
|
14
|
+
if (err) throw err[0];
|
|
15
|
+
try {
|
|
16
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
17
|
+
} catch (e) {
|
|
18
|
+
throw err = [e], e;
|
|
19
|
+
}
|
|
15
20
|
};
|
|
16
21
|
var __commonJS = (cb, mod) => function __require2() {
|
|
17
|
-
|
|
22
|
+
try {
|
|
23
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
24
|
+
} catch (e) {
|
|
25
|
+
throw mod = 0, e;
|
|
26
|
+
}
|
|
18
27
|
};
|
|
19
28
|
var __copyProps = (to, from, except, desc) => {
|
|
20
29
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
@@ -33,17 +42,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
42
|
mod
|
|
34
43
|
));
|
|
35
44
|
|
|
36
|
-
// node_modules/.bun/fast-string-truncated-width@
|
|
45
|
+
// node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
|
|
37
46
|
var init_utils = __esm({
|
|
38
|
-
"node_modules/.bun/fast-string-truncated-width@
|
|
47
|
+
"node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js"() {
|
|
39
48
|
init_utils2();
|
|
40
49
|
}
|
|
41
50
|
});
|
|
42
51
|
|
|
43
|
-
// node_modules/.bun/fast-string-truncated-width@
|
|
52
|
+
// node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
|
|
44
53
|
var EMOJI_RE, MODIFIER_RE;
|
|
45
54
|
var init_dist = __esm({
|
|
46
|
-
"node_modules/.bun/fast-string-truncated-width@
|
|
55
|
+
"node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js"() {
|
|
47
56
|
init_utils2();
|
|
48
57
|
init_utils();
|
|
49
58
|
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 +60,18 @@ var init_dist = __esm({
|
|
|
51
60
|
}
|
|
52
61
|
});
|
|
53
62
|
|
|
54
|
-
// node_modules/.bun/fast-string-width@
|
|
63
|
+
// node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
|
|
55
64
|
var init_dist2 = __esm({
|
|
56
|
-
"node_modules/.bun/fast-string-width@
|
|
65
|
+
"node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js"() {
|
|
57
66
|
init_utils2();
|
|
58
67
|
init_dist();
|
|
59
68
|
}
|
|
60
69
|
});
|
|
61
70
|
|
|
62
|
-
// node_modules/.bun/fast-wrap-ansi@0.
|
|
71
|
+
// node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js
|
|
63
72
|
var ANSI_ESCAPE_BELL, ANSI_CSI, ANSI_OSC, ANSI_ESCAPE_LINK, GROUP_REGEX;
|
|
64
73
|
var init_main = __esm({
|
|
65
|
-
"node_modules/.bun/fast-wrap-ansi@0.
|
|
74
|
+
"node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js"() {
|
|
66
75
|
init_utils2();
|
|
67
76
|
init_dist2();
|
|
68
77
|
ANSI_ESCAPE_BELL = "\x07";
|
|
@@ -81,17 +90,17 @@ var require_src = __commonJS({
|
|
|
81
90
|
var ESC = "\x1B";
|
|
82
91
|
var CSI = `${ESC}[`;
|
|
83
92
|
var beep = "\x07";
|
|
84
|
-
var
|
|
85
|
-
to(x,
|
|
86
|
-
if (!
|
|
87
|
-
return `${CSI}${
|
|
93
|
+
var cursor3 = {
|
|
94
|
+
to(x, y) {
|
|
95
|
+
if (!y) return `${CSI}${x + 1}G`;
|
|
96
|
+
return `${CSI}${y + 1};${x + 1}H`;
|
|
88
97
|
},
|
|
89
|
-
move(x,
|
|
98
|
+
move(x, y) {
|
|
90
99
|
let ret = "";
|
|
91
100
|
if (x < 0) ret += `${CSI}${-x}D`;
|
|
92
101
|
else if (x > 0) ret += `${CSI}${x}C`;
|
|
93
|
-
if (
|
|
94
|
-
else if (
|
|
102
|
+
if (y < 0) ret += `${CSI}${-y}A`;
|
|
103
|
+
else if (y > 0) ret += `${CSI}${y}B`;
|
|
95
104
|
return ret;
|
|
96
105
|
},
|
|
97
106
|
up: (count = 1) => `${CSI}${count}A`,
|
|
@@ -110,7 +119,7 @@ var require_src = __commonJS({
|
|
|
110
119
|
up: (count = 1) => `${CSI}S`.repeat(count),
|
|
111
120
|
down: (count = 1) => `${CSI}T`.repeat(count)
|
|
112
121
|
};
|
|
113
|
-
var
|
|
122
|
+
var erase3 = {
|
|
114
123
|
screen: `${CSI}2J`,
|
|
115
124
|
up: (count = 1) => `${CSI}1J`.repeat(count),
|
|
116
125
|
down: (count = 1) => `${CSI}J`.repeat(count),
|
|
@@ -119,106 +128,180 @@ var require_src = __commonJS({
|
|
|
119
128
|
lineStart: `${CSI}1K`,
|
|
120
129
|
lines(count) {
|
|
121
130
|
let clear = "";
|
|
122
|
-
for (let
|
|
123
|
-
clear += this.line + (
|
|
131
|
+
for (let i2 = 0; i2 < count; i2++)
|
|
132
|
+
clear += this.line + (i2 < count - 1 ? cursor3.up() : "");
|
|
124
133
|
if (count)
|
|
125
|
-
clear +=
|
|
134
|
+
clear += cursor3.left;
|
|
126
135
|
return clear;
|
|
127
136
|
}
|
|
128
137
|
};
|
|
129
|
-
module.exports = { cursor, scroll, erase, beep };
|
|
138
|
+
module.exports = { cursor: cursor3, scroll, erase: erase3, beep };
|
|
130
139
|
}
|
|
131
140
|
});
|
|
132
141
|
|
|
133
|
-
// node_modules/.bun/@clack+core@1.
|
|
134
|
-
import { styleText
|
|
135
|
-
import { stdout
|
|
136
|
-
import { ReadStream
|
|
137
|
-
var import_sisteransi,
|
|
142
|
+
// node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs
|
|
143
|
+
import { styleText } from "node:util";
|
|
144
|
+
import { stdout, stdin } from "node:process";
|
|
145
|
+
import { ReadStream } from "node:tty";
|
|
146
|
+
var import_sisteransi, a$1, t, settings, R;
|
|
138
147
|
var init_dist3 = __esm({
|
|
139
|
-
"node_modules/.bun/@clack+core@1.
|
|
148
|
+
"node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs"() {
|
|
140
149
|
init_utils2();
|
|
141
150
|
init_main();
|
|
142
151
|
import_sisteransi = __toESM(require_src(), 1);
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
152
|
+
a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
153
|
+
t = [
|
|
154
|
+
"January",
|
|
155
|
+
"February",
|
|
156
|
+
"March",
|
|
157
|
+
"April",
|
|
158
|
+
"May",
|
|
159
|
+
"June",
|
|
160
|
+
"July",
|
|
161
|
+
"August",
|
|
162
|
+
"September",
|
|
163
|
+
"October",
|
|
164
|
+
"November",
|
|
165
|
+
"December"
|
|
166
|
+
];
|
|
167
|
+
settings = {
|
|
168
|
+
actions: new Set(a$1),
|
|
169
|
+
aliases: /* @__PURE__ */ new Map([
|
|
170
|
+
// vim support
|
|
171
|
+
["k", "up"],
|
|
172
|
+
["j", "down"],
|
|
173
|
+
["h", "left"],
|
|
174
|
+
["l", "right"],
|
|
175
|
+
["", "cancel"],
|
|
176
|
+
// opinionated defaults!
|
|
177
|
+
["escape", "cancel"]
|
|
178
|
+
]),
|
|
179
|
+
messages: {
|
|
180
|
+
cancel: "Canceled",
|
|
181
|
+
error: "Something went wrong"
|
|
182
|
+
},
|
|
183
|
+
withGuide: true,
|
|
184
|
+
accessible: void 0,
|
|
185
|
+
date: {
|
|
186
|
+
monthNames: [...t],
|
|
187
|
+
messages: {
|
|
188
|
+
required: "Please enter a valid date",
|
|
189
|
+
invalidMonth: "There are only 12 months in a year",
|
|
190
|
+
invalidDay: (n2, e) => `There are only ${n2} days in ${e}`,
|
|
191
|
+
afterMin: (n2) => `Date must be on or after ${n2.toISOString().slice(0, 10)}`,
|
|
192
|
+
beforeMax: (n2) => `Date must be on or before ${n2.toISOString().slice(0, 10)}`
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
R = globalThis.process.platform.startsWith("win");
|
|
147
197
|
}
|
|
148
198
|
});
|
|
149
199
|
|
|
150
|
-
// node_modules/.bun/@clack+prompts@1.
|
|
151
|
-
import { styleText as
|
|
152
|
-
import
|
|
153
|
-
import { existsSync
|
|
154
|
-
import { dirname
|
|
155
|
-
function
|
|
156
|
-
|
|
200
|
+
// node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs
|
|
201
|
+
import { styleText as styleText2, stripVTControlCharacters } from "node:util";
|
|
202
|
+
import process$1 from "node:process";
|
|
203
|
+
import { existsSync, lstatSync, readdirSync } from "node:fs";
|
|
204
|
+
import { dirname, join } from "node:path";
|
|
205
|
+
function isUnicodeSupported() {
|
|
206
|
+
if (process$1.platform !== "win32") {
|
|
207
|
+
return process$1.env.TERM !== "linux";
|
|
208
|
+
}
|
|
209
|
+
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
210
|
}
|
|
158
|
-
var import_sisteransi2,
|
|
211
|
+
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
212
|
var init_dist4 = __esm({
|
|
160
|
-
"node_modules/.bun/@clack+prompts@1.
|
|
213
|
+
"node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs"() {
|
|
161
214
|
init_utils2();
|
|
162
215
|
init_dist3();
|
|
163
216
|
init_dist3();
|
|
164
217
|
init_main();
|
|
165
218
|
init_dist2();
|
|
166
219
|
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
|
-
|
|
220
|
+
unicode = isUnicodeSupported();
|
|
221
|
+
unicodeOr = (o, e) => unicode ? o : e;
|
|
222
|
+
S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
|
|
223
|
+
S_STEP_CANCEL = unicodeOr("\u25A0", "x");
|
|
224
|
+
S_STEP_ERROR = unicodeOr("\u25B2", "x");
|
|
225
|
+
S_STEP_SUBMIT = unicodeOr("\u25C7", "o");
|
|
226
|
+
S_BAR_START = unicodeOr("\u250C", "T");
|
|
227
|
+
S_BAR = unicodeOr("\u2502", "|");
|
|
228
|
+
S_BAR_END = unicodeOr("\u2514", "\u2014");
|
|
229
|
+
S_BAR_START_RIGHT = unicodeOr("\u2510", "T");
|
|
230
|
+
S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014");
|
|
231
|
+
S_RADIO_ACTIVE = unicodeOr("\u25CF", ">");
|
|
232
|
+
S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
|
|
233
|
+
S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
|
|
234
|
+
S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
|
|
235
|
+
S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
|
|
236
|
+
S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022");
|
|
237
|
+
S_BAR_H = unicodeOr("\u2500", "-");
|
|
238
|
+
S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+");
|
|
239
|
+
S_CONNECT_LEFT = unicodeOr("\u251C", "+");
|
|
240
|
+
S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+");
|
|
241
|
+
S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+");
|
|
242
|
+
S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+");
|
|
243
|
+
S_INFO = unicodeOr("\u25CF", "\u2022");
|
|
244
|
+
S_SUCCESS = unicodeOr("\u25C6", "*");
|
|
245
|
+
S_WARN = unicodeOr("\u25B2", "!");
|
|
246
|
+
S_ERROR = unicodeOr("\u25A0", "x");
|
|
247
|
+
MULTISELECT_INSTRUCTIONS = [
|
|
248
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
249
|
+
`${styleText2("dim", "Space:")} select`,
|
|
250
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
251
|
+
];
|
|
252
|
+
log = {
|
|
253
|
+
message: (s = [], {
|
|
254
|
+
symbol: e = styleText2("gray", S_BAR),
|
|
255
|
+
secondarySymbol: r2 = styleText2("gray", S_BAR),
|
|
256
|
+
output: m = process.stdout,
|
|
257
|
+
spacing: l = 1,
|
|
258
|
+
withGuide: c
|
|
259
|
+
} = {}) => {
|
|
260
|
+
const t2 = [], o = c ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
|
|
261
|
+
for (let i2 = 0; i2 < l; i2++)
|
|
262
|
+
t2.push(f);
|
|
263
|
+
const g = Array.isArray(s) ? s : s.split(`
|
|
198
264
|
`);
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
265
|
+
if (g.length > 0) {
|
|
266
|
+
const [i2, ...y] = g;
|
|
267
|
+
i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
|
|
268
|
+
for (const p of y)
|
|
269
|
+
p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
|
|
270
|
+
}
|
|
271
|
+
m.write(`${t2.join(`
|
|
205
272
|
`)}
|
|
206
273
|
`);
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
274
|
+
},
|
|
275
|
+
info: (s, e) => {
|
|
276
|
+
log.message(s, { ...e, symbol: styleText2("blue", S_INFO) });
|
|
277
|
+
},
|
|
278
|
+
success: (s, e) => {
|
|
279
|
+
log.message(s, { ...e, symbol: styleText2("green", S_SUCCESS) });
|
|
280
|
+
},
|
|
281
|
+
step: (s, e) => {
|
|
282
|
+
log.message(s, { ...e, symbol: styleText2("green", S_STEP_SUBMIT) });
|
|
283
|
+
},
|
|
284
|
+
warn: (s, e) => {
|
|
285
|
+
log.message(s, { ...e, symbol: styleText2("yellow", S_WARN) });
|
|
286
|
+
},
|
|
287
|
+
/** alias for `log.warn()`. */
|
|
288
|
+
warning: (s, e) => {
|
|
289
|
+
log.warn(s, e);
|
|
290
|
+
},
|
|
291
|
+
error: (s, e) => {
|
|
292
|
+
log.message(s, { ...e, symbol: styleText2("red", S_ERROR) });
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
u2 = {
|
|
296
|
+
light: unicodeOr("\u2500", "-"),
|
|
297
|
+
heavy: unicodeOr("\u2501", "="),
|
|
298
|
+
block: unicodeOr("\u2588", "#")
|
|
299
|
+
};
|
|
300
|
+
SELECT_INSTRUCTIONS = [
|
|
301
|
+
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
302
|
+
`${styleText2("dim", "Enter:")} confirm`
|
|
303
|
+
];
|
|
304
|
+
i = `${styleText2("gray", S_BAR)} `;
|
|
222
305
|
}
|
|
223
306
|
});
|
|
224
307
|
|
|
@@ -263,7 +346,7 @@ function stringify(value) {
|
|
|
263
346
|
function formatMessage(...args) {
|
|
264
347
|
return args.map(stringify).join(" ");
|
|
265
348
|
}
|
|
266
|
-
var colors, currentLogLevel,
|
|
349
|
+
var colors, currentLogLevel, log2, error, warn, info, success;
|
|
267
350
|
var init_cli_output = __esm({
|
|
268
351
|
"packages/tooling/src/utils/cli-output.ts"() {
|
|
269
352
|
"use strict";
|
|
@@ -296,7 +379,7 @@ var init_cli_output = __esm({
|
|
|
296
379
|
currentLogLevel = envLevel;
|
|
297
380
|
}
|
|
298
381
|
}
|
|
299
|
-
|
|
382
|
+
log2 = {
|
|
300
383
|
/**
|
|
301
384
|
* Logs an error message (always shows unless Quiet level)
|
|
302
385
|
* Uses clack's log.error + explicit red color
|
|
@@ -304,7 +387,7 @@ var init_cli_output = __esm({
|
|
|
304
387
|
error(...args) {
|
|
305
388
|
if (currentLogLevel < 0 /* Quiet */) return;
|
|
306
389
|
const message = formatMessage(...args);
|
|
307
|
-
|
|
390
|
+
log.error(colorize(message, colors.brightRed));
|
|
308
391
|
},
|
|
309
392
|
/**
|
|
310
393
|
* Logs a warning message (shows at Normal level and above)
|
|
@@ -313,7 +396,7 @@ var init_cli_output = __esm({
|
|
|
313
396
|
warn(...args) {
|
|
314
397
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
315
398
|
const message = formatMessage(...args);
|
|
316
|
-
|
|
399
|
+
log.warn(colorize(message, colors.brightYellow));
|
|
317
400
|
},
|
|
318
401
|
/**
|
|
319
402
|
* Logs an info message (shows at Normal level and above)
|
|
@@ -322,7 +405,7 @@ var init_cli_output = __esm({
|
|
|
322
405
|
info(...args) {
|
|
323
406
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
324
407
|
const message = formatMessage(...args);
|
|
325
|
-
|
|
408
|
+
log.info(colorize(message, colors.brightCyan));
|
|
326
409
|
},
|
|
327
410
|
/**
|
|
328
411
|
* Logs a success message (shows at Normal level and above)
|
|
@@ -331,7 +414,7 @@ var init_cli_output = __esm({
|
|
|
331
414
|
success(...args) {
|
|
332
415
|
if (currentLogLevel < 1 /* Normal */) return;
|
|
333
416
|
const message = formatMessage(...args);
|
|
334
|
-
|
|
417
|
+
log.success(colorize(message, colors.brightGreen));
|
|
335
418
|
},
|
|
336
419
|
/**
|
|
337
420
|
* Logs a debug message (only shows at Verbose level and above)
|
|
@@ -340,7 +423,7 @@ var init_cli_output = __esm({
|
|
|
340
423
|
debug(...args) {
|
|
341
424
|
if (currentLogLevel < 2 /* Verbose */) return;
|
|
342
425
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
343
|
-
|
|
426
|
+
log.message(
|
|
344
427
|
colorize(
|
|
345
428
|
`[${timeStamp}] \u{1F50D} DEBUG: ${formatMessage(...args)}`,
|
|
346
429
|
colors.gray
|
|
@@ -354,7 +437,7 @@ var init_cli_output = __esm({
|
|
|
354
437
|
trace(...args) {
|
|
355
438
|
if (currentLogLevel < 3 /* Debug */) return;
|
|
356
439
|
const timeStamp = (/* @__PURE__ */ new Date()).toISOString().slice(11, 19);
|
|
357
|
-
|
|
440
|
+
log.message(
|
|
358
441
|
colorize(
|
|
359
442
|
`[${timeStamp}] \u{1F52C} TRACE: ${formatMessage(...args)}`,
|
|
360
443
|
colors.gray
|
|
@@ -362,10 +445,10 @@ var init_cli_output = __esm({
|
|
|
362
445
|
);
|
|
363
446
|
}
|
|
364
447
|
};
|
|
365
|
-
error =
|
|
366
|
-
warn =
|
|
367
|
-
info =
|
|
368
|
-
success =
|
|
448
|
+
error = log2.error.bind(log2);
|
|
449
|
+
warn = log2.warn.bind(log2);
|
|
450
|
+
info = log2.info.bind(log2);
|
|
451
|
+
success = log2.success.bind(log2);
|
|
369
452
|
}
|
|
370
453
|
});
|
|
371
454
|
|
|
@@ -725,9 +808,9 @@ var require_is_glob = __commonJS({
|
|
|
725
808
|
index += 2;
|
|
726
809
|
var close = chars[open];
|
|
727
810
|
if (close) {
|
|
728
|
-
var
|
|
729
|
-
if (
|
|
730
|
-
index =
|
|
811
|
+
var n2 = str.indexOf(close, index);
|
|
812
|
+
if (n2 !== -1) {
|
|
813
|
+
index = n2 + 1;
|
|
731
814
|
}
|
|
732
815
|
}
|
|
733
816
|
if (str[index] === "!") {
|
|
@@ -753,9 +836,9 @@ var require_is_glob = __commonJS({
|
|
|
753
836
|
index += 2;
|
|
754
837
|
var close = chars[open];
|
|
755
838
|
if (close) {
|
|
756
|
-
var
|
|
757
|
-
if (
|
|
758
|
-
index =
|
|
839
|
+
var n2 = str.indexOf(close, index);
|
|
840
|
+
if (n2 !== -1) {
|
|
841
|
+
index = n2 + 1;
|
|
759
842
|
}
|
|
760
843
|
}
|
|
761
844
|
if (str[index] === "!") {
|
|
@@ -833,8 +916,8 @@ var require_utils = __commonJS({
|
|
|
833
916
|
if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
|
|
834
917
|
return (Number(max) - Number(min)) / Number(step) >= limit;
|
|
835
918
|
};
|
|
836
|
-
exports.escapeNode = (
|
|
837
|
-
const node =
|
|
919
|
+
exports.escapeNode = (block2, n2 = 0, type) => {
|
|
920
|
+
const node = block2.nodes[n2];
|
|
838
921
|
if (!node) return;
|
|
839
922
|
if (type && node.type === type || node.type === "open" || node.type === "close") {
|
|
840
923
|
if (node.escaped !== true) {
|
|
@@ -851,15 +934,15 @@ var require_utils = __commonJS({
|
|
|
851
934
|
}
|
|
852
935
|
return false;
|
|
853
936
|
};
|
|
854
|
-
exports.isInvalidBrace = (
|
|
855
|
-
if (
|
|
856
|
-
if (
|
|
857
|
-
if (
|
|
858
|
-
|
|
937
|
+
exports.isInvalidBrace = (block2) => {
|
|
938
|
+
if (block2.type !== "brace") return false;
|
|
939
|
+
if (block2.invalid === true || block2.dollar) return true;
|
|
940
|
+
if (block2.commas >> 0 + block2.ranges >> 0 === 0) {
|
|
941
|
+
block2.invalid = true;
|
|
859
942
|
return true;
|
|
860
943
|
}
|
|
861
|
-
if (
|
|
862
|
-
|
|
944
|
+
if (block2.open !== true || block2.close !== true) {
|
|
945
|
+
block2.invalid = true;
|
|
863
946
|
return true;
|
|
864
947
|
}
|
|
865
948
|
return false;
|
|
@@ -878,8 +961,8 @@ var require_utils = __commonJS({
|
|
|
878
961
|
exports.flatten = (...args) => {
|
|
879
962
|
const result = [];
|
|
880
963
|
const flat = (arr) => {
|
|
881
|
-
for (let
|
|
882
|
-
const ele = arr[
|
|
964
|
+
for (let i2 = 0; i2 < arr.length; i2++) {
|
|
965
|
+
const ele = arr[i2];
|
|
883
966
|
if (Array.isArray(ele)) {
|
|
884
967
|
flat(ele);
|
|
885
968
|
continue;
|
|
@@ -973,9 +1056,9 @@ var require_to_regex_range = __commonJS({
|
|
|
973
1056
|
if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
|
|
974
1057
|
return toRegexRange.cache[cacheKey].result;
|
|
975
1058
|
}
|
|
976
|
-
let
|
|
1059
|
+
let a2 = Math.min(min, max);
|
|
977
1060
|
let b = Math.max(min, max);
|
|
978
|
-
if (Math.abs(
|
|
1061
|
+
if (Math.abs(a2 - b) === 1) {
|
|
979
1062
|
let result = min + "|" + max;
|
|
980
1063
|
if (opts.capture) {
|
|
981
1064
|
return `(${result})`;
|
|
@@ -986,20 +1069,20 @@ var require_to_regex_range = __commonJS({
|
|
|
986
1069
|
return `(?:${result})`;
|
|
987
1070
|
}
|
|
988
1071
|
let isPadded = hasPadding(min) || hasPadding(max);
|
|
989
|
-
let state = { min, max, a, b };
|
|
1072
|
+
let state = { min, max, a: a2, b };
|
|
990
1073
|
let positives = [];
|
|
991
1074
|
let negatives = [];
|
|
992
1075
|
if (isPadded) {
|
|
993
1076
|
state.isPadded = isPadded;
|
|
994
1077
|
state.maxLen = String(state.max).length;
|
|
995
1078
|
}
|
|
996
|
-
if (
|
|
1079
|
+
if (a2 < 0) {
|
|
997
1080
|
let newMin = b < 0 ? Math.abs(b) : 1;
|
|
998
|
-
negatives = splitToPatterns(newMin, Math.abs(
|
|
999
|
-
|
|
1081
|
+
negatives = splitToPatterns(newMin, Math.abs(a2), state, opts);
|
|
1082
|
+
a2 = state.a = 0;
|
|
1000
1083
|
}
|
|
1001
1084
|
if (b >= 0) {
|
|
1002
|
-
positives = splitToPatterns(
|
|
1085
|
+
positives = splitToPatterns(a2, b, state, opts);
|
|
1003
1086
|
}
|
|
1004
1087
|
state.negatives = negatives;
|
|
1005
1088
|
state.positives = positives;
|
|
@@ -1047,8 +1130,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1047
1130
|
let digits = zipped.length;
|
|
1048
1131
|
let pattern = "";
|
|
1049
1132
|
let count = 0;
|
|
1050
|
-
for (let
|
|
1051
|
-
let [startDigit, stopDigit] = zipped[
|
|
1133
|
+
for (let i2 = 0; i2 < digits; i2++) {
|
|
1134
|
+
let [startDigit, stopDigit] = zipped[i2];
|
|
1052
1135
|
if (startDigit === stopDigit) {
|
|
1053
1136
|
pattern += startDigit;
|
|
1054
1137
|
} else if (startDigit !== "0" || stopDigit !== "9") {
|
|
@@ -1067,8 +1150,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1067
1150
|
let tokens = [];
|
|
1068
1151
|
let start = min;
|
|
1069
1152
|
let prev;
|
|
1070
|
-
for (let
|
|
1071
|
-
let max2 = ranges[
|
|
1153
|
+
for (let i2 = 0; i2 < ranges.length; i2++) {
|
|
1154
|
+
let max2 = ranges[i2];
|
|
1072
1155
|
let obj = rangeToPattern(String(start), String(max2), options);
|
|
1073
1156
|
let zeros = "";
|
|
1074
1157
|
if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
|
|
@@ -1103,13 +1186,13 @@ var require_to_regex_range = __commonJS({
|
|
|
1103
1186
|
}
|
|
1104
1187
|
return result;
|
|
1105
1188
|
}
|
|
1106
|
-
function zip(
|
|
1189
|
+
function zip(a2, b) {
|
|
1107
1190
|
let arr = [];
|
|
1108
|
-
for (let
|
|
1191
|
+
for (let i2 = 0; i2 < a2.length; i2++) arr.push([a2[i2], b[i2]]);
|
|
1109
1192
|
return arr;
|
|
1110
1193
|
}
|
|
1111
|
-
function compare(
|
|
1112
|
-
return
|
|
1194
|
+
function compare(a2, b) {
|
|
1195
|
+
return a2 > b ? 1 : b > a2 ? -1 : 0;
|
|
1113
1196
|
}
|
|
1114
1197
|
function contains(arr, key, val) {
|
|
1115
1198
|
return arr.some((ele) => ele[key] === val);
|
|
@@ -1127,8 +1210,8 @@ var require_to_regex_range = __commonJS({
|
|
|
1127
1210
|
}
|
|
1128
1211
|
return "";
|
|
1129
1212
|
}
|
|
1130
|
-
function toCharacterClass(
|
|
1131
|
-
return `[${
|
|
1213
|
+
function toCharacterClass(a2, b, options) {
|
|
1214
|
+
return `[${a2}${b - a2 === 1 ? "" : "-"}${b}]`;
|
|
1132
1215
|
}
|
|
1133
1216
|
function hasPadding(str) {
|
|
1134
1217
|
return /^-?(0+)\d/.test(str);
|
|
@@ -1207,8 +1290,8 @@ var require_fill_range = __commonJS({
|
|
|
1207
1290
|
return negative ? "-" + input : input;
|
|
1208
1291
|
};
|
|
1209
1292
|
var toSequence = (parts, options, maxLen) => {
|
|
1210
|
-
parts.negatives.sort((
|
|
1211
|
-
parts.positives.sort((
|
|
1293
|
+
parts.negatives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
1294
|
+
parts.positives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
1212
1295
|
let prefix = options.capture ? "" : "?:";
|
|
1213
1296
|
let positives = "";
|
|
1214
1297
|
let negatives = "";
|
|
@@ -1229,12 +1312,12 @@ var require_fill_range = __commonJS({
|
|
|
1229
1312
|
}
|
|
1230
1313
|
return result;
|
|
1231
1314
|
};
|
|
1232
|
-
var toRange = (
|
|
1315
|
+
var toRange = (a2, b, isNumbers, options) => {
|
|
1233
1316
|
if (isNumbers) {
|
|
1234
|
-
return toRegexRange(
|
|
1317
|
+
return toRegexRange(a2, b, { wrap: false, ...options });
|
|
1235
1318
|
}
|
|
1236
|
-
let start = String.fromCharCode(
|
|
1237
|
-
if (
|
|
1319
|
+
let start = String.fromCharCode(a2);
|
|
1320
|
+
if (a2 === b) return start;
|
|
1238
1321
|
let stop = String.fromCharCode(b);
|
|
1239
1322
|
return `[${start}-${stop}]`;
|
|
1240
1323
|
};
|
|
@@ -1260,15 +1343,15 @@ var require_fill_range = __commonJS({
|
|
|
1260
1343
|
return [];
|
|
1261
1344
|
};
|
|
1262
1345
|
var fillNumbers = (start, end, step = 1, options = {}) => {
|
|
1263
|
-
let
|
|
1346
|
+
let a2 = Number(start);
|
|
1264
1347
|
let b = Number(end);
|
|
1265
|
-
if (!Number.isInteger(
|
|
1348
|
+
if (!Number.isInteger(a2) || !Number.isInteger(b)) {
|
|
1266
1349
|
if (options.strictRanges === true) throw rangeError([start, end]);
|
|
1267
1350
|
return [];
|
|
1268
1351
|
}
|
|
1269
|
-
if (
|
|
1352
|
+
if (a2 === 0) a2 = 0;
|
|
1270
1353
|
if (b === 0) b = 0;
|
|
1271
|
-
let descending =
|
|
1354
|
+
let descending = a2 > b;
|
|
1272
1355
|
let startString = String(start);
|
|
1273
1356
|
let endString = String(end);
|
|
1274
1357
|
let stepString = String(step);
|
|
@@ -1284,13 +1367,13 @@ var require_fill_range = __commonJS({
|
|
|
1284
1367
|
let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
|
|
1285
1368
|
let range = [];
|
|
1286
1369
|
let index = 0;
|
|
1287
|
-
while (descending ?
|
|
1370
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
1288
1371
|
if (options.toRegex === true && step > 1) {
|
|
1289
|
-
push(
|
|
1372
|
+
push(a2);
|
|
1290
1373
|
} else {
|
|
1291
|
-
range.push(pad(format(
|
|
1374
|
+
range.push(pad(format(a2, index), maxLen, toNumber));
|
|
1292
1375
|
}
|
|
1293
|
-
|
|
1376
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
1294
1377
|
index++;
|
|
1295
1378
|
}
|
|
1296
1379
|
if (options.toRegex === true) {
|
|
@@ -1303,19 +1386,19 @@ var require_fill_range = __commonJS({
|
|
|
1303
1386
|
return invalidRange(start, end, options);
|
|
1304
1387
|
}
|
|
1305
1388
|
let format = options.transform || ((val) => String.fromCharCode(val));
|
|
1306
|
-
let
|
|
1389
|
+
let a2 = `${start}`.charCodeAt(0);
|
|
1307
1390
|
let b = `${end}`.charCodeAt(0);
|
|
1308
|
-
let descending =
|
|
1309
|
-
let min = Math.min(
|
|
1310
|
-
let max = Math.max(
|
|
1391
|
+
let descending = a2 > b;
|
|
1392
|
+
let min = Math.min(a2, b);
|
|
1393
|
+
let max = Math.max(a2, b);
|
|
1311
1394
|
if (options.toRegex && step === 1) {
|
|
1312
1395
|
return toRange(min, max, false, options);
|
|
1313
1396
|
}
|
|
1314
1397
|
let range = [];
|
|
1315
1398
|
let index = 0;
|
|
1316
|
-
while (descending ?
|
|
1317
|
-
range.push(format(
|
|
1318
|
-
|
|
1399
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
1400
|
+
range.push(format(a2, index));
|
|
1401
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
1319
1402
|
index++;
|
|
1320
1403
|
}
|
|
1321
1404
|
if (options.toRegex === true) {
|
|
@@ -1439,17 +1522,17 @@ var require_expand = __commonJS({
|
|
|
1439
1522
|
const walk = (node, parent = {}) => {
|
|
1440
1523
|
node.queue = [];
|
|
1441
1524
|
let p = parent;
|
|
1442
|
-
let
|
|
1525
|
+
let q = parent.queue;
|
|
1443
1526
|
while (p.type !== "brace" && p.type !== "root" && p.parent) {
|
|
1444
1527
|
p = p.parent;
|
|
1445
|
-
|
|
1528
|
+
q = p.queue;
|
|
1446
1529
|
}
|
|
1447
1530
|
if (node.invalid || node.dollar) {
|
|
1448
|
-
|
|
1531
|
+
q.push(append(q.pop(), stringify2(node, options)));
|
|
1449
1532
|
return;
|
|
1450
1533
|
}
|
|
1451
1534
|
if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
|
|
1452
|
-
|
|
1535
|
+
q.push(append(q.pop(), ["{}"]));
|
|
1453
1536
|
return;
|
|
1454
1537
|
}
|
|
1455
1538
|
if (node.nodes && node.ranges > 0) {
|
|
@@ -1461,26 +1544,26 @@ var require_expand = __commonJS({
|
|
|
1461
1544
|
if (range.length === 0) {
|
|
1462
1545
|
range = stringify2(node, options);
|
|
1463
1546
|
}
|
|
1464
|
-
|
|
1547
|
+
q.push(append(q.pop(), range));
|
|
1465
1548
|
node.nodes = [];
|
|
1466
1549
|
return;
|
|
1467
1550
|
}
|
|
1468
1551
|
const enclose = utils.encloseBrace(node);
|
|
1469
1552
|
let queue = node.queue;
|
|
1470
|
-
let
|
|
1471
|
-
while (
|
|
1472
|
-
|
|
1473
|
-
queue =
|
|
1553
|
+
let block2 = node;
|
|
1554
|
+
while (block2.type !== "brace" && block2.type !== "root" && block2.parent) {
|
|
1555
|
+
block2 = block2.parent;
|
|
1556
|
+
queue = block2.queue;
|
|
1474
1557
|
}
|
|
1475
|
-
for (let
|
|
1476
|
-
const child = node.nodes[
|
|
1558
|
+
for (let i2 = 0; i2 < node.nodes.length; i2++) {
|
|
1559
|
+
const child = node.nodes[i2];
|
|
1477
1560
|
if (child.type === "comma" && node.type === "brace") {
|
|
1478
|
-
if (
|
|
1561
|
+
if (i2 === 1) queue.push("");
|
|
1479
1562
|
queue.push("");
|
|
1480
1563
|
continue;
|
|
1481
1564
|
}
|
|
1482
1565
|
if (child.type === "close") {
|
|
1483
|
-
|
|
1566
|
+
q.push(append(q.pop(), queue, enclose));
|
|
1484
1567
|
continue;
|
|
1485
1568
|
}
|
|
1486
1569
|
if (child.value && child.type !== "open") {
|
|
@@ -1647,7 +1730,7 @@ var require_parse = __commonJS({
|
|
|
1647
1730
|
}
|
|
1648
1731
|
const ast = { type: "root", input, nodes: [] };
|
|
1649
1732
|
const stack = [ast];
|
|
1650
|
-
let
|
|
1733
|
+
let block2 = ast;
|
|
1651
1734
|
let prev = ast;
|
|
1652
1735
|
let brackets = 0;
|
|
1653
1736
|
const length = input.length;
|
|
@@ -1663,15 +1746,15 @@ var require_parse = __commonJS({
|
|
|
1663
1746
|
prev.value += node.value;
|
|
1664
1747
|
return;
|
|
1665
1748
|
}
|
|
1666
|
-
|
|
1667
|
-
node.parent =
|
|
1749
|
+
block2.nodes.push(node);
|
|
1750
|
+
node.parent = block2;
|
|
1668
1751
|
node.prev = prev;
|
|
1669
1752
|
prev = node;
|
|
1670
1753
|
return node;
|
|
1671
1754
|
};
|
|
1672
1755
|
push({ type: "bos" });
|
|
1673
1756
|
while (index < length) {
|
|
1674
|
-
|
|
1757
|
+
block2 = stack[stack.length - 1];
|
|
1675
1758
|
value = advance();
|
|
1676
1759
|
if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
|
|
1677
1760
|
continue;
|
|
@@ -1708,19 +1791,19 @@ var require_parse = __commonJS({
|
|
|
1708
1791
|
continue;
|
|
1709
1792
|
}
|
|
1710
1793
|
if (value === CHAR_LEFT_PARENTHESES) {
|
|
1711
|
-
|
|
1712
|
-
stack.push(
|
|
1794
|
+
block2 = push({ type: "paren", nodes: [] });
|
|
1795
|
+
stack.push(block2);
|
|
1713
1796
|
push({ type: "text", value });
|
|
1714
1797
|
continue;
|
|
1715
1798
|
}
|
|
1716
1799
|
if (value === CHAR_RIGHT_PARENTHESES) {
|
|
1717
|
-
if (
|
|
1800
|
+
if (block2.type !== "paren") {
|
|
1718
1801
|
push({ type: "text", value });
|
|
1719
1802
|
continue;
|
|
1720
1803
|
}
|
|
1721
|
-
|
|
1804
|
+
block2 = stack.pop();
|
|
1722
1805
|
push({ type: "text", value });
|
|
1723
|
-
|
|
1806
|
+
block2 = stack[stack.length - 1];
|
|
1724
1807
|
continue;
|
|
1725
1808
|
}
|
|
1726
1809
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
@@ -1745,7 +1828,7 @@ var require_parse = __commonJS({
|
|
|
1745
1828
|
}
|
|
1746
1829
|
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
1747
1830
|
depth++;
|
|
1748
|
-
const dollar = prev.value && prev.value.slice(-1) === "$" ||
|
|
1831
|
+
const dollar = prev.value && prev.value.slice(-1) === "$" || block2.dollar === true;
|
|
1749
1832
|
const brace = {
|
|
1750
1833
|
type: "brace",
|
|
1751
1834
|
open: true,
|
|
@@ -1756,52 +1839,52 @@ var require_parse = __commonJS({
|
|
|
1756
1839
|
ranges: 0,
|
|
1757
1840
|
nodes: []
|
|
1758
1841
|
};
|
|
1759
|
-
|
|
1760
|
-
stack.push(
|
|
1842
|
+
block2 = push(brace);
|
|
1843
|
+
stack.push(block2);
|
|
1761
1844
|
push({ type: "open", value });
|
|
1762
1845
|
continue;
|
|
1763
1846
|
}
|
|
1764
1847
|
if (value === CHAR_RIGHT_CURLY_BRACE) {
|
|
1765
|
-
if (
|
|
1848
|
+
if (block2.type !== "brace") {
|
|
1766
1849
|
push({ type: "text", value });
|
|
1767
1850
|
continue;
|
|
1768
1851
|
}
|
|
1769
1852
|
const type = "close";
|
|
1770
|
-
|
|
1771
|
-
|
|
1853
|
+
block2 = stack.pop();
|
|
1854
|
+
block2.close = true;
|
|
1772
1855
|
push({ type, value });
|
|
1773
1856
|
depth--;
|
|
1774
|
-
|
|
1857
|
+
block2 = stack[stack.length - 1];
|
|
1775
1858
|
continue;
|
|
1776
1859
|
}
|
|
1777
1860
|
if (value === CHAR_COMMA && depth > 0) {
|
|
1778
|
-
if (
|
|
1779
|
-
|
|
1780
|
-
const open =
|
|
1781
|
-
|
|
1861
|
+
if (block2.ranges > 0) {
|
|
1862
|
+
block2.ranges = 0;
|
|
1863
|
+
const open = block2.nodes.shift();
|
|
1864
|
+
block2.nodes = [open, { type: "text", value: stringify2(block2) }];
|
|
1782
1865
|
}
|
|
1783
1866
|
push({ type: "comma", value });
|
|
1784
|
-
|
|
1867
|
+
block2.commas++;
|
|
1785
1868
|
continue;
|
|
1786
1869
|
}
|
|
1787
|
-
if (value === CHAR_DOT && depth > 0 &&
|
|
1788
|
-
const siblings =
|
|
1870
|
+
if (value === CHAR_DOT && depth > 0 && block2.commas === 0) {
|
|
1871
|
+
const siblings = block2.nodes;
|
|
1789
1872
|
if (depth === 0 || siblings.length === 0) {
|
|
1790
1873
|
push({ type: "text", value });
|
|
1791
1874
|
continue;
|
|
1792
1875
|
}
|
|
1793
1876
|
if (prev.type === "dot") {
|
|
1794
|
-
|
|
1877
|
+
block2.range = [];
|
|
1795
1878
|
prev.value += value;
|
|
1796
1879
|
prev.type = "range";
|
|
1797
|
-
if (
|
|
1798
|
-
|
|
1799
|
-
|
|
1880
|
+
if (block2.nodes.length !== 3 && block2.nodes.length !== 5) {
|
|
1881
|
+
block2.invalid = true;
|
|
1882
|
+
block2.ranges = 0;
|
|
1800
1883
|
prev.type = "text";
|
|
1801
1884
|
continue;
|
|
1802
1885
|
}
|
|
1803
|
-
|
|
1804
|
-
|
|
1886
|
+
block2.ranges++;
|
|
1887
|
+
block2.args = [];
|
|
1805
1888
|
continue;
|
|
1806
1889
|
}
|
|
1807
1890
|
if (prev.type === "range") {
|
|
@@ -1809,7 +1892,7 @@ var require_parse = __commonJS({
|
|
|
1809
1892
|
const before = siblings[siblings.length - 1];
|
|
1810
1893
|
before.value += prev.value + value;
|
|
1811
1894
|
prev = before;
|
|
1812
|
-
|
|
1895
|
+
block2.ranges--;
|
|
1813
1896
|
continue;
|
|
1814
1897
|
}
|
|
1815
1898
|
push({ type: "dot", value });
|
|
@@ -1818,9 +1901,9 @@ var require_parse = __commonJS({
|
|
|
1818
1901
|
push({ type: "text", value });
|
|
1819
1902
|
}
|
|
1820
1903
|
do {
|
|
1821
|
-
|
|
1822
|
-
if (
|
|
1823
|
-
|
|
1904
|
+
block2 = stack.pop();
|
|
1905
|
+
if (block2.type !== "root") {
|
|
1906
|
+
block2.nodes.forEach((node) => {
|
|
1824
1907
|
if (!node.nodes) {
|
|
1825
1908
|
if (node.type === "open") node.isOpen = true;
|
|
1826
1909
|
if (node.type === "close") node.isClose = true;
|
|
@@ -1829,8 +1912,8 @@ var require_parse = __commonJS({
|
|
|
1829
1912
|
}
|
|
1830
1913
|
});
|
|
1831
1914
|
const parent = stack[stack.length - 1];
|
|
1832
|
-
const index2 = parent.nodes.indexOf(
|
|
1833
|
-
parent.nodes.splice(index2, 1, ...
|
|
1915
|
+
const index2 = parent.nodes.indexOf(block2);
|
|
1916
|
+
parent.nodes.splice(index2, 1, ...block2.nodes);
|
|
1834
1917
|
}
|
|
1835
1918
|
} while (stack.length > 0);
|
|
1836
1919
|
push({ type: "eos" });
|
|
@@ -2463,9 +2546,9 @@ var require_scan = __commonJS({
|
|
|
2463
2546
|
if (opts.parts === true || opts.tokens === true) {
|
|
2464
2547
|
let prevIndex;
|
|
2465
2548
|
for (let idx = 0; idx < slashes.length; idx++) {
|
|
2466
|
-
const
|
|
2467
|
-
const
|
|
2468
|
-
const value = input.slice(
|
|
2549
|
+
const n2 = prevIndex ? prevIndex + 1 : start;
|
|
2550
|
+
const i2 = slashes[idx];
|
|
2551
|
+
const value = input.slice(n2, i2);
|
|
2469
2552
|
if (opts.tokens) {
|
|
2470
2553
|
if (idx === 0 && start !== 0) {
|
|
2471
2554
|
tokens[idx].isPrefix = true;
|
|
@@ -2479,7 +2562,7 @@ var require_scan = __commonJS({
|
|
|
2479
2562
|
if (idx !== 0 || value !== "") {
|
|
2480
2563
|
parts.push(value);
|
|
2481
2564
|
}
|
|
2482
|
-
prevIndex =
|
|
2565
|
+
prevIndex = i2;
|
|
2483
2566
|
}
|
|
2484
2567
|
if (prevIndex && prevIndex + 1 < input.length) {
|
|
2485
2568
|
const value = input.slice(prevIndex + 1);
|
|
@@ -2608,15 +2691,15 @@ var require_parse2 = __commonJS({
|
|
|
2608
2691
|
};
|
|
2609
2692
|
var hasRepeatedCharPrefixOverlap = (branches) => {
|
|
2610
2693
|
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
2611
|
-
for (let
|
|
2612
|
-
for (let j =
|
|
2613
|
-
const
|
|
2694
|
+
for (let i2 = 0; i2 < values.length; i2++) {
|
|
2695
|
+
for (let j = i2 + 1; j < values.length; j++) {
|
|
2696
|
+
const a2 = values[i2];
|
|
2614
2697
|
const b = values[j];
|
|
2615
|
-
const char =
|
|
2616
|
-
if (!char ||
|
|
2698
|
+
const char = a2[0];
|
|
2699
|
+
if (!char || a2 !== char.repeat(a2.length) || b !== char.repeat(b.length)) {
|
|
2617
2700
|
continue;
|
|
2618
2701
|
}
|
|
2619
|
-
if (
|
|
2702
|
+
if (a2 === b || a2.startsWith(b) || b.startsWith(a2)) {
|
|
2620
2703
|
return true;
|
|
2621
2704
|
}
|
|
2622
2705
|
}
|
|
@@ -2631,8 +2714,8 @@ var require_parse2 = __commonJS({
|
|
|
2631
2714
|
let paren = 0;
|
|
2632
2715
|
let quote = 0;
|
|
2633
2716
|
let escaped = false;
|
|
2634
|
-
for (let
|
|
2635
|
-
const ch = pattern[
|
|
2717
|
+
for (let i2 = 1; i2 < pattern.length; i2++) {
|
|
2718
|
+
const ch = pattern[i2];
|
|
2636
2719
|
if (escaped === true) {
|
|
2637
2720
|
escaped = false;
|
|
2638
2721
|
continue;
|
|
@@ -2666,13 +2749,13 @@ var require_parse2 = __commonJS({
|
|
|
2666
2749
|
if (ch === ")") {
|
|
2667
2750
|
paren--;
|
|
2668
2751
|
if (paren === 0) {
|
|
2669
|
-
if (requireEnd === true &&
|
|
2752
|
+
if (requireEnd === true && i2 !== pattern.length - 1) {
|
|
2670
2753
|
return;
|
|
2671
2754
|
}
|
|
2672
2755
|
return {
|
|
2673
2756
|
type: pattern[0],
|
|
2674
|
-
body: pattern.slice(2,
|
|
2675
|
-
end:
|
|
2757
|
+
body: pattern.slice(2, i2),
|
|
2758
|
+
end: i2
|
|
2676
2759
|
};
|
|
2677
2760
|
}
|
|
2678
2761
|
}
|
|
@@ -2804,7 +2887,7 @@ var require_parse2 = __commonJS({
|
|
|
2804
2887
|
let prev = bos;
|
|
2805
2888
|
let value;
|
|
2806
2889
|
const eos = () => state.index === len - 1;
|
|
2807
|
-
const peek = state.peek = (
|
|
2890
|
+
const peek = state.peek = (n2 = 1) => input[state.index + n2];
|
|
2808
2891
|
const advance = state.advance = () => input[++state.index] || "";
|
|
2809
2892
|
const remaining = () => input.slice(state.index + 1);
|
|
2810
2893
|
const consume = (value2 = "", num = 0) => {
|
|
@@ -2885,10 +2968,10 @@ var require_parse2 = __commonJS({
|
|
|
2885
2968
|
open.type = "text";
|
|
2886
2969
|
open.value = literal;
|
|
2887
2970
|
open.output = safeOutput || utils.escapeRegex(literal);
|
|
2888
|
-
for (let
|
|
2889
|
-
tokens[
|
|
2890
|
-
tokens[
|
|
2891
|
-
delete tokens[
|
|
2971
|
+
for (let i2 = token.tokensIndex + 1; i2 < tokens.length; i2++) {
|
|
2972
|
+
tokens[i2].value = "";
|
|
2973
|
+
tokens[i2].output = "";
|
|
2974
|
+
delete tokens[i2].suffix;
|
|
2892
2975
|
}
|
|
2893
2976
|
state.output = token.output + open.output;
|
|
2894
2977
|
state.backtrack = true;
|
|
@@ -3131,13 +3214,13 @@ var require_parse2 = __commonJS({
|
|
|
3131
3214
|
if (brace.dots === true) {
|
|
3132
3215
|
const arr = tokens.slice();
|
|
3133
3216
|
const range = [];
|
|
3134
|
-
for (let
|
|
3217
|
+
for (let i2 = arr.length - 1; i2 >= 0; i2--) {
|
|
3135
3218
|
tokens.pop();
|
|
3136
|
-
if (arr[
|
|
3219
|
+
if (arr[i2].type === "brace") {
|
|
3137
3220
|
break;
|
|
3138
3221
|
}
|
|
3139
|
-
if (arr[
|
|
3140
|
-
range.unshift(arr[
|
|
3222
|
+
if (arr[i2].type !== "dots") {
|
|
3223
|
+
range.unshift(arr[i2].value);
|
|
3141
3224
|
}
|
|
3142
3225
|
}
|
|
3143
3226
|
output = expandRange(range, opts);
|
|
@@ -3680,8 +3763,8 @@ var require_micromatch = __commonJS({
|
|
|
3680
3763
|
options.onResult(state);
|
|
3681
3764
|
}
|
|
3682
3765
|
};
|
|
3683
|
-
for (let
|
|
3684
|
-
let isMatch = picomatch(String(patterns[
|
|
3766
|
+
for (let i2 = 0; i2 < patterns.length; i2++) {
|
|
3767
|
+
let isMatch = picomatch(String(patterns[i2]), { ...options, onResult }, true);
|
|
3685
3768
|
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
|
|
3686
3769
|
if (negated) negatives++;
|
|
3687
3770
|
for (let item of list) {
|
|
@@ -3929,7 +4012,7 @@ var require_pattern = __commonJS({
|
|
|
3929
4012
|
exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
|
3930
4013
|
function expandBraceExpansion(pattern) {
|
|
3931
4014
|
const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });
|
|
3932
|
-
patterns.sort((
|
|
4015
|
+
patterns.sort((a2, b) => a2.length - b.length);
|
|
3933
4016
|
return patterns.filter((pattern2) => pattern2 !== "");
|
|
3934
4017
|
}
|
|
3935
4018
|
exports.expandBraceExpansion = expandBraceExpansion;
|
|
@@ -4010,8 +4093,8 @@ var require_merge2 = __commonJS({
|
|
|
4010
4093
|
}
|
|
4011
4094
|
const mergedStream = PassThrough(options);
|
|
4012
4095
|
function addStream() {
|
|
4013
|
-
for (let
|
|
4014
|
-
streamsQueue.push(pauseStreams(arguments[
|
|
4096
|
+
for (let i2 = 0, len = arguments.length; i2 < len; i2++) {
|
|
4097
|
+
streamsQueue.push(pauseStreams(arguments[i2], options));
|
|
4015
4098
|
}
|
|
4016
4099
|
mergeStream();
|
|
4017
4100
|
return this;
|
|
@@ -4060,8 +4143,8 @@ var require_merge2 = __commonJS({
|
|
|
4060
4143
|
stream.pipe(mergedStream, { end: false });
|
|
4061
4144
|
stream.resume();
|
|
4062
4145
|
}
|
|
4063
|
-
for (let
|
|
4064
|
-
pipe(streams[
|
|
4146
|
+
for (let i2 = 0; i2 < streams.length; i2++) {
|
|
4147
|
+
pipe(streams[i2]);
|
|
4065
4148
|
}
|
|
4066
4149
|
next();
|
|
4067
4150
|
}
|
|
@@ -4092,8 +4175,8 @@ var require_merge2 = __commonJS({
|
|
|
4092
4175
|
}
|
|
4093
4176
|
streams.pause();
|
|
4094
4177
|
} else {
|
|
4095
|
-
for (let
|
|
4096
|
-
streams[
|
|
4178
|
+
for (let i2 = 0, len = streams.length; i2 < len; i2++) {
|
|
4179
|
+
streams[i2] = pauseStreams(streams[i2], options);
|
|
4097
4180
|
}
|
|
4098
4181
|
}
|
|
4099
4182
|
return streams;
|
|
@@ -4175,13 +4258,13 @@ var require_tasks = __commonJS({
|
|
|
4175
4258
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4176
4259
|
exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
|
|
4177
4260
|
var utils = require_utils3();
|
|
4178
|
-
function generate(input,
|
|
4179
|
-
const patterns = processPatterns(input,
|
|
4180
|
-
const ignore = processPatterns(
|
|
4261
|
+
function generate(input, settings2) {
|
|
4262
|
+
const patterns = processPatterns(input, settings2);
|
|
4263
|
+
const ignore = processPatterns(settings2.ignore, settings2);
|
|
4181
4264
|
const positivePatterns = getPositivePatterns(patterns);
|
|
4182
4265
|
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,
|
|
4266
|
+
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings2));
|
|
4267
|
+
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings2));
|
|
4185
4268
|
const staticTasks = convertPatternsToTasks(
|
|
4186
4269
|
staticPatterns,
|
|
4187
4270
|
negativePatterns,
|
|
@@ -4197,12 +4280,12 @@ var require_tasks = __commonJS({
|
|
|
4197
4280
|
return staticTasks.concat(dynamicTasks);
|
|
4198
4281
|
}
|
|
4199
4282
|
exports.generate = generate;
|
|
4200
|
-
function processPatterns(input,
|
|
4283
|
+
function processPatterns(input, settings2) {
|
|
4201
4284
|
let patterns = input;
|
|
4202
|
-
if (
|
|
4285
|
+
if (settings2.braceExpansion) {
|
|
4203
4286
|
patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);
|
|
4204
4287
|
}
|
|
4205
|
-
if (
|
|
4288
|
+
if (settings2.baseNameMatch) {
|
|
4206
4289
|
patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`);
|
|
4207
4290
|
}
|
|
4208
4291
|
return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));
|
|
@@ -4271,26 +4354,26 @@ var require_async = __commonJS({
|
|
|
4271
4354
|
init_utils2();
|
|
4272
4355
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4273
4356
|
exports.read = void 0;
|
|
4274
|
-
function read(path,
|
|
4275
|
-
|
|
4357
|
+
function read(path, settings2, callback) {
|
|
4358
|
+
settings2.fs.lstat(path, (lstatError, lstat) => {
|
|
4276
4359
|
if (lstatError !== null) {
|
|
4277
4360
|
callFailureCallback(callback, lstatError);
|
|
4278
4361
|
return;
|
|
4279
4362
|
}
|
|
4280
|
-
if (!lstat.isSymbolicLink() || !
|
|
4363
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
4281
4364
|
callSuccessCallback(callback, lstat);
|
|
4282
4365
|
return;
|
|
4283
4366
|
}
|
|
4284
|
-
|
|
4367
|
+
settings2.fs.stat(path, (statError, stat) => {
|
|
4285
4368
|
if (statError !== null) {
|
|
4286
|
-
if (
|
|
4369
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4287
4370
|
callFailureCallback(callback, statError);
|
|
4288
4371
|
return;
|
|
4289
4372
|
}
|
|
4290
4373
|
callSuccessCallback(callback, lstat);
|
|
4291
4374
|
return;
|
|
4292
4375
|
}
|
|
4293
|
-
if (
|
|
4376
|
+
if (settings2.markSymbolicLink) {
|
|
4294
4377
|
stat.isSymbolicLink = () => true;
|
|
4295
4378
|
}
|
|
4296
4379
|
callSuccessCallback(callback, stat);
|
|
@@ -4314,19 +4397,19 @@ var require_sync = __commonJS({
|
|
|
4314
4397
|
init_utils2();
|
|
4315
4398
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4316
4399
|
exports.read = void 0;
|
|
4317
|
-
function read(path,
|
|
4318
|
-
const lstat =
|
|
4319
|
-
if (!lstat.isSymbolicLink() || !
|
|
4400
|
+
function read(path, settings2) {
|
|
4401
|
+
const lstat = settings2.fs.lstatSync(path);
|
|
4402
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
4320
4403
|
return lstat;
|
|
4321
4404
|
}
|
|
4322
4405
|
try {
|
|
4323
|
-
const stat =
|
|
4324
|
-
if (
|
|
4406
|
+
const stat = settings2.fs.statSync(path);
|
|
4407
|
+
if (settings2.markSymbolicLink) {
|
|
4325
4408
|
stat.isSymbolicLink = () => true;
|
|
4326
4409
|
}
|
|
4327
4410
|
return stat;
|
|
4328
4411
|
} catch (error2) {
|
|
4329
|
-
if (!
|
|
4412
|
+
if (!settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4330
4413
|
return lstat;
|
|
4331
4414
|
}
|
|
4332
4415
|
throw error2;
|
|
@@ -4403,8 +4486,8 @@ var require_out = __commonJS({
|
|
|
4403
4486
|
}
|
|
4404
4487
|
exports.stat = stat;
|
|
4405
4488
|
function statSync3(path, optionsOrSettings) {
|
|
4406
|
-
const
|
|
4407
|
-
return sync.read(path,
|
|
4489
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
4490
|
+
return sync.read(path, settings2);
|
|
4408
4491
|
}
|
|
4409
4492
|
exports.statSync = statSync3;
|
|
4410
4493
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -4452,8 +4535,8 @@ var require_run_parallel = __commonJS({
|
|
|
4452
4535
|
if (isSync) queueMicrotask2(end);
|
|
4453
4536
|
else end();
|
|
4454
4537
|
}
|
|
4455
|
-
function each(
|
|
4456
|
-
results[
|
|
4538
|
+
function each(i2, err, result) {
|
|
4539
|
+
results[i2] = result;
|
|
4457
4540
|
if (--pending === 0 || err) {
|
|
4458
4541
|
done(err);
|
|
4459
4542
|
}
|
|
@@ -4467,9 +4550,9 @@ var require_run_parallel = __commonJS({
|
|
|
4467
4550
|
});
|
|
4468
4551
|
});
|
|
4469
4552
|
} else {
|
|
4470
|
-
tasks.forEach(function(task,
|
|
4553
|
+
tasks.forEach(function(task, i2) {
|
|
4471
4554
|
task(function(err, result) {
|
|
4472
|
-
each(
|
|
4555
|
+
each(i2, err, result);
|
|
4473
4556
|
});
|
|
4474
4557
|
});
|
|
4475
4558
|
}
|
|
@@ -4544,11 +4627,11 @@ var require_common = __commonJS({
|
|
|
4544
4627
|
init_utils2();
|
|
4545
4628
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4546
4629
|
exports.joinPathSegments = void 0;
|
|
4547
|
-
function joinPathSegments(
|
|
4548
|
-
if (
|
|
4549
|
-
return
|
|
4630
|
+
function joinPathSegments(a2, b, separator) {
|
|
4631
|
+
if (a2.endsWith(separator)) {
|
|
4632
|
+
return a2 + b;
|
|
4550
4633
|
}
|
|
4551
|
-
return
|
|
4634
|
+
return a2 + separator + b;
|
|
4552
4635
|
}
|
|
4553
4636
|
exports.joinPathSegments = joinPathSegments;
|
|
4554
4637
|
}
|
|
@@ -4566,16 +4649,16 @@ var require_async2 = __commonJS({
|
|
|
4566
4649
|
var constants_1 = require_constants3();
|
|
4567
4650
|
var utils = require_utils4();
|
|
4568
4651
|
var common = require_common();
|
|
4569
|
-
function read(directory,
|
|
4570
|
-
if (!
|
|
4571
|
-
readdirWithFileTypes(directory,
|
|
4652
|
+
function read(directory, settings2, callback) {
|
|
4653
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
4654
|
+
readdirWithFileTypes(directory, settings2, callback);
|
|
4572
4655
|
return;
|
|
4573
4656
|
}
|
|
4574
|
-
readdir(directory,
|
|
4657
|
+
readdir(directory, settings2, callback);
|
|
4575
4658
|
}
|
|
4576
4659
|
exports.read = read;
|
|
4577
|
-
function readdirWithFileTypes(directory,
|
|
4578
|
-
|
|
4660
|
+
function readdirWithFileTypes(directory, settings2, callback) {
|
|
4661
|
+
settings2.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
|
|
4579
4662
|
if (readdirError !== null) {
|
|
4580
4663
|
callFailureCallback(callback, readdirError);
|
|
4581
4664
|
return;
|
|
@@ -4583,13 +4666,13 @@ var require_async2 = __commonJS({
|
|
|
4583
4666
|
const entries = dirents.map((dirent) => ({
|
|
4584
4667
|
dirent,
|
|
4585
4668
|
name: dirent.name,
|
|
4586
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
4669
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
4587
4670
|
}));
|
|
4588
|
-
if (!
|
|
4671
|
+
if (!settings2.followSymbolicLinks) {
|
|
4589
4672
|
callSuccessCallback(callback, entries);
|
|
4590
4673
|
return;
|
|
4591
4674
|
}
|
|
4592
|
-
const tasks = entries.map((entry) => makeRplTaskEntry(entry,
|
|
4675
|
+
const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings2));
|
|
4593
4676
|
rpl(tasks, (rplError, rplEntries) => {
|
|
4594
4677
|
if (rplError !== null) {
|
|
4595
4678
|
callFailureCallback(callback, rplError);
|
|
@@ -4600,15 +4683,15 @@ var require_async2 = __commonJS({
|
|
|
4600
4683
|
});
|
|
4601
4684
|
}
|
|
4602
4685
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
4603
|
-
function makeRplTaskEntry(entry,
|
|
4686
|
+
function makeRplTaskEntry(entry, settings2) {
|
|
4604
4687
|
return (done) => {
|
|
4605
4688
|
if (!entry.dirent.isSymbolicLink()) {
|
|
4606
4689
|
done(null, entry);
|
|
4607
4690
|
return;
|
|
4608
4691
|
}
|
|
4609
|
-
|
|
4692
|
+
settings2.fs.stat(entry.path, (statError, stats) => {
|
|
4610
4693
|
if (statError !== null) {
|
|
4611
|
-
if (
|
|
4694
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4612
4695
|
done(statError);
|
|
4613
4696
|
return;
|
|
4614
4697
|
}
|
|
@@ -4620,16 +4703,16 @@ var require_async2 = __commonJS({
|
|
|
4620
4703
|
});
|
|
4621
4704
|
};
|
|
4622
4705
|
}
|
|
4623
|
-
function readdir(directory,
|
|
4624
|
-
|
|
4706
|
+
function readdir(directory, settings2, callback) {
|
|
4707
|
+
settings2.fs.readdir(directory, (readdirError, names) => {
|
|
4625
4708
|
if (readdirError !== null) {
|
|
4626
4709
|
callFailureCallback(callback, readdirError);
|
|
4627
4710
|
return;
|
|
4628
4711
|
}
|
|
4629
4712
|
const tasks = names.map((name) => {
|
|
4630
|
-
const path = common.joinPathSegments(directory, name,
|
|
4713
|
+
const path = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
4631
4714
|
return (done) => {
|
|
4632
|
-
fsStat.stat(path,
|
|
4715
|
+
fsStat.stat(path, settings2.fsStatSettings, (error2, stats) => {
|
|
4633
4716
|
if (error2 !== null) {
|
|
4634
4717
|
done(error2);
|
|
4635
4718
|
return;
|
|
@@ -4639,7 +4722,7 @@ var require_async2 = __commonJS({
|
|
|
4639
4722
|
path,
|
|
4640
4723
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
4641
4724
|
};
|
|
4642
|
-
if (
|
|
4725
|
+
if (settings2.stats) {
|
|
4643
4726
|
entry.stats = stats;
|
|
4644
4727
|
}
|
|
4645
4728
|
done(null, entry);
|
|
@@ -4676,27 +4759,27 @@ var require_sync2 = __commonJS({
|
|
|
4676
4759
|
var constants_1 = require_constants3();
|
|
4677
4760
|
var utils = require_utils4();
|
|
4678
4761
|
var common = require_common();
|
|
4679
|
-
function read(directory,
|
|
4680
|
-
if (!
|
|
4681
|
-
return readdirWithFileTypes(directory,
|
|
4762
|
+
function read(directory, settings2) {
|
|
4763
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
4764
|
+
return readdirWithFileTypes(directory, settings2);
|
|
4682
4765
|
}
|
|
4683
|
-
return readdir(directory,
|
|
4766
|
+
return readdir(directory, settings2);
|
|
4684
4767
|
}
|
|
4685
4768
|
exports.read = read;
|
|
4686
|
-
function readdirWithFileTypes(directory,
|
|
4687
|
-
const dirents =
|
|
4769
|
+
function readdirWithFileTypes(directory, settings2) {
|
|
4770
|
+
const dirents = settings2.fs.readdirSync(directory, { withFileTypes: true });
|
|
4688
4771
|
return dirents.map((dirent) => {
|
|
4689
4772
|
const entry = {
|
|
4690
4773
|
dirent,
|
|
4691
4774
|
name: dirent.name,
|
|
4692
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
4775
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
4693
4776
|
};
|
|
4694
|
-
if (entry.dirent.isSymbolicLink() &&
|
|
4777
|
+
if (entry.dirent.isSymbolicLink() && settings2.followSymbolicLinks) {
|
|
4695
4778
|
try {
|
|
4696
|
-
const stats =
|
|
4779
|
+
const stats = settings2.fs.statSync(entry.path);
|
|
4697
4780
|
entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
|
4698
4781
|
} catch (error2) {
|
|
4699
|
-
if (
|
|
4782
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4700
4783
|
throw error2;
|
|
4701
4784
|
}
|
|
4702
4785
|
}
|
|
@@ -4705,17 +4788,17 @@ var require_sync2 = __commonJS({
|
|
|
4705
4788
|
});
|
|
4706
4789
|
}
|
|
4707
4790
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
4708
|
-
function readdir(directory,
|
|
4709
|
-
const names =
|
|
4791
|
+
function readdir(directory, settings2) {
|
|
4792
|
+
const names = settings2.fs.readdirSync(directory);
|
|
4710
4793
|
return names.map((name) => {
|
|
4711
|
-
const entryPath = common.joinPathSegments(directory, name,
|
|
4712
|
-
const stats = fsStat.statSync(entryPath,
|
|
4794
|
+
const entryPath = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
4795
|
+
const stats = fsStat.statSync(entryPath, settings2.fsStatSettings);
|
|
4713
4796
|
const entry = {
|
|
4714
4797
|
name,
|
|
4715
4798
|
path: entryPath,
|
|
4716
4799
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
4717
4800
|
};
|
|
4718
|
-
if (
|
|
4801
|
+
if (settings2.stats) {
|
|
4719
4802
|
entry.stats = stats;
|
|
4720
4803
|
}
|
|
4721
4804
|
return entry;
|
|
@@ -4802,8 +4885,8 @@ var require_out2 = __commonJS({
|
|
|
4802
4885
|
}
|
|
4803
4886
|
exports.scandir = scandir;
|
|
4804
4887
|
function scandirSync(path, optionsOrSettings) {
|
|
4805
|
-
const
|
|
4806
|
-
return sync.read(path,
|
|
4888
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
4889
|
+
return sync.read(path, settings2);
|
|
4807
4890
|
}
|
|
4808
4891
|
exports.scandirSync = scandirSync;
|
|
4809
4892
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -4847,9 +4930,9 @@ var require_reusify = __commonJS({
|
|
|
4847
4930
|
}
|
|
4848
4931
|
});
|
|
4849
4932
|
|
|
4850
|
-
// node_modules/.bun/fastq@1.20.
|
|
4933
|
+
// node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js
|
|
4851
4934
|
var require_queue = __commonJS({
|
|
4852
|
-
"node_modules/.bun/fastq@1.20.
|
|
4935
|
+
"node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js"(exports, module) {
|
|
4853
4936
|
"use strict";
|
|
4854
4937
|
init_utils2();
|
|
4855
4938
|
var reusify = require_reusify();
|
|
@@ -5029,11 +5112,12 @@ var require_queue = __commonJS({
|
|
|
5029
5112
|
current.value = null;
|
|
5030
5113
|
current.callback = noop;
|
|
5031
5114
|
current.errorHandler = null;
|
|
5115
|
+
current.next = null;
|
|
5032
5116
|
if (errorHandler2) {
|
|
5033
5117
|
errorHandler2(new Error("abort"), val);
|
|
5034
5118
|
}
|
|
5035
5119
|
callback.call(context2, new Error("abort"));
|
|
5036
|
-
|
|
5120
|
+
cache.release(current);
|
|
5037
5121
|
current = next;
|
|
5038
5122
|
}
|
|
5039
5123
|
self.drain = noop;
|
|
@@ -5139,11 +5223,11 @@ var require_common2 = __commonJS({
|
|
|
5139
5223
|
init_utils2();
|
|
5140
5224
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5141
5225
|
exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
|
|
5142
|
-
function isFatalError(
|
|
5143
|
-
if (
|
|
5226
|
+
function isFatalError(settings2, error2) {
|
|
5227
|
+
if (settings2.errorFilter === null) {
|
|
5144
5228
|
return true;
|
|
5145
5229
|
}
|
|
5146
|
-
return !
|
|
5230
|
+
return !settings2.errorFilter(error2);
|
|
5147
5231
|
}
|
|
5148
5232
|
exports.isFatalError = isFatalError;
|
|
5149
5233
|
function isAppliedFilter(filter, value) {
|
|
@@ -5154,14 +5238,14 @@ var require_common2 = __commonJS({
|
|
|
5154
5238
|
return filepath.split(/[/\\]/).join(separator);
|
|
5155
5239
|
}
|
|
5156
5240
|
exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
|
|
5157
|
-
function joinPathSegments(
|
|
5158
|
-
if (
|
|
5241
|
+
function joinPathSegments(a2, b, separator) {
|
|
5242
|
+
if (a2 === "") {
|
|
5159
5243
|
return b;
|
|
5160
5244
|
}
|
|
5161
|
-
if (
|
|
5162
|
-
return
|
|
5245
|
+
if (a2.endsWith(separator)) {
|
|
5246
|
+
return a2 + b;
|
|
5163
5247
|
}
|
|
5164
|
-
return
|
|
5248
|
+
return a2 + separator + b;
|
|
5165
5249
|
}
|
|
5166
5250
|
exports.joinPathSegments = joinPathSegments;
|
|
5167
5251
|
}
|
|
@@ -5508,14 +5592,14 @@ var require_out3 = __commonJS({
|
|
|
5508
5592
|
}
|
|
5509
5593
|
exports.walk = walk;
|
|
5510
5594
|
function walkSync(directory, optionsOrSettings) {
|
|
5511
|
-
const
|
|
5512
|
-
const provider = new sync_1.default(directory,
|
|
5595
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5596
|
+
const provider = new sync_1.default(directory, settings2);
|
|
5513
5597
|
return provider.read();
|
|
5514
5598
|
}
|
|
5515
5599
|
exports.walkSync = walkSync;
|
|
5516
5600
|
function walkStream(directory, optionsOrSettings) {
|
|
5517
|
-
const
|
|
5518
|
-
const provider = new stream_1.default(directory,
|
|
5601
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5602
|
+
const provider = new stream_1.default(directory, settings2);
|
|
5519
5603
|
return provider.read();
|
|
5520
5604
|
}
|
|
5521
5605
|
exports.walkStream = walkStream;
|
|
@@ -5601,8 +5685,8 @@ var require_stream3 = __commonJS({
|
|
|
5601
5685
|
done();
|
|
5602
5686
|
}).catch(done);
|
|
5603
5687
|
};
|
|
5604
|
-
for (let
|
|
5605
|
-
stream.write(
|
|
5688
|
+
for (let i2 = 0; i2 < filepaths.length; i2++) {
|
|
5689
|
+
stream.write(i2);
|
|
5606
5690
|
}
|
|
5607
5691
|
return stream;
|
|
5608
5692
|
}
|
|
@@ -6263,14 +6347,14 @@ var require_out4 = __commonJS({
|
|
|
6263
6347
|
function generateTasks(source, options) {
|
|
6264
6348
|
assertPatternsInput(source);
|
|
6265
6349
|
const patterns = [].concat(source);
|
|
6266
|
-
const
|
|
6267
|
-
return taskManager.generate(patterns,
|
|
6350
|
+
const settings2 = new settings_1.default(options);
|
|
6351
|
+
return taskManager.generate(patterns, settings2);
|
|
6268
6352
|
}
|
|
6269
6353
|
FastGlob2.generateTasks = generateTasks;
|
|
6270
6354
|
function isDynamicPattern(source, options) {
|
|
6271
6355
|
assertPatternsInput(source);
|
|
6272
|
-
const
|
|
6273
|
-
return utils.pattern.isDynamicPattern(source,
|
|
6356
|
+
const settings2 = new settings_1.default(options);
|
|
6357
|
+
return utils.pattern.isDynamicPattern(source, settings2);
|
|
6274
6358
|
}
|
|
6275
6359
|
FastGlob2.isDynamicPattern = isDynamicPattern;
|
|
6276
6360
|
function escapePath(source) {
|
|
@@ -6312,9 +6396,9 @@ var require_out4 = __commonJS({
|
|
|
6312
6396
|
})(FastGlob || (FastGlob = {}));
|
|
6313
6397
|
function getWorks(source, _Provider, options) {
|
|
6314
6398
|
const patterns = [].concat(source);
|
|
6315
|
-
const
|
|
6316
|
-
const tasks = taskManager.generate(patterns,
|
|
6317
|
-
const provider = new _Provider(
|
|
6399
|
+
const settings2 = new settings_1.default(options);
|
|
6400
|
+
const tasks = taskManager.generate(patterns, settings2);
|
|
6401
|
+
const provider = new _Provider(settings2);
|
|
6318
6402
|
return tasks.map(provider.read, provider);
|
|
6319
6403
|
}
|
|
6320
6404
|
function assertPatternsInput(input) {
|
|
@@ -6492,14 +6576,14 @@ import "node:fs";
|
|
|
6492
6576
|
import { createRequire } from "node:module";
|
|
6493
6577
|
import {
|
|
6494
6578
|
resolve,
|
|
6495
|
-
join,
|
|
6496
|
-
dirname,
|
|
6579
|
+
join as join2,
|
|
6580
|
+
dirname as dirname2,
|
|
6497
6581
|
relative,
|
|
6498
6582
|
normalize,
|
|
6499
6583
|
sep,
|
|
6500
6584
|
extname
|
|
6501
6585
|
} from "node:path";
|
|
6502
|
-
import "node:url";
|
|
6586
|
+
import { fileURLToPath } from "node:url";
|
|
6503
6587
|
function safeExecuteAsync(fn, message) {
|
|
6504
6588
|
return fn().catch((error2) => {
|
|
6505
6589
|
throw new Error(
|
|
@@ -6507,7 +6591,7 @@ function safeExecuteAsync(fn, message) {
|
|
|
6507
6591
|
);
|
|
6508
6592
|
});
|
|
6509
6593
|
}
|
|
6510
|
-
var import_fast_glob, constants,
|
|
6594
|
+
var import_fast_glob, constants, log3, PACKAGE_PATHS, PathResolver;
|
|
6511
6595
|
var init_PathResolver = __esm({
|
|
6512
6596
|
"packages/core/config/utils/PathResolver.ts"() {
|
|
6513
6597
|
"use strict";
|
|
@@ -6520,7 +6604,7 @@ var init_PathResolver = __esm({
|
|
|
6520
6604
|
getPatternsFor: getPatternsFor || void 0,
|
|
6521
6605
|
I18N_PATHS: I18N_PATHS || void 0
|
|
6522
6606
|
};
|
|
6523
|
-
|
|
6607
|
+
log3 = {
|
|
6524
6608
|
error: (message, error2) => {
|
|
6525
6609
|
},
|
|
6526
6610
|
warn: (message, error2) => {
|
|
@@ -6556,6 +6640,7 @@ var init_PathResolver = __esm({
|
|
|
6556
6640
|
options;
|
|
6557
6641
|
_repoRoot;
|
|
6558
6642
|
_appRoot = null;
|
|
6643
|
+
_writtenPaths = null;
|
|
6559
6644
|
/**
|
|
6560
6645
|
* Get or create singleton instance
|
|
6561
6646
|
* @param options - Configuration options
|
|
@@ -6641,7 +6726,7 @@ var init_PathResolver = __esm({
|
|
|
6641
6726
|
*/
|
|
6642
6727
|
getDirname(path) {
|
|
6643
6728
|
if (!path) return "";
|
|
6644
|
-
return this.normalizePath(
|
|
6729
|
+
return this.normalizePath(dirname2(path));
|
|
6645
6730
|
}
|
|
6646
6731
|
/**
|
|
6647
6732
|
* Resolve package path using Node's module resolution
|
|
@@ -6653,7 +6738,7 @@ var init_PathResolver = __esm({
|
|
|
6653
6738
|
resolvePackage(packageSpecifier, fromPath = null) {
|
|
6654
6739
|
try {
|
|
6655
6740
|
const basePath = fromPath || this.getAppRoot();
|
|
6656
|
-
const require3 = createRequire(
|
|
6741
|
+
const require3 = createRequire(join2(basePath, "package.json"));
|
|
6657
6742
|
const resolved = require3.resolve(packageSpecifier);
|
|
6658
6743
|
return this.normalizePath(resolved);
|
|
6659
6744
|
} catch (error2) {
|
|
@@ -6805,7 +6890,7 @@ var init_PathResolver = __esm({
|
|
|
6805
6890
|
return cleanContent;
|
|
6806
6891
|
} catch (error2) {
|
|
6807
6892
|
if (this.options.debug) {
|
|
6808
|
-
|
|
6893
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
6809
6894
|
}
|
|
6810
6895
|
return null;
|
|
6811
6896
|
}
|
|
@@ -6833,7 +6918,7 @@ var init_PathResolver = __esm({
|
|
|
6833
6918
|
return cleanContent;
|
|
6834
6919
|
} catch (error2) {
|
|
6835
6920
|
if (this.options.debug) {
|
|
6836
|
-
|
|
6921
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
6837
6922
|
}
|
|
6838
6923
|
return null;
|
|
6839
6924
|
}
|
|
@@ -6855,16 +6940,16 @@ var init_PathResolver = __esm({
|
|
|
6855
6940
|
verbose = false
|
|
6856
6941
|
} = options;
|
|
6857
6942
|
const normalizedPath = this.normalizePath(filePath);
|
|
6858
|
-
const dir = this.normalizePath(
|
|
6943
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
6859
6944
|
const fileExists = this.pathExists(normalizedPath);
|
|
6860
6945
|
if (fileExists && !overwrite) {
|
|
6861
6946
|
if (verbose) {
|
|
6862
|
-
|
|
6947
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
6863
6948
|
}
|
|
6864
6949
|
return false;
|
|
6865
6950
|
}
|
|
6866
6951
|
if (dryRun) {
|
|
6867
|
-
|
|
6952
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
6868
6953
|
return true;
|
|
6869
6954
|
}
|
|
6870
6955
|
try {
|
|
@@ -6874,22 +6959,23 @@ var init_PathResolver = __esm({
|
|
|
6874
6959
|
}
|
|
6875
6960
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
6876
6961
|
let writeContent;
|
|
6877
|
-
if (
|
|
6962
|
+
if (Buffer2.isBuffer(content)) {
|
|
6878
6963
|
writeContent = content;
|
|
6879
6964
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
6880
|
-
writeContent = JSON.stringify(content, null, 2)
|
|
6965
|
+
writeContent = `${JSON.stringify(content, null, 2)}
|
|
6966
|
+
`;
|
|
6881
6967
|
} else {
|
|
6882
6968
|
writeContent = String(content);
|
|
6883
6969
|
}
|
|
6884
6970
|
try {
|
|
6885
6971
|
return await safeExecuteAsync(async () => {
|
|
6886
|
-
if (
|
|
6972
|
+
if (Buffer2.isBuffer(writeContent)) {
|
|
6887
6973
|
await fs.promises.writeFile(normalizedPath, writeContent);
|
|
6888
6974
|
} else {
|
|
6889
6975
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
6890
6976
|
}
|
|
6891
6977
|
if (verbose) {
|
|
6892
|
-
|
|
6978
|
+
log3.info(
|
|
6893
6979
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
6894
6980
|
);
|
|
6895
6981
|
}
|
|
@@ -6916,16 +7002,16 @@ var init_PathResolver = __esm({
|
|
|
6916
7002
|
verbose = false
|
|
6917
7003
|
} = options;
|
|
6918
7004
|
const normalizedPath = this.normalizePath(filePath);
|
|
6919
|
-
const dir = this.normalizePath(
|
|
7005
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
6920
7006
|
const fileExists = this.pathExists(normalizedPath);
|
|
6921
7007
|
if (fileExists && !overwrite) {
|
|
6922
7008
|
if (verbose) {
|
|
6923
|
-
|
|
7009
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
6924
7010
|
}
|
|
6925
7011
|
return false;
|
|
6926
7012
|
}
|
|
6927
7013
|
if (dryRun) {
|
|
6928
|
-
|
|
7014
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
6929
7015
|
return true;
|
|
6930
7016
|
}
|
|
6931
7017
|
try {
|
|
@@ -6935,21 +7021,23 @@ var init_PathResolver = __esm({
|
|
|
6935
7021
|
}
|
|
6936
7022
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
6937
7023
|
let writeContent;
|
|
6938
|
-
if (
|
|
7024
|
+
if (Buffer2.isBuffer(content)) {
|
|
6939
7025
|
writeContent = content;
|
|
6940
7026
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
6941
|
-
writeContent = JSON.stringify(content, null, 2)
|
|
7027
|
+
writeContent = `${JSON.stringify(content, null, 2)}
|
|
7028
|
+
`;
|
|
6942
7029
|
} else {
|
|
6943
7030
|
writeContent = String(content);
|
|
6944
7031
|
}
|
|
6945
7032
|
try {
|
|
6946
|
-
if (
|
|
7033
|
+
if (Buffer2.isBuffer(writeContent)) {
|
|
6947
7034
|
fs.writeFileSync(normalizedPath, writeContent);
|
|
6948
7035
|
} else {
|
|
6949
7036
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
6950
7037
|
}
|
|
7038
|
+
this._writtenPaths?.add(normalizedPath);
|
|
6951
7039
|
if (verbose) {
|
|
6952
|
-
|
|
7040
|
+
log3.info(
|
|
6953
7041
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
6954
7042
|
);
|
|
6955
7043
|
}
|
|
@@ -6974,15 +7062,15 @@ var init_PathResolver = __esm({
|
|
|
6974
7062
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
6975
7063
|
if (fileExists && !overwrite) {
|
|
6976
7064
|
if (verbose) {
|
|
6977
|
-
|
|
7065
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
6978
7066
|
}
|
|
6979
7067
|
return false;
|
|
6980
7068
|
}
|
|
6981
7069
|
if (dryRun) {
|
|
6982
|
-
|
|
7070
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
6983
7071
|
return true;
|
|
6984
7072
|
}
|
|
6985
|
-
const dir = this.normalizePath(
|
|
7073
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
6986
7074
|
try {
|
|
6987
7075
|
await fs.promises.mkdir(dir, { recursive: true });
|
|
6988
7076
|
} catch (error2) {
|
|
@@ -6992,7 +7080,7 @@ var init_PathResolver = __esm({
|
|
|
6992
7080
|
return await safeExecuteAsync(async () => {
|
|
6993
7081
|
await fs.promises.copyFile(srcPath, normalizedDestPath);
|
|
6994
7082
|
if (verbose) {
|
|
6995
|
-
|
|
7083
|
+
log3.info(
|
|
6996
7084
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
6997
7085
|
);
|
|
6998
7086
|
}
|
|
@@ -7016,15 +7104,15 @@ var init_PathResolver = __esm({
|
|
|
7016
7104
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
7017
7105
|
if (fileExists && !overwrite) {
|
|
7018
7106
|
if (verbose) {
|
|
7019
|
-
|
|
7107
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
7020
7108
|
}
|
|
7021
7109
|
return false;
|
|
7022
7110
|
}
|
|
7023
7111
|
if (dryRun) {
|
|
7024
|
-
|
|
7112
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
7025
7113
|
return true;
|
|
7026
7114
|
}
|
|
7027
|
-
const dir = this.normalizePath(
|
|
7115
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
7028
7116
|
try {
|
|
7029
7117
|
fs.mkdirSync(dir, { recursive: true });
|
|
7030
7118
|
} catch (error2) {
|
|
@@ -7032,8 +7120,9 @@ var init_PathResolver = __esm({
|
|
|
7032
7120
|
}
|
|
7033
7121
|
try {
|
|
7034
7122
|
fs.copyFileSync(srcPath, normalizedDestPath);
|
|
7123
|
+
this._writtenPaths?.add(normalizedDestPath);
|
|
7035
7124
|
if (verbose) {
|
|
7036
|
-
|
|
7125
|
+
log3.info(
|
|
7037
7126
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
7038
7127
|
);
|
|
7039
7128
|
}
|
|
@@ -7050,7 +7139,7 @@ var init_PathResolver = __esm({
|
|
|
7050
7139
|
return fs.existsSync(filePath);
|
|
7051
7140
|
} catch (error2) {
|
|
7052
7141
|
if (!silent) {
|
|
7053
|
-
|
|
7142
|
+
log3.error(`Error checking path existence: ${filePath}`, error2);
|
|
7054
7143
|
}
|
|
7055
7144
|
return false;
|
|
7056
7145
|
}
|
|
@@ -7076,7 +7165,7 @@ var init_PathResolver = __esm({
|
|
|
7076
7165
|
return fs.readdirSync(dirPath, options);
|
|
7077
7166
|
} catch (error2) {
|
|
7078
7167
|
if (this.options.debug) {
|
|
7079
|
-
|
|
7168
|
+
log3.warn(`Failed to read directory: ${dirPath}`, error2);
|
|
7080
7169
|
}
|
|
7081
7170
|
const isObjectOptions = options && typeof options === "object" && "withFileTypes" in options;
|
|
7082
7171
|
return isObjectOptions && options.withFileTypes ? [] : [];
|
|
@@ -7094,11 +7183,29 @@ var init_PathResolver = __esm({
|
|
|
7094
7183
|
return fs.statSync(filePath);
|
|
7095
7184
|
} catch (error2) {
|
|
7096
7185
|
if (this.options.debug) {
|
|
7097
|
-
|
|
7186
|
+
log3.warn(`Failed to stat file: ${filePath}`, error2);
|
|
7098
7187
|
}
|
|
7099
7188
|
return null;
|
|
7100
7189
|
}
|
|
7101
7190
|
}
|
|
7191
|
+
/**
|
|
7192
|
+
* Resolve the real path of a file, following symlinks
|
|
7193
|
+
* @param filePath - Path to resolve
|
|
7194
|
+
* @returns Resolved real path
|
|
7195
|
+
*/
|
|
7196
|
+
realpathSync(filePath) {
|
|
7197
|
+
return fs.realpathSync(filePath);
|
|
7198
|
+
}
|
|
7199
|
+
/**
|
|
7200
|
+
* Watch a directory for changes
|
|
7201
|
+
* @param dirPath - Directory to watch
|
|
7202
|
+
* @param options - fs.watch options
|
|
7203
|
+
* @param callback - Callback for change events
|
|
7204
|
+
* @returns FSWatcher instance
|
|
7205
|
+
*/
|
|
7206
|
+
watch(dirPath, options, callback) {
|
|
7207
|
+
return fs.watch(dirPath, options, callback);
|
|
7208
|
+
}
|
|
7102
7209
|
/**
|
|
7103
7210
|
* Get file stats synchronously (follows symlinks)
|
|
7104
7211
|
* Returns null if file doesn't exist (graceful degradation)
|
|
@@ -7111,7 +7218,7 @@ var init_PathResolver = __esm({
|
|
|
7111
7218
|
return fs.lstatSync(filePath);
|
|
7112
7219
|
} catch (error2) {
|
|
7113
7220
|
if (this.options.debug) {
|
|
7114
|
-
|
|
7221
|
+
log3.warn(`Failed to lstat file: ${filePath}`, error2);
|
|
7115
7222
|
}
|
|
7116
7223
|
return null;
|
|
7117
7224
|
}
|
|
@@ -7178,6 +7285,28 @@ var init_PathResolver = __esm({
|
|
|
7178
7285
|
* Get app root (where vite.config.ts is, Vite's config.root)
|
|
7179
7286
|
* Falls back to repoRoot if not set
|
|
7180
7287
|
*/
|
|
7288
|
+
/**
|
|
7289
|
+
* Start recording every path written by writeSync/copySync.
|
|
7290
|
+
* Lets a generator know exactly which files the current run produced,
|
|
7291
|
+
* without comparing file timestamps to a clock.
|
|
7292
|
+
*/
|
|
7293
|
+
startWriteRecording() {
|
|
7294
|
+
this._writtenPaths = /* @__PURE__ */ new Set();
|
|
7295
|
+
}
|
|
7296
|
+
/**
|
|
7297
|
+
* Stop recording and return the normalized paths written since
|
|
7298
|
+
* startWriteRecording().
|
|
7299
|
+
*/
|
|
7300
|
+
stopWriteRecording() {
|
|
7301
|
+
if (!this._writtenPaths) {
|
|
7302
|
+
throw new Error(
|
|
7303
|
+
"stopWriteRecording() called without startWriteRecording()"
|
|
7304
|
+
);
|
|
7305
|
+
}
|
|
7306
|
+
const written = this._writtenPaths;
|
|
7307
|
+
this._writtenPaths = null;
|
|
7308
|
+
return written;
|
|
7309
|
+
}
|
|
7181
7310
|
getAppRoot() {
|
|
7182
7311
|
if (!this._appRoot) {
|
|
7183
7312
|
return this._repoRoot;
|
|
@@ -7200,7 +7329,7 @@ var init_PathResolver = __esm({
|
|
|
7200
7329
|
* @returns True if repoRoot is the monorepo (has packages directory)
|
|
7201
7330
|
*/
|
|
7202
7331
|
isMonorepo() {
|
|
7203
|
-
const packagesDir =
|
|
7332
|
+
const packagesDir = join2(this._repoRoot, "packages");
|
|
7204
7333
|
return this.pathExists(packagesDir);
|
|
7205
7334
|
}
|
|
7206
7335
|
/**
|
|
@@ -7217,7 +7346,7 @@ var init_PathResolver = __esm({
|
|
|
7217
7346
|
* Find files matching pattern within directory
|
|
7218
7347
|
*/
|
|
7219
7348
|
async findFiles(directory, pattern, options = {}) {
|
|
7220
|
-
const searchPattern = this.normalizePath(
|
|
7349
|
+
const searchPattern = this.normalizePath(join2(directory, pattern));
|
|
7221
7350
|
const appRoot = this.getAppRoot();
|
|
7222
7351
|
const normalizeAppRoot = this.normalizePath(appRoot);
|
|
7223
7352
|
const relativePattern = searchPattern.startsWith(normalizeAppRoot) ? searchPattern.slice(normalizeAppRoot.length + 1) : searchPattern;
|
|
@@ -7264,7 +7393,7 @@ var init_PathResolver = __esm({
|
|
|
7264
7393
|
return null;
|
|
7265
7394
|
}
|
|
7266
7395
|
const resolvedPath = this.normalizePath(
|
|
7267
|
-
|
|
7396
|
+
join2(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
|
|
7268
7397
|
);
|
|
7269
7398
|
const resolvedDir = resolvedPath.replace(/\/[^/]*\*.*$/, "");
|
|
7270
7399
|
if (this.pathExists(resolvedDir)) {
|
|
@@ -7435,6 +7564,15 @@ var init_PathResolver = __esm({
|
|
|
7435
7564
|
const cjsPath = this.getEmptyCjsModulePath();
|
|
7436
7565
|
return cjsPath.replace(/\.cjs$/, ".js");
|
|
7437
7566
|
}
|
|
7567
|
+
/**
|
|
7568
|
+
* Get absolute path to empty flag component module.
|
|
7569
|
+
* Returns `export default () => null;` — used by flag filtering plugins
|
|
7570
|
+
* to replace unused flag files at build time.
|
|
7571
|
+
*/
|
|
7572
|
+
getEmptyFlagModulePath() {
|
|
7573
|
+
const __dirname2 = dirname2(fileURLToPath(import.meta.url));
|
|
7574
|
+
return this.normalizePath(resolve(__dirname2, "emptyFlag.js"));
|
|
7575
|
+
}
|
|
7438
7576
|
/**
|
|
7439
7577
|
* Get absolute path to empty CJS module for esbuild pre-bundling.
|
|
7440
7578
|
* CJS because esbuild statically analyzes ESM exports — CJS has dynamic
|
|
@@ -7460,13 +7598,13 @@ var init_PathResolver = __esm({
|
|
|
7460
7598
|
const maxLevels = this.options.maxLevels;
|
|
7461
7599
|
while (levelsChecked < maxLevels) {
|
|
7462
7600
|
const toolingPath = this.normalizePath(
|
|
7463
|
-
|
|
7601
|
+
join2(currentDir, PACKAGE_PATHS.TOOLING)
|
|
7464
7602
|
);
|
|
7465
|
-
const corePath = this.normalizePath(
|
|
7603
|
+
const corePath = this.normalizePath(join2(currentDir, PACKAGE_PATHS.CORE));
|
|
7466
7604
|
if (this.pathExists(toolingPath) && this.pathExists(corePath)) {
|
|
7467
7605
|
return currentDir;
|
|
7468
7606
|
}
|
|
7469
|
-
const appsDir =
|
|
7607
|
+
const appsDir = join2(currentDir, "apps");
|
|
7470
7608
|
if (this.pathExists(appsDir)) {
|
|
7471
7609
|
const appsDirStat = this.statSync(appsDir);
|
|
7472
7610
|
if (appsDirStat?.isDirectory()) {
|
|
@@ -7474,15 +7612,15 @@ var init_PathResolver = __esm({
|
|
|
7474
7612
|
}
|
|
7475
7613
|
}
|
|
7476
7614
|
const packageJsonPath = this.normalizePath(
|
|
7477
|
-
|
|
7615
|
+
join2(currentDir, "package.json")
|
|
7478
7616
|
);
|
|
7479
7617
|
if (this.pathExists(packageJsonPath)) {
|
|
7480
|
-
const parentDir2 = this.normalizePath(
|
|
7618
|
+
const parentDir2 = this.normalizePath(dirname2(currentDir));
|
|
7481
7619
|
if (parentDir2 === currentDir) {
|
|
7482
7620
|
return currentDir;
|
|
7483
7621
|
}
|
|
7484
7622
|
}
|
|
7485
|
-
const parentDir = this.normalizePath(
|
|
7623
|
+
const parentDir = this.normalizePath(dirname2(currentDir));
|
|
7486
7624
|
if (parentDir === currentDir) {
|
|
7487
7625
|
break;
|
|
7488
7626
|
}
|
|
@@ -7498,8 +7636,8 @@ var init_PathResolver = __esm({
|
|
|
7498
7636
|
// packages/tooling/src/utils/pathResolver.ts
|
|
7499
7637
|
import { createRequire as createRequire2 } from "node:module";
|
|
7500
7638
|
import {
|
|
7501
|
-
join as
|
|
7502
|
-
dirname as
|
|
7639
|
+
join as join3,
|
|
7640
|
+
dirname as dirname3,
|
|
7503
7641
|
basename as basename2,
|
|
7504
7642
|
extname as extname2,
|
|
7505
7643
|
relative as relative2,
|
|
@@ -7508,7 +7646,7 @@ import {
|
|
|
7508
7646
|
isAbsolute as pathIsAbsolute
|
|
7509
7647
|
} from "node:path";
|
|
7510
7648
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
7511
|
-
function
|
|
7649
|
+
function readdirSync3(dirPath, options) {
|
|
7512
7650
|
return pathResolverInstance.readdirSync(dirPath, options);
|
|
7513
7651
|
}
|
|
7514
7652
|
async function glob(pattern, options = {}) {
|
|
@@ -7546,7 +7684,7 @@ var init_pathResolver = __esm({
|
|
|
7546
7684
|
init_PathResolver();
|
|
7547
7685
|
pathResolverInstance = PathResolver.getInstance({ debug: false });
|
|
7548
7686
|
normalizePath = (...pathSegments) => {
|
|
7549
|
-
return pathResolverInstance.normalizePath(
|
|
7687
|
+
return pathResolverInstance.normalizePath(join3(...pathSegments));
|
|
7550
7688
|
};
|
|
7551
7689
|
pathExists = (filePath, silent = false) => pathResolverInstance.pathExists(filePath, silent);
|
|
7552
7690
|
removeSync = (path) => pathResolverInstance.removeSync(path);
|
|
@@ -7561,10 +7699,10 @@ var init_pathResolver = __esm({
|
|
|
7561
7699
|
});
|
|
7562
7700
|
|
|
7563
7701
|
// packages/tooling/src/bundler/utils.ts
|
|
7564
|
-
import { Buffer } from "node:buffer";
|
|
7702
|
+
import { Buffer as Buffer2 } from "node:buffer";
|
|
7565
7703
|
import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
7566
7704
|
import { createRequire as createRequire3 } from "node:module";
|
|
7567
|
-
import { dirname as
|
|
7705
|
+
import { dirname as dirname4, resolve as resolve3 } from "node:path";
|
|
7568
7706
|
import process from "node:process";
|
|
7569
7707
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
7570
7708
|
var require2, __filename, __dirname;
|
|
@@ -7573,12 +7711,12 @@ var init_utils2 = __esm({
|
|
|
7573
7711
|
"use strict";
|
|
7574
7712
|
require2 = createRequire3(import.meta.url);
|
|
7575
7713
|
__filename = fileURLToPath3(import.meta.url);
|
|
7576
|
-
__dirname =
|
|
7714
|
+
__dirname = dirname4(__filename);
|
|
7577
7715
|
if (typeof globalThis !== "undefined") {
|
|
7578
7716
|
globalThis.require = require2;
|
|
7579
7717
|
globalThis.__filename = __filename;
|
|
7580
7718
|
globalThis.__dirname = __dirname;
|
|
7581
|
-
globalThis.Buffer =
|
|
7719
|
+
globalThis.Buffer = Buffer2;
|
|
7582
7720
|
globalThis.process = process;
|
|
7583
7721
|
if (typeof global === "undefined") {
|
|
7584
7722
|
globalThis.global = globalThis;
|
|
@@ -7610,17 +7748,17 @@ async function findCacheItems(targetDir, verbose) {
|
|
|
7610
7748
|
if (!matches.has(absolutePath)) {
|
|
7611
7749
|
matches.add(absolutePath);
|
|
7612
7750
|
if (verbose) {
|
|
7613
|
-
|
|
7751
|
+
log2.info(` \u2713 Found: ${relativePath}`);
|
|
7614
7752
|
}
|
|
7615
7753
|
}
|
|
7616
7754
|
} else {
|
|
7617
7755
|
if (verbose) {
|
|
7618
|
-
|
|
7756
|
+
log2.debug(` \u25CB Not found: ${relativePath}`);
|
|
7619
7757
|
}
|
|
7620
7758
|
}
|
|
7621
7759
|
}
|
|
7622
7760
|
if (verbose) {
|
|
7623
|
-
|
|
7761
|
+
log2.info(`Checking from: ${targetDir}`);
|
|
7624
7762
|
}
|
|
7625
7763
|
check(joinPath(targetDir, ".vite"));
|
|
7626
7764
|
check(joinPath(targetDir, ".next"));
|
|
@@ -7643,13 +7781,13 @@ async function findCacheItems(targetDir, verbose) {
|
|
|
7643
7781
|
matches.add(file);
|
|
7644
7782
|
if (verbose) {
|
|
7645
7783
|
const relativePath = getRelativePathBetween(targetDir, file) || file;
|
|
7646
|
-
|
|
7784
|
+
log2.info(` \u2713 Found: ${relativePath}`);
|
|
7647
7785
|
}
|
|
7648
7786
|
}
|
|
7649
7787
|
}
|
|
7650
7788
|
const appsDir = joinPath(targetDir, "apps");
|
|
7651
7789
|
try {
|
|
7652
|
-
const apps =
|
|
7790
|
+
const apps = readdirSync3(appsDir).sort();
|
|
7653
7791
|
for (const app of apps) {
|
|
7654
7792
|
const appPath = joinPath(appsDir, app);
|
|
7655
7793
|
check(joinPath(appPath, ".vite"));
|
|
@@ -7676,7 +7814,7 @@ async function findCacheItems(targetDir, verbose) {
|
|
|
7676
7814
|
}
|
|
7677
7815
|
const packagesDir = joinPath(targetDir, "packages");
|
|
7678
7816
|
try {
|
|
7679
|
-
const packages =
|
|
7817
|
+
const packages = readdirSync3(packagesDir);
|
|
7680
7818
|
for (const pkg of packages) {
|
|
7681
7819
|
const pkgPath = joinPath(packagesDir, pkg);
|
|
7682
7820
|
check(joinPath(pkgPath, ".vite"));
|
|
@@ -7685,7 +7823,7 @@ async function findCacheItems(targetDir, verbose) {
|
|
|
7685
7823
|
check(joinPath(pkgPath, "tsconfig.tsbuildinfo"));
|
|
7686
7824
|
check(joinPath(pkgPath, "tsconfig.build.tsbuildinfo"));
|
|
7687
7825
|
try {
|
|
7688
|
-
const nestedPackages =
|
|
7826
|
+
const nestedPackages = readdirSync3(pkgPath);
|
|
7689
7827
|
for (const nestedPkg of nestedPackages) {
|
|
7690
7828
|
const nestedPkgPath = joinPath(pkgPath, nestedPkg);
|
|
7691
7829
|
try {
|
|
@@ -7713,21 +7851,21 @@ function removeItem(path, rootDir, dryRun, verbose) {
|
|
|
7713
7851
|
if (verbose) {
|
|
7714
7852
|
const relativePath2 = getRelativePathBetween(rootDir, path);
|
|
7715
7853
|
const displayPath2 = relativePath2 || path;
|
|
7716
|
-
|
|
7854
|
+
log2.debug(` \u25CB Skipped (not found): ${displayPath2}`);
|
|
7717
7855
|
}
|
|
7718
7856
|
return false;
|
|
7719
7857
|
}
|
|
7720
7858
|
const relativePath = getRelativePathBetween(rootDir, path);
|
|
7721
7859
|
const displayPath = relativePath || path;
|
|
7722
7860
|
if (dryRun) {
|
|
7723
|
-
|
|
7861
|
+
log2.info(`[DRY RUN] Would remove: ${displayPath}`);
|
|
7724
7862
|
return true;
|
|
7725
7863
|
}
|
|
7726
7864
|
removeSync(path);
|
|
7727
|
-
|
|
7865
|
+
log2.success(`Removed: ${displayPath}`);
|
|
7728
7866
|
return true;
|
|
7729
7867
|
} catch (err) {
|
|
7730
|
-
|
|
7868
|
+
log2.error(
|
|
7731
7869
|
`Failed to remove ${path}:`,
|
|
7732
7870
|
DoNotDevError.from(
|
|
7733
7871
|
err,
|
|
@@ -7742,29 +7880,29 @@ async function main(options) {
|
|
|
7742
7880
|
const opts = options;
|
|
7743
7881
|
const targetDir = opts.app ? joinPath(process.cwd(), "apps", opts.app) : process.cwd();
|
|
7744
7882
|
if (opts.app && !pathExists(targetDir)) {
|
|
7745
|
-
|
|
7883
|
+
log2.error(`App directory not found: ${targetDir}`);
|
|
7746
7884
|
throw new DoNotDevError(
|
|
7747
7885
|
`App directory not found: ${targetDir}`,
|
|
7748
7886
|
"file-not-found"
|
|
7749
7887
|
);
|
|
7750
7888
|
}
|
|
7751
7889
|
const verbose = opts.verbose ?? opts.debug ?? false;
|
|
7752
|
-
|
|
7890
|
+
log2.info(
|
|
7753
7891
|
opts.app ? `Cacheout - Clearing build caches for app: ${opts.app}...` : "Cacheout - Clearing build caches..."
|
|
7754
7892
|
);
|
|
7755
7893
|
if (opts.dryRun) {
|
|
7756
|
-
|
|
7894
|
+
log2.info("DRY RUN MODE - No files will be removed");
|
|
7757
7895
|
}
|
|
7758
7896
|
if (verbose) {
|
|
7759
|
-
|
|
7897
|
+
log2.info("Finding cache items...");
|
|
7760
7898
|
}
|
|
7761
7899
|
const cacheItems = await findCacheItems(targetDir, verbose);
|
|
7762
7900
|
if (cacheItems.length === 0) {
|
|
7763
|
-
|
|
7901
|
+
log2.success("No cache items found to remove.");
|
|
7764
7902
|
return 0;
|
|
7765
7903
|
}
|
|
7766
7904
|
if (verbose) {
|
|
7767
|
-
|
|
7905
|
+
log2.info(
|
|
7768
7906
|
`Found ${cacheItems.length} cache item${cacheItems.length === 1 ? "" : "s"} to remove`
|
|
7769
7907
|
);
|
|
7770
7908
|
}
|
|
@@ -7775,13 +7913,13 @@ async function main(options) {
|
|
|
7775
7913
|
}
|
|
7776
7914
|
}
|
|
7777
7915
|
if (opts.dryRun) {
|
|
7778
|
-
|
|
7779
|
-
|
|
7916
|
+
log2.info(`DRY RUN: Would remove ${removed} cache items.`);
|
|
7917
|
+
log2.info("Run without --dry-run to actually remove them");
|
|
7780
7918
|
} else if (removed > 0) {
|
|
7781
|
-
|
|
7782
|
-
|
|
7919
|
+
log2.success(`Cacheout complete! Removed ${removed} cache items.`);
|
|
7920
|
+
log2.info("You can now restart your dev server with your usual command");
|
|
7783
7921
|
} else {
|
|
7784
|
-
|
|
7922
|
+
log2.success("No cache items were removed.");
|
|
7785
7923
|
}
|
|
7786
7924
|
return 0;
|
|
7787
7925
|
}
|