Initial boiler plate project

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

View File

@ -0,0 +1,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>;

View 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

View 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"}

View 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
View 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

View 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"}

View File

@ -0,0 +1 @@
export declare const isDynamicUsageError: (err: unknown) => boolean;

View 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

View 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"}

View 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;

View 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

View 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"}