Compare commits

..

3 Commits

Author SHA1 Message Date
9649666195 claude too 2026-02-14 08:07:01 -08:00
fabdd084cb default .gitignore for templates 2026-02-14 08:06:40 -08:00
65e19d27e2 show total disk usage for each app 2026-02-14 08:06:30 -08:00
3 changed files with 47 additions and 3 deletions

View File

@ -13,6 +13,7 @@ const DATA_HISTORY_MAX_DAYS = 30 // Keep 30 days of data size history
const SAMPLE_INTERVAL_MS = 10_000 // How often to sample process metrics
const HISTORY_MAX_SAMPLES = 60 // Keep 10 minutes of history at 10s intervals
const APPS_DIR = process.env.APPS_DIR!
const TOES_DIR = process.env.TOES_DIR!
const TOES_URL = process.env.TOES_URL!
@ -178,9 +179,12 @@ setInterval(sampleAndRecordHistory, SAMPLE_INTERVAL_MS)
// ============================================================================
function getDataSize(appName: string): number {
let total = 0
const appDir = join(APPS_DIR, appName)
if (existsSync(appDir)) total += dirSize(appDir)
const dataDir = join(TOES_DIR, appName)
if (!existsSync(dataDir)) return 0
return dirSize(dataDir)
if (existsSync(dataDir)) total += dirSize(dataDir)
return total
}
function dirSize(dir: string): number {

View File

@ -15,6 +15,7 @@ interface TemplateVars {
APP_NAME: string
}
const SHARED_FILES = ['CLAUDE.md', '.gitignore', '.npmrc', 'package.json', 'tsconfig.json']
const TEMPLATES_DIR = join(import.meta.dir, '../../templates')
function readDir(dir: string): string[] {
@ -45,7 +46,7 @@ export function generateTemplates(appName: string, template: TemplateType = 'ssr
const result: AppTemplates = {}
// 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)
let content = readFileSync(path, 'utf-8')
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