inital commit

This commit is contained in:
2026-01-01 15:25:19 +05:30
commit f0ae49465a
36361 changed files with 4894111 additions and 0 deletions

40
node_modules/next/dist/esm/build/templates/app-page.js generated vendored Normal file
View File

@@ -0,0 +1,40 @@
import { AppPageRouteModule } from '../../server/route-modules/app-page/module.compiled' with {
'turbopack-transition': 'next-ssr'
};
import { RouteKind } from '../../server/route-kind' with {
'turbopack-transition': 'next-server-utility'
};
// We inject the tree and pages here so that we can use them in the route
// module.
// INJECT:tree
// INJECT:pages
export { tree, pages };
export { default as GlobalError } from 'VAR_MODULE_GLOBAL_ERROR' with {
'turbopack-transition': 'next-server-utility'
};
// INJECT:__next_app_require__
// INJECT:__next_app_load_chunk__
export const __next_app__ = {
require: __next_app_require__,
loadChunk: __next_app_load_chunk__
};
export * from '../../server/app-render/entry-base' with {
'turbopack-transition': 'next-server-utility'
};
// Create and export the route module that will be consumed.
export const routeModule = new AppPageRouteModule({
definition: {
kind: RouteKind.APP_PAGE,
page: 'VAR_DEFINITION_PAGE',
pathname: 'VAR_DEFINITION_PATHNAME',
// The following aren't used in production.
bundlePath: '',
filename: '',
appPaths: []
},
userland: {
loaderTree: tree
}
});
//# sourceMappingURL=app-page.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/build/templates/app-page.ts"],"sourcesContent":["import type { LoaderTree } from '../../server/lib/app-dir-module'\nimport { AppPageRouteModule } from '../../server/route-modules/app-page/module.compiled' with { 'turbopack-transition': 'next-ssr' }\nimport { RouteKind } from '../../server/route-kind' with { 'turbopack-transition': 'next-server-utility' }\n\n// These are injected by the loader afterwards.\n\n/**\n * The tree created in next-app-loader that holds component segments and modules\n * and I've updated it.\n */\ndeclare const tree: LoaderTree\ndeclare const pages: any\n\n// We inject the tree and pages here so that we can use them in the route\n// module.\n// INJECT:tree\n// INJECT:pages\n\nexport { tree, pages }\n\nexport { default as GlobalError } from 'VAR_MODULE_GLOBAL_ERROR' with { 'turbopack-transition': 'next-server-utility' }\n\n// These are injected by the loader afterwards.\ndeclare const __next_app_require__: (id: string | number) => unknown\ndeclare const __next_app_load_chunk__: (id: string | number) => Promise<unknown>\n\n// INJECT:__next_app_require__\n// INJECT:__next_app_load_chunk__\n\nexport const __next_app__ = {\n require: __next_app_require__,\n loadChunk: __next_app_load_chunk__,\n}\n\nexport * from '../../server/app-render/entry-base' with { 'turbopack-transition': 'next-server-utility' }\n\n// Create and export the route module that will be consumed.\nexport const routeModule = new AppPageRouteModule({\n definition: {\n kind: RouteKind.APP_PAGE,\n page: 'VAR_DEFINITION_PAGE',\n pathname: 'VAR_DEFINITION_PATHNAME',\n // The following aren't used in production.\n bundlePath: '',\n filename: '',\n appPaths: [],\n },\n userland: {\n loaderTree: tree,\n },\n})\n"],"names":["AppPageRouteModule","RouteKind","tree","pages","default","GlobalError","__next_app__","require","__next_app_require__","loadChunk","__next_app_load_chunk__","routeModule","definition","kind","APP_PAGE","page","pathname","bundlePath","filename","appPaths","userland","loaderTree"],"mappings":"AACA,SAASA,kBAAkB,QAAQ,2DAA2D;IAAE,wBAAwB;AAAW,EAAC;AACpI,SAASC,SAAS,QAAQ,+BAA+B;IAAE,wBAAwB;AAAsB,EAAC;AAW1G,yEAAyE;AACzE,UAAU;AACV,cAAc;AACd,eAAe;AAEf,SAASC,IAAI,EAAEC,KAAK,GAAE;AAEtB,SAASC,WAAWC,WAAW,QAAQ,+BAA+B;IAAE,wBAAwB;AAAsB,EAAC;AAMvH,8BAA8B;AAC9B,iCAAiC;AAEjC,OAAO,MAAMC,eAAe;IAC1BC,SAASC;IACTC,WAAWC;AACb,EAAC;AAED,cAAc,0CAA0C;IAAE,wBAAwB;AAAsB,EAAC;AAEzG,4DAA4D;AAC5D,OAAO,MAAMC,cAAc,IAAIX,mBAAmB;IAChDY,YAAY;QACVC,MAAMZ,UAAUa,QAAQ;QACxBC,MAAM;QACNC,UAAU;QACV,2CAA2C;QAC3CC,YAAY;QACZC,UAAU;QACVC,UAAU,EAAE;IACd;IACAC,UAAU;QACRC,YAAYnB;IACd;AACF,GAAE"}

View File

