@contractspec/bundle.workspace
v4.7.1
Published
Workspace utilities for monorepo development
Maintainers
Readme
@contractspec/bundle.workspace
Website: https://contractspec.io
Core workspace bundle that powers ContractSpec CLI, validation, code generation, AI workflows, and repository setup.
What It Provides
- Provides the service layer behind the CLI, editor integrations, drift detection, diagnostics, and setup flows.
- Owns workspace-oriented AI agents, prompts, templates, fixers, and validation/reporting services.
- Acts as the main orchestration bundle for repository lifecycle and codegen workflows.
src/adapters/contains runtime, provider, or environment-specific adapters.src/contracts/contains contract specs, operations, entities, and registry exports.src/services/contains business logic services and workflows.
Installation
npm install @contractspec/bundle.workspace
or
bun add @contractspec/bundle.workspace
Usage
Import the root entrypoint from @contractspec/bundle.workspace, or choose a documented subpath when you only need one part of the package surface.
Architecture
src/services/contains the core use-cases for build, validate, doctor, diff, setup, examples, and CI flows.src/adapters/andsrc/ports/isolate filesystem, git, AI, and workspace integration boundaries.src/ai/contains workspace-specific agent definitions, prompts, and model-aware helpers.src/templates/,src/contracts/,src/formatters/,src.types/, andsrc.utils/support generated outputs and reporting.src/index.tsis the root public barrel and package entrypoint.src/types.tsis shared public type definitions.
Public Entry Points
- Root bundle export with namespaced services, adapters, ports, formatters, templates, contracts, AI helpers, and utilities.
- Export
.resolves through./src/index.ts. - Environment templates can generate root and app-target
.env.examplecontent from the shared logical environment contract while preserving per-framework aliases such asNEXT_PUBLIC_*andEXPO_PUBLIC_*.
Local Commands
bun run dev— contractspec-bun-build devbun run build— bun run prebuild && bun run build:bundle && bun run build:typesbun run test— bun testbun run lint— bun 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— rimraf dist .turbobun 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.
- Add table capabilities.
- Stability.
- Package exports.
- Add latest models and align defaults.
- Standardize tool naming to underscore notation.
Notes
- Largest bundle in the monorepo (~280 source files); prefer editing existing services over adding new top-level directories.
- Adapters must implement port interfaces; no direct infrastructure calls from services.
- AI agent definitions must stay provider-agnostic via the
aiSDK abstraction. - Template changes affect generated code across all consumers; test thoroughly.
