@junejs/server 0.0.11 → 0.0.13

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": "@junejs/server",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
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",
@@ -30,8 +30,8 @@
30
30
  "typecheck": "tsc --noEmit"
31
31
  },
32
32
  "dependencies": {
33
- "@junejs/core": "0.0.11",
34
- "@junejs/db": "0.0.11",
33
+ "@junejs/core": "0.0.13",
34
+ "@junejs/db": "0.0.13",
35
35
  "marked": "^18.0.5",
36
36
  "rolldown": "^1.1.0",
37
37
  "postcss": "^8.4.0",
package/src/adapter.ts CHANGED
@@ -151,7 +151,12 @@ export function vercel(opts?: { regions?: string[] }): JuneAdapter {
151
151
  return {
152
152
  name: "vercel",
153
153
  capabilities: { runtime: "edge", persistentConnections: false, assets: "platform" },
154
- conditions: ["edge-light", "worker", "browser", "import", "default"],
154
+ // NO "worker"/"browser": react-dom's ./server exports map "worker" → the
155
+ // BROWSER SSR build (server.browser.js), listed BEFORE "edge-light", so
156
+ // requesting "worker" pulls the wrong renderer and the edge function crashes
157
+ // at invocation. "edge-light" → server.edge.js (the same build workerd gets
158
+ // via "workerd"). Mirrors workers()'s shape: <runtime>, edge, import, default.
159
+ conditions: ["edge-light", "edge", "import", "default"],
155
160
 
156
161
  validate({ plan }) {
157
162
  if (plan.db) {
package/src/build.ts CHANGED
@@ -417,6 +417,12 @@ ${adapterEntry.wrap("pipeline")}
417
417
  input: entryFile,
418
418
  cwd: appRoot,
419
419
  platform: "browser", // workerd's surface is web-standard; no node:* in the graph
420
+ // Bake NODE_ENV=production at BUILD (the same the client bundle does), so React's
421
+ // server entry folds to its production build (smaller/faster, no dev warnings) and
422
+ // the dev-only code tree-shakes. Build-time on purpose: runtime process.env.NODE_ENV
423
+ // differs by target (Vercel sets it; workerd may not), so baking it makes the output
424
+ // deterministic and target-agnostic. `june dev` doesn't use this path.
425
+ transform: { define: { "process.env.NODE_ENV": JSON.stringify("production") } },
420
426
  plugins: [rolldownCssModulesPlugin(cssModuleMaps)], // .module.css → scoped class map
421
427
  external: (id: string) => {
422
428
  // Binary assets stay external — wrangler's CompiledWasm/Data rules own them.