nitropack-nightly 2.11.7-20250317-120939.729315be → 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,5 +1,5 @@
1
1
  import { NitroPreset, NitroPresetMeta, Nitro } from 'nitropack/types';
2
- import { N as NitroModule } from '../shared/nitro.ZcB8T5yn.mjs';
2
+ import { N as NitroModule } from '../shared/nitro.BvFZg7IX.mjs';
3
3
  import 'consola';
4
4
  import 'h3';
5
5
  import 'hookable';
@@ -1,5 +1,5 @@
1
1
  import { NitroPreset, NitroPresetMeta, Nitro } from 'nitropack/types';
2
- import { N as NitroModule } from '../shared/nitro.ZcB8T5yn.js';
2
+ import { N as NitroModule } from '../shared/nitro.BvFZg7IX.js';
3
3
  import 'consola';
4
4
  import 'h3';
5
5
  import 'hookable';
@@ -1,3 +1,3 @@
1
- const version = "2.11.7-20250317-120939.729315be";
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-20250317-120939.729315be";
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-20250317-120939.729315be";
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) => {
@@ -8,6 +8,8 @@ export default eventHandler((event) => {
8
8
  const _config = runtimeConfig.nitro.openAPI?.ui?.scalar;
9
9
  const scalarConfig = {
10
10
  ..._config,
11
+ url: openAPIEndpoint,
12
+ // @ts-expect-error (missing types?)
11
13
  spec: { url: openAPIEndpoint, ..._config?.spec }
12
14
  };
13
15
  return (
@@ -25,7 +25,7 @@ import { FilterPattern } from 'unplugin-utils';
25
25
  import { NodeFileTraceOptions } from '@vercel/nft';
26
26
  import { TransformOptions, Loader } from 'esbuild';
27
27
  import { InputOptions, OutputOptions } from 'rollup';
28
- import { ReferenceConfiguration } from '@scalar/api-reference';
28
+ import { ApiReferenceConfiguration } from '@scalar/api-reference';
29
29
  import { ProviderName } from 'std-env';
30
30
 
31
31
  type Enumerate<N extends number, Acc extends number[] = []> = Acc["length"] extends N ? Acc[number] : Enumerate<N, [...Acc, Acc["length"]]>;
@@ -231,7 +231,7 @@ interface NitroOpenAPIConfig {
231
231
  /**
232
232
  * Scalar UI configuration
233
233
  */
234
- scalar?: false | (ReferenceConfiguration & {
234
+ scalar?: false | (Partial<ApiReferenceConfiguration> & {
235
235
  /**
236
236
  * Scalar UI route
237
237
  *
@@ -25,7 +25,7 @@ import { FilterPattern } from 'unplugin-utils';
25
25
  import { NodeFileTraceOptions } from '@vercel/nft';
26
26
  import { TransformOptions, Loader } from 'esbuild';
27
27
  import { InputOptions, OutputOptions } from 'rollup';
28
- import { ReferenceConfiguration } from '@scalar/api-reference';
28
+ import { ApiReferenceConfiguration } from '@scalar/api-reference';
29
29
  import { ProviderName } from 'std-env';
30
30
 
31
31
  type Enumerate<N extends number, Acc extends number[] = []> = Acc["length"] extends N ? Acc[number] : Enumerate<N, [...Acc, Acc["length"]]>;
@@ -231,7 +231,7 @@ interface NitroOpenAPIConfig {
231
231
  /**
232
232
  * Scalar UI configuration
233
233
  */
234
- scalar?: false | (ReferenceConfiguration & {
234
+ scalar?: false | (Partial<ApiReferenceConfiguration> & {
235
235
  /**
236
236
  * Scalar UI route
237
237
  *
@@ -1,7 +1,7 @@
1
1
  import { App, Router, H3Event, RouterMethod } from 'h3';
2
2
  import { FetchRequest, FetchOptions, FetchResponse } from 'ofetch';
3
- import { a as NitroOptions, b as NitroConfig, N as NitroModule } from '../shared/nitro.ZcB8T5yn.mjs';
4
- export { A as AppConfig, C as CacheEntry, c as CacheOptions, d as CachedEventHandlerOptions, e as CompressOptions, g as DatabaseConnectionConfig, h as DatabaseConnectionConfigs, D as DatabaseConnectionName, l as DevServerOptions, I as EsbuildOptions, O as HTTPStatusCode, L as LoadConfigOptions, u as Nitro, y as NitroBuildInfo, q as NitroDevEventHandler, n as NitroDevServer, v as NitroDynamicConfig, r as NitroErrorHandler, p as NitroEventHandler, x as NitroFrameworkInfo, s as NitroHooks, t as NitroModuleInput, k as NitroOpenAPIConfig, E as NitroPreset, F as NitroPresetMeta, Q as NitroRouteConfig, o as NitroRouteMeta, T as NitroRouteRules, j as NitroRuntimeConfig, i as NitroRuntimeConfigApp, w as NitroTypes, m as NitroWorker, J as NodeExternalsOptions, B as PrerenderGenerateRoute, z as PrerenderRoute, P as PublicAssetDir, M as RawOptions, R as ResponseCacheEntry, G as RollupConfig, H as RollupVirtualOptions, S as ServerAssetDir, K as ServerAssetOptions, f as StorageMounts, V as VirtualModule } from '../shared/nitro.ZcB8T5yn.mjs';
3
+ import { a as NitroOptions, b as NitroConfig, N as NitroModule } from '../shared/nitro.BvFZg7IX.mjs';
4
+ export { A as AppConfig, C as CacheEntry, c as CacheOptions, d as CachedEventHandlerOptions, e as CompressOptions, g as DatabaseConnectionConfig, h as DatabaseConnectionConfigs, D as DatabaseConnectionName, l as DevServerOptions, I as EsbuildOptions, O as HTTPStatusCode, L as LoadConfigOptions, u as Nitro, y as NitroBuildInfo, q as NitroDevEventHandler, n as NitroDevServer, v as NitroDynamicConfig, r as NitroErrorHandler, p as NitroEventHandler, x as NitroFrameworkInfo, s as NitroHooks, t as NitroModuleInput, k as NitroOpenAPIConfig, E as NitroPreset, F as NitroPresetMeta, Q as NitroRouteConfig, o as NitroRouteMeta, T as NitroRouteRules, j as NitroRuntimeConfig, i as NitroRuntimeConfigApp, w as NitroTypes, m as NitroWorker, J as NodeExternalsOptions, B as PrerenderGenerateRoute, z as PrerenderRoute, P as PublicAssetDir, M as RawOptions, R as ResponseCacheEntry, G as RollupConfig, H as RollupVirtualOptions, S as ServerAssetDir, K as ServerAssetOptions, f as StorageMounts, V as VirtualModule } from '../shared/nitro.BvFZg7IX.mjs';
5
5
  import { Hookable } from 'hookable';
6
6
  import { NitroRuntimeHooks as NitroRuntimeHooks$1 } from 'nitropack';
7
7
  import { AbstractRequest, AbstractResponse } from 'node-mock-http';
@@ -1,7 +1,7 @@
1
1
  import { App, Router, H3Event, RouterMethod } from 'h3';
2
2
  import { FetchRequest, FetchOptions, FetchResponse } from 'ofetch';
3
- import { a as NitroOptions, b as NitroConfig, N as NitroModule } from '../shared/nitro.ZcB8T5yn.js';
4
- export { A as AppConfig, C as CacheEntry, c as CacheOptions, d as CachedEventHandlerOptions, e as CompressOptions, g as DatabaseConnectionConfig, h as DatabaseConnectionConfigs, D as DatabaseConnectionName, l as DevServerOptions, I as EsbuildOptions, O as HTTPStatusCode, L as LoadConfigOptions, u as Nitro, y as NitroBuildInfo, q as NitroDevEventHandler, n as NitroDevServer, v as NitroDynamicConfig, r as NitroErrorHandler, p as NitroEventHandler, x as NitroFrameworkInfo, s as NitroHooks, t as NitroModuleInput, k as NitroOpenAPIConfig, E as NitroPreset, F as NitroPresetMeta, Q as NitroRouteConfig, o as NitroRouteMeta, T as NitroRouteRules, j as NitroRuntimeConfig, i as NitroRuntimeConfigApp, w as NitroTypes, m as NitroWorker, J as NodeExternalsOptions, B as PrerenderGenerateRoute, z as PrerenderRoute, P as PublicAssetDir, M as RawOptions, R as ResponseCacheEntry, G as RollupConfig, H as RollupVirtualOptions, S as ServerAssetDir, K as ServerAssetOptions, f as StorageMounts, V as VirtualModule } from '../shared/nitro.ZcB8T5yn.js';
3
+ import { a as NitroOptions, b as NitroConfig, N as NitroModule } from '../shared/nitro.BvFZg7IX.js';
4
+ export { A as AppConfig, C as CacheEntry, c as CacheOptions, d as CachedEventHandlerOptions, e as CompressOptions, g as DatabaseConnectionConfig, h as DatabaseConnectionConfigs, D as DatabaseConnectionName, l as DevServerOptions, I as EsbuildOptions, O as HTTPStatusCode, L as LoadConfigOptions, u as Nitro, y as NitroBuildInfo, q as NitroDevEventHandler, n as NitroDevServer, v as NitroDynamicConfig, r as NitroErrorHandler, p as NitroEventHandler, x as NitroFrameworkInfo, s as NitroHooks, t as NitroModuleInput, k as NitroOpenAPIConfig, E as NitroPreset, F as NitroPresetMeta, Q as NitroRouteConfig, o as NitroRouteMeta, T as NitroRouteRules, j as NitroRuntimeConfig, i as NitroRuntimeConfigApp, w as NitroTypes, m as NitroWorker, J as NodeExternalsOptions, B as PrerenderGenerateRoute, z as PrerenderRoute, P as PublicAssetDir, M as RawOptions, R as ResponseCacheEntry, G as RollupConfig, H as RollupVirtualOptions, S as ServerAssetDir, K as ServerAssetOptions, f as StorageMounts, V as VirtualModule } from '../shared/nitro.BvFZg7IX.js';
5
5
  import { Hookable } from 'hookable';
6
6
  import { NitroRuntimeHooks as NitroRuntimeHooks$1 } from 'nitropack';
7
7
  import { AbstractRequest, AbstractResponse } from 'node-mock-http';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitropack-nightly",
3
- "version": "2.11.7-20250317-120939.729315be",
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",
@@ -98,16 +98,15 @@
98
98
  "nitropack": "link:."
99
99
  },
100
100
  "dependencies": {
101
- "@cloudflare/kv-asset-handler": "^0.3.4",
102
- "@netlify/functions": "3.0.0",
101
+ "@cloudflare/kv-asset-handler": "^0.4.0",
102
+ "@netlify/functions": "^3.0.2",
103
103
  "@rollup/plugin-alias": "^5.1.1",
104
104
  "@rollup/plugin-commonjs": "^28.0.3",
105
105
  "@rollup/plugin-inject": "^5.0.5",
106
106
  "@rollup/plugin-json": "^6.1.0",
107
- "@rollup/plugin-node-resolve": "^16.0.0",
107
+ "@rollup/plugin-node-resolve": "^16.0.1",
108
108
  "@rollup/plugin-replace": "^6.0.2",
109
109
  "@rollup/plugin-terser": "^0.4.4",
110
- "@types/http-proxy": "^1.17.16",
111
110
  "@vercel/nft": "^0.29.2",
112
111
  "archiver": "^7.0.1",
113
112
  "c12": "^3.0.2",
@@ -115,7 +114,7 @@
115
114
  "citty": "^0.1.6",
116
115
  "compatx": "^0.1.8",
117
116
  "confbox": "^0.2.1",
118
- "consola": "^3.4.0",
117
+ "consola": "^3.4.2",
119
118
  "cookie-es": "^2.0.0",
120
119
  "croner": "^9.0.0",
121
120
  "crossws": "^0.3.4",
@@ -123,11 +122,10 @@
123
122
  "defu": "^6.1.4",
124
123
  "destr": "^2.0.3",
125
124
  "dot-prop": "^9.0.0",
126
- "esbuild": "^0.25.0",
125
+ "esbuild": "^0.25.1",
127
126
  "escape-string-regexp": "^5.0.0",
128
127
  "etag": "^1.8.1",
129
128
  "exsolve": "^1.0.4",
130
- "fs-extra": "^11.3.0",
131
129
  "globby": "^14.1.0",
132
130
  "gzip-size": "^7.0.0",
133
131
  "h3": "npm:h3-nightly@latest",
@@ -152,7 +150,7 @@
152
150
  "pkg-types": "^2.1.0",
153
151
  "pretty-bytes": "^6.1.1",
154
152
  "radix3": "^1.1.2",
155
- "rollup": "^4.35.0",
153
+ "rollup": "^4.36.0",
156
154
  "rollup-plugin-visualizer": "^5.14.0",
157
155
  "scule": "^1.3.0",
158
156
  "semver": "^7.7.1",
@@ -164,7 +162,7 @@
164
162
  "ultrahtml": "^1.5.3",
165
163
  "uncrypto": "^0.1.3",
166
164
  "unctx": "^2.4.1",
167
- "unenv": "^2.0.0-rc.14",
165
+ "unenv": "^2.0.0-rc.15",
168
166
  "unimport": "^4.1.2",
169
167
  "unplugin-utils": "^0.2.4",
170
168
  "unstorage": "^1.15.0",
@@ -176,10 +174,10 @@
176
174
  "devDependencies": {
177
175
  "@azure/functions": "^3.5.1",
178
176
  "@azure/static-web-apps-cli": "^2.0.4",
179
- "@cloudflare/workers-types": "^4.20250303.0",
177
+ "@cloudflare/workers-types": "^4.20250317.0",
180
178
  "@deno/types": "^0.0.1",
181
179
  "@netlify/edge-functions": "^2.11.1",
182
- "@scalar/api-reference": "^1.25.130",
180
+ "@scalar/api-reference": "^1.28.5",
183
181
  "@types/archiver": "^6.0.3",
184
182
  "@types/aws-lambda": "^8.10.147",
185
183
  "@types/estree": "^1.0.6",
@@ -189,7 +187,7 @@
189
187
  "@types/semver": "^7.5.8",
190
188
  "@types/serve-static": "^1.15.7",
191
189
  "@types/xml2js": "^0.4.14",
192
- "@vitest/coverage-v8": "^3.0.8",
190
+ "@vitest/coverage-v8": "^3.0.9",
193
191
  "automd": "^0.4.0",
194
192
  "changelogen": "^0.6.1",
195
193
  "edge-runtime": "^4.0.1",
@@ -200,13 +198,13 @@
200
198
  "firebase-admin": "^12.7.0",
201
199
  "firebase-functions": "^4.9.0",
202
200
  "get-port-please": "^3.1.2",
203
- "miniflare": "^3.20250224.0",
201
+ "miniflare": "^4.20250317.0",
204
202
  "ohash-v1": "npm:ohash@^1.1.6",
205
203
  "prettier": "^3.5.3",
206
204
  "typescript": "^5.8.2",
207
205
  "unbuild": "^3.5.0",
208
- "undici": "^7.4.0",
209
- "vitest": "^3.0.8",
206
+ "undici": "^7.5.0",
207
+ "vitest": "^3.0.9",
210
208
  "xml2js": "^0.6.2"
211
209
  },
212
210
  "peerDependencies": {