@cosmicdrift/kumiko-cli 0.353.0 → 0.354.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/bin/kumiko-upgrade.ts +12 -4
- package/package.json +21 -7
- package/src/changes.json +12 -0
- package/src/commands/agent.ts +21 -8
- package/src/index.ts +16 -1
- package/src/missing-peer.ts +16 -0
package/bin/kumiko-upgrade.ts
CHANGED
|
@@ -3,11 +3,19 @@
|
|
|
3
3
|
// depend on kumiko-cli + kumiko-guards never get a transitive dependency's bin
|
|
4
4
|
// linked, and guard-upgrade-state needs it in node_modules/.bin.
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { missingPeerMessage } from "../src/missing-peer";
|
|
7
7
|
|
|
8
8
|
// biome-ignore lint/suspicious/noConsole: CLI output is the feature.
|
|
9
9
|
const out = { log: (l: string) => console.log(l), err: (l: string) => console.error(l) };
|
|
10
10
|
const appCwd = process.env["INIT_CWD"] ?? process.cwd();
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
const { runUpgradeCli } = await import("@cosmicdrift/kumiko-framework/upgrade-cli");
|
|
14
|
+
// Let the event loop drain stdout (piped by guard-upgrade-state) before exit.
|
|
15
|
+
process.exitCode = await runUpgradeCli(process.argv.slice(2), appCwd, out);
|
|
16
|
+
} catch (error) {
|
|
17
|
+
const message = missingPeerMessage(error);
|
|
18
|
+
if (message === undefined) throw error;
|
|
19
|
+
out.err(message);
|
|
20
|
+
process.exitCode = 1;
|
|
21
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.354.1",
|
|
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.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -36,14 +36,28 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@cosmicdrift/kumiko-
|
|
40
|
-
"@cosmicdrift/kumiko-
|
|
41
|
-
"@cosmicdrift/kumiko-
|
|
42
|
-
"@cosmicdrift/kumiko-
|
|
43
|
-
"@cosmicdrift/kumiko-repo-manifest": "0.353.0",
|
|
44
|
-
"@cosmicdrift/kumiko-testing": "0.353.0",
|
|
39
|
+
"@cosmicdrift/kumiko-dev-server": "0.354.1",
|
|
40
|
+
"@cosmicdrift/kumiko-guards": "0.354.1",
|
|
41
|
+
"@cosmicdrift/kumiko-repo-manifest": "0.354.1",
|
|
42
|
+
"@cosmicdrift/kumiko-testing": "0.354.1",
|
|
45
43
|
"zod": "^4.4.3"
|
|
46
44
|
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"@cosmicdrift/kumiko-bundled-features": ">=0.353.0 <1.0.0",
|
|
47
|
+
"@cosmicdrift/kumiko-framework": ">=0.353.0 <1.0.0"
|
|
48
|
+
},
|
|
49
|
+
"peerDependenciesMeta": {
|
|
50
|
+
"@cosmicdrift/kumiko-bundled-features": {
|
|
51
|
+
"optional": true
|
|
52
|
+
},
|
|
53
|
+
"@cosmicdrift/kumiko-framework": {
|
|
54
|
+
"optional": true
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@cosmicdrift/kumiko-bundled-features": "0.354.1",
|
|
59
|
+
"@cosmicdrift/kumiko-framework": "0.354.1"
|
|
60
|
+
},
|
|
47
61
|
"publishConfig": {
|
|
48
62
|
"registry": "https://registry.npmjs.org",
|
|
49
63
|
"access": "public"
|
package/src/changes.json
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.354.0",
|
|
4
|
+
"type": "improvement",
|
|
5
|
+
"title": "kumiko-cli declares framework and bundled-features as optional peer dependencies",
|
|
6
|
+
"detail": "kumiko-cli declares @cosmicdrift/kumiko-framework and @cosmicdrift/kumiko-bundled-features as optional peer dependencies instead of hard dependencies, so `kumiko new app` no longer pulls them in; commands that need them report a missing install instead of a resolver stacktrace"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"version": "0.354.0",
|
|
10
|
+
"type": "fix",
|
|
11
|
+
"title": "kumiko-cli optional peers no longer force a 1.0.0 release",
|
|
12
|
+
"detail": "kumiko-cli declares its optional peers framework and bundled-features with an explicit 0.x range, and changesets only bumps peer dependents when that range is left, so a minor framework release no longer pushes the fixed package group to 1.0.0"
|
|
13
|
+
},
|
|
2
14
|
{
|
|
3
15
|
"version": "0.351.0",
|
|
4
16
|
"type": "fix",
|
package/src/commands/agent.ts
CHANGED
|
@@ -32,26 +32,39 @@ export const agentCommand: CliCommand = {
|
|
|
32
32
|
|
|
33
33
|
const config = await loadAppConfig(ctx, configPath);
|
|
34
34
|
if (config === null) return 1;
|
|
35
|
-
const { findAgentDocGaps, formatAgentDocGap } = await import(
|
|
35
|
+
const { findAgentDocGaps, findHandlerTranslationGaps, formatAgentDocGap } = await import(
|
|
36
36
|
"@cosmicdrift/kumiko-bundled-features/agent-tools"
|
|
37
37
|
);
|
|
38
38
|
|
|
39
39
|
const gaps = findAgentDocGaps(config.features);
|
|
40
|
+
const translationGaps = findHandlerTranslationGaps(config.features);
|
|
40
41
|
|
|
41
|
-
if (gaps.length === 0) {
|
|
42
|
+
if (gaps.length === 0 && translationGaps.length === 0) {
|
|
42
43
|
ctx.out.log("");
|
|
43
44
|
ctx.out.log(" ✓ No AI-agent doc gaps found.");
|
|
44
45
|
ctx.out.log("");
|
|
45
46
|
return 0;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
if (gaps.length > 0) {
|
|
50
|
+
ctx.out.log("");
|
|
51
|
+
ctx.out.log(` ${gaps.length} AI-agent doc gap${gaps.length === 1 ? "" : "s"} found:`);
|
|
52
|
+
ctx.out.log("");
|
|
53
|
+
for (const gap of gaps) {
|
|
54
|
+
ctx.out.log(` ${formatAgentDocGap(gap)}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (translationGaps.length > 0) {
|
|
58
|
+
ctx.out.log("");
|
|
59
|
+
ctx.out.log(
|
|
60
|
+
` ${translationGaps.length} warning${translationGaps.length === 1 ? "" : "s"} (handler translations, do not affect the exit code):`,
|
|
61
|
+
);
|
|
62
|
+
ctx.out.log("");
|
|
63
|
+
for (const gap of translationGaps) {
|
|
64
|
+
ctx.out.log(` ${formatAgentDocGap(gap)}`);
|
|
65
|
+
}
|
|
53
66
|
}
|
|
54
67
|
ctx.out.log("");
|
|
55
|
-
return 1;
|
|
68
|
+
return gaps.length === 0 ? 0 : 1;
|
|
56
69
|
},
|
|
57
70
|
};
|
package/src/index.ts
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
import { renderTestSetup } from "@cosmicdrift/kumiko-testing/scaffold";
|
|
18
18
|
import type { CliCommand } from "./commands";
|
|
19
19
|
import { APP_COMMANDS, findAppCommand } from "./commands";
|
|
20
|
+
import { missingPeerMessage } from "./missing-peer";
|
|
20
21
|
import type { Output } from "./output";
|
|
21
22
|
|
|
22
23
|
export type { Output } from "./output";
|
|
@@ -60,13 +61,27 @@ export async function runCli(options: RunCliOptions): Promise<number> {
|
|
|
60
61
|
printCommandHelp(appCommand, out);
|
|
61
62
|
return 0;
|
|
62
63
|
}
|
|
63
|
-
return await appCommand
|
|
64
|
+
return await runAppCommand(appCommand, { argv: rest, cwd, out });
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
out.err(`kumiko: unknown command "${first}". Run \`kumiko --help\` for usage.`);
|
|
67
68
|
return 1;
|
|
68
69
|
}
|
|
69
70
|
|
|
71
|
+
async function runAppCommand(
|
|
72
|
+
command: CliCommand,
|
|
73
|
+
context: Parameters<CliCommand["run"]>[0],
|
|
74
|
+
): Promise<number> {
|
|
75
|
+
try {
|
|
76
|
+
return await command.run(context);
|
|
77
|
+
} catch (error) {
|
|
78
|
+
const message = missingPeerMessage(error);
|
|
79
|
+
if (message === undefined) throw error;
|
|
80
|
+
context.out.err(`kumiko ${command.id}: ${message}`);
|
|
81
|
+
return 1;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
70
85
|
async function runNew(args: readonly string[], out: Output, cwd: string): Promise<number> {
|
|
71
86
|
const [subject, name] = args;
|
|
72
87
|
if (subject !== "app") {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const APP_PEER_PACKAGES = [
|
|
2
|
+
"@cosmicdrift/kumiko-framework",
|
|
3
|
+
"@cosmicdrift/kumiko-bundled-features",
|
|
4
|
+
] as const;
|
|
5
|
+
|
|
6
|
+
// The runtime packages are optional peers (so `new app` runs without them); a
|
|
7
|
+
// command that needs one must report the missing install, not a resolver stacktrace.
|
|
8
|
+
export function missingPeerMessage(error: unknown): string | undefined {
|
|
9
|
+
if (!(error instanceof Error)) return undefined;
|
|
10
|
+
for (const peer of APP_PEER_PACKAGES) {
|
|
11
|
+
if (error.message.includes(`'${peer}`) && /cannot find (package|module)/i.test(error.message)) {
|
|
12
|
+
return `${peer} is not installed. Install ${peer} in your app (bun add ${peer}).`;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|