main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

9
node_modules/next/dist/esm/lib/chalk.js generated vendored Normal file
View File

@@ -0,0 +1,9 @@
let chalk;
if (process.env.NEXT_RUNTIME === "edge" || process.env.NEXT_MINIMAL) {
chalk = require("./web/chalk").default;
} else {
chalk = require("next/dist/compiled/chalk");
}
export default chalk;
//# sourceMappingURL=chalk.js.map

1
node_modules/next/dist/esm/lib/chalk.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/chalk.ts"],"names":["chalk","process","env","NEXT_RUNTIME","NEXT_MINIMAL","require","default"],"mappings":"AAAA,IAAIA;AAEJ,IAAIC,QAAQC,GAAG,CAACC,YAAY,KAAK,UAAUF,QAAQC,GAAG,CAACE,YAAY,EAAE;IACnEJ,QAAQK,QAAQ,eAAeC,OAAO;AACxC,OAAO;IACLN,QAAQK,QAAQ;AAClB;AAEA,eAAeL,MAAK"}

5
node_modules/next/dist/esm/lib/client-reference.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
export function isClientReference(reference) {
return (reference == null ? void 0 : reference.$$typeof) === Symbol.for("react.client.reference");
}
//# sourceMappingURL=client-reference.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/client-reference.ts"],"names":["isClientReference","reference","$$typeof","Symbol","for"],"mappings":"AAAA,OAAO,SAASA,kBAAkBC,SAAc;IAC9C,OAAOA,CAAAA,6BAAAA,UAAWC,QAAQ,MAAKC,OAAOC,GAAG,CAAC;AAC5C"}

29
node_modules/next/dist/esm/lib/coalesced-function.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
const globalInvokeCache = new Map();
export function withCoalescedInvoke(func) {
return async function(key, args) {
const entry = globalInvokeCache.get(key);
if (entry) {
return entry.then((res)=>({
isOrigin: false,
value: res.value
}));
}
async function __wrapper() {
return await func.apply(undefined, args);
}
const future = __wrapper().then((res)=>{
globalInvokeCache.delete(key);
return {
isOrigin: true,
value: res
};
}).catch((err)=>{
globalInvokeCache.delete(key);
return Promise.reject(err);
});
globalInvokeCache.set(key, future);
return future;
};
}
//# sourceMappingURL=coalesced-function.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/coalesced-function.ts"],"names":["globalInvokeCache","Map","withCoalescedInvoke","func","key","args","entry","get","then","res","isOrigin","value","__wrapper","apply","undefined","future","delete","catch","err","Promise","reject","set"],"mappings":"AAOA,MAAMA,oBAAoB,IAAIC;AAE9B,OAAO,SAASC,oBACdC,IAAO;IAKP,OAAO,eAAgBC,GAAW,EAAEC,IAAmB;QACrD,MAAMC,QAAQN,kBAAkBO,GAAG,CAACH;QACpC,IAAIE,OAAO;YACT,OAAOA,MAAME,IAAI,CAAC,CAACC,MAAS,CAAA;oBAC1BC,UAAU;oBACVC,OAAOF,IAAIE,KAAK;gBAClB,CAAA;QACF;QAEA,eAAeC;YACb,OAAO,MAAMT,KAAKU,KAAK,CAACC,WAAWT;QACrC;QAEA,MAAMU,SAASH,YACZJ,IAAI,CAAC,CAACC;YACLT,kBAAkBgB,MAAM,CAACZ;YACzB,OAAO;gBAAEM,UAAU;gBAAMC,OAAOF;YAAoC;QACtE,GACCQ,KAAK,CAAC,CAACC;YACNlB,kBAAkBgB,MAAM,CAACZ;YACzB,OAAOe,QAAQC,MAAM,CAACF;QACxB;QACFlB,kBAAkBqB,GAAG,CAACjB,KAAKW;QAC3B,OAAOA;IACT;AACF"}

13
node_modules/next/dist/esm/lib/command-args.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
export const commandArgs = {
build: ()=>require("../cli/next-build-args").validArgs,
start: ()=>require("../cli/next-start-args").validArgs,
export: ()=>require("../cli/next-export-args").validArgs,
dev: ()=>require("../cli/next-dev-args").validArgs,
lint: ()=>require("../cli/next-lint-args").validArgs,
telemetry: ()=>require("../cli/next-telemetry-args").validArgs,
info: ()=>require("../cli/next-info-args").validArgs,
"experimental-compile": ()=>require("../cli/next-build-args").validArgs,
"experimental-generate": ()=>require("../cli/next-build-args").validArgs
};
//# sourceMappingURL=command-args.js.map

1
node_modules/next/dist/esm/lib/command-args.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/command-args.ts"],"names":["commandArgs","build","require","validArgs","start","export","dev","lint","telemetry","info"],"mappings":"AAIA,OAAO,MAAMA,cAET;IACFC,OAAO,IAAMC,QAAQ,0BAA0BC,SAAS;IACxDC,OAAO,IAAMF,QAAQ,0BAA0BC,SAAS;IACxDE,QAAQ,IAAMH,QAAQ,2BAA2BC,SAAS;IAC1DG,KAAK,IAAMJ,QAAQ,wBAAwBC,SAAS;IACpDI,MAAM,IAAML,QAAQ,yBAAyBC,SAAS;IACtDK,WAAW,IAAMN,QAAQ,8BAA8BC,SAAS;IAChEM,MAAM,IAAMP,QAAQ,yBAAyBC,SAAS;IACtD,wBAAwB,IAAMD,QAAQ,0BAA0BC,SAAS;IACzE,yBAAyB,IAAMD,QAAQ,0BAA0BC,SAAS;AAC5E,EAAC"}

13
node_modules/next/dist/esm/lib/commands.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
export const commands = {
build: ()=>Promise.resolve(require("../cli/next-build").nextBuild),
start: ()=>Promise.resolve(require("../cli/next-start").nextStart),
export: ()=>Promise.resolve(require("../cli/next-export").nextExport),
dev: ()=>Promise.resolve(require("../cli/next-dev").nextDev),
lint: ()=>Promise.resolve(require("../cli/next-lint").nextLint),
telemetry: ()=>Promise.resolve(require("../cli/next-telemetry").nextTelemetry),
info: ()=>Promise.resolve(require("../cli/next-info").nextInfo),
"experimental-compile": ()=>Promise.resolve(require("../cli/next-build").nextBuild),
"experimental-generate": ()=>Promise.resolve(require("../cli/next-build").nextBuild)
};
//# sourceMappingURL=commands.js.map

1
node_modules/next/dist/esm/lib/commands.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/commands.ts"],"names":["commands","build","Promise","resolve","require","nextBuild","start","nextStart","export","nextExport","dev","nextDev","lint","nextLint","telemetry","nextTelemetry","info","nextInfo"],"mappings":"AAIA,OAAO,MAAMA,WAA6D;IACxEC,OAAO,IAAMC,QAAQC,OAAO,CAACC,QAAQ,qBAAqBC,SAAS;IACnEC,OAAO,IAAMJ,QAAQC,OAAO,CAACC,QAAQ,qBAAqBG,SAAS;IACnEC,QAAQ,IAAMN,QAAQC,OAAO,CAACC,QAAQ,sBAAsBK,UAAU;IACtEC,KAAK,IAAMR,QAAQC,OAAO,CAACC,QAAQ,mBAAmBO,OAAO;IAC7DC,MAAM,IAAMV,QAAQC,OAAO,CAACC,QAAQ,oBAAoBS,QAAQ;IAChEC,WAAW,IACTZ,QAAQC,OAAO,CAACC,QAAQ,yBAAyBW,aAAa;IAChEC,MAAM,IAAMd,QAAQC,OAAO,CAACC,QAAQ,oBAAoBa,QAAQ;IAChE,wBAAwB,IACtBf,QAAQC,OAAO,CAACC,QAAQ,qBAAqBC,SAAS;IACxD,yBAAyB,IACvBH,QAAQC,OAAO,CAACC,QAAQ,qBAAqBC,SAAS;AAC1D,EAAC"}

4
node_modules/next/dist/esm/lib/compile-error.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
export class CompileError extends Error {
}
//# sourceMappingURL=compile-error.js.map

1
node_modules/next/dist/esm/lib/compile-error.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/compile-error.ts"],"names":["CompileError","Error"],"mappings":"AAAA,OAAO,MAAMA,qBAAqBC;AAAO"}

138
node_modules/next/dist/esm/lib/constants.js generated vendored Normal file
View File

@@ -0,0 +1,138 @@
export const NEXT_QUERY_PARAM_PREFIX = "nxtP";
export const PRERENDER_REVALIDATE_HEADER = "x-prerender-revalidate";
export const PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER = "x-prerender-revalidate-if-generated";
export const NEXT_CACHE_TAGS_HEADER = "x-next-cache-tags";
export const NEXT_CACHE_SOFT_TAGS_HEADER = "x-next-cache-soft-tags";
export const NEXT_CACHE_REVALIDATED_TAGS_HEADER = "x-next-revalidated-tags";
export const NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER = "x-next-revalidate-tag-token";
export const NEXT_CACHE_TAG_MAX_LENGTH = 256;
export const NEXT_CACHE_SOFT_TAG_MAX_LENGTH = 1024;
export const NEXT_CACHE_IMPLICIT_TAG_ID = "_N_T_";
// in seconds
export const CACHE_ONE_YEAR = 31536000;
// Patterns to detect middleware files
export const MIDDLEWARE_FILENAME = "middleware";
export const MIDDLEWARE_LOCATION_REGEXP = `(?:src/)?${MIDDLEWARE_FILENAME}`;
// Pattern to detect instrumentation hooks file
export const INSTRUMENTATION_HOOK_FILENAME = "instrumentation";
// Because on Windows absolute paths in the generated code can break because of numbers, eg 1 in the path,
// we have to use a private alias
export const PAGES_DIR_ALIAS = "private-next-pages";
export const DOT_NEXT_ALIAS = "private-dot-next";
export const ROOT_DIR_ALIAS = "private-next-root-dir";
export const APP_DIR_ALIAS = "private-next-app-dir";
export const RSC_MOD_REF_PROXY_ALIAS = "private-next-rsc-mod-ref-proxy";
export const RSC_ACTION_VALIDATE_ALIAS = "private-next-rsc-action-validate";
export const RSC_ACTION_PROXY_ALIAS = "private-next-rsc-action-proxy";
export const RSC_ACTION_CLIENT_WRAPPER_ALIAS = "private-next-rsc-action-client-wrapper";
export const PUBLIC_DIR_MIDDLEWARE_CONFLICT = `You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict`;
export const SSG_GET_INITIAL_PROPS_CONFLICT = `You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps`;
export const SERVER_PROPS_GET_INIT_PROPS_CONFLICT = `You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.`;
export const SERVER_PROPS_SSG_CONFLICT = `You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps`;
export const STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR = `can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props`;
export const SERVER_PROPS_EXPORT_ERROR = `pages with \`getServerSideProps\` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export`;
export const GSP_NO_RETURNED_VALUE = "Your `getStaticProps` function did not return an object. Did you forget to add a `return`?";
export const GSSP_NO_RETURNED_VALUE = "Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?";
export const UNSTABLE_REVALIDATE_RENAME_ERROR = "The `unstable_revalidate` property is available for general use.\n" + "Please use `revalidate` instead.";
export const GSSP_COMPONENT_MEMBER_ERROR = `can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member`;
export const NON_STANDARD_NODE_ENV = `You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env`;
export const SSG_FALLBACK_EXPORT_ERROR = `Pages with \`fallback\` enabled in \`getStaticPaths\` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export`;
export const ESLINT_DEFAULT_DIRS = [
"app",
"pages",
"components",
"lib",
"src"
];
export const ESLINT_PROMPT_VALUES = [
{
title: "Strict",
recommended: true,
config: {
extends: "next/core-web-vitals"
}
},
{
title: "Base",
config: {
extends: "next"
}
},
{
title: "Cancel",
config: null
}
];
export const SERVER_RUNTIME = {
edge: "edge",
experimentalEdge: "experimental-edge",
nodejs: "nodejs"
};
/**
* The names of the webpack layers. These layers are the primitives for the
* webpack chunks.
*/ const WEBPACK_LAYERS_NAMES = {
/**
* The layer for the shared code between the client and server bundles.
*/ shared: "shared",
/**
* React Server Components layer (rsc).
*/ reactServerComponents: "rsc",
/**
* Server Side Rendering layer for app (ssr).
*/ serverSideRendering: "ssr",
/**
* The browser client bundle layer for actions.
*/ actionBrowser: "action-browser",
/**
* The layer for the API routes.
*/ api: "api",
/**
* The layer for the middleware code.
*/ middleware: "middleware",
/**
* The layer for assets on the edge.
*/ edgeAsset: "edge-asset",
/**
* The browser client bundle layer for App directory.
*/ appPagesBrowser: "app-pages-browser",
/**
* The server bundle layer for metadata routes.
*/ appMetadataRoute: "app-metadata-route",
/**
* The layer for the server bundle for App Route handlers.
*/ appRouteHandler: "app-route-handler"
};
const WEBPACK_LAYERS = {
...WEBPACK_LAYERS_NAMES,
GROUP: {
server: [
WEBPACK_LAYERS_NAMES.reactServerComponents,
WEBPACK_LAYERS_NAMES.actionBrowser,
WEBPACK_LAYERS_NAMES.appMetadataRoute,
WEBPACK_LAYERS_NAMES.appRouteHandler
],
nonClientServerTarget: [
// plus middleware and pages api
WEBPACK_LAYERS_NAMES.middleware,
WEBPACK_LAYERS_NAMES.api
],
app: [
WEBPACK_LAYERS_NAMES.reactServerComponents,
WEBPACK_LAYERS_NAMES.actionBrowser,
WEBPACK_LAYERS_NAMES.appMetadataRoute,
WEBPACK_LAYERS_NAMES.appRouteHandler,
WEBPACK_LAYERS_NAMES.serverSideRendering,
WEBPACK_LAYERS_NAMES.appPagesBrowser
]
}
};
const WEBPACK_RESOURCE_QUERIES = {
edgeSSREntry: "__next_edge_ssr_entry__",
metadata: "__next_metadata__",
metadataRoute: "__next_metadata_route__",
metadataImageMeta: "__next_metadata_image_meta__"
};
export { WEBPACK_LAYERS, WEBPACK_RESOURCE_QUERIES };
//# sourceMappingURL=constants.js.map

1
node_modules/next/dist/esm/lib/constants.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/constants.ts"],"names":["NEXT_QUERY_PARAM_PREFIX","PRERENDER_REVALIDATE_HEADER","PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER","NEXT_CACHE_TAGS_HEADER","NEXT_CACHE_SOFT_TAGS_HEADER","NEXT_CACHE_REVALIDATED_TAGS_HEADER","NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER","NEXT_CACHE_TAG_MAX_LENGTH","NEXT_CACHE_SOFT_TAG_MAX_LENGTH","NEXT_CACHE_IMPLICIT_TAG_ID","CACHE_ONE_YEAR","MIDDLEWARE_FILENAME","MIDDLEWARE_LOCATION_REGEXP","INSTRUMENTATION_HOOK_FILENAME","PAGES_DIR_ALIAS","DOT_NEXT_ALIAS","ROOT_DIR_ALIAS","APP_DIR_ALIAS","RSC_MOD_REF_PROXY_ALIAS","RSC_ACTION_VALIDATE_ALIAS","RSC_ACTION_PROXY_ALIAS","RSC_ACTION_CLIENT_WRAPPER_ALIAS","PUBLIC_DIR_MIDDLEWARE_CONFLICT","SSG_GET_INITIAL_PROPS_CONFLICT","SERVER_PROPS_GET_INIT_PROPS_CONFLICT","SERVER_PROPS_SSG_CONFLICT","STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR","SERVER_PROPS_EXPORT_ERROR","GSP_NO_RETURNED_VALUE","GSSP_NO_RETURNED_VALUE","UNSTABLE_REVALIDATE_RENAME_ERROR","GSSP_COMPONENT_MEMBER_ERROR","NON_STANDARD_NODE_ENV","SSG_FALLBACK_EXPORT_ERROR","ESLINT_DEFAULT_DIRS","ESLINT_PROMPT_VALUES","title","recommended","config","extends","SERVER_RUNTIME","edge","experimentalEdge","nodejs","WEBPACK_LAYERS_NAMES","shared","reactServerComponents","serverSideRendering","actionBrowser","api","middleware","edgeAsset","appPagesBrowser","appMetadataRoute","appRouteHandler","WEBPACK_LAYERS","GROUP","server","nonClientServerTarget","app","WEBPACK_RESOURCE_QUERIES","edgeSSREntry","metadata","metadataRoute","metadataImageMeta"],"mappings":"AAEA,OAAO,MAAMA,0BAA0B,OAAM;AAE7C,OAAO,MAAMC,8BAA8B,yBAAwB;AACnE,OAAO,MAAMC,6CACX,sCAAqC;AAEvC,OAAO,MAAMC,yBAAyB,oBAAmB;AACzD,OAAO,MAAMC,8BAA8B,yBAAwB;AACnE,OAAO,MAAMC,qCAAqC,0BAAyB;AAC3E,OAAO,MAAMC,yCACX,8BAA6B;AAE/B,OAAO,MAAMC,4BAA4B,IAAG;AAC5C,OAAO,MAAMC,iCAAiC,KAAI;AAClD,OAAO,MAAMC,6BAA6B,QAAO;AAEjD,aAAa;AACb,OAAO,MAAMC,iBAAiB,SAAQ;AAEtC,sCAAsC;AACtC,OAAO,MAAMC,sBAAsB,aAAY;AAC/C,OAAO,MAAMC,6BAA6B,CAAC,SAAS,EAAED,oBAAoB,CAAC,CAAA;AAE3E,+CAA+C;AAC/C,OAAO,MAAME,gCAAgC,kBAAiB;AAE9D,0GAA0G;AAC1G,iCAAiC;AACjC,OAAO,MAAMC,kBAAkB,qBAAoB;AACnD,OAAO,MAAMC,iBAAiB,mBAAkB;AAChD,OAAO,MAAMC,iBAAiB,wBAAuB;AACrD,OAAO,MAAMC,gBAAgB,uBAAsB;AACnD,OAAO,MAAMC,0BAA0B,iCAAgC;AACvE,OAAO,MAAMC,4BAA4B,mCAAkC;AAC3E,OAAO,MAAMC,yBAAyB,gCAA+B;AACrE,OAAO,MAAMC,kCACX,yCAAwC;AAE1C,OAAO,MAAMC,iCAAiC,CAAC,6KAA6K,CAAC,CAAA;AAE7N,OAAO,MAAMC,iCAAiC,CAAC,mGAAmG,CAAC,CAAA;AAEnJ,OAAO,MAAMC,uCAAuC,CAAC,uFAAuF,CAAC,CAAA;AAE7I,OAAO,MAAMC,4BAA4B,CAAC,sHAAsH,CAAC,CAAA;AAEjK,OAAO,MAAMC,6CAA6C,CAAC,uGAAuG,CAAC,CAAA;AAEnK,OAAO,MAAMC,4BAA4B,CAAC,uHAAuH,CAAC,CAAA;AAElK,OAAO,MAAMC,wBACX,6FAA4F;AAC9F,OAAO,MAAMC,yBACX,iGAAgG;AAElG,OAAO,MAAMC,mCACX,uEACA,mCAAkC;AAEpC,OAAO,MAAMC,8BAA8B,CAAC,wJAAwJ,CAAC,CAAA;AAErM,OAAO,MAAMC,wBAAwB,CAAC,iNAAiN,CAAC,CAAA;AAExP,OAAO,MAAMC,4BAA4B,CAAC,wJAAwJ,CAAC,CAAA;AAEnM,OAAO,MAAMC,sBAAsB;IAAC;IAAO;IAAS;IAAc;IAAO;CAAM,CAAA;AAE/E,OAAO,MAAMC,uBAAuB;IAClC;QACEC,OAAO;QACPC,aAAa;QACbC,QAAQ;YACNC,SAAS;QACX;IACF;IACA;QACEH,OAAO;QACPE,QAAQ;YACNC,SAAS;QACX;IACF;IACA;QACEH,OAAO;QACPE,QAAQ;IACV;CACD,CAAA;AAED,OAAO,MAAME,iBAAgD;IAC3DC,MAAM;IACNC,kBAAkB;IAClBC,QAAQ;AACV,EAAC;AAED;;;CAGC,GACD,MAAMC,uBAAuB;IAC3B;;GAEC,GACDC,QAAQ;IACR;;GAEC,GACDC,uBAAuB;IACvB;;GAEC,GACDC,qBAAqB;IACrB;;GAEC,GACDC,eAAe;IACf;;GAEC,GACDC,KAAK;IACL;;GAEC,GACDC,YAAY;IACZ;;GAEC,GACDC,WAAW;IACX;;GAEC,GACDC,iBAAiB;IACjB;;GAEC,GACDC,kBAAkB;IAClB;;GAEC,GACDC,iBAAiB;AACnB;AAKA,MAAMC,iBAAiB;IACrB,GAAGX,oBAAoB;IACvBY,OAAO;QACLC,QAAQ;YACNb,qBAAqBE,qBAAqB;YAC1CF,qBAAqBI,aAAa;YAClCJ,qBAAqBS,gBAAgB;YACrCT,qBAAqBU,eAAe;SACrC;QACDI,uBAAuB;YACrB,gCAAgC;YAChCd,qBAAqBM,UAAU;YAC/BN,qBAAqBK,GAAG;SACzB;QACDU,KAAK;YACHf,qBAAqBE,qBAAqB;YAC1CF,qBAAqBI,aAAa;YAClCJ,qBAAqBS,gBAAgB;YACrCT,qBAAqBU,eAAe;YACpCV,qBAAqBG,mBAAmB;YACxCH,qBAAqBQ,eAAe;SACrC;IACH;AACF;AAEA,MAAMQ,2BAA2B;IAC/BC,cAAc;IACdC,UAAU;IACVC,eAAe;IACfC,mBAAmB;AACrB;AAEA,SAAST,cAAc,EAAEK,wBAAwB,GAAE"}

