@konvert7/klint 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/README.md +8 -1
- package/package.json +5 -5
- package/tools/generate-homebrew-formula.ts +68 -0
package/README.md
CHANGED
|
@@ -8,7 +8,14 @@ Use klint when "please follow AGENTS.md" is not strong enough. Put the rule in `
|
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
For macOS native CLI usage:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
brew tap konvert7/tap
|
|
15
|
+
brew install klint
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
For TypeScript projects using Bun:
|
|
12
19
|
|
|
13
20
|
```sh
|
|
14
21
|
bun add -d @konvert7/klint
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@konvert7/klint",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "Architecture-as-Code linter for TypeScript. Enforce layer boundaries, import rules, and singleton patterns in YAML.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
"zod": "^4.4.3"
|
|
65
65
|
},
|
|
66
66
|
"optionalDependencies": {
|
|
67
|
-
"@konvert7/klint-darwin-arm64": "0.
|
|
68
|
-
"@konvert7/klint-darwin-x64": "0.
|
|
69
|
-
"@konvert7/klint-linux-x64": "0.
|
|
70
|
-
"@konvert7/klint-win32-x64": "0.
|
|
67
|
+
"@konvert7/klint-darwin-arm64": "0.24.0",
|
|
68
|
+
"@konvert7/klint-darwin-x64": "0.24.0",
|
|
69
|
+
"@konvert7/klint-linux-x64": "0.24.0",
|
|
70
|
+
"@konvert7/klint-win32-x64": "0.24.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@biomejs/biome": "2.4.7",
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { mkdirSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { dirname, resolve } from "node:path";
|
|
3
|
+
|
|
4
|
+
interface FormulaOptions {
|
|
5
|
+
version: string;
|
|
6
|
+
darwinArm64Sha: string;
|
|
7
|
+
darwinX64Sha: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function homebrewFormula(options: FormulaOptions): string {
|
|
11
|
+
const version = options.version.replace(/^v/, "");
|
|
12
|
+
|
|
13
|
+
return `# typed: false
|
|
14
|
+
# frozen_string_literal: true
|
|
15
|
+
|
|
16
|
+
class Klint < Formula
|
|
17
|
+
desc "Architecture-as-Code linter for TypeScript, Python, and Swift projects"
|
|
18
|
+
homepage "https://github.com/konvert7/klint"
|
|
19
|
+
version "${version}"
|
|
20
|
+
license "MIT"
|
|
21
|
+
|
|
22
|
+
on_macos do
|
|
23
|
+
on_arm do
|
|
24
|
+
url "https://github.com/konvert7/klint/releases/download/native-v${version}/klint-${version}-darwin-arm64.tar.gz"
|
|
25
|
+
sha256 "${options.darwinArm64Sha}"
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
on_intel do
|
|
29
|
+
url "https://github.com/konvert7/klint/releases/download/native-v${version}/klint-${version}-darwin-x64.tar.gz"
|
|
30
|
+
sha256 "${options.darwinX64Sha}"
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def install
|
|
35
|
+
binary = File.exist?("klint") ? "klint" : Dir["klint-*/klint"].first
|
|
36
|
+
odie "klint binary not found" unless binary
|
|
37
|
+
bin.install binary => "klint"
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
test do
|
|
41
|
+
assert_match "klint-rs", shell_output("#{bin}/klint --version")
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (import.meta.main) {
|
|
48
|
+
const args = process.argv.slice(2);
|
|
49
|
+
const output = requireValue(args, "--output");
|
|
50
|
+
const formula = homebrewFormula({
|
|
51
|
+
version: requireValue(args, "--version"),
|
|
52
|
+
darwinArm64Sha: requireValue(args, "--darwin-arm64-sha"),
|
|
53
|
+
darwinX64Sha: requireValue(args, "--darwin-x64-sha"),
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const path = resolve(output);
|
|
57
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
58
|
+
writeFileSync(path, formula);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function requireValue(args: string[], name: string): string {
|
|
62
|
+
const index = args.indexOf(name);
|
|
63
|
+
const value = index >= 0 ? args[index + 1] : undefined;
|
|
64
|
+
if (!value) {
|
|
65
|
+
throw new Error(`${name} is required`);
|
|
66
|
+
}
|
|
67
|
+
return value;
|
|
68
|
+
}
|