@konvert7/klint 0.36.0 → 0.37.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konvert7/klint",
3
- "version": "0.36.0",
3
+ "version": "0.37.1",
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": {
@@ -54,7 +54,7 @@
54
54
  "knip": "knip-bun",
55
55
  "klint": "bun cli.ts --engine auto",
56
56
  "jscpd": "jscpd --noTips",
57
- "schema": "bun tools/generate-schema.ts",
57
+ "schema": "cargo run --quiet -p klint-rs --example generate_schema -- $npm_package_version",
58
58
  "lint-staged": "lint-staged",
59
59
  "prepare": "bun .husky/install.mjs"
60
60
  },
@@ -70,13 +70,13 @@
70
70
  "zod": "^4.4.3"
71
71
  },
72
72
  "optionalDependencies": {
73
- "@konvert7/klint-darwin-arm64": "0.36.0",
74
- "@konvert7/klint-darwin-x64": "0.36.0",
75
- "@konvert7/klint-linux-x64": "0.36.0",
76
- "@konvert7/klint-win32-x64": "0.36.0"
73
+ "@konvert7/klint-darwin-arm64": "0.37.1",
74
+ "@konvert7/klint-darwin-x64": "0.37.1",
75
+ "@konvert7/klint-linux-x64": "0.37.1",
76
+ "@konvert7/klint-win32-x64": "0.37.1"
77
77
  },
78
78
  "devDependencies": {
79
- "@biomejs/biome": "2.4.7",
79
+ "@biomejs/biome": "2.6.4",
80
80
  "@commitlint/cli": "^20.5.3",
81
81
  "@commitlint/config-conventional": "^20.5.3",
82
82
  "@semantic-release/changelog": "^6.0.3",
@@ -30,11 +30,12 @@ export async function prepare(pluginConfig = {}, context) {
30
30
  packageJson.version = version;
31
31
  writePackageJson(cwd, packageJson);
32
32
 
33
- regenerateSchema(cwd, pluginConfig.spawnSync ?? spawnSync);
33
+ regenerateSchema(cwd, version, pluginConfig.spawnSync ?? spawnSync);
34
34
  }
35
35
 
36
- function regenerateSchema(cwd, spawn) {
37
- const result = spawn("bun", ["tools/generate-schema.ts"], {
36
+ function regenerateSchema(cwd, version, spawn) {
37
+ const args = ["run", "--quiet", "-p", "klint-rs", "--example", "generate_schema", "--", version];
38
+ const result = spawn("cargo", args, {
38
39
  cwd,
39
40
  encoding: "utf-8",
40
41
  stdio: "inherit",
@@ -1,34 +0,0 @@
1
- #!/usr/bin/env bun
2
- import { readFileSync, writeFileSync } from "node:fs";
3
- import { resolve } from "node:path";
4
- import { stringify as toYaml } from "yaml";
5
- import { KlintConfigSchema } from "../core/config.schema";
6
- import { schemaUrlForVersion } from "../core/schema-version";
7
-
8
- const raw = KlintConfigSchema.toJSONSchema() as Record<string, unknown>;
9
-
10
- // Set Draft-07 (broad editor compatibility) instead of 2020-12.
11
- delete raw.$schema;
12
-
13
- function packageVersion(): string {
14
- const manifest = readFileSync(resolve(import.meta.dir, "../package.json"), "utf-8");
15
- try {
16
- return (JSON.parse(manifest) as { version?: string }).version ?? "0.0.0";
17
- } catch {
18
- throw new Error("package.json is not valid JSON — cannot stamp the schema version");
19
- }
20
- }
21
-
22
- const schema = {
23
- $schema: "http://json-schema.org/draft-07/schema#",
24
- $id: schemaUrlForVersion(packageVersion()),
25
- ...raw,
26
- };
27
-
28
- const jsonOutPath = resolve(import.meta.dir, "../klint.schema.json");
29
- writeFileSync(jsonOutPath, `${JSON.stringify(schema, null, 2)}\n`);
30
- process.stdout.write(`Generated ${jsonOutPath}\n`);
31
-
32
- const yamlOutPath = resolve(import.meta.dir, "../klint.schema.yaml");
33
- writeFileSync(yamlOutPath, toYaml(schema, { lineWidth: 120 }));
34
- process.stdout.write(`Generated ${yamlOutPath}\n`);