next 15.4.0-canary.58 → 15.4.0-canary.59
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.
- package/dist/bin/next +1 -1
- package/dist/build/collect-build-traces.js +6 -2
- package/dist/build/collect-build-traces.js.map +1 -1
- package/dist/build/index.js +7 -8
- package/dist/build/index.js.map +1 -1
- package/dist/build/preview-key-utils.d.ts +5 -0
- package/dist/build/preview-key-utils.js +91 -0
- package/dist/build/preview-key-utils.js.map +1 -0
- package/dist/build/swc/generated-native.d.ts +0 -1
- package/dist/build/swc/index.js +1 -1
- package/dist/build/swc/types.d.ts +0 -1
- package/dist/build/webpack-config.js +2 -2
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/index.js +1 -1
- package/dist/compiled/next-server/app-page-experimental.runtime.dev.js +2 -2
- package/dist/compiled/next-server/app-page-experimental.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js.map +1 -1
- package/dist/compiled/next-server/pages-turbo.runtime.prod.js +2 -2
- package/dist/compiled/next-server/pages-turbo.runtime.prod.js.map +1 -1
- package/dist/esm/build/collect-build-traces.js +6 -2
- package/dist/esm/build/collect-build-traces.js.map +1 -1
- package/dist/esm/build/index.js +7 -8
- package/dist/esm/build/index.js.map +1 -1
- package/dist/esm/build/preview-key-utils.js +81 -0
- package/dist/esm/build/preview-key-utils.js.map +1 -0
- package/dist/esm/build/swc/generated-native.d.ts +0 -1
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/swc/types.js.map +1 -1
- package/dist/esm/build/webpack-config.js +2 -2
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/esm/shared/lib/canary-only.js +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/shared/lib/canary-only.js +1 -1
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/package.json +15 -15
package/dist/bin/next
CHANGED
@@ -79,7 +79,7 @@ const program = new NextRootCommand();
|
|
79
79
|
program.name('next').description('The Next.js CLI allows you to develop, build, start your application, and more.').configureHelp({
|
80
80
|
formatHelp: (cmd, helper)=>(0, _formatclihelpoutput.formatCliHelpOutput)(cmd, helper),
|
81
81
|
subcommandTerm: (cmd)=>`${cmd.name()} ${cmd.usage()}`
|
82
|
-
}).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.4.0-canary.
|
82
|
+
}).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.4.0-canary.59"}`, '-v, --version', 'Outputs the Next.js version.');
|
83
83
|
program.command('build').description('Creates an optimized production build of your application. The output displays information about each route.').argument('[directory]', `A directory on which to build the application. ${(0, _picocolors.italic)('If no directory is provided, the current directory will be used.')}`).option('-d, --debug', 'Enables a more verbose build output.').option('--no-lint', 'Disables linting.').option('--no-mangling', 'Disables mangling.').option('--profile', 'Enables production profiling for React.').option('--experimental-app-only', 'Builds only App Router routes.').option('--turbo', 'Starts development mode using Turbopack.').option('--turbopack', 'Starts development mode using Turbopack.').addOption(new _commander.Option('--experimental-build-mode [mode]', 'Uses an experimental build mode.').choices([
|
84
84
|
'compile',
|
85
85
|
'generate',
|
@@ -394,14 +394,18 @@ async function collectBuildTraces({ dir, config, distDir, edgeRuntimeRoutes, sta
|
|
394
394
|
addToTracedFiles(root, relativeModulePath, serverTracedFiles);
|
395
395
|
addToTracedFiles(root, relativeModulePath, minimalServerTracedFiles);
|
396
396
|
}
|
397
|
+
const serverTracedFilesSorted = Array.from(serverTracedFiles);
|
398
|
+
serverTracedFilesSorted.sort();
|
399
|
+
const minimalServerTracedFilesSorted = Array.from(minimalServerTracedFiles);
|
400
|
+
minimalServerTracedFilesSorted.sort();
|
397
401
|
await Promise.all([
|
398
402
|
_promises.default.writeFile(nextServerTraceOutput, JSON.stringify({
|
399
403
|
version: 1,
|
400
|
-
files:
|
404
|
+
files: serverTracedFilesSorted
|
401
405
|
})),
|
402
406
|
_promises.default.writeFile(nextMinimalTraceOutput, JSON.stringify({
|
403
407
|
version: 1,
|
404
|
-
files:
|
408
|
+
files: minimalServerTracedFilesSorted
|
405
409
|
}))
|
406
410
|
]);
|
407
411
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/build/collect-build-traces.ts"],"sourcesContent":["import { Span } from '../trace'\nimport type { NextConfigComplete } from '../server/config-shared'\n\nimport {\n TRACE_IGNORES,\n type BuildTraceContext,\n getFilesMapFromReasons,\n} from './webpack/plugins/next-trace-entrypoints-plugin'\n\nimport path from 'path'\nimport fs from 'fs/promises'\nimport { nonNullable } from '../lib/non-nullable'\nimport * as ciEnvironment from '../server/ci-info'\nimport debugOriginal from 'next/dist/compiled/debug'\nimport picomatch from 'next/dist/compiled/picomatch'\nimport { defaultOverrides } from '../server/require-hook'\nimport { nodeFileTrace } from 'next/dist/compiled/@vercel/nft'\nimport { normalizePagePath } from '../shared/lib/page-path/normalize-page-path'\nimport { normalizeAppPath } from '../shared/lib/router/utils/app-paths'\nimport isError from '../lib/is-error'\nimport type { NodeFileTraceReasons } from '@vercel/nft'\nimport type { RoutesUsingEdgeRuntime } from './utils'\n\nconst debug = debugOriginal('next:build:build-traces')\n\nfunction shouldIgnore(\n file: string,\n serverIgnoreFn: (file: string) => boolean,\n reasons: NodeFileTraceReasons,\n cachedIgnoreFiles: Map<string, boolean>,\n children: Set<string> = new Set()\n) {\n if (cachedIgnoreFiles.has(file)) {\n return cachedIgnoreFiles.get(file)\n }\n\n if (serverIgnoreFn(file)) {\n cachedIgnoreFiles.set(file, true)\n return true\n }\n children.add(file)\n\n const reason = reasons.get(file)\n if (!reason || reason.parents.size === 0 || reason.type.includes('initial')) {\n cachedIgnoreFiles.set(file, false)\n return false\n }\n\n // if all parents are ignored the child file\n // should be ignored as well\n let allParentsIgnored = true\n\n for (const parent of reason.parents.values()) {\n if (!children.has(parent)) {\n children.add(parent)\n if (\n !shouldIgnore(\n parent,\n serverIgnoreFn,\n reasons,\n cachedIgnoreFiles,\n children\n )\n ) {\n allParentsIgnored = false\n break\n }\n }\n }\n\n cachedIgnoreFiles.set(file, allParentsIgnored)\n return allParentsIgnored\n}\n\nexport async function collectBuildTraces({\n dir,\n config,\n distDir,\n edgeRuntimeRoutes,\n staticPages,\n nextBuildSpan = new Span({ name: 'build' }),\n hasSsrAmpPages,\n buildTraceContext,\n outputFileTracingRoot,\n isTurbopack,\n}: {\n dir: string\n distDir: string\n staticPages: string[]\n hasSsrAmpPages: boolean\n outputFileTracingRoot: string\n // pageInfos is serialized when this function runs in a worker.\n edgeRuntimeRoutes: RoutesUsingEdgeRuntime\n nextBuildSpan?: Span\n config: NextConfigComplete\n buildTraceContext?: BuildTraceContext\n isTurbopack: boolean\n}) {\n const startTime = Date.now()\n debug('starting build traces')\n\n const { outputFileTracingIncludes = {}, outputFileTracingExcludes = {} } =\n config\n const excludeGlobKeys = Object.keys(outputFileTracingExcludes)\n const includeGlobKeys = Object.keys(outputFileTracingIncludes)\n\n await nextBuildSpan\n .traceChild('node-file-trace-build', {\n isTurbotrace: 'false', // TODO(arlyon): remove this\n })\n .traceAsyncFn(async () => {\n const nextServerTraceOutput = path.join(\n distDir,\n 'next-server.js.nft.json'\n )\n const nextMinimalTraceOutput = path.join(\n distDir,\n 'next-minimal-server.js.nft.json'\n )\n const root = outputFileTracingRoot\n\n // Under standalone mode, we need to trace the extra IPC server and\n // worker files.\n const isStandalone = config.output === 'standalone'\n const sharedEntriesSet = Object.keys(defaultOverrides).map((value) =>\n require.resolve(value, {\n paths: [require.resolve('next/dist/server/require-hook')],\n })\n )\n\n const { cacheHandler } = config\n const { cacheHandlers } = config.experimental\n\n // ensure we trace any dependencies needed for custom\n // incremental cache handler\n if (cacheHandler) {\n sharedEntriesSet.push(\n require.resolve(\n path.isAbsolute(cacheHandler)\n ? cacheHandler\n : path.join(dir, cacheHandler)\n )\n )\n }\n\n if (cacheHandlers) {\n for (const handlerPath of Object.values(cacheHandlers)) {\n if (handlerPath) {\n sharedEntriesSet.push(\n require.resolve(\n path.isAbsolute(handlerPath)\n ? handlerPath\n : path.join(dir, handlerPath)\n )\n )\n }\n }\n }\n\n const serverEntries = [\n ...sharedEntriesSet,\n ...(isStandalone\n ? [\n require.resolve('next/dist/server/lib/start-server'),\n require.resolve('next/dist/server/next'),\n require.resolve('next/dist/server/require-hook'),\n ]\n : []),\n require.resolve('next/dist/server/next-server'),\n ].filter(Boolean) as string[]\n\n const minimalServerEntries = [\n ...sharedEntriesSet,\n require.resolve('next/dist/compiled/next-server/server.runtime.prod'),\n ].filter(Boolean)\n\n const additionalIgnores = new Set<string>()\n\n for (const glob of excludeGlobKeys) {\n if (picomatch(glob)('next-server')) {\n outputFileTracingExcludes[glob].forEach((exclude) => {\n additionalIgnores.add(exclude)\n })\n }\n }\n\n const makeIgnoreFn = (ignores: string[]) => {\n // pre compile the ignore globs\n const isMatch = picomatch(ignores, {\n contains: true,\n dot: true,\n })\n\n return (pathname: string) => {\n if (path.isAbsolute(pathname) && !pathname.startsWith(root)) {\n return true\n }\n\n return isMatch(pathname)\n }\n }\n\n const sharedIgnores = [\n '**/next/dist/compiled/next-server/**/*.dev.js',\n ...(isStandalone ? [] : ['**/next/dist/compiled/jest-worker/**/*']),\n '**/next/dist/compiled/webpack/*',\n '**/node_modules/webpack5/**/*',\n '**/next/dist/server/lib/route-resolver*',\n 'next/dist/compiled/semver/semver/**/*.js',\n\n ...(ciEnvironment.hasNextSupport\n ? [\n // only ignore image-optimizer code when\n // this is being handled outside of next-server\n '**/next/dist/server/image-optimizer.js',\n ]\n : []),\n\n ...(!hasSsrAmpPages\n ? ['**/next/dist/compiled/@ampproject/toolbox-optimizer/**/*']\n : []),\n\n ...(isStandalone ? [] : TRACE_IGNORES),\n ...additionalIgnores,\n ]\n\n const sharedIgnoresFn = makeIgnoreFn(sharedIgnores)\n\n const serverIgnores = [\n ...sharedIgnores,\n '**/node_modules/react{,-dom,-dom-server-turbopack}/**/*.development.js',\n '**/*.d.ts',\n '**/*.map',\n '**/next/dist/pages/**/*',\n ...(ciEnvironment.hasNextSupport\n ? ['**/node_modules/sharp/**/*', '**/@img/sharp-libvips*/**/*']\n : []),\n ].filter(nonNullable)\n const serverIgnoreFn = makeIgnoreFn(serverIgnores)\n\n const minimalServerIgnores = [\n ...serverIgnores,\n '**/next/dist/compiled/edge-runtime/**/*',\n '**/next/dist/server/web/sandbox/**/*',\n '**/next/dist/server/post-process.js',\n ]\n const minimalServerIgnoreFn = makeIgnoreFn(minimalServerIgnores)\n\n const routesIgnores = [\n ...sharedIgnores,\n // server chunks are provided via next-trace-entrypoints-plugin plugin\n // as otherwise all chunks are traced here and included for all pages\n // whether they are needed or not\n '**/.next/server/chunks/**',\n '**/next/dist/server/optimize-amp.js',\n '**/next/dist/server/post-process.js',\n ].filter(nonNullable)\n\n const routeIgnoreFn = makeIgnoreFn(routesIgnores)\n\n const serverTracedFiles = new Set<string>()\n const minimalServerTracedFiles = new Set<string>()\n\n function addToTracedFiles(base: string, file: string, dest: Set<string>) {\n dest.add(\n path.relative(distDir, path.join(base, file)).replace(/\\\\/g, '/')\n )\n }\n\n if (isStandalone) {\n addToTracedFiles(\n '',\n require.resolve('next/dist/compiled/jest-worker/processChild'),\n serverTracedFiles\n )\n addToTracedFiles(\n '',\n require.resolve('next/dist/compiled/jest-worker/threadChild'),\n serverTracedFiles\n )\n }\n\n if (isTurbopack) {\n addToTracedFiles(distDir, './package.json', serverTracedFiles)\n addToTracedFiles(distDir, './package.json', minimalServerTracedFiles)\n }\n\n {\n const chunksToTrace: string[] = [\n ...(buildTraceContext?.chunksTrace?.action.input || []),\n ...serverEntries,\n ...minimalServerEntries,\n ]\n const result = await nodeFileTrace(chunksToTrace, {\n base: outputFileTracingRoot,\n processCwd: dir,\n mixedModules: true,\n async readFile(p) {\n try {\n return await fs.readFile(p, 'utf8')\n } catch (e) {\n if (isError(e) && (e.code === 'ENOENT' || e.code === 'EISDIR')) {\n // since tracing runs in parallel with static generation server\n // files might be removed from that step so tolerate ENOENT\n // errors gracefully\n return ''\n }\n throw e\n }\n },\n async readlink(p) {\n try {\n return await fs.readlink(p)\n } catch (e) {\n if (\n isError(e) &&\n (e.code === 'EINVAL' ||\n e.code === 'ENOENT' ||\n e.code === 'UNKNOWN')\n ) {\n return null\n }\n throw e\n }\n },\n async stat(p) {\n try {\n return await fs.stat(p)\n } catch (e) {\n if (isError(e) && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) {\n return null\n }\n throw e\n }\n },\n // handle shared ignores at top-level as it\n // avoids over-tracing when we don't need to\n // and speeds up total trace time\n ignore(p) {\n if (sharedIgnoresFn(p)) {\n return true\n }\n\n // if a chunk is attempting to be traced that isn't\n // in our initial list we need to ignore it to prevent\n // over tracing as webpack needs to be the source of\n // truth for which chunks should be included for each entry\n if (\n p.includes('.next/server/chunks') &&\n !chunksToTrace.includes(path.join(outputFileTracingRoot, p))\n ) {\n return true\n }\n return false\n },\n })\n const reasons = result.reasons\n const fileList = result.fileList\n for (const file of result.esmFileList) {\n fileList.add(file)\n }\n\n const parentFilesMap = getFilesMapFromReasons(fileList, reasons)\n const cachedLookupIgnore = new Map<string, boolean>()\n const cachedLookupIgnoreMinimal = new Map<string, boolean>()\n\n for (const [entries, tracedFiles] of [\n [serverEntries, serverTracedFiles],\n [minimalServerEntries, minimalServerTracedFiles],\n ] as Array<[string[], Set<string>]>) {\n for (const file of entries) {\n const curFiles = [\n ...(parentFilesMap\n .get(path.relative(outputFileTracingRoot, file))\n ?.keys() || []),\n ]\n tracedFiles.add(path.relative(distDir, file).replace(/\\\\/g, '/'))\n\n for (const curFile of curFiles || []) {\n const filePath = path.join(outputFileTracingRoot, curFile)\n\n if (\n !shouldIgnore(\n curFile,\n tracedFiles === minimalServerTracedFiles\n ? minimalServerIgnoreFn\n : serverIgnoreFn,\n reasons,\n tracedFiles === minimalServerTracedFiles\n ? cachedLookupIgnoreMinimal\n : cachedLookupIgnore\n )\n ) {\n tracedFiles.add(\n path.relative(distDir, filePath).replace(/\\\\/g, '/')\n )\n }\n }\n }\n }\n\n const { entryNameFilesMap } = buildTraceContext?.chunksTrace || {}\n\n const cachedLookupIgnoreRoutes = new Map<string, boolean>()\n\n await Promise.all(\n [\n ...(entryNameFilesMap\n ? Object.entries(entryNameFilesMap)\n : new Map()),\n ].map(async ([entryName, entryNameFiles]) => {\n const isApp = entryName.startsWith('app/')\n const isPages = entryName.startsWith('pages/')\n let route = entryName\n if (isApp) {\n route = normalizeAppPath(route.substring('app'.length))\n }\n if (isPages) {\n route = normalizePagePath(route.substring('pages'.length))\n }\n\n // we don't need to trace for automatically statically optimized\n // pages as they don't have server bundles, note there is\n // the caveat with flying shuttle mode as it needs this for\n // detecting changed entries\n if (staticPages.includes(route)) {\n return\n }\n const entryOutputPath = path.join(\n distDir,\n 'server',\n `${entryName}.js`\n )\n const traceOutputPath = `${entryOutputPath}.nft.json`\n const existingTrace = JSON.parse(\n await fs.readFile(traceOutputPath, 'utf8')\n ) as {\n version: number\n files: string[]\n fileHashes: Record<string, string>\n }\n const traceOutputDir = path.dirname(traceOutputPath)\n const curTracedFiles = new Set<string>()\n\n for (const file of [...entryNameFiles, entryOutputPath]) {\n const curFiles = [\n ...(parentFilesMap\n .get(path.relative(outputFileTracingRoot, file))\n ?.keys() || []),\n ]\n for (const curFile of curFiles || []) {\n if (\n !shouldIgnore(\n curFile,\n routeIgnoreFn,\n reasons,\n cachedLookupIgnoreRoutes\n )\n ) {\n const filePath = path.join(outputFileTracingRoot, curFile)\n const outputFile = path\n .relative(traceOutputDir, filePath)\n .replace(/\\\\/g, '/')\n curTracedFiles.add(outputFile)\n }\n }\n }\n\n for (const file of existingTrace.files || []) {\n curTracedFiles.add(file)\n }\n\n await fs.writeFile(\n traceOutputPath,\n JSON.stringify({\n ...existingTrace,\n files: [...curTracedFiles].sort(),\n })\n )\n })\n )\n }\n\n const moduleTypes = ['app-page', 'pages']\n\n for (const type of moduleTypes) {\n const modulePath = require.resolve(\n `next/dist/server/route-modules/${type}/module.compiled`\n )\n const relativeModulePath = path.relative(root, modulePath)\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 const itemPath = path.relative(root, path.join(contextDir, item))\n if (!serverIgnoreFn(itemPath)) {\n addToTracedFiles(root, itemPath, serverTracedFiles)\n addToTracedFiles(root, itemPath, minimalServerTracedFiles)\n }\n }\n addToTracedFiles(root, relativeModulePath, serverTracedFiles)\n addToTracedFiles(root, relativeModulePath, minimalServerTracedFiles)\n }\n\n await Promise.all([\n fs.writeFile(\n nextServerTraceOutput,\n JSON.stringify({\n version: 1,\n files: Array.from(serverTracedFiles),\n } as {\n version: number\n files: string[]\n })\n ),\n fs.writeFile(\n nextMinimalTraceOutput,\n JSON.stringify({\n version: 1,\n files: Array.from(minimalServerTracedFiles),\n } as {\n version: number\n files: string[]\n })\n ),\n ])\n })\n\n // apply outputFileTracingIncludes/outputFileTracingExcludes after runTurbotrace\n const includeExcludeSpan = nextBuildSpan.traceChild('apply-include-excludes')\n await includeExcludeSpan.traceAsyncFn(async () => {\n const globOrig =\n require('next/dist/compiled/glob') as typeof import('next/dist/compiled/glob')\n const glob = (pattern: string): Promise<string[]> => {\n return new Promise((resolve, reject) => {\n globOrig(\n pattern,\n { cwd: dir, nodir: true, dot: true },\n (err, files) => {\n if (err) {\n return reject(err)\n }\n resolve(files)\n }\n )\n })\n }\n\n const { entryNameFilesMap } = buildTraceContext?.chunksTrace || {}\n\n await Promise.all(\n [\n ...(entryNameFilesMap ? Object.entries(entryNameFilesMap) : new Map()),\n ].map(async ([entryName]) => {\n const isApp = entryName.startsWith('app/')\n const isPages = entryName.startsWith('pages/')\n let route = entryName\n if (isApp) {\n route = normalizeAppPath(entryName)\n }\n if (isPages) {\n route = normalizePagePath(entryName)\n }\n\n if (staticPages.includes(route)) {\n return\n }\n\n // edge routes have no trace files\n if (edgeRuntimeRoutes.hasOwnProperty(route)) {\n return\n }\n\n const combinedIncludes = new Set<string>()\n const combinedExcludes = new Set<string>()\n for (const curGlob of includeGlobKeys) {\n const isMatch = picomatch(curGlob, { dot: true, contains: true })\n if (isMatch(route)) {\n for (const include of outputFileTracingIncludes[curGlob]) {\n combinedIncludes.add(include.replace(/\\\\/g, '/'))\n }\n }\n }\n\n for (const curGlob of excludeGlobKeys) {\n const isMatch = picomatch(curGlob, { dot: true, contains: true })\n if (isMatch(route)) {\n for (const exclude of outputFileTracingExcludes[curGlob]) {\n combinedExcludes.add(exclude)\n }\n }\n }\n\n if (!combinedIncludes?.size && !combinedExcludes?.size) {\n return\n }\n\n const traceFile = path.join(\n distDir,\n `server`,\n `${entryName}.js.nft.json`\n )\n const pageDir = path.dirname(traceFile)\n const traceContent = JSON.parse(await fs.readFile(traceFile, 'utf8'))\n const includes: string[] = []\n const resolvedTraceIncludes = new Map<string, string[]>()\n\n if (combinedIncludes?.size) {\n await Promise.all(\n [...combinedIncludes].map(async (includeGlob) => {\n const results = await glob(includeGlob)\n const resolvedInclude = resolvedTraceIncludes.get(\n includeGlob\n ) || [\n ...results.map((file) => {\n return path.relative(pageDir, path.join(dir, file))\n }),\n ]\n includes.push(...resolvedInclude)\n resolvedTraceIncludes.set(includeGlob, resolvedInclude)\n })\n )\n }\n const combined = new Set([...traceContent.files, ...includes])\n\n if (combinedExcludes?.size) {\n const resolvedGlobs = [...combinedExcludes].map((exclude) =>\n path.join(dir, exclude)\n )\n\n // pre compile before forEach\n const isMatch = picomatch(resolvedGlobs, {\n dot: true,\n contains: true,\n })\n\n combined.forEach((file) => {\n if (isMatch(path.join(pageDir, file))) {\n combined.delete(file)\n }\n })\n }\n\n // overwrite trace file with custom includes/excludes\n await fs.writeFile(\n traceFile,\n JSON.stringify({\n version: traceContent.version,\n files: [...combined],\n })\n )\n })\n )\n })\n\n debug(`finished build tracing ${Date.now() - startTime}ms`)\n}\n"],"names":["collectBuildTraces","debug","debugOriginal","shouldIgnore","file","serverIgnoreFn","reasons","cachedIgnoreFiles","children","Set","has","get","set","add","reason","parents","size","type","includes","allParentsIgnored","parent","values","dir","config","distDir","edgeRuntimeRoutes","staticPages","nextBuildSpan","Span","name","hasSsrAmpPages","buildTraceContext","outputFileTracingRoot","isTurbopack","startTime","Date","now","outputFileTracingIncludes","outputFileTracingExcludes","excludeGlobKeys","Object","keys","includeGlobKeys","traceChild","isTurbotrace","traceAsyncFn","nextServerTraceOutput","path","join","nextMinimalTraceOutput","root","isStandalone","output","sharedEntriesSet","defaultOverrides","map","value","require","resolve","paths","cacheHandler","cacheHandlers","experimental","push","isAbsolute","handlerPath","serverEntries","filter","Boolean","minimalServerEntries","additionalIgnores","glob","picomatch","forEach","exclude","makeIgnoreFn","ignores","isMatch","contains","dot","pathname","startsWith","sharedIgnores","ciEnvironment","hasNextSupport","TRACE_IGNORES","sharedIgnoresFn","serverIgnores","nonNullable","minimalServerIgnores","minimalServerIgnoreFn","routesIgnores","routeIgnoreFn","serverTracedFiles","minimalServerTracedFiles","addToTracedFiles","base","dest","relative","replace","chunksToTrace","chunksTrace","action","input","result","nodeFileTrace","processCwd","mixedModules","readFile","p","fs","e","isError","code","readlink","stat","ignore","fileList","esmFileList","parentFilesMap","getFilesMapFromReasons","cachedLookupIgnore","Map","cachedLookupIgnoreMinimal","entries","tracedFiles","curFiles","curFile","filePath","entryNameFilesMap","cachedLookupIgnoreRoutes","Promise","all","entryName","entryNameFiles","isApp","isPages","route","normalizeAppPath","substring","length","normalizePagePath","entryOutputPath","traceOutputPath","existingTrace","JSON","parse","traceOutputDir","dirname","curTracedFiles","outputFile","files","writeFile","stringify","sort","moduleTypes","modulePath","relativeModulePath","contextDir","item","readdir","itemPath","version","Array","from","includeExcludeSpan","globOrig","pattern","reject","cwd","nodir","err","hasOwnProperty","combinedIncludes","combinedExcludes","curGlob","include","traceFile","pageDir","traceContent","resolvedTraceIncludes","includeGlob","results","resolvedInclude","combined","resolvedGlobs","delete"],"mappings":";;;;+BA0EsBA;;;eAAAA;;;uBA1ED;4CAOd;6DAEU;iEACF;6BACa;gEACG;8DACL;kEACJ;6BACW;qBACH;mCACI;0BACD;gEACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIpB,MAAMC,QAAQC,IAAAA,cAAa,EAAC;AAE5B,SAASC,aACPC,IAAY,EACZC,cAAyC,EACzCC,OAA6B,EAC7BC,iBAAuC,EACvCC,WAAwB,IAAIC,KAAK;IAEjC,IAAIF,kBAAkBG,GAAG,CAACN,OAAO;QAC/B,OAAOG,kBAAkBI,GAAG,CAACP;IAC/B;IAEA,IAAIC,eAAeD,OAAO;QACxBG,kBAAkBK,GAAG,CAACR,MAAM;QAC5B,OAAO;IACT;IACAI,SAASK,GAAG,CAACT;IAEb,MAAMU,SAASR,QAAQK,GAAG,CAACP;IAC3B,IAAI,CAACU,UAAUA,OAAOC,OAAO,CAACC,IAAI,KAAK,KAAKF,OAAOG,IAAI,CAACC,QAAQ,CAAC,YAAY;QAC3EX,kBAAkBK,GAAG,CAACR,MAAM;QAC5B,OAAO;IACT;IAEA,4CAA4C;IAC5C,4BAA4B;IAC5B,IAAIe,oBAAoB;IAExB,KAAK,MAAMC,UAAUN,OAAOC,OAAO,CAACM,MAAM,GAAI;QAC5C,IAAI,CAACb,SAASE,GAAG,CAACU,SAAS;YACzBZ,SAASK,GAAG,CAACO;YACb,IACE,CAACjB,aACCiB,QACAf,gBACAC,SACAC,mBACAC,WAEF;gBACAW,oBAAoB;gBACpB;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AK;mBAAKrI;aAAS;YAE7D,IAAI4J,oCAAAA,iBAAkB9J,IAAI,EAAE;gBAC1B,MAAMyK,gBAAgB;uBAAIX;iBAAiB,CAACvH,GAAG,CAAC,CAACmB,UAC/C3B,aAAI,CAACC,IAAI,CAAC1B,KAAKoD;gBAGjB,6BAA6B;gBAC7B,MAAMG,UAAUL,IAAAA,kBAAS,EAACiH,eAAe;oBACvC1G,KAAK;oBACLD,UAAU;gBACZ;gBAEA0G,SAAS/G,OAAO,CAAC,CAACrE;oBAChB,IAAIyE,QAAQ9B,aAAI,CAACC,IAAI,CAACkI,SAAS9K,QAAQ;wBACrCoL,SAASE,MAAM,CAACtL;oBAClB;gBACF;YACF;YAEA,qDAAqD;YACrD,MAAM0G,iBAAE,CAAC0C,SAAS,CAChByB,WACAhC,KAAKQ,SAAS,CAAC;gBACbS,SAASiB,aAAajB,OAAO;gBAC7BX,OAAO;uBAAIiC;iBAAS;YACtB;QAEJ;IAEJ;IAEAvL,MAAM,CAAC,uBAAuB,EAAEkC,KAAKC,GAAG,KAAKF,UAAU,EAAE,CAAC;AAC5D","ignoreList":[0]}
|
1
|
+
{"version":3,"sources":["../../src/build/collect-build-traces.ts"],"sourcesContent":["import { Span } from '../trace'\nimport type { NextConfigComplete } from '../server/config-shared'\n\nimport {\n TRACE_IGNORES,\n type BuildTraceContext,\n getFilesMapFromReasons,\n} from './webpack/plugins/next-trace-entrypoints-plugin'\n\nimport path from 'path'\nimport fs from 'fs/promises'\nimport { nonNullable } from '../lib/non-nullable'\nimport * as ciEnvironment from '../server/ci-info'\nimport debugOriginal from 'next/dist/compiled/debug'\nimport picomatch from 'next/dist/compiled/picomatch'\nimport { defaultOverrides } from '../server/require-hook'\nimport { nodeFileTrace } from 'next/dist/compiled/@vercel/nft'\nimport { normalizePagePath } from '../shared/lib/page-path/normalize-page-path'\nimport { normalizeAppPath } from '../shared/lib/router/utils/app-paths'\nimport isError from '../lib/is-error'\nimport type { NodeFileTraceReasons } from '@vercel/nft'\nimport type { RoutesUsingEdgeRuntime } from './utils'\n\nconst debug = debugOriginal('next:build:build-traces')\n\nfunction shouldIgnore(\n file: string,\n serverIgnoreFn: (file: string) => boolean,\n reasons: NodeFileTraceReasons,\n cachedIgnoreFiles: Map<string, boolean>,\n children: Set<string> = new Set()\n) {\n if (cachedIgnoreFiles.has(file)) {\n return cachedIgnoreFiles.get(file)\n }\n\n if (serverIgnoreFn(file)) {\n cachedIgnoreFiles.set(file, true)\n return true\n }\n children.add(file)\n\n const reason = reasons.get(file)\n if (!reason || reason.parents.size === 0 || reason.type.includes('initial')) {\n cachedIgnoreFiles.set(file, false)\n return false\n }\n\n // if all parents are ignored the child file\n // should be ignored as well\n let allParentsIgnored = true\n\n for (const parent of reason.parents.values()) {\n if (!children.has(parent)) {\n children.add(parent)\n if (\n !shouldIgnore(\n parent,\n serverIgnoreFn,\n reasons,\n cachedIgnoreFiles,\n children\n )\n ) {\n allParentsIgnored = false\n break\n }\n }\n }\n\n cachedIgnoreFiles.set(file, allParentsIgnored)\n return allParentsIgnored\n}\n\nexport async function collectBuildTraces({\n dir,\n config,\n distDir,\n edgeRuntimeRoutes,\n staticPages,\n nextBuildSpan = new Span({ name: 'build' }),\n hasSsrAmpPages,\n buildTraceContext,\n outputFileTracingRoot,\n isTurbopack,\n}: {\n dir: string\n distDir: string\n staticPages: string[]\n hasSsrAmpPages: boolean\n outputFileTracingRoot: string\n // pageInfos is serialized when this function runs in a worker.\n edgeRuntimeRoutes: RoutesUsingEdgeRuntime\n nextBuildSpan?: Span\n config: NextConfigComplete\n buildTraceContext?: BuildTraceContext\n isTurbopack: boolean\n}) {\n const startTime = Date.now()\n debug('starting build traces')\n\n const { outputFileTracingIncludes = {}, outputFileTracingExcludes = {} } =\n config\n const excludeGlobKeys = Object.keys(outputFileTracingExcludes)\n const includeGlobKeys = Object.keys(outputFileTracingIncludes)\n\n await nextBuildSpan\n .traceChild('node-file-trace-build', {\n isTurbotrace: 'false', // TODO(arlyon): remove this\n })\n .traceAsyncFn(async () => {\n const nextServerTraceOutput = path.join(\n distDir,\n 'next-server.js.nft.json'\n )\n const nextMinimalTraceOutput = path.join(\n distDir,\n 'next-minimal-server.js.nft.json'\n )\n const root = outputFileTracingRoot\n\n // Under standalone mode, we need to trace the extra IPC server and\n // worker files.\n const isStandalone = config.output === 'standalone'\n const sharedEntriesSet = Object.keys(defaultOverrides).map((value) =>\n require.resolve(value, {\n paths: [require.resolve('next/dist/server/require-hook')],\n })\n )\n\n const { cacheHandler } = config\n const { cacheHandlers } = config.experimental\n\n // ensure we trace any dependencies needed for custom\n // incremental cache handler\n if (cacheHandler) {\n sharedEntriesSet.push(\n require.resolve(\n path.isAbsolute(cacheHandler)\n ? cacheHandler\n : path.join(dir, cacheHandler)\n )\n )\n }\n\n if (cacheHandlers) {\n for (const handlerPath of Object.values(cacheHandlers)) {\n if (handlerPath) {\n sharedEntriesSet.push(\n require.resolve(\n path.isAbsolute(handlerPath)\n ? handlerPath\n : path.join(dir, handlerPath)\n )\n )\n }\n }\n }\n\n const serverEntries = [\n ...sharedEntriesSet,\n ...(isStandalone\n ? [\n require.resolve('next/dist/server/lib/start-server'),\n require.resolve('next/dist/server/next'),\n require.resolve('next/dist/server/require-hook'),\n ]\n : []),\n require.resolve('next/dist/server/next-server'),\n ].filter(Boolean) as string[]\n\n const minimalServerEntries = [\n ...sharedEntriesSet,\n require.resolve('next/dist/compiled/next-server/server.runtime.prod'),\n ].filter(Boolean)\n\n const additionalIgnores = new Set<string>()\n\n for (const glob of excludeGlobKeys) {\n if (picomatch(glob)('next-server')) {\n outputFileTracingExcludes[glob].forEach((exclude) => {\n additionalIgnores.add(exclude)\n })\n }\n }\n\n const makeIgnoreFn = (ignores: string[]) => {\n // pre compile the ignore globs\n const isMatch = picomatch(ignores, {\n contains: true,\n dot: true,\n })\n\n return (pathname: string) => {\n if (path.isAbsolute(pathname) && !pathname.startsWith(root)) {\n return true\n }\n\n return isMatch(pathname)\n }\n }\n\n const sharedIgnores = [\n '**/next/dist/compiled/next-server/**/*.dev.js',\n ...(isStandalone ? [] : ['**/next/dist/compiled/jest-worker/**/*']),\n '**/next/dist/compiled/webpack/*',\n '**/node_modules/webpack5/**/*',\n '**/next/dist/server/lib/route-resolver*',\n 'next/dist/compiled/semver/semver/**/*.js',\n\n ...(ciEnvironment.hasNextSupport\n ? [\n // only ignore image-optimizer code when\n // this is being handled outside of next-server\n '**/next/dist/server/image-optimizer.js',\n ]\n : []),\n\n ...(!hasSsrAmpPages\n ? ['**/next/dist/compiled/@ampproject/toolbox-optimizer/**/*']\n : []),\n\n ...(isStandalone ? [] : TRACE_IGNORES),\n ...additionalIgnores,\n ]\n\n const sharedIgnoresFn = makeIgnoreFn(sharedIgnores)\n\n const serverIgnores = [\n ...sharedIgnores,\n '**/node_modules/react{,-dom,-dom-server-turbopack}/**/*.development.js',\n '**/*.d.ts',\n '**/*.map',\n '**/next/dist/pages/**/*',\n ...(ciEnvironment.hasNextSupport\n ? ['**/node_modules/sharp/**/*', '**/@img/sharp-libvips*/**/*']\n : []),\n ].filter(nonNullable)\n const serverIgnoreFn = makeIgnoreFn(serverIgnores)\n\n const minimalServerIgnores = [\n ...serverIgnores,\n '**/next/dist/compiled/edge-runtime/**/*',\n '**/next/dist/server/web/sandbox/**/*',\n '**/next/dist/server/post-process.js',\n ]\n const minimalServerIgnoreFn = makeIgnoreFn(minimalServerIgnores)\n\n const routesIgnores = [\n ...sharedIgnores,\n // server chunks are provided via next-trace-entrypoints-plugin plugin\n // as otherwise all chunks are traced here and included for all pages\n // whether they are needed or not\n '**/.next/server/chunks/**',\n '**/next/dist/server/optimize-amp.js',\n '**/next/dist/server/post-process.js',\n ].filter(nonNullable)\n\n const routeIgnoreFn = makeIgnoreFn(routesIgnores)\n\n const serverTracedFiles = new Set<string>()\n const minimalServerTracedFiles = new Set<string>()\n\n function addToTracedFiles(base: string, file: string, dest: Set<string>) {\n dest.add(\n path.relative(distDir, path.join(base, file)).replace(/\\\\/g, '/')\n )\n }\n\n if (isStandalone) {\n addToTracedFiles(\n '',\n require.resolve('next/dist/compiled/jest-worker/processChild'),\n serverTracedFiles\n )\n addToTracedFiles(\n '',\n require.resolve('next/dist/compiled/jest-worker/threadChild'),\n serverTracedFiles\n )\n }\n\n if (isTurbopack) {\n addToTracedFiles(distDir, './package.json', serverTracedFiles)\n addToTracedFiles(distDir, './package.json', minimalServerTracedFiles)\n }\n\n {\n const chunksToTrace: string[] = [\n ...(buildTraceContext?.chunksTrace?.action.input || []),\n ...serverEntries,\n ...minimalServerEntries,\n ]\n const result = await nodeFileTrace(chunksToTrace, {\n base: outputFileTracingRoot,\n processCwd: dir,\n mixedModules: true,\n async readFile(p) {\n try {\n return await fs.readFile(p, 'utf8')\n } catch (e) {\n if (isError(e) && (e.code === 'ENOENT' || e.code === 'EISDIR')) {\n // since tracing runs in parallel with static generation server\n // files might be removed from that step so tolerate ENOENT\n // errors gracefully\n return ''\n }\n throw e\n }\n },\n async readlink(p) {\n try {\n return await fs.readlink(p)\n } catch (e) {\n if (\n isError(e) &&\n (e.code === 'EINVAL' ||\n e.code === 'ENOENT' ||\n e.code === 'UNKNOWN')\n ) {\n return null\n }\n throw e\n }\n },\n async stat(p) {\n try {\n return await fs.stat(p)\n } catch (e) {\n if (isError(e) && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) {\n return null\n }\n throw e\n }\n },\n // handle shared ignores at top-level as it\n // avoids over-tracing when we don't need to\n // and speeds up total trace time\n ignore(p) {\n if (sharedIgnoresFn(p)) {\n return true\n }\n\n // if a chunk is attempting to be traced that isn't\n // in our initial list we need to ignore it to prevent\n // over tracing as webpack needs to be the source of\n // truth for which chunks should be included for each entry\n if (\n p.includes('.next/server/chunks') &&\n !chunksToTrace.includes(path.join(outputFileTracingRoot, p))\n ) {\n return true\n }\n return false\n },\n })\n const reasons = result.reasons\n const fileList = result.fileList\n for (const file of result.esmFileList) {\n fileList.add(file)\n }\n\n const parentFilesMap = getFilesMapFromReasons(fileList, reasons)\n const cachedLookupIgnore = new Map<string, boolean>()\n const cachedLookupIgnoreMinimal = new Map<string, boolean>()\n\n for (const [entries, tracedFiles] of [\n [serverEntries, serverTracedFiles],\n [minimalServerEntries, minimalServerTracedFiles],\n ] as Array<[string[], Set<string>]>) {\n for (const file of entries) {\n const curFiles = [\n ...(parentFilesMap\n .get(path.relative(outputFileTracingRoot, file))\n ?.keys() || []),\n ]\n tracedFiles.add(path.relative(distDir, file).replace(/\\\\/g, '/'))\n\n for (const curFile of curFiles || []) {\n const filePath = path.join(outputFileTracingRoot, curFile)\n\n if (\n !shouldIgnore(\n curFile,\n tracedFiles === minimalServerTracedFiles\n ? minimalServerIgnoreFn\n : serverIgnoreFn,\n reasons,\n tracedFiles === minimalServerTracedFiles\n ? cachedLookupIgnoreMinimal\n : cachedLookupIgnore\n )\n ) {\n tracedFiles.add(\n path.relative(distDir, filePath).replace(/\\\\/g, '/')\n )\n }\n }\n }\n }\n\n const { entryNameFilesMap } = buildTraceContext?.chunksTrace || {}\n\n const cachedLookupIgnoreRoutes = new Map<string, boolean>()\n\n await Promise.all(\n [\n ...(entryNameFilesMap\n ? Object.entries(entryNameFilesMap)\n : new Map()),\n ].map(async ([entryName, entryNameFiles]) => {\n const isApp = entryName.startsWith('app/')\n const isPages = entryName.startsWith('pages/')\n let route = entryName\n if (isApp) {\n route = normalizeAppPath(route.substring('app'.length))\n }\n if (isPages) {\n route = normalizePagePath(route.substring('pages'.length))\n }\n\n // we don't need to trace for automatically statically optimized\n // pages as they don't have server bundles, note there is\n // the caveat with flying shuttle mode as it needs this for\n // detecting changed entries\n if (staticPages.includes(route)) {\n return\n }\n const entryOutputPath = path.join(\n distDir,\n 'server',\n `${entryName}.js`\n )\n const traceOutputPath = `${entryOutputPath}.nft.json`\n const existingTrace = JSON.parse(\n await fs.readFile(traceOutputPath, 'utf8')\n ) as {\n version: number\n files: string[]\n fileHashes: Record<string, string>\n }\n const traceOutputDir = path.dirname(traceOutputPath)\n const curTracedFiles = new Set<string>()\n\n for (const file of [...entryNameFiles, entryOutputPath]) {\n const curFiles = [\n ...(parentFilesMap\n .get(path.relative(outputFileTracingRoot, file))\n ?.keys() || []),\n ]\n for (const curFile of curFiles || []) {\n if (\n !shouldIgnore(\n curFile,\n routeIgnoreFn,\n reasons,\n cachedLookupIgnoreRoutes\n )\n ) {\n const filePath = path.join(outputFileTracingRoot, curFile)\n const outputFile = path\n .relative(traceOutputDir, filePath)\n .replace(/\\\\/g, '/')\n curTracedFiles.add(outputFile)\n }\n }\n }\n\n for (const file of existingTrace.files || []) {\n curTracedFiles.add(file)\n }\n\n await fs.writeFile(\n traceOutputPath,\n JSON.stringify({\n ...existingTrace,\n files: [...curTracedFiles].sort(),\n })\n )\n })\n )\n }\n\n const moduleTypes = ['app-page', 'pages']\n\n for (const type of moduleTypes) {\n const modulePath = require.resolve(\n `next/dist/server/route-modules/${type}/module.compiled`\n )\n const relativeModulePath = path.relative(root, modulePath)\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 const itemPath = path.relative(root, path.join(contextDir, item))\n if (!serverIgnoreFn(itemPath)) {\n addToTracedFiles(root, itemPath, serverTracedFiles)\n addToTracedFiles(root, itemPath, minimalServerTracedFiles)\n }\n }\n addToTracedFiles(root, relativeModulePath, serverTracedFiles)\n addToTracedFiles(root, relativeModulePath, minimalServerTracedFiles)\n }\n\n const serverTracedFilesSorted = Array.from(serverTracedFiles)\n serverTracedFilesSorted.sort()\n const minimalServerTracedFilesSorted = Array.from(\n minimalServerTracedFiles\n )\n minimalServerTracedFilesSorted.sort()\n\n await Promise.all([\n fs.writeFile(\n nextServerTraceOutput,\n JSON.stringify({\n version: 1,\n files: serverTracedFilesSorted,\n } as {\n version: number\n files: string[]\n })\n ),\n fs.writeFile(\n nextMinimalTraceOutput,\n JSON.stringify({\n version: 1,\n files: minimalServerTracedFilesSorted,\n } as {\n version: number\n files: string[]\n })\n ),\n ])\n })\n\n // apply outputFileTracingIncludes/outputFileTracingExcludes after runTurbotrace\n const includeExcludeSpan = nextBuildSpan.traceChild('apply-include-excludes')\n await includeExcludeSpan.traceAsyncFn(async () => {\n const globOrig =\n require('next/dist/compiled/glob') as typeof import('next/dist/compiled/glob')\n const glob = (pattern: string): Promise<string[]> => {\n return new Promise((resolve, reject) => {\n globOrig(\n pattern,\n { cwd: dir, nodir: true, dot: true },\n (err, files) => {\n if (err) {\n return reject(err)\n }\n resolve(files)\n }\n )\n })\n }\n\n const { entryNameFilesMap } = buildTraceContext?.chunksTrace || {}\n\n await Promise.all(\n [\n ...(entryNameFilesMap ? Object.entries(entryNameFilesMap) : new Map()),\n ].map(async ([entryName]) => {\n const isApp = entryName.startsWith('app/')\n const isPages = entryName.startsWith('pages/')\n let route = entryName\n if (isApp) {\n route = normalizeAppPath(entryName)\n }\n if (isPages) {\n route = normalizePagePath(entryName)\n }\n\n if (staticPages.includes(route)) {\n return\n }\n\n // edge routes have no trace files\n if (edgeRuntimeRoutes.hasOwnProperty(route)) {\n return\n }\n\n const combinedIncludes = new Set<string>()\n const combinedExcludes = new Set<string>()\n for (const curGlob of includeGlobKeys) {\n const isMatch = picomatch(curGlob, { dot: true, contains: true })\n if (isMatch(route)) {\n for (const include of outputFileTracingIncludes[curGlob]) {\n combinedIncludes.add(include.replace(/\\\\/g, '/'))\n }\n }\n }\n\n for (const curGlob of excludeGlobKeys) {\n const isMatch = picomatch(curGlob, { dot: true, contains: true })\n if (isMatch(route)) {\n for (const exclude of outputFileTracingExcludes[curGlob]) {\n combinedExcludes.add(exclude)\n }\n }\n }\n\n if (!combinedIncludes?.size && !combinedExcludes?.size) {\n return\n }\n\n const traceFile = path.join(\n distDir,\n `server`,\n `${entryName}.js.nft.json`\n )\n const pageDir = path.dirname(traceFile)\n const traceContent = JSON.parse(await fs.readFile(traceFile, 'utf8'))\n const includes: string[] = []\n const resolvedTraceIncludes = new Map<string, string[]>()\n\n if (combinedIncludes?.size) {\n await Promise.all(\n [...combinedIncludes].map(async (includeGlob) => {\n const results = await glob(includeGlob)\n const resolvedInclude = resolvedTraceIncludes.get(\n includeGlob\n ) || [\n ...results.map((file) => {\n return path.relative(pageDir, path.join(dir, file))\n }),\n ]\n includes.push(...resolvedInclude)\n resolvedTraceIncludes.set(includeGlob, resolvedInclude)\n })\n )\n }\n const combined = new Set([...traceContent.files, ...includes])\n\n if (combinedExcludes?.size) {\n const resolvedGlobs = [...combinedExcludes].map((exclude) =>\n path.join(dir, exclude)\n )\n\n // pre compile before forEach\n const isMatch = picomatch(resolvedGlobs, {\n dot: true,\n contains: true,\n })\n\n combined.forEach((file) => {\n if (isMatch(path.join(pageDir, file))) {\n combined.delete(file)\n }\n })\n }\n\n // overwrite trace file with custom includes/excludes\n await fs.writeFile(\n traceFile,\n JSON.stringify({\n version: traceContent.version,\n files: [...combined],\n })\n )\n })\n )\n })\n\n debug(`finished build tracing ${Date.now() - startTime}ms`)\n}\n"],"names":["collectBuildTraces","debug","debugOriginal","shouldIgnore","file","serverIgnoreFn","reasons","cachedIgnoreFiles","children","Set","has","get","set","add","reason","parents","size","type","includes","allParentsIgnored","parent","values","dir","config","distDir","edgeRuntimeRoutes","staticPages","nextBuildSpan","Span","name","hasSsrAmpPages","buildTraceContext","outputFileTracingRoot","isTurbopack","startTime","Date","now","outputFileTracingIncludes","outputFileTracingExcludes","excludeGlobKeys","Object","keys","includeGlobKeys","traceChild","isTurbotrace","traceAsyncFn","nextServerTraceOutput","path","join","nextMinimalTraceOutput","root","isStandalone","output","sharedEntriesSet","defaultOverrides","map","value","require","resolve","paths","cacheHandler","cacheHandlers","experimental","push","isAbsolute","handlerPath","serverEntries","filter","Boolean","minimalServerEntries","additionalIgnores","glob","picomatch","forEach","exclude","makeIgnoreFn","ignores","isMatch","contains","dot","pathname","startsWith","sharedIgnores","ciEnvironment","hasNextSupport","TRACE_IGNORES","sharedIgnoresFn","serverIgnores","nonNullable","minimalServerIgnores","minimalServerIgnoreFn","routesIgnores","routeIgnoreFn","serverTracedFiles","minimalServerTracedFiles","addToTracedFiles","base","dest","relative","replace","chunksToTrace","chunksTrace","action","input","result","nodeFileTrace","processCwd","mixedModules","readFile","p","fs","e","isError","code","readlink","stat","ignore","fileList","esmFileList","parentFilesMap","getFilesMapFromReasons","cachedLookupIgnore","Map","cachedLookupIgnoreMinimal","entries","tracedFiles","curFiles","curFile","filePath","entryNameFilesMap","cachedLookupIgnoreRoutes","Promise","all","entryName","entryNameFiles","isApp","isPages","route","normalizeAppPath","substring","length","normalizePagePath","entryOutputPath","traceOutputPath","existingTrace","JSON","parse","traceOutputDir","dirname","curTracedFiles","outputFile","files","writeFile","stringify","sort","moduleTypes","modulePath","relativeModulePath","contextDir","item","readdir","itemPath","serverTracedFilesSorted","Array","from","minimalServerTracedFilesSorted","version","includeExcludeSpan","globOrig","pattern","reject","cwd","nodir","err","hasOwnProperty","combinedIncludes","combinedExcludes","curGlob","include","traceFile","pageDir","traceContent","resolvedTraceIncludes","includeGlob","results","resolvedInclude","combined","resolvedGlobs","delete"],"mappings":";;;;+BA0EsBA;;;eAAAA;;;uBA1ED;4CAOd;6DAEU;iEACF;6BACa;gEACG;8DACL;kEACJ;6BACW;qBACH;mCACI;0BACD;gEACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIpB,MAAMC,QAAQC,IAAAA,cAAa,EAAC;AAE5B,SAASC,aACPC,IAAY,EACZC,cAAyC,EACzCC,OAA6B,EAC7BC,iBAAuC,EACvCC,WAAwB,IAAIC,KAAK;IAEjC,IAAIF,kBAAkBG,GAAG,CAACN,OAAO;QAC/B,OAAOG,kBAAkBI,GAAG,CAACP;IAC/B;IAEA,IAAIC,eAAeD,OAAO;QACxBG,kBAAkBK,GAAG,CAACR,MAAM;QAC5B,OAAO;IACT;IACAI,SAASK,GAAG,CAACT;IAEb,MAAMU,SAASR,QAAQK,GAAG,CAACP;IAC3B,IAAI,CAACU,UAAUA,OAAOC,OAAO,CAACC,IAAI,K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EAAE;gBAC1B,MAAMmH,QAAQC,GAAG,CACf;uBAAI2C;iBAAiB,CAACxH,GAAG,CAAC,OAAOgI;oBAC/B,MAAMC,UAAU,MAAMjH,KAAKgH;oBAC3B,MAAME,kBAAkBH,sBAAsB3K,GAAG,CAC/C4K,gBACG;2BACAC,QAAQjI,GAAG,CAAC,CAACnD;4BACd,OAAO2C,aAAI,CAACmD,QAAQ,CAACkF,SAASrI,aAAI,CAACC,IAAI,CAAC1B,KAAKlB;wBAC/C;qBACD;oBACDc,SAAS6C,IAAI,IAAI0H;oBACjBH,sBAAsB1K,GAAG,CAAC2K,aAAaE;gBACzC;YAEJ;YACA,MAAMC,WAAW,IAAIjL,IAAI;mBAAI4K,aAAa9B,KAAK;mBAAKrI;aAAS;YAE7D,IAAI8J,oCAAAA,iBAAkBhK,IAAI,EAAE;gBAC1B,MAAM2K,gBAAgB;uBAAIX;iBAAiB,CAACzH,GAAG,CAAC,CAACmB,UAC/C3B,aAAI,CAACC,IAAI,CAAC1B,KAAKoD;gBAGjB,6BAA6B;gBAC7B,MAAMG,UAAUL,IAAAA,kBAAS,EAACmH,eAAe;oBACvC5G,KAAK;oBACLD,UAAU;gBACZ;gBAEA4G,SAASjH,OAAO,CAAC,CAACrE;oBAChB,IAAIyE,QAAQ9B,aAAI,CAACC,IAAI,CAACoI,SAAShL,QAAQ;wBACrCsL,SAASE,MAAM,CAACxL;oBAClB;gBACF;YACF;YAEA,qDAAqD;YACrD,MAAM0G,iBAAE,CAAC0C,SAAS,CAChB2B,WACAlC,KAAKQ,SAAS,CAAC;gBACba,SAASe,aAAaf,OAAO;gBAC7Bf,OAAO;uBAAImC;iBAAS;YACtB;QAEJ;IAEJ;IAEAzL,MAAM,CAAC,uBAAuB,EAAEkC,KAAKC,GAAG,KAAKF,UAAU,EAAE,CAAC;AAC5D","ignoreList":[0]}
|
package/dist/build/index.js
CHANGED
@@ -23,7 +23,6 @@ _export(exports, {
|
|
23
23
|
require("../lib/setup-exception-listeners");
|
24
24
|
const _env = require("@next/env");
|
25
25
|
const _picocolors = require("../lib/picocolors");
|
26
|
-
const _crypto = /*#__PURE__*/ _interop_require_default(require("crypto"));
|
27
26
|
const _picomatch = require("next/dist/compiled/picomatch");
|
28
27
|
const _fs = require("fs");
|
29
28
|
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
|
@@ -102,6 +101,7 @@ const _durationtostring = require("./duration-to-string");
|
|
102
101
|
const _shared = require("../trace/shared");
|
103
102
|
const _errortelemetryutils = require("../lib/error-telemetry-utils");
|
104
103
|
const _afterproductioncompile = require("./after-production-compile");
|
104
|
+
const _previewkeyutils = require("./preview-key-utils");
|
105
105
|
function _interop_require_default(obj) {
|
106
106
|
return obj && obj.__esModule ? obj : {
|
107
107
|
default: obj
|
@@ -364,7 +364,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
|
|
364
364
|
const nextBuildSpan = (0, _trace.trace)('next-build', undefined, {
|
365
365
|
buildMode: experimentalBuildMode,
|
366
366
|
isTurboBuild: String(isTurbopack),
|
367
|
-
version: "15.4.0-canary.
|
367
|
+
version: "15.4.0-canary.59"
|
368
368
|
});
|
369
369
|
_buildcontext.NextBuildContext.nextBuildSpan = nextBuildSpan;
|
370
370
|
_buildcontext.NextBuildContext.dir = dir;
|
@@ -543,11 +543,10 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
|
|
543
543
|
const hasInstrumentationHook = rootPaths.some((p)=>p.includes(_constants.INSTRUMENTATION_HOOK_FILENAME));
|
544
544
|
const hasMiddlewareFile = rootPaths.some((p)=>p.includes(_constants.MIDDLEWARE_FILENAME));
|
545
545
|
_buildcontext.NextBuildContext.hasInstrumentationHook = hasInstrumentationHook;
|
546
|
-
const previewProps = {
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
};
|
546
|
+
const previewProps = await (0, _previewkeyutils.generatePreviewKeys)({
|
547
|
+
isBuild: true,
|
548
|
+
distDir
|
549
|
+
});
|
551
550
|
_buildcontext.NextBuildContext.previewProps = previewProps;
|
552
551
|
const mappedPages = await nextBuildSpan.traceChild('create-pages-mapping').traceAsyncFn(()=>(0, _entries.createPagesMapping)({
|
553
552
|
isDev: false,
|
@@ -746,7 +745,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
|
|
746
745
|
// Files outside of the distDir can be "type": "module"
|
747
746
|
await writeFileUtf8(_path.default.join(distDir, 'package.json'), '{"type": "commonjs"}');
|
748
747
|
// These are written to distDir, so they need to come after creating and cleaning distDr.
|
749
|
-
await (0, _builddiagnostics.recordFrameworkVersion)("15.4.0-canary.
|
748
|
+
await (0, _builddiagnostics.recordFrameworkVersion)("15.4.0-canary.59");
|
750
749
|
await (0, _builddiagnostics.updateBuildDiagnostics)({
|
751
750
|
buildStage: 'start'
|
752
751
|
});
|