create-morax 2.0.0 → 2.0.2
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/README.github.md +139 -139
- package/README.md +88 -88
- package/dist/index.js +194 -115
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import pc29 from "picocolors";
|
|
|
5
5
|
|
|
6
6
|
// src/core/runner.ts
|
|
7
7
|
import path35 from "path";
|
|
8
|
-
import { spinner as
|
|
8
|
+
import { spinner as spinner20 } from "@clack/prompts";
|
|
9
9
|
import pc28 from "picocolors";
|
|
10
10
|
|
|
11
11
|
// src/core/startcli.ts
|
|
@@ -27,7 +27,7 @@ function startCli() {
|
|
|
27
27
|
console.log("\n");
|
|
28
28
|
console.log(moraxGradient(asciiArt));
|
|
29
29
|
console.log("\n");
|
|
30
|
-
intro(pc.yellow("
|
|
30
|
+
intro(pc.yellow("Welcome to Morax \u2014 The Next-Gen Workspace Scaffolder"));
|
|
31
31
|
console.log(
|
|
32
32
|
boxen(
|
|
33
33
|
`\u26A1 ${pc.bold("Morax")} automates the setup of modern ${pc.cyan("pnpm workspaces")}, linking internal shared configurations, UI packages, and framework apps concurrently.`,
|
|
@@ -47,13 +47,13 @@ import pc3 from "picocolors";
|
|
|
47
47
|
import fsPromises from "fs/promises";
|
|
48
48
|
|
|
49
49
|
// src/utils/exec.ts
|
|
50
|
-
import { exec } from "child_process";
|
|
50
|
+
import { exec, spawn } from "child_process";
|
|
51
51
|
import { promisify } from "util";
|
|
52
52
|
import pc2 from "picocolors";
|
|
53
53
|
var execAsync = promisify(exec);
|
|
54
54
|
async function runCommand(command, options = {}) {
|
|
55
|
-
options.silent
|
|
56
|
-
if (!
|
|
55
|
+
const isSilent = options.silent ?? false;
|
|
56
|
+
if (!isSilent) {
|
|
57
57
|
console.log(pc2.cyan(`> ${command}`));
|
|
58
58
|
}
|
|
59
59
|
try {
|
|
@@ -61,7 +61,7 @@ async function runCommand(command, options = {}) {
|
|
|
61
61
|
cwd: options.cwd,
|
|
62
62
|
env: { ...process.env, NODE_NO_WARNINGS: "1" }
|
|
63
63
|
});
|
|
64
|
-
if (!
|
|
64
|
+
if (!isSilent) {
|
|
65
65
|
if (stdout && stdout.trim()) {
|
|
66
66
|
console.log(stdout.trim());
|
|
67
67
|
}
|
|
@@ -71,17 +71,41 @@ async function runCommand(command, options = {}) {
|
|
|
71
71
|
}
|
|
72
72
|
return { stdout, stderr };
|
|
73
73
|
} catch (error) {
|
|
74
|
-
if (!
|
|
74
|
+
if (!isSilent) {
|
|
75
75
|
if (error.stdout && error.stdout.trim()) {
|
|
76
76
|
console.log(error.stdout.trim());
|
|
77
77
|
}
|
|
78
78
|
if (error.stderr && error.stderr.trim()) {
|
|
79
79
|
console.error(pc2.red(error.stderr.trim()));
|
|
80
80
|
}
|
|
81
|
+
} else if (error.stderr && error.stderr.trim()) {
|
|
82
|
+
error.message = `${error.message}
|
|
83
|
+
${error.stderr.trim()}`;
|
|
81
84
|
}
|
|
82
85
|
throw error;
|
|
83
86
|
}
|
|
84
87
|
}
|
|
88
|
+
function runInteractiveCommand(command, args, cwd) {
|
|
89
|
+
return new Promise((resolve, reject) => {
|
|
90
|
+
const fullCommand = args.length > 0 ? `${command} ${args.join(" ")}` : command;
|
|
91
|
+
const child = spawn(fullCommand, [], {
|
|
92
|
+
cwd,
|
|
93
|
+
stdio: "inherit",
|
|
94
|
+
shell: true,
|
|
95
|
+
env: { ...process.env, NODE_NO_WARNINGS: "1" }
|
|
96
|
+
});
|
|
97
|
+
child.on("close", (code) => {
|
|
98
|
+
if (code === 0) {
|
|
99
|
+
resolve();
|
|
100
|
+
} else {
|
|
101
|
+
reject(new Error(`Command "${fullCommand}" exited with code ${code}`));
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
child.on("error", (err) => {
|
|
105
|
+
reject(err);
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
}
|
|
85
109
|
|
|
86
110
|
// src/core/preflight.ts
|
|
87
111
|
var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -1027,12 +1051,12 @@ import pc9 from "picocolors";
|
|
|
1027
1051
|
import pc7 from "picocolors";
|
|
1028
1052
|
import fsPromises3 from "fs/promises";
|
|
1029
1053
|
import path2 from "path";
|
|
1030
|
-
import { spawn } from "child_process";
|
|
1054
|
+
import { spawn as spawn2 } from "child_process";
|
|
1031
1055
|
import { confirm, spinner as spinner2, text as text2 } from "@clack/prompts";
|
|
1032
|
-
function
|
|
1056
|
+
function runInteractiveCommand2(command, args, cwd) {
|
|
1033
1057
|
return new Promise((resolve, reject) => {
|
|
1034
1058
|
const fullCommand = args.length > 0 ? `${command} ${args.join(" ")}` : command;
|
|
1035
|
-
const child =
|
|
1059
|
+
const child = spawn2(fullCommand, [], {
|
|
1036
1060
|
cwd,
|
|
1037
1061
|
stdio: "inherit",
|
|
1038
1062
|
shell: true,
|
|
@@ -1081,7 +1105,7 @@ async function setupReact(projectPath, isMonorepo = true) {
|
|
|
1081
1105
|
} catch {
|
|
1082
1106
|
}
|
|
1083
1107
|
try {
|
|
1084
|
-
await
|
|
1108
|
+
await runInteractiveCommand2("pnpm", ["create", "vite@latest"], appsDir);
|
|
1085
1109
|
let afterDirs = [];
|
|
1086
1110
|
try {
|
|
1087
1111
|
afterDirs = await fsPromises3.readdir(appsDir);
|
|
@@ -1100,19 +1124,20 @@ async function setupReact(projectPath, isMonorepo = true) {
|
|
|
1100
1124
|
`Vite React application directory "apps/${createdDirName}" was not found. Please ensure you complete the Vite installation.`
|
|
1101
1125
|
);
|
|
1102
1126
|
}
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1127
|
+
const pkgPath = path2.join(webDir, "package.json");
|
|
1128
|
+
try {
|
|
1129
|
+
const pkgRaw = await fsPromises3.readFile(pkgPath, "utf8");
|
|
1130
|
+
const pkg = JSON.parse(pkgRaw);
|
|
1131
|
+
if (isMonorepo) {
|
|
1108
1132
|
pkg.name = "web";
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
"
|
|
1113
|
-
|
|
1114
|
-
} catch {
|
|
1133
|
+
} else {
|
|
1134
|
+
pkg.pnpm = {
|
|
1135
|
+
...pkg.pnpm || {},
|
|
1136
|
+
onlyBuiltDependencies: ["esbuild"]
|
|
1137
|
+
};
|
|
1115
1138
|
}
|
|
1139
|
+
await fsPromises3.writeFile(pkgPath, JSON.stringify(pkg, null, 2), "utf8");
|
|
1140
|
+
} catch {
|
|
1116
1141
|
}
|
|
1117
1142
|
const aliasSpinner = spinner2();
|
|
1118
1143
|
aliasSpinner.start("Configuring import aliases and Node types...");
|
|
@@ -1313,7 +1338,7 @@ async function setupReact(projectPath, isMonorepo = true) {
|
|
|
1313
1338
|
console.log(
|
|
1314
1339
|
pc7.cyan("\nStarting interactive shadcn UI initialization...")
|
|
1315
1340
|
);
|
|
1316
|
-
await
|
|
1341
|
+
await runInteractiveCommand2("pnpm", args, webDir);
|
|
1317
1342
|
console.log(
|
|
1318
1343
|
pc7.green(
|
|
1319
1344
|
isMonorepo ? `
|
|
@@ -1566,11 +1591,11 @@ import { confirm as confirm3 } from "@clack/prompts";
|
|
|
1566
1591
|
import pc10 from "picocolors";
|
|
1567
1592
|
import fsPromises6 from "fs/promises";
|
|
1568
1593
|
import path6 from "path";
|
|
1569
|
-
import { spawn as
|
|
1570
|
-
function
|
|
1594
|
+
import { spawn as spawn3 } from "child_process";
|
|
1595
|
+
function runInteractiveCommand3(command, args, cwd) {
|
|
1571
1596
|
return new Promise((resolve, reject) => {
|
|
1572
1597
|
const fullCommand = args.length > 0 ? `${command} ${args.join(" ")}` : command;
|
|
1573
|
-
const child =
|
|
1598
|
+
const child = spawn3(fullCommand, [], {
|
|
1574
1599
|
cwd,
|
|
1575
1600
|
stdio: "inherit",
|
|
1576
1601
|
shell: true,
|
|
@@ -1597,7 +1622,7 @@ async function setupNextjs(projectPath, isMonorepo = true) {
|
|
|
1597
1622
|
} catch {
|
|
1598
1623
|
}
|
|
1599
1624
|
console.log(pc10.cyan("\nStarting interactive Next.js application setup..."));
|
|
1600
|
-
await
|
|
1625
|
+
await runInteractiveCommand3(
|
|
1601
1626
|
"pnpm",
|
|
1602
1627
|
["dlx", "create-next-app@latest", targetName],
|
|
1603
1628
|
appsDir
|
|
@@ -1611,19 +1636,24 @@ async function setupNextjs(projectPath, isMonorepo = true) {
|
|
|
1611
1636
|
} catch {
|
|
1612
1637
|
}
|
|
1613
1638
|
}
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1639
|
+
const webPkgPath = path6.join(webDir, "package.json");
|
|
1640
|
+
try {
|
|
1641
|
+
const webPkgRaw = await fsPromises6.readFile(webPkgPath, "utf8");
|
|
1642
|
+
const webPkg = JSON.parse(webPkgRaw);
|
|
1643
|
+
if (isMonorepo) {
|
|
1619
1644
|
webPkg.name = "web";
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
"
|
|
1624
|
-
|
|
1625
|
-
} catch {
|
|
1645
|
+
} else {
|
|
1646
|
+
webPkg.pnpm = {
|
|
1647
|
+
...webPkg.pnpm || {},
|
|
1648
|
+
onlyBuiltDependencies: ["sharp"]
|
|
1649
|
+
};
|
|
1626
1650
|
}
|
|
1651
|
+
await fsPromises6.writeFile(
|
|
1652
|
+
webPkgPath,
|
|
1653
|
+
JSON.stringify(webPkg, null, 2),
|
|
1654
|
+
"utf8"
|
|
1655
|
+
);
|
|
1656
|
+
} catch {
|
|
1627
1657
|
}
|
|
1628
1658
|
return webDir;
|
|
1629
1659
|
}
|
|
@@ -1633,16 +1663,16 @@ import { confirm as confirm4 } from "@clack/prompts";
|
|
|
1633
1663
|
import pc11 from "picocolors";
|
|
1634
1664
|
import fsPromises7 from "fs/promises";
|
|
1635
1665
|
import path7 from "path";
|
|
1636
|
-
import { spawn as
|
|
1666
|
+
import { spawn as spawn4 } from "child_process";
|
|
1637
1667
|
async function promptShadcn() {
|
|
1638
1668
|
return await confirm4({
|
|
1639
1669
|
message: "Do you want to setup shadcn UI in your Next.js website (apps/web)?",
|
|
1640
1670
|
initialValue: true
|
|
1641
1671
|
});
|
|
1642
1672
|
}
|
|
1643
|
-
function
|
|
1673
|
+
function runInteractiveCommand4(command, args, cwd) {
|
|
1644
1674
|
return new Promise((resolve, reject) => {
|
|
1645
|
-
const child =
|
|
1675
|
+
const child = spawn4(command, args, {
|
|
1646
1676
|
cwd,
|
|
1647
1677
|
stdio: "inherit",
|
|
1648
1678
|
shell: true,
|
|
@@ -1667,7 +1697,7 @@ function runInteractiveCommand3(command, args, cwd) {
|
|
|
1667
1697
|
async function setupShadcn(projectPath, isMonorepo = true) {
|
|
1668
1698
|
const webDir = isMonorepo ? path7.join(projectPath, "apps", "web") : projectPath;
|
|
1669
1699
|
console.log(pc11.cyan("\nStarting interactive shadcn UI initialization..."));
|
|
1670
|
-
await
|
|
1700
|
+
await runInteractiveCommand4(
|
|
1671
1701
|
"pnpm",
|
|
1672
1702
|
["dlx", "shadcn@latest", "init", "--template", "next"],
|
|
1673
1703
|
webDir
|
|
@@ -1732,9 +1762,21 @@ import fsPromises8 from "fs/promises";
|
|
|
1732
1762
|
import path9 from "path";
|
|
1733
1763
|
async function generateWorkspaceConfig(name, directories, projectPath) {
|
|
1734
1764
|
await fsPromises8.mkdir(projectPath, { recursive: true });
|
|
1765
|
+
const defaultOnlyBuiltDeps = [
|
|
1766
|
+
"esbuild",
|
|
1767
|
+
"@biomejs/biome",
|
|
1768
|
+
"oxlint",
|
|
1769
|
+
"lefthook",
|
|
1770
|
+
"sharp"
|
|
1771
|
+
];
|
|
1735
1772
|
const workspaceYamlContent = [
|
|
1736
1773
|
"packages:",
|
|
1737
1774
|
...directories.map((dir) => ` - '${dir}/*'`),
|
|
1775
|
+
"",
|
|
1776
|
+
"onlyBuiltDependencies:",
|
|
1777
|
+
...defaultOnlyBuiltDeps.map(
|
|
1778
|
+
(dep) => dep.startsWith("@") ? ` - '${dep}'` : ` - ${dep}`
|
|
1779
|
+
),
|
|
1738
1780
|
""
|
|
1739
1781
|
].join("\n");
|
|
1740
1782
|
await fsPromises8.writeFile(
|
|
@@ -1759,6 +1801,9 @@ async function generateWorkspaceConfig(name, directories, projectPath) {
|
|
|
1759
1801
|
} catch {
|
|
1760
1802
|
pkg.packageManager = "pnpm@latest";
|
|
1761
1803
|
}
|
|
1804
|
+
pkg.pnpm = {
|
|
1805
|
+
onlyBuiltDependencies: defaultOnlyBuiltDeps
|
|
1806
|
+
};
|
|
1762
1807
|
pkg.workspaces = directories.map((dir) => `${dir}/*`);
|
|
1763
1808
|
pkg.scripts = {
|
|
1764
1809
|
dev: "pnpm -r --parallel dev"
|
|
@@ -2600,61 +2645,95 @@ async function promptAndSetupExtras(projectPath, options) {
|
|
|
2600
2645
|
}
|
|
2601
2646
|
|
|
2602
2647
|
// src/modules/skills/index.ts
|
|
2603
|
-
import {
|
|
2648
|
+
import { confirm as confirm5 } from "@clack/prompts";
|
|
2604
2649
|
import pc15 from "picocolors";
|
|
2605
2650
|
import fsPromises14 from "fs/promises";
|
|
2606
2651
|
import path15 from "path";
|
|
2607
|
-
var CURATED_SKILLS = [
|
|
2608
|
-
{
|
|
2609
|
-
id: "modular-nextjs-dynamic",
|
|
2610
|
-
name: "Modular Next.js (Dynamic)",
|
|
2611
|
-
repo: "AshutoshDM1/skills",
|
|
2612
|
-
description: "Dynamic modular architecture for Next.js webapps",
|
|
2613
|
-
hint: "SaaS, dashboards & portals"
|
|
2614
|
-
},
|
|
2615
|
-
{
|
|
2616
|
-
id: "modular-nextjs-lean",
|
|
2617
|
-
name: "Modular Next.js (Lean)",
|
|
2618
|
-
repo: "AshutoshDM1/skills",
|
|
2619
|
-
description: "Lean modular architecture for Next.js landing pages",
|
|
2620
|
-
hint: "Landing pages & marketing sites"
|
|
2621
|
-
}
|
|
2622
|
-
];
|
|
2623
2652
|
async function promptSkills() {
|
|
2624
|
-
const result = await
|
|
2625
|
-
message: "Install
|
|
2626
|
-
|
|
2627
|
-
value: skill.id,
|
|
2628
|
-
label: skill.name,
|
|
2629
|
-
hint: skill.hint
|
|
2630
|
-
})),
|
|
2631
|
-
initialValues: [],
|
|
2632
|
-
required: false
|
|
2653
|
+
const result = await confirm5({
|
|
2654
|
+
message: "Install AI Agent Skills (skills.sh)?",
|
|
2655
|
+
initialValue: true
|
|
2633
2656
|
});
|
|
2634
2657
|
handleCancel(result);
|
|
2635
2658
|
return result;
|
|
2636
2659
|
}
|
|
2637
|
-
async function
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2660
|
+
async function moveRulesToAgentRoot(projectPath) {
|
|
2661
|
+
const targetRulesDir = path15.join(projectPath, ".agents", "rules");
|
|
2662
|
+
const sourceCandidates = [
|
|
2663
|
+
path15.join(projectPath, ".agents", "skills", "rules"),
|
|
2664
|
+
path15.join(projectPath, ".agent", "skills", "rules"),
|
|
2665
|
+
path15.join(projectPath, ".agent", "rules")
|
|
2666
|
+
];
|
|
2667
|
+
let moved = false;
|
|
2668
|
+
for (const sourceDir of sourceCandidates) {
|
|
2646
2669
|
try {
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
}
|
|
2651
|
-
|
|
2670
|
+
await fsPromises14.access(sourceDir);
|
|
2671
|
+
} catch {
|
|
2672
|
+
continue;
|
|
2673
|
+
}
|
|
2674
|
+
await fsPromises14.mkdir(targetRulesDir, { recursive: true });
|
|
2675
|
+
try {
|
|
2676
|
+
const entries = await fsPromises14.readdir(sourceDir);
|
|
2677
|
+
for (const entry of entries) {
|
|
2678
|
+
const srcPath = path15.join(sourceDir, entry);
|
|
2679
|
+
const destPath = path15.join(targetRulesDir, entry);
|
|
2680
|
+
await fsPromises14.cp(srcPath, destPath, {
|
|
2681
|
+
recursive: true,
|
|
2682
|
+
force: true
|
|
2683
|
+
});
|
|
2684
|
+
}
|
|
2685
|
+
await fsPromises14.rm(sourceDir, { recursive: true, force: true });
|
|
2686
|
+
moved = true;
|
|
2687
|
+
} catch (err) {
|
|
2688
|
+
console.log(
|
|
2652
2689
|
pc15.yellow(
|
|
2653
|
-
`\u26A0 Warning:
|
|
2690
|
+
`\u26A0 Warning: Could not move rules from ${sourceDir} (${err.message})
|
|
2691
|
+
`
|
|
2654
2692
|
)
|
|
2655
2693
|
);
|
|
2656
2694
|
}
|
|
2657
2695
|
}
|
|
2696
|
+
const agentDir = path15.join(projectPath, ".agent");
|
|
2697
|
+
try {
|
|
2698
|
+
const remaining = await fsPromises14.readdir(agentDir);
|
|
2699
|
+
if (remaining.length === 0) {
|
|
2700
|
+
await fsPromises14.rm(agentDir, { recursive: true, force: true });
|
|
2701
|
+
} else if (remaining.length === 1 && remaining[0] === "skills") {
|
|
2702
|
+
const skillsRemaining = await fsPromises14.readdir(
|
|
2703
|
+
path15.join(agentDir, "skills")
|
|
2704
|
+
);
|
|
2705
|
+
if (skillsRemaining.length === 0) {
|
|
2706
|
+
await fsPromises14.rm(agentDir, { recursive: true, force: true });
|
|
2707
|
+
}
|
|
2708
|
+
}
|
|
2709
|
+
} catch {
|
|
2710
|
+
}
|
|
2711
|
+
if (moved) {
|
|
2712
|
+
console.log(
|
|
2713
|
+
pc15.green(`\u2714 Configured AI rules: Moved rules to .agents/rules
|
|
2714
|
+
`)
|
|
2715
|
+
);
|
|
2716
|
+
}
|
|
2717
|
+
}
|
|
2718
|
+
async function installSkills(projectPath) {
|
|
2719
|
+
console.log(pc15.cyan("\nLaunching interactive skills CLI (skills.sh)...\n"));
|
|
2720
|
+
try {
|
|
2721
|
+
await runInteractiveCommand(
|
|
2722
|
+
"pnpm",
|
|
2723
|
+
["dlx", "skills", "add", "AshutoshDM1/skills"],
|
|
2724
|
+
projectPath
|
|
2725
|
+
);
|
|
2726
|
+
console.log(pc15.green("\n\u2714 Skills installation completed\n"));
|
|
2727
|
+
} catch (error) {
|
|
2728
|
+
console.log(
|
|
2729
|
+
pc15.yellow(
|
|
2730
|
+
`
|
|
2731
|
+
\u26A0 Note: Skills installation ended (${error.message || "CLI exited"})
|
|
2732
|
+
`
|
|
2733
|
+
)
|
|
2734
|
+
);
|
|
2735
|
+
}
|
|
2736
|
+
await moveRulesToAgentRoot(projectPath);
|
|
2658
2737
|
const claudeDir = path15.join(projectPath, ".claude");
|
|
2659
2738
|
try {
|
|
2660
2739
|
await fsPromises14.rm(claudeDir, { recursive: true, force: true });
|
|
@@ -2676,9 +2755,9 @@ async function installSkills(projectPath, selectedSkillIds) {
|
|
|
2676
2755
|
}
|
|
2677
2756
|
}
|
|
2678
2757
|
async function promptAndInstallSkills(projectPath) {
|
|
2679
|
-
const
|
|
2680
|
-
if (
|
|
2681
|
-
await installSkills(projectPath
|
|
2758
|
+
const shouldInstall = await promptSkills();
|
|
2759
|
+
if (shouldInstall) {
|
|
2760
|
+
await installSkills(projectPath);
|
|
2682
2761
|
}
|
|
2683
2762
|
}
|
|
2684
2763
|
|
|
@@ -2772,7 +2851,7 @@ async function setupRootEnv(projectPath, options = {}) {
|
|
|
2772
2851
|
}
|
|
2773
2852
|
|
|
2774
2853
|
// src/modules/git/husky.ts
|
|
2775
|
-
import { confirm as
|
|
2854
|
+
import { confirm as confirm6, spinner as spinner8 } from "@clack/prompts";
|
|
2776
2855
|
import pc16 from "picocolors";
|
|
2777
2856
|
import fsPromises16 from "fs/promises";
|
|
2778
2857
|
import path17 from "path";
|
|
@@ -2798,7 +2877,7 @@ async function setupHusky(projectPath) {
|
|
|
2798
2877
|
}
|
|
2799
2878
|
async function runHuskySetup(projectPath, gitInitialized) {
|
|
2800
2879
|
if (!gitInitialized) return;
|
|
2801
|
-
const s =
|
|
2880
|
+
const s = spinner8();
|
|
2802
2881
|
s.start("Setting up Husky hooks...");
|
|
2803
2882
|
try {
|
|
2804
2883
|
await setupHusky(projectPath);
|
|
@@ -2812,7 +2891,7 @@ Error details: ${error.message || error}`));
|
|
|
2812
2891
|
}
|
|
2813
2892
|
|
|
2814
2893
|
// src/modules/git/lefthook.ts
|
|
2815
|
-
import { spinner as
|
|
2894
|
+
import { spinner as spinner9 } from "@clack/prompts";
|
|
2816
2895
|
import pc17 from "picocolors";
|
|
2817
2896
|
import fsPromises17 from "fs/promises";
|
|
2818
2897
|
import path18 from "path";
|
|
@@ -2867,7 +2946,7 @@ async function setupLefthook(projectPath, hasFormatter, hasLinter) {
|
|
|
2867
2946
|
}
|
|
2868
2947
|
async function runLefthookSetup(projectPath, gitInitialized, hasFormatter = true, hasLinter = true) {
|
|
2869
2948
|
if (!gitInitialized) return;
|
|
2870
|
-
const s =
|
|
2949
|
+
const s = spinner9();
|
|
2871
2950
|
s.start("Configuring modern Lefthook Git hooks...");
|
|
2872
2951
|
try {
|
|
2873
2952
|
await setupLefthook(projectPath, hasFormatter, hasLinter);
|
|
@@ -2881,7 +2960,7 @@ Error details: ${error.message || error}`));
|
|
|
2881
2960
|
}
|
|
2882
2961
|
|
|
2883
2962
|
// src/modules/quality/biome.ts
|
|
2884
|
-
import { spinner as
|
|
2963
|
+
import { spinner as spinner10 } from "@clack/prompts";
|
|
2885
2964
|
import pc18 from "picocolors";
|
|
2886
2965
|
import fsPromises18 from "fs/promises";
|
|
2887
2966
|
import path19 from "path";
|
|
@@ -2946,7 +3025,7 @@ async function setupBiome(projectPath, options) {
|
|
|
2946
3025
|
);
|
|
2947
3026
|
}
|
|
2948
3027
|
async function runBiomeSetup(projectPath, options) {
|
|
2949
|
-
const s =
|
|
3028
|
+
const s = spinner10();
|
|
2950
3029
|
const actionText = options.linter && options.formatter ? "linter & formatter" : options.linter ? "linter" : "formatter";
|
|
2951
3030
|
s.start(`Configuring ultra-fast Biome ${actionText}...`);
|
|
2952
3031
|
try {
|
|
@@ -2961,7 +3040,7 @@ Error details: ${error.message || error}`));
|
|
|
2961
3040
|
}
|
|
2962
3041
|
|
|
2963
3042
|
// src/modules/quality/oxlint.ts
|
|
2964
|
-
import { spinner as
|
|
3043
|
+
import { spinner as spinner11 } from "@clack/prompts";
|
|
2965
3044
|
import pc19 from "picocolors";
|
|
2966
3045
|
import fsPromises19 from "fs/promises";
|
|
2967
3046
|
import path20 from "path";
|
|
@@ -3000,7 +3079,7 @@ async function setupOxlint(projectPath) {
|
|
|
3000
3079
|
);
|
|
3001
3080
|
}
|
|
3002
3081
|
async function runOxlintSetup(projectPath) {
|
|
3003
|
-
const s =
|
|
3082
|
+
const s = spinner11();
|
|
3004
3083
|
s.start("Configuring ultra-fast Oxlint linter...");
|
|
3005
3084
|
try {
|
|
3006
3085
|
await setupOxlint(projectPath);
|
|
@@ -3016,7 +3095,7 @@ Error details: ${error.message || error}`));
|
|
|
3016
3095
|
}
|
|
3017
3096
|
|
|
3018
3097
|
// src/modules/quality/prettier.ts
|
|
3019
|
-
import { confirm as
|
|
3098
|
+
import { confirm as confirm7, spinner as spinner12 } from "@clack/prompts";
|
|
3020
3099
|
import pc20 from "picocolors";
|
|
3021
3100
|
import fsPromises20 from "fs/promises";
|
|
3022
3101
|
import path21 from "path";
|
|
@@ -3062,7 +3141,7 @@ async function setupPrettier(projectPath) {
|
|
|
3062
3141
|
await runCommand("pnpm format", { cwd: projectPath });
|
|
3063
3142
|
}
|
|
3064
3143
|
async function runPrettierSetup(projectPath) {
|
|
3065
|
-
const s =
|
|
3144
|
+
const s = spinner12();
|
|
3066
3145
|
s.start("Setting up Prettier auto-formatting...");
|
|
3067
3146
|
try {
|
|
3068
3147
|
await setupPrettier(projectPath);
|
|
@@ -3076,7 +3155,7 @@ Error details: ${error.message || error}`));
|
|
|
3076
3155
|
}
|
|
3077
3156
|
|
|
3078
3157
|
// src/modules/packages/typescript.ts
|
|
3079
|
-
import { spinner as
|
|
3158
|
+
import { spinner as spinner13 } from "@clack/prompts";
|
|
3080
3159
|
import pc21 from "picocolors";
|
|
3081
3160
|
import fsPromises21 from "fs/promises";
|
|
3082
3161
|
import path22 from "path";
|
|
@@ -3128,7 +3207,7 @@ async function runTypescriptSetup(projectPath) {
|
|
|
3128
3207
|
} catch {
|
|
3129
3208
|
return;
|
|
3130
3209
|
}
|
|
3131
|
-
const s =
|
|
3210
|
+
const s = spinner13();
|
|
3132
3211
|
s.start("Setting up modular TypeScript config in packages/typescript...");
|
|
3133
3212
|
try {
|
|
3134
3213
|
await setupTypescript(projectPath);
|
|
@@ -3148,7 +3227,7 @@ Error details: ${error.message || error}`));
|
|
|
3148
3227
|
// src/modules/apps/server/index.ts
|
|
3149
3228
|
import fsPromises28 from "fs/promises";
|
|
3150
3229
|
import path31 from "path";
|
|
3151
|
-
import { spinner as
|
|
3230
|
+
import { spinner as spinner16 } from "@clack/prompts";
|
|
3152
3231
|
import pc24 from "picocolors";
|
|
3153
3232
|
|
|
3154
3233
|
// src/modules/apps/server/frameworks/express/index.ts
|
|
@@ -3704,7 +3783,7 @@ async function promptServerDeployment(framework) {
|
|
|
3704
3783
|
|
|
3705
3784
|
// src/modules/apps/server/deployment/docker/index.ts
|
|
3706
3785
|
import path27 from "path";
|
|
3707
|
-
import { spinner as
|
|
3786
|
+
import { spinner as spinner14 } from "@clack/prompts";
|
|
3708
3787
|
import pc22 from "picocolors";
|
|
3709
3788
|
|
|
3710
3789
|
// src/modules/apps/server/deployment/docker/express-docker.ts
|
|
@@ -3887,7 +3966,7 @@ async function setupDockerDeployment(options) {
|
|
|
3887
3966
|
const serverDir = path27.join(projectPath, "apps", "server");
|
|
3888
3967
|
const frameworkLabel = framework === "express" ? "Express" : "Hono";
|
|
3889
3968
|
const runtimeLabel = runtime === "bun" ? "Bun" : "Node.js";
|
|
3890
|
-
const s =
|
|
3969
|
+
const s = spinner14();
|
|
3891
3970
|
s.start(
|
|
3892
3971
|
`Configuring Docker deployment for ${frameworkLabel} (${runtimeLabel}) in apps/server...`
|
|
3893
3972
|
);
|
|
@@ -3910,7 +3989,7 @@ async function setupDockerDeployment(options) {
|
|
|
3910
3989
|
|
|
3911
3990
|
// src/modules/apps/server/deployment/vercel/index.ts
|
|
3912
3991
|
import path30 from "path";
|
|
3913
|
-
import { spinner as
|
|
3992
|
+
import { spinner as spinner15 } from "@clack/prompts";
|
|
3914
3993
|
import pc23 from "picocolors";
|
|
3915
3994
|
|
|
3916
3995
|
// src/modules/apps/server/deployment/vercel/express-vercel.ts
|
|
@@ -3991,7 +4070,7 @@ async function setupVercelDeployment(options) {
|
|
|
3991
4070
|
const { projectPath, framework, runtime } = options;
|
|
3992
4071
|
const serverDir = path30.join(projectPath, "apps", "server");
|
|
3993
4072
|
const frameworkLabel = framework === "express" ? "Express" : "Hono";
|
|
3994
|
-
const s =
|
|
4073
|
+
const s = spinner15();
|
|
3995
4074
|
s.start(
|
|
3996
4075
|
`Configuring Vercel deployment for ${frameworkLabel} backend in apps/server...`
|
|
3997
4076
|
);
|
|
@@ -4031,7 +4110,7 @@ async function runServerSetup(projectPath, framework, linter = "none", orm = "no
|
|
|
4031
4110
|
}
|
|
4032
4111
|
const frameworkLabel = framework === "express" ? "Express" : "Hono";
|
|
4033
4112
|
const runtimeLabel = runtime === "bun" ? "Bun" : "Node.js";
|
|
4034
|
-
const s =
|
|
4113
|
+
const s = spinner16();
|
|
4035
4114
|
s.start(
|
|
4036
4115
|
`Setting up modular ${frameworkLabel} backend (${runtimeLabel}) in apps/server...`
|
|
4037
4116
|
);
|
|
@@ -4098,7 +4177,7 @@ async function addWeb(projectPath) {
|
|
|
4098
4177
|
// src/modules/packages/env/index.ts
|
|
4099
4178
|
import fsPromises29 from "fs/promises";
|
|
4100
4179
|
import path32 from "path";
|
|
4101
|
-
import { confirm as
|
|
4180
|
+
import { confirm as confirm8, spinner as spinner17 } from "@clack/prompts";
|
|
4102
4181
|
import pc25 from "picocolors";
|
|
4103
4182
|
|
|
4104
4183
|
// src/modules/packages/env/package.ts
|
|
@@ -4452,8 +4531,8 @@ function renderCheckEnvTemplate(options) {
|
|
|
4452
4531
|
|
|
4453
4532
|
// src/modules/packages/env/index.ts
|
|
4454
4533
|
async function promptEnv() {
|
|
4455
|
-
const result = await
|
|
4456
|
-
message: "
|
|
4534
|
+
const result = await confirm8({
|
|
4535
|
+
message: `Configure ${pc25.cyan("packages/env")}? ${pc25.dim("(@repo/env: zod, dotenv)")}`,
|
|
4457
4536
|
initialValue: true
|
|
4458
4537
|
});
|
|
4459
4538
|
handleCancel(result);
|
|
@@ -4706,7 +4785,7 @@ async function setupEnvPackage(options) {
|
|
|
4706
4785
|
}
|
|
4707
4786
|
}
|
|
4708
4787
|
async function runEnvSetup(projectPath, options) {
|
|
4709
|
-
const s =
|
|
4788
|
+
const s = spinner17();
|
|
4710
4789
|
s.start("Configuring type-safe environment package in packages/env...");
|
|
4711
4790
|
try {
|
|
4712
4791
|
await setupEnvPackage(options);
|
|
@@ -4726,11 +4805,11 @@ Error details: ${error.message || error}`));
|
|
|
4726
4805
|
// src/modules/packages/auth/index.ts
|
|
4727
4806
|
import fsPromises30 from "fs/promises";
|
|
4728
4807
|
import path33 from "path";
|
|
4729
|
-
import { confirm as
|
|
4808
|
+
import { confirm as confirm9, spinner as spinner18 } from "@clack/prompts";
|
|
4730
4809
|
import pc26 from "picocolors";
|
|
4731
4810
|
async function promptAuth() {
|
|
4732
|
-
const result = await
|
|
4733
|
-
message:
|
|
4811
|
+
const result = await confirm9({
|
|
4812
|
+
message: `Configure ${pc26.cyan("packages/auth")}? ${pc26.dim("(@repo/auth: better-auth & Drizzle schemas)")}`,
|
|
4734
4813
|
initialValue: true
|
|
4735
4814
|
});
|
|
4736
4815
|
handleCancel(result);
|
|
@@ -4738,7 +4817,7 @@ async function promptAuth() {
|
|
|
4738
4817
|
}
|
|
4739
4818
|
async function setupAuth(options) {
|
|
4740
4819
|
const { projectPath, dialect, serverFramework, hasServer, hasEnv } = options;
|
|
4741
|
-
const s =
|
|
4820
|
+
const s = spinner18();
|
|
4742
4821
|
s.start("Configuring shared Better Auth package (@repo/auth)...");
|
|
4743
4822
|
try {
|
|
4744
4823
|
const authDir = path33.join(projectPath, "packages", "auth");
|
|
@@ -5174,7 +5253,7 @@ Error details: ${error.message || error}`));
|
|
|
5174
5253
|
}
|
|
5175
5254
|
|
|
5176
5255
|
// src/modules/docker/index.ts
|
|
5177
|
-
import { spinner as
|
|
5256
|
+
import { spinner as spinner19 } from "@clack/prompts";
|
|
5178
5257
|
import pc27 from "picocolors";
|
|
5179
5258
|
import fsPromises31 from "fs/promises";
|
|
5180
5259
|
import path34 from "path";
|
|
@@ -5182,7 +5261,7 @@ async function setupDocker(projectPath, options) {
|
|
|
5182
5261
|
if (!options.postgres && !options.redis) {
|
|
5183
5262
|
return;
|
|
5184
5263
|
}
|
|
5185
|
-
const s =
|
|
5264
|
+
const s = spinner19();
|
|
5186
5265
|
s.start("Configuring root Docker infrastructure in docker/...");
|
|
5187
5266
|
try {
|
|
5188
5267
|
const dockerDir = path34.join(projectPath, "docker");
|
|
@@ -5422,7 +5501,7 @@ async function runWorkspaceScaffolder(options = {}) {
|
|
|
5422
5501
|
}
|
|
5423
5502
|
});
|
|
5424
5503
|
await promptAndInstallSkills(projectPath);
|
|
5425
|
-
const s =
|
|
5504
|
+
const s = spinner20();
|
|
5426
5505
|
s.start("Running final workspace package installation...");
|
|
5427
5506
|
try {
|
|
5428
5507
|
await runCommand("pnpm install", { cwd: projectPath, silent: true });
|