Skip to content

test(types): pin the public types of nine packages - #425

Merged
codecaaron merged 1 commit into
mainfrom
test/type-narrowness
Nov 28, 2026
Merged

codecaaron merged 1 commit into
mainfrom
test/type-narrowness

Conversation

@codecaaron

Copy link
Copy Markdown
Owner

Adds type-narrowness fixtures for the public types that had none, on top of the types/ layout introduced in #424. No library type changes.

What is pinned

Package New fixtures What they pin
core kit, chain, groups, theme, exports, vocabulary class resolver props, system and theme builders, groups, scales, transforms, asset, appearance, every subpath entry
react style-objects, entries unknown keys and tokens in every style body, the four subpath entries, AnimusExtended, SystemInstance, ComposedFamily
effect-ui vars, builders defineVars, kitVars, bindEffectUiSystem, contract types, slot types, undeclared state and compound keys
properties exports all 25 exports
vite-plugin, next-plugin, unplugin, layergate, cli one each option key sets, required keys, closed values, an unknown key on each option type

205 new negative assertions. Every fixture compiles against the built declarations on TypeScript 7.0.2 and 5.9.3, with and without exactOptionalPropertyTypes.

Other changes

  • scripts/verify/types.sh: twelve new projects and six more freshness checks; the dist check also accepts index.d.mts for layergate. The tier takes about 15 s instead of 9 s and needs fresh dists of the six added packages.
  • AGENTS.md: vp run verify:types is added to the change-map rows for properties, the three plugins, layergate and extract/pipeline.
  • packages/react/types/published/guards.ts gains a shared RequiredKeys helper; the effect-ui mock host moves to host.ts so fixtures can share it.

Findings, not fixed here

Places where a published type is wider than a consumer would expect. The first four accept input that then fails or misbehaves at run time:

  1. addColorModes accepts an unknown colour token, a non-string alias, an initial mode not in the config, and a basedOn naming no mode.
  2. The @animus-ui/unplugin adapters compile with no options, though system is required.
  3. effect-ui .contract() accepts a misspelled key beside a valid one, which silently drops the obligation.
  4. addSelectors accepts an alias without the _ prefix.

Also: CSS keyword values are open (display: 'flexx' compiles); diagnostic codes are open strings; underscore aliases are open until Conditions and Selectors are augmented; a numeric key nested in a colour group has value type never; the CLI publishes no config type; TurbopackLoaderOptions is not exported.

Verification

  • vp run build:ts, verify:types, verify:lint and verify:compile pass at 1f053bc5.
  • Each new fixture file was given a deliberate type error once and the tier failed on it; a second pass removed every @ts-expect-error in a copy and confirmed each line fails on both compilers.

🤖 Generated with Claude Code

Adds published-declaration fixtures for core, react, effect-ui, properties, vite-plugin, next-plugin, unplugin, layergate and the CLI: 205 new negative assertions covering unknown keys and tokens in style bodies, option key sets and required keys, subpath entries, and builder inputs and outputs. Twelve new projects join scripts/verify/types.sh, compiled against the built declarations on TypeScript 7.0.2 and 5.9.3 with and without exactOptionalPropertyTypes.

No library type changes. AGENTS.md gains verify:types on the change-map rows for the packages that now have type fixtures.

Verified at this commit: vp run build:ts, verify:types, verify:lint and verify:compile.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@codecaaron
codecaaron merged commit 72f9452 into main Nov 28, 2026
16 checks passed
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.

1 participant