Home

giogio / openez-graph

public
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

fix(cli): build and bundle SQLite templates into CLI dist

3 months ago

446ae79
Authored
asta-nguyen8/8/2026, 6:35:43 AM
The 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

2 files changed
  • apps/cli/tsup.config.ts+23−0
  • packages/db/src/sqlite/workspace-db.ts+4−4