next 16.0.2-canary.14 → 16.0.2-canary.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/bin/next +1 -1
  2. package/dist/build/adapter/build-complete.js +14 -11
  3. package/dist/build/adapter/build-complete.js.map +1 -1
  4. package/dist/build/index.js +3 -3
  5. package/dist/build/swc/index.js +1 -1
  6. package/dist/build/webpack-config.js +2 -2
  7. package/dist/client/app-bootstrap.js +1 -1
  8. package/dist/client/index.js +1 -1
  9. package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js +1 -1
  10. package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js.map +1 -1
  11. package/dist/compiled/next-server/pages-api.runtime.dev.js +1 -1
  12. package/dist/compiled/next-server/pages-api.runtime.dev.js.map +1 -1
  13. package/dist/compiled/next-server/pages-turbo.runtime.prod.js +1 -1
  14. package/dist/compiled/next-server/pages-turbo.runtime.prod.js.map +1 -1
  15. package/dist/compiled/next-server/pages.runtime.dev.js +1 -1
  16. package/dist/compiled/next-server/pages.runtime.dev.js.map +1 -1
  17. package/dist/esm/build/adapter/build-complete.js +14 -11
  18. package/dist/esm/build/adapter/build-complete.js.map +1 -1
  19. package/dist/esm/build/index.js +3 -3
  20. package/dist/esm/build/swc/index.js +1 -1
  21. package/dist/esm/build/webpack-config.js +2 -2
  22. package/dist/esm/client/app-bootstrap.js +1 -1
  23. package/dist/esm/client/index.js +1 -1
  24. package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
  25. package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
  26. package/dist/esm/server/lib/app-info-log.js +1 -1
  27. package/dist/esm/server/lib/start-server.js +1 -1
  28. package/dist/esm/shared/lib/errors/canary-only-config-error.js +1 -1
  29. package/dist/server/dev/hot-reloader-turbopack.js +1 -1
  30. package/dist/server/dev/hot-reloader-webpack.js +1 -1
  31. package/dist/server/lib/app-info-log.js +1 -1
  32. package/dist/server/lib/start-server.js +1 -1
  33. package/dist/shared/lib/errors/canary-only-config-error.js +1 -1
  34. package/dist/telemetry/anonymous-meta.js +1 -1
  35. package/dist/telemetry/events/session-stopped.js +2 -2
  36. package/dist/telemetry/events/version.js +2 -2
  37. package/package.json +15 -15