@@ -0,0 +1,32 @@
import { AppRouteRouteModule } from '../../server/route-modules/app-route/module.compiled';
import { RouteKind } from '../../server/route-kind';
import { patchFetch as _patchFetch } from '../../server/lib/patch-fetch';
import * as userland from 'VAR_USERLAND';
// We inject the nextConfigOutput here so that we can use them in the route
// module.
// INJECT:nextConfigOutput
const routeModule = new AppRouteRouteModule({
definition: {
kind: RouteKind.APP_ROUTE,
page: 'VAR_DEFINITION_PAGE',
pathname: 'VAR_DEFINITION_PATHNAME',
filename: 'VAR_DEFINITION_FILENAME',
bundlePath: 'VAR_DEFINITION_BUNDLE_PATH'
},
resolvedPagePath: 'VAR_RESOLVED_PAGE_PATH',
nextConfigOutput,
userland
});
// Pull out the exports that we need to expose from the module. This should
// be eliminated when we've moved the other routes to the new format. These
// are used to hook into the route.
const { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule;
function patchFetch() {
return _patchFetch({
workAsyncStorage,
workUnitAsyncStorage
});
}
export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };
//# sourceMappingURL=app-route.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/build/templates/app-route.ts"],"sourcesContent":["import {\n AppRouteRouteModule,\n type AppRouteRouteModuleOptions,\n} from '../../server/route-modules/app-route/module.compiled'\nimport { RouteKind } from '../../server/route-kind'\nimport { patchFetch as _patchFetch } from '../../server/lib/patch-fetch'\n\nimport * as userland from 'VAR_USERLAND'\n\n// These are injected by the loader afterwards. This is injected as a variable\n// instead of a replacement because this could also be `undefined` instead of\n// an empty string.\ndeclare const nextConfigOutput: AppRouteRouteModuleOptions['nextConfigOutput']\n\n// We inject the nextConfigOutput here so that we can use them in the route\n// module.\n// INJECT:nextConfigOutput\n\nconst routeModule = new AppRouteRouteModule({\n definition: {\n kind: RouteKind.APP_ROUTE,\n page: 'VAR_DEFINITION_PAGE',\n pathname: 'VAR_DEFINITION_PATHNAME',\n filename: 'VAR_DEFINITION_FILENAME',\n bundlePath: 'VAR_DEFINITION_BUNDLE_PATH',\n },\n resolvedPagePath: 'VAR_RESOLVED_PAGE_PATH',\n nextConfigOutput,\n userland,\n})\n\n// Pull out the exports that we need to expose from the module. This should\n// be eliminated when we've moved the other routes to the new format. These\n// are used to hook into the route.\nconst { workAsyncStorage, workUnitAsyncStorage, serverHooks } = routeModule\n\nfunction patchFetch() {\n return _patchFetch({\n workAsyncStorage,\n workUnitAsyncStorage,\n })\n}\n\nexport {\n routeModule,\n workAsyncStorage,\n workUnitAsyncStorage,\n serverHooks,\n patchFetch,\n}\n"],"names":["AppRouteRouteModule","RouteKind","patchFetch","_patchFetch","userland","routeModule","definition","kind","APP_ROUTE","page","pathname","filename","bundlePath","resolvedPagePath","nextConfigOutput","workAsyncStorage","workUnitAsyncStorage","serverHooks"],"mappings":"AAAA,SACEA,mBAAmB,QAEd,uDAAsD;AAC7D,SAASC,SAAS,QAAQ,0BAAyB;AACnD,SAASC,cAAcC,WAAW,QAAQ,+BAA8B;AAExE,YAAYC,cAAc,eAAc;AAOxC,2EAA2E;AAC3E,UAAU;AACV,0BAA0B;AAE1B,MAAMC,cAAc,IAAIL,oBAAoB;IAC1CM,YAAY;QACVC,MAAMN,UAAUO,SAAS;QACzBC,MAAM;QACNC,UAAU;QACVC,UAAU;QACVC,YAAY;IACd;IACAC,kBAAkB;IAClBC;IACAV;AACF;AAEA,2EAA2E;AAC3E,2EAA2E;AAC3E,mCAAmC;AACnC,MAAM,EAAEW,gBAAgB,EAAEC,oBAAoB,EAAEC,WAAW,EAAE,GAAGZ;AAEhE,SAASH;IACP,OAAOC,YAAY;QACjBY;QACAC;IACF;AACF;AAEA,SACEX,WAAW,EACXU,gBAAgB,EAChBC,oBAAoB,EACpBC,WAAW,EACXf,UAAU,KACX"}

View File

