archgate 0.1.0 → 0.2.4
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 +16 -5
- package/bin/archgate.cjs +38 -0
- package/package.json +13 -7
package/README.md
CHANGED
|
@@ -38,18 +38,29 @@ When a rule is violated, `archgate check` reports the file, line, and which ADR
|
|
|
38
38
|
## Installation
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
|
-
|
|
41
|
+
npm install -g archgate
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
**Requirements:** macOS (arm64) or Linux (x86_64). Node.js is only needed to run the wrapper — the CLI itself is a standalone binary.
|
|
45
45
|
|
|
46
|
-
**
|
|
46
|
+
> **Using [proto](https://moonrepo.dev/proto)?** Add the following to `~/.proto/config.toml` and your shell profile so globals persist across Node.js version switches:
|
|
47
|
+
>
|
|
48
|
+
> ```toml
|
|
49
|
+
> # ~/.proto/config.toml
|
|
50
|
+
> [tools.npm]
|
|
51
|
+
> shared-globals-dir = true
|
|
52
|
+
> ```
|
|
53
|
+
>
|
|
54
|
+
> ```sh
|
|
55
|
+
> # ~/.zshrc or ~/.bashrc
|
|
56
|
+
> export PATH="$HOME/.proto/tools/node/globals/bin:$PATH"
|
|
57
|
+
> ```
|
|
47
58
|
|
|
48
59
|
## Quick start
|
|
49
60
|
|
|
50
61
|
```bash
|
|
51
62
|
# 1. Install
|
|
52
|
-
|
|
63
|
+
npm install -g archgate
|
|
53
64
|
|
|
54
65
|
# 2. Initialize governance in your project
|
|
55
66
|
cd my-project
|
|
@@ -188,7 +199,7 @@ Also exposes `adr://{id}` resources for reading individual ADRs by ID.
|
|
|
188
199
|
Upgrade to the latest release.
|
|
189
200
|
|
|
190
201
|
```bash
|
|
191
|
-
archgate
|
|
202
|
+
npm update -g archgate
|
|
192
203
|
```
|
|
193
204
|
|
|
194
205
|
### `archgate clean`
|
package/bin/archgate.cjs
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const { execFileSync } = require("child_process");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
|
|
8
|
+
function getPlatformPackageName() {
|
|
9
|
+
const { platform, arch } = process;
|
|
10
|
+
if (platform === "darwin" && arch === "arm64") return "archgate-darwin-arm64";
|
|
11
|
+
if (platform === "linux" && arch === "x64") return "archgate-linux-x64";
|
|
12
|
+
throw new Error(
|
|
13
|
+
`Unsupported platform: ${platform}/${arch}\narchgate supports darwin/arm64 and linux/x64 only.`
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function getBinaryPath() {
|
|
18
|
+
const pkgName = getPlatformPackageName();
|
|
19
|
+
try {
|
|
20
|
+
const pkgDir = path.dirname(require.resolve(`${pkgName}/package.json`));
|
|
21
|
+
const binaryPath = path.join(pkgDir, "bin", "archgate");
|
|
22
|
+
if (fs.existsSync(binaryPath)) return binaryPath;
|
|
23
|
+
} catch {
|
|
24
|
+
/* platform package not installed */
|
|
25
|
+
}
|
|
26
|
+
throw new Error(
|
|
27
|
+
`archgate binary not found. "${getPlatformPackageName()}" may not be installed.\nTry reinstalling: npm install -g archgate`
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
try {
|
|
32
|
+
const binary = getBinaryPath();
|
|
33
|
+
execFileSync(binary, process.argv.slice(2), { stdio: "inherit" });
|
|
34
|
+
} catch (e) {
|
|
35
|
+
if (typeof e.status === "number") process.exit(e.status);
|
|
36
|
+
console.error(e.message);
|
|
37
|
+
process.exit(2);
|
|
38
|
+
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "archgate",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.4",
|
|
4
|
+
"description": "Enforce Architecture Decision Records as executable rules — for both humans and AI agents",
|
|
5
5
|
"readme": "README.md",
|
|
6
6
|
"license": "FSL-1.1-ALv2",
|
|
7
7
|
"homepage": "https://archgate.dev",
|
|
8
|
+
"bin": {
|
|
9
|
+
"archgate": "bin/archgate.cjs"
|
|
10
|
+
},
|
|
8
11
|
"exports": {
|
|
9
12
|
"./rules": "./src/formats/rules.ts"
|
|
10
13
|
},
|
|
11
14
|
"files": [
|
|
12
|
-
"src/formats/rules.ts"
|
|
15
|
+
"src/formats/rules.ts",
|
|
16
|
+
"bin/archgate.cjs"
|
|
13
17
|
],
|
|
14
18
|
"author": {
|
|
15
19
|
"name": "Archgate",
|
|
@@ -40,11 +44,9 @@
|
|
|
40
44
|
"format:check": "prettier --check .",
|
|
41
45
|
"test": "bun test --timeout 60000",
|
|
42
46
|
"test:watch": "bun test --watch --timeout 60000",
|
|
43
|
-
"
|
|
47
|
+
"build:check": "bun build src/cli.ts --compile --bytecode --outfile dist/.build-check && rm -f dist/.build-check",
|
|
48
|
+
"validate": "bun run lint && bun run typecheck && bun run format:check && bun test && bun run check && bun run build:check",
|
|
44
49
|
"commit": "cz",
|
|
45
|
-
"build": "bun run scripts/build.ts",
|
|
46
|
-
"build:darwin": "bun run scripts/build.ts --target darwin-arm64",
|
|
47
|
-
"build:linux": "bun run scripts/build.ts --target linux-x64",
|
|
48
50
|
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0"
|
|
49
51
|
},
|
|
50
52
|
"type": "module",
|
|
@@ -68,5 +70,9 @@
|
|
|
68
70
|
},
|
|
69
71
|
"peerDependencies": {
|
|
70
72
|
"typescript": "^5"
|
|
73
|
+
},
|
|
74
|
+
"optionalDependencies": {
|
|
75
|
+
"archgate-darwin-arm64": ">=0.1.1",
|
|
76
|
+
"archgate-linux-x64": ">=0.1.1"
|
|
71
77
|
}
|
|
72
78
|
}
|