@contractspec/tool.create-contractspec-plugin
v3.8.9
Published
CLI tool for creating ContractSpec plugins from templates
Maintainers
Readme
@contractspec/tool.create-contractspec-plugin
Website: https://contractspec.io
CLI tool for creating ContractSpec plugins from templates.
What It Provides
- Layer: tool.
- Consumers: plugin authors (via
create-contractspec-pluginCLI). - 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/tool.create-contractspec-plugin
or
bun add @contractspec/tool.create-contractspec-plugin
Usage
npx create-contractspec-plugin --help
# or
bunx create-contractspec-plugin --helpArchitecture
src/index.tsis the root public barrel and package entrypoint.src/templatesis part of the package's public or composition surface.src/utils.tsis part of the package's public or composition surface.
Public Entry Points
- Binary
create-contractspec-pluginpoints to./dist/index.js. - Export
.resolves through./src/index.ts. - Export
./templates/example-generatorresolves through./src/templates/example-generator.ts. - Export
./utilsresolves through./src/utils.ts.
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 test --pass-with-no-testsbun 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
- Template files live in
templates/-- keep them in sync with the current plugin contract. - Do not change interactive prompts without updating the corresponding template variables.
- Depends on
@contractspec/lib.contracts-specand@contractspec/lib.schema-- respect their APIs.
