more gitignore

This commit is contained in:
Chris Wanstrath 2026-01-29 23:29:47 -08:00
parent c4af302d9d
commit 3068c719cd
2 changed files with 11 additions and 4 deletions

View File

@ -409,13 +409,15 @@ async function newApp(name?: string) {
writeFileSync(join(appPath, filename), content) writeFileSync(join(appPath, filename), content)
} }
process.chdir(appPath)
await pushApp()
console.log(color.green(`✓ Created ${appName}`)) console.log(color.green(`✓ Created ${appName}`))
console.log() console.log()
console.log('Next steps:') console.log('Next steps:')
if (name) { if (name) {
console.log(` cd ${name}`) console.log(` cd ${name}`)
} }
console.log(' toes push')
console.log(' bun install') console.log(' bun install')
console.log(' bun dev') console.log(' bun dev')
} }

View File

@ -1,14 +1,19 @@
import { existsSync, readFileSync } from 'fs' import { existsSync, readFileSync } from 'fs'
import { join } from 'path' import { join } from 'path'
const DEFAULT_PATTERNS = [ const ALWAYS_EXCLUDE = [
'node_modules', 'node_modules',
'.DS_Store', '.DS_Store',
'.git',
'*~',
]
const DEFAULT_PATTERNS = [
...ALWAYS_EXCLUDE,
'*.log', '*.log',
'dist', 'dist',
'build', 'build',
'.env.local', '.env.local',
'.git',
'bun.lockb', 'bun.lockb',
] ]
@ -19,7 +24,7 @@ export interface GitignoreChecker {
export function loadGitignore(appPath: string): GitignoreChecker { export function loadGitignore(appPath: string): GitignoreChecker {
const gitignorePath = join(appPath, '.gitignore') const gitignorePath = join(appPath, '.gitignore')
const patterns = existsSync(gitignorePath) const patterns = existsSync(gitignorePath)
? parseGitignore(readFileSync(gitignorePath, 'utf-8')) ? [...ALWAYS_EXCLUDE, ...parseGitignore(readFileSync(gitignorePath, 'utf-8'))]
: DEFAULT_PATTERNS : DEFAULT_PATTERNS
return { return {