@cosmicdrift/kumiko-dev-server 0.339.0 → 0.340.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.
@@ -15,7 +15,7 @@ export type BuildServerBundleEntry = {
15
15
  };
16
16
  export type BuildServerBundleResult = {
17
17
  readonly outDir: string;
18
- /** Benannte Entry-Files (server.js, ggf. kumiko.js). */
18
+ /** Named entry files (server.js, plus kumiko.js and worker.js when present). */
19
19
  readonly entries: readonly BuildServerBundleEntry[];
20
20
  /** Geteilte Framework-Chunks (von splitting). */
21
21
  readonly chunks: readonly BuildServerBundleEntry[];
@@ -8,18 +8,20 @@
8
8
  // bin/main.ts → dist-server/server.js (App-Boot, ruft runProdApp)
9
9
  // <repo>/bin/kumiko.ts → dist-server/kumiko.js (Migrate-CLI: `schema apply`,
10
10
  // gefunden via walk-up bis bin/kumiko.ts)
11
+ // bin/worker.ts → dist-server/worker.js (optional, next to bin/main.ts:
12
+ // background worker as its own process from the same image)
11
13
  // dist-server/package.json → runtime-deps mit gepinnten Versionen
12
14
  //
13
- // Beide Entries werden in EINEM Bun.build-Call mit `splitting` gebaut: das
14
- // Framework landet als geteilte chunk-*.js, server.js + kumiko.js sind schlanke
15
- // Entries die sie importieren — statt das Framework pro Entry neu zu inlinen
16
- // (vorher ~14 MB × N separate Bundles).
15
+ // All entries are built in ONE Bun.build call with `splitting`: the framework
16
+ // lands once as shared chunk-*.js and server.js, kumiko.js and worker.js are
17
+ // thin entries importing it. Separate bundles would inline ~14 MB per entry.
17
18
  //
18
19
  // Output:
19
20
  //
20
21
  // dist-server/
21
22
  // server.js ← App-Boot-Entry
22
23
  // kumiko.js ← Migrate-CLI-Entry (wenn bin/kumiko.ts gefunden)
24
+ // worker.js ← worker entry (if bin/worker.ts sits next to main.ts)
23
25
  // chunk-*.js ← geteilte Framework-Chunks
24
26
  // package.json ← runtime-deps mit gepinnten Versionen
25
27
  //
@@ -105,7 +107,12 @@ export async function buildServerBundle(options = {}) {
105
107
  await mkdir(outDir, { recursive: true });
106
108
  // Ein Bun.build-Call mit allen Entries + splitting → das Framework wird
107
109
  // einmal als shared chunk abgelegt statt pro Entry inlined.
108
- const entrypoints = kumikoCli ? [serverEntry, kumikoCli] : [serverEntry];
110
+ const workerEntry = join(dirname(serverEntry), "worker.ts");
111
+ const entrypoints = [
112
+ serverEntry,
113
+ ...(kumikoCli ? [kumikoCli] : []),
114
+ ...(existsSync(workerEntry) ? [workerEntry] : []),
115
+ ];
109
116
  const result = await Bun.build({
110
117
  entrypoints,
111
118
  outdir: outDir,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-dev-server",
3
- "version": "0.339.0",
3
+ "version": "0.340.0",
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>",
@@ -64,11 +64,11 @@
64
64
  "kumiko-upgrade": "./bin/kumiko-upgrade.ts"
65
65
  },
66
66
  "dependencies": {
67
- "@cosmicdrift/kumiko-bundled-features": "0.339.0",
68
- "@cosmicdrift/kumiko-framework": "0.339.0",
69
- "@cosmicdrift/kumiko-headless": "0.339.0",
70
- "@cosmicdrift/kumiko-renderer-web": "0.339.0",
71
- "@cosmicdrift/kumiko-server-runtime": "0.339.0",
67
+ "@cosmicdrift/kumiko-bundled-features": "0.340.0",
68
+ "@cosmicdrift/kumiko-framework": "0.340.0",
69
+ "@cosmicdrift/kumiko-headless": "0.340.0",
70
+ "@cosmicdrift/kumiko-renderer-web": "0.340.0",
71
+ "@cosmicdrift/kumiko-server-runtime": "0.340.0",
72
72
  "bun-types": "^1.3.13",
73
73
  "ts-morph": "^28.0.0",
74
74
  "zod": "^4.4.3"
package/src/changes.json CHANGED
@@ -1,4 +1,10 @@
1
1
  [
2
+ {
3
+ "version": "0.340.0",
4
+ "type": "improvement",
5
+ "title": "Server bundle includes an optional worker entry",
6
+ "detail": "When `bin/worker.ts` sits next to `bin/main.ts`, `buildServerBundle` builds it in the same split build as `dist-server/worker.js`. Start a separate worker process from the same image with `exec bun run worker.js`."
7
+ },
2
8
  {
3
9
  "version": "0.338.0",
4
10
  "type": "fix",