@cosmicdrift/kumiko-cli 0.414.0 → 0.415.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/package.json +12 -12
- package/src/changes.json +7 -0
- package/src/commands/check-lint.ts +52 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.415.0",
|
|
4
4
|
"description": "CLI for Kumiko apps. `bunx @cosmicdrift/kumiko-cli new app <name>` scaffolds a runnable workspace; `add feature <name>` mounts a feature; `check` runs boot validation plus the guard suites with the step list derived from kumiko.json; `agent lint`, `project` and `consumer` operate on an existing app; `handbuch build` renders the HTML handbuch.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -36,19 +36,19 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@cosmicdrift/kumiko-dev-server": "0.
|
|
40
|
-
"@cosmicdrift/kumiko-feature-ast": "0.
|
|
41
|
-
"@cosmicdrift/kumiko-guards": "0.
|
|
42
|
-
"@cosmicdrift/kumiko-server-runtime": "0.
|
|
43
|
-
"@cosmicdrift/kumiko-testing": "0.
|
|
39
|
+
"@cosmicdrift/kumiko-dev-server": "0.415.0",
|
|
40
|
+
"@cosmicdrift/kumiko-feature-ast": "0.415.0",
|
|
41
|
+
"@cosmicdrift/kumiko-guards": "0.415.0",
|
|
42
|
+
"@cosmicdrift/kumiko-server-runtime": "0.415.0",
|
|
43
|
+
"@cosmicdrift/kumiko-testing": "0.415.0",
|
|
44
44
|
"marked": "^18.1.2",
|
|
45
45
|
"zod": "^4.6.7"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"sharp": "^0.35.5",
|
|
49
|
-
"@cosmicdrift/kumiko-bundled-features": "0.
|
|
50
|
-
"@cosmicdrift/kumiko-framework": "0.
|
|
51
|
-
"@cosmicdrift/kumiko-renderer": "0.
|
|
49
|
+
"@cosmicdrift/kumiko-bundled-features": "0.415.0",
|
|
50
|
+
"@cosmicdrift/kumiko-framework": "0.415.0",
|
|
51
|
+
"@cosmicdrift/kumiko-renderer": "0.415.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependenciesMeta": {
|
|
54
54
|
"sharp": {
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@cosmicdrift/kumiko-bundled-features": "0.
|
|
69
|
-
"@cosmicdrift/kumiko-framework": "0.
|
|
70
|
-
"@cosmicdrift/kumiko-renderer": "0.
|
|
68
|
+
"@cosmicdrift/kumiko-bundled-features": "0.415.0",
|
|
69
|
+
"@cosmicdrift/kumiko-framework": "0.415.0",
|
|
70
|
+
"@cosmicdrift/kumiko-renderer": "0.415.0",
|
|
71
71
|
"sharp": "^0.35.5"
|
|
72
72
|
},
|
|
73
73
|
"publishConfig": {
|
package/src/changes.json
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.415.0",
|
|
4
|
+
"type": "breaking",
|
|
5
|
+
"title": "kumiko check fails when biome.json does not extend the Kumiko Biome preset",
|
|
6
|
+
"detail": "The lint step now reads `biome.json` or `biome.jsonc` (comments allowed) before it starts Biome and follows relative `extends` entries. It passes only if the chain reaches `@cosmicdrift/kumiko-framework/biome-rules`, `@cosmicdrift/kumiko-framework/biome` or a relative path to the framework's `presets/biome-rules.json` or `presets/biome-app.json`. Without the preset the SSRF, path-traversal, event-store write and admin-API plugins are missing and the step used to stay green; now it exits 1 and does not start Biome.",
|
|
7
|
+
"migration": "Add `\"extends\": [\"@cosmicdrift/kumiko-framework/biome\"]` to the repo's `biome.json` (`@cosmicdrift/kumiko-framework/biome-rules` for repos that keep their own file layout)."
|
|
8
|
+
},
|
|
2
9
|
{
|
|
3
10
|
"version": "0.413.0",
|
|
4
11
|
"type": "fix",
|
|
@@ -1,6 +1,49 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join, resolve } from "node:path";
|
|
2
3
|
import type { Output } from "../output";
|
|
3
4
|
|
|
5
|
+
const PRESET_PACKAGE_EXTENDS: ReadonlySet<string> = new Set([
|
|
6
|
+
"@cosmicdrift/kumiko-framework/biome-rules",
|
|
7
|
+
"@cosmicdrift/kumiko-framework/biome",
|
|
8
|
+
]);
|
|
9
|
+
const PRESET_FILE_SUFFIXES = ["/presets/biome-rules.json", "/presets/biome-app.json"];
|
|
10
|
+
const BIOME_CONFIG_NAMES = ["biome.json", "biome.jsonc"];
|
|
11
|
+
const PRESET_FIX = '"extends": ["@cosmicdrift/kumiko-framework/biome"]';
|
|
12
|
+
|
|
13
|
+
function readExtendsList(configPath: string): string[] {
|
|
14
|
+
let parsed: unknown;
|
|
15
|
+
try {
|
|
16
|
+
parsed = Bun.JSONC.parse(readFileSync(configPath, "utf-8"));
|
|
17
|
+
} catch {
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
const list =
|
|
21
|
+
typeof parsed === "object" && parsed !== null && "extends" in parsed
|
|
22
|
+
? parsed.extends
|
|
23
|
+
: undefined;
|
|
24
|
+
const entries = Array.isArray(list) ? list : [list];
|
|
25
|
+
return entries.filter((entry): entry is string => typeof entry === "string");
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function extendsFrameworkPreset(configPath: string, visited: Set<string>): boolean {
|
|
29
|
+
if (visited.has(configPath)) return false;
|
|
30
|
+
visited.add(configPath);
|
|
31
|
+
return readExtendsList(configPath).some((entry) => {
|
|
32
|
+
if (PRESET_PACKAGE_EXTENDS.has(entry)) return true;
|
|
33
|
+
if (!entry.startsWith(".")) return false;
|
|
34
|
+
const target = resolve(dirname(configPath), entry);
|
|
35
|
+
if (PRESET_FILE_SUFFIXES.some((suffix) => target.endsWith(suffix))) return true;
|
|
36
|
+
return existsSync(target) && extendsFrameworkPreset(target, visited);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function repoExtendsFrameworkPreset(repoRoot: string): boolean {
|
|
41
|
+
const configPath = BIOME_CONFIG_NAMES.map((name) => join(repoRoot, name)).find((candidate) =>
|
|
42
|
+
existsSync(candidate),
|
|
43
|
+
);
|
|
44
|
+
return configPath !== undefined && extendsFrameworkPreset(configPath, new Set());
|
|
45
|
+
}
|
|
46
|
+
|
|
4
47
|
function resolveBiomeBin(repoRoot: string): string | undefined {
|
|
5
48
|
try {
|
|
6
49
|
return join(dirname(Bun.resolveSync("@biomejs/biome/package.json", repoRoot)), "bin", "biome");
|
|
@@ -19,6 +62,14 @@ export async function runLintCheckStep(out: Output, repoRoot: string): Promise<n
|
|
|
19
62
|
out.err(" Fix: `bun add -d @biomejs/biome`");
|
|
20
63
|
return 1;
|
|
21
64
|
}
|
|
65
|
+
// Without the preset the SSRF, path-traversal, event-store-write and admin-API plugins are missing and the lint step stays green.
|
|
66
|
+
if (!repoExtendsFrameworkPreset(repoRoot)) {
|
|
67
|
+
out.err(
|
|
68
|
+
" ✗ biome.json does not extend the Kumiko Biome preset — the security plugins (SSRF, path traversal, event-store writes, admin API) would not run.",
|
|
69
|
+
);
|
|
70
|
+
out.err(` Fix: add ${PRESET_FIX} to biome.json`);
|
|
71
|
+
return 1;
|
|
72
|
+
}
|
|
22
73
|
const proc = Bun.spawn(["bun", biomeBin, "lint", "."], {
|
|
23
74
|
cwd: repoRoot,
|
|
24
75
|
stdout: "pipe",
|