@contractspec/example.minimal
v2.8.9
Published
**Minimal ContractSpec example showing the simplest possible contract definition and build.**
Readme
@contractspec/example.minimal
Minimal ContractSpec example showing the simplest possible contract definition and build.
What This Demonstrates
- Bare-minimum contract definition (user contract).
contractspec buildandcontractspec validateCLI usage.- Maintained example package included in the ContractSpec example registry.
src/contracts/contains contract specs, operations, entities, and registry exports.src/docs/contains docblocks and documentation-facing exports.src/handlers/contains handlers or demo adapters wired to contract surfaces.
Running Locally
From packages/examples/minimal:
bun run buildbun run testbun run typecheckbun run smokebun run preflight
Usage
Use @contractspec/example.minimal as a reference implementation, or import its exported surfaces into a workspace that composes ContractSpec examples and bundles.
Architecture
src/contracts/contains contract specs, operations, entities, and registry exports.src/docs/contains docblocks and documentation-facing exports.src/example.tsis the runnable example entrypoint.src/handlers/contains handlers or demo adapters wired to contract surfaces.src/index.tsis the root public barrel and package entrypoint.src/minimal.feature.tsdefines a feature entrypoint.
Public Entry Points
- Export
.resolves through./src/index.ts. - Export
./docsresolves through./src/docs/index.ts. - Export
./docs/minimal.docblockresolves through./src/docs/minimal.docblock.ts. - Export
./exampleresolves through./src/example.ts. - Export
./minimal.featureresolves through./src/minimal.feature.ts. - Export
./contracts/userresolves through./src/contracts/user.ts.
Local Commands
bun run build— bun ../../apps/cli-contractspec/src/cli.ts build src/contracts/user.tsbun run validate— bun ../../apps/cli-contractspec/src/cli.ts validate src/contracts/user.tsbun run typecheck— tsc --noEmitbun run test— bun testbun run smoke— bun test src/example.smoke.test.tsbun run preflight— bun run build && bun run typecheck && bun run test && bun run validate && bun run smoke
Recent Updates
- Replace eslint+prettier by biomejs to optimize speed.
- Stability.
- Missing contract layers.
Notes
- Works alongside
@contractspec/lib.contracts-spec,@contractspec/lib.schema.
