@cosmicdrift/kumiko-dev-server 0.387.0 → 0.388.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.
Files changed (42) hide show
  1. package/dist/build-server-bundle.d.ts +1 -1
  2. package/dist/build-server-bundle.js +2 -2
  3. package/dist/create-kumiko-server-client-bundles.d.ts +21 -0
  4. package/dist/create-kumiko-server-client-bundles.js +97 -0
  5. package/dist/create-kumiko-server-html.d.ts +21 -0
  6. package/dist/create-kumiko-server-html.js +132 -0
  7. package/dist/create-kumiko-server-public-files.d.ts +6 -0
  8. package/dist/create-kumiko-server-public-files.js +96 -0
  9. package/dist/create-kumiko-server-reload.d.ts +14 -0
  10. package/dist/create-kumiko-server-reload.js +73 -0
  11. package/dist/create-kumiko-server-routes.d.ts +16 -0
  12. package/dist/create-kumiko-server-routes.js +206 -0
  13. package/dist/create-kumiko-server-shutdown.d.ts +14 -0
  14. package/dist/create-kumiko-server-shutdown.js +72 -0
  15. package/dist/create-kumiko-server-stack.d.ts +12 -0
  16. package/dist/create-kumiko-server-stack.js +101 -0
  17. package/dist/create-kumiko-server-stylesheet.d.ts +10 -0
  18. package/dist/create-kumiko-server-stylesheet.js +137 -0
  19. package/dist/create-kumiko-server-watcher.d.ts +22 -0
  20. package/dist/create-kumiko-server-watcher.js +155 -0
  21. package/dist/create-kumiko-server.d.ts +6 -20
  22. package/dist/create-kumiko-server.js +59 -1046
  23. package/dist/dev-server-runtime.d.ts +5 -0
  24. package/dist/dev-server-runtime.js +11 -0
  25. package/dist/index.d.ts +3 -1
  26. package/dist/index.js +3 -1
  27. package/dist/managed-files/app-jobs.js +1 -1
  28. package/dist/managed-files/check.js +1 -1
  29. package/dist/run-dev-app-auth.d.ts +38 -0
  30. package/dist/run-dev-app-auth.js +155 -0
  31. package/dist/run-dev-app-config.d.ts +26 -0
  32. package/dist/run-dev-app-config.js +185 -0
  33. package/dist/run-dev-app-server-options.d.ts +13 -0
  34. package/dist/run-dev-app-server-options.js +49 -0
  35. package/dist/run-dev-app.d.ts +4 -4
  36. package/dist/run-dev-app.js +86 -459
  37. package/dist/schema-apply.d.ts +1 -1
  38. package/dist/schema-apply.js +4 -4
  39. package/dist/write-server-lockfile.js +23 -16
  40. package/package.json +9 -9
  41. package/src/changes.json +30 -0
  42. package/templates/managed/ci-public.yml.template +4 -0
@@ -17,29 +17,36 @@ function findSeedLockfile(startDir) {
17
17
  dir = parent;
18
18
  }
19
19
  }
