@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.
- package/dependencies-matrix.json +44 -42
- package/dist/bin/commands/agent-setup.js +135 -67
- package/dist/bin/commands/build.js +352 -234
- package/dist/bin/commands/bump.js +385 -257
- package/dist/bin/commands/cacheout.js +59 -49
- package/dist/bin/commands/coach.js +80 -50
- package/dist/bin/commands/create-app.js +501 -228
- package/dist/bin/commands/create-project.js +377 -241
- package/dist/bin/commands/db-check.js +192804 -0
- package/dist/bin/commands/db.js +1889 -1805
- package/dist/bin/commands/deploy.js +476 -287
- package/dist/bin/commands/dev.js +139 -108
- package/dist/bin/commands/doctor.js +91 -57
- package/dist/bin/commands/emu.js +196 -154
- package/dist/bin/commands/format.js +83 -50
- package/dist/bin/commands/get-demo.js +422 -197
- package/dist/bin/commands/make-admin.js +835 -713
- package/dist/bin/commands/preview.js +139 -108
- package/dist/bin/commands/seed.js +2186 -2044
- package/dist/bin/commands/setup-cicd.js +258 -204
- package/dist/bin/commands/setup.js +890 -339
- package/dist/bin/commands/staging.js +476 -287
- package/dist/bin/commands/sync-secrets.js +472 -141
- package/dist/bin/commands/type-check.js +163 -119
- package/dist/bin/commands/wai.js +53 -46
- package/dist/bin/dndev.js +32 -7
- package/dist/bin/donotdev.js +18 -8
- package/dist/index.js +654 -375
- package/package.json +2 -2
- package/templates/app-demo/index.html.example +1 -1
- package/templates/app-dndev/index.html.example +1 -1
- package/templates/app-dndev/src/globals.css.example +1 -1
- package/templates/app-dndev/src/pages/legal/LegalNoticePage.tsx.example +1 -1
- package/templates/app-dndev/src/pages/legal/PrivacyPage.tsx.example +1 -1
- package/templates/app-dndev/src/pages/legal/TermsPage.tsx.example +1 -1
- package/templates/app-next/src/app/AppDocument.tsx.example +58 -0
- package/templates/app-next/src/app/ClientLayout.tsx.example +6 -2
- package/templates/app-next/src/globals.css.example +1 -1
- package/templates/app-next/src/pages/legal/LegalNoticePage.tsx.example +1 -1
- package/templates/app-next/src/pages/legal/PrivacyPage.tsx.example +1 -1
- package/templates/app-next/src/pages/legal/TermsPage.tsx.example +1 -1
- package/templates/app-vite/csp.example.json +1 -1
- package/templates/app-vite/index.html.example +1 -1
- package/templates/app-vite/src/globals.css.example +1 -1
- package/templates/app-vite/src/pages/FormPageExample.tsx.example +21 -16
- package/templates/app-vite/src/pages/legal/LegalNoticePage.tsx.example +1 -1
- package/templates/app-vite/src/pages/legal/PrivacyPage.tsx.example +1 -1
- package/templates/app-vite/src/pages/legal/TermsPage.tsx.example +1 -1
- package/templates/deploy-config/vercel.json.example +2 -2
- package/templates/functions-supabase/supabase/migrations/20250101000006_crud_bulk_status_guard.sql +258 -0
- package/templates/functions-supabase/supabase/migrations/20250101000007_rate_limit_check.sql +76 -0
- package/templates/overlay-supabase/src/config/providers.nextjs.ts.example +37 -0
- package/templates/root-consumer/.claude/hooks/guard-bash.sh.example +3 -3
- package/templates/root-consumer/.claude/hooks/guard-write.sh.example +5 -1
- package/templates/root-consumer/.claude/hooks/typecheck-stop.sh.example +2 -2
- package/templates/root-consumer/.claude/rules/definition-of-done.md.example +2 -2
- package/templates/root-consumer/.claude/rules/framework.md.example +1 -1
- package/templates/root-consumer/.claude/skills/build/SKILL.md.example +1 -1
- package/templates/root-consumer/.claude/skills/polish/SKILL.md.example +1 -1
- package/templates/root-consumer/.gitignore.example +7 -1
- package/templates/root-consumer/AGENTS.md.example +25 -2
- package/templates/root-consumer/README.md.example +1 -1
- package/templates/app-next/src/app/layout.tsx.example +0 -80
- 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,
|
|
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@
|
|
409
|
-
var
|
|
410
|
-
|
|
411
|
-
|
|
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
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
return `${CSI2}${
|
|
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,
|
|
421
|
+
move(x, y) {
|
|
422
422
|
let ret = "";
|
|
423
|
-
if (x < 0)
|
|
424
|
-
|
|
425
|
-
if (
|
|
426
|
-
|
|
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
|
-
|
|
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
|
|
453
|
+
let clear2 = "";
|
|
454
454
|
for (let i2 = 0; i2 < count; i2++)
|
|
455
|
-
|
|
455
|
+
clear2 += this.line + (i2 < count - 1 ? cursor.up() : "");
|
|
456
456
|
if (count)
|
|
457
|
-
|
|
458
|
-
return
|
|
457
|
+
clear2 += cursor.left;
|
|
458
|
+
return clear2;
|
|
459
459
|
}
|
|
460
460
|
};
|
|
461
|
-
|
|
461
|
+
clear = {
|
|
462
|
+
screen: `${ESC2}c`
|
|
463
|
+
};
|
|
462
464
|
}
|
|
463
465
|
});
|
|
464
466
|
|
|
465
|
-
// node_modules/.bun/@clack+core@1.
|
|
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
|
|
469
|
-
import
|
|
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(
|
|
472
|
-
if (!
|
|
473
|
-
return
|
|
474
|
-
const t2 =
|
|
475
|
-
return
|
|
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 =
|
|
520
|
+
const s = f$1.createInterface({
|
|
519
521
|
input: e,
|
|
520
522
|
output: r2,
|
|
521
523
|
prompt: "",
|
|
522
524
|
tabSize: 1
|
|
523
525
|
});
|
|
524
|
-
|
|
525
|
-
const t2 = (
|
|
526
|
-
const
|
|
527
|
-
if (isActionKey([
|
|
528
|
-
n3 && r2.write(
|
|
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
|
|
533
|
-
|
|
534
|
-
|
|
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(
|
|
540
|
-
e.off("keypress", t2), n3 && r2.write(
|
|
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
|
|
545
|
-
return wrapAnsi(r2,
|
|
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((
|
|
550
|
-
const
|
|
551
|
-
return
|
|
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
|
|
563
|
-
var
|
|
564
|
-
"node_modules/.bun/@clack+core@1.
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
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(
|
|
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(
|
|
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,
|
|
747
|
+
const t2 = wrapAnsi(this._prevFrame, getColumns(this.output), { hard: true, trim: false }).split(`
|
|
745
748
|
`).length - 1;
|
|
746
|
-
this.output.write(
|
|
749
|
+
this.output.write(cursor.move(-999, t2 * -1));
|
|
747
750
|
}
|
|
748
751
|
render() {
|
|
749
|
-
const t2 = wrapAnsi(this._render(this) ?? "",
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
779
|
+
h2 > 0 && this.output.write(cursor.move(0, h2));
|
|
777
780
|
}
|
|
778
|
-
this.output.write(
|
|
779
|
-
const
|
|
781
|
+
this.output.write(erase.down());
|
|
782
|
+
const m = t2.split(`
|
|
780
783
|
`).slice(n3);
|
|
781
|
-
this.output.write(
|
|
784
|
+
this.output.write(m.join(`
|
|
782
785
|
`)), this._prevFrame = t2;
|
|
783
786
|
return;
|
|
784
787
|
}
|
|
785
788
|
}
|
|
786
|
-
this.output.write(
|
|
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
|
|
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(
|
|
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
|
|
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.
|
|
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,
|
|
852
|
-
const
|
|
853
|
-
|
|
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
|
|
856
|
-
var
|
|
857
|
-
"node_modules/.bun/@clack+prompts@1.
|
|
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
|
-
|
|
860
|
-
|
|
863
|
+
init_dist4();
|
|
864
|
+
init_dist4();
|
|
861
865
|
init_main();
|
|
862
866
|
init_dist2();
|
|
863
|
-
|
|
867
|
+
init_dist3();
|
|
864
868
|
unicode = isUnicodeSupported();
|
|
865
869
|
isCI = () => process.env.CI === "true";
|
|
866
|
-
unicodeOr = (
|
|
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 = (
|
|
893
|
-
switch (
|
|
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 = (
|
|
908
|
-
switch (
|
|
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
|
-
|
|
924
|
+
E$1 = (l, e, w, p, b, C3 = false) => {
|
|
921
925
|
let r2 = e, O = 0;
|
|
922
|
-
if (
|
|
926
|
+
if (C3)
|
|
923
927
|
for (let i2 = p - 1; i2 >= w; i2--) {
|
|
924
|
-
const m =
|
|
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 =
|
|
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:
|
|
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:
|
|
944
|
+
columnPadding: C3 = 0,
|
|
941
945
|
rowPadding: r2 = 4
|
|
942
946
|
}) => {
|
|
943
|
-
const i2 = getColumns(p) -
|
|
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
|
-
|
|
946
|
-
Math.min(
|
|
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,
|
|
950
|
-
const
|
|
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++,
|
|
956
|
-
const T = f + (d ? 1 : 0),
|
|
957
|
-
for (let t2 = T; t2 <
|
|
958
|
-
const n3 = e[t2], o = n3 ? w(n3, t2 ===
|
|
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 =
|
|
971
|
+
const h2 = l - T;
|
|
968
972
|
let u3 = v;
|
|
969
|
-
const L = () =>
|
|
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 && (
|
|
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
|
|
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)} `,
|
|
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
|
-
|
|
1003
|
+
l,
|
|
1000
1004
|
u3
|
|
1001
1005
|
), s = `${i2 ? `${styleText2("gray", S_BAR)}
|
|
1002
1006
|
` : ""}${f}
|
|
1003
|
-
`,
|
|
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",
|
|
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"],
|
|
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:
|
|
1037
|
-
withGuide:
|
|
1040
|
+
spacing: l = 1,
|
|
1041
|
+
withGuide: c3
|
|
1038
1042
|
} = {}) => {
|
|
1039
|
-
const t2 = [], o =
|
|
1040
|
-
for (let i2 = 0; 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, ...
|
|
1049
|
+
const [i2, ...y] = g;
|
|
1046
1050
|
i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
|
|
1047
|
-
for (const p of
|
|
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
|
|
1093
|
-
|
|
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
|
-
`),
|
|
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,
|
|
1103
|
-
`).map(
|
|
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
|
-
|
|
1128
|
+
Y = 3e4;
|
|
1129
|
+
Z = (c3) => styleText2("magenta", c3);
|
|
1125
1130
|
spinner = ({
|
|
1126
|
-
indicator:
|
|
1127
|
-
onCancel:
|
|
1131
|
+
indicator: c3 = "dots",
|
|
1132
|
+
onCancel: b,
|
|
1128
1133
|
output: n3 = process.stdout,
|
|
1129
|
-
cancelMessage:
|
|
1130
|
-
errorMessage:
|
|
1131
|
-
frames:
|
|
1132
|
-
delay:
|
|
1133
|
-
signal:
|
|
1134
|
-
...
|
|
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
|
|
1138
|
-
const
|
|
1139
|
-
const
|
|
1140
|
-
|
|
1141
|
-
},
|
|
1142
|
-
process.on("uncaughtExceptionMonitor",
|
|
1143
|
-
},
|
|
1144
|
-
process.removeListener("uncaughtExceptionMonitor",
|
|
1145
|
-
},
|
|
1146
|
-
if (
|
|
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
|
|
1154
|
+
const s = wrapAnsi(v, y, {
|
|
1150
1155
|
hard: true,
|
|
1151
1156
|
trim: false
|
|
1152
1157
|
}).split(`
|
|
1153
1158
|
`);
|
|
1154
|
-
|
|
1155
|
-
},
|
|
1156
|
-
const
|
|
1157
|
-
return
|
|
1158
|
-
}, N =
|
|
1159
|
-
|
|
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
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
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
|
-
|
|
1166
|
-
const
|
|
1167
|
-
let
|
|
1179
|
+
R2(), v = r2;
|
|
1180
|
+
const t2 = F(M[s]);
|
|
1181
|
+
let o;
|
|
1168
1182
|
if (u3)
|
|
1169
|
-
|
|
1170
|
-
else if (
|
|
1171
|
-
|
|
1183
|
+
o = `${t2} ${r2}...`;
|
|
1184
|
+
else if (c3 === "timer")
|
|
1185
|
+
o = `${t2} ${r2} ${T(w)}`;
|
|
1172
1186
|
else {
|
|
1173
|
-
const
|
|
1174
|
-
|
|
1187
|
+
const j = ".".repeat(Math.floor(i2)).slice(0, 3);
|
|
1188
|
+
o = `${t2} ${r2}${j}`;
|
|
1175
1189
|
}
|
|
1176
|
-
const
|
|
1190
|
+
const D = wrapAnsi(o, y, {
|
|
1177
1191
|
hard: true,
|
|
1178
1192
|
trim: false
|
|
1179
1193
|
});
|
|
1180
|
-
n3.write(
|
|
1181
|
-
},
|
|
1182
|
-
},
|
|
1183
|
-
if (
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
`)
|
|
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 = "") =>
|
|
1215
|
+
stop: (e = "") => m(e, 0),
|
|
1193
1216
|
message: (e = "") => {
|
|
1194
|
-
|
|
1217
|
+
r2 = L(e ?? r2);
|
|
1195
1218
|
},
|
|
1196
|
-
cancel: (e = "") =>
|
|
1197
|
-
error: (e = "") =>
|
|
1198
|
-
clear: () =>
|
|
1219
|
+
cancel: (e = "") => m(e, 1),
|
|
1220
|
+
error: (e = "") => m(e, 2),
|
|
1221
|
+
clear: () => m("", 0, true),
|
|
1199
1222
|
get isCancelled() {
|
|
1200
|
-
return
|
|
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
|
-
|
|
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)} ${
|
|
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 `${
|
|
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 `${
|
|
1253
|
+
return `${c2(s, (i2) => styleText2(["strikethrough", "dim"], i2))}`;
|
|
1231
1254
|
default:
|
|
1232
|
-
return `${styleText2("dim", S_RADIO_INACTIVE)} ${
|
|
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
|
-
|
|
1340
|
-
|
|
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,
|
|
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,
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
8910
|
-
label: choice.title,
|
|
8911
|
-
|
|
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
|
|
8966
|
+
initialValue
|
|
8917
8967
|
});
|
|
8918
8968
|
if (isCancel(result)) {
|
|
8919
8969
|
cancel("Operation cancelled.");
|
|
8920
8970
|
process.exit(0);
|
|
8921
8971
|
}
|
|
8922
|
-
|
|
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
|
-
|
|
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:
|
|
9454
|
+
run: bunx turbo run test
|
|
9401
9455
|
`;
|
|
9402
9456
|
}
|
|
9403
9457
|
function generateDeployWorkflow(providers, envSecretNames) {
|