@@ -0,0 +1,26 @@
var _self___RSC_MANIFEST;
import { createServerModuleMap } from '../../server/app-render/action-utils';
import { setReferenceManifestsSingleton } from '../../server/app-render/encryption-utils';
import { EdgeRouteModuleWrapper } from '../../server/web/edge-route-module-wrapper';
// Import the userland code.
import * as module from 'VAR_USERLAND';
// INJECT:nextConfig
const maybeJSONParse = (str)=>str ? JSON.parse(str) : undefined;
const rscManifest = (_self___RSC_MANIFEST = self.__RSC_MANIFEST) == null ? void 0 : _self___RSC_MANIFEST['VAR_PAGE'];
const rscServerManifest = maybeJSONParse(self.__RSC_SERVER_MANIFEST);
if (rscManifest && rscServerManifest) {
setReferenceManifestsSingleton({
page: 'VAR_PAGE',
clientReferenceManifest: rscManifest,
serverActionsManifest: rscServerManifest,
serverModuleMap: createServerModuleMap({
serverActionsManifest: rscServerManifest
})
});
}
export const ComponentMod = module;
export default EdgeRouteModuleWrapper.wrap(module.routeModule, {
nextConfig
});
//# sourceMappingURL=edge-app-route.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/build/templates/edge-app-route.ts"],"sourcesContent":["import { createServerModuleMap } from '../../server/app-render/action-utils'\nimport { setReferenceManifestsSingleton } from '../../server/app-render/encryption-utils'\nimport type { NextConfigComplete } from '../../server/config-shared'\nimport { EdgeRouteModuleWrapper } from '../../server/web/edge-route-module-wrapper'\n\n// Import the userland code.\nimport * as module from 'VAR_USERLAND'\n\n// injected by the loader afterwards.\ndeclare const nextConfig: NextConfigComplete\n// INJECT:nextConfig\n\nconst maybeJSONParse = (str?: string) => (str ? JSON.parse(str) : undefined)\n\nconst rscManifest = self.__RSC_MANIFEST?.['VAR_PAGE']\nconst rscServerManifest = maybeJSONParse(self.__RSC_SERVER_MANIFEST)\n\nif (rscManifest && rscServerManifest) {\n setReferenceManifestsSingleton({\n page: 'VAR_PAGE',\n clientReferenceManifest: rscManifest,\n serverActionsManifest: rscServerManifest,\n serverModuleMap: createServerModuleMap({\n serverActionsManifest: rscServerManifest,\n }),\n })\n}\n\nexport const ComponentMod = module\n\nexport default EdgeRouteModuleWrapper.wrap(module.routeModule, { nextConfig })\n"],"names":["self","createServerModuleMap","setReferenceManifestsSingleton","EdgeRouteModuleWrapper","module","maybeJSONParse","str","JSON","parse","undefined","rscManifest","__RSC_MANIFEST","rscServerManifest","__RSC_SERVER_MANIFEST","page","clientReferenceManifest","serverActionsManifest","serverModuleMap","ComponentMod","wrap","routeModule","nextConfig"],"mappings":"IAcoBA;AAdpB,SAASC,qBAAqB,QAAQ,uCAAsC;AAC5E,SAASC,8BAA8B,QAAQ,2CAA0C;AAEzF,SAASC,sBAAsB,QAAQ,6CAA4C;AAEnF,4BAA4B;AAC5B,YAAYC,YAAY,eAAc;AAItC,oBAAoB;AAEpB,MAAMC,iBAAiB,CAACC,MAAkBA,MAAMC,KAAKC,KAAK,CAACF,OAAOG;AAElE,MAAMC,eAAcV,uBAAAA,KAAKW,cAAc,qBAAnBX,oBAAqB,CAAC,WAAW;AACrD,MAAMY,oBAAoBP,eAAeL,KAAKa,qBAAqB;AAEnE,IAAIH,eAAeE,mBAAmB;IACpCV,+BAA+B;QAC7BY,MAAM;QACNC,yBAAyBL;QACzBM,uBAAuBJ;QACvBK,iBAAiBhB,sBAAsB;YACrCe,uBAAuBJ;QACzB;IACF;AACF;AAEA,OAAO,MAAMM,eAAed,OAAM;AAElC,eAAeD,uBAAuBgB,IAAI,CAACf,OAAOgB,WAAW,EAAE;IAAEC;AAAW,GAAE"}

View File

@@ -0,0 +1,73 @@
var _self___RSC_MANIFEST;
import '../../server/web/globals';
import { adapter } from '../../server/web/adapter';
import { getRender } from '../webpack/loaders/next-edge-ssr-loader/render';
import { IncrementalCache } from '../../server/lib/incremental-cache';
import { renderToHTMLOrFlight as renderToHTML } from '../../server/app-render/app-render';
import * as pageMod from 'VAR_USERLAND';
import { PAGE_TYPES } from '../../lib/page-types';
import { setReferenceManifestsSingleton } from '../../server/app-render/encryption-utils';
import { createServerModuleMap } from '../../server/app-render/action-utils';
import { initializeCacheHandlers } from '../../server/use-cache/handlers';
// OPTIONAL_IMPORT:incrementalCacheHandler
// Initialize the cache handlers interface.
initializeCacheHandlers();
const Document = null;
const appMod = null;
const errorMod = null;
const error500Mod = null;
// INJECT:sriEnabled
// INJECT:isServerComponent
// INJECT:dev
// INJECT:serverActions
// INJECT:nextConfig
const maybeJSONParse = (str)=>str ? JSON.parse(str) : undefined;
const buildManifest = self.__BUILD_MANIFEST;
const reactLoadableManifest = maybeJSONParse(self.__REACT_LOADABLE_MANIFEST);
const rscManifest = (_self___RSC_MANIFEST = self.__RSC_MANIFEST) == null ? void 0 : _self___RSC_MANIFEST['VAR_PAGE'];
const rscServerManifest = maybeJSONParse(self.__RSC_SERVER_MANIFEST);
const subresourceIntegrityManifest = sriEnabled ? maybeJSONParse(self.__SUBRESOURCE_INTEGRITY_MANIFEST) : undefined;
const nextFontManifest = maybeJSONParse(self.__NEXT_FONT_MANIFEST);
const interceptionRouteRewrites = maybeJSONParse(self.__INTERCEPTION_ROUTE_REWRITE_MANIFEST) ?? [];
if (rscManifest && rscServerManifest) {
setReferenceManifestsSingleton({
page: 'VAR_PAGE',
clientReferenceManifest: rscManifest,
serverActionsManifest: rscServerManifest,
serverModuleMap: createServerModuleMap({
serverActionsManifest: rscServerManifest
})
});
}
const render = getRender({
pagesType: PAGE_TYPES.APP,
dev,
page: 'VAR_PAGE',
appMod,
pageMod,
errorMod,
error500Mod,
Document,
buildManifest,
renderToHTML,
reactLoadableManifest,
clientReferenceManifest: isServerComponent ? rscManifest : null,
serverActionsManifest: isServerComponent ? rscServerManifest : null,
serverActions: isServerComponent ? serverActions : undefined,
subresourceIntegrityManifest,
config: nextConfig,
buildId: process.env.__NEXT_BUILD_ID,
nextFontManifest,
incrementalCacheHandler,
interceptionRouteRewrites
});
export const ComponentMod = pageMod;
export default function nHandler(opts) {
return adapter({
...opts,
IncrementalCache,
handler: render
});
}
//# sourceMappingURL=edge-ssr-app.js.map

