@contractual/cli 0.1.0-dev.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.
Files changed (74) hide show
  1. package/LICENSE +21 -0
  2. package/bin/cli.js +2 -0
  3. package/dist/commands/breaking.command.d.ts +19 -0
  4. package/dist/commands/breaking.command.d.ts.map +1 -0
  5. package/dist/commands/breaking.command.js +138 -0
  6. package/dist/commands/changeset.command.d.ts +11 -0
  7. package/dist/commands/changeset.command.d.ts.map +1 -0
  8. package/dist/commands/changeset.command.js +65 -0
  9. package/dist/commands/contract.command.d.ts +34 -0
  10. package/dist/commands/contract.command.d.ts.map +1 -0
  11. package/dist/commands/contract.command.js +259 -0
  12. package/dist/commands/diff.command.d.ts +21 -0
  13. package/dist/commands/diff.command.d.ts.map +1 -0
  14. package/dist/commands/diff.command.js +58 -0
  15. package/dist/commands/index.d.ts +7 -0
  16. package/dist/commands/index.d.ts.map +1 -0
  17. package/dist/commands/index.js +6 -0
  18. package/dist/commands/init.command.d.ts +21 -0
  19. package/dist/commands/init.command.d.ts.map +1 -0
  20. package/dist/commands/init.command.js +294 -0
  21. package/dist/commands/lint.command.d.ts +16 -0
  22. package/dist/commands/lint.command.d.ts.map +1 -0
  23. package/dist/commands/lint.command.js +174 -0
  24. package/dist/commands/pre.command.d.ts +14 -0
  25. package/dist/commands/pre.command.d.ts.map +1 -0
  26. package/dist/commands/pre.command.js +141 -0
  27. package/dist/commands/status.command.d.ts +5 -0
  28. package/dist/commands/status.command.d.ts.map +1 -0
  29. package/dist/commands/status.command.js +120 -0
  30. package/dist/commands/version.command.d.ts +16 -0
  31. package/dist/commands/version.command.d.ts.map +1 -0
  32. package/dist/commands/version.command.js +247 -0
  33. package/dist/commands.d.ts +2 -0
  34. package/dist/commands.d.ts.map +1 -0
  35. package/dist/commands.js +84 -0
  36. package/dist/config/index.d.ts +3 -0
  37. package/dist/config/index.d.ts.map +1 -0
  38. package/dist/config/index.js +2 -0
  39. package/dist/config/loader.d.ts +28 -0
  40. package/dist/config/loader.d.ts.map +1 -0
  41. package/dist/config/loader.js +123 -0
  42. package/dist/config/schema.json +121 -0
  43. package/dist/config/validator.d.ts +28 -0
  44. package/dist/config/validator.d.ts.map +1 -0
  45. package/dist/config/validator.js +34 -0
  46. package/dist/core/diff.d.ts +26 -0
  47. package/dist/core/diff.d.ts.map +1 -0
  48. package/dist/core/diff.js +89 -0
  49. package/dist/formatters/diff.d.ts +31 -0
  50. package/dist/formatters/diff.d.ts.map +1 -0
  51. package/dist/formatters/diff.js +139 -0
  52. package/dist/governance/index.d.ts +11 -0
  53. package/dist/governance/index.d.ts.map +1 -0
  54. package/dist/governance/index.js +14 -0
  55. package/dist/index.d.ts +9 -0
  56. package/dist/index.d.ts.map +1 -0
  57. package/dist/index.js +9 -0
  58. package/dist/utils/exec.d.ts +29 -0
  59. package/dist/utils/exec.d.ts.map +1 -0
  60. package/dist/utils/exec.js +66 -0
  61. package/dist/utils/files.d.ts +36 -0
  62. package/dist/utils/files.d.ts.map +1 -0
  63. package/dist/utils/files.js +137 -0
  64. package/dist/utils/index.d.ts +4 -0
  65. package/dist/utils/index.d.ts.map +1 -0
  66. package/dist/utils/index.js +3 -0
  67. package/dist/utils/output.d.ts +25 -0
  68. package/dist/utils/output.d.ts.map +1 -0
  69. package/dist/utils/output.js +73 -0
  70. package/dist/utils/prompts.d.ts +90 -0
  71. package/dist/utils/prompts.d.ts.map +1 -0
  72. package/dist/utils/prompts.js +119 -0
  73. package/package.json +81 -0
  74. package/src/config/schema.json +121 -0
