@donotdev/cli 0.2.2 → 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 (45) 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-next/src/app/AppDocument.tsx.example +57 -0
  33. package/templates/app-next/src/app/ClientLayout.tsx.example +6 -2
  34. package/templates/app-next/src/pages/legal/LegalNoticePage.tsx.example +1 -1
  35. package/templates/app-next/src/pages/legal/PrivacyPage.tsx.example +1 -1
  36. package/templates/app-next/src/pages/legal/TermsPage.tsx.example +1 -1
  37. package/templates/app-vite/src/pages/FormPageExample.tsx.example +21 -16
  38. package/templates/app-vite/src/pages/legal/LegalNoticePage.tsx.example +1 -1
  39. package/templates/app-vite/src/pages/legal/PrivacyPage.tsx.example +1 -1
  40. package/templates/app-vite/src/pages/legal/TermsPage.tsx.example +1 -1
  41. package/templates/overlay-supabase/src/config/providers.nextjs.ts.example +37 -0
  42. package/templates/root-consumer/.claude/hooks/guard-write.sh.example +5 -1
  43. package/templates/root-consumer/.gitignore.example +7 -1
  44. package/templates/app-next/src/app/layout.tsx.example +0 -80
  45. 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, n2 = Math.max(l2.length - 1, 0), e = t2 < 0 ? n2 : t2 > n2 ? 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, n2 = Math.max(l.length - 1, 0), e = t2 < 0 ? n2 : t2 > n2 ? 0 : t2;
477
+ return l[e]?.disabled ? findCursor(e, s < 0 ? -1 : 1, l) : e;
476
478
  }
