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