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,18 @@
import { Normalizer } from './normalizer';
/**
* 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 declare class AbsoluteFilenameNormalizer implements Normalizer {
private readonly dir;
private readonly extensions;
private readonly pagesType;
/**
*
* @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: string, extensions: ReadonlyArray<string>, pagesType: 'pages' | 'app' | 'root');
normalize(filename: string): string;
}

View File

@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "AbsoluteFilenameNormalizer", {
enumerable: true,
get: function() {
return AbsoluteFilenameNormalizer;
}
});
const _absolutepathtopage = require("../../../shared/lib/page-path/absolute-path-to-page");
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 (0, _absolutepathtopage.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":["AbsoluteFilenameNormalizer","constructor","dir","extensions","pagesType","normalize","filename","absolutePathToPage","keepIndex"],"mappings":";;;;+BAOaA;;;eAAAA;;;oCAPsB;AAO5B,MAAMA;IACX;;;;;GAKC,GACDC,YACmBC,KACAC,YACAC,UACjB;mBAHiBF;0BACAC;yBACAC;IAChB;IAEIC,UAAUC,QAAgB,EAAU;QACzC,OAAOC,IAAAA,sCAAkB,EAACD,UAAU;YAClCH,YAAY,IAAI,CAACA,UAAU;YAC3BK,WAAW;YACXN,KAAK,IAAI,CAACA,GAAG;YACbE,WAAW,IAAI,CAACA,SAAS;QAC3B;IACF;AACF"}

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1,11 @@
import { Normalizers } from '../../normalizers';
import { Normalizer } from '../../normalizer';
import { PrefixingNormalizer } from '../../prefixing-normalizer';
export declare class AppBundlePathNormalizer extends PrefixingNormalizer {
constructor();
normalize(page: string): string;
}
export declare class DevAppBundlePathNormalizer extends Normalizers {
constructor(pageNormalizer: Normalizer);
normalize(filename: string): string;
}

View File

@@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
AppBundlePathNormalizer: null,
DevAppBundlePathNormalizer: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
AppBundlePathNormalizer: function() {
return AppBundlePathNormalizer;
},
DevAppBundlePathNormalizer: function() {
return DevAppBundlePathNormalizer;
}
});
const _normalizers = require("../../normalizers");
const _prefixingnormalizer = require("../../prefixing-normalizer");
const _normalizepagepath = require("../../../../../shared/lib/page-path/normalize-page-path");
class AppBundlePathNormalizer extends _prefixingnormalizer.PrefixingNormalizer {
constructor(){
super("app");
}
normalize(page) {
return super.normalize((0, _normalizepagepath.normalizePagePath)(page));
}
}
class DevAppBundlePathNormalizer extends _normalizers.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":["AppBundlePathNormalizer","DevAppBundlePathNormalizer","PrefixingNormalizer","constructor","normalize","page","normalizePagePath","Normalizers","pageNormalizer","filename"],"mappings":";;;;;;;;;;;;;;;IAKaA,uBAAuB;eAAvBA;;IAUAC,0BAA0B;eAA1BA;;;6BAfe;qCAEQ;mCACF;AAE3B,MAAMD,gCAAgCE,wCAAmB;IAC9DC,aAAc;QACZ,KAAK,CAAC;IACR;IAEOC,UAAUC,IAAY,EAAU;QACrC,OAAO,KAAK,CAACD,UAAUE,IAAAA,oCAAiB,EAACD;IAC3C;AACF;AAEO,MAAMJ,mCAAmCM,wBAAW;IACzDJ,YAAYK,cAA0B,CAAE;QACtC,KAAK,CAAC;YACJ,gDAAgD;YAChDA;YACA,wCAAwC;YACxC,IAAIR;SACL;IACH;IAEOI,UAAUK,QAAgB,EAAU;QACzC,OAAO,KAAK,CAACL,UAAUK;IACzB;AACF"}

View File

@@ -0,0 +1,5 @@
import { PrefixingNormalizer } from '../../prefixing-normalizer';
export declare class AppFilenameNormalizer extends PrefixingNormalizer {
constructor(distDir: string);
normalize(manifestFilename: string): string;
}

View File

@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "AppFilenameNormalizer", {
enumerable: true,
get: function() {
return AppFilenameNormalizer;
}
});
const _constants = require("../../../../../shared/lib/constants");
const _prefixingnormalizer = require("../../prefixing-normalizer");
class AppFilenameNormalizer extends _prefixingnormalizer.PrefixingNormalizer {
constructor(distDir){
super(distDir, _constants.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":["AppFilenameNormalizer","PrefixingNormalizer","constructor","distDir","SERVER_DIRECTORY","normalize","manifestFilename"],"mappings":";;;;+BAGaA;;;eAAAA;;;2BAHoB;qCACG;AAE7B,MAAMA,8BAA8BC,wCAAmB;IAC5DC,YAAYC,OAAe,CAAE;QAC3B,KAAK,CAACA,SAASC,2BAAgB;IACjC;IAEOC,UAAUC,gBAAwB,EAAU;QACjD,OAAO,KAAK,CAACD,UAAUC;IACzB;AACF"}

View File

@@ -0,0 +1,8 @@
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 declare class DevAppPageNormalizer extends AbsoluteFilenameNormalizer {
constructor(appDir: string, extensions: ReadonlyArray<string>);
}

View File

@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "DevAppPageNormalizer", {
enumerable: true,
get: function() {
return DevAppPageNormalizer;
}
});
const _absolutefilenamenormalizer = require("../../absolute-filename-normalizer");
class DevAppPageNormalizer extends _absolutefilenamenormalizer.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":["DevAppPageNormalizer","AbsoluteFilenameNormalizer","constructor","appDir","extensions"],"mappings":";;;;+BAMaA;;;eAAAA;;;4CAN8B;AAMpC,MAAMA,6BAA6BC,sDAA0B;IAClEC,YAAYC,MAAc,EAAEC,UAAiC,CAAE;QAC7D,KAAK,CAACD,QAAQC,YAAY;IAC5B;AACF"}

View File

@@ -0,0 +1,10 @@
import { Normalizers } from '../../normalizers';
import { Normalizer } from '../../normalizer';
export declare class AppPathnameNormalizer extends Normalizers {
constructor();
normalize(page: string): string;
}
export declare class DevAppPathnameNormalizer extends Normalizers {
constructor(pageNormalizer: Normalizer);
normalize(filename: string): string;
}

View File

@@ -0,0 +1,55 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
AppPathnameNormalizer: null,
DevAppPathnameNormalizer: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
AppPathnameNormalizer: function() {
return AppPathnameNormalizer;
},
DevAppPathnameNormalizer: function() {
return DevAppPathnameNormalizer;
}
});
const _apppaths = require("../../../../../shared/lib/router/utils/app-paths");
const _normalizers = require("../../normalizers");
const _wrapnormalizerfn = require("../../wrap-normalizer-fn");
const _underscorenormalizer = require("../../underscore-normalizer");
class AppPathnameNormalizer extends _normalizers.Normalizers {
constructor(){
super([
// The pathname to match should have the trailing `/page` and other route
// group information stripped from it.
(0, _wrapnormalizerfn.wrapNormalizerFn)(_apppaths.normalizeAppPath),
// The page should have the `%5F` characters replaced with `_` characters.
new _underscorenormalizer.UnderscoreNormalizer()
]);
}
normalize(page) {
return super.normalize(page);
}
}
class DevAppPathnameNormalizer extends _normalizers.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":["AppPathnameNormalizer","DevAppPathnameNormalizer","Normalizers","constructor","wrapNormalizerFn","normalizeAppPath","UnderscoreNormalizer","normalize","page","pageNormalizer","filename"],"mappings":";;;;;;;;;;;;;;;IAMaA,qBAAqB;eAArBA;;IAgBAC,wBAAwB;eAAxBA;;;0BAtBoB;6BACL;kCACK;sCACI;AAG9B,MAAMD,8BAA8BE,wBAAW;IACpDC,aAAc;QACZ,KAAK,CAAC;YACJ,yEAAyE;YACzE,sCAAsC;YACtCC,IAAAA,kCAAgB,EAACC,0BAAgB;YACjC,0EAA0E;YAC1E,IAAIC,0CAAoB;SACzB;IACH;IAEOC,UAAUC,IAAY,EAAU;QACrC,OAAO,KAAK,CAACD,UAAUC;IACzB;AACF;AAEO,MAAMP,iCAAiCC,wBAAW;IACvDC,YAAYM,cAA0B,CAAE;QACtC,KAAK,CAAC;YACJ,gDAAgD;YAChDA;YACA,wCAAwC;YACxC,IAAIT;SACL;IACH;IAEOO,UAAUG,QAAgB,EAAU;QACzC,OAAO,KAAK,CAACH,UAAUG;IACzB;AACF"}

View File

@@ -0,0 +1,16 @@
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 declare class AppNormalizers {
readonly filename: AppFilenameNormalizer;
readonly pathname: AppPathnameNormalizer;
readonly bundlePath: AppBundlePathNormalizer;
constructor(distDir: string);
}
export declare class DevAppNormalizers {
readonly page: DevAppPageNormalizer;
readonly pathname: DevAppPathnameNormalizer;
readonly bundlePath: DevAppBundlePathNormalizer;
constructor(appDir: string, extensions: ReadonlyArray<string>);
}

View File

@@ -0,0 +1,42 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
AppNormalizers: null,
DevAppNormalizers: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
AppNormalizers: function() {
return AppNormalizers;
},
DevAppNormalizers: function() {
return DevAppNormalizers;
}
});
const _appbundlepathnormalizer = require("./app-bundle-path-normalizer");
const _appfilenamenormalizer = require("./app-filename-normalizer");
const _apppagenormalizer = require("./app-page-normalizer");
const _apppathnamenormalizer = require("./app-pathname-normalizer");
class AppNormalizers {
constructor(distDir){
this.filename = new _appfilenamenormalizer.AppFilenameNormalizer(distDir);
this.pathname = new _apppathnamenormalizer.AppPathnameNormalizer();
this.bundlePath = new _appbundlepathnormalizer.AppBundlePathNormalizer();
}
}
class DevAppNormalizers {
constructor(appDir, extensions){
this.page = new _apppagenormalizer.DevAppPageNormalizer(appDir, extensions);
this.pathname = new _apppathnamenormalizer.DevAppPathnameNormalizer(this.page);
this.bundlePath = new _appbundlepathnormalizer.DevAppBundlePathNormalizer(this.page);
}
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../src/server/future/normalizers/built/app/index.ts"],"names":["AppNormalizers","DevAppNormalizers","constructor","distDir","filename","AppFilenameNormalizer","pathname","AppPathnameNormalizer","bundlePath","AppBundlePathNormalizer","appDir","extensions","page","DevAppPageNormalizer","DevAppPathnameNormalizer","DevAppBundlePathNormalizer"],"mappings":";;;;;;;;;;;;;;;IAWaA,cAAc;eAAdA;;IAYAC,iBAAiB;eAAjBA;;;yCApBN;uCAC+B;mCACD;uCAI9B;AAEA,MAAMD;IAKXE,YAAYC,OAAe,CAAE;QAC3B,IAAI,CAACC,QAAQ,GAAG,IAAIC,4CAAqB,CAACF;QAC1C,IAAI,CAACG,QAAQ,GAAG,IAAIC,4CAAqB;QACzC,IAAI,CAACC,UAAU,GAAG,IAAIC,gDAAuB;IAC/C;AACF;AAEO,MAAMR;IAKXC,YAAYQ,MAAc,EAAEC,UAAiC,CAAE;QAC7D,IAAI,CAACC,IAAI,GAAG,IAAIC,uCAAoB,CAACH,QAAQC;QAC7C,IAAI,CAACL,QAAQ,GAAG,IAAIQ,+CAAwB,CAAC,IAAI,CAACF,IAAI;QACtD,IAAI,CAACJ,UAAU,GAAG,IAAIO,mDAA0B,CAAC,IAAI,CAACH,IAAI;IAC5D;AACF"}

View File

@@ -0,0 +1,15 @@
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 declare class PagesNormalizers {
readonly filename: PagesFilenameNormalizer;
readonly bundlePath: PagesBundlePathNormalizer;
constructor(distDir: string);
}
export declare class DevPagesNormalizers {
readonly page: DevPagesPageNormalizer;
readonly pathname: DevPagesPathnameNormalizer;
readonly bundlePath: DevPagesBundlePathNormalizer;
constructor(pagesDir: string, extensions: ReadonlyArray<string>);
}

View File

@@ -0,0 +1,44 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
PagesNormalizers: null,
DevPagesNormalizers: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
PagesNormalizers: function() {
return PagesNormalizers;
},
DevPagesNormalizers: function() {
return DevPagesNormalizers;
}
});
const _pagesbundlepathnormalizer = require("./pages-bundle-path-normalizer");
const _pagesfilenamenormalizer = require("./pages-filename-normalizer");
const _pagespagenormalizer = require("./pages-page-normalizer");
const _pagespathnamenormalizer = require("./pages-pathname-normalizer");
class PagesNormalizers {
constructor(distDir){
this.filename = new _pagesfilenamenormalizer.PagesFilenameNormalizer(distDir);
this.bundlePath = new _pagesbundlepathnormalizer.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.
}
}
class DevPagesNormalizers {
constructor(pagesDir, extensions){
this.page = new _pagespagenormalizer.DevPagesPageNormalizer(pagesDir, extensions);
this.pathname = new _pagespathnamenormalizer.DevPagesPathnameNormalizer(pagesDir, extensions);
this.bundlePath = new _pagesbundlepathnormalizer.DevPagesBundlePathNormalizer(this.page);
}
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../../src/server/future/normalizers/built/pages/index.ts"],"names":["PagesNormalizers","DevPagesNormalizers","constructor","distDir","filename","PagesFilenameNormalizer","bundlePath","PagesBundlePathNormalizer","pagesDir","extensions","page","DevPagesPageNormalizer","pathname","DevPagesPathnameNormalizer","DevPagesBundlePathNormalizer"],"mappings":";;;;;;;;;;;;;;;IAQaA,gBAAgB;eAAhBA;;IAcAC,mBAAmB;eAAnBA;;;2CAnBN;yCACiC;qCACD;yCACI;AAEpC,MAAMD;IAIXE,YAAYC,OAAe,CAAE;QAC3B,IAAI,CAACC,QAAQ,GAAG,IAAIC,gDAAuB,CAACF;QAC5C,IAAI,CAACG,UAAU,GAAG,IAAIC,oDAAyB;IAE/C,sEAAsE;IACtE,sEAAsE;IACtE,wEAAwE;IAC1E;AACF;AAEO,MAAMN;IAKXC,YAAYM,QAAgB,EAAEC,UAAiC,CAAE;QAC/D,IAAI,CAACC,IAAI,GAAG,IAAIC,2CAAsB,CAACH,UAAUC;QACjD,IAAI,CAACG,QAAQ,GAAG,IAAIC,mDAA0B,CAACL,UAAUC;QACzD,IAAI,CAACH,UAAU,GAAG,IAAIQ,uDAA4B,CAAC,IAAI,CAACJ,IAAI;IAC9D;AACF"}

View File

@@ -0,0 +1,10 @@
import { Normalizer } from '../../normalizer';
import { Normalizers } from '../../normalizers';
export declare class PagesBundlePathNormalizer extends Normalizers {
constructor();
normalize(page: string): string;
}
export declare class DevPagesBundlePathNormalizer extends Normalizers {
constructor(pagesNormalizer: Normalizer);
normalize(filename: string): string;
}

View File

@@ -0,0 +1,55 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
0 && (module.exports = {
PagesBundlePathNormalizer: null,
DevPagesBundlePathNormalizer: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
PagesBundlePathNormalizer: function() {
return PagesBundlePathNormalizer;
},
DevPagesBundlePathNormalizer: function() {
return DevPagesBundlePathNormalizer;
}
});
const _normalizepagepath = require("../../../../../shared/lib/page-path/normalize-page-path");
const _normalizers = require("../../normalizers");
const _prefixingnormalizer = require("../../prefixing-normalizer");
const _wrapnormalizerfn = require("../../wrap-normalizer-fn");
class PagesBundlePathNormalizer extends _normalizers.Normalizers {
constructor(){
super([
// The bundle path should have the trailing `/index` stripped from
// it.
(0, _wrapnormalizerfn.wrapNormalizerFn)(_normalizepagepath.normalizePagePath),
// The page should prefixed with `pages/`.
new _prefixingnormalizer.PrefixingNormalizer("pages")
]);
}
normalize(page) {
return super.normalize(page);
}
}
class DevPagesBundlePathNormalizer extends _normalizers.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":["PagesBundlePathNormalizer","DevPagesBundlePathNormalizer","Normalizers","constructor","wrapNormalizerFn","normalizePagePath","PrefixingNormalizer","normalize","page","pagesNormalizer","filename"],"mappings":";;;;;;;;;;;;;;;IAMaA,yBAAyB;eAAzBA;;IAgBAC,4BAA4B;eAA5BA;;;mCAtBqB;6BAEN;qCACQ;kCACH;AAE1B,MAAMD,kCAAkCE,wBAAW;IACxDC,aAAc;QACZ,KAAK,CAAC;YACJ,kEAAkE;YAClE,MAAM;YACNC,IAAAA,kCAAgB,EAACC,oCAAiB;YAClC,0CAA0C;YAC1C,IAAIC,wCAAmB,CAAC;SACzB;IACH;IAEOC,UAAUC,IAAY,EAAU;QACrC,OAAO,KAAK,CAACD,UAAUC;IACzB;AACF;AAEO,MAAMP,qCAAqCC,wBAAW;IAC3DC,YAAYM,eAA2B,CAAE;QACvC,KAAK,CAAC;YACJ,gDAAgD;YAChDA;YACA,wCAAwC;YACxC,IAAIT;SACL;IACH;IAEOO,UAAUG,QAAgB,EAAU;QACzC,OAAO,KAAK,CAACH,UAAUG;IACzB;AACF"}

View File

@@ -0,0 +1,5 @@
import { PrefixingNormalizer } from '../../prefixing-normalizer';
export declare class PagesFilenameNormalizer extends PrefixingNormalizer {
constructor(distDir: string);
normalize(manifestFilename: string): string;
}

View File

@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "PagesFilenameNormalizer", {
enumerable: true,
get: function() {
return PagesFilenameNormalizer;
}
});
const _constants = require("../../../../../shared/lib/constants");
const _prefixingnormalizer = require("../../prefixing-normalizer");
class PagesFilenameNormalizer extends _prefixingnormalizer.PrefixingNormalizer {
constructor(distDir){
super(distDir, _constants.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":["PagesFilenameNormalizer","PrefixingNormalizer","constructor","distDir","SERVER_DIRECTORY","normalize","manifestFilename"],"mappings":";;;;+BAGaA;;;eAAAA;;;2BAHoB;qCACG;AAE7B,MAAMA,gCAAgCC,wCAAmB;IAC9DC,YAAYC,OAAe,CAAE;QAC3B,KAAK,CAACA,SAASC,2BAAgB;IACjC;IAEOC,UAAUC,gBAAwB,EAAU;QACjD,OAAO,KAAK,CAACD,UAAUC;IACzB;AACF"}

View File

@@ -0,0 +1,4 @@
import { AbsoluteFilenameNormalizer } from '../../absolute-filename-normalizer';
export declare class DevPagesPageNormalizer extends AbsoluteFilenameNormalizer {
constructor(pagesDir: string, extensions: ReadonlyArray<string>);
}

View File

@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "DevPagesPageNormalizer", {
enumerable: true,
get: function() {
return DevPagesPageNormalizer;
}
});
const _absolutefilenamenormalizer = require("../../absolute-filename-normalizer");
class DevPagesPageNormalizer extends _absolutefilenamenormalizer.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":["DevPagesPageNormalizer","AbsoluteFilenameNormalizer","constructor","pagesDir","extensions"],"mappings":";;;;+BAEaA;;;eAAAA;;;4CAF8B;AAEpC,MAAMA,+BAA+BC,sDAA0B;IACpEC,YAAYC,QAAgB,EAAEC,UAAiC,CAAE;QAC/D,KAAK,CAACD,UAAUC,YAAY;IAC9B;AACF"}

View File

@@ -0,0 +1,4 @@
import { AbsoluteFilenameNormalizer } from '../../absolute-filename-normalizer';
export declare class DevPagesPathnameNormalizer extends AbsoluteFilenameNormalizer {
constructor(pagesDir: string, extensions: ReadonlyArray<string>);
}

View File

@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "DevPagesPathnameNormalizer", {
enumerable: true,
get: function() {
return DevPagesPathnameNormalizer;
}
});
const _absolutefilenamenormalizer = require("../../absolute-filename-normalizer");
class DevPagesPathnameNormalizer extends _absolutefilenamenormalizer.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":["DevPagesPathnameNormalizer","AbsoluteFilenameNormalizer","constructor","pagesDir","extensions"],"mappings":";;;;+BAEaA;;;eAAAA;;;4CAF8B;AAEpC,MAAMA,mCAAmCC,sDAA0B;IACxEC,YAAYC,QAAgB,EAAEC,UAAiC,CAAE;QAC/D,KAAK,CAACD,UAAUC,YAAY;IAC9B;AACF"}

View File

@@ -0,0 +1,16 @@
import { I18NProvider } from '../helpers/i18n-provider';
import { Normalizer } from './normalizer';
/**
* Normalizes the pathname by removing the locale prefix if any.
*/
export declare class LocaleRouteNormalizer implements Normalizer {
private readonly provider;
constructor(provider: I18NProvider);
/**
* 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: string): string;
}

View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "LocaleRouteNormalizer", {
enumerable: true,
get: function() {
return LocaleRouteNormalizer;
}
});
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":";;;;+BAMaA;;;eAAAA;;;AAAN,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 interface Normalizer {
normalize(pathname: string): string;
}

View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
//# sourceMappingURL=normalizer.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":[],"names":[],"mappings":""}

View File

@@ -0,0 +1,11 @@
import { Normalizer } from './normalizer';
/**
* Normalizers combines many normalizers into a single normalizer interface that
* will normalize the inputted pathname with each normalizer in order.
*/
export declare class Normalizers implements Normalizer {
private readonly normalizers;
constructor(normalizers?: Array<Normalizer>);
push(normalizer: Normalizer): void;
normalize(pathname: string): string;
}

View File

@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Normalizers", {
enumerable: true,
get: function() {
return Normalizers;
}
});
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":";;;;+BAMaA;;;eAAAA;;;AAAN,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,6 @@
import { Normalizer } from './normalizer';
export declare class PrefixingNormalizer implements Normalizer {
private readonly prefix;
constructor(...prefixes: ReadonlyArray<string>);
normalize(pathname: string): string;
}

