diff --git a/create-agentic-app/index.js b/create-agentic-app/index.js index b9f5d0a..d87b8f8 100644 --- a/create-agentic-app/index.js +++ b/create-agentic-app/index.js @@ -100,6 +100,15 @@ async function main() { await fs.copy(envExamplePath, envPath); } + // Rename _gitignore to .gitignore (npm excludes .gitignore by default) + const gitignoreTemplatePath = path.join(targetDir, '_gitignore'); + const gitignorePath = path.join(targetDir, '.gitignore'); + + if (fs.existsSync(gitignoreTemplatePath)) { + spinner.text = 'Setting up .gitignore file...'; + await fs.move(gitignoreTemplatePath, gitignorePath, { overwrite: true }); + } + // Update package.json name if not current directory if (projectDir !== '.') { const packageJsonPath = path.join(targetDir, 'package.json'); diff --git a/create-agentic-app/package-lock.json b/create-agentic-app/package-lock.json index 01797e7..dacc0e7 100644 --- a/create-agentic-app/package-lock.json +++ b/create-agentic-app/package-lock.json @@ -1,12 +1,12 @@ { "name": "create-agentic-app", - "version": "1.1.5", + "version": "1.1.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "create-agentic-app", - "version": "1.1.5", + "version": "1.1.7", "license": "MIT", "dependencies": { "chalk": "^5.3.0", diff --git a/create-agentic-app/package.json b/create-agentic-app/package.json index b9d4fb1..384eb49 100644 --- a/create-agentic-app/package.json +++ b/create-agentic-app/package.json @@ -1,6 +1,6 @@ { "name": "create-agentic-app", - "version": "1.1.5", + "version": "1.1.7", "description": "Scaffold a new agentic AI application with Next.js, Better Auth, and AI SDK", "type": "module", "bin": { diff --git a/create-agentic-app/scripts/sync-templates.js b/create-agentic-app/scripts/sync-templates.js index 27247ac..a92d2aa 100644 --- a/create-agentic-app/scripts/sync-templates.js +++ b/create-agentic-app/scripts/sync-templates.js @@ -78,6 +78,17 @@ async function sync() { console.log(`${colors.cyan}📦 Copying project files...${colors.reset}`); await copyWithExclusions(projectRoot, templateDir); + // Explicitly copy .gitignore file as _gitignore (npm excludes .gitignore by default) + console.log(`${colors.cyan}📄 Copying .gitignore as _gitignore...${colors.reset}`); + const gitignoreSrc = path.join(projectRoot, '.gitignore'); + const gitignoreDest = path.join(templateDir, '_gitignore'); + if (await fs.pathExists(gitignoreSrc)) { + await fs.copy(gitignoreSrc, gitignoreDest, { overwrite: true }); + console.log(`${colors.green}✓${colors.reset} .gitignore copied as _gitignore`); + } else { + console.log(`${colors.yellow}⚠${colors.reset} .gitignore not found in project root`); + } + // Process template package.json console.log(`${colors.cyan}⚙️ Updating template package.json...${colors.reset}`); const templatePackageJsonPath = path.join(templateDir, 'package.json'); diff --git a/create-agentic-app/template/_gitignore b/create-agentic-app/template/_gitignore new file mode 100644 index 0000000..10c46df --- /dev/null +++ b/create-agentic-app/template/_gitignore @@ -0,0 +1,43 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/versions +.pnpm-lock.yaml + +# testing +/coverage +/.playwright-mcp + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# env files (can opt-in for committing if needed) +.env* + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts