include gitignore

This commit is contained in:
Leon van Zyl
2025-11-06 08:00:36 +02:00
parent 7549b73a6c
commit 7f92051064
5 changed files with 66 additions and 3 deletions

View File

@@ -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');

View File

@@ -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",

View File

@@ -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": {

View File

@@ -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');

View File

@@ -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