View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "PrefixingNormalizer", {
enumerable: true,
get: function() {
return PrefixingNormalizer;
}
});
const _path = /*#__PURE__*/ _interop_require_default(require("../../../shared/lib/isomorphic/path"));
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
class PrefixingNormalizer {
constructor(...prefixes){
this.prefix = _path.default.posix.join(...prefixes);
}
normalize(pathname) {
return _path.default.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":["PrefixingNormalizer","constructor","prefixes","prefix","path","posix","join","normalize","pathname"],"mappings":";;;;+BAGaA;;;eAAAA;;;6DAHI;;;;;;AAGV,MAAMA;IAGXC,YAAY,GAAGC,QAA+B,CAAE;QAC9C,IAAI,CAACC,MAAM,GAAGC,aAAI,CAACC,KAAK,CAACC,IAAI,IAAIJ;IACnC;IAEOK,UAAUC,QAAgB,EAAU;QACzC,OAAOJ,aAAI,CAACC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACH,MAAM,EAAEK;IACtC;AACF"}

View File

@@ -0,0 +1,7 @@
import { Normalizer } from './normalizer';
/**
* UnderscoreNormalizer replaces all instances of %5F with _.
*/
export declare class UnderscoreNormalizer implements Normalizer {
normalize(pathname: string): string;
}

View File

@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "UnderscoreNormalizer", {
enumerable: true,
get: function() {
return UnderscoreNormalizer;
}
});
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":";;;;+BAKaA;;;eAAAA;;;AAAN,MAAMA;IACJC,UAAUC,QAAgB,EAAU;QACzC,OAAOA,SAASC,OAAO,CAAC,QAAQ;IAClC;AACF"}

View File

@@ -0,0 +1,2 @@
import { Normalizer } from './normalizer';
export declare function wrapNormalizerFn(fn: (pathname: string) => string): Normalizer;

View File

@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "wrapNormalizerFn", {
enumerable: true,
get: function() {
return wrapNormalizerFn;
}
});
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":";;;;+BAEgBA;;;eAAAA;;;AAAT,SAASA,iBAAiBC,EAAgC;IAC/D,OAAO;QAAEC,WAAWD;IAAG;AACzB"}