@junejs/server 0.0.5 → 0.0.6

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 (2) hide show
  1. package/package.json +4 -6
  2. package/src/app.ts +11 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junejs/server",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "June host adapters + dev server. Host-coupled; depends on the pure @junejs/core contract layer.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -29,16 +29,14 @@
29
29
  "typecheck": "tsc --noEmit"
30
30
  },
31
31
  "dependencies": {
32
- "@junejs/core": "0.0.5",
33
- "marked": "^18.0.5"
32
+ "@junejs/core": "0.0.6",
33
+ "marked": "^18.0.5",
34
+ "rolldown": "^1.1.0"
34
35
  },
35
36
  "peerDependencies": {
36
37
  "react": "^19.2.0",
37
38
  "react-dom": "^19.2.0"
38
39
  },
39
- "devDependencies": {
40
- "rolldown": "^1.1.0"
41
- },
42
40
  "repository": {
43
41
  "type": "git",
44
42
  "url": "https://github.com/junebuild/june"
package/src/app.ts CHANGED
@@ -138,6 +138,17 @@ export function createApp({ appDir: appDirInput, config = {} }: CreateAppOptions
138
138
  new Response(code, {
139
139
  headers: { "content-type": "text/javascript; charset=utf-8" },
140
140
  }),
141
+ (err: unknown) => {
142
+ // A rejected bundle must answer, not hang the request (Bun.serve
143
+ // times the handler out) — and must not be memoized, or the error
144
+ // outlives its cause.
145
+ clientBundle = undefined;
146
+ console.error("[june] client bundle failed:", err);
147
+ return new Response(`client bundle failed: ${err instanceof Error ? err.message : String(err)}\n`, {
148
+ status: 500,
149
+ headers: { "content-type": "text/plain; charset=utf-8" },
150
+ });
151
+ },
141
152
  );
142
153
  }
143
154
  return runWithTrace(newTrace(), async () => (await getPipeline()).fetch(request));