nitro-nightly 3.0.1-20260108-220050-08740398 → 3.0.1-20260113-184553-f312cfbe

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.
@@ -18593,7 +18593,7 @@ function replace(options) {
18593
18593
  }
18594
18594
 
18595
18595
  //#endregion
18596
- //#region node_modules/.pnpm/unwasm@0.5.2/node_modules/unwasm/dist/plugin/index.mjs
18596
+ //#region node_modules/.pnpm/unwasm@0.5.3/node_modules/unwasm/dist/plugin/index.mjs
18597
18597
  var __create = Object.create;
18598
18598
  var __defProp = Object.defineProperty;
18599
18599
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -24326,7 +24326,7 @@ export function createLazyWasmModule(_instantiator) {
24326
24326
  }
24327
24327
  `;
24328
24328
  }
24329
- const WASM_ID_RE = /\.wasm\??.*$/i;
24329
+ const WASM_ID_RE = /\.wasm(?:\?.*)?$/i;
24330
24330
  function unwasm(opts) {
24331
24331
  const assets = Object.create(null);
24332
24332
  const _parseCache = Object.create(null);
@@ -38,7 +38,7 @@ function escapeRegex(str) {
38
38
  }
39
39
 
40
40
  //#endregion
41
- //#region node_modules/.pnpm/@hiogawa+vite-plugin-fullstack@0.0.11_vite@8.0.0-beta.6_@types+node@25.0.3_jiti@2.6.1_tsx@4.21.0_yaml@2.8.2_/node_modules/@hiogawa/vite-plugin-fullstack/dist/plugin-B4MlD0Bd.js
41
+ //#region node_modules/.pnpm/@hiogawa+vite-plugin-fullstack@0.0.11_vite@8.0.0-beta.7_@types+node@25.0.8_jiti@2.6.1_tsx@4.21.0_yaml@2.8.2_/node_modules/@hiogawa/vite-plugin-fullstack/dist/plugin-B4MlD0Bd.js
42
42
  function parseIdQuery(id) {
43
43
  if (!id.includes("?")) return {
44
44
  filename: id,
@@ -623,7 +623,7 @@ function assetsURLDev(url, config) {
623
623
  }
624
624
 
625
625
  //#endregion
626
- //#region node_modules/.pnpm/@hiogawa+vite-plugin-fullstack@0.0.11_vite@8.0.0-beta.6_@types+node@25.0.3_jiti@2.6.1_tsx@4.21.0_yaml@2.8.2_/node_modules/@hiogawa/vite-plugin-fullstack/dist/runtime.js
626
+ //#region node_modules/.pnpm/@hiogawa+vite-plugin-fullstack@0.0.11_vite@8.0.0-beta.7_@types+node@25.0.8_jiti@2.6.1_tsx@4.21.0_yaml@2.8.2_/node_modules/@hiogawa/vite-plugin-fullstack/dist/runtime.js
627
627
  var runtime_exports = /* @__PURE__ */ __exportAll({ mergeAssets: () => mergeAssets });
628
628
  function mergeAssets(...args) {
629
629
  const js = uniqBy(args.flatMap((h) => h.js), (a) => a.href);
@@ -1,6 +1,6 @@
1
1
  import "#nitro/virtual/polyfills";
2
2
  import type * as CF from "@cloudflare/workers-types";
3
- import type { ExportedHandler } from "@cloudflare/workers-types";
3
+ import type { ServerRuntimeContext } from "srvx";
4
4
  type MaybePromise<T> = T | Promise<T>;
5
5
  export declare function createHandler<Env>(hooks: {
6
6
  fetch: (...params: [...Parameters<NonNullable<ExportedHandler<Env>["fetch"]>>, url: URL, cfContextExtras: any]) => MaybePromise<Response | CF.Response | undefined>;
@@ -12,5 +12,5 @@ export declare function createHandler<Env>(hooks: {
12
12
  tail(traces, env, context);
13
13
  trace(traces, env, context);
14
14
  };
15
- export declare function fetchHandler(cfReq: Request | CF.Request, env: unknown, context: CF.ExecutionContext | DurableObjectState, url: URL, nitroApp, ctxExt: any);
15
+ export declare function augmentReq(cfReq: Request | CF.Request, ctx: NonNullable<ServerRuntimeContext["cloudflare"]>);
16
16
  export {};
@@ -6,6 +6,11 @@ export function createHandler(hooks) {
6
6
  const nitroHooks = useNitroHooks();
7
7
  return {
8
8
  async fetch(request, env, context) {
9
+ globalThis.__env__ = env;
10
+ augmentReq(request, {
11
+ env,
12
+ context
13
+ });
9
14
  const ctxExt = {};
10
15
  const url = new URL(request.url);
11
16
  // Preset-specific logic
@@ -15,7 +20,7 @@ export function createHandler(hooks) {
15
20
  return res;
16
21
  }
17
22
  }
18
- return fetchHandler(request, env, context, url, nitroApp, ctxExt);
23
+ return await nitroApp.fetch(request);
19
24
  },
20
25
  scheduled(controller, env, context) {
21
26
  globalThis.__env__ = env;
@@ -70,16 +75,12 @@ export function createHandler(hooks) {
70
75
  }
71
76
  };
72
77
  }
73
- export async function fetchHandler(cfReq, env, context, url = new URL(cfReq.url), nitroApp = useNitroApp(), ctxExt) {
74
- // Expose latest env to the global context
75
- globalThis.__env__ = env;
76
- // srvx compatibility
78
+ export function augmentReq(cfReq, ctx) {
77
79
  const req = cfReq;
78
80
  req.runtime ??= { name: "cloudflare" };
79
- req.runtime.cloudflare ??= {
80
- context,
81
- env
81
+ req.runtime.cloudflare = {
82
+ ...req.runtime.cloudflare,
83
+ ...ctx
82
84
  };
83
- req.waitUntil = context.waitUntil.bind(context);
84
- return nitroApp.fetch(req);
85
+ req.waitUntil = ctx.context?.waitUntil.bind(ctx.context);
85
86
  }
@@ -1,7 +1,7 @@
1
1
  import "#nitro/virtual/polyfills";
2
2
  import { DurableObject } from "cloudflare:workers";
3
3
  import wsAdapter from "crossws/adapters/cloudflare";
4
- import { createHandler, fetchHandler } from "./_module-handler.mjs";
4
+ import { createHandler, augmentReq } from "./_module-handler.mjs";
5
5
  import { useNitroApp, useNitroHooks } from "nitro/app";
6
6
  import { isPublicAssetURL } from "#nitro/virtual/public-assets";
7
7
  import { resolveWebsocketHooks } from "#nitro/runtime/app";
@@ -48,12 +48,14 @@ export class $DurableObject extends DurableObject {
48
48
  }
49
49
  }
50
50
  fetch(request) {
51
+ augmentReq(request, {
52
+ env: this.env,
53
+ context: this.ctx
54
+ });
51
55
  if (hasWebSocket && request.headers.get("upgrade") === "websocket") {
52
56
  return ws.handleDurableUpgrade(this, request);
53
57
  }
54
- // Main handler
55
- const url = new URL(request.url);
56
- return fetchHandler(request, this.env, this.ctx, url, nitroApp, { durable: this });
58
+ return nitroApp.fetch(request);
57
59
  }
58
60
  alarm() {
59
61
  this.ctx.waitUntil(nitroHooks.callHook("cloudflare:durable:alarm", this) || Promise.resolve());
@@ -5,14 +5,14 @@ import { createHandler } from "./_module-handler.mjs";
5
5
  import { resolveWebsocketHooks } from "#nitro/runtime/app";
6
6
  import { hasWebSocket } from "#nitro/virtual/feature-flags";
7
7
  const ws = hasWebSocket ? wsAdapter({ resolve: resolveWebsocketHooks }) : undefined;
8
- export default createHandler({ fetch(request, env, context, url) {
8
+ export default createHandler({ fetch(cfRequest, env, context, url) {
9
9
  // Static assets fallback (optional binding)
10
10
  if (env.ASSETS && isPublicAssetURL(url.pathname)) {
11
- return env.ASSETS.fetch(request);
11
+ return env.ASSETS.fetch(cfRequest);
12
12
  }
13
13
  // Websocket upgrade
14
14
  // https://crossws.unjs.io/adapters/cloudflare
15
- if (hasWebSocket && request.headers.get("upgrade") === "websocket") {
16
- return ws.handleUpgrade(request, env, context);
15
+ if (hasWebSocket && cfRequest.headers.get("upgrade") === "websocket") {
16
+ return ws.handleUpgrade(cfRequest, env, context);
17
17
  }
18
18
  } });
@@ -5,18 +5,15 @@ import { isPublicAssetURL } from "#nitro/virtual/public-assets";
5
5
  import { runCronTasks } from "#nitro/runtime/task";
6
6
  import { resolveWebsocketHooks } from "#nitro/runtime/app";
7
7
  import { hasWebSocket } from "#nitro/virtual/feature-flags";
8
+ import { augmentReq } from "./_module-handler.mjs";
8
9
  const nitroApp = useNitroApp();
9
10
  const ws = hasWebSocket ? wsAdapter({ resolve: resolveWebsocketHooks }) : undefined;
10
11
  export default {
11
12
  async fetch(cfReq, env, context) {
12
- // srvx compatibility
13
- const req = cfReq;
14
- req.runtime ??= { name: "cloudflare" };
15
- req.runtime.cloudflare ??= {
16
- context,
17
- env
18
- };
19
- req.waitUntil = context.waitUntil.bind(context);
13
+ augmentReq(cfReq, {
14
+ env,
15
+ context
16
+ });
20
17
  // Websocket upgrade
21
18
  // https://crossws.unjs.io/adapters/cloudflare
22
19
  if (hasWebSocket && cfReq.headers.get("upgrade") === "websocket") {
@@ -26,9 +23,7 @@ export default {
26
23
  if (env.ASSETS && isPublicAssetURL(url.pathname)) {
27
24
  return env.ASSETS.fetch(cfReq);
28
25
  }
29
- // Expose latest env to the global context
30
- globalThis.__env__ = env;
31
- return nitroApp.fetch(req);
26
+ return nitroApp.fetch(cfReq);
32
27
  },
33
28
  scheduled(event, env, context) {
34
29
  if (import.meta._tasks) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitro-nightly",
3
- "version": "3.0.1-20260108-220050-08740398",
3
+ "version": "3.0.1-20260113-184553-f312cfbe",
4
4
  "description": "Build and Deploy Universal JavaScript Servers",
5
5
  "homepage": "https://nitro.build",
6
6
  "repository": "nitrojs/nitro",
@@ -65,20 +65,20 @@
65
65
  "db0": "^0.3.4",
66
66
  "h3": "^2.0.1-rc.7",
67
67
  "jiti": "^2.6.1",
68
- "nf3": "^0.3.3",
68
+ "nf3": "^0.3.4",
69
69
  "ofetch": "^2.0.0-alpha.3",
70
70
  "ohash": "^2.0.11",
71
- "oxc-minify": "^0.107.0",
72
- "oxc-transform": "^0.107.0",
71
+ "oxc-minify": "^0.108.0",
72
+ "oxc-transform": "^0.108.0",
73
73
  "srvx": "^0.10.0",
74
- "undici": "^7.17.0",
74
+ "undici": "^7.18.2",
75
75
  "unenv": "^2.0.0-rc.24",
76
76
  "unstorage": "^2.0.0-alpha.5"
77
77
  },
78
78
  "devDependencies": {
79
79
  "@azure/functions": "^3.5.1",
80
80
  "@azure/static-web-apps-cli": "^2.0.7",
81
- "@cloudflare/workers-types": "^4.20260103.0",
81
+ "@cloudflare/workers-types": "^4.20260113.0",
82
82
  "@deno/types": "^0.0.1",
83
83
  "@hiogawa/vite-plugin-fullstack": "^0.0.11",
84
84
  "@netlify/edge-functions": "^3.0.3",
@@ -89,17 +89,17 @@
89
89
  "@rollup/plugin-json": "^6.1.0",
90
90
  "@rollup/plugin-node-resolve": "^16.0.3",
91
91
  "@rollup/plugin-replace": "^6.0.3",
92
- "@scalar/api-reference": "^1.40.9",
92
+ "@scalar/api-reference": "^1.43.3",
93
93
  "@types/aws-lambda": "^8.10.159",
94
94
  "@types/estree": "^1.0.8",
95
95
  "@types/etag": "^1.8.4",
96
96
  "@types/fs-extra": "^11.0.4",
97
97
  "@types/http-proxy": "^1.17.17",
98
- "@types/node": "^25.0.3",
98
+ "@types/node": "^25.0.8",
99
99
  "@types/node-fetch": "^2.6.13",
100
100
  "@types/semver": "^7.7.1",
101
101
  "@types/xml2js": "^0.4.14",
102
- "@vitest/coverage-v8": "^4.0.16",
102
+ "@vitest/coverage-v8": "^4.0.17",
103
103
  "automd": "^0.4.2",
104
104
  "c12": "^3.3.3",
105
105
  "changelogen": "^0.6.2",
@@ -129,10 +129,10 @@
129
129
  "knitwork": "^1.3.0",
130
130
  "magic-string": "^0.30.21",
131
131
  "mime": "^4.1.0",
132
- "miniflare": "^4.20251217.0",
132
+ "miniflare": "^4.20260111.0",
133
133
  "mlly": "^1.8.0",
134
134
  "nypm": "^0.6.2",
135
- "obuild": "^0.4.13",
135
+ "obuild": "^0.4.14",
136
136
  "pathe": "^2.0.3",
137
137
  "perfect-debounce": "^2.0.0",
138
138
  "pkg-types": "^2.3.0",
@@ -157,11 +157,11 @@
157
157
  "unctx": "^2.5.0",
158
158
  "unimport": "^5.6.0",
159
159
  "untyped": "^2.0.0",
160
- "unwasm": "^0.5.2",
161
- "vite": "8.0.0-beta.6",
160
+ "unwasm": "^0.5.3",
161
+ "vite": "8.0.0-beta.7",
162
162
  "vite7": "npm:vite@^7.3.1",
163
- "vitest": "^4.0.16",
164
- "wrangler": "~4.54.0",
163
+ "vitest": "^4.0.17",
164
+ "wrangler": "~4.59.1",
165
165
  "xml2js": "^0.6.2",
166
166
  "youch": "4.1.0-beta.13",
167
167
  "youch-core": "^0.3.3"