nitropack-nightly 2.11.7-20250318-111257.10c8e534 → 2.11.7-20250318-123444.96e0b73b

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.
@@ -1,3 +1,3 @@
1
- const version = "2.11.7-20250318-111257.10c8e534";
1
+ const version = "2.11.7-20250318-123444.96e0b73b";
2
2
 
3
3
  export { version };
@@ -1,3 +1,3 @@
1
- const version = "2.11.7-20250318-111257.10c8e534";
1
+ const version = "2.11.7-20250318-123444.96e0b73b";
2
2
 
3
3
  export { version };
@@ -1,3 +1,3 @@
1
- const version = "2.11.7-20250318-111257.10c8e534";
1
+ const version = "2.11.7-20250318-123444.96e0b73b";
2
2
 
3
3
  export { version };
@@ -91,14 +91,16 @@ export async function fetchHandler(request, env, context, url = new URL(request.
91
91
  globalThis.__env__ = env;
92
92
  return nitroApp.localFetch(url.pathname + url.search, {
93
93
  context: {
94
- cf: request.cf,
95
94
  waitUntil: (promise) => context.waitUntil(promise),
96
- cloudflare: {
97
- request,
98
- env,
99
- context,
100
- url,
101
- ...ctxExt
95
+ _platform: {
96
+ cf: request.cf,
97
+ cloudflare: {
98
+ request,
99
+ env,
100
+ context,
101
+ url,
102
+ ...ctxExt
103
+ }
102
104
  }
103
105
  },
104
106
  host: url.hostname,
@@ -25,12 +25,14 @@ export default {
25
25
  globalThis.__env__ = env;
26
26
  return nitroApp.localFetch(url.pathname + url.search, {
27
27
  context: {
28
- cf: request.cf,
29
28
  waitUntil: (promise) => context.waitUntil(promise),
30
- cloudflare: {
31
- request,
32
- env,
33
- context
29
+ _platform: {
30
+ cf: request.cf,
31
+ cloudflare: {
32
+ request,
33
+ env,
34
+ context
35
+ }
34
36
  }
35
37
  },
36
38
  host: url.hostname,
@@ -31,11 +31,13 @@ async function handleEvent(event) {
31
31
  }
32
32
  return nitroApp.localFetch(url.pathname + url.search, {
33
33
  context: {
34
- // https://developers.cloudflare.com/workers//runtime-apis/request#incomingrequestcfproperties
35
- cf: event.request.cf,
36
34
  waitUntil: (promise) => event.waitUntil(promise),
37
- cloudflare: {
38
- event
35
+ _platform: {
36
+ // https://developers.cloudflare.com/workers/runtime-apis/request#incomingrequestcfproperties
37
+ cf: event.request.cf,
38
+ cloudflare: {
39
+ event
40
+ }
39
41
  }
40
42
  },
41
43
  host: url.hostname,
@@ -14,8 +14,10 @@ export default async function handleEvent(request, event) {
14
14
  method: request.method,
15
15
  body,
16
16
  context: {
17
- vercel: {
18
- event
17
+ _platform: {
18
+ vercel: {
19
+ event
20
+ }
19
21
  }
20
22
  }
21
23
  });
@@ -14,8 +14,10 @@ async function _handleEvent(event) {
14
14
  headers: event.request.headers,
15
15
  context: {
16
16
  waitUntil: (promise) => event.waitUntil(promise),
17
- winterjs: {
18
- event
17
+ _platform: {
18
+ winterjs: {
19
+ event
20
+ }
19
21
  }
20
22
  }
21
23
  });
@@ -46,9 +46,15 @@ function createNitroApp() {
46
46
  },
47
47
  onRequest: async (event) => {
48
48
  event.context.nitro = event.context.nitro || { errors: [] };
49
- const envContext = event.node.req?.__unenv__;
50
- if (envContext) {
51
- Object.assign(event.context, envContext);
49
+ const fetchContext = event.node.req?.__unenv__;
50
+ if (fetchContext?._platform) {
51
+ event.context = {
52
+ ...fetchContext._platform,
53
+ ...event.context
54
+ };
55
+ }
56
+ if (!event.context.waitUntil && fetchContext?.waitUntil) {
57
+ event.context.waitUntil = fetchContext.waitUntil;
52
58
  }
53
59
  event.fetch = (req, init) => fetchWithEvent(event, req, init, { fetch: localFetch });
54
60
  event.$fetch = (req, init) => fetchWithEvent(event, req, init, {
@@ -59,8 +65,8 @@ function createNitroApp() {
59
65
  event.context.nitro._waitUntilPromises = [];
60
66
  }
61
67
  event.context.nitro._waitUntilPromises.push(promise);
62
- if (envContext?.waitUntil) {
63
- envContext.waitUntil(promise);
68
+ if (event.context.waitUntil) {
69
+ event.context.waitUntil(promise);
64
70
  }
65
71
  };
66
72
  event.captureError = (error, context) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitropack-nightly",
3
- "version": "2.11.7-20250318-111257.10c8e534",
3
+ "version": "2.11.7-20250318-123444.96e0b73b",
4
4
  "description": "Build and Deploy Universal JavaScript Servers",
5
5
  "repository": "nitrojs/nitro",
6
6
  "license": "MIT",