chore(build): fields and plugin-editor stop publishing test declarations — coverage moves to the chained test project (#4006) - #4539
Merged
Conversation
…ons (#4006) Both packages' build tsconfigs set `include: ["src"]` with no test exclude, so every test file entered the declaration program and its `.d.ts` was written into `dist/`. Both are published, so those declarations shipped: 85 from `@object-ui/fields` and one (`dist/index.test.d.ts`) from `@object-ui/plugin-editor`. Measured on origin/main @ f565418 — 86, not the 73 the card recorded on 2026-08-09; the tests grew, the defect did not change shape. Adding the exclude alone would have been a regression, and the card said so. These two packages counted as "tests type-checked" in scripts/check-type-check-coverage.mjs precisely BECAUSE the build program read the tests — a correct verdict reached through an emit nobody wanted. Measured: the exclude on its own fails the gate's section 5c, naming all 86 files. So the coverage moves in the same commit — a `tsconfig.test.json` per package, chained from each `type-check` script, on the plugin-dashboard (#4530) template. The gate reports 41/41 packages compiling their tests with 0 declared debt on BOTH sides. Discrimination proof, direction-checked, per package: with a type error planted in one test file, the pre-change build config reds (TS2322), the post-change build config passes it SILENTLY, and only the new chained test project reds on the exact line. Coverage moved rather than vanished. The published artifact is otherwise untouched. Built each package both ways from a cleared `dist/`: fields 163 files to 78, plugin-editor 6 to 5, all 86 disappearances are `*.test.d.ts`, nothing appears, and every one of the 83 surviving files is byte-identical by sha256 — including both entry `dist/index.d.ts`. 19 downstream consumers type-check clean. `packages/fields`' `rootDir: ".."` is left alone deliberately, with the reason recorded in the file: it is load-bearing. The config inherits the root tsconfig's `paths`, so sibling `packages/core/src` and `packages/types/src` are real program inputs; narrowing it turns 122 of them into TS6059, even under `--noEmit`. Fixes #4006
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Collaborator
Author
|
PM step-7 复核 — ACCEPT (session_017Qqyix2QcnpUC9XeYVDzx3)
Auto-merge armed (squash) — landing verified per the merge-queue discipline. Generated by Claude Code Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4006
Both packages' build tsconfigs set
include: ["src"]with no test exclude, so every test file entered the declaration program and its.d.tswas written intodist/. Both are published (privateis false,filescontainsdist), so those declarations shipped.Premise: holds, with the count drifted upward
Measured on
origin/main@ f565418, cleandist/, both packages built:86, not the 73 the card recorded on 2026-08-09 — 85 from
@object-ui/fields(one per test file, exactly) and one from@object-ui/plugin-editor(dist/index.test.d.ts). The suites grew; the defect did not change shape.One mechanism correction worth recording, because it decides item 4. The card reads as though
tscemits these. It does not: both packages inheritnoEmit: truefrom the root tsconfig, andpackages/fieldsnever overrides it. Sotscin the fields build script only CHECKS, and every file in eitherdist/— the test declarations included — is written by vite-plugin-dts.Both halves, one commit
Adding the exclude alone would have been a regression, and the card said so. These two packages counted as "tests type-checked" in
scripts/check-type-check-coverage.mjsprecisely BECAUSE the build program read the tests — a correct verdict reached through an emit nobody wanted. Measured, exclude only:So the coverage moves in the same commit: a
tsconfig.test.jsonper package on the plugin-dashboard (#4530) template, chained from eachtype-checkscript. Gate on both sides of the change:scripts/check-type-check-coverage.mjsneeded no edit — it reads resolved tsconfig programs, so the new projects are picked up with no registry or table entry, as the #4530-era design intends.Discrimination proof, direction-checked
A type error planted in one test file per package (
coerce-safe-value.test.ts:37,index.test.ts:103), then all three programs run against it:TS2322TS2322TS2322on line 37TS2322on line 103The pre-change row is the one that matters: it shows the coverage genuinely moved rather than vanished. Plants removed, both files verified byte-identical by sha256 and
git diffempty.As predicted, moving the chain surfaced zero new type errors — these tests were already being checked, just by the wrong program.
Published artifact: only the test declarations leave
Each package built both ways from a cleared
dist/(and any*.tsbuildinforemoved between builds), file lists and sha256 diffed:*.test.d.tsdist/index.test.d.tsdist/index.d.tsf69dd08…d393aee…dist/__tests__/anddist/widgets/__tests__/are simply no longer created; no.mapsiblings were involved (neither package setsdeclarationMap).For plugin-editor specifically the card asked whether the exclude reaches what the dts plugin actually reads, since its
vite.config.tspasses its owninclude: ['src']. Measured: it does —dist/index.test.d.tsis gone with the tsconfigexcludealone, so novite.config.tschange is needed and none was made.Nothing referenced the removed files: neither package's
exportsmap exposes a deep path, and a repo-wide grep fordist/__tests__/dist/index.testfinds only the new comments in this PR.Item 4 —
packages/fields'rootDir: "..": load-bearing, left aloneBlamed first: added in 45093dc (2026-01-29, "chore: remove unused fields dependency and update tsconfig for clarity"), with no stated reason.
Measured rather than guessed — removing it:
122 such errors, from
packages/coreandpackages/types. The config inherits the root tsconfig'spaths, which map those specifiers to siblingsrctrees, so they are real program inputs and must sit underrootDir— and TS6059 fires even under--noEmit, being a program-level verdict. It has no effect on what is emitted, sincetschere emits nothing.So it stays, with that reasoning recorded in the file itself so the next reader does not "normalize" it away.
Verification
node scripts/check-type-check-coverage.mjs— green pre and post, red on the half-change (above)pnpm --filter @object-ui/fields --filter @object-ui/plugin-editor type-check— both, real scripts, exit 0pnpm exec vitest run packages/fields/ packages/plugin-editor/— 86 files, 1355 tests, all pass, no test source touched...pkg) direction = consumers: 19 packages,55 successful, 55 totalcheck:control-bytes,check:phantom-deps,check-changeset-presence,check-changeset-no-major,check-changeset-fixed— all greenscripts/__tests__/check-type-check-coverage.test.ts— 37 tests passChangeset
Patch for both packages. The presence gate does not demand one here (
0 of them under the src/ of a package the release covers ... no changeset is owed), but the published tarball of two released packages does change, so the declaration is written anyway — which the gate accepts and the card's ruling calls for. Never major;check-changeset-no-majorconfirms.Generated by Claude Code