archgate 0.13.2 → 0.15.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
@@ -42,10 +42,13 @@ When a rule is violated, `archgate check` reports the file, line, and which ADR
42
42
 
43
43
  ```bash
44
44
  # macOS / Linux
45
- curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh
45
+ curl -fsSL https://cli.archgate.dev/install-unix | sh
46
46
 
47
47
  # Windows (PowerShell)
48
- irm https://raw.githubusercontent.com/archgate/cli/main/install.ps1 | iex
48
+ irm https://cli.archgate.dev/install-windows | iex
49
+
50
+ # Windows (Git Bash / MSYS2)
51
+ curl -fsSL https://cli.archgate.dev/install-unix | sh
49
52
  ```
50
53
 
51
54
  **Via npm** (or any Node.js package manager):
@@ -77,7 +80,7 @@ npx archgate check # run via package manager
77
80
 
78
81
  ```bash
79
82
  # 1. Install
80
- curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh # or: npm install -g archgate
83
+ curl -fsSL https://cli.archgate.dev/install-unix | sh # or: npm install -g archgate
81
84
 
82
85
  # 2. Initialize governance in your project
83
86
  cd my-project
@@ -95,30 +98,7 @@ archgate check
95
98
 
96
99
  ## Writing rules
97
100
 
98
- Each ADR can have a companion `.rules.ts` file that exports checks using `defineRules()` from the `archgate` package. Rules receive the list of files to check and return an array of violations with file paths and line numbers.
99
-
100
- See the [writing rules guide](https://cli.archgate.dev/guides/writing-rules/) for examples and the full [rule API reference](https://cli.archgate.dev/reference/rule-api/).
101
-
102
- ## Commands
103
-
104
- | Command | Description |
105
- | ------------------------ | ---------------------------------------------------------- |
106
- | `archgate init` | Initialize `.archgate/` with example ADR and editor config |
107
- | `archgate check` | Run ADR compliance checks (`--staged` for pre-commit) |
108
- | `archgate adr create` | Create a new ADR interactively |
109
- | `archgate adr list` | List all ADRs (`--json`, `--domain`) |
110
- | `archgate adr show <id>` | Print a specific ADR |
111
- | `archgate adr update` | Update an ADR's frontmatter |
112
- | `archgate login` | Authenticate with GitHub for editor plugins |
113
- | `archgate mcp` | Start the MCP server for AI agent integration |
114
- | `archgate upgrade` | Upgrade to the latest release |
115
- | `archgate clean` | Remove the CLI cache (`~/.archgate/`) |
116
-
117
- See the [CLI reference](https://cli.archgate.dev/reference/cli-commands/) for full usage and options.
118
-
119
- ## CI and pre-commit hooks
120
-
121
- Add `archgate check` to your CI pipeline or pre-commit hooks to block merges that violate ADRs. See the [CI integration guide](https://cli.archgate.dev/guides/ci-integration/) and [pre-commit hooks guide](https://cli.archgate.dev/guides/pre-commit-hooks/) for setup instructions.
101
+ Each ADR can have a companion `.rules.ts` file that exports automated checks. See the [writing rules guide](https://cli.archgate.dev/guides/writing-rules/) for examples and the full [rule API reference](https://cli.archgate.dev/reference/rule-api/).
122
102
 
123
103
  ## Supercharge with AI plugins
124
104
 
@@ -135,7 +115,7 @@ Add `archgate check` to your CI pipeline or pre-commit hooks to block merges tha
135
115
 
136
116
  ## Documentation
137
117
 
138
- Full documentation is available at **[cli.archgate.dev](https://cli.archgate.dev)** — including guides for writing ADRs, writing rules, CI integration, editor plugin setup, and the complete CLI and MCP reference.
118
+ Full documentation is available at **[cli.archgate.dev](https://cli.archgate.dev)** — including guides for writing ADRs, writing rules, CI integration, editor plugin setup, and the complete CLI reference.
139
119
 
140
120
  ## Contributing
141
121
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archgate",
3
- "version": "0.13.2",
3
+ "version": "0.15.0",
4
4
  "description": "Enforce Architecture Decision Records as executable rules — for both humans and AI agents",
5
5
  "keywords": [
6
6
  "adr",
@@ -27,7 +27,6 @@
27
27
  "archgate": "bin/archgate.cjs"
28
28
  },
29
29
  "files": [
30
- "src/formats/rules.ts",
31
30
  "bin/archgate.cjs"
32
31
  ],
33
32
  "os": [
@@ -36,9 +35,6 @@
36
35
  "win32"
37
36
  ],
38
37
  "type": "module",
39
- "exports": {
40
- "./rules": "./src/formats/rules.ts"
41
- },
42
38
  "scripts": {
43
39
  "build:check": "bun build src/cli.ts --compile --bytecode --outfile dist/.build-check && rm -f dist/.build-check dist/.build-check.exe",
44
40
  "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
@@ -75,9 +71,9 @@
75
71
  "typescript": "^5"
76
72
  },
77
73
  "optionalDependencies": {
78
- "archgate-darwin-arm64": "0.13.2",
79
- "archgate-linux-x64": "0.13.2",
80
- "archgate-win32-x64": "0.13.2"
74
+ "archgate-darwin-arm64": "0.15.0",
75
+ "archgate-linux-x64": "0.15.0",
76
+ "archgate-win32-x64": "0.15.0"
81
77
  },
82
78
  "readme": "README.md"
83
79
  }
@@ -1,68 +0,0 @@
1
- // --- Severity ---
2
-
3
- export type Severity = "error" | "warning" | "info";
4
-
5
- // --- Grep Match ---
6
-
7
- export interface GrepMatch {
8
- file: string;
9
- line: number;
10
- column: number;
11
- content: string;
12
- }
13
-
14
- // --- Violation Detail ---
15
-
16
- export interface ViolationDetail {
17
- ruleId: string;
18
- adrId: string;
19
- message: string;
20
- file?: string;
21
- line?: number;
22
- fix?: string;
23
- severity: Severity;
24
- }
25
-
26
- // --- Report interface (side-effect based) ---
27
-
28
- export interface RuleReport {
29
- violation(
30
- detail: Omit<ViolationDetail, "ruleId" | "adrId" | "severity">
31
- ): void;
32
- warning(detail: Omit<ViolationDetail, "ruleId" | "adrId" | "severity">): void;
33
- info(detail: Omit<ViolationDetail, "ruleId" | "adrId" | "severity">): void;
34
- }
35
-
36
- // --- Rule Context ---
37
-
38
- export interface RuleContext {
39
- projectRoot: string;
40
- scopedFiles: string[];
41
- changedFiles: string[];
42
- glob(pattern: string): Promise<string[]>;
43
- grep(file: string, pattern: RegExp): Promise<GrepMatch[]>;
44
- grepFiles(pattern: RegExp, fileGlob: string): Promise<GrepMatch[]>;
45
- readFile(path: string): Promise<string>;
46
- readJSON(path: string): Promise<unknown>;
47
- report: RuleReport;
48
- }
49
-
50
- // --- Rule Config ---
51
-
52
- export interface RuleConfig {
53
- description: string;
54
- severity?: Severity;
55
- check: (ctx: RuleContext) => Promise<void>;
56
- }
57
-
58
- // --- Rule Set ---
59
-
60
- export type RuleSet = { rules: Record<string, RuleConfig> };
61
-
62
- /**
63
- * Define rules in a .rules.ts companion file.
64
- * Keys become rule IDs, preventing duplicates.
65
- */
66
- export function defineRules(rules: Record<string, RuleConfig>): RuleSet {
67
- return { rules };
68
- }