@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.
Files changed (47) hide show
  1. package/dependencies-matrix.json +189 -149
  2. package/dist/bin/commands/agent-setup.js +83 -19
  3. package/dist/bin/commands/build.js +105 -37
  4. package/dist/bin/commands/bump.js +108 -44
  5. package/dist/bin/commands/cacheout.js +83 -19
  6. package/dist/bin/commands/coach.js +83 -19
  7. package/dist/bin/commands/create-app.js +107 -43
  8. package/dist/bin/commands/create-project.js +107 -43
  9. package/dist/bin/commands/db.js +134098 -72027
  10. package/dist/bin/commands/deploy.js +310 -239
  11. package/dist/bin/commands/dev.js +87 -23
  12. package/dist/bin/commands/doctor.js +83 -19
  13. package/dist/bin/commands/emu.js +93 -29
  14. package/dist/bin/commands/format.js +83 -19
  15. package/dist/bin/commands/get-demo.js +87 -23
  16. package/dist/bin/commands/make-admin.js +7466 -8217
  17. package/dist/bin/commands/preview.js +87 -23
  18. package/dist/bin/commands/seed.js +134098 -72027
  19. package/dist/bin/commands/setup-cicd.js +107 -43
  20. package/dist/bin/commands/setup.js +110 -43
  21. package/dist/bin/commands/staging.js +310 -239
  22. package/dist/bin/commands/sync-secrets.js +88 -24
  23. package/dist/bin/commands/type-check.js +83 -19
  24. package/dist/bin/commands/wai.js +83 -19
  25. package/dist/bin/dndev.js +8 -3
  26. package/dist/index.js +317 -246
  27. package/package.json +3 -3
  28. package/templates/app-next/src/app/ClientLayout.tsx.example +11 -1
  29. package/templates/app-next/src/app/layout.tsx.example +19 -1
  30. package/templates/functions-firebase/src/billing/handleStripeWebhook.ts.example +8 -18
  31. package/templates/functions-firebase/src/billing/index.ts.example +0 -1
  32. package/templates/functions-firebase/src/billing/refreshSubscriptionStatus.ts.example +4 -8
  33. package/templates/functions-firebase/src/index.ts.example +0 -1
  34. package/templates/functions-supabase/supabase/config.toml.example +4 -0
  35. package/templates/functions-supabase/supabase/functions/stripe-webhook/index.ts.example +12 -0
  36. package/templates/functions-supabase/supabase/migrations/20250101000005_webhook_events.sql +133 -0
  37. package/templates/functions-vercel/.env.example +9 -0
  38. package/templates/functions-vercel/src/api/billing/handleStripeWebhook.ts.example +12 -14
  39. package/templates/functions-vercel/src/api/billing/refreshSubscriptionStatus.ts.example +4 -14
  40. package/templates/overlay-supabase/src/config/providers.ts.example +2 -2
  41. package/templates/root-consumer/.claude/hooks/guard-write.sh.example +32 -0
  42. package/templates/root-consumer/.claude/hooks/record-lookup.sh.example +22 -0
  43. package/templates/root-consumer/.claude/rules/definition-of-done.md.example +7 -0
  44. package/templates/root-consumer/.claude/rules/framework.md.example +6 -0
  45. package/templates/root-consumer/.claude/settings.json.example +11 -1
  46. package/templates/functions-firebase/src/billing/processPaymentSuccess.ts.example +0 -14
  47. 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
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
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
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
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.0/node_modules/@clack/core/dist/index.mjs
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 l__default from "node:readline";
@@ -520,7 +529,7 @@ function runValidation(e, a2) {
520
529
  }
521
530
  var import_sisteransi, a$1, t, settings, R, CANCEL_SYMBOL, getColumns, getRows, y, a, n$1;
