@company-semantics/contracts 0.23.0 → 0.24.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@company-semantics/contracts",
3
- "version": "0.23.0",
3
+ "version": "0.24.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -55,7 +55,7 @@
55
55
  "guard:version-tag:json": "npx tsx scripts/ci/version-tag-guard.ts --json",
56
56
  "guard:test": "vitest run scripts/ci/__tests__",
57
57
  "release": "npx tsx scripts/release.ts",
58
- "prepublishOnly": "pnpm guard:version-tag",
58
+ "prepublishOnly": "echo 'ERROR: Publishing is CI-only via tag push. Use pnpm release instead.' && exit 1",
59
59
  "test": "vitest run scripts/ci/__tests__"
60
60
  },
61
61
  "packageManager": "pnpm@10.25.0",
@@ -207,6 +207,18 @@ export interface VulnerabilitiesBaseline {
207
207
  }>;
208
208
  }
209
209
 
210
+ /**
211
+ * Contracts consumer guard configuration.
212
+ * Enforces: consumers never advance ahead of npm.
213
+ *
214
+ * Verifies that the @company-semantics/contracts version specified
215
+ * in package.json exists on npm before allowing consumer updates.
216
+ */
217
+ export interface ContractsConsumerBaseline {
218
+ /** Path to package.json relative to repo root */
219
+ packageJsonPath: string;
220
+ }
221
+
210
222
  /**
211
223
  * Structural guard baselines.
212
224
  * Product repos provide DATA only; CI orchestrator owns guard implementations.
@@ -226,6 +238,13 @@ export interface StructuralBaselines {
226
238
  * CI injects checkVulnerabilities based on this config.
227
239
  */
228
240
  vulnerabilities?: VulnerabilitiesBaseline;
241
+
242
+ /**
243
+ * Contracts consumer check configuration.
244
+ * CI injects checkContractsConsumer based on this config.
245
+ * Enforces: consumers never advance ahead of npm.
246
+ */
247
+ contractsConsumer?: ContractsConsumerBaseline;
229
248
  }
230
249
 
231
250
  /**
@@ -328,15 +347,15 @@ export interface CoverageBaseline {
328
347
  */
329
348
  export interface FileClusterBaseline {
330
349
  /** Minimum files to form a cluster */
331
- minClusterSize: number;
350
+ minClusterSize?: number;
332
351
  /** Minimum stragglers to suggest reorganization */
333
- minStragglers: number;
352
+ minStragglers?: number;
334
353
  /** Suffixes to strip when detecting clusters (e.g., '.test', '.spec') */
335
- stripSuffixes: string[];
354
+ stripSuffixes?: string[];
336
355
  /** Role words to strip (e.g., 'Service', 'Handler') */
337
- stripRoleWords: string[];
356
+ stripRoleWords?: string[];
338
357
  /** Directories to ignore */
339
- ignoredDirectories: string[];
358
+ ignoredDirectories?: string[];
340
359
  }
341
360
 
342
361
  /**
@@ -346,15 +365,15 @@ export interface FileClusterBaseline {
346
365
  */
347
366
  export interface SubdirectoryAffinityBaseline {
348
367
  /** Minimum importers required */
349
- minImporters: number;
368
+ minImporters?: number;
350
369
  /** Maximum non-subdirectory imports allowed */
351
- maxNonSubdirImports: number;
370
+ maxNonSubdirImports?: number;
352
371
  /** Patterns to exclude from analysis */
353
- excludePatterns: RegExp[];
372
+ excludePatterns?: RegExp[];
354
373
  /** Importer patterns to ignore */
355
- ignoredImporterPatterns: RegExp[];
374
+ ignoredImporterPatterns?: RegExp[];
356
375
  /** Directories to ignore */
357
- ignoredDirectories: string[];
376
+ ignoredDirectories?: string[];
358
377
  }
359
378
 
360
379
  /**
@@ -47,6 +47,7 @@ export type {
47
47
  StructuralBaselines,
48
48
  ScriptsDepsBaseline,
49
49
  VulnerabilitiesBaseline,
50
+ ContractsConsumerBaseline,
50
51
  EvolutionBaselines,
51
52
  ContractsFreshnessBaseline,
52
53
  CoverageBaseline,
@@ -15,7 +15,7 @@
15
15
  * @see ADR-CONTRACTS-NNN in DECISIONS.md
16
16
  */
17
17
 
18
- import type { DiagramNode, FlowStage, FeatureStatus } from './index.js'
18
+ import type { DiagramNode, FlowStage } from './index.js'
19
19
 
20
20
  // =============================================================================
21
21
  // Types
@@ -132,8 +132,3 @@ export interface AggregatedCapabilities {
132
132
  aggregatedAt: string
133
133
  }
134
134
 
135
- // =============================================================================
136
- // Re-exports for convenience
137
- // =============================================================================
138
-
139
- export type { FeatureStatus, FlowStage }