3 months ago
446ae79The build-template.ts script generated template databases but was never invoked during CLI builds, and the generated files were not copied into dist/. resolveBundledFile could never find them, so the template optimization was inactive — every init fell back to runtime DDL (~700ms wasted). Changes: - tsup.config.ts onSuccess: run build-template.ts via bun, then copy template.sqlite and registry-template.sqlite into dist/ - resolveBundledFile: fix candidate paths for bundled CLI — templates sit next to cli.cjs in dist/, not 4 dirs up. Added path.join(__dirname, filename) as first candidate. Verified: built CLI, init + status in temp dir creates index.sqlite (176128 bytes = template size) with all 16 tables and 12 custom indexes pre-created. Typecheck 8/8, tests 144 pass. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Parent9e8be57