From ea6369ef7e33d973989e7897e3b2332d34f2754b Mon Sep 17 00:00:00 2001 From: best Date: Sun, 22 Feb 2026 22:02:53 +0800 Subject: [PATCH] fix: resolve typecheck/build ordering in CI (#41) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .github/workflows/ci.yml | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef64c99..8f08a52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,9 +51,13 @@ jobs: echo "→ Source files changed; full pipeline will run." fi - # ── Type-check ─────────────────────────────────────────────────────────────── - typecheck: - name: Type check + # ── Build + Type-check ──────────────────────────────────────────────────────── + # Typecheck runs *after* build so that cross-package .d.ts files generated by + # the build step are available when tsc resolves workspace dependencies. + # (Running typecheck before build caused "Cannot find module" errors for + # packages whose 'types' field points to dist/index.d.ts — see issue #41.) + build: + name: Build & Type check needs: scope if: needs.scope.outputs.docs_only != 'true' runs-on: ubuntu-latest @@ -66,32 +70,15 @@ jobs: - uses: pnpm/action-setup@v4 - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Type check - run: pnpm typecheck - - # ── Build ───────────────────────────────────────────────────────────────────── - build: - name: Build - needs: typecheck - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: 20 - - - uses: pnpm/action-setup@v4 - - name: Install dependencies run: pnpm install --frozen-lockfile - name: Build run: pnpm build + - name: Type check + run: pnpm typecheck + # Cache build artifacts for the test job - name: Upload build artifacts uses: actions/upload-artifact@v4