@nextsparkjs/cli 0.1.0-beta.86 → 0.1.0-beta.88
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/dist/cli.js +39 -30
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3116,6 +3116,7 @@ async function generateProject(config2) {
|
|
|
3116
3116
|
await copyProjectFiles();
|
|
3117
3117
|
await updateGlobalsCss(config2);
|
|
3118
3118
|
await copyStarterTheme(config2);
|
|
3119
|
+
await fs8.ensureDir(path7.join(process.cwd(), "contents", "plugins"));
|
|
3119
3120
|
await copyContentFeatures(config2);
|
|
3120
3121
|
await updateThemeConfig(config2);
|
|
3121
3122
|
await updateDevConfig(config2);
|
|
@@ -3589,8 +3590,8 @@ async function runWizard(options = { mode: "interactive" }) {
|
|
|
3589
3590
|
const devCmd = isMonorepo ? "pnpm dev" : "pnpm dev";
|
|
3590
3591
|
console.log(chalk11.yellow(` Registries will be built automatically when you run "${devCmd}"`));
|
|
3591
3592
|
}
|
|
3592
|
-
await promptAIWorkflowSetup();
|
|
3593
|
-
showNextSteps(config2, selectedTheme);
|
|
3593
|
+
const aiChoice = await promptAIWorkflowSetup(config2);
|
|
3594
|
+
showNextSteps(config2, selectedTheme, aiChoice);
|
|
3594
3595
|
} catch (error) {
|
|
3595
3596
|
if (error instanceof Error) {
|
|
3596
3597
|
if (error.message.includes("User force closed")) {
|
|
@@ -3697,8 +3698,9 @@ function formatDevTool(tool) {
|
|
|
3697
3698
|
};
|
|
3698
3699
|
return mapping[tool] || tool;
|
|
3699
3700
|
}
|
|
3700
|
-
function showNextSteps(config2, referenceTheme = null) {
|
|
3701
|
+
function showNextSteps(config2, referenceTheme = null, aiChoice = "skip") {
|
|
3701
3702
|
const isMonorepo = config2.projectType === "web-mobile";
|
|
3703
|
+
const aiSetupDone = aiChoice === "claude";
|
|
3702
3704
|
console.log("");
|
|
3703
3705
|
console.log(chalk11.cyan(" " + "=".repeat(60)));
|
|
3704
3706
|
console.log(chalk11.bold.green(" \u2728 NextSpark project ready!"));
|
|
@@ -3707,12 +3709,12 @@ function showNextSteps(config2, referenceTheme = null) {
|
|
|
3707
3709
|
console.log(chalk11.bold.white(" Next steps:"));
|
|
3708
3710
|
console.log("");
|
|
3709
3711
|
const envPath = isMonorepo ? "web/.env" : ".env";
|
|
3710
|
-
console.log(chalk11.white(" 1. Configure your
|
|
3711
|
-
console.log(chalk11.gray(` Edit
|
|
3712
|
+
console.log(chalk11.white(" 1. Configure your environment:"));
|
|
3713
|
+
console.log(chalk11.gray(` Edit ${envPath} with your credentials:`));
|
|
3712
3714
|
console.log("");
|
|
3713
3715
|
console.log(chalk11.yellow(" DATABASE_URL"));
|
|
3714
3716
|
console.log(chalk11.gray(" PostgreSQL connection string"));
|
|
3715
|
-
console.log(chalk11.
|
|
3717
|
+
console.log(chalk11.gray(` Recommended: ${chalk11.cyan("https://supabase.com")} | ${chalk11.cyan("https://neon.com")}`));
|
|
3716
3718
|
console.log("");
|
|
3717
3719
|
console.log(chalk11.yellow(" BETTER_AUTH_SECRET"));
|
|
3718
3720
|
console.log(chalk11.gray(" Generate with:"));
|
|
@@ -3724,11 +3726,23 @@ function showNextSteps(config2, referenceTheme = null) {
|
|
|
3724
3726
|
console.log(chalk11.white(" 3. Start the development server:"));
|
|
3725
3727
|
console.log(chalk11.cyan(" pnpm dev"));
|
|
3726
3728
|
console.log("");
|
|
3729
|
+
let nextStep = 4;
|
|
3727
3730
|
if (isMonorepo) {
|
|
3728
|
-
console.log(chalk11.white(
|
|
3731
|
+
console.log(chalk11.white(` ${nextStep}. (Optional) Start the mobile app:`));
|
|
3729
3732
|
console.log(chalk11.cyan(" pnpm dev:mobile"));
|
|
3730
3733
|
console.log(chalk11.gray(" Or: cd mobile && pnpm start"));
|
|
3731
3734
|
console.log("");
|
|
3735
|
+
nextStep++;
|
|
3736
|
+
}
|
|
3737
|
+
if (aiSetupDone) {
|
|
3738
|
+
console.log(chalk11.white(` ${nextStep}. Start building with AI:`));
|
|
3739
|
+
console.log(chalk11.gray(" Open Claude Code in your project and run:"));
|
|
3740
|
+
console.log(chalk11.cyan(" /how-to:start"));
|
|
3741
|
+
console.log("");
|
|
3742
|
+
} else {
|
|
3743
|
+
console.log(chalk11.white(` ${nextStep}. (Optional) Setup AI workflows:`));
|
|
3744
|
+
console.log(chalk11.cyan(" nextspark setup:ai"));
|
|
3745
|
+
console.log("");
|
|
3732
3746
|
}
|
|
3733
3747
|
console.log(chalk11.gray(" " + "-".repeat(60)));
|
|
3734
3748
|
if (isMonorepo) {
|
|
@@ -3744,18 +3758,10 @@ function showNextSteps(config2, referenceTheme = null) {
|
|
|
3744
3758
|
const refPath = isMonorepo ? `web/contents/themes/${referenceTheme}/` : `contents/themes/${referenceTheme}/`;
|
|
3745
3759
|
console.log(chalk11.gray(` Reference: ${chalk11.white(refPath)}`));
|
|
3746
3760
|
}
|
|
3747
|
-
console.log("");
|
|
3748
|
-
console.log(chalk11.white(` ${isMonorepo ? "5" : "4"}. (Optional) Setup AI workflows:`));
|
|
3749
|
-
console.log(chalk11.cyan(" nextspark setup:ai"));
|
|
3750
|
-
console.log("");
|
|
3751
|
-
console.log(chalk11.gray(" Docs: https://nextspark.dev/docs"));
|
|
3761
|
+
console.log(chalk11.gray(` Docs: ${chalk11.cyan("https://nextspark.dev/docs")}`));
|
|
3752
3762
|
console.log("");
|
|
3753
3763
|
}
|
|
3754
|
-
async function promptAIWorkflowSetup() {
|
|
3755
|
-
console.log("");
|
|
3756
|
-
console.log(chalk11.cyan(" " + "=".repeat(60)));
|
|
3757
|
-
console.log(chalk11.bold.white(" AI Workflow Setup (Optional)"));
|
|
3758
|
-
console.log(chalk11.cyan(" " + "=".repeat(60)));
|
|
3764
|
+
async function promptAIWorkflowSetup(config2) {
|
|
3759
3765
|
console.log("");
|
|
3760
3766
|
const choice = await select6({
|
|
3761
3767
|
message: "Setup AI-assisted development workflows?",
|
|
@@ -3767,27 +3773,26 @@ async function promptAIWorkflowSetup() {
|
|
|
3767
3773
|
]
|
|
3768
3774
|
});
|
|
3769
3775
|
if (choice === "skip") {
|
|
3770
|
-
|
|
3771
|
-
return;
|
|
3776
|
+
return "skip";
|
|
3772
3777
|
}
|
|
3773
3778
|
if (choice === "cursor" || choice === "antigravity") {
|
|
3774
3779
|
showInfo(`${choice} support is coming soon. For now, use Claude Code.`);
|
|
3775
|
-
return;
|
|
3780
|
+
return "skip";
|
|
3776
3781
|
}
|
|
3777
|
-
const
|
|
3778
|
-
|
|
3779
|
-
prefixText: " "
|
|
3780
|
-
}).start();
|
|
3782
|
+
const projectRoot = process.cwd();
|
|
3783
|
+
const isMonorepo = isMonorepoProject(config2);
|
|
3781
3784
|
try {
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
cwd: process.cwd(),
|
|
3785
|
+
execSync("pnpm add -D -w @nextsparkjs/ai-workflow", {
|
|
3786
|
+
cwd: projectRoot,
|
|
3785
3787
|
stdio: "inherit"
|
|
3786
3788
|
});
|
|
3787
|
-
|
|
3789
|
+
let setupScript = join7(projectRoot, "node_modules", "@nextsparkjs", "ai-workflow", "scripts", "setup.mjs");
|
|
3790
|
+
if (!existsSync7(setupScript) && isMonorepo) {
|
|
3791
|
+
setupScript = join7(projectRoot, "web", "node_modules", "@nextsparkjs", "ai-workflow", "scripts", "setup.mjs");
|
|
3792
|
+
}
|
|
3788
3793
|
if (existsSync7(setupScript)) {
|
|
3789
3794
|
execSync(`node "${setupScript}" ${choice}`, {
|
|
3790
|
-
cwd:
|
|
3795
|
+
cwd: projectRoot,
|
|
3791
3796
|
stdio: "inherit"
|
|
3792
3797
|
});
|
|
3793
3798
|
showSuccess("AI workflow setup complete!");
|
|
@@ -3796,7 +3801,9 @@ async function promptAIWorkflowSetup() {
|
|
|
3796
3801
|
}
|
|
3797
3802
|
} catch (error) {
|
|
3798
3803
|
showError('Failed to install AI workflow package. Run "nextspark setup:ai" later.');
|
|
3804
|
+
return "skip";
|
|
3799
3805
|
}
|
|
3806
|
+
return choice;
|
|
3800
3807
|
}
|
|
3801
3808
|
function findLocalCoreTarball() {
|
|
3802
3809
|
const cwd = process.cwd();
|
|
@@ -4943,6 +4950,8 @@ function resolveAIWorkflowPath() {
|
|
|
4943
4950
|
const cwd = process.cwd();
|
|
4944
4951
|
const nmPath = join12(cwd, "node_modules", "@nextsparkjs", "ai-workflow");
|
|
4945
4952
|
if (existsSync12(nmPath)) return nmPath;
|
|
4953
|
+
const webNmPath = join12(cwd, "web", "node_modules", "@nextsparkjs", "ai-workflow");
|
|
4954
|
+
if (existsSync12(webNmPath)) return webNmPath;
|
|
4946
4955
|
const monoPath = join12(cwd, "packages", "ai-workflow");
|
|
4947
4956
|
if (existsSync12(monoPath)) return monoPath;
|
|
4948
4957
|
return null;
|
|
@@ -4964,7 +4973,7 @@ async function setupAICommand(options) {
|
|
|
4964
4973
|
console.log(chalk18.red(" @nextsparkjs/ai-workflow package not found."));
|
|
4965
4974
|
console.log("");
|
|
4966
4975
|
console.log(chalk18.gray(" Install it first:"));
|
|
4967
|
-
console.log(chalk18.cyan(" pnpm add -D @nextsparkjs/ai-workflow"));
|
|
4976
|
+
console.log(chalk18.cyan(" pnpm add -D -w @nextsparkjs/ai-workflow"));
|
|
4968
4977
|
console.log("");
|
|
4969
4978
|
process.exit(1);
|
|
4970
4979
|
}
|