create-kofi-stack 1.2.4 → 1.2.5
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/index.js +31 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6261,15 +6261,40 @@ async function setupConvex(config, envValues) {
|
|
|
6261
6261
|
}
|
|
6262
6262
|
if (convexChoice === "new") {
|
|
6263
6263
|
p6.log.info(`
|
|
6264
|
-
${pc2.bold("
|
|
6265
|
-
|
|
6266
|
-
1. Run ${pc2.cyan("pnpm convex dev")} in your project directory
|
|
6267
|
-
2. It will open your browser to create a new project
|
|
6268
|
-
3. Follow the prompts to set up your Convex project
|
|
6269
|
-
4. The CLI will automatically add the deployment URL to .env.local
|
|
6264
|
+
${pc2.bold("Creating a new Convex project...")}
|
|
6270
6265
|
|
|
6266
|
+
This will open your browser to create a new project on Convex.
|
|
6271
6267
|
${pc2.dim("Note: Make sure you have a Convex account at https://convex.dev")}
|
|
6272
6268
|
`);
|
|
6269
|
+
try {
|
|
6270
|
+
const convexDir = config.structure === "monorepo" ? path18.join(config.targetDir, "packages/backend") : config.targetDir;
|
|
6271
|
+
p6.log.info(`Running ${pc2.cyan("npx convex dev --once")} in ${pc2.dim(convexDir)}...`);
|
|
6272
|
+
const { spawn } = await import("child_process");
|
|
6273
|
+
await new Promise((resolve) => {
|
|
6274
|
+
const child = spawn("npx", ["convex", "dev", "--once"], {
|
|
6275
|
+
cwd: convexDir,
|
|
6276
|
+
stdio: "inherit",
|
|
6277
|
+
shell: true
|
|
6278
|
+
});
|
|
6279
|
+
child.on("close", (code) => {
|
|
6280
|
+
if (code === 0) {
|
|
6281
|
+
p6.log.success("Convex project created successfully!");
|
|
6282
|
+
resolve();
|
|
6283
|
+
} else {
|
|
6284
|
+
p6.log.warn(`Convex setup exited with code ${code}. You can run 'pnpm convex dev' manually later.`);
|
|
6285
|
+
resolve();
|
|
6286
|
+
}
|
|
6287
|
+
});
|
|
6288
|
+
child.on("error", (error) => {
|
|
6289
|
+
p6.log.warn(`Could not run Convex setup: ${error.message}`);
|
|
6290
|
+
p6.log.info(`Run ${pc2.cyan("pnpm convex dev")} manually in your project directory.`);
|
|
6291
|
+
resolve();
|
|
6292
|
+
});
|
|
6293
|
+
});
|
|
6294
|
+
} catch (error) {
|
|
6295
|
+
p6.log.warn("Could not run Convex setup automatically.");
|
|
6296
|
+
p6.log.info(`Run ${pc2.cyan("pnpm convex dev")} manually in your project directory.`);
|
|
6297
|
+
}
|
|
6273
6298
|
} else if (convexChoice === "existing") {
|
|
6274
6299
|
const deploymentName = await p6.text({
|
|
6275
6300
|
message: "Enter your Convex deployment name (e.g., my-app-123):",
|