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,12 @@
import { NextConfig } from '../../../../server/config-shared';
import { webpack } from 'next/dist/compiled/webpack/webpack';
export type EdgeAppRouteLoaderQuery = {
absolutePagePath: string;
page: string;
appDirLoader: string;
preferredRegion: string | string[] | undefined;
nextConfigOutput: NextConfig['output'];
middlewareConfig: string;
};
declare const EdgeAppRouteLoader: webpack.LoaderDefinitionFunction<EdgeAppRouteLoaderQuery>;
export default EdgeAppRouteLoader;

View File

@@ -0,0 +1,44 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return _default;
}
});
const _getmodulebuildinfo = require("../get-module-build-info");
const _stringifyrequest = require("../../stringify-request");
const _constants = require("../../../../lib/constants");
const EdgeAppRouteLoader = function() {
const { page, absolutePagePath, preferredRegion, appDirLoader: appDirLoaderBase64 = "", middlewareConfig: middlewareConfigBase64 = "" } = this.getOptions();
const appDirLoader = Buffer.from(appDirLoaderBase64, "base64").toString();
const middlewareConfig = JSON.parse(Buffer.from(middlewareConfigBase64, "base64").toString());
// Ensure we only run this loader for as a module.
if (!this._module) throw new Error("This loader is only usable as a module");
const buildInfo = (0, _getmodulebuildinfo.getModuleBuildInfo)(this._module);
buildInfo.nextEdgeSSR = {
isServerComponent: false,
page: page,
isAppDir: true
};
buildInfo.route = {
page,
absolutePagePath,
preferredRegion,
middlewareConfig
};
const stringifiedPagePath = (0, _stringifyrequest.stringifyRequest)(this, absolutePagePath);
const modulePath = `${appDirLoader}${stringifiedPagePath.substring(1, stringifiedPagePath.length - 1)}?${_constants.WEBPACK_RESOURCE_QUERIES.edgeSSREntry}`;
return `
import { EdgeRouteModuleWrapper } from 'next/dist/esm/server/web/edge-route-module-wrapper'
import * as module from ${JSON.stringify(modulePath)}
export const ComponentMod = module
export default EdgeRouteModuleWrapper.wrap(module.routeModule)`;
};
const _default = EdgeAppRouteLoader;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/build/webpack/loaders/next-edge-app-route-loader/index.ts"],"names":["EdgeAppRouteLoader","page","absolutePagePath","preferredRegion","appDirLoader","appDirLoaderBase64","middlewareConfig","middlewareConfigBase64","getOptions","Buffer","from","toString","JSON","parse","_module","Error","buildInfo","getModuleBuildInfo","nextEdgeSSR","isServerComponent","isAppDir","route","stringifiedPagePath","stringifyRequest","modulePath","substring","length","WEBPACK_RESOURCE_QUERIES","edgeSSREntry","stringify"],"mappings":";;;;+BA+DA;;;eAAA;;;oCA/DmC;kCACF;2BAGQ;AAYzC,MAAMA,qBACJ;IACE,MAAM,EACJC,IAAI,EACJC,gBAAgB,EAChBC,eAAe,EACfC,cAAcC,qBAAqB,EAAE,EACrCC,kBAAkBC,yBAAyB,EAAE,EAC9C,GAAG,IAAI,CAACC,UAAU;IAEnB,MAAMJ,eAAeK,OAAOC,IAAI,CAACL,oBAAoB,UAAUM,QAAQ;IACvE,MAAML,mBAAqCM,KAAKC,KAAK,CACnDJ,OAAOC,IAAI,CAACH,wBAAwB,UAAUI,QAAQ;IAGxD,kDAAkD;IAClD,IAAI,CAAC,IAAI,CAACG,OAAO,EAAE,MAAM,IAAIC,MAAM;IAEnC,MAAMC,YAAYC,IAAAA,sCAAkB,EAAC,IAAI,CAACH,OAAO;IAEjDE,UAAUE,WAAW,GAAG;QACtBC,mBAAmB;QACnBlB,MAAMA;QACNmB,UAAU;IACZ;IACAJ,UAAUK,KAAK,GAAG;QAChBpB;QACAC;QACAC;QACAG;IACF;IAEA,MAAMgB,sBAAsBC,IAAAA,kCAAgB,EAAC,IAAI,EAAErB;IACnD,MAAMsB,aAAa,CAAC,EAAEpB,aAAa,EAAEkB,oBAAoBG,SAAS,CAChE,GACAH,oBAAoBI,MAAM,GAAG,GAC7B,CAAC,EAAEC,mCAAwB,CAACC,YAAY,CAAC,CAAC;IAE5C,OAAO,CAAC;;4BAEgB,EAAEhB,KAAKiB,SAAS,CAACL,YAAY;;;;kEAIS,CAAC;AACjE;MAEF,WAAexB"}