@donotdev/cli 0.2.2 → 0.3.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 (64) hide show
  1. package/dependencies-matrix.json +44 -42
  2. package/dist/bin/commands/agent-setup.js +135 -67
  3. package/dist/bin/commands/build.js +352 -234
  4. package/dist/bin/commands/bump.js +385 -257
  5. package/dist/bin/commands/cacheout.js +59 -49
  6. package/dist/bin/commands/coach.js +80 -50
  7. package/dist/bin/commands/create-app.js +501 -228
  8. package/dist/bin/commands/create-project.js +377 -241
  9. package/dist/bin/commands/db-check.js +192804 -0
  10. package/dist/bin/commands/db.js +1889 -1805
  11. package/dist/bin/commands/deploy.js +476 -287
  12. package/dist/bin/commands/dev.js +139 -108
  13. package/dist/bin/commands/doctor.js +91 -57
  14. package/dist/bin/commands/emu.js +196 -154
  15. package/dist/bin/commands/format.js +83 -50
  16. package/dist/bin/commands/get-demo.js +422 -197
  17. package/dist/bin/commands/make-admin.js +835 -713
  18. package/dist/bin/commands/preview.js +139 -108
  19. package/dist/bin/commands/seed.js +2186 -2044
  20. package/dist/bin/commands/setup-cicd.js +258 -204
  21. package/dist/bin/commands/setup.js +890 -339
  22. package/dist/bin/commands/staging.js +476 -287
  23. package/dist/bin/commands/sync-secrets.js +472 -141
  24. package/dist/bin/commands/type-check.js +163 -119
  25. package/dist/bin/commands/wai.js +53 -46
  26. package/dist/bin/dndev.js +32 -7
  27. package/dist/bin/donotdev.js +18 -8
  28. package/dist/index.js +654 -375
  29. package/package.json +2 -2
  30. package/templates/app-demo/index.html.example +1 -1
  31. package/templates/app-dndev/index.html.example +1 -1
  32. package/templates/app-dndev/src/globals.css.example +1 -1
  33. package/templates/app-dndev/src/pages/legal/LegalNoticePage.tsx.example +1 -1
  34. package/templates/app-dndev/src/pages/legal/PrivacyPage.tsx.example +1 -1
  35. package/templates/app-dndev/src/pages/legal/TermsPage.tsx.example +1 -1
  36. package/templates/app-next/src/app/AppDocument.tsx.example +58 -0
  37. package/templates/app-next/src/app/ClientLayout.tsx.example +6 -2
  38. package/templates/app-next/src/globals.css.example +1 -1
  39. package/templates/app-next/src/pages/legal/LegalNoticePage.tsx.example +1 -1
  40. package/templates/app-next/src/pages/legal/PrivacyPage.tsx.example +1 -1
  41. package/templates/app-next/src/pages/legal/TermsPage.tsx.example +1 -1
  42. package/templates/app-vite/csp.example.json +1 -1
  43. package/templates/app-vite/index.html.example +1 -1
  44. package/templates/app-vite/src/globals.css.example +1 -1
  45. package/templates/app-vite/src/pages/FormPageExample.tsx.example +21 -16
  46. package/templates/app-vite/src/pages/legal/LegalNoticePage.tsx.example +1 -1
  47. package/templates/app-vite/src/pages/legal/PrivacyPage.tsx.example +1 -1
  48. package/templates/app-vite/src/pages/legal/TermsPage.tsx.example +1 -1
  49. package/templates/deploy-config/vercel.json.example +2 -2
  50. package/templates/functions-supabase/supabase/migrations/20250101000006_crud_bulk_status_guard.sql +258 -0
  51. package/templates/functions-supabase/supabase/migrations/20250101000007_rate_limit_check.sql +76 -0
  52. package/templates/overlay-supabase/src/config/providers.nextjs.ts.example +37 -0
  53. package/templates/root-consumer/.claude/hooks/guard-bash.sh.example +3 -3
  54. package/templates/root-consumer/.claude/hooks/guard-write.sh.example +5 -1
  55. package/templates/root-consumer/.claude/hooks/typecheck-stop.sh.example +2 -2
  56. package/templates/root-consumer/.claude/rules/definition-of-done.md.example +2 -2
  57. package/templates/root-consumer/.claude/rules/framework.md.example +1 -1
  58. package/templates/root-consumer/.claude/skills/build/SKILL.md.example +1 -1
  59. package/templates/root-consumer/.claude/skills/polish/SKILL.md.example +1 -1
  60. package/templates/root-consumer/.gitignore.example +7 -1
  61. package/templates/root-consumer/AGENTS.md.example +25 -2
  62. package/templates/root-consumer/README.md.example +1 -1
  63. package/templates/app-next/src/app/layout.tsx.example +0 -80
  64. package/templates/app-next/src/app/not-found.tsx.example +0 -40
