Skip to content

fix(annotator): move the React adapter to the ./react subpath so the root stays headless - #911

Merged
JArmandoAnaya merged 2 commits into
mainfrom
fix/annotator-react-subpath
Oct 12, 2026
Merged

JArmandoAnaya merged 2 commits into
mainfrom
fix/annotator-react-subpath

Conversation

@JArmandoAnaya

Copy link
Copy Markdown
Contributor

Fixes #843

@visionset/annotator declared react as an optional peer, but its only entry point re-exported the React adapter as values, so the package could not be imported without React.

Change

  • The root entry is headless again. The React adapter is the new @visionset/annotator/react export; the optional peer stays.
  • tsup builds two entries with splitting on, so both share one copy of the core (stores, error classes).
  • In-repo importers in ui-core and app now import React-adapter names from /react.
  • scripts/verify_npm_packages.sh gains a consumer that installs only the annotator tarball, asserts react is absent and imports the root. The existing consumer also imports ./react and type-checks a root-created store against the ./react hooks.
  • Architecture docs name the subpath; CHANGELOG.md records it.

Breaking

Importers of React adapter names from the package root must switch to @visionset/annotator/react. The package is a 0.0.x beta; all in-repo consumers are updated.

Verification

  • pnpm -r build, annotator lint and tests, ui-core and app lint, and verify_npm_packages.sh pass.
  • Only the touched ui-core suites were run locally; CI covers the rest.
  • The old annotator, packed and installed alone, throws ERR_MODULE_NOT_FOUND; the new gate covers that case.

UI-affecting (touches ui-core and app): for human review before merge.

JArmandoAnaya and others added 2 commits October 11, 2026 18:12
…root stays headless

The root re-exported the React adapter, so importing @visionset/annotator
required the optional react peer. The adapter is now the separate
@visionset/annotator/react entry; in-repo consumers import from it, and the
package verifier gains a react-free consumer and a root-store/react-hook type check.

Breaking for importers of React adapter names from the root.

Fixes #843
@JArmandoAnaya
JArmandoAnaya merged commit 9bff18b into main Oct 12, 2026
31 checks passed
@JArmandoAnaya
JArmandoAnaya deleted the fix/annotator-react-subpath branch October 12, 2026 04:00
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.

@visionset/annotator cannot be imported without React, despite declaring it an optional peer

1 participant