View File

@@ -0,0 +1,53 @@
import { BloomFilter } from "../shared/lib/bloom-filter";
import { isDynamicRoute } from "../shared/lib/router/utils";
import { removeTrailingSlash } from "../shared/lib/router/utils/remove-trailing-slash";
import { tryToParsePath } from "./try-to-parse-path";
export function createClientRouterFilter(paths, redirects, allowedErrorRate) {
const staticPaths = new Set();
const dynamicPaths = new Set();
for (const path of paths){
if (isDynamicRoute(path)) {
let subPath = "";
const pathParts = path.split("/");
// start at 1 since we split on '/' and the path starts
// with this so the first entry is an empty string
for(let i = 1; i < pathParts.length + 1; i++){
const curPart = pathParts[i];
if (curPart.startsWith("[")) {
break;
}
subPath = `${subPath}/${curPart}`;
}
if (subPath) {
dynamicPaths.add(subPath);
}
} else {
staticPaths.add(path);
}
}
for (const redirect of redirects){
const { source } = redirect;
const path = removeTrailingSlash(source);
let tokens = [];
try {
tokens = tryToParsePath(source).tokens || [];
} catch {}
if (tokens.every((token)=>typeof token === "string")) {
// only include static redirects initially
staticPaths.add(path);
}
}
const staticFilter = BloomFilter.from([
...staticPaths
], allowedErrorRate);
const dynamicFilter = BloomFilter.from([
...dynamicPaths
], allowedErrorRate);
const data = {
staticFilter: staticFilter.export(),
dynamicFilter: dynamicFilter.export()
};
return data;
}
//# sourceMappingURL=create-client-router-filter.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/create-client-router-filter.ts"],"names":["BloomFilter","isDynamicRoute","removeTrailingSlash","tryToParsePath","createClientRouterFilter","paths","redirects","allowedErrorRate","staticPaths","Set","dynamicPaths","path","subPath","pathParts","split","i","length","curPart","startsWith","add","redirect","source","tokens","every","token","staticFilter","from","dynamicFilter","data","export"],"mappings":"AACA,SAASA,WAAW,QAAQ,6BAA4B;AACxD,SAASC,cAAc,QAAQ,6BAA4B;AAC3D,SAASC,mBAAmB,QAAQ,mDAAkD;AAEtF,SAASC,cAAc,QAAQ,sBAAqB;AAEpD,OAAO,SAASC,yBACdC,KAAe,EACfC,SAAqB,EACrBC,gBAAyB;IAKzB,MAAMC,cAAc,IAAIC;IACxB,MAAMC,eAAe,IAAID;IAEzB,KAAK,MAAME,QAAQN,MAAO;QACxB,IAAIJ,eAAeU,OAAO;YACxB,IAAIC,UAAU;YACd,MAAMC,YAAYF,KAAKG,KAAK,CAAC;YAE7B,uDAAuD;YACvD,kDAAkD;YAClD,IAAK,IAAIC,IAAI,GAAGA,IAAIF,UAAUG,MAAM,GAAG,GAAGD,IAAK;gBAC7C,MAAME,UAAUJ,SAAS,CAACE,EAAE;gBAE5B,IAAIE,QAAQC,UAAU,CAAC,MAAM;oBAC3B;gBACF;gBACAN,UAAU,CAAC,EAAEA,QAAQ,CAAC,EAAEK,QAAQ,CAAC;YACnC;YAEA,IAAIL,SAAS;gBACXF,aAAaS,GAAG,CAACP;YACnB;QACF,OAAO;YACLJ,YAAYW,GAAG,CAACR;QAClB;IACF;IAEA,KAAK,MAAMS,YAAYd,UAAW;QAChC,MAAM,EAAEe,MAAM,EAAE,GAAGD;QACnB,MAAMT,OAAOT,oBAAoBmB;QACjC,IAAIC,SAAkB,EAAE;QAExB,IAAI;YACFA,SAASnB,eAAekB,QAAQC,MAAM,IAAI,EAAE;QAC9C,EAAE,OAAM,CAAC;QAET,IAAIA,OAAOC,KAAK,CAAC,CAACC,QAAU,OAAOA,UAAU,WAAW;YACtD,0CAA0C;YAC1ChB,YAAYW,GAAG,CAACR;QAClB;IACF;IAEA,MAAMc,eAAezB,YAAY0B,IAAI,CAAC;WAAIlB;KAAY,EAAED;IAExD,MAAMoB,gBAAgB3B,YAAY0B,IAAI,CAAC;WAAIhB;KAAa,EAAEH;IAC1D,MAAMqB,OAAO;QACXH,cAAcA,aAAaI,MAAM;QACjCF,eAAeA,cAAcE,MAAM;IACrC;IACA,OAAOD;AACT"}

41
node_modules/next/dist/esm/lib/detect-typo.js generated vendored Normal file
View File

@@ -0,0 +1,41 @@
// the minimum number of operations required to convert string a to string b.
function minDistance(a, b, threshold) {
const m = a.length;
const n = b.length;
if (m < n) {
return minDistance(b, a, threshold);
}
if (n === 0) {
return m;
}
let previousRow = Array.from({
length: n + 1
}, (_, i)=>i);
for(let i = 0; i < m; i++){
const s1 = a[i];
let currentRow = [
i + 1
];
for(let j = 0; j < n; j++){
const s2 = b[j];
const insertions = previousRow[j + 1] + 1;
const deletions = currentRow[j] + 1;
const substitutions = previousRow[j] + Number(s1 !== s2);
currentRow.push(Math.min(insertions, deletions, substitutions));
}
previousRow = currentRow;
}
return previousRow[previousRow.length - 1];
}
export function detectTypo(input, options, threshold = 2) {
const potentialTypos = options.map((o)=>({
option: o,
distance: minDistance(o, input, threshold)
})).filter(({ distance })=>distance <= threshold && distance > 0).sort((a, b)=>a.distance - b.distance);
if (potentialTypos.length) {
return potentialTypos[0].option;
}
return null;
}
//# sourceMappingURL=detect-typo.js.map

1
node_modules/next/dist/esm/lib/detect-typo.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/detect-typo.ts"],"names":["minDistance","a","b","threshold","m","length","n","previousRow","Array","from","_","i","s1","currentRow","j","s2","insertions","deletions","substitutions","Number","push","Math","min","detectTypo","input","options","potentialTypos","map","o","option","distance","filter","sort"],"mappings":"AAAA,6EAA6E;AAC7E,SAASA,YAAYC,CAAS,EAAEC,CAAS,EAAEC,SAAiB;IAC1D,MAAMC,IAAIH,EAAEI,MAAM;IAClB,MAAMC,IAAIJ,EAAEG,MAAM;IAElB,IAAID,IAAIE,GAAG;QACT,OAAON,YAAYE,GAAGD,GAAGE;IAC3B;IAEA,IAAIG,MAAM,GAAG;QACX,OAAOF;IACT;IAEA,IAAIG,cAAcC,MAAMC,IAAI,CAAC;QAAEJ,QAAQC,IAAI;IAAE,GAAG,CAACI,GAAGC,IAAMA;IAE1D,IAAK,IAAIA,IAAI,GAAGA,IAAIP,GAAGO,IAAK;QAC1B,MAAMC,KAAKX,CAAC,CAACU,EAAE;QACf,IAAIE,aAAa;YAACF,IAAI;SAAE;QACxB,IAAK,IAAIG,IAAI,GAAGA,IAAIR,GAAGQ,IAAK;YAC1B,MAAMC,KAAKb,CAAC,CAACY,EAAE;YACf,MAAME,aAAaT,WAAW,CAACO,IAAI,EAAE,GAAG;YACxC,MAAMG,YAAYJ,UAAU,CAACC,EAAE,GAAG;YAClC,MAAMI,gBAAgBX,WAAW,CAACO,EAAE,GAAGK,OAAOP,OAAOG;YACrDF,WAAWO,IAAI,CAACC,KAAKC,GAAG,CAACN,YAAYC,WAAWC;QAClD;QACAX,cAAcM;IAChB;IACA,OAAON,WAAW,CAACA,YAAYF,MAAM,GAAG,EAAE;AAC5C;AAEA,OAAO,SAASkB,WAAWC,KAAa,EAAEC,OAAiB,EAAEtB,YAAY,CAAC;IACxE,MAAMuB,iBAAiBD,QACpBE,GAAG,CAAC,CAACC,IAAO,CAAA;YACXC,QAAQD;YACRE,UAAU9B,YAAY4B,GAAGJ,OAAOrB;QAClC,CAAA,GACC4B,MAAM,CAAC,CAAC,EAAED,QAAQ,EAAE,GAAKA,YAAY3B,aAAa2B,WAAW,GAC7DE,IAAI,CAAC,CAAC/B,GAAGC,IAAMD,EAAE6B,QAAQ,GAAG5B,EAAE4B,QAAQ;IAEzC,IAAIJ,eAAerB,MAAM,EAAE;QACzB,OAAOqB,cAAc,CAAC,EAAE,CAACG,MAAM;IACjC;IACA,OAAO;AACT"}

95
node_modules/next/dist/esm/lib/download-swc.js generated vendored Normal file
View File

@@ -0,0 +1,95 @@
import fs from "fs";
import path from "path";
import * as Log from "../build/output/log";
import tar from "next/dist/compiled/tar";
const { fetch } = require("next/dist/compiled/undici");
const { WritableStream } = require("node:stream/web");
import { fileExists } from "./file-exists";
import { getRegistry } from "./helpers/get-registry";
import { getCacheDirectory } from "./helpers/get-cache-directory";
const MAX_VERSIONS_TO_CACHE = 8;
async function extractBinary(outputDirectory, pkgName, tarFileName) {
const cacheDirectory = await getCacheDirectory("next-swc", process.env["NEXT_SWC_PATH"]);
const extractFromTar = async ()=>{
await tar.x({
file: path.join(cacheDirectory, tarFileName),
cwd: outputDirectory,
strip: 1
});
};
if (!await fileExists(path.join(cacheDirectory, tarFileName))) {
Log.info(`Downloading swc package ${pkgName}...`);
await fs.promises.mkdir(cacheDirectory, {
recursive: true
});
const tempFile = path.join(cacheDirectory, `${tarFileName}.temp-${Date.now()}`);
const registry = getRegistry();
const downloadUrl = `${registry}${pkgName}/-/${tarFileName}`;
await fetch(downloadUrl).then((res)=>{
const { ok, body } = res;
if (!ok || !body) {
Log.error(`Failed to download swc package from ${downloadUrl}`);
}
if (!ok) {
throw new Error(`request failed with status ${res.status}`);
}
if (!body) {
throw new Error("request failed with empty body");
}
const cacheWriteStream = fs.createWriteStream(tempFile);
return body.pipeTo(new WritableStream({
write (chunk) {
cacheWriteStream.write(chunk);
},
close () {
cacheWriteStream.close();
}
}));
});
await fs.promises.rename(tempFile, path.join(cacheDirectory, tarFileName));
}
await extractFromTar();
const cacheFiles = await fs.promises.readdir(cacheDirectory);
if (cacheFiles.length > MAX_VERSIONS_TO_CACHE) {
cacheFiles.sort((a, b)=>{
if (a.length < b.length) return -1;
return a.localeCompare(b);
});
// prune oldest versions in cache
for(let i = 0; i++; i < cacheFiles.length - MAX_VERSIONS_TO_CACHE){
await fs.promises.unlink(path.join(cacheDirectory, cacheFiles[i])).catch(()=>{});
}
}
}
export async function downloadNativeNextSwc(version, bindingsDirectory, triplesABI) {
for (const triple of triplesABI){
const pkgName = `@next/swc-${triple}`;
const tarFileName = `${pkgName.substring(6)}-${version}.tgz`;
const outputDirectory = path.join(bindingsDirectory, pkgName);
if (await fileExists(outputDirectory)) {
// if the package is already downloaded a different
// failure occurred than not being present
return;
}
await fs.promises.mkdir(outputDirectory, {
recursive: true
});
await extractBinary(outputDirectory, pkgName, tarFileName);
}
}
export async function downloadWasmSwc(version, wasmDirectory, variant = "nodejs") {
const pkgName = `@next/swc-wasm-${variant}`;
const tarFileName = `${pkgName.substring(6)}-${version}.tgz`;
const outputDirectory = path.join(wasmDirectory, pkgName);
if (await fileExists(outputDirectory)) {
// if the package is already downloaded a different
// failure occurred than not being present
return;
}
await fs.promises.mkdir(outputDirectory, {
recursive: true
});
await extractBinary(outputDirectory, pkgName, tarFileName);
}
//# sourceMappingURL=download-swc.js.map

1
node_modules/next/dist/esm/lib/download-swc.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/download-swc.ts"],"names":["fs","path","Log","tar","fetch","require","WritableStream","fileExists","getRegistry","getCacheDirectory","MAX_VERSIONS_TO_CACHE","extractBinary","outputDirectory","pkgName","tarFileName","cacheDirectory","process","env","extractFromTar","x","file","join","cwd","strip","info","promises","mkdir","recursive","tempFile","Date","now","registry","downloadUrl","then","res","ok","body","error","Error","status","cacheWriteStream","createWriteStream","pipeTo","write","chunk","close","rename","cacheFiles","readdir","length","sort","a","b","localeCompare","i","unlink","catch","downloadNativeNextSwc","version","bindingsDirectory","triplesABI","triple","substring","downloadWasmSwc","wasmDirectory","variant"],"mappings":"AAAA,OAAOA,QAAQ,KAAI;AACnB,OAAOC,UAAU,OAAM;AACvB,YAAYC,SAAS,sBAAqB;AAC1C,OAAOC,SAAS,yBAAwB;AACxC,MAAM,EAAEC,KAAK,EAAE,GAAGC,QAAQ;AAG1B,MAAM,EAAEC,cAAc,EAAE,GAAGD,QAAQ;AAGnC,SAASE,UAAU,QAAQ,gBAAe;AAC1C,SAASC,WAAW,QAAQ,yBAAwB;AACpD,SAASC,iBAAiB,QAAQ,gCAA+B;AAEjE,MAAMC,wBAAwB;AAE9B,eAAeC,cACbC,eAAuB,EACvBC,OAAe,EACfC,WAAmB;IAEnB,MAAMC,iBAAiB,MAAMN,kBAC3B,YACAO,QAAQC,GAAG,CAAC,gBAAgB;IAG9B,MAAMC,iBAAiB;QACrB,MAAMf,IAAIgB,CAAC,CAAC;YACVC,MAAMnB,KAAKoB,IAAI,CAACN,gBAAgBD;YAChCQ,KAAKV;YACLW,OAAO;QACT;IACF;IAEA,IAAI,CAAE,MAAMhB,WAAWN,KAAKoB,IAAI,CAACN,gBAAgBD,eAAgB;QAC/DZ,IAAIsB,IAAI,CAAC,CAAC,wBAAwB,EAAEX,QAAQ,GAAG,CAAC;QAChD,MAAMb,GAAGyB,QAAQ,CAACC,KAAK,CAACX,gBAAgB;YAAEY,WAAW;QAAK;QAC1D,MAAMC,WAAW3B,KAAKoB,IAAI,CACxBN,gBACA,CAAC,EAAED,YAAY,MAAM,EAAEe,KAAKC,GAAG,GAAG,CAAC;QAGrC,MAAMC,WAAWvB;QAEjB,MAAMwB,cAAc,CAAC,EAAED,SAAS,EAAElB,QAAQ,GAAG,EAAEC,YAAY,CAAC;QAE5D,MAAMV,MAAM4B,aAAaC,IAAI,CAAC,CAACC;YAC7B,MAAM,EAAEC,EAAE,EAAEC,IAAI,EAAE,GAAGF;YACrB,IAAI,CAACC,MAAM,CAACC,MAAM;gBAChBlC,IAAImC,KAAK,CAAC,CAAC,oCAAoC,EAAEL,YAAY,CAAC;YAChE;YAEA,IAAI,CAACG,IAAI;gBACP,MAAM,IAAIG,MAAM,CAAC,2BAA2B,EAAEJ,IAAIK,MAAM,CAAC,CAAC;YAC5D;YACA,IAAI,CAACH,MAAM;gBACT,MAAM,IAAIE,MAAM;YAClB;YACA,MAAME,mBAAmBxC,GAAGyC,iBAAiB,CAACb;YAC9C,OAAOQ,KAAKM,MAAM,CAChB,IAAIpC,eAAe;gBACjBqC,OAAMC,KAAK;oBACTJ,iBAAiBG,KAAK,CAACC;gBACzB;gBACAC;oBACEL,iBAAiBK,KAAK;gBACxB;YACF;QAEJ;QACA,MAAM7C,GAAGyB,QAAQ,CAACqB,MAAM,CAAClB,UAAU3B,KAAKoB,IAAI,CAACN,gBAAgBD;IAC/D;IACA,MAAMI;IAEN,MAAM6B,aAAa,MAAM/C,GAAGyB,QAAQ,CAACuB,OAAO,CAACjC;IAE7C,IAAIgC,WAAWE,MAAM,GAAGvC,uBAAuB;QAC7CqC,WAAWG,IAAI,CAAC,CAACC,GAAGC;YAClB,IAAID,EAAEF,MAAM,GAAGG,EAAEH,MAAM,EAAE,OAAO,CAAC;YACjC,OAAOE,EAAEE,aAAa,CAACD;QACzB;QAEA,iCAAiC;QACjC,IAAK,IAAIE,IAAI,GAAGA,KAAKA,IAAIP,WAAWE,MAAM,GAAGvC,sBAAuB;YAClE,MAAMV,GAAGyB,QAAQ,CACd8B,MAAM,CAACtD,KAAKoB,IAAI,CAACN,gBAAgBgC,UAAU,CAACO,EAAE,GAC9CE,KAAK,CAAC,KAAO;QAClB;IACF;AACF;AAEA,OAAO,eAAeC,sBACpBC,OAAe,EACfC,iBAAyB,EACzBC,UAAyB;IAEzB,KAAK,MAAMC,UAAUD,WAAY;QAC/B,MAAM/C,UAAU,CAAC,UAAU,EAAEgD,OAAO,CAAC;QACrC,MAAM/C,cAAc,CAAC,EAAED,QAAQiD,SAAS,CAAC,GAAG,CAAC,EAAEJ,QAAQ,IAAI,CAAC;QAC5D,MAAM9C,kBAAkBX,KAAKoB,IAAI,CAACsC,mBAAmB9C;QAErD,IAAI,MAAMN,WAAWK,kBAAkB;YACrC,mDAAmD;YACnD,0CAA0C;YAC1C;QACF;QAEA,MAAMZ,GAAGyB,QAAQ,CAACC,KAAK,CAACd,iBAAiB;YAAEe,WAAW;QAAK;QAC3D,MAAMhB,cAAcC,iBAAiBC,SAASC;IAChD;AACF;AAEA,OAAO,eAAeiD,gBACpBL,OAAe,EACfM,aAAqB,EACrBC,UAA4B,QAAQ;IAEpC,MAAMpD,UAAU,CAAC,eAAe,EAAEoD,QAAQ,CAAC;IAC3C,MAAMnD,cAAc,CAAC,EAAED,QAAQiD,SAAS,CAAC,GAAG,CAAC,EAAEJ,QAAQ,IAAI,CAAC;IAC5D,MAAM9C,kBAAkBX,KAAKoB,IAAI,CAAC2C,eAAenD;IAEjD,IAAI,MAAMN,WAAWK,kBAAkB;QACrC,mDAAmD;QACnD,0CAA0C;QAC1C;IACF;IAEA,MAAMZ,GAAGyB,QAAQ,CAACC,KAAK,CAACd,iBAAiB;QAAEe,WAAW;IAAK;IAC3D,MAAMhB,cAAcC,iBAAiBC,SAASC;AAChD"}

View File

