nitropack-nightly 2.12.6-20250902-180605.b08a1296 → 2.12.6-20250908-085153.e195f910

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,4 +1,4 @@
1
- const version = "2.12.6-20250902-180605.b08a1296";
1
+ const version = "2.12.6-20250908-085153.e195f910";
2
2
 
3
3
  const compatibilityChanges = [
4
4
  {
@@ -4,6 +4,7 @@ import { writeFile } from "nitropack/kit";
4
4
  import { dirname, relative, resolve } from "pathe";
5
5
  import { joinURL, withLeadingSlash, withoutLeadingSlash } from "ufo";
6
6
  import { isTest } from "std-env";
7
+ import { createRouter as createRadixRouter, toRouteMatcher } from "radix3";
7
8
  const SUPPORTED_NODE_VERSIONS = [18, 20, 22];
8
9
  const FALLBACK_ROUTE = "/__fallback";
9
10
  const SAFE_FS_CHAR_RE = /[^a-zA-Z0-9_.[\]/]/g;
@@ -38,25 +39,6 @@ export async function generateFunctionFiles(nitro) {
38
39
  if (!value.isr) {
39
40
  continue;
40
41
  }
41
- let isrConfig = value.isr;
42
- if (typeof isrConfig === "number") {
43
- isrConfig = { expiration: isrConfig };
44
- } else if (isrConfig === true) {
45
- isrConfig = { expiration: false };
46
- } else {
47
- isrConfig = { ...isrConfig };
48
- }
49
- const prerenderConfig = {
50
- expiration: isrConfig.expiration ?? false,
51
- bypassToken: nitro.options.vercel?.config?.bypassToken,
52
- ...isrConfig
53
- };
54
- if (key.includes("/**")) {
55
- isrConfig.allowQuery = isrConfig.allowQuery || [];
56
- if (!isrConfig.allowQuery.includes("url")) {
57
- isrConfig.allowQuery.push("url");
58
- }
59
- }
60
42
  const funcPrefix = resolve(
61
43
  nitro.options.output.serverDir,
62
44
  "..",
@@ -68,12 +50,24 @@ export async function generateFunctionFiles(nitro) {
68
50
  funcPrefix + ".func",
69
51
  "junction"
70
52
  );
71
- await writeFile(
53
+ await writePrerenderConfig(
72
54
  funcPrefix + ".prerender-config.json",
73
- JSON.stringify(prerenderConfig, null, 2)
55
+ value.isr,
56
+ nitro.options.vercel?.config?.bypassToken
74
57
  );
75
58
  }
59
+ if (o11Routes.length === 0) {
60
+ return;
61
+ }
62
+ const _routeRulesMatcher = toRouteMatcher(
63
+ createRadixRouter({ routes: nitro.options.routeRules })
64
+ );
65
+ const _getRouteRules = (path) => defu({}, ..._routeRulesMatcher.matchAll(path).reverse());
76
66
  for (const route of o11Routes) {
67
+ const routeRules = _getRouteRules(route.src);
68
+ if (routeRules.isr) {
69
+ continue;
70
+ }
77
71
  const funcPrefix = resolve(
78
72
  nitro.options.output.serverDir,
79
73
  "..",
@@ -301,3 +295,18 @@ function normalizeRouteDest(route) {
301
295
  return segment;
302
296
  }).map((segment) => segment.replace(SAFE_FS_CHAR_RE, "-")).join("/") || "index";
303
297
  }
298
+ async function writePrerenderConfig(filename, isrConfig, bypassToken) {
299
+ if (typeof isrConfig === "number") {
300
+ isrConfig = { expiration: isrConfig };
301
+ } else if (isrConfig === true) {
302
+ isrConfig = { expiration: false };
303
+ } else {
304
+ isrConfig = { ...isrConfig };
305
+ }
306
+ const prerenderConfig = {
307
+ expiration: isrConfig.expiration ?? false,
308
+ bypassToken,
309
+ ...isrConfig
310
+ };
311
+ await writeFile(filename, JSON.stringify(prerenderConfig, null, 2));
312
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitropack-nightly",
3
- "version": "2.12.6-20250902-180605.b08a1296",
3
+ "version": "2.12.6-20250908-085153.e195f910",
4
4
  "description": "Build and Deploy Universal JavaScript Servers",
5
5
  "repository": "nitrojs/nitro",
6
6
  "license": "MIT",
@@ -140,7 +140,7 @@
140
140
  "mime": "^4.0.7",
141
141
  "mlly": "^1.8.0",
142
142
  "node-fetch-native": "^1.6.7",
143
- "node-mock-http": "^1.0.2",
143
+ "node-mock-http": "^1.0.3",
144
144
  "ofetch": "^1.4.1",
145
145
  "ohash": "^2.0.11",
146
146
  "pathe": "^2.0.3",
@@ -160,19 +160,19 @@
160
160
  "ultrahtml": "^1.6.0",
161
161
  "uncrypto": "^0.1.3",
162
162
  "unctx": "^2.4.1",
163
- "unenv": "2.0.0-rc.20",
163
+ "unenv": "^2.0.0-rc.21",
164
164
  "unimport": "^5.2.0",
165
165
  "unplugin-utils": "^0.3.0",
166
- "unstorage": "^1.17.0",
166
+ "unstorage": "^1.17.1",
167
167
  "untyped": "^2.0.0",
168
168
  "unwasm": "^0.3.11",
169
- "youch": "4.1.0-beta.8",
169
+ "youch": "^4.1.0-beta.11",
170
170
  "youch-core": "^0.3.3"
171
171
  },
172
172
  "devDependencies": {
173
173
  "@azure/functions": "^3.5.1",
174
174
  "@azure/static-web-apps-cli": "^2.0.6",
175
- "@cloudflare/workers-types": "^4.20250902.0",
175
+ "@cloudflare/workers-types": "^4.20250904.0",
176
176
  "@deno/types": "^0.0.1",
177
177
  "@netlify/edge-functions": "^2.17.4",
178
178
  "@netlify/functions": "^4.2.5",
@@ -183,7 +183,7 @@
183
183
  "@types/etag": "^1.8.4",
184
184
  "@types/fs-extra": "^11.0.4",
185
185
  "@types/node-fetch": "^2.6.13",
186
- "@types/semver": "^7.7.0",
186
+ "@types/semver": "^7.7.1",
187
187
  "@types/serve-static": "^1.15.8",
188
188
  "@types/xml2js": "^0.4.14",
189
189
  "@vitest/coverage-v8": "^3.2.4",
@@ -197,14 +197,14 @@
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.20250823.1",
200
+ "miniflare": "^4.20250829.0",
201
201
  "ohash-v1": "npm:ohash@^1.1.6",
202
202
  "prettier": "^3.6.2",
203
203
  "typescript": "^5.9.2",
204
204
  "unbuild": "^3.6.1",
205
205
  "undici": "^7.15.0",
206
206
  "vitest": "^3.2.4",
207
- "wrangler": "^4.33.1",
207
+ "wrangler": "^4.33.2",
208
208
  "xml2js": "^0.6.2"
209
209
  },
210
210
  "peerDependencies": {