use spaces instead of commas in flags

This commit is contained in:
Aman Varshney
2025-04-01 14:57:46 +05:30
parent 47e429554d
commit b296ac28ed
14 changed files with 390 additions and 163 deletions

View File

@@ -10,6 +10,7 @@ import { createReadme } from "./create-readme";
import { setupDatabase } from "./db-setup";
import { setupEnvironmentVariables } from "./env-setup";
import { setupExamples } from "./examples-setup";
import { installDependencies } from "./install-dependencies";
import { displayPostInstallInstructions } from "./post-installation";
import { initializeGit, updatePackageConfigurations } from "./project-config";
import { setupRuntime } from "./runtime-setup";
@@ -91,6 +92,14 @@ export async function createProject(options: ProjectConfig): Promise<string> {
await updatePackageConfigurations(projectDir, options);
await createReadme(projectDir, options);
if (!options.noInstall) {
await installDependencies({
projectDir,
packageManager: options.packageManager,
addons: options.addons,
});
}
displayPostInstallInstructions(
options.database,
options.projectName,

View File

@@ -81,7 +81,6 @@ app.post("/ai", async (c) => {
return stream(c, (stream) => stream.pipe(result.toDataStream()));
});`;
// Add the import section
if (indexContent.includes("import {")) {
const lastImportIndex = indexContent.lastIndexOf("import");
const endOfLastImport = indexContent.indexOf("\n", lastImportIndex);
@@ -94,7 +93,6 @@ ${indexContent.substring(endOfLastImport + 1)}`;
${indexContent}`;
}
// Add the route handler
const trpcHandlerIndex =
indexContent.indexOf('app.use("/trpc"') ||
indexContent.indexOf("app.use(trpc(");
@@ -103,7 +101,6 @@ ${indexContent}`;
${indexContent.substring(trpcHandlerIndex)}`;
} else {
// Add it near the end before export
const exportIndex = indexContent.indexOf("export default");
if (exportIndex !== -1) {
indexContent = `${indexContent.substring(0, exportIndex)}${aiRouteHandler}