@donotdev/cli 0.1.46 → 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 +189 -149
- package/dist/bin/commands/agent-setup.js +83 -19
- package/dist/bin/commands/build.js +105 -37
- package/dist/bin/commands/bump.js +108 -44
- package/dist/bin/commands/cacheout.js +83 -19
- package/dist/bin/commands/coach.js +83 -19
- package/dist/bin/commands/create-app.js +107 -43
- package/dist/bin/commands/create-project.js +107 -43
- package/dist/bin/commands/db.js +134098 -72027
- package/dist/bin/commands/deploy.js +310 -239
- package/dist/bin/commands/dev.js +87 -23
- package/dist/bin/commands/doctor.js +83 -19
- package/dist/bin/commands/emu.js +93 -29
- package/dist/bin/commands/format.js +83 -19
- package/dist/bin/commands/get-demo.js +87 -23
- package/dist/bin/commands/make-admin.js +7466 -8217
- package/dist/bin/commands/preview.js +87 -23
- package/dist/bin/commands/seed.js +134098 -72027
- package/dist/bin/commands/setup-cicd.js +107 -43
- package/dist/bin/commands/setup.js +110 -43
- package/dist/bin/commands/staging.js +310 -239
- package/dist/bin/commands/sync-secrets.js +88 -24
- package/dist/bin/commands/type-check.js +83 -19
- package/dist/bin/commands/wai.js +83 -19
- package/dist/bin/dndev.js +8 -3
- package/dist/index.js +317 -246
- 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
|
@@ -10,11 +10,20 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
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") {
|
|
@@ -453,7 +462,7 @@ var require_src = __commonJS({
|
|
|
453
462
|
}
|
|
454
463
|
});
|
|
455
464
|
|
|
456
|
-
// node_modules/.bun/@clack+core@1.5.
|
|
465
|
+
// node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs
|
|
457
466
|
import { styleText } from "node:util";
|
|
458
467
|
import { stdout, stdin } from "node:process";
|
|
459
468
|
import * as l from "node:readline";
|
|
@@ -552,7 +561,7 @@ function runValidation(e, a2) {
|
|
|
552
561
|
}
|
|
553
562
|
var import_sisteransi, a$1, t, settings, R, CANCEL_SYMBOL, getColumns, getRows, y, r, a;
|
|
554
563
|
var init_dist3 = __esm({
|
|
555
|
-
"node_modules/.bun/@clack+core@1.5.
|
|
564
|
+
"node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs"() {
|
|
556
565
|
init_utils2();
|
|
557
566
|
init_main();
|
|
558
567
|
import_sisteransi = __toESM(require_src(), 1);
|
|
@@ -850,7 +859,7 @@ var init_dist3 = __esm({
|
|
|
850
859
|
}
|
|
851
860
|
});
|
|
852
861
|
|
|
853
|
-
// node_modules/.bun/@clack+prompts@1.8.
|
|
862
|
+
// node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs
|
|
854
863
|
import { styleText as styleText2, stripVTControlCharacters } from "node:util";
|
|
855
864
|
import process$1 from "node:process";
|
|
856
865
|
import { existsSync, lstatSync, readdirSync } from "node:fs";
|
|
@@ -867,7 +876,7 @@ function formatInstructionFooter(o, e) {
|
|
|
867
876
|
}
|
|
868
877
|
var import_sisteransi2, unicode, isCI, 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, symbol, symbolBar, I, limitOptions, confirm, MULTISELECT_INSTRUCTIONS, m, multiselect, log, cancel, intro, outro, W$1, C, note, W, spinner, u2, SELECT_INSTRUCTIONS, i;
|
|
869
878
|
var init_dist4 = __esm({
|
|
870
|
-
"node_modules/.bun/@clack+prompts@1.8.
|
|
879
|
+
"node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs"() {
|
|
871
880
|
init_utils2();
|
|
872
881
|
init_dist3();
|
|
873
882
|
init_dist3();
|
|
@@ -996,39 +1005,39 @@ var init_dist4 = __esm({
|
|
|
996
1005
|
x.push(n2);
|
|
997
1006
|
return c && x.push(M), x;
|
|
998
1007
|
};
|
|
999
|
-
confirm = (
|
|
1000
|
-
const a2 =
|
|
1008
|
+
confirm = (e) => {
|
|
1009
|
+
const a2 = e.active ?? "Yes", o = e.inactive ?? "No";
|
|
1001
1010
|
return new r({
|
|
1002
1011
|
active: a2,
|
|
1003
|
-
inactive:
|
|
1004
|
-
signal:
|
|
1005
|
-
input:
|
|
1006
|
-
output:
|
|
1007
|
-
initialValue:
|
|
1012
|
+
inactive: o,
|
|
1013
|
+
signal: e.signal,
|
|
1014
|
+
input: e.input,
|
|
1015
|
+
output: e.output,
|
|
1016
|
+
initialValue: e.initialValue ?? true,
|
|
1008
1017
|
render() {
|
|
1009
|
-
const
|
|
1010
|
-
|
|
1011
|
-
|
|
1018
|
+
const i2 = e.withGuide ?? settings.withGuide, u3 = `${symbol(this.state)} `, l2 = i2 ? `${styleText2("gray", S_BAR)} ` : "", f = wrapTextWithPrefix(
|
|
1019
|
+
e.output,
|
|
1020
|
+
e.message,
|
|
1012
1021
|
l2,
|
|
1013
1022
|
u3
|
|
1014
|
-
),
|
|
1023
|
+
), s = `${i2 ? `${styleText2("gray", S_BAR)}
|
|
1015
1024
|
` : ""}${f}
|
|
1016
|
-
`, c = this.value ? a2 :
|
|
1025
|
+
`, c = this.value ? a2 : o;
|
|
1017
1026
|
switch (this.state) {
|
|
1018
1027
|
case "submit": {
|
|
1019
|
-
const r2 =
|
|
1020
|
-
return `${
|
|
1028
|
+
const r2 = i2 ? `${styleText2("gray", S_BAR)} ` : "";
|
|
1029
|
+
return `${s}${r2}${styleText2("dim", c)}`;
|
|
1021
1030
|
}
|
|
1022
1031
|
case "cancel": {
|
|
1023
|
-
const r2 =
|
|
1024
|
-
return `${
|
|
1032
|
+
const r2 = i2 ? `${styleText2("gray", S_BAR)} ` : "";
|
|
1033
|
+
return `${s}${r2}${styleText2(["strikethrough", "dim"], c)}${i2 ? `
|
|
1025
1034
|
${styleText2("gray", S_BAR)}` : ""}`;
|
|
1026
1035
|
}
|
|
1027
1036
|
default: {
|
|
1028
|
-
const r2 =
|
|
1029
|
-
return `${
|
|
1037
|
+
const r2 = i2 ? `${styleText2("cyan", S_BAR)} ` : "", g = i2 ? styleText2("cyan", S_BAR_END) : "";
|
|
1038
|
+
return `${s}${r2}${this.value ? `${styleText2("green", S_RADIO_ACTIVE)} ${a2}` : `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", a2)}`}${e.vertical ? i2 ? `
|
|
1030
1039
|
${styleText2("cyan", S_BAR)} ` : `
|
|
1031
|
-
` : ` ${styleText2("dim", "/")} `}${this.value ? `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim",
|
|
1040
|
+
` : ` ${styleText2("dim", "/")} `}${this.value ? `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", o)}` : `${styleText2("green", S_RADIO_ACTIVE)} ${o}`}
|
|
1032
1041
|
${g}
|
|
1033
1042
|
`;
|
|
1034
1043
|
}
|
|
@@ -1048,7 +1057,7 @@ ${g}
|
|
|
1048
1057
|
const u3 = (t2, a2) => {
|
|
1049
1058
|
const r2 = t2.label ?? String(t2.value);
|
|
1050
1059
|
return a2 === "disabled" ? `${styleText2("gray", S_CHECKBOX_INACTIVE)} ${m(r2, (o) => styleText2(["strikethrough", "gray"], o))}${t2.hint ? ` ${styleText2("dim", `(${t2.hint ?? "disabled"})`)}` : ""}` : a2 === "active" ? `${styleText2("cyan", S_CHECKBOX_ACTIVE)} ${r2}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : a2 === "selected" ? `${styleText2("green", S_CHECKBOX_SELECTED)} ${m(r2, (o) => styleText2("dim", o))}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : a2 === "cancelled" ? `${m(r2, (o) => styleText2(["strikethrough", "dim"], o))}` : a2 === "active-selected" ? `${styleText2("green", S_CHECKBOX_SELECTED)} ${r2}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : a2 === "submitted" ? `${m(r2, (o) => styleText2("dim", o))}` : `${styleText2("dim", S_CHECKBOX_INACTIVE)} ${m(r2, (o) => styleText2("dim", o))}`;
|
|
1051
|
-
}, d = i2.required ?? true,
|
|
1060
|
+
}, d = i2.required ?? true, x = i2.showInstructions ?? true;
|
|
1052
1061
|
return new a({
|
|
1053
1062
|
options: i2.options,
|
|
1054
1063
|
signal: i2.signal,
|
|
@@ -1079,7 +1088,7 @@ ${styleText2(
|
|
|
1079
1088
|
`${symbol(this.state)} `
|
|
1080
1089
|
), r2 = `${t2 ? `${styleText2("gray", S_BAR)}
|
|
1081
1090
|
` : ""}${a2}
|
|
1082
|
-
`, o = this.value ?? [],
|
|
1091
|
+
`, o = this.value ?? [], g = (n2, l2) => {
|
|
1083
1092
|
if (n2.disabled)
|
|
1084
1093
|
return u3(n2, "disabled");
|
|
1085
1094
|
const s = o.includes(n2.value);
|
|
@@ -1109,7 +1118,7 @@ ${styleText2("gray", S_BAR)}` : ""}`;
|
|
|
1109
1118
|
case "error": {
|
|
1110
1119
|
const n2 = t2 ? `${styleText2("yellow", S_BAR)} ` : "", l2 = this.error.split(`
|
|
1111
1120
|
`).map(
|
|
1112
|
-
($,
|
|
1121
|
+
($, v) => v === 0 ? `${t2 ? `${styleText2("yellow", S_BAR_END)} ` : ""}${styleText2("yellow", $)}` : ` ${$}`
|
|
1113
1122
|
).join(`
|
|
1114
1123
|
`), s = r2.split(`
|
|
1115
1124
|
`).length, h2 = l2.split(`
|
|
@@ -1121,7 +1130,7 @@ ${styleText2("gray", S_BAR)}` : ""}`;
|
|
|
1121
1130
|
maxItems: i2.maxItems,
|
|
1122
1131
|
columnPadding: n2.length,
|
|
1123
1132
|
rowPadding: s + h2,
|
|
1124
|
-
style:
|
|
1133
|
+
style: g
|
|
1125
1134
|
}).join(`
|
|
1126
1135
|
${n2}`)}
|
|
1127
1136
|
${l2}
|
|
@@ -1129,7 +1138,7 @@ ${l2}
|
|
|
1129
1138
|
}
|
|
1130
1139
|
default: {
|
|
1131
1140
|
const n2 = t2 ? `${styleText2("cyan", S_BAR)} ` : "", l2 = r2.split(`
|
|
1132
|
-
`).length, s =
|
|
1141
|
+
`).length, s = x ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, t2) : t2 ? [styleText2("cyan", S_BAR_END)] : [], h2 = s.join(`
|
|
1133
1142
|
`), $ = s.length + 1;
|
|
1134
1143
|
return `${r2}${n2}${limitOptions({
|
|
1135
1144
|
output: i2.output,
|
|
@@ -1138,7 +1147,7 @@ ${l2}
|
|
|
1138
1147
|
maxItems: i2.maxItems,
|
|
1139
1148
|
columnPadding: n2.length,
|
|
1140
1149
|
rowPadding: l2 + $,
|
|
1141
|
-
style:
|
|
1150
|
+
style: g
|
|
1142
1151
|
}).join(`
|
|
1143
1152
|
${n2}`)}
|
|
1144
1153
|
${h2}
|
|
@@ -5959,9 +5968,9 @@ var require_reusify = __commonJS({
|
|
|
5959
5968
|
}
|
|
5960
5969
|
});
|
|
5961
5970
|
|
|
5962
|
-
// node_modules/.bun/fastq@1.20.
|
|
5971
|
+
// node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js
|
|
5963
5972
|
var require_queue = __commonJS({
|
|
5964
|
-
"node_modules/.bun/fastq@1.20.
|
|
5973
|
+
"node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js"(exports, module) {
|
|
5965
5974
|
"use strict";
|
|
5966
5975
|
init_utils2();
|
|
5967
5976
|
var reusify = require_reusify();
|
|
@@ -6141,11 +6150,12 @@ var require_queue = __commonJS({
|
|
|
6141
6150
|
current.value = null;
|
|
6142
6151
|
current.callback = noop;
|
|
6143
6152
|
current.errorHandler = null;
|
|
6153
|
+
current.next = null;
|
|
6144
6154
|
if (errorHandler2) {
|
|
6145
6155
|
errorHandler2(new Error("abort"), val);
|
|
6146
6156
|
}
|
|
6147
6157
|
callback.call(context2, new Error("abort"));
|
|
6148
|
-
|
|
6158
|
+
cache.release(current);
|
|
6149
6159
|
current = next;
|
|
6150
6160
|
}
|
|
6151
6161
|
self.drain = noop;
|
|
@@ -7611,7 +7621,7 @@ import {
|
|
|
7611
7621
|
sep,
|
|
7612
7622
|
extname
|
|
7613
7623
|
} from "node:path";
|
|
7614
|
-
import "node:url";
|
|
7624
|
+
import { fileURLToPath } from "node:url";
|
|
7615
7625
|
function safeExecuteAsync(fn, message) {
|
|
7616
7626
|
return fn().catch((error2) => {
|
|
7617
7627
|
throw new Error(
|
|
@@ -7668,6 +7678,7 @@ var init_PathResolver = __esm({
|
|
|
7668
7678
|
options;
|
|
7669
7679
|
_repoRoot;
|
|
7670
7680
|
_appRoot = null;
|
|
7681
|
+
_writtenPaths = null;
|
|
7671
7682
|
/**
|
|
7672
7683
|
* Get or create singleton instance
|
|
7673
7684
|
* @param options - Configuration options
|
|
@@ -7986,16 +7997,17 @@ var init_PathResolver = __esm({
|
|
|
7986
7997
|
}
|
|
7987
7998
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
7988
7999
|
let writeContent;
|
|
7989
|
-
if (
|
|
8000
|
+
if (Buffer2.isBuffer(content)) {
|
|
7990
8001
|
writeContent = content;
|
|
7991
8002
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
7992
|
-
writeContent = JSON.stringify(content, null, 2)
|
|
8003
|
+
writeContent = `${JSON.stringify(content, null, 2)}
|
|
8004
|
+
`;
|
|
7993
8005
|
} else {
|
|
7994
8006
|
writeContent = String(content);
|
|
7995
8007
|
}
|
|
7996
8008
|
try {
|
|
7997
8009
|
return await safeExecuteAsync(async () => {
|
|
7998
|
-
if (
|
|
8010
|
+
if (Buffer2.isBuffer(writeContent)) {
|
|
7999
8011
|
await fs.promises.writeFile(normalizedPath, writeContent);
|
|
8000
8012
|
} else {
|
|
8001
8013
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
@@ -8047,19 +8059,21 @@ var init_PathResolver = __esm({
|
|
|
8047
8059
|
}
|
|
8048
8060
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
8049
8061
|
let writeContent;
|
|
8050
|
-
if (
|
|
8062
|
+
if (Buffer2.isBuffer(content)) {
|
|
8051
8063
|
writeContent = content;
|
|
8052
8064
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
8053
|
-
writeContent = JSON.stringify(content, null, 2)
|
|
8065
|
+
writeContent = `${JSON.stringify(content, null, 2)}
|
|
8066
|
+
`;
|
|
8054
8067
|
} else {
|
|
8055
8068
|
writeContent = String(content);
|
|
8056
8069
|
}
|
|
8057
8070
|
try {
|
|
8058
|
-
if (
|
|
8071
|
+
if (Buffer2.isBuffer(writeContent)) {
|
|
8059
8072
|
fs.writeFileSync(normalizedPath, writeContent);
|
|
8060
8073
|
} else {
|
|
8061
8074
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
8062
8075
|
}
|
|
8076
|
+
this._writtenPaths?.add(normalizedPath);
|
|
8063
8077
|
if (verbose) {
|
|
8064
8078
|
log3.info(
|
|
8065
8079
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
@@ -8144,6 +8158,7 @@ var init_PathResolver = __esm({
|
|
|
8144
8158
|
}
|
|
8145
8159
|
try {
|
|
8146
8160
|
fs.copyFileSync(srcPath, normalizedDestPath);
|
|
8161
|
+
this._writtenPaths?.add(normalizedDestPath);
|
|
8147
8162
|
if (verbose) {
|
|
8148
8163
|
log3.info(
|
|
8149
8164
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
@@ -8211,6 +8226,24 @@ var init_PathResolver = __esm({
|
|
|
8211
8226
|
return null;
|
|
8212
8227
|
}
|
|
8213
8228
|
}
|
|
8229
|
+
/**
|
|
8230
|
+
* Resolve the real path of a file, following symlinks
|
|
8231
|
+
* @param filePath - Path to resolve
|
|
8232
|
+
* @returns Resolved real path
|
|
8233
|
+
*/
|
|
8234
|
+
realpathSync(filePath) {
|
|
8235
|
+
return fs.realpathSync(filePath);
|
|
8236
|
+
}
|
|
8237
|
+
/**
|
|
8238
|
+
* Watch a directory for changes
|
|
8239
|
+
* @param dirPath - Directory to watch
|
|
8240
|
+
* @param options - fs.watch options
|
|
8241
|
+
* @param callback - Callback for change events
|
|
8242
|
+
* @returns FSWatcher instance
|
|
8243
|
+
*/
|
|
8244
|
+
watch(dirPath, options, callback) {
|
|
8245
|
+
return fs.watch(dirPath, options, callback);
|
|
8246
|
+
}
|
|
8214
8247
|
/**
|
|
8215
8248
|
* Get file stats synchronously (follows symlinks)
|
|
8216
8249
|
* Returns null if file doesn't exist (graceful degradation)
|
|
@@ -8290,6 +8323,28 @@ var init_PathResolver = __esm({
|
|
|
8290
8323
|
* Get app root (where vite.config.ts is, Vite's config.root)
|
|
8291
8324
|
* Falls back to repoRoot if not set
|
|
8292
8325
|
*/
|
|
8326
|
+
/**
|
|
8327
|
+
* Start recording every path written by writeSync/copySync.
|
|
8328
|
+
* Lets a generator know exactly which files the current run produced,
|
|
8329
|
+
* without comparing file timestamps to a clock.
|
|
8330
|
+
*/
|
|
8331
|
+
startWriteRecording() {
|
|
8332
|
+
this._writtenPaths = /* @__PURE__ */ new Set();
|
|
8333
|
+
}
|
|
8334
|
+
/**
|
|
8335
|
+
* Stop recording and return the normalized paths written since
|
|
8336
|
+
* startWriteRecording().
|
|
8337
|
+
*/
|
|
8338
|
+
stopWriteRecording() {
|
|
8339
|
+
if (!this._writtenPaths) {
|
|
8340
|
+
throw new Error(
|
|
8341
|
+
"stopWriteRecording() called without startWriteRecording()"
|
|
8342
|
+
);
|
|
8343
|
+
}
|
|
8344
|
+
const written = this._writtenPaths;
|
|
8345
|
+
this._writtenPaths = null;
|
|
8346
|
+
return written;
|
|
8347
|
+
}
|
|
8293
8348
|
getAppRoot() {
|
|
8294
8349
|
if (!this._appRoot) {
|
|
8295
8350
|
return this._repoRoot;
|
|
@@ -8547,6 +8602,15 @@ var init_PathResolver = __esm({
|
|
|
8547
8602
|
const cjsPath = this.getEmptyCjsModulePath();
|
|
8548
8603
|
return cjsPath.replace(/\.cjs$/, ".js");
|
|
8549
8604
|
}
|
|
8605
|
+
/**
|
|
8606
|
+
* Get absolute path to empty flag component module.
|
|
8607
|
+
* Returns `export default () => null;` — used by flag filtering plugins
|
|
8608
|
+
* to replace unused flag files at build time.
|
|
8609
|
+
*/
|
|
8610
|
+
getEmptyFlagModulePath() {
|
|
8611
|
+
const __dirname2 = dirname2(fileURLToPath(import.meta.url));
|
|
8612
|
+
return this.normalizePath(resolve(__dirname2, "emptyFlag.js"));
|
|
8613
|
+
}
|
|
8550
8614
|
/**
|
|
8551
8615
|
* Get absolute path to empty CJS module for esbuild pre-bundling.
|
|
8552
8616
|
* CJS because esbuild statically analyzes ESM exports — CJS has dynamic
|
|
@@ -8792,7 +8856,7 @@ var init_pathResolver = __esm({
|
|
|
8792
8856
|
});
|
|
8793
8857
|
|
|
8794
8858
|
// packages/tooling/src/bundler/utils.ts
|
|
8795
|
-
import { Buffer } from "node:buffer";
|
|
8859
|
+
import { Buffer as Buffer2 } from "node:buffer";
|
|
8796
8860
|
import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
8797
8861
|
import { createRequire as createRequire3 } from "node:module";
|
|
8798
8862
|
import { dirname as dirname4, resolve as resolve3 } from "node:path";
|
|
@@ -8809,7 +8873,7 @@ var init_utils2 = __esm({
|
|
|
8809
8873
|
globalThis.require = require2;
|
|
8810
8874
|
globalThis.__filename = __filename;
|
|
8811
8875
|
globalThis.__dirname = __dirname;
|
|
8812
|
-
globalThis.Buffer =
|
|
8876
|
+
globalThis.Buffer = Buffer2;
|
|
8813
8877
|
globalThis.process = process;
|
|
8814
8878
|
if (typeof global === "undefined") {
|
|
8815
8879
|
globalThis.global = globalThis;
|
|
@@ -10,11 +10,20 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
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") {
|
|
@@ -130,13 +139,13 @@ var require_src = __commonJS({
|
|
|
130
139
|
}
|
|
131
140
|
});
|
|
132
141
|
|
|
133
|
-
// node_modules/.bun/@clack+core@1.5.
|
|
142
|
+
// node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs
|
|
134
143
|
import { styleText } from "node:util";
|
|
135
144
|
import { stdout, stdin } from "node:process";
|
|
136
145
|
import { ReadStream } from "node:tty";
|
|
137
146
|
var import_sisteransi, a$1, t, settings, R;
|
|
138
147
|
var init_dist3 = __esm({
|
|
139
|
-
"node_modules/.bun/@clack+core@1.5.
|
|
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);
|
|
@@ -188,7 +197,7 @@ var init_dist3 = __esm({
|
|
|
188
197
|
}
|
|
189
198
|
});
|
|
190
199
|
|
|
191
|
-
// node_modules/.bun/@clack+prompts@1.8.
|
|
200
|
+
// node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs
|
|
192
201
|
import { styleText as styleText2, stripVTControlCharacters } from "node:util";
|
|
193
202
|
import process$1 from "node:process";
|
|
194
203
|
import { existsSync, lstatSync, readdirSync } from "node:fs";
|
|
@@ -201,7 +210,7 @@ function isUnicodeSupported() {
|
|
|
201
210
|
}
|
|
202
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;
|
|
203
212
|
var init_dist4 = __esm({
|
|
204
|
-
"node_modules/.bun/@clack+prompts@1.8.
|
|
213
|
+
"node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs"() {
|
|
205
214
|
init_utils2();
|
|
206
215
|
init_dist3();
|
|
207
216
|
init_dist3();
|
|
@@ -4921,9 +4930,9 @@ var require_reusify = __commonJS({
|
|
|
4921
4930
|
}
|
|
4922
4931
|
});
|
|
4923
4932
|
|
|
4924
|
-
// node_modules/.bun/fastq@1.20.
|
|
4933
|
+
// node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js
|
|
4925
4934
|
var require_queue = __commonJS({
|
|
4926
|
-
"node_modules/.bun/fastq@1.20.
|
|
4935
|
+
"node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js"(exports, module) {
|
|
4927
4936
|
"use strict";
|
|
4928
4937
|
init_utils2();
|
|
4929
4938
|
var reusify = require_reusify();
|
|
@@ -5103,11 +5112,12 @@ var require_queue = __commonJS({
|
|
|
5103
5112
|
current.value = null;
|
|
5104
5113
|
current.callback = noop;
|
|
5105
5114
|
current.errorHandler = null;
|
|
5115
|
+
current.next = null;
|
|
5106
5116
|
if (errorHandler2) {
|
|
5107
5117
|
errorHandler2(new Error("abort"), val);
|
|
5108
5118
|
}
|
|
5109
5119
|
callback.call(context2, new Error("abort"));
|
|
5110
|
-
|
|
5120
|
+
cache.release(current);
|
|
5111
5121
|
current = next;
|
|
5112
5122
|
}
|
|
5113
5123
|
self.drain = noop;
|
|
@@ -6573,7 +6583,7 @@ import {
|
|
|
6573
6583
|
sep,
|
|
6574
6584
|
extname
|
|
6575
6585
|
} from "node:path";
|
|
6576
|
-
import "node:url";
|
|
6586
|
+
import { fileURLToPath } from "node:url";
|
|
6577
6587
|
function safeExecuteAsync(fn, message) {
|
|
6578
6588
|
return fn().catch((error2) => {
|
|
6579
6589
|
throw new Error(
|
|
@@ -6630,6 +6640,7 @@ var init_PathResolver = __esm({
|
|
|
6630
6640
|
options;
|
|
6631
6641
|
_repoRoot;
|
|
6632
6642
|
_appRoot = null;
|
|
6643
|
+
_writtenPaths = null;
|
|
6633
6644
|
/**
|
|
6634
6645
|
* Get or create singleton instance
|
|
6635
6646
|
* @param options - Configuration options
|
|
@@ -6948,16 +6959,17 @@ var init_PathResolver = __esm({
|
|
|
6948
6959
|
}
|
|
6949
6960
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
6950
6961
|
let writeContent;
|
|
6951
|
-
if (
|
|
6962
|
+
if (Buffer2.isBuffer(content)) {
|
|
6952
6963
|
writeContent = content;
|
|
6953
6964
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
6954
|
-
writeContent = JSON.stringify(content, null, 2)
|
|
6965
|
+
writeContent = `${JSON.stringify(content, null, 2)}
|
|
6966
|
+
`;
|
|
6955
6967
|
} else {
|
|
6956
6968
|
writeContent = String(content);
|
|
6957
6969
|
}
|
|
6958
6970
|
try {
|
|
6959
6971
|
return await safeExecuteAsync(async () => {
|
|
6960
|
-
if (
|
|
6972
|
+
if (Buffer2.isBuffer(writeContent)) {
|
|
6961
6973
|
await fs.promises.writeFile(normalizedPath, writeContent);
|
|
6962
6974
|
} else {
|
|
6963
6975
|
await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
|
|
@@ -7009,19 +7021,21 @@ var init_PathResolver = __esm({
|
|
|
7009
7021
|
}
|
|
7010
7022
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
7011
7023
|
let writeContent;
|
|
7012
|
-
if (
|
|
7024
|
+
if (Buffer2.isBuffer(content)) {
|
|
7013
7025
|
writeContent = content;
|
|
7014
7026
|
} else if (detectedFormat === "json" && typeof content === "object") {
|
|
7015
|
-
writeContent = JSON.stringify(content, null, 2)
|
|
7027
|
+
writeContent = `${JSON.stringify(content, null, 2)}
|
|
7028
|
+
`;
|
|
7016
7029
|
} else {
|
|
7017
7030
|
writeContent = String(content);
|
|
7018
7031
|
}
|
|
7019
7032
|
try {
|
|
7020
|
-
if (
|
|
7033
|
+
if (Buffer2.isBuffer(writeContent)) {
|
|
7021
7034
|
fs.writeFileSync(normalizedPath, writeContent);
|
|
7022
7035
|
} else {
|
|
7023
7036
|
fs.writeFileSync(normalizedPath, writeContent, "utf8");
|
|
7024
7037
|
}
|
|
7038
|
+
this._writtenPaths?.add(normalizedPath);
|
|
7025
7039
|
if (verbose) {
|
|
7026
7040
|
log3.info(
|
|
7027
7041
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
|
|
@@ -7106,6 +7120,7 @@ var init_PathResolver = __esm({
|
|
|
7106
7120
|
}
|
|
7107
7121
|
try {
|
|
7108
7122
|
fs.copyFileSync(srcPath, normalizedDestPath);
|
|
7123
|
+
this._writtenPaths?.add(normalizedDestPath);
|
|
7109
7124
|
if (verbose) {
|
|
7110
7125
|
log3.info(
|
|
7111
7126
|
`${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
|
|
@@ -7173,6 +7188,24 @@ var init_PathResolver = __esm({
|
|
|
7173
7188
|
return null;
|
|
7174
7189
|
}
|
|
7175
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
|
+
}
|
|
7176
7209
|
/**
|
|
7177
7210
|
* Get file stats synchronously (follows symlinks)
|
|
7178
7211
|
* Returns null if file doesn't exist (graceful degradation)
|
|
@@ -7252,6 +7285,28 @@ var init_PathResolver = __esm({
|
|
|
7252
7285
|
* Get app root (where vite.config.ts is, Vite's config.root)
|
|
7253
7286
|
* Falls back to repoRoot if not set
|
|
7254
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
|
+
}
|
|
7255
7310
|
getAppRoot() {
|
|
7256
7311
|
if (!this._appRoot) {
|
|
7257
7312
|
return this._repoRoot;
|
|
@@ -7509,6 +7564,15 @@ var init_PathResolver = __esm({
|
|
|
7509
7564
|
const cjsPath = this.getEmptyCjsModulePath();
|
|
7510
7565
|
return cjsPath.replace(/\.cjs$/, ".js");
|
|
7511
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
|
+
}
|
|
7512
7576
|
/**
|
|
7513
7577
|
* Get absolute path to empty CJS module for esbuild pre-bundling.
|
|
7514
7578
|
* CJS because esbuild statically analyzes ESM exports — CJS has dynamic
|
|
@@ -7635,7 +7699,7 @@ var init_pathResolver = __esm({
|
|
|
7635
7699
|
});
|
|
7636
7700
|
|
|
7637
7701
|
// packages/tooling/src/bundler/utils.ts
|
|
7638
|
-
import { Buffer } from "node:buffer";
|
|
7702
|
+
import { Buffer as Buffer2 } from "node:buffer";
|
|
7639
7703
|
import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
7640
7704
|
import { createRequire as createRequire3 } from "node:module";
|
|
7641
7705
|
import { dirname as dirname4, resolve as resolve3 } from "node:path";
|
|
@@ -7652,7 +7716,7 @@ var init_utils2 = __esm({
|
|
|
7652
7716
|
globalThis.require = require2;
|
|
7653
7717
|
globalThis.__filename = __filename;
|
|
7654
7718
|
globalThis.__dirname = __dirname;
|
|
7655
|
-
globalThis.Buffer =
|
|
7719
|
+
globalThis.Buffer = Buffer2;
|
|
7656
7720
|
globalThis.process = process;
|
|
7657
7721
|
if (typeof global === "undefined") {
|
|
7658
7722
|
globalThis.global = globalThis;
|