@@ -240,7 +240,7 @@ export async function handleBuildComplete({ dir, config, buildId, configOutDir,
240
240
  }
241
241
  // need to add matching .rsc output
242
242
  if (isAppPage) {
243
- const rscPathname = (output.pathname === '/' ? '/index' : output.pathname) + '.rsc';
243
+ const rscPathname = normalizePagePath(output.pathname) + '.rsc';
244
244
  outputs.appPages.push({
245
245
  ...output,
246
246
  pathname: rscPathname,
@@ -343,7 +343,7 @@ export async function handleBuildComplete({ dir, config, buildId, configOutDir,
343
343
  // if page is get server side props we need to create
344
344
  // the _next/data output as well
345
345
  if (serverPropsPages.has(page)) {
346
- const dataPathname = path.posix.join('/_next/data', buildId, page + '.json');
346
+ const dataPathname = path.posix.join('/_next/data', buildId, normalizePagePath(page) + '.json');
347
347
  outputs.pages.push({
348
348
  ...output,
349
349
  pathname: dataPathname,
@@ -452,8 +452,8 @@ export async function handleBuildComplete({ dir, config, buildId, configOutDir,
452
452
  if (output.type === AdapterOutputType.APP_PAGE) {
453
453
  outputs.appPages.push({
454
454
  ...output,
455
- pathname: (output.pathname === '/' ? '/index' : output.pathname) + '.rsc',
456
- id: (output.id === '/' ? '/index' : output.pathname) + '.rsc'
455
+ pathname: normalizePagePath(output.pathname) + '.rsc',
456
+ id: normalizePagePath(output.pathname) + '.rsc'
457
457
  });
458
458
  outputs.appPages.push(output);
459
459
  } else {
@@ -484,10 +484,11 @@ export async function handleBuildComplete({ dir, config, buildId, configOutDir,
484
484
  initialOutput.fallback.postponedState = meta.postponed;
485
485
  }
486
486
  if (meta == null ? void 0 : meta.segmentPaths) {
487
- const segmentsDir = path.join(appDistDir, `${route}${prefetchSegmentDirSuffix}`);
487
+ const normalizedRoute = normalizePagePath(route);
488
+ const segmentsDir = path.join(appDistDir, `${normalizedRoute}${prefetchSegmentDirSuffix}`);
488
489
  for (const segmentPath of meta.segmentPaths){
489
490
  var _initialOutput_fallback, _initialOutput_fallback1, _initialOutput_fallback2;
490
- const outputSegmentPath = path.join(route + prefetchSegmentDirSuffix, segmentPath) + prefetchSegmentSuffix;
491
+ const outputSegmentPath = path.join(normalizedRoute + prefetchSegmentDirSuffix, segmentPath) + prefetchSegmentSuffix;
491
492
  const fallbackPathname = path.join(segmentsDir, segmentPath + prefetchSegmentSuffix);
492
493
  outputs.prerenders.push({
493
494
  id: outputSegmentPath,
@@ -515,7 +516,8 @@ export async function handleBuildComplete({ dir, config, buildId, configOutDir,
515
516
  };
516
517
  let prerenderGroupId = 1;
517
518
  const getAppRouteMeta = async (route, isAppPage)=>{
518
- const meta = isAppPage ? JSON.parse(await fs.readFile(path.join(appDistDir, `${route}.meta`), 'utf8').catch(()=>'{}')) : {};
519
+ const basename = route.endsWith('/') ? `${route}index` : route;
520
+ const meta = isAppPage ? JSON.parse(await fs.readFile(path.join(appDistDir, `${basename}.meta`), 'utf8').catch(()=>'{}')) : {};
519
521
  if (meta.headers) {
520
522
  // normalize these for consistency
521
523
  for (const key of Object.keys(meta.headers)){
@@ -559,7 +561,7 @@ export async function handleBuildComplete({ dir, config, buildId, configOutDir,
559
561
  // for allowQuery for dynamic routes
560
562
  allowQuery = Object.values(routeKeys);
561
563
  }
562
- let filePath = path.join(isAppPage ? appDistDir : pagesDistDir, `${route === '/' ? 'index' : route}.${isAppPage && !dataRoute ? 'body' : 'html'}`);
564
+ let filePath = path.join(isAppPage ? appDistDir : pagesDistDir, `${normalizePagePath(route)}.${isAppPage && !dataRoute ? 'body' : 'html'}`);
563
565
  // we use the static 404 for notFound: true if available
564
566
  // if not we do a blocking invoke on first request
565
567
  if (isNotFoundTrue && hasStatic404) {
@@ -611,7 +613,7 @@ export async function handleBuildComplete({ dir, config, buildId, configOutDir,
611
613
  outputs.prerenders.push(initialOutput);
612
614
  if (dataRoute) {
613
615
  var _initialOutput_fallback;
614
- let dataFilePath = path.join(pagesDistDir, `${route === '/' ? 'index' : route}.json`);
616
+ let dataFilePath = path.join(pagesDistDir, `${normalizePagePath(route)}.json`);
615
617
  if (isAppPage) {
616
618
  // When experimental PPR is enabled, we expect that the data
617
619
  // that should be served as a part of the prerender should
@@ -837,14 +839,15 @@ export async function handleBuildComplete({ dir, config, buildId, configOutDir,
837
839
  prefixRouteKeys: true,
838
840
  includeSuffix: true
839
841
  });
840
- const destination = path.posix.join('/', config.basePath, ...dataRoutePages.has(page) ? [
842
+ const isDataRoute = dataRoutePages.has(page);
843
+ const destination = path.posix.join('/', config.basePath, ...isDataRoute ? [
841
844
  `_next/data`,
842
845
  buildId
843
846
  ] : '', ...page === '/' ? [
844
847
  shouldLocalize ? '$nextLocale.json' : 'index.json'
845
848
  ] : [
846
849
  shouldLocalize ? '$nextLocale' : '',
847
- page + '.json' + getDestinationQuery(routeRegex.routeKeys || {})
850
+ page + (isDataRoute ? '.json' : '') + getDestinationQuery(routeRegex.routeKeys || {})
848
851
  ]);
849
852
  dynamicDataRoutes.push({
850
853
  source: page,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/build/adapter/build-complete.ts"],"sourcesContent":["import path from 'path'\nimport fs from 'fs/promises'\nimport { pathToFileURL } from 'url'\nimport * as Log from '../output/log'\nimport { isMiddlewareFilename } from '../utils'\nimport { RenderingMode } from '../rendering-mode'\nimport { interopDefault } from '../../lib/interop-default'\nimport type { RouteHas } from '../../lib/load-custom-routes'\nimport { recursiveReadDir } from '../../lib/recursive-readdir'\nimport { isDynamicRoute } from '../../shared/lib/router/utils'\nimport type { Revalidate } from '../../server/lib/cache-control'\nimport type { NextConfigComplete } from '../../server/config-shared'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport { AdapterOutputType, type PHASE_TYPE } from '../../shared/lib/constants'\nimport { normalizePagePath } from '../../shared/lib/page-path/normalize-page-path'\nimport {\n convertRedirects,\n convertRewrites,\n convertHeaders,\n} from 'next/dist/compiled/@vercel/routing-utils'\n\nimport type {\n MiddlewareManifest,\n EdgeFunctionDefinition,\n} from '../webpack/plugins/middleware-plugin'\n\nimport type {\n RoutesManifest,\n PrerenderManifest,\n ManifestRewriteRoute,\n FunctionsConfigManifest,\n DynamicPrerenderManifestRoute,\n} from '..'\n\nimport {\n HTML_CONTENT_TYPE_HEADER,\n JSON_CONTENT_TYPE_HEADER,\n NEXT_RESUME_HEADER,\n} from '../../lib/constants'\nimport { normalizeLocalePath } from '../../shared/lib/i18n/normalize-locale-path'\nimport { addPathPrefix } from '../../shared/lib/router/utils/add-path-prefix'\nimport { getRedirectStatus, modifyRouteRegex } from '../../lib/redirect-status'\nimport { getNamedRouteRegex } from '../../shared/lib/router/utils/route-regex'\nimport { escapeStringRegexp } from '../../shared/lib/escape-regexp'\nimport { sortSortableRoutes } from '../../shared/lib/router/utils/sortable-routes'\nimport { nodeFileTrace } from 'next/dist/compiled/@vercel/nft'\nimport { defaultOverrides } from '../../server/require-hook'\nimport { makeIgnoreFn } from '../collect-build-traces'\n\ninterface SharedRouteFields {\n /**\n * id is the unique identifier of the output\n */\n id: string\n /**\n * filePath is the location on disk of the built entrypoint asset\n */\n filePath: string\n /**\n * pathname is the URL pathname the asset should be served at\n */\n pathname: string\n\n /**\n * sourcePage is the original source in the app or pages folder\n */\n sourcePage: string\n\n /**\n * runtime is which runtime the entrypoint is built for\n */\n runtime: 'nodejs' | 'edge'\n /**\n * assets are all necessary traced assets that could be\n * loaded by the output to handle a request e.g. traced\n * node_modules or necessary manifests for Next.js.\n * The key is the relative path from the repo root and the value\n * is the absolute path to the file\n */\n assets: Record<string, string>\n\n /**\n * wasmAssets are bundled wasm files with mapping of name\n * to filePath on disk\n */\n wasmAssets?: Record<string, string>\n\n /**\n * config related to the route\n */\n config: {\n /**\n * maxDuration is a segment config to signal the max\n * execution duration a route should be allowed before\n * it's timed out\n */\n maxDuration?: number\n /**\n * preferredRegion is a segment config to signal deployment\n * region preferences to the provider being used\n */\n preferredRegion?: string | string[]\n\n /**\n * env is the environment variables to expose, this is only\n * populated for edge runtime currently\n */\n env?: Record<string, string>\n }\n}\n\nexport interface AdapterOutput {\n /**\n * `PAGES` represents all the React pages that are under `pages/`.\n */\n PAGES: SharedRouteFields & {\n type: AdapterOutputType.PAGES\n }\n\n /**\n * `PAGES_API` represents all the API routes under `pages/api/`.\n */\n PAGES_API: SharedRouteFields & {\n type: AdapterOutputType.PAGES_API\n }\n /**\n * `APP_PAGE` represents all the React pages that are under `app/` with the\n * filename of `page.{j,t}s{,x}`.\n */\n APP_PAGE: SharedRouteFields & {\n type: AdapterOutputType.APP_PAGE\n }\n\n /**\n * `APP_ROUTE` represents all the API routes and metadata routes that are under `app/` with the\n * filename of `route.{j,t}s{,x}`.\n */\n APP_ROUTE: SharedRouteFields & {\n type: AdapterOutputType.APP_ROUTE\n }\n\n /**\n * `PRERENDER` represents an ISR enabled route that might\n * have a seeded cache entry or fallback generated during build\n */\n PRERENDER: {\n id: string\n pathname: string\n type: AdapterOutputType.PRERENDER\n\n /**\n * For prerenders the parent output is the originating\n * page that the prerender is created from\n */\n parentOutputId: string\n\n /**\n * groupId is the identifier for a group of prerenders that should be\n * revalidated together\n */\n groupId: number\n\n pprChain?: {\n headers: Record<string, string>\n }\n\n /**\n * parentFallbackMode signals whether additional routes can be generated\n * e.g. fallback: false or 'blocking' in getStaticPaths in pages router\n */\n parentFallbackMode?: DynamicPrerenderManifestRoute['fallback']\n\n /**\n * fallback is initial cache data generated during build for a prerender\n */\n fallback?: {\n /**\n * path to the fallback file can be HTML/JSON/RSC\n */\n filePath: string\n /**\n * initialStatus is the status code that should be applied\n * when serving the fallback\n */\n initialStatus?: number\n /**\n * initialHeaders are the headers that should be sent when\n * serving the fallback\n */\n initialHeaders?: Record<string, string | string[]>\n /**\n * initial expiration is how long until the fallback entry\n * is considered expired and no longer valid to serve\n */\n initialExpiration?: number\n /**\n * initial revalidate is how long until the fallback is\n * considered stale and should be revalidated\n */\n initialRevalidate?: Revalidate\n\n /**\n * postponedState is the PPR state when it postponed and is used for resuming\n */\n postponedState?: string\n }\n /**\n * config related to the route\n */\n config: {\n /**\n * allowQuery is the allowed query values to be passed\n * to an ISR function and what should be considered for the cacheKey\n * e.g. for /blog/[slug], \"slug\" is the only allowQuery\n */\n allowQuery?: string[]\n /**\n * allowHeader is the allowed headers to be passed to an\n * ISR function to prevent accidentally poisoning the cache\n * from leaking additional information that can impact the render\n */\n allowHeader?: string[]\n /**\n * bypass for is a list of has conditions the cache\n * should be bypassed and invoked directly e.g. action header\n */\n bypassFor?: RouteHas[]\n /**\n * renderingMode signals PPR or not for a prerender\n */\n renderingMode?: RenderingMode\n\n /**\n * bypassToken is the generated token that signals a prerender cache\n * should be bypassed\n */\n bypassToken?: string\n }\n }\n\n /**\n * `STATIC_FILE` represents a static file (ie /_next/static) or a purely\n * static HTML asset e.g. an automatically statically optimized page\n * that does not use ISR\n */\n STATIC_FILE: {\n id: string\n filePath: string\n pathname: string\n type: AdapterOutputType.STATIC_FILE\n }\n\n /**\n * `MIDDLEWARE` represents the middleware output if present\n */\n MIDDLEWARE: SharedRouteFields & {\n type: AdapterOutputType.MIDDLEWARE\n /**\n * config related to the route\n */\n config: SharedRouteFields['config'] & {\n /**\n * matchers are the configured matchers for middleware\n */\n matchers?: Array<{\n source: string\n sourceRegex: string\n has: RouteHas[] | undefined\n missing: RouteHas[] | undefined\n }>\n }\n }\n}\n\nexport interface AdapterOutputs {\n pages: Array<AdapterOutput['PAGES']>\n middleware?: AdapterOutput['MIDDLEWARE']\n appPages: Array<AdapterOutput['APP_PAGE']>\n pagesApi: Array<AdapterOutput['PAGES_API']>\n appRoutes: Array<AdapterOutput['APP_ROUTE']>\n prerenders: Array<AdapterOutput['PRERENDER']>\n staticFiles: Array<AdapterOutput['STATIC_FILE']>\n}\n\ntype RewriteItem = {\n source: string\n sourceRegex: string\n destination: string\n has: RouteHas[] | undefined\n missing: RouteHas[] | undefined\n}\n\ntype DynamicRouteItem = {\n source: string\n sourceRegex: string\n destination: string\n has: RouteHas[] | undefined\n missing: RouteHas[] | undefined\n}\n\nexport interface NextAdapter {\n name: string\n /**\n * modifyConfig is called for any CLI command that loads the next.config\n * to only apply for specific commands the \"phase\" should be used\n * @param config\n * @param ctx\n * @returns\n */\n modifyConfig?: (\n config: NextConfigComplete,\n ctx: {\n phase: PHASE_TYPE\n }\n ) => Promise<NextConfigComplete> | NextConfigComplete\n onBuildComplete?: (ctx: {\n routes: {\n headers: Array<{\n source: string\n sourceRegex: string\n headers: Record<string, string>\n has: RouteHas[] | undefined\n missing: RouteHas[] | undefined\n priority?: boolean\n }>\n redirects: Array<{\n source: string\n sourceRegex: string\n destination: string\n statusCode: number\n has: RouteHas[] | undefined\n missing: RouteHas[] | undefined\n priority?: boolean\n }>\n rewrites: {\n beforeFiles: RewriteItem[]\n afterFiles: RewriteItem[]\n fallback: RewriteItem[]\n }\n dynamicRoutes: Array<DynamicRouteItem>\n }\n outputs: AdapterOutputs\n /**\n * projectDir is the absolute directory the Next.js application is in\n */\n projectDir: string\n /**\n * repoRoot is the absolute path of the detected root of the repo\n */\n repoRoot: string\n /**\n * distDir is the absolute path to the dist directory\n */\n distDir: string\n /**\n * config is the loaded next.config (has modifyConfig applied)\n */\n config: NextConfigComplete\n /**\n * nextVersion is the current version of Next.js being used\n */\n nextVersion: string\n /**\n * buildId is the current unique ID for the build, this can be\n * influenced by NextConfig.generateBuildId\n */\n buildId: string\n }) => Promise<void> | void\n}\n\nfunction normalizePathnames(\n config: NextConfigComplete,\n outputs: AdapterOutputs\n) {\n // normalize pathname field with basePath\n if (config.basePath) {\n for (const output of [\n ...outputs.pages,\n ...outputs.pagesApi,\n ...outputs.appPages,\n ...outputs.appRoutes,\n ...outputs.prerenders,\n ...outputs.staticFiles,\n ]) {\n output.pathname =\n addPathPrefix(output.pathname, config.basePath).replace(/\\/$/, '') ||\n '/'\n }\n }\n}\n\nexport async function handleBuildComplete({\n dir,\n config,\n buildId,\n configOutDir,\n distDir,\n pageKeys,\n tracingRoot,\n adapterPath,\n appPageKeys,\n staticPages,\n nextVersion,\n hasStatic404,\n hasStatic500,\n routesManifest,\n serverPropsPages,\n hasNodeMiddleware,\n prerenderManifest,\n middlewareManifest,\n requiredServerFiles,\n hasInstrumentationHook,\n functionsConfigManifest,\n}: {\n dir: string\n distDir: string\n buildId: string\n configOutDir: string\n adapterPath: string\n tracingRoot: string\n nextVersion: string\n hasStatic404: boolean\n hasStatic500: boolean\n staticPages: Set<string>\n hasNodeMiddleware: boolean\n config: NextConfigComplete\n pageKeys: readonly string[]\n serverPropsPages: Set<string>\n requiredServerFiles: string[]\n routesManifest: RoutesManifest\n hasInstrumentationHook: boolean\n prerenderManifest: PrerenderManifest\n middlewareManifest: MiddlewareManifest\n appPageKeys?: readonly string[] | undefined\n functionsConfigManifest: FunctionsConfigManifest\n}) {\n const adapterMod = interopDefault(\n await import(pathToFileURL(require.resolve(adapterPath)).href)\n ) as NextAdapter\n\n if (typeof adapterMod.onBuildComplete === 'function') {\n const outputs: AdapterOutputs = {\n pages: [],\n pagesApi: [],\n appPages: [],\n appRoutes: [],\n prerenders: [],\n staticFiles: [],\n }\n\n if (config.output === 'export') {\n // collect export assets and provide as static files\n const exportFiles = await recursiveReadDir(configOutDir)\n\n for (const file of exportFiles) {\n let pathname = (\n file.endsWith('.html') ? file.replace(/\\.html$/, '') : file\n ).replace(/\\\\/g, '/')\n\n pathname = pathname.startsWith('/') ? pathname : `/${pathname}`\n\n outputs.staticFiles.push({\n id: file,\n pathname,\n filePath: path.join(configOutDir, file),\n type: AdapterOutputType.STATIC_FILE,\n } satisfies AdapterOutput['STATIC_FILE'])\n }\n } else {\n const staticFiles = await recursiveReadDir(path.join(distDir, 'static'))\n\n for (const file of staticFiles) {\n const pathname = path.posix.join('/_next/static', file)\n const filePath = path.join(distDir, 'static', file)\n outputs.staticFiles.push({\n type: AdapterOutputType.STATIC_FILE,\n id: path.join('static', file),\n pathname,\n filePath,\n })\n }\n\n const sharedNodeAssets: Record<string, string> = {}\n const pagesSharedNodeAssets: Record<string, string> = {}\n const appPagesSharedNodeAssets: Record<string, string> = {}\n\n const sharedTraceIgnores = [\n '**/next/dist/compiled/next-server/**/*.dev.js',\n '**/next/dist/compiled/webpack/*',\n '**/node_modules/webpack5/**/*',\n '**/next/dist/server/lib/route-resolver*',\n 'next/dist/compiled/semver/semver/**/*.js',\n '**/node_modules/react{,-dom,-dom-server-turbopack}/**/*.development.js',\n '**/*.d.ts',\n '**/*.map',\n '**/next/dist/pages/**/*',\n '**/node_modules/sharp/**/*',\n '**/@img/sharp-libvips*/**/*',\n '**/next/dist/compiled/edge-runtime/**/*',\n '**/next/dist/server/web/sandbox/**/*',\n '**/next/dist/server/post-process.js',\n ]\n const sharedIgnoreFn = makeIgnoreFn(tracingRoot, sharedTraceIgnores)\n\n for (const file of requiredServerFiles) {\n // add to shared node assets\n const filePath = path.join(dir, file)\n const fileOutputPath = path.relative(tracingRoot, filePath)\n sharedNodeAssets[fileOutputPath] = filePath\n }\n\n const moduleTypes = ['app-page', 'pages'] as const\n\n for (const type of moduleTypes) {\n const currentDependencies: string[] = []\n const modulePath = require.resolve(\n `next/dist/server/route-modules/${type}/module.compiled`\n )\n const contextDir = path.join(\n path.dirname(modulePath),\n 'vendored',\n 'contexts'\n )\n\n for (const item of await fs.readdir(contextDir)) {\n if (item.match(/\\.(mjs|cjs|js)$/)) {\n currentDependencies.push(path.join(contextDir, item))\n }\n }\n\n const { fileList, esmFileList } = await nodeFileTrace(\n currentDependencies,\n {\n base: tracingRoot,\n ignore: sharedIgnoreFn,\n }\n )\n esmFileList.forEach((item) => fileList.add(item))\n\n for (const rootRelativeFilePath of fileList) {\n if (type === 'pages') {\n pagesSharedNodeAssets[rootRelativeFilePath] = path.join(\n tracingRoot,\n rootRelativeFilePath\n )\n } else {\n appPagesSharedNodeAssets[rootRelativeFilePath] = path.join(\n tracingRoot,\n rootRelativeFilePath\n )\n }\n }\n }\n\n // These are modules that are necessary for bootstrapping node env\n const necessaryNodeDependencies = [\n require.resolve('next/dist/server/node-environment'),\n require.resolve('next/dist/server/require-hook'),\n require.resolve('next/dist/server/node-polyfill-crypto'),\n ...Object.values(defaultOverrides).filter((item) => path.extname(item)),\n ]\n\n const { fileList, esmFileList } = await nodeFileTrace(\n necessaryNodeDependencies,\n {\n base: tracingRoot,\n ignore: sharedIgnoreFn,\n }\n )\n esmFileList.forEach((item) => fileList.add(item))\n\n for (const rootRelativeFilePath of fileList) {\n sharedNodeAssets[rootRelativeFilePath] = path.join(\n tracingRoot,\n rootRelativeFilePath\n )\n }\n\n if (hasInstrumentationHook) {\n const assets = await handleTraceFiles(\n path.join(distDir, 'server', 'instrumentation.js.nft.json'),\n 'neutral'\n )\n const fileOutputPath = path.relative(\n tracingRoot,\n path.join(distDir, 'server', 'instrumentation.js')\n )\n sharedNodeAssets[fileOutputPath] = path.join(\n distDir,\n 'server',\n 'instrumentation.js'\n )\n Object.assign(sharedNodeAssets, assets)\n }\n\n async function handleTraceFiles(\n traceFilePath: string,\n type: 'pages' | 'app' | 'neutral'\n ): Promise<Record<string, string>> {\n const assets: Record<string, string> = Object.assign(\n {},\n sharedNodeAssets,\n type === 'pages' ? pagesSharedNodeAssets : {},\n type === 'app' ? appPagesSharedNodeAssets : {}\n )\n const traceData = JSON.parse(\n await fs.readFile(traceFilePath, 'utf8')\n ) as {\n files: string[]\n }\n const traceFileDir = path.dirname(traceFilePath)\n\n for (const relativeFile of traceData.files) {\n const tracedFilePath = path.join(traceFileDir, relativeFile)\n const fileOutputPath = path.relative(tracingRoot, tracedFilePath)\n assets[fileOutputPath] = tracedFilePath\n }\n return assets\n }\n\n async function handleEdgeFunction(\n page: EdgeFunctionDefinition,\n isMiddleware: boolean = false\n ) {\n let type: AdapterOutputType = AdapterOutputType.PAGES\n const isAppPrefix = page.name.startsWith('app/')\n const isAppPage = isAppPrefix && page.name.endsWith('/page')\n const isAppRoute = isAppPrefix && page.name.endsWith('/route')\n let currentOutputs: Array<\n | AdapterOutput['PAGES']\n | AdapterOutput['PAGES_API']\n | AdapterOutput['APP_PAGE']\n | AdapterOutput['APP_ROUTE']\n > = outputs.pages\n\n if (isMiddleware) {\n type = AdapterOutputType.MIDDLEWARE\n } else if (isAppPage) {\n currentOutputs = outputs.appPages\n type = AdapterOutputType.APP_PAGE\n } else if (isAppRoute) {\n currentOutputs = outputs.appRoutes\n type = AdapterOutputType.APP_ROUTE\n } else if (page.page.startsWith('/api')) {\n currentOutputs = outputs.pagesApi\n type = AdapterOutputType.PAGES_API\n }\n\n const route = page.page.replace(/^(app|pages)\\//, '')\n\n const output: Omit<AdapterOutput[typeof type], 'type'> & {\n type: any\n } = {\n type,\n id: page.name,\n runtime: 'edge',\n sourcePage: route,\n pathname: isAppPrefix ? normalizeAppPath(route) : route,\n filePath: path.join(\n distDir,\n page.files.find(\n (item) =>\n item.startsWith('server/app') || item.startsWith('server/pages')\n ) ||\n // TODO: turbopack build doesn't name the main entry chunk\n // identifiably so we don't know which to mark here but\n // technically edge needs all chunks to load always so\n // should this field even be provided?\n page.files[0] ||\n ''\n ),\n assets: {},\n wasmAssets: {},\n config: {\n env: page.env,\n },\n }\n\n function handleFile(file: string) {\n const originalPath = path.join(distDir, file)\n const fileOutputPath = path.join(\n path.relative(tracingRoot, distDir),\n file\n )\n if (!output.assets) {\n output.assets = {}\n }\n output.assets[fileOutputPath] = originalPath\n }\n for (const file of page.files) {\n handleFile(file)\n }\n for (const item of [...(page.assets || [])]) {\n handleFile(item.filePath)\n }\n for (const item of page.wasm || []) {\n if (!output.wasmAssets) {\n output.wasmAssets = {}\n }\n output.wasmAssets[item.name] = path.join(distDir, item.filePath)\n }\n\n if (type === AdapterOutputType.MIDDLEWARE) {\n ;(output as AdapterOutput['MIDDLEWARE']).config.matchers =\n page.matchers.map((item) => {\n return {\n source: item.originalSource,\n sourceRegex: item.regexp,\n has: item.has,\n missing: [\n ...(item.missing || []),\n // always skip middleware for on-demand revalidate\n {\n type: 'header',\n key: 'x-prerender-revalidate',\n value: prerenderManifest.preview.previewModeId,\n },\n ],\n }\n })\n output.pathname = '/_middleware'\n output.id = page.name\n outputs.middleware = output\n } else {\n currentOutputs.push(output)\n }\n\n // need to add matching .rsc output\n if (isAppPage) {\n const rscPathname =\n (output.pathname === '/' ? '/index' : output.pathname) + '.rsc'\n outputs.appPages.push({\n ...output,\n pathname: rscPathname,\n id: page.name + '.rsc',\n })\n }\n }\n\n const edgeFunctionHandlers: Promise<any>[] = []\n\n for (const middleware of Object.values(middlewareManifest.middleware)) {\n if (isMiddlewareFilename(middleware.name)) {\n edgeFunctionHandlers.push(handleEdgeFunction(middleware, true))\n }\n }\n\n for (const page of Object.values(middlewareManifest.functions)) {\n edgeFunctionHandlers.push(handleEdgeFunction(page))\n }\n const pagesDistDir = path.join(distDir, 'server', 'pages')\n const pageOutputMap: Record<\n string,\n AdapterOutput['PAGES'] | AdapterOutput['PAGES_API']\n > = {}\n\n const rscFallbackPath = path.join(distDir, 'server', 'rsc-fallback.json')\n\n if (appPageKeys && appPageKeys.length > 0 && pageKeys.length > 0) {\n await fs.writeFile(rscFallbackPath, '{}')\n }\n\n for (const page of pageKeys) {\n if (page === '/_app' || page === '/_document') {\n continue\n }\n\n if (middlewareManifest.functions.hasOwnProperty(page)) {\n continue\n }\n\n const route = normalizePagePath(page)\n const pageFile = path.join(pagesDistDir, `${route}.js`)\n\n // if it's an auto static optimized page it's just\n // a static file\n if (staticPages.has(page)) {\n if (config.i18n) {\n for (const locale of config.i18n.locales || []) {\n const localePage =\n page === '/' ? `/${locale}` : addPathPrefix(page, `/${locale}`)\n\n const localeOutput = {\n id: localePage,\n pathname: localePage,\n type: AdapterOutputType.STATIC_FILE,\n filePath: path.join(\n pagesDistDir,\n `${normalizePagePath(localePage)}.html`\n ),\n } satisfies AdapterOutput['STATIC_FILE']\n\n outputs.staticFiles.push(localeOutput)\n\n if (appPageKeys && appPageKeys.length > 0) {\n outputs.staticFiles.push({\n id: `${localePage}.rsc`,\n pathname: `${localePage}.rsc`,\n type: AdapterOutputType.STATIC_FILE,\n filePath: rscFallbackPath,\n })\n }\n }\n } else {\n const staticOutput = {\n id: page,\n pathname: route,\n type: AdapterOutputType.STATIC_FILE,\n filePath: pageFile.replace(/\\.js$/, '.html'),\n } satisfies AdapterOutput['STATIC_FILE']\n\n outputs.staticFiles.push(staticOutput)\n\n if (appPageKeys && appPageKeys.length > 0) {\n outputs.staticFiles.push({\n id: `${page}.rsc`,\n pathname: `${route}.rsc`,\n type: AdapterOutputType.STATIC_FILE,\n filePath: rscFallbackPath,\n })\n }\n }\n // if was a static file output don't create page output as well\n continue\n }\n\n const pageTraceFile = `${pageFile}.nft.json`\n const assets = await handleTraceFiles(pageTraceFile, 'pages').catch(\n (err) => {\n if (err.code !== 'ENOENT' || (page !== '/404' && page !== '/500')) {\n Log.warn(`Failed to locate traced assets for ${pageFile}`, err)\n }\n return {} as Record<string, string>\n }\n )\n const functionConfig = functionsConfigManifest.functions[route] || {}\n let sourcePage = route.replace(/^\\//, '')\n\n sourcePage = sourcePage === 'api' ? 'api/index' : sourcePage\n\n const output: AdapterOutput['PAGES'] | AdapterOutput['PAGES_API'] = {\n id: route,\n type: page.startsWith('/api')\n ? AdapterOutputType.PAGES_API\n : AdapterOutputType.PAGES,\n filePath: pageTraceFile.replace(/\\.nft\\.json$/, ''),\n pathname: route,\n sourcePage,\n assets,\n runtime: 'nodejs',\n config: {\n maxDuration: functionConfig.maxDuration,\n preferredRegion: functionConfig.regions,\n },\n }\n pageOutputMap[page] = output\n\n if (output.type === AdapterOutputType.PAGES) {\n outputs.pages.push(output)\n\n // if page is get server side props we need to create\n // the _next/data output as well\n if (serverPropsPages.has(page)) {\n const dataPathname = path.posix.join(\n '/_next/data',\n buildId,\n page + '.json'\n )\n outputs.pages.push({\n ...output,\n pathname: dataPathname,\n id: dataPathname,\n })\n }\n\n for (const locale of config.i18n?.locales || []) {\n const localePage =\n page === '/' ? `/${locale}` : addPathPrefix(page, `/${locale}`)\n\n outputs.pages.push({\n ...output,\n id: localePage,\n pathname: localePage,\n })\n\n if (serverPropsPages.has(page)) {\n const dataPathname = path.posix.join(\n '/_next/data',\n buildId,\n localePage + '.json'\n )\n outputs.pages.push({\n ...output,\n pathname: dataPathname,\n id: dataPathname,\n })\n }\n }\n } else {\n outputs.pagesApi.push(output)\n }\n\n if (appPageKeys && appPageKeys.length > 0) {\n outputs.staticFiles.push({\n id: `${output.id}.rsc`,\n pathname: `${output.pathname}.rsc`,\n type: AdapterOutputType.STATIC_FILE,\n filePath: rscFallbackPath,\n })\n }\n }\n\n if (hasNodeMiddleware) {\n const middlewareFile = path.join(distDir, 'server', 'middleware.js')\n const middlewareTrace = `${middlewareFile}.nft.json`\n const assets = await handleTraceFiles(middlewareTrace, 'neutral')\n const functionConfig =\n functionsConfigManifest.functions['/_middleware'] || {}\n\n outputs.middleware = {\n pathname: '/_middleware',\n id: '/_middleware',\n sourcePage: 'middleware',\n assets,\n type: AdapterOutputType.MIDDLEWARE,\n runtime: 'nodejs',\n filePath: middlewareFile,\n config: {\n matchers:\n functionConfig.matchers?.map((item) => {\n return {\n source: item.originalSource,\n sourceRegex: item.regexp,\n has: item.has,\n missing: [\n ...(item.missing || []),\n // always skip middleware for on-demand revalidate\n {\n type: 'header',\n key: 'x-prerender-revalidate',\n value: prerenderManifest.preview.previewModeId,\n },\n ],\n }\n }) || [],\n },\n } satisfies AdapterOutput['MIDDLEWARE']\n }\n const appOutputMap: Record<\n string,\n AdapterOutput['APP_PAGE'] | AdapterOutput['APP_ROUTE']\n > = {}\n const appDistDir = path.join(distDir, 'server', 'app')\n\n if (appPageKeys) {\n for (const page of appPageKeys) {\n if (middlewareManifest.functions.hasOwnProperty(page)) {\n continue\n }\n const normalizedPage = normalizeAppPath(page)\n const pageFile = path.join(appDistDir, `${page}.js`)\n const pageTraceFile = `${pageFile}.nft.json`\n const assets = await handleTraceFiles(pageTraceFile, 'app').catch(\n (err) => {\n Log.warn(`Failed to copy traced files for ${pageFile}`, err)\n return {} as Record<string, string>\n }\n )\n\n // If this is a parallel route we just need to merge\n // the assets as they share the same pathname\n const existingOutput = appOutputMap[normalizedPage]\n if (existingOutput) {\n Object.assign(existingOutput.assets, assets)\n existingOutput.assets[path.relative(tracingRoot, pageFile)] =\n pageFile\n\n continue\n }\n\n const functionConfig =\n functionsConfigManifest.functions[normalizedPage] || {}\n\n const output: AdapterOutput['APP_PAGE'] | AdapterOutput['APP_ROUTE'] =\n {\n pathname: normalizedPage,\n id: normalizedPage,\n sourcePage: page,\n assets,\n type: page.endsWith('/route')\n ? AdapterOutputType.APP_ROUTE\n : AdapterOutputType.APP_PAGE,\n runtime: 'nodejs',\n filePath: pageFile,\n config: {\n maxDuration: functionConfig.maxDuration,\n preferredRegion: functionConfig.regions,\n },\n }\n appOutputMap[normalizedPage] = output\n\n if (output.type === AdapterOutputType.APP_PAGE) {\n outputs.appPages.push({\n ...output,\n pathname:\n (output.pathname === '/' ? '/index' : output.pathname) + '.rsc',\n id: (output.id === '/' ? '/index' : output.pathname) + '.rsc',\n })\n outputs.appPages.push(output)\n } else {\n outputs.appRoutes.push(output)\n }\n }\n }\n\n const getParentOutput = (\n srcRoute: string,\n childRoute: string,\n allowMissing?: boolean\n ) => {\n const normalizedSrcRoute = normalizeLocalePath(\n srcRoute,\n config.i18n?.locales || []\n ).pathname\n const parentOutput =\n pageOutputMap[normalizedSrcRoute] || appOutputMap[normalizedSrcRoute]\n\n if (!parentOutput && !allowMissing) {\n console.error({\n appOutputs: Object.keys(appOutputMap),\n pageOutputs: Object.keys(pageOutputMap),\n })\n throw new Error(\n `Invariant: failed to find source route ${srcRoute} for prerender ${childRoute}`\n )\n }\n return parentOutput\n }\n\n const {\n prefetchSegmentDirSuffix,\n prefetchSegmentSuffix,\n varyHeader,\n didPostponeHeader,\n contentTypeHeader: rscContentTypeHeader,\n } = routesManifest.rsc\n\n const handleAppMeta = async (\n route: string,\n initialOutput: AdapterOutput['PRERENDER'],\n meta: {\n postponed?: string\n segmentPaths?: string[]\n }\n ) => {\n if (meta.postponed && initialOutput.fallback) {\n initialOutput.fallback.postponedState = meta.postponed\n }\n\n if (meta?.segmentPaths) {\n const segmentsDir = path.join(\n appDistDir,\n `${route}${prefetchSegmentDirSuffix}`\n )\n\n for (const segmentPath of meta.segmentPaths) {\n const outputSegmentPath =\n path.join(route + prefetchSegmentDirSuffix, segmentPath) +\n prefetchSegmentSuffix\n\n const fallbackPathname = path.join(\n segmentsDir,\n segmentPath + prefetchSegmentSuffix\n )\n\n outputs.prerenders.push({\n id: outputSegmentPath,\n pathname: outputSegmentPath,\n type: AdapterOutputType.PRERENDER,\n parentOutputId: initialOutput.parentOutputId,\n groupId: initialOutput.groupId,\n\n config: {\n ...initialOutput.config,\n },\n\n fallback: {\n filePath: fallbackPathname,\n initialExpiration: initialOutput.fallback?.initialExpiration,\n initialRevalidate: initialOutput.fallback?.initialRevalidate,\n\n initialHeaders: {\n ...initialOutput.fallback?.initialHeaders,\n vary: varyHeader,\n 'content-type': rscContentTypeHeader,\n [didPostponeHeader]: '2',\n },\n },\n } satisfies AdapterOutput['PRERENDER'])\n }\n }\n }\n\n let prerenderGroupId = 1\n\n type AppRouteMeta = {\n segmentPaths?: string[]\n postponed?: string\n headers?: Record<string, string>\n status?: number\n }\n\n const getAppRouteMeta = async (\n route: string,\n isAppPage: boolean\n ): Promise<AppRouteMeta> => {\n const meta: AppRouteMeta = isAppPage\n ? JSON.parse(\n await fs\n .readFile(path.join(appDistDir, `${route}.meta`), 'utf8')\n .catch(() => '{}')\n )\n : {}\n\n if (meta.headers) {\n // normalize these for consistency\n for (const key of Object.keys(meta.headers)) {\n const keyLower = key.toLowerCase()\n if (keyLower !== key) {\n const value = meta.headers[key]\n delete meta.headers[key]\n meta.headers[keyLower] = value\n }\n }\n }\n\n return meta\n }\n\n const filePathCache = new Map<string, Promise<boolean>>()\n const cachedFilePathCheck = async (filePath: string) => {\n if (filePathCache.has(filePath)) {\n return filePathCache.get(filePath)\n }\n const newCheck = fs\n .access(filePath)\n .then(() => true)\n .catch(() => false)\n filePathCache.set(filePath, newCheck)\n\n return newCheck\n }\n\n for (const route in prerenderManifest.routes) {\n const {\n initialExpireSeconds: initialExpiration,\n initialRevalidateSeconds: initialRevalidate,\n initialHeaders,\n initialStatus,\n prefetchDataRoute,\n dataRoute,\n renderingMode,\n allowHeader,\n experimentalBypassFor,\n } = prerenderManifest.routes[route]\n\n const srcRoute = prerenderManifest.routes[route].srcRoute || route\n const srcRouteInfo = prerenderManifest.dynamicRoutes[srcRoute]\n\n const isAppPage =\n Boolean(appOutputMap[srcRoute]) || srcRoute === '/_not-found'\n\n const isNotFoundTrue = prerenderManifest.notFoundRoutes.includes(route)\n\n let allowQuery: string[] | undefined\n const routeKeys = routesManifest.dynamicRoutes.find(\n (item) => item.page === srcRoute\n )?.routeKeys\n\n if (!isDynamicRoute(srcRoute)) {\n // for non-dynamic routes we use an empty array since\n // no query values bust the cache for non-dynamic prerenders\n // prerendered paths also do not pass allowQuery as they match\n // during handle: 'filesystem' so should not cache differently\n // by query values\n allowQuery = []\n } else if (routeKeys) {\n // if we have routeKeys in the routes-manifest we use those\n // for allowQuery for dynamic routes\n allowQuery = Object.values(routeKeys)\n }\n\n let filePath = path.join(\n isAppPage ? appDistDir : pagesDistDir,\n `${route === '/' ? 'index' : route}.${isAppPage && !dataRoute ? 'body' : 'html'}`\n )\n\n // we use the static 404 for notFound: true if available\n // if not we do a blocking invoke on first request\n if (isNotFoundTrue && hasStatic404) {\n const locale =\n config.i18n &&\n normalizeLocalePath(route, config.i18n?.locales).detectedLocale\n\n for (const currentFilePath of [\n path.join(pagesDistDir, locale || '', '404.html'),\n path.join(pagesDistDir, '404.html'),\n ]) {\n if (await cachedFilePathCheck(currentFilePath)) {\n filePath = currentFilePath\n break\n }\n }\n }\n\n const meta = await getAppRouteMeta(route, isAppPage)\n\n const initialOutput: AdapterOutput['PRERENDER'] = {\n id: route,\n type: AdapterOutputType.PRERENDER,\n pathname: route,\n parentOutputId:\n srcRoute === '/_not-found'\n ? srcRoute\n : getParentOutput(srcRoute, route).id,\n groupId: prerenderGroupId,\n\n pprChain:\n isAppPage && config.experimental.ppr\n ? {\n headers: {\n [NEXT_RESUME_HEADER]: '1',\n },\n }\n : undefined,\n\n parentFallbackMode: srcRouteInfo?.fallback,\n\n fallback:\n !isNotFoundTrue || (isNotFoundTrue && hasStatic404)\n ? {\n filePath,\n initialStatus:\n (initialStatus ?? isNotFoundTrue) ? 404 : undefined,\n initialHeaders: {\n ...initialHeaders,\n vary: varyHeader,\n 'content-type': HTML_CONTENT_TYPE_HEADER,\n ...meta.headers,\n },\n initialExpiration,\n initialRevalidate:\n typeof initialRevalidate === 'undefined'\n ? 1\n : initialRevalidate,\n }\n : undefined,\n config: {\n allowQuery,\n allowHeader,\n renderingMode,\n bypassFor: experimentalBypassFor,\n bypassToken: prerenderManifest.preview.previewModeId,\n },\n }\n outputs.prerenders.push(initialOutput)\n\n if (dataRoute) {\n let dataFilePath = path.join(\n pagesDistDir,\n `${route === '/' ? 'index' : route}.json`\n )\n\n if (isAppPage) {\n // When experimental PPR is enabled, we expect that the data\n // that should be served as a part of the prerender should\n // be from the prefetch data route. If this isn't enabled\n // for ppr, the only way to get the data is from the data\n // route.\n dataFilePath = path.join(\n appDistDir,\n prefetchDataRoute &&\n renderingMode === RenderingMode.PARTIALLY_STATIC\n ? prefetchDataRoute\n : dataRoute\n )\n }\n\n outputs.prerenders.push({\n ...initialOutput,\n id: dataRoute,\n pathname: dataRoute,\n fallback: isNotFoundTrue\n ? undefined\n : {\n ...initialOutput.fallback,\n initialHeaders: {\n ...initialOutput.fallback?.initialHeaders,\n 'content-type': isAppPage\n ? rscContentTypeHeader\n : JSON_CONTENT_TYPE_HEADER,\n },\n filePath: dataFilePath,\n },\n })\n }\n\n if (isAppPage) {\n await handleAppMeta(route, initialOutput, meta)\n }\n prerenderGroupId += 1\n }\n\n for (const dynamicRoute in prerenderManifest.dynamicRoutes) {\n const {\n fallback,\n fallbackExpire,\n fallbackRevalidate,\n fallbackHeaders,\n fallbackStatus,\n allowHeader,\n dataRoute,\n renderingMode,\n experimentalBypassFor,\n } = prerenderManifest.dynamicRoutes[dynamicRoute]\n\n const isAppPage = Boolean(appOutputMap[dynamicRoute])\n\n const allowQuery = Object.values(\n routesManifest.dynamicRoutes.find(\n (item) => item.page === dynamicRoute\n )?.routeKeys || {}\n )\n const meta = await getAppRouteMeta(dynamicRoute, isAppPage)\n\n const initialOutput: AdapterOutput['PRERENDER'] = {\n id: dynamicRoute,\n type: AdapterOutputType.PRERENDER,\n pathname: dynamicRoute,\n parentOutputId: getParentOutput(dynamicRoute, dynamicRoute).id,\n groupId: prerenderGroupId,\n config: {\n allowQuery,\n allowHeader,\n renderingMode,\n bypassFor: experimentalBypassFor,\n bypassToken: prerenderManifest.preview.previewModeId,\n },\n fallback:\n typeof fallback === 'string'\n ? {\n filePath: path.join(\n isAppPage ? appDistDir : pagesDistDir,\n // app router dynamic route fallbacks don't have the\n // extension so ensure it's added here\n fallback.endsWith('.html') ? fallback : `${fallback}.html`\n ),\n initialStatus: fallbackStatus,\n initialHeaders: {\n ...fallbackHeaders,\n 'content-type': HTML_CONTENT_TYPE_HEADER,\n },\n initialExpiration: fallbackExpire,\n initialRevalidate: fallbackRevalidate || 1,\n }\n : undefined,\n }\n\n if (!config.i18n || isAppPage) {\n outputs.prerenders.push(initialOutput)\n\n if (isAppPage) {\n await handleAppMeta(dynamicRoute, initialOutput, meta)\n }\n\n if (dataRoute) {\n outputs.prerenders.push({\n ...initialOutput,\n id: dataRoute,\n pathname: dataRoute,\n fallback: undefined,\n })\n }\n prerenderGroupId += 1\n } else {\n for (const locale of config.i18n.locales) {\n const currentOutput = {\n ...initialOutput,\n pathname: path.posix.join(`/${locale}`, initialOutput.pathname),\n id: path.posix.join(`/${locale}`, initialOutput.id),\n fallback:\n typeof fallback === 'string'\n ? {\n ...initialOutput.fallback,\n filePath: path.join(\n pagesDistDir,\n locale,\n // app router dynamic route fallbacks don't have the\n // extension so ensure it's added here\n fallback.endsWith('.html')\n ? fallback\n : `${fallback}.html`\n ),\n }\n : undefined,\n groupId: prerenderGroupId,\n }\n outputs.prerenders.push(currentOutput)\n\n if (dataRoute) {\n const dataPathname = path.posix.join(\n `/_next/data`,\n buildId,\n locale,\n dynamicRoute + '.json'\n )\n outputs.prerenders.push({\n ...initialOutput,\n id: dataPathname,\n pathname: dataPathname,\n // data route doesn't have skeleton fallback\n fallback: undefined,\n groupId: prerenderGroupId,\n })\n }\n prerenderGroupId += 1\n }\n }\n }\n\n // ensure 404\n const staticErrorDocs = [\n ...(hasStatic404 ? ['/404'] : []),\n ...(hasStatic500 ? ['/500'] : []),\n ]\n\n for (const errorDoc of staticErrorDocs) {\n const errorDocPath = path.posix.join(\n '/',\n config.i18n?.defaultLocale || '',\n errorDoc\n )\n\n if (!prerenderManifest.routes[errorDocPath]) {\n for (const currentDocPath of [\n errorDocPath,\n ...(config.i18n?.locales?.map((locale) =>\n path.posix.join('/', locale, errorDoc)\n ) || []),\n ]) {\n const currentFilePath = path.join(\n pagesDistDir,\n `${currentDocPath}.html`\n )\n if (await cachedFilePathCheck(currentFilePath)) {\n outputs.staticFiles.push({\n pathname: currentDocPath,\n id: currentDocPath,\n type: AdapterOutputType.STATIC_FILE,\n filePath: currentFilePath,\n })\n }\n }\n }\n }\n }\n\n normalizePathnames(config, outputs)\n\n const dynamicRoutes: DynamicRouteItem[] = []\n const dynamicDataRoutes: DynamicRouteItem[] = []\n const dynamicSegmentRoutes: DynamicRouteItem[] = []\n\n const getDestinationQuery = (routeKeys: Record<string, string>) => {\n const items = Object.entries(routeKeys ?? {})\n if (items.length === 0) return ''\n\n return '?' + items.map(([key, value]) => `${value}=$${key}`).join('&')\n }\n\n const fallbackFalseHasCondition: RouteHas[] = [\n {\n type: 'cookie',\n key: '__prerender_bypass',\n value: prerenderManifest.preview.previewModeId,\n },\n {\n type: 'cookie',\n key: '__next_preview_data',\n },\n ]\n\n for (const route of routesManifest.dynamicRoutes) {\n const shouldLocalize = config.i18n\n\n const routeRegex = getNamedRouteRegex(route.page, {\n prefixRouteKeys: true,\n })\n\n const isFallbackFalse =\n prerenderManifest.dynamicRoutes[route.page]?.fallback === false\n\n const { hasFallbackRootParams } = route\n\n const sourceRegex = routeRegex.namedRegex.replace(\n '^',\n `^${config.basePath && config.basePath !== '/' ? path.posix.join('/', config.basePath || '') : ''}[/]?${shouldLocalize ? '(?<nextLocale>[^/]{1,})?' : ''}`\n )\n const destination =\n path.posix.join(\n '/',\n config.basePath,\n shouldLocalize ? '/$nextLocale' : '',\n route.page\n ) + getDestinationQuery(route.routeKeys)\n\n if (appPageKeys && appPageKeys.length > 0 && config.cacheComponents) {\n // If we have fallback root params (implying we've already\n // emitted a rewrite for the /_tree request), or if the route\n // has PPR enabled and client param parsing is enabled, then\n // we don't need to include any other suffixes.\n const shouldSkipSuffixes = hasFallbackRootParams\n\n dynamicRoutes.push({\n source: route.page + '.rsc',\n sourceRegex: sourceRegex.replace(\n new RegExp(escapeStringRegexp('(?:/)?$')),\n // Now than the upstream issues has been resolved, we can safely\n // add the suffix back, this resolves a bug related to segment\n // rewrites not capturing the correct suffix values when\n // enabled.\n shouldSkipSuffixes\n ? '(?<rscSuffix>\\\\.rsc|\\\\.segments/.+\\\\.segment\\\\.rsc)(?:/)?$'\n : '(?<rscSuffix>\\\\.rsc|\\\\.prefetch\\\\.rsc|\\\\.segments/.+\\\\.segment\\\\.rsc)(?:/)?$'\n ),\n destination: destination?.replace(/($|\\?)/, '$rscSuffix$1'),\n has: isFallbackFalse ? fallbackFalseHasCondition : undefined,\n missing: undefined,\n })\n }\n\n // needs basePath and locale handling if pages router\n dynamicRoutes.push({\n source: route.page,\n sourceRegex,\n destination,\n has: isFallbackFalse ? fallbackFalseHasCondition : undefined,\n missing: undefined,\n })\n\n for (const segmentRoute of route.prefetchSegmentDataRoutes || []) {\n dynamicSegmentRoutes.push({\n source: route.page,\n sourceRegex: segmentRoute.source.replace(\n '^',\n `^${config.basePath && config.basePath !== '/' ? path.posix.join('/', config.basePath || '') : ''}[/]?`\n ),\n destination: path.posix.join(\n '/',\n config.basePath,\n segmentRoute.destination +\n getDestinationQuery(segmentRoute.routeKeys)\n ),\n has: undefined,\n missing: undefined,\n })\n }\n }\n\n const needsMiddlewareResolveRoutes =\n outputs.middleware && outputs.pages.length > 0\n\n const dataRoutePages = new Set([\n ...routesManifest.dataRoutes.map((item) => item.page),\n ])\n const sortedDataPages = sortSortableRoutes([\n ...(needsMiddlewareResolveRoutes\n ? [...staticPages].map((page) => ({ sourcePage: page, page }))\n : []),\n ...routesManifest.dataRoutes.map((item) => ({\n sourcePage: item.page,\n page: item.page,\n })),\n ])\n\n for (const { page } of sortedDataPages) {\n if (needsMiddlewareResolveRoutes || isDynamicRoute(page)) {\n const shouldLocalize = config.i18n\n const isFallbackFalse =\n prerenderManifest.dynamicRoutes[page]?.fallback === false\n\n const routeRegex = getNamedRouteRegex(page + '.json', {\n prefixRouteKeys: true,\n includeSuffix: true,\n })\n const destination = path.posix.join(\n '/',\n config.basePath,\n ...(dataRoutePages.has(page) ? [`_next/data`, buildId] : ''),\n ...(page === '/'\n ? [shouldLocalize ? '$nextLocale.json' : 'index.json']\n : [\n shouldLocalize ? '$nextLocale' : '',\n page +\n '.json' +\n getDestinationQuery(routeRegex.routeKeys || {}),\n ])\n )\n\n dynamicDataRoutes.push({\n source: page,\n sourceRegex:\n shouldLocalize && page === '/'\n ? '^' +\n path.posix.join(\n '/',\n config.basePath,\n '_next/data',\n escapeStringRegexp(buildId),\n '(?<nextLocale>[^/]{1,}).json'\n )\n : routeRegex.namedRegex.replace(\n '^',\n `^${path.posix.join(\n '/',\n config.basePath,\n `_next/data`,\n escapeStringRegexp(buildId)\n )}[/]?${shouldLocalize ? '(?<nextLocale>[^/]{1,})?' : ''}`\n ),\n destination,\n has: isFallbackFalse ? fallbackFalseHasCondition : undefined,\n missing: undefined,\n })\n }\n }\n\n const buildRewriteItem = (route: ManifestRewriteRoute): RewriteItem => {\n const converted = convertRewrites([route], ['nextInternalLocale'])[0]\n const regex = converted.src || route.regex\n\n return {\n source: route.source,\n sourceRegex: route.internal ? regex : modifyRouteRegex(regex),\n destination: converted.dest || route.destination,\n has: route.has,\n missing: route.missing,\n }\n }\n\n try {\n Log.info(`Running onBuildComplete from ${adapterMod.name}`)\n await adapterMod.onBuildComplete({\n routes: {\n dynamicRoutes: [\n ...dynamicDataRoutes,\n ...dynamicSegmentRoutes,\n ...dynamicRoutes,\n ],\n rewrites: {\n beforeFiles:\n routesManifest.rewrites.beforeFiles.map(buildRewriteItem),\n afterFiles:\n routesManifest.rewrites.afterFiles.map(buildRewriteItem),\n fallback: routesManifest.rewrites.fallback.map(buildRewriteItem),\n },\n redirects: routesManifest.redirects.map((route) => {\n const converted = convertRedirects([route], 307)[0]\n let dest = 'headers' in converted && converted.headers?.Location\n const regex = converted.src || route.regex\n\n return {\n source: route.source,\n sourceRegex: route.internal ? regex : modifyRouteRegex(regex),\n destination: dest || route.destination,\n statusCode: converted.status || getRedirectStatus(route),\n has: route.has,\n missing: route.missing,\n priority: route.internal || undefined,\n }\n }),\n headers: routesManifest.headers.map((route) => {\n const converted = convertHeaders([route])[0]\n const regex = converted.src || route.regex\n\n return {\n source: route.source,\n sourceRegex: route.internal ? regex : modifyRouteRegex(regex),\n headers: 'headers' in converted ? converted.headers || {} : {},\n has: route.has,\n missing: route.missing,\n priority: route.internal || undefined,\n }\n }),\n },\n outputs,\n\n config,\n distDir,\n buildId,\n nextVersion,\n projectDir: dir,\n repoRoot: tracingRoot,\n })\n } catch (err) {\n Log.error(`Failed to run onBuildComplete from ${adapterMod.name}`)\n throw err\n }\n }\n}\n"],"names":["path","fs","pathToFileURL","Log","isMiddlewareFilename","RenderingMode","interopDefault","recursiveReadDir","isDynamicRoute","normalizeAppPath","AdapterOutputType","normalizePagePath","convertRedirects","convertRewrites","convertHeaders","HTML_CONTENT_TYPE_HEADER","JSON_CONTENT_TYPE_HEADER","NEXT_RESUME_HEADER","normalizeLocalePath","addPathPrefix","getRedirectStatus","modifyRouteRegex","getNamedRouteRegex","escapeStringRegexp","sortSortableRoutes","nodeFileTrace","defaultOverrides","makeIgnoreFn","normalizePathnames","config","outputs","basePath","output","pages","pagesApi","appPages","appRoutes","prerenders","staticFiles","pathname","replace","handleBuildComplete","dir","buildId","configOutDir","distDir","pageKeys","tracingRoot","adapterPath","appPageKeys","staticPages","nextVersion","hasStatic404","hasStatic500","routesManifest","serverPropsPages","hasNodeMiddleware","prerenderManifest","middlewareManifest","requiredServerFiles","hasInstrumentationHook","functionsConfigManifest","adapterMod","require","resolve","href","onBuildComplete","exportFiles","file","endsWith","startsWith","push","id","filePath","join","type","STATIC_FILE","posix","sharedNodeAssets","pagesSharedNodeAssets","appPagesSharedNodeAssets","sharedTraceIgnores","sharedIgnoreFn","fileOutputPath","relative","moduleTypes","currentDependencies","modulePath","contextDir","dirname","item","readdir","match","fileList","esmFileList","base","ignore","forEach","add","rootRelativeFilePath","necessaryNodeDependencies","Object","values","filter","extname","assets","handleTraceFiles","assign","traceFilePath","traceData","JSON","parse","readFile","traceFileDir","relativeFile","files","tracedFilePath","handleEdgeFunction","page","isMiddleware","PAGES","isAppPrefix","name","isAppPage","isAppRoute","currentOutputs","MIDDLEWARE","APP_PAGE","APP_ROUTE","PAGES_API","route","runtime","sourcePage","find","wasmAssets","env","handleFile","originalPath","wasm","matchers","map","source","originalSource","sourceRegex","regexp","has","missing","key","value","preview","previewModeId","middleware","rscPathname","edgeFunctionHandlers","functions","pagesDistDir","pageOutputMap","rscFallbackPath","length","writeFile","hasOwnProperty","pageFile","i18n","locale","locales","localePage","localeOutput","staticOutput","pageTraceFile","catch","err","code","warn","functionConfig","maxDuration","preferredRegion","regions","dataPathname","middlewareFile","middlewareTrace","appOutputMap","appDistDir","normalizedPage","existingOutput","getParentOutput","srcRoute","childRoute","allowMissing","normalizedSrcRoute","parentOutput","console","error","appOutputs","keys","pageOutputs","Error","prefetchSegmentDirSuffix","prefetchSegmentSuffix","varyHeader","didPostponeHeader","contentTypeHeader","rscContentTypeHeader","rsc","handleAppMeta","initialOutput","meta","postponed","fallback","postponedState","segmentPaths","segmentsDir","segmentPath","outputSegmentPath","fallbackPathname","PRERENDER","parentOutputId","groupId","initialExpiration","initialRevalidate","initialHeaders","vary","prerenderGroupId","getAppRouteMeta","headers","keyLower","toLowerCase","filePathCache","Map","cachedFilePathCheck","get","newCheck","access","then","set","routes","initialExpireSeconds","initialRevalidateSeconds","initialStatus","prefetchDataRoute","dataRoute","renderingMode","allowHeader","experimentalBypassFor","srcRouteInfo","dynamicRoutes","Boolean","isNotFoundTrue","notFoundRoutes","includes","allowQuery","routeKeys","detectedLocale","currentFilePath","pprChain","experimental","ppr","undefined","parentFallbackMode","bypassFor","bypassToken","dataFilePath","PARTIALLY_STATIC","dynamicRoute","fallbackExpire","fallbackRevalidate","fallbackHeaders","fallbackStatus","currentOutput","staticErrorDocs","errorDoc","errorDocPath","defaultLocale","currentDocPath","dynamicDataRoutes","dynamicSegmentRoutes","getDestinationQuery","items","entries","fallbackFalseHasCondition","shouldLocalize","routeRegex","prefixRouteKeys","isFallbackFalse","hasFallbackRootParams","namedRegex","destination","cacheComponents","shouldSkipSuffixes","RegExp","segmentRoute","prefetchSegmentDataRoutes","needsMiddlewareResolveRoutes","dataRoutePages","Set","dataRoutes","sortedDataPages","includeSuffix","buildRewriteItem","converted","regex","src","internal","dest","info","rewrites","beforeFiles","afterFiles","redirects","Location","statusCode","status","priority","projectDir","repoRoot"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AACvB,OAAOC,QAAQ,cAAa;AAC5B,SAASC,aAAa,QAAQ,MAAK;AACnC,YAAYC,SAAS,gBAAe;AACpC,SAASC,oBAAoB,QAAQ,WAAU;AAC/C,SAASC,aAAa,QAAQ,oBAAmB;AACjD,SAASC,cAAc,QAAQ,4BAA2B;AAE1D,SAASC,gBAAgB,QAAQ,8BAA6B;AAC9D,SAASC,cAAc,Q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K,CAAC,CAAC,mCAAmC,EAAEjI,WAAW4D,IAAI,EAAE;YACjE,MAAMgD;QACR;IACF;AACF","ignoreList":[0]}
1
+ {"version":3,"sources":["../../../../src/build/adapter/build-complete.ts"],"sourcesContent":["import path from 'path'\nimport fs from 'fs/promises'\nimport { pathToFileURL } from 'url'\nimport * as Log from '../output/log'\nimport { isMiddlewareFilename } from '../utils'\nimport { RenderingMode } from '../rendering-mode'\nimport { interopDefault } from '../../lib/interop-default'\nimport type { RouteHas } from '../../lib/load-custom-routes'\nimport { recursiveReadDir } from '../../lib/recursive-readdir'\nimport { isDynamicRoute } from '../../shared/lib/router/utils'\nimport type { Revalidate } from '../../server/lib/cache-control'\nimport type { NextConfigComplete } from '../../server/config-shared'\nimport { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'\nimport { AdapterOutputType, type PHASE_TYPE } from '../../shared/lib/constants'\nimport { normalizePagePath } from '../../shared/lib/page-path/normalize-page-path'\nimport {\n convertRedirects,\n convertRewrites,\n convertHeaders,\n} from 'next/dist/compiled/@vercel/routing-utils'\n\nimport type {\n MiddlewareManifest,\n EdgeFunctionDefinition,\n} from '../webpack/plugins/middleware-plugin'\n\nimport type {\n RoutesManifest,\n PrerenderManifest,\n ManifestRewriteRoute,\n FunctionsConfigManifest,\n DynamicPrerenderManifestRoute,\n} from '..'\n\nimport {\n HTML_CONTENT_TYPE_HEADER,\n JSON_CONTENT_TYPE_HEADER,\n NEXT_RESUME_HEADER,\n} from '../../lib/constants'\nimport { normalizeLocalePath } from '../../shared/lib/i18n/normalize-locale-path'\nimport { addPathPrefix } from '../../shared/lib/router/utils/add-path-prefix'\nimport { getRedirectStatus, modifyRouteRegex } from '../../lib/redirect-status'\nimport { getNamedRouteRegex } from '../../shared/lib/router/utils/route-regex'\nimport { escapeStringRegexp } from '../../shared/lib/escape-regexp'\nimport { sortSortableRoutes } from '../../shared/lib/router/utils/sortable-routes'\nimport { nodeFileTrace } from 'next/dist/compiled/@vercel/nft'\nimport { defaultOverrides } from '../../server/require-hook'\nimport { makeIgnoreFn } from '../collect-build-traces'\n\ninterface SharedRouteFields {\n /**\n * id is the unique identifier of the output\n */\n id: string\n /**\n * filePath is the location on disk of the built entrypoint asset\n */\n filePath: string\n /**\n * pathname is the URL pathname the asset should be served at\n */\n pathname: string\n\n /**\n * sourcePage is the original source in the app or pages folder\n */\n sourcePage: string\n\n /**\n * runtime is which runtime the entrypoint is built for\n */\n runtime: 'nodejs' | 'edge'\n /**\n * assets are all necessary traced assets that could be\n * loaded by the output to handle a request e.g. traced\n * node_modules or necessary manifests for Next.js.\n * The key is the relative path from the repo root and the value\n * is the absolute path to the file\n */\n assets: Record<string, string>\n\n /**\n * wasmAssets are bundled wasm files with mapping of name\n * to filePath on disk\n */\n wasmAssets?: Record<string, string>\n\n /**\n * config related to the route\n */\n config: {\n /**\n * maxDuration is a segment config to signal the max\n * execution duration a route should be allowed before\n * it's timed out\n */\n maxDuration?: number\n /**\n * preferredRegion is a segment config to signal deployment\n * region preferences to the provider being used\n */\n preferredRegion?: string | string[]\n\n /**\n * env is the environment variables to expose, this is only\n * populated for edge runtime currently\n */\n env?: Record<string, string>\n }\n}\n\nexport interface AdapterOutput {\n /**\n * `PAGES` represents all the React pages that are under `pages/`.\n */\n PAGES: SharedRouteFields & {\n type: AdapterOutputType.PAGES\n }\n\n /**\n * `PAGES_API` represents all the API routes under `pages/api/`.\n */\n PAGES_API: SharedRouteFields & {\n type: AdapterOutputType.PAGES_API\n }\n /**\n * `APP_PAGE` represents all the React pages that are under `app/` with the\n * filename of `page.{j,t}s{,x}`.\n */\n APP_PAGE: SharedRouteFields & {\n type: AdapterOutputType.APP_PAGE\n }\n\n /**\n * `APP_ROUTE` represents all the API routes and metadata routes that are under `app/` with the\n * filename of `route.{j,t}s{,x}`.\n */\n APP_ROUTE: SharedRouteFields & {\n type: AdapterOutputType.APP_ROUTE\n }\n\n /**\n * `PRERENDER` represents an ISR enabled route that might\n * have a seeded cache entry or fallback generated during build\n */\n PRERENDER: {\n id: string\n pathname: string\n type: AdapterOutputType.PRERENDER\n\n /**\n * For prerenders the parent output is the originating\n * page that the prerender is created from\n */\n parentOutputId: string\n\n /**\n * groupId is the identifier for a group of prerenders that should be\n * revalidated together\n */\n groupId: number\n\n pprChain?: {\n headers: Record<string, string>\n }\n\n /**\n * parentFallbackMode signals whether additional routes can be generated\n * e.g. fallback: false or 'blocking' in getStaticPaths in pages router\n */\n parentFallbackMode?: DynamicPrerenderManifestRoute['fallback']\n\n /**\n * fallback is initial cache data generated during build for a prerender\n */\n fallback?: {\n /**\n * path to the fallback file can be HTML/JSON/RSC\n */\n filePath: string\n /**\n * initialStatus is the status code that should be applied\n * when serving the fallback\n */\n initialStatus?: number\n /**\n * initialHeaders are the headers that should be sent when\n * serving the fallback\n */\n initialHeaders?: Record<string, string | string[]>\n /**\n * initial expiration is how long until the fallback entry\n * is considered expired and no longer valid to serve\n */\n initialExpiration?: number\n /**\n * initial revalidate is how long until the fallback is\n * considered stale and should be revalidated\n */\n initialRevalidate?: Revalidate\n\n /**\n * postponedState is the PPR state when it postponed and is used for resuming\n */\n postponedState?: string\n }\n /**\n * config related to the route\n */\n config: {\n /**\n * allowQuery is the allowed query values to be passed\n * to an ISR function and what should be considered for the cacheKey\n * e.g. for /blog/[slug], \"slug\" is the only allowQuery\n */\n allowQuery?: string[]\n /**\n * allowHeader is the allowed headers to be passed to an\n * ISR function to prevent accidentally poisoning the cache\n * from leaking additional information that can impact the render\n */\n allowHeader?: string[]\n /**\n * bypass for is a list of has conditions the cache\n * should be bypassed and invoked directly e.g. action header\n */\n bypassFor?: RouteHas[]\n /**\n * renderingMode signals PPR or not for a prerender\n */\n renderingMode?: RenderingMode\n\n /**\n * bypassToken is the generated token that signals a prerender cache\n * should be bypassed\n */\n bypassToken?: string\n }\n }\n\n /**\n * `STATIC_FILE` represents a static file (ie /_next/static) or a purely\n * static HTML asset e.g. an automatically statically optimized page\n * that does not use ISR\n */\n STATIC_FILE: {\n id: string\n filePath: string\n pathname: string\n type: AdapterOutputType.STATIC_FILE\n }\n\n /**\n * `MIDDLEWARE` represents the middleware output if present\n */\n MIDDLEWARE: SharedRouteFields & {\n type: AdapterOutputType.MIDDLEWARE\n /**\n * config related to the route\n */\n config: SharedRouteFields['config'] & {\n /**\n * matchers are the configured matchers for middleware\n */\n matchers?: Array<{\n source: string\n sourceRegex: string\n has: RouteHas[] | undefined\n missing: RouteHas[] | undefined\n }>\n }\n }\n}\n\nexport interface AdapterOutputs {\n pages: Array<AdapterOutput['PAGES']>\n middleware?: AdapterOutput['MIDDLEWARE']\n appPages: Array<AdapterOutput['APP_PAGE']>\n pagesApi: Array<AdapterOutput['PAGES_API']>\n appRoutes: Array<AdapterOutput['APP_ROUTE']>\n prerenders: Array<AdapterOutput['PRERENDER']>\n staticFiles: Array<AdapterOutput['STATIC_FILE']>\n}\n\ntype RewriteItem = {\n source: string\n sourceRegex: string\n destination: string\n has: RouteHas[] | undefined\n missing: RouteHas[] | undefined\n}\n\ntype DynamicRouteItem = {\n source: string\n sourceRegex: string\n destination: string\n has: RouteHas[] | undefined\n missing: RouteHas[] | undefined\n}\n\nexport interface NextAdapter {\n name: string\n /**\n * modifyConfig is called for any CLI command that loads the next.config\n * to only apply for specific commands the \"phase\" should be used\n * @param config\n * @param ctx\n * @returns\n */\n modifyConfig?: (\n config: NextConfigComplete,\n ctx: {\n phase: PHASE_TYPE\n }\n ) => Promise<NextConfigComplete> | NextConfigComplete\n onBuildComplete?: (ctx: {\n routes: {\n headers: Array<{\n source: string\n sourceRegex: string\n headers: Record<string, string>\n has: RouteHas[] | undefined\n missing: RouteHas[] | undefined\n priority?: boolean\n }>\n redirects: Array<{\n source: string\n sourceRegex: string\n destination: string\n statusCode: number\n has: RouteHas[] | undefined\n missing: RouteHas[] | undefined\n priority?: boolean\n }>\n rewrites: {\n beforeFiles: RewriteItem[]\n afterFiles: RewriteItem[]\n fallback: RewriteItem[]\n }\n dynamicRoutes: Array<DynamicRouteItem>\n }\n outputs: AdapterOutputs\n /**\n * projectDir is the absolute directory the Next.js application is in\n */\n projectDir: string\n /**\n * repoRoot is the absolute path of the detected root of the repo\n */\n repoRoot: string\n /**\n * distDir is the absolute path to the dist directory\n */\n distDir: string\n /**\n * config is the loaded next.config (has modifyConfig applied)\n */\n config: NextConfigComplete\n /**\n * nextVersion is the current version of Next.js being used\n */\n nextVersion: string\n /**\n * buildId is the current unique ID for the build, this can be\n * influenced by NextConfig.generateBuildId\n */\n buildId: string\n }) => Promise<void> | void\n}\n\nfunction normalizePathnames(\n config: NextConfigComplete,\n outputs: AdapterOutputs\n) {\n // normalize pathname field with basePath\n if (config.basePath) {\n for (const output of [\n ...outputs.pages,\n ...outputs.pagesApi,\n ...outputs.appPages,\n ...outputs.appRoutes,\n ...outputs.prerenders,\n ...outputs.staticFiles,\n ]) {\n output.pathname =\n addPathPrefix(output.pathname, config.basePath).replace(/\\/$/, '') ||\n '/'\n }\n }\n}\n\nexport async function handleBuildComplete({\n dir,\n config,\n buildId,\n configOutDir,\n distDir,\n pageKeys,\n tracingRoot,\n adapterPath,\n appPageKeys,\n staticPages,\n nextVersion,\n hasStatic404,\n hasStatic500,\n routesManifest,\n serverPropsPages,\n hasNodeMiddleware,\n prerenderManifest,\n middlewareManifest,\n requiredServerFiles,\n hasInstrumentationHook,\n functionsConfigManifest,\n}: {\n dir: string\n distDir: string\n buildId: string\n configOutDir: string\n adapterPath: string\n tracingRoot: string\n nextVersion: string\n hasStatic404: boolean\n hasStatic500: boolean\n staticPages: Set<string>\n hasNodeMiddleware: boolean\n config: NextConfigComplete\n pageKeys: readonly string[]\n serverPropsPages: Set<string>\n requiredServerFiles: string[]\n routesManifest: RoutesManifest\n hasInstrumentationHook: boolean\n prerenderManifest: PrerenderManifest\n middlewareManifest: MiddlewareManifest\n appPageKeys?: readonly string[] | undefined\n functionsConfigManifest: FunctionsConfigManifest\n}) {\n const adapterMod = interopDefault(\n await import(pathToFileURL(require.resolve(adapterPath)).href)\n ) as NextAdapter\n\n if (typeof adapterMod.onBuildComplete === 'function') {\n const outputs: AdapterOutputs = {\n pages: [],\n pagesApi: [],\n appPages: [],\n appRoutes: [],\n prerenders: [],\n staticFiles: [],\n }\n\n if (config.output === 'export') {\n // collect export assets and provide as static files\n const exportFiles = await recursiveReadDir(configOutDir)\n\n for (const file of exportFiles) {\n let pathname = (\n file.endsWith('.html') ? file.replace(/\\.html$/, '') : file\n ).replace(/\\\\/g, '/')\n\n pathname = pathname.startsWith('/') ? pathname : `/${pathname}`\n\n outputs.staticFiles.push({\n id: file,\n pathname,\n filePath: path.join(configOutDir, file),\n type: AdapterOutputType.STATIC_FILE,\n } satisfies AdapterOutput['STATIC_FILE'])\n }\n } else {\n const staticFiles = await recursiveReadDir(path.join(distDir, 'static'))\n\n for (const file of staticFiles) {\n const pathname = path.posix.join('/_next/static', file)\n const filePath = path.join(distDir, 'static', file)\n outputs.staticFiles.push({\n type: AdapterOutputType.STATIC_FILE,\n id: path.join('static', file),\n pathname,\n filePath,\n })\n }\n\n const sharedNodeAssets: Record<string, string> = {}\n const pagesSharedNodeAssets: Record<string, string> = {}\n const appPagesSharedNodeAssets: Record<string, string> = {}\n\n const sharedTraceIgnores = [\n '**/next/dist/compiled/next-server/**/*.dev.js',\n '**/next/dist/compiled/webpack/*',\n '**/node_modules/webpack5/**/*',\n '**/next/dist/server/lib/route-resolver*',\n 'next/dist/compiled/semver/semver/**/*.js',\n '**/node_modules/react{,-dom,-dom-server-turbopack}/**/*.development.js',\n '**/*.d.ts',\n '**/*.map',\n '**/next/dist/pages/**/*',\n '**/node_modules/sharp/**/*',\n '**/@img/sharp-libvips*/**/*',\n '**/next/dist/compiled/edge-runtime/**/*',\n '**/next/dist/server/web/sandbox/**/*',\n '**/next/dist/server/post-process.js',\n ]\n const sharedIgnoreFn = makeIgnoreFn(tracingRoot, sharedTraceIgnores)\n\n for (const file of requiredServerFiles) {\n // add to shared node assets\n const filePath = path.join(dir, file)\n const fileOutputPath = path.relative(tracingRoot, filePath)\n sharedNodeAssets[fileOutputPath] = filePath\n }\n\n const moduleTypes = ['app-page', 'pages'] as const\n\n for (const type of moduleTypes) {\n const currentDependencies: string[] = []\n const modulePath = require.resolve(\n `next/dist/server/route-modules/${type}/module.compiled`\n )\n const contextDir = path.join(\n path.dirname(modulePath),\n 'vendored',\n 'contexts'\n )\n\n for (const item of await fs.readdir(contextDir)) {\n if (item.match(/\\.(mjs|cjs|js)$/)) {\n currentDependencies.push(path.join(contextDir, item))\n }\n }\n\n const { fileList, esmFileList } = await nodeFileTrace(\n currentDependencies,\n {\n base: tracingRoot,\n ignore: sharedIgnoreFn,\n }\n )\n esmFileList.forEach((item) => fileList.add(item))\n\n for (const rootRelativeFilePath of fileList) {\n if (type === 'pages') {\n pagesSharedNodeAssets[rootRelativeFilePath] = path.join(\n tracingRoot,\n rootRelativeFilePath\n )\n } else {\n appPagesSharedNodeAssets[rootRelativeFilePath] = path.join(\n tracingRoot,\n rootRelativeFilePath\n )\n }\n }\n }\n\n // These are modules that are necessary for bootstrapping node env\n const necessaryNodeDependencies = [\n require.resolve('next/dist/server/node-environment'),\n require.resolve('next/dist/server/require-hook'),\n require.resolve('next/dist/server/node-polyfill-crypto'),\n ...Object.values(defaultOverrides).filter((item) => path.extname(item)),\n ]\n\n const { fileList, esmFileList } = await nodeFileTrace(\n necessaryNodeDependencies,\n {\n base: tracingRoot,\n ignore: sharedIgnoreFn,\n }\n )\n esmFileList.forEach((item) => fileList.add(item))\n\n for (const rootRelativeFilePath of fileList) {\n sharedNodeAssets[rootRelativeFilePath] = path.join(\n tracingRoot,\n rootRelativeFilePath\n )\n }\n\n if (hasInstrumentationHook) {\n const assets = await handleTraceFiles(\n path.join(distDir, 'server', 'instrumentation.js.nft.json'),\n 'neutral'\n )\n const fileOutputPath = path.relative(\n tracingRoot,\n path.join(distDir, 'server', 'instrumentation.js')\n )\n sharedNodeAssets[fileOutputPath] = path.join(\n distDir,\n 'server',\n 'instrumentation.js'\n )\n Object.assign(sharedNodeAssets, assets)\n }\n\n async function handleTraceFiles(\n traceFilePath: string,\n type: 'pages' | 'app' | 'neutral'\n ): Promise<Record<string, string>> {\n const assets: Record<string, string> = Object.assign(\n {},\n sharedNodeAssets,\n type === 'pages' ? pagesSharedNodeAssets : {},\n type === 'app' ? appPagesSharedNodeAssets : {}\n )\n const traceData = JSON.parse(\n await fs.readFile(traceFilePath, 'utf8')\n ) as {\n files: string[]\n }\n const traceFileDir = path.dirname(traceFilePath)\n\n for (const relativeFile of traceData.files) {\n const tracedFilePath = path.join(traceFileDir, relativeFile)\n const fileOutputPath = path.relative(tracingRoot, tracedFilePath)\n assets[fileOutputPath] = tracedFilePath\n }\n return assets\n }\n\n async function handleEdgeFunction(\n page: EdgeFunctionDefinition,\n isMiddleware: boolean = false\n ) {\n let type: AdapterOutputType = AdapterOutputType.PAGES\n const isAppPrefix = page.name.startsWith('app/')\n const isAppPage = isAppPrefix && page.name.endsWith('/page')\n const isAppRoute = isAppPrefix && page.name.endsWith('/route')\n let currentOutputs: Array<\n | AdapterOutput['PAGES']\n | AdapterOutput['PAGES_API']\n | AdapterOutput['APP_PAGE']\n | AdapterOutput['APP_ROUTE']\n > = outputs.pages\n\n if (isMiddleware) {\n type = AdapterOutputType.MIDDLEWARE\n } else if (isAppPage) {\n currentOutputs = outputs.appPages\n type = AdapterOutputType.APP_PAGE\n } else if (isAppRoute) {\n currentOutputs = outputs.appRoutes\n type = AdapterOutputType.APP_ROUTE\n } else if (page.page.startsWith('/api')) {\n currentOutputs = outputs.pagesApi\n type = AdapterOutputType.PAGES_API\n }\n\n const route = page.page.replace(/^(app|pages)\\//, '')\n\n const output: Omit<AdapterOutput[typeof type], 'type'> & {\n type: any\n } = {\n type,\n id: page.name,\n runtime: 'edge',\n sourcePage: route,\n pathname: isAppPrefix ? normalizeAppPath(route) : route,\n filePath: path.join(\n distDir,\n page.files.find(\n (item) =>\n item.startsWith('server/app') || item.startsWith('server/pages')\n ) ||\n // TODO: turbopack build doesn't name the main entry chunk\n // identifiably so we don't know which to mark here but\n // technically edge needs all chunks to load always so\n // should this field even be provided?\n page.files[0] ||\n ''\n ),\n assets: {},\n wasmAssets: {},\n config: {\n env: page.env,\n },\n }\n\n function handleFile(file: string) {\n const originalPath = path.join(distDir, file)\n const fileOutputPath = path.join(\n path.relative(tracingRoot, distDir),\n file\n )\n if (!output.assets) {\n output.assets = {}\n }\n output.assets[fileOutputPath] = originalPath\n }\n for (const file of page.files) {\n handleFile(file)\n }\n for (const item of [...(page.assets || [])]) {\n handleFile(item.filePath)\n }\n for (const item of page.wasm || []) {\n if (!output.wasmAssets) {\n output.wasmAssets = {}\n }\n output.wasmAssets[item.name] = path.join(distDir, item.filePath)\n }\n\n if (type === AdapterOutputType.MIDDLEWARE) {\n ;(output as AdapterOutput['MIDDLEWARE']).config.matchers =\n page.matchers.map((item) => {\n return {\n source: item.originalSource,\n sourceRegex: item.regexp,\n has: item.has,\n missing: [\n ...(item.missing || []),\n // always skip middleware for on-demand revalidate\n {\n type: 'header',\n key: 'x-prerender-revalidate',\n value: prerenderManifest.preview.previewModeId,\n },\n ],\n }\n })\n output.pathname = '/_middleware'\n output.id = page.name\n outputs.middleware = output\n } else {\n currentOutputs.push(output)\n }\n\n // need to add matching .rsc output\n if (isAppPage) {\n const rscPathname = normalizePagePath(output.pathname) + '.rsc'\n outputs.appPages.push({\n ...output,\n pathname: rscPathname,\n id: page.name + '.rsc',\n })\n }\n }\n\n const edgeFunctionHandlers: Promise<any>[] = []\n\n for (const middleware of Object.values(middlewareManifest.middleware)) {\n if (isMiddlewareFilename(middleware.name)) {\n edgeFunctionHandlers.push(handleEdgeFunction(middleware, true))\n }\n }\n\n for (const page of Object.values(middlewareManifest.functions)) {\n edgeFunctionHandlers.push(handleEdgeFunction(page))\n }\n const pagesDistDir = path.join(distDir, 'server', 'pages')\n const pageOutputMap: Record<\n string,\n AdapterOutput['PAGES'] | AdapterOutput['PAGES_API']\n > = {}\n\n const rscFallbackPath = path.join(distDir, 'server', 'rsc-fallback.json')\n\n if (appPageKeys && appPageKeys.length > 0 && pageKeys.length > 0) {\n await fs.writeFile(rscFallbackPath, '{}')\n }\n\n for (const page of pageKeys) {\n if (page === '/_app' || page === '/_document') {\n continue\n }\n\n if (middlewareManifest.functions.hasOwnProperty(page)) {\n continue\n }\n\n const route = normalizePagePath(page)\n const pageFile = path.join(pagesDistDir, `${route}.js`)\n\n // if it's an auto static optimized page it's just\n // a static file\n if (staticPages.has(page)) {\n if (config.i18n) {\n for (const locale of config.i18n.locales || []) {\n const localePage =\n page === '/' ? `/${locale}` : addPathPrefix(page, `/${locale}`)\n\n const localeOutput = {\n id: localePage,\n pathname: localePage,\n type: AdapterOutputType.STATIC_FILE,\n filePath: path.join(\n pagesDistDir,\n `${normalizePagePath(localePage)}.html`\n ),\n } satisfies AdapterOutput['STATIC_FILE']\n\n outputs.staticFiles.push(localeOutput)\n\n if (appPageKeys && appPageKeys.length > 0) {\n outputs.staticFiles.push({\n id: `${localePage}.rsc`,\n pathname: `${localePage}.rsc`,\n type: AdapterOutputType.STATIC_FILE,\n filePath: rscFallbackPath,\n })\n }\n }\n } else {\n const staticOutput = {\n id: page,\n pathname: route,\n type: AdapterOutputType.STATIC_FILE,\n filePath: pageFile.replace(/\\.js$/, '.html'),\n } satisfies AdapterOutput['STATIC_FILE']\n\n outputs.staticFiles.push(staticOutput)\n\n if (appPageKeys && appPageKeys.length > 0) {\n outputs.staticFiles.push({\n id: `${page}.rsc`,\n pathname: `${route}.rsc`,\n type: AdapterOutputType.STATIC_FILE,\n filePath: rscFallbackPath,\n })\n }\n }\n // if was a static file output don't create page output as well\n continue\n }\n\n const pageTraceFile = `${pageFile}.nft.json`\n const assets = await handleTraceFiles(pageTraceFile, 'pages').catch(\n (err) => {\n if (err.code !== 'ENOENT' || (page !== '/404' && page !== '/500')) {\n Log.warn(`Failed to locate traced assets for ${pageFile}`, err)\n }\n return {} as Record<string, string>\n }\n )\n const functionConfig = functionsConfigManifest.functions[route] || {}\n let sourcePage = route.replace(/^\\//, '')\n\n sourcePage = sourcePage === 'api' ? 'api/index' : sourcePage\n\n const output: AdapterOutput['PAGES'] | AdapterOutput['PAGES_API'] = {\n id: route,\n type: page.startsWith('/api')\n ? AdapterOutputType.PAGES_API\n : AdapterOutputType.PAGES,\n filePath: pageTraceFile.replace(/\\.nft\\.json$/, ''),\n pathname: route,\n sourcePage,\n assets,\n runtime: 'nodejs',\n config: {\n maxDuration: functionConfig.maxDuration,\n preferredRegion: functionConfig.regions,\n },\n }\n pageOutputMap[page] = output\n\n if (output.type === AdapterOutputType.PAGES) {\n outputs.pages.push(output)\n\n // if page is get server side props we need to create\n // the _next/data output as well\n if (serverPropsPages.has(page)) {\n const dataPathname = path.posix.join(\n '/_next/data',\n buildId,\n normalizePagePath(page) + '.json'\n )\n outputs.pages.push({\n ...output,\n pathname: dataPathname,\n id: dataPathname,\n })\n }\n\n for (const locale of config.i18n?.locales || []) {\n const localePage =\n page === '/' ? `/${locale}` : addPathPrefix(page, `/${locale}`)\n\n outputs.pages.push({\n ...output,\n id: localePage,\n pathname: localePage,\n })\n\n if (serverPropsPages.has(page)) {\n const dataPathname = path.posix.join(\n '/_next/data',\n buildId,\n localePage + '.json'\n )\n outputs.pages.push({\n ...output,\n pathname: dataPathname,\n id: dataPathname,\n })\n }\n }\n } else {\n outputs.pagesApi.push(output)\n }\n\n if (appPageKeys && appPageKeys.length > 0) {\n outputs.staticFiles.push({\n id: `${output.id}.rsc`,\n pathname: `${output.pathname}.rsc`,\n type: AdapterOutputType.STATIC_FILE,\n filePath: rscFallbackPath,\n })\n }\n }\n\n if (hasNodeMiddleware) {\n const middlewareFile = path.join(distDir, 'server', 'middleware.js')\n const middlewareTrace = `${middlewareFile}.nft.json`\n const assets = await handleTraceFiles(middlewareTrace, 'neutral')\n const functionConfig =\n functionsConfigManifest.functions['/_middleware'] || {}\n\n outputs.middleware = {\n pathname: '/_middleware',\n id: '/_middleware',\n sourcePage: 'middleware',\n assets,\n type: AdapterOutputType.MIDDLEWARE,\n runtime: 'nodejs',\n filePath: middlewareFile,\n config: {\n matchers:\n functionConfig.matchers?.map((item) => {\n return {\n source: item.originalSource,\n sourceRegex: item.regexp,\n has: item.has,\n missing: [\n ...(item.missing || []),\n // always skip middleware for on-demand revalidate\n {\n type: 'header',\n key: 'x-prerender-revalidate',\n value: prerenderManifest.preview.previewModeId,\n },\n ],\n }\n }) || [],\n },\n } satisfies AdapterOutput['MIDDLEWARE']\n }\n const appOutputMap: Record<\n string,\n AdapterOutput['APP_PAGE'] | AdapterOutput['APP_ROUTE']\n > = {}\n const appDistDir = path.join(distDir, 'server', 'app')\n\n if (appPageKeys) {\n for (const page of appPageKeys) {\n if (middlewareManifest.functions.hasOwnProperty(page)) {\n continue\n }\n const normalizedPage = normalizeAppPath(page)\n const pageFile = path.join(appDistDir, `${page}.js`)\n const pageTraceFile = `${pageFile}.nft.json`\n const assets = await handleTraceFiles(pageTraceFile, 'app').catch(\n (err) => {\n Log.warn(`Failed to copy traced files for ${pageFile}`, err)\n return {} as Record<string, string>\n }\n )\n\n // If this is a parallel route we just need to merge\n // the assets as they share the same pathname\n const existingOutput = appOutputMap[normalizedPage]\n if (existingOutput) {\n Object.assign(existingOutput.assets, assets)\n existingOutput.assets[path.relative(tracingRoot, pageFile)] =\n pageFile\n\n continue\n }\n\n const functionConfig =\n functionsConfigManifest.functions[normalizedPage] || {}\n\n const output: AdapterOutput['APP_PAGE'] | AdapterOutput['APP_ROUTE'] =\n {\n pathname: normalizedPage,\n id: normalizedPage,\n sourcePage: page,\n assets,\n type: page.endsWith('/route')\n ? AdapterOutputType.APP_ROUTE\n : AdapterOutputType.APP_PAGE,\n runtime: 'nodejs',\n filePath: pageFile,\n config: {\n maxDuration: functionConfig.maxDuration,\n preferredRegion: functionConfig.regions,\n },\n }\n appOutputMap[normalizedPage] = output\n\n if (output.type === AdapterOutputType.APP_PAGE) {\n outputs.appPages.push({\n ...output,\n pathname: normalizePagePath(output.pathname) + '.rsc',\n id: normalizePagePath(output.pathname) + '.rsc',\n })\n outputs.appPages.push(output)\n } else {\n outputs.appRoutes.push(output)\n }\n }\n }\n\n const getParentOutput = (\n srcRoute: string,\n childRoute: string,\n allowMissing?: boolean\n ) => {\n const normalizedSrcRoute = normalizeLocalePath(\n srcRoute,\n config.i18n?.locales || []\n ).pathname\n const parentOutput =\n pageOutputMap[normalizedSrcRoute] || appOutputMap[normalizedSrcRoute]\n\n if (!parentOutput && !allowMissing) {\n console.error({\n appOutputs: Object.keys(appOutputMap),\n pageOutputs: Object.keys(pageOutputMap),\n })\n throw new Error(\n `Invariant: failed to find source route ${srcRoute} for prerender ${childRoute}`\n )\n }\n return parentOutput\n }\n\n const {\n prefetchSegmentDirSuffix,\n prefetchSegmentSuffix,\n varyHeader,\n didPostponeHeader,\n contentTypeHeader: rscContentTypeHeader,\n } = routesManifest.rsc\n\n const handleAppMeta = async (\n route: string,\n initialOutput: AdapterOutput['PRERENDER'],\n meta: {\n postponed?: string\n segmentPaths?: string[]\n }\n ) => {\n if (meta.postponed && initialOutput.fallback) {\n initialOutput.fallback.postponedState = meta.postponed\n }\n\n if (meta?.segmentPaths) {\n const normalizedRoute = normalizePagePath(route)\n const segmentsDir = path.join(\n appDistDir,\n `${normalizedRoute}${prefetchSegmentDirSuffix}`\n )\n\n for (const segmentPath of meta.segmentPaths) {\n const outputSegmentPath =\n path.join(\n normalizedRoute + prefetchSegmentDirSuffix,\n segmentPath\n ) + prefetchSegmentSuffix\n\n const fallbackPathname = path.join(\n segmentsDir,\n segmentPath + prefetchSegmentSuffix\n )\n\n outputs.prerenders.push({\n id: outputSegmentPath,\n pathname: outputSegmentPath,\n type: AdapterOutputType.PRERENDER,\n parentOutputId: initialOutput.parentOutputId,\n groupId: initialOutput.groupId,\n\n config: {\n ...initialOutput.config,\n },\n\n fallback: {\n filePath: fallbackPathname,\n initialExpiration: initialOutput.fallback?.initialExpiration,\n initialRevalidate: initialOutput.fallback?.initialRevalidate,\n\n initialHeaders: {\n ...initialOutput.fallback?.initialHeaders,\n vary: varyHeader,\n 'content-type': rscContentTypeHeader,\n [didPostponeHeader]: '2',\n },\n },\n } satisfies AdapterOutput['PRERENDER'])\n }\n }\n }\n\n let prerenderGroupId = 1\n\n type AppRouteMeta = {\n segmentPaths?: string[]\n postponed?: string\n headers?: Record<string, string>\n status?: number\n }\n\n const getAppRouteMeta = async (\n route: string,\n isAppPage: boolean\n ): Promise<AppRouteMeta> => {\n const basename = route.endsWith('/') ? `${route}index` : route\n const meta: AppRouteMeta = isAppPage\n ? JSON.parse(\n await fs\n .readFile(path.join(appDistDir, `${basename}.meta`), 'utf8')\n .catch(() => '{}')\n )\n : {}\n\n if (meta.headers) {\n // normalize these for consistency\n for (const key of Object.keys(meta.headers)) {\n const keyLower = key.toLowerCase()\n if (keyLower !== key) {\n const value = meta.headers[key]\n delete meta.headers[key]\n meta.headers[keyLower] = value\n }\n }\n }\n\n return meta\n }\n\n const filePathCache = new Map<string, Promise<boolean>>()\n const cachedFilePathCheck = async (filePath: string) => {\n if (filePathCache.has(filePath)) {\n return filePathCache.get(filePath)\n }\n const newCheck = fs\n .access(filePath)\n .then(() => true)\n .catch(() => false)\n filePathCache.set(filePath, newCheck)\n\n return newCheck\n }\n\n for (const route in prerenderManifest.routes) {\n const {\n initialExpireSeconds: initialExpiration,\n initialRevalidateSeconds: initialRevalidate,\n initialHeaders,\n initialStatus,\n prefetchDataRoute,\n dataRoute,\n renderingMode,\n allowHeader,\n experimentalBypassFor,\n } = prerenderManifest.routes[route]\n\n const srcRoute = prerenderManifest.routes[route].srcRoute || route\n const srcRouteInfo = prerenderManifest.dynamicRoutes[srcRoute]\n\n const isAppPage =\n Boolean(appOutputMap[srcRoute]) || srcRoute === '/_not-found'\n\n const isNotFoundTrue = prerenderManifest.notFoundRoutes.includes(route)\n\n let allowQuery: string[] | undefined\n const routeKeys = routesManifest.dynamicRoutes.find(\n (item) => item.page === srcRoute\n )?.routeKeys\n\n if (!isDynamicRoute(srcRoute)) {\n // for non-dynamic routes we use an empty array since\n // no query values bust the cache for non-dynamic prerenders\n // prerendered paths also do not pass allowQuery as they match\n // during handle: 'filesystem' so should not cache differently\n // by query values\n allowQuery = []\n } else if (routeKeys) {\n // if we have routeKeys in the routes-manifest we use those\n // for allowQuery for dynamic routes\n allowQuery = Object.values(routeKeys)\n }\n\n let filePath = path.join(\n isAppPage ? appDistDir : pagesDistDir,\n `${normalizePagePath(route)}.${isAppPage && !dataRoute ? 'body' : 'html'}`\n )\n\n // we use the static 404 for notFound: true if available\n // if not we do a blocking invoke on first request\n if (isNotFoundTrue && hasStatic404) {\n const locale =\n config.i18n &&\n normalizeLocalePath(route, config.i18n?.locales).detectedLocale\n\n for (const currentFilePath of [\n path.join(pagesDistDir, locale || '', '404.html'),\n path.join(pagesDistDir, '404.html'),\n ]) {\n if (await cachedFilePathCheck(currentFilePath)) {\n filePath = currentFilePath\n break\n }\n }\n }\n\n const meta = await getAppRouteMeta(route, isAppPage)\n\n const initialOutput: AdapterOutput['PRERENDER'] = {\n id: route,\n type: AdapterOutputType.PRERENDER,\n pathname: route,\n parentOutputId:\n srcRoute === '/_not-found'\n ? srcRoute\n : getParentOutput(srcRoute, route).id,\n groupId: prerenderGroupId,\n\n pprChain:\n isAppPage && config.experimental.ppr\n ? {\n headers: {\n [NEXT_RESUME_HEADER]: '1',\n },\n }\n : undefined,\n\n parentFallbackMode: srcRouteInfo?.fallback,\n\n fallback:\n !isNotFoundTrue || (isNotFoundTrue && hasStatic404)\n ? {\n filePath,\n initialStatus:\n (initialStatus ?? isNotFoundTrue) ? 404 : undefined,\n initialHeaders: {\n ...initialHeaders,\n vary: varyHeader,\n 'content-type': HTML_CONTENT_TYPE_HEADER,\n ...meta.headers,\n },\n initialExpiration,\n initialRevalidate:\n typeof initialRevalidate === 'undefined'\n ? 1\n : initialRevalidate,\n }\n : undefined,\n config: {\n allowQuery,\n allowHeader,\n renderingMode,\n bypassFor: experimentalBypassFor,\n bypassToken: prerenderManifest.preview.previewModeId,\n },\n }\n outputs.prerenders.push(initialOutput)\n\n if (dataRoute) {\n let dataFilePath = path.join(\n pagesDistDir,\n `${normalizePagePath(route)}.json`\n )\n\n if (isAppPage) {\n // When experimental PPR is enabled, we expect that the data\n // that should be served as a part of the prerender should\n // be from the prefetch data route. If this isn't enabled\n // for ppr, the only way to get the data is from the data\n // route.\n dataFilePath = path.join(\n appDistDir,\n prefetchDataRoute &&\n renderingMode === RenderingMode.PARTIALLY_STATIC\n ? prefetchDataRoute\n : dataRoute\n )\n }\n\n outputs.prerenders.push({\n ...initialOutput,\n id: dataRoute,\n pathname: dataRoute,\n fallback: isNotFoundTrue\n ? undefined\n : {\n ...initialOutput.fallback,\n initialHeaders: {\n ...initialOutput.fallback?.initialHeaders,\n 'content-type': isAppPage\n ? rscContentTypeHeader\n : JSON_CONTENT_TYPE_HEADER,\n },\n filePath: dataFilePath,\n },\n })\n }\n\n if (isAppPage) {\n await handleAppMeta(route, initialOutput, meta)\n }\n prerenderGroupId += 1\n }\n\n for (const dynamicRoute in prerenderManifest.dynamicRoutes) {\n const {\n fallback,\n fallbackExpire,\n fallbackRevalidate,\n fallbackHeaders,\n fallbackStatus,\n allowHeader,\n dataRoute,\n renderingMode,\n experimentalBypassFor,\n } = prerenderManifest.dynamicRoutes[dynamicRoute]\n\n const isAppPage = Boolean(appOutputMap[dynamicRoute])\n\n const allowQuery = Object.values(\n routesManifest.dynamicRoutes.find(\n (item) => item.page === dynamicRoute\n )?.routeKeys || {}\n )\n const meta = await getAppRouteMeta(dynamicRoute, isAppPage)\n\n const initialOutput: AdapterOutput['PRERENDER'] = {\n id: dynamicRoute,\n type: AdapterOutputType.PRERENDER,\n pathname: dynamicRoute,\n parentOutputId: getParentOutput(dynamicRoute, dynamicRoute).id,\n groupId: prerenderGroupId,\n config: {\n allowQuery,\n allowHeader,\n renderingMode,\n bypassFor: experimentalBypassFor,\n bypassToken: prerenderManifest.preview.previewModeId,\n },\n fallback:\n typeof fallback === 'string'\n ? {\n filePath: path.join(\n isAppPage ? appDistDir : pagesDistDir,\n // app router dynamic route fallbacks don't have the\n // extension so ensure it's added here\n fallback.endsWith('.html') ? fallback : `${fallback}.html`\n ),\n initialStatus: fallbackStatus,\n initialHeaders: {\n ...fallbackHeaders,\n 'content-type': HTML_CONTENT_TYPE_HEADER,\n },\n initialExpiration: fallbackExpire,\n initialRevalidate: fallbackRevalidate || 1,\n }\n : undefined,\n }\n\n if (!config.i18n || isAppPage) {\n outputs.prerenders.push(initialOutput)\n\n if (isAppPage) {\n await handleAppMeta(dynamicRoute, initialOutput, meta)\n }\n\n if (dataRoute) {\n outputs.prerenders.push({\n ...initialOutput,\n id: dataRoute,\n pathname: dataRoute,\n fallback: undefined,\n })\n }\n prerenderGroupId += 1\n } else {\n for (const locale of config.i18n.locales) {\n const currentOutput = {\n ...initialOutput,\n pathname: path.posix.join(`/${locale}`, initialOutput.pathname),\n id: path.posix.join(`/${locale}`, initialOutput.id),\n fallback:\n typeof fallback === 'string'\n ? {\n ...initialOutput.fallback,\n filePath: path.join(\n pagesDistDir,\n locale,\n // app router dynamic route fallbacks don't have the\n // extension so ensure it's added here\n fallback.endsWith('.html')\n ? fallback\n : `${fallback}.html`\n ),\n }\n : undefined,\n groupId: prerenderGroupId,\n }\n outputs.prerenders.push(currentOutput)\n\n if (dataRoute) {\n const dataPathname = path.posix.join(\n `/_next/data`,\n buildId,\n locale,\n dynamicRoute + '.json'\n )\n outputs.prerenders.push({\n ...initialOutput,\n id: dataPathname,\n pathname: dataPathname,\n // data route doesn't have skeleton fallback\n fallback: undefined,\n groupId: prerenderGroupId,\n })\n }\n prerenderGroupId += 1\n }\n }\n }\n\n // ensure 404\n const staticErrorDocs = [\n ...(hasStatic404 ? ['/404'] : []),\n ...(hasStatic500 ? ['/500'] : []),\n ]\n\n for (const errorDoc of staticErrorDocs) {\n const errorDocPath = path.posix.join(\n '/',\n config.i18n?.defaultLocale || '',\n errorDoc\n )\n\n if (!prerenderManifest.routes[errorDocPath]) {\n for (const currentDocPath of [\n errorDocPath,\n ...(config.i18n?.locales?.map((locale) =>\n path.posix.join('/', locale, errorDoc)\n ) || []),\n ]) {\n const currentFilePath = path.join(\n pagesDistDir,\n `${currentDocPath}.html`\n )\n if (await cachedFilePathCheck(currentFilePath)) {\n outputs.staticFiles.push({\n pathname: currentDocPath,\n id: currentDocPath,\n type: AdapterOutputType.STATIC_FILE,\n filePath: currentFilePath,\n })\n }\n }\n }\n }\n }\n\n normalizePathnames(config, outputs)\n\n const dynamicRoutes: DynamicRouteItem[] = []\n const dynamicDataRoutes: DynamicRouteItem[] = []\n const dynamicSegmentRoutes: DynamicRouteItem[] = []\n\n const getDestinationQuery = (routeKeys: Record<string, string>) => {\n const items = Object.entries(routeKeys ?? {})\n if (items.length === 0) return ''\n\n return '?' + items.map(([key, value]) => `${value}=$${key}`).join('&')\n }\n\n const fallbackFalseHasCondition: RouteHas[] = [\n {\n type: 'cookie',\n key: '__prerender_bypass',\n value: prerenderManifest.preview.previewModeId,\n },\n {\n type: 'cookie',\n key: '__next_preview_data',\n },\n ]\n\n for (const route of routesManifest.dynamicRoutes) {\n const shouldLocalize = config.i18n\n\n const routeRegex = getNamedRouteRegex(route.page, {\n prefixRouteKeys: true,\n })\n\n const isFallbackFalse =\n prerenderManifest.dynamicRoutes[route.page]?.fallback === false\n\n const { hasFallbackRootParams } = route\n\n const sourceRegex = routeRegex.namedRegex.replace(\n '^',\n `^${config.basePath && config.basePath !== '/' ? path.posix.join('/', config.basePath || '') : ''}[/]?${shouldLocalize ? '(?<nextLocale>[^/]{1,})?' : ''}`\n )\n const destination =\n path.posix.join(\n '/',\n config.basePath,\n shouldLocalize ? '/$nextLocale' : '',\n route.page\n ) + getDestinationQuery(route.routeKeys)\n\n if (appPageKeys && appPageKeys.length > 0 && config.cacheComponents) {\n // If we have fallback root params (implying we've already\n // emitted a rewrite for the /_tree request), or if the route\n // has PPR enabled and client param parsing is enabled, then\n // we don't need to include any other suffixes.\n const shouldSkipSuffixes = hasFallbackRootParams\n\n dynamicRoutes.push({\n source: route.page + '.rsc',\n sourceRegex: sourceRegex.replace(\n new RegExp(escapeStringRegexp('(?:/)?$')),\n // Now than the upstream issues has been resolved, we can safely\n // add the suffix back, this resolves a bug related to segment\n // rewrites not capturing the correct suffix values when\n // enabled.\n shouldSkipSuffixes\n ? '(?<rscSuffix>\\\\.rsc|\\\\.segments/.+\\\\.segment\\\\.rsc)(?:/)?$'\n : '(?<rscSuffix>\\\\.rsc|\\\\.prefetch\\\\.rsc|\\\\.segments/.+\\\\.segment\\\\.rsc)(?:/)?$'\n ),\n destination: destination?.replace(/($|\\?)/, '$rscSuffix$1'),\n has: isFallbackFalse ? fallbackFalseHasCondition : undefined,\n missing: undefined,\n })\n }\n\n // needs basePath and locale handling if pages router\n dynamicRoutes.push({\n source: route.page,\n sourceRegex,\n destination,\n has: isFallbackFalse ? fallbackFalseHasCondition : undefined,\n missing: undefined,\n })\n\n for (const segmentRoute of route.prefetchSegmentDataRoutes || []) {\n dynamicSegmentRoutes.push({\n source: route.page,\n sourceRegex: segmentRoute.source.replace(\n '^',\n `^${config.basePath && config.basePath !== '/' ? path.posix.join('/', config.basePath || '') : ''}[/]?`\n ),\n destination: path.posix.join(\n '/',\n config.basePath,\n segmentRoute.destination +\n getDestinationQuery(segmentRoute.routeKeys)\n ),\n has: undefined,\n missing: undefined,\n })\n }\n }\n\n const needsMiddlewareResolveRoutes =\n outputs.middleware && outputs.pages.length > 0\n\n const dataRoutePages = new Set([\n ...routesManifest.dataRoutes.map((item) => item.page),\n ])\n const sortedDataPages = sortSortableRoutes([\n ...(needsMiddlewareResolveRoutes\n ? [...staticPages].map((page) => ({ sourcePage: page, page }))\n : []),\n ...routesManifest.dataRoutes.map((item) => ({\n sourcePage: item.page,\n page: item.page,\n })),\n ])\n\n for (const { page } of sortedDataPages) {\n if (needsMiddlewareResolveRoutes || isDynamicRoute(page)) {\n const shouldLocalize = config.i18n\n const isFallbackFalse =\n prerenderManifest.dynamicRoutes[page]?.fallback === false\n\n const routeRegex = getNamedRouteRegex(page + '.json', {\n prefixRouteKeys: true,\n includeSuffix: true,\n })\n const isDataRoute = dataRoutePages.has(page)\n\n const destination = path.posix.join(\n '/',\n config.basePath,\n ...(isDataRoute ? [`_next/data`, buildId] : ''),\n ...(page === '/'\n ? [shouldLocalize ? '$nextLocale.json' : 'index.json']\n : [\n shouldLocalize ? '$nextLocale' : '',\n page +\n (isDataRoute ? '.json' : '') +\n getDestinationQuery(routeRegex.routeKeys || {}),\n ])\n )\n\n dynamicDataRoutes.push({\n source: page,\n sourceRegex:\n shouldLocalize && page === '/'\n ? '^' +\n path.posix.join(\n '/',\n config.basePath,\n '_next/data',\n escapeStringRegexp(buildId),\n '(?<nextLocale>[^/]{1,}).json'\n )\n : routeRegex.namedRegex.replace(\n '^',\n `^${path.posix.join(\n '/',\n config.basePath,\n `_next/data`,\n escapeStringRegexp(buildId)\n )}[/]?${shouldLocalize ? '(?<nextLocale>[^/]{1,})?' : ''}`\n ),\n destination,\n has: isFallbackFalse ? fallbackFalseHasCondition : undefined,\n missing: undefined,\n })\n }\n }\n\n const buildRewriteItem = (route: ManifestRewriteRoute): RewriteItem => {\n const converted = convertRewrites([route], ['nextInternalLocale'])[0]\n const regex = converted.src || route.regex\n\n return {\n source: route.source,\n sourceRegex: route.internal ? regex : modifyRouteRegex(regex),\n destination: converted.dest || route.destination,\n has: route.has,\n missing: route.missing,\n }\n }\n\n try {\n Log.info(`Running onBuildComplete from ${adapterMod.name}`)\n await adapterMod.onBuildComplete({\n routes: {\n dynamicRoutes: [\n ...dynamicDataRoutes,\n ...dynamicSegmentRoutes,\n ...dynamicRoutes,\n ],\n rewrites: {\n beforeFiles:\n routesManifest.rewrites.beforeFiles.map(buildRewriteItem),\n afterFiles:\n routesManifest.rewrites.afterFiles.map(buildRewriteItem),\n fallback: routesManifest.rewrites.fallback.map(buildRewriteItem),\n },\n redirects: routesManifest.redirects.map((route) => {\n const converted = convertRedirects([route], 307)[0]\n let dest = 'headers' in converted && converted.headers?.Location\n const regex = converted.src || route.regex\n\n return {\n source: route.source,\n sourceRegex: route.internal ? regex : modifyRouteRegex(regex),\n destination: dest || route.destination,\n statusCode: converted.status || getRedirectStatus(route),\n has: route.has,\n missing: route.missing,\n priority: route.internal || undefined,\n }\n }),\n headers: routesManifest.headers.map((route) => {\n const converted = convertHeaders([route])[0]\n const regex = converted.src || route.regex\n\n return {\n source: route.source,\n sourceRegex: route.internal ? regex : modifyRouteRegex(regex),\n headers: 'headers' in converted ? converted.headers || {} : {},\n has: route.has,\n missing: route.missing,\n priority: route.internal || undefined,\n }\n }),\n },\n outputs,\n\n config,\n distDir,\n buildId,\n nextVersion,\n projectDir: dir,\n repoRoot: tracingRoot,\n })\n } catch (err) {\n Log.error(`Failed to run onBuildComplete from ${adapterMod.name}`)\n throw err\n }\n }\n}\n"],"names":["path","fs","pathToFileURL","Log","isMiddlewareFilename","RenderingMode","interopDefault","recursiveReadDir","isDynamicRoute","normalizeAppPath","AdapterOutputType","normalizePagePath","convertRedirects","convertRewrites","convertHeaders","HTML_CONTENT_TYPE_HEADER","JSON_CONTENT_TYPE_HEADER","NEXT_RESUME_HEADER","normalizeLocalePath","addPathPrefix","getRedirectStatus","modifyRouteRegex","getNamedRouteRegex","escapeStringRegexp","sortSortableRoutes","nodeFileTrace","defaultOverrides","makeIgnoreFn","normalizePathnames","config","outputs","basePath","output","pages","pagesApi","appPages","appRoutes","prerenders","staticFiles","pathname","replace","handleBuildComplete","dir","buildId","configOutDir","distDir","pageKeys","tracingRoot","adapterPath","appPageKeys","staticPages","nextVersion","hasStatic404","hasStatic500","routesManifest","serverPropsPages","hasNodeMiddleware","prerenderManifest","middlewareManifest","requiredServerFiles","hasInstrumentationHook","functionsConfigManifest","adapterMod","require","resolve","href","onBuildComplete","exportFiles","file","endsWith","startsWith","push","id","filePath","join","type","STATIC_FILE","posix","sharedNodeAssets","pagesSharedNodeAssets","appPagesSharedNodeAssets","sharedTraceIgnores","sharedIgnoreFn","fileOutputPath","relative","moduleTypes","currentDependencies","modulePath","contextDir","dirname","item","readdir","match","fileList","esmFileList","base","ignore","forEach","add","rootRelativeFilePath","necessaryNodeDependencies","Object","values","filter","extname","assets","handleTraceFiles","assign","traceFilePath","traceData","JSON","parse","readFile","traceFileDir","relativeFile","files","tracedFilePath","handleEdgeFunction","page","isMiddleware","PAGES","isAppPrefix","name","isAppPage","isAppRoute","currentOutputs","MIDDLEWARE","APP_PAGE","APP_ROUTE","PAGES_API","route","runtime","sourcePage","find","wasmAssets","env","handleFile","originalPath","wasm","matchers","map","source","originalSource","sourceRegex","regexp","has","missing","key","value","preview","previewModeId","middleware","rscPathname","edgeFunctionHandlers","functions","pagesDistDir","pageOutputMap","rscFallbackPath","length","writeFile","hasOwnProperty","pageFile","i18n","locale","locales","localePage","localeOutput","staticOutput","pageTraceFile","catch","err","code","warn","functionConfig","maxDuration","preferredRegion","regions","dataPathname","middlewareFile","middlewareTrace","appOutputMap","appDistDir","normalizedPage","existingOutput","getParentOutput","srcRoute","childRoute","allowMissing","normalizedSrcRoute","parentOutput","console","error","appOutputs","keys","pageOutputs","Error","prefetchSegmentDirSuffix","prefetchSegmentSuffix","varyHeader","didPostponeHeader","contentTypeHeader","rscContentTypeHeader","rsc","handleAppMeta","initialOutput","meta","postponed","fallback","postponedState","segmentPaths","normalizedRoute","segmentsDir","segmentPath","outputSegmentPath","fallbackPathname","PRERENDER","parentOutputId","groupId","initialExpiration","initialRevalidate","initialHeaders","vary","prerenderGroupId","getAppRouteMeta","basename","headers","keyLower","toLowerCase","filePathCache","Map","cachedFilePathCheck","get","newCheck","access","then","set","routes","initialExpireSeconds","initialRevalidateSeconds","initialStatus","prefetchDataRoute","dataRoute","renderingMode","allowHeader","experimentalBypassFor","srcRouteInfo","dynamicRoutes","Boolean","isNotFoundTrue","notFoundRoutes","includes","allowQuery","routeKeys","detectedLocale","currentFilePath","pprChain","experimental","ppr","undefined","parentFallbackMode","bypassFor","bypassToken","dataFilePath","PARTIALLY_STATIC","dynamicRoute","fallbackExpire","fallbackRevalidate","fallbackHeaders","fallbackStatus","currentOutput","staticErrorDocs","errorDoc","errorDocPath","defaultLocale","currentDocPath","dynamicDataRoutes","dynamicSegmentRoutes","getDestinationQuery","items","entries","fallbackFalseHasCondition","shouldLocalize","routeRegex","prefixRouteKeys","isFallbackFalse","hasFallbackRootParams","namedRegex","destination","cacheComponents","shouldSkipSuffixes","RegExp","segmentRoute","prefetchSegmentDataRoutes","needsMiddlewareResolveRoutes","dataRoutePages","Set","dataRoutes","sortedDataPages","includeSuffix","isDataRoute","buildRewriteItem","converted","regex","src","internal","dest","info","rewrites","beforeFiles","afterFiles","redirects","Location","statusCode","status","priority","projectDir","repoRoot"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AACvB,OAAOC,QAAQ,cAAa;AAC5B,SAASC,aAAa,QAAQ,MAAK;AACnC,YAAYC,SAAS,gBAAe;AACpC,SAASC,oBAAoB,QAAQ,WAAU;AAC/C,SAASC,aAAa,QAAQ,oBAAmB;AACjD,SAASC,cAAc,QAAQ,4BAA2B;AAE1D,SAASC,gBAAgB,QAAQ,8BAA6B;AAC9D,SAASC,cAAc,QAAQ,gCAA+B;AAG9D,SAASC,gBAAgB,QAAQ,0CAAyC;AAC1E,SAASC,iBAAiB,QAAyB,6BAA4B;AAC/E,SAASC,iBAAiB,QAAQ,iDAAgD;AAClF,SACEC,gBAAgB,EAChBC,eAAe,EACfC,cAAc,QACT,2CAA0C;AAejD,SACEC,wBAAwB,EACxBC,wBAAwB,EACxBC,kBAAkB,QACb,sBAAqB;AAC5B,SAASC,mBAAmB,QAAQ,8CAA6C;AACjF,SAASC,aAAa,QAAQ,gDAA+C;AAC7E,SAASC,iBAAiB,EAAEC,gBAAgB,QAAQ,4BAA2B;AAC/E,SAASC,kBAAkB,QAAQ,4CAA2C;AAC9E,SAASC,kBAAkB,QAAQ,iCAAgC;AACnE,SAASC,kBAAkB,QAAQ,gDAA+C;AAClF,SAASC,aAAa,QA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YAAYX,UAAUY,MAAM,IAAIrS,kBAAkB8G;4BAClDe,KAAKf,MAAMe,GAAG;4BACdC,SAAShB,MAAMgB,OAAO;4BACtBwK,UAAUxL,MAAM8K,QAAQ,IAAI9C;wBAC9B;oBACF;oBACAjC,SAAS3K,eAAe2K,OAAO,CAACrF,GAAG,CAAC,CAACV;wBACnC,MAAM2K,YAAY/R,eAAe;4BAACoH;yBAAM,CAAC,CAAC,EAAE;wBAC5C,MAAM4K,QAAQD,UAAUE,GAAG,IAAI7K,MAAM4K,KAAK;wBAE1C,OAAO;4BACLjK,QAAQX,MAAMW,MAAM;4BACpBE,aAAab,MAAM8K,QAAQ,GAAGF,QAAQzR,iBAAiByR;4BACvD7E,SAAS,aAAa4E,YAAYA,UAAU5E,OAAO,IAAI,CAAC,IAAI,CAAC;4BAC7DhF,KAAKf,MAAMe,GAAG;4BACdC,SAAShB,MAAMgB,OAAO;4BACtBwK,UAAUxL,MAAM8K,QAAQ,IAAI9C;wBAC9B;oBACF;gBACF;gBACApO;gBAEAD;gBACAgB;gBACAF;gBACAQ;gBACAwQ,YAAYjR;gBACZkR,UAAU7Q;YACZ;QACF,EAAE,OAAO2H,KAAK;YACZvK,IAAI4L,KAAK,CAAC,CAAC,mCAAmC,EAAEjI,WAAW4D,IAAI,EAAE;YACjE,MAAMgD;QACR;IACF;AACF","ignoreList":[0]}
@@ -309,7 +309,7 @@ export default async function build(dir, experimentalAnalyze = false, reactProdu
309
309
  try {
310
310
  const nextBuildSpan = trace('next-build', undefined, {
311
311
  buildMode: experimentalBuildMode,
312
- version: "16.0.2-canary.14"
312
+ version: "16.0.2-canary.15"
313
313
  });
314
314
  NextBuildContext.nextBuildSpan = nextBuildSpan;
315
315
  NextBuildContext.dir = dir;
@@ -847,7 +847,7 @@ export default async function build(dir, experimentalAnalyze = false, reactProdu
847
847
  // Files outside of the distDir can be "type": "module"
848
848
  await writeFileUtf8(path.join(distDir, 'package.json'), '{"type": "commonjs"}');
849
849
  // These are written to distDir, so they need to come after creating and cleaning distDr.
850
- await recordFrameworkVersion("16.0.2-canary.14");
850
+ await recordFrameworkVersion("16.0.2-canary.15");
851
851
  await updateBuildDiagnostics({
852
852
  buildStage: 'start'
853
853
  });
@@ -2526,7 +2526,7 @@ export default async function build(dir, experimentalAnalyze = false, reactProdu
2526
2526
  configOutDir: path.join(dir, configOutDir),
2527
2527
  staticPages,
2528
2528
  serverPropsPages,
2529
- nextVersion: "16.0.2-canary.14",
2529
+ nextVersion: "16.0.2-canary.15",
2530
2530
  tracingRoot: outputFileTracingRoot,
2531
2531
  hasNodeMiddleware,
2532
2532
  hasInstrumentationHook,
@@ -10,7 +10,7 @@ import { downloadNativeNextSwc, downloadWasmSwc } from '../../lib/download-swc';
10
10
  import { isDeepStrictEqual } from 'util';
11
11
  import { getDefineEnv } from '../define-env';
12
12
  import { throwTurbopackInternalError } from '../../shared/lib/turbopack/internal-error';
13
- const nextVersion = "16.0.2-canary.14";
13
+ const nextVersion = "16.0.2-canary.15";
14
14
  const ArchName = arch();
15
15
  const PlatformName = platform();
16
16
  function infoLog(...args) {
@@ -1620,7 +1620,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
1620
1620
  isClient && new CopyFilePlugin({
1621
1621
  // file path to build output of `@next/polyfill-nomodule`
1622
1622
  filePath: require.resolve('./polyfills/polyfill-nomodule'),
1623
- cacheKey: "16.0.2-canary.14",
1623
+ cacheKey: "16.0.2-canary.15",
1624
1624
  name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
1625
1625
  minimize: false,
1626
1626
  info: {
@@ -1806,7 +1806,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
1806
1806
  // - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
1807
1807
  // - Next.js version
1808
1808
  // - next.config.js keys that affect compilation
1809
- version: `${__dirname}|${"16.0.2-canary.14"}|${configVars}`,
1809
+ version: `${__dirname}|${"16.0.2-canary.15"}|${configVars}`,
1810
1810
  cacheDirectory: path.join(distDir, 'cache', 'webpack'),
1811
1811
  // For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
1812
1812
  // So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
@@ -5,7 +5,7 @@
5
5
  * - next/script with `beforeInteractive` strategy
6
6
  */ import { getAssetPrefix } from './asset-prefix';
7
7
  import { setAttributesFromProps } from './set-attributes-from-props';
8
- const version = "16.0.2-canary.14";
8
+ const version = "16.0.2-canary.15";
9
9
  window.next = {
10
10
  version,
11
11
  appDir: true