@company-semantics/contracts 0.7.0 → 0.8.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/README.md CHANGED
@@ -25,6 +25,11 @@ import type { IntentCategory, InsightConfidence } from '@company-semantics/contr
25
25
  - Frontend-only extensions
26
26
  - Implementation details
27
27
 
28
+ ## Package Format
29
+
30
+ This package intentionally exports TypeScript source.
31
+ It does not emit `.d.ts` files. Consumers are expected to compile TS.
32
+
28
33
  ## Versioning
29
34
 
30
35
  Follows semver:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@company-semantics/contracts",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,33 +9,44 @@
9
9
  "type": "module",
10
10
  "exports": {
11
11
  ".": {
12
- "types": "./index.ts"
13
- }
12
+ "types": "./src/index.ts",
13
+ "default": "./src/index.ts"
14
+ },
15
+ "./schemas/guard-result.schema.json": "./schemas/guard-result.schema.json"
14
16
  },
15
- "types": "./index.ts",
17
+ "types": "./src/index.ts",
16
18
  "files": [
17
- "index.ts",
18
- "system/",
19
- "README.md"
19
+ "src",
20
+ "schemas"
20
21
  ],
21
22
  "publishConfig": {
22
23
  "access": "public"
23
24
  },
24
25
  "scripts": {
25
- "typecheck": "tsc --noEmit",
26
+ "typecheck": "tsc -b --noEmit",
26
27
  "lint:md": "markdownlint-cli2 '**/*.md' '#node_modules'",
27
28
  "lint:json": "node -e \"JSON.parse(require('fs').readFileSync('package.json'))\"",
28
- "prepare": "husky"
29
+ "prepare": "husky",
30
+ "guard:decision": "npx tsx scripts/ci/decision-guard.ts",
31
+ "guard:decision:json": "npx tsx scripts/ci/decision-guard.ts --json",
32
+ "guard:export": "npx tsx scripts/ci/export-guard.ts",
33
+ "guard:export:json": "npx tsx scripts/ci/export-guard.ts --json",
34
+ "guard:vocabulary": "npx tsx scripts/ci/vocabulary-guard.ts",
35
+ "guard:vocabulary:json": "npx tsx scripts/ci/vocabulary-guard.ts --json",
36
+ "guard:test": "vitest run scripts/ci/__tests__"
29
37
  },
30
38
  "packageManager": "pnpm@10.25.0",
31
39
  "devDependencies": {
40
+ "@types/node": "^25.0.3",
32
41
  "husky": "^9",
33
42
  "lint-staged": "^15",
34
43
  "markdownlint-cli2": "^0.17",
35
- "typescript": "^5"
44
+ "tsx": "^4.21.0",
45
+ "typescript": "^5",
46
+ "vitest": "^4.0.16"
36
47
  },
37
48
  "lint-staged": {
38
- "*.ts": "tsc --noEmit",
49
+ "*.ts": "bash -c 'tsc -b --noEmit'",
39
50
  "*.md": "markdownlint-cli2",
40
51
  "package.json": "node -e \"JSON.parse(require('fs').readFileSync('package.json'))\""
41
52
  }
@@ -0,0 +1,63 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://company-semantics.dev/schemas/guard-result.json",
4
+ "title": "Guard Result",
5
+ "description": "JSON output envelope for CI guard --json mode. schemaVersion reflects the JSON schema version, not the guard tool version.",
6
+ "type": "object",
7
+ "required": ["tool", "schemaVersion", "timestamp", "results"],
8
+ "properties": {
9
+ "tool": {
10
+ "type": "string",
11
+ "description": "The guard tool name (e.g., 'architecture-guard', 'vocabulary-guard')"
12
+ },
13
+ "schemaVersion": {
14
+ "type": "string",
15
+ "description": "Schema version (not tool version). Bump on breaking schema changes.",
16
+ "pattern": "^\\d+\\.\\d+\\.\\d+$"
17
+ },
18
+ "timestamp": {
19
+ "type": "string",
20
+ "format": "date-time",
21
+ "description": "ISO 8601 timestamp of when the guard ran"
22
+ },
23
+ "results": {
24
+ "type": "object",
25
+ "description": "Flat structure: all errors/warnings from all tiers are aggregated here",
26
+ "required": ["errors", "warnings"],
27
+ "properties": {
28
+ "errors": {
29
+ "type": "array",
30
+ "items": { "$ref": "#/definitions/GuardMessage" }
31
+ },
32
+ "warnings": {
33
+ "type": "array",
34
+ "items": { "$ref": "#/definitions/GuardMessage" }
35
+ }
36
+ }
37
+ }
38
+ },
39
+ "definitions": {
40
+ "GuardMessage": {
41
+ "type": "object",
42
+ "required": ["file", "message"],
43
+ "properties": {
44
+ "file": {
45
+ "type": "string",
46
+ "description": "Path to the file with the issue"
47
+ },
48
+ "message": {
49
+ "type": "string",
50
+ "description": "Human-readable description of the issue"
51
+ },
52
+ "line": {
53
+ "type": "number",
54
+ "description": "Optional line number (when available)"
55
+ },
56
+ "rule": {
57
+ "type": "string",
58
+ "description": "Optional rule identifier (when available)"
59
+ }
60
+ }
61
+ }
62
+ }
63
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "strict": true,
7
+ "noEmit": true,
8
+ "composite": true,
9
+ "skipLibCheck": true
10
+ },
11
+ "include": ["**/*.ts"],
12
+ "exclude": ["**/*.test.ts", "**/*.spec.ts"]
13
+ }
File without changes
File without changes
File without changes
File without changes