feat(blog): add file-based blog with dynamic slugs, MDX content and layout shell
- Introduced blog routing using Next.js App Router - Implemented dynamic [slug] pages for blog posts - Added MDX-based content loading via lib/posts - Integrated shared TopBar layout with navigation - Established clear content, lib and component separation
This commit is contained in:
13
apps/public-web/node_modules/next/dist/build/templates/app-page.d.ts
generated
vendored
Normal file
13
apps/public-web/node_modules/next/dist/build/templates/app-page.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { IncomingMessage, ServerResponse } from 'node:http';
|
||||
import { AppPageRouteModule } from '../../server/route-modules/app-page/module.compiled';
|
||||
import GlobalError from 'VAR_MODULE_GLOBAL_ERROR';
|
||||
export { GlobalError };
|
||||
export declare const __next_app__: {
|
||||
require: (id: string | number) => unknown;
|
||||
loadChunk: (id: string | number) => Promise<unknown>;
|
||||
};
|
||||
export * from '../../server/app-render/entry-base';
|
||||
export declare const routeModule: AppPageRouteModule;
|
||||
export declare function handler(req: IncomingMessage, res: ServerResponse, ctx: {
|
||||
waitUntil: (prom: Promise<void>) => void;
|
||||
}): Promise<void | null>;
|
||||
1071
apps/public-web/node_modules/next/dist/build/templates/app-page.js
generated
vendored
Normal file
1071
apps/public-web/node_modules/next/dist/build/templates/app-page.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
apps/public-web/node_modules/next/dist/build/templates/app-page.js.map
generated
vendored
Normal file
1
apps/public-web/node_modules/next/dist/build/templates/app-page.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
9
apps/public-web/node_modules/next/dist/build/templates/app-route.d.ts
generated
vendored
Normal file
9
apps/public-web/node_modules/next/dist/build/templates/app-route.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { AppRouteRouteModule } from '../../server/route-modules/app-route/module.compiled';
|
||||
import type { IncomingMessage, ServerResponse } from 'node:http';
|
||||
declare const routeModule: AppRouteRouteModule;
|
||||
declare const workAsyncStorage: import("../../server/app-render/work-async-storage.external").WorkAsyncStorage, workUnitAsyncStorage: import("../../server/app-render/work-unit-async-storage.external").WorkUnitAsyncStorage, serverHooks: typeof import("../../client/components/hooks-server-context");
|
||||
declare function patchFetch(): void;
|
||||
export { routeModule, workAsyncStorage, workUnitAsyncStorage, serverHooks, patchFetch, };
|
||||
export declare function handler(req: IncomingMessage, res: ServerResponse, ctx: {
|
||||
waitUntil: (prom: Promise<void>) => void;
|
||||
}): Promise<null | undefined>;
|
||||
420
apps/public-web/node_modules/next/dist/build/templates/app-route.js
generated
vendored
Normal file
420
apps/public-web/node_modules/next/dist/build/templates/app-route.js
generated
vendored
Normal file
@@ -0,0 +1,420 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
handler: null,
|
||||
patchFetch: null,
|
||||
routeModule: null,
|
||||
serverHooks: null,
|
||||
workAsyncStorage: null,
|
||||
workUnitAsyncStorage: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
handler: function() {
|
||||
return handler;
|
||||
},
|
||||
patchFetch: function() {
|
||||
return patchFetch;
|
||||
},
|
||||
routeModule: function() {
|
||||
return routeModule;
|
||||
},
|
||||
serverHooks: function() {
|
||||
return serverHooks;
|
||||
},
|
||||
workAsyncStorage: function() {
|
||||
return workAsyncStorage;
|
||||
},
|
||||
workUnitAsyncStorage: function() {
|
||||
return workUnitAsyncStorage;
|
||||
}
|
||||
});
|
||||
const _modulecompiled = require("../../server/route-modules/app-route/module.compiled");
|
||||
const _routekind = require("../../server/route-kind");
|
||||
const _patchfetch = require("../../server/lib/patch-fetch");
|
||||
const _requestmeta = require("../../server/request-meta");
|
||||
const _tracer = require("../../server/lib/trace/tracer");
|
||||
const _manifestssingleton = require("../../server/app-render/manifests-singleton");
|
||||
const _apppaths = require("../../shared/lib/router/utils/app-paths");
|
||||
const _node = require("../../server/base-http/node");
|
||||
const _nextrequest = require("../../server/web/spec-extension/adapters/next-request");
|
||||
const _constants = require("../../server/lib/trace/constants");
|
||||
const _utils = require("../../server/instrumentation/utils");
|
||||
const _sendresponse = require("../../server/send-response");
|
||||
const _utils1 = require("../../server/web/utils");
|
||||
const _cachecontrol = require("../../server/lib/cache-control");
|
||||
const _constants1 = require("../../lib/constants");
|
||||
const _nofallbackerrorexternal = require("../../shared/lib/no-fallback-error.external");
|
||||
const _responsecache = require("../../server/response-cache");
|
||||
const _VAR_USERLAND = /*#__PURE__*/ _interop_require_wildcard(require("VAR_USERLAND"));
|
||||
function _getRequireWildcardCache(nodeInterop) {
|
||||
if (typeof WeakMap !== "function") return null;
|
||||
var cacheBabelInterop = new WeakMap();
|
||||
var cacheNodeInterop = new WeakMap();
|
||||
return (_getRequireWildcardCache = function(nodeInterop) {
|
||||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
||||
})(nodeInterop);
|
||||
}
|
||||
function _interop_require_wildcard(obj, nodeInterop) {
|
||||
if (!nodeInterop && obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
||||
return {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var cache = _getRequireWildcardCache(nodeInterop);
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {
|
||||
__proto__: null
|
||||
};
|
||||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for(var key in obj){
|
||||
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
// We inject the nextConfigOutput here so that we can use them in the route
|
||||
// module.
|
||||
// INJECT:nextConfigOutput
|
||||
const routeModule = new _modulecompiled.AppRouteRouteModule({
|
||||
definition: {
|
||||
kind: _routekind.RouteKind.APP_ROUTE,
|
||||
page: 'VAR_DEFINITION_PAGE',
|
||||
pathname: 'VAR_DEFINITION_PATHNAME',
|
||||
filename: 'VAR_DEFINITION_FILENAME',
|
||||
bundlePath: 'VAR_DEFINITION_BUNDLE_PATH'
|
||||
},
|
||||
distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',
|
||||
relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',
|
||||
resolvedPagePath: 'VAR_RESOLVED_PAGE_PATH',
|
||||
nextConfigOutput,
|
||||
userland: _VAR_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 (0, _patchfetch.patchFetch)({
|
||||
workAsyncStorage,
|
||||
workUnitAsyncStorage
|
||||
});
|
||||
}
|
||||
async function handler(req, res, ctx) {
|
||||
if (routeModule.isDev) {
|
||||
(0, _requestmeta.addRequestMeta)(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());
|
||||
}
|
||||
let srcPage = 'VAR_DEFINITION_PAGE';
|
||||
// turbopack doesn't normalize `/index` in the page name
|
||||
// so we need to to process dynamic routes properly
|
||||
// TODO: fix turbopack providing differing value from webpack
|
||||
if (process.env.TURBOPACK) {
|
||||
srcPage = srcPage.replace(/\/index$/, '') || '/';
|
||||
} else if (srcPage === '/index') {
|
||||
// we always normalize /index specifically
|
||||
srcPage = '/';
|
||||
}
|
||||
const multiZoneDraftMode = process.env.__NEXT_MULTI_ZONE_DRAFT_MODE;
|
||||
const prepareResult = await routeModule.prepare(req, res, {
|
||||
srcPage,
|
||||
multiZoneDraftMode
|
||||
});
|
||||
if (!prepareResult) {
|
||||
res.statusCode = 400;
|
||||
res.end('Bad Request');
|
||||
ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());
|
||||
return null;
|
||||
}
|
||||
const { buildId, params, nextConfig, parsedUrl, isDraftMode, prerenderManifest, routerServerContext, isOnDemandRevalidate, revalidateOnlyGenerated, resolvedPathname, clientReferenceManifest, serverActionsManifest } = prepareResult;
|
||||
const normalizedSrcPage = (0, _apppaths.normalizeAppPath)(srcPage);
|
||||
let isIsr = Boolean(prerenderManifest.dynamicRoutes[normalizedSrcPage] || prerenderManifest.routes[resolvedPathname]);
|
||||
const render404 = async ()=>{
|
||||
// TODO: should route-module itself handle rendering the 404
|
||||
if (routerServerContext == null ? void 0 : routerServerContext.render404) {
|
||||
await routerServerContext.render404(req, res, parsedUrl, false);
|
||||
} else {
|
||||
res.end('This page could not be found');
|
||||
}
|
||||
return null;
|
||||
};
|
||||
if (isIsr && !isDraftMode) {
|
||||
const isPrerendered = Boolean(prerenderManifest.routes[resolvedPathname]);
|
||||
const prerenderInfo = prerenderManifest.dynamicRoutes[normalizedSrcPage];
|
||||
if (prerenderInfo) {
|
||||
if (prerenderInfo.fallback === false && !isPrerendered) {
|
||||
if (nextConfig.experimental.adapterPath) {
|
||||
return await render404();
|
||||
}
|
||||
throw new _nofallbackerrorexternal.NoFallbackError();
|
||||
}
|
||||
}
|
||||
}
|
||||
let cacheKey = null;
|
||||
if (isIsr && !routeModule.isDev && !isDraftMode) {
|
||||
cacheKey = resolvedPathname;
|
||||
// ensure /index and / is normalized to one key
|
||||
cacheKey = cacheKey === '/index' ? '/' : cacheKey;
|
||||
}
|
||||
const supportsDynamicResponse = // If we're in development, we always support dynamic HTML
|
||||
routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports
|
||||
// dynamic HTML.
|
||||
!isIsr;
|
||||
// This is a revalidation request if the request is for a static
|
||||
// page and it is not being resumed from a postponed render and
|
||||
// it is not a dynamic RSC request then it is a revalidation
|
||||
// request.
|
||||
const isStaticGeneration = isIsr && !supportsDynamicResponse;
|
||||
// Before rendering (which initializes component tree modules), we have to
|
||||
// set the reference manifests to our global store so Server Action's
|
||||
// encryption util can access to them at the top level of the page module.
|
||||
if (serverActionsManifest && clientReferenceManifest) {
|
||||
(0, _manifestssingleton.setManifestsSingleton)({
|
||||
page: srcPage,
|
||||
clientReferenceManifest,
|
||||
serverActionsManifest
|
||||
});
|
||||
}
|
||||
const method = req.method || 'GET';
|
||||
const tracer = (0, _tracer.getTracer)();
|
||||
const activeSpan = tracer.getActiveScopeSpan();
|
||||
const context = {
|
||||
params,
|
||||
prerenderManifest,
|
||||
renderOpts: {
|
||||
experimental: {
|
||||
authInterrupts: Boolean(nextConfig.experimental.authInterrupts)
|
||||
},
|
||||
cacheComponents: Boolean(nextConfig.cacheComponents),
|
||||
supportsDynamicResponse,
|
||||
incrementalCache: (0, _requestmeta.getRequestMeta)(req, 'incrementalCache'),
|
||||
cacheLifeProfiles: nextConfig.cacheLife,
|
||||
waitUntil: ctx.waitUntil,
|
||||
onClose: (cb)=>{
|
||||
res.on('close', cb);
|
||||
},
|
||||
onAfterTaskError: undefined,
|
||||
onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>routeModule.onRequestError(req, error, errorContext, silenceLog, routerServerContext)
|
||||
},
|
||||
sharedContext: {
|
||||
buildId
|
||||
}
|
||||
};
|
||||
const nodeNextReq = new _node.NodeNextRequest(req);
|
||||
const nodeNextRes = new _node.NodeNextResponse(res);
|
||||
const nextReq = _nextrequest.NextRequestAdapter.fromNodeNextRequest(nodeNextReq, (0, _nextrequest.signalFromNodeResponse)(res));
|
||||
try {
|
||||
const invokeRouteModule = async (span)=>{
|
||||
return routeModule.handle(nextReq, context).finally(()=>{
|
||||
if (!span) return;
|
||||
span.setAttributes({
|
||||
'http.status_code': res.statusCode,
|
||||
'next.rsc': false
|
||||
});
|
||||
const rootSpanAttributes = tracer.getRootSpanAttributes();
|
||||
// We were unable to get attributes, probably OTEL is not enabled
|
||||
if (!rootSpanAttributes) {
|
||||
return;
|
||||
}
|
||||
if (rootSpanAttributes.get('next.span_type') !== _constants.BaseServerSpan.handleRequest) {
|
||||
console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
|
||||
return;
|
||||
}
|
||||
const route = rootSpanAttributes.get('next.route');
|
||||
if (route) {
|
||||
const name = `${method} ${route}`;
|
||||
span.setAttributes({
|
||||
'next.route': route,
|
||||
'http.route': route,
|
||||
'next.span_name': name
|
||||
});
|
||||
span.updateName(name);
|
||||
} else {
|
||||
span.updateName(`${method} ${srcPage}`);
|
||||
}
|
||||
});
|
||||
};
|
||||
const isMinimalMode = Boolean(process.env.MINIMAL_MODE || (0, _requestmeta.getRequestMeta)(req, 'minimalMode'));
|
||||
const handleResponse = async (currentSpan)=>{
|
||||
var _cacheEntry_value;
|
||||
const responseGenerator = async ({ previousCacheEntry })=>{
|
||||
try {
|
||||
if (!isMinimalMode && isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry) {
|
||||
res.statusCode = 404;
|
||||
// on-demand revalidate always sets this header
|
||||
res.setHeader('x-nextjs-cache', 'REVALIDATED');
|
||||
res.end('This page could not be found');
|
||||
return null;
|
||||
}
|
||||
const response = await invokeRouteModule(currentSpan);
|
||||
req.fetchMetrics = context.renderOpts.fetchMetrics;
|
||||
let pendingWaitUntil = context.renderOpts.pendingWaitUntil;
|
||||
// Attempt using provided waitUntil if available
|
||||
// if it's not we fallback to sendResponse's handling
|
||||
if (pendingWaitUntil) {
|
||||
if (ctx.waitUntil) {
|
||||
ctx.waitUntil(pendingWaitUntil);
|
||||
pendingWaitUntil = undefined;
|
||||
}
|
||||
}
|
||||
const cacheTags = context.renderOpts.collectedTags;
|
||||
// If the request is for a static response, we can cache it so long
|
||||
// as it's not edge.
|
||||
if (isIsr) {
|
||||
const blob = await response.blob();
|
||||
// Copy the headers from the response.
|
||||
const headers = (0, _utils1.toNodeOutgoingHttpHeaders)(response.headers);
|
||||
if (cacheTags) {
|
||||
headers[_constants1.NEXT_CACHE_TAGS_HEADER] = cacheTags;
|
||||
}
|
||||
if (!headers['content-type'] && blob.type) {
|
||||
headers['content-type'] = blob.type;
|
||||
}
|
||||
const revalidate = typeof context.renderOpts.collectedRevalidate === 'undefined' || context.renderOpts.collectedRevalidate >= _constants1.INFINITE_CACHE ? false : context.renderOpts.collectedRevalidate;
|
||||
const expire = typeof context.renderOpts.collectedExpire === 'undefined' || context.renderOpts.collectedExpire >= _constants1.INFINITE_CACHE ? undefined : context.renderOpts.collectedExpire;
|
||||
// Create the cache entry for the response.
|
||||
const cacheEntry = {
|
||||
value: {
|
||||
kind: _responsecache.CachedRouteKind.APP_ROUTE,
|
||||
status: response.status,
|
||||
body: Buffer.from(await blob.arrayBuffer()),
|
||||
headers
|
||||
},
|
||||
cacheControl: {
|
||||
revalidate,
|
||||
expire
|
||||
}
|
||||
};
|
||||
return cacheEntry;
|
||||
} else {
|
||||
// send response without caching if not ISR
|
||||
await (0, _sendresponse.sendResponse)(nodeNextReq, nodeNextRes, response, context.renderOpts.pendingWaitUntil);
|
||||
return null;
|
||||
}
|
||||
} catch (err) {
|
||||
// if this is a background revalidate we need to report
|
||||
// the request error here as it won't be bubbled
|
||||
if (previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) {
|
||||
const silenceLog = false;
|
||||
await routeModule.onRequestError(req, err, {
|
||||
routerKind: 'App Router',
|
||||
routePath: srcPage,
|
||||
routeType: 'route',
|
||||
revalidateReason: (0, _utils.getRevalidateReason)({
|
||||
isStaticGeneration,
|
||||
isOnDemandRevalidate
|
||||
})
|
||||
}, silenceLog, routerServerContext);
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
const cacheEntry = await routeModule.handleResponse({
|
||||
req,
|
||||
nextConfig,
|
||||
cacheKey,
|
||||
routeKind: _routekind.RouteKind.APP_ROUTE,
|
||||
isFallback: false,
|
||||
prerenderManifest,
|
||||
isRoutePPREnabled: false,
|
||||
isOnDemandRevalidate,
|
||||
revalidateOnlyGenerated,
|
||||
responseGenerator,
|
||||
waitUntil: ctx.waitUntil,
|
||||
isMinimalMode
|
||||
});
|
||||
// we don't create a cacheEntry for ISR
|
||||
if (!isIsr) {
|
||||
return null;
|
||||
}
|
||||
if ((cacheEntry == null ? void 0 : (_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== _responsecache.CachedRouteKind.APP_ROUTE) {
|
||||
var _cacheEntry_value1;
|
||||
throw Object.defineProperty(new Error(`Invariant: app-route received invalid cache entry ${cacheEntry == null ? void 0 : (_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", {
|
||||
value: "E701",
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
if (!isMinimalMode) {
|
||||
res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
|
||||
}
|
||||
// Draft mode should never be cached
|
||||
if (isDraftMode) {
|
||||
res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
|
||||
}
|
||||
const headers = (0, _utils1.fromNodeOutgoingHttpHeaders)(cacheEntry.value.headers);
|
||||
if (!(isMinimalMode && isIsr)) {
|
||||
headers.delete(_constants1.NEXT_CACHE_TAGS_HEADER);
|
||||
}
|
||||
// If cache control is already set on the response we don't
|
||||
// override it to allow users to customize it via next.config
|
||||
if (cacheEntry.cacheControl && !res.getHeader('Cache-Control') && !headers.get('Cache-Control')) {
|
||||
headers.set('Cache-Control', (0, _cachecontrol.getCacheControlHeader)(cacheEntry.cacheControl));
|
||||
}
|
||||
await (0, _sendresponse.sendResponse)(nodeNextReq, nodeNextRes, // @ts-expect-error - Argument of type 'Buffer<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.
|
||||
new Response(cacheEntry.value.body, {
|
||||
headers,
|
||||
status: cacheEntry.value.status || 200
|
||||
}));
|
||||
return null;
|
||||
};
|
||||
// TODO: activeSpan code path is for when wrapped by
|
||||
// next-server can be removed when this is no longer used
|
||||
if (activeSpan) {
|
||||
await handleResponse(activeSpan);
|
||||
} else {
|
||||
await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(_constants.BaseServerSpan.handleRequest, {
|
||||
spanName: `${method} ${srcPage}`,
|
||||
kind: _tracer.SpanKind.SERVER,
|
||||
attributes: {
|
||||
'http.method': method,
|
||||
'http.target': req.url
|
||||
}
|
||||
}, handleResponse));
|
||||
}
|
||||
} catch (err) {
|
||||
if (!(err instanceof _nofallbackerrorexternal.NoFallbackError)) {
|
||||
const silenceLog = false;
|
||||
await routeModule.onRequestError(req, err, {
|
||||
routerKind: 'App Router',
|
||||
routePath: normalizedSrcPage,
|
||||
routeType: 'route',
|
||||
revalidateReason: (0, _utils.getRevalidateReason)({
|
||||
isStaticGeneration,
|
||||
isOnDemandRevalidate
|
||||
})
|
||||
}, silenceLog, routerServerContext);
|
||||
}
|
||||
// rethrow so that we can handle serving error page
|
||||
// If this is during static generation, throw the error again.
|
||||
if (isIsr) throw err;
|
||||
// Otherwise, send a 500 response.
|
||||
await (0, _sendresponse.sendResponse)(nodeNextReq, nodeNextRes, new Response(null, {
|
||||
status: 500
|
||||
}));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-route.js.map
|
||||
1
apps/public-web/node_modules/next/dist/build/templates/app-route.js.map
generated
vendored
Normal file
1
apps/public-web/node_modules/next/dist/build/templates/app-route.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
4
apps/public-web/node_modules/next/dist/build/templates/edge-app-route.d.ts
generated
vendored
Normal file
4
apps/public-web/node_modules/next/dist/build/templates/edge-app-route.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import type { EdgeHandler } from '../../server/web/adapter';
|
||||
export declare const ComponentMod: any;
|
||||
declare const handler: EdgeHandler;
|
||||
export default handler;
|
||||
85
apps/public-web/node_modules/next/dist/build/templates/edge-app-route.js
generated
vendored
Normal file
85
apps/public-web/node_modules/next/dist/build/templates/edge-app-route.js
generated
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
ComponentMod: null,
|
||||
default: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
ComponentMod: function() {
|
||||
return ComponentMod;
|
||||
},
|
||||
default: function() {
|
||||
return _default;
|
||||
}
|
||||
});
|
||||
const _manifestssingleton = require("../../server/app-render/manifests-singleton");
|
||||
const _edgeroutemodulewrapper = require("../../server/web/edge-route-module-wrapper");
|
||||
const _VAR_USERLAND = /*#__PURE__*/ _interop_require_wildcard(require("VAR_USERLAND"));
|
||||
function _getRequireWildcardCache(nodeInterop) {
|
||||
if (typeof WeakMap !== "function") return null;
|
||||
var cacheBabelInterop = new WeakMap();
|
||||
var cacheNodeInterop = new WeakMap();
|
||||
return (_getRequireWildcardCache = function(nodeInterop) {
|
||||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
||||
})(nodeInterop);
|
||||
}
|
||||
function _interop_require_wildcard(obj, nodeInterop) {
|
||||
if (!nodeInterop && obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
||||
return {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var cache = _getRequireWildcardCache(nodeInterop);
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {
|
||||
__proto__: null
|
||||
};
|
||||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for(var key in obj){
|
||||
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
var _self___RSC_MANIFEST;
|
||||
// injected by the loader afterwards.
|
||||
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) {
|
||||
(0, _manifestssingleton.setManifestsSingleton)({
|
||||
page: 'VAR_PAGE',
|
||||
clientReferenceManifest: rscManifest,
|
||||
serverActionsManifest: rscServerManifest
|
||||
});
|
||||
}
|
||||
const ComponentMod = _VAR_USERLAND;
|
||||
const handler = _edgeroutemodulewrapper.EdgeRouteModuleWrapper.wrap(_VAR_USERLAND.routeModule, {
|
||||
page: 'VAR_PAGE'
|
||||
});
|
||||
const _default = handler;
|
||||
|
||||
//# sourceMappingURL=edge-app-route.js.map
|
||||
1
apps/public-web/node_modules/next/dist/build/templates/edge-app-route.js.map
generated
vendored
Normal file
1
apps/public-web/node_modules/next/dist/build/templates/edge-app-route.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/build/templates/edge-app-route.ts"],"sourcesContent":["import { setManifestsSingleton } from '../../server/app-render/manifests-singleton'\nimport type { EdgeHandler } from '../../server/web/adapter'\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.\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 setManifestsSingleton({\n page: 'VAR_PAGE',\n clientReferenceManifest: rscManifest,\n serverActionsManifest: rscServerManifest,\n })\n}\n\nexport const ComponentMod = module\n\nconst handler: EdgeHandler = EdgeRouteModuleWrapper.wrap(module.routeModule, {\n page: 'VAR_PAGE',\n})\nexport default handler\n"],"names":["ComponentMod","self","maybeJSONParse","str","JSON","parse","undefined","rscManifest","__RSC_MANIFEST","rscServerManifest","__RSC_SERVER_MANIFEST","setManifestsSingleton","page","clientReferenceManifest","serverActionsManifest","module","handler","EdgeRouteModuleWrapper","wrap","routeModule"],"mappings":";;;;;;;;;;;;;;;IAsBaA,YAAY;eAAZA;;IAKb,OAAsB;eAAtB;;;oCA3BsC;wCAEC;sEAGf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAMJC;AAJpB,qCAAqC;AAErC,MAAMC,iBAAiB,CAACC,MAAkBA,MAAMC,KAAKC,KAAK,CAACF,OAAOG;AAElE,MAAMC,eAAcN,uBAAAA,KAAKO,cAAc,qBAAnBP,oBAAqB,CAAC,WAAW;AACrD,MAAMQ,oBAAoBP,eAAeD,KAAKS,qBAAqB;AAEnE,IAAIH,eAAeE,mBAAmB;IACpCE,IAAAA,yCAAqB,EAAC;QACpBC,MAAM;QACNC,yBAAyBN;QACzBO,uBAAuBL;IACzB;AACF;AAEO,MAAMT,eAAee;AAE5B,MAAMC,UAAuBC,8CAAsB,CAACC,IAAI,CAACH,cAAOI,WAAW,EAAE;IAC3EP,MAAM;AACR;MACA,WAAeI","ignoreList":[0]}
|
||||
5
apps/public-web/node_modules/next/dist/build/templates/edge-ssr-app.d.ts
generated
vendored
Normal file
5
apps/public-web/node_modules/next/dist/build/templates/edge-ssr-app.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import '../../server/web/globals';
|
||||
import { type EdgeHandler } from '../../server/web/adapter';
|
||||
export declare const ComponentMod: any;
|
||||
declare const handler: EdgeHandler;
|
||||
export default handler;
|
||||
309
apps/public-web/node_modules/next/dist/build/templates/edge-ssr-app.js
generated
vendored
Normal file
309
apps/public-web/node_modules/next/dist/build/templates/edge-ssr-app.js
generated
vendored
Normal file
@@ -0,0 +1,309 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
ComponentMod: null,
|
||||
default: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
ComponentMod: function() {
|
||||
return ComponentMod;
|
||||
},
|
||||
default: function() {
|
||||
return _default;
|
||||
}
|
||||
});
|
||||
require("../../server/web/globals");
|
||||
const _adapter = require("../../server/web/adapter");
|
||||
const _incrementalcache = require("../../server/lib/incremental-cache");
|
||||
const _VAR_USERLAND = /*#__PURE__*/ _interop_require_wildcard(require("VAR_USERLAND"));
|
||||
const _manifestssingleton = require("../../server/app-render/manifests-singleton");
|
||||
const _handlers = require("../../server/use-cache/handlers");
|
||||
const _constants = require("../../server/lib/trace/constants");
|
||||
const _tracer = require("../../server/lib/trace/tracer");
|
||||
const _web = require("../../server/base-http/web");
|
||||
const _serveractionrequestmeta = require("../../server/lib/server-action-request-meta");
|
||||
const _isbot = require("../../shared/lib/router/utils/is-bot");
|
||||
const _interopdefault = require("../../lib/interop-default");
|
||||
const _apppaths = require("../../shared/lib/router/utils/app-paths");
|
||||
const _apiutils = require("../../server/api-utils");
|
||||
const _webonclose = require("../../server/web/web-on-close");
|
||||
function _getRequireWildcardCache(nodeInterop) {
|
||||
if (typeof WeakMap !== "function") return null;
|
||||
var cacheBabelInterop = new WeakMap();
|
||||
var cacheNodeInterop = new WeakMap();
|
||||
return (_getRequireWildcardCache = function(nodeInterop) {
|
||||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
||||
})(nodeInterop);
|
||||
}
|
||||
function _interop_require_wildcard(obj, nodeInterop) {
|
||||
if (!nodeInterop && obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
||||
return {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var cache = _getRequireWildcardCache(nodeInterop);
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {
|
||||
__proto__: null
|
||||
};
|
||||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for(var key in obj){
|
||||
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
var _self___RSC_MANIFEST;
|
||||
// OPTIONAL_IMPORT:incrementalCacheHandler
|
||||
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) {
|
||||
(0, _manifestssingleton.setManifestsSingleton)({
|
||||
page: 'VAR_PAGE',
|
||||
clientReferenceManifest: rscManifest,
|
||||
serverActionsManifest: rscServerManifest
|
||||
});
|
||||
}
|
||||
const ComponentMod = _VAR_USERLAND;
|
||||
async function requestHandler(req, event) {
|
||||
let srcPage = 'VAR_PAGE';
|
||||
const normalizedSrcPage = (0, _apppaths.normalizeAppPath)(srcPage);
|
||||
const relativeUrl = `${req.nextUrl.pathname}${req.nextUrl.search}`;
|
||||
const baseReq = new _web.WebNextRequest(req);
|
||||
const baseRes = new _web.WebNextResponse(undefined);
|
||||
const pageRouteModule = _VAR_USERLAND.routeModule;
|
||||
const prepareResult = await pageRouteModule.prepare(baseReq, null, {
|
||||
srcPage,
|
||||
multiZoneDraftMode: false
|
||||
});
|
||||
if (!prepareResult) {
|
||||
return new Response('Bad Request', {
|
||||
status: 400
|
||||
});
|
||||
}
|
||||
const { query, params, buildId, nextConfig, buildManifest, prerenderManifest, reactLoadableManifest, subresourceIntegrityManifest, dynamicCssManifest, nextFontManifest, resolvedPathname, interceptionRoutePatterns, routerServerContext, deploymentId } = prepareResult;
|
||||
// Initialize the cache handlers interface.
|
||||
(0, _handlers.initializeCacheHandlers)(nextConfig.cacheMaxMemorySize);
|
||||
const isPossibleServerAction = (0, _serveractionrequestmeta.getIsPossibleServerAction)(req);
|
||||
const botType = (0, _isbot.getBotType)(req.headers.get('User-Agent') || '');
|
||||
const { isOnDemandRevalidate } = (0, _apiutils.checkIsOnDemandRevalidate)(req, prerenderManifest.preview);
|
||||
const closeController = new _webonclose.CloseController();
|
||||
const renderContext = {
|
||||
page: normalizedSrcPage,
|
||||
query,
|
||||
params,
|
||||
sharedContext: {
|
||||
buildId
|
||||
},
|
||||
fallbackRouteParams: null,
|
||||
renderOpts: {
|
||||
App: ()=>null,
|
||||
Document: ()=>null,
|
||||
pageConfig: {},
|
||||
ComponentMod,
|
||||
Component: (0, _interopdefault.interopDefault)(ComponentMod),
|
||||
routeModule: pageRouteModule,
|
||||
params,
|
||||
page: srcPage,
|
||||
postponed: undefined,
|
||||
shouldWaitOnAllReady: false,
|
||||
serveStreamingMetadata: true,
|
||||
supportsDynamicResponse: true,
|
||||
buildManifest,
|
||||
nextFontManifest,
|
||||
reactLoadableManifest,
|
||||
subresourceIntegrityManifest,
|
||||
dynamicCssManifest,
|
||||
setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus,
|
||||
dir: pageRouteModule.relativeProjectDir,
|
||||
botType,
|
||||
isDraftMode: false,
|
||||
isOnDemandRevalidate,
|
||||
isPossibleServerAction,
|
||||
assetPrefix: nextConfig.assetPrefix,
|
||||
nextConfigOutput: nextConfig.output,
|
||||
crossOrigin: nextConfig.crossOrigin,
|
||||
trailingSlash: nextConfig.trailingSlash,
|
||||
images: nextConfig.images,
|
||||
previewProps: prerenderManifest.preview,
|
||||
deploymentId,
|
||||
enableTainting: nextConfig.experimental.taint,
|
||||
htmlLimitedBots: nextConfig.htmlLimitedBots,
|
||||
reactMaxHeadersLength: nextConfig.reactMaxHeadersLength,
|
||||
multiZoneDraftMode: false,
|
||||
cacheLifeProfiles: nextConfig.cacheLife,
|
||||
basePath: nextConfig.basePath,
|
||||
serverActions: nextConfig.experimental.serverActions,
|
||||
cacheComponents: Boolean(nextConfig.cacheComponents),
|
||||
experimental: {
|
||||
isRoutePPREnabled: false,
|
||||
expireTime: nextConfig.expireTime,
|
||||
staleTimes: nextConfig.experimental.staleTimes,
|
||||
dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover),
|
||||
inlineCss: Boolean(nextConfig.experimental.inlineCss),
|
||||
authInterrupts: Boolean(nextConfig.experimental.authInterrupts),
|
||||
clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || [],
|
||||
clientParamParsingOrigins: nextConfig.experimental.clientParamParsingOrigins
|
||||
},
|
||||
incrementalCache: await pageRouteModule.getIncrementalCache(baseReq, nextConfig, prerenderManifest, true),
|
||||
waitUntil: event.waitUntil.bind(event),
|
||||
onClose: (cb)=>{
|
||||
closeController.onClose(cb);
|
||||
},
|
||||
onAfterTaskError: ()=>{},
|
||||
onInstrumentationRequestError: (error, _request, errorContext, silenceLog)=>pageRouteModule.onRequestError(baseReq, error, errorContext, silenceLog, routerServerContext),
|
||||
dev: pageRouteModule.isDev
|
||||
}
|
||||
};
|
||||
let finalStatus = 200;
|
||||
const renderResultToResponse = (result)=>{
|
||||
const varyHeader = pageRouteModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns);
|
||||
// Handle null responses
|
||||
if (result.isNull) {
|
||||
finalStatus = 500;
|
||||
closeController.dispatchClose();
|
||||
return new Response(null, {
|
||||
status: 500
|
||||
});
|
||||
}
|
||||
// Extract metadata
|
||||
const { metadata } = result;
|
||||
const headers = new Headers();
|
||||
finalStatus = metadata.statusCode || baseRes.statusCode || 200;
|
||||
req.fetchMetrics = metadata.fetchMetrics;
|
||||
// Set content type
|
||||
const contentType = result.contentType || 'text/html; charset=utf-8';
|
||||
headers.set('Content-Type', contentType);
|
||||
headers.set('x-edge-runtime', '1');
|
||||
if (varyHeader) {
|
||||
headers.set('Vary', varyHeader);
|
||||
}
|
||||
// Add existing headers
|
||||
for (const [key, value] of Object.entries({
|
||||
...baseRes.getHeaders(),
|
||||
...metadata.headers
|
||||
})){
|
||||
if (value !== undefined) {
|
||||
if (Array.isArray(value)) {
|
||||
// Handle multiple header values
|
||||
for (const v of value){
|
||||
headers.append(key, String(v));
|
||||
}
|
||||
} else {
|
||||
headers.set(key, String(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
// Handle static response
|
||||
if (!result.isDynamic) {
|
||||
const body = result.toUnchunkedString();
|
||||
headers.set('Content-Length', String(new TextEncoder().encode(body).length));
|
||||
closeController.dispatchClose();
|
||||
return new Response(body, {
|
||||
status: finalStatus,
|
||||
headers
|
||||
});
|
||||
}
|
||||
// Handle dynamic/streaming response
|
||||
// For edge runtime, we need to create a readable stream that pipes from the result
|
||||
const { readable, writable } = new TransformStream();
|
||||
// Start piping the result to the writable stream
|
||||
// This is done asynchronously to avoid blocking the response creation
|
||||
result.pipeTo(writable).catch((err)=>{
|
||||
console.error('Error piping RenderResult to response:', err);
|
||||
}).finally(()=>closeController.dispatchClose());
|
||||
return new Response(readable, {
|
||||
status: finalStatus,
|
||||
headers
|
||||
});
|
||||
};
|
||||
const invokeRender = async (span)=>{
|
||||
try {
|
||||
const result = await pageRouteModule.render(baseReq, baseRes, renderContext).finally(()=>{
|
||||
if (!span) return;
|
||||
span.setAttributes({
|
||||
'http.status_code': finalStatus,
|
||||
'next.rsc': false
|
||||
});
|
||||
const rootSpanAttributes = tracer.getRootSpanAttributes();
|
||||
// We were unable to get attributes, probably OTEL is not enabled
|
||||
if (!rootSpanAttributes) {
|
||||
return;
|
||||
}
|
||||
if (rootSpanAttributes.get('next.span_type') !== _constants.BaseServerSpan.handleRequest) {
|
||||
console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
|
||||
return;
|
||||
}
|
||||
const route = normalizedSrcPage;
|
||||
if (route) {
|
||||
const name = `${req.method} ${route}`;
|
||||
span.setAttributes({
|
||||
'next.route': route,
|
||||
'http.route': route,
|
||||
'next.span_name': name
|
||||
});
|
||||
span.updateName(name);
|
||||
} else {
|
||||
span.updateName(`${req.method} ${srcPage}`);
|
||||
}
|
||||
});
|
||||
return renderResultToResponse(result);
|
||||
} catch (err) {
|
||||
const silenceLog = false;
|
||||
await pageRouteModule.onRequestError(baseReq, err, {
|
||||
routerKind: 'App Router',
|
||||
routePath: normalizedSrcPage,
|
||||
routeType: 'render',
|
||||
revalidateReason: undefined
|
||||
}, silenceLog);
|
||||
// rethrow so that we can handle serving error page
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
const tracer = (0, _tracer.getTracer)();
|
||||
return tracer.withPropagatedContext(req.headers, ()=>tracer.trace(_constants.BaseServerSpan.handleRequest, {
|
||||
spanName: `${req.method} ${srcPage}`,
|
||||
kind: _tracer.SpanKind.SERVER,
|
||||
attributes: {
|
||||
'http.method': req.method,
|
||||
'http.target': relativeUrl,
|
||||
'http.route': normalizedSrcPage
|
||||
}
|
||||
}, invokeRender));
|
||||
}
|
||||
const handler = (opts)=>{
|
||||
return (0, _adapter.adapter)({
|
||||
...opts,
|
||||
IncrementalCache: _incrementalcache.IncrementalCache,
|
||||
handler: requestHandler,
|
||||
incrementalCacheHandler,
|
||||
page: 'VAR_PAGE'
|
||||
});
|
||||
};
|
||||
const _default = handler;
|
||||
|
||||
//# sourceMappingURL=edge-ssr-app.js.map
|
||||
1
apps/public-web/node_modules/next/dist/build/templates/edge-ssr-app.js.map
generated
vendored
Normal file
1
apps/public-web/node_modules/next/dist/build/templates/edge-ssr-app.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5
apps/public-web/node_modules/next/dist/build/templates/edge-ssr.d.ts
generated
vendored
Normal file
5
apps/public-web/node_modules/next/dist/build/templates/edge-ssr.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import '../../server/web/globals';
|
||||
import { type EdgeHandler } from '../../server/web/adapter';
|
||||
export declare const ComponentMod: any;
|
||||
declare const handler: EdgeHandler;
|
||||
export default handler;
|
||||
335
apps/public-web/node_modules/next/dist/build/templates/edge-ssr.js
generated
vendored
Normal file
335
apps/public-web/node_modules/next/dist/build/templates/edge-ssr.js
generated
vendored
Normal file
@@ -0,0 +1,335 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
ComponentMod: null,
|
||||
default: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
ComponentMod: function() {
|
||||
return ComponentMod;
|
||||
},
|
||||
default: function() {
|
||||
return _default;
|
||||
}
|
||||
});
|
||||
require("../../server/web/globals");
|
||||
const _adapter = require("../../server/web/adapter");
|
||||
const _incrementalcache = require("../../server/lib/incremental-cache");
|
||||
const _handlers = require("../../server/use-cache/handlers");
|
||||
const _VAR_MODULE_DOCUMENT = /*#__PURE__*/ _interop_require_default(require("VAR_MODULE_DOCUMENT"));
|
||||
const _VAR_MODULE_APP = /*#__PURE__*/ _interop_require_wildcard(require("VAR_MODULE_APP"));
|
||||
const _VAR_USERLAND = /*#__PURE__*/ _interop_require_wildcard(require("VAR_USERLAND"));
|
||||
const _VAR_MODULE_GLOBAL_ERROR = /*#__PURE__*/ _interop_require_wildcard(require("VAR_MODULE_GLOBAL_ERROR"));
|
||||
const _module = /*#__PURE__*/ _interop_require_default(require("../../server/route-modules/pages/module"));
|
||||
const _web = require("../../server/base-http/web");
|
||||
const _tracer = require("../../server/lib/trace/tracer");
|
||||
const _constants = require("../../server/lib/trace/constants");
|
||||
const _constants1 = require("../../lib/constants");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function _getRequireWildcardCache(nodeInterop) {
|
||||
if (typeof WeakMap !== "function") return null;
|
||||
var cacheBabelInterop = new WeakMap();
|
||||
var cacheNodeInterop = new WeakMap();
|
||||
return (_getRequireWildcardCache = function(nodeInterop) {
|
||||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
||||
})(nodeInterop);
|
||||
}
|
||||
function _interop_require_wildcard(obj, nodeInterop) {
|
||||
if (!nodeInterop && obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
||||
return {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var cache = _getRequireWildcardCache(nodeInterop);
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {
|
||||
__proto__: null
|
||||
};
|
||||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for(var key in obj){
|
||||
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
// INJECT:pageRouteModuleOptions
|
||||
// INJECT:errorRouteModuleOptions
|
||||
// INJECT:user500RouteModuleOptions
|
||||
const pageMod = {
|
||||
..._VAR_USERLAND,
|
||||
routeModule: new _module.default({
|
||||
...pageRouteModuleOptions,
|
||||
components: {
|
||||
App: _VAR_MODULE_APP.default,
|
||||
Document: _VAR_MODULE_DOCUMENT.default
|
||||
},
|
||||
userland: _VAR_USERLAND,
|
||||
distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',
|
||||
relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || ''
|
||||
})
|
||||
};
|
||||
const errorMod = {
|
||||
..._VAR_MODULE_GLOBAL_ERROR,
|
||||
routeModule: new _module.default({
|
||||
...errorRouteModuleOptions,
|
||||
components: {
|
||||
App: _VAR_MODULE_APP.default,
|
||||
Document: _VAR_MODULE_DOCUMENT.default
|
||||
},
|
||||
userland: _VAR_MODULE_GLOBAL_ERROR,
|
||||
distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',
|
||||
relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || ''
|
||||
})
|
||||
};
|
||||
// FIXME: this needs to be made compatible with the template
|
||||
const error500Mod = userland500Page ? {
|
||||
...userland500Page,
|
||||
routeModule: new _module.default({
|
||||
...user500RouteModuleOptions,
|
||||
components: {
|
||||
App: _VAR_MODULE_APP.default,
|
||||
Document: _VAR_MODULE_DOCUMENT.default
|
||||
},
|
||||
userland: userland500Page,
|
||||
distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',
|
||||
relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || ''
|
||||
})
|
||||
} : null;
|
||||
const ComponentMod = pageMod;
|
||||
async function requestHandler(req, _event) {
|
||||
var _nextConfig_i18n;
|
||||
let srcPage = 'VAR_DEFINITION_PATHNAME';
|
||||
const relativeUrl = `${req.nextUrl.pathname}${req.nextUrl.search}`;
|
||||
const baseReq = new _web.WebNextRequest(req);
|
||||
const pageRouteModule = pageMod.routeModule;
|
||||
const prepareResult = await pageRouteModule.prepare(baseReq, null, {
|
||||
srcPage,
|
||||
multiZoneDraftMode: false
|
||||
});
|
||||
if (!prepareResult) {
|
||||
return new Response('Bad Request', {
|
||||
status: 400
|
||||
});
|
||||
}
|
||||
const { query, params, buildId, nextConfig, isNextDataRequest, buildManifest, prerenderManifest, reactLoadableManifest, clientReferenceManifest, subresourceIntegrityManifest, dynamicCssManifest } = prepareResult;
|
||||
(0, _handlers.initializeCacheHandlers)(nextConfig.cacheMaxMemorySize);
|
||||
const renderContext = {
|
||||
page: srcPage,
|
||||
query,
|
||||
params,
|
||||
sharedContext: {
|
||||
buildId,
|
||||
deploymentId: process.env.NEXT_DEPLOYMENT_ID,
|
||||
customServer: undefined
|
||||
},
|
||||
renderContext: {
|
||||
isFallback: false,
|
||||
isDraftMode: false,
|
||||
developmentNotFoundSourcePage: undefined
|
||||
},
|
||||
renderOpts: {
|
||||
params,
|
||||
page: srcPage,
|
||||
supportsDynamicResponse: true,
|
||||
Component: pageMod.Component,
|
||||
ComponentMod: pageMod,
|
||||
pageConfig: pageMod.pageConfig,
|
||||
routeModule: pageMod.routeModule,
|
||||
previewProps: prerenderManifest.preview,
|
||||
basePath: nextConfig.basePath,
|
||||
assetPrefix: nextConfig.assetPrefix,
|
||||
images: nextConfig.images,
|
||||
optimizeCss: nextConfig.experimental.optimizeCss,
|
||||
nextConfigOutput: nextConfig.output,
|
||||
nextScriptWorkers: nextConfig.experimental.nextScriptWorkers,
|
||||
disableOptimizedLoading: nextConfig.experimental.disableOptimizedLoading,
|
||||
domainLocales: (_nextConfig_i18n = nextConfig.i18n) == null ? void 0 : _nextConfig_i18n.domains,
|
||||
distDir: '',
|
||||
crossOrigin: nextConfig.crossOrigin ? nextConfig.crossOrigin : undefined,
|
||||
largePageDataBytes: nextConfig.experimental.largePageDataBytes,
|
||||
isExperimentalCompile: nextConfig.experimental.isExperimentalCompile,
|
||||
// `htmlLimitedBots` is passed to server as serialized config in string format
|
||||
experimental: {
|
||||
clientTraceMetadata: nextConfig.experimental.clientTraceMetadata
|
||||
},
|
||||
buildManifest,
|
||||
subresourceIntegrityManifest,
|
||||
reactLoadableManifest,
|
||||
clientReferenceManifest,
|
||||
dynamicCssManifest
|
||||
}
|
||||
};
|
||||
let finalStatus = 200;
|
||||
const renderResultToResponse = (result)=>{
|
||||
// Handle null responses
|
||||
if (result.isNull) {
|
||||
finalStatus = 500;
|
||||
return new Response(null, {
|
||||
status: 500
|
||||
});
|
||||
}
|
||||
// Extract metadata
|
||||
const { metadata } = result;
|
||||
finalStatus = metadata.statusCode || 200;
|
||||
const headers = new Headers();
|
||||
// Set content type
|
||||
const contentType = result.contentType || _constants1.HTML_CONTENT_TYPE_HEADER;
|
||||
headers.set('Content-Type', contentType);
|
||||
// Add metadata headers
|
||||
if (metadata.headers) {
|
||||
for (const [key, value] of Object.entries(metadata.headers)){
|
||||
if (value !== undefined) {
|
||||
if (Array.isArray(value)) {
|
||||
// Handle multiple header values
|
||||
for (const v of value){
|
||||
headers.append(key, String(v));
|
||||
}
|
||||
} else {
|
||||
headers.set(key, String(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Handle static response
|
||||
if (!result.isDynamic) {
|
||||
const body = result.toUnchunkedString();
|
||||
headers.set('Content-Length', String(new TextEncoder().encode(body).length));
|
||||
return new Response(body, {
|
||||
status: finalStatus,
|
||||
headers
|
||||
});
|
||||
}
|
||||
// Handle dynamic/streaming response
|
||||
// For edge runtime, we need to create a readable stream that pipes from the result
|
||||
const { readable, writable } = new TransformStream();
|
||||
// Start piping the result to the writable stream
|
||||
// This is done asynchronously to avoid blocking the response creation
|
||||
result.pipeTo(writable).catch((err)=>{
|
||||
console.error('Error piping RenderResult to response:', err);
|
||||
});
|
||||
return new Response(readable, {
|
||||
status: finalStatus,
|
||||
headers
|
||||
});
|
||||
};
|
||||
const invokeRender = async (span)=>{
|
||||
try {
|
||||
const result = await pageRouteModule.render(// @ts-expect-error we don't type this for edge
|
||||
baseReq, new _web.WebNextResponse(undefined), {
|
||||
...renderContext,
|
||||
renderOpts: {
|
||||
...renderContext.renderOpts,
|
||||
getServerSideProps: pageMod.getServerSideProps,
|
||||
Component: pageMod.default || pageMod,
|
||||
ComponentMod: pageMod,
|
||||
pageConfig: pageMod.config,
|
||||
isNextDataRequest
|
||||
}
|
||||
}).finally(()=>{
|
||||
if (!span) return;
|
||||
span.setAttributes({
|
||||
'http.status_code': finalStatus,
|
||||
'next.rsc': false
|
||||
});
|
||||
const rootSpanAttributes = tracer.getRootSpanAttributes();
|
||||
// We were unable to get attributes, probably OTEL is not enabled
|
||||
if (!rootSpanAttributes) {
|
||||
return;
|
||||
}
|
||||
if (rootSpanAttributes.get('next.span_type') !== _constants.BaseServerSpan.handleRequest) {
|
||||
console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
|
||||
return;
|
||||
}
|
||||
const route = rootSpanAttributes.get('next.route');
|
||||
if (route) {
|
||||
const name = `${req.method} ${route}`;
|
||||
span.setAttributes({
|
||||
'next.route': route,
|
||||
'http.route': route,
|
||||
'next.span_name': name
|
||||
});
|
||||
span.updateName(name);
|
||||
} else {
|
||||
span.updateName(`${req.method} ${srcPage}`);
|
||||
}
|
||||
});
|
||||
return renderResultToResponse(result);
|
||||
} catch (err) {
|
||||
const errModule = error500Mod || errorMod;
|
||||
const errRouteModule = errModule.routeModule;
|
||||
if (errRouteModule.isDev) {
|
||||
throw err;
|
||||
}
|
||||
const silenceLog = false;
|
||||
await errRouteModule.onRequestError(baseReq, err, {
|
||||
routerKind: 'Pages Router',
|
||||
routePath: srcPage,
|
||||
routeType: 'render',
|
||||
revalidateReason: undefined
|
||||
}, silenceLog);
|
||||
const errResult = await errRouteModule.render(// @ts-expect-error we don't type this for edge
|
||||
baseReq, new _web.WebNextResponse(undefined), {
|
||||
...renderContext,
|
||||
page: error500Mod ? '/500' : '/_error',
|
||||
renderOpts: {
|
||||
...renderContext.renderOpts,
|
||||
getServerSideProps: errModule.getServerSideProps,
|
||||
Component: errModule.default || errModule,
|
||||
ComponentMod: errModule,
|
||||
pageConfig: errModule.config
|
||||
}
|
||||
});
|
||||
return renderResultToResponse(errResult);
|
||||
}
|
||||
};
|
||||
const tracer = (0, _tracer.getTracer)();
|
||||
return tracer.withPropagatedContext(req.headers, ()=>tracer.trace(_constants.BaseServerSpan.handleRequest, {
|
||||
spanName: `${req.method} ${srcPage}`,
|
||||
kind: _tracer.SpanKind.SERVER,
|
||||
attributes: {
|
||||
'http.method': req.method,
|
||||
'http.target': relativeUrl,
|
||||
'http.route': srcPage
|
||||
}
|
||||
}, invokeRender));
|
||||
}
|
||||
const handler = (opts)=>{
|
||||
return (0, _adapter.adapter)({
|
||||
...opts,
|
||||
IncrementalCache: _incrementalcache.IncrementalCache,
|
||||
handler: requestHandler,
|
||||
incrementalCacheHandler,
|
||||
bypassNextUrl: true,
|
||||
page: 'VAR_DEFINITION_PATHNAME'
|
||||
});
|
||||
};
|
||||
const _default = handler;
|
||||
|
||||
//# sourceMappingURL=edge-ssr.js.map
|
||||
1
apps/public-web/node_modules/next/dist/build/templates/edge-ssr.js.map
generated
vendored
Normal file
1
apps/public-web/node_modules/next/dist/build/templates/edge-ssr.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
24
apps/public-web/node_modules/next/dist/build/templates/edge-wrapper.js
generated
vendored
Normal file
24
apps/public-web/node_modules/next/dist/build/templates/edge-wrapper.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
// The wrapped module could be an async module, we handle that with the proxy
|
||||
// here. The comma expression makes sure we don't call the function with the
|
||||
// module as the "this" arg.
|
||||
// Turn exports into functions that are also a thenable. This way you can await the whole object
|
||||
// or exports (e.g. for Components) or call them directly as though they are async functions
|
||||
// (e.g. edge functions/middleware, this is what the Edge Runtime does).
|
||||
// Catch promise to prevent UnhandledPromiseRejectionWarning, this will be propagated through
|
||||
// the awaited export(s) anyway.
|
||||
"use strict";
|
||||
self._ENTRIES ||= {};
|
||||
const modProm = import('MODULE');
|
||||
modProm.catch(()=>{});
|
||||
self._ENTRIES['VAR_ENTRY_NAME'] = new Proxy(modProm, {
|
||||
get (innerModProm, name) {
|
||||
if (name === 'then') {
|
||||
return (res, rej)=>innerModProm.then(res, rej);
|
||||
}
|
||||
let result = (...args)=>innerModProm.then((mod)=>(0, mod[name])(...args));
|
||||
result.then = (res, rej)=>innerModProm.then((mod)=>mod[name]).then(res, rej);
|
||||
return result;
|
||||
}
|
||||
});
|
||||
|
||||
//# sourceMappingURL=edge-wrapper.js.map
|
||||
1
apps/public-web/node_modules/next/dist/build/templates/edge-wrapper.js.map
generated
vendored
Normal file
1
apps/public-web/node_modules/next/dist/build/templates/edge-wrapper.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/build/templates/edge-wrapper.js"],"sourcesContent":["// The wrapped module could be an async module, we handle that with the proxy\n// here. The comma expression makes sure we don't call the function with the\n// module as the \"this\" arg.\n// Turn exports into functions that are also a thenable. This way you can await the whole object\n// or exports (e.g. for Components) or call them directly as though they are async functions\n// (e.g. edge functions/middleware, this is what the Edge Runtime does).\n// Catch promise to prevent UnhandledPromiseRejectionWarning, this will be propagated through\n// the awaited export(s) anyway.\nself._ENTRIES ||= {}\nconst modProm = import('MODULE')\nmodProm.catch(() => {})\nself._ENTRIES['VAR_ENTRY_NAME'] = new Proxy(modProm, {\n get(innerModProm, name) {\n if (name === 'then') {\n return (res, rej) => innerModProm.then(res, rej)\n }\n let result = (...args) =>\n innerModProm.then((mod) => (0, mod[name])(...args))\n result.then = (res, rej) =>\n innerModProm.then((mod) => mod[name]).then(res, rej)\n return result\n },\n})\n"],"names":["self","_ENTRIES","modProm","catch","Proxy","get","innerModProm","name","res","rej","then","result","args","mod"],"mappings":"AAAA,6EAA6E;AAC7E,4EAA4E;AAC5E,4BAA4B;AAC5B,gGAAgG;AAChG,6FAA6F;AAC7F,wEAAwE;AACxE,6FAA6F;AAC7F,gCAAgC;;AAChCA,KAAKC,QAAQ,KAAK,CAAC;AACnB,MAAMC,UAAU,MAAM,CAAC;AACvBA,QAAQC,KAAK,CAAC,KAAO;AACrBH,KAAKC,QAAQ,CAAC,iBAAiB,GAAG,IAAIG,MAAMF,SAAS;IACnDG,KAAIC,YAAY,EAAEC,IAAI;QACpB,IAAIA,SAAS,QAAQ;YACnB,OAAO,CAACC,KAAKC,MAAQH,aAAaI,IAAI,CAACF,KAAKC;QAC9C;QACA,IAAIE,SAAS,CAAC,GAAGC,OACfN,aAAaI,IAAI,CAAC,CAACG,MAAQ,AAAC,CAAA,GAAGA,GAAG,CAACN,KAAK,AAAD,KAAMK;QAC/CD,OAAOD,IAAI,GAAG,CAACF,KAAKC,MAClBH,aAAaI,IAAI,CAAC,CAACG,MAAQA,GAAG,CAACN,KAAK,EAAEG,IAAI,CAACF,KAAKC;QAClD,OAAOE;IACT;AACF","ignoreList":[0]}
|
||||
8
apps/public-web/node_modules/next/dist/build/templates/helpers.d.ts
generated
vendored
Normal file
8
apps/public-web/node_modules/next/dist/build/templates/helpers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* 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 declare function hoist(module: any, name: string): any;
|
||||
36
apps/public-web/node_modules/next/dist/build/templates/helpers.js
generated
vendored
Normal file
36
apps/public-web/node_modules/next/dist/build/templates/helpers.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* 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)
|
||||
*/ "use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "hoist", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return hoist;
|
||||
}
|
||||
});
|
||||
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
|
||||
1
apps/public-web/node_modules/next/dist/build/templates/helpers.js.map
generated
vendored
Normal file
1
apps/public-web/node_modules/next/dist/build/templates/helpers.js.map
generated
vendored
Normal 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;;;;+BACeA;;;eAAAA;;;AAAT,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","ignoreList":[0]}
|
||||
4
apps/public-web/node_modules/next/dist/build/templates/middleware.d.ts
generated
vendored
Normal file
4
apps/public-web/node_modules/next/dist/build/templates/middleware.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import type { EdgeHandler } from '../../server/web/adapter';
|
||||
import '../../server/web/globals';
|
||||
declare const handler: EdgeHandler;
|
||||
export default handler;
|
||||
115
apps/public-web/node_modules/next/dist/build/templates/middleware.js
generated
vendored
Normal file
115
apps/public-web/node_modules/next/dist/build/templates/middleware.js
generated
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _default;
|
||||
}
|
||||
});
|
||||
const _globals = require("../../server/web/globals");
|
||||
const _adapter = require("../../server/web/adapter");
|
||||
const _VAR_USERLAND = /*#__PURE__*/ _interop_require_wildcard(require("VAR_USERLAND"));
|
||||
const _isnextroutererror = require("../../client/components/is-next-router-error");
|
||||
function _getRequireWildcardCache(nodeInterop) {
|
||||
if (typeof WeakMap !== "function") return null;
|
||||
var cacheBabelInterop = new WeakMap();
|
||||
var cacheNodeInterop = new WeakMap();
|
||||
return (_getRequireWildcardCache = function(nodeInterop) {
|
||||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
||||
})(nodeInterop);
|
||||
}
|
||||
function _interop_require_wildcard(obj, nodeInterop) {
|
||||
if (!nodeInterop && obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
||||
return {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var cache = _getRequireWildcardCache(nodeInterop);
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {
|
||||
__proto__: null
|
||||
};
|
||||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for(var key in obj){
|
||||
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
const mod = {
|
||||
..._VAR_USERLAND
|
||||
};
|
||||
const page = 'VAR_DEFINITION_PAGE';
|
||||
const isProxy = page === '/proxy' || page === '/src/proxy';
|
||||
const handlerUserland = (isProxy ? mod.proxy : mod.middleware) || mod.default;
|
||||
class ProxyMissingExportError extends Error {
|
||||
constructor(message){
|
||||
super(message);
|
||||
// Stack isn't useful here, remove it considering it spams logs during development.
|
||||
this.stack = '';
|
||||
}
|
||||
}
|
||||
// TODO: This spams logs during development. Find a better way to handle this.
|
||||
// Removing this will spam "fn is not a function" logs which is worse.
|
||||
if (typeof handlerUserland !== 'function') {
|
||||
throw new ProxyMissingExportError(`The ${isProxy ? 'Proxy' : 'Middleware'} file "${page}" must export a function named \`${isProxy ? 'proxy' : 'middleware'}\` or a default function.`);
|
||||
}
|
||||
// Proxy will only sent out the FetchEvent to next server,
|
||||
// so load instrumentation module here and track the error inside proxy 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 proxy as it's outside of react component tree.
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if ((0, _isnextroutererror.isNextRouterError)(err)) {
|
||||
err.message = `Next.js navigation API is not allowed to be used in ${isProxy ? 'Proxy' : 'Middleware'}.`;
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
const req = args[0];
|
||||
const url = new URL(req.url);
|
||||
const resource = url.pathname + url.search;
|
||||
await (0, _globals.edgeInstrumentationOnRequestError)(err, {
|
||||
path: resource,
|
||||
method: req.method,
|
||||
headers: Object.fromEntries(req.headers.entries())
|
||||
}, {
|
||||
routerKind: 'Pages Router',
|
||||
routePath: '/proxy',
|
||||
routeType: 'proxy',
|
||||
revalidateReason: undefined
|
||||
});
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
}
|
||||
const handler = (opts)=>{
|
||||
return (0, _adapter.adapter)({
|
||||
...opts,
|
||||
page,
|
||||
handler: errorHandledHandler(handlerUserland)
|
||||
});
|
||||
};
|
||||
const _default = handler;
|
||||
|
||||
//# sourceMappingURL=middleware.js.map
|
||||
1
apps/public-web/node_modules/next/dist/build/templates/middleware.js.map
generated
vendored
Normal file
1
apps/public-web/node_modules/next/dist/build/templates/middleware.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/build/templates/middleware.ts"],"sourcesContent":["import type { AdapterOptions, EdgeHandler } 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 }\n\nconst page: string = 'VAR_DEFINITION_PAGE'\nconst isProxy = page === '/proxy' || page === '/src/proxy'\nconst handlerUserland = (isProxy ? mod.proxy : mod.middleware) || mod.default\n\nclass ProxyMissingExportError extends Error {\n constructor(message: string) {\n super(message)\n // Stack isn't useful here, remove it considering it spams logs during development.\n this.stack = ''\n }\n}\n\n// TODO: This spams logs during development. Find a better way to handle this.\n// Removing this will spam \"fn is not a function\" logs which is worse.\nif (typeof handlerUserland !== 'function') {\n throw new ProxyMissingExportError(\n `The ${isProxy ? 'Proxy' : 'Middleware'} file \"${page}\" must export a function named \\`${isProxy ? 'proxy' : 'middleware'}\\` or a default function.`\n )\n}\n\n// Proxy will only sent out the FetchEvent to next server,\n// so load instrumentation module here and track the error inside proxy 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 proxy 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 ${isProxy ? 'Proxy' : '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: '/proxy',\n routeType: 'proxy',\n revalidateReason: undefined,\n }\n )\n\n throw err\n }\n }\n}\n\nconst handler: EdgeHandler = (opts) => {\n return adapter({\n ...opts,\n page,\n handler: errorHandledHandler(handlerUserland),\n })\n}\nexport default handler\n"],"names":["mod","_mod","page","isProxy","handlerUserland","proxy","middleware","default","ProxyMissingExportError","Error","constructor","message","stack","errorHandledHandler","fn","args","err","process","env","NODE_ENV","isNextRouterError","req","url","URL","resource","pathname","search","edgeInstrumentationOnRequestError","path","method","headers","Object","fromEntries","entries","routerKind","routePath","routeType","revalidateReason","undefined","handler","opts","adapter"],"mappings":";;;;+BA8EA;;;eAAA;;;yBA5EO;yBAEiB;sEAGF;mCAEY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElC,MAAMA,MAAM;IAAE,GAAGC,aAAI;AAAC;AAEtB,MAAMC,OAAe;AACrB,MAAMC,UAAUD,SAAS,YAAYA,SAAS;AAC9C,MAAME,kBAAkB,AAACD,CAAAA,UAAUH,IAAIK,KAAK,GAAGL,IAAIM,UAAU,AAAD,KAAMN,IAAIO,OAAO;AAE7E,MAAMC,gCAAgCC;IACpCC,YAAYC,OAAe,CAAE;QAC3B,KAAK,CAACA;QACN,mFAAmF;QACnF,IAAI,CAACC,KAAK,GAAG;IACf;AACF;AAEA,8EAA8E;AAC9E,sEAAsE;AACtE,IAAI,OAAOR,oBAAoB,YAAY;IACzC,MAAM,IAAII,wBACR,CAAC,IAAI,EAAEL,UAAU,UAAU,aAAa,OAAO,EAAED,KAAK,iCAAiC,EAAEC,UAAU,UAAU,aAAa,yBAAyB,CAAC;AAExJ;AAEA,0DAA0D;AAC1D,+EAA+E;AAC/E,SAASU,oBAAoBC,EAA6B;IACxD,OAAO,OAAO,GAAGC;QACf,IAAI;YACF,OAAO,MAAMD,MAAMC;QACrB,EAAE,OAAOC,KAAK;YACZ,6DAA6D;YAC7D,sFAAsF;YACtF,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;gBACzC,IAAIC,IAAAA,oCAAiB,EAACJ,MAAM;oBAC1BA,IAAIL,OAAO,GAAG,CAAC,oDAAoD,EAAER,UAAU,UAAU,aAAa,CAAC,CAAC;oBACxG,MAAMa;gBACR;YACF;YACA,MAAMK,MAAMN,IAAI,CAAC,EAAE;YACnB,MAAMO,MAAM,IAAIC,IAAIF,IAAIC,GAAG;YAC3B,MAAME,WAAWF,IAAIG,QAAQ,GAAGH,IAAII,MAAM;YAC1C,MAAMC,IAAAA,0CAAiC,EACrCX,KACA;gBACEY,MAAMJ;gBACNK,QAAQR,IAAIQ,MAAM;gBAClBC,SAASC,OAAOC,WAAW,CAACX,IAAIS,OAAO,CAACG,OAAO;YACjD,GACA;gBACEC,YAAY;gBACZC,WAAW;gBACXC,WAAW;gBACXC,kBAAkBC;YACpB;YAGF,MAAMtB;QACR;IACF;AACF;AAEA,MAAMuB,UAAuB,CAACC;IAC5B,OAAOC,IAAAA,gBAAO,EAAC;QACb,GAAGD,IAAI;QACPtC;QACAqC,SAAS1B,oBAAoBT;IAC/B;AACF;MACA,WAAemC","ignoreList":[0]}
|
||||
7
apps/public-web/node_modules/next/dist/build/templates/pages-api.d.ts
generated
vendored
Normal file
7
apps/public-web/node_modules/next/dist/build/templates/pages-api.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { IncomingMessage, ServerResponse } from 'node:http';
|
||||
declare const _default: any;
|
||||
export default _default;
|
||||
export declare const config: any;
|
||||
export declare function handler(req: IncomingMessage, res: ServerResponse, ctx: {
|
||||
waitUntil?: (prom: Promise<void>) => void;
|
||||
}): Promise<void>;
|
||||
194
apps/public-web/node_modules/next/dist/build/templates/pages-api.js
generated
vendored
Normal file
194
apps/public-web/node_modules/next/dist/build/templates/pages-api.js
generated
vendored
Normal file
@@ -0,0 +1,194 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
config: null,
|
||||
default: null,
|
||||
handler: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
config: function() {
|
||||
return config;
|
||||
},
|
||||
// Re-export the handler (should be the default export).
|
||||
default: function() {
|
||||
return _default;
|
||||
},
|
||||
handler: function() {
|
||||
return handler;
|
||||
}
|
||||
});
|
||||
const _apiutils = require("../../server/api-utils");
|
||||
const _routekind = require("../../server/route-kind");
|
||||
const _modulecompiled = require("../../server/route-modules/pages-api/module.compiled");
|
||||
const _helpers = require("./helpers");
|
||||
const _VAR_USERLAND = /*#__PURE__*/ _interop_require_wildcard(require("VAR_USERLAND"));
|
||||
const _tracer = require("../../server/lib/trace/tracer");
|
||||
const _constants = require("../../server/lib/trace/constants");
|
||||
const _requestmeta = require("../../server/request-meta");
|
||||
function _getRequireWildcardCache(nodeInterop) {
|
||||
if (typeof WeakMap !== "function") return null;
|
||||
var cacheBabelInterop = new WeakMap();
|
||||
var cacheNodeInterop = new WeakMap();
|
||||
return (_getRequireWildcardCache = function(nodeInterop) {
|
||||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
||||
})(nodeInterop);
|
||||
}
|
||||
function _interop_require_wildcard(obj, nodeInterop) {
|
||||
if (!nodeInterop && obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
||||
return {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var cache = _getRequireWildcardCache(nodeInterop);
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {
|
||||
__proto__: null
|
||||
};
|
||||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for(var key in obj){
|
||||
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
const _default = (0, _helpers.hoist)(_VAR_USERLAND, 'default');
|
||||
const config = (0, _helpers.hoist)(_VAR_USERLAND, 'config');
|
||||
// Create and export the route module that will be consumed.
|
||||
const routeModule = new _modulecompiled.PagesAPIRouteModule({
|
||||
definition: {
|
||||
kind: _routekind.RouteKind.PAGES_API,
|
||||
page: 'VAR_DEFINITION_PAGE',
|
||||
pathname: 'VAR_DEFINITION_PATHNAME',
|
||||
// The following aren't used in production.
|
||||
bundlePath: '',
|
||||
filename: ''
|
||||
},
|
||||
userland: _VAR_USERLAND,
|
||||
distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',
|
||||
relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || ''
|
||||
});
|
||||
async function handler(req, res, ctx) {
|
||||
if (routeModule.isDev) {
|
||||
(0, _requestmeta.addRequestMeta)(req, 'devRequestTimingInternalsEnd', process.hrtime.bigint());
|
||||
}
|
||||
let srcPage = 'VAR_DEFINITION_PAGE';
|
||||
// turbopack doesn't normalize `/index` in the page name
|
||||
// so we need to to process dynamic routes properly
|
||||
// TODO: fix turbopack providing differing value from webpack
|
||||
if (process.env.TURBOPACK) {
|
||||
srcPage = srcPage.replace(/\/index$/, '') || '/';
|
||||
}
|
||||
const prepareResult = await routeModule.prepare(req, res, {
|
||||
srcPage
|
||||
});
|
||||
if (!prepareResult) {
|
||||
res.statusCode = 400;
|
||||
res.end('Bad Request');
|
||||
ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());
|
||||
return;
|
||||
}
|
||||
const { query, params, prerenderManifest, routerServerContext } = prepareResult;
|
||||
try {
|
||||
const method = req.method || 'GET';
|
||||
const tracer = (0, _tracer.getTracer)();
|
||||
const activeSpan = tracer.getActiveScopeSpan();
|
||||
const onRequestError = routeModule.instrumentationOnRequestError.bind(routeModule);
|
||||
const invokeRouteModule = async (span)=>routeModule.render(req, res, {
|
||||
query: {
|
||||
...query,
|
||||
...params
|
||||
},
|
||||
params,
|
||||
allowedRevalidateHeaderKeys: process.env.__NEXT_ALLOWED_REVALIDATE_HEADERS,
|
||||
multiZoneDraftMode: Boolean(process.env.__NEXT_MULTI_ZONE_DRAFT_MODE),
|
||||
trustHostHeader: process.env.__NEXT_TRUST_HOST_HEADER,
|
||||
// TODO: get this from from runtime env so manifest
|
||||
// doesn't need to load
|
||||
previewProps: prerenderManifest.preview,
|
||||
propagateError: false,
|
||||
dev: routeModule.isDev,
|
||||
page: 'VAR_DEFINITION_PAGE',
|
||||
internalRevalidate: routerServerContext == null ? void 0 : routerServerContext.revalidate,
|
||||
onError: (...args)=>onRequestError(req, ...args)
|
||||
}).finally(()=>{
|
||||
if (!span) return;
|
||||
span.setAttributes({
|
||||
'http.status_code': res.statusCode,
|
||||
'next.rsc': false
|
||||
});
|
||||
const rootSpanAttributes = tracer.getRootSpanAttributes();
|
||||
// We were unable to get attributes, probably OTEL is not enabled
|
||||
if (!rootSpanAttributes) {
|
||||
return;
|
||||
}
|
||||
if (rootSpanAttributes.get('next.span_type') !== _constants.BaseServerSpan.handleRequest) {
|
||||
console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
|
||||
return;
|
||||
}
|
||||
const route = rootSpanAttributes.get('next.route');
|
||||
if (route) {
|
||||
const name = `${method} ${route}`;
|
||||
span.setAttributes({
|
||||
'next.route': route,
|
||||
'http.route': route,
|
||||
'next.span_name': name
|
||||
});
|
||||
span.updateName(name);
|
||||
} else {
|
||||
span.updateName(`${method} ${srcPage}`);
|
||||
}
|
||||
});
|
||||
// TODO: activeSpan code path is for when wrapped by
|
||||
// next-server can be removed when this is no longer used
|
||||
if (activeSpan) {
|
||||
await invokeRouteModule(activeSpan);
|
||||
} else {
|
||||
await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(_constants.BaseServerSpan.handleRequest, {
|
||||
spanName: `${method} ${srcPage}`,
|
||||
kind: _tracer.SpanKind.SERVER,
|
||||
attributes: {
|
||||
'http.method': method,
|
||||
'http.target': req.url
|
||||
}
|
||||
}, invokeRouteModule));
|
||||
}
|
||||
} catch (err) {
|
||||
// we re-throw in dev to show the error overlay
|
||||
if (routeModule.isDev) {
|
||||
throw err;
|
||||
}
|
||||
// this is technically an invariant as error handling
|
||||
// should be done inside of api-resolver onError
|
||||
(0, _apiutils.sendError)(res, 500, 'Internal Server Error');
|
||||
} finally{
|
||||
// We don't allow any waitUntil work in pages API routes currently
|
||||
// so if callback is present return with resolved promise since no
|
||||
// pending work
|
||||
ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=pages-api.js.map
|
||||
1
apps/public-web/node_modules/next/dist/build/templates/pages-api.js.map
generated
vendored
Normal file
1
apps/public-web/node_modules/next/dist/build/templates/pages-api.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
4
apps/public-web/node_modules/next/dist/build/templates/pages-edge-api.d.ts
generated
vendored
Normal file
4
apps/public-web/node_modules/next/dist/build/templates/pages-edge-api.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import type { EdgeHandler } from '../../server/web/adapter';
|
||||
import '../../server/web/globals';
|
||||
declare const handler: EdgeHandler;
|
||||
export default handler;
|
||||
39
apps/public-web/node_modules/next/dist/build/templates/pages-edge-api.js
generated
vendored
Normal file
39
apps/public-web/node_modules/next/dist/build/templates/pages-edge-api.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _default;
|
||||
}
|
||||
});
|
||||
require("../../server/web/globals");
|
||||
const _adapter = require("../../server/web/adapter");
|
||||
const _incrementalcache = require("../../server/lib/incremental-cache");
|
||||
const _apiutils = require("../../server/api-utils");
|
||||
const _VAR_USERLAND = /*#__PURE__*/ _interop_require_default(require("VAR_USERLAND"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
const page = 'VAR_DEFINITION_PAGE';
|
||||
if (typeof _VAR_USERLAND.default !== '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
|
||||
});
|
||||
}
|
||||
const handler = (opts)=>{
|
||||
return (0, _adapter.adapter)({
|
||||
...opts,
|
||||
IncrementalCache: _incrementalcache.IncrementalCache,
|
||||
page: 'VAR_DEFINITION_PATHNAME',
|
||||
handler: (0, _apiutils.wrapApiHandler)(page, _VAR_USERLAND.default)
|
||||
});
|
||||
};
|
||||
const _default = handler;
|
||||
|
||||
//# sourceMappingURL=pages-edge-api.js.map
|
||||
1
apps/public-web/node_modules/next/dist/build/templates/pages-edge-api.js.map
generated
vendored
Normal file
1
apps/public-web/node_modules/next/dist/build/templates/pages-edge-api.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/build/templates/pages-edge-api.ts"],"sourcesContent":["import type { EdgeHandler } 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 handlerUserland from 'VAR_USERLAND'\n\nconst page = 'VAR_DEFINITION_PAGE'\n\nif (typeof handlerUserland !== 'function') {\n throw new Error(\n `The Edge Function \"pages${page}\" must export a \\`default\\` function`\n )\n}\n\nconst handler: EdgeHandler = (opts) => {\n return adapter({\n ...opts,\n IncrementalCache,\n page: 'VAR_DEFINITION_PATHNAME',\n handler: wrapApiHandler(page, handlerUserland),\n })\n}\nexport default handler\n"],"names":["page","handlerUserland","Error","handler","opts","adapter","IncrementalCache","wrapApiHandler"],"mappings":";;;;+BA2BA;;;eAAA;;;QAzBO;yBAEiB;kCACS;0BACF;qEAGH;;;;;;AAE5B,MAAMA,OAAO;AAEb,IAAI,OAAOC,qBAAe,KAAK,YAAY;IACzC,MAAM,qBAEL,CAFK,IAAIC,MACR,CAAC,wBAAwB,EAAEF,KAAK,oCAAoC,CAAC,GADjE,qBAAA;eAAA;oBAAA;sBAAA;IAEN;AACF;AAEA,MAAMG,UAAuB,CAACC;IAC5B,OAAOC,IAAAA,gBAAO,EAAC;QACb,GAAGD,IAAI;QACPE,kBAAAA,kCAAgB;QAChBN,MAAM;QACNG,SAASI,IAAAA,wBAAc,EAACP,MAAMC,qBAAe;IAC/C;AACF;MACA,WAAeE","ignoreList":[0]}
|
||||
17
apps/public-web/node_modules/next/dist/build/templates/pages.d.ts
generated
vendored
Normal file
17
apps/public-web/node_modules/next/dist/build/templates/pages.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import { PagesRouteModule } from '../../server/route-modules/pages/module.compiled';
|
||||
declare const _default: any;
|
||||
export default _default;
|
||||
export declare const getStaticProps: any;
|
||||
export declare const getStaticPaths: any;
|
||||
export declare const getServerSideProps: any;
|
||||
export declare const config: any;
|
||||
export declare const reportWebVitals: any;
|
||||
export declare const unstable_getStaticProps: any;
|
||||
export declare const unstable_getStaticPaths: any;
|
||||
export declare const unstable_getStaticParams: any;
|
||||
export declare const unstable_getServerProps: any;
|
||||
export declare const unstable_getServerSideProps: any;
|
||||
export declare const routeModule: PagesRouteModule;
|
||||
export declare const handler: (req: import("http").IncomingMessage, res: import("http").ServerResponse, ctx: {
|
||||
waitUntil: (prom: Promise<void>) => void;
|
||||
}) => Promise<void>;
|
||||
155
apps/public-web/node_modules/next/dist/build/templates/pages.js
generated
vendored
Normal file
155
apps/public-web/node_modules/next/dist/build/templates/pages.js
generated
vendored
Normal file
@@ -0,0 +1,155 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
config: null,
|
||||
default: null,
|
||||
getServerSideProps: null,
|
||||
getStaticPaths: null,
|
||||
getStaticProps: null,
|
||||
handler: null,
|
||||
reportWebVitals: null,
|
||||
routeModule: null,
|
||||
unstable_getServerProps: null,
|
||||
unstable_getServerSideProps: null,
|
||||
unstable_getStaticParams: null,
|
||||
unstable_getStaticPaths: null,
|
||||
unstable_getStaticProps: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
config: function() {
|
||||
return config;
|
||||
},
|
||||
// Re-export the component (should be the default export).
|
||||
default: function() {
|
||||
return _default;
|
||||
},
|
||||
getServerSideProps: function() {
|
||||
return getServerSideProps;
|
||||
},
|
||||
getStaticPaths: function() {
|
||||
return getStaticPaths;
|
||||
},
|
||||
getStaticProps: function() {
|
||||
return getStaticProps;
|
||||
},
|
||||
handler: function() {
|
||||
return handler;
|
||||
},
|
||||
reportWebVitals: function() {
|
||||
return reportWebVitals;
|
||||
},
|
||||
routeModule: function() {
|
||||
return routeModule;
|
||||
},
|
||||
unstable_getServerProps: function() {
|
||||
return unstable_getServerProps;
|
||||
},
|
||||
unstable_getServerSideProps: function() {
|
||||
return unstable_getServerSideProps;
|
||||
},
|
||||
unstable_getStaticParams: function() {
|
||||
return unstable_getStaticParams;
|
||||
},
|
||||
unstable_getStaticPaths: function() {
|
||||
return unstable_getStaticPaths;
|
||||
},
|
||||
unstable_getStaticProps: function() {
|
||||
return unstable_getStaticProps;
|
||||
}
|
||||
});
|
||||
const _modulecompiled = require("../../server/route-modules/pages/module.compiled");
|
||||
const _routekind = require("../../server/route-kind");
|
||||
const _helpers = require("./helpers");
|
||||
const _VAR_MODULE_DOCUMENT = /*#__PURE__*/ _interop_require_wildcard(require("VAR_MODULE_DOCUMENT"));
|
||||
const _VAR_MODULE_APP = /*#__PURE__*/ _interop_require_wildcard(require("VAR_MODULE_APP"));
|
||||
const _VAR_USERLAND = /*#__PURE__*/ _interop_require_wildcard(require("VAR_USERLAND"));
|
||||
const _pageshandler = require("../../server/route-modules/pages/pages-handler");
|
||||
function _getRequireWildcardCache(nodeInterop) {
|
||||
if (typeof WeakMap !== "function") return null;
|
||||
var cacheBabelInterop = new WeakMap();
|
||||
var cacheNodeInterop = new WeakMap();
|
||||
return (_getRequireWildcardCache = function(nodeInterop) {
|
||||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
||||
})(nodeInterop);
|
||||
}
|
||||
function _interop_require_wildcard(obj, nodeInterop) {
|
||||
if (!nodeInterop && obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
||||
return {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var cache = _getRequireWildcardCache(nodeInterop);
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {
|
||||
__proto__: null
|
||||
};
|
||||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for(var key in obj){
|
||||
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
const _default = (0, _helpers.hoist)(_VAR_USERLAND, 'default');
|
||||
const getStaticProps = (0, _helpers.hoist)(_VAR_USERLAND, 'getStaticProps');
|
||||
const getStaticPaths = (0, _helpers.hoist)(_VAR_USERLAND, 'getStaticPaths');
|
||||
const getServerSideProps = (0, _helpers.hoist)(_VAR_USERLAND, 'getServerSideProps');
|
||||
const config = (0, _helpers.hoist)(_VAR_USERLAND, 'config');
|
||||
const reportWebVitals = (0, _helpers.hoist)(_VAR_USERLAND, 'reportWebVitals');
|
||||
const unstable_getStaticProps = (0, _helpers.hoist)(_VAR_USERLAND, 'unstable_getStaticProps');
|
||||
const unstable_getStaticPaths = (0, _helpers.hoist)(_VAR_USERLAND, 'unstable_getStaticPaths');
|
||||
const unstable_getStaticParams = (0, _helpers.hoist)(_VAR_USERLAND, 'unstable_getStaticParams');
|
||||
const unstable_getServerProps = (0, _helpers.hoist)(_VAR_USERLAND, 'unstable_getServerProps');
|
||||
const unstable_getServerSideProps = (0, _helpers.hoist)(_VAR_USERLAND, 'unstable_getServerSideProps');
|
||||
const routeModule = new _modulecompiled.PagesRouteModule({
|
||||
definition: {
|
||||
kind: _routekind.RouteKind.PAGES,
|
||||
page: 'VAR_DEFINITION_PAGE',
|
||||
pathname: 'VAR_DEFINITION_PATHNAME',
|
||||
// The following aren't used in production.
|
||||
bundlePath: '',
|
||||
filename: ''
|
||||
},
|
||||
distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',
|
||||
relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',
|
||||
components: {
|
||||
// default export might not exist when optimized for data only
|
||||
App: _VAR_MODULE_APP.default,
|
||||
Document: _VAR_MODULE_DOCUMENT.default
|
||||
},
|
||||
userland: _VAR_USERLAND
|
||||
});
|
||||
const handler = (0, _pageshandler.getHandler)({
|
||||
srcPage: 'VAR_DEFINITION_PAGE',
|
||||
config,
|
||||
userland: _VAR_USERLAND,
|
||||
routeModule,
|
||||
getStaticPaths,
|
||||
getStaticProps,
|
||||
getServerSideProps
|
||||
});
|
||||
|
||||
//# sourceMappingURL=pages.js.map
|
||||
1
apps/public-web/node_modules/next/dist/build/templates/pages.js.map
generated
vendored
Normal file
1
apps/public-web/node_modules/next/dist/build/templates/pages.js.map
generated
vendored
Normal 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'\n\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'\nimport { getHandler } from '../../server/route-modules/pages/pages-handler'\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 distDir: process.env.__NEXT_RELATIVE_DIST_DIR || '',\n relativeProjectDir: process.env.__NEXT_RELATIVE_PROJECT_DIR || '',\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\nexport const handler = getHandler({\n srcPage: 'VAR_DEFINITION_PAGE',\n config,\n userland,\n routeModule,\n getStaticPaths,\n getStaticProps,\n getServerSideProps,\n})\n"],"names":["config","getServerSideProps","getStaticPaths","getStaticProps","handler","reportWebVitals","routeModule","unstable_getServerProps","unstable_getServerSideProps","unstable_getStaticParams","unstable_getStaticPaths","unstable_getStaticProps","hoist","userland","PagesRouteModule","definition","kind","RouteKind","PAGES","page","pathname","bundlePath","filename","distDir","process","env","__NEXT_RELATIVE_DIST_DIR","relativeProjectDir","__NEXT_RELATIVE_PROJECT_DIR","components","App","app","default","Document","document","getHandler","srcPage"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;IAoBaA,MAAM;eAANA;;IAPb,0DAA0D;IAC1D,OAAyC;eAAzC;;IAKaC,kBAAkB;eAAlBA;;IADAC,cAAc;eAAdA;;IADAC,cAAc;eAAdA;;IAgDAC,OAAO;eAAPA;;IA5CAC,eAAe;eAAfA;;IAyBAC,WAAW;eAAXA;;IAVAC,uBAAuB;eAAvBA;;IAIAC,2BAA2B;eAA3BA;;IARAC,wBAAwB;eAAxBA;;IAJAC,uBAAuB;eAAvBA;;IAJAC,uBAAuB;eAAvBA;;;gCAxBoB;2BACP;yBAEJ;6EAGI;wEACL;sEAGK;8BACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAG3B,WAAeC,IAAAA,cAAK,EAACC,eAAU;AAGxB,MAAMV,iBAAiBS,IAAAA,cAAK,EAACC,eAAU;AACvC,MAAMX,iBAAiBU,IAAAA,cAAK,EAACC,eAAU;AACvC,MAAMZ,qBAAqBW,IAAAA,cAAK,EAACC,eAAU;AAC3C,MAAMb,SAASY,IAAAA,cAAK,EAACC,eAAU;AAC/B,MAAMR,kBAAkBO,IAAAA,cAAK,EAACC,eAAU;AAGxC,MAAMF,0BAA0BC,IAAAA,cAAK,EAC1CC,eACA;AAEK,MAAMH,0BAA0BE,IAAAA,cAAK,EAC1CC,eACA;AAEK,MAAMJ,2BAA2BG,IAAAA,cAAK,EAC3CC,eACA;AAEK,MAAMN,0BAA0BK,IAAAA,cAAK,EAC1CC,eACA;AAEK,MAAML,8BAA8BI,IAAAA,cAAK,EAC9CC,eACA;AAIK,MAAMP,cAAc,IAAIQ,gCAAgB,CAAC;IAC9CC,YAAY;QACVC,MAAMC,oBAAS,CAACC,KAAK;QACrBC,MAAM;QACNC,UAAU;QACV,2CAA2C;QAC3CC,YAAY;QACZC,UAAU;IACZ;IACAC,SAASC,QAAQC,GAAG,CAACC,wBAAwB,IAAI;IACjDC,oBAAoBH,QAAQC,GAAG,CAACG,2BAA2B,IAAI;IAC/DC,YAAY;QACV,8DAA8D;QAC9DC,KAAKC,gBAAIC,OAAO;QAChBC,UAAUC,qBAASF,OAAO;IAC5B;IACAnB,UAAAA;AACF;AAEO,MAAMT,UAAU+B,IAAAA,wBAAU,EAAC;IAChCC,SAAS;IACTpC;IACAa,UAAAA;IACAP;IACAJ;IACAC;IACAF;AACF","ignoreList":[0]}
|
||||
Reference in New Issue
Block a user