Skip to content

fix(exports)!: form filling leaves the root, one install stays - #8

Merged
catomean merged 1 commit into
mainfrom
fix/forms-not-in-root-export
Aug 26, 2026
Merged

fix(exports)!: form filling leaves the root, one install stays#8
catomean merged 1 commit into
mainfrom
fix/forms-not-in-root-export

Conversation

@catomean

Copy link
Copy Markdown
Collaborator

fix(exports)!: form filling leaves the root, one install stays

The first app to adopt the merged package broke on it, which is the fastest
possible feedback and worth acting on rather than patching around.

ai-forms is ESM-only. Re-exporting it from this root meant that importing the
CHAIN pulled the forms package in behind it, so AOZ — which wanted freeChain
and nothing else — had its Jest run die on Unexpected token 'export' inside a
module it never asked for. Three suites, seven tests.

The available remedy was a transformIgnorePatterns entry in AOZ. Then the same
entry in the next adopter, and the one after: a single class of breakage, paid
once per repo, forever. That is precisely the shape this fleet has a rule
against, so the fix goes here instead.

One install was always the promise, and it is untouched. Same package, same
version, nothing new to install — only the import path moves:

import { freeChain }    from "ai-kit";        // the chain
import { defineFields } from "ai-kit/forms";  // form filling
import { useAssist }    from "ai-kit/react";  // the React hook

Which is what the exports map was for. Collapsing it into the root threw away
the one thing it buys: a server that wants a provider chain no longer pays for
a form library, or for a UI peer behind it.

BREAKING for anyone importing form symbols from the root. Measured before
changing rather than assumed: across both consumers — FleetCrown (5 files) and
AOZ (2) — every root import is chain, limits or fair-share. Zero form symbols.
Nothing in the fleet has to change.

The absence is now a test, not a convention. test/exports.test.js asserts both
that ai-kit/forms resolves and that the root does NOT carry those symbols,
because a convenience re-export added back at the root would read as harmless in
review and break the next consumer in exactly this way.

verify: lint, typecheck, build, 48/48 tests.

🤖 Generated with Claude Code

The first app to adopt the merged package broke on it, which is the fastest
possible feedback and worth acting on rather than patching around.

`ai-forms` is ESM-only. Re-exporting it from this root meant that importing the
CHAIN pulled the forms package in behind it, so AOZ — which wanted `freeChain`
and nothing else — had its Jest run die on `Unexpected token 'export'` inside a
module it never asked for. Three suites, seven tests.

The available remedy was a `transformIgnorePatterns` entry in AOZ. Then the same
entry in the next adopter, and the one after: a single class of breakage, paid
once per repo, forever. That is precisely the shape this fleet has a rule
against, so the fix goes here instead.

One install was always the promise, and it is untouched. Same package, same
version, nothing new to install — only the import path moves:

    import { freeChain }    from "ai-kit";        // the chain
    import { defineFields } from "ai-kit/forms";  // form filling
    import { useAssist }    from "ai-kit/react";  // the React hook

Which is what the exports map was for. Collapsing it into the root threw away
the one thing it buys: a server that wants a provider chain no longer pays for
a form library, or for a UI peer behind it.

BREAKING for anyone importing form symbols from the root. Measured before
changing rather than assumed: across both consumers — FleetCrown (5 files) and
AOZ (2) — every root import is chain, limits or fair-share. Zero form symbols.
Nothing in the fleet has to change.

The absence is now a test, not a convention. `test/exports.test.js` asserts both
that `ai-kit/forms` resolves and that the root does NOT carry those symbols,
because a convenience re-export added back at the root would read as harmless in
review and break the next consumer in exactly this way.

verify: lint, typecheck, build, 48/48 tests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@catomean
catomean merged commit 44f6bca into main Aug 26, 2026
1 check passed
@catomean
catomean deleted the fix/forms-not-in-root-export branch August 26, 2026 21:38
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