Initial boiler plate project
This commit is contained in:
14
node_modules/next/dist/export/helpers/create-incremental-cache.d.ts
generated
vendored
Normal file
14
node_modules/next/dist/export/helpers/create-incremental-cache.d.ts
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
import type { NextEnabledDirectories } from '../../server/base-server';
|
||||
import { IncrementalCache } from '../../server/lib/incremental-cache';
|
||||
export declare function createIncrementalCache({ cacheHandler, cacheMaxMemorySize, fetchCacheKeyPrefix, distDir, dir, enabledDirectories, experimental, flushToDisk, }: {
|
||||
cacheHandler?: string;
|
||||
cacheMaxMemorySize?: number;
|
||||
fetchCacheKeyPrefix?: string;
|
||||
distDir: string;
|
||||
dir: string;
|
||||
enabledDirectories: NextEnabledDirectories;
|
||||
experimental: {
|
||||
ppr: boolean;
|
||||
};
|
||||
flushToDisk?: boolean;
|
||||
}): Promise<IncrementalCache>;
|
||||
58
node_modules/next/dist/export/helpers/create-incremental-cache.js
generated
vendored
Normal file
58
node_modules/next/dist/export/helpers/create-incremental-cache.js
generated
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "createIncrementalCache", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return createIncrementalCache;
|
||||
}
|
||||
});
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
||||
const _incrementalcache = require("../../server/lib/incremental-cache");
|
||||
const _ciinfo = require("../../telemetry/ci-info");
|
||||
const _nodefsmethods = require("../../server/lib/node-fs-methods");
|
||||
const _interopdefault = require("../../lib/interop-default");
|
||||
const _formatdynamicimportpath = require("../../lib/format-dynamic-import-path");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
async function createIncrementalCache({ cacheHandler, cacheMaxMemorySize, fetchCacheKeyPrefix, distDir, dir, enabledDirectories, experimental, flushToDisk }) {
|
||||
// Custom cache handler overrides.
|
||||
let CacheHandler;
|
||||
if (cacheHandler) {
|
||||
CacheHandler = (0, _interopdefault.interopDefault)(await import((0, _formatdynamicimportpath.formatDynamicImportPath)(dir, cacheHandler)).then((mod)=>mod.default || mod));
|
||||
}
|
||||
const incrementalCache = new _incrementalcache.IncrementalCache({
|
||||
dev: false,
|
||||
requestHeaders: {},
|
||||
flushToDisk,
|
||||
fetchCache: true,
|
||||
maxMemoryCacheSize: cacheMaxMemorySize,
|
||||
fetchCacheKeyPrefix,
|
||||
getPrerenderManifest: ()=>({
|
||||
version: 4,
|
||||
routes: {},
|
||||
dynamicRoutes: {},
|
||||
preview: {
|
||||
previewModeEncryptionKey: "",
|
||||
previewModeId: "",
|
||||
previewModeSigningKey: ""
|
||||
},
|
||||
notFoundRoutes: []
|
||||
}),
|
||||
fs: _nodefsmethods.nodeFs,
|
||||
pagesDir: enabledDirectories.pages,
|
||||
appDir: enabledDirectories.app,
|
||||
serverDistDir: _path.default.join(distDir, "server"),
|
||||
CurCacheHandler: CacheHandler,
|
||||
minimalMode: _ciinfo.hasNextSupport,
|
||||
experimental
|
||||
});
|
||||
globalThis.__incrementalCache = incrementalCache;
|
||||
return incrementalCache;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=create-incremental-cache.js.map
|
||||
1
node_modules/next/dist/export/helpers/create-incremental-cache.js.map
generated
vendored
Normal file
1
node_modules/next/dist/export/helpers/create-incremental-cache.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/export/helpers/create-incremental-cache.ts"],"names":["createIncrementalCache","cacheHandler","cacheMaxMemorySize","fetchCacheKeyPrefix","distDir","dir","enabledDirectories","experimental","flushToDisk","CacheHandler","interopDefault","formatDynamicImportPath","then","mod","default","incrementalCache","IncrementalCache","dev","requestHeaders","fetchCache","maxMemoryCacheSize","getPrerenderManifest","version","routes","dynamicRoutes","preview","previewModeEncryptionKey","previewModeId","previewModeSigningKey","notFoundRoutes","fs","nodeFs","pagesDir","pages","appDir","app","serverDistDir","path","join","CurCacheHandler","minimalMode","hasNextSupport","globalThis","__incrementalCache"],"mappings":";;;;+BASsBA;;;eAAAA;;;6DAPL;kCACgB;wBACF;+BACR;gCACQ;yCACS;;;;;;AAEjC,eAAeA,uBAAuB,EAC3CC,YAAY,EACZC,kBAAkB,EAClBC,mBAAmB,EACnBC,OAAO,EACPC,GAAG,EACHC,kBAAkB,EAClBC,YAAY,EACZC,WAAW,EAUZ;IACC,kCAAkC;IAClC,IAAIC;IACJ,IAAIR,cAAc;QAChBQ,eAAeC,IAAAA,8BAAc,EAC3B,MAAM,MAAM,CAACC,IAAAA,gDAAuB,EAACN,KAAKJ,eAAeW,IAAI,CAC3D,CAACC,MAAQA,IAAIC,OAAO,IAAID;IAG9B;IAEA,MAAME,mBAAmB,IAAIC,kCAAgB,CAAC;QAC5CC,KAAK;QACLC,gBAAgB,CAAC;QACjBV;QACAW,YAAY;QACZC,oBAAoBlB;QACpBC;QACAkB,sBAAsB,IAAO,CAAA;gBAC3BC,SAAS;gBACTC,QAAQ,CAAC;gBACTC,eAAe,CAAC;gBAChBC,SAAS;oBACPC,0BAA0B;oBAC1BC,eAAe;oBACfC,uBAAuB;gBACzB;gBACAC,gBAAgB,EAAE;YACpB,CAAA;QACAC,IAAIC,qBAAM;QACVC,UAAU1B,mBAAmB2B,KAAK;QAClCC,QAAQ5B,mBAAmB6B,GAAG;QAC9BC,eAAeC,aAAI,CAACC,IAAI,CAAClC,SAAS;QAClCmC,iBAAiB9B;QACjB+B,aAAaC,sBAAc;QAC3BlC;IACF;IAEEmC,WAAmBC,kBAAkB,GAAG5B;IAE1C,OAAOA;AACT"}
|
||||
7
node_modules/next/dist/export/helpers/get-params.d.ts
generated
vendored
Normal file
7
node_modules/next/dist/export/helpers/get-params.d.ts
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Gets the params for the provided page.
|
||||
* @param page the page that contains dynamic path parameters
|
||||
* @param pathname the pathname to match
|
||||
* @returns the matches that were found, throws otherwise
|
||||
*/
|
||||
export declare function getParams(page: string, pathname: string): import("../../shared/lib/router/utils/route-matcher").Params;
|
||||
32
node_modules/next/dist/export/helpers/get-params.js
generated
vendored
Normal file
32
node_modules/next/dist/export/helpers/get-params.js
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "getParams", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return getParams;
|
||||
}
|
||||
});
|
||||
const _routematcher = require("../../shared/lib/router/utils/route-matcher");
|
||||
const _routeregex = require("../../shared/lib/router/utils/route-regex");
|
||||
// The last page and matcher that this function handled.
|
||||
let last = null;
|
||||
function getParams(page, pathname) {
|
||||
// Because this is often called on the output of `getStaticPaths` or similar
|
||||
// where the `page` here doesn't change, this will "remember" the last page
|
||||
// it created the RegExp for. If it matches, it'll just re-use it.
|
||||
let matcher;
|
||||
if ((last == null ? void 0 : last.page) === page) {
|
||||
matcher = last.matcher;
|
||||
} else {
|
||||
matcher = (0, _routematcher.getRouteMatcher)((0, _routeregex.getRouteRegex)(page));
|
||||
}
|
||||
const params = matcher(pathname);
|
||||
if (!params) {
|
||||
throw new Error(`The provided export path '${pathname}' doesn't match the '${page}' page.\nRead more: https://nextjs.org/docs/messages/export-path-mismatch`);
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=get-params.js.map
|
||||
1
node_modules/next/dist/export/helpers/get-params.js.map
generated
vendored
Normal file
1
node_modules/next/dist/export/helpers/get-params.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/export/helpers/get-params.ts"],"names":["getParams","last","page","pathname","matcher","getRouteMatcher","getRouteRegex","params","Error"],"mappings":";;;;+BAkBgBA;;;eAAAA;;;8BAfT;4BACuB;AAE9B,wDAAwD;AACxD,IAAIC,OAGO;AAQJ,SAASD,UAAUE,IAAY,EAAEC,QAAgB;IACtD,4EAA4E;IAC5E,2EAA2E;IAC3E,kEAAkE;IAClE,IAAIC;IACJ,IAAIH,CAAAA,wBAAAA,KAAMC,IAAI,MAAKA,MAAM;QACvBE,UAAUH,KAAKG,OAAO;IACxB,OAAO;QACLA,UAAUC,IAAAA,6BAAe,EAACC,IAAAA,yBAAa,EAACJ;IAC1C;IAEA,MAAMK,SAASH,QAAQD;IACvB,IAAI,CAACI,QAAQ;QACX,MAAM,IAAIC,MACR,CAAC,0BAA0B,EAAEL,SAAS,qBAAqB,EAAED,KAAK,yEAAyE,CAAC;IAEhJ;IAEA,OAAOK;AACT"}
|
||||
1
node_modules/next/dist/export/helpers/is-dynamic-usage-error.d.ts
generated
vendored
Normal file
1
node_modules/next/dist/export/helpers/is-dynamic-usage-error.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export declare const isDynamicUsageError: (err: unknown) => boolean;
|
||||
16
node_modules/next/dist/export/helpers/is-dynamic-usage-error.js
generated
vendored
Normal file
16
node_modules/next/dist/export/helpers/is-dynamic-usage-error.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "isDynamicUsageError", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return isDynamicUsageError;
|
||||
}
|
||||
});
|
||||
const _hooksservercontext = require("../../client/components/hooks-server-context");
|
||||
const _bailouttocsr = require("../../shared/lib/lazy-dynamic/bailout-to-csr");
|
||||
const _isnavigationsignalerror = require("./is-navigation-signal-error");
|
||||
const isDynamicUsageError = (err)=>(0, _hooksservercontext.isDynamicServerError)(err) || (0, _bailouttocsr.isBailoutToCSRError)(err) || (0, _isnavigationsignalerror.isNavigationSignalError)(err);
|
||||
|
||||
//# sourceMappingURL=is-dynamic-usage-error.js.map
|
||||
1
node_modules/next/dist/export/helpers/is-dynamic-usage-error.js.map
generated
vendored
Normal file
1
node_modules/next/dist/export/helpers/is-dynamic-usage-error.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/export/helpers/is-dynamic-usage-error.ts"],"names":["isDynamicUsageError","err","isDynamicServerError","isBailoutToCSRError","isNavigationSignalError"],"mappings":";;;;+BAIaA;;;eAAAA;;;oCAJwB;8BACD;yCACI;AAEjC,MAAMA,sBAAsB,CAACC,MAClCC,IAAAA,wCAAoB,EAACD,QACrBE,IAAAA,iCAAmB,EAACF,QACpBG,IAAAA,gDAAuB,EAACH"}
|
||||
6
node_modules/next/dist/export/helpers/is-navigation-signal-error.d.ts
generated
vendored
Normal file
6
node_modules/next/dist/export/helpers/is-navigation-signal-error.d.ts
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
/**
|
||||
* Returns true if the error is a navigation signal error. These errors are
|
||||
* thrown by user code to perform navigation operations and interrupt the React
|
||||
* render.
|
||||
*/
|
||||
export declare const isNavigationSignalError: (err: unknown) => boolean;
|
||||
15
node_modules/next/dist/export/helpers/is-navigation-signal-error.js
generated
vendored
Normal file
15
node_modules/next/dist/export/helpers/is-navigation-signal-error.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "isNavigationSignalError", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return isNavigationSignalError;
|
||||
}
|
||||
});
|
||||
const _notfound = require("../../client/components/not-found");
|
||||
const _redirect = require("../../client/components/redirect");
|
||||
const isNavigationSignalError = (err)=>(0, _notfound.isNotFoundError)(err) || (0, _redirect.isRedirectError)(err);
|
||||
|
||||
//# sourceMappingURL=is-navigation-signal-error.js.map
|
||||
1
node_modules/next/dist/export/helpers/is-navigation-signal-error.js.map
generated
vendored
Normal file
1
node_modules/next/dist/export/helpers/is-navigation-signal-error.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/export/helpers/is-navigation-signal-error.ts"],"names":["isNavigationSignalError","err","isNotFoundError","isRedirectError"],"mappings":";;;;+BAQaA;;;eAAAA;;;0BARmB;0BACA;AAOzB,MAAMA,0BAA0B,CAACC,MACtCC,IAAAA,yBAAe,EAACD,QAAQE,IAAAA,yBAAe,EAACF"}
|
||||
8
node_modules/next/dist/export/index.d.ts
generated
vendored
Normal file
8
node_modules/next/dist/export/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
import type { ExportAppResult, ExportAppOptions } from './types';
|
||||
import '../server/require-hook';
|
||||
import type { Span } from '../trace';
|
||||
export declare class ExportError extends Error {
|
||||
code: string;
|
||||
}
|
||||
export declare function exportAppImpl(dir: string, options: Readonly<ExportAppOptions>, span: Span): Promise<ExportAppResult | null>;
|
||||
export default function exportApp(dir: string, options: ExportAppOptions, span: Span): Promise<ExportAppResult | null>;
|
||||
627
node_modules/next/dist/export/index.js
generated
vendored
Normal file
627
node_modules/next/dist/export/index.js
generated
vendored
Normal file
@ -0,0 +1,627 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
ExportError: null,
|
||||
default: null,
|
||||
exportAppImpl: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
ExportError: function() {
|
||||
return ExportError;
|
||||
},
|
||||
default: function() {
|
||||
return exportApp;
|
||||
},
|
||||
exportAppImpl: function() {
|
||||
return exportAppImpl;
|
||||
}
|
||||
});
|
||||
const _picocolors = require("../lib/picocolors");
|
||||
const _findup = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/find-up"));
|
||||
const _fs = require("fs");
|
||||
require("../server/require-hook");
|
||||
const _worker = require("../lib/worker");
|
||||
const _path = require("path");
|
||||
const _index = require("../build/output/index");
|
||||
const _log = /*#__PURE__*/ _interop_require_wildcard(require("../build/output/log"));
|
||||
const _constants = require("../lib/constants");
|
||||
const _recursivecopy = require("../lib/recursive-copy");
|
||||
const _constants1 = require("../shared/lib/constants");
|
||||
const _config = /*#__PURE__*/ _interop_require_default(require("../server/config"));
|
||||
const _events = require("../telemetry/events");
|
||||
const _ciinfo = require("../telemetry/ci-info");
|
||||
const _storage = require("../telemetry/storage");
|
||||
const _normalizepagepath = require("../shared/lib/page-path/normalize-page-path");
|
||||
const _denormalizepagepath = require("../shared/lib/page-path/denormalize-page-path");
|
||||
const _env = require("@next/env");
|
||||
const _isapiroute = require("../lib/is-api-route");
|
||||
const _require = require("../server/require");
|
||||
const _isapprouteroute = require("../lib/is-app-route-route");
|
||||
const _isapppageroute = require("../lib/is-app-page-route");
|
||||
const _iserror = /*#__PURE__*/ _interop_require_default(require("../lib/is-error"));
|
||||
const _needsexperimentalreact = require("../lib/needs-experimental-react");
|
||||
const _formatmanifest = require("../build/manifests/formatter/format-manifest");
|
||||
const _patchfetch = require("../server/lib/patch-fetch");
|
||||
const _turborepoaccesstrace = require("../build/turborepo-access-trace");
|
||||
const _progress = require("../build/progress");
|
||||
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;
|
||||
}
|
||||
class ExportError extends Error {
|
||||
constructor(...args){
|
||||
super(...args);
|
||||
this.code = "NEXT_EXPORT_ERROR";
|
||||
}
|
||||
}
|
||||
function setupWorkers(options, nextConfig) {
|
||||
if (options.exportPageWorker) {
|
||||
return {
|
||||
pages: options.exportPageWorker,
|
||||
app: options.exportAppPageWorker,
|
||||
end: options.endWorker || (()=>Promise.resolve())
|
||||
};
|
||||
}
|
||||
const threads = options.threads || nextConfig.experimental.cpus;
|
||||
if (!options.silent && !options.buildExport) {
|
||||
_log.info(`Launching ${threads} workers`);
|
||||
}
|
||||
const timeout = (nextConfig == null ? void 0 : nextConfig.staticPageGenerationTimeout) || 0;
|
||||
let infoPrinted = false;
|
||||
const worker = new _worker.Worker(require.resolve("./worker"), {
|
||||
timeout: timeout * 1000,
|
||||
onRestart: (_method, [{ path }], attempts)=>{
|
||||
if (attempts >= 3) {
|
||||
throw new ExportError(`Static page generation for ${path} is still timing out after 3 attempts. See more info here https://nextjs.org/docs/messages/static-page-generation-timeout`);
|
||||
}
|
||||
_log.warn(`Restarted static page generation for ${path} because it took more than ${timeout} seconds`);
|
||||
if (!infoPrinted) {
|
||||
_log.warn("See more info here https://nextjs.org/docs/messages/static-page-generation-timeout");
|
||||
infoPrinted = true;
|
||||
}
|
||||
},
|
||||
maxRetries: 0,
|
||||
numWorkers: threads,
|
||||
enableWorkerThreads: nextConfig.experimental.workerThreads,
|
||||
exposedMethods: [
|
||||
"default"
|
||||
]
|
||||
});
|
||||
return {
|
||||
pages: worker.default,
|
||||
end: async ()=>{
|
||||
await worker.end();
|
||||
}
|
||||
};
|
||||
}
|
||||
async function exportAppImpl(dir, options, span) {
|
||||
var _nextConfig_amp, _nextConfig_experimental_amp, _nextConfig_experimental_amp1;
|
||||
dir = (0, _path.resolve)(dir);
|
||||
// attempt to load global env values so they are available in next.config.js
|
||||
span.traceChild("load-dotenv").traceFn(()=>(0, _env.loadEnvConfig)(dir, false, _log));
|
||||
const { enabledDirectories } = options;
|
||||
const nextConfig = options.nextConfig || await span.traceChild("load-next-config").traceAsyncFn(()=>(0, _config.default)(_constants1.PHASE_EXPORT, dir));
|
||||
const distDir = (0, _path.join)(dir, nextConfig.distDir);
|
||||
const telemetry = options.buildExport ? null : new _storage.Telemetry({
|
||||
distDir
|
||||
});
|
||||
if (telemetry) {
|
||||
telemetry.record((0, _events.eventCliSession)(distDir, nextConfig, {
|
||||
webpackVersion: null,
|
||||
cliCommand: "export",
|
||||
isSrcDir: null,
|
||||
hasNowJson: !!await (0, _findup.default)("now.json", {
|
||||
cwd: dir
|
||||
}),
|
||||
isCustomServer: null,
|
||||
turboFlag: false,
|
||||
pagesDir: null,
|
||||
appDir: null
|
||||
}));
|
||||
}
|
||||
const subFolders = nextConfig.trailingSlash && !options.buildExport;
|
||||
if (!options.silent && !options.buildExport) {
|
||||
_log.info(`using build directory: ${distDir}`);
|
||||
}
|
||||
const buildIdFile = (0, _path.join)(distDir, _constants1.BUILD_ID_FILE);
|
||||
if (!(0, _fs.existsSync)(buildIdFile)) {
|
||||
throw new ExportError(`Could not find a production build in the '${distDir}' directory. Try building your app with 'next build' before starting the static export. https://nextjs.org/docs/messages/next-export-no-build-id`);
|
||||
}
|
||||
const customRoutes = [
|
||||
"rewrites",
|
||||
"redirects",
|
||||
"headers"
|
||||
].filter((config)=>typeof nextConfig[config] === "function");
|
||||
if (!_ciinfo.hasNextSupport && !options.buildExport && customRoutes.length > 0) {
|
||||
_log.warn(`rewrites, redirects, and headers are not applied when exporting your application, detected (${customRoutes.join(", ")}). See more info here: https://nextjs.org/docs/messages/export-no-custom-routes`);
|
||||
}
|
||||
const buildId = await _fs.promises.readFile(buildIdFile, "utf8");
|
||||
const pagesManifest = !options.pages && require((0, _path.join)(distDir, _constants1.SERVER_DIRECTORY, _constants1.PAGES_MANIFEST));
|
||||
let prerenderManifest;
|
||||
try {
|
||||
prerenderManifest = require((0, _path.join)(distDir, _constants1.PRERENDER_MANIFEST));
|
||||
} catch {}
|
||||
let appRoutePathManifest;
|
||||
try {
|
||||
appRoutePathManifest = require((0, _path.join)(distDir, _constants1.APP_PATH_ROUTES_MANIFEST));
|
||||
} catch (err) {
|
||||
if ((0, _iserror.default)(err) && (err.code === "ENOENT" || err.code === "MODULE_NOT_FOUND")) {
|
||||
// the manifest doesn't exist which will happen when using
|
||||
// "pages" dir instead of "app" dir.
|
||||
appRoutePathManifest = undefined;
|
||||
} else {
|
||||
// the manifest is malformed (invalid json)
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
const excludedPrerenderRoutes = new Set();
|
||||
const pages = options.pages || Object.keys(pagesManifest);
|
||||
const defaultPathMap = {};
|
||||
let hasApiRoutes = false;
|
||||
for (const page of pages){
|
||||
// _document and _app are not real pages
|
||||
// _error is exported as 404.html later on
|
||||
// API Routes are Node.js functions
|
||||
if ((0, _isapiroute.isAPIRoute)(page)) {
|
||||
hasApiRoutes = true;
|
||||
continue;
|
||||
}
|
||||
if (page === "/_document" || page === "/_app" || page === "/_error") {
|
||||
continue;
|
||||
}
|
||||
// iSSG pages that are dynamic should not export templated version by
|
||||
// default. In most cases, this would never work. There is no server that
|
||||
// could run `getStaticProps`. If users make their page work lazily, they
|
||||
// can manually add it to the `exportPathMap`.
|
||||
if (prerenderManifest == null ? void 0 : prerenderManifest.dynamicRoutes[page]) {
|
||||
excludedPrerenderRoutes.add(page);
|
||||
continue;
|
||||
}
|
||||
defaultPathMap[page] = {
|
||||
page
|
||||
};
|
||||
}
|
||||
const mapAppRouteToPage = new Map();
|
||||
if (!options.buildExport && appRoutePathManifest) {
|
||||
for (const [pageName, routePath] of Object.entries(appRoutePathManifest)){
|
||||
mapAppRouteToPage.set(routePath, pageName);
|
||||
if ((0, _isapppageroute.isAppPageRoute)(pageName) && !(prerenderManifest == null ? void 0 : prerenderManifest.routes[routePath]) && !(prerenderManifest == null ? void 0 : prerenderManifest.dynamicRoutes[routePath])) {
|
||||
defaultPathMap[routePath] = {
|
||||
page: pageName,
|
||||
_isAppDir: true
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
// Initialize the output directory
|
||||
const outDir = options.outdir;
|
||||
if (outDir === (0, _path.join)(dir, "public")) {
|
||||
throw new ExportError(`The 'public' directory is reserved in Next.js and can not be used as the export out directory. https://nextjs.org/docs/messages/can-not-output-to-public`);
|
||||
}
|
||||
if (outDir === (0, _path.join)(dir, "static")) {
|
||||
throw new ExportError(`The 'static' directory is reserved in Next.js and can not be used as the export out directory. https://nextjs.org/docs/messages/can-not-output-to-static`);
|
||||
}
|
||||
await _fs.promises.rm(outDir, {
|
||||
recursive: true,
|
||||
force: true
|
||||
});
|
||||
await _fs.promises.mkdir((0, _path.join)(outDir, "_next", buildId), {
|
||||
recursive: true
|
||||
});
|
||||
await _fs.promises.writeFile((0, _path.join)(distDir, _constants1.EXPORT_DETAIL), (0, _formatmanifest.formatManifest)({
|
||||
version: 1,
|
||||
outDirectory: outDir,
|
||||
success: false
|
||||
}), "utf8");
|
||||
// Copy static directory
|
||||
if (!options.buildExport && (0, _fs.existsSync)((0, _path.join)(dir, "static"))) {
|
||||
if (!options.silent) {
|
||||
_log.info('Copying "static" directory');
|
||||
}
|
||||
await span.traceChild("copy-static-directory").traceAsyncFn(()=>(0, _recursivecopy.recursiveCopy)((0, _path.join)(dir, "static"), (0, _path.join)(outDir, "static")));
|
||||
}
|
||||
// Copy .next/static directory
|
||||
if (!options.buildExport && (0, _fs.existsSync)((0, _path.join)(distDir, _constants1.CLIENT_STATIC_FILES_PATH))) {
|
||||
if (!options.silent) {
|
||||
_log.info('Copying "static build" directory');
|
||||
}
|
||||
await span.traceChild("copy-next-static-directory").traceAsyncFn(()=>(0, _recursivecopy.recursiveCopy)((0, _path.join)(distDir, _constants1.CLIENT_STATIC_FILES_PATH), (0, _path.join)(outDir, "_next", _constants1.CLIENT_STATIC_FILES_PATH)));
|
||||
}
|
||||
// Get the exportPathMap from the config file
|
||||
if (typeof nextConfig.exportPathMap !== "function") {
|
||||
nextConfig.exportPathMap = async (defaultMap)=>{
|
||||
return defaultMap;
|
||||
};
|
||||
}
|
||||
const { i18n, images: { loader = "default", unoptimized } } = nextConfig;
|
||||
if (i18n && !options.buildExport) {
|
||||
throw new ExportError(`i18n support is not compatible with next export. See here for more info on deploying: https://nextjs.org/docs/messages/export-no-custom-routes`);
|
||||
}
|
||||
if (!options.buildExport) {
|
||||
const { isNextImageImported } = await span.traceChild("is-next-image-imported").traceAsyncFn(()=>_fs.promises.readFile((0, _path.join)(distDir, _constants1.EXPORT_MARKER), "utf8").then((text)=>JSON.parse(text)).catch(()=>({})));
|
||||
if (isNextImageImported && loader === "default" && !unoptimized && !_ciinfo.hasNextSupport) {
|
||||
throw new ExportError(`Image Optimization using the default loader is not compatible with export.
|
||||
Possible solutions:
|
||||
- Use \`next start\` to run a server, which includes the Image Optimization API.
|
||||
- Configure \`images.unoptimized = true\` in \`next.config.js\` to disable the Image Optimization API.
|
||||
Read more: https://nextjs.org/docs/messages/export-image-api`);
|
||||
}
|
||||
}
|
||||
let serverActionsManifest;
|
||||
if (enabledDirectories.app) {
|
||||
serverActionsManifest = require((0, _path.join)(distDir, _constants1.SERVER_DIRECTORY, _constants1.SERVER_REFERENCE_MANIFEST + ".json"));
|
||||
if (nextConfig.output === "export") {
|
||||
if (Object.keys(serverActionsManifest.node).length > 0 || Object.keys(serverActionsManifest.edge).length > 0) {
|
||||
throw new ExportError(`Server Actions are not supported with static export.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Start the rendering process
|
||||
const renderOpts = {
|
||||
previewProps: prerenderManifest == null ? void 0 : prerenderManifest.preview,
|
||||
buildId,
|
||||
nextExport: true,
|
||||
assetPrefix: nextConfig.assetPrefix.replace(/\/$/, ""),
|
||||
distDir,
|
||||
dev: false,
|
||||
basePath: nextConfig.basePath,
|
||||
trailingSlash: nextConfig.trailingSlash,
|
||||
canonicalBase: ((_nextConfig_amp = nextConfig.amp) == null ? void 0 : _nextConfig_amp.canonicalBase) || "",
|
||||
ampSkipValidation: ((_nextConfig_experimental_amp = nextConfig.experimental.amp) == null ? void 0 : _nextConfig_experimental_amp.skipValidation) || false,
|
||||
ampOptimizerConfig: ((_nextConfig_experimental_amp1 = nextConfig.experimental.amp) == null ? void 0 : _nextConfig_experimental_amp1.optimizer) || undefined,
|
||||
locales: i18n == null ? void 0 : i18n.locales,
|
||||
locale: i18n == null ? void 0 : i18n.defaultLocale,
|
||||
defaultLocale: i18n == null ? void 0 : i18n.defaultLocale,
|
||||
domainLocales: i18n == null ? void 0 : i18n.domains,
|
||||
disableOptimizedLoading: nextConfig.experimental.disableOptimizedLoading,
|
||||
// Exported pages do not currently support dynamic HTML.
|
||||
supportsDynamicResponse: false,
|
||||
crossOrigin: nextConfig.crossOrigin,
|
||||
optimizeCss: nextConfig.experimental.optimizeCss,
|
||||
nextConfigOutput: nextConfig.output,
|
||||
nextScriptWorkers: nextConfig.experimental.nextScriptWorkers,
|
||||
optimizeFonts: nextConfig.optimizeFonts,
|
||||
largePageDataBytes: nextConfig.experimental.largePageDataBytes,
|
||||
serverActions: nextConfig.experimental.serverActions,
|
||||
serverComponents: enabledDirectories.app,
|
||||
nextFontManifest: require((0, _path.join)(distDir, "server", `${_constants1.NEXT_FONT_MANIFEST}.json`)),
|
||||
images: nextConfig.images,
|
||||
...enabledDirectories.app ? {
|
||||
serverActionsManifest
|
||||
} : {},
|
||||
strictNextHead: !!nextConfig.experimental.strictNextHead,
|
||||
deploymentId: nextConfig.deploymentId,
|
||||
experimental: {
|
||||
ppr: nextConfig.experimental.ppr === true,
|
||||
missingSuspenseWithCSRBailout: nextConfig.experimental.missingSuspenseWithCSRBailout === true,
|
||||
swrDelta: nextConfig.experimental.swrDelta
|
||||
}
|
||||
};
|
||||
const { serverRuntimeConfig, publicRuntimeConfig } = nextConfig;
|
||||
if (Object.keys(publicRuntimeConfig).length > 0) {
|
||||
renderOpts.runtimeConfig = publicRuntimeConfig;
|
||||
}
|
||||
globalThis.__NEXT_DATA__ = {
|
||||
nextExport: true
|
||||
};
|
||||
const exportPathMap = await span.traceChild("run-export-path-map").traceAsyncFn(async ()=>{
|
||||
const exportMap = await nextConfig.exportPathMap(defaultPathMap, {
|
||||
dev: false,
|
||||
dir,
|
||||
outDir,
|
||||
distDir,
|
||||
buildId
|
||||
});
|
||||
return exportMap;
|
||||
});
|
||||
// only add missing 404 page when `buildExport` is false
|
||||
if (!options.buildExport) {
|
||||
// only add missing /404 if not specified in `exportPathMap`
|
||||
if (!exportPathMap["/404"]) {
|
||||
exportPathMap["/404"] = {
|
||||
page: "/_error"
|
||||
};
|
||||
}
|
||||
/**
|
||||
* exports 404.html for backwards compat
|
||||
* E.g. GitHub Pages, GitLab Pages, Cloudflare Pages, Netlify
|
||||
*/ if (!exportPathMap["/404.html"]) {
|
||||
// alias /404.html to /404 to be compatible with custom 404 / _error page
|
||||
exportPathMap["/404.html"] = exportPathMap["/404"];
|
||||
}
|
||||
}
|
||||
// make sure to prevent duplicates
|
||||
const exportPaths = [
|
||||
...new Set(Object.keys(exportPathMap).map((path)=>(0, _denormalizepagepath.denormalizePagePath)((0, _normalizepagepath.normalizePagePath)(path))))
|
||||
];
|
||||
const filteredPaths = exportPaths.filter((route)=>exportPathMap[route]._isAppDir || // Remove API routes
|
||||
!(0, _isapiroute.isAPIRoute)(exportPathMap[route].page));
|
||||
if (filteredPaths.length !== exportPaths.length) {
|
||||
hasApiRoutes = true;
|
||||
}
|
||||
if (filteredPaths.length === 0) {
|
||||
return null;
|
||||
}
|
||||
if (prerenderManifest && !options.buildExport) {
|
||||
const fallbackEnabledPages = new Set();
|
||||
for (const path of Object.keys(exportPathMap)){
|
||||
const page = exportPathMap[path].page;
|
||||
const prerenderInfo = prerenderManifest.dynamicRoutes[page];
|
||||
if (prerenderInfo && prerenderInfo.fallback !== false) {
|
||||
fallbackEnabledPages.add(page);
|
||||
}
|
||||
}
|
||||
if (fallbackEnabledPages.size > 0) {
|
||||
throw new ExportError(`Found pages with \`fallback\` enabled:\n${[
|
||||
...fallbackEnabledPages
|
||||
].join("\n")}\n${_constants.SSG_FALLBACK_EXPORT_ERROR}\n`);
|
||||
}
|
||||
}
|
||||
let hasMiddleware = false;
|
||||
if (!options.buildExport) {
|
||||
try {
|
||||
const middlewareManifest = require((0, _path.join)(distDir, _constants1.SERVER_DIRECTORY, _constants1.MIDDLEWARE_MANIFEST));
|
||||
hasMiddleware = Object.keys(middlewareManifest.middleware).length > 0;
|
||||
} catch {}
|
||||
// Warn if the user defines a path for an API page
|
||||
if (hasApiRoutes || hasMiddleware) {
|
||||
if (nextConfig.output === "export") {
|
||||
_log.warn((0, _picocolors.yellow)(`Statically exporting a Next.js application via \`next export\` disables API routes and middleware.`) + `\n` + (0, _picocolors.yellow)(`This command is meant for static-only hosts, and is` + " " + (0, _picocolors.bold)(`not necessary to make your application static.`)) + `\n` + (0, _picocolors.yellow)(`Pages in your application without server-side data dependencies will be automatically statically exported by \`next build\`, including pages powered by \`getStaticProps\`.`) + `\n` + (0, _picocolors.yellow)(`Learn more: https://nextjs.org/docs/messages/api-routes-static-export`));
|
||||
}
|
||||
}
|
||||
}
|
||||
const progress = !options.silent && (0, _progress.createProgress)(filteredPaths.length, options.statusMessage || "Exporting");
|
||||
const pagesDataDir = options.buildExport ? outDir : (0, _path.join)(outDir, "_next/data", buildId);
|
||||
const ampValidations = {};
|
||||
const publicDir = (0, _path.join)(dir, _constants1.CLIENT_PUBLIC_FILES_PATH);
|
||||
// Copy public directory
|
||||
if (!options.buildExport && (0, _fs.existsSync)(publicDir)) {
|
||||
if (!options.silent) {
|
||||
_log.info('Copying "public" directory');
|
||||
}
|
||||
await span.traceChild("copy-public-directory").traceAsyncFn(()=>(0, _recursivecopy.recursiveCopy)(publicDir, outDir, {
|
||||
filter (path) {
|
||||
// Exclude paths used by pages
|
||||
return !exportPathMap[path];
|
||||
}
|
||||
}));
|
||||
}
|
||||
const workers = setupWorkers(options, nextConfig);
|
||||
const results = await Promise.all(filteredPaths.map(async (path)=>{
|
||||
const pathMap = exportPathMap[path];
|
||||
const exportPage = workers[pathMap._isAppDir ? "app" : "pages"];
|
||||
if (!exportPage) {
|
||||
throw new Error("Invariant: Undefined export worker for app dir, this is a bug in Next.js.");
|
||||
}
|
||||
const pageExportSpan = span.traceChild("export-page");
|
||||
pageExportSpan.setAttribute("path", path);
|
||||
const result = await pageExportSpan.traceAsyncFn(async ()=>{
|
||||
var _nextConfig_experimental_amp;
|
||||
return await exportPage({
|
||||
dir,
|
||||
path,
|
||||
pathMap,
|
||||
distDir,
|
||||
outDir,
|
||||
pagesDataDir,
|
||||
renderOpts,
|
||||
ampValidatorPath: ((_nextConfig_experimental_amp = nextConfig.experimental.amp) == null ? void 0 : _nextConfig_experimental_amp.validator) || undefined,
|
||||
trailingSlash: nextConfig.trailingSlash,
|
||||
serverRuntimeConfig,
|
||||
subFolders,
|
||||
buildExport: options.buildExport,
|
||||
optimizeFonts: nextConfig.optimizeFonts,
|
||||
optimizeCss: nextConfig.experimental.optimizeCss,
|
||||
disableOptimizedLoading: nextConfig.experimental.disableOptimizedLoading,
|
||||
parentSpanId: pageExportSpan.getId(),
|
||||
httpAgentOptions: nextConfig.httpAgentOptions,
|
||||
debugOutput: options.debugOutput,
|
||||
cacheMaxMemorySize: nextConfig.cacheMaxMemorySize,
|
||||
fetchCache: true,
|
||||
fetchCacheKeyPrefix: nextConfig.experimental.fetchCacheKeyPrefix,
|
||||
cacheHandler: nextConfig.cacheHandler,
|
||||
enableExperimentalReact: (0, _needsexperimentalreact.needsExperimentalReact)(nextConfig),
|
||||
enabledDirectories
|
||||
});
|
||||
});
|
||||
if (nextConfig.experimental.prerenderEarlyExit) {
|
||||
if (result && "error" in result) {
|
||||
throw new Error(`Export encountered an error on ${path}, exiting due to prerenderEarlyExit: true being set`);
|
||||
}
|
||||
}
|
||||
if (progress) progress();
|
||||
return {
|
||||
result,
|
||||
path
|
||||
};
|
||||
}));
|
||||
const errorPaths = [];
|
||||
let renderError = false;
|
||||
let hadValidationError = false;
|
||||
const collector = {
|
||||
byPath: new Map(),
|
||||
byPage: new Map(),
|
||||
ssgNotFoundPaths: new Set(),
|
||||
turborepoAccessTraceResults: new Map()
|
||||
};
|
||||
for (const { result, path } of results){
|
||||
if (!result) continue;
|
||||
const { page } = exportPathMap[path];
|
||||
if (result.turborepoAccessTraceResult) {
|
||||
var _collector_turborepoAccessTraceResults;
|
||||
(_collector_turborepoAccessTraceResults = collector.turborepoAccessTraceResults) == null ? void 0 : _collector_turborepoAccessTraceResults.set(path, _turborepoaccesstrace.TurborepoAccessTraceResult.fromSerialized(result.turborepoAccessTraceResult));
|
||||
}
|
||||
// Capture any render errors.
|
||||
if ("error" in result) {
|
||||
renderError = true;
|
||||
errorPaths.push(page !== path ? `${page}: ${path}` : path);
|
||||
continue;
|
||||
}
|
||||
// Capture any amp validations.
|
||||
if (result.ampValidations) {
|
||||
for (const validation of result.ampValidations){
|
||||
ampValidations[validation.page] = validation.result;
|
||||
hadValidationError ||= validation.result.errors.length > 0;
|
||||
}
|
||||
}
|
||||
if (options.buildExport) {
|
||||
// Update path info by path.
|
||||
const info = collector.byPath.get(path) ?? {};
|
||||
if (typeof result.revalidate !== "undefined") {
|
||||
info.revalidate = (0, _patchfetch.validateRevalidate)(result.revalidate, path);
|
||||
}
|
||||
if (typeof result.metadata !== "undefined") {
|
||||
info.metadata = result.metadata;
|
||||
}
|
||||
if (typeof result.hasEmptyPrelude !== "undefined") {
|
||||
info.hasEmptyPrelude = result.hasEmptyPrelude;
|
||||
}
|
||||
if (typeof result.hasPostponed !== "undefined") {
|
||||
info.hasPostponed = result.hasPostponed;
|
||||
}
|
||||
collector.byPath.set(path, info);
|
||||
// Update not found.
|
||||
if (result.ssgNotFound === true) {
|
||||
collector.ssgNotFoundPaths.add(path);
|
||||
}
|
||||
// Update durations.
|
||||
const durations = collector.byPage.get(page) ?? {
|
||||
durationsByPath: new Map()
|
||||
};
|
||||
durations.durationsByPath.set(path, result.duration);
|
||||
collector.byPage.set(page, durations);
|
||||
}
|
||||
}
|
||||
const endWorkerPromise = workers.end();
|
||||
// Export mode provide static outputs that are not compatible with PPR mode.
|
||||
if (!options.buildExport && nextConfig.experimental.ppr) {
|
||||
// TODO: add message
|
||||
throw new Error("Invariant: PPR cannot be enabled in export mode");
|
||||
}
|
||||
// copy prerendered routes to outDir
|
||||
if (!options.buildExport && prerenderManifest) {
|
||||
await Promise.all(Object.keys(prerenderManifest.routes).map(async (route)=>{
|
||||
const { srcRoute } = prerenderManifest.routes[route];
|
||||
const appPageName = mapAppRouteToPage.get(srcRoute || "");
|
||||
const pageName = appPageName || srcRoute || route;
|
||||
const isAppPath = Boolean(appPageName);
|
||||
const isAppRouteHandler = appPageName && (0, _isapprouteroute.isAppRouteRoute)(appPageName);
|
||||
// returning notFound: true from getStaticProps will not
|
||||
// output html/json files during the build
|
||||
if (prerenderManifest.notFoundRoutes.includes(route)) {
|
||||
return;
|
||||
}
|
||||
route = (0, _normalizepagepath.normalizePagePath)(route);
|
||||
const pagePath = (0, _require.getPagePath)(pageName, distDir, undefined, isAppPath);
|
||||
const distPagesDir = (0, _path.join)(pagePath, // strip leading / and then recurse number of nested dirs
|
||||
// to place from base folder
|
||||
pageName.slice(1).split("/").map(()=>"..").join("/"));
|
||||
const orig = (0, _path.join)(distPagesDir, route);
|
||||
const handlerSrc = `${orig}.body`;
|
||||
const handlerDest = (0, _path.join)(outDir, route);
|
||||
if (isAppRouteHandler && (0, _fs.existsSync)(handlerSrc)) {
|
||||
await _fs.promises.mkdir((0, _path.dirname)(handlerDest), {
|
||||
recursive: true
|
||||
});
|
||||
await _fs.promises.copyFile(handlerSrc, handlerDest);
|
||||
return;
|
||||
}
|
||||
const htmlDest = (0, _path.join)(outDir, `${route}${subFolders && route !== "/index" ? `${_path.sep}index` : ""}.html`);
|
||||
const ampHtmlDest = (0, _path.join)(outDir, `${route}.amp${subFolders ? `${_path.sep}index` : ""}.html`);
|
||||
const jsonDest = isAppPath ? (0, _path.join)(outDir, `${route}${subFolders && route !== "/index" ? `${_path.sep}index` : ""}.txt`) : (0, _path.join)(pagesDataDir, `${route}.json`);
|
||||
await _fs.promises.mkdir((0, _path.dirname)(htmlDest), {
|
||||
recursive: true
|
||||
});
|
||||
await _fs.promises.mkdir((0, _path.dirname)(jsonDest), {
|
||||
recursive: true
|
||||
});
|
||||
const htmlSrc = `${orig}.html`;
|
||||
const jsonSrc = `${orig}${isAppPath ? _constants.RSC_SUFFIX : ".json"}`;
|
||||
await _fs.promises.copyFile(htmlSrc, htmlDest);
|
||||
await _fs.promises.copyFile(jsonSrc, jsonDest);
|
||||
if ((0, _fs.existsSync)(`${orig}.amp.html`)) {
|
||||
await _fs.promises.mkdir((0, _path.dirname)(ampHtmlDest), {
|
||||
recursive: true
|
||||
});
|
||||
await _fs.promises.copyFile(`${orig}.amp.html`, ampHtmlDest);
|
||||
}
|
||||
}));
|
||||
}
|
||||
if (Object.keys(ampValidations).length) {
|
||||
console.log((0, _index.formatAmpMessages)(ampValidations));
|
||||
}
|
||||
if (hadValidationError) {
|
||||
throw new ExportError(`AMP Validation caused the export to fail. https://nextjs.org/docs/messages/amp-export-validation`);
|
||||
}
|
||||
if (renderError) {
|
||||
throw new ExportError(`Export encountered errors on following paths:\n\t${errorPaths.sort().join("\n ")}`);
|
||||
}
|
||||
await _fs.promises.writeFile((0, _path.join)(distDir, _constants1.EXPORT_DETAIL), (0, _formatmanifest.formatManifest)({
|
||||
version: 1,
|
||||
outDirectory: outDir,
|
||||
success: true
|
||||
}), "utf8");
|
||||
if (telemetry) {
|
||||
await telemetry.flush();
|
||||
}
|
||||
await endWorkerPromise;
|
||||
return collector;
|
||||
}
|
||||
async function exportApp(dir, options, span) {
|
||||
const nextExportSpan = span.traceChild("next-export");
|
||||
return nextExportSpan.traceAsyncFn(async ()=>{
|
||||
return await exportAppImpl(dir, options, nextExportSpan);
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/next/dist/export/index.js.map
generated
vendored
Normal file
1
node_modules/next/dist/export/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
12
node_modules/next/dist/export/routes/app-page.d.ts
generated
vendored
Normal file
12
node_modules/next/dist/export/routes/app-page.d.ts
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
import type { ExportRouteResult, FileWriter } from '../types';
|
||||
import type { RenderOpts } from '../../server/app-render/types';
|
||||
import type { NextParsedUrlQuery } from '../../server/request-meta';
|
||||
import type { MockedRequest, MockedResponse } from '../../server/lib/mock-request';
|
||||
export declare const enum ExportedAppPageFiles {
|
||||
HTML = "HTML",
|
||||
FLIGHT = "FLIGHT",
|
||||
PREFETCH_FLIGHT = "PREFETCH_FLIGHT",
|
||||
META = "META",
|
||||
POSTPONED = "POSTPONED"
|
||||
}
|
||||
export declare function exportAppPage(req: MockedRequest, res: MockedResponse, page: string, path: string, pathname: string, query: NextParsedUrlQuery, renderOpts: RenderOpts, htmlFilepath: string, debugOutput: boolean, isDynamicError: boolean, fileWriter: FileWriter): Promise<ExportRouteResult>;
|
||||
148
node_modules/next/dist/export/routes/app-page.js
generated
vendored
Normal file
148
node_modules/next/dist/export/routes/app-page.js
generated
vendored
Normal file
@ -0,0 +1,148 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
ExportedAppPageFiles: null,
|
||||
exportAppPage: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
ExportedAppPageFiles: function() {
|
||||
return ExportedAppPageFiles;
|
||||
},
|
||||
exportAppPage: function() {
|
||||
return exportAppPage;
|
||||
}
|
||||
});
|
||||
const _isdynamicusageerror = require("../helpers/is-dynamic-usage-error");
|
||||
const _constants = require("../../lib/constants");
|
||||
const _ciinfo = require("../../telemetry/ci-info");
|
||||
const _modulerender = require("../../server/future/route-modules/app-page/module.render");
|
||||
const _bailouttocsr = require("../../shared/lib/lazy-dynamic/bailout-to-csr");
|
||||
var ExportedAppPageFiles;
|
||||
(function(ExportedAppPageFiles) {
|
||||
ExportedAppPageFiles["HTML"] = "HTML";
|
||||
ExportedAppPageFiles["FLIGHT"] = "FLIGHT";
|
||||
ExportedAppPageFiles["PREFETCH_FLIGHT"] = "PREFETCH_FLIGHT";
|
||||
ExportedAppPageFiles["META"] = "META";
|
||||
ExportedAppPageFiles["POSTPONED"] = "POSTPONED";
|
||||
})(ExportedAppPageFiles || (ExportedAppPageFiles = {}));
|
||||
async function exportAppPage(req, res, page, path, pathname, query, renderOpts, htmlFilepath, debugOutput, isDynamicError, fileWriter) {
|
||||
let isDefaultNotFound = false;
|
||||
// If the page is `/_not-found`, then we should update the page to be `/404`.
|
||||
// UNDERSCORE_NOT_FOUND_ROUTE value used here, however we don't want to import it here as it causes constants to be inlined which we don't want here.
|
||||
if (page === "/_not-found/page") {
|
||||
isDefaultNotFound = true;
|
||||
pathname = "/404";
|
||||
}
|
||||
try {
|
||||
const result = await (0, _modulerender.lazyRenderAppPage)(req, res, pathname, query, renderOpts);
|
||||
const html = result.toUnchunkedString();
|
||||
const { metadata } = result;
|
||||
const { flightData, revalidate = false, postponed, fetchTags } = metadata;
|
||||
// Ensure we don't postpone without having PPR enabled.
|
||||
if (postponed && !renderOpts.experimental.ppr) {
|
||||
throw new Error("Invariant: page postponed without PPR being enabled");
|
||||
}
|
||||
if (revalidate === 0) {
|
||||
if (isDynamicError) {
|
||||
throw new Error(`Page with dynamic = "error" encountered dynamic data method on ${path}.`);
|
||||
}
|
||||
const { staticBailoutInfo = {} } = metadata;
|
||||
if (revalidate === 0 && debugOutput && (staticBailoutInfo == null ? void 0 : staticBailoutInfo.description)) {
|
||||
logDynamicUsageWarning({
|
||||
path,
|
||||
description: staticBailoutInfo.description,
|
||||
stack: staticBailoutInfo.stack
|
||||
});
|
||||
}
|
||||
return {
|
||||
revalidate: 0
|
||||
};
|
||||
} else if (!flightData) {
|
||||
throw new Error(`Invariant: failed to get page data for ${path}`);
|
||||
} else if (renderOpts.experimental.ppr) {
|
||||
// If PPR is enabled, we should emit the flight data as the prefetch
|
||||
// payload.
|
||||
await fileWriter("PREFETCH_FLIGHT", htmlFilepath.replace(/\.html$/, _constants.RSC_PREFETCH_SUFFIX), flightData);
|
||||
} else {
|
||||
// Writing the RSC payload to a file if we don't have PPR enabled.
|
||||
await fileWriter("FLIGHT", htmlFilepath.replace(/\.html$/, _constants.RSC_SUFFIX), flightData);
|
||||
}
|
||||
const headers = {
|
||||
...metadata.headers
|
||||
};
|
||||
// When PPR is enabled, we should grab the headers from the mocked response
|
||||
// and add it to the headers.
|
||||
if (renderOpts.experimental.ppr) {
|
||||
Object.assign(headers, res.getHeaders());
|
||||
}
|
||||
if (fetchTags) {
|
||||
headers[_constants.NEXT_CACHE_TAGS_HEADER] = fetchTags;
|
||||
}
|
||||
// Writing static HTML to a file.
|
||||
await fileWriter("HTML", htmlFilepath, html ?? "", "utf8");
|
||||
const isParallelRoute = /\/@\w+/.test(page);
|
||||
const isNonSuccessfulStatusCode = res.statusCode > 300;
|
||||
// When PPR is enabled, we don't always send 200 for routes that have been
|
||||
// pregenerated, so we should grab the status code from the mocked
|
||||
// response.
|
||||
let status = renderOpts.experimental.ppr ? res.statusCode : undefined;
|
||||
if (isDefaultNotFound) {
|
||||
// Override the default /_not-found page status code to 404
|
||||
status = 404;
|
||||
} else if (isNonSuccessfulStatusCode && !isParallelRoute) {
|
||||
// If it's parallel route the status from mock response is 404
|
||||
status = res.statusCode;
|
||||
}
|
||||
// Writing the request metadata to a file.
|
||||
const meta = {
|
||||
status,
|
||||
headers,
|
||||
postponed
|
||||
};
|
||||
await fileWriter("META", htmlFilepath.replace(/\.html$/, _constants.NEXT_META_SUFFIX), JSON.stringify(meta, null, 2));
|
||||
return {
|
||||
// Only include the metadata if the environment has next support.
|
||||
metadata: _ciinfo.hasNextSupport ? meta : undefined,
|
||||
hasEmptyPrelude: Boolean(postponed) && html === "",
|
||||
hasPostponed: Boolean(postponed),
|
||||
revalidate
|
||||
};
|
||||
} catch (err) {
|
||||
if (!(0, _isdynamicusageerror.isDynamicUsageError)(err)) {
|
||||
throw err;
|
||||
}
|
||||
// If enabled, we should fail rendering if a client side rendering bailout
|
||||
// occurred at the page level.
|
||||
if (renderOpts.experimental.missingSuspenseWithCSRBailout && (0, _bailouttocsr.isBailoutToCSRError)(err)) {
|
||||
throw err;
|
||||
}
|
||||
if (debugOutput) {
|
||||
const { dynamicUsageDescription, dynamicUsageStack } = renderOpts.store;
|
||||
logDynamicUsageWarning({
|
||||
path,
|
||||
description: dynamicUsageDescription,
|
||||
stack: dynamicUsageStack
|
||||
});
|
||||
}
|
||||
return {
|
||||
revalidate: 0
|
||||
};
|
||||
}
|
||||
}
|
||||
function logDynamicUsageWarning({ path, description, stack }) {
|
||||
const errMessage = new Error(`Static generation failed due to dynamic usage on ${path}, reason: ${description}`);
|
||||
if (stack) {
|
||||
errMessage.stack = errMessage.message + stack.substring(stack.indexOf("\n"));
|
||||
}
|
||||
console.warn(errMessage);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-page.js.map
|
||||
1
node_modules/next/dist/export/routes/app-page.js.map
generated
vendored
Normal file
1
node_modules/next/dist/export/routes/app-page.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/export/routes/app-page.ts"],"names":["exportAppPage","ExportedAppPageFiles","req","res","page","path","pathname","query","renderOpts","htmlFilepath","debugOutput","isDynamicError","fileWriter","isDefaultNotFound","result","lazyRenderAppPage","html","toUnchunkedString","metadata","flightData","revalidate","postponed","fetchTags","experimental","ppr","Error","staticBailoutInfo","description","logDynamicUsageWarning","stack","replace","RSC_PREFETCH_SUFFIX","RSC_SUFFIX","headers","Object","assign","getHeaders","NEXT_CACHE_TAGS_HEADER","isParallelRoute","test","isNonSuccessfulStatusCode","statusCode","status","undefined","meta","NEXT_META_SUFFIX","JSON","stringify","hasNextSupport","hasEmptyPrelude","Boolean","hasPostponed","err","isDynamicUsageError","missingSuspenseWithCSRBailout","isBailoutToCSRError","dynamicUsageDescription","dynamicUsageStack","store","errMessage","message","substring","indexOf","console","warn"],"mappings":"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"}
|
||||
10
node_modules/next/dist/export/routes/app-route.d.ts
generated
vendored
Normal file
10
node_modules/next/dist/export/routes/app-route.d.ts
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
import type { ExportRouteResult, FileWriter } from '../types';
|
||||
import type { IncrementalCache } from '../../server/lib/incremental-cache';
|
||||
import type { MockedRequest, MockedResponse } from '../../server/lib/mock-request';
|
||||
export declare const enum ExportedAppRouteFiles {
|
||||
BODY = "BODY",
|
||||
META = "META"
|
||||
}
|
||||
export declare function exportAppRoute(req: MockedRequest, res: MockedResponse, params: {
|
||||
[key: string]: string | string[];
|
||||
} | undefined, page: string, incrementalCache: IncrementalCache | undefined, distDir: string, htmlFilepath: string, fileWriter: FileWriter): Promise<ExportRouteResult>;
|
||||
117
node_modules/next/dist/export/routes/app-route.js
generated
vendored
Normal file
117
node_modules/next/dist/export/routes/app-route.js
generated
vendored
Normal file
@ -0,0 +1,117 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
ExportedAppRouteFiles: null,
|
||||
exportAppRoute: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
ExportedAppRouteFiles: function() {
|
||||
return ExportedAppRouteFiles;
|
||||
},
|
||||
exportAppRoute: function() {
|
||||
return exportAppRoute;
|
||||
}
|
||||
});
|
||||
const _path = require("path");
|
||||
const _constants = require("../../lib/constants");
|
||||
const _node = require("../../server/base-http/node");
|
||||
const _routemoduleloader = require("../../server/future/helpers/module-loader/route-module-loader");
|
||||
const _nextrequest = require("../../server/web/spec-extension/adapters/next-request");
|
||||
const _utils = require("../../server/web/utils");
|
||||
const _isdynamicusageerror = require("../helpers/is-dynamic-usage-error");
|
||||
const _constants1 = require("../../shared/lib/constants");
|
||||
const _ciinfo = require("../../telemetry/ci-info");
|
||||
var ExportedAppRouteFiles;
|
||||
(function(ExportedAppRouteFiles) {
|
||||
ExportedAppRouteFiles["BODY"] = "BODY";
|
||||
ExportedAppRouteFiles["META"] = "META";
|
||||
})(ExportedAppRouteFiles || (ExportedAppRouteFiles = {}));
|
||||
async function exportAppRoute(req, res, params, page, incrementalCache, distDir, htmlFilepath, fileWriter) {
|
||||
// Ensure that the URL is absolute.
|
||||
req.url = `http://localhost:3000${req.url}`;
|
||||
// Adapt the request and response to the Next.js request and response.
|
||||
const request = _nextrequest.NextRequestAdapter.fromNodeNextRequest(new _node.NodeNextRequest(req), (0, _nextrequest.signalFromNodeResponse)(res));
|
||||
// Create the context for the handler. This contains the params from
|
||||
// the route and the context for the request.
|
||||
const context = {
|
||||
params,
|
||||
prerenderManifest: {
|
||||
version: 4,
|
||||
routes: {},
|
||||
dynamicRoutes: {},
|
||||
preview: {
|
||||
previewModeEncryptionKey: "",
|
||||
previewModeId: "",
|
||||
previewModeSigningKey: ""
|
||||
},
|
||||
notFoundRoutes: []
|
||||
},
|
||||
renderOpts: {
|
||||
experimental: {
|
||||
ppr: false
|
||||
},
|
||||
originalPathname: page,
|
||||
nextExport: true,
|
||||
supportsDynamicResponse: false,
|
||||
incrementalCache
|
||||
}
|
||||
};
|
||||
if (_ciinfo.hasNextSupport) {
|
||||
context.renderOpts.isRevalidate = true;
|
||||
}
|
||||
// This is a route handler, which means it has it's handler in the
|
||||
// bundled file already, we should just use that.
|
||||
const filename = (0, _path.join)(distDir, _constants1.SERVER_DIRECTORY, "app", page);
|
||||
try {
|
||||
var _context_renderOpts_store;
|
||||
// Route module loading and handling.
|
||||
const module1 = await _routemoduleloader.RouteModuleLoader.load(filename);
|
||||
const response = await module1.handle(request, context);
|
||||
const isValidStatus = response.status < 400 || response.status === 404;
|
||||
if (!isValidStatus) {
|
||||
return {
|
||||
revalidate: 0
|
||||
};
|
||||
}
|
||||
const blob = await response.blob();
|
||||
const revalidate = typeof ((_context_renderOpts_store = context.renderOpts.store) == null ? void 0 : _context_renderOpts_store.revalidate) === "undefined" ? false : context.renderOpts.store.revalidate;
|
||||
const headers = (0, _utils.toNodeOutgoingHttpHeaders)(response.headers);
|
||||
const cacheTags = context.renderOpts.fetchTags;
|
||||
if (cacheTags) {
|
||||
headers[_constants.NEXT_CACHE_TAGS_HEADER] = cacheTags;
|
||||
}
|
||||
if (!headers["content-type"] && blob.type) {
|
||||
headers["content-type"] = blob.type;
|
||||
}
|
||||
// Writing response body to a file.
|
||||
const body = Buffer.from(await blob.arrayBuffer());
|
||||
await fileWriter("BODY", htmlFilepath.replace(/\.html$/, _constants.NEXT_BODY_SUFFIX), body, "utf8");
|
||||
// Write the request metadata to a file.
|
||||
const meta = {
|
||||
status: response.status,
|
||||
headers
|
||||
};
|
||||
await fileWriter("META", htmlFilepath.replace(/\.html$/, _constants.NEXT_META_SUFFIX), JSON.stringify(meta));
|
||||
return {
|
||||
revalidate: revalidate,
|
||||
metadata: meta
|
||||
};
|
||||
} catch (err) {
|
||||
if (!(0, _isdynamicusageerror.isDynamicUsageError)(err)) {
|
||||
throw err;
|
||||
}
|
||||
return {
|
||||
revalidate: 0
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=app-route.js.map
|
||||
1
node_modules/next/dist/export/routes/app-route.js.map
generated
vendored
Normal file
1
node_modules/next/dist/export/routes/app-route.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/export/routes/app-route.ts"],"names":["exportAppRoute","ExportedAppRouteFiles","req","res","params","page","incrementalCache","distDir","htmlFilepath","fileWriter","url","request","NextRequestAdapter","fromNodeNextRequest","NodeNextRequest","signalFromNodeResponse","context","prerenderManifest","version","routes","dynamicRoutes","preview","previewModeEncryptionKey","previewModeId","previewModeSigningKey","notFoundRoutes","renderOpts","experimental","ppr","originalPathname","nextExport","supportsDynamicResponse","hasNextSupport","isRevalidate","filename","join","SERVER_DIRECTORY","module","RouteModuleLoader","load","response","handle","isValidStatus","status","revalidate","blob","store","headers","toNodeOutgoingHttpHeaders","cacheTags","fetchTags","NEXT_CACHE_TAGS_HEADER","type","body","Buffer","from","arrayBuffer","replace","NEXT_BODY_SUFFIX","meta","NEXT_META_SUFFIX","JSON","stringify","metadata","err","isDynamicUsageError"],"mappings":";;;;;;;;;;;;;;;;;;IA+BsBA,cAAc;eAAdA;;;sBA1BD;2BAKd;sBACyB;mCACE;6BAI3B;uBACmC;qCAKN;4BACH;wBACF;;UAEbC;;;GAAAA,0BAAAA;AAKX,eAAeD,eACpBE,GAAkB,EAClBC,GAAmB,EACnBC,MAAwD,EACxDC,IAAY,EACZC,gBAA8C,EAC9CC,OAAe,EACfC,YAAoB,EACpBC,UAAsB;IAEtB,mCAAmC;IACnCP,IAAIQ,GAAG,GAAG,CAAC,qBAAqB,EAAER,IAAIQ,GAAG,CAAC,CAAC;IAE3C,sEAAsE;IACtE,MAAMC,UAAUC,+BAAkB,CAACC,mBAAmB,CACpD,IAAIC,qBAAe,CAACZ,MACpBa,IAAAA,mCAAsB,EAACZ;IAGzB,oEAAoE;IACpE,6CAA6C;IAC7C,MAAMa,UAAuC;QAC3CZ;QACAa,mBAAmB;YACjBC,SAAS;YACTC,QAAQ,CAAC;YACTC,eAAe,CAAC;YAChBC,SAAS;gBACPC,0BAA0B;gBAC1BC,eAAe;gBACfC,uBAAuB;YACzB;YACAC,gBAAgB,EAAE;QACpB;QACAC,YAAY;YACVC,cAAc;gBAAEC,KAAK;YAAM;YAC3BC,kBAAkBxB;YAClByB,YAAY;YACZC,yBAAyB;YACzBzB;QACF;IACF;IAEA,IAAI0B,sBAAc,EAAE;QAClBhB,QAAQU,UAAU,CAACO,YAAY,GAAG;IACpC;IAEA,kEAAkE;IAClE,iDAAiD;IACjD,MAAMC,WAAWC,IAAAA,UAAI,EAAC5B,SAAS6B,4BAAgB,EAAE,OAAO/B;IAExD,IAAI;YAYOW;QAXT,qCAAqC;QACrC,MAAMqB,UAAS,MAAMC,oCAAiB,CAACC,IAAI,CAAsBL;QACjE,MAAMM,WAAW,MAAMH,QAAOI,MAAM,CAAC9B,SAASK;QAE9C,MAAM0B,gBAAgBF,SAASG,MAAM,GAAG,OAAOH,SAASG,MAAM,KAAK;QACnE,IAAI,CAACD,eAAe;YAClB,OAAO;gBAAEE,YAAY;YAAE;QACzB;QAEA,MAAMC,OAAO,MAAML,SAASK,IAAI;QAChC,MAAMD,aACJ,SAAO5B,4BAAAA,QAAQU,UAAU,CAACoB,KAAK,qBAAxB9B,0BAA0B4B,UAAU,MAAK,cAC5C,QACA5B,QAAQU,UAAU,CAACoB,KAAK,CAACF,UAAU;QAEzC,MAAMG,UAAUC,IAAAA,gCAAyB,EAACR,SAASO,OAAO;QAC1D,MAAME,YAAY,AAACjC,QAAQU,UAAU,CAASwB,SAAS;QAEvD,IAAID,WAAW;YACbF,OAAO,CAACI,iCAAsB,CAAC,GAAGF;QACpC;QAEA,IAAI,CAACF,OAAO,CAAC,eAAe,IAAIF,KAAKO,IAAI,EAAE;YACzCL,OAAO,CAAC,eAAe,GAAGF,KAAKO,IAAI;QACrC;QAEA,mCAAmC;QACnC,MAAMC,OAAOC,OAAOC,IAAI,CAAC,MAAMV,KAAKW,WAAW;QAC/C,MAAM/C,mBAEJD,aAAaiD,OAAO,CAAC,WAAWC,2BAAgB,GAChDL,MACA;QAGF,wCAAwC;QACxC,MAAMM,OAAO;YAAEhB,QAAQH,SAASG,MAAM;YAAEI;QAAQ;QAChD,MAAMtC,mBAEJD,aAAaiD,OAAO,CAAC,WAAWG,2BAAgB,GAChDC,KAAKC,SAAS,CAACH;QAGjB,OAAO;YACLf,YAAYA;YACZmB,UAAUJ;QACZ;IACF,EAAE,OAAOK,KAAK;QACZ,IAAI,CAACC,IAAAA,wCAAmB,EAACD,MAAM;YAC7B,MAAMA;QACR;QAEA,OAAO;YAAEpB,YAAY;QAAE;IACzB;AACF"}
|
||||
12
node_modules/next/dist/export/routes/pages.d.ts
generated
vendored
Normal file
12
node_modules/next/dist/export/routes/pages.d.ts
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
import type { ExportRouteResult, FileWriter } from '../types';
|
||||
import type { RenderOpts } from '../../server/render';
|
||||
import type { LoadComponentsReturnType } from '../../server/load-components';
|
||||
import type { NextParsedUrlQuery } from '../../server/request-meta';
|
||||
import type { MockedRequest, MockedResponse } from '../../server/lib/mock-request';
|
||||
export declare const enum ExportedPagesFiles {
|
||||
HTML = "HTML",
|
||||
DATA = "DATA",
|
||||
AMP_HTML = "AMP_HTML",
|
||||
AMP_DATA = "AMP_PAGE_DATA"
|
||||
}
|
||||
export declare function exportPages(req: MockedRequest, res: MockedResponse, path: string, page: string, query: NextParsedUrlQuery, htmlFilepath: string, htmlFilename: string, ampPath: string, subFolders: boolean, outDir: string, ampValidatorPath: string | undefined, pagesDataDir: string, buildExport: boolean, isDynamic: boolean, hasOrigQueryValues: boolean, renderOpts: RenderOpts, components: LoadComponentsReturnType, fileWriter: FileWriter): Promise<ExportRouteResult | undefined>;
|
||||
151
node_modules/next/dist/export/routes/pages.js
generated
vendored
Normal file
151
node_modules/next/dist/export/routes/pages.js
generated
vendored
Normal file
@ -0,0 +1,151 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
ExportedPagesFiles: null,
|
||||
exportPages: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
ExportedPagesFiles: function() {
|
||||
return ExportedPagesFiles;
|
||||
},
|
||||
exportPages: function() {
|
||||
return exportPages;
|
||||
}
|
||||
});
|
||||
const _renderresult = /*#__PURE__*/ _interop_require_default(require("../../server/render-result"));
|
||||
const _path = require("path");
|
||||
const _ampmode = require("../../shared/lib/amp-mode");
|
||||
const _constants = require("../../lib/constants");
|
||||
const _bailouttocsr = require("../../shared/lib/lazy-dynamic/bailout-to-csr");
|
||||
const _amphtmlvalidator = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/amphtml-validator"));
|
||||
const _fileexists = require("../../lib/file-exists");
|
||||
const _modulerender = require("../../server/future/route-modules/pages/module.render");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var ExportedPagesFiles;
|
||||
(function(ExportedPagesFiles) {
|
||||
ExportedPagesFiles["HTML"] = "HTML";
|
||||
ExportedPagesFiles["DATA"] = "DATA";
|
||||
ExportedPagesFiles["AMP_HTML"] = "AMP_HTML";
|
||||
ExportedPagesFiles["AMP_DATA"] = "AMP_PAGE_DATA";
|
||||
})(ExportedPagesFiles || (ExportedPagesFiles = {}));
|
||||
async function exportPages(req, res, path, page, query, htmlFilepath, htmlFilename, ampPath, subFolders, outDir, ampValidatorPath, pagesDataDir, buildExport, isDynamic, hasOrigQueryValues, renderOpts, components, fileWriter) {
|
||||
var _components_pageConfig, _components_pageConfig1;
|
||||
const ampState = {
|
||||
ampFirst: ((_components_pageConfig = components.pageConfig) == null ? void 0 : _components_pageConfig.amp) === true,
|
||||
hasQuery: Boolean(query.amp),
|
||||
hybrid: ((_components_pageConfig1 = components.pageConfig) == null ? void 0 : _components_pageConfig1.amp) === "hybrid"
|
||||
};
|
||||
const inAmpMode = (0, _ampmode.isInAmpMode)(ampState);
|
||||
const hybridAmp = ampState.hybrid;
|
||||
if (components.getServerSideProps) {
|
||||
throw new Error(`Error for page ${page}: ${_constants.SERVER_PROPS_EXPORT_ERROR}`);
|
||||
}
|
||||
// for non-dynamic SSG pages we should have already
|
||||
// prerendered the file
|
||||
if (!buildExport && components.getStaticProps && !isDynamic) {
|
||||
return;
|
||||
}
|
||||
if (components.getStaticProps && !htmlFilepath.endsWith(".html")) {
|
||||
// make sure it ends with .html if the name contains a dot
|
||||
htmlFilepath += ".html";
|
||||
htmlFilename += ".html";
|
||||
}
|
||||
let renderResult;
|
||||
if (typeof components.Component === "string") {
|
||||
renderResult = _renderresult.default.fromStatic(components.Component);
|
||||
if (hasOrigQueryValues) {
|
||||
throw new Error(`\nError: you provided query values for ${path} which is an auto-exported page. These can not be applied since the page can no longer be re-rendered on the server. To disable auto-export for this page add \`getInitialProps\`\n`);
|
||||
}
|
||||
} else {
|
||||
/**
|
||||
* This sets environment variable to be used at the time of static export by head.tsx.
|
||||
* Using this from process.env allows targeting SSR by calling
|
||||
* `process.env.__NEXT_OPTIMIZE_FONTS`.
|
||||
* TODO(prateekbh@): Remove this when experimental.optimizeFonts are being cleaned up.
|
||||
*/ if (renderOpts.optimizeFonts) {
|
||||
process.env.__NEXT_OPTIMIZE_FONTS = JSON.stringify(renderOpts.optimizeFonts);
|
||||
}
|
||||
if (renderOpts.optimizeCss) {
|
||||
process.env.__NEXT_OPTIMIZE_CSS = JSON.stringify(true);
|
||||
}
|
||||
try {
|
||||
renderResult = await (0, _modulerender.lazyRenderPagesPage)(req, res, page, query, renderOpts);
|
||||
} catch (err) {
|
||||
if (!(0, _bailouttocsr.isBailoutToCSRError)(err)) throw err;
|
||||
}
|
||||
}
|
||||
const ssgNotFound = renderResult == null ? void 0 : renderResult.metadata.isNotFound;
|
||||
const ampValidations = [];
|
||||
const validateAmp = async (rawAmpHtml, ampPageName, validatorPath)=>{
|
||||
const validator = await _amphtmlvalidator.default.getInstance(validatorPath);
|
||||
const result = validator.validateString(rawAmpHtml);
|
||||
const errors = result.errors.filter((e)=>e.severity === "ERROR");
|
||||
const warnings = result.errors.filter((e)=>e.severity !== "ERROR");
|
||||
if (warnings.length || errors.length) {
|
||||
ampValidations.push({
|
||||
page: ampPageName,
|
||||
result: {
|
||||
errors,
|
||||
warnings
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
const html = renderResult && !renderResult.isNull ? renderResult.toUnchunkedString() : "";
|
||||
let ampRenderResult;
|
||||
if (inAmpMode && !renderOpts.ampSkipValidation) {
|
||||
if (!ssgNotFound) {
|
||||
await validateAmp(html, path, ampValidatorPath);
|
||||
}
|
||||
} else if (hybridAmp) {
|
||||
const ampHtmlFilename = subFolders ? (0, _path.join)(ampPath, "index.html") : `${ampPath}.html`;
|
||||
const ampHtmlFilepath = (0, _path.join)(outDir, ampHtmlFilename);
|
||||
const exists = await (0, _fileexists.fileExists)(ampHtmlFilepath, _fileexists.FileType.File);
|
||||
if (!exists) {
|
||||
try {
|
||||
ampRenderResult = await (0, _modulerender.lazyRenderPagesPage)(req, res, page, {
|
||||
...query,
|
||||
amp: "1"
|
||||
}, renderOpts);
|
||||
} catch (err) {
|
||||
if (!(0, _bailouttocsr.isBailoutToCSRError)(err)) throw err;
|
||||
}
|
||||
const ampHtml = ampRenderResult && !ampRenderResult.isNull ? ampRenderResult.toUnchunkedString() : "";
|
||||
if (!renderOpts.ampSkipValidation) {
|
||||
await validateAmp(ampHtml, page + "?amp=1", ampValidatorPath);
|
||||
}
|
||||
await fileWriter("AMP_HTML", ampHtmlFilepath, ampHtml, "utf8");
|
||||
}
|
||||
}
|
||||
const metadata = (renderResult == null ? void 0 : renderResult.metadata) || (ampRenderResult == null ? void 0 : ampRenderResult.metadata) || {};
|
||||
if (metadata.pageData) {
|
||||
const dataFile = (0, _path.join)(pagesDataDir, htmlFilename.replace(/\.html$/, _constants.NEXT_DATA_SUFFIX));
|
||||
await fileWriter("DATA", dataFile, JSON.stringify(metadata.pageData), "utf8");
|
||||
if (hybridAmp) {
|
||||
await fileWriter("AMP_PAGE_DATA", dataFile.replace(/\.json$/, ".amp.json"), JSON.stringify(metadata.pageData), "utf8");
|
||||
}
|
||||
}
|
||||
if (!ssgNotFound) {
|
||||
// don't attempt writing to disk if getStaticProps returned not found
|
||||
await fileWriter("HTML", htmlFilepath, html, "utf8");
|
||||
}
|
||||
return {
|
||||
ampValidations,
|
||||
revalidate: metadata.revalidate ?? false,
|
||||
ssgNotFound
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=pages.js.map
|
||||
1
node_modules/next/dist/export/routes/pages.js.map
generated
vendored
Normal file
1
node_modules/next/dist/export/routes/pages.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/export/routes/pages.ts"],"names":["exportPages","ExportedPagesFiles","req","res","path","page","query","htmlFilepath","htmlFilename","ampPath","subFolders","outDir","ampValidatorPath","pagesDataDir","buildExport","isDynamic","hasOrigQueryValues","renderOpts","components","fileWriter","ampState","ampFirst","pageConfig","amp","hasQuery","Boolean","hybrid","inAmpMode","isInAmpMode","hybridAmp","getServerSideProps","Error","SERVER_PROPS_EXPORT_ERROR","getStaticProps","endsWith","renderResult","Component","RenderResult","fromStatic","optimizeFonts","process","env","__NEXT_OPTIMIZE_FONTS","JSON","stringify","optimizeCss","__NEXT_OPTIMIZE_CSS","lazyRenderPagesPage","err","isBailoutToCSRError","ssgNotFound","metadata","isNotFound","ampValidations","validateAmp","rawAmpHtml","ampPageName","validatorPath","validator","AmpHtmlValidator","getInstance","result","validateString","errors","filter","e","severity","warnings","length","push","html","isNull","toUnchunkedString","ampRenderResult","ampSkipValidation","ampHtmlFilename","join","ampHtmlFilepath","exists","fileExists","FileType","File","ampHtml","pageData","dataFile","replace","NEXT_DATA_SUFFIX","revalidate"],"mappings":"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"}
|
||||
7
node_modules/next/dist/export/routes/types.d.ts
generated
vendored
Normal file
7
node_modules/next/dist/export/routes/types.d.ts
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
/// <reference types="node" />
|
||||
import type { OutgoingHttpHeaders } from 'node:http';
|
||||
export type RouteMetadata = {
|
||||
status: number | undefined;
|
||||
headers: OutgoingHttpHeaders | undefined;
|
||||
postponed: string | undefined;
|
||||
};
|
||||
6
node_modules/next/dist/export/routes/types.js
generated
vendored
Normal file
6
node_modules/next/dist/export/routes/types.js
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
//# sourceMappingURL=types.js.map
|
||||
1
node_modules/next/dist/export/routes/types.js.map
generated
vendored
Normal file
1
node_modules/next/dist/export/routes/types.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":[],"names":[],"mappings":""}
|
||||
146
node_modules/next/dist/export/types.d.ts
generated
vendored
Normal file
146
node_modules/next/dist/export/types.d.ts
generated
vendored
Normal file
@ -0,0 +1,146 @@
|
||||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
import type { WriteFileOptions } from 'fs';
|
||||
import type { RenderOptsPartial as AppRenderOptsPartial } from '../server/app-render/types';
|
||||
import type { RenderOptsPartial as PagesRenderOptsPartial } from '../server/render';
|
||||
import type { LoadComponentsReturnType } from '../server/load-components';
|
||||
import type { OutgoingHttpHeaders } from 'http';
|
||||
import type AmpHtmlValidator from 'next/dist/compiled/amphtml-validator';
|
||||
import type { FontConfig } from '../server/font-utils';
|
||||
import type { ExportPathMap, NextConfigComplete } from '../server/config-shared';
|
||||
import type { Span } from '../trace';
|
||||
import type { Revalidate } from '../server/lib/revalidate';
|
||||
import type { NextEnabledDirectories } from '../server/base-server';
|
||||
import type { SerializableTurborepoAccessTraceResult, TurborepoAccessTraceResult } from '../build/turborepo-access-trace';
|
||||
export interface AmpValidation {
|
||||
page: string;
|
||||
result: {
|
||||
errors: AmpHtmlValidator.ValidationError[];
|
||||
warnings: AmpHtmlValidator.ValidationError[];
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Writes a file to the filesystem (and also records the file that was written).
|
||||
*/
|
||||
export type FileWriter = (type: string, path: string, content: string | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView>, encodingOptions?: WriteFileOptions) => Promise<void>;
|
||||
type PathMap = ExportPathMap[keyof ExportPathMap];
|
||||
export interface ExportPageInput {
|
||||
path: string;
|
||||
dir: string;
|
||||
pathMap: PathMap;
|
||||
distDir: string;
|
||||
outDir: string;
|
||||
pagesDataDir: string;
|
||||
renderOpts: WorkerRenderOptsPartial;
|
||||
ampValidatorPath?: string;
|
||||
trailingSlash?: boolean;
|
||||
buildExport?: boolean;
|
||||
serverRuntimeConfig: {
|
||||
[key: string]: any;
|
||||
};
|
||||
subFolders?: boolean;
|
||||
optimizeFonts: FontConfig;
|
||||
optimizeCss: any;
|
||||
disableOptimizedLoading: any;
|
||||
parentSpanId: any;
|
||||
httpAgentOptions: NextConfigComplete['httpAgentOptions'];
|
||||
debugOutput?: boolean;
|
||||
cacheMaxMemorySize?: NextConfigComplete['cacheMaxMemorySize'];
|
||||
fetchCache?: boolean;
|
||||
cacheHandler?: string;
|
||||
fetchCacheKeyPrefix?: string;
|
||||
nextConfigOutput?: NextConfigComplete['output'];
|
||||
enableExperimentalReact?: boolean;
|
||||
enabledDirectories: NextEnabledDirectories;
|
||||
}
|
||||
export type ExportedPageFile = {
|
||||
type: string;
|
||||
path: string;
|
||||
};
|
||||
export type ExportRouteResult = {
|
||||
ampValidations?: AmpValidation[];
|
||||
revalidate: Revalidate;
|
||||
metadata?: {
|
||||
status?: number;
|
||||
headers?: OutgoingHttpHeaders;
|
||||
};
|
||||
ssgNotFound?: boolean;
|
||||
hasEmptyPrelude?: boolean;
|
||||
hasPostponed?: boolean;
|
||||
} | {
|
||||
error: boolean;
|
||||
};
|
||||
export type ExportPageResult = ExportRouteResult & {
|
||||
files: ExportedPageFile[];
|
||||
duration: number;
|
||||
turborepoAccessTraceResult?: SerializableTurborepoAccessTraceResult;
|
||||
};
|
||||
export type WorkerRenderOptsPartial = PagesRenderOptsPartial & AppRenderOptsPartial;
|
||||
export type WorkerRenderOpts = WorkerRenderOptsPartial & LoadComponentsReturnType;
|
||||
export type ExportWorker = (input: ExportPageInput) => Promise<ExportPageResult | undefined>;
|
||||
export interface ExportAppOptions {
|
||||
outdir: string;
|
||||
enabledDirectories: NextEnabledDirectories;
|
||||
silent?: boolean;
|
||||
threads?: number;
|
||||
debugOutput?: boolean;
|
||||
pages?: string[];
|
||||
buildExport: boolean;
|
||||
statusMessage?: string;
|
||||
exportPageWorker?: ExportWorker;
|
||||
exportAppPageWorker?: ExportWorker;
|
||||
endWorker?: () => Promise<void>;
|
||||
nextConfig?: NextConfigComplete;
|
||||
hasOutdirFromCli?: boolean;
|
||||
}
|
||||
export type ExportPageMetadata = {
|
||||
revalidate: number | false;
|
||||
metadata: {
|
||||
status?: number | undefined;
|
||||
headers?: OutgoingHttpHeaders | undefined;
|
||||
} | undefined;
|
||||
duration: number;
|
||||
};
|
||||
export type ExportAppResult = {
|
||||
/**
|
||||
* Page information keyed by path.
|
||||
*/
|
||||
byPath: Map<string, {
|
||||
/**
|
||||
* The revalidation time for the page in seconds.
|
||||
*/
|
||||
revalidate?: Revalidate;
|
||||
/**
|
||||
* The metadata for the page.
|
||||
*/
|
||||
metadata?: {
|
||||
status?: number;
|
||||
headers?: OutgoingHttpHeaders;
|
||||
};
|
||||
/**
|
||||
* If the page has an empty prelude when using PPR.
|
||||
*/
|
||||
hasEmptyPrelude?: boolean;
|
||||
/**
|
||||
* If the page has postponed when using PPR.
|
||||
*/
|
||||
hasPostponed?: boolean;
|
||||
}>;
|
||||
/**
|
||||
* Durations for each page in milliseconds.
|
||||
*/
|
||||
byPage: Map<string, {
|
||||
durationsByPath: Map<string, number>;
|
||||
}>;
|
||||
/**
|
||||
* The paths that were not found during SSG.
|
||||
*/
|
||||
ssgNotFoundPaths: Set<string>;
|
||||
/**
|
||||
* Traced dependencies for each page.
|
||||
*/
|
||||
turborepoAccessTraceResults: Map<string, TurborepoAccessTraceResult>;
|
||||
};
|
||||
export type ExportAppWorker = (dir: string, options: ExportAppOptions, span: Span) => Promise<ExportAppResult | null>;
|
||||
export {};
|
||||
6
node_modules/next/dist/export/types.js
generated
vendored
Normal file
6
node_modules/next/dist/export/types.js
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
//# sourceMappingURL=types.js.map
|
||||
1
node_modules/next/dist/export/types.js.map
generated
vendored
Normal file
1
node_modules/next/dist/export/types.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":[],"names":[],"mappings":""}
|
||||
2
node_modules/next/dist/export/utils.d.ts
generated
vendored
Normal file
2
node_modules/next/dist/export/utils.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
import type { NextConfigComplete } from '../server/config-shared';
|
||||
export declare function hasCustomExportOutput(config: NextConfigComplete): boolean;
|
||||
24
node_modules/next/dist/export/utils.js
generated
vendored
Normal file
24
node_modules/next/dist/export/utils.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "hasCustomExportOutput", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return hasCustomExportOutput;
|
||||
}
|
||||
});
|
||||
function hasCustomExportOutput(config) {
|
||||
// In the past, a user had to run "next build" to generate
|
||||
// ".next" (or whatever the distDir) followed by "next export"
|
||||
// to generate "out" (or whatever the outDir). However, when
|
||||
// "output: export" is configured, "next build" does both steps.
|
||||
// So the user-configured distDir is actually the outDir.
|
||||
// We'll do some custom logic when meeting this condition.
|
||||
// e.g.
|
||||
// Will set config.distDir to .next to make sure the manifests
|
||||
// are still reading from temporary .next directory.
|
||||
return config.output === "export" && config.distDir !== ".next";
|
||||
}
|
||||
|
||||
//# sourceMappingURL=utils.js.map
|
||||
1
node_modules/next/dist/export/utils.js.map
generated
vendored
Normal file
1
node_modules/next/dist/export/utils.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/export/utils.ts"],"names":["hasCustomExportOutput","config","output","distDir"],"mappings":";;;;+BAEgBA;;;eAAAA;;;AAAT,SAASA,sBAAsBC,MAA0B;IAC9D,0DAA0D;IAC1D,8DAA8D;IAC9D,4DAA4D;IAC5D,gEAAgE;IAChE,yDAAyD;IACzD,0DAA0D;IAC1D,OAAO;IACP,8DAA8D;IAC9D,oDAAoD;IACpD,OAAOA,OAAOC,MAAM,KAAK,YAAYD,OAAOE,OAAO,KAAK;AAC1D"}
|
||||
3
node_modules/next/dist/export/worker.d.ts
generated
vendored
Normal file
3
node_modules/next/dist/export/worker.d.ts
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import type { ExportPageInput, ExportPageResult } from './types';
|
||||
import '../server/node-environment';
|
||||
export default function exportPage(input: ExportPageInput): Promise<ExportPageResult | undefined>;
|
||||
278
node_modules/next/dist/export/worker.js
generated
vendored
Normal file
278
node_modules/next/dist/export/worker.js
generated
vendored
Normal file
@ -0,0 +1,278 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return exportPage;
|
||||
}
|
||||
});
|
||||
require("../server/node-environment");
|
||||
const _path = require("path");
|
||||
const _promises = /*#__PURE__*/ _interop_require_default(require("fs/promises"));
|
||||
const _loadcomponents = require("../server/load-components");
|
||||
const _isdynamic = require("../shared/lib/router/utils/is-dynamic");
|
||||
const _normalizepagepath = require("../shared/lib/page-path/normalize-page-path");
|
||||
const _require = require("../server/require");
|
||||
const _normalizelocalepath = require("../shared/lib/i18n/normalize-locale-path");
|
||||
const _trace = require("../trace");
|
||||
const _setuphttpagentenv = require("../server/setup-http-agent-env");
|
||||
const _iserror = /*#__PURE__*/ _interop_require_default(require("../lib/is-error"));
|
||||
const _requestmeta = require("../server/request-meta");
|
||||
const _apppaths = require("../shared/lib/router/utils/app-paths");
|
||||
const _mockrequest = require("../server/lib/mock-request");
|
||||
const _isapprouteroute = require("../lib/is-app-route-route");
|
||||
const _ciinfo = require("../telemetry/ci-info");
|
||||
const _approute = require("./routes/app-route");
|
||||
const _apppage = require("./routes/app-page");
|
||||
const _pages = require("./routes/pages");
|
||||
const _getparams = require("./helpers/get-params");
|
||||
const _createincrementalcache = require("./helpers/create-incremental-cache");
|
||||
const _ispostpone = require("../server/lib/router-utils/is-postpone");
|
||||
const _isdynamicusageerror = require("./helpers/is-dynamic-usage-error");
|
||||
const _bailouttocsr = require("../shared/lib/lazy-dynamic/bailout-to-csr");
|
||||
const _turborepoaccesstrace = require("../build/turborepo-access-trace");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
process.env.NEXT_IS_EXPORT_WORKER = "true";
|
||||
const envConfig = require("../shared/lib/runtime-config.external");
|
||||
globalThis.__NEXT_DATA__ = {
|
||||
nextExport: true
|
||||
};
|
||||
async function exportPageImpl(input, fileWriter) {
|
||||
const { dir, path, pathMap, distDir, pagesDataDir, buildExport = false, serverRuntimeConfig, subFolders = false, optimizeFonts, optimizeCss, disableOptimizedLoading, debugOutput = false, cacheMaxMemorySize, fetchCache, fetchCacheKeyPrefix, cacheHandler, enableExperimentalReact, ampValidatorPath, trailingSlash, enabledDirectories } = input;
|
||||
if (enableExperimentalReact) {
|
||||
process.env.__NEXT_EXPERIMENTAL_REACT = "true";
|
||||
}
|
||||
const { page, // Check if this is an `app/` page.
|
||||
_isAppDir: isAppDir = false, // TODO: use this when we've re-enabled app prefetching https://github.com/vercel/next.js/pull/58609
|
||||
// // Check if this is an `app/` prefix request.
|
||||
// _isAppPrefetch: isAppPrefetch = false,
|
||||
// Check if this should error when dynamic usage is detected.
|
||||
_isDynamicError: isDynamicError = false, // Pull the original query out.
|
||||
query: originalQuery = {} } = pathMap;
|
||||
try {
|
||||
var _req_url;
|
||||
let query = {
|
||||
...originalQuery
|
||||
};
|
||||
const pathname = (0, _apppaths.normalizeAppPath)(page);
|
||||
const isDynamic = (0, _isdynamic.isDynamicRoute)(page);
|
||||
const outDir = isAppDir ? (0, _path.join)(distDir, "server/app") : input.outDir;
|
||||
let params;
|
||||
const filePath = (0, _normalizepagepath.normalizePagePath)(path);
|
||||
const ampPath = `${filePath}.amp`;
|
||||
let renderAmpPath = ampPath;
|
||||
let updatedPath = query.__nextSsgPath || path;
|
||||
delete query.__nextSsgPath;
|
||||
let locale = query.__nextLocale || input.renderOpts.locale;
|
||||
delete query.__nextLocale;
|
||||
if (input.renderOpts.locale) {
|
||||
const localePathResult = (0, _normalizelocalepath.normalizeLocalePath)(path, input.renderOpts.locales);
|
||||
if (localePathResult.detectedLocale) {
|
||||
updatedPath = localePathResult.pathname;
|
||||
locale = localePathResult.detectedLocale;
|
||||
if (locale === input.renderOpts.defaultLocale) {
|
||||
renderAmpPath = `${(0, _normalizepagepath.normalizePagePath)(updatedPath)}.amp`;
|
||||
}
|
||||
}
|
||||
}
|
||||
// We need to show a warning if they try to provide query values
|
||||
// for an auto-exported page since they won't be available
|
||||
const hasOrigQueryValues = Object.keys(originalQuery).length > 0;
|
||||
// Check if the page is a specified dynamic route
|
||||
const { pathname: nonLocalizedPath } = (0, _normalizelocalepath.normalizeLocalePath)(path, input.renderOpts.locales);
|
||||
if (isDynamic && page !== nonLocalizedPath) {
|
||||
const normalizedPage = isAppDir ? (0, _apppaths.normalizeAppPath)(page) : page;
|
||||
params = (0, _getparams.getParams)(normalizedPage, updatedPath);
|
||||
if (params) {
|
||||
query = {
|
||||
...query,
|
||||
...params
|
||||
};
|
||||
}
|
||||
}
|
||||
const { req, res } = (0, _mockrequest.createRequestResponseMocks)({
|
||||
url: updatedPath
|
||||
});
|
||||
// If this is a status code page, then set the response code.
|
||||
for (const statusCode of [
|
||||
404,
|
||||
500
|
||||
]){
|
||||
if ([
|
||||
`/${statusCode}`,
|
||||
`/${statusCode}.html`,
|
||||
`/${statusCode}/index.html`
|
||||
].some((p)=>p === updatedPath || `/${locale}${p}` === updatedPath)) {
|
||||
res.statusCode = statusCode;
|
||||
}
|
||||
}
|
||||
// Ensure that the URL has a trailing slash if it's configured.
|
||||
if (trailingSlash && !((_req_url = req.url) == null ? void 0 : _req_url.endsWith("/"))) {
|
||||
req.url += "/";
|
||||
}
|
||||
if (locale && buildExport && input.renderOpts.domainLocales && input.renderOpts.domainLocales.some((dl)=>{
|
||||
var _dl_locales;
|
||||
return dl.defaultLocale === locale || ((_dl_locales = dl.locales) == null ? void 0 : _dl_locales.includes(locale || ""));
|
||||
})) {
|
||||
(0, _requestmeta.addRequestMeta)(req, "isLocaleDomain", true);
|
||||
}
|
||||
envConfig.setConfig({
|
||||
serverRuntimeConfig,
|
||||
publicRuntimeConfig: input.renderOpts.runtimeConfig
|
||||
});
|
||||
const getHtmlFilename = (p)=>subFolders ? `${p}${_path.sep}index.html` : `${p}.html`;
|
||||
let htmlFilename = getHtmlFilename(filePath);
|
||||
// dynamic routes can provide invalid extensions e.g. /blog/[...slug] returns an
|
||||
// extension of `.slug]`
|
||||
const pageExt = isDynamic || isAppDir ? "" : (0, _path.extname)(page);
|
||||
const pathExt = isDynamic || isAppDir ? "" : (0, _path.extname)(path);
|
||||
// force output 404.html for backwards compat
|
||||
if (path === "/404.html") {
|
||||
htmlFilename = path;
|
||||
} else if (pageExt !== pathExt && pathExt !== "") {
|
||||
const isBuiltinPaths = [
|
||||
"/500",
|
||||
"/404"
|
||||
].some((p)=>p === path || p === path + ".html");
|
||||
// If the ssg path has .html extension, and it's not builtin paths, use it directly
|
||||
// Otherwise, use that as the filename instead
|
||||
const isHtmlExtPath = !isBuiltinPaths && path.endsWith(".html");
|
||||
htmlFilename = isHtmlExtPath ? getHtmlFilename(path) : path;
|
||||
} else if (path === "/") {
|
||||
// If the path is the root, just use index.html
|
||||
htmlFilename = "index.html";
|
||||
}
|
||||
const baseDir = (0, _path.join)(outDir, (0, _path.dirname)(htmlFilename));
|
||||
let htmlFilepath = (0, _path.join)(outDir, htmlFilename);
|
||||
await _promises.default.mkdir(baseDir, {
|
||||
recursive: true
|
||||
});
|
||||
// If the fetch cache was enabled, we need to create an incremental
|
||||
// cache instance for this page.
|
||||
const incrementalCache = isAppDir && fetchCache ? await (0, _createincrementalcache.createIncrementalCache)({
|
||||
cacheHandler,
|
||||
cacheMaxMemorySize,
|
||||
fetchCacheKeyPrefix,
|
||||
distDir,
|
||||
dir,
|
||||
enabledDirectories,
|
||||
// PPR is not available for Pages.
|
||||
experimental: {
|
||||
ppr: false
|
||||
},
|
||||
// skip writing to disk in minimal mode for now, pending some
|
||||
// changes to better support it
|
||||
flushToDisk: !_ciinfo.hasNextSupport
|
||||
}) : undefined;
|
||||
// Handle App Routes.
|
||||
if (isAppDir && (0, _isapprouteroute.isAppRouteRoute)(page)) {
|
||||
return await (0, _approute.exportAppRoute)(req, res, params, page, incrementalCache, distDir, htmlFilepath, fileWriter);
|
||||
}
|
||||
const components = await (0, _loadcomponents.loadComponents)({
|
||||
distDir,
|
||||
page,
|
||||
isAppPath: isAppDir
|
||||
});
|
||||
const renderOpts = {
|
||||
...components,
|
||||
...input.renderOpts,
|
||||
ampPath: renderAmpPath,
|
||||
params,
|
||||
optimizeFonts,
|
||||
optimizeCss,
|
||||
disableOptimizedLoading,
|
||||
fontManifest: optimizeFonts ? (0, _require.requireFontManifest)(distDir) : undefined,
|
||||
locale,
|
||||
supportsDynamicResponse: false,
|
||||
originalPathname: page
|
||||
};
|
||||
if (_ciinfo.hasNextSupport) {
|
||||
renderOpts.isRevalidate = true;
|
||||
}
|
||||
// Handle App Pages
|
||||
if (isAppDir) {
|
||||
// Set the incremental cache on the renderOpts, that's how app page's
|
||||
// consume it.
|
||||
renderOpts.incrementalCache = incrementalCache;
|
||||
return await (0, _apppage.exportAppPage)(req, res, page, path, pathname, query, renderOpts, htmlFilepath, debugOutput, isDynamicError, fileWriter);
|
||||
}
|
||||
return await (0, _pages.exportPages)(req, res, path, page, query, htmlFilepath, htmlFilename, ampPath, subFolders, outDir, ampValidatorPath, pagesDataDir, buildExport, isDynamic, hasOrigQueryValues, renderOpts, components, fileWriter);
|
||||
} catch (err) {
|
||||
console.error(`\nError occurred prerendering page "${path}". Read more: https://nextjs.org/docs/messages/prerender-error\n`);
|
||||
if (!(0, _bailouttocsr.isBailoutToCSRError)(err)) {
|
||||
console.error((0, _iserror.default)(err) && err.stack ? err.stack : err);
|
||||
}
|
||||
return {
|
||||
error: true
|
||||
};
|
||||
}
|
||||
}
|
||||
async function exportPage(input) {
|
||||
// Configure the http agent.
|
||||
(0, _setuphttpagentenv.setHttpClientAndAgentOptions)({
|
||||
httpAgentOptions: input.httpAgentOptions
|
||||
});
|
||||
const files = [];
|
||||
const baseFileWriter = async (type, path, content, encodingOptions = "utf-8")=>{
|
||||
await _promises.default.mkdir((0, _path.dirname)(path), {
|
||||
recursive: true
|
||||
});
|
||||
await _promises.default.writeFile(path, content, encodingOptions);
|
||||
files.push({
|
||||
type,
|
||||
path
|
||||
});
|
||||
};
|
||||
const exportPageSpan = (0, _trace.trace)("export-page-worker", input.parentSpanId);
|
||||
const start = Date.now();
|
||||
const turborepoAccessTraceResult = new _turborepoaccesstrace.TurborepoAccessTraceResult();
|
||||
// Export the page.
|
||||
const result = await exportPageSpan.traceAsyncFn(()=>(0, _turborepoaccesstrace.turborepoTraceAccess)(()=>exportPageImpl(input, baseFileWriter), turborepoAccessTraceResult));
|
||||
// If there was no result, then we can exit early.
|
||||
if (!result) return;
|
||||
// If there was an error, then we can exit early.
|
||||
if ("error" in result) {
|
||||
return {
|
||||
error: result.error,
|
||||
duration: Date.now() - start,
|
||||
files: []
|
||||
};
|
||||
}
|
||||
// Otherwise we can return the result.
|
||||
return {
|
||||
duration: Date.now() - start,
|
||||
files,
|
||||
ampValidations: result.ampValidations,
|
||||
revalidate: result.revalidate,
|
||||
metadata: result.metadata,
|
||||
ssgNotFound: result.ssgNotFound,
|
||||
hasEmptyPrelude: result.hasEmptyPrelude,
|
||||
hasPostponed: result.hasPostponed,
|
||||
turborepoAccessTraceResult: turborepoAccessTraceResult.serialize()
|
||||
};
|
||||
}
|
||||
process.on("unhandledRejection", (err)=>{
|
||||
// if it's a postpone error, it'll be handled later
|
||||
// when the postponed promise is actually awaited.
|
||||
if ((0, _ispostpone.isPostpone)(err)) {
|
||||
return;
|
||||
}
|
||||
// we don't want to log these errors
|
||||
if ((0, _isdynamicusageerror.isDynamicUsageError)(err)) {
|
||||
return;
|
||||
}
|
||||
console.error(err);
|
||||
});
|
||||
process.on("rejectionHandled", ()=>{
|
||||
// It is ok to await a Promise late in Next.js as it allows for better
|
||||
// prefetching patterns to avoid waterfalls. We ignore logging these.
|
||||
// We should've already errored in anyway unhandledRejection.
|
||||
});
|
||||
|
||||
//# sourceMappingURL=worker.js.map
|
||||
1
node_modules/next/dist/export/worker.js.map
generated
vendored
Normal file
1
node_modules/next/dist/export/worker.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user