@@ -0,0 +1,121 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://contractual.dev/schemas/config.json",
4
+ "title": "Contractual Configuration",
5
+ "description": "Configuration file for Contractual schema contract lifecycle orchestrator",
6
+ "type": "object",
7
+ "required": ["contracts"],
8
+ "properties": {
9
+ "contracts": {
10
+ "type": "array",
11
+ "description": "List of contract definitions",
12
+ "minItems": 1,
13
+ "items": {
14
+ "type": "object",
15
+ "required": ["name", "type", "path"],
16
+ "properties": {
17
+ "name": {
18
+ "type": "string",
19
+ "description": "Unique identifier for the contract",
20
+ "pattern": "^[a-z][a-z0-9-]*$"
21
+ },
22
+ "type": {
23
+ "type": "string",
24
+ "description": "Type of schema",
25
+ "enum": ["openapi", "json-schema", "asyncapi", "odcs"]
26
+ },
27
+ "path": {
28
+ "type": "string",
29
+ "description": "Path to spec file (can be glob pattern)"
30
+ },
31
+ "lint": {
32
+ "oneOf": [
33
+ { "type": "string", "description": "Linter tool name or custom command" },
34
+ { "type": "boolean", "const": false, "description": "Disable linting" }
35
+ ]
36
+ },
37
+ "breaking": {
38
+ "oneOf": [
39
+ { "type": "string", "description": "Differ tool name or custom command" },
40
+ { "type": "boolean", "const": false, "description": "Disable breaking change detection" }
41
+ ]
42
+ },
43
+ "generate": {
44
+ "type": "array",
45
+ "description": "Output generation commands",
46
+ "items": { "type": "string" }
47
+ }
48
+ },
49
+ "additionalProperties": false
50
+ }
51
+ },
52
+ "versioning": {
53
+ "type": "object",
54
+ "description": "Versioning configuration",
55
+ "properties": {
56
+ "mode": {
57
+ "type": "string",
58
+ "enum": ["independent", "fixed"],
59
+ "description": "Versioning mode: independent (each contract separate) or fixed (all share same version)",
60
+ "default": "independent"
61
+ }
62
+ },
63
+ "additionalProperties": false
64
+ },
65
+ "changeset": {
66
+ "type": "object",
67
+ "description": "Changeset behavior configuration",
68
+ "properties": {
69
+ "autoDetect": {
70
+ "type": "boolean",
71
+ "description": "Auto-detect change classifications",
72
+ "default": true
73
+ },
74
+ "requireOnPR": {
75
+ "type": "boolean",
76
+ "description": "Require changeset for spec changes in PRs",
77
+ "default": true
78
+ }
79
+ },
80
+ "additionalProperties": false
81
+ },
82
+ "ai": {
83
+ "type": "object",
84
+ "description": "AI/LLM integration configuration",
85
+ "properties": {
86
+ "provider": {
87
+ "type": "string",
88
+ "enum": ["anthropic"],
89
+ "default": "anthropic"
90
+ },
91
+ "model": {
92
+ "type": "string",
93
+ "description": "Model to use"
94
+ },
95
+ "features": {
96
+ "type": "object",
97
+ "properties": {
98
+ "explain": {
99
+ "type": "boolean",
100
+ "description": "PR change explanations",
101
+ "default": true
102
+ },
103
+ "changelog": {
104
+ "type": "boolean",
105
+ "description": "AI-enriched changelog entries",
106
+ "default": true
107
+ },
108
+ "enhance": {
109
+ "type": "boolean",
110
+ "description": "Spec metadata enhancement",
111
+ "default": false
112
+ }
113
+ },
114
+ "additionalProperties": false
115
+ }
116
+ },
117
+ "additionalProperties": false
118
+ }
119
+ },
120
+ "additionalProperties": false
121
+ }