@cosmicdrift/kumiko-dev-server 0.155.0 → 0.155.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": "@cosmicdrift/kumiko-dev-server",
|
|
3
|
-
"version": "0.155.
|
|
3
|
+
"version": "0.155.1",
|
|
4
4
|
"description": "Dev-tooling for Kumiko apps: local dev-server bootstrap (runDevApp), scaffolding, codegen. Not shipped into production node_modules — see @cosmicdrift/kumiko-server-runtime for the prod boot path.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"kumiko-schema-check": "./bin/kumiko-schema-check.ts"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@cosmicdrift/kumiko-bundled-features": "0.155.
|
|
58
|
-
"@cosmicdrift/kumiko-framework": "0.155.
|
|
59
|
-
"@cosmicdrift/kumiko-server-runtime": "0.155.
|
|
57
|
+
"@cosmicdrift/kumiko-bundled-features": "0.155.1",
|
|
58
|
+
"@cosmicdrift/kumiko-framework": "0.155.1",
|
|
59
|
+
"@cosmicdrift/kumiko-server-runtime": "0.155.1",
|
|
60
60
|
"ts-morph": "^28.0.0"
|
|
61
61
|
},
|
|
62
62
|
"publishConfig": {
|
|
@@ -283,7 +283,7 @@ export default defineFeature("dup", (r) => {
|
|
|
283
283
|
const result = runCodegen({ appRoot });
|
|
284
284
|
expect(result.eventCount).toBe(1);
|
|
285
285
|
expect(result.warnings.length).toBeGreaterThanOrEqual(1);
|
|
286
|
-
const w = result.warnings.find((w) => w.
|
|
286
|
+
const w = result.warnings.find((w) => w.message.includes("duplicate"));
|
|
287
287
|
expect(w).toBeDefined();
|
|
288
288
|
});
|
|
289
289
|
|
|
@@ -368,7 +368,7 @@ export default defineFeature("inline", (r) => {
|
|
|
368
368
|
const result = runCodegen({ appRoot });
|
|
369
369
|
expect(result.eventCount).toBe(0);
|
|
370
370
|
expect(result.warnings.length).toBe(1);
|
|
371
|
-
expect(result.warnings[0]?.
|
|
371
|
+
expect(result.warnings[0]?.message).toMatch(/not a named import nor an inline z\.\* call/);
|
|
372
372
|
});
|
|
373
373
|
|
|
374
374
|
test("skips test files, node_modules, .kumiko, dist", () => {
|
|
@@ -93,7 +93,7 @@ export type SchemaSource =
|
|
|
93
93
|
export type ScanWarning = {
|
|
94
94
|
readonly file: string;
|
|
95
95
|
readonly line: number;
|
|
96
|
-
readonly
|
|
96
|
+
readonly message: string;
|
|
97
97
|
};
|
|
98
98
|
|
|
99
99
|
export type ScanResult = {
|
|
@@ -152,7 +152,7 @@ function collectTsFiles(dir: string, out: string[]): void {
|
|
|
152
152
|
try {
|
|
153
153
|
entries = readdirSync(dir);
|
|
154
154
|
} catch {
|
|
155
|
-
//
|
|
155
|
+
// skip: directory unreadable, nothing to scan there
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
158
|
for (const entry of entries) {
|
|
@@ -224,8 +224,9 @@ function collectFromDefineEvent(
|
|
|
224
224
|
warnings.push({
|
|
225
225
|
file: filePath,
|
|
226
226
|
line: call.getStartLineNumber(),
|
|
227
|
-
|
|
227
|
+
message: "r.defineEvent: cannot read event-name + schema statically",
|
|
228
228
|
});
|
|
229
|
+
// skip: defineEvent call shape not statically parseable, already recorded as warning
|
|
229
230
|
return;
|
|
230
231
|
}
|
|
231
232
|
|
|
@@ -241,8 +242,9 @@ function collectFromDefineEvent(
|
|
|
241
242
|
warnings.push({
|
|
242
243
|
file: filePath,
|
|
243
244
|
line: call.getStartLineNumber(),
|
|
244
|
-
|
|
245
|
+
message: `r.defineEvent("${parsed.eventName}"): schema "${parsed.schemaNode.getText()}" — not a named import nor an inline z.* call, skipped`,
|
|
245
246
|
});
|
|
247
|
+
// skip: schema source not resolvable, already recorded as warning
|
|
246
248
|
return;
|
|
247
249
|
}
|
|
248
250
|
|
|
@@ -544,7 +546,7 @@ function dedupe(events: ScannedEvent[], warnings: ScanWarning[]): ScannedEvent[]
|
|
|
544
546
|
warnings.push({
|
|
545
547
|
file: ev.source.file,
|
|
546
548
|
line: ev.source.line,
|
|
547
|
-
|
|
549
|
+
message: `duplicate r.defineEvent("${ev.qualifiedName}") — first declared at ${existing.source.file}:${existing.source.line}, ignored here`,
|
|
548
550
|
});
|
|
549
551
|
continue;
|
|
550
552
|
}
|
package/src/codegen/watch.ts
CHANGED
|
@@ -74,7 +74,7 @@ export function watchAndRegenerate(opts: WatchOptions): WatchHandle {
|
|
|
74
74
|
if (result.warnings.length > 0) {
|
|
75
75
|
for (const w of result.warnings) {
|
|
76
76
|
// biome-ignore lint/suspicious/noConsole: codegen-watcher logs to terminal
|
|
77
|
-
console.warn(`[codegen] ${w.file}:${w.line} — ${w.
|
|
77
|
+
console.warn(`[codegen] ${w.file}:${w.line} — ${w.message}`);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -95,17 +95,19 @@ export function watchAndRegenerate(opts: WatchOptions): WatchHandle {
|
|
|
95
95
|
|
|
96
96
|
try {
|
|
97
97
|
watcher = watch(srcDir, { recursive: true }, (_eventType, filename) => {
|
|
98
|
+
// skip: watcher closed or no filename reported, nothing to act on
|
|
98
99
|
if (closed || !filename) return;
|
|
99
|
-
// node liefert filename relativ zu srcDir, kann aber posix oder
|
|
100
|
+
// skip: node liefert filename relativ zu srcDir, kann aber posix oder
|
|
100
101
|
// windows-style separators haben. Wir prüfen substring-tolerant.
|
|
101
102
|
const normalised = `/${filename.toString().replace(/\\/g, "/")}`;
|
|
103
|
+
// skip: path matches an excluded segment (node_modules/dist/etc.)
|
|
102
104
|
if (SKIP_SUBSTRINGS.some((seg) => normalised.includes(seg))) return;
|
|
103
|
-
// Nur .ts/.tsx interessieren — alles andere (CSS, MD, JSON) hat
|
|
105
|
+
// skip: Nur .ts/.tsx interessieren — alles andere (CSS, MD, JSON) hat
|
|
104
106
|
// keinen Einfluss auf r.defineEvent-Calls.
|
|
105
107
|
if (!normalised.endsWith(".ts") && !normalised.endsWith(".tsx")) return;
|
|
106
|
-
// .d.ts ausgenommen — die kommen meistens vom codegen selbst.
|
|
108
|
+
// skip: .d.ts ausgenommen — die kommen meistens vom codegen selbst.
|
|
107
109
|
if (normalised.endsWith(".d.ts")) return;
|
|
108
|
-
// .test.ts/.test.tsx ausgenommen — Tests definieren keine
|
|
110
|
+
// skip: .test.ts/.test.tsx ausgenommen — Tests definieren keine
|
|
109
111
|
// Production-Features.
|
|
110
112
|
if (normalised.endsWith(".test.ts") || normalised.endsWith(".test.tsx")) return;
|
|
111
113
|
|
|
@@ -127,6 +129,7 @@ export function watchAndRegenerate(opts: WatchOptions): WatchHandle {
|
|
|
127
129
|
|
|
128
130
|
return {
|
|
129
131
|
close: () => {
|
|
132
|
+
// skip: already closed, avoid double-close
|
|
130
133
|
if (closed) return;
|
|
131
134
|
closed = true;
|
|
132
135
|
if (timer) clearTimeout(timer);
|
|
@@ -342,6 +342,7 @@ async function watchDir(
|
|
|
342
342
|
} catch (err) {
|
|
343
343
|
// signal.abort() wirft AbortError aus dem async-iterator; das ist
|
|
344
344
|
// gewollt und kein Fehler. Andere Errors weiterreichen.
|
|
345
|
+
// skip: AbortSignal fired the abort, this is expected teardown not a real error
|
|
345
346
|
if ((err as { name?: string }).name === "AbortError") return;
|
|
346
347
|
throw err;
|
|
347
348
|
}
|
|
@@ -954,6 +955,7 @@ export async function createKumikoServer(
|
|
|
954
955
|
dir,
|
|
955
956
|
async (filename) => {
|
|
956
957
|
const action = classifyChange(filename);
|
|
958
|
+
// skip: file change classified as ignore (test/css/json), nothing to rebuild
|
|
957
959
|
if (action === "ignore") return;
|
|
958
960
|
if (action === "restart") {
|
|
959
961
|
logInfo(
|
package/src/few-shot-corpus.ts
CHANGED
package/src/schema-apply.ts
CHANGED