@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
package/dist/bin/commands/wai.js
CHANGED
|
@@ -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
|
|
|
@@ -583,9 +666,9 @@ var require_is_glob = __commonJS({
|
|
|
583
666
|
index += 2;
|
|
584
667
|
var close = chars[open];
|
|
585
668
|
if (close) {
|
|
586
|
-
var
|
|
587
|
-
if (
|
|
588
|
-
index =
|
|
669
|
+
var n2 = str.indexOf(close, index);
|
|
670
|
+
if (n2 !== -1) {
|
|
671
|
+
index = n2 + 1;
|
|
589
672
|
}
|
|
590
673
|
}
|
|
591
674
|
if (str[index] === "!") {
|
|
@@ -611,9 +694,9 @@ var require_is_glob = __commonJS({
|
|
|
611
694
|
index += 2;
|
|
612
695
|
var close = chars[open];
|
|
613
696
|
if (close) {
|
|
614
|
-
var
|
|
615
|
-
if (
|
|
616
|
-
index =
|
|
697
|
+
var n2 = str.indexOf(close, index);
|
|
698
|
+
if (n2 !== -1) {
|
|
699
|
+
index = n2 + 1;
|
|
617
700
|
}
|
|
618
701
|
}
|
|
619
702
|
if (str[index] === "!") {
|
|
@@ -691,8 +774,8 @@ var require_utils = __commonJS({
|
|
|
691
774
|
if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
|
|
692
775
|
return (Number(max) - Number(min)) / Number(step) >= limit;
|
|
693
776
|
};
|
|
694
|
-
exports.escapeNode = (
|
|
695
|
-
const node =
|
|
777
|
+
exports.escapeNode = (block2, n2 = 0, type) => {
|
|
778
|
+
const node = block2.nodes[n2];
|
|
696
779
|
if (!node) return;
|
|
697
780
|
if (type && node.type === type || node.type === "open" || node.type === "close") {
|
|
698
781
|
if (node.escaped !== true) {
|
|
@@ -709,15 +792,15 @@ var require_utils = __commonJS({
|
|
|
709
792
|
}
|
|
710
793
|
return false;
|
|
711
794
|
};
|
|
712
|
-
exports.isInvalidBrace = (
|
|
713
|
-
if (
|
|
714
|
-
if (
|
|
715
|
-
if (
|
|
716
|
-
|
|
795
|
+
exports.isInvalidBrace = (block2) => {
|
|
796
|
+
if (block2.type !== "brace") return false;
|
|
797
|
+
if (block2.invalid === true || block2.dollar) return true;
|
|
798
|
+
if (block2.commas >> 0 + block2.ranges >> 0 === 0) {
|
|
799
|
+
block2.invalid = true;
|
|
717
800
|
return true;
|
|
718
801
|
}
|
|
719
|
-
if (
|
|
720
|
-
|
|
802
|
+
if (block2.open !== true || block2.close !== true) {
|
|
803
|
+
block2.invalid = true;
|
|
721
804
|
return true;
|
|
722
805
|
}
|
|
723
806
|
return false;
|
|
@@ -736,8 +819,8 @@ var require_utils = __commonJS({
|
|
|
736
819
|
exports.flatten = (...args) => {
|
|
737
820
|
const result = [];
|
|
738
821
|
const flat = (arr) => {
|
|
739
|
-
for (let
|
|
740
|
-
const ele = arr[
|
|
822
|
+
for (let i2 = 0; i2 < arr.length; i2++) {
|
|
823
|
+
const ele = arr[i2];
|
|
741
824
|
if (Array.isArray(ele)) {
|
|
742
825
|
flat(ele);
|
|
743
826
|
continue;
|
|
@@ -831,9 +914,9 @@ var require_to_regex_range = __commonJS({
|
|
|
831
914
|
if (toRegexRange.cache.hasOwnProperty(cacheKey)) {
|
|
832
915
|
return toRegexRange.cache[cacheKey].result;
|
|
833
916
|
}
|
|
834
|
-
let
|
|
917
|
+
let a2 = Math.min(min, max);
|
|
835
918
|
let b = Math.max(min, max);
|
|
836
|
-
if (Math.abs(
|
|
919
|
+
if (Math.abs(a2 - b) === 1) {
|
|
837
920
|
let result = min + "|" + max;
|
|
838
921
|
if (opts.capture) {
|
|
839
922
|
return `(${result})`;
|
|
@@ -844,20 +927,20 @@ var require_to_regex_range = __commonJS({
|
|
|
844
927
|
return `(?:${result})`;
|
|
845
928
|
}
|
|
846
929
|
let isPadded = hasPadding(min) || hasPadding(max);
|
|
847
|
-
let state = { min, max, a, b };
|
|
930
|
+
let state = { min, max, a: a2, b };
|
|
848
931
|
let positives = [];
|
|
849
932
|
let negatives = [];
|
|
850
933
|
if (isPadded) {
|
|
851
934
|
state.isPadded = isPadded;
|
|
852
935
|
state.maxLen = String(state.max).length;
|
|
853
936
|
}
|
|
854
|
-
if (
|
|
937
|
+
if (a2 < 0) {
|
|
855
938
|
let newMin = b < 0 ? Math.abs(b) : 1;
|
|
856
|
-
negatives = splitToPatterns(newMin, Math.abs(
|
|
857
|
-
|
|
939
|
+
negatives = splitToPatterns(newMin, Math.abs(a2), state, opts);
|
|
940
|
+
a2 = state.a = 0;
|
|
858
941
|
}
|
|
859
942
|
if (b >= 0) {
|
|
860
|
-
positives = splitToPatterns(
|
|
943
|
+
positives = splitToPatterns(a2, b, state, opts);
|
|
861
944
|
}
|
|
862
945
|
state.negatives = negatives;
|
|
863
946
|
state.positives = positives;
|
|
@@ -905,8 +988,8 @@ var require_to_regex_range = __commonJS({
|
|
|
905
988
|
let digits = zipped.length;
|
|
906
989
|
let pattern = "";
|
|
907
990
|
let count = 0;
|
|
908
|
-
for (let
|
|
909
|
-
let [startDigit, stopDigit] = zipped[
|
|
991
|
+
for (let i2 = 0; i2 < digits; i2++) {
|
|
992
|
+
let [startDigit, stopDigit] = zipped[i2];
|
|
910
993
|
if (startDigit === stopDigit) {
|
|
911
994
|
pattern += startDigit;
|
|
912
995
|
} else if (startDigit !== "0" || stopDigit !== "9") {
|
|
@@ -925,8 +1008,8 @@ var require_to_regex_range = __commonJS({
|
|
|
925
1008
|
let tokens = [];
|
|
926
1009
|
let start = min;
|
|
927
1010
|
let prev;
|
|
928
|
-
for (let
|
|
929
|
-
let max2 = ranges[
|
|
1011
|
+
for (let i2 = 0; i2 < ranges.length; i2++) {
|
|
1012
|
+
let max2 = ranges[i2];
|
|
930
1013
|
let obj = rangeToPattern(String(start), String(max2), options);
|
|
931
1014
|
let zeros = "";
|
|
932
1015
|
if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
|
|
@@ -961,13 +1044,13 @@ var require_to_regex_range = __commonJS({
|
|
|
961
1044
|
}
|
|
962
1045
|
return result;
|
|
963
1046
|
}
|
|
964
|
-
function zip(
|
|
1047
|
+
function zip(a2, b) {
|
|
965
1048
|
let arr = [];
|
|
966
|
-
for (let
|
|
1049
|
+
for (let i2 = 0; i2 < a2.length; i2++) arr.push([a2[i2], b[i2]]);
|
|
967
1050
|
return arr;
|
|
968
1051
|
}
|
|
969
|
-
function compare(
|
|
970
|
-
return
|
|
1052
|
+
function compare(a2, b) {
|
|
1053
|
+
return a2 > b ? 1 : b > a2 ? -1 : 0;
|
|
971
1054
|
}
|
|
972
1055
|
function contains(arr, key, val) {
|
|
973
1056
|
return arr.some((ele) => ele[key] === val);
|
|
@@ -985,8 +1068,8 @@ var require_to_regex_range = __commonJS({
|
|
|
985
1068
|
}
|
|
986
1069
|
return "";
|
|
987
1070
|
}
|
|
988
|
-
function toCharacterClass(
|
|
989
|
-
return `[${
|
|
1071
|
+
function toCharacterClass(a2, b, options) {
|
|
1072
|
+
return `[${a2}${b - a2 === 1 ? "" : "-"}${b}]`;
|
|
990
1073
|
}
|
|
991
1074
|
function hasPadding(str) {
|
|
992
1075
|
return /^-?(0+)\d/.test(str);
|
|
@@ -1065,8 +1148,8 @@ var require_fill_range = __commonJS({
|
|
|
1065
1148
|
return negative ? "-" + input : input;
|
|
1066
1149
|
};
|
|
1067
1150
|
var toSequence = (parts, options, maxLen) => {
|
|
1068
|
-
parts.negatives.sort((
|
|
1069
|
-
parts.positives.sort((
|
|
1151
|
+
parts.negatives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
1152
|
+
parts.positives.sort((a2, b) => a2 < b ? -1 : a2 > b ? 1 : 0);
|
|
1070
1153
|
let prefix = options.capture ? "" : "?:";
|
|
1071
1154
|
let positives = "";
|
|
1072
1155
|
let negatives = "";
|
|
@@ -1087,12 +1170,12 @@ var require_fill_range = __commonJS({
|
|
|
1087
1170
|
}
|
|
1088
1171
|
return result;
|
|
1089
1172
|
};
|
|
1090
|
-
var toRange = (
|
|
1173
|
+
var toRange = (a2, b, isNumbers, options) => {
|
|
1091
1174
|
if (isNumbers) {
|
|
1092
|
-
return toRegexRange(
|
|
1175
|
+
return toRegexRange(a2, b, { wrap: false, ...options });
|
|
1093
1176
|
}
|
|
1094
|
-
let start = String.fromCharCode(
|
|
1095
|
-
if (
|
|
1177
|
+
let start = String.fromCharCode(a2);
|
|
1178
|
+
if (a2 === b) return start;
|
|
1096
1179
|
let stop = String.fromCharCode(b);
|
|
1097
1180
|
return `[${start}-${stop}]`;
|
|
1098
1181
|
};
|
|
@@ -1118,15 +1201,15 @@ var require_fill_range = __commonJS({
|
|
|
1118
1201
|
return [];
|
|
1119
1202
|
};
|
|
1120
1203
|
var fillNumbers = (start, end, step = 1, options = {}) => {
|
|
1121
|
-
let
|
|
1204
|
+
let a2 = Number(start);
|
|
1122
1205
|
let b = Number(end);
|
|
1123
|
-
if (!Number.isInteger(
|
|
1206
|
+
if (!Number.isInteger(a2) || !Number.isInteger(b)) {
|
|
1124
1207
|
if (options.strictRanges === true) throw rangeError([start, end]);
|
|
1125
1208
|
return [];
|
|
1126
1209
|
}
|
|
1127
|
-
if (
|
|
1210
|
+
if (a2 === 0) a2 = 0;
|
|
1128
1211
|
if (b === 0) b = 0;
|
|
1129
|
-
let descending =
|
|
1212
|
+
let descending = a2 > b;
|
|
1130
1213
|
let startString = String(start);
|
|
1131
1214
|
let endString = String(end);
|
|
1132
1215
|
let stepString = String(step);
|
|
@@ -1142,13 +1225,13 @@ var require_fill_range = __commonJS({
|
|
|
1142
1225
|
let push = (num) => parts[num < 0 ? "negatives" : "positives"].push(Math.abs(num));
|
|
1143
1226
|
let range = [];
|
|
1144
1227
|
let index = 0;
|
|
1145
|
-
while (descending ?
|
|
1228
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
1146
1229
|
if (options.toRegex === true && step > 1) {
|
|
1147
|
-
push(
|
|
1230
|
+
push(a2);
|
|
1148
1231
|
} else {
|
|
1149
|
-
range.push(pad(format(
|
|
1232
|
+
range.push(pad(format(a2, index), maxLen, toNumber));
|
|
1150
1233
|
}
|
|
1151
|
-
|
|
1234
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
1152
1235
|
index++;
|
|
1153
1236
|
}
|
|
1154
1237
|
if (options.toRegex === true) {
|
|
@@ -1161,19 +1244,19 @@ var require_fill_range = __commonJS({
|
|
|
1161
1244
|
return invalidRange(start, end, options);
|
|
1162
1245
|
}
|
|
1163
1246
|
let format = options.transform || ((val) => String.fromCharCode(val));
|
|
1164
|
-
let
|
|
1247
|
+
let a2 = `${start}`.charCodeAt(0);
|
|
1165
1248
|
let b = `${end}`.charCodeAt(0);
|
|
1166
|
-
let descending =
|
|
1167
|
-
let min = Math.min(
|
|
1168
|
-
let max = Math.max(
|
|
1249
|
+
let descending = a2 > b;
|
|
1250
|
+
let min = Math.min(a2, b);
|
|
1251
|
+
let max = Math.max(a2, b);
|
|
1169
1252
|
if (options.toRegex && step === 1) {
|
|
1170
1253
|
return toRange(min, max, false, options);
|
|
1171
1254
|
}
|
|
1172
1255
|
let range = [];
|
|
1173
1256
|
let index = 0;
|
|
1174
|
-
while (descending ?
|
|
1175
|
-
range.push(format(
|
|
1176
|
-
|
|
1257
|
+
while (descending ? a2 >= b : a2 <= b) {
|
|
1258
|
+
range.push(format(a2, index));
|
|
1259
|
+
a2 = descending ? a2 - step : a2 + step;
|
|
1177
1260
|
index++;
|
|
1178
1261
|
}
|
|
1179
1262
|
if (options.toRegex === true) {
|
|
@@ -1297,17 +1380,17 @@ var require_expand = __commonJS({
|
|
|
1297
1380
|
const walk = (node, parent = {}) => {
|
|
1298
1381
|
node.queue = [];
|
|
1299
1382
|
let p = parent;
|
|
1300
|
-
let
|
|
1383
|
+
let q = parent.queue;
|
|
1301
1384
|
while (p.type !== "brace" && p.type !== "root" && p.parent) {
|
|
1302
1385
|
p = p.parent;
|
|
1303
|
-
|
|
1386
|
+
q = p.queue;
|
|
1304
1387
|
}
|
|
1305
1388
|
if (node.invalid || node.dollar) {
|
|
1306
|
-
|
|
1389
|
+
q.push(append(q.pop(), stringify2(node, options)));
|
|
1307
1390
|
return;
|
|
1308
1391
|
}
|
|
1309
1392
|
if (node.type === "brace" && node.invalid !== true && node.nodes.length === 2) {
|
|
1310
|
-
|
|
1393
|
+
q.push(append(q.pop(), ["{}"]));
|
|
1311
1394
|
return;
|
|
1312
1395
|
}
|
|
1313
1396
|
if (node.nodes && node.ranges > 0) {
|
|
@@ -1319,26 +1402,26 @@ var require_expand = __commonJS({
|
|
|
1319
1402
|
if (range.length === 0) {
|
|
1320
1403
|
range = stringify2(node, options);
|
|
1321
1404
|
}
|
|
1322
|
-
|
|
1405
|
+
q.push(append(q.pop(), range));
|
|
1323
1406
|
node.nodes = [];
|
|
1324
1407
|
return;
|
|
1325
1408
|
}
|
|
1326
1409
|
const enclose = utils.encloseBrace(node);
|
|
1327
1410
|
let queue = node.queue;
|
|
1328
|
-
let
|
|
1329
|
-
while (
|
|
1330
|
-
|
|
1331
|
-
queue =
|
|
1411
|
+
let block2 = node;
|
|
1412
|
+
while (block2.type !== "brace" && block2.type !== "root" && block2.parent) {
|
|
1413
|
+
block2 = block2.parent;
|
|
1414
|
+
queue = block2.queue;
|
|
1332
1415
|
}
|
|
1333
|
-
for (let
|
|
1334
|
-
const child = node.nodes[
|
|
1416
|
+
for (let i2 = 0; i2 < node.nodes.length; i2++) {
|
|
1417
|
+
const child = node.nodes[i2];
|
|
1335
1418
|
if (child.type === "comma" && node.type === "brace") {
|
|
1336
|
-
if (
|
|
1419
|
+
if (i2 === 1) queue.push("");
|
|
1337
1420
|
queue.push("");
|
|
1338
1421
|
continue;
|
|
1339
1422
|
}
|
|
1340
1423
|
if (child.type === "close") {
|
|
1341
|
-
|
|
1424
|
+
q.push(append(q.pop(), queue, enclose));
|
|
1342
1425
|
continue;
|
|
1343
1426
|
}
|
|
1344
1427
|
if (child.value && child.type !== "open") {
|
|
@@ -1505,7 +1588,7 @@ var require_parse = __commonJS({
|
|
|
1505
1588
|
}
|
|
1506
1589
|
const ast = { type: "root", input, nodes: [] };
|
|
1507
1590
|
const stack = [ast];
|
|
1508
|
-
let
|
|
1591
|
+
let block2 = ast;
|
|
1509
1592
|
let prev = ast;
|
|
1510
1593
|
let brackets = 0;
|
|
1511
1594
|
const length = input.length;
|
|
@@ -1521,15 +1604,15 @@ var require_parse = __commonJS({
|
|
|
1521
1604
|
prev.value += node.value;
|
|
1522
1605
|
return;
|
|
1523
1606
|
}
|
|
1524
|
-
|
|
1525
|
-
node.parent =
|
|
1607
|
+
block2.nodes.push(node);
|
|
1608
|
+
node.parent = block2;
|
|
1526
1609
|
node.prev = prev;
|
|
1527
1610
|
prev = node;
|
|
1528
1611
|
return node;
|
|
1529
1612
|
};
|
|
1530
1613
|
push({ type: "bos" });
|
|
1531
1614
|
while (index < length) {
|
|
1532
|
-
|
|
1615
|
+
block2 = stack[stack.length - 1];
|
|
1533
1616
|
value = advance();
|
|
1534
1617
|
if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
|
|
1535
1618
|
continue;
|
|
@@ -1566,19 +1649,19 @@ var require_parse = __commonJS({
|
|
|
1566
1649
|
continue;
|
|
1567
1650
|
}
|
|
1568
1651
|
if (value === CHAR_LEFT_PARENTHESES) {
|
|
1569
|
-
|
|
1570
|
-
stack.push(
|
|
1652
|
+
block2 = push({ type: "paren", nodes: [] });
|
|
1653
|
+
stack.push(block2);
|
|
1571
1654
|
push({ type: "text", value });
|
|
1572
1655
|
continue;
|
|
1573
1656
|
}
|
|
1574
1657
|
if (value === CHAR_RIGHT_PARENTHESES) {
|
|
1575
|
-
if (
|
|
1658
|
+
if (block2.type !== "paren") {
|
|
1576
1659
|
push({ type: "text", value });
|
|
1577
1660
|
continue;
|
|
1578
1661
|
}
|
|
1579
|
-
|
|
1662
|
+
block2 = stack.pop();
|
|
1580
1663
|
push({ type: "text", value });
|
|
1581
|
-
|
|
1664
|
+
block2 = stack[stack.length - 1];
|
|
1582
1665
|
continue;
|
|
1583
1666
|
}
|
|
1584
1667
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
@@ -1603,7 +1686,7 @@ var require_parse = __commonJS({
|
|
|
1603
1686
|
}
|
|
1604
1687
|
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
1605
1688
|
depth++;
|
|
1606
|
-
const dollar = prev.value && prev.value.slice(-1) === "$" ||
|
|
1689
|
+
const dollar = prev.value && prev.value.slice(-1) === "$" || block2.dollar === true;
|
|
1607
1690
|
const brace = {
|
|
1608
1691
|
type: "brace",
|
|
1609
1692
|
open: true,
|
|
@@ -1614,52 +1697,52 @@ var require_parse = __commonJS({
|
|
|
1614
1697
|
ranges: 0,
|
|
1615
1698
|
nodes: []
|
|
1616
1699
|
};
|
|
1617
|
-
|
|
1618
|
-
stack.push(
|
|
1700
|
+
block2 = push(brace);
|
|
1701
|
+
stack.push(block2);
|
|
1619
1702
|
push({ type: "open", value });
|
|
1620
1703
|
continue;
|
|
1621
1704
|
}
|
|
1622
1705
|
if (value === CHAR_RIGHT_CURLY_BRACE) {
|
|
1623
|
-
if (
|
|
1706
|
+
if (block2.type !== "brace") {
|
|
1624
1707
|
push({ type: "text", value });
|
|
1625
1708
|
continue;
|
|
1626
1709
|
}
|
|
1627
1710
|
const type = "close";
|
|
1628
|
-
|
|
1629
|
-
|
|
1711
|
+
block2 = stack.pop();
|
|
1712
|
+
block2.close = true;
|
|
1630
1713
|
push({ type, value });
|
|
1631
1714
|
depth--;
|
|
1632
|
-
|
|
1715
|
+
block2 = stack[stack.length - 1];
|
|
1633
1716
|
continue;
|
|
1634
1717
|
}
|
|
1635
1718
|
if (value === CHAR_COMMA && depth > 0) {
|
|
1636
|
-
if (
|
|
1637
|
-
|
|
1638
|
-
const open =
|
|
1639
|
-
|
|
1719
|
+
if (block2.ranges > 0) {
|
|
1720
|
+
block2.ranges = 0;
|
|
1721
|
+
const open = block2.nodes.shift();
|
|
1722
|
+
block2.nodes = [open, { type: "text", value: stringify2(block2) }];
|
|
1640
1723
|
}
|
|
1641
1724
|
push({ type: "comma", value });
|
|
1642
|
-
|
|
1725
|
+
block2.commas++;
|
|
1643
1726
|
continue;
|
|
1644
1727
|
}
|
|
1645
|
-
if (value === CHAR_DOT && depth > 0 &&
|
|
1646
|
-
const siblings =
|
|
1728
|
+
if (value === CHAR_DOT && depth > 0 && block2.commas === 0) {
|
|
1729
|
+
const siblings = block2.nodes;
|
|
1647
1730
|
if (depth === 0 || siblings.length === 0) {
|
|
1648
1731
|
push({ type: "text", value });
|
|
1649
1732
|
continue;
|
|
1650
1733
|
}
|
|
1651
1734
|
if (prev.type === "dot") {
|
|
1652
|
-
|
|
1735
|
+
block2.range = [];
|
|
1653
1736
|
prev.value += value;
|
|
1654
1737
|
prev.type = "range";
|
|
1655
|
-
if (
|
|
1656
|
-
|
|
1657
|
-
|
|
1738
|
+
if (block2.nodes.length !== 3 && block2.nodes.length !== 5) {
|
|
1739
|
+
block2.invalid = true;
|
|
1740
|
+
block2.ranges = 0;
|
|
1658
1741
|
prev.type = "text";
|
|
1659
1742
|
continue;
|
|
1660
1743
|
}
|
|
1661
|
-
|
|
1662
|
-
|
|
1744
|
+
block2.ranges++;
|
|
1745
|
+
block2.args = [];
|
|
1663
1746
|
continue;
|
|
1664
1747
|
}
|
|
1665
1748
|
if (prev.type === "range") {
|
|
@@ -1667,7 +1750,7 @@ var require_parse = __commonJS({
|
|
|
1667
1750
|
const before = siblings[siblings.length - 1];
|
|
1668
1751
|
before.value += prev.value + value;
|
|
1669
1752
|
prev = before;
|
|
1670
|
-
|
|
1753
|
+
block2.ranges--;
|
|
1671
1754
|
continue;
|
|
1672
1755
|
}
|
|
1673
1756
|
push({ type: "dot", value });
|
|
@@ -1676,9 +1759,9 @@ var require_parse = __commonJS({
|
|
|
1676
1759
|
push({ type: "text", value });
|
|
1677
1760
|
}
|
|
1678
1761
|
do {
|
|
1679
|
-
|
|
1680
|
-
if (
|
|
1681
|
-
|
|
1762
|
+
block2 = stack.pop();
|
|
1763
|
+
if (block2.type !== "root") {
|
|
1764
|
+
block2.nodes.forEach((node) => {
|
|
1682
1765
|
if (!node.nodes) {
|
|
1683
1766
|
if (node.type === "open") node.isOpen = true;
|
|
1684
1767
|
if (node.type === "close") node.isClose = true;
|
|
@@ -1687,8 +1770,8 @@ var require_parse = __commonJS({
|
|
|
1687
1770
|
}
|
|
1688
1771
|
});
|
|
1689
1772
|
const parent = stack[stack.length - 1];
|
|
1690
|
-
const index2 = parent.nodes.indexOf(
|
|
1691
|
-
parent.nodes.splice(index2, 1, ...
|
|
1773
|
+
const index2 = parent.nodes.indexOf(block2);
|
|
1774
|
+
parent.nodes.splice(index2, 1, ...block2.nodes);
|
|
1692
1775
|
}
|
|
1693
1776
|
} while (stack.length > 0);
|
|
1694
1777
|
push({ type: "eos" });
|
|
@@ -2321,9 +2404,9 @@ var require_scan = __commonJS({
|
|
|
2321
2404
|
if (opts.parts === true || opts.tokens === true) {
|
|
2322
2405
|
let prevIndex;
|
|
2323
2406
|
for (let idx = 0; idx < slashes.length; idx++) {
|
|
2324
|
-
const
|
|
2325
|
-
const
|
|
2326
|
-
const value = input.slice(
|
|
2407
|
+
const n2 = prevIndex ? prevIndex + 1 : start;
|
|
2408
|
+
const i2 = slashes[idx];
|
|
2409
|
+
const value = input.slice(n2, i2);
|
|
2327
2410
|
if (opts.tokens) {
|
|
2328
2411
|
if (idx === 0 && start !== 0) {
|
|
2329
2412
|
tokens[idx].isPrefix = true;
|
|
@@ -2337,7 +2420,7 @@ var require_scan = __commonJS({
|
|
|
2337
2420
|
if (idx !== 0 || value !== "") {
|
|
2338
2421
|
parts.push(value);
|
|
2339
2422
|
}
|
|
2340
|
-
prevIndex =
|
|
2423
|
+
prevIndex = i2;
|
|
2341
2424
|
}
|
|
2342
2425
|
if (prevIndex && prevIndex + 1 < input.length) {
|
|
2343
2426
|
const value = input.slice(prevIndex + 1);
|
|
@@ -2466,15 +2549,15 @@ var require_parse2 = __commonJS({
|
|
|
2466
2549
|
};
|
|
2467
2550
|
var hasRepeatedCharPrefixOverlap = (branches) => {
|
|
2468
2551
|
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
2469
|
-
for (let
|
|
2470
|
-
for (let j =
|
|
2471
|
-
const
|
|
2552
|
+
for (let i2 = 0; i2 < values.length; i2++) {
|
|
2553
|
+
for (let j = i2 + 1; j < values.length; j++) {
|
|
2554
|
+
const a2 = values[i2];
|
|
2472
2555
|
const b = values[j];
|
|
2473
|
-
const char =
|
|
2474
|
-
if (!char ||
|
|
2556
|
+
const char = a2[0];
|
|
2557
|
+
if (!char || a2 !== char.repeat(a2.length) || b !== char.repeat(b.length)) {
|
|
2475
2558
|
continue;
|
|
2476
2559
|
}
|
|
2477
|
-
if (
|
|
2560
|
+
if (a2 === b || a2.startsWith(b) || b.startsWith(a2)) {
|
|
2478
2561
|
return true;
|
|
2479
2562
|
}
|
|
2480
2563
|
}
|
|
@@ -2489,8 +2572,8 @@ var require_parse2 = __commonJS({
|
|
|
2489
2572
|
let paren = 0;
|
|
2490
2573
|
let quote = 0;
|
|
2491
2574
|
let escaped = false;
|
|
2492
|
-
for (let
|
|
2493
|
-
const ch = pattern[
|
|
2575
|
+
for (let i2 = 1; i2 < pattern.length; i2++) {
|
|
2576
|
+
const ch = pattern[i2];
|
|
2494
2577
|
if (escaped === true) {
|
|
2495
2578
|
escaped = false;
|
|
2496
2579
|
continue;
|
|
@@ -2524,13 +2607,13 @@ var require_parse2 = __commonJS({
|
|
|
2524
2607
|
if (ch === ")") {
|
|
2525
2608
|
paren--;
|
|
2526
2609
|
if (paren === 0) {
|
|
2527
|
-
if (requireEnd === true &&
|
|
2610
|
+
if (requireEnd === true && i2 !== pattern.length - 1) {
|
|
2528
2611
|
return;
|
|
2529
2612
|
}
|
|
2530
2613
|
return {
|
|
2531
2614
|
type: pattern[0],
|
|
2532
|
-
body: pattern.slice(2,
|
|
2533
|
-
end:
|
|
2615
|
+
body: pattern.slice(2, i2),
|
|
2616
|
+
end: i2
|
|
2534
2617
|
};
|
|
2535
2618
|
}
|
|
2536
2619
|
}
|
|
@@ -2662,7 +2745,7 @@ var require_parse2 = __commonJS({
|
|
|
2662
2745
|
let prev = bos;
|
|
2663
2746
|
let value;
|
|
2664
2747
|
const eos = () => state.index === len - 1;
|
|
2665
|
-
const peek = state.peek = (
|
|
2748
|
+
const peek = state.peek = (n2 = 1) => input[state.index + n2];
|
|
2666
2749
|
const advance = state.advance = () => input[++state.index] || "";
|
|
2667
2750
|
const remaining = () => input.slice(state.index + 1);
|
|
2668
2751
|
const consume = (value2 = "", num = 0) => {
|
|
@@ -2743,10 +2826,10 @@ var require_parse2 = __commonJS({
|
|
|
2743
2826
|
open.type = "text";
|
|
2744
2827
|
open.value = literal;
|
|
2745
2828
|
open.output = safeOutput || utils.escapeRegex(literal);
|
|
2746
|
-
for (let
|
|
2747
|
-
tokens[
|
|
2748
|
-
tokens[
|
|
2749
|
-
delete tokens[
|
|
2829
|
+
for (let i2 = token.tokensIndex + 1; i2 < tokens.length; i2++) {
|
|
2830
|
+
tokens[i2].value = "";
|
|
2831
|
+
tokens[i2].output = "";
|
|
2832
|
+
delete tokens[i2].suffix;
|
|
2750
2833
|
}
|
|
2751
2834
|
state.output = token.output + open.output;
|
|
2752
2835
|
state.backtrack = true;
|
|
@@ -2989,13 +3072,13 @@ var require_parse2 = __commonJS({
|
|
|
2989
3072
|
if (brace.dots === true) {
|
|
2990
3073
|
const arr = tokens.slice();
|
|
2991
3074
|
const range = [];
|
|
2992
|
-
for (let
|
|
3075
|
+
for (let i2 = arr.length - 1; i2 >= 0; i2--) {
|
|
2993
3076
|
tokens.pop();
|
|
2994
|
-
if (arr[
|
|
3077
|
+
if (arr[i2].type === "brace") {
|
|
2995
3078
|
break;
|
|
2996
3079
|
}
|
|
2997
|
-
if (arr[
|
|
2998
|
-
range.unshift(arr[
|
|
3080
|
+
if (arr[i2].type !== "dots") {
|
|
3081
|
+
range.unshift(arr[i2].value);
|
|
2999
3082
|
}
|
|
3000
3083
|
}
|
|
3001
3084
|
output = expandRange(range, opts);
|
|
@@ -3538,8 +3621,8 @@ var require_micromatch = __commonJS({
|
|
|
3538
3621
|
options.onResult(state);
|
|
3539
3622
|
}
|
|
3540
3623
|
};
|
|
3541
|
-
for (let
|
|
3542
|
-
let isMatch = picomatch(String(patterns[
|
|
3624
|
+
for (let i2 = 0; i2 < patterns.length; i2++) {
|
|
3625
|
+
let isMatch = picomatch(String(patterns[i2]), { ...options, onResult }, true);
|
|
3543
3626
|
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
|
|
3544
3627
|
if (negated) negatives++;
|
|
3545
3628
|
for (let item of list) {
|
|
@@ -3787,7 +3870,7 @@ var require_pattern = __commonJS({
|
|
|
3787
3870
|
exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
|
3788
3871
|
function expandBraceExpansion(pattern) {
|
|
3789
3872
|
const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });
|
|
3790
|
-
patterns.sort((
|
|
3873
|
+
patterns.sort((a2, b) => a2.length - b.length);
|
|
3791
3874
|
return patterns.filter((pattern2) => pattern2 !== "");
|
|
3792
3875
|
}
|
|
3793
3876
|
exports.expandBraceExpansion = expandBraceExpansion;
|
|
@@ -3868,8 +3951,8 @@ var require_merge2 = __commonJS({
|
|
|
3868
3951
|
}
|
|
3869
3952
|
const mergedStream = PassThrough(options);
|
|
3870
3953
|
function addStream() {
|
|
3871
|
-
for (let
|
|
3872
|
-
streamsQueue.push(pauseStreams(arguments[
|
|
3954
|
+
for (let i2 = 0, len = arguments.length; i2 < len; i2++) {
|
|
3955
|
+
streamsQueue.push(pauseStreams(arguments[i2], options));
|
|
3873
3956
|
}
|
|
3874
3957
|
mergeStream();
|
|
3875
3958
|
return this;
|
|
@@ -3918,8 +4001,8 @@ var require_merge2 = __commonJS({
|
|
|
3918
4001
|
stream.pipe(mergedStream, { end: false });
|
|
3919
4002
|
stream.resume();
|
|
3920
4003
|
}
|
|
3921
|
-
for (let
|
|
3922
|
-
pipe(streams[
|
|
4004
|
+
for (let i2 = 0; i2 < streams.length; i2++) {
|
|
4005
|
+
pipe(streams[i2]);
|
|
3923
4006
|
}
|
|
3924
4007
|
next();
|
|
3925
4008
|
}
|
|
@@ -3950,8 +4033,8 @@ var require_merge2 = __commonJS({
|
|
|
3950
4033
|
}
|
|
3951
4034
|
streams.pause();
|
|
3952
4035
|
} else {
|
|
3953
|
-
for (let
|
|
3954
|
-
streams[
|
|
4036
|
+
for (let i2 = 0, len = streams.length; i2 < len; i2++) {
|
|
4037
|
+
streams[i2] = pauseStreams(streams[i2], options);
|
|
3955
4038
|
}
|
|
3956
4039
|
}
|
|
3957
4040
|
return streams;
|
|
@@ -4033,13 +4116,13 @@ var require_tasks = __commonJS({
|
|
|
4033
4116
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4034
4117
|
exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
|
|
4035
4118
|
var utils = require_utils3();
|
|
4036
|
-
function generate(input,
|
|
4037
|
-
const patterns = processPatterns(input,
|
|
4038
|
-
const ignore = processPatterns(
|
|
4119
|
+
function generate(input, settings2) {
|
|
4120
|
+
const patterns = processPatterns(input, settings2);
|
|
4121
|
+
const ignore = processPatterns(settings2.ignore, settings2);
|
|
4039
4122
|
const positivePatterns = getPositivePatterns(patterns);
|
|
4040
4123
|
const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
|
|
4041
|
-
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern,
|
|
4042
|
-
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern,
|
|
4124
|
+
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings2));
|
|
4125
|
+
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings2));
|
|
4043
4126
|
const staticTasks = convertPatternsToTasks(
|
|
4044
4127
|
staticPatterns,
|
|
4045
4128
|
negativePatterns,
|
|
@@ -4055,12 +4138,12 @@ var require_tasks = __commonJS({
|
|
|
4055
4138
|
return staticTasks.concat(dynamicTasks);
|
|
4056
4139
|
}
|
|
4057
4140
|
exports.generate = generate;
|
|
4058
|
-
function processPatterns(input,
|
|
4141
|
+
function processPatterns(input, settings2) {
|
|
4059
4142
|
let patterns = input;
|
|
4060
|
-
if (
|
|
4143
|
+
if (settings2.braceExpansion) {
|
|
4061
4144
|
patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);
|
|
4062
4145
|
}
|
|
4063
|
-
if (
|
|
4146
|
+
if (settings2.baseNameMatch) {
|
|
4064
4147
|
patterns = patterns.map((pattern) => pattern.includes("/") ? pattern : `**/${pattern}`);
|
|
4065
4148
|
}
|
|
4066
4149
|
return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));
|
|
@@ -4129,26 +4212,26 @@ var require_async = __commonJS({
|
|
|
4129
4212
|
init_utils2();
|
|
4130
4213
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4131
4214
|
exports.read = void 0;
|
|
4132
|
-
function read(path,
|
|
4133
|
-
|
|
4215
|
+
function read(path, settings2, callback) {
|
|
4216
|
+
settings2.fs.lstat(path, (lstatError, lstat) => {
|
|
4134
4217
|
if (lstatError !== null) {
|
|
4135
4218
|
callFailureCallback(callback, lstatError);
|
|
4136
4219
|
return;
|
|
4137
4220
|
}
|
|
4138
|
-
if (!lstat.isSymbolicLink() || !
|
|
4221
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
4139
4222
|
callSuccessCallback(callback, lstat);
|
|
4140
4223
|
return;
|
|
4141
4224
|
}
|
|
4142
|
-
|
|
4225
|
+
settings2.fs.stat(path, (statError, stat) => {
|
|
4143
4226
|
if (statError !== null) {
|
|
4144
|
-
if (
|
|
4227
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4145
4228
|
callFailureCallback(callback, statError);
|
|
4146
4229
|
return;
|
|
4147
4230
|
}
|
|
4148
4231
|
callSuccessCallback(callback, lstat);
|
|
4149
4232
|
return;
|
|
4150
4233
|
}
|
|
4151
|
-
if (
|
|
4234
|
+
if (settings2.markSymbolicLink) {
|
|
4152
4235
|
stat.isSymbolicLink = () => true;
|
|
4153
4236
|
}
|
|
4154
4237
|
callSuccessCallback(callback, stat);
|
|
@@ -4172,19 +4255,19 @@ var require_sync = __commonJS({
|
|
|
4172
4255
|
init_utils2();
|
|
4173
4256
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4174
4257
|
exports.read = void 0;
|
|
4175
|
-
function read(path,
|
|
4176
|
-
const lstat =
|
|
4177
|
-
if (!lstat.isSymbolicLink() || !
|
|
4258
|
+
function read(path, settings2) {
|
|
4259
|
+
const lstat = settings2.fs.lstatSync(path);
|
|
4260
|
+
if (!lstat.isSymbolicLink() || !settings2.followSymbolicLink) {
|
|
4178
4261
|
return lstat;
|
|
4179
4262
|
}
|
|
4180
4263
|
try {
|
|
4181
|
-
const stat =
|
|
4182
|
-
if (
|
|
4264
|
+
const stat = settings2.fs.statSync(path);
|
|
4265
|
+
if (settings2.markSymbolicLink) {
|
|
4183
4266
|
stat.isSymbolicLink = () => true;
|
|
4184
4267
|
}
|
|
4185
4268
|
return stat;
|
|
4186
4269
|
} catch (error2) {
|
|
4187
|
-
if (!
|
|
4270
|
+
if (!settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4188
4271
|
return lstat;
|
|
4189
4272
|
}
|
|
4190
4273
|
throw error2;
|
|
@@ -4261,8 +4344,8 @@ var require_out = __commonJS({
|
|
|
4261
4344
|
}
|
|
4262
4345
|
exports.stat = stat;
|
|
4263
4346
|
function statSync2(path, optionsOrSettings) {
|
|
4264
|
-
const
|
|
4265
|
-
return sync.read(path,
|
|
4347
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
4348
|
+
return sync.read(path, settings2);
|
|
4266
4349
|
}
|
|
4267
4350
|
exports.statSync = statSync2;
|
|
4268
4351
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -4310,8 +4393,8 @@ var require_run_parallel = __commonJS({
|
|
|
4310
4393
|
if (isSync) queueMicrotask2(end);
|
|
4311
4394
|
else end();
|
|
4312
4395
|
}
|
|
4313
|
-
function each(
|
|
4314
|
-
results[
|
|
4396
|
+
function each(i2, err, result) {
|
|
4397
|
+
results[i2] = result;
|
|
4315
4398
|
if (--pending === 0 || err) {
|
|
4316
4399
|
done(err);
|
|
4317
4400
|
}
|
|
@@ -4325,9 +4408,9 @@ var require_run_parallel = __commonJS({
|
|
|
4325
4408
|
});
|
|
4326
4409
|
});
|
|
4327
4410
|
} else {
|
|
4328
|
-
tasks.forEach(function(task,
|
|
4411
|
+
tasks.forEach(function(task, i2) {
|
|
4329
4412
|
task(function(err, result) {
|
|
4330
|
-
each(
|
|
4413
|
+
each(i2, err, result);
|
|
4331
4414
|
});
|
|
4332
4415
|
});
|
|
4333
4416
|
}
|
|
@@ -4402,11 +4485,11 @@ var require_common = __commonJS({
|
|
|
4402
4485
|
init_utils2();
|
|
4403
4486
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4404
4487
|
exports.joinPathSegments = void 0;
|
|
4405
|
-
function joinPathSegments(
|
|
4406
|
-
if (
|
|
4407
|
-
return
|
|
4488
|
+
function joinPathSegments(a2, b, separator) {
|
|
4489
|
+
if (a2.endsWith(separator)) {
|
|
4490
|
+
return a2 + b;
|
|
4408
4491
|
}
|
|
4409
|
-
return
|
|
4492
|
+
return a2 + separator + b;
|
|
4410
4493
|
}
|
|
4411
4494
|
exports.joinPathSegments = joinPathSegments;
|
|
4412
4495
|
}
|
|
@@ -4424,16 +4507,16 @@ var require_async2 = __commonJS({
|
|
|
4424
4507
|
var constants_1 = require_constants3();
|
|
4425
4508
|
var utils = require_utils4();
|
|
4426
4509
|
var common = require_common();
|
|
4427
|
-
function read(directory,
|
|
4428
|
-
if (!
|
|
4429
|
-
readdirWithFileTypes(directory,
|
|
4510
|
+
function read(directory, settings2, callback) {
|
|
4511
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
4512
|
+
readdirWithFileTypes(directory, settings2, callback);
|
|
4430
4513
|
return;
|
|
4431
4514
|
}
|
|
4432
|
-
readdir(directory,
|
|
4515
|
+
readdir(directory, settings2, callback);
|
|
4433
4516
|
}
|
|
4434
4517
|
exports.read = read;
|
|
4435
|
-
function readdirWithFileTypes(directory,
|
|
4436
|
-
|
|
4518
|
+
function readdirWithFileTypes(directory, settings2, callback) {
|
|
4519
|
+
settings2.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
|
|
4437
4520
|
if (readdirError !== null) {
|
|
4438
4521
|
callFailureCallback(callback, readdirError);
|
|
4439
4522
|
return;
|
|
@@ -4441,13 +4524,13 @@ var require_async2 = __commonJS({
|
|
|
4441
4524
|
const entries = dirents.map((dirent) => ({
|
|
4442
4525
|
dirent,
|
|
4443
4526
|
name: dirent.name,
|
|
4444
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
4527
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
4445
4528
|
}));
|
|
4446
|
-
if (!
|
|
4529
|
+
if (!settings2.followSymbolicLinks) {
|
|
4447
4530
|
callSuccessCallback(callback, entries);
|
|
4448
4531
|
return;
|
|
4449
4532
|
}
|
|
4450
|
-
const tasks = entries.map((entry) => makeRplTaskEntry(entry,
|
|
4533
|
+
const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings2));
|
|
4451
4534
|
rpl(tasks, (rplError, rplEntries) => {
|
|
4452
4535
|
if (rplError !== null) {
|
|
4453
4536
|
callFailureCallback(callback, rplError);
|
|
@@ -4458,15 +4541,15 @@ var require_async2 = __commonJS({
|
|
|
4458
4541
|
});
|
|
4459
4542
|
}
|
|
4460
4543
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
4461
|
-
function makeRplTaskEntry(entry,
|
|
4544
|
+
function makeRplTaskEntry(entry, settings2) {
|
|
4462
4545
|
return (done) => {
|
|
4463
4546
|
if (!entry.dirent.isSymbolicLink()) {
|
|
4464
4547
|
done(null, entry);
|
|
4465
4548
|
return;
|
|
4466
4549
|
}
|
|
4467
|
-
|
|
4550
|
+
settings2.fs.stat(entry.path, (statError, stats) => {
|
|
4468
4551
|
if (statError !== null) {
|
|
4469
|
-
if (
|
|
4552
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4470
4553
|
done(statError);
|
|
4471
4554
|
return;
|
|
4472
4555
|
}
|
|
@@ -4478,16 +4561,16 @@ var require_async2 = __commonJS({
|
|
|
4478
4561
|
});
|
|
4479
4562
|
};
|
|
4480
4563
|
}
|
|
4481
|
-
function readdir(directory,
|
|
4482
|
-
|
|
4564
|
+
function readdir(directory, settings2, callback) {
|
|
4565
|
+
settings2.fs.readdir(directory, (readdirError, names) => {
|
|
4483
4566
|
if (readdirError !== null) {
|
|
4484
4567
|
callFailureCallback(callback, readdirError);
|
|
4485
4568
|
return;
|
|
4486
4569
|
}
|
|
4487
4570
|
const tasks = names.map((name) => {
|
|
4488
|
-
const path = common.joinPathSegments(directory, name,
|
|
4571
|
+
const path = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
4489
4572
|
return (done) => {
|
|
4490
|
-
fsStat.stat(path,
|
|
4573
|
+
fsStat.stat(path, settings2.fsStatSettings, (error2, stats) => {
|
|
4491
4574
|
if (error2 !== null) {
|
|
4492
4575
|
done(error2);
|
|
4493
4576
|
return;
|
|
@@ -4497,7 +4580,7 @@ var require_async2 = __commonJS({
|
|
|
4497
4580
|
path,
|
|
4498
4581
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
4499
4582
|
};
|
|
4500
|
-
if (
|
|
4583
|
+
if (settings2.stats) {
|
|
4501
4584
|
entry.stats = stats;
|
|
4502
4585
|
}
|
|
4503
4586
|
done(null, entry);
|
|
@@ -4534,27 +4617,27 @@ var require_sync2 = __commonJS({
|
|
|
4534
4617
|
var constants_1 = require_constants3();
|
|
4535
4618
|
var utils = require_utils4();
|
|
4536
4619
|
var common = require_common();
|
|
4537
|
-
function read(directory,
|
|
4538
|
-
if (!
|
|
4539
|
-
return readdirWithFileTypes(directory,
|
|
4620
|
+
function read(directory, settings2) {
|
|
4621
|
+
if (!settings2.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
4622
|
+
return readdirWithFileTypes(directory, settings2);
|
|
4540
4623
|
}
|
|
4541
|
-
return readdir(directory,
|
|
4624
|
+
return readdir(directory, settings2);
|
|
4542
4625
|
}
|
|
4543
4626
|
exports.read = read;
|
|
4544
|
-
function readdirWithFileTypes(directory,
|
|
4545
|
-
const dirents =
|
|
4627
|
+
function readdirWithFileTypes(directory, settings2) {
|
|
4628
|
+
const dirents = settings2.fs.readdirSync(directory, { withFileTypes: true });
|
|
4546
4629
|
return dirents.map((dirent) => {
|
|
4547
4630
|
const entry = {
|
|
4548
4631
|
dirent,
|
|
4549
4632
|
name: dirent.name,
|
|
4550
|
-
path: common.joinPathSegments(directory, dirent.name,
|
|
4633
|
+
path: common.joinPathSegments(directory, dirent.name, settings2.pathSegmentSeparator)
|
|
4551
4634
|
};
|
|
4552
|
-
if (entry.dirent.isSymbolicLink() &&
|
|
4635
|
+
if (entry.dirent.isSymbolicLink() && settings2.followSymbolicLinks) {
|
|
4553
4636
|
try {
|
|
4554
|
-
const stats =
|
|
4637
|
+
const stats = settings2.fs.statSync(entry.path);
|
|
4555
4638
|
entry.dirent = utils.fs.createDirentFromStats(entry.name, stats);
|
|
4556
4639
|
} catch (error2) {
|
|
4557
|
-
if (
|
|
4640
|
+
if (settings2.throwErrorOnBrokenSymbolicLink) {
|
|
4558
4641
|
throw error2;
|
|
4559
4642
|
}
|
|
4560
4643
|
}
|
|
@@ -4563,17 +4646,17 @@ var require_sync2 = __commonJS({
|
|
|
4563
4646
|
});
|
|
4564
4647
|
}
|
|
4565
4648
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
4566
|
-
function readdir(directory,
|
|
4567
|
-
const names =
|
|
4649
|
+
function readdir(directory, settings2) {
|
|
4650
|
+
const names = settings2.fs.readdirSync(directory);
|
|
4568
4651
|
return names.map((name) => {
|
|
4569
|
-
const entryPath = common.joinPathSegments(directory, name,
|
|
4570
|
-
const stats = fsStat.statSync(entryPath,
|
|
4652
|
+
const entryPath = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
|
|
4653
|
+
const stats = fsStat.statSync(entryPath, settings2.fsStatSettings);
|
|
4571
4654
|
const entry = {
|
|
4572
4655
|
name,
|
|
4573
4656
|
path: entryPath,
|
|
4574
4657
|
dirent: utils.fs.createDirentFromStats(name, stats)
|
|
4575
4658
|
};
|
|
4576
|
-
if (
|
|
4659
|
+
if (settings2.stats) {
|
|
4577
4660
|
entry.stats = stats;
|
|
4578
4661
|
}
|
|
4579
4662
|
return entry;
|
|
@@ -4660,8 +4743,8 @@ var require_out2 = __commonJS({
|
|
|
4660
4743
|
}
|
|
4661
4744
|
exports.scandir = scandir;
|
|
4662
4745
|
function scandirSync(path, optionsOrSettings) {
|
|
4663
|
-
const
|
|
4664
|
-
return sync.read(path,
|
|
4746
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
4747
|
+
return sync.read(path, settings2);
|
|
4665
4748
|
}
|
|
4666
4749
|
exports.scandirSync = scandirSync;
|
|
4667
4750
|
function getSettings(settingsOrOptions = {}) {
|
|
@@ -4705,9 +4788,9 @@ var require_reusify = __commonJS({
|
|
|
4705
4788
|
}
|
|
4706
4789
|
});
|
|
4707
4790
|
|
|
4708
|
-
// node_modules/.bun/fastq@1.20.
|
|
4791
|
+
// node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js
|
|
4709
4792
|
var require_queue = __commonJS({
|
|
4710
|
-
"node_modules/.bun/fastq@1.20.
|
|
4793
|
+
"node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js"(exports, module) {
|
|
4711
4794
|
"use strict";
|
|
4712
4795
|
init_utils2();
|
|
4713
4796
|
var reusify = require_reusify();
|
|
@@ -4887,11 +4970,12 @@ var require_queue = __commonJS({
|
|
|
4887
4970
|
current.value = null;
|
|
4888
4971
|
current.callback = noop;
|
|
4889
4972
|
current.errorHandler = null;
|
|
4973
|
+
current.next = null;
|
|
4890
4974
|
if (errorHandler2) {
|
|
4891
4975
|
errorHandler2(new Error("abort"), val);
|
|
4892
4976
|
}
|
|
4893
4977
|
callback.call(context2, new Error("abort"));
|
|
4894
|
-
|
|
4978
|
+
cache.release(current);
|
|
4895
4979
|
current = next;
|
|
4896
4980
|
}
|
|
4897
4981
|
self.drain = noop;
|
|
@@ -4997,11 +5081,11 @@ var require_common2 = __commonJS({
|
|
|
4997
5081
|
init_utils2();
|
|
4998
5082
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4999
5083
|
exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0;
|
|
5000
|
-
function isFatalError(
|
|
5001
|
-
if (
|
|
5084
|
+
function isFatalError(settings2, error2) {
|
|
5085
|
+
if (settings2.errorFilter === null) {
|
|
5002
5086
|
return true;
|
|
5003
5087
|
}
|
|
5004
|
-
return !
|
|
5088
|
+
return !settings2.errorFilter(error2);
|
|
5005
5089
|
}
|
|
5006
5090
|
exports.isFatalError = isFatalError;
|
|
5007
5091
|
function isAppliedFilter(filter, value) {
|
|
@@ -5012,14 +5096,14 @@ var require_common2 = __commonJS({
|
|
|
5012
5096
|
return filepath.split(/[/\\]/).join(separator);
|
|
5013
5097
|
}
|
|
5014
5098
|
exports.replacePathSegmentSeparator = replacePathSegmentSeparator;
|
|
5015
|
-
function joinPathSegments(
|
|
5016
|
-
if (
|
|
5099
|
+
function joinPathSegments(a2, b, separator) {
|
|
5100
|
+
if (a2 === "") {
|
|
5017
5101
|
return b;
|
|
5018
5102
|
}
|
|
5019
|
-
if (
|
|
5020
|
-
return
|
|
5103
|
+
if (a2.endsWith(separator)) {
|
|
5104
|
+
return a2 + b;
|
|
5021
5105
|
}
|
|
5022
|
-
return
|
|
5106
|
+
return a2 + separator + b;
|
|
5023
5107
|
}
|
|
5024
5108
|
exports.joinPathSegments = joinPathSegments;
|
|
5025
5109
|
}
|
|
@@ -5366,14 +5450,14 @@ var require_out3 = __commonJS({
|
|
|
5366
5450
|
}
|
|
5367
5451
|
exports.walk = walk;
|
|
5368
5452
|
function walkSync(directory, optionsOrSettings) {
|
|
5369
|
-
const
|
|
5370
|
-
const provider = new sync_1.default(directory,
|
|
5453
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5454
|
+
const provider = new sync_1.default(directory, settings2);
|
|
5371
5455
|
return provider.read();
|
|
5372
5456
|
}
|
|
5373
5457
|
exports.walkSync = walkSync;
|
|
5374
5458
|
function walkStream(directory, optionsOrSettings) {
|
|
5375
|
-
const
|
|
5376
|
-
const provider = new stream_1.default(directory,
|
|
5459
|
+
const settings2 = getSettings(optionsOrSettings);
|
|
5460
|
+
const provider = new stream_1.default(directory, settings2);
|
|
5377
5461
|
return provider.read();
|
|
5378
5462
|
}
|
|
5379
5463
|
exports.walkStream = walkStream;
|
|
@@ -5459,8 +5543,8 @@ var require_stream3 = __commonJS({
|
|
|
5459
5543
|
done();
|
|
5460
5544
|
}).catch(done);
|
|
5461
5545
|
};
|
|
5462
|
-
for (let
|
|
5463
|
-
stream.write(
|
|
5546
|
+
for (let i2 = 0; i2 < filepaths.length; i2++) {
|
|
5547
|
+
stream.write(i2);
|
|
5464
5548
|
}
|
|
5465
5549
|
return stream;
|
|
5466
5550
|
}
|
|
@@ -6121,14 +6205,14 @@ var require_out4 = __commonJS({
|
|
|
6121
6205
|
function generateTasks(source, options) {
|
|
6122
6206
|
assertPatternsInput(source);
|
|
6123
6207
|
const patterns = [].concat(source);
|
|
6124
|
-
const
|
|
6125
|
-
return taskManager.generate(patterns,
|
|
6208
|
+
const settings2 = new settings_1.default(options);
|
|
6209
|
+
return taskManager.generate(patterns, settings2);
|
|
6126
6210
|
}
|
|
6127
6211
|
FastGlob2.generateTasks = generateTasks;
|
|
6128
6212
|
function isDynamicPattern(source, options) {
|
|
6129
6213
|
assertPatternsInput(source);
|
|
6130
|
-
const
|
|
6131
|
-
return utils.pattern.isDynamicPattern(source,
|
|
6214
|
+
const settings2 = new settings_1.default(options);
|
|
6215
|
+
return utils.pattern.isDynamicPattern(source, settings2);
|
|
6132
6216
|
}
|
|
6133
6217
|
FastGlob2.isDynamicPattern = isDynamicPattern;
|
|
6134
6218
|
function escapePath(source) {
|
|
@@ -6170,9 +6254,9 @@ var require_out4 = __commonJS({
|
|
|
6170
6254
|
})(FastGlob || (FastGlob = {}));
|
|
6171
6255
|
function getWorks(source, _Provider, options) {
|
|
6172
6256
|
const patterns = [].concat(source);
|
|
6173
|
-
const
|
|
6174
|
-
const tasks = taskManager.generate(patterns,
|
|
6175
|
-
const provider = new _Provider(
|
|
6257
|
+
const settings2 = new settings_1.default(options);
|
|
6258
|
+
const tasks = taskManager.generate(patterns, settings2);
|
|
6259
|
+
const provider = new _Provider(settings2);
|
|
6176
6260
|
return tasks.map(provider.read, provider);
|
|
6177
6261
|
}
|
|
6178
6262
|
function assertPatternsInput(input) {
|
|
@@ -6350,14 +6434,14 @@ import "node:fs";
|
|
|
6350
6434
|
import { createRequire } from "node:module";
|
|
6351
6435
|
import {
|
|
6352
6436
|
resolve,
|
|
6353
|
-
join,
|
|
6354
|
-
dirname,
|
|
6437
|
+
join as join2,
|
|
6438
|
+
dirname as dirname2,
|
|
6355
6439
|
relative,
|
|
6356
6440
|
normalize,
|
|
6357
6441
|
sep,
|
|
6358
6442
|
extname
|
|
6359
6443
|
} from "node:path";
|
|
6360
|
-
import "node:url";
|
|
6444
|
+
import { fileURLToPath } from "node:url";
|
|
6361
6445
|
function safeExecuteAsync(fn, message) {
|
|
6362
6446
|
return fn().catch((error2) => {
|
|
6363
6447
|
throw new Error(
|
|
@@ -6365,7 +6449,7 @@ function safeExecuteAsync(fn, message) {
|
|
|
6365
6449
|
);
|
|
6366
6450
|
});
|
|
6367
6451
|
}
|
|
6368
|
-
var import_fast_glob, constants,
|
|
6452
|
+
var import_fast_glob, constants, log3, PACKAGE_PATHS, PathResolver;
|
|
6369
6453
|
var init_PathResolver = __esm({
|
|
6370
6454
|
"packages/core/config/utils/PathResolver.ts"() {
|
|
6371
6455
|
"use strict";
|
|
@@ -6378,7 +6462,7 @@ var init_PathResolver = __esm({
|
|
|
6378
6462
|
getPatternsFor: getPatternsFor || void 0,
|
|
6379
6463
|
I18N_PATHS: I18N_PATHS || void 0
|
|
6380
6464
|
};
|
|
6381
|
-
|
|
6465
|
+
log3 = {
|
|
6382
6466
|
error: (message, error2) => {
|
|
6383
6467
|
},
|
|
6384
6468
|
warn: (message, error2) => {
|
|
@@ -6414,6 +6498,7 @@ var init_PathResolver = __esm({
|
|
|
6414
6498
|
options;
|
|
6415
6499
|
_repoRoot;
|
|
6416
6500
|
_appRoot = null;
|
|
6501
|
+
_writtenPaths = null;
|
|
6417
6502
|
/**
|
|
6418
6503
|
* Get or create singleton instance
|
|
6419
6504
|
* @param options - Configuration options
|
|
@@ -6499,7 +6584,7 @@ var init_PathResolver = __esm({
|
|
|
6499
6584
|
*/
|
|
6500
6585
|
getDirname(path) {
|
|
6501
6586
|
if (!path) return "";
|
|
6502
|
-
return this.normalizePath(
|
|
6587
|
+
return this.normalizePath(dirname2(path));
|
|
6503
6588
|
}
|
|
6504
6589
|
/**
|
|
6505
6590
|
* Resolve package path using Node's module resolution
|
|
@@ -6511,7 +6596,7 @@ var init_PathResolver = __esm({
|
|
|
6511
6596
|
resolvePackage(packageSpecifier, fromPath = null) {
|
|
6512
6597
|
try {
|
|
6513
6598
|
const basePath = fromPath || this.getAppRoot();
|
|
6514
|
-
const require3 = createRequire(
|
|
6599
|
+
const require3 = createRequire(join2(basePath, "package.json"));
|
|
6515
6600
|
const resolved = require3.resolve(packageSpecifier);
|
|
6516
6601
|
return this.normalizePath(resolved);
|
|
6517
6602
|
} catch (error2) {
|
|
@@ -6663,7 +6748,7 @@ var init_PathResolver = __esm({
|
|
|
6663
6748
|
return cleanContent;
|
|
6664
6749
|
} catch (error2) {
|
|
6665
6750
|
if (this.options.debug) {
|
|
6666
|
-
|
|
6751
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
6667
6752
|
}
|
|
6668
6753
|
return null;
|
|
6669
6754
|
}
|
|
@@ -6691,7 +6776,7 @@ var init_PathResolver = __esm({
|
|
|
6691
6776
|
return cleanContent;
|
|
6692
6777
|
} catch (error2) {
|
|
6693
6778
|
if (this.options.debug) {
|
|
6694
|
-
|
|
6779
|
+
log3.warn(`Failed to read file: ${filePath}`, error2);
|
|
6695
6780
|
}
|
|
6696
6781
|
return null;
|
|
6697
6782
|
}
|
|
@@ -6713,16 +6798,16 @@ var init_PathResolver = __esm({
|
|
|
6713
6798
|
verbose = false
|
|
6714
6799
|
} = options;
|
|
6715
6800
|
const normalizedPath = this.normalizePath(filePath);
|
|
6716
|
-
const dir = this.normalizePath(
|
|
6801
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
6717
6802
|
const fileExists = this.pathExists(normalizedPath);
|
|
6718
6803
|
if (fileExists && !overwrite) {
|
|
6719
6804
|
if (verbose) {
|
|
6720
|
-
|
|
6805
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
6721
6806
|
}
|
|
6722
6807
|
return false;
|
|
6723
6808
|
}
|
|
6724
6809
|
if (dryRun) {
|
|
6725
|
-
|
|
6810
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
6726
6811
|
return true;
|
|
6727
6812
|
}
|
|
6728
6813
|
try {
|
|
@@ -6732,22 +6817,23 @@ var init_PathResolver = __esm({
|
|
|
6732
6817
|
}
|
|
6733
6818
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
6734
6819
|
let writeContent;
|
|
6735
|
-
if (
|
|
6820
|
+
if (Buffer2.isBuffer(content)) {
|
|
6736
6821
|
writeContent = content;
|
|
6737
6822
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
6738
|
-
writeContent = JSON.stringify(content, null, 2)
|
|
6823
|
+
writeContent = `${JSON.stringify(content, null, 2)}
|
|
6824
|
+
`;
|
|
6739
6825
|
} else {
|
|
6740
6826
|
writeContent = String(content);
|
|
6741
6827
|
}
|
|
6742
6828
|
try {
|
|
6743
6829
|
return await safeExecuteAsync(async () => {
|
|
6744
|
-
if (
|
|
6830
|
+
if (Buffer2.isBuffer(writeContent)) {
|
|
6745
6831
|
await fs.promises.writeFile(normalizedPath, writeContent);
|
|
6746
6832
|
} else {
|
|
6747
6833
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
6748
6834
|
}
|
|
6749
6835
|
if (verbose) {
|
|
6750
|
-
|
|
6836
|
+
log3.info(
|
|
6751
6837
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
6752
6838
|
);
|
|
6753
6839
|
}
|
|
@@ -6774,16 +6860,16 @@ var init_PathResolver = __esm({
|
|
|
6774
6860
|
verbose = false
|
|
6775
6861
|
} = options;
|
|
6776
6862
|
const normalizedPath = this.normalizePath(filePath);
|
|
6777
|
-
const dir = this.normalizePath(
|
|
6863
|
+
const dir = this.normalizePath(dirname2(normalizedPath));
|
|
6778
6864
|
const fileExists = this.pathExists(normalizedPath);
|
|
6779
6865
|
if (fileExists && !overwrite) {
|
|
6780
6866
|
if (verbose) {
|
|
6781
|
-
|
|
6867
|
+
log3.info(`Skipping existing file: ${normalizedPath}`);
|
|
6782
6868
|
}
|
|
6783
6869
|
return false;
|
|
6784
6870
|
}
|
|
6785
6871
|
if (dryRun) {
|
|
6786
|
-
|
|
6872
|
+
log3.info(`[DRY RUN] Would write file: ${normalizedPath}`);
|
|
6787
6873
|
return true;
|
|
6788
6874
|
}
|
|
6789
6875
|
try {
|
|
@@ -6793,21 +6879,23 @@ var init_PathResolver = __esm({
|
|
|
6793
6879
|
}
|
|
6794
6880
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
6795
6881
|
let writeContent;
|
|
6796
|
-
if (
|
|
6882
|
+
if (Buffer2.isBuffer(content)) {
|
|
6797
6883
|
writeContent = content;
|
|
6798
6884
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
6799
|
-
writeContent = JSON.stringify(content, null, 2)
|
|
6885
|
+
writeContent = `${JSON.stringify(content, null, 2)}
|
|
6886
|
+
`;
|
|
6800
6887
|
} else {
|
|
6801
6888
|
writeContent = String(content);
|
|
6802
6889
|
}
|
|
6803
6890
|
try {
|
|
6804
|
-
if (
|
|
6891
|
+
if (Buffer2.isBuffer(writeContent)) {
|
|
6805
6892
|
fs.writeFileSync(normalizedPath, writeContent);
|
|
6806
6893
|
} else {
|
|
6807
6894
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
6808
6895
|
}
|
|
6896
|
+
this._writtenPaths?.add(normalizedPath);
|
|
6809
6897
|
if (verbose) {
|
|
6810
|
-
|
|
6898
|
+
log3.info(
|
|
6811
6899
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
6812
6900
|
);
|
|
6813
6901
|
}
|
|
@@ -6832,15 +6920,15 @@ var init_PathResolver = __esm({
|
|
|
6832
6920
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
6833
6921
|
if (fileExists && !overwrite) {
|
|
6834
6922
|
if (verbose) {
|
|
6835
|
-
|
|
6923
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
6836
6924
|
}
|
|
6837
6925
|
return false;
|
|
6838
6926
|
}
|
|
6839
6927
|
if (dryRun) {
|
|
6840
|
-
|
|
6928
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
6841
6929
|
return true;
|
|
6842
6930
|
}
|
|
6843
|
-
const dir = this.normalizePath(
|
|
6931
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
6844
6932
|
try {
|
|
6845
6933
|
await fs.promises.mkdir(dir, { recursive: true });
|
|
6846
6934
|
} catch (error2) {
|
|
@@ -6850,7 +6938,7 @@ var init_PathResolver = __esm({
|
|
|
6850
6938
|
return await safeExecuteAsync(async () => {
|
|
6851
6939
|
await fs.promises.copyFile(srcPath, normalizedDestPath);
|
|
6852
6940
|
if (verbose) {
|
|
6853
|
-
|
|
6941
|
+
log3.info(
|
|
6854
6942
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
6855
6943
|
);
|
|
6856
6944
|
}
|
|
@@ -6874,15 +6962,15 @@ var init_PathResolver = __esm({
|
|
|
6874
6962
|
const fileExists = this.pathExists(normalizedDestPath);
|
|
6875
6963
|
if (fileExists && !overwrite) {
|
|
6876
6964
|
if (verbose) {
|
|
6877
|
-
|
|
6965
|
+
log3.info(`Skipping existing file: ${normalizedDestPath}`);
|
|
6878
6966
|
}
|
|
6879
6967
|
return false;
|
|
6880
6968
|
}
|
|
6881
6969
|
if (dryRun) {
|
|
6882
|
-
|
|
6970
|
+
log3.info(`[DRY RUN] Would copy file: ${normalizedDestPath}`);
|
|
6883
6971
|
return true;
|
|
6884
6972
|
}
|
|
6885
|
-
const dir = this.normalizePath(
|
|
6973
|
+
const dir = this.normalizePath(dirname2(normalizedDestPath));
|
|
6886
6974
|
try {
|
|
6887
6975
|
fs.mkdirSync(dir, { recursive: true });
|
|
6888
6976
|
} catch (error2) {
|
|
@@ -6890,8 +6978,9 @@ var init_PathResolver = __esm({
|
|
|
6890
6978
|
}
|
|
6891
6979
|
try {
|
|
6892
6980
|
fs.copyFileSync(srcPath, normalizedDestPath);
|
|
6981
|
+
this._writtenPaths?.add(normalizedDestPath);
|
|
6893
6982
|
if (verbose) {
|
|
6894
|
-
|
|
6983
|
+
log3.info(
|
|
6895
6984
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
6896
6985
|
);
|
|
6897
6986
|
}
|
|
@@ -6908,7 +6997,7 @@ var init_PathResolver = __esm({
|
|
|
6908
6997
|
return fs.existsSync(filePath);
|
|
6909
6998
|
} catch (error2) {
|
|
6910
6999
|
if (!silent) {
|
|
6911
|
-
|
|
7000
|
+
log3.error(`Error checking path existence: ${filePath}`, error2);
|
|
6912
7001
|
}
|
|
6913
7002
|
return false;
|
|
6914
7003
|
}
|
|
@@ -6934,7 +7023,7 @@ var init_PathResolver = __esm({
|
|
|
6934
7023
|
return fs.readdirSync(dirPath, options);
|
|
6935
7024
|
} catch (error2) {
|
|
6936
7025
|
if (this.options.debug) {
|
|
6937
|
-
|
|
7026
|
+
log3.warn(`Failed to read directory: ${dirPath}`, error2);
|
|
6938
7027
|
}
|
|
6939
7028
|
const isObjectOptions = options && typeof options === "object" && "withFileTypes" in options;
|
|
6940
7029
|
return isObjectOptions && options.withFileTypes ? [] : [];
|
|
@@ -6952,11 +7041,29 @@ var init_PathResolver = __esm({
|
|
|
6952
7041
|
return fs.statSync(filePath);
|
|
6953
7042
|
} catch (error2) {
|
|
6954
7043
|
if (this.options.debug) {
|
|
6955
|
-
|
|
7044
|
+
log3.warn(`Failed to stat file: ${filePath}`, error2);
|
|
6956
7045
|
}
|
|
6957
7046
|
return null;
|
|
6958
7047
|
}
|
|
6959
7048
|
}
|
|
7049
|
+
/**
|
|
7050
|
+
* Resolve the real path of a file, following symlinks
|
|
7051
|
+
* @param filePath - Path to resolve
|
|
7052
|
+
* @returns Resolved real path
|
|
7053
|
+
*/
|
|
7054
|
+
realpathSync(filePath) {
|
|
7055
|
+
return fs.realpathSync(filePath);
|
|
7056
|
+
}
|
|
7057
|
+
/**
|
|
7058
|
+
* Watch a directory for changes
|
|
7059
|
+
* @param dirPath - Directory to watch
|
|
7060
|
+
* @param options - fs.watch options
|
|
7061
|
+
* @param callback - Callback for change events
|
|
7062
|
+
* @returns FSWatcher instance
|
|
7063
|
+
*/
|
|
7064
|
+
watch(dirPath, options, callback) {
|
|
7065
|
+
return fs.watch(dirPath, options, callback);
|
|
7066
|
+
}
|
|
6960
7067
|
/**
|
|
6961
7068
|
* Get file stats synchronously (follows symlinks)
|
|
6962
7069
|
* Returns null if file doesn't exist (graceful degradation)
|
|
@@ -6969,7 +7076,7 @@ var init_PathResolver = __esm({
|
|
|
6969
7076
|
return fs.lstatSync(filePath);
|
|
6970
7077
|
} catch (error2) {
|
|
6971
7078
|
if (this.options.debug) {
|
|
6972
|
-
|
|
7079
|
+
log3.warn(`Failed to lstat file: ${filePath}`, error2);
|
|
6973
7080
|
}
|
|
6974
7081
|
return null;
|
|
6975
7082
|
}
|
|
@@ -7036,6 +7143,28 @@ var init_PathResolver = __esm({
|
|
|
7036
7143
|
* Get app root (where vite.config.ts is, Vite's config.root)
|
|
7037
7144
|
* Falls back to repoRoot if not set
|
|
7038
7145
|
*/
|
|
7146
|
+
/**
|
|
7147
|
+
* Start recording every path written by writeSync/copySync.
|
|
7148
|
+
* Lets a generator know exactly which files the current run produced,
|
|
7149
|
+
* without comparing file timestamps to a clock.
|
|
7150
|
+
*/
|
|
7151
|
+
startWriteRecording() {
|
|
7152
|
+
this._writtenPaths = /* @__PURE__ */ new Set();
|
|
7153
|
+
}
|
|
7154
|
+
/**
|
|
7155
|
+
* Stop recording and return the normalized paths written since
|
|
7156
|
+
* startWriteRecording().
|
|
7157
|
+
*/
|
|
7158
|
+
stopWriteRecording() {
|
|
7159
|
+
if (!this._writtenPaths) {
|
|
7160
|
+
throw new Error(
|
|
7161
|
+
"stopWriteRecording() called without startWriteRecording()"
|
|
7162
|
+
);
|
|
7163
|
+
}
|
|
7164
|
+
const written = this._writtenPaths;
|
|
7165
|
+
this._writtenPaths = null;
|
|
7166
|
+
return written;
|
|
7167
|
+
}
|
|
7039
7168
|
getAppRoot() {
|
|
7040
7169
|
if (!this._appRoot) {
|
|
7041
7170
|
return this._repoRoot;
|
|
@@ -7058,7 +7187,7 @@ var init_PathResolver = __esm({
|
|
|
7058
7187
|
* @returns True if repoRoot is the monorepo (has packages directory)
|
|
7059
7188
|
*/
|
|
7060
7189
|
isMonorepo() {
|
|
7061
|
-
const packagesDir =
|
|
7190
|
+
const packagesDir = join2(this._repoRoot, "packages");
|
|
7062
7191
|
return this.pathExists(packagesDir);
|
|
7063
7192
|
}
|
|
7064
7193
|
/**
|
|
@@ -7075,7 +7204,7 @@ var init_PathResolver = __esm({
|
|
|
7075
7204
|
* Find files matching pattern within directory
|
|
7076
7205
|
*/
|
|
7077
7206
|
async findFiles(directory, pattern, options = {}) {
|
|
7078
|
-
const searchPattern = this.normalizePath(
|
|
7207
|
+
const searchPattern = this.normalizePath(join2(directory, pattern));
|
|
7079
7208
|
const appRoot = this.getAppRoot();
|
|
7080
7209
|
const normalizeAppRoot = this.normalizePath(appRoot);
|
|
7081
7210
|
const relativePattern = searchPattern.startsWith(normalizeAppRoot) ? searchPattern.slice(normalizeAppRoot.length + 1) : searchPattern;
|
|
@@ -7122,7 +7251,7 @@ var init_PathResolver = __esm({
|
|
|
7122
7251
|
return null;
|
|
7123
7252
|
}
|
|
7124
7253
|
const resolvedPath = this.normalizePath(
|
|
7125
|
-
|
|
7254
|
+
join2(corePackageRoot, I18N_PATHS2.PUBLISHED_ROOT, i18nSubpath)
|
|
7126
7255
|
);
|
|
7127
7256
|
const resolvedDir = resolvedPath.replace(/\/[^/]*\*.*$/, "");
|
|
7128
7257
|
if (this.pathExists(resolvedDir)) {
|
|
@@ -7293,6 +7422,15 @@ var init_PathResolver = __esm({
|
|
|
7293
7422
|
const cjsPath = this.getEmptyCjsModulePath();
|
|
7294
7423
|
return cjsPath.replace(/\.cjs$/, ".js");
|
|
7295
7424
|
}
|
|
7425
|
+
/**
|
|
7426
|
+
* Get absolute path to empty flag component module.
|
|
7427
|
+
* Returns `export default () => null;` — used by flag filtering plugins
|
|
7428
|
+
* to replace unused flag files at build time.
|
|
7429
|
+
*/
|
|
7430
|
+
getEmptyFlagModulePath() {
|
|
7431
|
+
const __dirname2 = dirname2(fileURLToPath(import.meta.url));
|
|
7432
|
+
return this.normalizePath(resolve(__dirname2, "emptyFlag.js"));
|
|
7433
|
+
}
|
|
7296
7434
|
/**
|
|
7297
7435
|
* Get absolute path to empty CJS module for esbuild pre-bundling.
|
|
7298
7436
|
* CJS because esbuild statically analyzes ESM exports — CJS has dynamic
|
|
@@ -7318,13 +7456,13 @@ var init_PathResolver = __esm({
|
|
|
7318
7456
|
const maxLevels = this.options.maxLevels;
|
|
7319
7457
|
while (levelsChecked < maxLevels) {
|
|
7320
7458
|
const toolingPath = this.normalizePath(
|
|
7321
|
-
|
|
7459
|
+
join2(currentDir, PACKAGE_PATHS.TOOLING)
|
|
7322
7460
|
);
|
|
7323
|
-
const corePath = this.normalizePath(
|
|
7461
|
+
const corePath = this.normalizePath(join2(currentDir, PACKAGE_PATHS.CORE));
|
|
7324
7462
|
if (this.pathExists(toolingPath) && this.pathExists(corePath)) {
|
|
7325
7463
|
return currentDir;
|
|
7326
7464
|
}
|
|
7327
|
-
const appsDir =
|
|
7465
|
+
const appsDir = join2(currentDir, "apps");
|
|
7328
7466
|
if (this.pathExists(appsDir)) {
|
|
7329
7467
|
const appsDirStat = this.statSync(appsDir);
|
|
7330
7468
|
if (appsDirStat?.isDirectory()) {
|
|
@@ -7332,15 +7470,15 @@ var init_PathResolver = __esm({
|
|
|
7332
7470
|
}
|
|
7333
7471
|
}
|
|
7334
7472
|
const packageJsonPath = this.normalizePath(
|
|
7335
|
-
|
|
7473
|
+
join2(currentDir, "package.json")
|
|
7336
7474
|
);
|
|
7337
7475
|
if (this.pathExists(packageJsonPath)) {
|
|
7338
|
-
const parentDir2 = this.normalizePath(
|
|
7476
|
+
const parentDir2 = this.normalizePath(dirname2(currentDir));
|
|
7339
7477
|
if (parentDir2 === currentDir) {
|
|
7340
7478
|
return currentDir;
|
|
7341
7479
|
}
|
|
7342
7480
|
}
|
|
7343
|
-
const parentDir = this.normalizePath(
|
|
7481
|
+
const parentDir = this.normalizePath(dirname2(currentDir));
|
|
7344
7482
|
if (parentDir === currentDir) {
|
|
7345
7483
|
break;
|
|
7346
7484
|
}
|
|
@@ -7356,8 +7494,8 @@ var init_PathResolver = __esm({
|
|
|
7356
7494
|
// packages/tooling/src/utils/pathResolver.ts
|
|
7357
7495
|
import { createRequire as createRequire2 } from "node:module";
|
|
7358
7496
|
import {
|
|
7359
|
-
join as
|
|
7360
|
-
dirname as
|
|
7497
|
+
join as join3,
|
|
7498
|
+
dirname as dirname3,
|
|
7361
7499
|
basename as basename2,
|
|
7362
7500
|
extname as extname2,
|
|
7363
7501
|
relative as relative2,
|
|
@@ -7375,7 +7513,7 @@ var init_pathResolver = __esm({
|
|
|
7375
7513
|
pathResolverInstance = PathResolver.getInstance({ debug: false });
|
|
7376
7514
|
getRepoRoot = () => pathResolverInstance.getRepoRoot();
|
|
7377
7515
|
normalizePath = (...pathSegments) => {
|
|
7378
|
-
return pathResolverInstance.normalizePath(
|
|
7516
|
+
return pathResolverInstance.normalizePath(join3(...pathSegments));
|
|
7379
7517
|
};
|
|
7380
7518
|
pathExists = (filePath, silent = false) => pathResolverInstance.pathExists(filePath, silent);
|
|
7381
7519
|
readSync = (filePath, options) => pathResolverInstance.readSync(filePath, options);
|
|
@@ -7386,10 +7524,10 @@ var init_pathResolver = __esm({
|
|
|
7386
7524
|
});
|
|
7387
7525
|
|
|
7388
7526
|
// packages/tooling/src/bundler/utils.ts
|
|
7389
|
-
import { Buffer } from "node:buffer";
|
|
7527
|
+
import { Buffer as Buffer2 } from "node:buffer";
|
|
7390
7528
|
import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
7391
7529
|
import { createRequire as createRequire3 } from "node:module";
|
|
7392
|
-
import { dirname as
|
|
7530
|
+
import { dirname as dirname4, resolve as resolve3 } from "node:path";
|
|
7393
7531
|
import process from "node:process";
|
|
7394
7532
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
7395
7533
|
var require2, __filename, __dirname;
|
|
@@ -7398,12 +7536,12 @@ var init_utils2 = __esm({
|
|
|
7398
7536
|
"use strict";
|
|
7399
7537
|
require2 = createRequire3(import.meta.url);
|
|
7400
7538
|
__filename = fileURLToPath3(import.meta.url);
|
|
7401
|
-
__dirname =
|
|
7539
|
+
__dirname = dirname4(__filename);
|
|
7402
7540
|
if (typeof globalThis !== "undefined") {
|
|
7403
7541
|
globalThis.require = require2;
|
|
7404
7542
|
globalThis.__filename = __filename;
|
|
7405
7543
|
globalThis.__dirname = __dirname;
|
|
7406
|
-
globalThis.Buffer =
|
|
7544
|
+
globalThis.Buffer = Buffer2;
|
|
7407
7545
|
globalThis.process = process;
|
|
7408
7546
|
if (typeof global === "undefined") {
|
|
7409
7547
|
globalThis.global = globalThis;
|
|
@@ -7438,20 +7576,20 @@ async function main() {
|
|
|
7438
7576
|
}
|
|
7439
7577
|
const projectRoot = getRepoRoot();
|
|
7440
7578
|
if (!projectRoot) {
|
|
7441
|
-
|
|
7579
|
+
log2.error("Not in a project directory. Run this from your project root.");
|
|
7442
7580
|
return 1;
|
|
7443
7581
|
}
|
|
7444
7582
|
const agentsMdPath = joinPath(projectRoot, "AGENTS.md");
|
|
7445
7583
|
if (!pathExists(agentsMdPath)) {
|
|
7446
|
-
|
|
7447
|
-
|
|
7584
|
+
log2.error("AGENTS.md not found in project root.");
|
|
7585
|
+
log2.warn(
|
|
7448
7586
|
'Run "dndev init" to scaffold a new project, or create AGENTS.md manually.'
|
|
7449
7587
|
);
|
|
7450
7588
|
return 1;
|
|
7451
7589
|
}
|
|
7452
7590
|
const content = readSync(agentsMdPath);
|
|
7453
7591
|
if (!content) {
|
|
7454
|
-
|
|
7592
|
+
log2.error("AGENTS.md is empty.");
|
|
7455
7593
|
return 1;
|
|
7456
7594
|
}
|
|
7457
7595
|
if (copyToClipboard) {
|
|
@@ -7460,30 +7598,30 @@ async function main() {
|
|
|
7460
7598
|
const platform = process.platform;
|
|
7461
7599
|
if (platform === "darwin") {
|
|
7462
7600
|
execSync("pbcopy", { input: content });
|
|
7463
|
-
|
|
7601
|
+
log2.success("Copied to clipboard! Paste into your AI agent.");
|
|
7464
7602
|
} else if (platform === "linux") {
|
|
7465
7603
|
try {
|
|
7466
7604
|
execSync("xclip -selection clipboard", { input: content });
|
|
7467
|
-
|
|
7605
|
+
log2.success("Copied to clipboard! Paste into your AI agent.");
|
|
7468
7606
|
} catch {
|
|
7469
7607
|
try {
|
|
7470
7608
|
execSync("xsel --clipboard --input", { input: content });
|
|
7471
|
-
|
|
7609
|
+
log2.success("Copied to clipboard! Paste into your AI agent.");
|
|
7472
7610
|
} catch {
|
|
7473
|
-
|
|
7611
|
+
log2.warn("Could not copy to clipboard. Install xclip or xsel.");
|
|
7474
7612
|
}
|
|
7475
7613
|
}
|
|
7476
7614
|
} else if (platform === "win32") {
|
|
7477
7615
|
execSync("clip", { input: content });
|
|
7478
|
-
|
|
7616
|
+
log2.success("Copied to clipboard! Paste into your AI agent.");
|
|
7479
7617
|
}
|
|
7480
7618
|
} catch {
|
|
7481
|
-
|
|
7619
|
+
log2.warn("Could not copy to clipboard automatically.");
|
|
7482
7620
|
}
|
|
7483
7621
|
}
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7622
|
+
log2.info("\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
|
|
7623
|
+
log2.info("Paste the above into your AI agent to start the WAI-WAY flow.");
|
|
7624
|
+
log2.info("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n");
|
|
7487
7625
|
return 0;
|
|
7488
7626
|
}
|
|
7489
7627
|
export {
|