File diff suppressed because one or more lines are too long

93
node_modules/next/dist/esm/build/templates/edge-ssr.js generated vendored Normal file
View File

@@ -0,0 +1,93 @@
import '../../server/web/globals';
import { adapter } from '../../server/web/adapter';
import { getRender } from '../webpack/loaders/next-edge-ssr-loader/render';
import { IncrementalCache } from '../../server/lib/incremental-cache';
import { initializeCacheHandlers } from '../../server/use-cache/handlers';
import Document from 'VAR_MODULE_DOCUMENT';
import * as appMod from 'VAR_MODULE_APP';
import * as userlandPage from 'VAR_USERLAND';
import * as userlandErrorPage from 'VAR_MODULE_GLOBAL_ERROR';
// OPTIONAL_IMPORT:* as userland500Page
// OPTIONAL_IMPORT:incrementalCacheHandler
// TODO: re-enable this once we've refactored to use implicit matches
// const renderToHTML = undefined
import { renderToHTML } from '../../server/render';
import RouteModule from '../../server/route-modules/pages/module';
// INJECT:pagesType
// INJECT:sriEnabled
// INJECT:dev
// INJECT:nextConfig
// INJECT:pageRouteModuleOptions
// INJECT:errorRouteModuleOptions
// INJECT:user500RouteModuleOptions
// Initialize the cache handlers interface.
initializeCacheHandlers();
const pageMod = {
...userlandPage,
routeModule: new RouteModule({
...pageRouteModuleOptions,
components: {
App: appMod.default,
Document
},
userland: userlandPage
})
};
const errorMod = {
...userlandErrorPage,
routeModule: new RouteModule({
...errorRouteModuleOptions,
components: {
App: appMod.default,
Document
},
userland: userlandErrorPage
})
};
// FIXME: this needs to be made compatible with the template
const error500Mod = userland500Page ? {
...userland500Page,
routeModule: new RouteModule({
...user500RouteModuleOptions,
components: {
App: appMod.default,
Document
},
userland: userland500Page
})
} : null;
const maybeJSONParse = (str)=>str ? JSON.parse(str) : undefined;
const buildManifest = self.__BUILD_MANIFEST;
const reactLoadableManifest = maybeJSONParse(self.__REACT_LOADABLE_MANIFEST);
const dynamicCssManifest = maybeJSONParse(self.__DYNAMIC_CSS_MANIFEST);
const subresourceIntegrityManifest = sriEnabled ? maybeJSONParse(self.__SUBRESOURCE_INTEGRITY_MANIFEST) : undefined;
const nextFontManifest = maybeJSONParse(self.__NEXT_FONT_MANIFEST);
const render = getRender({
pagesType,
dev,
page: 'VAR_PAGE',
appMod,
pageMod,
errorMod,
error500Mod,
Document,
buildManifest,
renderToHTML,
reactLoadableManifest,
dynamicCssManifest,
subresourceIntegrityManifest,
config: nextConfig,
buildId: process.env.__NEXT_BUILD_ID,
nextFontManifest,
incrementalCacheHandler
});
export const ComponentMod = pageMod;
export default function nHandler(opts) {
return adapter({
...opts,
IncrementalCache,
handler: render
});
}
//# sourceMappingURL=edge-ssr.js.map

File diff suppressed because one or more lines are too long

