@cosmicdrift/kumiko-dev-server 0.173.0 → 0.174.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-dev-server",
3
- "version": "0.173.0",
3
+ "version": "0.174.0",
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.173.0",
58
- "@cosmicdrift/kumiko-framework": "0.173.0",
59
- "@cosmicdrift/kumiko-server-runtime": "0.173.0",
57
+ "@cosmicdrift/kumiko-bundled-features": "0.174.0",
58
+ "@cosmicdrift/kumiko-framework": "0.174.0",
59
+ "@cosmicdrift/kumiko-server-runtime": "0.174.0",
60
60
  "ts-morph": "^28.0.0"
61
61
  },
62
62
  "publishConfig": {
@@ -9,6 +9,7 @@ import {
9
9
  createTextField,
10
10
  defineFeature,
11
11
  } from "@cosmicdrift/kumiko-framework/engine";
12
+ import { TestUsers } from "@cosmicdrift/kumiko-framework/stack";
12
13
  import { z } from "zod";
13
14
  import { createKumikoServer, type KumikoServerHandle } from "../create-kumiko-server";
14
15
 
@@ -337,6 +338,32 @@ describe("createKumikoServer extraRoutes-deps", () => {
337
338
  });
338
339
  });
339
340
 
341
+ // framework#1668: extraRoutes must be registered BEFORE onAfterSetup
342
+ // dispatches through stack.http — Hono builds its matcher on first dispatch,
343
+ // and any route registered after that throws. Pins the ordering.
344
+ describe("createKumikoServer — extraRoutes vs. onAfterSetup ordering", () => {
345
+ test("an extraRoutes route stays reachable after onAfterSetup dispatches via stack.http", async () => {
346
+ handle = await createKumikoServer({
347
+ features: [probeFeature],
348
+ port: 0,
349
+ installSignalHandlers: false,
350
+ extraRoutes: (app) => {
351
+ app.get("/probe", (c) => c.json({ ok: true }));
352
+ },
353
+ onAfterSetup: async (stack) => {
354
+ await stack.http.writeOk(
355
+ "dev-server-probe:write:probe-write",
356
+ { note: "onAfterSetup" },
357
+ TestUsers.systemAdmin,
358
+ );
359
+ },
360
+ });
361
+
362
+ const res = await handle.fetch(new Request("http://test/probe"));
363
+ expect(res.status).toBe(200);
364
+ });
365
+ });
366
+
340
367
  describe("createKumikoServer — stylesheet tailwind failure (graceful)", () => {
341
368
  test("missing stylesheet entry boots without CSS — GET /styles.css → 404", async () => {
342
369
  const tmpDir = mkdtempSync(join(tmpdir(), "kumiko-css-fail-"));
@@ -710,6 +710,8 @@ export async function createKumikoServer(
710
710
  // zugreifen kann, und VOR dem Server-Start damit der erste HTTP-Request
711
711
  // bereits gegen einen gefüllten State läuft. Idempotenz ist Caller-
712
712
  // Verantwortung (persistent-DB-Modus läuft es bei jedem Boot).
713
+ // Dispatching through stack.http below builds Hono's matcher — no route
714
+ // may be registered after this point (see extraRoutes above).
713
715
  if (options.onAfterSetup !== undefined) {
714
716
  await options.onAfterSetup(stack);
715
717
  }