nitropack-nightly 2.12.5-20250726-160806.b49eb81d → 2.12.5-20250819-230311.89278001

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.
@@ -2506,7 +2506,14 @@ function fmtFrame(frame) {
2506
2506
 
2507
2507
  function createVFSHandler(nitro) {
2508
2508
  return eventHandler(async (event) => {
2509
- const ip = getRequestIP(event, { xForwardedFor: false });
2509
+ const { socket } = event.node.req;
2510
+ const isUnixSocket = (
2511
+ // No network addresses
2512
+ !socket?.remoteAddress && !socket?.localAddress && // Empty address object
2513
+ Object.keys(socket?.address?.() || {}).length === 0 && // Socket is readable/writable but has no port info
2514
+ socket?.readable && socket?.writable && !socket?.remotePort
2515
+ );
2516
+ const ip = getRequestIP(event, { xForwardedFor: isUnixSocket });
2510
2517
  const isLocalRequest = ip && /^::1$|^127\.\d+\.\d+\.\d+$/.test(ip);
2511
2518
  if (!isLocalRequest) {
2512
2519
  throw createError({
@@ -1,4 +1,4 @@
1
- const version = "2.12.5-20250726-160806.b49eb81d";
1
+ const version = "2.12.5-20250819-230311.89278001";
2
2
 
3
3
  const compatibilityChanges = [
4
4
  {
@@ -52,7 +52,7 @@ const cloudflarePages = defineNitroPreset(
52
52
  async compiled(nitro) {
53
53
  await writeWranglerConfig(nitro, "pages");
54
54
  await writeCFRoutes(nitro);
55
- await writeCFHeaders(nitro);
55
+ await writeCFHeaders(nitro, "output");
56
56
  await writeCFPagesRedirects(nitro);
57
57
  }
58
58
  }
@@ -82,7 +82,7 @@ const cloudflarePagesStatic = defineNitroPreset(
82
82
  }
83
83
  },
84
84
  async compiled(nitro) {
85
- await writeCFHeaders(nitro);
85
+ await writeCFHeaders(nitro, "output");
86
86
  await writeCFPagesRedirects(nitro);
87
87
  }
88
88
  }
@@ -143,7 +143,7 @@ const cloudflareModule = defineNitroPreset(
143
143
  },
144
144
  async compiled(nitro) {
145
145
  await writeWranglerConfig(nitro, "module");
146
- await writeCFHeaders(nitro);
146
+ await writeCFHeaders(nitro, "public");
147
147
  await writeFile(
148
148
  resolve(nitro.options.output.dir, "package.json"),
149
149
  JSON.stringify({ private: true, main: "./server/index.mjs" }, null, 2)
@@ -1,6 +1,6 @@
1
1
  import type { Nitro } from "nitropack/types";
2
2
  export declare function writeCFRoutes(nitro: Nitro): Promise<void>;
3
- export declare function writeCFHeaders(nitro: Nitro): Promise<void>;
3
+ export declare function writeCFHeaders(nitro: Nitro, outdir: "public" | "output"): Promise<void>;
4
4
  export declare function writeCFPagesRedirects(nitro: Nitro): Promise<void>;
5
5
  export declare function enableNodeCompat(nitro: Nitro): Promise<void>;
6
6
  export declare function writeWranglerConfig(nitro: Nitro, cfTarget: "pages" | "module"): Promise<void>;
@@ -75,8 +75,11 @@ export async function writeCFRoutes(nitro) {
75
75
  function comparePaths(a, b) {
76
76
  return a.split("/").length - b.split("/").length || a.localeCompare(b);
77
77
  }
78
- export async function writeCFHeaders(nitro) {
79
- const headersPath = join(nitro.options.output.dir, "_headers");
78
+ export async function writeCFHeaders(nitro, outdir) {
79
+ const headersPath = join(
80
+ outdir === "public" ? nitro.options.output.publicDir : nitro.options.output.dir,
81
+ "_headers"
82
+ );
80
83
  const contents = [];
81
84
  const rules = Object.entries(nitro.options.routeRules).sort(
82
85
  (a, b) => b[0].split(/\/(?!\*)/).length - a[0].split(/\/(?!\*)/).length
@@ -14,7 +14,7 @@ export const handler = async function handler2(event, context) {
14
14
  (r) => r.builder || r.default.builder
15
15
  );
16
16
  const ttl = typeof routeRules.isr === "number" ? routeRules.isr : false;
17
- const builderHandler = ttl ? (event2, context2) => lambda(event2, context2).then((r) => ({ ...r, ttl })) : lambda;
17
+ const builderHandler = ttl ? ((event2, context2) => lambda(event2, context2).then((r) => ({ ...r, ttl }))) : lambda;
18
18
  return builder(builderHandler)(event, context);
19
19
  }
20
20
  return lambda(event, context);
@@ -702,17 +702,17 @@ function normalizeMatcher(input) {
702
702
  return input;
703
703
  }
704
704
  if (input instanceof RegExp) {
705
- const matcher = (id) => input.test(id);
705
+ const matcher = ((id) => input.test(id));
706
706
  matcher.score = input.toString().length;
707
707
  Object.defineProperty(matcher, "name", { value: `match(${input})` });
708
708
  return matcher;
709
709
  }
710
710
  if (typeof input === "string") {
711
711
  const pattern = normalize(input);
712
- const matcher = (id) => {
712
+ const matcher = ((id) => {
713
713
  const idWithoutNodeModules = id.split("node_modules/").pop();
714
714
  return id.startsWith(pattern) || idWithoutNodeModules?.startsWith(pattern);
715
- };
715
+ });
716
716
  matcher.score = input.length;
717
717
  if (!isAbsolute(input) && input[0] !== ".") {
718
718
  matcher.score += 1e3;
@@ -93,7 +93,10 @@ function createNitroApp() {
93
93
  preemptive: true
94
94
  });
95
95
  const nodeHandler = toNodeListener(h3App);
96
- const localCall = (aRequest) => callNodeRequestHandler(nodeHandler, aRequest);
96
+ const localCall = (aRequest) => callNodeRequestHandler(
97
+ nodeHandler,
98
+ aRequest
99
+ );
97
100
  const localFetch = (input, init) => {
98
101
  if (!input.toString().startsWith("/")) {
99
102
  return globalThis.fetch(input, init);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitropack-nightly",
3
- "version": "2.12.5-20250726-160806.b49eb81d",
3
+ "version": "2.12.5-20250819-230311.89278001",
4
4
  "description": "Build and Deploy Universal JavaScript Servers",
5
5
  "repository": "nitrojs/nitro",
6
6
  "license": "MIT",
@@ -107,9 +107,9 @@
107
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
- "@vercel/nft": "^0.29.4",
110
+ "@vercel/nft": "^0.30.0",
111
111
  "archiver": "^7.0.1",
112
- "c12": "^3.1.0",
112
+ "c12": "^3.2.0",
113
113
  "chokidar": "^4.0.3",
114
114
  "citty": "^0.1.6",
115
115
  "compatx": "^0.2.0",
@@ -122,7 +122,7 @@
122
122
  "defu": "^6.1.4",
123
123
  "destr": "^2.0.5",
124
124
  "dot-prop": "^9.0.0",
125
- "esbuild": "^0.25.6",
125
+ "esbuild": "^0.25.9",
126
126
  "escape-string-regexp": "^5.0.0",
127
127
  "etag": "^1.8.1",
128
128
  "exsolve": "^1.0.7",
@@ -131,8 +131,8 @@
131
131
  "h3": "npm:h3-nightly@latest",
132
132
  "hookable": "^5.5.3",
133
133
  "httpxy": "^0.1.7",
134
- "ioredis": "^5.6.1",
135
- "jiti": "^2.4.2",
134
+ "ioredis": "^5.7.0",
135
+ "jiti": "^2.5.1",
136
136
  "klona": "^2.0.6",
137
137
  "knitwork": "^1.2.0",
138
138
  "listhen": "^1.9.0",
@@ -140,8 +140,8 @@
140
140
  "magicast": "^0.3.5",
141
141
  "mime": "^4.0.7",
142
142
  "mlly": "^1.7.4",
143
- "node-fetch-native": "^1.6.6",
144
- "node-mock-http": "^1.0.1",
143
+ "node-fetch-native": "^1.6.7",
144
+ "node-mock-http": "^1.0.2",
145
145
  "ofetch": "^1.4.1",
146
146
  "ohash": "^2.0.11",
147
147
  "pathe": "^2.0.3",
@@ -149,40 +149,40 @@
149
149
  "pkg-types": "^2.2.0",
150
150
  "pretty-bytes": "^6.1.1",
151
151
  "radix3": "^1.1.2",
152
- "rollup": "^4.45.0",
152
+ "rollup": "^4.46.3",
153
153
  "rollup-plugin-visualizer": "^6.0.3",
154
154
  "scule": "^1.3.0",
155
155
  "semver": "^7.7.2",
156
156
  "serve-placeholder": "^2.0.2",
157
157
  "serve-static": "^2.2.0",
158
- "source-map": "^0.7.4",
158
+ "source-map": "^0.7.6",
159
159
  "std-env": "^3.9.0",
160
160
  "ufo": "^1.6.1",
161
161
  "ultrahtml": "^1.6.0",
162
162
  "uncrypto": "^0.1.3",
163
163
  "unctx": "^2.4.1",
164
- "unenv": "^2.0.0-rc.18",
165
- "unimport": "^5.1.0",
166
- "unplugin-utils": "^0.2.4",
164
+ "unenv": "2.0.0-rc.19",
165
+ "unimport": "^5.2.0",
166
+ "unplugin-utils": "^0.2.5",
167
167
  "unstorage": "^1.16.1",
168
168
  "untyped": "^2.0.0",
169
- "unwasm": "^0.3.9",
169
+ "unwasm": "^0.3.11",
170
170
  "youch": "4.1.0-beta.8",
171
171
  "youch-core": "^0.3.3"
172
172
  },
173
173
  "devDependencies": {
174
174
  "@azure/functions": "^3.5.1",
175
175
  "@azure/static-web-apps-cli": "^2.0.6",
176
- "@cloudflare/workers-types": "^4.20250712.0",
176
+ "@cloudflare/workers-types": "^4.20250819.0",
177
177
  "@deno/types": "^0.0.1",
178
- "@netlify/edge-functions": "^2.15.6",
179
- "@scalar/api-reference": "^1.32.7",
178
+ "@netlify/edge-functions": "^2.17.1",
179
+ "@scalar/api-reference": "^1.34.2",
180
180
  "@types/archiver": "^6.0.3",
181
- "@types/aws-lambda": "^8.10.150",
181
+ "@types/aws-lambda": "^8.10.152",
182
182
  "@types/estree": "^1.0.8",
183
183
  "@types/etag": "^1.8.4",
184
184
  "@types/fs-extra": "^11.0.4",
185
- "@types/node-fetch": "^2.6.12",
185
+ "@types/node-fetch": "^2.6.13",
186
186
  "@types/semver": "^7.7.0",
187
187
  "@types/serve-static": "^1.15.8",
188
188
  "@types/xml2js": "^0.4.14",
@@ -190,21 +190,21 @@
190
190
  "automd": "^0.4.0",
191
191
  "changelogen": "^0.6.2",
192
192
  "edge-runtime": "^4.0.1",
193
- "eslint": "^9.31.0",
193
+ "eslint": "^9.33.0",
194
194
  "eslint-config-unjs": "^0.5.0",
195
195
  "execa": "^9.6.0",
196
196
  "expect-type": "^1.2.2",
197
197
  "firebase-admin": "^12.7.0",
198
198
  "firebase-functions": "^4.9.0",
199
199
  "get-port-please": "^3.2.0",
200
- "miniflare": "^4.20250709.0",
200
+ "miniflare": "^4.20250816.0",
201
201
  "ohash-v1": "npm:ohash@^1.1.6",
202
202
  "prettier": "^3.6.2",
203
- "typescript": "^5.8.3",
204
- "unbuild": "^3.5.0",
205
- "undici": "^7.11.0",
203
+ "typescript": "^5.9.2",
204
+ "unbuild": "^3.6.1",
205
+ "undici": "^7.14.0",
206
206
  "vitest": "^3.2.4",
207
- "wrangler": "^4.24.3",
207
+ "wrangler": "^4.31.0",
208
208
  "xml2js": "^0.6.2"
209
209
  },
210
210
  "peerDependencies": {