26
node_modules/next/dist/esm/build/templates/helpers.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
/**
* Hoists a name from a module or promised module.
*
* @param module the module to hoist the name from
* @param name the name to hoist
* @returns the value on the module (or promised module)
*/ export function hoist(module, name) {
// If the name is available in the module, return it.
if (name in module) {
return module[name];
}
// If a property called `then` exists, assume it's a promise and
// return a promise that resolves to the name.
if ('then' in module && typeof module.then === 'function') {
return module.then((mod)=>hoist(mod, name));
}
// If we're trying to hoise the default export, and the module is a function,
// return the module itself.
if (typeof module === 'function' && name === 'default') {
return module;
}
// Otherwise, return undefined.
return undefined;
}
//# sourceMappingURL=helpers.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/build/templates/helpers.ts"],"sourcesContent":["/**\n * Hoists a name from a module or promised module.\n *\n * @param module the module to hoist the name from\n * @param name the name to hoist\n * @returns the value on the module (or promised module)\n */\nexport function hoist(module: any, name: string) {\n // If the name is available in the module, return it.\n if (name in module) {\n return module[name]\n }\n\n // If a property called `then` exists, assume it's a promise and\n // return a promise that resolves to the name.\n if ('then' in module && typeof module.then === 'function') {\n return module.then((mod: any) => hoist(mod, name))\n }\n\n // If we're trying to hoise the default export, and the module is a function,\n // return the module itself.\n if (typeof module === 'function' && name === 'default') {\n return module\n }\n\n // Otherwise, return undefined.\n return undefined\n}\n"],"names":["hoist","module","name","then","mod","undefined"],"mappings":"AAAA;;;;;;CAMC,GACD,OAAO,SAASA,MAAMC,MAAW,EAAEC,IAAY;IAC7C,qDAAqD;IACrD,IAAIA,QAAQD,QAAQ;QAClB,OAAOA,MAAM,CAACC,KAAK;IACrB;IAEA,gEAAgE;IAChE,8CAA8C;IAC9C,IAAI,UAAUD,UAAU,OAAOA,OAAOE,IAAI,KAAK,YAAY;QACzD,OAAOF,OAAOE,IAAI,CAAC,CAACC,MAAaJ,MAAMI,KAAKF;IAC9C;IAEA,6EAA6E;IAC7E,4BAA4B;IAC5B,IAAI,OAAOD,WAAW,cAAcC,SAAS,WAAW;QACtD,OAAOD;IACT;IAEA,+BAA+B;IAC/B,OAAOI;AACT"}

View File

