@cosmicdrift/kumiko-dev-server 0.219.0 → 0.220.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.219.0",
3
+ "version": "0.220.1",
4
4
  "description": "Dev-tooling for Kumiko apps: local dev-server bootstrap (runDevApp), scaffolding, codegen. Its compose-stacks/env-schema subpaths are consumed at prod boot too — see @cosmicdrift/kumiko-server-runtime for the prod runner itself.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -59,9 +59,9 @@
59
59
  "kumiko-upgrade": "./bin/kumiko-upgrade.ts"
60
60
  },
61
61
  "dependencies": {
62
- "@cosmicdrift/kumiko-bundled-features": "0.219.0",
63
- "@cosmicdrift/kumiko-framework": "0.219.0",
64
- "@cosmicdrift/kumiko-server-runtime": "0.219.0",
62
+ "@cosmicdrift/kumiko-bundled-features": "0.220.1",
63
+ "@cosmicdrift/kumiko-framework": "0.220.1",
64
+ "@cosmicdrift/kumiko-server-runtime": "0.220.1",
65
65
  "ts-morph": "^28.0.0"
66
66
  },
67
67
  "publishConfig": {
@@ -8,11 +8,13 @@ import { frameworkCoreEnvSchema as envSchemaViaRelative } from "../env-schema";
8
8
  // `// @runtime <kind>`) — guards against a reformat of compose-stacks.ts
9
9
  // pushing the directive out of that window. Doesn't catch infra changing
10
10
  // the window/regex itself; that lives in the infra repo's own tests.
11
+ const ALL_RUNTIMES = new Set(["runtime", "client", "dev", "tooling", "test"]);
12
+
11
13
  function classifyByDirective(filePath: string): string | null {
12
14
  const head = readFileSync(filePath, "utf8").slice(0, 600);
13
15
  for (const line of head.split("\n").slice(0, 8)) {
14
16
  const match = line.match(/\/\/\s*@runtime\s+(\w+)/);
15
- if (match) return match[1] ?? null;
17
+ if (match && ALL_RUNTIMES.has(match[1] ?? "")) return match[1] ?? null;
16
18
  }
17
19
  return null;
18
20
  }
@@ -211,6 +211,9 @@ export type RunDevAppOptions = {
211
211
  /** Extra-AppContext-Keys. `templateResolver` (immer) + `secrets` (wenn das
212
212
  * secrets-Feature gemountet ist) + `configResolver` (auth-mode) werden
213
213
  * automatisch ergänzt — App-Werte gewinnen. Symmetrisch zu runProdApp. */
214
+ /** Boot default locale (BCP-47) for ctx.locale when the request carries
215
+ * no locale signal. Merged into AppContext before extraContext (app wins). */
216
+ readonly defaultLocale?: string;
214
217
  readonly extraContext?: CreateKumikoServerOptions["extraContext"];
215
218
  /** MasterKeyProvider für die auto-verdrahtete `ctx.secrets`. Default:
216
219
  * `createEnvMasterKeyProvider`. Override für KMS-Backends. Nur relevant
@@ -407,7 +410,11 @@ export async function runDevApp(options: RunDevAppOptions): Promise<KumikoServer
407
410
  crypto: bootCrypto,
408
411
  });
409
412
  const base = typeof cfgExtra === "function" ? cfgExtra(deps) : (cfgExtra ?? {});
410
- return { ...boot, ...base };
413
+ return {
414
+ ...boot,
415
+ ...(options.defaultLocale !== undefined && { defaultLocale: options.defaultLocale }),
416
+ ...base,
417
+ };
411
418
  };
412
419
 
413
420
  // Sessions: late-bound holder — resolveSessionStore needs concrete db+
@@ -421,7 +421,7 @@ function renderMain(appName: string): string {
421
421
  const sf = project.createSourceFile("main.ts", "");
422
422
 
423
423
  sf.addImportDeclaration({
424
- moduleSpecifier: "@cosmicdrift/kumiko-dev-server",
424
+ moduleSpecifier: "@cosmicdrift/kumiko-dev-server/env-schema",
425
425
  namedImports: ["frameworkCoreEnvSchema"],
426
426
  });
427
427
  sf.addImportDeclaration({