fix(exports)!: form filling leaves the root, one install stays - #8
Merged
Conversation
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>
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.
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-formsis ESM-only. Re-exporting it from this root meant that importing theCHAIN pulled the forms package in behind it, so AOZ — which wanted
freeChainand nothing else — had its Jest run die on
Unexpected token 'export'inside amodule it never asked for. Three suites, seven tests.
The available remedy was a
transformIgnorePatternsentry in AOZ. Then the sameentry 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:
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.jsasserts boththat
ai-kit/formsresolves 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