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