@donotdev/cli 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dependencies-matrix.json +39 -38
- package/dist/bin/commands/agent-setup.js +135 -67
- package/dist/bin/commands/build.js +288 -232
- package/dist/bin/commands/bump.js +293 -250
- 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.js +1873 -1804
- 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 +813 -707
- package/dist/bin/commands/preview.js +139 -108
- package/dist/bin/commands/seed.js +1874 -1809
- package/dist/bin/commands/setup-cicd.js +258 -204
- package/dist/bin/commands/setup.js +346 -247
- 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 +10 -1
- package/dist/bin/donotdev.js +18 -8
- package/dist/index.js +590 -373
- package/package.json +2 -2
- 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-dndev/src/stores/dndevStore.ts.example +0 -3
- package/templates/app-next/src/app/AppDocument.tsx.example +57 -0
- package/templates/app-next/src/app/ClientLayout.tsx.example +6 -2
- 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/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/overlay-supabase/src/config/providers.nextjs.ts.example +37 -0
- package/templates/root-consumer/.claude/hooks/guard-write.sh.example +5 -1
- package/templates/root-consumer/.gitignore.example +7 -1
- package/templates/app-next/src/app/layout.tsx.example +0 -80
- package/templates/app-next/src/app/not-found.tsx.example +0 -40
|
@@ -143,7 +143,7 @@ var init_dist = __esm({
|
|
|
143
143
|
if (index >= length) {
|
|
144
144
|
break outer;
|
|
145
145
|
}
|
|
146
|
-
for (let i2 = 0,
|
|
146
|
+
for (let i2 = 0, l = PARSE_BLOCKS.length; i2 < l; i2++) {
|
|
147
147
|
const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i2];
|
|
148
148
|
BLOCK_RE.lastIndex = index;
|
|
149
149
|
if (BLOCK_RE.test(input)) {
|
|
@@ -409,25 +409,29 @@ var init_main = __esm({
|
|
|
409
409
|
}
|
|
410
410
|
});
|
|
411
411
|
|
|
412
|
-
// node_modules/.bun/sisteransi@
|
|
413
|
-
var
|
|
414
|
-
|
|
415
|
-
|
|
412
|
+
// node_modules/.bun/sisteransi@2.0.0/node_modules/sisteransi/dist/index.js
|
|
413
|
+
var ESC2, CSI2, cursor, erase, clear;
|
|
414
|
+
var init_dist3 = __esm({
|
|
415
|
+
"node_modules/.bun/sisteransi@2.0.0/node_modules/sisteransi/dist/index.js"() {
|
|
416
416
|
init_utils2();
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
return `${CSI2}${
|
|
417
|
+
ESC2 = "\x1B";
|
|
418
|
+
CSI2 = `${ESC2}[`;
|
|
419
|
+
cursor = {
|
|
420
|
+
to(x, y) {
|
|
421
|
+
if (!y)
|
|
422
|
+
return `${CSI2}${x + 1}G`;
|
|
423
|
+
return `${CSI2}${y + 1};${x + 1}H`;
|
|
424
424
|
},
|
|
425
|
-
move(x,
|
|
425
|
+
move(x, y) {
|
|
426
426
|
let ret = "";
|
|
427
|
-
if (x < 0)
|
|
428
|
-
|
|
429
|
-
if (
|
|
430
|
-
|
|
427
|
+
if (x < 0)
|
|
428
|
+
ret += `${CSI2}${-x}D`;
|
|
429
|
+
else if (x > 0)
|
|
430
|
+
ret += `${CSI2}${x}C`;
|
|
431
|
+
if (y < 0)
|
|
432
|
+
ret += `${CSI2}${-y}A`;
|
|
433
|
+
else if (y > 0)
|
|
434
|
+
ret += `${CSI2}${y}B`;
|
|
431
435
|
return ret;
|
|
432
436
|
},
|
|
433
437
|
up: (count = 1) => `${CSI2}${count}A`,
|
|
@@ -442,11 +446,7 @@ var require_src = __commonJS({
|
|
|
442
446
|
save: `${ESC2}7`,
|
|
443
447
|
restore: `${ESC2}8`
|
|
444
448
|
};
|
|
445
|
-
|
|
446
|
-
up: (count = 1) => `${CSI2}S`.repeat(count),
|
|
447
|
-
down: (count = 1) => `${CSI2}T`.repeat(count)
|
|
448
|
-
};
|
|
449
|
-
var erase3 = {
|
|
449
|
+
erase = {
|
|
450
450
|
screen: `${CSI2}2J`,
|
|
451
451
|
up: (count = 1) => `${CSI2}1J`.repeat(count),
|
|
452
452
|
down: (count = 1) => `${CSI2}J`.repeat(count),
|
|
@@ -454,29 +454,31 @@ var require_src = __commonJS({
|
|
|
454
454
|
lineEnd: `${CSI2}K`,
|
|
455
455
|
lineStart: `${CSI2}1K`,
|
|
456
456
|
lines(count) {
|
|
457
|
-
let
|
|
457
|
+
let clear2 = "";
|
|
458
458
|
for (let i2 = 0; i2 < count; i2++)
|
|
459
|
-
|
|
459
|
+
clear2 += this.line + (i2 < count - 1 ? cursor.up() : "");
|
|
460
460
|
if (count)
|
|
461
|
-
|
|
462
|
-
return
|
|
461
|
+
clear2 += cursor.left;
|
|
462
|
+
return clear2;
|
|
463
463
|
}
|
|
464
464
|
};
|
|
465
|
-
|
|
465
|
+
clear = {
|
|
466
|
+
screen: `${ESC2}c`
|
|
467
|
+
};
|
|
466
468
|
}
|
|
467
469
|
});
|
|
468
470
|
|
|
469
|
-
// node_modules/.bun/@clack+core@1.
|
|
471
|
+
// node_modules/.bun/@clack+core@1.6.0/node_modules/@clack/core/dist/index.mjs
|
|
470
472
|
import { styleText } from "node:util";
|
|
471
473
|
import { stdout, stdin } from "node:process";
|
|
472
|
-
import * as
|
|
473
|
-
import
|
|
474
|
+
import * as f$1 from "node:readline";
|
|
475
|
+
import f__default from "node:readline";
|
|
474
476
|
import { ReadStream } from "node:tty";
|
|
475
|
-
function findCursor(
|
|
476
|
-
if (!
|
|
477
|
-
return
|
|
478
|
-
const t2 =
|
|
479
|
-
return
|
|
477
|
+
function findCursor(o, s, l) {
|
|
478
|
+
if (!l.some((r2) => !r2.disabled))
|
|
479
|
+
return o;
|
|
480
|
+
const t2 = o + s, n3 = Math.max(l.length - 1, 0), e = t2 < 0 ? n3 : t2 > n3 ? 0 : t2;
|
|
481
|
+
return l[e]?.disabled ? findCursor(e, s < 0 ? -1 : 1, l) : e;
|
|
480
482
|
}
|
|
481
483
|
function isAccessible(n3) {
|
|
482
484
|
if (n3 !== void 0) return n3;
|
|
@@ -519,40 +521,40 @@ function block({
|
|
|
519
521
|
overwrite: o = true,
|
|
520
522
|
hideCursor: n3 = true
|
|
521
523
|
} = {}) {
|
|
522
|
-
const s =
|
|
524
|
+
const s = f$1.createInterface({
|
|
523
525
|
input: e,
|
|
524
526
|
output: r2,
|
|
525
527
|
prompt: "",
|
|
526
528
|
tabSize: 1
|
|
527
529
|
});
|
|
528
|
-
|
|
529
|
-
const t2 = (
|
|
530
|
-
const
|
|
531
|
-
if (isActionKey([
|
|
532
|
-
n3 && r2.write(
|
|
530
|
+
f$1.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(true);
|
|
531
|
+
const t2 = (l, { name: i2, sequence: p }) => {
|
|
532
|
+
const w = String(l);
|
|
533
|
+
if (isActionKey([w, i2, p], "cancel")) {
|
|
534
|
+
n3 && r2.write(cursor.show), process.exit(0);
|
|
533
535
|
return;
|
|
534
536
|
}
|
|
535
537
|
if (!o) return;
|
|
536
|
-
const
|
|
537
|
-
|
|
538
|
-
|
|
538
|
+
const c3 = i2 === "return" ? 0 : -1, a2 = i2 === "return" ? -1 : 0;
|
|
539
|
+
f$1.moveCursor(r2, c3, a2, () => {
|
|
540
|
+
f$1.clearLine(r2, 1, () => {
|
|
539
541
|
e.once("keypress", t2);
|
|
540
542
|
});
|
|
541
543
|
});
|
|
542
544
|
};
|
|
543
|
-
return n3 && r2.write(
|
|
544
|
-
e.off("keypress", t2), n3 && r2.write(
|
|
545
|
+
return n3 && r2.write(cursor.hide), e.once("keypress", t2), () => {
|
|
546
|
+
e.off("keypress", t2), n3 && r2.write(cursor.show), e instanceof ReadStream && e.isTTY && !R && e.setRawMode(false), s.terminal = false, s.close();
|
|
545
547
|
};
|
|
546
548
|
}
|
|
547
549
|
function wrapTextWithPrefix(e, r2, o, n3 = o, s = o, t2) {
|
|
548
|
-
const
|
|
549
|
-
return wrapAnsi(r2,
|
|
550
|
+
const l = getColumns(e ?? stdout), i2 = dist_default2(o);
|
|
551
|
+
return wrapAnsi(r2, l - i2, {
|
|
550
552
|
hard: true,
|
|
551
553
|
trim: false
|
|
552
554
|
}).split(`
|
|
553
|
-
`).map((
|
|
554
|
-
const
|
|
555
|
-
return
|
|
555
|
+
`).map((c3, a2, g) => {
|
|
556
|
+
const m = t2 ? t2(c3, a2) : c3;
|
|
557
|
+
return a2 === 0 ? `${n3}${m}` : a2 === g.length - 1 ? `${s}${m}` : `${o}${m}`;
|
|
556
558
|
}).join(`
|
|
557
559
|
`);
|
|
558
560
|
}
|
|
@@ -563,12 +565,13 @@ function runValidation(e, a2) {
|
|
|
563
565
|
}
|
|
564
566
|
return e(a2);
|
|
565
567
|
}
|
|
566
|
-
var
|
|
567
|
-
var
|
|
568
|
-
"node_modules/.bun/@clack+core@1.
|
|
568
|
+
var a$1, t, settings, R, CANCEL_SYMBOL, getColumns, getRows, C$1, n$1;
|
|
569
|
+
var init_dist4 = __esm({
|
|
570
|
+
"node_modules/.bun/@clack+core@1.6.0/node_modules/@clack/core/dist/index.mjs"() {
|
|
569
571
|
init_utils2();
|
|
570
572
|
init_main();
|
|
571
|
-
|
|
573
|
+
init_dist3();
|
|
574
|
+
init_dist2();
|
|
572
575
|
a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
573
576
|
t = [
|
|
574
577
|
"January",
|
|
@@ -617,7 +620,7 @@ var init_dist3 = __esm({
|
|
|
617
620
|
CANCEL_SYMBOL = /* @__PURE__ */ Symbol("clack:cancel");
|
|
618
621
|
getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
|
|
619
622
|
getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
|
|
620
|
-
|
|
623
|
+
C$1 = class C {
|
|
621
624
|
input;
|
|
622
625
|
output;
|
|
623
626
|
_abortSignal;
|
|
@@ -699,16 +702,16 @@ var init_dist3 = __esm({
|
|
|
699
702
|
{ once: true }
|
|
700
703
|
);
|
|
701
704
|
}
|
|
702
|
-
this.rl =
|
|
705
|
+
this.rl = f__default.createInterface({
|
|
703
706
|
input: this.input,
|
|
704
707
|
tabSize: 2,
|
|
705
708
|
prompt: "",
|
|
706
709
|
escapeCodeTimeout: 50,
|
|
707
710
|
terminal: true
|
|
708
711
|
}), 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", () => {
|
|
709
|
-
this.output.write(
|
|
712
|
+
this.output.write(cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(this.value);
|
|
710
713
|
}), this.once("cancel", () => {
|
|
711
|
-
this.output.write(
|
|
714
|
+
this.output.write(cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(CANCEL_SYMBOL);
|
|
712
715
|
});
|
|
713
716
|
});
|
|
714
717
|
}
|
|
@@ -745,18 +748,18 @@ var init_dist3 = __esm({
|
|
|
745
748
|
`), setRawMode(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
746
749
|
}
|
|
747
750
|
restoreCursor() {
|
|
748
|
-
const t2 = wrapAnsi(this._prevFrame,
|
|
751
|
+
const t2 = wrapAnsi(this._prevFrame, getColumns(this.output), { hard: true, trim: false }).split(`
|
|
749
752
|
`).length - 1;
|
|
750
|
-
this.output.write(
|
|
753
|
+
this.output.write(cursor.move(-999, t2 * -1));
|
|
751
754
|
}
|
|
752
755
|
render() {
|
|
753
|
-
const t2 = wrapAnsi(this._render(this) ?? "",
|
|
756
|
+
const t2 = wrapAnsi(this._render(this) ?? "", getColumns(this.output), {
|
|
754
757
|
hard: true,
|
|
755
758
|
trim: false
|
|
756
759
|
});
|
|
757
760
|
if (t2 !== this._prevFrame) {
|
|
758
761
|
if (this.state === "initial")
|
|
759
|
-
this.output.write(
|
|
762
|
+
this.output.write(cursor.hide);
|
|
760
763
|
else {
|
|
761
764
|
const e = diffLines(this._prevFrame, t2), i2 = getRows(this.output);
|
|
762
765
|
if (this.restoreCursor(), e) {
|
|
@@ -767,33 +770,33 @@ var init_dist3 = __esm({
|
|
|
767
770
|
return;
|
|
768
771
|
}
|
|
769
772
|
if (e.lines.length === 1) {
|
|
770
|
-
this.output.write(
|
|
773
|
+
this.output.write(cursor.move(0, n3 - r2)), this.output.write(erase.lines(1));
|
|
771
774
|
const o = t2.split(`
|
|
772
775
|
`);
|
|
773
|
-
this.output.write(o[n3]), this._prevFrame = t2, this.output.write(
|
|
776
|
+
this.output.write(o[n3]), this._prevFrame = t2, this.output.write(cursor.move(0, o.length - n3 - 1));
|
|
774
777
|
return;
|
|
775
778
|
} else if (e.lines.length > 1) {
|
|
776
779
|
if (s < r2)
|
|
777
780
|
n3 = s;
|
|
778
781
|
else {
|
|
779
782
|
const h2 = n3 - r2;
|
|
780
|
-
h2 > 0 && this.output.write(
|
|
783
|
+
h2 > 0 && this.output.write(cursor.move(0, h2));
|
|
781
784
|
}
|
|
782
|
-
this.output.write(
|
|
783
|
-
const
|
|
785
|
+
this.output.write(erase.down());
|
|
786
|
+
const m = t2.split(`
|
|
784
787
|
`).slice(n3);
|
|
785
|
-
this.output.write(
|
|
788
|
+
this.output.write(m.join(`
|
|
786
789
|
`)), this._prevFrame = t2;
|
|
787
790
|
return;
|
|
788
791
|
}
|
|
789
792
|
}
|
|
790
|
-
this.output.write(
|
|
793
|
+
this.output.write(erase.down());
|
|
791
794
|
}
|
|
792
795
|
this.output.write(t2), this.state === "initial" && (this.state = "active"), this._prevFrame = t2;
|
|
793
796
|
}
|
|
794
797
|
}
|
|
795
798
|
};
|
|
796
|
-
n$1 = class n extends
|
|
799
|
+
n$1 = class n extends C$1 {
|
|
797
800
|
options;
|
|
798
801
|
cursor = 0;
|
|
799
802
|
get _selectedValue() {
|
|
@@ -824,7 +827,7 @@ var init_dist3 = __esm({
|
|
|
824
827
|
}
|
|
825
828
|
});
|
|
826
829
|
|
|
827
|
-
// node_modules/.bun/@clack+prompts@1.
|
|
830
|
+
// node_modules/.bun/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.mjs
|
|
828
831
|
import { styleText as styleText2, stripVTControlCharacters } from "node:util";
|
|
829
832
|
import process$1 from "node:process";
|
|
830
833
|
import { existsSync, lstatSync, readdirSync } from "node:fs";
|
|
@@ -835,22 +838,23 @@ function isUnicodeSupported() {
|
|
|
835
838
|
}
|
|
836
839
|
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";
|
|
837
840
|
}
|
|
838
|
-
function formatInstructionFooter(o,
|
|
839
|
-
const
|
|
840
|
-
|
|
841
|
+
function formatInstructionFooter(e, o, r2) {
|
|
842
|
+
const s = r2 ? `${styleText2("cyan", S_BAR)} ` : "", n3 = wrapTextWithPrefix(e, o.join(" \u2022 "), s).split(`
|
|
843
|
+
`);
|
|
844
|
+
return r2 && n3.push(styleText2("cyan", S_BAR_END)), n3;
|
|
841
845
|
}
|
|
842
|
-
var
|
|
843
|
-
var
|
|
844
|
-
"node_modules/.bun/@clack+prompts@1.
|
|
846
|
+
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, MULTISELECT_INSTRUCTIONS, log, cancel, W, C2, note, Y, Z, spinner, u2, SELECT_INSTRUCTIONS, c2, select, i;
|
|
847
|
+
var init_dist5 = __esm({
|
|
848
|
+
"node_modules/.bun/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.mjs"() {
|
|
845
849
|
init_utils2();
|
|
846
|
-
|
|
847
|
-
|
|
850
|
+
init_dist4();
|
|
851
|
+
init_dist4();
|
|
848
852
|
init_main();
|
|
849
853
|
init_dist2();
|
|
850
|
-
|
|
854
|
+
init_dist3();
|
|
851
855
|
unicode = isUnicodeSupported();
|
|
852
856
|
isCI = () => process.env.CI === "true";
|
|
853
|
-
unicodeOr = (
|
|
857
|
+
unicodeOr = (e, o) => unicode ? e : o;
|
|
854
858
|
S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
|
|
855
859
|
S_STEP_CANCEL = unicodeOr("\u25A0", "x");
|
|
856
860
|
S_STEP_ERROR = unicodeOr("\u25B2", "x");
|
|
@@ -876,8 +880,8 @@ var init_dist4 = __esm({
|
|
|
876
880
|
S_SUCCESS = unicodeOr("\u25C6", "*");
|
|
877
881
|
S_WARN = unicodeOr("\u25B2", "!");
|
|
878
882
|
S_ERROR = unicodeOr("\u25A0", "x");
|
|
879
|
-
symbol = (
|
|
880
|
-
switch (
|
|
883
|
+
symbol = (e) => {
|
|
884
|
+
switch (e) {
|
|
881
885
|
case "initial":
|
|
882
886
|
case "active":
|
|
883
887
|
return styleText2("cyan", S_STEP_ACTIVE);
|
|
@@ -891,8 +895,8 @@ var init_dist4 = __esm({
|
|
|
891
895
|
return styleText2("dim", S_STEP_ACTIVE);
|
|
892
896
|
}
|
|
893
897
|
};
|
|
894
|
-
symbolBar = (
|
|
895
|
-
switch (
|
|
898
|
+
symbolBar = (e) => {
|
|
899
|
+
switch (e) {
|
|
896
900
|
case "initial":
|
|
897
901
|
case "active":
|
|
898
902
|
return styleText2("cyan", S_BAR);
|
|
@@ -904,45 +908,45 @@ var init_dist4 = __esm({
|
|
|
904
908
|
return styleText2("green", S_BAR);
|
|
905
909
|
}
|
|
906
910
|
};
|
|
907
|
-
|
|
911
|
+
E$1 = (l, e, w, p, b, C3 = false) => {
|
|
908
912
|
let r2 = e, O = 0;
|
|
909
|
-
if (
|
|
913
|
+
if (C3)
|
|
910
914
|
for (let i2 = p - 1; i2 >= w; i2--) {
|
|
911
|
-
const m =
|
|
915
|
+
const m = l[i2];
|
|
912
916
|
if (m && (r2 -= m.length), O++, r2 <= b) break;
|
|
913
917
|
}
|
|
914
918
|
else
|
|
915
919
|
for (let i2 = w; i2 < p; i2++) {
|
|
916
|
-
const m =
|
|
920
|
+
const m = l[i2];
|
|
917
921
|
if (m && (r2 -= m.length), O++, r2 <= b) break;
|
|
918
922
|
}
|
|
919
923
|
return { lineCount: r2, removals: O };
|
|
920
924
|
};
|
|
921
925
|
limitOptions = ({
|
|
922
|
-
cursor:
|
|
926
|
+
cursor: l,
|
|
923
927
|
options: e,
|
|
924
928
|
style: w,
|
|
925
929
|
output: p = process.stdout,
|
|
926
930
|
maxItems: b = Number.POSITIVE_INFINITY,
|
|
927
|
-
columnPadding:
|
|
931
|
+
columnPadding: C3 = 0,
|
|
928
932
|
rowPadding: r2 = 4
|
|
929
933
|
}) => {
|
|
930
|
-
const i2 = getColumns(p) -
|
|
934
|
+
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);
|
|
931
935
|
let f = 0;
|
|
932
|
-
|
|
933
|
-
Math.min(
|
|
936
|
+
l >= a2 - 3 && (f = Math.max(
|
|
937
|
+
Math.min(l - a2 + 3, e.length - a2),
|
|
934
938
|
0
|
|
935
939
|
));
|
|
936
|
-
let d = a2 < e.length && f > 0,
|
|
937
|
-
const
|
|
940
|
+
let d = a2 < e.length && f > 0, c3 = a2 < e.length && f + a2 < e.length;
|
|
941
|
+
const I = Math.min(
|
|
938
942
|
f + a2,
|
|
939
943
|
e.length
|
|
940
944
|
), s = [];
|
|
941
945
|
let g = 0;
|
|
942
|
-
d && g++,
|
|
943
|
-
const T = f + (d ? 1 : 0),
|
|
944
|
-
for (let t2 = T; t2 <
|
|
945
|
-
const n3 = e[t2], o = n3 ? w(n3, t2 ===
|
|
946
|
+
d && g++, c3 && g++;
|
|
947
|
+
const T = f + (d ? 1 : 0), W2 = I - (c3 ? 1 : 0);
|
|
948
|
+
for (let t2 = T; t2 < W2; t2++) {
|
|
949
|
+
const n3 = e[t2], o = n3 !== void 0 ? w(n3, t2 === l) : "", h2 = wrapAnsi(o, i2, {
|
|
946
950
|
hard: true,
|
|
947
951
|
trim: false
|
|
948
952
|
}).split(`
|
|
@@ -951,9 +955,9 @@ var init_dist4 = __esm({
|
|
|
951
955
|
}
|
|
952
956
|
if (g > v) {
|
|
953
957
|
let t2 = 0, n3 = 0, o = g;
|
|
954
|
-
const h2 =
|
|
958
|
+
const h2 = l - T;
|
|
955
959
|
let u3 = v;
|
|
956
|
-
const L = () =>
|
|
960
|
+
const L = () => E$1(s, o, 0, h2, u3), y = () => E$1(
|
|
957
961
|
s,
|
|
958
962
|
o,
|
|
959
963
|
h2 + 1,
|
|
@@ -961,14 +965,14 @@ var init_dist4 = __esm({
|
|
|
961
965
|
u3,
|
|
962
966
|
true
|
|
963
967
|
);
|
|
964
|
-
d ? ({ lineCount: o, removals: t2 } = L(), o > u3 && (
|
|
968
|
+
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));
|
|
965
969
|
}
|
|
966
970
|
const x = [];
|
|
967
971
|
d && x.push(M);
|
|
968
972
|
for (const t2 of s)
|
|
969
973
|
for (const n3 of t2)
|
|
970
974
|
x.push(n3);
|
|
971
|
-
return
|
|
975
|
+
return c3 && x.push(M), x;
|
|
972
976
|
};
|
|
973
977
|
MULTISELECT_INSTRUCTIONS = [
|
|
974
978
|
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
@@ -980,18 +984,18 @@ var init_dist4 = __esm({
|
|
|
980
984
|
symbol: e = styleText2("gray", S_BAR),
|
|
981
985
|
secondarySymbol: r2 = styleText2("gray", S_BAR),
|
|
982
986
|
output: m = process.stdout,
|
|
983
|
-
spacing:
|
|
984
|
-
withGuide:
|
|
987
|
+
spacing: l = 1,
|
|
988
|
+
withGuide: c3
|
|
985
989
|
} = {}) => {
|
|
986
|
-
const t2 = [], o =
|
|
987
|
-
for (let i2 = 0; i2 <
|
|
990
|
+
const t2 = [], o = c3 ?? settings.withGuide, f = o ? r2 : "", O = o ? `${e} ` : "", u3 = o ? `${r2} ` : "";
|
|
991
|
+
for (let i2 = 0; i2 < l; i2++)
|
|
988
992
|
t2.push(f);
|
|
989
993
|
const g = Array.isArray(s) ? s : s.split(`
|
|
990
994
|
`);
|
|
991
995
|
if (g.length > 0) {
|
|
992
|
-
const [i2, ...
|
|
996
|
+
const [i2, ...y] = g;
|
|
993
997
|
i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o ? e : "");
|
|
994
|
-
for (const p of
|
|
998
|
+
for (const p of y)
|
|
995
999
|
p.length > 0 ? t2.push(`${u3}${p}`) : t2.push(o ? r2 : "");
|
|
996
1000
|
}
|
|
997
1001
|
m.write(`${t2.join(`
|
|
@@ -1024,18 +1028,18 @@ var init_dist4 = __esm({
|
|
|
1024
1028
|
|
|
1025
1029
|
`);
|
|
1026
1030
|
};
|
|
1027
|
-
W
|
|
1028
|
-
|
|
1031
|
+
W = (o) => o;
|
|
1032
|
+
C2 = (o, e, s) => {
|
|
1029
1033
|
const a2 = {
|
|
1030
1034
|
hard: true,
|
|
1031
1035
|
trim: false
|
|
1032
1036
|
}, i2 = wrapAnsi(o, e, a2).split(`
|
|
1033
|
-
`),
|
|
1037
|
+
`), 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);
|
|
1034
1038
|
return wrapAnsi(o, g, a2);
|
|
1035
1039
|
};
|
|
1036
1040
|
note = (o = "", e = "", s) => {
|
|
1037
|
-
const a2 = s?.output ?? process$1.stdout, i2 = s?.withGuide ?? settings.withGuide,
|
|
1038
|
-
`).map(
|
|
1041
|
+
const a2 = s?.output ?? process$1.stdout, i2 = s?.withGuide ?? settings.withGuide, c3 = s?.format ?? W, g = ["", ...C2(o, getColumns(a2) - 6, c3).split(`
|
|
1042
|
+
`).map(c3), ""], n3 = dist_default2(e), t2 = Math.max(
|
|
1039
1043
|
g.reduce((m, F) => {
|
|
1040
1044
|
const O = dist_default2(F);
|
|
1041
1045
|
return O > m ? O : m;
|
|
@@ -1056,83 +1060,102 @@ ${styleText2("gray", l$1 + S_BAR_H.repeat(t2 + 2) + S_CORNER_BOTTOM_RIGHT)}
|
|
|
1056
1060
|
`
|
|
1057
1061
|
);
|
|
1058
1062
|
};
|
|
1059
|
-
|
|
1063
|
+
Y = 3e4;
|
|
1064
|
+
Z = (c3) => styleText2("magenta", c3);
|
|
1060
1065
|
spinner = ({
|
|
1061
|
-
indicator:
|
|
1062
|
-
onCancel:
|
|
1066
|
+
indicator: c3 = "dots",
|
|
1067
|
+
onCancel: b,
|
|
1063
1068
|
output: n3 = process.stdout,
|
|
1064
|
-
cancelMessage:
|
|
1065
|
-
errorMessage:
|
|
1066
|
-
frames:
|
|
1067
|
-
delay:
|
|
1068
|
-
signal:
|
|
1069
|
-
...
|
|
1069
|
+
cancelMessage: _,
|
|
1070
|
+
errorMessage: C3,
|
|
1071
|
+
frames: M = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
|
|
1072
|
+
delay: O = unicode ? 80 : 120,
|
|
1073
|
+
signal: g,
|
|
1074
|
+
...E
|
|
1070
1075
|
} = {}) => {
|
|
1071
|
-
const u3 = isCI();
|
|
1072
|
-
let
|
|
1073
|
-
const
|
|
1074
|
-
const
|
|
1075
|
-
|
|
1076
|
-
},
|
|
1077
|
-
process.on("uncaughtExceptionMonitor",
|
|
1078
|
-
},
|
|
1079
|
-
process.removeListener("uncaughtExceptionMonitor",
|
|
1080
|
-
},
|
|
1081
|
-
if (
|
|
1076
|
+
const u3 = isCI(), h2 = isAccessible(E.accessible);
|
|
1077
|
+
let x, I, p = false, l = false, r2 = "", v, w = performance.now();
|
|
1078
|
+
const y = getColumns(n3), F = E?.styleFrame ?? Z, S = (e) => {
|
|
1079
|
+
const s = e > 1 ? C3 ?? settings.messages.error : _ ?? settings.messages.cancel;
|
|
1080
|
+
l = e === 1, p && (m(s, e), l && typeof b == "function" && b());
|
|
1081
|
+
}, $ = () => S(2), a2 = () => S(1), H = () => {
|
|
1082
|
+
process.on("uncaughtExceptionMonitor", $), process.on("unhandledRejection", $), process.on("SIGINT", a2), process.on("SIGTERM", a2), process.on("exit", S), g && g.addEventListener("abort", a2);
|
|
1083
|
+
}, B = () => {
|
|
1084
|
+
process.removeListener("uncaughtExceptionMonitor", $), process.removeListener("unhandledRejection", $), process.removeListener("SIGINT", a2), process.removeListener("SIGTERM", a2), process.removeListener("exit", S), g && g.removeEventListener("abort", a2);
|
|
1085
|
+
}, R2 = () => {
|
|
1086
|
+
if (v === void 0) return;
|
|
1082
1087
|
u3 && n3.write(`
|
|
1083
1088
|
`);
|
|
1084
|
-
const
|
|
1089
|
+
const s = wrapAnsi(v, y, {
|
|
1085
1090
|
hard: true,
|
|
1086
1091
|
trim: false
|
|
1087
1092
|
}).split(`
|
|
1088
1093
|
`);
|
|
1089
|
-
|
|
1090
|
-
},
|
|
1091
|
-
const
|
|
1092
|
-
return
|
|
1093
|
-
}, N =
|
|
1094
|
-
|
|
1094
|
+
s.length > 1 && n3.write(cursor.up(s.length - 1)), n3.write(cursor.to(0)), n3.write(erase.down());
|
|
1095
|
+
}, L = (e) => e.replace(/\.+$/, ""), T = (e) => {
|
|
1096
|
+
const s = (performance.now() - e) / 1e3, i2 = Math.floor(s / 60), t2 = Math.floor(s % 60);
|
|
1097
|
+
return i2 > 0 ? `[${i2}m ${t2}s]` : `[${t2}s]`;
|
|
1098
|
+
}, N = E.withGuide ?? settings.withGuide, P = (e = "") => {
|
|
1099
|
+
if (p = true, l = false, r2 = L(e), w = performance.now(), H(), h2) {
|
|
1100
|
+
r2 !== "" && n3.write(`${r2}
|
|
1101
|
+
`), I = setInterval(() => {
|
|
1102
|
+
n3.write(r2 === "" ? `still working
|
|
1103
|
+
` : `still working: ${r2}
|
|
1095
1104
|
`);
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1105
|
+
}, Y);
|
|
1106
|
+
return;
|
|
1107
|
+
}
|
|
1108
|
+
x = block({ output: n3 }), N && n3.write(`${styleText2("gray", S_BAR)}
|
|
1109
|
+
`);
|
|
1110
|
+
let s = 0, i2 = 0;
|
|
1111
|
+
I = setInterval(() => {
|
|
1112
|
+
if (u3 && r2 === v)
|
|
1099
1113
|
return;
|
|
1100
|
-
|
|
1101
|
-
const
|
|
1102
|
-
let
|
|
1114
|
+
R2(), v = r2;
|
|
1115
|
+
const t2 = F(M[s]);
|
|
1116
|
+
let o;
|
|
1103
1117
|
if (u3)
|
|
1104
|
-
|
|
1105
|
-
else if (
|
|
1106
|
-
|
|
1118
|
+
o = `${t2} ${r2}...`;
|
|
1119
|
+
else if (c3 === "timer")
|
|
1120
|
+
o = `${t2} ${r2} ${T(w)}`;
|
|
1107
1121
|
else {
|
|
1108
|
-
const
|
|
1109
|
-
|
|
1122
|
+
const j = ".".repeat(Math.floor(i2)).slice(0, 3);
|
|
1123
|
+
o = `${t2} ${r2}${j}`;
|
|
1110
1124
|
}
|
|
1111
|
-
const
|
|
1125
|
+
const D = wrapAnsi(o, y, {
|
|
1112
1126
|
hard: true,
|
|
1113
1127
|
trim: false
|
|
1114
1128
|
});
|
|
1115
|
-
n3.write(
|
|
1116
|
-
},
|
|
1117
|
-
},
|
|
1118
|
-
if (
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
`)
|
|
1129
|
+
n3.write(D), s = s + 1 < M.length ? s + 1 : 0, i2 = i2 < 4 ? i2 + 0.125 : 0;
|
|
1130
|
+
}, O);
|
|
1131
|
+
}, m = (e = "", s = 0, i2 = false) => {
|
|
1132
|
+
if (p) {
|
|
1133
|
+
if (p = false, l = s === 1, clearInterval(I), h2 || R2(), r2 = e ?? r2, !i2)
|
|
1134
|
+
if (h2) {
|
|
1135
|
+
const t2 = s === 1 ? _ ?? settings.messages.cancel : s === 2 ? C3 ?? settings.messages.error : "Done", o = r2 || t2;
|
|
1136
|
+
c3 === "timer" ? n3.write(`${o} ${T(w)}
|
|
1137
|
+
`) : n3.write(`${o}
|
|
1138
|
+
`);
|
|
1139
|
+
} else {
|
|
1140
|
+
const t2 = s === 0 ? styleText2("green", S_STEP_SUBMIT) : s === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
|
|
1141
|
+
c3 === "timer" ? n3.write(`${t2} ${r2} ${T(w)}
|
|
1142
|
+
`) : n3.write(`${t2} ${r2}
|
|
1143
|
+
`);
|
|
1144
|
+
}
|
|
1145
|
+
B(), x?.();
|
|
1146
|
+
}
|
|
1124
1147
|
};
|
|
1125
1148
|
return {
|
|
1126
1149
|
start: P,
|
|
1127
|
-
stop: (e = "") =>
|
|
1150
|
+
stop: (e = "") => m(e, 0),
|
|
1128
1151
|
message: (e = "") => {
|
|
1129
|
-
|
|
1152
|
+
r2 = L(e ?? r2);
|
|
1130
1153
|
},
|
|
1131
|
-
cancel: (e = "") =>
|
|
1132
|
-
error: (e = "") =>
|
|
1133
|
-
clear: () =>
|
|
1154
|
+
cancel: (e = "") => m(e, 1),
|
|
1155
|
+
error: (e = "") => m(e, 2),
|
|
1156
|
+
clear: () => m("", 0, true),
|
|
1134
1157
|
get isCancelled() {
|
|
1135
|
-
return
|
|
1158
|
+
return l;
|
|
1136
1159
|
}
|
|
1137
1160
|
};
|
|
1138
1161
|
};
|
|
@@ -1145,7 +1168,7 @@ ${styleText2("gray", l$1 + S_BAR_H.repeat(t2 + 2) + S_CORNER_BOTTOM_RIGHT)}
|
|
|
1145
1168
|
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
1146
1169
|
`${styleText2("dim", "Enter:")} confirm`
|
|
1147
1170
|
];
|
|
1148
|
-
|
|
1171
|
+
c2 = (t2, o) => t2.includes(`
|
|
1149
1172
|
`) ? t2.split(`
|
|
1150
1173
|
`).map((d) => o(d)).join(`
|
|
1151
1174
|
`) : o(t2);
|
|
@@ -1156,15 +1179,15 @@ ${styleText2("gray", l$1 + S_BAR_H.repeat(t2 + 2) + S_CORNER_BOTTOM_RIGHT)}
|
|
|
1156
1179
|
const s = n3.label ?? String(n3.value);
|
|
1157
1180
|
switch (m) {
|
|
1158
1181
|
case "disabled":
|
|
1159
|
-
return `${styleText2("gray", S_RADIO_INACTIVE)} ${
|
|
1182
|
+
return `${styleText2("gray", S_RADIO_INACTIVE)} ${c2(s, (i2) => styleText2("gray", i2))}${n3.hint ? ` ${styleText2("dim", `(${n3.hint ?? "disabled"})`)}` : ""}`;
|
|
1160
1183
|
case "selected":
|
|
1161
|
-
return `${
|
|
1184
|
+
return `${c2(s, (i2) => styleText2("dim", i2))}`;
|
|
1162
1185
|
case "active":
|
|
1163
1186
|
return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${n3.hint ? ` ${styleText2("dim", `(${n3.hint})`)}` : ""}`;
|
|
1164
1187
|
case "cancelled":
|
|
1165
|
-
return `${
|
|
1188
|
+
return `${c2(s, (i2) => styleText2(["strikethrough", "dim"], i2))}`;
|
|
1166
1189
|
default:
|
|
1167
|
-
return `${styleText2("dim", S_RADIO_INACTIVE)} ${
|
|
1190
|
+
return `${styleText2("dim", S_RADIO_INACTIVE)} ${c2(s, (i2) => styleText2("dim", i2))}`;
|
|
1168
1191
|
}
|
|
1169
1192
|
}, d = t2.showInstructions ?? true;
|
|
1170
1193
|
return new n$1({
|
|
@@ -1202,7 +1225,7 @@ ${styleText2("gray", S_BAR)}` : ""}`;
|
|
|
1202
1225
|
}
|
|
1203
1226
|
default: {
|
|
1204
1227
|
const r2 = n3 ? `${styleText2("cyan", S_BAR)} ` : "", a2 = u3.split(`
|
|
1205
|
-
`).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], f = p.join(`
|
|
1228
|
+
`).length, p = d ? formatInstructionFooter(t2.output, SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], f = p.join(`
|
|
1206
1229
|
`), b = p.length + 1;
|
|
1207
1230
|
return `${u3}${r2}${limitOptions({
|
|
1208
1231
|
output: t2.output,
|
|
@@ -1271,8 +1294,8 @@ var init_cli_output = __esm({
|
|
|
1271
1294
|
"packages/tooling/src/utils/cli-output.ts"() {
|
|
1272
1295
|
"use strict";
|
|
1273
1296
|
init_utils2();
|
|
1274
|
-
|
|
1275
|
-
|
|
1297
|
+
init_dist5();
|
|
1298
|
+
init_dist5();
|
|
1276
1299
|
colors = {
|
|
1277
1300
|
reset: "\x1B[0m",
|
|
1278
1301
|
// Success (green)
|
|
@@ -1423,7 +1446,7 @@ var init_errors = __esm({
|
|
|
1423
1446
|
* @param {DoNotDevErrorCode} code - Error code
|
|
1424
1447
|
* @param {object} [options] - Additional error options
|
|
1425
1448
|
* @param {Error} [options.originalError] - Original error if wrapping
|
|
1426
|
-
* @param {Record<string,
|
|
1449
|
+
* @param {Record<string, unknown>} [options.context] - Additional context data
|
|
1427
1450
|
* @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
|
|
1428
1451
|
*/
|
|
1429
1452
|
constructor(message, code = DO_NOT_DEV_ERROR_CODES.UNKNOWN_ERROR, options) {
|
|
@@ -1453,7 +1476,7 @@ var init_errors = __esm({
|
|
|
1453
1476
|
* @param {string} [context] - Additional context for the error
|
|
1454
1477
|
* @param {DoNotDevErrorCode} [code='unknown-error'] - Error code
|
|
1455
1478
|
* @param {object} [options] - Additional error options
|
|
1456
|
-
* @param {Record<string,
|
|
1479
|
+
* @param {Record<string, unknown>} [options.context] - Additional context data
|
|
1457
1480
|
* @param {boolean} [options.displayable=true] - Whether this error should be displayed to the user
|
|
1458
1481
|
* @returns {DoNotDevError} New DoNotDev error wrapping the original
|
|
1459
1482
|
*/
|
|
@@ -7504,6 +7527,9 @@ import {
|
|
|
7504
7527
|
extname
|
|
7505
7528
|
} from "node:path";
|
|
7506
7529
|
import { fileURLToPath } from "node:url";
|
|
7530
|
+
function isEexistError(error2) {
|
|
7531
|
+
return typeof error2 === "object" && error2 !== null && "code" in error2 && error2.code === "EEXIST";
|
|
7532
|
+
}
|
|
7507
7533
|
function safeExecuteAsync(fn, message) {
|
|
7508
7534
|
return fn().catch((error2) => {
|
|
7509
7535
|
throw new Error(
|
|
@@ -7875,7 +7901,7 @@ var init_PathResolver = __esm({
|
|
|
7875
7901
|
try {
|
|
7876
7902
|
await fs.promises.mkdir(dir, { recursive: true });
|
|
7877
7903
|
} catch (error2) {
|
|
7878
|
-
if (error2
|
|
7904
|
+
if (!isEexistError(error2)) throw error2;
|
|
7879
7905
|
}
|
|
7880
7906
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
7881
7907
|
let writeContent;
|
|
@@ -7937,7 +7963,7 @@ var init_PathResolver = __esm({
|
|
|
7937
7963
|
try {
|
|
7938
7964
|
fs.mkdirSync(dir, { recursive: true });
|
|
7939
7965
|
} catch (error2) {
|
|
7940
|
-
if (error2
|
|
7966
|
+
if (!isEexistError(error2)) throw error2;
|
|
7941
7967
|
}
|
|
7942
7968
|
const detectedFormat = this._detectFormat(filePath, format);
|
|
7943
7969
|
let writeContent;
|
|
@@ -7994,7 +8020,7 @@ var init_PathResolver = __esm({
|
|
|
7994
8020
|
try {
|
|
7995
8021
|
await fs.promises.mkdir(dir, { recursive: true });
|
|
7996
8022
|
} catch (error2) {
|
|
7997
|
-
if (error2
|
|
8023
|
+
if (!isEexistError(error2)) throw error2;
|
|
7998
8024
|
}
|
|
7999
8025
|
try {
|
|
8000
8026
|
return await safeExecuteAsync(async () => {
|
|
@@ -8036,7 +8062,7 @@ var init_PathResolver = __esm({
|
|
|
8036
8062
|
try {
|
|
8037
8063
|
fs.mkdirSync(dir, { recursive: true });
|
|
8038
8064
|
} catch (error2) {
|
|
8039
|
-
if (error2
|
|
8065
|
+
if (!isEexistError(error2)) throw error2;
|
|
8040
8066
|
}
|
|
8041
8067
|
try {
|
|
8042
8068
|
fs.copyFileSync(srcPath, normalizedDestPath);
|
|
@@ -8152,7 +8178,7 @@ var init_PathResolver = __esm({
|
|
|
8152
8178
|
try {
|
|
8153
8179
|
await fs.promises.mkdir(dirPath, { recursive: true });
|
|
8154
8180
|
} catch (error2) {
|
|
8155
|
-
if (error2
|
|
8181
|
+
if (!isEexistError(error2)) throw error2;
|
|
8156
8182
|
}
|
|
8157
8183
|
}
|
|
8158
8184
|
/**
|
|
@@ -8164,7 +8190,7 @@ var init_PathResolver = __esm({
|
|
|
8164
8190
|
try {
|
|
8165
8191
|
fs.mkdirSync(dirPath, { recursive: true });
|
|
8166
8192
|
} catch (error2) {
|
|
8167
|
-
if (error2
|
|
8193
|
+
if (!isEexistError(error2)) throw error2;
|
|
8168
8194
|
}
|
|
8169
8195
|
}
|
|
8170
8196
|
/**
|
|
@@ -8413,6 +8439,7 @@ var init_PathResolver = __esm({
|
|
|
8413
8439
|
* @param patternType - Type of patterns (css, routes, i18n, assets, pwa)
|
|
8414
8440
|
* @returns Resolved patterns with absolute paths
|
|
8415
8441
|
*/
|
|
8442
|
+
// 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)
|
|
8416
8443
|
async resolvePatterns(patternType) {
|
|
8417
8444
|
if (!constants.getPatternsFor) {
|
|
8418
8445
|
return { framework: [], consumer: [], all: [] };
|
|
@@ -8567,6 +8594,9 @@ import {
|
|
|
8567
8594
|
} from "node:path";
|
|
8568
8595
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
8569
8596
|
function readdirSync3(dirPath, options) {
|
|
8597
|
+
if (options !== null && typeof options === "object" && options.withFileTypes === true) {
|
|
8598
|
+
return pathResolverInstance.readdirSync(dirPath, options);
|
|
8599
|
+
}
|
|
8570
8600
|
return pathResolverInstance.readdirSync(dirPath, options);
|
|
8571
8601
|
}
|
|
8572
8602
|
var pathResolverInstance, getRepoRoot, resolvePackage, resolveFrameworkPackage, normalizePath, pathExists, readSync, statSync2, joinPath;
|
|
@@ -8637,6 +8667,25 @@ var init_typed_file_operations = __esm({
|
|
|
8637
8667
|
}
|
|
8638
8668
|
});
|
|
8639
8669
|
|
|
8670
|
+
// packages/tooling/src/utils/type-guards.ts
|
|
8671
|
+
function requireText(value, filePath) {
|
|
8672
|
+
if (typeof value !== "string") {
|
|
8673
|
+
throw new DoNotDevError(
|
|
8674
|
+
`Cannot read text file: ${filePath}`,
|
|
8675
|
+
DO_NOT_DEV_ERROR_CODES.FILE_NOT_FOUND,
|
|
8676
|
+
{ context: { filePath } }
|
|
8677
|
+
);
|
|
8678
|
+
}
|
|
8679
|
+
return value;
|
|
8680
|
+
}
|
|
8681
|
+
var init_type_guards = __esm({
|
|
8682
|
+
"packages/tooling/src/utils/type-guards.ts"() {
|
|
8683
|
+
"use strict";
|
|
8684
|
+
init_utils2();
|
|
8685
|
+
init_errors();
|
|
8686
|
+
}
|
|
8687
|
+
});
|
|
8688
|
+
|
|
8640
8689
|
// packages/tooling/src/bundler/utils.ts
|
|
8641
8690
|
import { Buffer as Buffer2 } from "node:buffer";
|
|
8642
8691
|
import { copyFileSync as copyFileSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "node:fs";
|
|
@@ -8742,7 +8791,7 @@ function analyzeApp(appPath, appName) {
|
|
|
8742
8791
|
try {
|
|
8743
8792
|
const envPath = joinPath(appPath, ".env");
|
|
8744
8793
|
if (pathExists(envPath)) {
|
|
8745
|
-
const envContent = readSync(envPath);
|
|
8794
|
+
const envContent = requireText(readSync(envPath), envPath);
|
|
8746
8795
|
if (envContent.match(/VITE_SUPABASE_URL=.+/)) {
|
|
8747
8796
|
hasSupabase = true;
|
|
8748
8797
|
}
|
|
@@ -8789,7 +8838,7 @@ function analyzeApp(appPath, appName) {
|
|
|
8789
8838
|
try {
|
|
8790
8839
|
const envPath = joinPath(appPath, ".env");
|
|
8791
8840
|
if (pathExists(envPath)) {
|
|
8792
|
-
const envContent = readSync(envPath);
|
|
8841
|
+
const envContent = requireText(readSync(envPath), envPath);
|
|
8793
8842
|
const urlMatch = envContent.match(/VITE_SUPABASE_URL=(.+)/);
|
|
8794
8843
|
if (urlMatch && urlMatch[1]) {
|
|
8795
8844
|
url = urlMatch[1].trim();
|
|
@@ -8852,6 +8901,7 @@ var init_app_detection = __esm({
|
|
|
8852
8901
|
init_utils2();
|
|
8853
8902
|
init_pathResolver();
|
|
8854
8903
|
init_typed_file_operations();
|
|
8904
|
+
init_type_guards();
|
|
8855
8905
|
}
|
|
8856
8906
|
});
|
|
8857
8907
|
|
|
@@ -8893,7 +8943,7 @@ var init_app_selector = __esm({
|
|
|
8893
8943
|
"packages/tooling/src/utils/app-selector.ts"() {
|
|
8894
8944
|
"use strict";
|
|
8895
8945
|
init_utils2();
|
|
8896
|
-
|
|
8946
|
+
init_dist5();
|
|
8897
8947
|
init_app_detection();
|
|
8898
8948
|
init_cli_output();
|
|
8899
8949
|
}
|
|
@@ -8901,27 +8951,31 @@ var init_app_selector = __esm({
|
|
|
8901
8951
|
|
|
8902
8952
|
// packages/tooling/src/utils/cli-input.ts
|
|
8903
8953
|
async function askForSelection(message, choices, defaultValue = 0) {
|
|
8904
|
-
const options = choices.map((choice) =>
|
|
8905
|
-
value
|
|
8906
|
-
label: choice.title,
|
|
8907
|
-
|
|
8908
|
-
|
|
8954
|
+
const options = choices.map((choice) => {
|
|
8955
|
+
const value = choice.value;
|
|
8956
|
+
return { value, label: choice.title, hint: choice.hint };
|
|
8957
|
+
});
|
|
8958
|
+
const initialValue = choices[defaultValue]?.value;
|
|
8909
8959
|
const result = await select({
|
|
8910
8960
|
message,
|
|
8911
8961
|
options,
|
|
8912
|
-
initialValue
|
|
8962
|
+
initialValue
|
|
8913
8963
|
});
|
|
8914
8964
|
if (isCancel(result)) {
|
|
8915
8965
|
cancel("Operation cancelled.");
|
|
8916
8966
|
process.exit(0);
|
|
8917
8967
|
}
|
|
8918
|
-
|
|
8968
|
+
const picked = choices.find((choice) => choice.value === result);
|
|
8969
|
+
if (!picked) {
|
|
8970
|
+
throw new Error(`Unknown selection: ${result}`);
|
|
8971
|
+
}
|
|
8972
|
+
return picked.value;
|
|
8919
8973
|
}
|
|
8920
8974
|
var init_cli_input = __esm({
|
|
8921
8975
|
"packages/tooling/src/utils/cli-input.ts"() {
|
|
8922
8976
|
"use strict";
|
|
8923
8977
|
init_utils2();
|
|
8924
|
-
|
|
8978
|
+
init_dist5();
|
|
8925
8979
|
}
|
|
8926
8980
|
});
|
|
8927
8981
|
|
|
@@ -9132,7 +9186,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
9132
9186
|
}
|
|
9133
9187
|
var fromCharCode = String.fromCharCode;
|
|
9134
9188
|
function throwSyntaxError(bytes, index, message) {
|
|
9135
|
-
const
|
|
9189
|
+
const c3 = bytes[index];
|
|
9136
9190
|
let line = 1;
|
|
9137
9191
|
let column = 0;
|
|
9138
9192
|
for (let i2 = 0; i2 < index; i2++) {
|
|
@@ -9144,7 +9198,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
9144
9198
|
}
|
|
9145
9199
|
}
|
|
9146
9200
|
throw new SyntaxError(
|
|
9147
|
-
message ? message : index === bytes.length ? "Unexpected end of input while parsing JSON" :
|
|
9201
|
+
message ? message : index === bytes.length ? "Unexpected end of input while parsing JSON" : c3 >= 32 && c3 <= 126 ? `Unexpected character ${fromCharCode(c3)} in JSON at position ${index} (line ${line}, column ${column})` : `Unexpected byte 0x${c3.toString(16)} in JSON at position ${index} (line ${line}, column ${column})`
|
|
9148
9202
|
);
|
|
9149
9203
|
}
|
|
9150
9204
|
function JSON_parse(bytes) {
|
|
@@ -9160,15 +9214,15 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
9160
9214
|
let object;
|
|
9161
9215
|
let i2 = 0;
|
|
9162
9216
|
while (i2 < length) {
|
|
9163
|
-
let
|
|
9164
|
-
if (
|
|
9217
|
+
let c3 = bytes[i2++];
|
|
9218
|
+
if (c3 <= 32) {
|
|
9165
9219
|
continue;
|
|
9166
9220
|
}
|
|
9167
9221
|
let value;
|
|
9168
|
-
if (state === 2 && property === null &&
|
|
9222
|
+
if (state === 2 && property === null && c3 !== 34 && c3 !== 125) {
|
|
9169
9223
|
throwSyntaxError(bytes, --i2);
|
|
9170
9224
|
}
|
|
9171
|
-
switch (
|
|
9225
|
+
switch (c3) {
|
|
9172
9226
|
// True
|
|
9173
9227
|
case 116: {
|
|
9174
9228
|
if (bytes[i2++] !== 114 || bytes[i2++] !== 117 || bytes[i2++] !== 101) {
|
|
@@ -9207,10 +9261,10 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
9207
9261
|
case 56:
|
|
9208
9262
|
case 57: {
|
|
9209
9263
|
let index = i2;
|
|
9210
|
-
value = fromCharCode(
|
|
9211
|
-
|
|
9264
|
+
value = fromCharCode(c3);
|
|
9265
|
+
c3 = bytes[i2];
|
|
9212
9266
|
while (true) {
|
|
9213
|
-
switch (
|
|
9267
|
+
switch (c3) {
|
|
9214
9268
|
case 43:
|
|
9215
9269
|
case 45:
|
|
9216
9270
|
case 46:
|
|
@@ -9226,8 +9280,8 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
9226
9280
|
case 57:
|
|
9227
9281
|
case 101:
|
|
9228
9282
|
case 69: {
|
|
9229
|
-
value += fromCharCode(
|
|
9230
|
-
|
|
9283
|
+
value += fromCharCode(c3);
|
|
9284
|
+
c3 = bytes[++i2];
|
|
9231
9285
|
continue;
|
|
9232
9286
|
}
|
|
9233
9287
|
}
|
|
@@ -9246,10 +9300,10 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
9246
9300
|
if (i2 >= length) {
|
|
9247
9301
|
throwSyntaxError(bytes, length);
|
|
9248
9302
|
}
|
|
9249
|
-
|
|
9250
|
-
if (
|
|
9303
|
+
c3 = bytes[i2++];
|
|
9304
|
+
if (c3 === 34) {
|
|
9251
9305
|
break;
|
|
9252
|
-
} else if (
|
|
9306
|
+
} else if (c3 === 92) {
|
|
9253
9307
|
switch (bytes[i2++]) {
|
|
9254
9308
|
// Normal escape sequence
|
|
9255
9309
|
case 34:
|
|
@@ -9280,11 +9334,11 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
9280
9334
|
case 117: {
|
|
9281
9335
|
let code = 0;
|
|
9282
9336
|
for (let j = 0; j < 4; j++) {
|
|
9283
|
-
|
|
9337
|
+
c3 = bytes[i2++];
|
|
9284
9338
|
code <<= 4;
|
|
9285
|
-
if (
|
|
9286
|
-
else if (
|
|
9287
|
-
else if (
|
|
9339
|
+
if (c3 >= 48 && c3 <= 57) code |= c3 - 48;
|
|
9340
|
+
else if (c3 >= 97 && c3 <= 102) code |= c3 + (10 - 97);
|
|
9341
|
+
else if (c3 >= 65 && c3 <= 70) code |= c3 + (10 - 65);
|
|
9288
9342
|
else throwSyntaxError(bytes, --i2);
|
|
9289
9343
|
}
|
|
9290
9344
|
value += fromCharCode(code);
|
|
@@ -9295,14 +9349,14 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
9295
9349
|
throwSyntaxError(bytes, --i2);
|
|
9296
9350
|
break;
|
|
9297
9351
|
}
|
|
9298
|
-
} else if (
|
|
9299
|
-
value += fromCharCode(
|
|
9300
|
-
} else if ((
|
|
9301
|
-
value += fromCharCode((
|
|
9302
|
-
} else if ((
|
|
9303
|
-
value += fromCharCode((
|
|
9304
|
-
} else if ((
|
|
9305
|
-
let codePoint = (
|
|
9352
|
+
} else if (c3 <= 127) {
|
|
9353
|
+
value += fromCharCode(c3);
|
|
9354
|
+
} else if ((c3 & 224) === 192) {
|
|
9355
|
+
value += fromCharCode((c3 & 31) << 6 | bytes[i2++] & 63);
|
|
9356
|
+
} else if ((c3 & 240) === 224) {
|
|
9357
|
+
value += fromCharCode((c3 & 15) << 12 | (bytes[i2++] & 63) << 6 | bytes[i2++] & 63);
|
|
9358
|
+
} else if ((c3 & 248) == 240) {
|
|
9359
|
+
let codePoint = (c3 & 7) << 18 | (bytes[i2++] & 63) << 12 | (bytes[i2++] & 63) << 6 | bytes[i2++] & 63;
|
|
9306
9360
|
if (codePoint > 65535) {
|
|
9307
9361
|
codePoint -= 65536;
|
|
9308
9362
|
value += fromCharCode(codePoint >> 10 & 1023 | 55296);
|
|
@@ -9362,9 +9416,9 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
9362
9416
|
throwSyntaxError(bytes, --i2);
|
|
9363
9417
|
}
|
|
9364
9418
|
}
|
|
9365
|
-
|
|
9366
|
-
while (
|
|
9367
|
-
|
|
9419
|
+
c3 = bytes[i2];
|
|
9420
|
+
while (c3 <= 32) {
|
|
9421
|
+
c3 = bytes[++i2];
|
|
9368
9422
|
}
|
|
9369
9423
|
switch (state) {
|
|
9370
9424
|
case 0: {
|
|
@@ -9375,11 +9429,11 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
9375
9429
|
}
|
|
9376
9430
|
case 1: {
|
|
9377
9431
|
object.push(value);
|
|
9378
|
-
if (
|
|
9432
|
+
if (c3 === 44) {
|
|
9379
9433
|
i2++;
|
|
9380
9434
|
continue;
|
|
9381
9435
|
}
|
|
9382
|
-
if (
|
|
9436
|
+
if (c3 === 93) {
|
|
9383
9437
|
continue;
|
|
9384
9438
|
}
|
|
9385
9439
|
break;
|
|
@@ -9387,18 +9441,18 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
9387
9441
|
case 2: {
|
|
9388
9442
|
if (property === null) {
|
|
9389
9443
|
property = value;
|
|
9390
|
-
if (
|
|
9444
|
+
if (c3 === 58) {
|
|
9391
9445
|
i2++;
|
|
9392
9446
|
continue;
|
|
9393
9447
|
}
|
|
9394
9448
|
} else {
|
|
9395
9449
|
object[property] = value;
|
|
9396
9450
|
property = null;
|
|
9397
|
-
if (
|
|
9451
|
+
if (c3 === 44) {
|
|
9398
9452
|
i2++;
|
|
9399
9453
|
continue;
|
|
9400
9454
|
}
|
|
9401
|
-
if (
|
|
9455
|
+
if (c3 === 125) {
|
|
9402
9456
|
continue;
|
|
9403
9457
|
}
|
|
9404
9458
|
}
|
|
@@ -11786,7 +11840,9 @@ async function bundleEdgeFunction(options) {
|
|
|
11786
11840
|
alias,
|
|
11787
11841
|
plugins: [createDenoEdgePlugin(workspace, denoImports, functionsDir)],
|
|
11788
11842
|
mainFields: ["module", "main"],
|
|
11789
|
-
|
|
11843
|
+
// `react-server`: server code. `@donotdev/core` (".") resolves to its client-free
|
|
11844
|
+
// server entry, as in Next's server layer (docs/architecture/INDEX.md, export conditions).
|
|
11845
|
+
conditions: ["react-server", "import", "module"],
|
|
11790
11846
|
logLevel: "warning",
|
|
11791
11847
|
metafile: true
|
|
11792
11848
|
};
|