522
531
  var init_dist3 = __esm({
523
- "node_modules/.bun/@clack+core@1.5.0/node_modules/@clack/core/dist/index.mjs"() {
532
+ "node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs"() {
524
533
  init_utils2();
525
534
  init_main();
526
535
  import_sisteransi = __toESM(require_src(), 1);
@@ -829,7 +838,7 @@ var init_dist3 = __esm({
829
838
  }
830
839
  });
831
840
 
832
- // node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs
841
+ // node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs
833
842
  import { styleText as styleText2, stripVTControlCharacters } from "node:util";
834
843
  import process$1 from "node:process";
835
844
  import { existsSync, lstatSync, readdirSync } from "node:fs";
@@ -846,7 +855,7 @@ function formatInstructionFooter(o, e) {
846
855
  }
847
856
  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, symbol, symbolBar, I, limitOptions, MULTISELECT_INSTRUCTIONS, m, multiselect, log, cancel, u2, SELECT_INSTRUCTIONS, c, select, i;
848
857
  var init_dist4 = __esm({
849
- "node_modules/.bun/@clack+prompts@1.8.0/node_modules/@clack/prompts/dist/index.mjs"() {
858
+ "node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs"() {
850
859
  init_utils2();
851
860
  init_dist3();
852
861
  init_dist3();
@@ -986,7 +995,7 @@ var init_dist4 = __esm({
986
995
  const u3 = (t2, a2) => {
987
996
  const r2 = t2.label ?? String(t2.value);
988
997
  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))}`;
989
- }, d = i2.required ?? true, v = i2.showInstructions ?? true;
998
+ }, d = i2.required ?? true, x = i2.showInstructions ?? true;
990
999
  return new a({
991
1000
  options: i2.options,
992
1001
  signal: i2.signal,
@@ -1017,7 +1026,7 @@ ${styleText2(
1017
1026
  `${symbol(this.state)} `
1018
1027
  ), r2 = `${t2 ? `${styleText2("gray", S_BAR)}
1019
1028
  ` : ""}${a2}
1020
- `, o = this.value ?? [], p = (n3, l) => {
1029
+ `, o = this.value ?? [], g = (n3, l) => {
1021
1030
  if (n3.disabled)
1022
1031
  return u3(n3, "disabled");
1023
1032
  const s = o.includes(n3.value);
@@ -1047,7 +1056,7 @@ ${styleText2("gray", S_BAR)}` : ""}`;
1047
1056
  case "error": {
1048
1057
  const n3 = t2 ? `${styleText2("yellow", S_BAR)} ` : "", l = this.error.split(`
1049
1058
  `).map(
1050
- ($, C) => C === 0 ? `${t2 ? `${styleText2("yellow", S_BAR_END)} ` : ""}${styleText2("yellow", $)}` : ` ${$}`
1059
+ ($, v) => v === 0 ? `${t2 ? `${styleText2("yellow", S_BAR_END)} ` : ""}${styleText2("yellow", $)}` : ` ${$}`
1051
1060
  ).join(`
1052
1061
  `), s = r2.split(`
1053
1062
  `).length, h2 = l.split(`
@@ -1059,7 +1068,7 @@ ${styleText2("gray", S_BAR)}` : ""}`;
1059
1068
  maxItems: i2.maxItems,
1060
1069
  columnPadding: n3.length,
1061
1070
  rowPadding: s + h2,
1062
- style: p
1071
+ style: g
1063
1072
  }).join(`
1064
1073
  ${n3}`)}
1065
1074
  ${l}
@@ -1067,7 +1076,7 @@ ${l}
1067
1076
  }
1068
1077
  default: {
1069
1078
  const n3 = t2 ? `${styleText2("cyan", S_BAR)} ` : "", l = r2.split(`
1070
- `).length, s = v ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, t2) : t2 ? [styleText2("cyan", S_BAR_END)] : [], h2 = s.join(`
1079
+ `).length, s = x ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, t2) : t2 ? [styleText2("cyan", S_BAR_END)] : [], h2 = s.join(`
1071
1080
  `), $ = s.length + 1;
1072
1081
  return `${r2}${n3}${limitOptions({
1073
1082
  output: i2.output,
@@ -1076,7 +1085,7 @@ ${l}
1076
1085
  maxItems: i2.maxItems,
1077
1086
  columnPadding: n3.length,
1078
1087
  rowPadding: l + $,
1079
- style: p
1088
+ style: g
1080
1089
  }).join(`
1081
1090
  ${n3}`)}
1082
1091
  ${h2}
@@ -1201,19 +1210,19 @@ ${styleText2("gray", S_BAR)}` : ""}`;
1201
1210
  }
1202
1211
  default: {
1203
1212
  const r2 = n3 ? `${styleText2("cyan", S_BAR)} ` : "", a2 = u3.split(`
1204
- `).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], b = p.join(`
1205
- `), f = p.length + 1;
1213
+ `).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], f = p.join(`
1214
+ `), b = p.length + 1;
1206
1215
  return `${u3}${r2}${limitOptions({
1207
1216
  output: t2.output,
1208
1217
  cursor: this.cursor,
1209
1218
  options: this.options,
1210
1219
  maxItems: t2.maxItems,
1211
1220
  columnPadding: r2.length,
1212
- rowPadding: a2 + f,
1221
+ rowPadding: a2 + b,
1213
1222
  style: (g, x) => o(g, g.disabled ? "disabled" : x ? "active" : "inactive")
1214
1223
  }).join(`
1215
1224
  ${r2}`)}
1216
- ${b}
1225
+ ${f}
1217
1226
  `;
1218
1227
  }
1219
1228
  }
@@ -5849,9 +5858,9 @@ var require_reusify = __commonJS({
5849
5858
  }
5850
5859
  });
5851
5860
 
5852
- // node_modules/.bun/fastq@1.20.1/node_modules/fastq/queue.js
5861
+ // node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js
5853
5862
  var require_queue = __commonJS({
5854
- "node_modules/.bun/fastq@1.20.1/node_modules/fastq/queue.js"(exports, module) {
5863
+ "node_modules/.bun/fastq@1.20.3/node_modules/fastq/queue.js"(exports, module) {
5855
5864
  "use strict";
5856
5865
  init_utils2();
5857
5866
  var reusify = require_reusify();
@@ -6031,11 +6040,12 @@ var require_queue = __commonJS({
6031
6040
  current.value = null;
6032
6041
  current.callback = noop;
6033
6042
  current.errorHandler = null;
6043
+ current.next = null;
6034
6044
  if (errorHandler2) {
6035
6045
  errorHandler2(new Error("abort"), val);
6036
6046
  }
6037
6047
  callback.call(context2, new Error("abort"));
6038
- current.release(current);
6048
+ cache.release(current);
6039
6049
  current = next;
6040
6050
  }
6041
6051
  self.drain = noop;
@@ -7501,7 +7511,7 @@ import {
7501
7511
  sep,
7502
7512
  extname
7503
7513
  } from "node:path";
7504
- import "node:url";
7514
+ import { fileURLToPath } from "node:url";
7505
7515
  function safeExecuteAsync(fn, message) {
7506
7516
  return fn().catch((error2) => {
7507
7517
  throw new Error(
@@ -7558,6 +7568,7 @@ var init_PathResolver = __esm({
7558
7568
  options;
7559
7569
  _repoRoot;
7560
7570
  _appRoot = null;
7571
+ _writtenPaths = null;
7561
7572
  /**
7562
7573
  * Get or create singleton instance
7563
7574
  * @param options - Configuration options
@@ -7876,16 +7887,17 @@ var init_PathResolver = __esm({
7876
7887
  }
7877
7888
  const detectedFormat = this._detectFormat(filePath, format);
7878
7889
  let writeContent;
7879
- if (Buffer.isBuffer(content)) {
7890
+ if (Buffer2.isBuffer(content)) {
7880
7891
  writeContent = content;
7881
7892
  } else if (detectedFormat === "json" && typeof content === "object") {
7882
- writeContent = JSON.stringify(content, null, 2);
7893
+ writeContent = `${JSON.stringify(content, null, 2)}
7894
+ `;
7883
7895
  } else {
7884
7896
  writeContent = String(content);
7885
7897
  }
7886
7898
  try {
7887
7899
  return await safeExecuteAsync(async () => {
7888
- if (Buffer.isBuffer(writeContent)) {
7900
+ if (Buffer2.isBuffer(writeContent)) {
7889
7901
  await fs.promises.writeFile(normalizedPath, writeContent);
7890
7902
  } else {
7891
7903
  await fs.promises.writeFile(normalizedPath, writeContent, "utf8");
@@ -7937,19 +7949,21 @@ var init_PathResolver = __esm({
7937
7949
  }
7938
7950
  const detectedFormat = this._detectFormat(filePath, format);
7939
7951
  let writeContent;
7940
- if (Buffer.isBuffer(content)) {
7952
+ if (Buffer2.isBuffer(content)) {
7941
7953
  writeContent = content;
7942
7954
  } else if (detectedFormat === "json" && typeof content === "object") {
7943
- writeContent = JSON.stringify(content, null, 2);
7955
+ writeContent = `${JSON.stringify(content, null, 2)}
7956
+ `;
7944
7957
  } else {
7945
7958
  writeContent = String(content);
7946
7959
  }
7947
7960
  try {
7948
- if (Buffer.isBuffer(writeContent)) {
7961
+ if (Buffer2.isBuffer(writeContent)) {
7949
7962
  fs.writeFileSync(normalizedPath, writeContent);
7950
7963
  } else {
7951
7964
  fs.writeFileSync(normalizedPath, writeContent, "utf8");
7952
7965
  }
7966
+ this._writtenPaths?.add(normalizedPath);
7953
7967
  if (verbose) {
7954
7968
  log3.info(
7955
7969
  `${fileExists ? "Updated" : "Created"} file: ${normalizedPath}`
@@ -8034,6 +8048,7 @@ var init_PathResolver = __esm({
8034
8048
  }
8035
8049
  try {
8036
8050
  fs.copyFileSync(srcPath, normalizedDestPath);
8051
+ this._writtenPaths?.add(normalizedDestPath);
8037
8052
  if (verbose) {
8038
8053
  log3.info(
8039
8054
  `${fileExists ? "Updated" : "Created"} file: ${normalizedDestPath}`
@@ -8101,6 +8116,24 @@ var init_PathResolver = __esm({
8101
8116
  return null;
8102
8117
  }
8103
8118
  }
8119
+ /**
8120
+ * Resolve the real path of a file, following symlinks
8121
+ * @param filePath - Path to resolve
8122
+ * @returns Resolved real path
8123
+ */
8124
+ realpathSync(filePath) {
8125
+ return fs.realpathSync(filePath);
8126
+ }
8127
+ /**
8128
+ * Watch a directory for changes
8129
+ * @param dirPath - Directory to watch
8130
+ * @param options - fs.watch options
8131
+ * @param callback - Callback for change events
8132
+ * @returns FSWatcher instance
8133
+ */
8134
+ watch(dirPath, options, callback) {
8135
+ return fs.watch(dirPath, options, callback);
8136
+ }
8104
8137
  /**
8105
8138
  * Get file stats synchronously (follows symlinks)
8106
8139
  * Returns null if file doesn't exist (graceful degradation)
@@ -8180,6 +8213,28 @@ var init_PathResolver = __esm({
8180
8213
  * Get app root (where vite.config.ts is, Vite's config.root)
8181
8214
  * Falls back to repoRoot if not set
8182
8215
  */
8216
+ /**
8217
+ * Start recording every path written by writeSync/copySync.
8218
+ * Lets a generator know exactly which files the current run produced,
8219
+ * without comparing file timestamps to a clock.
8220
+ */
8221
+ startWriteRecording() {
8222
+ this._writtenPaths = /* @__PURE__ */ new Set();
8223
+ }
8224
+ /**
8225
+ * Stop recording and return the normalized paths written since
8226
+ * startWriteRecording().
8227
+ */
8228
+ stopWriteRecording() {
8229
+ if (!this._writtenPaths) {
8230
+ throw new Error(
8231
+ "stopWriteRecording() called without startWriteRecording()"
8232
+ );
8233
+ }
8234
+ const written = this._writtenPaths;
8235
+ this._writtenPaths = null;
8236
+ return written;
8237
+ }
8183
8238
  getAppRoot() {
8184
8239
  if (!this._appRoot) {
8185
8240
  return this._repoRoot;
@@ -8437,6 +8492,15 @@ var init_PathResolver = __esm({
8437
8492
  const cjsPath = this.getEmptyCjsModulePath();
8438
8493
  return cjsPath.replace(/\.cjs$/, ".js");
8439
8494
  }
8495
+ /**
8496
+ * Get absolute path to empty flag component module.
8497
+ * Returns `export default () => null;` — used by flag filtering plugins
8498
+ * to replace unused flag files at build time.
8499
+ */
8500
+ getEmptyFlagModulePath() {
8501
+ const __dirname2 = dirname2(fileURLToPath(import.meta.url));
8502
+ return this.normalizePath(resolve(__dirname2, "emptyFlag.js"));
8503
+ }
8440
8504
  /**
8441
8505
  * Get absolute path to empty CJS module for esbuild pre-bundling.
8442
8506
  * CJS because esbuild statically analyzes ESM exports — CJS has dynamic
@@ -8581,7 +8645,7 @@ var init_typed_file_operations = __esm({
8581
8645
  });
8582
8646
 
8583
8647
  // packages/tooling/src/bundler/utils.ts
8584
- import { Buffer } from "node:buffer";
8648
+ import { Buffer as Buffer2 } from "node:buffer";
8585
8649
  import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
8586
8650
  import { createRequire as createRequire3 } from "node:module";
8587
8651
  import { dirname as dirname4, resolve as resolve3 } from "node:path";
@@ -8598,7 +8662,7 @@ var init_utils2 = __esm({
8598
8662
  globalThis.require = require2;
8599
8663
  globalThis.__filename = __filename;
8600
8664
  globalThis.__dirname = __dirname;
8601
- globalThis.Buffer = Buffer;
8665
+ globalThis.Buffer = Buffer2;
8602
8666
  globalThis.process = process;
8603
8667
  if (typeof global === "undefined") {
8604
8668
  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
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
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
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
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.0/node_modules/@clack/core/dist/index.mjs
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.0/node_modules/@clack/core/dist/index.mjs"() {
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.0/node_modules/@clack/prompts/dist/index.mjs
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.0/node_modules/@clack/prompts/dist/index.mjs"() {
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.1/node_modules/fastq/queue.js
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.1/node_modules/fastq/queue.js"(exports, module) {
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
- current.release(current);
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 (Buffer.isBuffer(content)) {
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 (Buffer.isBuffer(writeContent)) {
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 (Buffer.isBuffer(content)) {
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 (Buffer.isBuffer(writeContent)) {
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
@@ -7612,7 +7676,7 @@ var init_pathResolver = __esm({
7612
7676
  });
7613
7677
 
7614
7678
  // packages/tooling/src/bundler/utils.ts
7615
- import { Buffer } from "node:buffer";
7679
+ import { Buffer as Buffer2 } from "node:buffer";
7616
7680
  import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
7617
7681
  import { createRequire as createRequire3 } from "node:module";
7618
7682
  import { dirname as dirname4, resolve as resolve3 } from "node:path";
@@ -7629,7 +7693,7 @@ var init_utils2 = __esm({
7629
7693
  globalThis.require = require2;
7630
7694
  globalThis.__filename = __filename;
7631
7695
  globalThis.__dirname = __dirname;
7632
- globalThis.Buffer = Buffer;
7696
+ globalThis.Buffer = Buffer2;
7633
7697
  globalThis.process = process;
7634
7698
  if (typeof global === "undefined") {
7635
7699
  globalThis.global = globalThis;