@donotdev/cli 0.2.1 → 0.2.3

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 (46) hide show
  1. package/dependencies-matrix.json +39 -38
  2. package/dist/bin/commands/agent-setup.js +135 -67
  3. package/dist/bin/commands/build.js +288 -232
  4. package/dist/bin/commands/bump.js +293 -250
  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.js +1873 -1804
  10. package/dist/bin/commands/deploy.js +476 -287
  11. package/dist/bin/commands/dev.js +139 -108
  12. package/dist/bin/commands/doctor.js +91 -57
  13. package/dist/bin/commands/emu.js +196 -154
  14. package/dist/bin/commands/format.js +83 -50
  15. package/dist/bin/commands/get-demo.js +422 -197
  16. package/dist/bin/commands/make-admin.js +813 -707
  17. package/dist/bin/commands/preview.js +139 -108
  18. package/dist/bin/commands/seed.js +1874 -1809
  19. package/dist/bin/commands/setup-cicd.js +258 -204
  20. package/dist/bin/commands/setup.js +346 -247
  21. package/dist/bin/commands/staging.js +476 -287
  22. package/dist/bin/commands/sync-secrets.js +472 -141
  23. package/dist/bin/commands/type-check.js +163 -119
  24. package/dist/bin/commands/wai.js +53 -46
  25. package/dist/bin/dndev.js +10 -1
  26. package/dist/bin/donotdev.js +18 -8
  27. package/dist/index.js +590 -373
  28. package/package.json +2 -2
  29. package/templates/app-dndev/src/pages/legal/LegalNoticePage.tsx.example +1 -1
  30. package/templates/app-dndev/src/pages/legal/PrivacyPage.tsx.example +1 -1
  31. package/templates/app-dndev/src/pages/legal/TermsPage.tsx.example +1 -1
  32. package/templates/app-dndev/src/stores/dndevStore.ts.example +0 -3
  33. package/templates/app-next/src/app/AppDocument.tsx.example +57 -0
  34. package/templates/app-next/src/app/ClientLayout.tsx.example +6 -2
  35. package/templates/app-next/src/pages/legal/LegalNoticePage.tsx.example +1 -1
  36. package/templates/app-next/src/pages/legal/PrivacyPage.tsx.example +1 -1
  37. package/templates/app-next/src/pages/legal/TermsPage.tsx.example +1 -1
  38. package/templates/app-vite/src/pages/FormPageExample.tsx.example +21 -16
  39. package/templates/app-vite/src/pages/legal/LegalNoticePage.tsx.example +1 -1
  40. package/templates/app-vite/src/pages/legal/PrivacyPage.tsx.example +1 -1
  41. package/templates/app-vite/src/pages/legal/TermsPage.tsx.example +1 -1
  42. package/templates/overlay-supabase/src/config/providers.nextjs.ts.example +37 -0
  43. package/templates/root-consumer/.claude/hooks/guard-write.sh.example +5 -1
  44. package/templates/root-consumer/.gitignore.example +7 -1
  45. package/templates/app-next/src/app/layout.tsx.example +0 -80
  46. package/templates/app-next/src/app/not-found.tsx.example +0 -40
