Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

Commit b1b76e0

Browse files
committed
ci(type-check): the affected speed builds the packages the repo-root setup program imports (objectui#12272)
Since objectui#12222 a pull request or queue build type-checks only the affected set, `pnpm type-check --filter=...[BASE]`. A change outside every package selects zero packages, so nothing built and the root step `pnpm type-check:vitest-setup` failed to resolve the five workspace packages the root `vitest.setup.*` files import (four TS2882, one TS2307; PR #12262). A non-empty affected set can lack them too: a change to `packages/plugin-ai` alone leaves fields, plugin-dashboard and plugin-grid unbuilt. A new step between `Run type-check` and the root program, on the affected speed only, runs `turbo run build` for those packages (replayed from the restored cache when unchanged). Which packages is read on every run out of `tsconfig.vitest-setup.json`'s `paths` by `scripts/select-type-check-scope.mjs --root-builds`, never copied. Adding the names to the type-check filter instead was measured and does not work: that task waits on `^build` and builds no named package's own declarations. `push` and `schedule` are unchanged. Claude-Session: https://claude.ai/code/session_01LqNgdPZB2Jnr5HpGbaqLeB Co-authored-by: Claude <noreply@anthropic.com>
1 parent 7af0ab3 commit b1b76e0

4 files changed

Lines changed: 229 additions & 6 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,46 @@ jobs:
770770
pnpm type-check
771771
fi
772772
773+
# ── The repo-root programs' packages, built on the fast speed (objectui#12272) ──
774+
# `Type-check repo-root vitest setup files` below resolves the workspace
775+
# packages the root `vitest.setup.*` files import through their BUILT
776+
# declarations. The full battery and the whole-workspace run build every
777+
# one of them as the `^build` of the packages that depend on them; the
778+
# affected run builds only the dependencies of what it selects, and that
779+
# may hold none of them -- a change outside every package selects ZERO
780+
# packages, so nothing built and that step failed with four TS2882 and a
781+
# TS2307 (PR #12262; and a change to `packages/plugin-ai` alone selects
782+
# one package and still leaves three of them unbuilt -- both measured on
783+
# objectui#12272, readings of that day, not live counts). So this
784+
# speed builds them here, whatever it selected. Which packages is read
785+
# on every run out of that program's tsconfig `paths` by the selector,
786+
# never copied. `turbo run build` replays each from the restored cache
787+
# when its hash did not move; it is not `turbo run type-check` with
788+
# their names added, because that task waits on `^build` -- the
789+
# DEPENDENCIES' builds -- and builds no named package's own (measured:
790+
# that spelling leaves `plugin-dashboard` and `plugin-grid` unbuilt).
791+
# No run summary is asked for here, so `Report what the turbo cache
792+
# replayed` still reads `Run type-check`'s; turbo's own `Cached:` line
793+
# goes out as a notice instead, so the replay stays readable to anyone
794+
# who cannot open this log. `push` and `schedule` skip this step: the
795+
# full battery is unchanged.
796+
- name: Build the packages the repo-root programs import
797+
if: >-
798+
steps.relevant.outputs.should_run == 'true'
799+
&& steps.tc-scope.outputs.scope == 'affected'
800+
run: |
801+
set -o pipefail
802+
packages=$(node scripts/select-type-check-scope.mjs --root-builds)
803+
filters=()
804+
for p in $packages; do filters+=("--filter=$p"); done
805+
if [ "${#filters[@]}" -eq 0 ]; then
806+
echo 'The repo-root programs import no workspace package: nothing to build.'
807+
exit 0
808+
fi
809+
pnpm exec turbo run build "${filters[@]}" | tee "$RUNNER_TEMP/root-builds.out"
810+
cached=$(grep -E '^ *Cached:' "$RUNNER_TEMP/root-builds.out" | tail -n 1 | tr -s ' ' || true)
811+
echo "::notice title=Repo-root program builds::$(echo $packages) --${cached:- turbo printed no Cached line}"
812+
773813
# The four repo-root `vitest.setup.*` files were in ZERO tsc programs
774814
# (objectui#3515) — the same shape as `scripts/` before objectui#3494, one
775815
# directory over. They live outside every workspace package, so
@@ -785,8 +825,10 @@ jobs:
785825
# @object-ui/components, /fields, /plugin-dashboard and /plugin-grid for
786826
# their registrations. `tsconfig.vitest-setup.json` resolves those through
787827
# each package's own `exports.types`, i.e. its built declarations — which
788-
# exist only after the `^build` that `pnpm type-check` depends on.
789-
# `scripts/__tests__/vitest-setup-type-check.test.ts` pins that ordering.
828+
# exist only after the `^build` that `pnpm type-check` depends on, and on
829+
# the affected speed after the step above (objectui#12272).
830+
# `scripts/__tests__/vitest-setup-type-check.test.ts` pins that ordering,
831+
# `scripts/__tests__/select-type-check-scope.test.ts` the step above.
790832
#
791833
# A direct step, deliberately: this is not a turbo task, so no cache key
792834
# decides its verdict. `pnpm type-check` is cached by turbo and its `inputs`

0 commit comments

Comments
 (0)