default .gitignore for templates

This commit is contained in:
Chris Wanstrath 2026-02-14 08:06:40 -08:00
parent 65e19d27e2
commit fabdd084cb
2 changed files with 41 additions and 1 deletions

View File

@ -15,6 +15,7 @@ interface TemplateVars {
APP_NAME: string APP_NAME: string
} }
const SHARED_FILES = ['.gitignore', '.npmrc', 'package.json', 'tsconfig.json']
const TEMPLATES_DIR = join(import.meta.dir, '../../templates') const TEMPLATES_DIR = join(import.meta.dir, '../../templates')
function readDir(dir: string): string[] { function readDir(dir: string): string[] {
@ -45,7 +46,7 @@ export function generateTemplates(appName: string, template: TemplateType = 'ssr
const result: AppTemplates = {} const result: AppTemplates = {}
// Read shared files from templates/ // Read shared files from templates/
for (const filename of ['.npmrc', 'package.json', 'tsconfig.json']) { for (const filename of SHARED_FILES) {
const path = join(TEMPLATES_DIR, filename) const path = join(TEMPLATES_DIR, filename)
let content = readFileSync(path, 'utf-8') let content = readFileSync(path, 'utf-8')
content = replaceVars(content, vars) content = replaceVars(content, vars)

39
templates/.gitignore vendored Normal file
View File

@ -0,0 +1,39 @@
# dependencies (bun install)
node_modules
# dev data
data/
# honk honk
.claude/settings.local.json
# output
dist/
*.tgz
# code coverage
coverage
*.lcov
# logs
logs
_.log
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# caches
.eslintcache
.cache
*.tsbuildinfo
# IntelliJ based IDEs
.idea
# Finder (MacOS) folder config
.DS_Store