477
479
  function isAccessible(n2) {
478
480
  if (n2 !== void 0) return n2;
@@ -515,40 +517,40 @@ function block({
515
517
  overwrite: o = true,
516
518
  hideCursor: n2 = 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 c = String(f);
527
- if (isActionKey([c, a2, w], "cancel")) {
528
- n2 && 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
+ n2 && r2.write(cursor.show), process.exit(0);
529
531
  return;
530
532
  }
531
533
  if (!o) return;
532
- const i2 = a2 === "return" ? 0 : -1, m2 = a2 === "return" ? -1 : 0;
533
- l.moveCursor(r2, i2, m2, () => {
534
- l.clearLine(r2, 1, () => {
534
+ const c2 = i2 === "return" ? 0 : -1, a2 = i2 === "return" ? -1 : 0;
535
+ f$1.moveCursor(r2, c2, a2, () => {
536
+ f$1.clearLine(r2, 1, () => {
535
537
  e.once("keypress", t2);
536
538
  });
537
539
  });
538
540
  };
539
- return n2 && r2.write(import_sisteransi.cursor.hide), e.once("keypress", t2), () => {
540
- 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();
541
+ return n2 && r2.write(cursor.hide), e.once("keypress", t2), () => {
542
+ e.off("keypress", t2), n2 && 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, n2 = 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((c, i2, m2) => {
550
- const d = t2 ? t2(c, i2) : c;
551
- return i2 === 0 ? `${n2}${d}` : i2 === m2.length - 1 ? `${s}${d}` : `${o}${d}`;
551
+ `).map((c2, a2, g) => {
552
+ const m2 = t2 ? t2(c2, a2) : c2;
553
+ return a2 === 0 ? `${n2}${m2}` : a2 === g.length - 1 ? `${s}${m2}` : `${o}${m2}`;
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, a;
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, a;
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, n2 - r2)), this.output.write(import_sisteransi.erase.lines(1));
769
+ this.output.write(cursor.move(0, n2 - r2)), this.output.write(erase.lines(1));
767
770
  const o = t2.split(`
768
771
  `);
769
- this.output.write(o[n2]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, o.length - n2 - 1));
772
+ this.output.write(o[n2]), this._prevFrame = t2, this.output.write(cursor.move(0, o.length - n2 - 1));
770
773
  return;
771
774
  } else if (e.lines.length > 1) {
772
775
  if (s < r2)
773
776
  n2 = s;
774
777
  else {
775
778
  const h2 = n2 - 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 m2 = t2.split(`
780
783
  `).slice(n2);
781
- this.output.write(f.join(`
784
+ this.output.write(m2.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
- a = class extends y {
812
+ a = class extends C$1 {
810
813
  options;
811
814
  cursor = 0;
812
815
  get _value() {
@@ -837,8 +840,8 @@ var init_dist3 = __esm({
837
840
  this.options.findIndex(({ value: t2 }) => t2 === e.cursorAt),
838
841
  0
839
842
  );
840
- this.cursor = this.options[i2]?.disabled ? findCursor(i2, 1, this.options) : i2, this.on("key", (t2, l2) => {
841
- l2.name === "a" && this.toggleAll(), l2.name === "i" && this.toggleInvert();
843
+ this.cursor = this.options[i2]?.disabled ? findCursor(i2, 1, this.options) : i2, this.on("key", (t2, s) => {
844
+ s.name === "a" && this.toggleAll(), s.name === "i" && this.toggleInvert(), s.name === void 0 && t2 === "\u3000" && this.toggleValue();
842
845
  }), this.on("cursor", (t2) => {
843
846
  switch (t2) {
844
847
  case "left":
@@ -859,7 +862,7 @@ var init_dist3 = __esm({
859
862
  }
860
863
  });
861
864
 
862
- // node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs
865
+ // node_modules/.bun/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.mjs
863
866
  import { styleText as styleText2, stripVTControlCharacters } from "node:util";
864
867
  import process$1 from "node:process";
865
868
  import { existsSync, lstatSync, readdirSync } from "node:fs";
@@ -870,22 +873,23 @@ function isUnicodeSupported() {
870
873
  }
871
874
  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";
872
875
  }
873
- function formatInstructionFooter(o, e) {
874
- const r2 = [`${e ? `${styleText2("cyan", S_BAR)} ` : ""}${o.join(" \u2022 ")}`];
875
- return e && r2.push(styleText2("cyan", S_BAR_END)), r2;
876
+ function formatInstructionFooter(e, o, r2) {
877
+ const s = r2 ? `${styleText2("cyan", S_BAR)} ` : "", n2 = wrapTextWithPrefix(e, o.join(" \u2022 "), s).split(`
878
+ `);
879
+ return r2 && n2.push(styleText2("cyan", S_BAR_END)), n2;
876
880
  }
877
- var import_sisteransi2, unicode, isCI, unicodeOr, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_BAR_START, S_BAR, S_BAR_END, S_BAR_START_RIGHT, S_BAR_END_RIGHT, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, S_PASSWORD_MASK, S_BAR_H, S_CORNER_TOP_RIGHT, S_CONNECT_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_BOTTOM_LEFT, S_CORNER_TOP_LEFT, S_INFO, S_SUCCESS, S_WARN, S_ERROR, symbol, symbolBar, I, limitOptions, confirm, MULTISELECT_INSTRUCTIONS, m, multiselect, log, cancel, intro, outro, W$1, C, note, W, spinner, u2, SELECT_INSTRUCTIONS, i;
878
- var init_dist4 = __esm({
879
- "node_modules/.bun/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs"() {
881
+ 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, m, multiselect, log, cancel, intro, outro, W, C2, note, Y, Z, spinner, u2, SELECT_INSTRUCTIONS, i;
882
+ var init_dist5 = __esm({
883
+ "node_modules/.bun/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.mjs"() {
880
884
  init_utils2();
881
- init_dist3();
882
- init_dist3();
885
+ init_dist4();
886
+ init_dist4();
883
887
  init_main();
884
888
  init_dist2();
885
- import_sisteransi2 = __toESM(require_src(), 1);
889
+ init_dist3();
886
890
  unicode = isUnicodeSupported();
887
891
  isCI = () => process.env.CI === "true";
888
- unicodeOr = (o, e) => unicode ? o : e;
892
+ unicodeOr = (e, o) => unicode ? e : o;
889
893
  S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
890
894
  S_STEP_CANCEL = unicodeOr("\u25A0", "x");
891
895
  S_STEP_ERROR = unicodeOr("\u25B2", "x");
@@ -911,8 +915,8 @@ var init_dist4 = __esm({
911
915
  S_SUCCESS = unicodeOr("\u25C6", "*");
912
916
  S_WARN = unicodeOr("\u25B2", "!");
913
917
  S_ERROR = unicodeOr("\u25A0", "x");
914
- symbol = (o) => {
915
- switch (o) {
918
+ symbol = (e) => {
919
+ switch (e) {
916
920
  case "initial":
917
921
  case "active":
918
922
  return styleText2("cyan", S_STEP_ACTIVE);
@@ -926,8 +930,8 @@ var init_dist4 = __esm({
926
930
  return styleText2("dim", S_STEP_ACTIVE);
927
931
  }
928
932
  };
929
- symbolBar = (o) => {
930
- switch (o) {
933
+ symbolBar = (e) => {
934
+ switch (e) {
931
935
  case "initial":
932
936
  case "active":
933
937
  return styleText2("cyan", S_BAR);
@@ -939,45 +943,45 @@ var init_dist4 = __esm({
939
943
  return styleText2("green", S_BAR);
940
944
  }
941
945
  };
942
- I = (l2, e, w, p, b, C2 = false) => {
946
+ E$1 = (l, e, w, p, b, C3 = false) => {
943
947
  let r2 = e, O = 0;
944
- if (C2)
948
+ if (C3)
945
949
  for (let i2 = p - 1; i2 >= w; i2--) {
946
- const m2 = l2[i2];
950
+ const m2 = l[i2];
947
951
  if (m2 && (r2 -= m2.length), O++, r2 <= b) break;
948
952
  }
949
953
  else
950
954
  for (let i2 = w; i2 < p; i2++) {
951
- const m2 = l2[i2];
955
+ const m2 = l[i2];
952
956
  if (m2 && (r2 -= m2.length), O++, r2 <= b) break;
953
957
  }
954
958
  return { lineCount: r2, removals: O };
955
959
  };
956
960
  limitOptions = ({
957
- cursor: l2,
961
+ cursor: l,
958
962
  options: e,
959
963
  style: w,
960
964
  output: p = process.stdout,
961
965
  maxItems: b = Number.POSITIVE_INFINITY,
962
- columnPadding: C2 = 0,
966
+ columnPadding: C3 = 0,
963
967
  rowPadding: r2 = 4
964
968
  }) => {
965
- const i2 = getColumns(p) - C2, m2 = getRows(p), M = styleText2("dim", "..."), v = Math.max(m2 - r2, 0), a2 = Math.max(Math.min(b, v), 5);
969
+ const i2 = getColumns(p) - C3, m2 = getRows(p), M = styleText2("dim", "..."), v = Math.max(m2 - r2, 0), a2 = Math.max(Math.min(b, v), 5);
966
970
  let f = 0;
967
- l2 >= a2 - 3 && (f = Math.max(
968
- Math.min(l2 - a2 + 3, e.length - a2),
971
+ l >= a2 - 3 && (f = Math.max(
972
+ Math.min(l - a2 + 3, e.length - a2),
969
973
  0
970
974
  ));
971
- let d = a2 < e.length && f > 0, c = a2 < e.length && f + a2 < e.length;
972
- const W2 = Math.min(
975
+ let d = a2 < e.length && f > 0, c2 = a2 < e.length && f + a2 < e.length;
976
+ const I = Math.min(
973
977
  f + a2,
974
978
  e.length
975
979
  ), s = [];
976
980
  let g = 0;
977
- d && g++, c && g++;
978
- const T = f + (d ? 1 : 0), y2 = W2 - (c ? 1 : 0);
979
- for (let t2 = T; t2 < y2; t2++) {
980
- const n2 = e[t2], o = n2 ? w(n2, t2 === l2) : "", h2 = wrapAnsi(o, i2, {
981
+ d && g++, c2 && g++;
982
+ const T = f + (d ? 1 : 0), W2 = I - (c2 ? 1 : 0);
983
+ for (let t2 = T; t2 < W2; t2++) {
984
+ const n2 = e[t2], o = n2 !== void 0 ? w(n2, t2 === l) : "", h2 = wrapAnsi(o, i2, {
981
985
  hard: true,
982
986
  trim: false
983
987
  }).split(`
@@ -986,9 +990,9 @@ var init_dist4 = __esm({
986
990
  }
987
991
  if (g > v) {
988
992
  let t2 = 0, n2 = 0, o = g;
989
- const h2 = l2 - T;
993
+ const h2 = l - T;
990
994
  let u3 = v;
991
- const L = () => I(s, o, 0, h2, u3), E = () => I(
995
+ const L = () => E$1(s, o, 0, h2, u3), y = () => E$1(
992
996
  s,
993
997
  o,
994
998
  h2 + 1,
@@ -996,14 +1000,14 @@ var init_dist4 = __esm({
996
1000
  u3,
997
1001
  true
998
1002
  );
999
- d ? ({ lineCount: o, removals: t2 } = L(), o > u3 && (c || (u3 -= 1), { lineCount: o, removals: n2 } = E())) : (c || (u3 -= 1), { lineCount: o, removals: n2 } = E(), o > u3 && (u3 -= 1, { lineCount: o, removals: t2 } = L())), t2 > 0 && (d = true, s.splice(0, t2)), n2 > 0 && (c = true, s.splice(s.length - n2, n2));
1003
+ d ? ({ lineCount: o, removals: t2 } = L(), o > u3 && (c2 || (u3 -= 1), { lineCount: o, removals: n2 } = y())) : (c2 || (u3 -= 1), { lineCount: o, removals: n2 } = y(), o > u3 && (u3 -= 1, { lineCount: o, removals: t2 } = L())), t2 > 0 && (d = true, s.splice(0, t2)), n2 > 0 && (c2 = true, s.splice(s.length - n2, n2));
1000
1004
  }
1001
1005
  const x = [];
1002
1006
  d && x.push(M);
1003
1007
  for (const t2 of s)
1004
1008
  for (const n2 of t2)
1005
1009
  x.push(n2);
1006
- return c && x.push(M), x;
1010
+ return c2 && x.push(M), x;
1007
1011
  };
1008
1012
  confirm = (e) => {
1009
1013
  const a2 = e.active ?? "Yes", o = e.inactive ?? "No";
@@ -1015,22 +1019,22 @@ var init_dist4 = __esm({
1015
1019
  output: e.output,
1016
1020
  initialValue: e.initialValue ?? true,
1017
1021
  render() {
1018
- const i2 = e.withGuide ?? settings.withGuide, u3 = `${symbol(this.state)} `, l2 = i2 ? `${styleText2("gray", S_BAR)} ` : "", f = wrapTextWithPrefix(
1022
+ const i2 = e.withGuide ?? settings.withGuide, u3 = `${symbol(this.state)} `, l = i2 ? `${styleText2("gray", S_BAR)} ` : "", f = wrapTextWithPrefix(
1019
1023
  e.output,
1020
1024
  e.message,
1021
- l2,
1025
+ l,
1022
1026
  u3
1023
1027
  ), s = `${i2 ? `${styleText2("gray", S_BAR)}
1024
1028
  ` : ""}${f}
1025
- `, c = this.value ? a2 : o;
1029
+ `, c2 = this.value ? a2 : o;
1026
1030
  switch (this.state) {
1027
1031
  case "submit": {
1028
1032
  const r2 = i2 ? `${styleText2("gray", S_BAR)} ` : "";
1029
- return `${s}${r2}${styleText2("dim", c)}`;
1033
+ return `${s}${r2}${styleText2("dim", c2)}`;
1030
1034
  }
1031
1035
  case "cancel": {
1032
1036
  const r2 = i2 ? `${styleText2("gray", S_BAR)} ` : "";
1033
- return `${s}${r2}${styleText2(["strikethrough", "dim"], c)}${i2 ? `
1037
+ return `${s}${r2}${styleText2(["strikethrough", "dim"], c2)}${i2 ? `
1034
1038
  ${styleText2("gray", S_BAR)}` : ""}`;
1035
1039
  }
1036
1040
  default: {
@@ -1050,22 +1054,22 @@ ${g}
1050
1054
  `${styleText2("dim", "Space:")} select`,
1051
1055
  `${styleText2("dim", "Enter:")} confirm`
1052
1056
  ];
1053
- m = (i2, u3) => i2.split(`
1057
+ m = (n2, u3) => n2.split(`
1054
1058
  `).map((d) => u3(d)).join(`
1055
1059
  `);
1056
- multiselect = (i2) => {
1060
+ multiselect = (n2) => {
1057
1061
  const u3 = (t2, a2) => {
1058
1062
  const r2 = t2.label ?? String(t2.value);
1059
1063
  return a2 === "disabled" ? `${styleText2("gray", S_CHECKBOX_INACTIVE)} ${m(r2, (o) => styleText2(["strikethrough", "gray"], o))}${t2.hint ? ` ${styleText2("dim", `(${t2.hint ?? "disabled"})`)}` : ""}` : a2 === "active" ? `${styleText2("cyan", S_CHECKBOX_ACTIVE)} ${r2}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : a2 === "selected" ? `${styleText2("green", S_CHECKBOX_SELECTED)} ${m(r2, (o) => styleText2("dim", o))}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : a2 === "cancelled" ? `${m(r2, (o) => styleText2(["strikethrough", "dim"], o))}` : a2 === "active-selected" ? `${styleText2("green", S_CHECKBOX_SELECTED)} ${r2}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : a2 === "submitted" ? `${m(r2, (o) => styleText2("dim", o))}` : `${styleText2("dim", S_CHECKBOX_INACTIVE)} ${m(r2, (o) => styleText2("dim", o))}`;
1060
- }, d = i2.required ?? true, x = i2.showInstructions ?? true;
1064
+ }, d = n2.required ?? true, x = n2.showInstructions ?? true;
1061
1065
  return new a({
1062
- options: i2.options,
1063
- signal: i2.signal,
1064
- input: i2.input,
1065
- output: i2.output,
1066
- initialValues: i2.initialValues,
1066
+ options: n2.options,
1067
+ signal: n2.signal,
1068
+ input: n2.input,
1069
+ output: n2.output,
1070
+ initialValues: n2.initialValues,
1067
1071
  required: d,
1068
- cursorAt: i2.cursorAt,
1072
+ cursorAt: n2.cursorAt,
1069
1073
  validate(t2) {
1070
1074
  if (d && (t2 === void 0 || t2.length === 0))
1071
1075
  return `Please select at least one option.
@@ -1081,75 +1085,75 @@ ${styleText2(
1081
1085
  )}`;
1082
1086
  },
1083
1087
  render() {
1084
- const t2 = i2.withGuide ?? settings.withGuide, a2 = wrapTextWithPrefix(
1085
- i2.output,
1086
- i2.message,
1088
+ const t2 = n2.withGuide ?? settings.withGuide, a2 = wrapTextWithPrefix(
1089
+ n2.output,
1090
+ n2.message,
1087
1091
  t2 ? `${symbolBar(this.state)} ` : "",
1088
1092
  `${symbol(this.state)} `
1089
1093
  ), r2 = `${t2 ? `${styleText2("gray", S_BAR)}
1090
1094
  ` : ""}${a2}
1091
- `, o = this.value ?? [], g = (n2, l2) => {
1092
- if (n2.disabled)
1093
- return u3(n2, "disabled");
1094
- const s = o.includes(n2.value);
1095
- return l2 && s ? u3(n2, "active-selected") : s ? u3(n2, "selected") : u3(n2, l2 ? "active" : "inactive");
1095
+ `, o = this.value ?? [], g = (i2, l) => {
1096
+ if (i2.disabled)
1097
+ return u3(i2, "disabled");
1098
+ const s = o.includes(i2.value);
1099
+ return l && s ? u3(i2, "active-selected") : s ? u3(i2, "selected") : u3(i2, l ? "active" : "inactive");
1096
1100
  };
1097
1101
  switch (this.state) {
1098
1102
  case "submit": {
1099
- const n2 = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u3(s, "submitted")).join(styleText2("dim", ", ")) || styleText2("dim", "none"), l2 = wrapTextWithPrefix(
1100
- i2.output,
1101
- n2,
1103
+ const i2 = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u3(s, "submitted")).join(styleText2("dim", ", ")) || styleText2("dim", "none"), l = wrapTextWithPrefix(
1104
+ n2.output,
1105
+ i2,
1102
1106
  t2 ? `${styleText2("gray", S_BAR)} ` : ""
1103
1107
  );
1104
- return `${r2}${l2}`;
1108
+ return `${r2}${l}`;
1105
1109
  }
1106
1110
  case "cancel": {
1107
- const n2 = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u3(s, "cancelled")).join(styleText2("dim", ", "));
1108
- if (n2.trim() === "")
1111
+ const i2 = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u3(s, "cancelled")).join(styleText2("dim", ", "));
1112
+ if (i2.trim() === "")
1109
1113
  return `${r2}${styleText2("gray", S_BAR)}`;
1110
- const l2 = wrapTextWithPrefix(
1111
- i2.output,
1112
- n2,
1114
+ const l = wrapTextWithPrefix(
1115
+ n2.output,
1116
+ i2,
1113
1117
  t2 ? `${styleText2("gray", S_BAR)} ` : ""
1114
1118
  );
1115
- return `${r2}${l2}${t2 ? `
1119
+ return `${r2}${l}${t2 ? `
1116
1120
  ${styleText2("gray", S_BAR)}` : ""}`;
1117
1121
  }
1118
1122
  case "error": {
1119
- const n2 = t2 ? `${styleText2("yellow", S_BAR)} ` : "", l2 = this.error.split(`
1123
+ const i2 = t2 ? `${styleText2("yellow", S_BAR)} ` : "", l = this.error.split(`
1120
1124
  `).map(
1121
1125
  ($, v) => v === 0 ? `${t2 ? `${styleText2("yellow", S_BAR_END)} ` : ""}${styleText2("yellow", $)}` : ` ${$}`
1122
1126
  ).join(`
1123
1127
  `), s = r2.split(`
1124
- `).length, h2 = l2.split(`
1128
+ `).length, h2 = l.split(`
1125
1129
  `).length + 1;
1126
- return `${r2}${n2}${limitOptions({
1127
- output: i2.output,
1130
+ return `${r2}${i2}${limitOptions({
1131
+ output: n2.output,
1128
1132
  options: this.options,
1129
1133
  cursor: this.cursor,
1130
- maxItems: i2.maxItems,
1131
- columnPadding: n2.length,
1134
+ maxItems: n2.maxItems,
1135
+ columnPadding: i2.length,
1132
1136
  rowPadding: s + h2,
1133
1137
  style: g
1134
1138
  }).join(`
1135
- ${n2}`)}
1136
- ${l2}
1139
+ ${i2}`)}
1140
+ ${l}
1137
1141
  `;
1138
1142
  }
1139
1143
  default: {
1140
- const n2 = t2 ? `${styleText2("cyan", S_BAR)} ` : "", l2 = r2.split(`
1141
- `).length, s = x ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, t2) : t2 ? [styleText2("cyan", S_BAR_END)] : [], h2 = s.join(`
1144
+ const i2 = t2 ? `${styleText2("cyan", S_BAR)} ` : "", l = r2.split(`
1145
+ `).length, s = x ? formatInstructionFooter(n2.output, MULTISELECT_INSTRUCTIONS, t2) : t2 ? [styleText2("cyan", S_BAR_END)] : [], h2 = s.join(`
1142
1146
  `), $ = s.length + 1;
1143
- return `${r2}${n2}${limitOptions({
1144
- output: i2.output,
1147
+ return `${r2}${i2}${limitOptions({
1148
+ output: n2.output,
1145
1149
  options: this.options,
1146
1150
  cursor: this.cursor,
1147
- maxItems: i2.maxItems,
1148
- columnPadding: n2.length,
1149
- rowPadding: l2 + $,
1151
+ maxItems: n2.maxItems,
1152
+ columnPadding: i2.length,
1153
+ rowPadding: l + $,
1150
1154
  style: g
1151
1155
  }).join(`
1152
- ${n2}`)}
1156
+ ${i2}`)}
1153
1157
  ${h2}
1154
1158
  `;
1155
1159
  }
@@ -1162,18 +1166,18 @@ ${h2}
1162
1166
  symbol: e = styleText2("gray", S_BAR),
1163
1167
  secondarySymbol: r2 = styleText2("gray", S_BAR),
1164
1168
  output: m2 = process.stdout,
1165
- spacing: l2 = 1,
1166
- withGuide: c
1169
+ spacing: l = 1,
1170
+ withGuide: c2
1167
1171
  } = {}) => {
1168
- const t2 = [], o = c ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
1169
- for (let i2 = 0; i2 < l2; i2++)
1172
+ const t2 = [], o = c2 ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
1173
+ for (let i2 = 0; i2 < l; i2++)
1170
1174
  t2.push(f);
1171
1175
  const g = Array.isArray(s) ? s : s.split(`
1172
1176
  `);
1173
1177
  if (g.length > 0) {
1174
- const [i2, ...y2] = g;
1178
+ const [i2, ...y] = g;
1175
1179
  i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
1176
- for (const p of y2)
1180
+ for (const p of y)
1177
1181
  p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
1178
1182
  }
1179
1183
  m2.write(`${t2.join(`
@@ -1218,18 +1222,18 @@ ${styleText2("gray", S_BAR_END)} ` : "";
1218
1222
 
1219
1223
  `);
1220
1224
  };
1221
- W$1 = (o) => o;
1222
- C = (o, e, s) => {
1225
+ W = (o) => o;
1226
+ C2 = (o, e, s) => {
1223
1227
  const a2 = {
1224
1228
  hard: true,
1225
1229
  trim: false
1226
1230
  }, i2 = wrapAnsi(o, e, a2).split(`
1227
- `), c = i2.reduce((n2, t2) => Math.max(dist_default2(t2), n2), 0), u3 = i2.map(s).reduce((n2, t2) => Math.max(dist_default2(t2), n2), 0), g = e - (u3 - c);
1231
+ `), c2 = i2.reduce((n2, t2) => Math.max(dist_default2(t2), n2), 0), u3 = i2.map(s).reduce((n2, t2) => Math.max(dist_default2(t2), n2), 0), g = e - (u3 - c2);
1228
1232
  return wrapAnsi(o, g, a2);
1229
1233
  };
1230
1234
  note = (o = "", e = "", s) => {
1231
- const a2 = s?.output ?? process$1.stdout, i2 = s?.withGuide ?? settings.withGuide, c = s?.format ?? W$1, g = ["", ...C(o, getColumns(a2) - 6, c).split(`
1232
- `).map(c), ""], n2 = dist_default2(e), t2 = Math.max(
1235
+ const a2 = s?.output ?? process$1.stdout, i2 = s?.withGuide ?? settings.withGuide, c2 = s?.format ?? W, g = ["", ...C2(o, getColumns(a2) - 6, c2).split(`
1236
+ `).map(c2), ""], n2 = dist_default2(e), t2 = Math.max(
1233
1237
  g.reduce((m2, F) => {
1234
1238
  const O = dist_default2(F);
1235
1239
  return O > m2 ? O : m2;
@@ -1250,83 +1254,102 @@ ${styleText2("gray", l$1 + S_BAR_H.repeat(t2 + 2) + S_CORNER_BOTTOM_RIGHT)}
1250
1254
  `
1251
1255
  );
1252
1256
  };
1253
- W = (l2) => styleText2("magenta", l2);
1257
+ Y = 3e4;
1258
+ Z = (c2) => styleText2("magenta", c2);
1254
1259
  spinner = ({
1255
- indicator: l2 = "dots",
1256
- onCancel: h2,
1260
+ indicator: c2 = "dots",
1261
+ onCancel: b,
1257
1262
  output: n2 = process.stdout,
1258
- cancelMessage: G,
1259
- errorMessage: O,
1260
- frames: E = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
1261
- delay: F = unicode ? 80 : 120,
1262
- signal: m2,
1263
- ...I2
1263
+ cancelMessage: _,
1264
+ errorMessage: C3,
1265
+ frames: M = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
1266
+ delay: O = unicode ? 80 : 120,
1267
+ signal: g,
1268
+ ...E
1264
1269
  } = {}) => {
1265
- const u3 = isCI();
1266
- let M, T, d = false, S = false, s = "", p, w = performance.now();
1267
- const x = getColumns(n2), k = I2?.styleFrame ?? W, g = (e) => {
1268
- const r2 = e > 1 ? O ?? settings.messages.error : G ?? settings.messages.cancel;
1269
- S = e === 1, d && (a2(r2, e), S && typeof h2 == "function" && h2());
1270
- }, f = () => g(2), i2 = () => g(1), A = () => {
1271
- process.on("uncaughtExceptionMonitor", f), process.on("unhandledRejection", f), process.on("SIGINT", i2), process.on("SIGTERM", i2), process.on("exit", g), m2 && m2.addEventListener("abort", i2);
1272
- }, H = () => {
1273
- process.removeListener("uncaughtExceptionMonitor", f), process.removeListener("unhandledRejection", f), process.removeListener("SIGINT", i2), process.removeListener("SIGTERM", i2), process.removeListener("exit", g), m2 && m2.removeEventListener("abort", i2);
1274
- }, y2 = () => {
1275
- if (p === void 0) return;
1270
+ const u3 = isCI(), h2 = isAccessible(E.accessible);
1271
+ let x, I, p = false, l = false, r2 = "", v, w = performance.now();
1272
+ const y = getColumns(n2), F = E?.styleFrame ?? Z, S = (e) => {
1273
+ const s = e > 1 ? C3 ?? settings.messages.error : _ ?? settings.messages.cancel;
1274
+ l = e === 1, p && (m2(s, e), l && typeof b == "function" && b());
1275
+ }, $ = () => S(2), a2 = () => S(1), H = () => {
1276
+ process.on("uncaughtExceptionMonitor", $), process.on("unhandledRejection", $), process.on("SIGINT", a2), process.on("SIGTERM", a2), process.on("exit", S), g && g.addEventListener("abort", a2);
1277
+ }, B = () => {
1278
+ process.removeListener("uncaughtExceptionMonitor", $), process.removeListener("unhandledRejection", $), process.removeListener("SIGINT", a2), process.removeListener("SIGTERM", a2), process.removeListener("exit", S), g && g.removeEventListener("abort", a2);
1279
+ }, R2 = () => {
1280
+ if (v === void 0) return;
1276
1281
  u3 && n2.write(`
1277
1282
  `);
1278
- const r2 = wrapAnsi(p, x, {
1283
+ const s = wrapAnsi(v, y, {
1279
1284
  hard: true,
1280
1285
  trim: false
1281
1286
  }).split(`
1282
1287
  `);
1283
- 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());
1284
- }, C2 = (e) => e.replace(/\.+$/, ""), _ = (e) => {
1285
- const r2 = (performance.now() - e) / 1e3, t2 = Math.floor(r2 / 60), o = Math.floor(r2 % 60);
1286
- return t2 > 0 ? `[${t2}m ${o}s]` : `[${o}s]`;
1287
- }, N = I2.withGuide ?? settings.withGuide, P = (e = "") => {
1288
- d = true, M = block({ output: n2 }), s = C2(e), w = performance.now(), N && n2.write(`${styleText2("gray", S_BAR)}
1288
+ s.length > 1 && n2.write(cursor.up(s.length - 1)), n2.write(cursor.to(0)), n2.write(erase.down());
1289
+ }, L = (e) => e.replace(/\.+$/, ""), T = (e) => {
1290
+ const s = (performance.now() - e) / 1e3, i2 = Math.floor(s / 60), t2 = Math.floor(s % 60);
1291
+ return i2 > 0 ? `[${i2}m ${t2}s]` : `[${t2}s]`;
1292
+ }, N = E.withGuide ?? settings.withGuide, P = (e = "") => {
1293
+ if (p = true, l = false, r2 = L(e), w = performance.now(), H(), h2) {
1294
+ r2 !== "" && n2.write(`${r2}
1295
+ `), I = setInterval(() => {
1296
+ n2.write(r2 === "" ? `still working
1297
+ ` : `still working: ${r2}
1298
+ `);
1299
+ }, Y);
1300
+ return;
1301
+ }
1302
+ x = block({ output: n2 }), N && n2.write(`${styleText2("gray", S_BAR)}
1289
1303
  `);
1290
- let r2 = 0, t2 = 0;
1291
- A(), T = setInterval(() => {
1292
- if (u3 && s === p)
1304
+ let s = 0, i2 = 0;
1305
+ I = setInterval(() => {
1306
+ if (u3 && r2 === v)
1293
1307
  return;
1294
- y2(), p = s;
1295
- const o = k(E[r2]);
1296
- let v;
1308
+ R2(), v = r2;
1309
+ const t2 = F(M[s]);
1310
+ let o;
1297
1311
  if (u3)
1298
- v = `${o} ${s}...`;
1299
- else if (l2 === "timer")
1300
- v = `${o} ${s} ${_(w)}`;
1312
+ o = `${t2} ${r2}...`;
1313
+ else if (c2 === "timer")
1314
+ o = `${t2} ${r2} ${T(w)}`;
1301
1315
  else {
1302
- const B = ".".repeat(Math.floor(t2)).slice(0, 3);
1303
- v = `${o} ${s}${B}`;
1316
+ const j = ".".repeat(Math.floor(i2)).slice(0, 3);
1317
+ o = `${t2} ${r2}${j}`;
1304
1318
  }
1305
- const j = wrapAnsi(v, x, {
1319
+ const D = wrapAnsi(o, y, {
1306
1320
  hard: true,
1307
1321
  trim: false
1308
1322
  });
1309
- n2.write(j), r2 = r2 + 1 < E.length ? r2 + 1 : 0, t2 = t2 < 4 ? t2 + 0.125 : 0;
1310
- }, F);
1311
- }, a2 = (e = "", r2 = 0, t2 = false) => {
1312
- if (!d) return;
1313
- d = false, clearInterval(T), y2();
1314
- const o = r2 === 0 ? styleText2("green", S_STEP_SUBMIT) : r2 === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
1315
- s = e ?? s, t2 || (l2 === "timer" ? n2.write(`${o} ${s} ${_(w)}
1316
- `) : n2.write(`${o} ${s}
1317
- `)), H(), M();
1323
+ n2.write(D), s = s + 1 < M.length ? s + 1 : 0, i2 = i2 < 4 ? i2 + 0.125 : 0;
1324
+ }, O);
1325
+ }, m2 = (e = "", s = 0, i2 = false) => {
1326
+ if (p) {
1327
+ if (p = false, l = s === 1, clearInterval(I), h2 || R2(), r2 = e ?? r2, !i2)
1328
+ if (h2) {
1329
+ const t2 = s === 1 ? _ ?? settings.messages.cancel : s === 2 ? C3 ?? settings.messages.error : "Done", o = r2 || t2;
1330
+ c2 === "timer" ? n2.write(`${o} ${T(w)}
1331
+ `) : n2.write(`${o}
1332
+ `);
1333
+ } else {
1334
+ const t2 = s === 0 ? styleText2("green", S_STEP_SUBMIT) : s === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
1335
+ c2 === "timer" ? n2.write(`${t2} ${r2} ${T(w)}
1336
+ `) : n2.write(`${t2} ${r2}
1337
+ `);
1338
+ }
1339
+ B(), x?.();
1340
+ }
1318
1341
  };
1319
1342
  return {
1320
1343
  start: P,
1321
- stop: (e = "") => a2(e, 0),
1344
+ stop: (e = "") => m2(e, 0),
1322
1345
  message: (e = "") => {
1323
- s = C2(e ?? s);
1346
+ r2 = L(e ?? r2);
1324
1347
  },
1325
- cancel: (e = "") => a2(e, 1),
1326
- error: (e = "") => a2(e, 2),
1327
- clear: () => a2("", 0, true),
1348
+ cancel: (e = "") => m2(e, 1),
1349
+ error: (e = "") => m2(e, 2),
1350
+ clear: () => m2("", 0, true),
1328
1351
  get isCancelled() {
1329
- return S;
1352
+ return l;
1330
1353
  }
1331
1354
  };
1332
1355
  };
@@ -1389,8 +1412,8 @@ var init_cli_output = __esm({
1389
1412
  "packages/tooling/src/utils/cli-output.ts"() {
1390
1413
  "use strict";
1391
1414
  init_utils2();
1392
- init_dist4();
1393
- init_dist4();
1415
+ init_dist5();
1416
+ init_dist5();
1394
1417
  colors = {
1395
1418
  reset: "\x1B[0m",
1396
1419
  // Success (green)
@@ -1541,7 +1564,7 @@ var init_errors = __esm({
1541
1564
  * @param {DoNotDevErrorCode} code - Error code
1542
1565
  * @param {object} [options] - Additional error options
1543
1566
  * @param {Error} [options.originalError] - Original error if wrapping
1544
- * @param {Record<string, any>} [options.context] - Additional context data
1567
+ * @param {Record<string, unknown>} [options.context] - Additional context data
1545
1568
  * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
1546
1569
  */
1547
1570
  constructor(message, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
@@ -1571,7 +1594,7 @@ var init_errors = __esm({
1571
1594
  * @param {string} [context] - Additional context for the error
1572
1595
  * @param {DoNotDevErrorCode} [code='unknown-error'] - Error code
1573
1596
  * @param {object} [options] - Additional error options
1574
- * @param {Record<string, any>} [options.context] - Additional context data
1597
+ * @param {Record<string, unknown>} [options.context] - Additional context data
1575
1598
  * @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
1576
1599
  * @returns {DoNotDevError} New DoNotDev error wrapping the original
1577
1600
  */
@@ -7622,6 +7645,9 @@ import {
7622
7645
  extname
7623
7646
  } from "node:path";
7624
7647
  import { fileURLToPath } from "node:url";
7648
+ function isEexistError(error2) {
7649
+ return typeof error2 === "object" && error2 !== null && "code" in error2 && error2.code === "EEXIST";
7650
+ }
7625
7651
  function safeExecuteAsync(fn, message) {
7626
7652
  return fn().catch((error2) => {
7627
7653
  throw new Error(
@@ -7993,7 +8019,7 @@ var init_PathResolver = __esm({
7993
8019
  try {
7994
8020
  await fs.promises.mkdir(dir, { recursive: true });
7995
8021
  } catch (error2) {
7996
- if (error2?.code !== "EEXIST") throw error2;
8022
+ if (!isEexistError(error2)) throw error2;
7997
8023
  }
7998
8024
  const detectedFormat = this._detectFormat(filePath, format);
7999
8025
  let writeContent;
@@ -8055,7 +8081,7 @@ var init_PathResolver = __esm({
8055
8081
  try {
8056
8082
  fs.mkdirSync(dir, { recursive: true });
8057
8083
  } catch (error2) {
8058
- if (error2?.code !== "EEXIST") throw error2;
8084
+ if (!isEexistError(error2)) throw error2;
8059
8085
  }
8060
8086
  const detectedFormat = this._detectFormat(filePath, format);
8061
8087
  let writeContent;
@@ -8112,7 +8138,7 @@ var init_PathResolver = __esm({
8112
8138
  try {
8113
8139
  await fs.promises.mkdir(dir, { recursive: true });
8114
8140
  } catch (error2) {
8115
- if (error2?.code !== "EEXIST") throw error2;
8141
+ if (!isEexistError(error2)) throw error2;
8116
8142
  }
8117
8143
  try {
8118
8144
  return await safeExecuteAsync(async () => {
@@ -8154,7 +8180,7 @@ var init_PathResolver = __esm({
8154
8180
  try {
8155
8181
  fs.mkdirSync(dir, { recursive: true });
8156
8182
  } catch (error2) {
8157
- if (error2?.code !== "EEXIST") throw error2;
8183
+ if (!isEexistError(error2)) throw error2;
8158
8184
  }
8159
8185
  try {
8160
8186
  fs.copyFileSync(srcPath, normalizedDestPath);
@@ -8270,7 +8296,7 @@ var init_PathResolver = __esm({
8270
8296
  try {
8271
8297
  await fs.promises.mkdir(dirPath, { recursive: true });
8272
8298
  } catch (error2) {
8273
- if (error2?.code !== "EEXIST") throw error2;
8299
+ if (!isEexistError(error2)) throw error2;
8274
8300
  }
8275
8301
  }
8276
8302
  /**
@@ -8282,7 +8308,7 @@ var init_PathResolver = __esm({
8282
8308
  try {
8283
8309
  fs.mkdirSync(dirPath, { recursive: true });
8284
8310
  } catch (error2) {
8285
- if (error2?.code !== "EEXIST") throw error2;
8311
+ if (!isEexistError(error2)) throw error2;
8286
8312
  }
8287
8313
  }
8288
8314
  /**
@@ -8531,6 +8557,7 @@ var init_PathResolver = __esm({
8531
8557
  * @param patternType - Type of patterns (css, routes, i18n, assets, pwa)
8532
8558
  * @returns Resolved patterns with absolute paths
8533
8559
  */
8560
+ // 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)
8534
8561
  async resolvePatterns(patternType) {
8535
8562
  if (!constants.getPatternsFor) {
8536
8563
  return { framework: [], consumer: [], all: [] };
@@ -8855,6 +8882,17 @@ var init_pathResolver = __esm({
8855
8882
  }
8856
8883
  });
8857
8884
 
8885
+ // packages/tooling/src/utils/type-guards.ts
8886
+ function asText(value) {
8887
+ return typeof value === "string" ? value : null;
8888
+ }
8889
+ var init_type_guards = __esm({
8890
+ "packages/tooling/src/utils/type-guards.ts"() {
8891
+ "use strict";
8892
+ init_utils2();
8893
+ }
8894
+ });
8895
+
8858
8896
  // packages/tooling/src/bundler/utils.ts
8859
8897
  import { Buffer as Buffer2 } from "node:buffer";
8860
8898
  import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
@@ -8900,7 +8938,7 @@ async function askForMultiSelection(message, choices, defaultIndices = []) {
8900
8938
  label: choice.title,
8901
8939
  hint: choice.hint
8902
8940
  }));
8903
- const initialValues = defaultIndices.map((i2) => choices[i2]?.value).filter(Boolean);
8941
+ const initialValues = defaultIndices.map((i2) => choices[i2]?.value).filter((value) => Boolean(value));
8904
8942
  const result = await multiselect({
8905
8943
  message,
8906
8944
  options,
@@ -8916,7 +8954,7 @@ var init_cli_input = __esm({
8916
8954
  "packages/tooling/src/utils/cli-input.ts"() {
8917
8955
  "use strict";
8918
8956
  init_utils2();
8919
- init_dist4();
8957
+ init_dist5();
8920
8958
  }
8921
8959
  });
8922
8960
 
@@ -9048,7 +9086,8 @@ function writePackageJson(filePath, pkg) {
9048
9086
  if (!obj) return void 0;
9049
9087
  const sorted2 = {};
9050
9088
  for (const key of Object.keys(obj).sort()) {
9051
- sorted2[key] = obj[key];
9089
+ const value = obj[key];
9090
+ if (value !== void 0) sorted2[key] = value;
9052
9091
  }
9053
9092
  return sorted2;
9054
9093
  };
@@ -9090,24 +9129,24 @@ function ensureCaretPrefix(version) {
9090
9129
  return `^${version}`;
9091
9130
  }
9092
9131
  function compareVersions(current, expected) {
9093
- const c = normalizeVersion(current).split(".").map(Number);
9132
+ const c2 = normalizeVersion(current).split(".").map(Number);
9094
9133
  const e = normalizeVersion(expected).split(".").map(Number);
9095
- for (let i2 = 0; i2 < Math.max(c.length, e.length); i2++) {
9096
- const cv = c[i2] || 0;
9134
+ for (let i2 = 0; i2 < Math.max(c2.length, e.length); i2++) {
9135
+ const cv = c2[i2] || 0;
9097
9136
  const ev = e[i2] || 0;
9098
9137
  if (cv < ev)
9099
9138
  return {
9100
9139
  behind: true,
9101
9140
  ahead: false,
9102
9141
  equal: false,
9103
- isMajor: (c[0] || 0) !== (e[0] || 0)
9142
+ isMajor: (c2[0] || 0) !== (e[0] || 0)
9104
9143
  };
9105
9144
  if (cv > ev)
9106
9145
  return {
9107
9146
  behind: false,
9108
9147
  ahead: true,
9109
9148
  equal: false,
9110
- isMajor: (c[0] || 0) !== (e[0] || 0)
9149
+ isMajor: (c2[0] || 0) !== (e[0] || 0)
9111
9150
  };
9112
9151
  }
9113
9152
  return { behind: false, ahead: false, equal: true, isMajor: false };
@@ -9160,7 +9199,7 @@ function syncDonotdevToMatrix(matrix, donotdevVersions, dryRun) {
9160
9199
  }
9161
9200
  }
9162
9201
  if (changes.length > 0 && !dryRun) {
9163
- matrix.lastUpdated = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
9202
+ matrix.lastUpdated = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
9164
9203
  try {
9165
9204
  const require3 = createRequire5(import.meta.url);
9166
9205
  const matrixPath = require3.resolve("@donotdev/cli/dependencies-matrix.json");
@@ -9378,6 +9417,7 @@ init_utils2();
9378
9417
  init_cli_output();
9379
9418
  init_errors();
9380
9419
  init_pathResolver();
9420
+ init_type_guards();
9381
9421
  var PRESERVE_MAP = {
9382
9422
  demo: [],
9383
9423
  dndev: ["commands.ts"]
@@ -9530,10 +9570,10 @@ async function syncApp(appName, options = {}) {
9530
9570
  continue;
9531
9571
  }
9532
9572
  if (!pathExists(sourceFile)) continue;
9533
- const content = await read(sourceFile, { format: "text" });
9573
+ const content = asText(await read(sourceFile, { format: "text" }));
9534
9574
  if (!content) continue;
9535
9575
  if (pathExists(destFile)) {
9536
- const existing = await read(destFile, { format: "text" });
9576
+ const existing = asText(await read(destFile, { format: "text" }));
9537
9577
  if (existing === content) continue;
9538
9578
  }
9539
9579
  if (dryRun) {
@@ -9564,6 +9604,7 @@ init_utils2();
9564
9604
  init_cli_output();
9565
9605
  init_errors();
9566
9606
  init_pathResolver();
9607
+ init_type_guards();
9567
9608
  var SYNC_PATHS = [
9568
9609
  // Documentation
9569
9610
  "guides/**/*.md.example",
@@ -9638,15 +9679,17 @@ async function syncFile(sourcePath, destPath, preserveIfExists, appRoot) {
9638
9679
  log2.warn(`Source file not found: ${sourcePath}`);
9639
9680
  return false;
9640
9681
  }
9641
- const content = await read(sourcePath, { format: "text" });
9682
+ const content = asText(await read(sourcePath, { format: "text" }));
9642
9683
  if (!content) {
9643
9684
  log2.warn(`Source file is empty: ${sourcePath}`);
9644
9685
  return false;
9645
9686
  }
9646
9687
  if (pathExists(destPathWithoutExample)) {
9647
- const existingContent = await read(destPathWithoutExample, {
9648
- format: "text"
9649
- });
9688
+ const existingContent = asText(
9689
+ await read(destPathWithoutExample, {
9690
+ format: "text"
9691
+ })
9692
+ );
9650
9693
  if (existingContent === content) {
9651
9694
  return false;
9652
9695
  }
@@ -9869,9 +9912,9 @@ function formatDeprecatedList(deprecated, appRoot) {
9869
9912
  const lines = [];
9870
9913
  for (const d of deprecated) {
9871
9914
  lines.push(` ${d.name} \u2014 ${d.message}`);
9872
- const locs = d.locations.map((l2) => {
9873
- const rel = appRoot ? getRelativePathBetween(appRoot, l2.file) : l2.file;
9874
- return `${rel} (${l2.field})`;
9915
+ const locs = d.locations.map((l) => {
9916
+ const rel = appRoot ? getRelativePathBetween(appRoot, l.file) : l.file;
9917
+ return `${rel} (${l.field})`;
9875
9918
  });
9876
9919
  lines.push(` Found in: ${locs.join(", ")}`);
9877
9920
  }