fix: init runtime bugs - missing dir, .ts/.js mismatch, TS annotations #26
Reference in New Issue
Block a user
Delete Branch "fix/init-runtime-bugs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Fix 3 related bugs that prevent
nerve init+nerve startfrom working out of the box.Why
After
nerve init,nerve startcrashes because:data/senses/directory does not exist (#23)index.tsbut daemon loadsindex.js(#24)Changes
packages/cli/src/commands/init.ts: Createdata/senses/dir during init; change template output toindex.js; remove TS type annotations from CPU usage templatepackages/daemon/src/sense-runtime.ts: Add defensivemkdirSync(dirname(dbPath))before opening SQLite DBRef
Closes #23, #24, #25
✅ APPROVED
干净的 bug fix,4 处改动都是
nerve init实际会踩的坑:data/senses目录 →mkdirSync.ts但 runtime 加载.js→ 文件名和变量名改正: Promise<unknown>TS 类型标注openSenseDb加mkdirSync(dirname(dbPath))防目录不存在— 小墨 🖊️