@@ -0,0 +1,59 @@
import '../../server/web/globals';
import { adapter } from '../../server/web/adapter';
// Import the userland code.
import * as _mod from 'VAR_USERLAND';
import { edgeInstrumentationOnRequestError } from '../../server/web/globals';
import { isNextRouterError } from '../../client/components/is-next-router-error';
const mod = {
..._mod
};
const handler = mod.middleware || mod.default;
const page = 'VAR_DEFINITION_PAGE';
if (typeof handler !== 'function') {
throw Object.defineProperty(new Error(`The Middleware "${page}" must export a \`middleware\` or a \`default\` function`), "__NEXT_ERROR_CODE", {
value: "E120",
enumerable: false,
configurable: true
});
}
// Middleware will only sent out the FetchEvent to next server,
// so load instrumentation module here and track the error inside middleware module.
function errorHandledHandler(fn) {
return async (...args)=>{
try {
return await fn(...args);
} catch (err) {
// In development, error the navigation API usage in runtime,
// since it's not allowed to be used in middleware as it's outside of react component tree.
if (process.env.NODE_ENV !== 'production') {
if (isNextRouterError(err)) {
err.message = `Next.js navigation API is not allowed to be used in Middleware.`;
throw err;
}
}
const req = args[0];
const url = new URL(req.url);
const resource = url.pathname + url.search;
await edgeInstrumentationOnRequestError(err, {
path: resource,
method: req.method,
headers: Object.fromEntries(req.headers.entries())
}, {
routerKind: 'Pages Router',
routePath: '/middleware',
routeType: 'middleware',
revalidateReason: undefined
});
throw err;
}
};
}
export default function nHandler(opts) {
return adapter({
...opts,
page,
handler: errorHandledHandler(handler)
});
}
//# sourceMappingURL=middleware.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/build/templates/middleware.ts"],"sourcesContent":["import type { AdapterOptions } from '../../server/web/adapter'\n\nimport '../../server/web/globals'\n\nimport { adapter } from '../../server/web/adapter'\n\n// Import the userland code.\nimport * as _mod from 'VAR_USERLAND'\nimport { edgeInstrumentationOnRequestError } from '../../server/web/globals'\nimport { isNextRouterError } from '../../client/components/is-next-router-error'\n\nconst mod = { ..._mod }\nconst handler = mod.middleware || mod.default\n\nconst page = 'VAR_DEFINITION_PAGE'\n\nif (typeof handler !== 'function') {\n throw new Error(\n `The Middleware \"${page}\" must export a \\`middleware\\` or a \\`default\\` function`\n )\n}\n\n// Middleware will only sent out the FetchEvent to next server,\n// so load instrumentation module here and track the error inside middleware module.\nfunction errorHandledHandler(fn: AdapterOptions['handler']) {\n return async (...args: Parameters<AdapterOptions['handler']>) => {\n try {\n return await fn(...args)\n } catch (err) {\n // In development, error the navigation API usage in runtime,\n // since it's not allowed to be used in middleware as it's outside of react component tree.\n if (process.env.NODE_ENV !== 'production') {\n if (isNextRouterError(err)) {\n err.message = `Next.js navigation API is not allowed to be used in Middleware.`\n throw err\n }\n }\n const req = args[0]\n const url = new URL(req.url)\n const resource = url.pathname + url.search\n await edgeInstrumentationOnRequestError(\n err,\n {\n path: resource,\n method: req.method,\n headers: Object.fromEntries(req.headers.entries()),\n },\n {\n routerKind: 'Pages Router',\n routePath: '/middleware',\n routeType: 'middleware',\n revalidateReason: undefined,\n }\n )\n\n throw err\n }\n }\n}\n\nexport default function nHandler(\n opts: Omit<AdapterOptions, 'IncrementalCache' | 'page' | 'handler'>\n) {\n return adapter({\n ...opts,\n page,\n handler: errorHandledHandler(handler),\n })\n}\n"],"names":["adapter","_mod","edgeInstrumentationOnRequestError","isNextRouterError","mod","handler","middleware","default","page","Error","errorHandledHandler","fn","args","err","process","env","NODE_ENV","message","req","url","URL","resource","pathname","search","path","method","headers","Object","fromEntries","entries","routerKind","routePath","routeType","revalidateReason","undefined","nHandler","opts"],"mappings":"AAEA,OAAO,2BAA0B;AAEjC,SAASA,OAAO,QAAQ,2BAA0B;AAElD,4BAA4B;AAC5B,YAAYC,UAAU,eAAc;AACpC,SAASC,iCAAiC,QAAQ,2BAA0B;AAC5E,SAASC,iBAAiB,QAAQ,+CAA8C;AAEhF,MAAMC,MAAM;IAAE,GAAGH,IAAI;AAAC;AACtB,MAAMI,UAAUD,IAAIE,UAAU,IAAIF,IAAIG,OAAO;AAE7C,MAAMC,OAAO;AAEb,IAAI,OAAOH,YAAY,YAAY;IACjC,MAAM,qBAEL,CAFK,IAAII,MACR,CAAC,gBAAgB,EAAED,KAAK,wDAAwD,CAAC,GAD7E,qBAAA;eAAA;oBAAA;sBAAA;IAEN;AACF;AAEA,+DAA+D;AAC/D,oFAAoF;AACpF,SAASE,oBAAoBC,EAA6B;IACxD,OAAO,OAAO,GAAGC;QACf,IAAI;YACF,OAAO,MAAMD,MAAMC;QACrB,EAAE,OAAOC,KAAK;YACZ,6DAA6D;YAC7D,2FAA2F;YAC3F,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;gBACzC,IAAIb,kBAAkBU,MAAM;oBAC1BA,IAAII,OAAO,GAAG,CAAC,+DAA+D,CAAC;oBAC/E,MAAMJ;gBACR;YACF;YACA,MAAMK,MAAMN,IAAI,CAAC,EAAE;YACnB,MAAMO,MAAM,IAAIC,IAAIF,IAAIC,GAAG;YAC3B,MAAME,WAAWF,IAAIG,QAAQ,GAAGH,IAAII,MAAM;YAC1C,MAAMrB,kCACJW,KACA;gBACEW,MAAMH;gBACNI,QAAQP,IAAIO,MAAM;gBAClBC,SAASC,OAAOC,WAAW,CAACV,IAAIQ,OAAO,CAACG,OAAO;YACjD,GACA;gBACEC,YAAY;gBACZC,WAAW;gBACXC,WAAW;gBACXC,kBAAkBC;YACpB;YAGF,MAAMrB;QACR;IACF;AACF;AAEA,eAAe,SAASsB,SACtBC,IAAmE;IAEnE,OAAOpC,QAAQ;QACb,GAAGoC,IAAI;QACP5B;QACAH,SAASK,oBAAoBL;IAC/B;AACF"}

View File

@@ -0,0 +1,23 @@
import { PagesAPIRouteModule } from '../../server/route-modules/pages-api/module.compiled';
import { RouteKind } from '../../server/route-kind';
import { hoist } from './helpers';
// Import the userland code.
import * as userland from 'VAR_USERLAND';
// Re-export the handler (should be the default export).
export default hoist(userland, 'default');
// Re-export config.
export const config = hoist(userland, 'config');
// Create and export the route module that will be consumed.
export const routeModule = new PagesAPIRouteModule({
definition: {
kind: RouteKind.PAGES_API,
page: 'VAR_DEFINITION_PAGE',
pathname: 'VAR_DEFINITION_PATHNAME',
// The following aren't used in production.
bundlePath: '',
filename: ''
},
userland
});
//# sourceMappingURL=pages-api.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/build/templates/pages-api.ts"],"sourcesContent":["import { PagesAPIRouteModule } from '../../server/route-modules/pages-api/module.compiled'\nimport { RouteKind } from '../../server/route-kind'\n\nimport { hoist } from './helpers'\n\n// Import the userland code.\nimport * as userland from 'VAR_USERLAND'\n\n// Re-export the handler (should be the default export).\nexport default hoist(userland, 'default')\n\n// Re-export config.\nexport const config = hoist(userland, 'config')\n\n// Create and export the route module that will be consumed.\nexport const routeModule = new PagesAPIRouteModule({\n definition: {\n kind: RouteKind.PAGES_API,\n page: 'VAR_DEFINITION_PAGE',\n pathname: 'VAR_DEFINITION_PATHNAME',\n // The following aren't used in production.\n bundlePath: '',\n filename: '',\n },\n userland,\n})\n"],"names":["PagesAPIRouteModule","RouteKind","hoist","userland","config","routeModule","definition","kind","PAGES_API","page","pathname","bundlePath","filename"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,uDAAsD;AAC1F,SAASC,SAAS,QAAQ,0BAAyB;AAEnD,SAASC,KAAK,QAAQ,YAAW;AAEjC,4BAA4B;AAC5B,YAAYC,cAAc,eAAc;AAExC,wDAAwD;AACxD,eAAeD,MAAMC,UAAU,WAAU;AAEzC,oBAAoB;AACpB,OAAO,MAAMC,SAASF,MAAMC,UAAU,UAAS;AAE/C,4DAA4D;AAC5D,OAAO,MAAME,cAAc,IAAIL,oBAAoB;IACjDM,YAAY;QACVC,MAAMN,UAAUO,SAAS;QACzBC,MAAM;QACNC,UAAU;QACV,2CAA2C;QAC3CC,YAAY;QACZC,UAAU;IACZ;IACAT;AACF,GAAE"}

