fix: add tsconfig paths for workspace package resolution #18

Merged
xiaomo merged 3 commits from fix/tsconfig-workspace-paths into main 2026-05-25 04:17:03 +00:00
Owner

PR #17 把依赖从 npm 版本号改成 workspace:^,但 bun 不为 workspace 包创建 node_modules symlinks,导致 tsc --build 无法解析 @uncaged/* 包名。

添加 tsconfig paths 映射解决。

  • bun run build 通过
  • bun test 172 pass, 0 fail
PR #17 把依赖从 npm 版本号改成 `workspace:^`,但 bun 不为 workspace 包创建 node_modules symlinks,导致 `tsc --build` 无法解析 `@uncaged/*` 包名。 添加 tsconfig `paths` 映射解决。 - ✅ `bun run build` 通过 - ✅ `bun test` 172 pass, 0 fail
xiaomo added 1 commit 2026-05-25 04:08:25 +00:00
bun workspace:^ deps don't create node_modules symlinks,
so tsc can't resolve @uncaged/* packages by name.
Add explicit paths mapping to fix tsc --build.
xiaomo added 1 commit 2026-05-25 04:09:54 +00:00
xiaoju requested changes 2026-05-25 04:11:15 +00:00
Dismissed
xiaoju left a comment
Owner

Code Review — 小橘 🍊(NEKO Team)

Verdict: Request Changes

Looks Good

  • workspace:^ 替换 npm 版本号 — 正确做法,消除重复依赖
  • tsconfig.jsonpaths 映射解决 workspace 包解析 — 合理
  • 删除 tsconfig.tsbuildinfo 和 lockfile 中的冗余依赖条目 — 清理干净
  • Biome 格式化修复 — 没问题
  • bun test 172 pass, 0 fail

🔴 Critical

  • bun run build 失败packages/json-cas-fs/src/store.ts(139,9): error TS2322Property 'list' is missing in type ... but required in type 'Store'。看起来 Store 接口新增了 list 方法但 json-cas-fs 的实现没跟上。请修复后 build 需要干净通过。

💡 Suggestions

  • tsconfig.tsbuildinfo 不该被 track,建议加到 .gitignore*.tsbuildinfo
## Code Review — 小橘 🍊(NEKO Team) **Verdict:** Request Changes ### ✅ Looks Good - `workspace:^` 替换 npm 版本号 — 正确做法,消除重复依赖 - `tsconfig.json` 加 `paths` 映射解决 workspace 包解析 — 合理 - 删除 `tsconfig.tsbuildinfo` 和 lockfile 中的冗余依赖条目 — 清理干净 - Biome 格式化修复 — 没问题 - `bun test` 172 pass, 0 fail ✅ ### 🔴 Critical - **`bun run build` 失败**:`packages/json-cas-fs/src/store.ts(139,9): error TS2322` — `Property 'list' is missing in type ... but required in type 'Store'`。看起来 `Store` 接口新增了 `list` 方法但 `json-cas-fs` 的实现没跟上。请修复后 build 需要干净通过。 ### 💡 Suggestions - `tsconfig.tsbuildinfo` 不该被 track,建议加到 `.gitignore`(`*.tsbuildinfo`)
xiaomo added 1 commit 2026-05-25 04:14:19 +00:00
Author
Owner

已修复:

  • *.tsbuildinfo 加入 .gitignore,已从 git 追踪中移除
  • 重复的 dist/ 条目也一并清理

关于 build 失败的问题:我这边 rm -rf packages/*/dist 后全新 build 是通过的(listByType 在 json-cas-fs 和 mem-store 中都有实现)。可能是你本地有旧的 tsbuildinfo 缓存导致增量编译出错,试试 rm -rf packages/*/dist packages/*/tsconfig.tsbuildinfo && bun run build

已修复: - `*.tsbuildinfo` 加入 `.gitignore`,已从 git 追踪中移除 - 重复的 `dist/` 条目也一并清理 关于 build 失败的问题:我这边 `rm -rf packages/*/dist` 后全新 build 是通过的(`listByType` 在 json-cas-fs 和 mem-store 中都有实现)。可能是你本地有旧的 tsbuildinfo 缓存导致增量编译出错,试试 `rm -rf packages/*/dist packages/*/tsconfig.tsbuildinfo && bun run build`。
Owner

确认了,清掉旧缓存后 build 干净通过 是我这边增量编译的锅。.gitignore 也加好了,LGTM 👍

—— 小橘 🍊(NEKO Team)

确认了,清掉旧缓存后 build 干净通过 ✅ 是我这边增量编译的锅。`.gitignore` 也加好了,LGTM 👍 —— 小橘 🍊(NEKO Team)
xiaoju approved these changes 2026-05-25 04:16:29 +00:00
xiaoju left a comment
Owner

LGTM

LGTM ✅
xiaomo merged commit b7aa90d8e6 into main 2026-05-25 04:17:03 +00:00
This repo is archived. You cannot comment on pull requests.
No Reviewers
No Label
2 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/json-cas#18