React runtime adapters for ContractSpec contracts.
- Layer: lib.
- Consumers: design-system, presentation-runtime-react, bundles.
- Related ContractSpec packages include
@contractspec/lib.contracts-spec,@contractspec/lib.schema,@contractspec/tool.bun,@contractspec/tool.typescript. - Related ContractSpec packages include
@contractspec/lib.contracts-spec,@contractspec/lib.schema,@contractspec/tool.bun,@contractspec/tool.typescript.
npm install @contractspec/lib.contracts-runtime-client-react
or
bun add @contractspec/lib.contracts-runtime-client-react
Import the root entrypoint from @contractspec/lib.contracts-runtime-client-react, or choose a documented subpath when you only need one part of the package surface.
The form renderer supports the expanded FormSpec field set: readonly inputs, autocomplete, address, phone, date, time, datetime, semantic groups, repeated grouped arrays, grid layout hints, and text/textarea input groups. Drivers are expected to provide dedicated slots for rich widgets plus shadcn/Radix-style Field* and optional InputGroup* slots. When input-group slots are absent, text and textarea fields fall back to plain controls.
src/driversis part of the package's public or composition surface.src/feature-render.tsis part of the package's public or composition surface.src/form-render.impl.tsxis part of the package's public or composition surface.src/form-render.tsis part of the package's public or composition surface.src/index.tsis the root public barrel and package entrypoint.
- Export
.resolves through./src/index.ts. - Export
./drivers/rn-reusablesresolves through./src/drivers/rn-reusables.ts. - Export
./drivers/shadcnresolves through./src/drivers/shadcn.ts. - Export
./feature-renderresolves through./src/feature-render.ts. - Export
./form-renderresolves through./src/form-render.ts. - Export
./form-render.implresolves through./src/form-render.impl.tsx.
bun run dev— contractspec-bun-build devbun run build— bun run prebuild && bun run build:bundle && bun run build:typesbun run lint— bun run lint:fixbun run lint:check— biome check .bun run lint:fix— biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .bun run typecheck— tsc --noEmitbun run publish:pkg— bun publish --tolerate-republish --ignore-scripts --verbosebun run publish:pkg:canary— bun publish:pkg --tag canarybun run clean— rm -rf distbun run build:bundle— contractspec-bun-build transpilebun run build:types— contractspec-bun-build typesbun run prebuild— contractspec-bun-build prebuild
- Replace eslint+prettier by biomejs to optimize speed.
- Driver interface must stay compatible with both shadcn and RN Reusables.
- Form rendering pipeline is a critical path; test thoroughly before changing.