@contractspec/lib.plugins 3.7.6 → 3.7.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,63 +1,64 @@
1
1
  # @contractspec/lib.plugins
2
2
 
3
- Core plugin API for ContractSpec. Defines plugin interfaces, registry management, and discovery configuration.
3
+ Website: https://contractspec.io
4
4
 
5
- ## Overview
5
+ **Plugin API and registry for ContractSpec extensions.**
6
6
 
7
- Use this package to build generator, validator, adapter, formatter, and registry resolver plugins. The core types keep plugin behavior consistent while allowing capability-specific logic.
7
+ ## What It Provides
8
+
9
+ - **Layer**: lib.
10
+ - **Consumers**: bundles, CLI.
11
+ - Related ContractSpec packages include `@contractspec/lib.contracts-spec`, `@contractspec/lib.schema`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
12
+ - Related ContractSpec packages include `@contractspec/lib.contracts-spec`, `@contractspec/lib.schema`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
8
13
 
9
14
  ## Installation
10
15
 
11
- ```bash
12
- bun add @contractspec/lib.plugins
13
- ```
16
+ `npm install @contractspec/lib.plugins`
17
+
18
+ or
19
+
20
+ `bun add @contractspec/lib.plugins`
14
21
 
15
22
  ## Usage
16
23
 
17
- ```typescript
18
- import type { ContractSpecPlugin, PluginContext } from "@contractspec/lib.plugins";
19
-
20
- export const MarkdownGeneratorPlugin: ContractSpecPlugin = {
21
- meta: {
22
- id: "markdown-generator",
23
- version: "1.0.0",
24
- type: "generator",
25
- provides: ["docs"],
26
- },
27
- register(context: PluginContext) {
28
- context.generators.register({
29
- id: "markdown",
30
- description: "Generate markdown docs",
31
- generate: async (specs) => {
32
- // Implementation
33
- },
34
- });
35
- },
36
- };
37
- ```
38
-
39
- ## Capabilities
40
-
41
- - **Generators**: Produce code, docs, schemas, or artifacts.
42
- - **Validators**: Enforce policies and compliance checks.
43
- - **Adapters**: Integrate frameworks or runtimes.
44
- - **Formatters**: Post-process generated output.
45
- - **Registry resolvers**: Resolve plugins from workspace, npm, or remote registries.
46
-
47
- ## Registry configuration
48
-
49
- ```json
50
- {
51
- "plugins": [
52
- {
53
- "id": "markdown-generator",
54
- "package": "@contractspec/plugin.markdown-generator",
55
- "capabilities": ["generator"],
56
- "options": {
57
- "outputDir": "./docs/generated",
58
- "format": "table"
59
- }
60
- }
61
- ]
62
- }
63
- ```
24
+ Import the root entrypoint from `@contractspec/lib.plugins`, or choose a documented subpath when you only need one part of the package surface.
25
+
26
+ ## Architecture
27
+
28
+ - `src/config.ts` is part of the package's public or composition surface.
29
+ - `src/index.ts` is the root public barrel and package entrypoint.
30
+ - `src/registry.ts` is part of the package's public or composition surface.
31
+ - `src/types.ts` is shared public type definitions.
32
+
33
+ ## Public Entry Points
34
+
35
+ - Export `.` resolves through `./src/index.ts`.
36
+ - Export `./config` resolves through `./src/config.ts`.
37
+ - Export `./registry` resolves through `./src/registry.ts`.
38
+ - Export `./types` resolves through `./src/types.ts`.
39
+
40
+ ## Local Commands
41
+
42
+ - `bun run dev` — contractspec-bun-build dev
43
+ - `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
44
+ - `bun run test` — bun test --pass-with-no-tests
45
+ - `bun run lint` — bun lint:fix
46
+ - `bun run lint:check` — biome check .
47
+ - `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
48
+ - `bun run typecheck` tsc --noEmit
49
+ - `bun run publish:pkg` bun publish --tolerate-republish --ignore-scripts --verbose
50
+ - `bun run publish:pkg:canary` bun publish:pkg --tag canary
51
+ - `bun run clean` — rimraf dist .turbo
52
+ - `bun run build:bundle` contractspec-bun-build transpile
53
+ - `bun run build:types` — contractspec-bun-build types
54
+ - `bun run prebuild` — contractspec-bun-build prebuild
55
+
56
+ ## Recent Updates
57
+
58
+ - Replace eslint+prettier by biomejs to optimize speed.
59
+
60
+ ## Notes
61
+
62
+ - Plugin interface is a public API contract — breaking changes affect all published plugins.
63
+ - Registry must stay backward-compatible; older plugin manifests must remain loadable.
64
+ - Config schema changes require a migration path for existing plugin configurations.
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export type { AdapterCapability, AdapterRegistry, ContractSpecPlugin, FormatterCapability, FormatterRegistry, GeneratorCapability, GeneratorRegistry, PluginCapabilityType, PluginContext, PluginMeta, PluginRegistryConfig, PluginRegistryItem, RegistryResolverCapability, RegistryResolverRegistry, SpecRegistryEntry, ValidatorCapability, ValidatorRegistry, } from './types.js';
2
- export { PluginRegistries, defaultPluginRegistryConfig } from './registry.js';
3
1
  export { mergePluginConfig } from './config.js';
2
+ export { defaultPluginRegistryConfig, PluginRegistries } from './registry.js';
3
+ export type { AdapterCapability, AdapterRegistry, ContractSpecPlugin, FormatterCapability, FormatterRegistry, GeneratorCapability, GeneratorRegistry, PluginCapabilityType, PluginContext, PluginMeta, PluginRegistryConfig, PluginRegistryItem, RegistryResolverCapability, RegistryResolverRegistry, SpecRegistryEntry, ValidatorCapability, ValidatorRegistry, } from './types.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/lib.plugins",
3
- "version": "3.7.6",
3
+ "version": "3.7.10",
4
4
  "description": "Plugin API and registry for ContractSpec extensions",
5
5
  "keywords": [
6
6
  "contractspec",
@@ -23,21 +23,21 @@
23
23
  "dev": "contractspec-bun-build dev",
24
24
  "clean": "rimraf dist .turbo",
25
25
  "lint": "bun lint:fix",
26
- "lint:fix": "eslint src --fix",
27
- "lint:check": "eslint src",
26
+ "lint:fix": "biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .",
27
+ "lint:check": "biome check .",
28
28
  "test": "bun test --pass-with-no-tests",
29
29
  "prebuild": "contractspec-bun-build prebuild",
30
30
  "typecheck": "tsc --noEmit"
31
31
  },
32
32
  "dependencies": {
33
- "@contractspec/lib.contracts-spec": "3.7.6",
34
- "@contractspec/lib.schema": "3.7.6",
33
+ "@contractspec/lib.contracts-spec": "4.1.2",
34
+ "@contractspec/lib.schema": "3.7.8",
35
35
  "zod": "^4.3.5"
36
36
  },
37
37
  "devDependencies": {
38
- "@contractspec/tool.typescript": "3.7.6",
38
+ "@contractspec/tool.typescript": "3.7.8",
39
39
  "typescript": "^5.9.3",
40
- "@contractspec/tool.bun": "3.7.6"
40
+ "@contractspec/tool.bun": "3.7.8"
41
41
  },
42
42
  "exports": {
43
43
  ".": {