diff --git a/.changeset/huge-cobras-dig.md b/.changeset/huge-cobras-dig.md new file mode 100644 index 0000000..c5328b9 --- /dev/null +++ b/.changeset/huge-cobras-dig.md @@ -0,0 +1,5 @@ +--- +"create-better-t-stack": patch +--- + +fix .gitignore diff --git a/apps/cli/src/helpers/create-project.ts b/apps/cli/src/helpers/create-project.ts index 7d14439..8620686 100644 --- a/apps/cli/src/helpers/create-project.ts +++ b/apps/cli/src/helpers/create-project.ts @@ -18,13 +18,17 @@ export async function createProject(options: ProjectConfig): Promise { try { await fs.ensureDir(projectDir); - const templateDir = path.join(PKG_ROOT, "template/base"); if (!(await fs.pathExists(templateDir))) { throw new Error(`Template directory not found: ${templateDir}`); } await fs.copy(templateDir, projectDir); + const gitignorePath = path.join(projectDir, "_gitignore"); + if (await fs.pathExists(gitignorePath)) { + await fs.move(gitignorePath, path.join(projectDir, ".gitignore")); + } + if (options.auth) { const authTemplateDir = path.join(PKG_ROOT, "template/with-auth"); if (await fs.pathExists(authTemplateDir)) { @@ -40,7 +44,6 @@ export async function createProject(options: ProjectConfig): Promise { if (await fs.pathExists(ormTemplateDir)) { await fs.copy(ormTemplateDir, projectDir, { overwrite: true }); - const serverSrcPath = path.join(projectDir, "packages/server/src"); const baseLibPath = path.join(serverSrcPath, "lib"); const withAuthLibPath = path.join(serverSrcPath, "with-auth-lib"); @@ -80,7 +83,6 @@ export async function createProject(options: ProjectConfig): Promise { } } else { await fs.remove(withAuthLibPath); - if (options.orm === "prisma") { const withAuthSchema = path.join( projectDir, @@ -108,7 +110,6 @@ export async function createProject(options: ProjectConfig): Promise { options.orm, options.turso ?? options.database === "sqlite", ); - await setupAuth(projectDir, options.auth); await setupEnvironmentVariables(projectDir, options); diff --git a/apps/cli/template/base/.gitignore b/apps/cli/template/base/_gitignore similarity index 100% rename from apps/cli/template/base/.gitignore rename to apps/cli/template/base/_gitignore