@@ -405,25 +405,29 @@ var init_main = __esm({
405
405
  }
406
406
  });
407
407
 
408
- // node_modules/.bun/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
409
- var require_src = __commonJS({
410
- "node_modules/.bun/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports, module) {
411
- "use strict";
408
+ // node_modules/.bun/sisteransi@2.0.0/node_modules/sisteransi/dist/index.js
409
+ var ESC2, CSI2, cursor, erase, clear;
410
+ var init_dist3 = __esm({
411
+ "node_modules/.bun/sisteransi@2.0.0/node_modules/sisteransi/dist/index.js"() {
412
412
  init_utils2();
413
- var ESC2 = "\x1B";
414
- var CSI2 = `${ESC2}[`;
415
- var beep = "\x07";
416
- var cursor3 = {
417
- to(x, y2) {
418
- if (!y2) return `${CSI2}${x + 1}G`;
419
- return `${CSI2}${y2 + 1};${x + 1}H`;
413
+ ESC2 = "\x1B";
414
+ CSI2 = `${ESC2}[`;
415
+ cursor = {
416
+ to(x, y) {
417
+ if (!y)
418
+ return `${CSI2}${x + 1}G`;
419
+ return `${CSI2}${y + 1};${x + 1}H`;
420
420
  },
421
- move(x, y2) {
421
+ move(x, y) {
422
422
  let ret = "";
423
- if (x < 0) ret += `${CSI2}${-x}D`;
424
- else if (x > 0) ret += `${CSI2}${x}C`;
425
- if (y2 < 0) ret += `${CSI2}${-y2}A`;
426
- else if (y2 > 0) ret += `${CSI2}${y2}B`;
423
+ if (x < 0)
424
+ ret += `${CSI2}${-x}D`;
425
+ else if (x > 0)
426
+ ret += `${CSI2}${x}C`;
427
+ if (y < 0)
428
+ ret += `${CSI2}${-y}A`;
429
+ else if (y > 0)
430
+ ret += `${CSI2}${y}B`;
427
431
  return ret;
428
432
  },
429
433
  up: (count = 1) => `${CSI2}${count}A`,
@@ -438,11 +442,7 @@ var require_src = __commonJS({
438
442
  save: `${ESC2}7`,
439
443
  restore: `${ESC2}8`
440
444
  };
441
- var scroll = {
442
- up: (count = 1) => `${CSI2}S`.repeat(count),
443
- down: (count = 1) => `${CSI2}T`.repeat(count)
444
- };
445
- var erase3 = {
445
+ erase = {
446
446
  screen: `${CSI2}2J`,
447
447
  up: (count = 1) => `${CSI2}1J`.repeat(count),
448
448
  down: (count = 1) => `${CSI2}J`.repeat(count),
@@ -450,28 +450,30 @@ var require_src = __commonJS({
450
450
  lineEnd: `${CSI2}K`,
451
451
  lineStart: `${CSI2}1K`,
452
452
  lines(count) {
453
- let clear = "";
453
+ let clear2 = "";
454
454
  for (let i2 = 0; i2 < count; i2++)
455
- clear += this.line + (i2 < count - 1 ? cursor3.up() : "");
455
+ clear2 += this.line + (i2 < count - 1 ? cursor.up() : "");
456
456
  if (count)
457
- clear += cursor3.left;
458
- return clear;
457
+ clear2 += cursor.left;
458
+ return clear2;
459
459
  }
460
460
  };
461
- module.exports = { cursor: cursor3, scroll, erase: erase3, beep };
461
+ clear = {
462
+ screen: `${ESC2}c`
463
+ };
462
464
  }
463
465
  });
464
466
 
465
- // node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs
467
+ // node_modules/.bun/@clack+core@1.6.0/node_modules/@clack/core/dist/index.mjs
466
468
  import { styleText } from "node:util";
467
469
  import { stdout, stdin } from "node:process";
468
- import l__default from "node:readline";
470
+ import f__default from "node:readline";
469
471
  import { ReadStream } from "node:tty";
470
- function findCursor(s, o, l) {
472
+ function findCursor(o, s, l) {
471
473
  if (!l.some((r2) => !r2.disabled))
472
- return s;
473
- const t2 = s + o, n3 = Math.max(l.length - 1, 0), e = t2 < 0 ? n3 : t2 > n3 ? 0 : t2;
474
- return l[e]?.disabled ? findCursor(e, o < 0 ? -1 : 1, l) : e;
474
+ return o;
475
+ const t2 = o + s, n3 = Math.max(l.length - 1, 0), e = t2 < 0 ? n3 : t2 > n3 ? 0 : t2;
476
+ return l[e]?.disabled ? findCursor(e, s < 0 ? -1 : 1, l) : e;
475
477
  }
476
478
  function isAccessible(n3) {
477
479
  if (n3 !== void 0) return n3;
@@ -506,14 +508,14 @@ function setRawMode(e, r2) {
506
508
  o.isTTY && o.setRawMode(r2);
507
509
  }
508
510
  function wrapTextWithPrefix(e, r2, o, n3 = o, s = o, t2) {
509
- const f = getColumns(e ?? stdout);
510
- return wrapAnsi(r2, f - o.length, {
511
+ const l = getColumns(e ?? stdout), i2 = dist_default2(o);
512
+ return wrapAnsi(r2, l - i2, {
511
513
  hard: true,
512
514
  trim: false
513
515
  }).split(`
514
- `).map((c2, i2, m) => {
515
- const d = t2 ? t2(c2, i2) : c2;
516
- return i2 === 0 ? `${n3}${d}` : i2 === m.length - 1 ? `${s}${d}` : `${o}${d}`;
516
+ `).map((c3, a2, g) => {
517
+ const m = t2 ? t2(c3, a2) : c3;
518
+ return a2 === 0 ? `${n3}${m}` : a2 === g.length - 1 ? `${s}${m}` : `${o}${m}`;
517
519
  }).join(`
518
520
  `);
519
521
  }
@@ -524,12 +526,13 @@ function runValidation(e, a2) {
524
526
  }
525
527
  return e(a2);
526
528
  }
527
- var import_sisteransi, a$1, t, settings, R, CANCEL_SYMBOL, getColumns, getRows, y, n$1;
528
- var init_dist3 = __esm({
529
- "node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs"() {
529
+ var a$1, t, settings, R, CANCEL_SYMBOL, getColumns, getRows, C$1, n$1;
530
+ var init_dist4 = __esm({
531
+ "node_modules/.bun/@clack+core@1.6.0/node_modules/@clack/core/dist/index.mjs"() {
530
532
  init_utils2();
531
533
  init_main();
532
- import_sisteransi = __toESM(require_src(), 1);
534
+ init_dist3();
535
+ init_dist2();
533
536
  a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
534
537
  t = [
535
538
  "January",
@@ -578,7 +581,7 @@ var init_dist3 = __esm({
578
581
  CANCEL_SYMBOL = /* @__PURE__ */ Symbol("clack:cancel");
579
582
  getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
580
583
  getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
581
- y = class {
584
+ C$1 = class C {
582
585
  input;
583
586
  output;
584
587
  _abortSignal;
@@ -660,16 +663,16 @@ var init_dist3 = __esm({
660
663
  { once: true }
661
664
  );
662
665
  }
663
- this.rl = l__default.createInterface({
666
+ this.rl = f__default.createInterface({
664
667
  input: this.input,
665
668
  tabSize: 2,
666
669
  prompt: "",
667
670
  escapeCodeTimeout: 50,
668
671
  terminal: true
669
672
  }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), setRawMode(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
670
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(this.value);
673
+ this.output.write(cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(this.value);
671
674
  }), this.once("cancel", () => {
672
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(CANCEL_SYMBOL);
675
+ this.output.write(cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(CANCEL_SYMBOL);
673
676
  });
674
677
  });
675
678
  }
@@ -706,18 +709,18 @@ var init_dist3 = __esm({
706
709
  `), setRawMode(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
707
710
  }
708
711
  restoreCursor() {
709
- const t2 = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
712
+ const t2 = wrapAnsi(this._prevFrame, getColumns(this.output), { hard: true, trim: false }).split(`
710
713
  `).length - 1;
711
- this.output.write(import_sisteransi.cursor.move(-999, t2 * -1));
714
+ this.output.write(cursor.move(-999, t2 * -1));
712
715
  }
713
716
  render() {
714
- const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
717
+ const t2 = wrapAnsi(this._render(this) ?? "", getColumns(this.output), {
715
718
  hard: true,
716
719
  trim: false
717
720
  });
718
721
  if (t2 !== this._prevFrame) {
719
722
  if (this.state === "initial")
720
- this.output.write(import_sisteransi.cursor.hide);
723
+ this.output.write(cursor.hide);
721
724
  else {
722
725
  const e = diffLines(this._prevFrame, t2), i2 = getRows(this.output);
723
726
  if (this.restoreCursor(), e) {
@@ -728,33 +731,33 @@ var init_dist3 = __esm({
728
731
  return;
729
732
  }
730
733
  if (e.lines.length === 1) {
731
- this.output.write(import_sisteransi.cursor.move(0, n3 - r2)), this.output.write(import_sisteransi.erase.lines(1));
734
+ this.output.write(cursor.move(0, n3 - r2)), this.output.write(erase.lines(1));
732
735
  const o = t2.split(`
733
736
  `);
734
- this.output.write(o[n3]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, o.length - n3 - 1));
737
+ this.output.write(o[n3]), this._prevFrame = t2, this.output.write(cursor.move(0, o.length - n3 - 1));
735
738
  return;
736
739
  } else if (e.lines.length > 1) {
737
740
  if (s < r2)
738
741
  n3 = s;
739
742
  else {
740
743
  const h2 = n3 - r2;
741
- h2 > 0 && this.output.write(import_sisteransi.cursor.move(0, h2));
744
+ h2 > 0 && this.output.write(cursor.move(0, h2));
742
745
  }
743
- this.output.write(import_sisteransi.erase.down());
744
- const f = t2.split(`
746
+ this.output.write(erase.down());
747
+ const m = t2.split(`
745
748
  `).slice(n3);
746
- this.output.write(f.join(`
749
+ this.output.write(m.join(`
747
750
  `)), this._prevFrame = t2;
748
751
  return;
749
752
  }
750
753
  }
751
- this.output.write(import_sisteransi.erase.down());
754
+ this.output.write(erase.down());
752
755
  }
753
756
  this.output.write(t2), this.state === "initial" && (this.state = "active"), this._prevFrame = t2;
754
757
  }
755
758
  }
756
759
  };
757
- n$1 = class n extends y {
760
+ n$1 = class n extends C$1 {
758
761
  options;
759
762
  cursor = 0;
760
763
  get _selectedValue() {
@@ -785,7 +788,7 @@ var init_dist3 = __esm({
785
788
  }
786
789
  });
787
790
 
788
- // node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs
791
+ // node_modules/.bun/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.mjs
789
792
  import { styleText as styleText2, stripVTControlCharacters } from "node:util";
790
793
  import process$1 from "node:process";
791
794
  import { existsSync, lstatSync, readdirSync } from "node:fs";
@@ -796,21 +799,22 @@ function isUnicodeSupported() {
796
799
  }
797
800
  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";
798
801
  }
799
- function formatInstructionFooter(o, e) {
800
- const r2 = [`${e ? `${styleText2("cyan", S_BAR)} ` : ""}${o.join(" \u2022 ")}`];
801
- return e && r2.push(styleText2("cyan", S_BAR_END)), r2;
802
+ function formatInstructionFooter(e, o, r2) {
803
+ const s = r2 ? `${styleText2("cyan", S_BAR)} ` : "", n3 = wrapTextWithPrefix(e, o.join(" \u2022 "), s).split(`
804
+ `);
805
+ return r2 && n3.push(styleText2("cyan", S_BAR_END)), n3;
802
806
  }
803
- 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, log, u2, SELECT_INSTRUCTIONS, c, select, i;
804
- var init_dist4 = __esm({
805
- "node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs"() {
807
+ var 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, E$1, limitOptions, MULTISELECT_INSTRUCTIONS, log, u2, SELECT_INSTRUCTIONS, c2, select, i;
808
+ var init_dist5 = __esm({
809
+ "node_modules/.bun/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.mjs"() {
806
810
  init_utils2();
807
- init_dist3();
808
- init_dist3();
811
+ init_dist4();
812
+ init_dist4();
809
813
  init_main();
810
814
  init_dist2();
811
- import_sisteransi2 = __toESM(require_src(), 1);
815
+ init_dist3();
812
816
  unicode = isUnicodeSupported();
813
- unicodeOr = (o, e) => unicode ? o : e;
817
+ unicodeOr = (e, o) => unicode ? e : o;
814
818
  S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
815
819
  S_STEP_CANCEL = unicodeOr("\u25A0", "x");
816
820
  S_STEP_ERROR = unicodeOr("\u25B2", "x");
@@ -836,8 +840,8 @@ var init_dist4 = __esm({
836
840
  S_SUCCESS = unicodeOr("\u25C6", "*");
837
841
  S_WARN = unicodeOr("\u25B2", "!");
838
842
  S_ERROR = unicodeOr("\u25A0", "x");
839
- symbol = (o) => {
840
- switch (o) {
843
+ symbol = (e) => {
844
+ switch (e) {
841
845
  case "initial":
842
846
  case "active":
843
847
  return styleText2("cyan", S_STEP_ACTIVE);
@@ -851,8 +855,8 @@ var init_dist4 = __esm({
851
855
  return styleText2("dim", S_STEP_ACTIVE);
852
856
  }
853
857
  };
854
- symbolBar = (o) => {
855
- switch (o) {
858
+ symbolBar = (e) => {
859
+ switch (e) {
856
860
  case "initial":
857
861
  case "active":
858
862
  return styleText2("cyan", S_BAR);
@@ -864,9 +868,9 @@ var init_dist4 = __esm({
864
868
  return styleText2("green", S_BAR);
865
869
  }
866
870
  };
867
- I = (l, e, w, p, b, C = false) => {
871
+ E$1 = (l, e, w, p, b, C2 = false) => {
868
872
  let r2 = e, O = 0;
869
- if (C)
873
+ if (C2)
870
874
  for (let i2 = p - 1; i2 >= w; i2--) {
871
875
  const m = l[i2];
872
876
  if (m && (r2 -= m.length), O++, r2 <= b) break;
@@ -884,25 +888,25 @@ var init_dist4 = __esm({
884
888
  style: w,
885
889
  output: p = process.stdout,
886
890
  maxItems: b = Number.POSITIVE_INFINITY,
887
- columnPadding: C = 0,
891
+ columnPadding: C2 = 0,
888
892
  rowPadding: r2 = 4
889
893
  }) => {
890
- const i2 = getColumns(p) - C, m = getRows(p), M = styleText2("dim", "..."), v = Math.max(m - r2, 0), a2 = Math.max(Math.min(b, v), 5);
894
+ const i2 = getColumns(p) - C2, m = getRows(p), M = styleText2("dim", "..."), v = Math.max(m - r2, 0), a2 = Math.max(Math.min(b, v), 5);
891
895
  let f = 0;
892
896
  l >= a2 - 3 && (f = Math.max(
893
897
  Math.min(l - a2 + 3, e.length - a2),
894
898
  0
895
899
  ));
896
- let d = a2 < e.length && f > 0, c2 = a2 < e.length && f + a2 < e.length;
897
- const W = Math.min(
900
+ let d = a2 < e.length && f > 0, c3 = a2 < e.length && f + a2 < e.length;
901
+ const I = Math.min(
898
902
  f + a2,
899
903
  e.length
900
904
  ), s = [];
901
905
  let g = 0;
902
- d && g++, c2 && g++;
903
- const T = f + (d ? 1 : 0), y2 = W - (c2 ? 1 : 0);
904
- for (let t2 = T; t2 < y2; t2++) {
905
- const n3 = e[t2], o = n3 ? w(n3, t2 === l) : "", h2 = wrapAnsi(o, i2, {
906
+ d && g++, c3 && g++;
907
+ const T = f + (d ? 1 : 0), W = I - (c3 ? 1 : 0);
908
+ for (let t2 = T; t2 < W; t2++) {
909
+ const n3 = e[t2], o = n3 !== void 0 ? w(n3, t2 === l) : "", h2 = wrapAnsi(o, i2, {
906
910
  hard: true,
907
911
  trim: false
908
912
  }).split(`
@@ -913,7 +917,7 @@ var init_dist4 = __esm({
913
917
  let t2 = 0, n3 = 0, o = g;
914
918
  const h2 = l - T;
915
919
  let u3 = v;
916
- const L = () => I(s, o, 0, h2, u3), E = () => I(
920
+ const L = () => E$1(s, o, 0, h2, u3), y = () => E$1(
917
921
  s,
918
922
  o,
919
923
  h2 + 1,
@@ -921,14 +925,14 @@ var init_dist4 = __esm({
921
925
  u3,
922
926
  true
923
927
  );
924
- d ? ({ lineCount: o, removals: t2 } = L(), o > u3 && (c2 || (u3 -= 1), { lineCount: o, removals: n3 } = E())) : (c2 || (u3 -= 1), { lineCount: o, removals: n3 } = E(), o > u3 && (u3 -= 1, { lineCount: o, removals: t2 } = L())), t2 > 0 && (d = true, s.splice(0, t2)), n3 > 0 && (c2 = true, s.splice(s.length - n3, n3));
928
+ d ? ({ lineCount: o, removals: t2 } = L(), o > u3 && (c3 || (u3 -= 1), { lineCount: o, removals: n3 } = y())) : (c3 || (u3 -= 1), { lineCount: o, removals: n3 } = y(), o > u3 && (u3 -= 1, { lineCount: o, removals: t2 } = L())), t2 > 0 && (d = true, s.splice(0, t2)), n3 > 0 && (c3 = true, s.splice(s.length - n3, n3));
925
929
  }
926
930
  const x = [];
927
931
  d && x.push(M);
928
932
  for (const t2 of s)
929
933
  for (const n3 of t2)
930
934
  x.push(n3);
931
- return c2 && x.push(M), x;
935
+ return c3 && x.push(M), x;
932
936
  };
933
937
  MULTISELECT_INSTRUCTIONS = [
934
938
  `${styleText2("dim", "\u2191/\u2193")} to navigate`,
@@ -941,17 +945,17 @@ var init_dist4 = __esm({
941
945
  secondarySymbol: r2 = styleText2("gray", S_BAR),
942
946
  output: m = process.stdout,
943
947
  spacing: l = 1,
944
- withGuide: c2
948
+ withGuide: c3
945
949
  } = {}) => {
946
- const t2 = [], o = c2 ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
950
+ const t2 = [], o = c3 ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
947
951
  for (let i2 = 0; i2 < l; i2++)
948
952
  t2.push(f);
949
953
  const g = Array.isArray(s) ? s : s.split(`
950
954
  `);
951
955
  if (g.length > 0) {
952
- const [i2, ...y2] = g;
956
+ const [i2, ...y] = g;
953
957
  i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
954
- for (const p of y2)
958
+ for (const p of y)
955
959
  p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
956
960
  }
957
961
  m.write(`${t2.join(`
@@ -987,7 +991,7 @@ var init_dist4 = __esm({
987
991
  `${styleText2("dim", "\u2191/\u2193")} to navigate`,
988
992
  `${styleText2("dim", "Enter:")} confirm`
989
993
  ];
990
- c = (t2, o) => t2.includes(`
994
+ c2 = (t2, o) => t2.includes(`
991
995
  `) ? t2.split(`
992
996
  `).map((d) => o(d)).join(`
993
997
  `) : o(t2);
@@ -998,15 +1002,15 @@ var init_dist4 = __esm({
998
1002
  const s = n3.label ?? String(n3.value);
999
1003
  switch (m) {
1000
1004
  case "disabled":
1001
- return `${styleText2("gray", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("gray", i2))}${n3.hint ? ` ${styleText2("dim", `(${n3.hint ?? "disabled"})`)}` : ""}`;
1005
+ return `${styleText2("gray", S_RADIO_INACTIVE)} ${c2(s, (i2) => styleText2("gray", i2))}${n3.hint ? ` ${styleText2("dim", `(${n3.hint ?? "disabled"})`)}` : ""}`;
1002
1006
  case "selected":
1003
- return `${c(s, (i2) => styleText2("dim", i2))}`;
1007
+ return `${c2(s, (i2) => styleText2("dim", i2))}`;
1004
1008
  case "active":
1005
1009
  return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${n3.hint ? ` ${styleText2("dim", `(${n3.hint})`)}` : ""}`;
1006
1010
  case "cancelled":
1007
- return `${c(s, (i2) => styleText2(["strikethrough", "dim"], i2))}`;
1011
+ return `${c2(s, (i2) => styleText2(["strikethrough", "dim"], i2))}`;
1008
1012
  default:
1009
- return `${styleText2("dim", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("dim", i2))}`;
1013
+ return `${styleText2("dim", S_RADIO_INACTIVE)} ${c2(s, (i2) => styleText2("dim", i2))}`;
1010
1014
  }
1011
1015
  }, d = t2.showInstructions ?? true;
1012
1016
  return new n$1({
@@ -1044,7 +1048,7 @@ ${styleText2("gray", S_BAR)}` : ""}`;
1044
1048
  }
1045
1049
  default: {
1046
1050
  const r2 = n3 ? `${styleText2("cyan", S_BAR)} ` : "", a2 = u3.split(`
1047
- `).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], f = p.join(`
1051
+ `).length, p = d ? formatInstructionFooter(t2.output, SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], f = p.join(`
1048
1052
  `), b = p.length + 1;
1049
1053
  return `${u3}${r2}${limitOptions({
1050
1054
  output: t2.output,
@@ -1113,8 +1117,8 @@ var init_cli_output = __esm({
1113
1117
  "packages/tooling/src/utils/cli-output.ts"() {
1114
1118
  "use strict";
1115
1119
  init_utils2();
1116
- init_dist4();
1117
- init_dist4();
1120
+ init_dist5();
1121
+ init_dist5();
1118
1122
  colors = {
1119
1123
  reset: "\x1B[0m",
1120
1124
  // Success (green)
@@ -1265,7 +1269,7 @@ var init_errors = __esm({
1265
1269
  * @param {DoNotDevErrorCode} code - Error code
1266
1270
  * @param {object} [options] - Additional error options
1267
1271
  * @param {Error} [options.originalError] - Original error if wrapping
1268
- * @param {Record<string, any>} [options.context] - Additional context data
1272
+ * @param {Record<string, unknown>} [options.context] - Additional context data
1269
1273
  * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
1270
1274
  */
1271
1275
  constructor(message, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
@@ -1295,7 +1299,7 @@ var init_errors = __esm({
1295
1299
  * @param {string} [context] - Additional context for the error
1296
1300
  * @param {DoNotDevErrorCode} [code='unknown-error'] - Error code
1297
1301
  * @param {object} [options] - Additional error options
1298
- * @param {Record<string, any>} [options.context] - Additional context data
1302
+ * @param {Record<string, unknown>} [options.context] - Additional context data
1299
1303
  * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
1300
1304
  * @returns {DoNotDevError} New DoNotDev error wrapping the original
1301
1305
  */
@@ -7346,6 +7350,9 @@ import {
7346
7350
  extname
7347
7351
  } from "node:path";
7348
7352
  import { fileURLToPath } from "node:url";
7353
+ function isEexistError(error2) {
7354
+ return typeof error2 === "object" && error2 !== null && "code" in error2 && error2.code === "EEXIST";
7355
+ }
7349
7356
  function safeExecuteAsync(fn, message) {
7350
7357
  return fn().catch((error2) => {
7351
7358
  throw new Error(
@@ -7717,7 +7724,7 @@ var init_PathResolver = __esm({
7717
7724
  try {
7718
7725
  await fs.promises.mkdir(dir, { recursive: true });
7719
7726
  } catch (error2) {
7720
- if (error2?.code !== "EEXIST") throw error2;
7727
+ if (!isEexistError(error2)) throw error2;
7721
7728
  }
7722
7729
  const detectedFormat = this._detectFormat(filePath, format);
7723
7730
  let writeContent;
@@ -7779,7 +7786,7 @@ var init_PathResolver = __esm({
7779
7786
  try {
7780
7787
  fs.mkdirSync(dir, { recursive: true });
7781
7788
  } catch (error2) {
7782
- if (error2?.code !== "EEXIST") throw error2;
7789
+ if (!isEexistError(error2)) throw error2;
7783
7790
  }
7784
7791
  const detectedFormat = this._detectFormat(filePath, format);
7785
7792
  let writeContent;
@@ -7836,7 +7843,7 @@ var init_PathResolver = __esm({
7836
7843
  try {
7837
7844
  await fs.promises.mkdir(dir, { recursive: true });
7838
7845
  } catch (error2) {
7839
- if (error2?.code !== "EEXIST") throw error2;
7846
+ if (!isEexistError(error2)) throw error2;
7840
7847
  }
7841
7848
  try {
7842
7849
  return await safeExecuteAsync(async () => {
@@ -7878,7 +7885,7 @@ var init_PathResolver = __esm({
7878
7885
  try {
7879
7886
  fs.mkdirSync(dir, { recursive: true });
7880
7887
  } catch (error2) {
7881
- if (error2?.code !== "EEXIST") throw error2;
7888
+ if (!isEexistError(error2)) throw error2;
7882
7889
  }
7883
7890
  try {
7884
7891
  fs.copyFileSync(srcPath, normalizedDestPath);
@@ -7994,7 +8001,7 @@ var init_PathResolver = __esm({
7994
8001
  try {
7995
8002
  await fs.promises.mkdir(dirPath, { recursive: true });
7996
8003
  } catch (error2) {
7997
- if (error2?.code !== "EEXIST") throw error2;
8004
+ if (!isEexistError(error2)) throw error2;
7998
8005
  }
7999
8006
  }
8000
8007
  /**
@@ -8006,7 +8013,7 @@ var init_PathResolver = __esm({
8006
8013
  try {
8007
8014
  fs.mkdirSync(dirPath, { recursive: true });
8008
8015
  } catch (error2) {
8009
- if (error2?.code !== "EEXIST") throw error2;
8016
+ if (!isEexistError(error2)) throw error2;
8010
8017
  }
8011
8018
  }
8012
8019
  /**
@@ -8255,6 +8262,7 @@ var init_PathResolver = __esm({
8255
8262
  * @param patternType - Type of patterns (css, routes, i18n, assets, pwa)
8256
8263
  * @returns Resolved patterns with absolute paths
8257
8264
  */
8265
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- why: mirrors the public PathResolver.d.ts signature; tightening it is a breaking change (any-audit)
8258
8266
  async resolvePatterns(patternType) {
8259
8267
  if (!constants.getPatternsFor) {
8260
8268
  return { framework: [], consumer: [], all: [] };
@@ -8409,6 +8417,9 @@ import {
8409
8417
  } from "node:path";
8410
8418
  import { fileURLToPath as fileURLToPath2 } from "node:url";
8411
8419
  function readdirSync3(dirPath, options) {
8420
+ if (options !== null && typeof options === "object" && options.withFileTypes === true) {
8421
+ return pathResolverInstance.readdirSync(dirPath, options);
8422
+ }
8412
8423
  return pathResolverInstance.readdirSync(dirPath, options);
8413
8424
  }
8414
8425
  var pathResolverInstance, getRepoRoot, normalizePath, pathExists, readSync, statSync2, joinPath;
@@ -8459,6 +8470,25 @@ var init_typed_file_operations = __esm({
8459
8470
  }
8460
8471
  });
8461
8472
 
8473
+ // packages/tooling/src/utils/type-guards.ts
8474
+ function requireText(value, filePath) {
8475
+ if (typeof value !== "string") {
8476
+ throw new DoNotDevError(
8477
+ `Cannot read text file: ${filePath}`,
8478
+ DO_NOT_DEV_ERROR_CODES.FILE_NOT_FOUND,
8479
+ { context: { filePath } }
8480
+ );
8481
+ }
8482
+ return value;
8483
+ }
8484
+ var init_type_guards = __esm({
8485
+ "packages/tooling/src/utils/type-guards.ts"() {
8486
+ "use strict";
8487
+ init_utils2();
8488
+ init_errors();
8489
+ }
8490
+ });
8491
+
8462
8492
  // packages/tooling/src/bundler/utils.ts
8463
8493
  import { Buffer as Buffer2 } from "node:buffer";
8464
8494
  import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
@@ -8552,7 +8582,7 @@ function analyzeApp(appPath, appName) {
8552
8582
  try {
8553
8583
  const envPath = joinPath(appPath, ".env");
8554
8584
  if (pathExists(envPath)) {
8555
- const envContent = readSync(envPath);
8585
+ const envContent = requireText(readSync(envPath), envPath);
8556
8586
  if (envContent.match(/VITE_SUPABASE_URL=.+/)) {
8557
8587
  hasSupabase = true;
8558
8588
  }
@@ -8599,7 +8629,7 @@ function analyzeApp(appPath, appName) {
8599
8629
  try {
8600
8630
  const envPath = joinPath(appPath, ".env");
8601
8631
  if (pathExists(envPath)) {
8602
- const envContent = readSync(envPath);
8632
+ const envContent = requireText(readSync(envPath), envPath);
8603
8633
  const urlMatch = envContent.match(/VITE_SUPABASE_URL=(.+)/);
8604
8634
  if (urlMatch && urlMatch[1]) {
8605
8635
  url = urlMatch[1].trim();
@@ -8662,6 +8692,7 @@ var init_app_detection = __esm({
8662
8692
  init_utils2();
8663
8693
  init_pathResolver();
8664
8694
  init_typed_file_operations();
8695
+ init_type_guards();
8665
8696
  }
8666
8697
  });
8667
8698
 
@@ -8703,7 +8734,7 @@ var init_app_selector = __esm({
8703
8734
  "packages/tooling/src/utils/app-selector.ts"() {
8704
8735
  "use strict";
8705
8736
  init_utils2();
8706
- init_dist4();
8737
+ init_dist5();
8707
8738
  init_app_detection();
8708
8739
  init_cli_output();
8709
8740
  }