View File

@@ -0,0 +1,24 @@
import '../../server/web/globals';
import { adapter } from '../../server/web/adapter';
import { IncrementalCache } from '../../server/lib/incremental-cache';
import { wrapApiHandler } from '../../server/api-utils';
// Import the userland code.
import handler from 'VAR_USERLAND';
const page = 'VAR_DEFINITION_PAGE';
if (typeof handler !== 'function') {
throw Object.defineProperty(new Error(`The Edge Function "pages${page}" must export a \`default\` function`), "__NEXT_ERROR_CODE", {
value: "E162",
enumerable: false,
configurable: true
});
}
export default function(opts) {
return adapter({
...opts,
IncrementalCache,
page: 'VAR_DEFINITION_PATHNAME',
handler: wrapApiHandler(page, handler)
});
}
//# sourceMappingURL=pages-edge-api.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/build/templates/pages-edge-api.ts"],"sourcesContent":["import type { AdapterOptions } from '../../server/web/adapter'\n\nimport '../../server/web/globals'\n\nimport { adapter } from '../../server/web/adapter'\nimport { IncrementalCache } from '../../server/lib/incremental-cache'\nimport { wrapApiHandler } from '../../server/api-utils'\n\n// Import the userland code.\nimport handler from 'VAR_USERLAND'\n\nconst page = 'VAR_DEFINITION_PAGE'\n\nif (typeof handler !== 'function') {\n throw new Error(\n `The Edge Function \"pages${page}\" must export a \\`default\\` function`\n )\n}\n\nexport default function (\n opts: Omit<AdapterOptions, 'IncrementalCache' | 'page' | 'handler'>\n) {\n return adapter({\n ...opts,\n IncrementalCache,\n page: 'VAR_DEFINITION_PATHNAME',\n handler: wrapApiHandler(page, handler),\n })\n}\n"],"names":["adapter","IncrementalCache","wrapApiHandler","handler","page","Error","opts"],"mappings":"AAEA,OAAO,2BAA0B;AAEjC,SAASA,OAAO,QAAQ,2BAA0B;AAClD,SAASC,gBAAgB,QAAQ,qCAAoC;AACrE,SAASC,cAAc,QAAQ,yBAAwB;AAEvD,4BAA4B;AAC5B,OAAOC,aAAa,eAAc;AAElC,MAAMC,OAAO;AAEb,IAAI,OAAOD,YAAY,YAAY;IACjC,MAAM,qBAEL,CAFK,IAAIE,MACR,CAAC,wBAAwB,EAAED,KAAK,oCAAoC,CAAC,GADjE,qBAAA;eAAA;oBAAA;sBAAA;IAEN;AACF;AAEA,eAAe,SACbE,IAAmE;IAEnE,OAAON,QAAQ;QACb,GAAGM,IAAI;QACPL;QACAG,MAAM;QACND,SAASD,eAAeE,MAAMD;IAChC;AACF"}

41
node_modules/next/dist/esm/build/templates/pages.js generated vendored Normal file
View File

