Update app and tooling
This commit is contained in:
parent
3046531bdd
commit
e620ec7349
4950 changed files with 2975120 additions and 10 deletions
1
node_modules/@vercel/next/dist/___get-nextjs-edge-function.js
generated
vendored
Normal file
1
node_modules/@vercel/next/dist/___get-nextjs-edge-function.js
generated
vendored
Normal file
|
|
@ -0,0 +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"
|
||||
11228
node_modules/@vercel/next/dist/adapter/index.js
generated
vendored
Normal file
11228
node_modules/@vercel/next/dist/adapter/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
323
node_modules/@vercel/next/dist/adapter/node-handler.js
generated
vendored
Normal file
323
node_modules/@vercel/next/dist/adapter/node-handler.js
generated
vendored
Normal file
|
|
@ -0,0 +1,323 @@
|
|||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var node_handler_exports = {};
|
||||
__export(node_handler_exports, {
|
||||
getHandlerSource: () => getHandlerSource
|
||||
});
|
||||
module.exports = __toCommonJS(node_handler_exports);
|
||||
const getHandlerSource = (ctx) => `
|
||||
process.env.NODE_ENV = 'production';
|
||||
require('next/dist/server/node-environment');
|
||||
require('next/dist/server/node-polyfill-crypto');
|
||||
|
||||
try {
|
||||
// this can fail to install if styled-jsx is not discoverable
|
||||
// but this is tolerable as the require-hook is handling edge cases
|
||||
require('next/dist/server/require-hook');
|
||||
} catch (_) {}
|
||||
|
||||
process.chdir(__dirname);
|
||||
|
||||
const _n_handler = (${ctx.isMiddleware ? () => {
|
||||
const path = require("path");
|
||||
const relativeDistDir = process.env.__PRIVATE_RELATIVE_DIST_DIR;
|
||||
const SYMBOL_FOR_REQ_CONTEXT = Symbol.for("@vercel/request-context");
|
||||
function getRequestContext() {
|
||||
const fromSymbol = globalThis;
|
||||
return fromSymbol[SYMBOL_FOR_REQ_CONTEXT]?.get?.() ?? {};
|
||||
}
|
||||
return async function handler(request) {
|
||||
console.log("middleware handler", request);
|
||||
let middlewareHandler = await require("./" + path.posix.join(relativeDistDir, "server", "middleware.js"));
|
||||
middlewareHandler = middlewareHandler.handler || middlewareHandler;
|
||||
const context = getRequestContext();
|
||||
const response = await middlewareHandler(request, {
|
||||
waitUntil: context.waitUntil,
|
||||
requestMeta: {
|
||||
// we use '.' for relative project dir since we process.chdir
|
||||
// to the same directory as the handler file so everything is
|
||||
// relative to that/project dir
|
||||
relativeProjectDir: "."
|
||||
}
|
||||
});
|
||||
return response;
|
||||
};
|
||||
} : (() => {
|
||||
const path = require("path");
|
||||
const relativeDistDir = process.env.__PRIVATE_RELATIVE_DIST_DIR;
|
||||
const prerenderFallbackFalseMap = process.env.__PRIVATE_PRERENDER_FALLBACK_MAP;
|
||||
const {
|
||||
dynamicRoutes: dynamicRoutesRaw,
|
||||
staticRoutes: staticRoutesRaw,
|
||||
i18n
|
||||
} = require("./" + path.posix.join(relativeDistDir, "routes-manifest.json"));
|
||||
const hydrateRoutesManifestItem = (item) => {
|
||||
return {
|
||||
...item,
|
||||
namedRegex: new RegExp(item.namedRegex || item.regex)
|
||||
};
|
||||
};
|
||||
const matchOperatorsRegex = /[|\\{}()[\]^$+*?.-]/g;
|
||||
function escapeStringRegexp(str) {
|
||||
return str.replace(matchOperatorsRegex, "\\$&");
|
||||
}
|
||||
const dynamicRoutes = dynamicRoutesRaw.map(hydrateRoutesManifestItem);
|
||||
const staticRoutes = staticRoutesRaw.map((route) => {
|
||||
return {
|
||||
...route,
|
||||
namedRegex: new RegExp(
|
||||
"^" + escapeStringRegexp(route.page) + "$"
|
||||
)
|
||||
};
|
||||
});
|
||||
let appPathRoutesManifest = {};
|
||||
try {
|
||||
appPathRoutesManifest = require("./" + path.posix.join(
|
||||
relativeDistDir,
|
||||
"app-path-routes-manifest.json"
|
||||
));
|
||||
} catch (_) {
|
||||
}
|
||||
const inversedAppRoutesManifest = Object.entries(
|
||||
appPathRoutesManifest
|
||||
).reduce(
|
||||
(manifest, [originalKey, normalizedKey]) => {
|
||||
manifest[normalizedKey] = originalKey;
|
||||
return manifest;
|
||||
},
|
||||
{}
|
||||
);
|
||||
function normalizeLocalePath(pathname, locales) {
|
||||
if (!locales) return { pathname };
|
||||
const lowercasedLocales = locales.map(
|
||||
(locale) => locale.toLowerCase()
|
||||
);
|
||||
const segments = pathname.split("/", 2);
|
||||
if (!segments[1]) return { pathname };
|
||||
const segment = segments[1].toLowerCase();
|
||||
const index = lowercasedLocales.indexOf(segment);
|
||||
if (index < 0) return { pathname };
|
||||
const detectedLocale = locales[index];
|
||||
pathname = pathname.slice(detectedLocale.length + 1) || "/";
|
||||
return { pathname, locale: detectedLocale };
|
||||
}
|
||||
function normalizeDataPath(pathname) {
|
||||
if (!(pathname || "/").startsWith("/_next/data")) {
|
||||
return pathname;
|
||||
}
|
||||
pathname = pathname.replace(/\/_next\/data\/[^/]{1,}/, "").replace(/\.json$/, "");
|
||||
if (pathname === "/index") {
|
||||
return "/";
|
||||
}
|
||||
return pathname;
|
||||
}
|
||||
function matchUrlToPage(urlPathname) {
|
||||
urlPathname = normalizeDataPath(urlPathname);
|
||||
console.log("before normalize", urlPathname);
|
||||
for (const suffixRegex of [
|
||||
/\.segments(\/.*)\.segment\.rsc$/,
|
||||
/\.rsc$/
|
||||
]) {
|
||||
urlPathname = urlPathname.replace(suffixRegex, "");
|
||||
}
|
||||
const urlPathnameWithLocale = urlPathname;
|
||||
const normalizeResult = normalizeLocalePath(
|
||||
urlPathname,
|
||||
i18n?.locales
|
||||
);
|
||||
urlPathname = normalizeResult.pathname;
|
||||
console.log("after normalize", normalizeResult);
|
||||
urlPathname = urlPathname.replace(/\/$/, "") || "/";
|
||||
const combinedRoutes = [...staticRoutes, ...dynamicRoutes];
|
||||
for (const route of combinedRoutes) {
|
||||
if (route.page === urlPathname) {
|
||||
console.log("matched direct page", route);
|
||||
return {
|
||||
matchedPathname: inversedAppRoutesManifest[route.page] || route.page,
|
||||
locale: normalizeResult.locale
|
||||
};
|
||||
}
|
||||
}
|
||||
for (const route of [...staticRoutes, ...dynamicRoutes]) {
|
||||
console.log("testing", route.namedRegex, "against", urlPathname);
|
||||
const matches = urlPathname.match(route.namedRegex);
|
||||
if (matches || urlPathname === "/index" && route.namedRegex.test("/")) {
|
||||
const fallbackFalseMap = prerenderFallbackFalseMap[route.page];
|
||||
if (fallbackFalseMap && !(fallbackFalseMap.includes(urlPathname) || fallbackFalseMap.includes(urlPathnameWithLocale))) {
|
||||
console.log("fallback: false but not prerendered", {
|
||||
page: route.page,
|
||||
urlPathname,
|
||||
urlPathnameWithLocale,
|
||||
paths: Object.values(fallbackFalseMap)
|
||||
});
|
||||
continue;
|
||||
}
|
||||
console.log("matched route", route, urlPathname, matches);
|
||||
return {
|
||||
matchedPathname: inversedAppRoutesManifest[route.page] || route.page,
|
||||
locale: normalizeResult.locale,
|
||||
matches
|
||||
};
|
||||
}
|
||||
}
|
||||
return {
|
||||
matchedPathname: inversedAppRoutesManifest[urlPathname] || urlPathname,
|
||||
locale: normalizeResult.locale
|
||||
};
|
||||
}
|
||||
const SYMBOL_FOR_REQ_CONTEXT = Symbol.for("@vercel/request-context");
|
||||
function getRequestContext() {
|
||||
const fromSymbol = globalThis;
|
||||
return fromSymbol[SYMBOL_FOR_REQ_CONTEXT]?.get?.() ?? {};
|
||||
}
|
||||
const RouterServerContextSymbol = Symbol.for(
|
||||
"@next/router-server-methods"
|
||||
);
|
||||
const routerServerGlobal = globalThis;
|
||||
if (!routerServerGlobal[RouterServerContextSymbol]) {
|
||||
routerServerGlobal[RouterServerContextSymbol] = {};
|
||||
}
|
||||
routerServerGlobal[RouterServerContextSymbol]["."] = {
|
||||
async render404(req, res) {
|
||||
let mod;
|
||||
try {
|
||||
try {
|
||||
mod = await require("./" + path.posix.join(
|
||||
relativeDistDir,
|
||||
"server",
|
||||
"app",
|
||||
`_not-found`,
|
||||
"page.js"
|
||||
));
|
||||
console.log("using _not-found.js for render404");
|
||||
} catch {
|
||||
}
|
||||
if (!mod) {
|
||||
mod = await require("./" + path.posix.join(
|
||||
relativeDistDir,
|
||||
"server",
|
||||
"pages",
|
||||
`404.js`
|
||||
));
|
||||
console.log("using 404.js for render404");
|
||||
}
|
||||
} catch (_) {
|
||||
mod = await require("./" + path.posix.join(
|
||||
relativeDistDir,
|
||||
"server",
|
||||
"pages",
|
||||
`_error.js`
|
||||
));
|
||||
console.log("using _error for render404");
|
||||
}
|
||||
res.statusCode = 404;
|
||||
if (mod) {
|
||||
await mod.handler(req, res, {
|
||||
waitUntil: getRequestContext().waitUntil
|
||||
});
|
||||
} else {
|
||||
console.log(
|
||||
"failed to find 404 module",
|
||||
await require("fs").promises.readdir(
|
||||
path.posix.join(relativeDistDir, "server", "pages")
|
||||
).catch((err) => err)
|
||||
);
|
||||
res.end("This page could not be found");
|
||||
}
|
||||
}
|
||||
};
|
||||
return async function handler(req, res, internalMetadata) {
|
||||
try {
|
||||
const parsedUrl = new URL(req.url || "/", "http://n");
|
||||
let urlPathname = req.headers["x-matched-path"];
|
||||
if (typeof urlPathname !== "string") {
|
||||
console.log("no x-matched-path", { url: req.url });
|
||||
urlPathname = parsedUrl.pathname || "/";
|
||||
}
|
||||
const {
|
||||
matchedPathname: page,
|
||||
locale,
|
||||
matches
|
||||
} = matchUrlToPage(urlPathname);
|
||||
const isAppDir = page.match(/\/(page|route)$/);
|
||||
let addedMatchesToUrl = false;
|
||||
for (const matchKey in matches?.groups || {}) {
|
||||
const matchValue = matches?.groups?.[matchKey];
|
||||
if (!parsedUrl.searchParams.has(matchKey) && matchValue) {
|
||||
parsedUrl.searchParams.set(matchKey, matchValue);
|
||||
addedMatchesToUrl = true;
|
||||
}
|
||||
}
|
||||
if (addedMatchesToUrl) {
|
||||
console.log("updating URL with new matches", matches, req.url);
|
||||
req.url = `${parsedUrl.pathname}${parsedUrl.searchParams.size > 0 ? "?" : ""}${parsedUrl.searchParams.toString()}`;
|
||||
}
|
||||
console.log("invoking handler", {
|
||||
page,
|
||||
url: req.url,
|
||||
matchedPath: req.headers["x-matched-path"]
|
||||
});
|
||||
const mod = await require("./" + path.posix.join(
|
||||
relativeDistDir,
|
||||
"server",
|
||||
isAppDir ? "app" : "pages",
|
||||
`${page === "/" ? "index" : page}.js`
|
||||
));
|
||||
await mod.handler(req, res, {
|
||||
waitUntil: getRequestContext().waitUntil,
|
||||
requestMeta: {
|
||||
...internalMetadata,
|
||||
minimalMode: true,
|
||||
// we use '.' for relative project dir since we process.chdir
|
||||
// to the same directory as the handler file so everything is
|
||||
// relative to that/project dir
|
||||
relativeProjectDir: ".",
|
||||
locale
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(`Failed to handle ${req.url}`, error);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
}).toString()})()
|
||||
|
||||
module.exports = _n_handler
|
||||
|
||||
${ctx.isMiddleware ? "" : `
|
||||
module.exports.getRequestHandlerWithMetadata = (metadata) => {
|
||||
console.log('using getRequestHandlerWithMetadata', metadata)
|
||||
return (req, res) => _n_handler(req, res, metadata)
|
||||
}
|
||||
`}
|
||||
|
||||
`.replaceAll(
|
||||
"process.env.__PRIVATE_RELATIVE_DIST_DIR",
|
||||
`"${ctx.projectRelativeDistDir}"`
|
||||
).replaceAll(
|
||||
"process.env.__PRIVATE_PRERENDER_FALLBACK_MAP",
|
||||
JSON.stringify(ctx.prerenderFallbackFalseMap)
|
||||
).replaceAll(
|
||||
"process.env.__PRIVATE_NEXT_CONFIG",
|
||||
JSON.stringify(ctx.nextConfig)
|
||||
);
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
getHandlerSource
|
||||
});
|
||||
18620
node_modules/@vercel/next/dist/index.js
generated
vendored
Normal file
18620
node_modules/@vercel/next/dist/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
34
node_modules/@vercel/next/dist/legacy-launcher.js
generated
vendored
Normal file
34
node_modules/@vercel/next/dist/legacy-launcher.js
generated
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var import_next_server = __toESM(require("next-server"));
|
||||
var import_url = __toESM(require("url"));
|
||||
if (!process.env.NODE_ENV) {
|
||||
const region = process.env.VERCEL_REGION || process.env.NOW_REGION;
|
||||
process.env.NODE_ENV = region === "dev1" ? "development" : "production";
|
||||
}
|
||||
const app = (0, import_next_server.default)({});
|
||||
module.exports = (req, res) => {
|
||||
const parsedUrl = import_url.default.parse(req.url || "", true);
|
||||
app.render(req, res, "PATHNAME_PLACEHOLDER", parsedUrl.query, parsedUrl);
|
||||
};
|
||||
BIN
node_modules/@vercel/next/dist/mappings.wasm
generated
vendored
Normal file
BIN
node_modules/@vercel/next/dist/mappings.wasm
generated
vendored
Normal file
Binary file not shown.
135
node_modules/@vercel/next/dist/middleware-launcher.js
generated
vendored
Normal file
135
node_modules/@vercel/next/dist/middleware-launcher.js
generated
vendored
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
"use strict";
|
||||
|
||||
// src/vercel-request-context.ts
|
||||
var SYMBOL_FOR_REQ_CONTEXT = Symbol.for("@vercel/request-context");
|
||||
function getContext() {
|
||||
const fromSymbol = globalThis;
|
||||
return fromSymbol[SYMBOL_FOR_REQ_CONTEXT]?.get?.() ?? {};
|
||||
}
|
||||
|
||||
// src/next-request-context.ts
|
||||
var import_async_hooks = require("async_hooks");
|
||||
var name = "@next/request-context";
|
||||
var NEXT_REQUEST_CONTEXT_SYMBOL = Symbol.for(name);
|
||||
var INTERNAL_STORAGE_FIELD_SYMBOL = Symbol.for("internal.storage");
|
||||
function getOrCreateContextSingleton() {
|
||||
const _globalThis = globalThis;
|
||||
if (!_globalThis[NEXT_REQUEST_CONTEXT_SYMBOL]) {
|
||||
const storage = new import_async_hooks.AsyncLocalStorage();
|
||||
const Context = {
|
||||
get: () => storage.getStore(),
|
||||
[INTERNAL_STORAGE_FIELD_SYMBOL]: storage
|
||||
};
|
||||
_globalThis[NEXT_REQUEST_CONTEXT_SYMBOL] = Context;
|
||||
}
|
||||
return _globalThis[NEXT_REQUEST_CONTEXT_SYMBOL];
|
||||
}
|
||||
var NextRequestContext = getOrCreateContextSingleton();
|
||||
function withNextRequestContext(value, callback) {
|
||||
const storage = NextRequestContext[INTERNAL_STORAGE_FIELD_SYMBOL];
|
||||
return storage.run(value, callback);
|
||||
}
|
||||
|
||||
// src/edge-function-source/to-plain-headers.ts
|
||||
function toPlainHeaders(headers) {
|
||||
const result = {};
|
||||
if (!headers)
|
||||
return result;
|
||||
headers.forEach((value, key) => {
|
||||
result[key] = value;
|
||||
if (key.toLowerCase() === "set-cookie") {
|
||||
result[key] = splitCookiesString(value);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
function splitCookiesString(cookiesString) {
|
||||
const cookiesStrings = [];
|
||||
let pos = 0;
|
||||
let start;
|
||||
let ch;
|
||||
let lastComma;
|
||||
let nextStart;
|
||||
let cookiesSeparatorFound;
|
||||
function skipWhitespace() {
|
||||
while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos)))
|
||||
pos += 1;
|
||||
return pos < cookiesString.length;
|
||||
}
|
||||
function notSpecialChar() {
|
||||
ch = cookiesString.charAt(pos);
|
||||
return ch !== "=" && ch !== ";" && ch !== ",";
|
||||
}
|
||||
while (pos < cookiesString.length) {
|
||||
start = pos;
|
||||
cookiesSeparatorFound = false;
|
||||
while (skipWhitespace()) {
|
||||
ch = cookiesString.charAt(pos);
|
||||
if (ch === ",") {
|
||||
lastComma = pos;
|
||||
pos += 1;
|
||||
skipWhitespace();
|
||||
nextStart = pos;
|
||||
while (pos < cookiesString.length && notSpecialChar()) {
|
||||
pos += 1;
|
||||
}
|
||||
if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
|
||||
cookiesSeparatorFound = true;
|
||||
pos = nextStart;
|
||||
cookiesStrings.push(cookiesString.substring(start, lastComma));
|
||||
start = pos;
|
||||
} else {
|
||||
pos = lastComma + 1;
|
||||
}
|
||||
} else {
|
||||
pos += 1;
|
||||
}
|
||||
}
|
||||
if (!cookiesSeparatorFound || pos >= cookiesString.length) {
|
||||
cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
|
||||
}
|
||||
}
|
||||
return cookiesStrings;
|
||||
}
|
||||
|
||||
// src/middleware-launcher.ts
|
||||
process.chdir(__dirname);
|
||||
var region = process.env.VERCEL_REGION || process.env.NOW_REGION;
|
||||
if (!process.env.NODE_ENV) {
|
||||
process.env.NODE_ENV = region === "dev1" ? "development" : "production";
|
||||
}
|
||||
if (process.env.NODE_ENV !== "production" && region !== "dev1") {
|
||||
console.warn(
|
||||
`Warning: NODE_ENV was incorrectly set to "${process.env.NODE_ENV}", this value is being overridden to "production"`
|
||||
);
|
||||
process.env.NODE_ENV = "production";
|
||||
}
|
||||
var conf = __NEXT_CONFIG__;
|
||||
globalThis.AsyncLocalStorage = require("async_hooks").AsyncLocalStorage;
|
||||
var middlewareModule = require("__NEXT_MIDDLEWARE_PATH__");
|
||||
var serve = async (request) => {
|
||||
const context = getContext();
|
||||
return await withNextRequestContext(
|
||||
{ waitUntil: context.waitUntil },
|
||||
async () => {
|
||||
let middlewareHandler = await middlewareModule;
|
||||
middlewareHandler = middlewareHandler.default || middlewareHandler;
|
||||
const result = await middlewareHandler({
|
||||
request: {
|
||||
url: request.url,
|
||||
method: request.method,
|
||||
headers: toPlainHeaders(request.headers),
|
||||
nextConfig: conf,
|
||||
page: "/middleware",
|
||||
body: request.method !== "GET" && request.method !== "HEAD" ? request.body : void 0,
|
||||
waitUntil: context.waitUntil
|
||||
}
|
||||
});
|
||||
if (result.waitUntil && context.waitUntil) {
|
||||
context.waitUntil(result.waitUntil);
|
||||
}
|
||||
return result.response;
|
||||
}
|
||||
);
|
||||
};
|
||||
module.exports = serve;
|
||||
68
node_modules/@vercel/next/dist/server-launcher.js
generated
vendored
Normal file
68
node_modules/@vercel/next/dist/server-launcher.js
generated
vendored
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
"use strict";
|
||||
|
||||
// src/vercel-request-context.ts
|
||||
var SYMBOL_FOR_REQ_CONTEXT = Symbol.for("@vercel/request-context");
|
||||
function getContext() {
|
||||
const fromSymbol = globalThis;
|
||||
return fromSymbol[SYMBOL_FOR_REQ_CONTEXT]?.get?.() ?? {};
|
||||
}
|
||||
|
||||
// src/next-request-context.ts
|
||||
var import_async_hooks = require("async_hooks");
|
||||
var name = "@next/request-context";
|
||||
var NEXT_REQUEST_CONTEXT_SYMBOL = Symbol.for(name);
|
||||
var INTERNAL_STORAGE_FIELD_SYMBOL = Symbol.for("internal.storage");
|
||||
function getOrCreateContextSingleton() {
|
||||
const _globalThis = globalThis;
|
||||
if (!_globalThis[NEXT_REQUEST_CONTEXT_SYMBOL]) {
|
||||
const storage = new import_async_hooks.AsyncLocalStorage();
|
||||
const Context = {
|
||||
get: () => storage.getStore(),
|
||||
[INTERNAL_STORAGE_FIELD_SYMBOL]: storage
|
||||
};
|
||||
_globalThis[NEXT_REQUEST_CONTEXT_SYMBOL] = Context;
|
||||
}
|
||||
return _globalThis[NEXT_REQUEST_CONTEXT_SYMBOL];
|
||||
}
|
||||
var NextRequestContext = getOrCreateContextSingleton();
|
||||
function withNextRequestContext(value, callback) {
|
||||
const storage = NextRequestContext[INTERNAL_STORAGE_FIELD_SYMBOL];
|
||||
return storage.run(value, callback);
|
||||
}
|
||||
|
||||
// src/server-launcher.ts
|
||||
process.chdir(__dirname);
|
||||
var region = process.env.VERCEL_REGION || process.env.NOW_REGION;
|
||||
if (!process.env.NODE_ENV) {
|
||||
process.env.NODE_ENV = region === "dev1" ? "development" : "production";
|
||||
}
|
||||
if (process.env.NODE_ENV !== "production" && region !== "dev1") {
|
||||
console.warn(
|
||||
`Warning: NODE_ENV was incorrectly set to "${process.env.NODE_ENV}", this value is being overridden to "production"`
|
||||
);
|
||||
process.env.NODE_ENV = "production";
|
||||
}
|
||||
// @preserve pre-next-server-target
|
||||
var NextServer = require("__NEXT_SERVER_PATH__").default;
|
||||
// @preserve next-server-preload-target
|
||||
var conf = __NEXT_CONFIG__;
|
||||
var nextServer = new NextServer({
|
||||
conf,
|
||||
dir: ".",
|
||||
minimalMode: true,
|
||||
customServer: false
|
||||
});
|
||||
var serve = (handler) => async (req, res) => {
|
||||
const vercelContext = getContext();
|
||||
await withNextRequestContext({ waitUntil: vercelContext.waitUntil }, () => {
|
||||
// @preserve entryDirectory handler
|
||||
return handler(req, res);
|
||||
});
|
||||
};
|
||||
module.exports = serve(nextServer.getRequestHandler());
|
||||
if ((conf.experimental?.ppr || conf.experimental?.cacheComponents) && "getRequestHandlerWithMetadata" in nextServer && typeof nextServer.getRequestHandlerWithMetadata === "function") {
|
||||
module.exports.getRequestHandlerWithMetadata = (metadata) => serve(nextServer.getRequestHandlerWithMetadata(metadata));
|
||||
}
|
||||
if (process.env.NEXT_PRIVATE_PRELOAD_ENTRIES) {
|
||||
module.exports.preload = nextServer.unstable_preloadEntries.bind(nextServer);
|
||||
}
|
||||
14
node_modules/@vercel/next/dist/templated-launcher-shared.js
generated
vendored
Normal file
14
node_modules/@vercel/next/dist/templated-launcher-shared.js
generated
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
"use strict";
|
||||
process.chdir(__dirname);
|
||||
const region = process.env.VERCEL_REGION || process.env.NOW_REGION;
|
||||
if (!process.env.NODE_ENV) {
|
||||
process.env.NODE_ENV = region === "dev1" ? "development" : "production";
|
||||
}
|
||||
if (process.env.NODE_ENV !== "production" && region !== "dev1") {
|
||||
console.warn(
|
||||
`Warning: NODE_ENV was incorrectly set to "${process.env.NODE_ENV}", this value is being overridden to "production"`
|
||||
);
|
||||
process.env.NODE_ENV = "production";
|
||||
}
|
||||
let page = {};
|
||||
module.exports = page.render || page.default || page;
|
||||
8
node_modules/@vercel/next/dist/templated-launcher.js
generated
vendored
Normal file
8
node_modules/@vercel/next/dist/templated-launcher.js
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
"use strict";
|
||||
process.chdir(__dirname);
|
||||
if (!process.env.NODE_ENV) {
|
||||
const region = process.env.VERCEL_REGION || process.env.NOW_REGION;
|
||||
process.env.NODE_ENV = region === "dev1" ? "development" : "production";
|
||||
}
|
||||
const page = require(__LAUNCHER_PAGE_PATH__);
|
||||
module.exports = page.render || page.default || page;
|
||||
Loading…
Add table
Add a link
Reference in a new issue