@@ -0,0 +1,70 @@
import chalk from "next/dist/compiled/chalk";
import path from "path";
export var MessageSeverity;
(function(MessageSeverity) {
MessageSeverity[MessageSeverity["Warning"] = 1] = "Warning";
MessageSeverity[MessageSeverity["Error"] = 2] = "Error";
})(MessageSeverity || (MessageSeverity = {}));
function pluginCount(messages) {
let nextPluginWarningCount = 0;
let nextPluginErrorCount = 0;
for(let i = 0; i < messages.length; i++){
const { severity, ruleId } = messages[i];
if (ruleId == null ? void 0 : ruleId.includes("@next/next")) {
if (severity === 1) {
nextPluginWarningCount += 1;
} else {
nextPluginErrorCount += 1;
}
}
}
return {
nextPluginErrorCount,
nextPluginWarningCount
};
}
function formatMessage(dir, messages, filePath) {
let fileName = path.posix.normalize(path.relative(dir, filePath).replace(/\\/g, "/"));
if (!fileName.startsWith(".")) {
fileName = "./" + fileName;
}
let output = "\n" + chalk.cyan(fileName);
for(let i = 0; i < messages.length; i++){
const { message, severity, line, column, ruleId } = messages[i];
output = output + "\n";
if (line && column) {
output = output + chalk.yellow(line.toString()) + ":" + chalk.yellow(column.toString()) + " ";
}
if (severity === 1) {
output += chalk.yellow.bold("Warning") + ": ";
} else {
output += chalk.red.bold("Error") + ": ";
}
output += message;
if (ruleId) {
output += " " + chalk.gray.bold(ruleId);
}
}
return output;
}
export function formatResults(baseDir, results, format) {
let totalNextPluginErrorCount = 0;
let totalNextPluginWarningCount = 0;
let resultsWithMessages = results.filter(({ messages })=>messages == null ? void 0 : messages.length);
// Track number of Next.js plugin errors and warnings
resultsWithMessages.forEach(({ messages })=>{
const res = pluginCount(messages);
totalNextPluginErrorCount += res.nextPluginErrorCount;
totalNextPluginWarningCount += res.nextPluginWarningCount;
});
// Use user defined formatter or Next.js's built-in custom formatter
const output = format ? format(resultsWithMessages) : resultsWithMessages.map(({ messages, filePath })=>formatMessage(baseDir, messages, filePath)).join("\n");
return {
output: output,
outputWithMessages: resultsWithMessages.length > 0 ? output + `\n\n${chalk.cyan("info")} - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules` : "",
totalNextPluginErrorCount,
totalNextPluginWarningCount
};
}
//# sourceMappingURL=customFormatter.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/eslint/customFormatter.ts"],"names":["chalk","path","MessageSeverity","Warning","Error","pluginCount","messages","nextPluginWarningCount","nextPluginErrorCount","i","length","severity","ruleId","includes","formatMessage","dir","filePath","fileName","posix","normalize","relative","replace","startsWith","output","cyan","message","line","column","yellow","toString","bold","red","gray","formatResults","baseDir","results","format","totalNextPluginErrorCount","totalNextPluginWarningCount","resultsWithMessages","filter","forEach","res","map","join","outputWithMessages"],"mappings":"AAAA,OAAOA,WAAW,2BAA0B;AAC5C,OAAOC,UAAU,OAAM;WAGhB;UAAKC,eAAe;IAAfA,gBAAAA,gBACVC,aAAU,KAAVA;IADUD,gBAAAA,gBAEVE,WAAQ,KAARA;GAFUF,oBAAAA;AAsBZ,SAASG,YAAYC,QAAuB;IAI1C,IAAIC,yBAAyB;IAC7B,IAAIC,uBAAuB;IAE3B,IAAK,IAAIC,IAAI,GAAGA,IAAIH,SAASI,MAAM,EAAED,IAAK;QACxC,MAAM,EAAEE,QAAQ,EAAEC,MAAM,EAAE,GAAGN,QAAQ,CAACG,EAAE;QAExC,IAAIG,0BAAAA,OAAQC,QAAQ,CAAC,eAAe;YAClC,IAAIF,aAhCE,GAgCoC;gBACxCJ,0BAA0B;YAC5B,OAAO;gBACLC,wBAAwB;YAC1B;QACF;IACF;IAEA,OAAO;QACLA;QACAD;IACF;AACF;AAEA,SAASO,cACPC,GAAW,EACXT,QAAuB,EACvBU,QAAgB;IAEhB,IAAIC,WAAWhB,KAAKiB,KAAK,CAACC,SAAS,CACjClB,KAAKmB,QAAQ,CAACL,KAAKC,UAAUK,OAAO,CAAC,OAAO;IAG9C,IAAI,CAACJ,SAASK,UAAU,CAAC,MAAM;QAC7BL,WAAW,OAAOA;IACpB;IAEA,IAAIM,SAAS,OAAOvB,MAAMwB,IAAI,CAACP;IAE/B,IAAK,IAAIR,IAAI,GAAGA,IAAIH,SAASI,MAAM,EAAED,IAAK;QACxC,MAAM,EAAEgB,OAAO,EAAEd,QAAQ,EAAEe,IAAI,EAAEC,MAAM,EAAEf,MAAM,EAAE,GAAGN,QAAQ,CAACG,EAAE;QAE/Dc,SAASA,SAAS;QAElB,IAAIG,QAAQC,QAAQ;YAClBJ,SACEA,SACAvB,MAAM4B,MAAM,CAACF,KAAKG,QAAQ,MAC1B,MACA7B,MAAM4B,MAAM,CAACD,OAAOE,QAAQ,MAC5B;QACJ;QAEA,IAAIlB,aA3EI,GA2EkC;YACxCY,UAAUvB,MAAM4B,MAAM,CAACE,IAAI,CAAC,aAAa;QAC3C,OAAO;YACLP,UAAUvB,MAAM+B,GAAG,CAACD,IAAI,CAAC,WAAW;QACtC;QAEAP,UAAUE;QAEV,IAAIb,QAAQ;YACVW,UAAU,OAAOvB,MAAMgC,IAAI,CAACF,IAAI,CAAClB;QACnC;IACF;IAEA,OAAOW;AACT;AAEA,OAAO,SAASU,cACdC,OAAe,EACfC,OAAqB,EACrBC,MAAmC;IAOnC,IAAIC,4BAA4B;IAChC,IAAIC,8BAA8B;IAClC,IAAIC,sBAAsBJ,QAAQK,MAAM,CAAC,CAAC,EAAElC,QAAQ,EAAE,GAAKA,4BAAAA,SAAUI,MAAM;IAE3E,qDAAqD;IACrD6B,oBAAoBE,OAAO,CAAC,CAAC,EAAEnC,QAAQ,EAAE;QACvC,MAAMoC,MAAMrC,YAAYC;QACxB+B,6BAA6BK,IAAIlC,oBAAoB;QACrD8B,+BAA+BI,IAAInC,sBAAsB;IAC3D;IAEA,oEAAoE;IACpE,MAAMgB,SAASa,SACXA,OAAOG,uBACPA,oBACGI,GAAG,CAAC,CAAC,EAAErC,QAAQ,EAAEU,QAAQ,EAAE,GAC1BF,cAAcoB,SAAS5B,UAAUU,WAElC4B,IAAI,CAAC;IAEZ,OAAO;QACLrB,QAAQA;QACRsB,oBACEN,oBAAoB7B,MAAM,GAAG,IACzBa,SACA,CAAC,IAAI,EAAEvB,MAAMwB,IAAI,CACf,QACA,qHAAqH,CAAC,GACxH;QACNa;QACAC;IACF;AACF"}

View File

@@ -0,0 +1,27 @@
import { promises as fs } from "fs";
export async function hasEslintConfiguration(eslintrcFile, packageJsonConfig) {
const configObject = {
exists: false,
emptyEslintrc: false,
emptyPkgJsonConfig: false
};
if (eslintrcFile) {
const content = await fs.readFile(eslintrcFile, {
encoding: "utf8"
}).then((txt)=>txt.trim().replace(/\n/g, ""), ()=>null);
if (content === "" || content === "{}" || content === "---" || content === "module.exports = {}") {
configObject.emptyEslintrc = true;
} else {
configObject.exists = true;
}
} else if (packageJsonConfig == null ? void 0 : packageJsonConfig.eslintConfig) {
if (Object.keys(packageJsonConfig.eslintConfig).length) {
configObject.exists = true;
} else {
configObject.emptyPkgJsonConfig = true;
}
}
return configObject;
}
//# sourceMappingURL=hasEslintConfiguration.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/eslint/hasEslintConfiguration.ts"],"names":["promises","fs","hasEslintConfiguration","eslintrcFile","packageJsonConfig","configObject","exists","emptyEslintrc","emptyPkgJsonConfig","content","readFile","encoding","then","txt","trim","replace","eslintConfig","Object","keys","length"],"mappings":"AAAA,SAASA,YAAYC,EAAE,QAAQ,KAAI;AASnC,OAAO,eAAeC,uBACpBC,YAA2B,EAC3BC,iBAA+C;IAE/C,MAAMC,eAAe;QACnBC,QAAQ;QACRC,eAAe;QACfC,oBAAoB;IACtB;IAEA,IAAIL,cAAc;QAChB,MAAMM,UAAU,MAAMR,GAAGS,QAAQ,CAACP,cAAc;YAAEQ,UAAU;QAAO,GAAGC,IAAI,CACxE,CAACC,MAAQA,IAAIC,IAAI,GAAGC,OAAO,CAAC,OAAO,KACnC,IAAM;QAGR,IACEN,YAAY,MACZA,YAAY,QACZA,YAAY,SACZA,YAAY,uBACZ;YACAJ,aAAaE,aAAa,GAAG;QAC/B,OAAO;YACLF,aAAaC,MAAM,GAAG;QACxB;IACF,OAAO,IAAIF,qCAAAA,kBAAmBY,YAAY,EAAE;QAC1C,IAAIC,OAAOC,IAAI,CAACd,kBAAkBY,YAAY,EAAEG,MAAM,EAAE;YACtDd,aAAaC,MAAM,GAAG;QACxB,OAAO;YACLD,aAAaG,kBAAkB,GAAG;QACpC;IACF;IACA,OAAOH;AACT"}

247
node_modules/next/dist/esm/lib/eslint/runLintCheck.js generated vendored Normal file
View File

@@ -0,0 +1,247 @@
import { promises as fs } from "fs";
import chalk from "next/dist/compiled/chalk";
import path from "path";
import findUp from "next/dist/compiled/find-up";
import semver from "next/dist/compiled/semver";
import * as CommentJson from "next/dist/compiled/comment-json";
import { formatResults } from "./customFormatter";
import { writeDefaultConfig } from "./writeDefaultConfig";
import { hasEslintConfiguration } from "./hasEslintConfiguration";
import { writeOutputFile } from "./writeOutputFile";
import { ESLINT_PROMPT_VALUES } from "../constants";
import { existsSync, findPagesDir } from "../find-pages-dir";
import { installDependencies } from "../install-dependencies";
import { hasNecessaryDependencies } from "../has-necessary-dependencies";
import * as Log from "../../build/output/log";
import isError, { getProperError } from "../is-error";
import { getPkgManager } from "../helpers/get-pkg-manager";
// 0 is off, 1 is warn, 2 is error. See https://eslint.org/docs/user-guide/configuring/rules#configuring-rules
const VALID_SEVERITY = [
"off",
"warn",
"error"
];
function isValidSeverity(severity) {
return VALID_SEVERITY.includes(severity);
}
const requiredPackages = [
{
file: "eslint",
pkg: "eslint",
exportsRestrict: false
},
{
file: "eslint-config-next",
pkg: "eslint-config-next",
exportsRestrict: false
}
];
async function cliPrompt() {
console.log(chalk.bold(`${chalk.cyan("?")} How would you like to configure ESLint? https://nextjs.org/docs/basic-features/eslint`));
try {
const cliSelect = (await Promise.resolve(require("next/dist/compiled/cli-select"))).default;
const { value } = await cliSelect({
values: ESLINT_PROMPT_VALUES,
valueRenderer: ({ title, recommended }, selected)=>{
const name = selected ? chalk.bold.underline.cyan(title) : title;
return name + (recommended ? chalk.bold.yellow(" (recommended)") : "");
},
selected: chalk.cyan(" "),
unselected: " "
});
return {
config: (value == null ? void 0 : value.config) ?? null
};
} catch {
return {
config: null
};
}
}
async function lint(baseDir, lintDirs, eslintrcFile, pkgJsonPath, { lintDuringBuild = false, eslintOptions = null, reportErrorsOnly = false, maxWarnings = -1, formatter = null, outputFile = null }) {
try {
var _mod_CLIEngine, _ESLint_getErrorResults;
// Load ESLint after we're sure it exists:
const deps = await hasNecessaryDependencies(baseDir, requiredPackages);
const packageManager = getPkgManager(baseDir);
if (deps.missing.some((dep)=>dep.pkg === "eslint")) {
Log.error(`ESLint must be installed${lintDuringBuild ? " in order to run during builds:" : ":"} ${chalk.bold.cyan((packageManager === "yarn" ? "yarn add --dev" : packageManager === "pnpm" ? "pnpm install --save-dev" : "npm install --save-dev") + " eslint")}`);
return null;
}
const mod = await Promise.resolve(require(deps.resolved.get("eslint")));
const { ESLint } = mod;
let eslintVersion = (ESLint == null ? void 0 : ESLint.version) ?? ((_mod_CLIEngine = mod.CLIEngine) == null ? void 0 : _mod_CLIEngine.version);
if (!eslintVersion || semver.lt(eslintVersion, "7.0.0")) {
return `${chalk.red("error")} - Your project has an older version of ESLint installed${eslintVersion ? " (" + eslintVersion + ")" : ""}. Please upgrade to ESLint version 7 or above`;
}
let options = {
useEslintrc: true,
baseConfig: {},
errorOnUnmatchedPattern: false,
extensions: [
".js",
".jsx",
".ts",
".tsx"
],
cache: true,
...eslintOptions
};
let eslint = new ESLint(options);
let nextEslintPluginIsEnabled = false;
const nextRulesEnabled = new Map();
for (const configFile of [
eslintrcFile,
pkgJsonPath
]){
var _completeConfig_plugins;
if (!configFile) continue;
const completeConfig = await eslint.calculateConfigForFile(configFile);
if ((_completeConfig_plugins = completeConfig.plugins) == null ? void 0 : _completeConfig_plugins.includes("@next/next")) {
nextEslintPluginIsEnabled = true;
for (const [name, [severity]] of Object.entries(completeConfig.rules)){
if (!name.startsWith("@next/next/")) {
continue;
}
if (typeof severity === "number" && severity >= 0 && severity < VALID_SEVERITY.length) {
nextRulesEnabled.set(name, VALID_SEVERITY[severity]);
} else if (typeof severity === "string" && isValidSeverity(severity)) {
nextRulesEnabled.set(name, severity);
}
}
break;
}
}
const pagesDir = findPagesDir(baseDir).pagesDir;
const pagesDirRules = pagesDir ? [
"@next/next/no-html-link-for-pages"
] : [];
if (nextEslintPluginIsEnabled) {
let updatedPagesDir = false;
for (const rule of pagesDirRules){
var _options_baseConfig_rules, _options_baseConfig_rules1;
if (!((_options_baseConfig_rules = options.baseConfig.rules) == null ? void 0 : _options_baseConfig_rules[rule]) && !((_options_baseConfig_rules1 = options.baseConfig.rules) == null ? void 0 : _options_baseConfig_rules1[rule.replace("@next/next", "@next/babel-plugin-next")])) {
if (!options.baseConfig.rules) {
options.baseConfig.rules = {};
}
options.baseConfig.rules[rule] = [
1,
pagesDir
];
updatedPagesDir = true;
}
}
if (updatedPagesDir) {
eslint = new ESLint(options);
}
} else {
Log.warn("");
Log.warn("The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/basic-features/eslint#migrating-existing-config");
}
const lintStart = process.hrtime();
let results = await eslint.lintFiles(lintDirs);
let selectedFormatter = null;
if (options.fix) await ESLint.outputFixes(results);
if (reportErrorsOnly) results = await ESLint.getErrorResults(results) // Only return errors if --quiet flag is used
;
if (formatter) selectedFormatter = await eslint.loadFormatter(formatter);
const formattedResult = formatResults(baseDir, results, selectedFormatter == null ? void 0 : selectedFormatter.format);
const lintEnd = process.hrtime(lintStart);
const totalWarnings = results.reduce((sum, file)=>sum + file.warningCount, 0);
if (outputFile) await writeOutputFile(outputFile, formattedResult.output);
return {
output: formattedResult.outputWithMessages,
isError: ((_ESLint_getErrorResults = ESLint.getErrorResults(results)) == null ? void 0 : _ESLint_getErrorResults.length) > 0 || maxWarnings >= 0 && totalWarnings > maxWarnings,
eventInfo: {
durationInSeconds: lintEnd[0],
eslintVersion: eslintVersion,
lintedFilesCount: results.length,
lintFix: !!options.fix,
nextEslintPluginVersion: nextEslintPluginIsEnabled && deps.resolved.has("eslint-config-next") ? require(path.join(path.dirname(deps.resolved.get("eslint-config-next")), "package.json")).version : null,
nextEslintPluginErrorsCount: formattedResult.totalNextPluginErrorCount,
nextEslintPluginWarningsCount: formattedResult.totalNextPluginWarningCount,
nextRulesEnabled: Object.fromEntries(nextRulesEnabled)
}
};
} catch (err) {
if (lintDuringBuild) {
Log.error(`ESLint: ${isError(err) && err.message ? err.message.replace(/\n/g, " ") : err}`);
return null;
} else {
throw getProperError(err);
}
}
}
export async function runLintCheck(baseDir, lintDirs, opts) {
const { lintDuringBuild = false, eslintOptions = null, reportErrorsOnly = false, maxWarnings = -1, formatter = null, outputFile = null, strict = false } = opts;
try {
// Find user's .eslintrc file
// See: https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-file-formats
const eslintrcFile = await findUp([
".eslintrc.js",
".eslintrc.cjs",
".eslintrc.yaml",
".eslintrc.yml",
".eslintrc.json",
".eslintrc"
], {
cwd: baseDir
}) ?? null;
const pkgJsonPath = await findUp("package.json", {
cwd: baseDir
}) ?? null;
let packageJsonConfig = null;
if (pkgJsonPath) {
const pkgJsonContent = await fs.readFile(pkgJsonPath, {
encoding: "utf8"
});
packageJsonConfig = CommentJson.parse(pkgJsonContent);
}
const config = await hasEslintConfiguration(eslintrcFile, packageJsonConfig);
let deps;
if (config.exists) {
// Run if ESLint config exists
return await lint(baseDir, lintDirs, eslintrcFile, pkgJsonPath, {
lintDuringBuild,
eslintOptions,
reportErrorsOnly,
maxWarnings,
formatter,
outputFile
});
} else {
// Display warning if no ESLint configuration is present inside
// config file during "next build", no warning is shown when
// no eslintrc file is present
if (lintDuringBuild) {
if (config.emptyPkgJsonConfig || config.emptyEslintrc) {
Log.warn(`No ESLint configuration detected. Run ${chalk.bold.cyan("next lint")} to begin setup`);
}
return null;
} else {
// Ask user what config they would like to start with for first time "next lint" setup
const { config: selectedConfig } = strict ? ESLINT_PROMPT_VALUES.find((opt)=>opt.title === "Strict") : await cliPrompt();
if (selectedConfig == null) {
// Show a warning if no option is selected in prompt
Log.warn("If you set up ESLint yourself, we recommend adding the Next.js ESLint plugin. See https://nextjs.org/docs/basic-features/eslint#migrating-existing-config");
return null;
} else {
// Check if necessary deps installed, and install any that are missing
deps = await hasNecessaryDependencies(baseDir, requiredPackages);
if (deps.missing.length > 0) await installDependencies(baseDir, deps.missing, true);
// Write default ESLint config.
// Check for /pages and src/pages is to make sure this happens in Next.js folder
if (existsSync(path.join(baseDir, "pages")) || existsSync(path.join(baseDir, "src/pages"))) {
await writeDefaultConfig(baseDir, config, selectedConfig, eslintrcFile, pkgJsonPath, packageJsonConfig);
}
}
Log.ready(`ESLint has successfully been configured. Run ${chalk.bold.cyan("next lint")} again to view warnings and errors.`);
return null;
}
}
} catch (err) {
throw err;
}
}
//# sourceMappingURL=runLintCheck.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,31 @@
import { promises as fs } from "fs";
import chalk from "next/dist/compiled/chalk";
import os from "os";
import path from "path";
import * as CommentJson from "next/dist/compiled/comment-json";
import * as Log from "../../build/output/log";
export async function writeDefaultConfig(baseDir, { exists, emptyEslintrc, emptyPkgJsonConfig }, selectedConfig, eslintrcFile, pkgJsonPath, packageJsonConfig) {
if (!exists && emptyEslintrc && eslintrcFile) {
const ext = path.extname(eslintrcFile);
let newFileContent;
if (ext === ".yaml" || ext === ".yml") {
newFileContent = "extends: 'next'";
} else {
newFileContent = CommentJson.stringify(selectedConfig, null, 2);
if (ext === ".js") {
newFileContent = "module.exports = " + newFileContent;
}
}
await fs.writeFile(eslintrcFile, newFileContent + os.EOL);
Log.info(`We detected an empty ESLint configuration file (${chalk.bold(path.basename(eslintrcFile))}) and updated it for you!`);
} else if (!exists && emptyPkgJsonConfig && packageJsonConfig) {
packageJsonConfig.eslintConfig = selectedConfig;
if (pkgJsonPath) await fs.writeFile(pkgJsonPath, CommentJson.stringify(packageJsonConfig, null, 2) + os.EOL);
Log.info(`We detected an empty ${chalk.bold("eslintConfig")} field in package.json and updated it for you!`);
} else if (!exists) {
await fs.writeFile(path.join(baseDir, ".eslintrc.json"), CommentJson.stringify(selectedConfig, null, 2) + os.EOL);
console.log(chalk.green(`We created the ${chalk.bold(".eslintrc.json")} file for you and included your selected configuration.`));
}
}
//# sourceMappingURL=writeDefaultConfig.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/eslint/writeDefaultConfig.ts"],"names":["promises","fs","chalk","os","path","CommentJson","Log","writeDefaultConfig","baseDir","exists","emptyEslintrc","emptyPkgJsonConfig","selectedConfig","eslintrcFile","pkgJsonPath","packageJsonConfig","ext","extname","newFileContent","stringify","writeFile","EOL","info","bold","basename","eslintConfig","join","console","log","green"],"mappings":"AAAA,SAASA,YAAYC,EAAE,QAAQ,KAAI;AACnC,OAAOC,WAAW,2BAA0B;AAC5C,OAAOC,QAAQ,KAAI;AACnB,OAAOC,UAAU,OAAM;AACvB,YAAYC,iBAAiB,kCAAiC;AAG9D,YAAYC,SAAS,yBAAwB;AAE7C,OAAO,eAAeC,mBACpBC,OAAe,EACf,EAAEC,MAAM,EAAEC,aAAa,EAAEC,kBAAkB,EAAmB,EAC9DC,cAAmB,EACnBC,YAA2B,EAC3BC,WAA0B,EAC1BC,iBAA+C;IAE/C,IAAI,CAACN,UAAUC,iBAAiBG,cAAc;QAC5C,MAAMG,MAAMZ,KAAKa,OAAO,CAACJ;QAEzB,IAAIK;QACJ,IAAIF,QAAQ,WAAWA,QAAQ,QAAQ;YACrCE,iBAAiB;QACnB,OAAO;YACLA,iBAAiBb,YAAYc,SAAS,CAACP,gBAAgB,MAAM;YAE7D,IAAII,QAAQ,OAAO;gBACjBE,iBAAiB,sBAAsBA;YACzC;QACF;QAEA,MAAMjB,GAAGmB,SAAS,CAACP,cAAcK,iBAAiBf,GAAGkB,GAAG;QAExDf,IAAIgB,IAAI,CACN,CAAC,gDAAgD,EAAEpB,MAAMqB,IAAI,CAC3DnB,KAAKoB,QAAQ,CAACX,eACd,yBAAyB,CAAC;IAEhC,OAAO,IAAI,CAACJ,UAAUE,sBAAsBI,mBAAmB;QAC7DA,kBAAkBU,YAAY,GAAGb;QAEjC,IAAIE,aACF,MAAMb,GAAGmB,SAAS,CAChBN,aACAT,YAAYc,SAAS,CAACJ,mBAAmB,MAAM,KAAKZ,GAAGkB,GAAG;QAG9Df,IAAIgB,IAAI,CACN,CAAC,qBAAqB,EAAEpB,MAAMqB,IAAI,CAChC,gBACA,8CAA8C,CAAC;IAErD,OAAO,IAAI,CAACd,QAAQ;QAClB,MAAMR,GAAGmB,SAAS,CAChBhB,KAAKsB,IAAI,CAAClB,SAAS,mBACnBH,YAAYc,SAAS,CAACP,gBAAgB,MAAM,KAAKT,GAAGkB,GAAG;QAGzDM,QAAQC,GAAG,CACT1B,MAAM2B,KAAK,CACT,CAAC,eAAe,EAAE3B,MAAMqB,IAAI,CAC1B,kBACA,uDAAuD,CAAC;IAGhE;AACF"}

View File

@@ -0,0 +1,36 @@
import { promises as fs } from "fs";
import path from "path";
import * as Log from "../../build/output/log";
import isError from "../../lib/is-error";
/**
* Check if a given file path is a directory or not.
* Returns `true` if the path is a directory.
*/ function isDirectory(/** The path to a file to check. */ filePath) {
return fs.stat(filePath).then((stat)=>stat.isDirectory()).catch((error)=>{
if (isError(error) && (error.code === "ENOENT" || error.code === "ENOTDIR")) {
return false;
}
throw error;
});
}
/**
* Create a file with eslint output data
*/ export async function writeOutputFile(/** The name file that needs to be created */ outputFile, /** The data that needs to be inserted into the file */ outputData) {
const filePath = path.resolve(process.cwd(), outputFile);
if (await isDirectory(filePath)) {
Log.error(`Cannot write to output file path, it is a directory: ${filePath}`);
} else {
try {
await fs.mkdir(path.dirname(filePath), {
recursive: true
});
await fs.writeFile(filePath, outputData);
Log.info(`The output file has been created: ${filePath}`);
} catch (err) {
Log.error(`There was a problem writing the output file: ${filePath}`);
console.error(err);
}
}
}
//# sourceMappingURL=writeOutputFile.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/eslint/writeOutputFile.ts"],"names":["promises","fs","path","Log","isError","isDirectory","filePath","stat","then","catch","error","code","writeOutputFile","outputFile","outputData","resolve","process","cwd","mkdir","dirname","recursive","writeFile","info","err","console"],"mappings":"AAAA,SAASA,YAAYC,EAAE,QAAQ,KAAI;AACnC,OAAOC,UAAU,OAAM;AACvB,YAAYC,SAAS,yBAAwB;AAC7C,OAAOC,aAAa,qBAAoB;AAExC;;;CAGC,GACD,SAASC,YACP,kCAAkC,GAClCC,QAAgB;IAEhB,OAAOL,GACJM,IAAI,CAACD,UACLE,IAAI,CAAC,CAACD,OAASA,KAAKF,WAAW,IAC/BI,KAAK,CAAC,CAACC;QACN,IACEN,QAAQM,UACPA,CAAAA,MAAMC,IAAI,KAAK,YAAYD,MAAMC,IAAI,KAAK,SAAQ,GACnD;YACA,OAAO;QACT;QACA,MAAMD;IACR;AACJ;AACA;;CAEC,GACD,OAAO,eAAeE,gBACpB,2CAA2C,GAC3CC,UAAkB,EAClB,qDAAqD,GACrDC,UAAkB;IAElB,MAAMR,WAAWJ,KAAKa,OAAO,CAACC,QAAQC,GAAG,IAAIJ;IAE7C,IAAI,MAAMR,YAAYC,WAAW;QAC/BH,IAAIO,KAAK,CACP,CAAC,qDAAqD,EAAEJ,SAAS,CAAC;IAEtE,OAAO;QACL,IAAI;YACF,MAAML,GAAGiB,KAAK,CAAChB,KAAKiB,OAAO,CAACb,WAAW;gBAAEc,WAAW;YAAK;YACzD,MAAMnB,GAAGoB,SAAS,CAACf,UAAUQ;YAC7BX,IAAImB,IAAI,CAAC,CAAC,kCAAkC,EAAEhB,SAAS,CAAC;QAC1D,EAAE,OAAOiB,KAAK;YACZpB,IAAIO,KAAK,CAAC,CAAC,6CAA6C,EAAEJ,SAAS,CAAC;YACpEkB,QAAQd,KAAK,CAACa;QAChB;IACF;AACF"}

4
node_modules/next/dist/esm/lib/fatal-error.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
export class FatalError extends Error {
}
//# sourceMappingURL=fatal-error.js.map

1
node_modules/next/dist/esm/lib/fatal-error.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/fatal-error.ts"],"names":["FatalError","Error"],"mappings":"AAAA,OAAO,MAAMA,mBAAmBC;AAAO"}

28
node_modules/next/dist/esm/lib/file-exists.js generated vendored Normal file
View File

@@ -0,0 +1,28 @@
import { constants, promises } from "fs";
import isError from "./is-error";
export var FileType;
(function(FileType) {
FileType["File"] = "file";
FileType["Directory"] = "directory";
})(FileType || (FileType = {}));
export async function fileExists(fileName, type) {
try {
if (type === "file") {
const stats = await promises.stat(fileName);
return stats.isFile();
} else if (type === "directory") {
const stats = await promises.stat(fileName);
return stats.isDirectory();
} else {
await promises.access(fileName, constants.F_OK);
}
return true;
} catch (err) {
if (isError(err) && (err.code === "ENOENT" || err.code === "ENAMETOOLONG")) {
return false;
}
throw err;
}
}
//# sourceMappingURL=file-exists.js.map

1
node_modules/next/dist/esm/lib/file-exists.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/file-exists.ts"],"names":["constants","promises","isError","FileType","File","Directory","fileExists","fileName","type","stats","stat","isFile","isDirectory","access","F_OK","err","code"],"mappings":"AAAA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,KAAI;AACxC,OAAOC,aAAa,aAAY;WAEzB;UAAKC,QAAQ;IAARA,SACVC,UAAO;IADGD,SAEVE,eAAY;GAFFF,aAAAA;AAKZ,OAAO,eAAeG,WACpBC,QAAgB,EAChBC,IAAe;IAEf,IAAI;QACF,IAAIA,SATC,QASuB;YAC1B,MAAMC,QAAQ,MAAMR,SAASS,IAAI,CAACH;YAClC,OAAOE,MAAME,MAAM;QACrB,OAAO,IAAIH,SAXD,aAW8B;YACtC,MAAMC,QAAQ,MAAMR,SAASS,IAAI,CAACH;YAClC,OAAOE,MAAMG,WAAW;QAC1B,OAAO;YACL,MAAMX,SAASY,MAAM,CAACN,UAAUP,UAAUc,IAAI;QAChD;QACA,OAAO;IACT,EAAE,OAAOC,KAAK;QACZ,IACEb,QAAQa,QACPA,CAAAA,IAAIC,IAAI,KAAK,YAAYD,IAAIC,IAAI,KAAK,cAAa,GACpD;YACA,OAAO;QACT;QACA,MAAMD;IACR;AACF"}

44
node_modules/next/dist/esm/lib/find-config.js generated vendored Normal file
View File

@@ -0,0 +1,44 @@
import findUp from "next/dist/compiled/find-up";
import fs from "fs";
import JSON5 from "next/dist/compiled/json5";
export function findConfigPath(dir, key) {
// If we didn't find the configuration in `package.json`, we should look for
// known filenames.
return findUp([
`.${key}rc.json`,
`${key}.config.json`,
`.${key}rc.js`,
`${key}.config.js`,
`${key}.config.cjs`
], {
cwd: dir
});
}
// We'll allow configuration to be typed, but we force everything provided to
// become optional. We do not perform any schema validation. We should maybe
// force all the types to be `unknown` as well.
export async function findConfig(directory, key, _returnFile) {
// `package.json` configuration always wins. Let's check that first.
const packageJsonPath = await findUp("package.json", {
cwd: directory
});
if (packageJsonPath) {
const packageJson = require(packageJsonPath);
if (packageJson[key] != null && typeof packageJson[key] === "object") {
return packageJson[key];
}
}
const filePath = await findConfigPath(directory, key);
if (filePath) {
if (filePath.endsWith(".js") || filePath.endsWith(".cjs")) {
return require(filePath);
}
// We load JSON contents with JSON5 to allow users to comment in their
// configuration file. This pattern was popularized by TypeScript.
const fileContents = fs.readFileSync(filePath, "utf8");
return JSON5.parse(fileContents);
}
return null;
}
//# sourceMappingURL=find-config.js.map

1
node_modules/next/dist/esm/lib/find-config.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/find-config.ts"],"names":["findUp","fs","JSON5","findConfigPath","dir","key","cwd","findConfig","directory","_returnFile","packageJsonPath","packageJson","require","filePath","endsWith","fileContents","readFileSync","parse"],"mappings":"AAAA,OAAOA,YAAY,6BAA4B;AAC/C,OAAOC,QAAQ,KAAI;AACnB,OAAOC,WAAW,2BAA0B;AAM5C,OAAO,SAASC,eACdC,GAAW,EACXC,GAAW;IAEX,4EAA4E;IAC5E,mBAAmB;IACnB,OAAOL,OACL;QACE,CAAC,CAAC,EAAEK,IAAI,OAAO,CAAC;QAChB,CAAC,EAAEA,IAAI,YAAY,CAAC;QACpB,CAAC,CAAC,EAAEA,IAAI,KAAK,CAAC;QACd,CAAC,EAAEA,IAAI,UAAU,CAAC;QAClB,CAAC,EAAEA,IAAI,WAAW,CAAC;KACpB,EACD;QACEC,KAAKF;IACP;AAEJ;AAEA,6EAA6E;AAC7E,4EAA4E;AAC5E,+CAA+C;AAC/C,OAAO,eAAeG,WACpBC,SAAiB,EACjBH,GAAW,EACXI,WAAqB;IAErB,oEAAoE;IACpE,MAAMC,kBAAkB,MAAMV,OAAO,gBAAgB;QAAEM,KAAKE;IAAU;IACtE,IAAIE,iBAAiB;QACnB,MAAMC,cAAcC,QAAQF;QAC5B,IAAIC,WAAW,CAACN,IAAI,IAAI,QAAQ,OAAOM,WAAW,CAACN,IAAI,KAAK,UAAU;YACpE,OAAOM,WAAW,CAACN,IAAI;QACzB;IACF;IAEA,MAAMQ,WAAW,MAAMV,eAAeK,WAAWH;IAEjD,IAAIQ,UAAU;QACZ,IAAIA,SAASC,QAAQ,CAAC,UAAUD,SAASC,QAAQ,CAAC,SAAS;YACzD,OAAOF,QAAQC;QACjB;QAEA,sEAAsE;QACtE,kEAAkE;QAClE,MAAME,eAAed,GAAGe,YAAY,CAACH,UAAU;QAC/C,OAAOX,MAAMe,KAAK,CAACF;IACrB;IAEA,OAAO;AACT"}

31
node_modules/next/dist/esm/lib/find-pages-dir.js generated vendored Normal file
View File

@@ -0,0 +1,31 @@
import fs from "fs";
import path from "path";
export const existsSync = (f)=>{
try {
fs.accessSync(f, fs.constants.F_OK);
return true;
} catch (_) {
return false;
}
};
export function findDir(dir, name) {
// prioritize ./${name} over ./src/${name}
let curDir = path.join(dir, name);
if (existsSync(curDir)) return curDir;
curDir = path.join(dir, "src", name);
if (existsSync(curDir)) return curDir;
return null;
}
export function findPagesDir(dir) {
const pagesDir = findDir(dir, "pages") || undefined;
const appDir = findDir(dir, "app") || undefined;
if (appDir == null && pagesDir == null) {
throw new Error("> Couldn't find any `pages` or `app` directory. Please create one under the project root");
}
return {
pagesDir,
appDir
};
}
//# sourceMappingURL=find-pages-dir.js.map

1
node_modules/next/dist/esm/lib/find-pages-dir.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/find-pages-dir.ts"],"names":["fs","path","existsSync","f","accessSync","constants","F_OK","_","findDir","dir","name","curDir","join","findPagesDir","pagesDir","undefined","appDir","Error"],"mappings":"AAAA,OAAOA,QAAQ,KAAI;AACnB,OAAOC,UAAU,OAAM;AAEvB,OAAO,MAAMC,aAAa,CAACC;IACzB,IAAI;QACFH,GAAGI,UAAU,CAACD,GAAGH,GAAGK,SAAS,CAACC,IAAI;QAClC,OAAO;IACT,EAAE,OAAOC,GAAG;QACV,OAAO;IACT;AACF,EAAC;AAED,OAAO,SAASC,QAAQC,GAAW,EAAEC,IAAqB;IACxD,0CAA0C;IAC1C,IAAIC,SAASV,KAAKW,IAAI,CAACH,KAAKC;IAC5B,IAAIR,WAAWS,SAAS,OAAOA;IAE/BA,SAASV,KAAKW,IAAI,CAACH,KAAK,OAAOC;IAC/B,IAAIR,WAAWS,SAAS,OAAOA;IAE/B,OAAO;AACT;AAEA,OAAO,SAASE,aAAaJ,GAAW;IAItC,MAAMK,WAAWN,QAAQC,KAAK,YAAYM;IAC1C,MAAMC,SAASR,QAAQC,KAAK,UAAUM;IAEtC,IAAIC,UAAU,QAAQF,YAAY,MAAM;QACtC,MAAM,IAAIG,MACR;IAEJ;IAEA,OAAO;QACLH;QACAE;IACF;AACF"}

17
node_modules/next/dist/esm/lib/find-root.js generated vendored Normal file
View File

@@ -0,0 +1,17 @@
import { dirname } from "path";
import findUp from "next/dist/compiled/find-up";
export function findRootLockFile(cwd) {
return findUp.sync([
"pnpm-lock.yaml",
"package-lock.json",
"yarn.lock"
], {
cwd
});
}
export function findRootDir(cwd) {
const lockFile = findRootLockFile(cwd);
return lockFile ? dirname(lockFile) : undefined;
}
//# sourceMappingURL=find-root.js.map

1
node_modules/next/dist/esm/lib/find-root.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/find-root.ts"],"names":["dirname","findUp","findRootLockFile","cwd","sync","findRootDir","lockFile","undefined"],"mappings":"AAAA,SAASA,OAAO,QAAQ,OAAM;AAC9B,OAAOC,YAAY,6BAA4B;AAE/C,OAAO,SAASC,iBAAiBC,GAAW;IAC1C,OAAOF,OAAOG,IAAI,CAAC;QAAC;QAAkB;QAAqB;KAAY,EAAE;QACvED;IACF;AACF;AAEA,OAAO,SAASE,YAAYF,GAAW;IACrC,MAAMG,WAAWJ,iBAAiBC;IAClC,OAAOG,WAAWN,QAAQM,YAAYC;AACxC"}

19
node_modules/next/dist/esm/lib/flat-readdir.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
import { join } from "path";
import fs from "fs/promises";
export async function flatReaddir(dir, includes) {
const dirents = await fs.opendir(dir);
const result = [];
for await (const part of dirents){
let shouldOmit = part.isDirectory() || !includes.some((include)=>include.test(part.name));
if (part.isSymbolicLink()) {
const stats = await fs.stat(join(dir, part.name));
shouldOmit = stats.isDirectory();
}
if (!shouldOmit) {
result.push(join(dir, part.name));
}
}
return result;
}
//# sourceMappingURL=flat-readdir.js.map

1
node_modules/next/dist/esm/lib/flat-readdir.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/flat-readdir.ts"],"names":["join","fs","flatReaddir","dir","includes","dirents","opendir","result","part","shouldOmit","isDirectory","some","include","test","name","isSymbolicLink","stats","stat","push"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAM;AAC3B,OAAOC,QAAQ,cAAa;AAE5B,OAAO,eAAeC,YAAYC,GAAW,EAAEC,QAAkB;IAC/D,MAAMC,UAAU,MAAMJ,GAAGK,OAAO,CAACH;IACjC,MAAMI,SAAS,EAAE;IAEjB,WAAW,MAAMC,QAAQH,QAAS;QAChC,IAAII,aACFD,KAAKE,WAAW,MAAM,CAACN,SAASO,IAAI,CAAC,CAACC,UAAYA,QAAQC,IAAI,CAACL,KAAKM,IAAI;QAE1E,IAAIN,KAAKO,cAAc,IAAI;YACzB,MAAMC,QAAQ,MAAMf,GAAGgB,IAAI,CAACjB,KAAKG,KAAKK,KAAKM,IAAI;YAC/CL,aAAaO,MAAMN,WAAW;QAChC;QAEA,IAAI,CAACD,YAAY;YACfF,OAAOW,IAAI,CAAClB,KAAKG,KAAKK,KAAKM,IAAI;QACjC;IACF;IAEA,OAAOP;AACT"}

47
node_modules/next/dist/esm/lib/format-server-error.js generated vendored Normal file
View File

@@ -0,0 +1,47 @@
const invalidServerComponentReactHooks = [
"useDeferredValue",
"useEffect",
"useImperativeHandle",
"useInsertionEffect",
"useLayoutEffect",
"useReducer",
"useRef",
"useState",
"useSyncExternalStore",
"useTransition",
"experimental_useOptimistic",
"useOptimistic"
];
function setMessage(error, message) {
error.message = message;
if (error.stack) {
const lines = error.stack.split("\n");
lines[0] = message;
error.stack = lines.join("\n");
}
}
export function formatServerError(error) {
if (typeof (error == null ? void 0 : error.message) !== "string") return;
if (error.message.includes("Class extends value undefined is not a constructor or null")) {
const addedMessage = "This might be caused by a React Class Component being rendered in a Server Component, React Class Components only works in Client Components. Read more: https://nextjs.org/docs/messages/class-component-in-server-component";
// If this error instance already has the message, don't add it again
if (error.message.includes(addedMessage)) return;
setMessage(error, `${error.message}
${addedMessage}`);
return;
}
if (error.message.includes("createContext is not a function")) {
setMessage(error, 'createContext only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more: https://nextjs.org/docs/messages/context-in-server-component');
return;
}
for (const clientHook of invalidServerComponentReactHooks){
const regex = new RegExp(`\\b${clientHook}\\b.*is not a function`);
if (regex.test(error.message)) {
setMessage(error, `${clientHook} only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more: https://nextjs.org/docs/messages/react-client-hook-in-server-component`);
return;
}
}
}
//# sourceMappingURL=format-server-error.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/format-server-error.ts"],"names":["invalidServerComponentReactHooks","setMessage","error","message","stack","lines","split","join","formatServerError","includes","addedMessage","clientHook","regex","RegExp","test"],"mappings":"AAAA,MAAMA,mCAAmC;IACvC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,SAASC,WAAWC,KAAY,EAAEC,OAAe;IAC/CD,MAAMC,OAAO,GAAGA;IAChB,IAAID,MAAME,KAAK,EAAE;QACf,MAAMC,QAAQH,MAAME,KAAK,CAACE,KAAK,CAAC;QAChCD,KAAK,CAAC,EAAE,GAAGF;QACXD,MAAME,KAAK,GAAGC,MAAME,IAAI,CAAC;IAC3B;AACF;AAEA,OAAO,SAASC,kBAAkBN,KAAY;IAC5C,IAAI,QAAOA,yBAAAA,MAAOC,OAAO,MAAK,UAAU;IAExC,IACED,MAAMC,OAAO,CAACM,QAAQ,CACpB,+DAEF;QACA,MAAMC,eACJ;QAEF,qEAAqE;QACrE,IAAIR,MAAMC,OAAO,CAACM,QAAQ,CAACC,eAAe;QAE1CT,WACEC,OACA,CAAC,EAAEA,MAAMC,OAAO,CAAC;;AAEvB,EAAEO,aAAa,CAAC;QAEZ;IACF;IAEA,IAAIR,MAAMC,OAAO,CAACM,QAAQ,CAAC,oCAAoC;QAC7DR,WACEC,OACA;QAEF;IACF;IAEA,KAAK,MAAMS,cAAcX,iCAAkC;QACzD,MAAMY,QAAQ,IAAIC,OAAO,CAAC,GAAG,EAAEF,WAAW,sBAAsB,CAAC;QACjE,IAAIC,MAAME,IAAI,CAACZ,MAAMC,OAAO,GAAG;YAC7BF,WACEC,OACA,CAAC,EAAES,WAAW,oLAAoL,CAAC;YAErM;QACF;IACF;AACF"}

View File

@@ -0,0 +1,61 @@
import { pathToRegexp } from "next/dist/compiled/path-to-regexp";
import { NEXT_URL } from "../client/components/app-router-headers";
import { INTERCEPTION_ROUTE_MARKERS, extractInterceptionRouteInformation, isInterceptionRouteAppPath } from "../server/future/helpers/interception-routes";
// a function that converts normalised paths (e.g. /foo/[bar]/[baz]) to the format expected by pathToRegexp (e.g. /foo/:bar/:baz)
function toPathToRegexpPath(path) {
return path.replace(/\[\[?([^\]]+)\]\]?/g, (_, capture)=>{
// handle catch-all segments (e.g. /foo/bar/[...baz] or /foo/bar/[[...baz]])
if (capture.startsWith("...")) {
return `:${capture.slice(3)}*`;
}
return ":" + capture;
});
}
// for interception routes we don't have access to the dynamic segments from the
// referrer route so we mark them as noop for the app renderer so that it
// can retrieve them from the router state later on. This also allows us to
// compile the route properly with path-to-regexp, otherwise it will throw
function voidParamsBeforeInterceptionMarker(path) {
let newPath = [];
let foundInterceptionMarker = false;
for (const segment of path.split("/")){
if (INTERCEPTION_ROUTE_MARKERS.find((marker)=>segment.startsWith(marker))) {
foundInterceptionMarker = true;
}
if (segment.startsWith(":") && !foundInterceptionMarker) {
newPath.push("__NEXT_EMPTY_PARAM__");
} else {
newPath.push(segment);
}
}
return newPath.join("/");
}
export function generateInterceptionRoutesRewrites(appPaths) {
const rewrites = [];
for (const appPath of appPaths){
if (isInterceptionRouteAppPath(appPath)) {
const { interceptingRoute, interceptedRoute } = extractInterceptionRouteInformation(appPath);
const normalizedInterceptingRoute = `${interceptingRoute !== "/" ? toPathToRegexpPath(interceptingRoute) : ""}/(.*)?`;
const normalizedInterceptedRoute = toPathToRegexpPath(interceptedRoute);
const normalizedAppPath = voidParamsBeforeInterceptionMarker(toPathToRegexpPath(appPath));
// pathToRegexp returns a regex that matches the path, but we need to
// convert it to a string that can be used in a header value
// to the format that Next/the proxy expects
let interceptingRouteRegex = pathToRegexp(normalizedInterceptingRoute).toString().slice(2, -3);
rewrites.push({
source: normalizedInterceptedRoute,
destination: normalizedAppPath,
has: [
{
type: "header",
key: NEXT_URL,
value: interceptingRouteRegex
}
]
});
}
}
return rewrites;
}
//# sourceMappingURL=generate-interception-routes-rewrites.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/generate-interception-routes-rewrites.ts"],"names":["pathToRegexp","NEXT_URL","INTERCEPTION_ROUTE_MARKERS","extractInterceptionRouteInformation","isInterceptionRouteAppPath","toPathToRegexpPath","path","replace","_","capture","startsWith","slice","voidParamsBeforeInterceptionMarker","newPath","foundInterceptionMarker","segment","split","find","marker","push","join","generateInterceptionRoutesRewrites","appPaths","rewrites","appPath","interceptingRoute","interceptedRoute","normalizedInterceptingRoute","normalizedInterceptedRoute","normalizedAppPath","interceptingRouteRegex","toString","source","destination","has","type","key","value"],"mappings":"AAAA,SAASA,YAAY,QAAQ,oCAAmC;AAChE,SAASC,QAAQ,QAAQ,0CAAyC;AAClE,SACEC,0BAA0B,EAC1BC,mCAAmC,EACnCC,0BAA0B,QACrB,+CAA8C;AAGrD,iIAAiI;AACjI,SAASC,mBAAmBC,IAAY;IACtC,OAAOA,KAAKC,OAAO,CAAC,uBAAuB,CAACC,GAAGC;QAC7C,4EAA4E;QAC5E,IAAIA,QAAQC,UAAU,CAAC,QAAQ;YAC7B,OAAO,CAAC,CAAC,EAAED,QAAQE,KAAK,CAAC,GAAG,CAAC,CAAC;QAChC;QACA,OAAO,MAAMF;IACf;AACF;AAEA,gFAAgF;AAChF,yEAAyE;AACzE,2EAA2E;AAC3E,0EAA0E;AAC1E,SAASG,mCAAmCN,IAAY;IACtD,IAAIO,UAAU,EAAE;IAEhB,IAAIC,0BAA0B;IAC9B,KAAK,MAAMC,WAAWT,KAAKU,KAAK,CAAC,KAAM;QACrC,IACEd,2BAA2Be,IAAI,CAAC,CAACC,SAAWH,QAAQL,UAAU,CAACQ,UAC/D;YACAJ,0BAA0B;QAC5B;QAEA,IAAIC,QAAQL,UAAU,CAAC,QAAQ,CAACI,yBAAyB;YACvDD,QAAQM,IAAI,CAAC;QACf,OAAO;YACLN,QAAQM,IAAI,CAACJ;QACf;IACF;IAEA,OAAOF,QAAQO,IAAI,CAAC;AACtB;AAEA,OAAO,SAASC,mCACdC,QAAkB;IAElB,MAAMC,WAAsB,EAAE;IAE9B,KAAK,MAAMC,WAAWF,SAAU;QAC9B,IAAIlB,2BAA2BoB,UAAU;YACvC,MAAM,EAAEC,iBAAiB,EAAEC,gBAAgB,EAAE,GAC3CvB,oCAAoCqB;YAEtC,MAAMG,8BAA8B,CAAC,EACnCF,sBAAsB,MAAMpB,mBAAmBoB,qBAAqB,GACrE,MAAM,CAAC;YAER,MAAMG,6BAA6BvB,mBAAmBqB;YACtD,MAAMG,oBAAoBjB,mCACxBP,mBAAmBmB;YAGrB,qEAAqE;YACrE,4DAA4D;YAC5D,4CAA4C;YAC5C,IAAIM,yBAAyB9B,aAAa2B,6BACvCI,QAAQ,GACRpB,KAAK,CAAC,GAAG,CAAC;YAEbY,SAASJ,IAAI,CAAC;gBACZa,QAAQJ;gBACRK,aAAaJ;gBACbK,KAAK;oBACH;wBACEC,MAAM;wBACNC,KAAKnC;wBACLoC,OAAOP;oBACT;iBACD;YACH;QACF;IACF;IAEA,OAAOP;AACT"}

50
node_modules/next/dist/esm/lib/get-package-version.js generated vendored Normal file
View File

@@ -0,0 +1,50 @@
import { promises as fs } from "fs";
import findUp from "next/dist/compiled/find-up";
import JSON5 from "next/dist/compiled/json5";
import * as path from "path";
let cachedDeps;
export function getDependencies({ cwd }) {
if (cachedDeps) {
return cachedDeps;
}
return cachedDeps = (async ()=>{
const configurationPath = await findUp("package.json", {
cwd
});
if (!configurationPath) {
return {
dependencies: {},
devDependencies: {}
};
}
const content = await fs.readFile(configurationPath, "utf-8");
const packageJson = JSON5.parse(content);
const { dependencies = {}, devDependencies = {} } = packageJson || {};
return {
dependencies,
devDependencies
};
})();
}
export async function getPackageVersion({ cwd, name }) {
const { dependencies, devDependencies } = await getDependencies({
cwd
});
if (!(dependencies[name] || devDependencies[name])) {
return null;
}
const cwd2 = cwd.endsWith(path.posix.sep) || cwd.endsWith(path.win32.sep) ? cwd : `${cwd}/`;
try {
const targetPath = require.resolve(`${name}/package.json`, {
paths: [
cwd2
]
});
const targetContent = await fs.readFile(targetPath, "utf-8");
return JSON5.parse(targetContent).version ?? null;
} catch {
return null;
}
}
//# sourceMappingURL=get-package-version.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/get-package-version.ts"],"names":["promises","fs","findUp","JSON5","path","cachedDeps","getDependencies","cwd","configurationPath","dependencies","devDependencies","content","readFile","packageJson","parse","getPackageVersion","name","cwd2","endsWith","posix","sep","win32","targetPath","require","resolve","paths","targetContent","version"],"mappings":"AAAA,SAASA,YAAYC,EAAE,QAAQ,KAAI;AACnC,OAAOC,YAAY,6BAA4B;AAC/C,OAAOC,WAAW,2BAA0B;AAC5C,YAAYC,UAAU,OAAM;AAO5B,IAAIC;AAEJ,OAAO,SAASC,gBAAgB,EAC9BC,GAAG,EAGJ;IACC,IAAIF,YAAY;QACd,OAAOA;IACT;IAEA,OAAQA,aAAa,AAAC,CAAA;QACpB,MAAMG,oBAAwC,MAAMN,OAAO,gBAAgB;YACzEK;QACF;QACA,IAAI,CAACC,mBAAmB;YACtB,OAAO;gBAAEC,cAAc,CAAC;gBAAGC,iBAAiB,CAAC;YAAE;QACjD;QAEA,MAAMC,UAAU,MAAMV,GAAGW,QAAQ,CAACJ,mBAAmB;QACrD,MAAMK,cAAmBV,MAAMW,KAAK,CAACH;QAErC,MAAM,EAAEF,eAAe,CAAC,CAAC,EAAEC,kBAAkB,CAAC,CAAC,EAAE,GAAGG,eAAe,CAAC;QACpE,OAAO;YAAEJ;YAAcC;QAAgB;IACzC,CAAA;AACF;AAEA,OAAO,eAAeK,kBAAkB,EACtCR,GAAG,EACHS,IAAI,EAIL;IACC,MAAM,EAAEP,YAAY,EAAEC,eAAe,EAAE,GAAG,MAAMJ,gBAAgB;QAAEC;IAAI;IACtE,IAAI,CAAEE,CAAAA,YAAY,CAACO,KAAK,IAAIN,eAAe,CAACM,KAAK,AAAD,GAAI;QAClD,OAAO;IACT;IAEA,MAAMC,OACJV,IAAIW,QAAQ,CAACd,KAAKe,KAAK,CAACC,GAAG,KAAKb,IAAIW,QAAQ,CAACd,KAAKiB,KAAK,CAACD,GAAG,IACvDb,MACA,CAAC,EAAEA,IAAI,CAAC,CAAC;IAEf,IAAI;QACF,MAAMe,aAAaC,QAAQC,OAAO,CAAC,CAAC,EAAER,KAAK,aAAa,CAAC,EAAE;YACzDS,OAAO;gBAACR;aAAK;QACf;QACA,MAAMS,gBAAgB,MAAMzB,GAAGW,QAAQ,CAACU,YAAY;QACpD,OAAOnB,MAAMW,KAAK,CAACY,eAAeC,OAAO,IAAI;IAC/C,EAAE,OAAM;QACN,OAAO;IACT;AACF"}

30
node_modules/next/dist/esm/lib/get-project-dir.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
import path from "path";
import { commands } from "./commands";
import * as Log from "../build/output/log";
import { detectTypo } from "./detect-typo";
import { realpathSync } from "./realpath";
export function getProjectDir(dir) {
try {
const resolvedDir = path.resolve(dir || ".");
const realDir = realpathSync(resolvedDir);
if (resolvedDir !== realDir && resolvedDir.toLowerCase() === realDir.toLowerCase()) {
Log.warn(`Invalid casing detected for project dir, received ${resolvedDir} actual path ${realDir}, see more info here https://nextjs.org/docs/messages/invalid-project-dir-casing`);
}
return realDir;
} catch (err) {
if (err.code === "ENOENT") {
if (typeof dir === "string") {
const detectedTypo = detectTypo(dir, Object.keys(commands));
if (detectedTypo) {
Log.error(`"next ${dir}" does not exist. Did you mean "next ${detectedTypo}"?`);
process.exit(1);
}
}
Log.error(`Invalid project directory provided, no such directory: ${path.resolve(dir || ".")}`);
process.exit(1);
}
throw err;
}
}
//# sourceMappingURL=get-project-dir.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/get-project-dir.ts"],"names":["path","commands","Log","detectTypo","realpathSync","getProjectDir","dir","resolvedDir","resolve","realDir","toLowerCase","warn","err","code","detectedTypo","Object","keys","error","process","exit"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AACvB,SAASC,QAAQ,QAAQ,aAAY;AACrC,YAAYC,SAAS,sBAAqB;AAC1C,SAASC,UAAU,QAAQ,gBAAe;AAC1C,SAASC,YAAY,QAAQ,aAAY;AAEzC,OAAO,SAASC,cAAcC,GAAY;IACxC,IAAI;QACF,MAAMC,cAAcP,KAAKQ,OAAO,CAACF,OAAO;QACxC,MAAMG,UAAUL,aAAaG;QAE7B,IACEA,gBAAgBE,WAChBF,YAAYG,WAAW,OAAOD,QAAQC,WAAW,IACjD;YACAR,IAAIS,IAAI,CACN,CAAC,kDAAkD,EAAEJ,YAAY,aAAa,EAAEE,QAAQ,gFAAgF,CAAC;QAE7K;QAEA,OAAOA;IACT,EAAE,OAAOG,KAAU;QACjB,IAAIA,IAAIC,IAAI,KAAK,UAAU;YACzB,IAAI,OAAOP,QAAQ,UAAU;gBAC3B,MAAMQ,eAAeX,WAAWG,KAAKS,OAAOC,IAAI,CAACf;gBAEjD,IAAIa,cAAc;oBAChBZ,IAAIe,KAAK,CACP,CAAC,MAAM,EAAEX,IAAI,qCAAqC,EAAEQ,aAAa,EAAE,CAAC;oBAEtEI,QAAQC,IAAI,CAAC;gBACf;YACF;YAEAjB,IAAIe,KAAK,CACP,CAAC,uDAAuD,EAAEjB,KAAKQ,OAAO,CACpEF,OAAO,KACP,CAAC;YAELY,QAAQC,IAAI,CAAC;QACf;QACA,MAAMP;IACR;AACF"}

19
node_modules/next/dist/esm/lib/get-validated-args.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
import arg from "next/dist/compiled/arg/index.js";
import { printAndExit } from "../server/lib/utils";
import isError from "./is-error";
export function getValidatedArgs(validArgs, argv) {
let args;
try {
args = arg(validArgs, {
argv
});
} catch (error) {
if (isError(error) && error.code === "ARG_UNKNOWN_OPTION") {
printAndExit(error.message, 1);
}
throw error;
}
return args;
}
//# sourceMappingURL=get-validated-args.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/get-validated-args.ts"],"names":["arg","printAndExit","isError","getValidatedArgs","validArgs","argv","args","error","code","message"],"mappings":"AAAA,OAAOA,SAAS,kCAAiC;AACjD,SAASC,YAAY,QAAQ,sBAAqB;AAClD,OAAOC,aAAa,aAAY;AAEhC,OAAO,SAASC,iBAAiBC,SAAmB,EAAEC,IAAe;IACnE,IAAIC;IACJ,IAAI;QACFA,OAAON,IAAII,WAAW;YAAEC;QAAK;IAC/B,EAAE,OAAOE,OAAO;QACd,IAAIL,QAAQK,UAAUA,MAAMC,IAAI,KAAK,sBAAsB;YACzDP,aAAaM,MAAME,OAAO,EAAE;QAC9B;QACA,MAAMF;IACR;IACA,OAAOD;AACT"}

View File

@@ -0,0 +1,37 @@
import { promises as fs } from "fs";
import { fileExists } from "./file-exists";
import { resolveFrom } from "./resolve-from";
import { dirname, join, relative } from "path";
export async function hasNecessaryDependencies(baseDir, requiredPackages) {
let resolutions = new Map();
const missingPackages = [];
await Promise.all(requiredPackages.map(async (p)=>{
try {
const pkgPath = await fs.realpath(resolveFrom(baseDir, `${p.pkg}/package.json`));
const pkgDir = dirname(pkgPath);
if (p.exportsRestrict) {
const fileNameToVerify = relative(p.pkg, p.file);
if (fileNameToVerify) {
const fileToVerify = join(pkgDir, fileNameToVerify);
if (await fileExists(fileToVerify)) {
resolutions.set(p.pkg, fileToVerify);
} else {
return missingPackages.push(p);
}
} else {
resolutions.set(p.pkg, pkgPath);
}
} else {
resolutions.set(p.pkg, resolveFrom(baseDir, p.file));
}
} catch (_) {
return missingPackages.push(p);
}
}));
return {
resolved: resolutions,
missing: missingPackages
};
}
//# sourceMappingURL=has-necessary-dependencies.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/has-necessary-dependencies.ts"],"names":["promises","fs","fileExists","resolveFrom","dirname","join","relative","hasNecessaryDependencies","baseDir","requiredPackages","resolutions","Map","missingPackages","Promise","all","map","p","pkgPath","realpath","pkg","pkgDir","exportsRestrict","fileNameToVerify","file","fileToVerify","set","push","_","resolved","missing"],"mappings":"AAAA,SAASA,YAAYC,EAAE,QAAQ,KAAI;AACnC,SAASC,UAAU,QAAQ,gBAAe;AAC1C,SAASC,WAAW,QAAQ,iBAAgB;AAC5C,SAASC,OAAO,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,OAAM;AAa9C,OAAO,eAAeC,yBACpBC,OAAe,EACfC,gBAAqC;IAErC,IAAIC,cAAc,IAAIC;IACtB,MAAMC,kBAAuC,EAAE;IAE/C,MAAMC,QAAQC,GAAG,CACfL,iBAAiBM,GAAG,CAAC,OAAOC;QAC1B,IAAI;YACF,MAAMC,UAAU,MAAMhB,GAAGiB,QAAQ,CAC/Bf,YAAYK,SAAS,CAAC,EAAEQ,EAAEG,GAAG,CAAC,aAAa,CAAC;YAE9C,MAAMC,SAAShB,QAAQa;YAEvB,IAAID,EAAEK,eAAe,EAAE;gBACrB,MAAMC,mBAAmBhB,SAASU,EAAEG,GAAG,EAAEH,EAAEO,IAAI;gBAC/C,IAAID,kBAAkB;oBACpB,MAAME,eAAenB,KAAKe,QAAQE;oBAClC,IAAI,MAAMpB,WAAWsB,eAAe;wBAClCd,YAAYe,GAAG,CAACT,EAAEG,GAAG,EAAEK;oBACzB,OAAO;wBACL,OAAOZ,gBAAgBc,IAAI,CAACV;oBAC9B;gBACF,OAAO;oBACLN,YAAYe,GAAG,CAACT,EAAEG,GAAG,EAAEF;gBACzB;YACF,OAAO;gBACLP,YAAYe,GAAG,CAACT,EAAEG,GAAG,EAAEhB,YAAYK,SAASQ,EAAEO,IAAI;YACpD;QACF,EAAE,OAAOI,GAAG;YACV,OAAOf,gBAAgBc,IAAI,CAACV;QAC9B;IACF;IAGF,OAAO;QACLY,UAAUlB;QACVmB,SAASjB;IACX;AACF"}

View File

@@ -0,0 +1,49 @@
import os from "os";
import path from "path";
import { fileExists } from "../file-exists";
// get platform specific cache directory adapted from playwright's handling
// https://github.com/microsoft/playwright/blob/7d924470d397975a74a19184c136b3573a974e13/packages/playwright-core/src/utils/registry.ts#L141
export async function getCacheDirectory(fileDirectory, envPath) {
let result;
if (envPath) {
result = envPath;
} else {
let systemCacheDirectory;
if (process.platform === "linux") {
systemCacheDirectory = process.env.XDG_CACHE_HOME || path.join(os.homedir(), ".cache");
} else if (process.platform === "darwin") {
systemCacheDirectory = path.join(os.homedir(), "Library", "Caches");
} else if (process.platform === "win32") {
systemCacheDirectory = process.env.LOCALAPPDATA || path.join(os.homedir(), "AppData", "Local");
} else {
/// Attempt to use generic tmp location for un-handled platform
if (!systemCacheDirectory) {
for (const dir of [
path.join(os.homedir(), ".cache"),
path.join(os.tmpdir())
]){
if (await fileExists(dir)) {
systemCacheDirectory = dir;
break;
}
}
}
if (!systemCacheDirectory) {
console.error(new Error("Unsupported platform: " + process.platform));
process.exit(0);
}
}
result = path.join(systemCacheDirectory, fileDirectory);
}
if (!path.isAbsolute(result)) {
// It is important to resolve to the absolute path:
// - for unzipping to work correctly;
// - so that registry directory matches between installation and execution.
// INIT_CWD points to the root of `npm/yarn install` and is probably what
// the user meant when typing the relative path.
result = path.resolve(process.env["INIT_CWD"] || process.cwd(), result);
}
return result;
}
//# sourceMappingURL=get-cache-directory.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/helpers/get-cache-directory.ts"],"names":["os","path","fileExists","getCacheDirectory","fileDirectory","envPath","result","systemCacheDirectory","process","platform","env","XDG_CACHE_HOME","join","homedir","LOCALAPPDATA","dir","tmpdir","console","error","Error","exit","isAbsolute","resolve","cwd"],"mappings":"AAAA,OAAOA,QAAQ,KAAI;AACnB,OAAOC,UAAU,OAAM;AACvB,SAASC,UAAU,QAAQ,iBAAgB;AAE3C,2EAA2E;AAC3E,4IAA4I;AAC5I,OAAO,eAAeC,kBACpBC,aAAqB,EACrBC,OAAgB;IAEhB,IAAIC;IAEJ,IAAID,SAAS;QACXC,SAASD;IACX,OAAO;QACL,IAAIE;QACJ,IAAIC,QAAQC,QAAQ,KAAK,SAAS;YAChCF,uBACEC,QAAQE,GAAG,CAACC,cAAc,IAAIV,KAAKW,IAAI,CAACZ,GAAGa,OAAO,IAAI;QAC1D,OAAO,IAAIL,QAAQC,QAAQ,KAAK,UAAU;YACxCF,uBAAuBN,KAAKW,IAAI,CAACZ,GAAGa,OAAO,IAAI,WAAW;QAC5D,OAAO,IAAIL,QAAQC,QAAQ,KAAK,SAAS;YACvCF,uBACEC,QAAQE,GAAG,CAACI,YAAY,IAAIb,KAAKW,IAAI,CAACZ,GAAGa,OAAO,IAAI,WAAW;QACnE,OAAO;YACL,+DAA+D;YAC/D,IAAI,CAACN,sBAAsB;gBACzB,KAAK,MAAMQ,OAAO;oBAChBd,KAAKW,IAAI,CAACZ,GAAGa,OAAO,IAAI;oBACxBZ,KAAKW,IAAI,CAACZ,GAAGgB,MAAM;iBACpB,CAAE;oBACD,IAAI,MAAMd,WAAWa,MAAM;wBACzBR,uBAAuBQ;wBACvB;oBACF;gBACF;YACF;YAEA,IAAI,CAACR,sBAAsB;gBACzBU,QAAQC,KAAK,CAAC,IAAIC,MAAM,2BAA2BX,QAAQC,QAAQ;gBACnED,QAAQY,IAAI,CAAC;YACf;QACF;QACAd,SAASL,KAAKW,IAAI,CAACL,sBAAsBH;IAC3C;IAEA,IAAI,CAACH,KAAKoB,UAAU,CAACf,SAAS;QAC5B,mDAAmD;QACnD,uCAAuC;QACvC,6EAA6E;QAC7E,yEAAyE;QACzE,gDAAgD;QAChDA,SAASL,KAAKqB,OAAO,CAACd,QAAQE,GAAG,CAAC,WAAW,IAAIF,QAAQe,GAAG,IAAIjB;IAClE;IACA,OAAOA;AACT"}

View File

@@ -0,0 +1,19 @@
import { execSync } from "child_process";
import { getPkgManager } from "./get-pkg-manager";
export function getNpxCommand(baseDir) {
const pkgManager = getPkgManager(baseDir);
let command = "npx";
if (pkgManager === "pnpm") {
command = "pnpm dlx";
} else if (pkgManager === "yarn") {
try {
execSync("yarn dlx --help", {
stdio: "ignore"
});
command = "yarn dlx";
} catch {}
}
return command;
}
//# sourceMappingURL=get-npx-command.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/helpers/get-npx-command.ts"],"names":["execSync","getPkgManager","getNpxCommand","baseDir","pkgManager","command","stdio"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAe;AACxC,SAASC,aAAa,QAAQ,oBAAmB;AAEjD,OAAO,SAASC,cAAcC,OAAe;IAC3C,MAAMC,aAAaH,cAAcE;IACjC,IAAIE,UAAU;IACd,IAAID,eAAe,QAAQ;QACzBC,UAAU;IACZ,OAAO,IAAID,eAAe,QAAQ;QAChC,IAAI;YACFJ,SAAS,mBAAmB;gBAAEM,OAAO;YAAS;YAC9CD,UAAU;QACZ,EAAE,OAAM,CAAC;IACX;IAEA,OAAOA;AACT"}

36
node_modules/next/dist/esm/lib/helpers/get-online.js generated vendored Normal file
View File

@@ -0,0 +1,36 @@
import { execSync } from "child_process";
import dns from "dns";
import url from "url";
function getProxy() {
if (process.env.https_proxy) {
return process.env.https_proxy;
}
try {
const httpsProxy = execSync("npm config get https-proxy").toString().trim();
return httpsProxy !== "null" ? httpsProxy : undefined;
} catch (e) {
return;
}
}
export function getOnline() {
return new Promise((resolve)=>{
dns.lookup("registry.yarnpkg.com", (registryErr)=>{
if (!registryErr) {
return resolve(true);
}
const proxy = getProxy();
if (!proxy) {
return resolve(false);
}
const { hostname } = url.parse(proxy);
if (!hostname) {
return resolve(false);
}
dns.lookup(hostname, (proxyErr)=>{
resolve(proxyErr == null);
});
});
});
}
//# sourceMappingURL=get-online.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/helpers/get-online.ts"],"names":["execSync","dns","url","getProxy","process","env","https_proxy","httpsProxy","toString","trim","undefined","e","getOnline","Promise","resolve","lookup","registryErr","proxy","hostname","parse","proxyErr"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAe;AACxC,OAAOC,SAAS,MAAK;AACrB,OAAOC,SAAS,MAAK;AAErB,SAASC;IACP,IAAIC,QAAQC,GAAG,CAACC,WAAW,EAAE;QAC3B,OAAOF,QAAQC,GAAG,CAACC,WAAW;IAChC;IAEA,IAAI;QACF,MAAMC,aAAaP,SAAS,8BAA8BQ,QAAQ,GAAGC,IAAI;QACzE,OAAOF,eAAe,SAASA,aAAaG;IAC9C,EAAE,OAAOC,GAAG;QACV;IACF;AACF;AAEA,OAAO,SAASC;IACd,OAAO,IAAIC,QAAQ,CAACC;QAClBb,IAAIc,MAAM,CAAC,wBAAwB,CAACC;YAClC,IAAI,CAACA,aAAa;gBAChB,OAAOF,QAAQ;YACjB;YAEA,MAAMG,QAAQd;YACd,IAAI,CAACc,OAAO;gBACV,OAAOH,QAAQ;YACjB;YAEA,MAAM,EAAEI,QAAQ,EAAE,GAAGhB,IAAIiB,KAAK,CAACF;YAC/B,IAAI,CAACC,UAAU;gBACb,OAAOJ,QAAQ;YACjB;YAEAb,IAAIc,MAAM,CAACG,UAAU,CAACE;gBACpBN,QAAQM,YAAY;YACtB;QACF;IACF;AACF"}

View File

@@ -0,0 +1,48 @@
import fs from "fs";
import path from "path";
import { execSync } from "child_process";
export function getPkgManager(baseDir) {
try {
for (const { lockFile, packageManager } of [
{
lockFile: "yarn.lock",
packageManager: "yarn"
},
{
lockFile: "pnpm-lock.yaml",
packageManager: "pnpm"
},
{
lockFile: "package-lock.json",
packageManager: "npm"
}
]){
if (fs.existsSync(path.join(baseDir, lockFile))) {
return packageManager;
}
}
const userAgent = process.env.npm_config_user_agent;
if (userAgent) {
if (userAgent.startsWith("yarn")) {
return "yarn";
} else if (userAgent.startsWith("pnpm")) {
return "pnpm";
}
}
try {
execSync("yarn --version", {
stdio: "ignore"
});
return "yarn";
} catch {
execSync("pnpm --version", {
stdio: "ignore"
});
return "pnpm";
}
} catch {
return "npm";
}
}
//# sourceMappingURL=get-pkg-manager.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/helpers/get-pkg-manager.ts"],"names":["fs","path","execSync","getPkgManager","baseDir","lockFile","packageManager","existsSync","join","userAgent","process","env","npm_config_user_agent","startsWith","stdio"],"mappings":"AAAA,OAAOA,QAAQ,KAAI;AACnB,OAAOC,UAAU,OAAM;AACvB,SAASC,QAAQ,QAAQ,gBAAe;AAIxC,OAAO,SAASC,cAAcC,OAAe;IAC3C,IAAI;QACF,KAAK,MAAM,EAAEC,QAAQ,EAAEC,cAAc,EAAE,IAAI;YACzC;gBAAED,UAAU;gBAAaC,gBAAgB;YAAO;YAChD;gBAAED,UAAU;gBAAkBC,gBAAgB;YAAO;YACrD;gBAAED,UAAU;gBAAqBC,gBAAgB;YAAM;SACxD,CAAE;YACD,IAAIN,GAAGO,UAAU,CAACN,KAAKO,IAAI,CAACJ,SAASC,YAAY;gBAC/C,OAAOC;YACT;QACF;QACA,MAAMG,YAAYC,QAAQC,GAAG,CAACC,qBAAqB;QACnD,IAAIH,WAAW;YACb,IAAIA,UAAUI,UAAU,CAAC,SAAS;gBAChC,OAAO;YACT,OAAO,IAAIJ,UAAUI,UAAU,CAAC,SAAS;gBACvC,OAAO;YACT;QACF;QACA,IAAI;YACFX,SAAS,kBAAkB;gBAAEY,OAAO;YAAS;YAC7C,OAAO;QACT,EAAE,OAAM;YACNZ,SAAS,kBAAkB;gBAAEY,OAAO;YAAS;YAC7C,OAAO;QACT;IACF,EAAE,OAAM;QACN,OAAO;IACT;AACF"}

20
node_modules/next/dist/esm/lib/helpers/get-registry.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
import { execSync } from "child_process";
import { getPkgManager } from "./get-pkg-manager";
/**
* Returns the package registry using the user's package manager.
* The URL will have a trailing slash.
* @default https://registry.npmjs.org/
*/ export function getRegistry(baseDir = process.cwd()) {
let registry = `https://registry.npmjs.org/`;
try {
const pkgManager = getPkgManager(baseDir);
const output = execSync(`${pkgManager} config get registry`).toString().trim();
if (output.startsWith("http")) {
registry = output.endsWith("/") ? output : `${output}/`;
}
} finally{
return registry;
}
}
//# sourceMappingURL=get-registry.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/helpers/get-registry.ts"],"names":["execSync","getPkgManager","getRegistry","baseDir","process","cwd","registry","pkgManager","output","toString","trim","startsWith","endsWith"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAe;AACxC,SAASC,aAAa,QAAQ,oBAAmB;AAEjD;;;;CAIC,GACD,OAAO,SAASC,YAAYC,UAAkBC,QAAQC,GAAG,EAAE;IACzD,IAAIC,WAAW,CAAC,2BAA2B,CAAC;IAC5C,IAAI;QACF,MAAMC,aAAaN,cAAcE;QACjC,MAAMK,SAASR,SAAS,CAAC,EAAEO,WAAW,oBAAoB,CAAC,EACxDE,QAAQ,GACRC,IAAI;QAEP,IAAIF,OAAOG,UAAU,CAAC,SAAS;YAC7BL,WAAWE,OAAOI,QAAQ,CAAC,OAAOJ,SAAS,CAAC,EAAEA,OAAO,CAAC,CAAC;QACzD;IACF,SAAU;QACR,OAAOF;IACT;AACF"}

View File

@@ -0,0 +1,90 @@
/** https://fetch.spec.whatwg.org/#port-blocking */ export const KNOWN_RESERVED_PORTS = {
1: "tcpmux",
7: "echo",
9: "discard",
11: "systat",
13: "daytime",
15: "netstat",
17: "qotd",
19: "chargen",
20: "ftp-data",
21: "ftp",
22: "ssh",
23: "telnet",
25: "smtp",
37: "time",
42: "name",
43: "nicname",
53: "domain",
69: "tftp",
77: "rje",
79: "finger",
87: "link",
95: "supdup",
101: "hostname",
102: "iso-tsap",
103: "gppitnp",
104: "acr-nema",
109: "pop2",
110: "pop3",
111: "sunrpc",
113: "auth",
115: "sftp",
117: "uucp-path",
119: "nntp",
123: "ntp",
135: "epmap",
137: "netbios-ns",
139: "netbios-ssn",
143: "imap",
161: "snmp",
179: "bgp",
389: "ldap",
427: "svrloc",
465: "submissions",
512: "exec",
513: "login",
514: "shell",
515: "printer",
526: "tempo",
530: "courier",
531: "chat",
532: "netnews",
540: "uucp",
548: "afp",
554: "rtsp",
556: "remotefs",
563: "nntps",
587: "submission",
601: "syslog-conn",
636: "ldaps",
989: "ftps-data",
990: "ftps",
993: "imaps",
995: "pop3s",
1719: "h323gatestat",
1720: "h323hostcall",
1723: "pptp",
2049: "nfs",
3659: "apple-sasl",
4045: "npp",
5060: "sip",
5061: "sips",
6000: "x11",
6566: "sane-port",
6665: "ircu",
6666: "ircu",
6667: "ircu",
6668: "ircu",
6669: "ircu",
6697: "ircs-u",
10080: "amanda"
};
export function isPortIsReserved(port) {
return port in KNOWN_RESERVED_PORTS;
}
export function getReservedPortExplanation(port) {
return `Bad port: "${port}" is reserved for ${KNOWN_RESERVED_PORTS[port]}\n` + "Read more: https://nextjs.org/docs/messages/reserved-port";
}
//# sourceMappingURL=get-reserved-port.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/helpers/get-reserved-port.ts"],"names":["KNOWN_RESERVED_PORTS","isPortIsReserved","port","getReservedPortExplanation"],"mappings":"AAAA,iDAAiD,GACjD,OAAO,MAAMA,uBAAuB;IAClC,GAAG;IACH,GAAG;IACH,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;AACT,EAAU;AAIV,OAAO,SAASC,iBAAiBC,IAAY;IAC3C,OAAOA,QAAQF;AACjB;AAEA,OAAO,SAASG,2BAA2BD,IAAkB;IAC3D,OACE,CAAC,WAAW,EAAEA,KAAK,kBAAkB,EAAEF,oBAAoB,CAACE,KAAK,CAAC,EAAE,CAAC,GACrE;AAEJ"}

94
node_modules/next/dist/esm/lib/helpers/install.js generated vendored Normal file
View File

@@ -0,0 +1,94 @@
import chalk from "next/dist/compiled/chalk";
import spawn from "next/dist/compiled/cross-spawn";
/**
* Spawn a package manager installation with either Yarn or NPM.
*
* @returns A Promise that resolves once the installation is finished.
*/ export function install(root, dependencies, { packageManager, isOnline, devDependencies }) {
/**
* (p)npm-specific command-line flags.
*/ const npmFlags = [];
/**
* Yarn-specific command-line flags.
*/ const yarnFlags = [];
/**
* Return a Promise that resolves once the installation is finished.
*/ return new Promise((resolve, reject)=>{
let args;
let command = packageManager;
const useYarn = packageManager === "yarn";
if (dependencies && dependencies.length) {
/**
* If there are dependencies, run a variation of `{packageManager} add`.
*/ if (useYarn) {
/**
* Call `yarn add --exact (--offline)? (-D)? ...`.
*/ args = [
"add",
"--exact"
];
if (!isOnline) args.push("--offline");
args.push("--cwd", root);
if (devDependencies) args.push("--dev");
args.push(...dependencies);
} else {
/**
* Call `(p)npm install [--save|--save-dev] ...`.
*/ args = [
"install",
"--save-exact"
];
args.push(devDependencies ? "--save-dev" : "--save");
args.push(...dependencies);
}
} else {
/**
* If there are no dependencies, run a variation of `{packageManager}
* install`.
*/ args = [
"install"
];
if (!isOnline) {
console.log(chalk.yellow("You appear to be offline."));
if (useYarn) {
console.log(chalk.yellow("Falling back to the local Yarn cache."));
console.log();
args.push("--offline");
} else {
console.log();
}
}
}
/**
* Add any package manager-specific flags.
*/ if (useYarn) {
args.push(...yarnFlags);
} else {
args.push(...npmFlags);
}
/**
* Spawn the installation process.
*/ const child = spawn(command, args, {
stdio: "inherit",
env: {
...process.env,
ADBLOCK: "1",
// we set NODE_ENV to development as pnpm skips dev
// dependencies when production
NODE_ENV: "development",
DISABLE_OPENCOLLECTIVE: "1"
}
});
child.on("close", (code)=>{
if (code !== 0) {
reject({
command: `${command} ${args.join(" ")}`
});
return;
}
resolve();
});
});
}
//# sourceMappingURL=install.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/helpers/install.ts"],"names":["chalk","spawn","install","root","dependencies","packageManager","isOnline","devDependencies","npmFlags","yarnFlags","Promise","resolve","reject","args","command","useYarn","length","push","console","log","yellow","child","stdio","env","process","ADBLOCK","NODE_ENV","DISABLE_OPENCOLLECTIVE","on","code","join"],"mappings":"AAAA,OAAOA,WAAW,2BAA0B;AAC5C,OAAOC,WAAW,iCAAgC;AAmBlD;;;;CAIC,GACD,OAAO,SAASC,QACdC,IAAY,EACZC,YAA6B,EAC7B,EAAEC,cAAc,EAAEC,QAAQ,EAAEC,eAAe,EAAe;IAE1D;;GAEC,GACD,MAAMC,WAAqB,EAAE;IAC7B;;GAEC,GACD,MAAMC,YAAsB,EAAE;IAC9B;;GAEC,GACD,OAAO,IAAIC,QAAQ,CAACC,SAASC;QAC3B,IAAIC;QACJ,IAAIC,UAAUT;QACd,MAAMU,UAAUV,mBAAmB;QAEnC,IAAID,gBAAgBA,aAAaY,MAAM,EAAE;YACvC;;OAEC,GACD,IAAID,SAAS;gBACX;;SAEC,GACDF,OAAO;oBAAC;oBAAO;iBAAU;gBACzB,IAAI,CAACP,UAAUO,KAAKI,IAAI,CAAC;gBACzBJ,KAAKI,IAAI,CAAC,SAASd;gBACnB,IAAII,iBAAiBM,KAAKI,IAAI,CAAC;gBAC/BJ,KAAKI,IAAI,IAAIb;YACf,OAAO;gBACL;;SAEC,GACDS,OAAO;oBAAC;oBAAW;iBAAe;gBAClCA,KAAKI,IAAI,CAACV,kBAAkB,eAAe;gBAC3CM,KAAKI,IAAI,IAAIb;YACf;QACF,OAAO;YACL;;;OAGC,GACDS,OAAO;gBAAC;aAAU;YAClB,IAAI,CAACP,UAAU;gBACbY,QAAQC,GAAG,CAACnB,MAAMoB,MAAM,CAAC;gBACzB,IAAIL,SAAS;oBACXG,QAAQC,GAAG,CAACnB,MAAMoB,MAAM,CAAC;oBACzBF,QAAQC,GAAG;oBACXN,KAAKI,IAAI,CAAC;gBACZ,OAAO;oBACLC,QAAQC,GAAG;gBACb;YACF;QACF;QACA;;KAEC,GACD,IAAIJ,SAAS;YACXF,KAAKI,IAAI,IAAIR;QACf,OAAO;YACLI,KAAKI,IAAI,IAAIT;QACf;QACA;;KAEC,GACD,MAAMa,QAAQpB,MAAMa,SAASD,MAAM;YACjCS,OAAO;YACPC,KAAK;gBACH,GAAGC,QAAQD,GAAG;gBACdE,SAAS;gBACT,mDAAmD;gBACnD,+BAA+B;gBAC/BC,UAAU;gBACVC,wBAAwB;YAC1B;QACF;QACAN,MAAMO,EAAE,CAAC,SAAS,CAACC;YACjB,IAAIA,SAAS,GAAG;gBACdjB,OAAO;oBAAEE,SAAS,CAAC,EAAEA,QAAQ,CAAC,EAAED,KAAKiB,IAAI,CAAC,KAAK,CAAC;gBAAC;gBACjD;YACF;YACAnB;QACF;IACF;AACF"}

View File

@@ -0,0 +1,5 @@
var _module_parent;
import * as Log from "../build/output/log";
Log.warn(`"next" should not be imported directly, imported in ${(_module_parent = module.parent) == null ? void 0 : _module_parent.filename}\nSee more info here: https://nextjs.org/docs/messages/import-next`);
//# sourceMappingURL=import-next-warning.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/import-next-warning.ts"],"names":["module","Log","warn","parent","filename"],"mappings":"IAGyDA;AAHzD,YAAYC,SAAS,sBAAqB;AAE1CA,IAAIC,IAAI,CACN,CAAC,oDAAoD,GAAEF,iBAAAA,OAAOG,MAAM,qBAAbH,eAAeI,QAAQ,CAAC,kEAAkE,CAAC"}

25
node_modules/next/dist/esm/lib/install-dependencies.js generated vendored Normal file
View File

@@ -0,0 +1,25 @@
import chalk from "next/dist/compiled/chalk";
import path from "path";
import { getPkgManager } from "./helpers/get-pkg-manager";
import { install } from "./helpers/install";
import { getOnline } from "./helpers/get-online";
export async function installDependencies(baseDir, deps, dev = false) {
const packageManager = getPkgManager(baseDir);
const isOnline = await getOnline();
if (deps.length) {
console.log();
console.log(`Installing ${dev ? "devDependencies" : "dependencies"} (${packageManager}):`);
for (const dep of deps){
console.log(`- ${chalk.cyan(dep.pkg)}`);
}
console.log();
await install(path.resolve(baseDir), deps.map((dep)=>dep.pkg), {
devDependencies: dev,
isOnline,
packageManager
});
console.log();
}
}
//# sourceMappingURL=install-dependencies.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/install-dependencies.ts"],"names":["chalk","path","getPkgManager","install","getOnline","installDependencies","baseDir","deps","dev","packageManager","isOnline","length","console","log","dep","cyan","pkg","resolve","map","devDependencies"],"mappings":"AAAA,OAAOA,WAAW,2BAA0B;AAC5C,OAAOC,UAAU,OAAM;AAGvB,SAASC,aAAa,QAAQ,4BAA2B;AACzD,SAASC,OAAO,QAAQ,oBAAmB;AAC3C,SAASC,SAAS,QAAQ,uBAAsB;AAMhD,OAAO,eAAeC,oBACpBC,OAAe,EACfC,IAAS,EACTC,MAAe,KAAK;IAEpB,MAAMC,iBAAiBP,cAAcI;IACrC,MAAMI,WAAW,MAAMN;IAEvB,IAAIG,KAAKI,MAAM,EAAE;QACfC,QAAQC,GAAG;QACXD,QAAQC,GAAG,CACT,CAAC,WAAW,EACVL,MAAM,oBAAoB,eAC3B,EAAE,EAAEC,eAAe,EAAE,CAAC;QAEzB,KAAK,MAAMK,OAAOP,KAAM;YACtBK,QAAQC,GAAG,CAAC,CAAC,EAAE,EAAEb,MAAMe,IAAI,CAACD,IAAIE,GAAG,EAAE,CAAC;QACxC;QACAJ,QAAQC,GAAG;QAEX,MAAMV,QACJF,KAAKgB,OAAO,CAACX,UACbC,KAAKW,GAAG,CAAC,CAACJ,MAA2BA,IAAIE,GAAG,GAC5C;YAAEG,iBAAiBX;YAAKE;YAAUD;QAAe;QAEnDG,QAAQC,GAAG;IACb;AACF"}

