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

View File

@@ -0,0 +1,118 @@
/**
* The I18NProvider is used to match locale aware routes, detect the locale from
* the pathname and hostname and normalize the pathname by removing the locale
* prefix.
*/ export class I18NProvider {
constructor(config){
var _config_domains;
this.config = config;
if (!config.locales.length) {
throw new Error("Invariant: No locales provided");
}
this.lowerCaseLocales = config.locales.map((locale)=>locale.toLowerCase());
this.lowerCaseDomains = (_config_domains = config.domains) == null ? void 0 : _config_domains.map((domainLocale)=>{
var _domainLocale_locales;
const domain = domainLocale.domain.toLowerCase();
return {
defaultLocale: domainLocale.defaultLocale.toLowerCase(),
hostname: domain.split(":")[0],
domain,
locales: (_domainLocale_locales = domainLocale.locales) == null ? void 0 : _domainLocale_locales.map((locale)=>locale.toLowerCase()),
http: domainLocale.http
};
});
}
/**
* Detects the domain locale from the hostname and the detected locale if
* provided.
*
* @param hostname The hostname to detect the domain locale from, this must be lowercased.
* @param detectedLocale The detected locale to use if the hostname does not match.
* @returns The domain locale if found, `undefined` otherwise.
*/ detectDomainLocale(hostname, detectedLocale) {
if (!hostname || !this.lowerCaseDomains || !this.config.domains) return;
if (detectedLocale) detectedLocale = detectedLocale.toLowerCase();
for(let i = 0; i < this.lowerCaseDomains.length; i++){
var // Configuration validation ensures that the locale is not repeated in
// other domains locales.
_domainLocale_locales;
const domainLocale = this.lowerCaseDomains[i];
if (// We assume that the hostname is already lowercased.
domainLocale.hostname === hostname || ((_domainLocale_locales = domainLocale.locales) == null ? void 0 : _domainLocale_locales.some((locale)=>locale === detectedLocale))) {
return this.config.domains[i];
}
}
return;
}
/**
* Pulls the pre-computed locale and inference results from the query
* object.
*
* @param pathname the pathname that could contain a locale prefix
* @param query the query object
* @returns the locale analysis result
*/ fromQuery(pathname, query) {
const detectedLocale = query.__nextLocale;
// If a locale was detected on the query, analyze the pathname to ensure
// that the locale matches.
if (detectedLocale) {
const analysis = this.analyze(pathname);
// If the analysis contained a locale we should validate it against the
// query and strip it from the pathname.
if (analysis.detectedLocale) {
if (analysis.detectedLocale !== detectedLocale) {
throw new Error(`Invariant: The detected locale does not match the locale in the query. Expected to find '${detectedLocale}' in '${pathname}' but found '${analysis.detectedLocale}'}`);
}
pathname = analysis.pathname;
}
}
return {
pathname,
detectedLocale,
inferredFromDefault: query.__nextInferredLocaleFromDefault === "1"
};
}
/**
* Analyzes the pathname for a locale and returns the pathname without it.
*
* @param pathname The pathname that could contain a locale prefix.
* @param options The options to use when matching the locale.
* @returns The matched locale and the pathname without the locale prefix
* (if any).
*/ analyze(pathname, options = {}) {
let detectedLocale = options.defaultLocale;
// By default, we assume that the default locale was inferred if there was
// no detected locale.
let inferredFromDefault = typeof detectedLocale === "string";
// The first segment will be empty, because it has a leading `/`. If
// there is no further segment, there is no locale (or it's the default).
const segments = pathname.split("/");
if (!segments[1]) return {
detectedLocale,
pathname,
inferredFromDefault
};
// The second segment will contain the locale part if any.
const segment = segments[1].toLowerCase();
// See if the segment matches one of the locales. If it doesn't, there is
// no locale (or it's the default).
const index = this.lowerCaseLocales.indexOf(segment);
if (index < 0) return {
detectedLocale,
pathname,
inferredFromDefault
};
// Return the case-sensitive locale.
detectedLocale = this.config.locales[index];
inferredFromDefault = false;
// Remove the `/${locale}` part of the pathname.
pathname = pathname.slice(detectedLocale.length + 1) || "/";
return {
detectedLocale,
pathname,
inferredFromDefault
};
}
}
//# sourceMappingURL=i18n-provider.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/future/helpers/i18n-provider.ts"],"names":["I18NProvider","constructor","config","locales","length","Error","lowerCaseLocales","map","locale","toLowerCase","lowerCaseDomains","domains","domainLocale","domain","defaultLocale","hostname","split","http","detectDomainLocale","detectedLocale","i","some","fromQuery","pathname","query","__nextLocale","analysis","analyze","inferredFromDefault","__nextInferredLocaleFromDefault","options","segments","segment","index","indexOf","slice"],"mappings":"AA+BA;;;;CAIC,GACD,OAAO,MAAMA;IAWXC,YAA4BC,OAA8B;YAMhCA;sBANEA;QAC1B,IAAI,CAACA,OAAOC,OAAO,CAACC,MAAM,EAAE;YAC1B,MAAM,IAAIC,MAAM;QAClB;QAEA,IAAI,CAACC,gBAAgB,GAAGJ,OAAOC,OAAO,CAACI,GAAG,CAAC,CAACC,SAAWA,OAAOC,WAAW;QACzE,IAAI,CAACC,gBAAgB,IAAGR,kBAAAA,OAAOS,OAAO,qBAAdT,gBAAgBK,GAAG,CAAC,CAACK;gBAMhCA;YALX,MAAMC,SAASD,aAAaC,MAAM,CAACJ,WAAW;YAC9C,OAAO;gBACLK,eAAeF,aAAaE,aAAa,CAACL,WAAW;gBACrDM,UAAUF,OAAOG,KAAK,CAAC,IAAI,CAAC,EAAE;gBAC9BH;gBACAV,OAAO,GAAES,wBAAAA,aAAaT,OAAO,qBAApBS,sBAAsBL,GAAG,CAAC,CAACC,SAAWA,OAAOC,WAAW;gBACjEQ,MAAML,aAAaK,IAAI;YACzB;QACF;IACF;IAEA;;;;;;;GAOC,GACD,AAAOC,mBACLH,QAAiB,EACjBI,cAAuB,EACG;QAC1B,IAAI,CAACJ,YAAY,CAAC,IAAI,CAACL,gBAAgB,IAAI,CAAC,IAAI,CAACR,MAAM,CAACS,OAAO,EAAE;QAEjE,IAAIQ,gBAAgBA,iBAAiBA,eAAeV,WAAW;QAE/D,IAAK,IAAIW,IAAI,GAAGA,IAAI,IAAI,CAACV,gBAAgB,CAACN,MAAM,EAAEgB,IAAK;gBAKnD,sEAAsE;YACtE,yBAAyB;YACzBR;YANF,MAAMA,eAAe,IAAI,CAACF,gBAAgB,CAACU,EAAE;YAC7C,IACE,qDAAqD;YACrDR,aAAaG,QAAQ,KAAKA,cAG1BH,wBAAAA,aAAaT,OAAO,qBAApBS,sBAAsBS,IAAI,CAAC,CAACb,SAAWA,WAAWW,kBAClD;gBACA,OAAO,IAAI,CAACjB,MAAM,CAACS,OAAO,CAACS,EAAE;YAC/B;QACF;QAEA;IACF;IAEA;;;;;;;GAOC,GACD,AAAOE,UACLC,QAAgB,EAChBC,KAAyB,EACH;QACtB,MAAML,iBAAiBK,MAAMC,YAAY;QAEzC,wEAAwE;QACxE,2BAA2B;QAC3B,IAAIN,gBAAgB;YAClB,MAAMO,WAAW,IAAI,CAACC,OAAO,CAACJ;YAE9B,uEAAuE;YACvE,wCAAwC;YACxC,IAAIG,SAASP,cAAc,EAAE;gBAC3B,IAAIO,SAASP,cAAc,KAAKA,gBAAgB;oBAC9C,MAAM,IAAId,MACR,CAAC,yFAAyF,EAAEc,eAAe,MAAM,EAAEI,SAAS,aAAa,EAAEG,SAASP,cAAc,CAAC,EAAE,CAAC;gBAE1K;gBAEAI,WAAWG,SAASH,QAAQ;YAC9B;QACF;QAEA,OAAO;YACLA;YACAJ;YACAS,qBAAqBJ,MAAMK,+BAA+B,KAAK;QACjE;IACF;IAEA;;;;;;;GAOC,GACD,AAAOF,QACLJ,QAAgB,EAChBO,UAAiC,CAAC,CAAC,EACb;QACtB,IAAIX,iBAAqCW,QAAQhB,aAAa;QAE9D,0EAA0E;QAC1E,sBAAsB;QACtB,IAAIc,sBAAsB,OAAOT,mBAAmB;QAEpD,oEAAoE;QACpE,yEAAyE;QACzE,MAAMY,WAAWR,SAASP,KAAK,CAAC;QAChC,IAAI,CAACe,QAAQ,CAAC,EAAE,EACd,OAAO;YACLZ;YACAI;YACAK;QACF;QAEF,0DAA0D;QAC1D,MAAMI,UAAUD,QAAQ,CAAC,EAAE,CAACtB,WAAW;QAEvC,yEAAyE;QACzE,mCAAmC;QACnC,MAAMwB,QAAQ,IAAI,CAAC3B,gBAAgB,CAAC4B,OAAO,CAACF;QAC5C,IAAIC,QAAQ,GACV,OAAO;YACLd;YACAI;YACAK;QACF;QAEF,oCAAoC;QACpCT,iBAAiB,IAAI,CAACjB,MAAM,CAACC,OAAO,CAAC8B,MAAM;QAC3CL,sBAAsB;QAEtB,gDAAgD;QAChDL,WAAWA,SAASY,KAAK,CAAChB,eAAef,MAAM,GAAG,MAAM;QAExD,OAAO;YACLe;YACAI;YACAK;QACF;IACF;AACF"}

View File

@@ -0,0 +1,64 @@
import { normalizeAppPath } from "../../../shared/lib/router/utils/app-paths";
// order matters here, the first match will be used
export const INTERCEPTION_ROUTE_MARKERS = [
"(..)(..)",
"(.)",
"(..)",
"(...)"
];
export function isInterceptionRouteAppPath(path) {
// TODO-APP: add more serious validation
return path.split("/").find((segment)=>INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m))) !== undefined;
}
export function extractInterceptionRouteInformation(path) {
let interceptingRoute, marker, interceptedRoute;
for (const segment of path.split("/")){
marker = INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m));
if (marker) {
[interceptingRoute, interceptedRoute] = path.split(marker, 2);
break;
}
}
if (!interceptingRoute || !marker || !interceptedRoute) {
throw new Error(`Invalid interception route: ${path}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`);
}
interceptingRoute = normalizeAppPath(interceptingRoute) // normalize the path, e.g. /(blog)/feed -> /feed
;
switch(marker){
case "(.)":
// (.) indicates that we should match with sibling routes, so we just need to append the intercepted route to the intercepting route
if (interceptingRoute === "/") {
interceptedRoute = `/${interceptedRoute}`;
} else {
interceptedRoute = interceptingRoute + "/" + interceptedRoute;
}
break;
case "(..)":
// (..) indicates that we should match at one level up, so we need to remove the last segment of the intercepting route
if (interceptingRoute === "/") {
throw new Error(`Invalid interception route: ${path}. Cannot use (..) marker at the root level, use (.) instead.`);
}
interceptedRoute = interceptingRoute.split("/").slice(0, -1).concat(interceptedRoute).join("/");
break;
case "(...)":
// (...) will match the route segment in the root directory, so we need to use the root directory to prepend the intercepted route
interceptedRoute = "/" + interceptedRoute;
break;
case "(..)(..)":
// (..)(..) indicates that we should match at two levels up, so we need to remove the last two segments of the intercepting route
const splitInterceptingRoute = interceptingRoute.split("/");
if (splitInterceptingRoute.length <= 2) {
throw new Error(`Invalid interception route: ${path}. Cannot use (..)(..) marker at the root level or one level up.`);
}
interceptedRoute = splitInterceptingRoute.slice(0, -2).concat(interceptedRoute).join("/");
break;
default:
throw new Error("Invariant: unexpected marker");
}
return {
interceptingRoute,
interceptedRoute
};
}
//# sourceMappingURL=interception-routes.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/future/helpers/interception-routes.ts"],"names":["normalizeAppPath","INTERCEPTION_ROUTE_MARKERS","isInterceptionRouteAppPath","path","split","find","segment","m","startsWith","undefined","extractInterceptionRouteInformation","interceptingRoute","marker","interceptedRoute","Error","slice","concat","join","splitInterceptingRoute","length"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,6CAA4C;AAE7E,mDAAmD;AACnD,OAAO,MAAMC,6BAA6B;IACxC;IACA;IACA;IACA;CACD,CAAS;AAEV,OAAO,SAASC,2BAA2BC,IAAY;IACrD,wCAAwC;IACxC,OACEA,KACGC,KAAK,CAAC,KACNC,IAAI,CAAC,CAACC,UACLL,2BAA2BI,IAAI,CAAC,CAACE,IAAMD,QAAQE,UAAU,CAACD,SACtDE;AAEZ;AAEA,OAAO,SAASC,oCAAoCP,IAAY;IAC9D,IAAIQ,mBACFC,QACAC;IAEF,KAAK,MAAMP,WAAWH,KAAKC,KAAK,CAAC,KAAM;QACrCQ,SAASX,2BAA2BI,IAAI,CAAC,CAACE,IAAMD,QAAQE,UAAU,CAACD;QACnE,IAAIK,QAAQ;YACT,CAACD,mBAAmBE,iBAAiB,GAAGV,KAAKC,KAAK,CAACQ,QAAQ;YAC5D;QACF;IACF;IAEA,IAAI,CAACD,qBAAqB,CAACC,UAAU,CAACC,kBAAkB;QACtD,MAAM,IAAIC,MACR,CAAC,4BAA4B,EAAEX,KAAK,iFAAiF,CAAC;IAE1H;IAEAQ,oBAAoBX,iBAAiBW,mBAAmB,iDAAiD;;IAEzG,OAAQC;QACN,KAAK;YACH,oIAAoI;YACpI,IAAID,sBAAsB,KAAK;gBAC7BE,mBAAmB,CAAC,CAAC,EAAEA,iBAAiB,CAAC;YAC3C,OAAO;gBACLA,mBAAmBF,oBAAoB,MAAME;YAC/C;YACA;QACF,KAAK;YACH,uHAAuH;YACvH,IAAIF,sBAAsB,KAAK;gBAC7B,MAAM,IAAIG,MACR,CAAC,4BAA4B,EAAEX,KAAK,4DAA4D,CAAC;YAErG;YACAU,mBAAmBF,kBAChBP,KAAK,CAAC,KACNW,KAAK,CAAC,GAAG,CAAC,GACVC,MAAM,CAACH,kBACPI,IAAI,CAAC;YACR;QACF,KAAK;YACH,kIAAkI;YAClIJ,mBAAmB,MAAMA;YACzB;QACF,KAAK;YACH,iIAAiI;YAEjI,MAAMK,yBAAyBP,kBAAkBP,KAAK,CAAC;YACvD,IAAIc,uBAAuBC,MAAM,IAAI,GAAG;gBACtC,MAAM,IAAIL,MACR,CAAC,4BAA4B,EAAEX,KAAK,+DAA+D,CAAC;YAExG;YAEAU,mBAAmBK,uBAChBH,KAAK,CAAC,GAAG,CAAC,GACVC,MAAM,CAACH,kBACPI,IAAI,CAAC;YACR;QACF;YACE,MAAM,IAAIH,MAAM;IACpB;IAEA,OAAO;QAAEH;QAAmBE;IAAiB;AAC/C"}

View File

@@ -0,0 +1,5 @@
/**
* Loads a given module for a given ID.
*/ export { };
//# sourceMappingURL=module-loader.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/server/future/helpers/module-loader/module-loader.ts"],"names":[],"mappings":"AAAA;;CAEC,GACD,WAEC"}

View File

@@ -0,0 +1,13 @@
/**
* Loads a module using `await require(id)`.
*/ export class NodeModuleLoader {
async load(id) {
if (process.env.NEXT_RUNTIME !== "edge") {
// Need to `await` to cover the case that route is marked ESM modules by ESM escalation.
return await (process.env.NEXT_MINIMAL ? __non_webpack_require__(id) : require(id));
}
throw new Error("NodeModuleLoader is not supported in edge runtime.");
}
}
//# sourceMappingURL=node-module-loader.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/server/future/helpers/module-loader/node-module-loader.ts"],"names":["NodeModuleLoader","load","id","process","env","NEXT_RUNTIME","NEXT_MINIMAL","__non_webpack_require__","require","Error"],"mappings":"AAEA;;CAEC,GACD,OAAO,MAAMA;IACX,MAAaC,KAAQC,EAAU,EAAc;QAC3C,IAAIC,QAAQC,GAAG,CAACC,YAAY,KAAK,QAAQ;YACvC,wFAAwF;YACxF,OAAO,MAAOF,CAAAA,QAAQC,GAAG,CAACE,YAAY,GAElCC,wBAAwBL,MACxBM,QAAQN,GAAE;QAChB;QAEA,MAAM,IAAIO,MAAM;IAClB;AACF"}

View File

@@ -0,0 +1,12 @@
import { NodeModuleLoader } from "./node-module-loader";
export class RouteModuleLoader {
static async load(id, loader = new NodeModuleLoader()) {
const module = await loader.load(id);
if ("routeModule" in module) {
return module.routeModule;
}
throw new Error(`Module "${id}" does not export a routeModule.`);
}
}
//# sourceMappingURL=route-module-loader.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/server/future/helpers/module-loader/route-module-loader.ts"],"names":["NodeModuleLoader","RouteModuleLoader","load","id","loader","module","routeModule","Error"],"mappings":"AAGA,SAASA,gBAAgB,QAAQ,uBAAsB;AAMvD,OAAO,MAAMC;IACX,aAAaC,KACXC,EAAU,EACVC,SAAuB,IAAIJ,kBAAkB,EACjC;QACZ,MAAMK,SAA6B,MAAMD,OAAOF,IAAI,CAACC;QACrD,IAAI,iBAAiBE,QAAQ;YAC3B,OAAOA,OAAOC,WAAW;QAC3B;QAEA,MAAM,IAAIC,MAAM,CAAC,QAAQ,EAAEJ,GAAG,gCAAgC,CAAC;IACjE;AACF"}

View File

@@ -0,0 +1,26 @@
import { absolutePathToPage } from "../../../shared/lib/page-path/absolute-path-to-page";
/**
* Normalizes a given filename so that it's relative to the provided directory.
* It will also strip the extension (if provided) and the trailing `/index`.
*/ export class AbsoluteFilenameNormalizer {
/**
*
* @param dir the directory for which the files should be made relative to
* @param extensions the extensions the file could have
* @param keepIndex when `true` the trailing `/index` is _not_ removed
*/ constructor(dir, extensions, pagesType){
this.dir = dir;
this.extensions = extensions;
this.pagesType = pagesType;
}
normalize(filename) {
return absolutePathToPage(filename, {
extensions: this.extensions,
keepIndex: false,
dir: this.dir,
pagesType: this.pagesType
});
}
}
//# sourceMappingURL=absolute-filename-normalizer.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/future/normalizers/absolute-filename-normalizer.ts"],"names":["absolutePathToPage","AbsoluteFilenameNormalizer","constructor","dir","extensions","pagesType","normalize","filename","keepIndex"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,sDAAqD;AAGxF;;;CAGC,GACD,OAAO,MAAMC;IACX;;;;;GAKC,GACDC,YACmBC,KACAC,YACAC,UACjB;mBAHiBF;0BACAC;yBACAC;IAChB;IAEIC,UAAUC,QAAgB,EAAU;QACzC,OAAOP,mBAAmBO,UAAU;YAClCH,YAAY,IAAI,CAACA,UAAU;YAC3BI,WAAW;YACXL,KAAK,IAAI,CAACA,GAAG;YACbE,WAAW,IAAI,CAACA,SAAS;QAC3B;IACF;AACF"}

View File

@@ -0,0 +1,26 @@
import { Normalizers } from "../../normalizers";
import { PrefixingNormalizer } from "../../prefixing-normalizer";
import { normalizePagePath } from "../../../../../shared/lib/page-path/normalize-page-path";
export class AppBundlePathNormalizer extends PrefixingNormalizer {
constructor(){
super("app");
}
normalize(page) {
return super.normalize(normalizePagePath(page));
}
}
export class DevAppBundlePathNormalizer extends Normalizers {
constructor(pageNormalizer){
super([
// This should normalize the filename to a page.
pageNormalizer,
// Normalize the app page to a pathname.
new AppBundlePathNormalizer()
]);
}
normalize(filename) {
return super.normalize(filename);
}
}
//# sourceMappingURL=app-bundle-path-normalizer.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../src/server/future/normalizers/built/app/app-bundle-path-normalizer.ts"],"names":["Normalizers","PrefixingNormalizer","normalizePagePath","AppBundlePathNormalizer","constructor","normalize","page","DevAppBundlePathNormalizer","pageNormalizer","filename"],"mappings":"AAAA,SAASA,WAAW,QAAQ,oBAAmB;AAE/C,SAASC,mBAAmB,QAAQ,6BAA4B;AAChE,SAASC,iBAAiB,QAAQ,0DAAyD;AAE3F,OAAO,MAAMC,gCAAgCF;IAC3CG,aAAc;QACZ,KAAK,CAAC;IACR;IAEOC,UAAUC,IAAY,EAAU;QACrC,OAAO,KAAK,CAACD,UAAUH,kBAAkBI;IAC3C;AACF;AAEA,OAAO,MAAMC,mCAAmCP;IAC9CI,YAAYI,cAA0B,CAAE;QACtC,KAAK,CAAC;YACJ,gDAAgD;YAChDA;YACA,wCAAwC;YACxC,IAAIL;SACL;IACH;IAEOE,UAAUI,QAAgB,EAAU;QACzC,OAAO,KAAK,CAACJ,UAAUI;IACzB;AACF"}

View File

@@ -0,0 +1,12 @@
import { SERVER_DIRECTORY } from "../../../../../shared/lib/constants";
import { PrefixingNormalizer } from "../../prefixing-normalizer";
export class AppFilenameNormalizer extends PrefixingNormalizer {
constructor(distDir){
super(distDir, SERVER_DIRECTORY);
}
normalize(manifestFilename) {
return super.normalize(manifestFilename);
}
}
//# sourceMappingURL=app-filename-normalizer.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../src/server/future/normalizers/built/app/app-filename-normalizer.ts"],"names":["SERVER_DIRECTORY","PrefixingNormalizer","AppFilenameNormalizer","constructor","distDir","normalize","manifestFilename"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,sCAAqC;AACtE,SAASC,mBAAmB,QAAQ,6BAA4B;AAEhE,OAAO,MAAMC,8BAA8BD;IACzCE,YAAYC,OAAe,CAAE;QAC3B,KAAK,CAACA,SAASJ;IACjB;IAEOK,UAAUC,gBAAwB,EAAU;QACjD,OAAO,KAAK,CAACD,UAAUC;IACzB;AACF"}

View File

@@ -0,0 +1,11 @@
import { AbsoluteFilenameNormalizer } from "../../absolute-filename-normalizer";
/**
* DevAppPageNormalizer is a normalizer that is used to normalize a pathname
* to a page in the `app` directory.
*/ export class DevAppPageNormalizer extends AbsoluteFilenameNormalizer {
constructor(appDir, extensions){
super(appDir, extensions, "app");
}
}
//# sourceMappingURL=app-page-normalizer.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../src/server/future/normalizers/built/app/app-page-normalizer.ts"],"names":["AbsoluteFilenameNormalizer","DevAppPageNormalizer","constructor","appDir","extensions"],"mappings":"AAAA,SAASA,0BAA0B,QAAQ,qCAAoC;AAE/E;;;CAGC,GACD,OAAO,MAAMC,6BAA6BD;IACxCE,YAAYC,MAAc,EAAEC,UAAiC,CAAE;QAC7D,KAAK,CAACD,QAAQC,YAAY;IAC5B;AACF"}

View File

@@ -0,0 +1,33 @@
import { normalizeAppPath } from "../../../../../shared/lib/router/utils/app-paths";
import { Normalizers } from "../../normalizers";
import { wrapNormalizerFn } from "../../wrap-normalizer-fn";
import { UnderscoreNormalizer } from "../../underscore-normalizer";
export class AppPathnameNormalizer extends Normalizers {
constructor(){
super([
// The pathname to match should have the trailing `/page` and other route
// group information stripped from it.
wrapNormalizerFn(normalizeAppPath),
// The page should have the `%5F` characters replaced with `_` characters.
new UnderscoreNormalizer()
]);
}
normalize(page) {
return super.normalize(page);
}
}
export class DevAppPathnameNormalizer extends Normalizers {
constructor(pageNormalizer){
super([
// This should normalize the filename to a page.
pageNormalizer,
// Normalize the app page to a pathname.
new AppPathnameNormalizer()
]);
}
normalize(filename) {
return super.normalize(filename);
}
}
//# sourceMappingURL=app-pathname-normalizer.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../src/server/future/normalizers/built/app/app-pathname-normalizer.ts"],"names":["normalizeAppPath","Normalizers","wrapNormalizerFn","UnderscoreNormalizer","AppPathnameNormalizer","constructor","normalize","page","DevAppPathnameNormalizer","pageNormalizer","filename"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,mDAAkD;AACnF,SAASC,WAAW,QAAQ,oBAAmB;AAC/C,SAASC,gBAAgB,QAAQ,2BAA0B;AAC3D,SAASC,oBAAoB,QAAQ,8BAA6B;AAGlE,OAAO,MAAMC,8BAA8BH;IACzCI,aAAc;QACZ,KAAK,CAAC;YACJ,yEAAyE;YACzE,sCAAsC;YACtCH,iBAAiBF;YACjB,0EAA0E;YAC1E,IAAIG;SACL;IACH;IAEOG,UAAUC,IAAY,EAAU;QACrC,OAAO,KAAK,CAACD,UAAUC;IACzB;AACF;AAEA,OAAO,MAAMC,iCAAiCP;IAC5CI,YAAYI,cAA0B,CAAE;QACtC,KAAK,CAAC;YACJ,gDAAgD;YAChDA;YACA,wCAAwC;YACxC,IAAIL;SACL;IACH;IAEOE,UAAUI,QAAgB,EAAU;QACzC,OAAO,KAAK,CAACJ,UAAUI;IACzB;AACF"}

View File

@@ -0,0 +1,20 @@
import { AppBundlePathNormalizer, DevAppBundlePathNormalizer } from "./app-bundle-path-normalizer";
import { AppFilenameNormalizer } from "./app-filename-normalizer";
import { DevAppPageNormalizer } from "./app-page-normalizer";
import { AppPathnameNormalizer, DevAppPathnameNormalizer } from "./app-pathname-normalizer";
export class AppNormalizers {
constructor(distDir){
this.filename = new AppFilenameNormalizer(distDir);
this.pathname = new AppPathnameNormalizer();
this.bundlePath = new AppBundlePathNormalizer();
}
}
export class DevAppNormalizers {
constructor(appDir, extensions){
this.page = new DevAppPageNormalizer(appDir, extensions);
this.pathname = new DevAppPathnameNormalizer(this.page);
this.bundlePath = new DevAppBundlePathNormalizer(this.page);
}
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../src/server/future/normalizers/built/app/index.ts"],"names":["AppBundlePathNormalizer","DevAppBundlePathNormalizer","AppFilenameNormalizer","DevAppPageNormalizer","AppPathnameNormalizer","DevAppPathnameNormalizer","AppNormalizers","constructor","distDir","filename","pathname","bundlePath","DevAppNormalizers","appDir","extensions","page"],"mappings":"AAAA,SACEA,uBAAuB,EACvBC,0BAA0B,QACrB,+BAA8B;AACrC,SAASC,qBAAqB,QAAQ,4BAA2B;AACjE,SAASC,oBAAoB,QAAQ,wBAAuB;AAC5D,SACEC,qBAAqB,EACrBC,wBAAwB,QACnB,4BAA2B;AAElC,OAAO,MAAMC;IAKXC,YAAYC,OAAe,CAAE;QAC3B,IAAI,CAACC,QAAQ,GAAG,IAAIP,sBAAsBM;QAC1C,IAAI,CAACE,QAAQ,GAAG,IAAIN;QACpB,IAAI,CAACO,UAAU,GAAG,IAAIX;IACxB;AACF;AAEA,OAAO,MAAMY;IAKXL,YAAYM,MAAc,EAAEC,UAAiC,CAAE;QAC7D,IAAI,CAACC,IAAI,GAAG,IAAIZ,qBAAqBU,QAAQC;QAC7C,IAAI,CAACJ,QAAQ,GAAG,IAAIL,yBAAyB,IAAI,CAACU,IAAI;QACtD,IAAI,CAACJ,UAAU,GAAG,IAAIV,2BAA2B,IAAI,CAACc,IAAI;IAC5D;AACF"}

View File

@@ -0,0 +1,22 @@
import { DevPagesBundlePathNormalizer, PagesBundlePathNormalizer } from "./pages-bundle-path-normalizer";
import { PagesFilenameNormalizer } from "./pages-filename-normalizer";
import { DevPagesPageNormalizer } from "./pages-page-normalizer";
import { DevPagesPathnameNormalizer } from "./pages-pathname-normalizer";
export class PagesNormalizers {
constructor(distDir){
this.filename = new PagesFilenameNormalizer(distDir);
this.bundlePath = new PagesBundlePathNormalizer();
// You'd think that we'd require a `pathname` normalizer here, but for
// `/pages` we have to handle i18n routes, which means that we need to
// analyze the page path to determine the locale prefix and it's locale.
}
}
export class DevPagesNormalizers {
constructor(pagesDir, extensions){
this.page = new DevPagesPageNormalizer(pagesDir, extensions);
this.pathname = new DevPagesPathnameNormalizer(pagesDir, extensions);
this.bundlePath = new DevPagesBundlePathNormalizer(this.page);
}
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../src/server/future/normalizers/built/pages/index.ts"],"names":["DevPagesBundlePathNormalizer","PagesBundlePathNormalizer","PagesFilenameNormalizer","DevPagesPageNormalizer","DevPagesPathnameNormalizer","PagesNormalizers","constructor","distDir","filename","bundlePath","DevPagesNormalizers","pagesDir","extensions","page","pathname"],"mappings":"AAAA,SACEA,4BAA4B,EAC5BC,yBAAyB,QACpB,iCAAgC;AACvC,SAASC,uBAAuB,QAAQ,8BAA6B;AACrE,SAASC,sBAAsB,QAAQ,0BAAyB;AAChE,SAASC,0BAA0B,QAAQ,8BAA6B;AAExE,OAAO,MAAMC;IAIXC,YAAYC,OAAe,CAAE;QAC3B,IAAI,CAACC,QAAQ,GAAG,IAAIN,wBAAwBK;QAC5C,IAAI,CAACE,UAAU,GAAG,IAAIR;IAEtB,sEAAsE;IACtE,sEAAsE;IACtE,wEAAwE;IAC1E;AACF;AAEA,OAAO,MAAMS;IAKXJ,YAAYK,QAAgB,EAAEC,UAAiC,CAAE;QAC/D,IAAI,CAACC,IAAI,GAAG,IAAIV,uBAAuBQ,UAAUC;QACjD,IAAI,CAACE,QAAQ,GAAG,IAAIV,2BAA2BO,UAAUC;QACzD,IAAI,CAACH,UAAU,GAAG,IAAIT,6BAA6B,IAAI,CAACa,IAAI;IAC9D;AACF"}

View File

@@ -0,0 +1,33 @@
import { normalizePagePath } from "../../../../../shared/lib/page-path/normalize-page-path";
import { Normalizers } from "../../normalizers";
import { PrefixingNormalizer } from "../../prefixing-normalizer";
import { wrapNormalizerFn } from "../../wrap-normalizer-fn";
export class PagesBundlePathNormalizer extends Normalizers {
constructor(){
super([
// The bundle path should have the trailing `/index` stripped from
// it.
wrapNormalizerFn(normalizePagePath),
// The page should prefixed with `pages/`.
new PrefixingNormalizer("pages")
]);
}
normalize(page) {
return super.normalize(page);
}
}
export class DevPagesBundlePathNormalizer extends Normalizers {
constructor(pagesNormalizer){
super([
// This should normalize the filename to a page.
pagesNormalizer,
// Normalize the app page to a pathname.
new PagesBundlePathNormalizer()
]);
}
normalize(filename) {
return super.normalize(filename);
}
}
//# sourceMappingURL=pages-bundle-path-normalizer.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../src/server/future/normalizers/built/pages/pages-bundle-path-normalizer.ts"],"names":["normalizePagePath","Normalizers","PrefixingNormalizer","wrapNormalizerFn","PagesBundlePathNormalizer","constructor","normalize","page","DevPagesBundlePathNormalizer","pagesNormalizer","filename"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,0DAAyD;AAE3F,SAASC,WAAW,QAAQ,oBAAmB;AAC/C,SAASC,mBAAmB,QAAQ,6BAA4B;AAChE,SAASC,gBAAgB,QAAQ,2BAA0B;AAE3D,OAAO,MAAMC,kCAAkCH;IAC7CI,aAAc;QACZ,KAAK,CAAC;YACJ,kEAAkE;YAClE,MAAM;YACNF,iBAAiBH;YACjB,0CAA0C;YAC1C,IAAIE,oBAAoB;SACzB;IACH;IAEOI,UAAUC,IAAY,EAAU;QACrC,OAAO,KAAK,CAACD,UAAUC;IACzB;AACF;AAEA,OAAO,MAAMC,qCAAqCP;IAChDI,YAAYI,eAA2B,CAAE;QACvC,KAAK,CAAC;YACJ,gDAAgD;YAChDA;YACA,wCAAwC;YACxC,IAAIL;SACL;IACH;IAEOE,UAAUI,QAAgB,EAAU;QACzC,OAAO,KAAK,CAACJ,UAAUI;IACzB;AACF"}

View File

@@ -0,0 +1,12 @@
import { SERVER_DIRECTORY } from "../../../../../shared/lib/constants";
import { PrefixingNormalizer } from "../../prefixing-normalizer";
export class PagesFilenameNormalizer extends PrefixingNormalizer {
constructor(distDir){
super(distDir, SERVER_DIRECTORY);
}
normalize(manifestFilename) {
return super.normalize(manifestFilename);
}
}
//# sourceMappingURL=pages-filename-normalizer.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../src/server/future/normalizers/built/pages/pages-filename-normalizer.ts"],"names":["SERVER_DIRECTORY","PrefixingNormalizer","PagesFilenameNormalizer","constructor","distDir","normalize","manifestFilename"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,sCAAqC;AACtE,SAASC,mBAAmB,QAAQ,6BAA4B;AAEhE,OAAO,MAAMC,gCAAgCD;IAC3CE,YAAYC,OAAe,CAAE;QAC3B,KAAK,CAACA,SAASJ;IACjB;IAEOK,UAAUC,gBAAwB,EAAU;QACjD,OAAO,KAAK,CAACD,UAAUC;IACzB;AACF"}

View File

@@ -0,0 +1,8 @@
import { AbsoluteFilenameNormalizer } from "../../absolute-filename-normalizer";
export class DevPagesPageNormalizer extends AbsoluteFilenameNormalizer {
constructor(pagesDir, extensions){
super(pagesDir, extensions, "pages");
}
}
//# sourceMappingURL=pages-page-normalizer.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../src/server/future/normalizers/built/pages/pages-page-normalizer.ts"],"names":["AbsoluteFilenameNormalizer","DevPagesPageNormalizer","constructor","pagesDir","extensions"],"mappings":"AAAA,SAASA,0BAA0B,QAAQ,qCAAoC;AAE/E,OAAO,MAAMC,+BAA+BD;IAC1CE,YAAYC,QAAgB,EAAEC,UAAiC,CAAE;QAC/D,KAAK,CAACD,UAAUC,YAAY;IAC9B;AACF"}

View File

@@ -0,0 +1,8 @@
import { AbsoluteFilenameNormalizer } from "../../absolute-filename-normalizer";
export class DevPagesPathnameNormalizer extends AbsoluteFilenameNormalizer {
constructor(pagesDir, extensions){
super(pagesDir, extensions, "pages");
}
}
//# sourceMappingURL=pages-pathname-normalizer.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../src/server/future/normalizers/built/pages/pages-pathname-normalizer.ts"],"names":["AbsoluteFilenameNormalizer","DevPagesPathnameNormalizer","constructor","pagesDir","extensions"],"mappings":"AAAA,SAASA,0BAA0B,QAAQ,qCAAoC;AAE/E,OAAO,MAAMC,mCAAmCD;IAC9CE,YAAYC,QAAgB,EAAEC,UAAiC,CAAE;QAC/D,KAAK,CAACD,UAAUC,YAAY;IAC9B;AACF"}

View File

@@ -0,0 +1,18 @@
/**
* Normalizes the pathname by removing the locale prefix if any.
*/ export class LocaleRouteNormalizer {
constructor(provider){
this.provider = provider;
}
/**
* Normalizes the pathname by removing the locale prefix if any.
*
* @param pathname The pathname to normalize.
* @returns The pathname without the locale prefix (if any).
*/ normalize(pathname) {
const match = this.provider.analyze(pathname);
return match.pathname;
}
}
//# sourceMappingURL=locale-route-normalizer.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/future/normalizers/locale-route-normalizer.ts"],"names":["LocaleRouteNormalizer","constructor","provider","normalize","pathname","match","analyze"],"mappings":"AAGA;;CAEC,GACD,OAAO,MAAMA;IACXC,YAA6BC,SAAwB;wBAAxBA;IAAyB;IAEtD;;;;;GAKC,GACD,AAAOC,UAAUC,QAAgB,EAAU;QACzC,MAAMC,QAAQ,IAAI,CAACH,QAAQ,CAACI,OAAO,CAACF;QACpC,OAAOC,MAAMD,QAAQ;IACvB;AACF"}

View File

@@ -0,0 +1,3 @@
export { };
//# sourceMappingURL=normalizer.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/future/normalizers/normalizer.ts"],"names":[],"mappings":"AAAA,WAEC"}

View File

@@ -0,0 +1,16 @@
/**
* Normalizers combines many normalizers into a single normalizer interface that
* will normalize the inputted pathname with each normalizer in order.
*/ export class Normalizers {
constructor(normalizers = []){
this.normalizers = normalizers;
}
push(normalizer) {
this.normalizers.push(normalizer);
}
normalize(pathname) {
return this.normalizers.reduce((normalized, normalizer)=>normalizer.normalize(normalized), pathname);
}
}
//# sourceMappingURL=normalizers.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/future/normalizers/normalizers.ts"],"names":["Normalizers","constructor","normalizers","push","normalizer","normalize","pathname","reduce","normalized"],"mappings":"AAEA;;;CAGC,GACD,OAAO,MAAMA;IACXC,YAA6BC,cAAiC,EAAE,CAAE;2BAArCA;IAAsC;IAE5DC,KAAKC,UAAsB,EAAE;QAClC,IAAI,CAACF,WAAW,CAACC,IAAI,CAACC;IACxB;IAEOC,UAAUC,QAAgB,EAAU;QACzC,OAAO,IAAI,CAACJ,WAAW,CAACK,MAAM,CAC5B,CAACC,YAAYJ,aAAeA,WAAWC,SAAS,CAACG,aACjDF;IAEJ;AACF"}

View File

@@ -0,0 +1,11 @@
import path from "../../../shared/lib/isomorphic/path";
export class PrefixingNormalizer {
constructor(...prefixes){
this.prefix = path.posix.join(...prefixes);
}
normalize(pathname) {
return path.posix.join(this.prefix, pathname);
}
}
//# sourceMappingURL=prefixing-normalizer.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/future/normalizers/prefixing-normalizer.ts"],"names":["path","PrefixingNormalizer","constructor","prefixes","prefix","posix","join","normalize","pathname"],"mappings":"AAAA,OAAOA,UAAU,sCAAqC;AAGtD,OAAO,MAAMC;IAGXC,YAAY,GAAGC,QAA+B,CAAE;QAC9C,IAAI,CAACC,MAAM,GAAGJ,KAAKK,KAAK,CAACC,IAAI,IAAIH;IACnC;IAEOI,UAAUC,QAAgB,EAAU;QACzC,OAAOR,KAAKK,KAAK,CAACC,IAAI,CAAC,IAAI,CAACF,MAAM,EAAEI;IACtC;AACF"}

View File

@@ -0,0 +1,9 @@
/**
* UnderscoreNormalizer replaces all instances of %5F with _.
*/ export class UnderscoreNormalizer {
normalize(pathname) {
return pathname.replace(/%5F/g, "_");
}
}
//# sourceMappingURL=underscore-normalizer.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/future/normalizers/underscore-normalizer.ts"],"names":["UnderscoreNormalizer","normalize","pathname","replace"],"mappings":"AAEA;;CAEC,GACD,OAAO,MAAMA;IACJC,UAAUC,QAAgB,EAAU;QACzC,OAAOA,SAASC,OAAO,CAAC,QAAQ;IAClC;AACF"}

View File

@@ -0,0 +1,7 @@
export function wrapNormalizerFn(fn) {
return {
normalize: fn
};
}
//# sourceMappingURL=wrap-normalizer-fn.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/future/normalizers/wrap-normalizer-fn.ts"],"names":["wrapNormalizerFn","fn","normalize"],"mappings":"AAEA,OAAO,SAASA,iBAAiBC,EAAgC;IAC/D,OAAO;QAAEC,WAAWD;IAAG;AACzB"}

View File

@@ -0,0 +1,3 @@
export { };
//# sourceMappingURL=app-page-route-definition.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/future/route-definitions/app-page-route-definition.ts"],"names":[],"mappings":"AAAA,WAMC"}

View File

@@ -0,0 +1,3 @@
export { };
//# sourceMappingURL=app-route-route-definition.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/future/route-definitions/app-route-route-definition.ts"],"names":[],"mappings":"AAAA,WAIiD"}

View File

@@ -0,0 +1,3 @@
export { };
//# sourceMappingURL=locale-route-definition.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/future/route-definitions/locale-route-definition.ts"],"names":[],"mappings":"AAAA,WAgBC"}

View File

@@ -0,0 +1,3 @@
export { };
//# sourceMappingURL=pages-api-route-definition.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/future/route-definitions/pages-api-route-definition.ts"],"names":[],"mappings":"AAAA,WAIuD"}

View File

@@ -0,0 +1,3 @@
export { };
//# sourceMappingURL=pages-route-definition.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/future/route-definitions/pages-route-definition.ts"],"names":[],"mappings":"AAAA,WAImD"}

View File

@@ -0,0 +1,3 @@
export { };
//# sourceMappingURL=route-definition.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/future/route-definitions/route-definition.ts"],"names":[],"mappings":"AAAA,WAiBC"}

19
node_modules/next/dist/esm/server/future/route-kind.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
export var RouteKind;
(function(RouteKind) {
RouteKind[/**
* `PAGES` represents all the React pages that are under `pages/`.
*/ "PAGES"] = "PAGES";
RouteKind[/**
* `PAGES_API` represents all the API routes under `pages/api/`.
*/ "PAGES_API"] = "PAGES_API";
RouteKind[/**
* `APP_PAGE` represents all the React pages that are under `app/` with the
* filename of `page.{j,t}s{,x}`.
*/ "APP_PAGE"] = "APP_PAGE";
RouteKind[/**
* `APP_ROUTE` represents all the API routes and metadata routes that are under `app/` with the
* filename of `route.{j,t}s{,x}`.
*/ "APP_ROUTE"] = "APP_ROUTE";
})(RouteKind || (RouteKind = {}));
//# sourceMappingURL=route-kind.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/server/future/route-kind.ts"],"names":["RouteKind","PAGES","PAGES_API","APP_PAGE","APP_ROUTE"],"mappings":"WAAO;UAAWA,SAAS;IAATA,UAChB;;GAEC,GACDC,WAAAA;IAJgBD,UAKhB;;GAEC,GACDE,eAAAA;IARgBF,UAShB;;;GAGC,GACDG,cAAAA;IAbgBH,UAchB;;;GAGC,GACDI,eAAAA;GAlBgBJ,cAAAA"}

View File

@@ -0,0 +1,222 @@
/* eslint-disable @typescript-eslint/no-unused-vars */ import { isDynamicRoute } from "../../../shared/lib/router/utils";
import { getSortedRoutes } from "../../../shared/lib/router/utils";
import { LocaleRouteMatcher } from "../route-matchers/locale-route-matcher";
import { ensureLeadingSlash } from "../../../shared/lib/page-path/ensure-leading-slash";
export class DefaultRouteMatcherManager {
/**
* When this value changes, it indicates that a change has been introduced
* that requires recompilation.
*/ get compilationID() {
return this.providers.length;
}
async waitTillReady() {
if (this.waitTillReadyPromise) {
await this.waitTillReadyPromise;
delete this.waitTillReadyPromise;
}
}
async reload() {
let callbacks;
this.waitTillReadyPromise = new Promise((resolve, reject)=>{
callbacks = {
resolve,
reject
};
});
// Grab the compilation ID for this run, we'll verify it at the end to
// ensure that if any routes were added before reloading is finished that
// we error out.
const compilationID = this.compilationID;
try {
// Collect all the matchers from each provider.
const matchers = [];
// Get all the providers matchers.
const providersMatchers = await Promise.all(this.providers.map((provider)=>provider.matchers()));
// Use this to detect duplicate pathnames.
const all = new Map();
const duplicates = {};
for (const providerMatchers of providersMatchers){
for (const matcher of providerMatchers){
// Reset duplicated matches when reloading from pages conflicting state.
if (matcher.duplicated) delete matcher.duplicated;
// Test to see if the matcher being added is a duplicate.
const duplicate = all.get(matcher.definition.pathname);
if (duplicate) {
// This looks a little weird, but essentially if the pathname
// already exists in the duplicates map, then we got that array
// reference. Otherwise, we create a new array with the original
// duplicate first. Then we push the new matcher into the duplicate
// array, and reset it to the duplicates object (which may be a
// no-op if the pathname already existed in the duplicates object).
// Then we set the array of duplicates on both the original
// duplicate object and the new one, so we can keep them in sync.
// If a new duplicate is found, and it matches an existing pathname,
// the retrieval of the `other` will actually return the array
// reference used by all other duplicates. This is why ReadonlyArray
// is so important! Array's are always references!
const others = duplicates[matcher.definition.pathname] ?? [
duplicate
];
others.push(matcher);
duplicates[matcher.definition.pathname] = others;
// Add duplicated details to each route.
duplicate.duplicated = others;
matcher.duplicated = others;
// TODO: see if we should error for duplicates in production?
}
matchers.push(matcher);
// Add the matcher's pathname to the set.
all.set(matcher.definition.pathname, matcher);
}
}
// Update the duplicate matchers. This is used in the development manager
// to warn about duplicates.
this.matchers.duplicates = duplicates;
// If the cache is the same as what we just parsed, we can exit now. We
// can tell by using the `===` which compares object identity, which for
// the manifest matchers, will return the same matcher each time.
if (this.previousMatchers.length === matchers.length && this.previousMatchers.every((cachedMatcher, index)=>cachedMatcher === matchers[index])) {
return;
}
this.previousMatchers = matchers;
// For matchers that are for static routes, filter them now.
this.matchers.static = matchers.filter((matcher)=>!matcher.isDynamic);
// For matchers that are for dynamic routes, filter them and sort them now.
const dynamic = matchers.filter((matcher)=>matcher.isDynamic);
// As `getSortedRoutes` only takes an array of strings, we need to create
// a map of the pathnames (used for sorting) and the matchers. When we
// have locales, there may be multiple matches for the same pathname. To
// handle this, we keep a map of all the indexes (in `reference`) and
// merge them in later.
const reference = new Map();
const pathnames = new Array();
for(let index = 0; index < dynamic.length; index++){
// Grab the pathname from the definition.
const pathname = dynamic[index].definition.pathname;
// Grab the index in the dynamic array, push it into the reference.
const indexes = reference.get(pathname) ?? [];
indexes.push(index);
// If this is the first one set it. If it isn't, we don't need to
// because pushing above on the array will mutate the array already
// stored there because array's are always a reference!
if (indexes.length === 1) reference.set(pathname, indexes);
else continue;
pathnames.push(pathname);
}
// Sort the array of pathnames.
const sorted = getSortedRoutes(pathnames);
// For each of the sorted pathnames, iterate over them, grabbing the list
// of indexes and merging them back into the new `sortedDynamicMatchers`
// array. The order of the same matching pathname doesn't matter because
// they will have other matching characteristics (like the locale) that
// is considered.
const sortedDynamicMatchers = [];
for (const pathname of sorted){
const indexes = reference.get(pathname);
if (!Array.isArray(indexes)) {
throw new Error("Invariant: expected to find identity in indexes map");
}
const dynamicMatches = indexes.map((index)=>dynamic[index]);
sortedDynamicMatchers.push(...dynamicMatches);
}
this.matchers.dynamic = sortedDynamicMatchers;
// This means that there was a new matcher pushed while we were waiting
if (this.compilationID !== compilationID) {
throw new Error("Invariant: expected compilation to finish before new matchers were added, possible missing await");
}
} catch (err) {
callbacks.reject(err);
} finally{
// The compilation ID matched, so mark the complication as finished.
this.lastCompilationID = compilationID;
callbacks.resolve();
}
}
push(provider) {
this.providers.push(provider);
}
async test(pathname, options) {
// See if there's a match for the pathname...
const match = await this.match(pathname, options);
// This default implementation only needs to check to see if there _was_ a
// match. The development matcher actually changes it's behavior by not
// recompiling the routes.
return match !== null;
}
async match(pathname, options) {
// "Iterate" over the match options. Once we found a single match, exit with
// it, otherwise return null below. If no match is found, the inner block
// won't be called.
for await (const match of this.matchAll(pathname, options)){
return match;
}
return null;
}
/**
* This is a point for other managers to override to inject other checking
* behavior like duplicate route checking on a per-request basis.
*
* @param pathname the pathname to validate against
* @param matcher the matcher to validate/test with
* @returns the match if found
*/ validate(pathname, matcher, options) {
var _options_i18n;
if (matcher instanceof LocaleRouteMatcher) {
return matcher.match(pathname, options);
}
// If the locale was inferred from the default locale, then it will have
// already added a locale to the pathname. We need to remove it before
// matching because this matcher is not locale aware.
if ((_options_i18n = options.i18n) == null ? void 0 : _options_i18n.inferredFromDefault) {
return matcher.match(options.i18n.pathname);
}
return matcher.match(pathname);
}
async *matchAll(pathname, options) {
// Guard against the matcher manager from being run before it needs to be
// recompiled. This was preferred to re-running the compilation here because
// it should be re-ran only when it changes. If a match is attempted before
// this is done, it indicates that there is a case where a provider is added
// before it was recompiled (an error). We also don't want to affect request
// times.
if (this.lastCompilationID !== this.compilationID) {
throw new Error("Invariant: expected routes to have been loaded before match");
}
// Ensure that path matching is done with a leading slash.
pathname = ensureLeadingSlash(pathname);
// If this pathname doesn't look like a dynamic route, and this pathname is
// listed in the normalized list of routes, then return it. This ensures
// that when a route like `/user/[id]` is encountered, it doesn't just match
// with the list of normalized routes.
if (!isDynamicRoute(pathname)) {
for (const matcher of this.matchers.static){
const match = this.validate(pathname, matcher, options);
if (!match) continue;
yield match;
}
}
// If we should skip handling dynamic routes, exit now.
if (options == null ? void 0 : options.skipDynamic) return null;
// Loop over the dynamic matchers, yielding each match.
for (const matcher of this.matchers.dynamic){
const match = this.validate(pathname, matcher, options);
if (!match) continue;
yield match;
}
// We tried direct matching against the pathname and against all the dynamic
// paths, so there was no match.
return null;
}
constructor(){
this.providers = [];
this.matchers = {
static: [],
dynamic: [],
duplicates: {}
};
this.lastCompilationID = this.compilationID;
this.previousMatchers = [];
}
}
//# sourceMappingURL=default-route-matcher-manager.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,70 @@
import { RouteKind } from "../route-kind";
import { DefaultRouteMatcherManager } from "./default-route-matcher-manager";
import path from "../../../shared/lib/isomorphic/path";
import * as Log from "../../../build/output/log";
import chalk from "next/dist/compiled/chalk";
export class DevRouteMatcherManager extends DefaultRouteMatcherManager {
constructor(production, ensurer, dir){
super();
this.production = production;
this.ensurer = ensurer;
this.dir = dir;
}
async test(pathname, options) {
// Try to find a match within the developer routes.
const match = await super.match(pathname, options);
// Return if the match wasn't null. Unlike the implementation of `match`
// which uses `matchAll` here, this does not call `ensure` on the match
// found via the development matches.
return match !== null;
}
validate(pathname, matcher, options) {
const match = super.validate(pathname, matcher, options);
// If a match was found, check to see if there were any conflicting app or
// pages files.
// TODO: maybe expand this to _any_ duplicated routes instead?
if (match && matcher.duplicated && matcher.duplicated.some((duplicate)=>duplicate.definition.kind === RouteKind.APP_PAGE || duplicate.definition.kind === RouteKind.APP_ROUTE) && matcher.duplicated.some((duplicate)=>duplicate.definition.kind === RouteKind.PAGES || duplicate.definition.kind === RouteKind.PAGES_API)) {
return null;
}
return match;
}
async *matchAll(pathname, options) {
// Compile the development routes.
// TODO: we may want to only run this during testing, users won't be fast enough to require this many dir scans
await super.reload();
// Iterate over the development matches to see if one of them match the
// request path.
for await (const development of super.matchAll(pathname, options)){
// We're here, which means that we haven't seen this match yet, so we
// should try to ensure it and recompile the production matcher.
await this.ensurer.ensure(development);
await this.production.reload();
// Iterate over the production matches again, this time we should be able
// to match it against the production matcher unless there's an error.
for await (const production of this.production.matchAll(pathname, options)){
yield production;
}
}
// We tried direct matching against the pathname and against all the dynamic
// paths, so there was no match.
return null;
}
async reload() {
// Compile the production routes again.
await this.production.reload();
// Compile the development routes.
await super.reload();
// Check for and warn of any duplicates.
for (const [pathname, matchers] of Object.entries(this.matchers.duplicates)){
// We only want to warn about matchers resolving to the same path if their
// identities are different.
const identity = matchers[0].identity;
if (matchers.slice(1).some((matcher)=>matcher.identity !== identity)) {
continue;
}
Log.warn(`Duplicate page detected. ${matchers.map((matcher)=>chalk.cyan(path.relative(this.dir, matcher.definition.filename))).join(" and ")} resolve to ${chalk.cyan(pathname)}`);
}
}
}
//# sourceMappingURL=dev-route-matcher-manager.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/future/route-matcher-managers/dev-route-matcher-manager.ts"],"names":["RouteKind","DefaultRouteMatcherManager","path","Log","chalk","DevRouteMatcherManager","constructor","production","ensurer","dir","test","pathname","options","match","validate","matcher","duplicated","some","duplicate","definition","kind","APP_PAGE","APP_ROUTE","PAGES","PAGES_API","matchAll","reload","development","ensure","matchers","Object","entries","duplicates","identity","slice","warn","map","cyan","relative","filename","join"],"mappings":"AAAA,SAASA,SAAS,QAAQ,gBAAe;AAGzC,SAASC,0BAA0B,QAAQ,kCAAiC;AAE5E,OAAOC,UAAU,sCAAqC;AACtD,YAAYC,SAAS,4BAA2B;AAChD,OAAOC,WAAW,2BAA0B;AAO5C,OAAO,MAAMC,+BAA+BJ;IAC1CK,YACmBC,YACAC,SACAC,IACjB;QACA,KAAK;0BAJYF;uBACAC;mBACAC;IAGnB;IAEA,MAAaC,KAAKC,QAAgB,EAAEC,OAAqB,EAAoB;QAC3E,mDAAmD;QACnD,MAAMC,QAAQ,MAAM,KAAK,CAACA,MAAMF,UAAUC;QAE1C,wEAAwE;QACxE,uEAAuE;QACvE,qCAAqC;QACrC,OAAOC,UAAU;IACnB;IAEUC,SACRH,QAAgB,EAChBI,OAAqB,EACrBH,OAAqB,EACF;QACnB,MAAMC,QAAQ,KAAK,CAACC,SAASH,UAAUI,SAASH;QAEhD,0EAA0E;QAC1E,eAAe;QACf,8DAA8D;QAC9D,IACEC,SACAE,QAAQC,UAAU,IAClBD,QAAQC,UAAU,CAACC,IAAI,CACrB,CAACC,YACCA,UAAUC,UAAU,CAACC,IAAI,KAAKpB,UAAUqB,QAAQ,IAChDH,UAAUC,UAAU,CAACC,IAAI,KAAKpB,UAAUsB,SAAS,KAErDP,QAAQC,UAAU,CAACC,IAAI,CACrB,CAACC,YACCA,UAAUC,UAAU,CAACC,IAAI,KAAKpB,UAAUuB,KAAK,IAC7CL,UAAUC,UAAU,CAACC,IAAI,KAAKpB,UAAUwB,SAAS,GAErD;YACA,OAAO;QACT;QAEA,OAAOX;IACT;IAEA,OAAcY,SACZd,QAAgB,EAChBC,OAAqB,EACoD;QACzE,kCAAkC;QAClC,+GAA+G;QAC/G,MAAM,KAAK,CAACc;QAEZ,uEAAuE;QACvE,gBAAgB;QAChB,WAAW,MAAMC,eAAe,KAAK,CAACF,SAASd,UAAUC,SAAU;YACjE,qEAAqE;YACrE,gEAAgE;YAChE,MAAM,IAAI,CAACJ,OAAO,CAACoB,MAAM,CAACD;YAC1B,MAAM,IAAI,CAACpB,UAAU,CAACmB,MAAM;YAE5B,yEAAyE;YACzE,sEAAsE;YACtE,WAAW,MAAMnB,cAAc,IAAI,CAACA,UAAU,CAACkB,QAAQ,CACrDd,UACAC,SACC;gBACD,MAAML;YACR;QACF;QAEA,4EAA4E;QAC5E,gCAAgC;QAChC,OAAO;IACT;IAEA,MAAamB,SAAwB;QACnC,uCAAuC;QACvC,MAAM,IAAI,CAACnB,UAAU,CAACmB,MAAM;QAE5B,kCAAkC;QAClC,MAAM,KAAK,CAACA;QAEZ,wCAAwC;QACxC,KAAK,MAAM,CAACf,UAAUkB,SAAS,IAAIC,OAAOC,OAAO,CAC/C,IAAI,CAACF,QAAQ,CAACG,UAAU,EACvB;YACD,0EAA0E;YAC1E,4BAA4B;YAC5B,MAAMC,WAAWJ,QAAQ,CAAC,EAAE,CAACI,QAAQ;YACrC,IAAIJ,SAASK,KAAK,CAAC,GAAGjB,IAAI,CAAC,CAACF,UAAYA,QAAQkB,QAAQ,KAAKA,WAAW;gBACtE;YACF;YAEA9B,IAAIgC,IAAI,CACN,CAAC,yBAAyB,EAAEN,SACzBO,GAAG,CAAC,CAACrB,UACJX,MAAMiC,IAAI,CAACnC,KAAKoC,QAAQ,CAAC,IAAI,CAAC7B,GAAG,EAAEM,QAAQI,UAAU,CAACoB,QAAQ,IAE/DC,IAAI,CAAC,SAAS,YAAY,EAAEpC,MAAMiC,IAAI,CAAC1B,UAAU,CAAC;QAEzD;IACF;AACF"}

View File

@@ -0,0 +1,3 @@
export { };
//# sourceMappingURL=route-matcher-manager.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/future/route-matcher-managers/route-matcher-manager.ts"],"names":[],"mappings":"AAAA,WAiEC"}

View File

@@ -0,0 +1,45 @@
import { isAppPageRoute } from "../../../lib/is-app-page-route";
import { APP_PATHS_MANIFEST } from "../../../shared/lib/constants";
import { AppNormalizers } from "../normalizers/built/app";
import { RouteKind } from "../route-kind";
import { AppPageRouteMatcher } from "../route-matchers/app-page-route-matcher";
import { ManifestRouteMatcherProvider } from "./manifest-route-matcher-provider";
export class AppPageRouteMatcherProvider extends ManifestRouteMatcherProvider {
constructor(distDir, manifestLoader){
super(APP_PATHS_MANIFEST, manifestLoader);
this.normalizers = new AppNormalizers(distDir);
}
async transform(manifest) {
// This matcher only matches app pages.
const pages = Object.keys(manifest).filter((page)=>isAppPageRoute(page));
// Collect all the app paths for each page. This could include any parallel
// routes.
const allAppPaths = {};
for (const page of pages){
const pathname = this.normalizers.pathname.normalize(page);
if (pathname in allAppPaths) allAppPaths[pathname].push(page);
else allAppPaths[pathname] = [
page
];
}
// Format the routes.
const matchers = [];
for (const [pathname, appPaths] of Object.entries(allAppPaths)){
// TODO-APP: (wyattjoh) this is a hack right now, should be more deterministic
const page = appPaths[0];
const filename = this.normalizers.filename.normalize(manifest[page]);
const bundlePath = this.normalizers.bundlePath.normalize(page);
matchers.push(new AppPageRouteMatcher({
kind: RouteKind.APP_PAGE,
pathname,
page,
bundlePath,
filename,
appPaths
}));
}
return matchers;
}
}
//# sourceMappingURL=app-page-route-matcher-provider.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/future/route-matcher-providers/app-page-route-matcher-provider.ts"],"names":["isAppPageRoute","APP_PATHS_MANIFEST","AppNormalizers","RouteKind","AppPageRouteMatcher","ManifestRouteMatcherProvider","AppPageRouteMatcherProvider","constructor","distDir","manifestLoader","normalizers","transform","manifest","pages","Object","keys","filter","page","allAppPaths","pathname","normalize","push","matchers","appPaths","entries","filename","bundlePath","kind","APP_PAGE"],"mappings":"AAAA,SAASA,cAAc,QAAQ,iCAAgC;AAE/D,SAASC,kBAAkB,QAAQ,gCAA+B;AAClE,SAASC,cAAc,QAAQ,2BAA0B;AACzD,SAASC,SAAS,QAAQ,gBAAe;AACzC,SAASC,mBAAmB,QAAQ,2CAA0C;AAK9E,SAASC,4BAA4B,QAAQ,oCAAmC;AAEhF,OAAO,MAAMC,oCAAoCD;IAG/CE,YAAYC,OAAe,EAAEC,cAA8B,CAAE;QAC3D,KAAK,CAACR,oBAAoBQ;QAE1B,IAAI,CAACC,WAAW,GAAG,IAAIR,eAAeM;IACxC;IAEA,MAAgBG,UACdC,QAAkB,EAC2B;QAC7C,uCAAuC;QACvC,MAAMC,QAAQC,OAAOC,IAAI,CAACH,UAAUI,MAAM,CAAC,CAACC,OAASjB,eAAeiB;QAEpE,2EAA2E;QAC3E,UAAU;QACV,MAAMC,cAAwC,CAAC;QAC/C,KAAK,MAAMD,QAAQJ,MAAO;YACxB,MAAMM,WAAW,IAAI,CAACT,WAAW,CAACS,QAAQ,CAACC,SAAS,CAACH;YACrD,IAAIE,YAAYD,aAAaA,WAAW,CAACC,SAAS,CAACE,IAAI,CAACJ;iBACnDC,WAAW,CAACC,SAAS,GAAG;gBAACF;aAAK;QACrC;QAEA,qBAAqB;QACrB,MAAMK,WAAuC,EAAE;QAC/C,KAAK,MAAM,CAACH,UAAUI,SAAS,IAAIT,OAAOU,OAAO,CAACN,aAAc;YAC9D,8EAA8E;YAC9E,MAAMD,OAAOM,QAAQ,CAAC,EAAE;YAExB,MAAME,WAAW,IAAI,CAACf,WAAW,CAACe,QAAQ,CAACL,SAAS,CAACR,QAAQ,CAACK,KAAK;YACnE,MAAMS,aAAa,IAAI,CAAChB,WAAW,CAACgB,UAAU,CAACN,SAAS,CAACH;YAEzDK,SAASD,IAAI,CACX,IAAIjB,oBAAoB;gBACtBuB,MAAMxB,UAAUyB,QAAQ;gBACxBT;gBACAF;gBACAS;gBACAD;gBACAF;YACF;QAEJ;QAEA,OAAOD;IACT;AACF"}

View File

@@ -0,0 +1,33 @@
import { isAppRouteRoute } from "../../../lib/is-app-route-route";
import { APP_PATHS_MANIFEST } from "../../../shared/lib/constants";
import { RouteKind } from "../route-kind";
import { AppRouteRouteMatcher } from "../route-matchers/app-route-route-matcher";
import { ManifestRouteMatcherProvider } from "./manifest-route-matcher-provider";
import { AppNormalizers } from "../normalizers/built/app";
export class AppRouteRouteMatcherProvider extends ManifestRouteMatcherProvider {
constructor(distDir, manifestLoader){
super(APP_PATHS_MANIFEST, manifestLoader);
this.normalizers = new AppNormalizers(distDir);
}
async transform(manifest) {
// This matcher only matches app routes.
const pages = Object.keys(manifest).filter((page)=>isAppRouteRoute(page));
// Format the routes.
const matchers = [];
for (const page of pages){
const filename = this.normalizers.filename.normalize(manifest[page]);
const pathname = this.normalizers.pathname.normalize(page);
const bundlePath = this.normalizers.bundlePath.normalize(page);
matchers.push(new AppRouteRouteMatcher({
kind: RouteKind.APP_ROUTE,
pathname,
page,
bundlePath,
filename
}));
}
return matchers;
}
}
//# sourceMappingURL=app-route-route-matcher-provider.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/future/route-matcher-providers/app-route-route-matcher-provider.ts"],"names":["isAppRouteRoute","APP_PATHS_MANIFEST","RouteKind","AppRouteRouteMatcher","ManifestRouteMatcherProvider","AppNormalizers","AppRouteRouteMatcherProvider","constructor","distDir","manifestLoader","normalizers","transform","manifest","pages","Object","keys","filter","page","matchers","filename","normalize","pathname","bundlePath","push","kind","APP_ROUTE"],"mappings":"AAAA,SAASA,eAAe,QAAQ,kCAAiC;AACjE,SAASC,kBAAkB,QAAQ,gCAA+B;AAClE,SAASC,SAAS,QAAQ,gBAAe;AACzC,SAASC,oBAAoB,QAAQ,4CAA2C;AAKhF,SAASC,4BAA4B,QAAQ,oCAAmC;AAChF,SAASC,cAAc,QAAQ,2BAA0B;AAEzD,OAAO,MAAMC,qCAAqCF;IAGhDG,YAAYC,OAAe,EAAEC,cAA8B,CAAE;QAC3D,KAAK,CAACR,oBAAoBQ;QAE1B,IAAI,CAACC,WAAW,GAAG,IAAIL,eAAeG;IACxC;IAEA,MAAgBG,UACdC,QAAkB,EAC4B;QAC9C,wCAAwC;QACxC,MAAMC,QAAQC,OAAOC,IAAI,CAACH,UAAUI,MAAM,CAAC,CAACC,OAASjB,gBAAgBiB;QAErE,qBAAqB;QACrB,MAAMC,WAAwC,EAAE;QAChD,KAAK,MAAMD,QAAQJ,MAAO;YACxB,MAAMM,WAAW,IAAI,CAACT,WAAW,CAACS,QAAQ,CAACC,SAAS,CAACR,QAAQ,CAACK,KAAK;YACnE,MAAMI,WAAW,IAAI,CAACX,WAAW,CAACW,QAAQ,CAACD,SAAS,CAACH;YACrD,MAAMK,aAAa,IAAI,CAACZ,WAAW,CAACY,UAAU,CAACF,SAAS,CAACH;YAEzDC,SAASK,IAAI,CACX,IAAIpB,qBAAqB;gBACvBqB,MAAMtB,UAAUuB,SAAS;gBACzBJ;gBACAJ;gBACAK;gBACAH;YACF;QAEJ;QAEA,OAAOD;IACT;AACF"}

View File

@@ -0,0 +1,61 @@
import { AppPageRouteMatcher } from "../../route-matchers/app-page-route-matcher";
import { RouteKind } from "../../route-kind";
import { FileCacheRouteMatcherProvider } from "./file-cache-route-matcher-provider";
import { DevAppNormalizers } from "../../normalizers/built/app";
export class DevAppPageRouteMatcherProvider extends FileCacheRouteMatcherProvider {
constructor(appDir, extensions, reader){
super(appDir, reader);
this.normalizers = new DevAppNormalizers(appDir, extensions);
// Match any page file that ends with `/page.${extension}` under the app
// directory.
this.expression = new RegExp(`[/\\\\]page\\.(?:${extensions.join("|")})$`);
}
async transform(files) {
// Collect all the app paths for each page. This could include any parallel
// routes.
const cache = new Map();
const routeFilenames = new Array();
const appPaths = {};
for (const filename of files){
// If the file isn't a match for this matcher, then skip it.
if (!this.expression.test(filename)) continue;
const page = this.normalizers.page.normalize(filename);
// Validate that this is not an ignored page.
if (page.includes("/_")) continue;
// This is a valid file that we want to create a matcher for.
routeFilenames.push(filename);
const pathname = this.normalizers.pathname.normalize(filename);
const bundlePath = this.normalizers.bundlePath.normalize(filename);
// Save the normalization results.
cache.set(filename, {
page,
pathname,
bundlePath
});
if (pathname in appPaths) appPaths[pathname].push(page);
else appPaths[pathname] = [
page
];
}
const matchers = [];
for (const filename of routeFilenames){
// Grab the cached values (and the appPaths).
const cached = cache.get(filename);
if (!cached) {
throw new Error("Invariant: expected filename to exist in cache");
}
const { pathname, page, bundlePath } = cached;
matchers.push(new AppPageRouteMatcher({
kind: RouteKind.APP_PAGE,
pathname,
page,
bundlePath,
filename,
appPaths: appPaths[pathname]
}));
}
return matchers;
}
}
//# sourceMappingURL=dev-app-page-route-matcher-provider.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/server/future/route-matcher-providers/dev/dev-app-page-route-matcher-provider.ts"],"names":["AppPageRouteMatcher","RouteKind","FileCacheRouteMatcherProvider","DevAppNormalizers","DevAppPageRouteMatcherProvider","constructor","appDir","extensions","reader","normalizers","expression","RegExp","join","transform","files","cache","Map","routeFilenames","Array","appPaths","filename","test","page","normalize","includes","push","pathname","bundlePath","set","matchers","cached","get","Error","kind","APP_PAGE"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,8CAA6C;AACjF,SAASC,SAAS,QAAQ,mBAAkB;AAC5C,SAASC,6BAA6B,QAAQ,sCAAqC;AAEnF,SAASC,iBAAiB,QAAQ,8BAA6B;AAE/D,OAAO,MAAMC,uCAAuCF;IAIlDG,YACEC,MAAc,EACdC,UAAiC,EACjCC,MAAkB,CAClB;QACA,KAAK,CAACF,QAAQE;QAEd,IAAI,CAACC,WAAW,GAAG,IAAIN,kBAAkBG,QAAQC;QAEjD,wEAAwE;QACxE,aAAa;QACb,IAAI,CAACG,UAAU,GAAG,IAAIC,OAAO,CAAC,iBAAiB,EAAEJ,WAAWK,IAAI,CAAC,KAAK,EAAE,CAAC;IAC3E;IAEA,MAAgBC,UACdC,KAA4B,EACiB;QAC7C,2EAA2E;QAC3E,UAAU;QACV,MAAMC,QAAQ,IAAIC;QAIlB,MAAMC,iBAAiB,IAAIC;QAC3B,MAAMC,WAAqC,CAAC;QAC5C,KAAK,MAAMC,YAAYN,MAAO;YAC5B,4DAA4D;YAC5D,IAAI,CAAC,IAAI,CAACJ,UAAU,CAACW,IAAI,CAACD,WAAW;YAErC,MAAME,OAAO,IAAI,CAACb,WAAW,CAACa,IAAI,CAACC,SAAS,CAACH;YAE7C,6CAA6C;YAC7C,IAAIE,KAAKE,QAAQ,CAAC,OAAO;YAEzB,6DAA6D;YAC7DP,eAAeQ,IAAI,CAACL;YAEpB,MAAMM,WAAW,IAAI,CAACjB,WAAW,CAACiB,QAAQ,CAACH,SAAS,CAACH;YACrD,MAAMO,aAAa,IAAI,CAAClB,WAAW,CAACkB,UAAU,CAACJ,SAAS,CAACH;YAEzD,kCAAkC;YAClCL,MAAMa,GAAG,CAACR,UAAU;gBAAEE;gBAAMI;gBAAUC;YAAW;YAEjD,IAAID,YAAYP,UAAUA,QAAQ,CAACO,SAAS,CAACD,IAAI,CAACH;iBAC7CH,QAAQ,CAACO,SAAS,GAAG;gBAACJ;aAAK;QAClC;QAEA,MAAMO,WAAuC,EAAE;QAC/C,KAAK,MAAMT,YAAYH,eAAgB;YACrC,6CAA6C;YAC7C,MAAMa,SAASf,MAAMgB,GAAG,CAACX;YACzB,IAAI,CAACU,QAAQ;gBACX,MAAM,IAAIE,MAAM;YAClB;YACA,MAAM,EAAEN,QAAQ,EAAEJ,IAAI,EAAEK,UAAU,EAAE,GAAGG;YAEvCD,SAASJ,IAAI,CACX,IAAIzB,oBAAoB;gBACtBiC,MAAMhC,UAAUiC,QAAQ;gBACxBR;gBACAJ;gBACAK;gBACAP;gBACAD,UAAUA,QAAQ,CAACO,SAAS;YAC9B;QAEJ;QACA,OAAOG;IACT;AACF"}

View File

@@ -0,0 +1,33 @@
import { AppRouteRouteMatcher } from "../../route-matchers/app-route-route-matcher";
import { RouteKind } from "../../route-kind";
import { FileCacheRouteMatcherProvider } from "./file-cache-route-matcher-provider";
import { isAppRouteRoute } from "../../../../lib/is-app-route-route";
import { DevAppNormalizers } from "../../normalizers/built/app";
export class DevAppRouteRouteMatcherProvider extends FileCacheRouteMatcherProvider {
constructor(appDir, extensions, reader){
super(appDir, reader);
this.normalizers = new DevAppNormalizers(appDir, extensions);
}
async transform(files) {
const matchers = [];
for (const filename of files){
const page = this.normalizers.page.normalize(filename);
// If the file isn't a match for this matcher, then skip it.
if (!isAppRouteRoute(page)) continue;
// Validate that this is not an ignored page.
if (page.includes("/_")) continue;
const pathname = this.normalizers.pathname.normalize(filename);
const bundlePath = this.normalizers.bundlePath.normalize(filename);
matchers.push(new AppRouteRouteMatcher({
kind: RouteKind.APP_ROUTE,
pathname,
page,
bundlePath,
filename
}));
}
return matchers;
}
}
//# sourceMappingURL=dev-app-route-route-matcher-provider.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/server/future/route-matcher-providers/dev/dev-app-route-route-matcher-provider.ts"],"names":["AppRouteRouteMatcher","RouteKind","FileCacheRouteMatcherProvider","isAppRouteRoute","DevAppNormalizers","DevAppRouteRouteMatcherProvider","constructor","appDir","extensions","reader","normalizers","transform","files","matchers","filename","page","normalize","includes","pathname","bundlePath","push","kind","APP_ROUTE"],"mappings":"AACA,SAASA,oBAAoB,QAAQ,+CAA8C;AAEnF,SAASC,SAAS,QAAQ,mBAAkB;AAC5C,SAASC,6BAA6B,QAAQ,sCAAqC;AACnF,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,iBAAiB,QAAQ,8BAA6B;AAE/D,OAAO,MAAMC,wCAAwCH;IAOnDI,YACEC,MAAc,EACdC,UAAiC,EACjCC,MAAkB,CAClB;QACA,KAAK,CAACF,QAAQE;QAEd,IAAI,CAACC,WAAW,GAAG,IAAIN,kBAAkBG,QAAQC;IACnD;IAEA,MAAgBG,UACdC,KAA4B,EACkB;QAC9C,MAAMC,WAAwC,EAAE;QAChD,KAAK,MAAMC,YAAYF,MAAO;YAC5B,MAAMG,OAAO,IAAI,CAACL,WAAW,CAACK,IAAI,CAACC,SAAS,CAACF;YAE7C,4DAA4D;YAC5D,IAAI,CAACX,gBAAgBY,OAAO;YAE5B,6CAA6C;YAC7C,IAAIA,KAAKE,QAAQ,CAAC,OAAO;YAEzB,MAAMC,WAAW,IAAI,CAACR,WAAW,CAACQ,QAAQ,CAACF,SAAS,CAACF;YACrD,MAAMK,aAAa,IAAI,CAACT,WAAW,CAACS,UAAU,CAACH,SAAS,CAACF;YAEzDD,SAASO,IAAI,CACX,IAAIpB,qBAAqB;gBACvBqB,MAAMpB,UAAUqB,SAAS;gBACzBJ;gBACAH;gBACAI;gBACAL;YACF;QAEJ;QAEA,OAAOD;IACT;AACF"}

View File

@@ -0,0 +1,65 @@
import { PagesAPILocaleRouteMatcher, PagesAPIRouteMatcher } from "../../route-matchers/pages-api-route-matcher";
import { RouteKind } from "../../route-kind";
import path from "path";
import { FileCacheRouteMatcherProvider } from "./file-cache-route-matcher-provider";
import { DevPagesNormalizers } from "../../normalizers/built/pages";
export class DevPagesAPIRouteMatcherProvider extends FileCacheRouteMatcherProvider {
constructor(pagesDir, extensions, reader, localeNormalizer){
super(pagesDir, reader);
this.pagesDir = pagesDir;
this.extensions = extensions;
this.localeNormalizer = localeNormalizer;
// Match any route file that ends with `/${filename}.${extension}` under the
// pages directory.
this.expression = new RegExp(`\\.(?:${extensions.join("|")})$`);
this.normalizers = new DevPagesNormalizers(pagesDir, extensions);
}
test(filename) {
// If the file does not end in the correct extension it's not a match.
if (!this.expression.test(filename)) return false;
// Pages API routes must exist in the pages directory with the `/api/`
// prefix. The pathnames being tested here though are the full filenames,
// so we need to include the pages directory.
// TODO: could path separator normalization be needed here?
if (filename.startsWith(path.join(this.pagesDir, "/api/"))) return true;
for (const extension of this.extensions){
// We can also match if we have `pages/api.${extension}`, so check to
// see if it's a match.
if (filename === path.join(this.pagesDir, `api.${extension}`)) {
return true;
}
}
return false;
}
async transform(files) {
const matchers = [];
for (const filename of files){
// If the file isn't a match for this matcher, then skip it.
if (!this.test(filename)) continue;
const pathname = this.normalizers.pathname.normalize(filename);
const page = this.normalizers.page.normalize(filename);
const bundlePath = this.normalizers.bundlePath.normalize(filename);
if (this.localeNormalizer) {
matchers.push(new PagesAPILocaleRouteMatcher({
kind: RouteKind.PAGES_API,
pathname,
page,
bundlePath,
filename,
i18n: {}
}));
} else {
matchers.push(new PagesAPIRouteMatcher({
kind: RouteKind.PAGES_API,
pathname,
page,
bundlePath,
filename
}));
}
}
return matchers;
}
}
//# sourceMappingURL=dev-pages-api-route-matcher-provider.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/server/future/route-matcher-providers/dev/dev-pages-api-route-matcher-provider.ts"],"names":["PagesAPILocaleRouteMatcher","PagesAPIRouteMatcher","RouteKind","path","FileCacheRouteMatcherProvider","DevPagesNormalizers","DevPagesAPIRouteMatcherProvider","constructor","pagesDir","extensions","reader","localeNormalizer","expression","RegExp","join","normalizers","test","filename","startsWith","extension","transform","files","matchers","pathname","normalize","page","bundlePath","push","kind","PAGES_API","i18n"],"mappings":"AACA,SACEA,0BAA0B,EAC1BC,oBAAoB,QACf,+CAA8C;AACrD,SAASC,SAAS,QAAQ,mBAAkB;AAC5C,OAAOC,UAAU,OAAM;AAEvB,SAASC,6BAA6B,QAAQ,sCAAqC;AACnF,SAASC,mBAAmB,QAAQ,gCAA+B;AAEnE,OAAO,MAAMC,wCAAwCF;IAInDG,YACmBC,UACAC,YACjBC,MAAkB,EACDC,iBACjB;QACA,KAAK,CAACH,UAAUE;wBALCF;0BACAC;gCAEAE;QAIjB,4EAA4E;QAC5E,mBAAmB;QACnB,IAAI,CAACC,UAAU,GAAG,IAAIC,OAAO,CAAC,MAAM,EAAEJ,WAAWK,IAAI,CAAC,KAAK,EAAE,CAAC;QAE9D,IAAI,CAACC,WAAW,GAAG,IAAIV,oBAAoBG,UAAUC;IACvD;IAEQO,KAAKC,QAAgB,EAAW;QACtC,sEAAsE;QACtE,IAAI,CAAC,IAAI,CAACL,UAAU,CAACI,IAAI,CAACC,WAAW,OAAO;QAE5C,sEAAsE;QACtE,yEAAyE;QACzE,6CAA6C;QAE7C,2DAA2D;QAC3D,IAAIA,SAASC,UAAU,CAACf,KAAKW,IAAI,CAAC,IAAI,CAACN,QAAQ,EAAE,WAAW,OAAO;QAEnE,KAAK,MAAMW,aAAa,IAAI,CAACV,UAAU,CAAE;YACvC,qEAAqE;YACrE,uBAAuB;YACvB,IAAIQ,aAAad,KAAKW,IAAI,CAAC,IAAI,CAACN,QAAQ,EAAE,CAAC,IAAI,EAAEW,UAAU,CAAC,GAAG;gBAC7D,OAAO;YACT;QACF;QAEA,OAAO;IACT;IAEA,MAAgBC,UACdC,KAA4B,EACkB;QAC9C,MAAMC,WAAwC,EAAE;QAChD,KAAK,MAAML,YAAYI,MAAO;YAC5B,4DAA4D;YAC5D,IAAI,CAAC,IAAI,CAACL,IAAI,CAACC,WAAW;YAE1B,MAAMM,WAAW,IAAI,CAACR,WAAW,CAACQ,QAAQ,CAACC,SAAS,CAACP;YACrD,MAAMQ,OAAO,IAAI,CAACV,WAAW,CAACU,IAAI,CAACD,SAAS,CAACP;YAC7C,MAAMS,aAAa,IAAI,CAACX,WAAW,CAACW,UAAU,CAACF,SAAS,CAACP;YAEzD,IAAI,IAAI,CAACN,gBAAgB,EAAE;gBACzBW,SAASK,IAAI,CACX,IAAI3B,2BAA2B;oBAC7B4B,MAAM1B,UAAU2B,SAAS;oBACzBN;oBACAE;oBACAC;oBACAT;oBACAa,MAAM,CAAC;gBACT;YAEJ,OAAO;gBACLR,SAASK,IAAI,CACX,IAAI1B,qBAAqB;oBACvB2B,MAAM1B,UAAU2B,SAAS;oBACzBN;oBACAE;oBACAC;oBACAT;gBACF;YAEJ;QACF;QAEA,OAAOK;IACT;AACF"}

View File

@@ -0,0 +1,65 @@
import { PagesRouteMatcher, PagesLocaleRouteMatcher } from "../../route-matchers/pages-route-matcher";
import { RouteKind } from "../../route-kind";
import path from "path";
import { FileCacheRouteMatcherProvider } from "./file-cache-route-matcher-provider";
import { DevPagesNormalizers } from "../../normalizers/built/pages";
export class DevPagesRouteMatcherProvider extends FileCacheRouteMatcherProvider {
constructor(pagesDir, extensions, reader, localeNormalizer){
super(pagesDir, reader);
this.pagesDir = pagesDir;
this.extensions = extensions;
this.localeNormalizer = localeNormalizer;
// Match any route file that ends with `/${filename}.${extension}` under the
// pages directory.
this.expression = new RegExp(`\\.(?:${extensions.join("|")})$`);
this.normalizers = new DevPagesNormalizers(pagesDir, extensions);
}
test(filename) {
// If the file does not end in the correct extension it's not a match.
if (!this.expression.test(filename)) return false;
// Pages routes must exist in the pages directory without the `/api/`
// prefix. The pathnames being tested here though are the full filenames,
// so we need to include the pages directory.
// TODO: could path separator normalization be needed here?
if (filename.startsWith(path.join(this.pagesDir, "/api/"))) return false;
for (const extension of this.extensions){
// We can also match if we have `pages/api.${extension}`, so check to
// see if it's a match.
if (filename === path.join(this.pagesDir, `api.${extension}`)) {
return false;
}
}
return true;
}
async transform(files) {
const matchers = [];
for (const filename of files){
// If the file isn't a match for this matcher, then skip it.
if (!this.test(filename)) continue;
const pathname = this.normalizers.pathname.normalize(filename);
const page = this.normalizers.page.normalize(filename);
const bundlePath = this.normalizers.bundlePath.normalize(filename);
if (this.localeNormalizer) {
matchers.push(new PagesLocaleRouteMatcher({
kind: RouteKind.PAGES,
pathname,
page,
bundlePath,
filename,
i18n: {}
}));
} else {
matchers.push(new PagesRouteMatcher({
kind: RouteKind.PAGES,
pathname,
page,
bundlePath,
filename
}));
}
}
return matchers;
}
}
//# sourceMappingURL=dev-pages-route-matcher-provider.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/server/future/route-matcher-providers/dev/dev-pages-route-matcher-provider.ts"],"names":["PagesRouteMatcher","PagesLocaleRouteMatcher","RouteKind","path","FileCacheRouteMatcherProvider","DevPagesNormalizers","DevPagesRouteMatcherProvider","constructor","pagesDir","extensions","reader","localeNormalizer","expression","RegExp","join","normalizers","test","filename","startsWith","extension","transform","files","matchers","pathname","normalize","page","bundlePath","push","kind","PAGES","i18n"],"mappings":"AACA,SACEA,iBAAiB,EACjBC,uBAAuB,QAClB,2CAA0C;AACjD,SAASC,SAAS,QAAQ,mBAAkB;AAC5C,OAAOC,UAAU,OAAM;AAEvB,SAASC,6BAA6B,QAAQ,sCAAqC;AACnF,SAASC,mBAAmB,QAAQ,gCAA+B;AAEnE,OAAO,MAAMC,qCAAqCF;IAIhDG,YACmBC,UACAC,YACjBC,MAAkB,EACDC,iBACjB;QACA,KAAK,CAACH,UAAUE;wBALCF;0BACAC;gCAEAE;QAIjB,4EAA4E;QAC5E,mBAAmB;QACnB,IAAI,CAACC,UAAU,GAAG,IAAIC,OAAO,CAAC,MAAM,EAAEJ,WAAWK,IAAI,CAAC,KAAK,EAAE,CAAC;QAE9D,IAAI,CAACC,WAAW,GAAG,IAAIV,oBAAoBG,UAAUC;IACvD;IAEQO,KAAKC,QAAgB,EAAW;QACtC,sEAAsE;QACtE,IAAI,CAAC,IAAI,CAACL,UAAU,CAACI,IAAI,CAACC,WAAW,OAAO;QAE5C,qEAAqE;QACrE,yEAAyE;QACzE,6CAA6C;QAE7C,2DAA2D;QAC3D,IAAIA,SAASC,UAAU,CAACf,KAAKW,IAAI,CAAC,IAAI,CAACN,QAAQ,EAAE,WAAW,OAAO;QAEnE,KAAK,MAAMW,aAAa,IAAI,CAACV,UAAU,CAAE;YACvC,qEAAqE;YACrE,uBAAuB;YACvB,IAAIQ,aAAad,KAAKW,IAAI,CAAC,IAAI,CAACN,QAAQ,EAAE,CAAC,IAAI,EAAEW,UAAU,CAAC,GAAG;gBAC7D,OAAO;YACT;QACF;QAEA,OAAO;IACT;IAEA,MAAgBC,UACdC,KAA4B,EACe;QAC3C,MAAMC,WAAqC,EAAE;QAC7C,KAAK,MAAML,YAAYI,MAAO;YAC5B,4DAA4D;YAC5D,IAAI,CAAC,IAAI,CAACL,IAAI,CAACC,WAAW;YAE1B,MAAMM,WAAW,IAAI,CAACR,WAAW,CAACQ,QAAQ,CAACC,SAAS,CAACP;YACrD,MAAMQ,OAAO,IAAI,CAACV,WAAW,CAACU,IAAI,CAACD,SAAS,CAACP;YAC7C,MAAMS,aAAa,IAAI,CAACX,WAAW,CAACW,UAAU,CAACF,SAAS,CAACP;YAEzD,IAAI,IAAI,CAACN,gBAAgB,EAAE;gBACzBW,SAASK,IAAI,CACX,IAAI1B,wBAAwB;oBAC1B2B,MAAM1B,UAAU2B,KAAK;oBACrBN;oBACAE;oBACAC;oBACAT;oBACAa,MAAM,CAAC;gBACT;YAEJ,OAAO;gBACLR,SAASK,IAAI,CACX,IAAI3B,kBAAkB;oBACpB4B,MAAM1B,UAAU2B,KAAK;oBACrBN;oBACAE;oBACAC;oBACAT;gBACF;YAEJ;QACF;QAEA,OAAOK;IACT;AACF"}

View File

@@ -0,0 +1,20 @@
import { CachedRouteMatcherProvider } from "../helpers/cached-route-matcher-provider";
/**
* This will memoize the matchers when the file contents are the same.
*/ export class FileCacheRouteMatcherProvider extends CachedRouteMatcherProvider {
constructor(dir, reader){
super({
load: async ()=>reader.read(dir),
compare: (left, right)=>{
if (left.length !== right.length) return false;
// Assuming the file traversal order is deterministic...
for(let i = 0; i < left.length; i++){
if (left[i] !== right[i]) return false;
}
return true;
}
});
}
}
//# sourceMappingURL=file-cache-route-matcher-provider.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/server/future/route-matcher-providers/dev/file-cache-route-matcher-provider.ts"],"names":["CachedRouteMatcherProvider","FileCacheRouteMatcherProvider","constructor","dir","reader","load","read","compare","left","right","length","i"],"mappings":"AACA,SAASA,0BAA0B,QAAQ,2CAA0C;AAGrF;;CAEC,GACD,OAAO,MAAeC,sCAEZD;IACRE,YAAYC,GAAW,EAAEC,MAAkB,CAAE;QAC3C,KAAK,CAAC;YACJC,MAAM,UAAYD,OAAOE,IAAI,CAACH;YAC9BI,SAAS,CAACC,MAAMC;gBACd,IAAID,KAAKE,MAAM,KAAKD,MAAMC,MAAM,EAAE,OAAO;gBAEzC,wDAAwD;gBACxD,IAAK,IAAIC,IAAI,GAAGA,IAAIH,KAAKE,MAAM,EAAEC,IAAK;oBACpC,IAAIH,IAAI,CAACG,EAAE,KAAKF,KAAK,CAACE,EAAE,EAAE,OAAO;gBACnC;gBAEA,OAAO;YACT;QACF;IACF;AACF"}

View File

@@ -0,0 +1,99 @@
/**
* CachedFileReader will deduplicate requests made to the same folder structure
* to scan for files.
*/ export class BatchedFileReader {
constructor(reader){
this.reader = reader;
}
schedule(callback) {
if (!this.schedulePromise) {
this.schedulePromise = Promise.resolve();
}
this.schedulePromise.then(()=>{
process.nextTick(callback);
});
}
getOrCreateBatch() {
// If there is an existing batch and it's not completed, then reuse it.
if (this.batch && !this.batch.completed) {
return this.batch;
}
const batch = {
completed: false,
directories: [],
callbacks: []
};
this.batch = batch;
this.schedule(async ()=>{
batch.completed = true;
if (batch.directories.length === 0) return;
// Collect all the results for each of the directories. If any error
// occurs, send the results back to the loaders.
let values;
try {
values = await this.load(batch.directories);
} catch (err) {
// Reject all the callbacks.
for (const { reject } of batch.callbacks){
reject(err);
}
return;
}
// Loop over all the callbacks and send them their results.
for(let i = 0; i < batch.callbacks.length; i++){
const value = values[i];
if (value instanceof Error) {
batch.callbacks[i].reject(value);
} else {
batch.callbacks[i].resolve(value);
}
}
});
return batch;
}
async load(directories) {
// Make a unique array of directories. This is what lets us de-duplicate
// loads for the same directory.
const unique = [
...new Set(directories)
];
const results = await Promise.all(unique.map(async (directory)=>{
let files;
let error;
try {
files = await this.reader.read(directory);
} catch (err) {
if (err instanceof Error) error = err;
}
return {
directory,
files,
error
};
}));
return directories.map((directory)=>{
const found = results.find((result)=>result.directory === directory);
if (!found) return [];
if (found.files) return found.files;
if (found.error) return found.error;
return [];
});
}
async read(dir) {
// Get or create a new file reading batch.
const batch = this.getOrCreateBatch();
// Push this directory into the batch to resolve.
batch.directories.push(dir);
// Push the promise handles into the batch (under the same index) so it can
// be resolved later when it's scheduled.
const promise = new Promise((resolve, reject)=>{
batch.callbacks.push({
resolve,
reject
});
});
return promise;
}
}
//# sourceMappingURL=batched-file-reader.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/server/future/route-matcher-providers/dev/helpers/file-reader/batched-file-reader.ts"],"names":["BatchedFileReader","constructor","reader","schedule","callback","schedulePromise","Promise","resolve","then","process","nextTick","getOrCreateBatch","batch","completed","directories","callbacks","length","values","load","err","reject","i","value","Error","unique","Set","results","all","map","directory","files","error","read","found","find","result","dir","push","promise"],"mappings":"AAWA;;;CAGC,GACD,OAAO,MAAMA;IAGXC,YAA6BC,OAAoB;sBAApBA;IAAqB;IAK1CC,SAASC,QAAkB,EAAE;QACnC,IAAI,CAAC,IAAI,CAACC,eAAe,EAAE;YACzB,IAAI,CAACA,eAAe,GAAGC,QAAQC,OAAO;QACxC;QACA,IAAI,CAACF,eAAe,CAACG,IAAI,CAAC;YACxBC,QAAQC,QAAQ,CAACN;QACnB;IACF;IAEQO,mBAAoC;QAC1C,uEAAuE;QACvE,IAAI,IAAI,CAACC,KAAK,IAAI,CAAC,IAAI,CAACA,KAAK,CAACC,SAAS,EAAE;YACvC,OAAO,IAAI,CAACD,KAAK;QACnB;QAEA,MAAMA,QAAyB;YAC7BC,WAAW;YACXC,aAAa,EAAE;YACfC,WAAW,EAAE;QACf;QAEA,IAAI,CAACH,KAAK,GAAGA;QAEb,IAAI,CAACT,QAAQ,CAAC;YACZS,MAAMC,SAAS,GAAG;YAClB,IAAID,MAAME,WAAW,CAACE,MAAM,KAAK,GAAG;YAEpC,oEAAoE;YACpE,gDAAgD;YAChD,IAAIC;YACJ,IAAI;gBACFA,SAAS,MAAM,IAAI,CAACC,IAAI,CAACN,MAAME,WAAW;YAC5C,EAAE,OAAOK,KAAK;gBACZ,4BAA4B;gBAC5B,KAAK,MAAM,EAAEC,MAAM,EAAE,IAAIR,MAAMG,SAAS,CAAE;oBACxCK,OAAOD;gBACT;gBACA;YACF;YAEA,2DAA2D;YAC3D,IAAK,IAAIE,IAAI,GAAGA,IAAIT,MAAMG,SAAS,CAACC,MAAM,EAAEK,IAAK;gBAC/C,MAAMC,QAAQL,MAAM,CAACI,EAAE;gBACvB,IAAIC,iBAAiBC,OAAO;oBAC1BX,MAAMG,SAAS,CAACM,EAAE,CAACD,MAAM,CAACE;gBAC5B,OAAO;oBACLV,MAAMG,SAAS,CAACM,EAAE,CAACd,OAAO,CAACe;gBAC7B;YACF;QACF;QAEA,OAAOV;IACT;IAEA,MAAcM,KACZJ,WAAkC,EACqB;QACvD,wEAAwE;QACxE,gCAAgC;QAChC,MAAMU,SAAS;eAAI,IAAIC,IAAIX;SAAa;QAExC,MAAMY,UAAU,MAAMpB,QAAQqB,GAAG,CAC/BH,OAAOI,GAAG,CAAC,OAAOC;YAChB,IAAIC;YACJ,IAAIC;YACJ,IAAI;gBACFD,QAAQ,MAAM,IAAI,CAAC5B,MAAM,CAAC8B,IAAI,CAACH;YACjC,EAAE,OAAOV,KAAK;gBACZ,IAAIA,eAAeI,OAAOQ,QAAQZ;YACpC;YAEA,OAAO;gBAAEU;gBAAWC;gBAAOC;YAAM;QACnC;QAGF,OAAOjB,YAAYc,GAAG,CAAC,CAACC;YACtB,MAAMI,QAAQP,QAAQQ,IAAI,CAAC,CAACC,SAAWA,OAAON,SAAS,KAAKA;YAC5D,IAAI,CAACI,OAAO,OAAO,EAAE;YAErB,IAAIA,MAAMH,KAAK,EAAE,OAAOG,MAAMH,KAAK;YACnC,IAAIG,MAAMF,KAAK,EAAE,OAAOE,MAAMF,KAAK;YAEnC,OAAO,EAAE;QACX;IACF;IAEA,MAAaC,KAAKI,GAAW,EAAkC;QAC7D,0CAA0C;QAC1C,MAAMxB,QAAQ,IAAI,CAACD,gBAAgB;QAEnC,iDAAiD;QACjDC,MAAME,WAAW,CAACuB,IAAI,CAACD;QAEvB,2EAA2E;QAC3E,yCAAyC;QACzC,MAAME,UAAU,IAAIhC,QAA+B,CAACC,SAASa;YAC3DR,MAAMG,SAAS,CAACsB,IAAI,CAAC;gBAAE9B;gBAASa;YAAO;QACzC;QAEA,OAAOkB;IACT;AACF"}

View File

@@ -0,0 +1,36 @@
import { recursiveReadDir } from "../../../../../../lib/recursive-readdir";
/**
* Reads all the files in the directory and its subdirectories following any
* symbolic links.
*/ export class DefaultFileReader {
/**
* Creates a new file reader.
*
* @param pathnameFilter filter to ignore files with absolute pathnames, false to ignore
* @param ignoreFilter filter to ignore files and directories with absolute pathnames, false to ignore
* @param ignorePartFilter filter to ignore files and directories with the pathname part, false to ignore
*/ constructor(options){
this.options = options;
}
/**
* Reads all the files in the directory and its subdirectories following any
* symbolic links.
*
* @param dir the directory to read
* @returns a promise that resolves to the list of files
*/ async read(dir) {
return recursiveReadDir(dir, {
pathnameFilter: this.options.pathnameFilter,
ignoreFilter: this.options.ignoreFilter,
ignorePartFilter: this.options.ignorePartFilter,
// We don't need to sort the results because we're not depending on the
// order of the results.
sortPathnames: false,
// We want absolute pathnames because we're going to be comparing them
// with other absolute pathnames.
relativePathnames: false
});
}
}
//# sourceMappingURL=default-file-reader.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/server/future/route-matcher-providers/dev/helpers/file-reader/default-file-reader.ts"],"names":["recursiveReadDir","DefaultFileReader","constructor","options","read","dir","pathnameFilter","ignoreFilter","ignorePartFilter","sortPathnames","relativePathnames"],"mappings":"AAEA,SAEEA,gBAAgB,QACX,0CAAyC;AAOhD;;;CAGC,GACD,OAAO,MAAMC;IAOX;;;;;;GAMC,GACDC,YAAYC,OAA2C,CAAE;QACvD,IAAI,CAACA,OAAO,GAAGA;IACjB;IAEA;;;;;;GAMC,GACD,MAAaC,KAAKC,GAAW,EAAkC;QAC7D,OAAOL,iBAAiBK,KAAK;YAC3BC,gBAAgB,IAAI,CAACH,OAAO,CAACG,cAAc;YAC3CC,cAAc,IAAI,CAACJ,OAAO,CAACI,YAAY;YACvCC,kBAAkB,IAAI,CAACL,OAAO,CAACK,gBAAgB;YAE/C,uEAAuE;YACvE,wBAAwB;YACxBC,eAAe;YAEf,sEAAsE;YACtE,iCAAiC;YACjCC,mBAAmB;QACrB;IACF;AACF"}

View File

@@ -0,0 +1,3 @@
export { };
//# sourceMappingURL=file-reader.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../../src/server/future/route-matcher-providers/dev/helpers/file-reader/file-reader.ts"],"names":[],"mappings":"AAAA,WAOC"}

View File

@@ -0,0 +1,22 @@
/**
* This will memoize the matchers if the loaded data is comparable.
*/ export class CachedRouteMatcherProvider {
constructor(loader){
this.loader = loader;
this.cached = [];
}
async matchers() {
const data = await this.loader.load();
if (!data) return [];
// Return the cached matchers if the data has not changed.
if (this.data && this.loader.compare(this.data, data)) return this.cached;
this.data = data;
// Transform the manifest into matchers.
const matchers = await this.transform(data);
// Cache the matchers.
this.cached = matchers;
return matchers;
}
}
//# sourceMappingURL=cached-route-matcher-provider.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/server/future/route-matcher-providers/helpers/cached-route-matcher-provider.ts"],"names":["CachedRouteMatcherProvider","constructor","loader","cached","matchers","data","load","compare","transform"],"mappings":"AAQA;;CAEC,GACD,OAAO,MAAeA;IAQpBC,YAA6BC,OAA6B;sBAA7BA;aAFrBC,SAA2B,EAAE;IAEsB;IAI3D,MAAaC,WAAkC;QAC7C,MAAMC,OAAO,MAAM,IAAI,CAACH,MAAM,CAACI,IAAI;QACnC,IAAI,CAACD,MAAM,OAAO,EAAE;QAEpB,0DAA0D;QAC1D,IAAI,IAAI,CAACA,IAAI,IAAI,IAAI,CAACH,MAAM,CAACK,OAAO,CAAC,IAAI,CAACF,IAAI,EAAEA,OAAO,OAAO,IAAI,CAACF,MAAM;QACzE,IAAI,CAACE,IAAI,GAAGA;QAEZ,wCAAwC;QACxC,MAAMD,WAAW,MAAM,IAAI,CAACI,SAAS,CAACH;QAEtC,sBAAsB;QACtB,IAAI,CAACF,MAAM,GAAGC;QAEd,OAAOA;IACT;AACF"}

View File

@@ -0,0 +1,3 @@
export { };
//# sourceMappingURL=manifest-loader.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../src/server/future/route-matcher-providers/helpers/manifest-loaders/manifest-loader.ts"],"names":[],"mappings":"AAAA,WAIC"}

View File

@@ -0,0 +1,19 @@
import { SERVER_DIRECTORY } from "../../../../../shared/lib/constants";
import path from "../../../../../shared/lib/isomorphic/path";
export class NodeManifestLoader {
constructor(distDir){
this.distDir = distDir;
}
static require(id) {
try {
return require(id);
} catch {
return null;
}
}
load(name) {
return NodeManifestLoader.require(path.join(this.distDir, SERVER_DIRECTORY, name));
}
}
//# sourceMappingURL=node-manifest-loader.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../src/server/future/route-matcher-providers/helpers/manifest-loaders/node-manifest-loader.ts"],"names":["SERVER_DIRECTORY","path","NodeManifestLoader","constructor","distDir","require","id","load","name","join"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,sCAAqC;AACtE,OAAOC,UAAU,4CAA2C;AAG5D,OAAO,MAAMC;IACXC,YAA6BC,QAAiB;uBAAjBA;IAAkB;IAE/C,OAAOC,QAAQC,EAAU,EAAE;QACzB,IAAI;YACF,OAAOD,QAAQC;QACjB,EAAE,OAAM;YACN,OAAO;QACT;IACF;IAEOC,KAAKC,IAAY,EAAmB;QACzC,OAAON,mBAAmBG,OAAO,CAC/BJ,KAAKQ,IAAI,CAAC,IAAI,CAACL,OAAO,EAAEJ,kBAAkBQ;IAE9C;AACF"}

View File

@@ -0,0 +1,10 @@
export class ServerManifestLoader {
constructor(getter){
this.getter = getter;
}
load(name) {
return this.getter(name);
}
}
//# sourceMappingURL=server-manifest-loader.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../src/server/future/route-matcher-providers/helpers/manifest-loaders/server-manifest-loader.ts"],"names":["ServerManifestLoader","constructor","getter","load","name"],"mappings":"AAEA,OAAO,MAAMA;IACXC,YAA6BC,OAA2C;sBAA3CA;IAA4C;IAElEC,KAAKC,IAAY,EAAmB;QACzC,OAAO,IAAI,CAACF,MAAM,CAACE;IACrB;AACF"}

View File

@@ -0,0 +1,11 @@
import { CachedRouteMatcherProvider } from "./helpers/cached-route-matcher-provider";
export class ManifestRouteMatcherProvider extends CachedRouteMatcherProvider {
constructor(manifestName, manifestLoader){
super({
load: async ()=>manifestLoader.load(manifestName),
compare: (left, right)=>left === right
});
}
}
//# sourceMappingURL=manifest-route-matcher-provider.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/future/route-matcher-providers/manifest-route-matcher-provider.ts"],"names":["CachedRouteMatcherProvider","ManifestRouteMatcherProvider","constructor","manifestName","manifestLoader","load","compare","left","right"],"mappings":"AAKA,SAASA,0BAA0B,QAAQ,0CAAyC;AAEpF,OAAO,MAAeC,qCAEZD;IACRE,YAAYC,YAAoB,EAAEC,cAA8B,CAAE;QAChE,KAAK,CAAC;YACJC,MAAM,UAAYD,eAAeC,IAAI,CAACF;YACtCG,SAAS,CAACC,MAAMC,QAAUD,SAASC;QACrC;IACF;AACF"}

View File

@@ -0,0 +1,46 @@
import { isAPIRoute } from "../../../lib/is-api-route";
import { PAGES_MANIFEST } from "../../../shared/lib/constants";
import { RouteKind } from "../route-kind";
import { PagesAPILocaleRouteMatcher, PagesAPIRouteMatcher } from "../route-matchers/pages-api-route-matcher";
import { ManifestRouteMatcherProvider } from "./manifest-route-matcher-provider";
import { PagesNormalizers } from "../normalizers/built/pages";
export class PagesAPIRouteMatcherProvider extends ManifestRouteMatcherProvider {
constructor(distDir, manifestLoader, i18nProvider){
super(PAGES_MANIFEST, manifestLoader);
this.i18nProvider = i18nProvider;
this.normalizers = new PagesNormalizers(distDir);
}
async transform(manifest) {
// This matcher is only for Pages API routes.
const pathnames = Object.keys(manifest).filter((pathname)=>isAPIRoute(pathname));
const matchers = [];
for (const page of pathnames){
if (this.i18nProvider) {
// Match the locale on the page name, or default to the default locale.
const { detectedLocale, pathname } = this.i18nProvider.analyze(page);
matchers.push(new PagesAPILocaleRouteMatcher({
kind: RouteKind.PAGES_API,
pathname,
page,
bundlePath: this.normalizers.bundlePath.normalize(page),
filename: this.normalizers.filename.normalize(manifest[page]),
i18n: {
locale: detectedLocale
}
}));
} else {
matchers.push(new PagesAPIRouteMatcher({
kind: RouteKind.PAGES_API,
// In `pages/`, the page is the same as the pathname.
pathname: page,
page,
bundlePath: this.normalizers.bundlePath.normalize(page),
filename: this.normalizers.filename.normalize(manifest[page])
}));
}
}
return matchers;
}
}
//# sourceMappingURL=pages-api-route-matcher-provider.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/future/route-matcher-providers/pages-api-route-matcher-provider.ts"],"names":["isAPIRoute","PAGES_MANIFEST","RouteKind","PagesAPILocaleRouteMatcher","PagesAPIRouteMatcher","ManifestRouteMatcherProvider","PagesNormalizers","PagesAPIRouteMatcherProvider","constructor","distDir","manifestLoader","i18nProvider","normalizers","transform","manifest","pathnames","Object","keys","filter","pathname","matchers","page","detectedLocale","analyze","push","kind","PAGES_API","bundlePath","normalize","filename","i18n","locale"],"mappings":"AAAA,SAASA,UAAU,QAAQ,4BAA2B;AACtD,SAASC,cAAc,QAAQ,gCAA+B;AAC9D,SAASC,SAAS,QAAQ,gBAAe;AACzC,SACEC,0BAA0B,EAC1BC,oBAAoB,QACf,4CAA2C;AAKlD,SAASC,4BAA4B,QAAQ,oCAAmC;AAEhF,SAASC,gBAAgB,QAAQ,6BAA4B;AAE7D,OAAO,MAAMC,qCAAqCF;IAGhDG,YACEC,OAAe,EACfC,cAA8B,EACbC,aACjB;QACA,KAAK,CAACV,gBAAgBS;4BAFLC;QAIjB,IAAI,CAACC,WAAW,GAAG,IAAIN,iBAAiBG;IAC1C;IAEA,MAAgBI,UACdC,QAAkB,EAC4B;QAC9C,6CAA6C;QAC7C,MAAMC,YAAYC,OAAOC,IAAI,CAACH,UAAUI,MAAM,CAAC,CAACC,WAC9CnB,WAAWmB;QAGb,MAAMC,WAAwC,EAAE;QAEhD,KAAK,MAAMC,QAAQN,UAAW;YAC5B,IAAI,IAAI,CAACJ,YAAY,EAAE;gBACrB,uEAAuE;gBACvE,MAAM,EAAEW,cAAc,EAAEH,QAAQ,EAAE,GAAG,IAAI,CAACR,YAAY,CAACY,OAAO,CAACF;gBAE/DD,SAASI,IAAI,CACX,IAAIrB,2BAA2B;oBAC7BsB,MAAMvB,UAAUwB,SAAS;oBACzBP;oBACAE;oBACAM,YAAY,IAAI,CAACf,WAAW,CAACe,UAAU,CAACC,SAAS,CAACP;oBAClDQ,UAAU,IAAI,CAACjB,WAAW,CAACiB,QAAQ,CAACD,SAAS,CAACd,QAAQ,CAACO,KAAK;oBAC5DS,MAAM;wBACJC,QAAQT;oBACV;gBACF;YAEJ,OAAO;gBACLF,SAASI,IAAI,CACX,IAAIpB,qBAAqB;oBACvBqB,MAAMvB,UAAUwB,SAAS;oBACzB,qDAAqD;oBACrDP,UAAUE;oBACVA;oBACAM,YAAY,IAAI,CAACf,WAAW,CAACe,UAAU,CAACC,SAAS,CAACP;oBAClDQ,UAAU,IAAI,CAACjB,WAAW,CAACiB,QAAQ,CAACD,SAAS,CAACd,QAAQ,CAACO,KAAK;gBAC9D;YAEJ;QACF;QAEA,OAAOD;IACT;AACF"}

View File

@@ -0,0 +1,55 @@
import { isAPIRoute } from "../../../lib/is-api-route";
import { BLOCKED_PAGES, PAGES_MANIFEST } from "../../../shared/lib/constants";
import { RouteKind } from "../route-kind";
import { PagesLocaleRouteMatcher, PagesRouteMatcher } from "../route-matchers/pages-route-matcher";
import { ManifestRouteMatcherProvider } from "./manifest-route-matcher-provider";
import { PagesNormalizers } from "../normalizers/built/pages";
export class PagesRouteMatcherProvider extends ManifestRouteMatcherProvider {
constructor(distDir, manifestLoader, i18nProvider){
super(PAGES_MANIFEST, manifestLoader);
this.i18nProvider = i18nProvider;
this.normalizers = new PagesNormalizers(distDir);
}
async transform(manifest) {
// This matcher is only for Pages routes, not Pages API routes which are
// included in this manifest.
const pathnames = Object.keys(manifest).filter((pathname)=>!isAPIRoute(pathname))// Remove any blocked pages (page that can't be routed to, like error or
// internal pages).
.filter((pathname)=>{
var _this_i18nProvider;
const normalized = ((_this_i18nProvider = this.i18nProvider) == null ? void 0 : _this_i18nProvider.analyze(pathname).pathname) ?? pathname;
// Skip any blocked pages.
if (BLOCKED_PAGES.includes(normalized)) return false;
return true;
});
const matchers = [];
for (const page of pathnames){
if (this.i18nProvider) {
// Match the locale on the page name, or default to the default locale.
const { detectedLocale, pathname } = this.i18nProvider.analyze(page);
matchers.push(new PagesLocaleRouteMatcher({
kind: RouteKind.PAGES,
pathname,
page,
bundlePath: this.normalizers.bundlePath.normalize(page),
filename: this.normalizers.filename.normalize(manifest[page]),
i18n: {
locale: detectedLocale
}
}));
} else {
matchers.push(new PagesRouteMatcher({
kind: RouteKind.PAGES,
// In `pages/`, the page is the same as the pathname.
pathname: page,
page,
bundlePath: this.normalizers.bundlePath.normalize(page),
filename: this.normalizers.filename.normalize(manifest[page])
}));
}
}
return matchers;
}
}
//# sourceMappingURL=pages-route-matcher-provider.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/future/route-matcher-providers/pages-route-matcher-provider.ts"],"names":["isAPIRoute","BLOCKED_PAGES","PAGES_MANIFEST","RouteKind","PagesLocaleRouteMatcher","PagesRouteMatcher","ManifestRouteMatcherProvider","PagesNormalizers","PagesRouteMatcherProvider","constructor","distDir","manifestLoader","i18nProvider","normalizers","transform","manifest","pathnames","Object","keys","filter","pathname","normalized","analyze","includes","matchers","page","detectedLocale","push","kind","PAGES","bundlePath","normalize","filename","i18n","locale"],"mappings":"AAAA,SAASA,UAAU,QAAQ,4BAA2B;AACtD,SAASC,aAAa,EAAEC,cAAc,QAAQ,gCAA+B;AAC7E,SAASC,SAAS,QAAQ,gBAAe;AACzC,SACEC,uBAAuB,EACvBC,iBAAiB,QACZ,wCAAuC;AAK9C,SAASC,4BAA4B,QAAQ,oCAAmC;AAEhF,SAASC,gBAAgB,QAAQ,6BAA4B;AAE7D,OAAO,MAAMC,kCAAkCF;IAG7CG,YACEC,OAAe,EACfC,cAA8B,EACbC,aACjB;QACA,KAAK,CAACV,gBAAgBS;4BAFLC;QAIjB,IAAI,CAACC,WAAW,GAAG,IAAIN,iBAAiBG;IAC1C;IAEA,MAAgBI,UACdC,QAAkB,EACyB;QAC3C,wEAAwE;QACxE,6BAA6B;QAC7B,MAAMC,YAAYC,OAAOC,IAAI,CAACH,UAC3BI,MAAM,CAAC,CAACC,WAAa,CAACpB,WAAWoB,UAClC,wEAAwE;QACxE,mBAAmB;SAClBD,MAAM,CAAC,CAACC;gBAEL;YADF,MAAMC,aACJ,EAAA,qBAAA,IAAI,CAACT,YAAY,qBAAjB,mBAAmBU,OAAO,CAACF,UAAUA,QAAQ,KAAIA;YAEnD,0BAA0B;YAC1B,IAAInB,cAAcsB,QAAQ,CAACF,aAAa,OAAO;YAE/C,OAAO;QACT;QAEF,MAAMG,WAAqC,EAAE;QAC7C,KAAK,MAAMC,QAAQT,UAAW;YAC5B,IAAI,IAAI,CAACJ,YAAY,EAAE;gBACrB,uEAAuE;gBACvE,MAAM,EAAEc,cAAc,EAAEN,QAAQ,EAAE,GAAG,IAAI,CAACR,YAAY,CAACU,OAAO,CAACG;gBAE/DD,SAASG,IAAI,CACX,IAAIvB,wBAAwB;oBAC1BwB,MAAMzB,UAAU0B,KAAK;oBACrBT;oBACAK;oBACAK,YAAY,IAAI,CAACjB,WAAW,CAACiB,UAAU,CAACC,SAAS,CAACN;oBAClDO,UAAU,IAAI,CAACnB,WAAW,CAACmB,QAAQ,CAACD,SAAS,CAAChB,QAAQ,CAACU,KAAK;oBAC5DQ,MAAM;wBACJC,QAAQR;oBACV;gBACF;YAEJ,OAAO;gBACLF,SAASG,IAAI,CACX,IAAItB,kBAAkB;oBACpBuB,MAAMzB,UAAU0B,KAAK;oBACrB,qDAAqD;oBACrDT,UAAUK;oBACVA;oBACAK,YAAY,IAAI,CAACjB,WAAW,CAACiB,UAAU,CAACC,SAAS,CAACN;oBAClDO,UAAU,IAAI,CAACnB,WAAW,CAACmB,QAAQ,CAACD,SAAS,CAAChB,QAAQ,CAACU,KAAK;gBAC9D;YAEJ;QACF;QAEA,OAAOD;IACT;AACF"}

View File

@@ -0,0 +1,3 @@
export { };
//# sourceMappingURL=route-matcher-provider.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/server/future/route-matcher-providers/route-matcher-provider.ts"],"names":[],"mappings":"AAAA,WAIC"}

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