@vercel/next 4.15.11 → 4.15.12

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 +1 @@
1
- module.exports = "var b=Object.create;var p=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty;var h=e=>p(e,\"__esModule\",{value:!0});var _=(e,n)=>{h(e);for(var t in n)p(e,t,{get:n[t],enumerable:!0})},U=(e,n,t)=>{if(n&&typeof n==\"object\"||typeof n==\"function\")for(let i of T(n))!L.call(e,i)&&i!==\"default\"&&p(e,i,{get:()=>n[i],enumerable:!(t=w(n,i))||t.enumerable});return e},A=e=>U(h(p(e!=null?b(P(e)):{},\"default\",e&&e.__esModule&&\"default\"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);_(exports,{default:()=>N});var R=A(require(\"async_hooks\")),S=\"@next/request-context\",f=Symbol.for(S),C=Symbol.for(\"internal.storage\");function O(){let e=globalThis;if(!e[f]){let n=new R.AsyncLocalStorage,t={get:()=>n.getStore(),[C]:n};e[f]=t}return e[f]}var q=O();function m(e,n){return q[C].run(e,n)}function y(e){let n={};return e&&e.forEach((t,i)=>{n[i]=t,i.toLowerCase()===\"set-cookie\"&&(n[i]=M(t))}),n}function M(e){let n=[],t=0,i,a,g,o,r;function x(){for(;t<e.length&&/\\s/.test(e.charAt(t));)t+=1;return t<e.length}function s(){return a=e.charAt(t),a!==\"=\"&&a!==\";\"&&a!==\",\"}for(;t<e.length;){for(i=t,r=!1;x();)if(a=e.charAt(t),a===\",\"){for(g=t,t+=1,x(),o=t;t<e.length&&s();)t+=1;t<e.length&&e.charAt(t)===\"=\"?(r=!0,t=o,n.push(e.substring(i,g)),i=t):t=g+1}else t+=1;(!r||t>=e.length)&&n.push(e.substring(i,e.length))}return n}function N(e){let n=e.staticRoutes.map(i=>({regexp:new RegExp(i.namedRegex),page:i.page})),t=e.dynamicRoutes?.map(i=>({regexp:new RegExp(i.namedRegex),page:i.page}))||[];return async function(a,g){let o=new URL(a.url).pathname,r={};if(e.nextConfig?.basePath&&o.startsWith(e.nextConfig.basePath)&&(o=o.replace(e.nextConfig.basePath,\"\")||\"/\"),e.nextConfig?.i18n)for(let s of e.nextConfig.i18n.locales){let u=new RegExp(`^/${s}($|/)`,\"i\");if(o.match(u)){o=o.replace(u,\"/\")||\"/\";break}}for(let s of n)if(s.regexp.exec(o)){r.name=s.page;break}if(!r.name){let s=E(o);for(let u of t||[]){if(s&&!E(u.page))continue;let d=u.regexp.exec(o);if(d){r={name:u.page,params:d.groups};break}}}let x=await m({waitUntil:g.waitUntil},()=>_ENTRIES[`middleware_${e.name}`].default.call({},{request:{url:a.url,method:a.method,headers:y(a.headers),ip:c(a.headers,l.Ip),geo:{city:c(a.headers,l.City,!0),country:c(a.headers,l.Country,!0),latitude:c(a.headers,l.Latitude),longitude:c(a.headers,l.Longitude),region:c(a.headers,l.Region,!0)},nextConfig:e.nextConfig,page:r,body:a.body}}));return x.waitUntil&&g.waitUntil(x.waitUntil),x.response}}function c(e,n,t=!1){let i=e.get(n)||void 0;return t&&i?decodeURIComponent(i):i}function E(e){return e===\"/api\"||e.startsWith(\"/api/\")}var l;(function(o){o.City=\"x-vercel-ip-city\",o.Country=\"x-vercel-ip-country\",o.Ip=\"x-real-ip\",o.Latitude=\"x-vercel-ip-latitude\",o.Longitude=\"x-vercel-ip-longitude\",o.Region=\"x-vercel-ip-country-region\"})(l||(l={}));\n"
1
+ module.exports = "\"use strict\";var x=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var w=(e,n)=>{for(var t in n)x(e,t,{get:n[t],enumerable:!0})},T=(e,n,t,o)=>{if(n&&typeof n==\"object\"||typeof n==\"function\")for(let i of E(n))!b.call(e,i)&&i!==t&&x(e,i,{get:()=>n[i],enumerable:!(o=N(n,i))||o.enumerable});return e};var P=e=>T(x({},\"__esModule\",{value:!0}),e);var S={};w(S,{default:()=>y});module.exports=P(S);var f=require(\"async_hooks\"),L=\"@next/request-context\",d=Symbol.for(L),h=Symbol.for(\"internal.storage\");function _(){let e=globalThis;if(!e[d]){let n=new f.AsyncLocalStorage,t={get:()=>n.getStore(),[h]:n};e[d]=t}return e[d]}var U=_();function m(e,n){return U[h].run(e,n)}function R(e){let n={};return e&&e.forEach((t,o)=>{n[o]=t,o.toLowerCase()===\"set-cookie\"&&(n[o]=A(t))}),n}function A(e){let n=[],t=0,o,i,g,r,a;function u(){for(;t<e.length&&/\\s/.test(e.charAt(t));)t+=1;return t<e.length}function s(){return i=e.charAt(t),i!==\"=\"&&i!==\";\"&&i!==\",\"}for(;t<e.length;){for(o=t,a=!1;u();)if(i=e.charAt(t),i===\",\"){for(g=t,t+=1,u(),r=t;t<e.length&&s();)t+=1;t<e.length&&e.charAt(t)===\"=\"?(a=!0,t=r,n.push(e.substring(o,g)),o=t):t=g+1}else t+=1;(!a||t>=e.length)&&n.push(e.substring(o,e.length))}return n}function y(e){let n=e.staticRoutes.map(o=>({regexp:new RegExp(o.namedRegex),page:o.page})),t=e.dynamicRoutes?.map(o=>({regexp:new RegExp(o.namedRegex),page:o.page}))||[];return async function(i,g){let r=new URL(i.url).pathname,a={};if(e.nextConfig?.basePath&&r.startsWith(e.nextConfig.basePath)&&(r=r.replace(e.nextConfig.basePath,\"\")||\"/\"),e.nextConfig?.i18n)for(let s of e.nextConfig.i18n.locales){let l=new RegExp(`^/${s}($|/)`,\"i\");if(r.match(l)){r=r.replace(l,\"/\")||\"/\";break}}for(let s of n)if(s.regexp.exec(r)){a.name=s.page;break}if(!a.name){let s=C(r);for(let l of t||[]){if(s&&!C(l.page))continue;let p=l.regexp.exec(r);if(p){a={name:l.page,params:p.groups};break}}}let u=await m({waitUntil:g.waitUntil},()=>_ENTRIES[`middleware_${e.name}`].default.call({},{request:{url:i.url,method:i.method,headers:R(i.headers),ip:c(i.headers,\"x-real-ip\"),geo:{city:c(i.headers,\"x-vercel-ip-city\",!0),country:c(i.headers,\"x-vercel-ip-country\",!0),latitude:c(i.headers,\"x-vercel-ip-latitude\"),longitude:c(i.headers,\"x-vercel-ip-longitude\"),region:c(i.headers,\"x-vercel-ip-country-region\",!0)},nextConfig:e.nextConfig,page:a,body:i.body}}));return u.waitUntil&&g.waitUntil(u.waitUntil),u.response}}function c(e,n,t=!1){let o=e.get(n)||void 0;return t&&o?decodeURIComponent(o):o}function C(e){return e===\"/api\"||e.startsWith(\"/api/\")}\n"
package/dist/index.js CHANGED
@@ -10698,7 +10698,7 @@ var require_bytes = __commonJS({
10698
10698
  var require_get_nextjs_edge_function = __commonJS({
10699
10699
  "dist/___get-nextjs-edge-function.js"(exports, module2) {
10700
10700
  "use strict";
10701
- module2.exports = 'var b=Object.create;var p=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty;var h=e=>p(e,"__esModule",{value:!0});var _=(e,n)=>{h(e);for(var t in n)p(e,t,{get:n[t],enumerable:!0})},U=(e,n,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of T(n))!L.call(e,i)&&i!=="default"&&p(e,i,{get:()=>n[i],enumerable:!(t=w(n,i))||t.enumerable});return e},A=e=>U(h(p(e!=null?b(P(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);_(exports,{default:()=>N});var R=A(require("async_hooks")),S="@next/request-context",f=Symbol.for(S),C=Symbol.for("internal.storage");function O(){let e=globalThis;if(!e[f]){let n=new R.AsyncLocalStorage,t={get:()=>n.getStore(),[C]:n};e[f]=t}return e[f]}var q=O();function m(e,n){return q[C].run(e,n)}function y(e){let n={};return e&&e.forEach((t,i)=>{n[i]=t,i.toLowerCase()==="set-cookie"&&(n[i]=M(t))}),n}function M(e){let n=[],t=0,i,a,g,o,r;function x(){for(;t<e.length&&/\\s/.test(e.charAt(t));)t+=1;return t<e.length}function s(){return a=e.charAt(t),a!=="="&&a!==";"&&a!==","}for(;t<e.length;){for(i=t,r=!1;x();)if(a=e.charAt(t),a===","){for(g=t,t+=1,x(),o=t;t<e.length&&s();)t+=1;t<e.length&&e.charAt(t)==="="?(r=!0,t=o,n.push(e.substring(i,g)),i=t):t=g+1}else t+=1;(!r||t>=e.length)&&n.push(e.substring(i,e.length))}return n}function N(e){let n=e.staticRoutes.map(i=>({regexp:new RegExp(i.namedRegex),page:i.page})),t=e.dynamicRoutes?.map(i=>({regexp:new RegExp(i.namedRegex),page:i.page}))||[];return async function(a,g){let o=new URL(a.url).pathname,r={};if(e.nextConfig?.basePath&&o.startsWith(e.nextConfig.basePath)&&(o=o.replace(e.nextConfig.basePath,"")||"/"),e.nextConfig?.i18n)for(let s of e.nextConfig.i18n.locales){let u=new RegExp(`^/${s}($|/)`,"i");if(o.match(u)){o=o.replace(u,"/")||"/";break}}for(let s of n)if(s.regexp.exec(o)){r.name=s.page;break}if(!r.name){let s=E(o);for(let u of t||[]){if(s&&!E(u.page))continue;let d=u.regexp.exec(o);if(d){r={name:u.page,params:d.groups};break}}}let x=await m({waitUntil:g.waitUntil},()=>_ENTRIES[`middleware_${e.name}`].default.call({},{request:{url:a.url,method:a.method,headers:y(a.headers),ip:c(a.headers,l.Ip),geo:{city:c(a.headers,l.City,!0),country:c(a.headers,l.Country,!0),latitude:c(a.headers,l.Latitude),longitude:c(a.headers,l.Longitude),region:c(a.headers,l.Region,!0)},nextConfig:e.nextConfig,page:r,body:a.body}}));return x.waitUntil&&g.waitUntil(x.waitUntil),x.response}}function c(e,n,t=!1){let i=e.get(n)||void 0;return t&&i?decodeURIComponent(i):i}function E(e){return e==="/api"||e.startsWith("/api/")}var l;(function(o){o.City="x-vercel-ip-city",o.Country="x-vercel-ip-country",o.Ip="x-real-ip",o.Latitude="x-vercel-ip-latitude",o.Longitude="x-vercel-ip-longitude",o.Region="x-vercel-ip-country-region"})(l||(l={}));\n';
10701
+ module2.exports = '"use strict";var x=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var w=(e,n)=>{for(var t in n)x(e,t,{get:n[t],enumerable:!0})},T=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of E(n))!b.call(e,i)&&i!==t&&x(e,i,{get:()=>n[i],enumerable:!(o=N(n,i))||o.enumerable});return e};var P=e=>T(x({},"__esModule",{value:!0}),e);var S={};w(S,{default:()=>y});module.exports=P(S);var f=require("async_hooks"),L="@next/request-context",d=Symbol.for(L),h=Symbol.for("internal.storage");function _(){let e=globalThis;if(!e[d]){let n=new f.AsyncLocalStorage,t={get:()=>n.getStore(),[h]:n};e[d]=t}return e[d]}var U=_();function m(e,n){return U[h].run(e,n)}function R(e){let n={};return e&&e.forEach((t,o)=>{n[o]=t,o.toLowerCase()==="set-cookie"&&(n[o]=A(t))}),n}function A(e){let n=[],t=0,o,i,g,r,a;function u(){for(;t<e.length&&/\\s/.test(e.charAt(t));)t+=1;return t<e.length}function s(){return i=e.charAt(t),i!=="="&&i!==";"&&i!==","}for(;t<e.length;){for(o=t,a=!1;u();)if(i=e.charAt(t),i===","){for(g=t,t+=1,u(),r=t;t<e.length&&s();)t+=1;t<e.length&&e.charAt(t)==="="?(a=!0,t=r,n.push(e.substring(o,g)),o=t):t=g+1}else t+=1;(!a||t>=e.length)&&n.push(e.substring(o,e.length))}return n}function y(e){let n=e.staticRoutes.map(o=>({regexp:new RegExp(o.namedRegex),page:o.page})),t=e.dynamicRoutes?.map(o=>({regexp:new RegExp(o.namedRegex),page:o.page}))||[];return async function(i,g){let r=new URL(i.url).pathname,a={};if(e.nextConfig?.basePath&&r.startsWith(e.nextConfig.basePath)&&(r=r.replace(e.nextConfig.basePath,"")||"/"),e.nextConfig?.i18n)for(let s of e.nextConfig.i18n.locales){let l=new RegExp(`^/${s}($|/)`,"i");if(r.match(l)){r=r.replace(l,"/")||"/";break}}for(let s of n)if(s.regexp.exec(r)){a.name=s.page;break}if(!a.name){let s=C(r);for(let l of t||[]){if(s&&!C(l.page))continue;let p=l.regexp.exec(r);if(p){a={name:l.page,params:p.groups};break}}}let u=await m({waitUntil:g.waitUntil},()=>_ENTRIES[`middleware_${e.name}`].default.call({},{request:{url:i.url,method:i.method,headers:R(i.headers),ip:c(i.headers,"x-real-ip"),geo:{city:c(i.headers,"x-vercel-ip-city",!0),country:c(i.headers,"x-vercel-ip-country",!0),latitude:c(i.headers,"x-vercel-ip-latitude"),longitude:c(i.headers,"x-vercel-ip-longitude"),region:c(i.headers,"x-vercel-ip-country-region",!0)},nextConfig:e.nextConfig,page:a,body:i.body}}));return u.waitUntil&&g.waitUntil(u.waitUntil),u.response}}function c(e,n,t=!1){let o=e.get(n)||void 0;return t&&o?decodeURIComponent(o):o}function C(e){return e==="/api"||e.startsWith("/api/")}\n';
10702
10702
  }
10703
10703
  });
10704
10704
 
@@ -16293,7 +16293,10 @@ ${JSON.stringify(
16293
16293
  )}(?<nextLocale>${i18n.locales.map((locale) => (0, import_escape_string_regexp2.default)(locale)).join("|")})(/.*|$)`,
16294
16294
  dest: import_path5.default.posix.join("/", entryDirectory, "/$nextLocale/404"),
16295
16295
  status: 404,
16296
- caseSensitive: true
16296
+ caseSensitive: true,
16297
+ headers: {
16298
+ "x-next-error-status": "404"
16299
+ }
16297
16300
  },
16298
16301
  {
16299
16302
  src: import_path5.default.posix.join("/", entryDirectory, ".*"),
@@ -16302,7 +16305,10 @@ ${JSON.stringify(
16302
16305
  entryDirectory,
16303
16306
  `/${i18n.defaultLocale}/404`
16304
16307
  ),
16305
- status: 404
16308
+ status: 404,
16309
+ headers: {
16310
+ "x-next-error-status": "404"
16311
+ }
16306
16312
  }
16307
16313
  ] : [
16308
16314
  {
@@ -16319,7 +16325,10 @@ ${JSON.stringify(
16319
16325
  entryDirectory,
16320
16326
  static404Page || hasIsr404Page || lambdas[import_path5.default.posix.join(entryDirectory, "404")] ? "/404" : appPathRoutesManifest && (middleware.edgeFunctions[appNotFoundPath] || lambdas[appNotFoundPath]) ? "/_not-found" : "/_error"
16321
16327
  ),
16322
- status: 404
16328
+ status: 404,
16329
+ headers: {
16330
+ "x-next-error-status": "404"
16331
+ }
16323
16332
  }
16324
16333
  ],
16325
16334
  // custom 500 page if present
@@ -16332,7 +16341,10 @@ ${JSON.stringify(
16332
16341
  )}(?<nextLocale>${i18n.locales.map((locale) => (0, import_escape_string_regexp2.default)(locale)).join("|")})(/.*|$)`,
16333
16342
  dest: import_path5.default.posix.join("/", entryDirectory, "/$nextLocale/500"),
16334
16343
  status: 500,
16335
- caseSensitive: true
16344
+ caseSensitive: true,
16345
+ headers: {
16346
+ "x-next-error-status": "500"
16347
+ }
16336
16348
  },
16337
16349
  {
16338
16350
  src: import_path5.default.posix.join("/", entryDirectory, ".*"),
@@ -16341,7 +16353,10 @@ ${JSON.stringify(
16341
16353
  entryDirectory,
16342
16354
  `/${i18n.defaultLocale}/500`
16343
16355
  ),
16344
- status: 500
16356
+ status: 500,
16357
+ headers: {
16358
+ "x-next-error-status": "500"
16359
+ }
16345
16360
  }
16346
16361
  ] : [
16347
16362
  {
@@ -16358,7 +16373,10 @@ ${JSON.stringify(
16358
16373
  entryDirectory,
16359
16374
  hasStatic500 || hasIsr500Page || lambdas[import_path5.default.posix.join(entryDirectory, "500")] ? "/500" : "/_error"
16360
16375
  ),
16361
- status: 500
16376
+ status: 500,
16377
+ headers: {
16378
+ "x-next-error-status": "500"
16379
+ }
16362
16380
  }
16363
16381
  ]
16364
16382
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/next",
3
- "version": "4.15.11",
3
+ "version": "4.15.12",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -35,7 +35,7 @@
35
35
  "bytes": "3.1.2",
36
36
  "cheerio": "1.0.0-rc.10",
37
37
  "convert-source-map": "1.8.0",
38
- "esbuild": "0.12.22",
38
+ "esbuild": "0.27.0",
39
39
  "escape-string-regexp": "2.0.0",
40
40
  "execa": "2.0.4",
41
41
  "find-up": "4.1.0",
@@ -52,7 +52,7 @@
52
52
  "test-listen": "1.1.0",
53
53
  "text-table": "0.2.0",
54
54
  "webpack-sources": "3.2.3",
55
- "@vercel/build-utils": "13.2.5",
55
+ "@vercel/build-utils": "13.2.6",
56
56
  "@vercel/routing-utils": "5.3.2"
57
57
  },
58
58
  "scripts": {