5
node_modules/next/dist/esm/lib/interop-default.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
export function interopDefault(mod) {
return mod.default || mod;
}
//# sourceMappingURL=interop-default.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/interop-default.ts"],"names":["interopDefault","mod","default"],"mappings":"AAAA,OAAO,SAASA,eAAeC,GAAQ;IACrC,OAAOA,IAAIC,OAAO,IAAID;AACxB"}

5
node_modules/next/dist/esm/lib/is-api-route.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
export function isAPIRoute(value) {
return value === "/api" || Boolean(value == null ? void 0 : value.startsWith("/api/"));
}
//# sourceMappingURL=is-api-route.js.map

1
node_modules/next/dist/esm/lib/is-api-route.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/is-api-route.ts"],"names":["isAPIRoute","value","Boolean","startsWith"],"mappings":"AAAA,OAAO,SAASA,WAAWC,KAAc;IACvC,OAAOA,UAAU,UAAUC,QAAQD,yBAAAA,MAAOE,UAAU,CAAC;AACvD"}

5
node_modules/next/dist/esm/lib/is-app-page-route.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
export function isAppPageRoute(route) {
return route.endsWith("/page");
}
//# sourceMappingURL=is-app-page-route.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/is-app-page-route.ts"],"names":["isAppPageRoute","route","endsWith"],"mappings":"AAAA,OAAO,SAASA,eAAeC,KAAa;IAC1C,OAAOA,MAAMC,QAAQ,CAAC;AACxB"}

5
node_modules/next/dist/esm/lib/is-app-route-route.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
export function isAppRouteRoute(route) {
return route.endsWith("/route");
}
//# sourceMappingURL=is-app-route-route.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/is-app-route-route.ts"],"names":["isAppRouteRoute","route","endsWith"],"mappings":"AAAA,OAAO,SAASA,gBAAgBC,KAAa;IAC3C,OAAOA,MAAMC,QAAQ,CAAC;AACxB"}

6
node_modules/next/dist/esm/lib/is-edge-runtime.js generated vendored Normal file
View File

@@ -0,0 +1,6 @@
import { SERVER_RUNTIME } from "./constants";
export function isEdgeRuntime(value) {
return value === SERVER_RUNTIME.experimentalEdge || value === SERVER_RUNTIME.edge;
}
//# sourceMappingURL=is-edge-runtime.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/is-edge-runtime.ts"],"names":["SERVER_RUNTIME","isEdgeRuntime","value","experimentalEdge","edge"],"mappings":"AACA,SAASA,cAAc,QAAQ,cAAa;AAE5C,OAAO,SAASC,cAAcC,KAAc;IAC1C,OACEA,UAAUF,eAAeG,gBAAgB,IAAID,UAAUF,eAAeI,IAAI;AAE9E"}

22
node_modules/next/dist/esm/lib/is-error.js generated vendored Normal file
View File

@@ -0,0 +1,22 @@
import { isPlainObject } from "../shared/lib/is-plain-object";
export default function isError(err) {
return typeof err === "object" && err !== null && "name" in err && "message" in err;
}
export function getProperError(err) {
if (isError(err)) {
return err;
}
if (process.env.NODE_ENV === "development") {
// provide better error for case where `throw undefined`
// is called in development
if (typeof err === "undefined") {
return new Error("An undefined error was thrown, " + "see here for more info: https://nextjs.org/docs/messages/threw-undefined");
}
if (err === null) {
return new Error("A null error was thrown, " + "see here for more info: https://nextjs.org/docs/messages/threw-undefined");
}
}
return new Error(isPlainObject(err) ? JSON.stringify(err) : err + "");
}
//# sourceMappingURL=is-error.js.map

1
node_modules/next/dist/esm/lib/is-error.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/is-error.ts"],"names":["isPlainObject","isError","err","getProperError","process","env","NODE_ENV","Error","JSON","stringify"],"mappings":"AAAA,SAASA,aAAa,QAAQ,gCAA+B;AAU7D,eAAe,SAASC,QAAQC,GAAY;IAC1C,OACE,OAAOA,QAAQ,YAAYA,QAAQ,QAAQ,UAAUA,OAAO,aAAaA;AAE7E;AAEA,OAAO,SAASC,eAAeD,GAAY;IACzC,IAAID,QAAQC,MAAM;QAChB,OAAOA;IACT;IAEA,IAAIE,QAAQC,GAAG,CAACC,QAAQ,KAAK,eAAe;QAC1C,wDAAwD;QACxD,2BAA2B;QAC3B,IAAI,OAAOJ,QAAQ,aAAa;YAC9B,OAAO,IAAIK,MACT,oCACE;QAEN;QAEA,IAAIL,QAAQ,MAAM;YAChB,OAAO,IAAIK,MACT,8BACE;QAEN;IACF;IAEA,OAAO,IAAIA,MAAMP,cAAcE,OAAOM,KAAKC,SAAS,CAACP,OAAOA,MAAM;AACpE"}

View File

@@ -0,0 +1,14 @@
export function isInternalComponent(pathname) {
switch(pathname){
case "next/dist/pages/_app":
case "next/dist/pages/_document":
return true;
default:
return false;
}
}
export function isNonRoutePagesPage(pathname) {
return pathname === "/_app" || pathname === "/_document";
}
//# sourceMappingURL=is-internal-component.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/is-internal-component.ts"],"names":["isInternalComponent","pathname","isNonRoutePagesPage"],"mappings":"AAAA,OAAO,SAASA,oBAAoBC,QAAgB;IAClD,OAAQA;QACN,KAAK;QACL,KAAK;YACH,OAAO;QACT;YACE,OAAO;IACX;AACF;AAEA,OAAO,SAASC,oBAAoBD,QAAgB;IAClD,OAAOA,aAAa,WAAWA,aAAa;AAC9C"}

View File

@@ -0,0 +1,60 @@
import { isPlainObject, getObjectClassLabel } from "../shared/lib/is-plain-object";
const regexpPlainIdentifier = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
export class SerializableError extends Error {
constructor(page, method, path, message){
super(path ? `Error serializing \`${path}\` returned from \`${method}\` in "${page}".\nReason: ${message}` : `Error serializing props returned from \`${method}\` in "${page}".\nReason: ${message}`);
}
}
export function isSerializableProps(page, method, input) {
if (!isPlainObject(input)) {
throw new SerializableError(page, method, "", `Props must be returned as a plain object from ${method}: \`{ props: { ... } }\` (received: \`${getObjectClassLabel(input)}\`).`);
}
function visit(visited, value, path) {
if (visited.has(value)) {
throw new SerializableError(page, method, path, `Circular references cannot be expressed in JSON (references: \`${visited.get(value) || "(self)"}\`).`);
}
visited.set(value, path);
}
function isSerializable(refs, value, path) {
const type = typeof value;
if (// `null` can be serialized, but not `undefined`.
value === null || // n.b. `bigint`, `function`, `symbol`, and `undefined` cannot be
// serialized.
//
// `object` is special-cased below, as it may represent `null`, an Array,
// a plain object, a class, et al.
type === "boolean" || type === "number" || type === "string") {
return true;
}
if (type === "undefined") {
throw new SerializableError(page, method, path, "`undefined` cannot be serialized as JSON. Please use `null` or omit this value.");
}
if (isPlainObject(value)) {
visit(refs, value, path);
if (Object.entries(value).every(([key, nestedValue])=>{
const nextPath = regexpPlainIdentifier.test(key) ? `${path}.${key}` : `${path}[${JSON.stringify(key)}]`;
const newRefs = new Map(refs);
return isSerializable(newRefs, key, nextPath) && isSerializable(newRefs, nestedValue, nextPath);
})) {
return true;
}
throw new SerializableError(page, method, path, `invariant: Unknown error encountered in Object.`);
}
if (Array.isArray(value)) {
visit(refs, value, path);
if (value.every((nestedValue, index)=>{
const newRefs = new Map(refs);
return isSerializable(newRefs, nestedValue, `${path}[${index}]`);
})) {
return true;
}
throw new SerializableError(page, method, path, `invariant: Unknown error encountered in Array.`);
}
// None of these can be expressed as JSON:
// const type: "bigint" | "symbol" | "object" | "function"
throw new SerializableError(page, method, path, "`" + type + "`" + (type === "object" ? ` ("${Object.prototype.toString.call(value)}")` : "") + " cannot be serialized as JSON. Please only return JSON serializable data types.");
}
return isSerializable(new Map(), input, "");
}
//# sourceMappingURL=is-serializable-props.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/lib/is-serializable-props.ts"],"names":["isPlainObject","getObjectClassLabel","regexpPlainIdentifier","SerializableError","Error","constructor","page","method","path","message","isSerializableProps","input","visit","visited","value","has","get","set","isSerializable","refs","type","Object","entries","every","key","nestedValue","nextPath","test","JSON","stringify","newRefs","Map","Array","isArray","index","prototype","toString","call"],"mappings":"AAAA,SACEA,aAAa,EACbC,mBAAmB,QACd,gCAA+B;AAEtC,MAAMC,wBAAwB;AAE9B,OAAO,MAAMC,0BAA0BC;IACrCC,YAAYC,IAAY,EAAEC,MAAc,EAAEC,IAAY,EAAEC,OAAe,CAAE;QACvE,KAAK,CACHD,OACI,CAAC,oBAAoB,EAAEA,KAAK,mBAAmB,EAAED,OAAO,OAAO,EAAED,KAAK,YAAY,EAAEG,QAAQ,CAAC,GAC7F,CAAC,wCAAwC,EAAEF,OAAO,OAAO,EAAED,KAAK,YAAY,EAAEG,QAAQ,CAAC;IAE/F;AACF;AAEA,OAAO,SAASC,oBACdJ,IAAY,EACZC,MAAc,EACdI,KAAU;IAEV,IAAI,CAACX,cAAcW,QAAQ;QACzB,MAAM,IAAIR,kBACRG,MACAC,QACA,IACA,CAAC,8CAA8C,EAAEA,OAAO,sCAAsC,EAAEN,oBAC9FU,OACA,IAAI,CAAC;IAEX;IAEA,SAASC,MAAMC,OAAyB,EAAEC,KAAU,EAAEN,IAAY;QAChE,IAAIK,QAAQE,GAAG,CAACD,QAAQ;YACtB,MAAM,IAAIX,kBACRG,MACAC,QACAC,MACA,CAAC,+DAA+D,EAC9DK,QAAQG,GAAG,CAACF,UAAU,SACvB,IAAI,CAAC;QAEV;QAEAD,QAAQI,GAAG,CAACH,OAAON;IACrB;IAEA,SAASU,eACPC,IAAsB,EACtBL,KAAU,EACVN,IAAY;QAEZ,MAAMY,OAAO,OAAON;QACpB,IACE,iDAAiD;QACjDA,UAAU,QACV,iEAAiE;QACjE,cAAc;QACd,EAAE;QACF,yEAAyE;QACzE,kCAAkC;QAClCM,SAAS,aACTA,SAAS,YACTA,SAAS,UACT;YACA,OAAO;QACT;QAEA,IAAIA,SAAS,aAAa;YACxB,MAAM,IAAIjB,kBACRG,MACAC,QACAC,MACA;QAEJ;QAEA,IAAIR,cAAcc,QAAQ;YACxBF,MAAMO,MAAML,OAAON;YAEnB,IACEa,OAAOC,OAAO,CAACR,OAAOS,KAAK,CAAC,CAAC,CAACC,KAAKC,YAAY;gBAC7C,MAAMC,WAAWxB,sBAAsByB,IAAI,CAACH,OACxC,CAAC,EAAEhB,KAAK,CAAC,EAAEgB,IAAI,CAAC,GAChB,CAAC,EAAEhB,KAAK,CAAC,EAAEoB,KAAKC,SAAS,CAACL,KAAK,CAAC,CAAC;gBAErC,MAAMM,UAAU,IAAIC,IAAIZ;gBACxB,OACED,eAAeY,SAASN,KAAKE,aAC7BR,eAAeY,SAASL,aAAaC;YAEzC,IACA;gBACA,OAAO;YACT;YAEA,MAAM,IAAIvB,kBACRG,MACAC,QACAC,MACA,CAAC,+CAA+C,CAAC;QAErD;QAEA,IAAIwB,MAAMC,OAAO,CAACnB,QAAQ;YACxBF,MAAMO,MAAML,OAAON;YAEnB,IACEM,MAAMS,KAAK,CAAC,CAACE,aAAaS;gBACxB,MAAMJ,UAAU,IAAIC,IAAIZ;gBACxB,OAAOD,eAAeY,SAASL,aAAa,CAAC,EAAEjB,KAAK,CAAC,EAAE0B,MAAM,CAAC,CAAC;YACjE,IACA;gBACA,OAAO;YACT;YAEA,MAAM,IAAI/B,kBACRG,MACAC,QACAC,MACA,CAAC,8CAA8C,CAAC;QAEpD;QAEA,0CAA0C;QAC1C,0DAA0D;QAC1D,MAAM,IAAIL,kBACRG,MACAC,QACAC,MACA,MACEY,OACA,MACCA,CAAAA,SAAS,WACN,CAAC,GAAG,EAAEC,OAAOc,SAAS,CAACC,QAAQ,CAACC,IAAI,CAACvB,OAAO,EAAE,CAAC,GAC/C,EAAC,IACL;IAEN;IAEA,OAAOI,eAAe,IAAIa,OAAOpB,OAAO;AAC1C"}

View File

@@ -0,0 +1 @@
["function-bind"]

478
node_modules/next/dist/esm/lib/load-custom-routes.js generated vendored Normal file
View File

