Update app and tooling
This commit is contained in:
parent
3046531bdd
commit
e620ec7349
4950 changed files with 2975120 additions and 10 deletions
202
node_modules/@vercel/next/LICENSE
generated
vendored
Normal file
202
node_modules/@vercel/next/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2017 Vercel, Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
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;
|
||||
69
node_modules/@vercel/next/package.json
generated
vendored
Normal file
69
node_modules/@vercel/next/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
{
|
||||
"name": "@vercel/next",
|
||||
"version": "4.15.19",
|
||||
"license": "Apache-2.0",
|
||||
"main": "./dist/index",
|
||||
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/vercel/vercel.git",
|
||||
"directory": "packages/next"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@vercel/nft": "1.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@next-community/adapter-vercel": "0.0.1-beta.2",
|
||||
"@types/aws-lambda": "8.10.19",
|
||||
"@types/buffer-crc32": "0.2.0",
|
||||
"@types/bytes": "3.1.1",
|
||||
"@types/convert-source-map": "1.5.2",
|
||||
"@types/find-up": "4.0.0",
|
||||
"@types/fs-extra": "8.0.0",
|
||||
"@types/glob": "7.1.3",
|
||||
"@types/jest": "29.5.5",
|
||||
"@types/next-server": "8.0.0",
|
||||
"@types/node": "20.11.0",
|
||||
"@types/resolve-from": "5.0.1",
|
||||
"@types/semver": "6.0.0",
|
||||
"@types/text-table": "0.2.1",
|
||||
"@types/webpack-sources": "3.2.0",
|
||||
"async-sema": "3.0.1",
|
||||
"buffer-crc32": "0.2.13",
|
||||
"bytes": "3.1.2",
|
||||
"cheerio": "1.0.0-rc.10",
|
||||
"convert-source-map": "1.8.0",
|
||||
"esbuild": "0.27.0",
|
||||
"escape-string-regexp": "2.0.0",
|
||||
"execa": "2.0.4",
|
||||
"find-up": "4.1.0",
|
||||
"fs-extra": "11.2.0",
|
||||
"get-port": "5.0.0",
|
||||
"jest-junit": "16.0.0",
|
||||
"nanoid": "3.3.4",
|
||||
"ndjson": "2.0.0",
|
||||
"pretty-bytes": "5.3.0",
|
||||
"resolve-from": "5.0.0",
|
||||
"semver": "6.3.1",
|
||||
"set-cookie-parser": "2.4.6",
|
||||
"source-map": "0.7.4",
|
||||
"test-listen": "1.1.0",
|
||||
"text-table": "0.2.0",
|
||||
"webpack-sources": "3.2.3",
|
||||
"@vercel/build-utils": "13.2.16",
|
||||
"@vercel/routing-utils": "5.3.2"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "node build.mjs",
|
||||
"test": "jest --reporters=default --reporters=jest-junit --env node --verbose --bail --runInBand --testTimeout=360000",
|
||||
"test-unit": "pnpm test test/unit/",
|
||||
"test-next-local": "pnpm test test/integration/*.test.js test/integration/*.test.ts",
|
||||
"test-next-local-legacy": "pnpm test test/integration/legacy/*.test.js",
|
||||
"test-next-local:middleware": "pnpm test test/integration/middleware.test.ts",
|
||||
"test-e2e": "rm -f test/builder-info.json; pnpm test test/fixtures/**/*.test.js",
|
||||
"type-check": "tsc --noEmit"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue