Initial boiler plate project

This commit is contained in:
2024-09-24 03:52:46 +00:00
parent 6120b2d6c3
commit 154b93e267
10034 changed files with 2079352 additions and 2 deletions

View File

@ -0,0 +1,19 @@
import type { PAGE_TYPES } from '../../../lib/page-types';
import type { 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: PAGE_TYPES);
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":";;;;+BAQaA;;;eAAAA;;;oCAPsB;AAO5B,MAAMA;IACX;;;;;GAKC,GACDC,YACE,AAAiBC,GAAW,EAC5B,AAAiBC,UAAiC,EAClD,AAAiBC,SAAqB,CACtC;aAHiBF,MAAAA;aACAC,aAAAA;aACAC,YAAAA;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 type { 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,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "DevAppPageNormalizer", {
enumerable: true,
get: function() {
return DevAppPageNormalizer;
}
});
const _pagetypes = require("../../../../../lib/page-types");
const _absolutefilenamenormalizer = require("../../absolute-filename-normalizer");
class DevAppPageNormalizer extends _absolutefilenamenormalizer.AbsoluteFilenameNormalizer {
constructor(appDir, extensions){
super(appDir, extensions, _pagetypes.PAGE_TYPES.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","PAGE_TYPES","APP"],"mappings":";;;;+BAOaA;;;eAAAA;;;2BAPc;4CACgB;AAMpC,MAAMA,6BAA6BC,sDAA0B;IAClEC,YAAYC,MAAc,EAAEC,UAAiC,CAAE;QAC7D,KAAK,CAACD,QAAQC,YAAYC,qBAAU,CAACC,GAAG;IAC1C;AACF"}

View File

@ -0,0 +1,10 @@
import { Normalizers } from '../../normalizers';
import type { 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 = {
DevPagesNormalizers: null,
PagesNormalizers: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
DevPagesNormalizers: function() {
return DevPagesNormalizers;
},
PagesNormalizers: function() {
return PagesNormalizers;
}
});
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":["DevPagesNormalizers","PagesNormalizers","constructor","distDir","filename","PagesFilenameNormalizer","bundlePath","PagesBundlePathNormalizer","pagesDir","extensions","page","DevPagesPageNormalizer","pathname","DevPagesPathnameNormalizer","DevPagesBundlePathNormalizer"],"mappings":";;;;;;;;;;;;;;;IAsBaA,mBAAmB;eAAnBA;;IAdAC,gBAAgB;eAAhBA;;;2CALN;yCACiC;qCACD;yCACI;AAEpC,MAAMA;IAIXC,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,MAAMP;IAKXE,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 type { 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 = {
DevPagesBundlePathNormalizer: null,
PagesBundlePathNormalizer: null
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
DevPagesBundlePathNormalizer: function() {
return DevPagesBundlePathNormalizer;
},
PagesBundlePathNormalizer: function() {
return PagesBundlePathNormalizer;
}
});
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":["DevPagesBundlePathNormalizer","PagesBundlePathNormalizer","Normalizers","constructor","wrapNormalizerFn","normalizePagePath","PrefixingNormalizer","normalize","page","pagesNormalizer","filename"],"mappings":";;;;;;;;;;;;;;;IAsBaA,4BAA4B;eAA5BA;;IAhBAC,yBAAyB;eAAzBA;;;mCANqB;6BAEN;qCACQ;kCACH;AAE1B,MAAMA,kCAAkCC,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,MAAMR,qCAAqCE,wBAAW;IAC3DC,YAAYM,eAA2B,CAAE;QACvC,KAAK,CAAC;YACJ,gDAAgD;YAChDA;YACA,wCAAwC;YACxC,IAAIR;SACL;IACH;IAEOM,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,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "DevPagesPageNormalizer", {
enumerable: true,
get: function() {
return DevPagesPageNormalizer;
}
});
const _pagetypes = require("../../../../../lib/page-types");
const _absolutefilenamenormalizer = require("../../absolute-filename-normalizer");
class DevPagesPageNormalizer extends _absolutefilenamenormalizer.AbsoluteFilenameNormalizer {
constructor(pagesDir, extensions){
super(pagesDir, extensions, _pagetypes.PAGE_TYPES.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","PAGE_TYPES","PAGES"],"mappings":";;;;+BAGaA;;;eAAAA;;;2BAHc;4CACgB;AAEpC,MAAMA,+BAA+BC,sDAA0B;IACpEC,YAAYC,QAAgB,EAAEC,UAAiC,CAAE;QAC/D,KAAK,CAACD,UAAUC,YAAYC,qBAAU,CAACC,KAAK;IAC9C;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,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "DevPagesPathnameNormalizer", {
enumerable: true,
get: function() {
return DevPagesPathnameNormalizer;
}
});
const _pagetypes = require("../../../../../lib/page-types");
const _absolutefilenamenormalizer = require("../../absolute-filename-normalizer");
class DevPagesPathnameNormalizer extends _absolutefilenamenormalizer.AbsoluteFilenameNormalizer {
constructor(pagesDir, extensions){
super(pagesDir, extensions, _pagetypes.PAGE_TYPES.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","PAGE_TYPES","PAGES"],"mappings":";;;;+BAGaA;;;eAAAA;;;2BAHc;4CACgB;AAEpC,MAAMA,mCAAmCC,sDAA0B;IACxEC,YAAYC,QAAgB,EAAEC,UAAiC,CAAE;QAC/D,KAAK,CAACD,UAAUC,YAAYC,qBAAU,CAACC,KAAK;IAC9C;AACF"}

View File

@ -0,0 +1,16 @@
import type { I18NProvider } from '../helpers/i18n-provider';
import type { 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,YAAY,AAAiBC,QAAsB,CAAE;aAAxBA,WAAAA;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 type { 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,YAAY,AAAiBC,cAAiC,EAAE,CAAE;aAArCA,cAAAA;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 type { 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,5 @@
import type { PathnameNormalizer } from './pathname-normalizer';
import { SuffixPathnameNormalizer } from './suffix';
export declare class ActionPathnameNormalizer extends SuffixPathnameNormalizer implements PathnameNormalizer {
constructor();
}

View File

@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "ActionPathnameNormalizer", {
enumerable: true,
get: function() {
return ActionPathnameNormalizer;
}
});
const _constants = require("../../../../lib/constants");
const _suffix = require("./suffix");
class ActionPathnameNormalizer extends _suffix.SuffixPathnameNormalizer {
constructor(){
super(_constants.ACTION_SUFFIX);
}
}
//# sourceMappingURL=action.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/server/future/normalizers/request/action.ts"],"names":["ActionPathnameNormalizer","SuffixPathnameNormalizer","constructor","ACTION_SUFFIX"],"mappings":";;;;+BAKaA;;;eAAAA;;;2BAHiB;wBACW;AAElC,MAAMA,iCACHC,gCAAwB;IAGhCC,aAAc;QACZ,KAAK,CAACC,wBAAa;IACrB;AACF"}

View File

@ -0,0 +1,5 @@
import type { PathnameNormalizer } from './pathname-normalizer';
import { PrefixPathnameNormalizer } from './prefix';
export declare class BasePathPathnameNormalizer extends PrefixPathnameNormalizer implements PathnameNormalizer {
constructor(basePath: string);
}

View File

@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "BasePathPathnameNormalizer", {
enumerable: true,
get: function() {
return BasePathPathnameNormalizer;
}
});
const _prefix = require("./prefix");
class BasePathPathnameNormalizer extends _prefix.PrefixPathnameNormalizer {
constructor(basePath){
if (!basePath || basePath === "/") {
throw new Error('Invariant: basePath must be set and cannot be "/"');
}
super(basePath);
}
}
//# sourceMappingURL=base-path.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/server/future/normalizers/request/base-path.ts"],"names":["BasePathPathnameNormalizer","PrefixPathnameNormalizer","constructor","basePath","Error"],"mappings":";;;;+BAIaA;;;eAAAA;;;wBAF4B;AAElC,MAAMA,mCACHC,gCAAwB;IAGhCC,YAAYC,QAAgB,CAAE;QAC5B,IAAI,CAACA,YAAYA,aAAa,KAAK;YACjC,MAAM,IAAIC,MAAM;QAClB;QAEA,KAAK,CAACD;IACR;AACF"}

View File

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

View File

@ -0,0 +1,8 @@
import type { PathnameNormalizer } from './pathname-normalizer';
export declare class NextDataPathnameNormalizer implements PathnameNormalizer {
private readonly prefix;
private readonly suffix;
constructor(buildID: string);
match(pathname: string): boolean;
normalize(pathname: string, matched?: boolean): string;
}

View File

@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "NextDataPathnameNormalizer", {
enumerable: true,
get: function() {
return NextDataPathnameNormalizer;
}
});
const _denormalizepagepath = require("../../../../shared/lib/page-path/denormalize-page-path");
const _prefix = require("./prefix");
const _suffix = require("./suffix");
class NextDataPathnameNormalizer {
constructor(buildID){
this.suffix = new _suffix.SuffixPathnameNormalizer(".json");
if (!buildID) {
throw new Error("Invariant: buildID is required");
}
this.prefix = new _prefix.PrefixPathnameNormalizer(`/_next/data/${buildID}`);
}
match(pathname) {
return this.prefix.match(pathname) && this.suffix.match(pathname);
}
normalize(pathname, matched) {
// If we're not matched and we don't match, we don't need to normalize.
if (!matched && !this.match(pathname)) return pathname;
pathname = this.prefix.normalize(pathname, true);
pathname = this.suffix.normalize(pathname, true);
return (0, _denormalizepagepath.denormalizePagePath)(pathname);
}
}
//# sourceMappingURL=next-data.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/server/future/normalizers/request/next-data.ts"],"names":["NextDataPathnameNormalizer","constructor","buildID","suffix","SuffixPathnameNormalizer","Error","prefix","PrefixPathnameNormalizer","match","pathname","normalize","matched","denormalizePagePath"],"mappings":";;;;+BAMaA;;;eAAAA;;;qCAJuB;wBACK;wBACA;AAElC,MAAMA;IAGXC,YAAYC,OAAe,CAAE;aADZC,SAAS,IAAIC,gCAAwB,CAAC;QAErD,IAAI,CAACF,SAAS;YACZ,MAAM,IAAIG,MAAM;QAClB;QAEA,IAAI,CAACC,MAAM,GAAG,IAAIC,gCAAwB,CAAC,CAAC,YAAY,EAAEL,QAAQ,CAAC;IACrE;IAEOM,MAAMC,QAAgB,EAAE;QAC7B,OAAO,IAAI,CAACH,MAAM,CAACE,KAAK,CAACC,aAAa,IAAI,CAACN,MAAM,CAACK,KAAK,CAACC;IAC1D;IAEOC,UAAUD,QAAgB,EAAEE,OAAiB,EAAU;QAC5D,uEAAuE;QACvE,IAAI,CAACA,WAAW,CAAC,IAAI,CAACH,KAAK,CAACC,WAAW,OAAOA;QAE9CA,WAAW,IAAI,CAACH,MAAM,CAACI,SAAS,CAACD,UAAU;QAC3CA,WAAW,IAAI,CAACN,MAAM,CAACO,SAAS,CAACD,UAAU;QAE3C,OAAOG,IAAAA,wCAAmB,EAACH;IAC7B;AACF"}

View File

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

View File

@ -0,0 +1,5 @@
import type { Normalizer } from '../normalizer';
export interface PathnameNormalizer extends Normalizer {
match(pathname: string): boolean;
normalize(pathname: string, matched?: boolean): string;
}

View File

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

View File

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

View File

@ -0,0 +1,6 @@
import type { PathnameNormalizer } from './pathname-normalizer';
import { PrefixPathnameNormalizer } from './prefix';
export declare class PostponedPathnameNormalizer extends PrefixPathnameNormalizer implements PathnameNormalizer {
constructor();
normalize(pathname: string, matched?: boolean): string;
}

View File

@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "PostponedPathnameNormalizer", {
enumerable: true,
get: function() {
return PostponedPathnameNormalizer;
}
});
const _denormalizepagepath = require("../../../../shared/lib/page-path/denormalize-page-path");
const _prefix = require("./prefix");
const prefix = "/_next/postponed/resume";
class PostponedPathnameNormalizer extends _prefix.PrefixPathnameNormalizer {
constructor(){
super(prefix);
}
normalize(pathname, matched) {
// If we're not matched and we don't match, we don't need to normalize.
if (!matched && !this.match(pathname)) return pathname;
// Remove the prefix.
pathname = super.normalize(pathname, true);
return (0, _denormalizepagepath.denormalizePagePath)(pathname);
}
}
//# sourceMappingURL=postponed.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/server/future/normalizers/request/postponed.ts"],"names":["PostponedPathnameNormalizer","prefix","PrefixPathnameNormalizer","constructor","normalize","pathname","matched","match","denormalizePagePath"],"mappings":";;;;+BAOaA;;;eAAAA;;;qCAPuB;wBAGK;AAEzC,MAAMC,SAAS;AAER,MAAMD,oCACHE,gCAAwB;IAGhCC,aAAc;QACZ,KAAK,CAACF;IACR;IAEOG,UAAUC,QAAgB,EAAEC,OAAiB,EAAU;QAC5D,uEAAuE;QACvE,IAAI,CAACA,WAAW,CAAC,IAAI,CAACC,KAAK,CAACF,WAAW,OAAOA;QAE9C,qBAAqB;QACrBA,WAAW,KAAK,CAACD,UAAUC,UAAU;QAErC,OAAOG,IAAAA,wCAAmB,EAACH;IAC7B;AACF"}

View File

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

View File

@ -0,0 +1,5 @@
import type { PathnameNormalizer } from './pathname-normalizer';
import { SuffixPathnameNormalizer } from './suffix';
export declare class PrefetchRSCPathnameNormalizer extends SuffixPathnameNormalizer implements PathnameNormalizer {
constructor();
}

View File

@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "PrefetchRSCPathnameNormalizer", {
enumerable: true,
get: function() {
return PrefetchRSCPathnameNormalizer;
}
});
const _constants = require("../../../../lib/constants");
const _suffix = require("./suffix");
class PrefetchRSCPathnameNormalizer extends _suffix.SuffixPathnameNormalizer {
constructor(){
super(_constants.RSC_PREFETCH_SUFFIX);
}
}
//# sourceMappingURL=prefetch-rsc.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/server/future/normalizers/request/prefetch-rsc.ts"],"names":["PrefetchRSCPathnameNormalizer","SuffixPathnameNormalizer","constructor","RSC_PREFETCH_SUFFIX"],"mappings":";;;;+BAKaA;;;eAAAA;;;2BAHuB;wBACK;AAElC,MAAMA,sCACHC,gCAAwB;IAGhCC,aAAc;QACZ,KAAK,CAACC,8BAAmB;IAC3B;AACF"}

View File

@ -0,0 +1,7 @@
import type { Normalizer } from '../normalizer';
export declare class PrefixPathnameNormalizer implements Normalizer {
private readonly prefix;
constructor(prefix: string);
match(pathname: string): boolean;
normalize(pathname: string, matched?: boolean): string;
}

View File

@ -0,0 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "PrefixPathnameNormalizer", {
enumerable: true,
get: function() {
return PrefixPathnameNormalizer;
}
});
class PrefixPathnameNormalizer {
constructor(prefix){
this.prefix = prefix;
if (prefix.endsWith("/")) {
throw new Error(`PrefixPathnameNormalizer: prefix "${prefix}" should not end with a slash`);
}
}
match(pathname) {
// If the pathname doesn't start with the prefix, we don't match.
if (pathname !== this.prefix && !pathname.startsWith(this.prefix + "/")) {
return false;
}
return true;
}
normalize(pathname, matched) {
// If we're not matched and we don't match, we don't need to normalize.
if (!matched && !this.match(pathname)) return pathname;
if (pathname.length === this.prefix.length) {
return "/";
}
return pathname.substring(this.prefix.length);
}
}
//# sourceMappingURL=prefix.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/server/future/normalizers/request/prefix.ts"],"names":["PrefixPathnameNormalizer","constructor","prefix","endsWith","Error","match","pathname","startsWith","normalize","matched","length","substring"],"mappings":";;;;+BAEaA;;;eAAAA;;;AAAN,MAAMA;IACXC,YAAY,AAAiBC,MAAc,CAAE;aAAhBA,SAAAA;QAC3B,IAAIA,OAAOC,QAAQ,CAAC,MAAM;YACxB,MAAM,IAAIC,MACR,CAAC,kCAAkC,EAAEF,OAAO,6BAA6B,CAAC;QAE9E;IACF;IAEOG,MAAMC,QAAgB,EAAE;QAC7B,iEAAiE;QACjE,IAAIA,aAAa,IAAI,CAACJ,MAAM,IAAI,CAACI,SAASC,UAAU,CAAC,IAAI,CAACL,MAAM,GAAG,MAAM;YACvE,OAAO;QACT;QAEA,OAAO;IACT;IAEOM,UAAUF,QAAgB,EAAEG,OAAiB,EAAU;QAC5D,uEAAuE;QACvE,IAAI,CAACA,WAAW,CAAC,IAAI,CAACJ,KAAK,CAACC,WAAW,OAAOA;QAE9C,IAAIA,SAASI,MAAM,KAAK,IAAI,CAACR,MAAM,CAACQ,MAAM,EAAE;YAC1C,OAAO;QACT;QAEA,OAAOJ,SAASK,SAAS,CAAC,IAAI,CAACT,MAAM,CAACQ,MAAM;IAC9C;AACF"}

View File

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

View File

@ -0,0 +1,5 @@
import type { PathnameNormalizer } from './pathname-normalizer';
import { SuffixPathnameNormalizer } from './suffix';
export declare class RSCPathnameNormalizer extends SuffixPathnameNormalizer implements PathnameNormalizer {
constructor();
}

View File

@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "RSCPathnameNormalizer", {
enumerable: true,
get: function() {
return RSCPathnameNormalizer;
}
});
const _constants = require("../../../../lib/constants");
const _suffix = require("./suffix");
class RSCPathnameNormalizer extends _suffix.SuffixPathnameNormalizer {
constructor(){
super(_constants.RSC_SUFFIX);
}
}
//# sourceMappingURL=rsc.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/server/future/normalizers/request/rsc.ts"],"names":["RSCPathnameNormalizer","SuffixPathnameNormalizer","constructor","RSC_SUFFIX"],"mappings":";;;;+BAKaA;;;eAAAA;;;2BAHc;wBACc;AAElC,MAAMA,8BACHC,gCAAwB;IAGhCC,aAAc;QACZ,KAAK,CAACC,qBAAU;IAClB;AACF"}

View File

@ -0,0 +1,7 @@
import type { Normalizer } from '../normalizer';
export declare class SuffixPathnameNormalizer implements Normalizer {
private readonly suffix;
constructor(suffix: string);
match(pathname: string): boolean;
normalize(pathname: string, matched?: boolean): string;
}

View File

@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "SuffixPathnameNormalizer", {
enumerable: true,
get: function() {
return SuffixPathnameNormalizer;
}
});
class SuffixPathnameNormalizer {
constructor(suffix){
this.suffix = suffix;
}
match(pathname) {
// If the pathname doesn't end in the suffix, we don't match.
if (!pathname.endsWith(this.suffix)) return false;
return true;
}
normalize(pathname, matched) {
// If we're not matched and we don't match, we don't need to normalize.
if (!matched && !this.match(pathname)) return pathname;
return pathname.substring(0, pathname.length - this.suffix.length);
}
}
//# sourceMappingURL=suffix.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/server/future/normalizers/request/suffix.ts"],"names":["SuffixPathnameNormalizer","constructor","suffix","match","pathname","endsWith","normalize","matched","substring","length"],"mappings":";;;;+BAEaA;;;eAAAA;;;AAAN,MAAMA;IACXC,YAAY,AAAiBC,MAAc,CAAE;aAAhBA,SAAAA;IAAiB;IAEvCC,MAAMC,QAAgB,EAAE;QAC7B,6DAA6D;QAC7D,IAAI,CAACA,SAASC,QAAQ,CAAC,IAAI,CAACH,MAAM,GAAG,OAAO;QAE5C,OAAO;IACT;IAEOI,UAAUF,QAAgB,EAAEG,OAAiB,EAAU;QAC5D,uEAAuE;QACvE,IAAI,CAACA,WAAW,CAAC,IAAI,CAACJ,KAAK,CAACC,WAAW,OAAOA;QAE9C,OAAOA,SAASI,SAAS,CAAC,GAAGJ,SAASK,MAAM,GAAG,IAAI,CAACP,MAAM,CAACO,MAAM;IACnE;AACF"}

View File

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

View File

@ -0,0 +1,7 @@
import type { 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 type { 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"}