@contractspec/lib.feature-flags
v3.7.17
Published
Feature flags and experiments module for ContractSpec applications
Maintainers
Readme
@contractspec/lib.feature-flags
Website: https://contractspec.io
Feature flags and experiments module for ContractSpec applications.
What It Provides
- Layer: lib.
- Consumers: bundles, apps.
src/contracts/contains contract specs, operations, entities, and registry exports.src/docs/contains docblocks and documentation-facing exports.src/contracts/contains contract specs, operations, entities, and registry exports.src/docs/contains docblocks and documentation-facing exports.
Installation
npm install @contractspec/lib.feature-flags
or
bun add @contractspec/lib.feature-flags
Usage
Import the root entrypoint from @contractspec/lib.feature-flags, or choose a documented subpath when you only need one part of the package surface.
Architecture
src/contracts/contains contract specs, operations, entities, and registry exports.src/docs/contains docblocks and documentation-facing exports.src/entities/contains domain entities and value objects.src/evaluationis part of the package's public or composition surface.src/events.tsis package-level event definitions.src/feature-flags.capability.tsdefines a capability surface.src/feature-flags.feature.tsdefines a feature entrypoint.
Public Entry Points
- Export
.resolves through./src/index.ts. - Export
./contractsresolves through./src/contracts/index.ts. - Export
./docsresolves through./src/docs/index.ts. - Export
./docs/feature-flags.docblockresolves through./src/docs/feature-flags.docblock.ts. - Export
./entitiesresolves through./src/entities/index.ts. - Export
./evaluationresolves through./src/evaluation/index.ts. - Export
./eventsresolves through./src/events.ts. - Export
./feature-flags.capabilityresolves through./src/feature-flags.capability.ts. - Export
./feature-flags.featureresolves through./src/feature-flags.feature.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 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.
Notes
- Flag evaluation logic must be deterministic — same input always produces same output.
- Capability and feature contracts are public API; changes are breaking.
- Follow the PostHog naming conventions defined in workspace rules for new flag names.
