Skip to content

fix: resolve typecheck/build ordering in CI#42

Merged
best merged 1 commit into
masterfrom
fix/ci-typecheck-build-order
Feb 22, 2026
Merged

fix: resolve typecheck/build ordering in CI#42
best merged 1 commit into
masterfrom
fix/ci-typecheck-build-order

Conversation

@best
Copy link
Copy Markdown
Contributor

@best best commented Feb 22, 2026

Closes #41

问题

CI 重构(#36)中 typecheck job 在 build 之前运行,导致跨包的 .d.ts 文件(如 @openlinkos/channel → dist/index.d.ts)尚不存在,tsc 报 Cannot find module 错误。

根本原因:各包 package.jsontypes 字段指向 dist/index.d.ts,而 dist/ 只有 build 后才存在。

修复方案

方案 A:合并 typecheck 进 build job

  • 移除独立的 typecheck job
  • build job 中先执行 pnpm build(生成所有 .d.ts),再执行 pnpm typecheck

新的 CI 依赖链:

scope → build (pnpm build + pnpm typecheck) → test

权衡

  • ✅ 修复简单、改动最小(仅修改 .github/workflows/ci.yml
  • ✅ 类型错误仍然是阻断性门控,测试不会在类型错误时运行
  • ⚠️ 失去「typecheck 先于 build 快速失败」的分层,但保持了「类型正确 → 测试」的语义

Typecheck ran before build in the CI pipeline, so cross-package
.d.ts files (e.g. @openlinkos/channel → dist/index.d.ts) did not
exist yet, causing 'Cannot find module' TypeScript errors.

Fix (Method A): merge typecheck into the build job, running
'pnpm typecheck' immediately after 'pnpm build'. The dependency
chain is now:

  scope → build (build + typecheck) → test

The standalone 'typecheck' job is removed. Type errors are still
caught as a blocking gate before tests run.

Closes #41
@best best merged commit ceac748 into master Feb 22, 2026
2 checks passed
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Code Review

Automated review for PR #42informational only, does not block merge.

Checklist

Item Notes
Type Safety No issues detected
Error Handling No issues detected
Test Coverage No issues detected
API Consistency No public API changes
Breaking Changes No breaking changes detected

Stats

  • 📁 Files changed: 1 (0 TypeScript)
  • ➕ Lines added: 10
  • 🧪 Test files updated: 0

All checks passed — looks good! 🎉

Powered by openlinkos/agent · AI PR Review workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] CI typecheck fails due to missing build artifacts in monorepo

1 participant