Package Responsibilities
What each of the six published packages owns, and the dependency direction between them.
The six packages
| Package | Owns | Depends on |
|---|---|---|
@prismrepo/core | Framework-independent, React-free contracts: error types, type-level utilities. | Nothing. |
@prismrepo/forms | Registry contracts (defineRegistry), form-builder contracts (createFormBuilder). | @prismrepo/core; react (type inference only, not imported at runtime). |
@prismrepo/react | React integration: PrismProvider, registry-binding hooks. | @prismrepo/core; react. Never react-hook-form, zod, or any adapter. |
@prismrepo/adapter-rhf | Binds forms contracts to React Hook Form; Controller-first binding; preserves the full UseFormReturn. | @prismrepo/core, @prismrepo/forms; react-hook-form (peer). |
@prismrepo/adapter-zod | Thin Zod validation integration, compatible with @hookform/resolvers/zod. | @prismrepo/core, @prismrepo/forms, @hookform/resolvers; react-hook-form (type-only peer), zod (peer). |
prismrepo CLI (@prismrepo/cli) | Copy-in installation of primitives/field templates, registry updates, safe file handling. | ts-morph only. Never depended on by any runtime package. |
Dependency direction
@prismrepo/core depends on nothing in the ecosystem and never on React. @prismrepo/react
and @prismrepo/forms depend only on core. Both adapters depend on core and forms but
never on each other, @prismrepo/adapter-zod doesn't import @prismrepo/adapter-rhf, it only
needs react-hook-form's types to shape its return value correctly. The CLI depends on nothing
at runtime, and nothing depends on it, it's a devDependency-only, install-time tool.
This means @prismrepo/react's PrismProvider works without React Hook Form installed at all,
and @prismrepo/adapter-zod can be swapped for a different validation adapter in the future
without touching @prismrepo/adapter-rhf.
Why this split, not one package
A single @prismrepo/forms package containing everything would force every consumer to pull in
React Hook Form and Zod even if they only need the registry contracts, and would make "no
hidden dependency on a specific form library" unenforceable at the package level, the only
enforcement would be internal discipline, not import resolution. Six focused packages make each
dependency explicit and let a bundler tree-shake what a given consumer doesn't use.