@@ -139,7 +139,7 @@ var init_dist = __esm({
139
139
  if (index >= length) {
140
140
  break outer;
141
141
  }
142
- for (let i2 = 0, l2 = PARSE_BLOCKS.length; i2 < l2; i2++) {
142
+ for (let i2 = 0, l = PARSE_BLOCKS.length; i2 < l; i2++) {
143
143
  const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i2];
144
144
  BLOCK_RE.lastIndex = index;
145
145
  if (BLOCK_RE.test(input)) {
@@ -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,29 +450,31 @@ 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 * as l from "node:readline";
469
- import l__default from "node:readline";
470
+ import * as f$1 from "node:readline";
471
+ import f__default from "node:readline";
470
472
  import { ReadStream } from "node:tty";
471
- function findCursor(s, o, l2) {
472
- if (!l2.some((r2) => !r2.disabled))
473
- return s;
474
- const t2 = s + o, n3 = Math.max(l2.length - 1, 0), e = t2 < 0 ? n3 : t2 > n3 ? 0 : t2;
475
- return l2[e]?.disabled ? findCursor(e, o < 0 ? -1 : 1, l2) : e;
473
+ function findCursor(o, s, l) {
474
+ if (!l.some((r2) => !r2.disabled))
475
+ return o;
476
+ const t2 = o + s, n3 = Math.max(l.length - 1, 0), e = t2 < 0 ? n3 : t2 > n3 ? 0 : t2;
477
+ return l[e]?.disabled ? findCursor(e, s < 0 ? -1 : 1, l) : e;
476
478
  }
477
479
  function isAccessible(n3) {
478
480
  if (n3 !== void 0) return n3;
@@ -515,40 +517,40 @@ function block({
515
517
  overwrite: o = true,
516
518
  hideCursor: n3 = true
517
519
  } = {}) {
518
- const s = l.createInterface({
520
+ const s = f$1.createInterface({
519
521
  input: e,
520
522
  output: r2,
521
523
  prompt: "",
522
524
  tabSize: 1
523
525
  });
524
- l.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(true);
525
- const t2 = (f, { name: a2, sequence: w }) => {
526
- const c2 = String(f);
527
- if (isActionKey([c2, a2, w], "cancel")) {
528
- n3 && r2.write(import_sisteransi.cursor.show), process.exit(0);
526
+ f$1.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(true);
527
+ const t2 = (l, { name: i2, sequence: p }) => {
528
+ const w = String(l);
529
+ if (isActionKey([w, i2, p], "cancel")) {
530
+ n3 && r2.write(cursor.show), process.exit(0);
529
531
  return;
530
532
  }
531
533
  if (!o) return;
532
- const i2 = a2 === "return" ? 0 : -1, m = a2 === "return" ? -1 : 0;
533
- l.moveCursor(r2, i2, m, () => {
534
- l.clearLine(r2, 1, () => {
534
+ const c3 = i2 === "return" ? 0 : -1, a2 = i2 === "return" ? -1 : 0;
535
+ f$1.moveCursor(r2, c3, a2, () => {
536
+ f$1.clearLine(r2, 1, () => {
535
537
  e.once("keypress", t2);
536
538
  });
537
539
  });
538
540
  };
539
- return n3 && r2.write(import_sisteransi.cursor.hide), e.once("keypress", t2), () => {
540
- e.off("keypress", t2), n3 && r2.write(import_sisteransi.cursor.show), e instanceof ReadStream && e.isTTY && !R && e.setRawMode(false), s.terminal = false, s.close();
541
+ return n3 && r2.write(cursor.hide), e.once("keypress", t2), () => {
542
+ e.off("keypress", t2), n3 && r2.write(cursor.show), e instanceof ReadStream && e.isTTY && !R && e.setRawMode(false), s.terminal = false, s.close();
541
543
  };
542
544
  }
543
545
  function wrapTextWithPrefix(e, r2, o, n3 = o, s = o, t2) {
544
- const f = getColumns(e ?? stdout);
545
- return wrapAnsi(r2, f - o.length, {
546
+ const l = getColumns(e ?? stdout), i2 = dist_default2(o);
547
+ return wrapAnsi(r2, l - i2, {
546
548
  hard: true,
547
549
  trim: false
548
550
  }).split(`
549
- `).map((c2, i2, m) => {
550
- const d = t2 ? t2(c2, i2) : c2;
551
- return i2 === 0 ? `${n3}${d}` : i2 === m.length - 1 ? `${s}${d}` : `${o}${d}`;
551
+ `).map((c3, a2, g) => {
552
+ const m = t2 ? t2(c3, a2) : c3;
553
+ return a2 === 0 ? `${n3}${m}` : a2 === g.length - 1 ? `${s}${m}` : `${o}${m}`;
552
554
  }).join(`
553
555
  `);
554
556
  }
@@ -559,12 +561,13 @@ function runValidation(e, a2) {
559
561
  }
560
562
  return e(a2);
561
563
  }
562
- var import_sisteransi, a$1, t, settings, R, CANCEL_SYMBOL, getColumns, getRows, y, r, n$1;
563
- var init_dist3 = __esm({
564
- "node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs"() {
564
+ var a$1, t, settings, R, CANCEL_SYMBOL, getColumns, getRows, C$1, r, n$1;
565
+ var init_dist4 = __esm({
566
+ "node_modules/.bun/@clack+core@1.6.0/node_modules/@clack/core/dist/index.mjs"() {
565
567
  init_utils2();
566
568
  init_main();
567
- import_sisteransi = __toESM(require_src(), 1);
569
+ init_dist3();
570
+ init_dist2();
568
571
  a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
569
572
  t = [
570
573
  "January",
@@ -613,7 +616,7 @@ var init_dist3 = __esm({
613
616
  CANCEL_SYMBOL = /* @__PURE__ */ Symbol("clack:cancel");
614
617
  getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
615
618
  getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
616
- y = class {
619
+ C$1 = class C {
617
620
  input;
618
621
  output;
619
622
  _abortSignal;
@@ -695,16 +698,16 @@ var init_dist3 = __esm({
695
698
  { once: true }
696
699
  );
697
700
  }
698
- this.rl = l__default.createInterface({
701
+ this.rl = f__default.createInterface({
699
702
  input: this.input,
700
703
  tabSize: 2,
701
704
  prompt: "",
702
705
  escapeCodeTimeout: 50,
703
706
  terminal: true
704
707
  }), 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", () => {
705
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(this.value);
708
+ this.output.write(cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(this.value);
706
709
  }), this.once("cancel", () => {
707
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(CANCEL_SYMBOL);
710
+ this.output.write(cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(CANCEL_SYMBOL);
708
711
  });
709
712
  });
710
713
  }
@@ -741,18 +744,18 @@ var init_dist3 = __esm({
741
744
  `), setRawMode(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
742
745
  }
743
746
  restoreCursor() {
744
- const t2 = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
747
+ const t2 = wrapAnsi(this._prevFrame, getColumns(this.output), { hard: true, trim: false }).split(`
745
748
  `).length - 1;
746
- this.output.write(import_sisteransi.cursor.move(-999, t2 * -1));
749
+ this.output.write(cursor.move(-999, t2 * -1));
747
750
  }
748
751
  render() {
749
- const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
752
+ const t2 = wrapAnsi(this._render(this) ?? "", getColumns(this.output), {
750
753
  hard: true,
751
754
  trim: false
752
755
  });
753
756
  if (t2 !== this._prevFrame) {
754
757
  if (this.state === "initial")
755
- this.output.write(import_sisteransi.cursor.hide);
758
+ this.output.write(cursor.hide);
756
759
  else {
757
760
  const e = diffLines(this._prevFrame, t2), i2 = getRows(this.output);
758
761
  if (this.restoreCursor(), e) {
@@ -763,33 +766,33 @@ var init_dist3 = __esm({
763
766
  return;
764
767
  }
765
768
  if (e.lines.length === 1) {
766
- this.output.write(import_sisteransi.cursor.move(0, n3 - r2)), this.output.write(import_sisteransi.erase.lines(1));
769
+ this.output.write(cursor.move(0, n3 - r2)), this.output.write(erase.lines(1));
767
770
  const o = t2.split(`
768
771
  `);
769
- this.output.write(o[n3]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, o.length - n3 - 1));
772
+ this.output.write(o[n3]), this._prevFrame = t2, this.output.write(cursor.move(0, o.length - n3 - 1));
770
773
  return;
771
774
  } else if (e.lines.length > 1) {
772
775
  if (s < r2)
773
776
  n3 = s;
774
777
  else {
775
778
  const h2 = n3 - r2;
776
- h2 > 0 && this.output.write(import_sisteransi.cursor.move(0, h2));
779
+ h2 > 0 && this.output.write(cursor.move(0, h2));
777
780
  }
778
- this.output.write(import_sisteransi.erase.down());
779
- const f = t2.split(`
781
+ this.output.write(erase.down());
782
+ const m = t2.split(`
780
783
  `).slice(n3);
781
- this.output.write(f.join(`
784
+ this.output.write(m.join(`
782
785
  `)), this._prevFrame = t2;
783
786
  return;
784
787
  }
785
788
  }
786
- this.output.write(import_sisteransi.erase.down());
789
+ this.output.write(erase.down());
787
790
  }
788
791
  this.output.write(t2), this.state === "initial" && (this.state = "active"), this._prevFrame = t2;
789
792
  }
790
793
  }
791
794
  };
792
- r = class extends y {
795
+ r = class extends C$1 {
793
796
  get cursor() {
794
797
  return this.value ? 0 : 1;
795
798
  }
@@ -800,13 +803,13 @@ var init_dist3 = __esm({
800
803
  super(t2, false), this.value = !!t2.initialValue, this.on("userInput", () => {
801
804
  this.value = this._value;
802
805
  }), this.on("confirm", (i2) => {
803
- this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = i2, this.state = "submit", this.close();
806
+ this.output.write(cursor.move(0, -1)), this.value = i2, this.state = "submit", this.close();
804
807
  }), this.on("cursor", () => {
805
808
  this.value = !this.value;
806
809
  });
807
810
  }
808
811
  };
809
- n$1 = class n extends y {
812
+ n$1 = class n extends C$1 {
810
813
  options;
811
814
  cursor = 0;
812
815
  get _selectedValue() {
@@ -837,7 +840,7 @@ var init_dist3 = __esm({
837
840
  }
838
841
  });
839
842
 
840
- // node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs
843
+ // node_modules/.bun/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.mjs
841
844
  import { styleText as styleText2, stripVTControlCharacters } from "node:util";
842
845
  import process$1 from "node:process";
843
846
  import { existsSync, lstatSync, readdirSync } from "node:fs";
@@ -848,22 +851,23 @@ function isUnicodeSupported() {
848
851
  }
849
852
  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";
850
853
  }
851
- function formatInstructionFooter(o, e) {
852
- const r2 = [`${e ? `${styleText2("cyan", S_BAR)} ` : ""}${o.join(" \u2022 ")}`];
853
- return e && r2.push(styleText2("cyan", S_BAR_END)), r2;
854
+ function formatInstructionFooter(e, o, r2) {
855
+ const s = r2 ? `${styleText2("cyan", S_BAR)} ` : "", n3 = wrapTextWithPrefix(e, o.join(" \u2022 "), s).split(`
856
+ `);
857
+ return r2 && n3.push(styleText2("cyan", S_BAR_END)), n3;
854
858
  }
855
- 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, log, cancel, intro, outro, W$1, C, note, W, spinner, u2, SELECT_INSTRUCTIONS, c, select, i;
856
- var init_dist4 = __esm({
857
- "node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs"() {
859
+ var 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, E$1, limitOptions, confirm, MULTISELECT_INSTRUCTIONS, log, cancel, intro, outro, W, C2, note, Y, Z, spinner, u2, SELECT_INSTRUCTIONS, c2, select, i;
860
+ var init_dist5 = __esm({
861
+ "node_modules/.bun/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.mjs"() {
858
862
  init_utils2();
859
- init_dist3();
860
- init_dist3();
863
+ init_dist4();
864
+ init_dist4();
861
865
  init_main();
862
866
  init_dist2();
863
- import_sisteransi2 = __toESM(require_src(), 1);
867
+ init_dist3();
864
868
  unicode = isUnicodeSupported();
865
869
  isCI = () => process.env.CI === "true";
866
- unicodeOr = (o, e) => unicode ? o : e;
870
+ unicodeOr = (e, o) => unicode ? e : o;
867
871
  S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
868
872
  S_STEP_CANCEL = unicodeOr("\u25A0", "x");
869
873
  S_STEP_ERROR = unicodeOr("\u25B2", "x");
@@ -889,8 +893,8 @@ var init_dist4 = __esm({
889
893
  S_SUCCESS = unicodeOr("\u25C6", "*");
890
894
  S_WARN = unicodeOr("\u25B2", "!");
891
895
  S_ERROR = unicodeOr("\u25A0", "x");
892
- symbol = (o) => {
893
- switch (o) {
896
+ symbol = (e) => {
897
+ switch (e) {
894
898
  case "initial":
895
899
  case "active":
896
900
  return styleText2("cyan", S_STEP_ACTIVE);
@@ -904,8 +908,8 @@ var init_dist4 = __esm({
904
908
  return styleText2("dim", S_STEP_ACTIVE);
905
909
  }
906
910
  };
907
- symbolBar = (o) => {
908
- switch (o) {
911
+ symbolBar = (e) => {
912
+ switch (e) {
909
913
  case "initial":
910
914
  case "active":
911
915
  return styleText2("cyan", S_BAR);
@@ -917,45 +921,45 @@ var init_dist4 = __esm({
917
921
  return styleText2("green", S_BAR);
918
922
  }
919
923
  };
920
- I = (l2, e, w, p, b, C2 = false) => {
924
+ E$1 = (l, e, w, p, b, C3 = false) => {
921
925
  let r2 = e, O = 0;
922
- if (C2)
926
+ if (C3)
923
927
  for (let i2 = p - 1; i2 >= w; i2--) {
924
- const m = l2[i2];
928
+ const m = l[i2];
925
929
  if (m && (r2 -= m.length), O++, r2 <= b) break;
926
930
  }
927
931
  else
928
932
  for (let i2 = w; i2 < p; i2++) {
929
- const m = l2[i2];
933
+ const m = l[i2];
930
934
  if (m && (r2 -= m.length), O++, r2 <= b) break;
931
935
  }
932
936
  return { lineCount: r2, removals: O };
933
937
  };
934
938
  limitOptions = ({
935
- cursor: l2,
939
+ cursor: l,
936
940
  options: e,
937
941
  style: w,
938
942
  output: p = process.stdout,
939
943
  maxItems: b = Number.POSITIVE_INFINITY,
940
- columnPadding: C2 = 0,
944
+ columnPadding: C3 = 0,
941
945
  rowPadding: r2 = 4
942
946
  }) => {
943
- 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);
947
+ const i2 = getColumns(p) - C3, m = getRows(p), M = styleText2("dim", "..."), v = Math.max(m - r2, 0), a2 = Math.max(Math.min(b, v), 5);
944
948
  let f = 0;
945
- l2 >= a2 - 3 && (f = Math.max(
946
- Math.min(l2 - a2 + 3, e.length - a2),
949
+ l >= a2 - 3 && (f = Math.max(
950
+ Math.min(l - a2 + 3, e.length - a2),
947
951
  0
948
952
  ));
949
- let d = a2 < e.length && f > 0, c2 = a2 < e.length && f + a2 < e.length;
950
- const W2 = Math.min(
953
+ let d = a2 < e.length && f > 0, c3 = a2 < e.length && f + a2 < e.length;
954
+ const I = Math.min(
951
955
  f + a2,
952
956
  e.length
953
957
  ), s = [];
954
958
  let g = 0;
955
- d && g++, c2 && g++;
956
- const T = f + (d ? 1 : 0), y2 = W2 - (c2 ? 1 : 0);
957
- for (let t2 = T; t2 < y2; t2++) {
958
- const n3 = e[t2], o = n3 ? w(n3, t2 === l2) : "", h2 = wrapAnsi(o, i2, {
959
+ d && g++, c3 && g++;
960
+ const T = f + (d ? 1 : 0), W2 = I - (c3 ? 1 : 0);
961
+ for (let t2 = T; t2 < W2; t2++) {
962
+ const n3 = e[t2], o = n3 !== void 0 ? w(n3, t2 === l) : "", h2 = wrapAnsi(o, i2, {
959
963
  hard: true,
960
964
  trim: false
961
965
  }).split(`
@@ -964,9 +968,9 @@ var init_dist4 = __esm({
964
968
  }
965
969
  if (g > v) {
966
970
  let t2 = 0, n3 = 0, o = g;
967
- const h2 = l2 - T;
971
+ const h2 = l - T;
968
972
  let u3 = v;
969
- const L = () => I(s, o, 0, h2, u3), E = () => I(
973
+ const L = () => E$1(s, o, 0, h2, u3), y = () => E$1(
970
974
  s,
971
975
  o,
972
976
  h2 + 1,
@@ -974,14 +978,14 @@ var init_dist4 = __esm({
974
978
  u3,
975
979
  true
976
980
  );
977
- 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));
981
+ 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));
978
982
  }
979
983
  const x = [];
980
984
  d && x.push(M);
981
985
  for (const t2 of s)
982
986
  for (const n3 of t2)
983
987
  x.push(n3);
984
- return c2 && x.push(M), x;
988
+ return c3 && x.push(M), x;
985
989
  };
986
990
  confirm = (e) => {
987
991
  const a2 = e.active ?? "Yes", o = e.inactive ?? "No";
@@ -993,22 +997,22 @@ var init_dist4 = __esm({
993
997
  output: e.output,
994
998
  initialValue: e.initialValue ?? true,
995
999
  render() {
996
- const i2 = e.withGuide ?? settings.withGuide, u3 = `${symbol(this.state)} `, l2 = i2 ? `${styleText2("gray", S_BAR)} ` : "", f = wrapTextWithPrefix(
1000
+ const i2 = e.withGuide ?? settings.withGuide, u3 = `${symbol(this.state)} `, l = i2 ? `${styleText2("gray", S_BAR)} ` : "", f = wrapTextWithPrefix(
997
1001
  e.output,
998
1002
  e.message,
999
- l2,
1003
+ l,
1000
1004
  u3
1001
1005
  ), s = `${i2 ? `${styleText2("gray", S_BAR)}
1002
1006
  ` : ""}${f}
1003
- `, c2 = this.value ? a2 : o;
1007
+ `, c3 = this.value ? a2 : o;
1004
1008
  switch (this.state) {
1005
1009
  case "submit": {
1006
1010
  const r2 = i2 ? `${styleText2("gray", S_BAR)} ` : "";
1007
- return `${s}${r2}${styleText2("dim", c2)}`;
1011
+ return `${s}${r2}${styleText2("dim", c3)}`;
1008
1012
  }
1009
1013
  case "cancel": {
1010
1014
  const r2 = i2 ? `${styleText2("gray", S_BAR)} ` : "";
1011
- return `${s}${r2}${styleText2(["strikethrough", "dim"], c2)}${i2 ? `
1015
+ return `${s}${r2}${styleText2(["strikethrough", "dim"], c3)}${i2 ? `
1012
1016
  ${styleText2("gray", S_BAR)}` : ""}`;
1013
1017
  }
1014
1018
  default: {
@@ -1033,18 +1037,18 @@ ${g}
1033
1037
  symbol: e = styleText2("gray", S_BAR),
1034
1038
  secondarySymbol: r2 = styleText2("gray", S_BAR),
1035
1039
  output: m = process.stdout,
1036
- spacing: l2 = 1,
1037
- withGuide: c2
1040
+ spacing: l = 1,
1041
+ withGuide: c3
1038
1042
  } = {}) => {
1039
- const t2 = [], o = c2 ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
1040
- for (let i2 = 0; i2 < l2; i2++)
1043
+ const t2 = [], o = c3 ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
1044
+ for (let i2 = 0; i2 < l; i2++)
1041
1045
  t2.push(f);
1042
1046
  const g = Array.isArray(s) ? s : s.split(`
1043
1047
  `);
1044
1048
  if (g.length > 0) {
1045
- const [i2, ...y2] = g;
1049
+ const [i2, ...y] = g;
1046
1050
  i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
1047
- for (const p of y2)
1051
+ for (const p of y)
1048
1052
  p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
1049
1053
  }
1050
1054
  m.write(`${t2.join(`
@@ -1089,18 +1093,18 @@ ${styleText2("gray", S_BAR_END)} ` : "";
1089
1093
 
1090
1094
  `);
1091
1095
  };
1092
- W$1 = (o) => o;
1093
- C = (o, e, s) => {
1096
+ W = (o) => o;
1097
+ C2 = (o, e, s) => {
1094
1098
  const a2 = {
1095
1099
  hard: true,
1096
1100
  trim: false
1097
1101
  }, i2 = wrapAnsi(o, e, a2).split(`
1098
- `), c2 = i2.reduce((n3, t2) => Math.max(dist_default2(t2), n3), 0), u3 = i2.map(s).reduce((n3, t2) => Math.max(dist_default2(t2), n3), 0), g = e - (u3 - c2);
1102
+ `), c3 = i2.reduce((n3, t2) => Math.max(dist_default2(t2), n3), 0), u3 = i2.map(s).reduce((n3, t2) => Math.max(dist_default2(t2), n3), 0), g = e - (u3 - c3);
1099
1103
  return wrapAnsi(o, g, a2);
1100
1104
  };
1101
1105
  note = (o = "", e = "", s) => {
1102
- const a2 = s?.output ?? process$1.stdout, i2 = s?.withGuide ?? settings.withGuide, c2 = s?.format ?? W$1, g = ["", ...C(o, getColumns(a2) - 6, c2).split(`
1103
- `).map(c2), ""], n3 = dist_default2(e), t2 = Math.max(
1106
+ const a2 = s?.output ?? process$1.stdout, i2 = s?.withGuide ?? settings.withGuide, c3 = s?.format ?? W, g = ["", ...C2(o, getColumns(a2) - 6, c3).split(`
1107
+ `).map(c3), ""], n3 = dist_default2(e), t2 = Math.max(
1104
1108
  g.reduce((m, F) => {
1105
1109
  const O = dist_default2(F);
1106
1110
  return O > m ? O : m;
@@ -1121,83 +1125,102 @@ ${styleText2("gray", l$1 + S_BAR_H.repeat(t2 + 2) + S_CORNER_BOTTOM_RIGHT)}
1121
1125
  `
1122
1126
  );
1123
1127
  };
1124
- W = (l2) => styleText2("magenta", l2);
1128
+ Y = 3e4;
1129
+ Z = (c3) => styleText2("magenta", c3);
1125
1130
  spinner = ({
1126
- indicator: l2 = "dots",
1127
- onCancel: h2,
1131
+ indicator: c3 = "dots",
1132
+ onCancel: b,
1128
1133
  output: n3 = process.stdout,
1129
- cancelMessage: G,
1130
- errorMessage: O,
1131
- frames: E = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
1132
- delay: F = unicode ? 80 : 120,
1133
- signal: m,
1134
- ...I2
1134
+ cancelMessage: _,
1135
+ errorMessage: C3,
1136
+ frames: M = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
1137
+ delay: O = unicode ? 80 : 120,
1138
+ signal: g,
1139
+ ...E
1135
1140
  } = {}) => {
1136
- const u3 = isCI();
1137
- let M, T, d = false, S = false, s = "", p, w = performance.now();
1138
- const x = getColumns(n3), k = I2?.styleFrame ?? W, g = (e) => {
1139
- const r2 = e > 1 ? O ?? settings.messages.error : G ?? settings.messages.cancel;
1140
- S = e === 1, d && (a2(r2, e), S && typeof h2 == "function" && h2());
1141
- }, f = () => g(2), i2 = () => g(1), A = () => {
1142
- process.on("uncaughtExceptionMonitor", f), process.on("unhandledRejection", f), process.on("SIGINT", i2), process.on("SIGTERM", i2), process.on("exit", g), m && m.addEventListener("abort", i2);
1143
- }, H = () => {
1144
- process.removeListener("uncaughtExceptionMonitor", f), process.removeListener("unhandledRejection", f), process.removeListener("SIGINT", i2), process.removeListener("SIGTERM", i2), process.removeListener("exit", g), m && m.removeEventListener("abort", i2);
1145
- }, y2 = () => {
1146
- if (p === void 0) return;
1141
+ const u3 = isCI(), h2 = isAccessible(E.accessible);
1142
+ let x, I, p = false, l = false, r2 = "", v, w = performance.now();
1143
+ const y = getColumns(n3), F = E?.styleFrame ?? Z, S = (e) => {
1144
+ const s = e > 1 ? C3 ?? settings.messages.error : _ ?? settings.messages.cancel;
1145
+ l = e === 1, p && (m(s, e), l && typeof b == "function" && b());
1146
+ }, $ = () => S(2), a2 = () => S(1), H = () => {
1147
+ process.on("uncaughtExceptionMonitor", $), process.on("unhandledRejection", $), process.on("SIGINT", a2), process.on("SIGTERM", a2), process.on("exit", S), g && g.addEventListener("abort", a2);
1148
+ }, B = () => {
1149
+ process.removeListener("uncaughtExceptionMonitor", $), process.removeListener("unhandledRejection", $), process.removeListener("SIGINT", a2), process.removeListener("SIGTERM", a2), process.removeListener("exit", S), g && g.removeEventListener("abort", a2);
1150
+ }, R2 = () => {
1151
+ if (v === void 0) return;
1147
1152
  u3 && n3.write(`
1148
1153
  `);
1149
- const r2 = wrapAnsi(p, x, {
1154
+ const s = wrapAnsi(v, y, {
1150
1155
  hard: true,
1151
1156
  trim: false
1152
1157
  }).split(`
1153
1158
  `);
1154
- r2.length > 1 && n3.write(import_sisteransi2.cursor.up(r2.length - 1)), n3.write(import_sisteransi2.cursor.to(0)), n3.write(import_sisteransi2.erase.down());
1155
- }, C2 = (e) => e.replace(/\.+$/, ""), _ = (e) => {
1156
- const r2 = (performance.now() - e) / 1e3, t2 = Math.floor(r2 / 60), o = Math.floor(r2 % 60);
1157
- return t2 > 0 ? `[${t2}m ${o}s]` : `[${o}s]`;
1158
- }, N = I2.withGuide ?? settings.withGuide, P = (e = "") => {
1159
- d = true, M = block({ output: n3 }), s = C2(e), w = performance.now(), N && n3.write(`${styleText2("gray", S_BAR)}
1159
+ s.length > 1 && n3.write(cursor.up(s.length - 1)), n3.write(cursor.to(0)), n3.write(erase.down());
1160
+ }, L = (e) => e.replace(/\.+$/, ""), T = (e) => {
1161
+ const s = (performance.now() - e) / 1e3, i2 = Math.floor(s / 60), t2 = Math.floor(s % 60);
1162
+ return i2 > 0 ? `[${i2}m ${t2}s]` : `[${t2}s]`;
1163
+ }, N = E.withGuide ?? settings.withGuide, P = (e = "") => {
1164
+ if (p = true, l = false, r2 = L(e), w = performance.now(), H(), h2) {
1165
+ r2 !== "" && n3.write(`${r2}
1166
+ `), I = setInterval(() => {
1167
+ n3.write(r2 === "" ? `still working
1168
+ ` : `still working: ${r2}
1160
1169
  `);
1161
- let r2 = 0, t2 = 0;
1162
- A(), T = setInterval(() => {
1163
- if (u3 && s === p)
1170
+ }, Y);
1171
+ return;
1172
+ }
1173
+ x = block({ output: n3 }), N && n3.write(`${styleText2("gray", S_BAR)}
1174
+ `);
1175
+ let s = 0, i2 = 0;
1176
+ I = setInterval(() => {
1177
+ if (u3 && r2 === v)
1164
1178
  return;
1165
- y2(), p = s;
1166
- const o = k(E[r2]);
1167
- let v;
1179
+ R2(), v = r2;
1180
+ const t2 = F(M[s]);
1181
+ let o;
1168
1182
  if (u3)
1169
- v = `${o} ${s}...`;
1170
- else if (l2 === "timer")
1171
- v = `${o} ${s} ${_(w)}`;
1183
+ o = `${t2} ${r2}...`;
1184
+ else if (c3 === "timer")
1185
+ o = `${t2} ${r2} ${T(w)}`;
1172
1186
  else {
1173
- const B = ".".repeat(Math.floor(t2)).slice(0, 3);
1174
- v = `${o} ${s}${B}`;
1187
+ const j = ".".repeat(Math.floor(i2)).slice(0, 3);
1188
+ o = `${t2} ${r2}${j}`;
1175
1189
  }
1176
- const j = wrapAnsi(v, x, {
1190
+ const D = wrapAnsi(o, y, {
1177
1191
  hard: true,
1178
1192
  trim: false
1179
1193
  });
1180
- n3.write(j), r2 = r2 + 1 < E.length ? r2 + 1 : 0, t2 = t2 < 4 ? t2 + 0.125 : 0;
1181
- }, F);
1182
- }, a2 = (e = "", r2 = 0, t2 = false) => {
1183
- if (!d) return;
1184
- d = false, clearInterval(T), y2();
1185
- const o = r2 === 0 ? styleText2("green", S_STEP_SUBMIT) : r2 === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
1186
- s = e ?? s, t2 || (l2 === "timer" ? n3.write(`${o} ${s} ${_(w)}
1187
- `) : n3.write(`${o} ${s}
1188
- `)), H(), M();
1194
+ n3.write(D), s = s + 1 < M.length ? s + 1 : 0, i2 = i2 < 4 ? i2 + 0.125 : 0;
1195
+ }, O);
1196
+ }, m = (e = "", s = 0, i2 = false) => {
1197
+ if (p) {
1198
+ if (p = false, l = s === 1, clearInterval(I), h2 || R2(), r2 = e ?? r2, !i2)
1199
+ if (h2) {
1200
+ const t2 = s === 1 ? _ ?? settings.messages.cancel : s === 2 ? C3 ?? settings.messages.error : "Done", o = r2 || t2;
1201
+ c3 === "timer" ? n3.write(`${o} ${T(w)}
1202
+ `) : n3.write(`${o}
1203
+ `);
1204
+ } else {
1205
+ const t2 = s === 0 ? styleText2("green", S_STEP_SUBMIT) : s === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
1206
+ c3 === "timer" ? n3.write(`${t2} ${r2} ${T(w)}
1207
+ `) : n3.write(`${t2} ${r2}
1208
+ `);
1209
+ }
1210
+ B(), x?.();
1211
+ }
1189
1212
  };
1190
1213
  return {
1191
1214
  start: P,
1192
- stop: (e = "") => a2(e, 0),
1215
+ stop: (e = "") => m(e, 0),
1193
1216
  message: (e = "") => {
1194
- s = C2(e ?? s);
1217
+ r2 = L(e ?? r2);
1195
1218
  },
1196
- cancel: (e = "") => a2(e, 1),
1197
- error: (e = "") => a2(e, 2),
1198
- clear: () => a2("", 0, true),
1219
+ cancel: (e = "") => m(e, 1),
1220
+ error: (e = "") => m(e, 2),
1221
+ clear: () => m("", 0, true),
1199
1222
  get isCancelled() {
1200
- return S;
1223
+ return l;
1201
1224
  }
1202
1225
  };
1203
1226
  };
@@ -1210,7 +1233,7 @@ ${styleText2("gray", l$1 + S_BAR_H.repeat(t2 + 2) + S_CORNER_BOTTOM_RIGHT)}
1210
1233
  `${styleText2("dim", "\u2191/\u2193")} to navigate`,
1211
1234
  `${styleText2("dim", "Enter:")} confirm`
1212
1235
  ];
1213
- c = (t2, o) => t2.includes(`
1236
+ c2 = (t2, o) => t2.includes(`
1214
1237
  `) ? t2.split(`
1215
1238
  `).map((d) => o(d)).join(`
1216
1239
  `) : o(t2);
@@ -1221,15 +1244,15 @@ ${styleText2("gray", l$1 + S_BAR_H.repeat(t2 + 2) + S_CORNER_BOTTOM_RIGHT)}
1221
1244
  const s = n3.label ?? String(n3.value);
1222
1245
  switch (m) {
1223
1246
  case "disabled":
1224
- return `${styleText2("gray", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("gray", i2))}${n3.hint ? ` ${styleText2("dim", `(${n3.hint ?? "disabled"})`)}` : ""}`;
1247
+ return `${styleText2("gray", S_RADIO_INACTIVE)} ${c2(s, (i2) => styleText2("gray", i2))}${n3.hint ? ` ${styleText2("dim", `(${n3.hint ?? "disabled"})`)}` : ""}`;
1225
1248
  case "selected":
1226
- return `${c(s, (i2) => styleText2("dim", i2))}`;
1249
+ return `${c2(s, (i2) => styleText2("dim", i2))}`;
1227
1250
  case "active":
1228
1251
  return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${n3.hint ? ` ${styleText2("dim", `(${n3.hint})`)}` : ""}`;
1229
1252
  case "cancelled":
1230
- return `${c(s, (i2) => styleText2(["strikethrough", "dim"], i2))}`;
1253
+ return `${c2(s, (i2) => styleText2(["strikethrough", "dim"], i2))}`;
1231
1254
  default:
1232
- return `${styleText2("dim", S_RADIO_INACTIVE)} ${c(s, (i2) => styleText2("dim", i2))}`;
1255
+ return `${styleText2("dim", S_RADIO_INACTIVE)} ${c2(s, (i2) => styleText2("dim", i2))}`;
1233
1256
  }
1234
1257
  }, d = t2.showInstructions ?? true;
1235
1258
  return new n$1({
@@ -1267,7 +1290,7 @@ ${styleText2("gray", S_BAR)}` : ""}`;
1267
1290
  }
1268
1291
  default: {
1269
1292
  const r2 = n3 ? `${styleText2("cyan", S_BAR)} ` : "", a2 = u3.split(`
1270
- `).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], f = p.join(`
1293
+ `).length, p = d ? formatInstructionFooter(t2.output, SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], f = p.join(`
1271
1294
  `), b = p.length + 1;
1272
1295
  return `${u3}${r2}${limitOptions({
1273
1296
  output: t2.output,
@@ -1336,8 +1359,8 @@ var init_cli_output = __esm({
1336
1359
  "packages/tooling/src/utils/cli-output.ts"() {
1337
1360
  "use strict";
1338
1361
  init_utils2();
1339
- init_dist4();
1340
- init_dist4();
1362
+ init_dist5();
1363
+ init_dist5();
1341
1364
  colors = {
1342
1365
  reset: "\x1B[0m",
1343
1366
  // Success (green)
@@ -1488,7 +1511,7 @@ var init_errors = __esm({
1488
1511
  * @param {DoNotDevErrorCode} code - Error code
1489
1512
  * @param {object} [options] - Additional error options
1490
1513
  * @param {Error} [options.originalError] - Original error if wrapping
1491
- * @param {Record<string, any>} [options.context] - Additional context data
1514
+ * @param {Record<string, unknown>} [options.context] - Additional context data
1492
1515
  * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
1493
1516
  */
1494
1517
  constructor(message, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
@@ -1518,7 +1541,7 @@ var init_errors = __esm({
1518
1541
  * @param {string} [context] - Additional context for the error
1519
1542
  * @param {DoNotDevErrorCode} [code='unknown-error'] - Error code
1520
1543
  * @param {object} [options] - Additional error options
1521
- * @param {Record<string, any>} [options.context] - Additional context data
1544
+ * @param {Record<string, unknown>} [options.context] - Additional context data
1522
1545
  * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
1523
1546
  * @returns {DoNotDevError} New DoNotDev error wrapping the original
1524
1547
  */
@@ -7569,6 +7592,9 @@ import {
7569
7592
  extname
7570
7593
  } from "node:path";
7571
7594
  import { fileURLToPath } from "node:url";
7595
+ function isEexistError(error2) {
7596
+ return typeof error2 === "object" && error2 !== null && "code" in error2 && error2.code === "EEXIST";
7597
+ }
7572
7598
  function safeExecuteAsync(fn, message) {
7573
7599
  return fn().catch((error2) => {
7574
7600
  throw new Error(
@@ -7940,7 +7966,7 @@ var init_PathResolver = __esm({
7940
7966
  try {
7941
7967
  await fs.promises.mkdir(dir, { recursive: true });
7942
7968
  } catch (error2) {
7943
- if (error2?.code !== "EEXIST") throw error2;
7969
+ if (!isEexistError(error2)) throw error2;
7944
7970
  }
7945
7971
  const detectedFormat = this._detectFormat(filePath, format);
7946
7972
  let writeContent;
@@ -8002,7 +8028,7 @@ var init_PathResolver = __esm({
8002
8028
  try {
8003
8029
  fs.mkdirSync(dir, { recursive: true });
8004
8030
  } catch (error2) {
8005
- if (error2?.code !== "EEXIST") throw error2;
8031
+ if (!isEexistError(error2)) throw error2;
8006
8032
  }
8007
8033
  const detectedFormat = this._detectFormat(filePath, format);
8008
8034
  let writeContent;
@@ -8059,7 +8085,7 @@ var init_PathResolver = __esm({
8059
8085
  try {
8060
8086
  await fs.promises.mkdir(dir, { recursive: true });
8061
8087
  } catch (error2) {
8062
- if (error2?.code !== "EEXIST") throw error2;
8088
+ if (!isEexistError(error2)) throw error2;
8063
8089
  }
8064
8090
  try {
8065
8091
  return await safeExecuteAsync(async () => {
@@ -8101,7 +8127,7 @@ var init_PathResolver = __esm({
8101
8127
  try {
8102
8128
  fs.mkdirSync(dir, { recursive: true });
8103
8129
  } catch (error2) {
8104
- if (error2?.code !== "EEXIST") throw error2;
8130
+ if (!isEexistError(error2)) throw error2;
8105
8131
  }
8106
8132
  try {
8107
8133
  fs.copyFileSync(srcPath, normalizedDestPath);
@@ -8217,7 +8243,7 @@ var init_PathResolver = __esm({
8217
8243
  try {
8218
8244
  await fs.promises.mkdir(dirPath, { recursive: true });
8219
8245
  } catch (error2) {
8220
- if (error2?.code !== "EEXIST") throw error2;
8246
+ if (!isEexistError(error2)) throw error2;
8221
8247
  }
8222
8248
  }
8223
8249
  /**
@@ -8229,7 +8255,7 @@ var init_PathResolver = __esm({
8229
8255
  try {
8230
8256
  fs.mkdirSync(dirPath, { recursive: true });
8231
8257
  } catch (error2) {
8232
- if (error2?.code !== "EEXIST") throw error2;
8258
+ if (!isEexistError(error2)) throw error2;
8233
8259
  }
8234
8260
  }
8235
8261
  /**
@@ -8478,6 +8504,7 @@ var init_PathResolver = __esm({
8478
8504
  * @param patternType - Type of patterns (css, routes, i18n, assets, pwa)
8479
8505
  * @returns Resolved patterns with absolute paths
8480
8506
  */
8507
+ // 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)
8481
8508
  async resolvePatterns(patternType) {
8482
8509
  if (!constants.getPatternsFor) {
8483
8510
  return { framework: [], consumer: [], all: [] };
@@ -8632,6 +8659,9 @@ import {
8632
8659
  } from "node:path";
8633
8660
  import { fileURLToPath as fileURLToPath2 } from "node:url";
8634
8661
  function readdirSync3(dirPath, options) {
8662
+ if (options !== null && typeof options === "object" && options.withFileTypes === true) {
8663
+ return pathResolverInstance.readdirSync(dirPath, options);
8664
+ }
8635
8665
  return pathResolverInstance.readdirSync(dirPath, options);
8636
8666
  }
8637
8667
  var pathResolverInstance, getRepoRoot, getAppRoot, normalizePath, pathExists, readSync, write, statSync2, ensureDir, joinPath;
@@ -8699,6 +8729,25 @@ var init_typed_file_operations = __esm({
8699
8729
  }
8700
8730
  });
8701
8731
 
8732
+ // packages/tooling/src/utils/type-guards.ts
8733
+ function requireText(value, filePath) {
8734
+ if (typeof value !== "string") {
8735
+ throw new DoNotDevError(
8736
+ `Cannot read text file: ${filePath}`,
8737
+ DO_NOT_DEV_ERROR_CODES.FILE_NOT_FOUND,
8738
+ { context: { filePath } }
8739
+ );
8740
+ }
8741
+ return value;
8742
+ }
8743
+ var init_type_guards = __esm({
8744
+ "packages/tooling/src/utils/type-guards.ts"() {
8745
+ "use strict";
8746
+ init_utils2();
8747
+ init_errors();
8748
+ }
8749
+ });
8750
+
8702
8751
  // packages/tooling/src/bundler/utils.ts
8703
8752
  import { Buffer as Buffer2 } from "node:buffer";
8704
8753
  import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
@@ -8766,7 +8815,7 @@ function analyzeApp(appPath, appName) {
8766
8815
  try {
8767
8816
  const envPath = joinPath(appPath, ".env");
8768
8817
  if (pathExists(envPath)) {
8769
- const envContent = readSync(envPath);
8818
+ const envContent = requireText(readSync(envPath), envPath);
8770
8819
  if (envContent.match(/VITE_SUPABASE_URL=.+/)) {
8771
8820
  hasSupabase = true;
8772
8821
  }
@@ -8813,7 +8862,7 @@ function analyzeApp(appPath, appName) {
8813
8862
  try {
8814
8863
  const envPath = joinPath(appPath, ".env");
8815
8864
  if (pathExists(envPath)) {
8816
- const envContent = readSync(envPath);
8865
+ const envContent = requireText(readSync(envPath), envPath);
8817
8866
  const urlMatch = envContent.match(/VITE_SUPABASE_URL=(.+)/);
8818
8867
  if (urlMatch && urlMatch[1]) {
8819
8868
  url = urlMatch[1].trim();
@@ -8889,6 +8938,7 @@ var init_app_detection = __esm({
8889
8938
  init_utils2();
8890
8939
  init_pathResolver();
8891
8940
  init_typed_file_operations();
8941
+ init_type_guards();
8892
8942
  }
8893
8943
  });
8894
8944
 
@@ -8905,27 +8955,31 @@ async function askForConfirmation(message, defaultValue = false) {
8905
8955
  return result;
8906
8956
  }
8907
8957
  async function askForSelection(message, choices, defaultValue = 0) {
8908
- const options = choices.map((choice) => ({
8909
- value: choice.value,
8910
- label: choice.title,
8911
- hint: choice.hint
8912
- }));
8958
+ const options = choices.map((choice) => {
8959
+ const value = choice.value;
8960
+ return { value, label: choice.title, hint: choice.hint };
8961
+ });
8962
+ const initialValue = choices[defaultValue]?.value;
8913
8963
  const result = await select({
8914
8964
  message,
8915
8965
  options,
8916
- initialValue: choices[defaultValue]?.value
8966
+ initialValue
8917
8967
  });
8918
8968
  if (isCancel(result)) {
8919
8969
  cancel("Operation cancelled.");
8920
8970
  process.exit(0);
8921
8971
  }
8922
- return result;
8972
+ const picked = choices.find((choice) => choice.value === result);
8973
+ if (!picked) {
8974
+ throw new Error(`Unknown selection: ${result}`);
8975
+ }
8976
+ return picked.value;
8923
8977
  }
8924
8978
  var init_cli_input = __esm({
8925
8979
  "packages/tooling/src/utils/cli-input.ts"() {
8926
8980
  "use strict";
8927
8981
  init_utils2();
8928
- init_dist4();
8982
+ init_dist5();
8929
8983
  }
8930
8984
  });
8931
8985
 
@@ -9397,7 +9451,7 @@ jobs:
9397
9451
  run: bunx dndev tc
9398
9452
 
9399
9453
  - name: Test
9400
- run: bun test
9454
+ run: bunx turbo run test
9401
9455
  `;
9402
9456
  }
9403
9457
  function generateDeployWorkflow(providers, envSecretNames) {