20
- export async function writeServerLockfile(options) {
21
- const outDir = resolve(options.outDir);
22
- const lockfile = join(outDir, "bun.lock");
23
- const seedLockfile = findSeedLockfile(options.cwd);
24
- if (seedLockfile !== undefined)
25
- await copyFile(seedLockfile, lockfile);
20
+ async function runBun(args, cwd) {
26
21
  // process.execPath: the lock format has to match the Bun that built the bundle.
27
- const install = Bun.spawn({
28
- cmd: [process.execPath, "install", "--lockfile-only"],
29
- cwd: outDir,
22
+ const proc = Bun.spawn({
23
+ cmd: [process.execPath, ...args],
24
+ cwd,
30
25
  stdout: "pipe",
31
26
  stderr: "pipe",
32
27
  });
33
28
  const [exitCode, stdout, stderr] = await Promise.all([
34
- install.exited,
35
- new Response(install.stdout).text(),
36
- new Response(install.stderr).text(),
29
+ proc.exited,
30
+ new Response(proc.stdout).text(),
31
+ new Response(proc.stderr).text(),
37
32
  ]);
38
- if (exitCode !== 0) {
39
- throw new Error(`bun install --lockfile-only failed in ${outDir} (exit ${exitCode}); shipping dist-server without a lockfile would leave runtime versions unpinned.\n${stderr.trim() || stdout.trim()}`);
33
+ return { exitCode, output: stderr.trim() || stdout.trim() };
34
+ }
35
+ export async function writeServerLockfile(options) {
36
+ const outDir = resolve(options.outDir);
37
+ const lockfile = join(outDir, "bun.lock");
38
+ const seedLockfile = findSeedLockfile(options.cwd);
39
+ if (seedLockfile !== undefined)
40
+ await copyFile(seedLockfile, lockfile);
41
+ const install = await runBun(["install", "--lockfile-only"], outDir);
42
+ if (install.exitCode !== 0) {
43
+ throw new Error(`bun install --lockfile-only failed in ${outDir} (exit ${install.exitCode}); shipping dist-server without a lockfile would leave runtime versions unpinned.\n${install.output}`);
40
44
  }
41
- if (!existsSync(lockfile)) {
42
- throw new Error(`bun install --lockfile-only did not write ${lockfile}`);
45
+ // A seeded copy exists before the install, so file presence proves nothing: replay the
46
+ // runtime stage's frozen install to catch a lock that never re-resolved for this package.json.
47
+ const frozen = await runBun(["install", "--production", "--frozen-lockfile", "--lockfile-only"], outDir);
48
+ if (frozen.exitCode !== 0) {
49
+ throw new Error(`${lockfile} does not satisfy ${join(outDir, "package.json")} (frozen install exit ${frozen.exitCode}); the runtime image build would fail.\n${frozen.output}`);
43
50
  }
44
51
  return seedLockfile === undefined
45
52
  ? { mode: "resolved", lockfile }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-dev-server",
3
- "version": "0.387.0",
3
+ "version": "0.388.0",
4
4
  "description": "Dev-tooling for Kumiko apps: local dev-server bootstrap (runDevApp), scaffolding. 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": "MIT",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -77,14 +77,14 @@
77
77
  "kumiko-upgrade": "./bin/kumiko-upgrade.ts"
78
78
  },
79
79
  "dependencies": {
80
- "@cosmicdrift/kumiko-bundled-features": "0.387.0",
81
- "@cosmicdrift/kumiko-framework": "0.387.0",
82
- "@cosmicdrift/kumiko-renderer": "0.387.0",
83
- "@cosmicdrift/kumiko-renderer-mail-html": "0.387.0",
84
- "@cosmicdrift/kumiko-guards": "0.387.0",
85
- "@cosmicdrift/kumiko-server-runtime": "0.387.0",
86
- "@cosmicdrift/kumiko-testing": "0.387.0",
87
- "@cosmicdrift/kumiko-types": "0.387.0",
80
+ "@cosmicdrift/kumiko-bundled-features": "0.388.0",
81
+ "@cosmicdrift/kumiko-framework": "0.388.0",
82
+ "@cosmicdrift/kumiko-renderer": "0.388.0",
83
+ "@cosmicdrift/kumiko-renderer-mail-html": "0.388.0",
84
+ "@cosmicdrift/kumiko-guards": "0.388.0",
85
+ "@cosmicdrift/kumiko-server-runtime": "0.388.0",
86
+ "@cosmicdrift/kumiko-testing": "0.388.0",
87
+ "@cosmicdrift/kumiko-types": "0.388.0",
88
88
  "bun-types": "^1.3.13",
89
89
  "ts-morph": "^28.0.0",
90
90
  "zod": "^4.4.3"
package/src/changes.json CHANGED
@@ -1,4 +1,34 @@
1
1
  [
2
+ {
3
+ "version": "0.388.0",
4
+ "type": "improvement",
5
+ "title": "English buildServerBundle errors",
6
+ "detail": "The errors for a missing bin/main.ts and a missing bin/kumiko.ts in buildServerBundle are now English."
7
+ },
8
+ {
9
+ "version": "0.388.0",
10
+ "type": "improvement",
11
+ "title": "Named boot phases for the dev server",
12
+ "detail": "createKumikoServer now reads as a list of phases: client bundles, Tailwind stylesheet, HTML templates, stack boot, background runners, fetch handler, HTTP server, shutdown, file watchers and signal handlers. Each phase lives in its own create-kumiko-server-*.ts file. Request routing is a route table instead of one if chain, and the file watcher classifies changes through suffix and directory tables. Responses, headers, cookies, the reload stream, log lines, exit codes and the start and stop order stay the same. PROD_BUNDLES_ENV, STYLESHEET_WATCH_ENV and resolveStylesheet are still exported from the package index."
13
+ },
14
+ {
15
+ "version": "0.388.0",
16
+ "type": "improvement",
17
+ "title": "runDevApp split into boot phases",
18
+ "detail": "runDevApp() keeps its signature and behavior. Config resolution and boot validation (run-dev-app-config.ts), late-bound tier, session and token wiring plus the onAfterSetup step (run-dev-app-auth.ts) and the createKumikoServer options (run-dev-app-server-options.ts) are separate phases. Steps shared with prod come from @cosmicdrift/kumiko-server-runtime/boot/shared-boot-steps. A new unit test covers the late-bound tier resolver's boot-order guard and trialGate delegation."
19
+ },
20
+ {
21
+ "version": "0.388.0",
22
+ "type": "fix",
23
+ "title": "runDevApp releases the KMS on any boot failure; server lockfile is verified",
24
+ "detail": "runDevApp closes the KMS wiring when a boot gate throws before the server is created. Stopping one app no longer replaces the session, MFA and PAT revokers a newer app bound on the same feature instances: the bind functions of sessions, auth-mfa and personal-access-tokens return an unbind that only clears its own binding. writeServerLockfile replays the frozen install the runtime image runs, so a lock that did not re-resolve fails in kumiko-build."
25
+ },
26
+ {
27
+ "version": "0.388.0",
28
+ "type": "fix",
29
+ "title": "Managed CI, app jobs and static config parsing",
30
+ "detail": "The public ci.yml sets MEILI_URL and MEILI_MASTER_KEY for the Meilisearch service. App-owned workflow jobs with a trailing comment or a quoted name survive a sync. kumiko.config.ts with shorthand or spread siblings next to literal ports is read as defined instead of invalid."
31
+ },
2
32
  {
3
33
  "version": "0.379.0",
4
34
  "type": "fix",
@@ -95,6 +95,10 @@ jobs:
95
95
  TEST_DATABASE_URL: postgresql://kumiko:kumiko@localhost:15432/kumiko_test
96
96
  REDIS_URL: redis://localhost:16379
97
97
  JWT_SECRET: testtesttesttesttesttesttesttest
98
+ {{#meilisearch}}
99
+ MEILI_URL: http://localhost:17700
100
+ MEILI_MASTER_KEY: kumiko-dev-key
101
+ {{/meilisearch}}
98
102
  run: bun run test:integration
99
103
 
100
104
  # Build on main only; the rollout runs through the manual release workflow.