@contractspec/lib.contracts-runtime-server-rest
v3.8.2
Published
REST server runtime adapters for ContractSpec contracts
Downloads
1,940
Readme
@contractspec/lib.contracts-runtime-server-rest
REST server runtime adapters for ContractSpec contracts.
What It Provides
- Layer: lib.
- Consumers: bundles, all REST apps.
- 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.
Installation
npm install @contractspec/lib.contracts-runtime-server-rest
or
bun add @contractspec/lib.contracts-runtime-server-rest
Usage
Import the root entrypoint from @contractspec/lib.contracts-runtime-server-rest, or choose a documented subpath when you only need one part of the package surface.
Architecture
src/contracts-adapter-hydration.tsis part of the package's public or composition surface.src/contracts-adapter-input.tsis part of the package's public or composition surface.src/index.tsis the root public barrel and package entrypoint.src/rest-elysia.tsis part of the package's public or composition surface.src/rest-express.tsis part of the package's public or composition surface.src/rest-generic.tsis part of the package's public or composition surface.src/rest-next-app.tsis part of the package's public or composition surface.
Public Entry Points
- Export
.resolves through./src/index.ts. - Export
./contracts-adapter-hydrationresolves through./src/contracts-adapter-hydration.ts. - Export
./contracts-adapter-inputresolves through./src/contracts-adapter-input.ts. - Export
./rest-elysiaresolves through./src/rest-elysia.ts. - Export
./rest-expressresolves through./src/rest-express.ts. - Export
./rest-genericresolves through./src/rest-generic.ts. - Export
./rest-next-appresolves through./src/rest-next-app.ts. - Export
./rest-next-pagesresolves through./src/rest-next-pages.ts.
Local Commands
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
Recent Updates
- Replace eslint+prettier by biomejs to optimize speed.
Notes
- High blast radius — all REST APIs depend on this package.
- Framework adapters (Elysia, Express, Next.js) must stay independent of each other.
- Do not introduce cross-adapter coupling.
