@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
@@ -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 = {
413
+ ESC2 = "\x1B";
414
+ CSI2 = `${ESC2}[`;
415
+ cursor = {
417
416
  to(x, y) {
418
- if (!y) return `${CSI2}${x + 1}G`;
417
+ if (!y)
418
+ return `${CSI2}${x + 1}G`;
419
419
  return `${CSI2}${y + 1};${x + 1}H`;
420
420
  },
421
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 (y < 0) ret += `${CSI2}${-y}A`;
426
- else if (y > 0) ret += `${CSI2}${y}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,23 +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";
470
+ import * as f$1 from "node:readline";
469
471
  import { ReadStream } from "node:tty";
472
+ function isAccessible(n2) {
473
+ if (n2 !== void 0) return n2;
474
+ if (settings.accessible !== void 0) return settings.accessible;
475
+ const e = process.env.ACCESSIBLE;
476
+ return e !== void 0 && e !== "" && e !== "0" && e !== "false";
477
+ }
470
478
  function isActionKey(n2, e) {
471
479
  if (typeof n2 == "string")
472
480
  return settings.aliases.get(n2) === e;
@@ -481,37 +489,38 @@ function block({
481
489
  overwrite: o = true,
482
490
  hideCursor: n2 = true
483
491
  } = {}) {
484
- const s = l.createInterface({
492
+ const s = f$1.createInterface({
485
493
  input: e,
486
494
  output: r2,
487
495
  prompt: "",
488
496
  tabSize: 1
489
497
  });
490
- l.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(true);
491
- const t2 = (f, { name: a2, sequence: w }) => {
492
- const c = String(f);
493
- if (isActionKey([c, a2, w], "cancel")) {
494
- n2 && r2.write(import_sisteransi.cursor.show), process.exit(0);
498
+ f$1.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(true);
499
+ const t2 = (l, { name: i2, sequence: p }) => {
500
+ const w = String(l);
501
+ if (isActionKey([w, i2, p], "cancel")) {
502
+ n2 && r2.write(cursor.show), process.exit(0);
495
503
  return;
496
504
  }
497
505
  if (!o) return;
498
- const i2 = a2 === "return" ? 0 : -1, m = a2 === "return" ? -1 : 0;
499
- l.moveCursor(r2, i2, m, () => {
500
- l.clearLine(r2, 1, () => {
506
+ const c2 = i2 === "return" ? 0 : -1, a2 = i2 === "return" ? -1 : 0;
507
+ f$1.moveCursor(r2, c2, a2, () => {
508
+ f$1.clearLine(r2, 1, () => {
501
509
  e.once("keypress", t2);
502
510
  });
503
511
  });
504
512
  };
505
- return n2 && r2.write(import_sisteransi.cursor.hide), e.once("keypress", t2), () => {
506
- e.off("keypress", t2), n2 && r2.write(import_sisteransi.cursor.show), e instanceof ReadStream && e.isTTY && !R && e.setRawMode(false), s.terminal = false, s.close();
513
+ return n2 && r2.write(cursor.hide), e.once("keypress", t2), () => {
514
+ e.off("keypress", t2), n2 && r2.write(cursor.show), e instanceof ReadStream && e.isTTY && !R && e.setRawMode(false), s.terminal = false, s.close();
507
515
  };
508
516
  }
509
- var import_sisteransi, a$1, t, settings, R, getColumns;
510
- var init_dist3 = __esm({
511
- "node_modules/.bun/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs"() {
517
+ var a$1, t, settings, R, getColumns;
518
+ var init_dist4 = __esm({
519
+ "node_modules/.bun/@clack+core@1.6.0/node_modules/@clack/core/dist/index.mjs"() {
512
520
  init_utils2();
513
521
  init_main();
514
- import_sisteransi = __toESM(require_src(), 1);
522
+ init_dist3();
523
+ init_dist2();
515
524
  a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
516
525
  t = [
517
526
  "January",
@@ -561,7 +570,7 @@ var init_dist3 = __esm({
561
570
  }
562
571
  });
563
572
 
564
- // node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs
573
+ // node_modules/.bun/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.mjs
565
574
  import { styleText as styleText2, stripVTControlCharacters } from "node:util";
566
575
  import process$1 from "node:process";
567
576
  import { existsSync, lstatSync, readdirSync } from "node:fs";
@@ -572,18 +581,18 @@ function isUnicodeSupported() {
572
581
  }
573
582
  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";
574
583
  }
575
- 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, MULTISELECT_INSTRUCTIONS, log, intro, outro, W, spinner, u2, SELECT_INSTRUCTIONS, i;
576
- var init_dist4 = __esm({
577
- "node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs"() {
584
+ 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, MULTISELECT_INSTRUCTIONS, log, intro, outro, Y, Z, spinner, u2, SELECT_INSTRUCTIONS, i;
585
+ var init_dist5 = __esm({
586
+ "node_modules/.bun/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.mjs"() {
578
587
  init_utils2();
579
- init_dist3();
580
- init_dist3();
588
+ init_dist4();
589
+ init_dist4();
581
590
  init_main();
582
591
  init_dist2();
583
- import_sisteransi2 = __toESM(require_src(), 1);
592
+ init_dist3();
584
593
  unicode = isUnicodeSupported();
585
594
  isCI = () => process.env.CI === "true";
586
- unicodeOr = (o, e) => unicode ? o : e;
595
+ unicodeOr = (e, o) => unicode ? e : o;
587
596
  S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
588
597
  S_STEP_CANCEL = unicodeOr("\u25A0", "x");
589
598
  S_STEP_ERROR = unicodeOr("\u25B2", "x");
@@ -619,11 +628,11 @@ var init_dist4 = __esm({
619
628
  symbol: e = styleText2("gray", S_BAR),
620
629
  secondarySymbol: r2 = styleText2("gray", S_BAR),
621
630
  output: m = process.stdout,
622
- spacing: l2 = 1,
623
- withGuide: c
631
+ spacing: l = 1,
632
+ withGuide: c2
624
633
  } = {}) => {
625
- const t2 = [], o = c ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
626
- for (let i2 = 0; i2 < l2; i2++)
634
+ const t2 = [], o = c2 ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
635
+ for (let i2 = 0; i2 < l; i2++)
627
636
  t2.push(f);
628
637
  const g = Array.isArray(s) ? s : s.split(`
629
638
  `);
@@ -669,83 +678,102 @@ ${styleText2("gray", S_BAR_END)} ` : "";
669
678
 
670
679
  `);
671
680
  };
672
- W = (l2) => styleText2("magenta", l2);
681
+ Y = 3e4;
682
+ Z = (c2) => styleText2("magenta", c2);
673
683
  spinner = ({
674
- indicator: l2 = "dots",
675
- onCancel: h2,
684
+ indicator: c2 = "dots",
685
+ onCancel: b,
676
686
  output: n2 = process.stdout,
677
- cancelMessage: G,
678
- errorMessage: O,
679
- frames: E = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
680
- delay: F = unicode ? 80 : 120,
681
- signal: m,
682
- ...I
687
+ cancelMessage: _,
688
+ errorMessage: C,
689
+ frames: M = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
690
+ delay: O = unicode ? 80 : 120,
691
+ signal: g,
692
+ ...E
683
693
  } = {}) => {
684
- const u3 = isCI();
685
- let M, T, d = false, S = false, s = "", p, w = performance.now();
686
- const x = getColumns(n2), k = I?.styleFrame ?? W, g = (e) => {
687
- const r2 = e > 1 ? O ?? settings.messages.error : G ?? settings.messages.cancel;
688
- S = e === 1, d && (a2(r2, e), S && typeof h2 == "function" && h2());
689
- }, f = () => g(2), i2 = () => g(1), A = () => {
690
- 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);
691
- }, H = () => {
692
- 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);
693
- }, y = () => {
694
- if (p === void 0) return;
694
+ const u3 = isCI(), h2 = isAccessible(E.accessible);
695
+ let x, I, p = false, l = false, r2 = "", v, w = performance.now();
696
+ const y = getColumns(n2), F = E?.styleFrame ?? Z, S = (e) => {
697
+ const s = e > 1 ? C ?? settings.messages.error : _ ?? settings.messages.cancel;
698
+ l = e === 1, p && (m(s, e), l && typeof b == "function" && b());
699
+ }, $ = () => S(2), a2 = () => S(1), H = () => {
700
+ process.on("uncaughtExceptionMonitor", $), process.on("unhandledRejection", $), process.on("SIGINT", a2), process.on("SIGTERM", a2), process.on("exit", S), g && g.addEventListener("abort", a2);
701
+ }, B = () => {
702
+ process.removeListener("uncaughtExceptionMonitor", $), process.removeListener("unhandledRejection", $), process.removeListener("SIGINT", a2), process.removeListener("SIGTERM", a2), process.removeListener("exit", S), g && g.removeEventListener("abort", a2);
703
+ }, R2 = () => {
704
+ if (v === void 0) return;
695
705
  u3 && n2.write(`
696
706
  `);
697
- const r2 = wrapAnsi(p, x, {
707
+ const s = wrapAnsi(v, y, {
698
708
  hard: true,
699
709
  trim: false
700
710
  }).split(`
701
711
  `);
702
- r2.length > 1 && n2.write(import_sisteransi2.cursor.up(r2.length - 1)), n2.write(import_sisteransi2.cursor.to(0)), n2.write(import_sisteransi2.erase.down());
703
- }, C = (e) => e.replace(/\.+$/, ""), _ = (e) => {
704
- const r2 = (performance.now() - e) / 1e3, t2 = Math.floor(r2 / 60), o = Math.floor(r2 % 60);
705
- return t2 > 0 ? `[${t2}m ${o}s]` : `[${o}s]`;
706
- }, N = I.withGuide ?? settings.withGuide, P = (e = "") => {
707
- d = true, M = block({ output: n2 }), s = C(e), w = performance.now(), N && n2.write(`${styleText2("gray", S_BAR)}
712
+ s.length > 1 && n2.write(cursor.up(s.length - 1)), n2.write(cursor.to(0)), n2.write(erase.down());
713
+ }, L = (e) => e.replace(/\.+$/, ""), T = (e) => {
714
+ const s = (performance.now() - e) / 1e3, i2 = Math.floor(s / 60), t2 = Math.floor(s % 60);
715
+ return i2 > 0 ? `[${i2}m ${t2}s]` : `[${t2}s]`;
716
+ }, N = E.withGuide ?? settings.withGuide, P = (e = "") => {
717
+ if (p = true, l = false, r2 = L(e), w = performance.now(), H(), h2) {
718
+ r2 !== "" && n2.write(`${r2}
719
+ `), I = setInterval(() => {
720
+ n2.write(r2 === "" ? `still working
721
+ ` : `still working: ${r2}
722
+ `);
723
+ }, Y);
724
+ return;
725
+ }
726
+ x = block({ output: n2 }), N && n2.write(`${styleText2("gray", S_BAR)}
708
727
  `);
709
- let r2 = 0, t2 = 0;
710
- A(), T = setInterval(() => {
711
- if (u3 && s === p)
728
+ let s = 0, i2 = 0;
729
+ I = setInterval(() => {
730
+ if (u3 && r2 === v)
712
731
  return;
713
- y(), p = s;
714
- const o = k(E[r2]);
715
- let v;
732
+ R2(), v = r2;
733
+ const t2 = F(M[s]);
734
+ let o;
716
735
  if (u3)
717
- v = `${o} ${s}...`;
718
- else if (l2 === "timer")
719
- v = `${o} ${s} ${_(w)}`;
736
+ o = `${t2} ${r2}...`;
737
+ else if (c2 === "timer")
738
+ o = `${t2} ${r2} ${T(w)}`;
720
739
  else {
721
- const B = ".".repeat(Math.floor(t2)).slice(0, 3);
722
- v = `${o} ${s}${B}`;
740
+ const j = ".".repeat(Math.floor(i2)).slice(0, 3);
741
+ o = `${t2} ${r2}${j}`;
723
742
  }
724
- const j = wrapAnsi(v, x, {
743
+ const D = wrapAnsi(o, y, {
725
744
  hard: true,
726
745
  trim: false
727
746
  });
728
- n2.write(j), r2 = r2 + 1 < E.length ? r2 + 1 : 0, t2 = t2 < 4 ? t2 + 0.125 : 0;
729
- }, F);
730
- }, a2 = (e = "", r2 = 0, t2 = false) => {
731
- if (!d) return;
732
- d = false, clearInterval(T), y();
733
- const o = r2 === 0 ? styleText2("green", S_STEP_SUBMIT) : r2 === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
734
- s = e ?? s, t2 || (l2 === "timer" ? n2.write(`${o} ${s} ${_(w)}
735
- `) : n2.write(`${o} ${s}
736
- `)), H(), M();
747
+ n2.write(D), s = s + 1 < M.length ? s + 1 : 0, i2 = i2 < 4 ? i2 + 0.125 : 0;
748
+ }, O);
749
+ }, m = (e = "", s = 0, i2 = false) => {
750
+ if (p) {
751
+ if (p = false, l = s === 1, clearInterval(I), h2 || R2(), r2 = e ?? r2, !i2)
752
+ if (h2) {
753
+ const t2 = s === 1 ? _ ?? settings.messages.cancel : s === 2 ? C ?? settings.messages.error : "Done", o = r2 || t2;
754
+ c2 === "timer" ? n2.write(`${o} ${T(w)}
755
+ `) : n2.write(`${o}
756
+ `);
757
+ } else {
758
+ const t2 = s === 0 ? styleText2("green", S_STEP_SUBMIT) : s === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
759
+ c2 === "timer" ? n2.write(`${t2} ${r2} ${T(w)}
760
+ `) : n2.write(`${t2} ${r2}
761
+ `);
762
+ }
763
+ B(), x?.();
764
+ }
737
765
  };
738
766
  return {
739
767
  start: P,
740
- stop: (e = "") => a2(e, 0),
768
+ stop: (e = "") => m(e, 0),
741
769
  message: (e = "") => {
742
- s = C(e ?? s);
770
+ r2 = L(e ?? r2);
743
771
  },
744
- cancel: (e = "") => a2(e, 1),
745
- error: (e = "") => a2(e, 2),
746
- clear: () => a2("", 0, true),
772
+ cancel: (e = "") => m(e, 1),
773
+ error: (e = "") => m(e, 2),
774
+ clear: () => m("", 0, true),
747
775
  get isCancelled() {
748
- return S;
776
+ return l;
749
777
  }
750
778
  };
751
779
  };
@@ -830,8 +858,8 @@ var init_cli_output = __esm({
830
858
  "packages/tooling/src/utils/cli-output.ts"() {
831
859
  "use strict";
832
860
  init_utils2();
833
- init_dist4();
834
- init_dist4();
861
+ init_dist5();
862
+ init_dist5();
835
863
  colors = {
836
864
  reset: "\x1B[0m",
837
865
  // Success (green)
@@ -987,7 +1015,7 @@ var init_errors = __esm({
987
1015
  * @param {DoNotDevErrorCode} code - Error code
988
1016
  * @param {object} [options] - Additional error options
989
1017
  * @param {Error} [options.originalError] - Original error if wrapping
990
- * @param {Record<string, any>} [options.context] - Additional context data
1018
+ * @param {Record<string, unknown>} [options.context] - Additional context data
991
1019
  * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
992
1020
  */
993
1021
  constructor(message, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
@@ -1017,7 +1045,7 @@ var init_errors = __esm({
1017
1045
  * @param {string} [context] - Additional context for the error
1018
1046
  * @param {DoNotDevErrorCode} [code='unknown-error'] - Error code
1019
1047
  * @param {object} [options] - Additional error options
1020
- * @param {Record<string, any>} [options.context] - Additional context data
1048
+ * @param {Record<string, unknown>} [options.context] - Additional context data
1021
1049
  * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
1022
1050
  * @returns {DoNotDevError} New DoNotDev error wrapping the original
1023
1051
  */
@@ -7068,6 +7096,9 @@ import {
7068
7096
  extname
7069
7097
  } from "node:path";
7070
7098
  import { fileURLToPath } from "node:url";
7099
+ function isEexistError(error2) {
7100
+ return typeof error2 === "object" && error2 !== null && "code" in error2 && error2.code === "EEXIST";
7101
+ }
7071
7102
  function safeExecuteAsync(fn, message) {
7072
7103
  return fn().catch((error2) => {
7073
7104
  throw new Error(
@@ -7439,7 +7470,7 @@ var init_PathResolver = __esm({
7439
7470
  try {
7440
7471
  await fs.promises.mkdir(dir, { recursive: true });
7441
7472
  } catch (error2) {
7442
- if (error2?.code !== "EEXIST") throw error2;
7473
+ if (!isEexistError(error2)) throw error2;
7443
7474
  }
7444
7475
  const detectedFormat = this._detectFormat(filePath, format);
7445
7476
  let writeContent;
@@ -7501,7 +7532,7 @@ var init_PathResolver = __esm({
7501
7532
  try {
7502
7533
  fs.mkdirSync(dir, { recursive: true });
7503
7534
  } catch (error2) {
7504
- if (error2?.code !== "EEXIST") throw error2;
7535
+ if (!isEexistError(error2)) throw error2;
7505
7536
  }
7506
7537
  const detectedFormat = this._detectFormat(filePath, format);
7507
7538
  let writeContent;
@@ -7558,7 +7589,7 @@ var init_PathResolver = __esm({
7558
7589
  try {
7559
7590
  await fs.promises.mkdir(dir, { recursive: true });
7560
7591
  } catch (error2) {
7561
- if (error2?.code !== "EEXIST") throw error2;
7592
+ if (!isEexistError(error2)) throw error2;
7562
7593
  }
7563
7594
  try {
7564
7595
  return await safeExecuteAsync(async () => {
@@ -7600,7 +7631,7 @@ var init_PathResolver = __esm({
7600
7631
  try {
7601
7632
  fs.mkdirSync(dir, { recursive: true });
7602
7633
  } catch (error2) {
7603
- if (error2?.code !== "EEXIST") throw error2;
7634
+ if (!isEexistError(error2)) throw error2;
7604
7635
  }
7605
7636
  try {
7606
7637
  fs.copyFileSync(srcPath, normalizedDestPath);
@@ -7716,7 +7747,7 @@ var init_PathResolver = __esm({
7716
7747
  try {
7717
7748
  await fs.promises.mkdir(dirPath, { recursive: true });
7718
7749
  } catch (error2) {
7719
- if (error2?.code !== "EEXIST") throw error2;
7750
+ if (!isEexistError(error2)) throw error2;
7720
7751
  }
7721
7752
  }
7722
7753
  /**
@@ -7728,7 +7759,7 @@ var init_PathResolver = __esm({
7728
7759
  try {
7729
7760
  fs.mkdirSync(dirPath, { recursive: true });
7730
7761
  } catch (error2) {
7731
- if (error2?.code !== "EEXIST") throw error2;
7762
+ if (!isEexistError(error2)) throw error2;
7732
7763
  }
7733
7764
  }
7734
7765
  /**
@@ -7977,6 +8008,7 @@ var init_PathResolver = __esm({
7977
8008
  * @param patternType - Type of patterns (css, routes, i18n, assets, pwa)
7978
8009
  * @returns Resolved patterns with absolute paths
7979
8010
  */
8011
+ // 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)
7980
8012
  async resolvePatterns(patternType) {
7981
8013
  if (!constants.getPatternsFor) {
7982
8014
  return { framework: [], consumer: [], all: [] };
@@ -8185,6 +8217,17 @@ var init_pathResolver = __esm({
8185
8217
  }
8186
8218
  });
8187
8219
 
8220
+ // packages/tooling/src/utils/type-guards.ts
8221
+ function isObjectLike(value) {
8222
+ return typeof value === "object" && value !== null;
8223
+ }
8224
+ var init_type_guards = __esm({
8225
+ "packages/tooling/src/utils/type-guards.ts"() {
8226
+ "use strict";
8227
+ init_utils2();
8228
+ }
8229
+ });
8230
+
8188
8231
  // packages/tooling/src/bundler/utils.ts
8189
8232
  import { Buffer as Buffer2 } from "node:buffer";
8190
8233
  import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
@@ -8227,6 +8270,7 @@ import { spawn } from "node:child_process";
8227
8270
  import { EOL as EOL2 } from "node:os";
8228
8271
  init_errors();
8229
8272
  init_pathResolver();
8273
+ init_type_guards();
8230
8274
  var PRIVATE_CORE_PACKAGES = [
8231
8275
  "@donotdev/types",
8232
8276
  "@donotdev/utils",
@@ -8312,11 +8356,11 @@ function discoverPackages(repoRoot, filter) {
8312
8356
  for (const packageFile of packageFiles) {
8313
8357
  try {
8314
8358
  const packageJson = readSync(packageFile, { format: "json" });
8315
- if (!packageJson || !packageJson.name) {
8359
+ if (!isObjectLike(packageJson) || typeof packageJson.name !== "string" || !packageJson.name) {
8316
8360
  continue;
8317
8361
  }
8318
8362
  const packageName = packageJson.name;
8319
- const scripts = packageJson.scripts || {};
8363
+ const scripts = isObjectLike(packageJson.scripts) ? packageJson.scripts : {};
8320
8364
  if (!packageName || !scripts["type-check"]) {
8321
8365
  continue;
8322
8366
  }