Commit Graph

285 Commits

Author SHA1 Message Date
xingyue 01d4f0fa14 chore: use proman test instead of vitest run 2026-06-04 09:51:30 +08:00
xiaomo d79d0227fa Merge pull request 'fix: resolve prompt files from package root instead of dist' (#74) from fix/prompt-path into main
fix: resolve prompt files from package root, suppress ExperimentalWarning in tests (#74)
2026-06-04 00:38:14 +00:00
tuanzi e4e4ce0f73 fix: suppress SQLite ExperimentalWarning in edge-cases and schema-validation tests
The local runCli helpers in edge-cases.test.ts (Phase 3/4/7) and raw
execFileSync calls in schema-validation.test.ts (tests 2.1, 2.3) were
missing NODE_NO_WARNINGS=1, causing ExperimentalWarning to leak into
stderr snapshots. Added env override to match what helpers.runCli
already does.
2026-06-04 00:36:38 +00:00
tuanzi 13b12ef50c fix: resolve prompt files from package root instead of dist
prompts/*.md files are not copied to dist/ during tsc build,
causing `ocas prompt setup/usage` to fail with ENOENT.

- Change join(__dirname, "prompts") → join(__dirname, "..", "prompts")
- Add prompts/ to package.json "files" for npm publishing
- Update snapshots (Node.js SQLite ExperimentalWarning + version string)
2026-06-04 00:11:28 +00:00
xiaomo a9d43abf28 release: @ocas/cli@0.3.1 @ocas/cli@0.3.1 2026-06-04 00:01:29 +00:00
xiaomo 6f054f6447 fix(cli): update prompts — bun→pnpm, remove stale --var-db flag 2026-06-03 23:49:11 +00:00
xiaomo 5e9b266ebd docs: add pkg descriptions/keywords/engines, fix core README
Fixes #70, #71, #72, #73
2026-06-03 23:23:48 +00:00
xiaomo c4d9205eb2 docs: update all documentation for node:sqlite, pnpm, proman workflow
- README: bun → pnpm, update API examples, add Node >=22.5.0 requirement
- CLAUDE.md: replace 3-phase release process with proman bump/publish
- Package READMEs: fix package names, update storage/API descriptions
- Cards: update store.md (sqlite), cli.md (db filename, remove --var-db)
- docs/sync-readme.md: update to proman workflow
2026-06-03 23:21:30 +00:00
xiaoju 9d17be8b7b release: v0.3.0 v0.3.0 2026-06-03 23:06:00 +00:00
xiaomo 7e9bd26fec fix: suppress ExperimentalWarning in tests via NODE_NO_WARNINGS env
- Use NODE_NO_WARNINGS=1 in execFileSync env instead of --no-warnings flag
- Remove overly broad process.removeAllListeners('warning') from CLI entry
- Add engines field requiring Node >=22.5.0 (node:sqlite availability)
- Update proman to 0.4.2
2026-06-03 23:02:43 +00:00
xiaomo 3168bf55c3 chore: add changeset for node:sqlite migration 2026-06-03 22:30:15 +00:00
xiaomo 00a536631a refactor: migrate from better-sqlite3 to node:sqlite
- Replace better-sqlite3 with built-in node:sqlite (DatabaseSync)
- Add transaction() helper for manual BEGIN/COMMIT/ROLLBACK
- Suppress ExperimentalWarning in CLI tests with --no-warnings
- Remove better-sqlite3 from dependencies and onlyBuiltDependencies
- No more native addon compilation issues across Node versions
2026-06-03 22:11:44 +00:00
xiaomo f8103e20ce chore: bump @shazhou/proman to 0.4.0, remove link override 2026-06-03 16:30:24 +00:00
xiaomo 5c567dc455 Revert "Merge pull request 'chore: remove redundant vite/vitest devDeps' (#69) from chore/remove-redundant-devdeps into main"
This reverts commit 08a2bddcf0, reversing
changes made to 36ebf42f2f.
2026-06-03 15:15:38 +00:00
xiaomo 08a2bddcf0 Merge pull request 'chore: remove redundant vite/vitest devDeps' (#69) from chore/remove-redundant-devdeps into main 2026-06-03 14:28:35 +00:00
xiaomo 6fc3b9030b chore: remove redundant vite/vitest devDeps (proman bundles them) 2026-06-03 14:25:35 +00:00
xiaoju 36ebf42f2f chore: bump 0.2.2, fix lint, biome format
- Bump all packages to 0.2.2
- Fix noNonNullAssertion in cli/index.ts
- Fix unused imports in fs/sqlite-store.ts
- Biome 2.4.16 migration + format all files
- Update snapshots for version change
v0.2.2
2026-06-03 11:16:16 +00:00
xiaoju f286df91f0 chore: restore workspace:* 2026-06-03 09:43:57 +00:00
xiaoju 8971206a3e Merge release/0.2.1 into main 2026-06-03 09:43:37 +00:00
xiaoju 807c0942e8 release: v0.2.1
- Clean dist: no stale variable-store.js (bun:sqlite reference removed)
- Fix vitest rejects pattern in liquid-render tests
- proman.yaml runtime: bun → node
- Upgrade @shazhou/proman to 0.2.2
v0.2.1
2026-06-03 09:43:27 +00:00
xiaoju 5c0670e69b release: prepare v0.2.1 2026-06-03 09:40:07 +00:00
xiaoju c90efda4dd chore: upgrade @shazhou/proman to 0.2.2 2026-06-03 09:39:59 +00:00
xiaoju 2d4f76330c fix: vitest rejects pattern + runtime config
- Fix 4 liquid-render tests: expect(async()=>{}).rejects → expect(promise).rejects
- proman.yaml: runtime bun → node (matches actual stack)
- package.json: test script uses vitest directly (avoid proman recursion)
- Add changeset for 0.2.1 patch (clean dist)
2026-06-03 09:30:23 +00:00
xiaomo 768ae20a24 Merge pull request 'feat: migrate var/tag store from JSONL to better-sqlite3' (#68) from feat/60-sqlite-var-tag into main
feat: migrate var/tag store from JSONL to better-sqlite3 (#68)
2026-06-03 08:40:45 +00:00
xiaoju 72ba313d12 fix: address review — transactions, LIKE escape, post-filter pagination
Critical fixes:
1. LIKE ESCAPE '\' clause added for namePrefix queries
2. list() limit/offset now applied AFTER tag/label post-filter
3. tag()/untag() wrapped in db.transaction()

Warning fixes:
4. set()/update() wrapped in db.transaction() (txnSetVar)
5. listByTag sort/limit/offset pushed to SQL
6. close() idempotent (double-close guard)
7. JSONL → SQLite migration on first open (vars + tags)
8. History truncation simplified (NOT IN subquery)
9. Removed unnecessary pre-fetch in upsert (ON CONFLICT handles it)

Nits:
10. Database.Database type instead of InstanceType
11. row.name instead of row["name"]
12. DESC index on var_history position
13. key+value composite index on tags
2026-06-03 08:38:44 +00:00
xiaoju 1fe6035be5 feat: migrate var/tag store from JSONL to better-sqlite3
- New sqlite-store.ts: VarStore + TagStore backed by SQLite (WAL mode)
- Tables: vars (composite PK name+schema), var_history (with MAX_HISTORY truncation), tags (composite PK target+key)
- Indexed queries for name, created, updated, tag key
- Tags/labels stored as JSON columns with post-filter
- Removed var-store.ts (JSONL append-log implementation)
- Updated tests: JSONL assertions → SQLite db file checks

Closes #60
2026-06-03 08:29:22 +00:00
xiaoju e3f7ec1a11 Merge pull request 'chore: 去掉 Bun,切换到 pnpm + 纯 Node runtime' (#67) from chore/66-remove-bun into main 2026-06-03 07:55:03 +00:00
xiaoju 9ac08e5893 chore: 去掉 Bun,切换到 pnpm + 纯 Node runtime
- bun.lock → pnpm-lock.yaml + pnpm-workspace.yaml
- 删除 sqlite-adapter.ts(Bun/Node 双 runtime 兼容层,未被使用)
- package.json 删除 workspaces 字段,加 pnpm.onlyBuiltDependencies
- 加 vite 8 显式依赖(vitest 4.x peer dep)
- CLAUDE.md 全面更新:Runtime/Commands/Release 流程
- .gitignore 加 bun.lock

36/36 files pass, 617/617 tests pass

Fixes #66
2026-06-03 07:43:09 +00:00
xiaoju fe56634160 fix: clean build 兼容性修复
- 根 package.json 加 @types/node(clean install 后 tsc 需要)
- CLI tests entrypoint 从 src/index.ts 改为 dist/index.js
- 局部 runCli 支持 rest 和 array 两种调用模式(rawArgs.flat())
- 所有剩余 tsx 引用改为 node

36/36 files pass, 617/617 tests pass

Fixes #64
2026-06-03 06:32:39 +00:00
xiaoju dd75c1f39d Merge pull request 'fix: 修复 vitest 迁移后测试失败' (#65) from fix/64-test-failures into main 2026-06-03 06:16:56 +00:00
xiaoju 32b520b2a4 fix: 修复 vitest 迁移后测试失败
- async 函数断言改用 await expect().rejects.toThrow()
- 所有局部 runCli 从 tsx 改为 node
- rest params (...args) 改为 array params (args)
- 更新 snapshots

36/36 files pass, 617/617 tests pass

Fixes #64
2026-06-03 06:16:33 +00:00
xiaoju 05f3246e5b Merge pull request 'chore: 测试框架从 bun:test 迁移到 vitest' (#63) from chore/62-vitest into main 2026-06-03 04:16:29 +00:00
xiaoju 736d7e7374 chore: 测试框架从 bun:test 迁移到 vitest
- 36 个 test 文件 bun:test → vitest
- Bun.spawn() → execFileSync('tsx', ...)
- Bun.file() → readFileSync
- import.meta.dir → import.meta.dirname (tests) / __dirname (CLI source)
- 删除 bun-types devDep
- 添加 vitest + tsx devDep
- CLI shebang bun → node
- 30/36 test files pass, 558/617 tests pass

Refs #62
2026-06-03 04:11:10 +00:00
xiaomo 3cfcf6db89 Merge pull request 'feat: cli 包完整 build 支持(tsc emit + Node 兼容)' (#61) from feat/58-cli-build into main 2026-06-03 03:28:31 +00:00
xiaoju 5f562cbc5a feat: cli 包完整 build 支持(tsc emit + Node 兼容)
- tsconfig: 启用 emit (rootDir/outDir/composite), 添加 project references
- shebang: bun → node
- bin: src/index.ts → dist/index.js
- import.meta.dir → import.meta.dirname (去掉 Bun 专有 API)
- prompts 目录移到包根, src/dist 路径统一
- 修复 exactOptionalPropertyTypes 类型错误

Fixes #58
2026-06-03 02:29:01 +00:00
xiaoju 234bd0d611 chore: remove legacy release scripts (replaced by proman)
小橘 🍊
2026-06-03 00:37:15 +00:00
xiaoju ff4c4f3eff chore: remove per-package scripts (test/prepublishOnly)
All dev commands handled by proman at root level.
workspace:* safety handled by proman release flow.

小橘 🍊
2026-06-03 00:36:04 +00:00
xiaoju 39e4e4faca chore: remove changeset deps, release now handled by proman
小橘 🍊
2026-06-03 00:25:04 +00:00
xiaoju 799ef0af92 chore: consolidate dev deps via @shazhou/proman
Remove direct biome and typescript devDependencies.
All dev commands (build/test/check/format) now go through proman.

小橘 🍊
2026-06-03 00:10:14 +00:00
xiaoju 845ecb635e chore: add per-package build scripts for proman compatibility
小橘 🍊
2026-06-02 16:30:27 +00:00
xiaoju aa0584dea7 chore: switch proman config from TS to YAML 2026-06-02 15:47:25 +00:00
xiaoju 12b61b4625 fix: set correct version in fs/cli package.json (was workspace:*) 2026-06-02 14:40:41 +00:00
xiaoju 22dec2ae7a chore: add proman.config.ts 2026-06-02 14:40:01 +00:00
xiaoju 4d6d090bb9 chore: restore workspace:* on main 2026-06-02 12:53:58 +00:00
xiaoju 6d89c60401 Merge release/0.2.0 into main 2026-06-02 12:53:48 +00:00
xiaoju 185c4c779b chore: release v0.2.0 v0.2.0 2026-06-02 12:53:38 +00:00
xiaoju b49da8ebbd chore: publish @ocas/*@0.2.0-rc.1 2026-06-02 12:19:29 +00:00
xiaoju 298a8ec626 chore: prepare release/0.2.0 — fix workspace:* to real versions 2026-06-02 11:50:47 +00:00
xiaoju 67620e0d57 docs: add changesets for #52/#53 and update card docs for tag commands 2026-06-02 11:45:37 +00:00
xiaoju fcb514ef50 Merge pull request 'feat: --tag filter for list / var list' (#57) from fix/54-list-tag-filter into main 2026-06-02 11:39:29 +00:00