@@ -0,0 +1,41 @@
import { PagesRouteModule } from '../../server/route-modules/pages/module.compiled';
import { RouteKind } from '../../server/route-kind';
import { hoist } from './helpers';
// Import the app and document modules.
import * as document from 'VAR_MODULE_DOCUMENT';
import * as app from 'VAR_MODULE_APP';
// Import the userland code.
import * as userland from 'VAR_USERLAND';
// Re-export the component (should be the default export).
export default hoist(userland, 'default');
// Re-export methods.
export const getStaticProps = hoist(userland, 'getStaticProps');
export const getStaticPaths = hoist(userland, 'getStaticPaths');
export const getServerSideProps = hoist(userland, 'getServerSideProps');
export const config = hoist(userland, 'config');
export const reportWebVitals = hoist(userland, 'reportWebVitals');
// Re-export legacy methods.
export const unstable_getStaticProps = hoist(userland, 'unstable_getStaticProps');
export const unstable_getStaticPaths = hoist(userland, 'unstable_getStaticPaths');
export const unstable_getStaticParams = hoist(userland, 'unstable_getStaticParams');
export const unstable_getServerProps = hoist(userland, 'unstable_getServerProps');
export const unstable_getServerSideProps = hoist(userland, 'unstable_getServerSideProps');
// Create and export the route module that will be consumed.
export const routeModule = new PagesRouteModule({
definition: {
kind: RouteKind.PAGES,
page: 'VAR_DEFINITION_PAGE',
pathname: 'VAR_DEFINITION_PATHNAME',
// The following aren't used in production.
bundlePath: '',
filename: ''
},
components: {
// default export might not exist when optimized for data only
App: app.default,
Document: document.default
},
userland
});
//# sourceMappingURL=pages.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/build/templates/pages.ts"],"sourcesContent":["import { PagesRouteModule } from '../../server/route-modules/pages/module.compiled'\nimport { RouteKind } from '../../server/route-kind'\nimport { hoist } from './helpers'\n\n// Import the app and document modules.\nimport * as document from 'VAR_MODULE_DOCUMENT'\nimport * as app from 'VAR_MODULE_APP'\n\n// Import the userland code.\nimport * as userland from 'VAR_USERLAND'\n\n// Re-export the component (should be the default export).\nexport default hoist(userland, 'default')\n\n// Re-export methods.\nexport const getStaticProps = hoist(userland, 'getStaticProps')\nexport const getStaticPaths = hoist(userland, 'getStaticPaths')\nexport const getServerSideProps = hoist(userland, 'getServerSideProps')\nexport const config = hoist(userland, 'config')\nexport const reportWebVitals = hoist(userland, 'reportWebVitals')\n\n// Re-export legacy methods.\nexport const unstable_getStaticProps = hoist(\n userland,\n 'unstable_getStaticProps'\n)\nexport const unstable_getStaticPaths = hoist(\n userland,\n 'unstable_getStaticPaths'\n)\nexport const unstable_getStaticParams = hoist(\n userland,\n 'unstable_getStaticParams'\n)\nexport const unstable_getServerProps = hoist(\n userland,\n 'unstable_getServerProps'\n)\nexport const unstable_getServerSideProps = hoist(\n userland,\n 'unstable_getServerSideProps'\n)\n\n// Create and export the route module that will be consumed.\nexport const routeModule = new PagesRouteModule({\n definition: {\n kind: RouteKind.PAGES,\n page: 'VAR_DEFINITION_PAGE',\n pathname: 'VAR_DEFINITION_PATHNAME',\n // The following aren't used in production.\n bundlePath: '',\n filename: '',\n },\n components: {\n // default export might not exist when optimized for data only\n App: app.default,\n Document: document.default,\n },\n userland,\n})\n"],"names":["PagesRouteModule","RouteKind","hoist","document","app","userland","getStaticProps","getStaticPaths","getServerSideProps","config","reportWebVitals","unstable_getStaticProps","unstable_getStaticPaths","unstable_getStaticParams","unstable_getServerProps","unstable_getServerSideProps","routeModule","definition","kind","PAGES","page","pathname","bundlePath","filename","components","App","default","Document"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,mDAAkD;AACnF,SAASC,SAAS,QAAQ,0BAAyB;AACnD,SAASC,KAAK,QAAQ,YAAW;AAEjC,uCAAuC;AACvC,YAAYC,cAAc,sBAAqB;AAC/C,YAAYC,SAAS,iBAAgB;AAErC,4BAA4B;AAC5B,YAAYC,cAAc,eAAc;AAExC,0DAA0D;AAC1D,eAAeH,MAAMG,UAAU,WAAU;AAEzC,qBAAqB;AACrB,OAAO,MAAMC,iBAAiBJ,MAAMG,UAAU,kBAAiB;AAC/D,OAAO,MAAME,iBAAiBL,MAAMG,UAAU,kBAAiB;AAC/D,OAAO,MAAMG,qBAAqBN,MAAMG,UAAU,sBAAqB;AACvE,OAAO,MAAMI,SAASP,MAAMG,UAAU,UAAS;AAC/C,OAAO,MAAMK,kBAAkBR,MAAMG,UAAU,mBAAkB;AAEjE,4BAA4B;AAC5B,OAAO,MAAMM,0BAA0BT,MACrCG,UACA,2BACD;AACD,OAAO,MAAMO,0BAA0BV,MACrCG,UACA,2BACD;AACD,OAAO,MAAMQ,2BAA2BX,MACtCG,UACA,4BACD;AACD,OAAO,MAAMS,0BAA0BZ,MACrCG,UACA,2BACD;AACD,OAAO,MAAMU,8BAA8Bb,MACzCG,UACA,+BACD;AAED,4DAA4D;AAC5D,OAAO,MAAMW,cAAc,IAAIhB,iBAAiB;IAC9CiB,YAAY;QACVC,MAAMjB,UAAUkB,KAAK;QACrBC,MAAM;QACNC,UAAU;QACV,2CAA2C;QAC3CC,YAAY;QACZC,UAAU;IACZ;IACAC,YAAY;QACV,8DAA8D;QAC9DC,KAAKrB,IAAIsB,OAAO;QAChBC,UAAUxB,SAASuB,OAAO;IAC5B;IACArB;AACF,GAAE"}