@@ -0,0 +1,478 @@
import chalk from "./chalk";
import { escapeStringRegexp } from "../shared/lib/escape-regexp";
import { tryToParsePath } from "./try-to-parse-path";
import { allowedStatusCodes } from "./redirect-status";
const allowedHasTypes = new Set([
"header",
"cookie",
"query",
"host"
]);
const namedGroupsRegex = /\(\?<([a-zA-Z][a-zA-Z0-9]*)>/g;
export function normalizeRouteRegex(regex) {
// clean up un-necessary escaping from regex.source which turns / into \\/
return regex.replace(/\\\//g, "/");
}
function checkRedirect(route) {
const invalidParts = [];
let hadInvalidStatus = false;
if (route.statusCode && !allowedStatusCodes.has(route["statusCode"])) {
hadInvalidStatus = true;
invalidParts.push(`\`statusCode\` is not undefined or valid statusCode`);
}
if (typeof route.permanent !== "boolean" && !route["statusCode"]) {
invalidParts.push(`\`permanent\` is not set to \`true\` or \`false\``);
}
return {
invalidParts,
hadInvalidStatus
};
}
function checkHeader(route) {
const invalidParts = [];
if (!Array.isArray(route.headers)) {
invalidParts.push("`headers` field must be an array");
} else if (route.headers.length === 0) {
invalidParts.push("`headers` field cannot be empty");
} else {
for (const header of route.headers){
if (!header || typeof header !== "object") {
invalidParts.push("`headers` items must be object with { key: '', value: '' }");
break;
}
if (typeof header.key !== "string") {
invalidParts.push("`key` in header item must be string");
break;
}
if (typeof header.value !== "string") {
invalidParts.push("`value` in header item must be string");
break;
}
}
}
return invalidParts;
}
export function checkCustomRoutes(routes, type) {
if (!Array.isArray(routes)) {
console.error(`Error: ${type}s must return an array, received ${typeof routes}.\n` + `See here for more info: https://nextjs.org/docs/messages/routes-must-be-array`);
process.exit(1);
}
let numInvalidRoutes = 0;
let hadInvalidStatus = false;
let hadInvalidHas = false;
let hadInvalidMissing = false;
const allowedKeys = new Set([
"source",
"locale",
"has",
"missing"
]);
if (type === "rewrite") {
allowedKeys.add("basePath");
allowedKeys.add("destination");
}
if (type === "redirect") {
allowedKeys.add("basePath");
allowedKeys.add("statusCode");
allowedKeys.add("permanent");
allowedKeys.add("destination");
}
if (type === "header") {
allowedKeys.add("basePath");
allowedKeys.add("headers");
}
for (const route of routes){
if (!route || typeof route !== "object") {
console.error(`The route ${JSON.stringify(route)} is not a valid object with \`source\`${type !== "middleware" ? ` and \`${type === "header" ? "headers" : "destination"}\`` : ""}`);
numInvalidRoutes++;
continue;
}
if (type === "rewrite" && route.basePath === false && !(route.destination.startsWith("http://") || route.destination.startsWith("https://"))) {
console.error(`The route ${route.source} rewrites urls outside of the basePath. Please use a destination that starts with \`http://\` or \`https://\` https://nextjs.org/docs/messages/invalid-external-rewrite`);
numInvalidRoutes++;
continue;
}
const keys = Object.keys(route);
const invalidKeys = keys.filter((key)=>!allowedKeys.has(key));
const invalidParts = [];
if ("basePath" in route && typeof route.basePath !== "undefined" && route.basePath !== false) {
invalidParts.push("`basePath` must be undefined or false");
}
if (typeof route.locale !== "undefined" && route.locale !== false) {
invalidParts.push("`locale` must be undefined or false");
}
const checkInvalidHasMissing = (items, fieldName)=>{
let hadInvalidItem = false;
if (typeof items !== "undefined" && !Array.isArray(items)) {
invalidParts.push(`\`${fieldName}\` must be undefined or valid has object`);
hadInvalidItem = true;
} else if (items) {
const invalidHasItems = [];
for (const hasItem of items){
let invalidHasParts = [];
if (!allowedHasTypes.has(hasItem.type)) {
invalidHasParts.push(`invalid type "${hasItem.type}"`);
}
if (typeof hasItem.key !== "string" && hasItem.type !== "host") {
invalidHasParts.push(`invalid key "${hasItem.key}"`);
}
if (typeof hasItem.value !== "undefined" && typeof hasItem.value !== "string") {
invalidHasParts.push(`invalid value "${hasItem.value}"`);
}
if (typeof hasItem.value === "undefined" && hasItem.type === "host") {
invalidHasParts.push(`value is required for "host" type`);
}
if (invalidHasParts.length > 0) {
invalidHasItems.push(`${invalidHasParts.join(", ")} for ${JSON.stringify(hasItem)}`);
}
}
if (invalidHasItems.length > 0) {
hadInvalidItem = true;
const itemStr = `item${invalidHasItems.length === 1 ? "" : "s"}`;
console.error(`Invalid \`${fieldName}\` ${itemStr}:\n` + invalidHasItems.join("\n"));
console.error();
invalidParts.push(`invalid \`${fieldName}\` ${itemStr} found`);
}
}
return hadInvalidItem;
};
if (checkInvalidHasMissing(route.has, "has")) {
hadInvalidHas = true;
}
if (checkInvalidHasMissing(route.missing, "missing")) {
hadInvalidMissing = true;
}
if (!route.source) {
invalidParts.push("`source` is missing");
} else if (typeof route.source !== "string") {
invalidParts.push("`source` is not a string");
} else if (!route.source.startsWith("/")) {
invalidParts.push("`source` does not start with /");
}
if (type === "header") {
invalidParts.push(...checkHeader(route));
} else if (type !== "middleware") {
let _route = route;
if (!_route.destination) {
invalidParts.push("`destination` is missing");
} else if (typeof _route.destination !== "string") {
invalidParts.push("`destination` is not a string");
} else if (type === "rewrite" && !_route.destination.match(/^(\/|https:\/\/|http:\/\/)/)) {
invalidParts.push("`destination` does not start with `/`, `http://`, or `https://`");
}
}
if (type === "redirect") {
const result = checkRedirect(route);
hadInvalidStatus = hadInvalidStatus || result.hadInvalidStatus;
invalidParts.push(...result.invalidParts);
}
let sourceTokens;
if (typeof route.source === "string" && route.source.startsWith("/")) {
// only show parse error if we didn't already show error
// for not being a string
const { tokens, error, regexStr } = tryToParsePath(route.source);
if (error) {
invalidParts.push("`source` parse failed");
}
if (regexStr && regexStr.length > 4096) {
invalidParts.push("`source` exceeds max built length of 4096");
}
sourceTokens = tokens;
}
const hasSegments = new Set();
if (route.has) {
for (const hasItem of route.has){
if (!hasItem.value && hasItem.key) {
hasSegments.add(hasItem.key);
}
if (hasItem.value) {
for (const match of hasItem.value.matchAll(namedGroupsRegex)){
if (match[1]) {
hasSegments.add(match[1]);
}
}
if (hasItem.type === "host") {
hasSegments.add("host");
}
}
}
}
// make sure no unnamed patterns are attempted to be used in the
// destination as this can cause confusion and is not allowed
if (typeof route.destination === "string") {
if (route.destination.startsWith("/") && Array.isArray(sourceTokens)) {
const unnamedInDest = new Set();
for (const token of sourceTokens){
if (typeof token === "object" && typeof token.name === "number") {
const unnamedIndex = new RegExp(`:${token.name}(?!\\d)`);
if (route.destination.match(unnamedIndex)) {
unnamedInDest.add(`:${token.name}`);
}
}
}
if (unnamedInDest.size > 0) {
invalidParts.push(`\`destination\` has unnamed params ${[
...unnamedInDest
].join(", ")}`);
} else {
const { tokens: destTokens, regexStr: destRegexStr, error: destinationParseFailed } = tryToParsePath(route.destination, {
handleUrl: true
});
if (destRegexStr && destRegexStr.length > 4096) {
invalidParts.push("`destination` exceeds max built length of 4096");
}
if (destinationParseFailed) {
invalidParts.push("`destination` parse failed");
} else {
const sourceSegments = new Set(sourceTokens.map((item)=>typeof item === "object" && item.name).filter(Boolean));
const invalidDestSegments = new Set();
for (const token of destTokens){
if (typeof token === "object" && !sourceSegments.has(token.name) && !hasSegments.has(token.name)) {
invalidDestSegments.add(token.name);
}
}
if (invalidDestSegments.size) {
invalidParts.push(`\`destination\` has segments not in \`source\` or \`has\` (${[
...invalidDestSegments
].join(", ")})`);
}
}
}
}
}
const hasInvalidKeys = invalidKeys.length > 0;
const hasInvalidParts = invalidParts.length > 0;
if (hasInvalidKeys || hasInvalidParts) {
console.error(`${invalidParts.join(", ")}${invalidKeys.length ? (hasInvalidParts ? "," : "") + ` invalid field${invalidKeys.length === 1 ? "" : "s"}: ` + invalidKeys.join(",") : ""} for route ${JSON.stringify(route)}`);
console.error();
numInvalidRoutes++;
}
}
if (numInvalidRoutes > 0) {
if (hadInvalidStatus) {
console.error(`\nValid redirect statusCode values are ${[
...allowedStatusCodes
].join(", ")}`);
}
if (hadInvalidHas) {
console.error(`\nValid \`has\` object shape is ${JSON.stringify({
type: [
...allowedHasTypes
].join(", "),
key: "the key to check for",
value: "undefined or a value string to match against"
}, null, 2)}`);
}
if (hadInvalidMissing) {
console.error(`\nValid \`missing\` object shape is ${JSON.stringify({
type: [
...allowedHasTypes
].join(", "),
key: "the key to check for",
value: "undefined or a value string to match against"
}, null, 2)}`);
}
console.error();
console.error(`Error: Invalid ${type}${numInvalidRoutes === 1 ? "" : "s"} found`);
process.exit(1);
}
}
function processRoutes(routes, config, type) {
const _routes = routes;
const newRoutes = [];
const defaultLocales = [];
if (config.i18n && type === "redirect") {
var _config_i18n;
for (const item of ((_config_i18n = config.i18n) == null ? void 0 : _config_i18n.domains) || []){
defaultLocales.push({
locale: item.defaultLocale,
base: `http${item.http ? "" : "s"}://${item.domain}`
});
}
defaultLocales.push({
locale: config.i18n.defaultLocale,
base: ""
});
}
for (const r of _routes){
var _r_destination;
const srcBasePath = config.basePath && r.basePath !== false ? config.basePath : "";
const isExternal = !((_r_destination = r.destination) == null ? void 0 : _r_destination.startsWith("/"));
const destBasePath = srcBasePath && !isExternal ? srcBasePath : "";
if (config.i18n && r.locale !== false) {
var _r_destination1;
if (!isExternal) {
defaultLocales.forEach((item)=>{
let destination;
if (r.destination) {
destination = item.base ? `${item.base}${destBasePath}${r.destination}` : `${destBasePath}${r.destination}`;
}
newRoutes.push({
...r,
destination,
source: `${srcBasePath}/${item.locale}${r.source === "/" && !config.trailingSlash ? "" : r.source}`
});
});
}
r.source = `/:nextInternalLocale(${config.i18n.locales.map((locale)=>escapeStringRegexp(locale)).join("|")})${r.source === "/" && !config.trailingSlash ? "" : r.source}`;
if (r.destination && ((_r_destination1 = r.destination) == null ? void 0 : _r_destination1.startsWith("/"))) {
r.destination = `/:nextInternalLocale${r.destination === "/" && !config.trailingSlash ? "" : r.destination}`;
}
}
r.source = `${srcBasePath}${r.source === "/" && srcBasePath ? "" : r.source}`;
if (r.destination) {
r.destination = `${destBasePath}${r.destination === "/" && destBasePath ? "" : r.destination}`;
}
newRoutes.push(r);
}
return newRoutes;
}
async function loadRedirects(config) {
if (typeof config.redirects !== "function") {
return [];
}
let redirects = await config.redirects();
// check before we process the routes and after to ensure
// they are still valid
checkCustomRoutes(redirects, "redirect");
// save original redirects before transforms
if (Array.isArray(redirects)) {
config._originalRedirects = redirects.map((r)=>({
...r
}));
}
redirects = processRoutes(redirects, config, "redirect");
checkCustomRoutes(redirects, "redirect");
return redirects;
}
async function loadRewrites(config) {
if (typeof config.rewrites !== "function") {
return {
beforeFiles: [],
afterFiles: [],
fallback: []
};
}
const _rewrites = await config.rewrites();
let beforeFiles = [];
let afterFiles = [];
let fallback = [];
if (!Array.isArray(_rewrites) && typeof _rewrites === "object" && Object.keys(_rewrites).every((key)=>key === "beforeFiles" || key === "afterFiles" || key === "fallback")) {
beforeFiles = _rewrites.beforeFiles || [];
afterFiles = _rewrites.afterFiles || [];
fallback = _rewrites.fallback || [];
} else {
afterFiles = _rewrites;
}
// check before we process the routes and after to ensure
// they are still valid
checkCustomRoutes(beforeFiles, "rewrite");
checkCustomRoutes(afterFiles, "rewrite");
checkCustomRoutes(fallback, "rewrite");
// save original rewrites before transforms
config._originalRewrites = {
beforeFiles: beforeFiles.map((r)=>({
...r
})),
afterFiles: afterFiles.map((r)=>({
...r
})),
fallback: fallback.map((r)=>({
...r
}))
};
beforeFiles = processRoutes(beforeFiles, config, "rewrite");
afterFiles = processRoutes(afterFiles, config, "rewrite");
fallback = processRoutes(fallback, config, "rewrite");
checkCustomRoutes(beforeFiles, "rewrite");
checkCustomRoutes(afterFiles, "rewrite");
checkCustomRoutes(fallback, "rewrite");
return {
beforeFiles,
afterFiles,
fallback
};
}
async function loadHeaders(config) {
if (typeof config.headers !== "function") {
return [];
}
let headers = await config.headers();
// check before we process the routes and after to ensure
// they are still valid
checkCustomRoutes(headers, "header");
headers = processRoutes(headers, config, "header");
checkCustomRoutes(headers, "header");
return headers;
}
export default async function loadCustomRoutes(config) {
const [headers, rewrites, redirects] = await Promise.all([
loadHeaders(config),
loadRewrites(config),
loadRedirects(config)
]);
const totalRewrites = rewrites.beforeFiles.length + rewrites.afterFiles.length + rewrites.fallback.length;
const totalRoutes = headers.length + redirects.length + totalRewrites;
if (totalRoutes > 1000) {
console.warn(chalk.bold.yellow(`Warning: `) + `total number of custom routes exceeds 1000, this can reduce performance. Route counts:\n` + `headers: ${headers.length}\n` + `rewrites: ${totalRewrites}\n` + `redirects: ${redirects.length}\n` + `See more info: https://nextjs.org/docs/messages/max-custom-routes-reached`);
}
if (!config.skipTrailingSlashRedirect) {
if (config.trailingSlash) {
redirects.unshift({
source: "/:file((?!\\.well-known(?:/.*)?)(?:[^/]+/)*[^/]+\\.\\w+)/",
destination: "/:file",
permanent: true,
locale: config.i18n ? false : undefined,
internal: true,
// don't run this redirect for _next/data requests
missing: [
{
type: "header",
key: "x-nextjs-data"
}
]
}, {
source: "/:notfile((?!\\.well-known(?:/.*)?)(?:[^/]+/)*[^/\\.]+)",
destination: "/:notfile/",
permanent: true,
locale: config.i18n ? false : undefined,
internal: true
});
if (config.basePath) {
redirects.unshift({
source: config.basePath,
destination: config.basePath + "/",
permanent: true,
basePath: false,
locale: config.i18n ? false : undefined,
internal: true
});
}
} else {
redirects.unshift({
source: "/:path+/",
destination: "/:path+",
permanent: true,
locale: config.i18n ? false : undefined,
internal: true
});
if (config.basePath) {
redirects.unshift({
source: config.basePath + "/",
destination: config.basePath,
permanent: true,
basePath: false,
locale: config.i18n ? false : undefined,
internal: true
});
}
}
}
return {
headers,
rewrites,
redirects
};
}
//# sourceMappingURL=load-custom-routes.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,23 @@
const TYPE_URL = "__METADATA_URL";
function replacer(_key, val) {
// clone URL as string but recover it as URL
if (val instanceof URL) {
return {
_type: TYPE_URL,
value: val.href
};
}
return val;
}
function reviver(_key, val) {
if (typeof val === "object" && val !== null && val._type === TYPE_URL) {
return new URL(val.value);
}
return val;
}
export function cloneMetadata(metadata) {
const jsonString = JSON.stringify(metadata, replacer);
return JSON.parse(jsonString, reviver);
}
//# sourceMappingURL=clone-metadata.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/metadata/clone-metadata.ts"],"names":["TYPE_URL","replacer","_key","val","URL","_type","value","href","reviver","cloneMetadata","metadata","jsonString","JSON","stringify","parse"],"mappings":"AAEA,MAAMA,WAAW;AAEjB,SAASC,SAASC,IAAY,EAAEC,GAAQ;IACtC,4CAA4C;IAC5C,IAAIA,eAAeC,KAAK;QACtB,OAAO;YAAEC,OAAOL;YAAUM,OAAOH,IAAII,IAAI;QAAC;IAC5C;IACA,OAAOJ;AACT;AAEA,SAASK,QAAQN,IAAY,EAAEC,GAAQ;IACrC,IAAI,OAAOA,QAAQ,YAAYA,QAAQ,QAAQA,IAAIE,KAAK,KAAKL,UAAU;QACrE,OAAO,IAAII,IAAID,IAAIG,KAAK;IAC1B;IACA,OAAOH;AACT;AAEA,OAAO,SAASM,cAAcC,QAA0B;IACtD,MAAMC,aAAaC,KAAKC,SAAS,CAACH,UAAUT;IAC5C,OAAOW,KAAKE,KAAK,CAACH,YAAYH;AAChC"}

18
node_modules/next/dist/esm/lib/metadata/constants.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
export const ViewPortKeys = {
width: "width",
height: "height",
initialScale: "initial-scale",
minimumScale: "minimum-scale",
maximumScale: "maximum-scale",
viewportFit: "viewport-fit",
userScalable: "user-scalable",
interactiveWidget: "interactive-widget"
};
export const IconKeys = [
"icon",
"shortcut",
"apple",
"other"
];
//# sourceMappingURL=constants.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/metadata/constants.ts"],"names":["ViewPortKeys","width","height","initialScale","minimumScale","maximumScale","viewportFit","userScalable","interactiveWidget","IconKeys"],"mappings":"AAGA,OAAO,MAAMA,eAAkD;IAC7DC,OAAO;IACPC,QAAQ;IACRC,cAAc;IACdC,cAAc;IACdC,cAAc;IACdC,aAAa;IACbC,cAAc;IACdC,mBAAmB;AACrB,EAAU;AAEV,OAAO,MAAMC,WAA4B;IAAC;IAAQ;IAAY;IAAS;CAAQ,CAAA"}

View File

@@ -0,0 +1,43 @@
export function createDefaultMetadata() {
return {
viewport: "width=device-width, initial-scale=1",
metadataBase: null,
// Other values are all null
title: null,
description: null,
applicationName: null,
authors: null,
generator: null,
keywords: null,
referrer: null,
themeColor: null,
colorScheme: null,
creator: null,
publisher: null,
robots: null,
manifest: null,
alternates: {
canonical: null,
languages: null,
media: null,
types: null
},
icons: null,
openGraph: null,
twitter: null,
verification: {},
appleWebApp: null,
formatDetection: null,
itunes: null,
abstract: null,
appLinks: null,
archives: null,
assets: null,
bookmarks: null,
category: null,
classification: null,
other: {}
};
}
//# sourceMappingURL=default-metadata.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/lib/metadata/default-metadata.tsx"],"names":["createDefaultMetadata","viewport","metadataBase","title","description","applicationName","authors","generator","keywords","referrer","themeColor","colorScheme","creator","publisher","robots","manifest","alternates","canonical","languages","media","types","icons","openGraph","twitter","verification","appleWebApp","formatDetection","itunes","abstract","appLinks","archives","assets","bookmarks","category","classification","other"],"mappings":"AAEA,OAAO,SAASA;IACd,OAAO;QACLC,UAAU;QACVC,cAAc;QAEd,4BAA4B;QAC5BC,OAAO;QACPC,aAAa;QACbC,iBAAiB;QACjBC,SAAS;QACTC,WAAW;QACXC,UAAU;QACVC,UAAU;QACVC,YAAY;QACZC,aAAa;QACbC,SAAS;QACTC,WAAW;QACXC,QAAQ;QACRC,UAAU;QACVC,YAAY;YACVC,WAAW;YACXC,WAAW;YACXC,OAAO;YACPC,OAAO;QACT;QACAC,OAAO;QACPC,WAAW;QACXC,SAAS;QACTC,cAAc,CAAC;QACfC,aAAa;QACbC,iBAAiB;QACjBC,QAAQ;QACRC,UAAU;QACVC,UAAU;QACVC,UAAU;QACVC,QAAQ;QACRC,WAAW;QACXC,UAAU;QACVC,gBAAgB;QAChBC,OAAO,CAAC;IACV;AACF"}

View File

@@ -0,0 +1,39 @@
import React from "react";
import { MetaFilter } from "./meta";
function AlternateLink({ descriptor, ...props }) {
if (!descriptor.url) return null;
return /*#__PURE__*/ React.createElement("link", {
...props,
...descriptor.title && {
title: descriptor.title
},
href: descriptor.url.toString()
});
}
export function AlternatesMetadata({ alternates }) {
if (!alternates) return null;
const { canonical, languages, media, types } = alternates;
return MetaFilter([
canonical ? AlternateLink({
rel: "canonical",
descriptor: canonical
}) : null,
languages ? Object.entries(languages).flatMap(([locale, descriptors])=>descriptors == null ? void 0 : descriptors.map((descriptor)=>AlternateLink({
rel: "alternate",
hrefLang: locale,
descriptor
}))) : null,
media ? Object.entries(media).flatMap(([mediaName, descriptors])=>descriptors == null ? void 0 : descriptors.map((descriptor)=>AlternateLink({
rel: "alternate",
media: mediaName,
descriptor
}))) : null,
types ? Object.entries(types).flatMap(([type, descriptors])=>descriptors == null ? void 0 : descriptors.map((descriptor)=>AlternateLink({
rel: "alternate",
type,
descriptor
}))) : null
]);
}
//# sourceMappingURL=alternate.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/lib/metadata/generate/alternate.tsx"],"names":["React","MetaFilter","AlternateLink","descriptor","props","url","link","title","href","toString","AlternatesMetadata","alternates","canonical","languages","media","types","rel","Object","entries","flatMap","locale","descriptors","map","hrefLang","mediaName","type"],"mappings":"AAEA,OAAOA,WAAW,QAAO;AAEzB,SAASC,UAAU,QAAQ,SAAQ;AAEnC,SAASC,cAAc,EACrBC,UAAU,EACV,GAAGC,OAGwC;IAC3C,IAAI,CAACD,WAAWE,GAAG,EAAE,OAAO;IAC5B,qBACE,oBAACC;QACE,GAAGF,KAAK;QACR,GAAID,WAAWI,KAAK,IAAI;YAAEA,OAAOJ,WAAWI,KAAK;QAAC,CAAC;QACpDC,MAAML,WAAWE,GAAG,CAACI,QAAQ;;AAGnC;AAEA,OAAO,SAASC,mBAAmB,EACjCC,UAAU,EAGX;IACC,IAAI,CAACA,YAAY,OAAO;IAExB,MAAM,EAAEC,SAAS,EAAEC,SAAS,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGJ;IAE/C,OAAOV,WAAW;QAChBW,YACIV,cAAc;YAAEc,KAAK;YAAab,YAAYS;QAAU,KACxD;QACJC,YACII,OAAOC,OAAO,CAACL,WAAWM,OAAO,CAAC,CAAC,CAACC,QAAQC,YAAY,GACtDA,+BAAAA,YAAaC,GAAG,CAAC,CAACnB,aAChBD,cAAc;oBAAEc,KAAK;oBAAaO,UAAUH;oBAAQjB;gBAAW,OAGnE;QACJW,QACIG,OAAOC,OAAO,CAACJ,OAAOK,OAAO,CAAC,CAAC,CAACK,WAAWH,YAAY,GACrDA,+BAAAA,YAAaC,GAAG,CAAC,CAACnB,aAChBD,cAAc;oBAAEc,KAAK;oBAAaF,OAAOU;oBAAWrB;gBAAW,OAGnE;QACJY,QACIE,OAAOC,OAAO,CAACH,OAAOI,OAAO,CAAC,CAAC,CAACM,MAAMJ,YAAY,GAChDA,+BAAAA,YAAaC,GAAG,CAAC,CAACnB,aAChBD,cAAc;oBAAEc,KAAK;oBAAaS;oBAAMtB;gBAAW,OAGvD;KACL;AACH"}

View File

@@ -0,0 +1,185 @@
import React from "react";
import { Meta, MetaFilter, MultiMeta } from "./meta";
export function BasicMetadata({ metadata }) {
var _metadata_keywords, _metadata_robots, _metadata_robots1;
return MetaFilter([
/*#__PURE__*/ React.createElement("meta", {
charSet: "utf-8"
}),
metadata.title !== null && metadata.title.absolute ? /*#__PURE__*/ React.createElement("title", null, metadata.title.absolute) : null,
Meta({
name: "description",
content: metadata.description
}),
Meta({
name: "application-name",
content: metadata.applicationName
}),
...metadata.authors ? metadata.authors.map((author)=>[
author.url ? /*#__PURE__*/ React.createElement("link", {
rel: "author",
href: author.url.toString()
}) : null,
Meta({
name: "author",
content: author.name
})
]) : [],
metadata.manifest ? /*#__PURE__*/ React.createElement("link", {
rel: "manifest",
href: metadata.manifest.toString()
}) : null,
Meta({
name: "generator",
content: metadata.generator
}),
Meta({
name: "keywords",
content: (_metadata_keywords = metadata.keywords) == null ? void 0 : _metadata_keywords.join(",")
}),
Meta({
name: "referrer",
content: metadata.referrer
}),
...metadata.themeColor ? metadata.themeColor.map((themeColor)=>Meta({
name: "theme-color",
content: themeColor.color,
media: themeColor.media
})) : [],
Meta({
name: "color-scheme",
content: metadata.colorScheme
}),
Meta({
name: "viewport",
content: metadata.viewport
}),
Meta({
name: "creator",
content: metadata.creator
}),
Meta({
name: "publisher",
content: metadata.publisher
}),
Meta({
name: "robots",
content: (_metadata_robots = metadata.robots) == null ? void 0 : _metadata_robots.basic
}),
Meta({
name: "googlebot",
content: (_metadata_robots1 = metadata.robots) == null ? void 0 : _metadata_robots1.googleBot
}),
Meta({
name: "abstract",
content: metadata.abstract
}),
...metadata.archives ? metadata.archives.map((archive)=>/*#__PURE__*/ React.createElement("link", {
rel: "archives",
href: archive
})) : [],
...metadata.assets ? metadata.assets.map((asset)=>/*#__PURE__*/ React.createElement("link", {
rel: "assets",
href: asset
})) : [],
...metadata.bookmarks ? metadata.bookmarks.map((bookmark)=>/*#__PURE__*/ React.createElement("link", {
rel: "bookmarks",
href: bookmark
})) : [],
Meta({
name: "category",
content: metadata.category
}),
Meta({
name: "classification",
content: metadata.classification
}),
...metadata.other ? Object.entries(metadata.other).map(([name, content])=>Meta({
name,
content: Array.isArray(content) ? content.join(",") : content
})) : []
]);
}
export function ItunesMeta({ itunes }) {
if (!itunes) return null;
const { appId, appArgument } = itunes;
let content = `app-id=${appId}`;
if (appArgument) {
content += `, app-argument=${appArgument}`;
}
return /*#__PURE__*/ React.createElement("meta", {
name: "apple-itunes-app",
content: content
});
}
const formatDetectionKeys = [
"telephone",
"date",
"address",
"email",
"url"
];
export function FormatDetectionMeta({ formatDetection }) {
if (!formatDetection) return null;
let content = "";
for (const key of formatDetectionKeys){
if (key in formatDetection) {
if (content) content += ", ";
content += `${key}=no`;
}
}
return /*#__PURE__*/ React.createElement("meta", {
name: "format-detection",
content: content
});
}
export function AppleWebAppMeta({ appleWebApp }) {
if (!appleWebApp) return null;
const { capable, title, startupImage, statusBarStyle } = appleWebApp;
return MetaFilter([
capable ? Meta({
name: "apple-mobile-web-app-capable",
content: "yes"
}) : null,
Meta({
name: "apple-mobile-web-app-title",
content: title
}),
startupImage ? startupImage.map((image)=>/*#__PURE__*/ React.createElement("link", {
href: image.url,
media: image.media,
rel: "apple-touch-startup-image"
})) : null,
statusBarStyle ? Meta({
name: "apple-mobile-web-app-status-bar-style",
content: statusBarStyle
}) : null
]);
}
export function VerificationMeta({ verification }) {
if (!verification) return null;
return MetaFilter([
MultiMeta({
namePrefix: "google-site-verification",
contents: verification.google
}),
MultiMeta({
namePrefix: "y_key",
contents: verification.yahoo
}),
MultiMeta({
namePrefix: "yandex-verification",
contents: verification.yandex
}),
MultiMeta({
namePrefix: "me",
contents: verification.me
}),
...verification.other ? Object.entries(verification.other).map(([key, value])=>MultiMeta({
namePrefix: key,
contents: value
})) : []
]);
}
//# sourceMappingURL=basic.js.map

Some files were not shown because too many files have changed in this diff Show More