next 15.6.0-canary.26 → 15.6.0-canary.27
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/index.js +3 -3
- package/dist/build/swc/index.js +1 -1
- package/dist/build/turbopack-build/impl.js +11 -1
- package/dist/build/turbopack-build/impl.js.map +1 -1
- package/dist/build/webpack/plugins/build-manifest-plugin-utils.js +2 -2
- package/dist/build/webpack/plugins/build-manifest-plugin-utils.js.map +1 -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/babel/bundle.js +1 -1
- package/dist/compiled/babel/code-frame.js +1 -1
- package/dist/compiled/babel-code-frame/LICENSE +22 -0
- package/dist/compiled/babel-code-frame/index.js +1 -0
- package/dist/compiled/babel-code-frame/package.json +1 -0
- package/dist/compiled/next-server/pages-api-turbo.runtime.dev.js +1 -1
- package/dist/compiled/next-server/pages-api-turbo.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/pages-api.runtime.dev.js +1 -1
- package/dist/compiled/next-server/pages-api.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/pages-turbo.runtime.dev.js +1 -1
- package/dist/compiled/next-server/pages-turbo.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/pages.runtime.dev.js +1 -1
- package/dist/compiled/next-server/pages.runtime.dev.js.map +1 -1
- package/dist/esm/build/index.js +3 -3
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/turbopack-build/impl.js +11 -1
- package/dist/esm/build/turbopack-build/impl.js.map +1 -1
- package/dist/esm/build/webpack/plugins/build-manifest-plugin-utils.js +2 -2
- package/dist/esm/build/webpack/plugins/build-manifest-plugin-utils.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.6.0-canary.
|
82
|
+
}).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.6.0-canary.27"}`, '-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('--debug-prerender', 'Enables debug mode for prerendering. Not for production use!').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',
|
package/dist/build/index.js
CHANGED
@@ -371,7 +371,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
|
|
371
371
|
const nextBuildSpan = (0, _trace.trace)('next-build', undefined, {
|
372
372
|
buildMode: experimentalBuildMode,
|
373
373
|
isTurboBuild: String(isTurbopack),
|
374
|
-
version: "15.6.0-canary.
|
374
|
+
version: "15.6.0-canary.27"
|
375
375
|
});
|
376
376
|
_buildcontext.NextBuildContext.nextBuildSpan = nextBuildSpan;
|
377
377
|
_buildcontext.NextBuildContext.dir = dir;
|
@@ -850,7 +850,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
|
|
850
850
|
// Files outside of the distDir can be "type": "module"
|
851
851
|
await writeFileUtf8(_path.default.join(distDir, 'package.json'), '{"type": "commonjs"}');
|
852
852
|
// These are written to distDir, so they need to come after creating and cleaning distDr.
|
853
|
-
await (0, _builddiagnostics.recordFrameworkVersion)("15.6.0-canary.
|
853
|
+
await (0, _builddiagnostics.recordFrameworkVersion)("15.6.0-canary.27");
|
854
854
|
await (0, _builddiagnostics.updateBuildDiagnostics)({
|
855
855
|
buildStage: 'start'
|
856
856
|
});
|
@@ -2508,7 +2508,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
|
|
2508
2508
|
distDir,
|
2509
2509
|
config,
|
2510
2510
|
staticPages,
|
2511
|
-
nextVersion: "15.6.0-canary.
|
2511
|
+
nextVersion: "15.6.0-canary.27",
|
2512
2512
|
tracingRoot: outputFileTracingRoot,
|
2513
2513
|
hasNodeMiddleware,
|
2514
2514
|
hasInstrumentationHook,
|
package/dist/build/swc/index.js
CHANGED
@@ -130,7 +130,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
130
130
|
}
|
131
131
|
return newObj;
|
132
132
|
}
|
133
|
-
const nextVersion = "15.6.0-canary.
|
133
|
+
const nextVersion = "15.6.0-canary.27";
|
134
134
|
const ArchName = (0, _os.arch)();
|
135
135
|
const PlatformName = (0, _os.platform)();
|
136
136
|
function infoLog(...args) {
|
@@ -60,7 +60,6 @@ async function turbopackBuild() {
|
|
60
60
|
const previewProps = _buildcontext.NextBuildContext.previewProps;
|
61
61
|
const hasRewrites = _buildcontext.NextBuildContext.hasRewrites;
|
62
62
|
const rewrites = _buildcontext.NextBuildContext.rewrites;
|
63
|
-
const appDirOnly = _buildcontext.NextBuildContext.appDirOnly;
|
64
63
|
const noMangling = _buildcontext.NextBuildContext.noMangling;
|
65
64
|
const currentNodeJsVersion = process.versions.node;
|
66
65
|
const startTime = process.hrtime();
|
@@ -116,8 +115,19 @@ async function turbopackBuild() {
|
|
116
115
|
recursive: true
|
117
116
|
});
|
118
117
|
await _fs.promises.writeFile(_path.default.join(distDir, 'package.json'), '{"type": "commonjs"}');
|
118
|
+
let appDirOnly = _buildcontext.NextBuildContext.appDirOnly;
|
119
119
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
120
120
|
const entrypoints = await project.writeAllEntrypointsToDisk(appDirOnly);
|
121
|
+
const hasPagesEntries = Array.from(entrypoints.routes.values()).some((route)=>{
|
122
|
+
if (route.type === 'page' || route.type === 'page-api') {
|
123
|
+
return true;
|
124
|
+
}
|
125
|
+
return false;
|
126
|
+
});
|
127
|
+
// If there's no pages entries, then we are in app-dir-only mode
|
128
|
+
if (!hasPagesEntries) {
|
129
|
+
appDirOnly = true;
|
130
|
+
}
|
121
131
|
const manifestLoader = new _manifestloader.TurbopackManifestLoader({
|
122
132
|
buildId,
|
123
133
|
distDir,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/build/turbopack-build/impl.ts"],"sourcesContent":["import path from 'path'\nimport { validateTurboNextConfig } from '../../lib/turbopack-warning'\nimport {\n formatIssue,\n isPersistentCachingEnabled,\n isRelevantWarning,\n} from '../../shared/lib/turbopack/utils'\nimport { NextBuildContext } from '../build-context'\nimport { createDefineEnv, loadBindings } from '../swc'\nimport {\n rawEntrypointsToEntrypoints,\n handleRouteType,\n} from '../handle-entrypoints'\nimport { TurbopackManifestLoader } from '../../shared/lib/turbopack/manifest-loader'\nimport { promises as fs } from 'fs'\nimport { PHASE_PRODUCTION_BUILD } from '../../shared/lib/constants'\nimport loadConfig from '../../server/config'\nimport { hasCustomExportOutput } from '../../export/utils'\nimport { Telemetry } from '../../telemetry/storage'\nimport { setGlobal } from '../../trace'\nimport { isCI } from '../../server/ci-info'\nimport { backgroundLogCompilationEvents } from '../../shared/lib/turbopack/compilation-events'\nimport { getSupportedBrowsers } from '../utils'\nimport { normalizePath } from '../../lib/normalize-path'\n\nexport async function turbopackBuild(): Promise<{\n duration: number\n buildTraceContext: undefined\n shutdownPromise: Promise<void>\n}> {\n await validateTurboNextConfig({\n dir: NextBuildContext.dir!,\n isDev: false,\n })\n\n const config = NextBuildContext.config!\n const dir = NextBuildContext.dir!\n const distDir = NextBuildContext.distDir!\n const buildId = NextBuildContext.buildId!\n const encryptionKey = NextBuildContext.encryptionKey!\n const previewProps = NextBuildContext.previewProps!\n const hasRewrites = NextBuildContext.hasRewrites!\n const rewrites = NextBuildContext.rewrites!\n const appDirOnly = NextBuildContext.appDirOnly!\n const noMangling = NextBuildContext.noMangling!\n const currentNodeJsVersion = process.versions.node\n\n const startTime = process.hrtime()\n const bindings = await loadBindings(config?.experimental?.useWasmBinary)\n const dev = false\n\n const supportedBrowsers = getSupportedBrowsers(dir, dev)\n\n const persistentCaching = isPersistentCachingEnabled(config)\n const rootPath = config.turbopack?.root || config.outputFileTracingRoot || dir\n const project = await bindings.turbo.createProject(\n {\n rootPath: config.turbopack?.root || config.outputFileTracingRoot || dir,\n projectPath: normalizePath(path.relative(rootPath, dir) || '.'),\n distDir,\n nextConfig: config,\n watch: {\n enable: false,\n },\n dev,\n env: process.env as Record<string, string>,\n defineEnv: createDefineEnv({\n isTurbopack: true,\n clientRouterFilters: NextBuildContext.clientRouterFilters!,\n config,\n dev,\n distDir,\n projectPath: dir,\n fetchCacheKeyPrefix: config.experimental.fetchCacheKeyPrefix,\n hasRewrites,\n // Implemented separately in Turbopack, doesn't have to be passed here.\n middlewareMatchers: undefined,\n rewrites,\n }),\n buildId,\n encryptionKey,\n previewProps,\n browserslistQuery: supportedBrowsers.join(', '),\n noMangling,\n currentNodeJsVersion,\n },\n {\n persistentCaching,\n memoryLimit: config.experimental?.turbopackMemoryLimit,\n dependencyTracking: persistentCaching,\n isCi: isCI,\n isShortSession: true,\n }\n )\n try {\n backgroundLogCompilationEvents(project)\n\n // Write an empty file in a known location to signal this was built with Turbopack\n await fs.writeFile(path.join(distDir, 'turbopack'), '')\n\n await fs.mkdir(path.join(distDir, 'server'), { recursive: true })\n await fs.mkdir(path.join(distDir, 'static', buildId), {\n recursive: true,\n })\n await fs.writeFile(\n path.join(distDir, 'package.json'),\n '{\"type\": \"commonjs\"}'\n )\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const entrypoints = await project.writeAllEntrypointsToDisk(appDirOnly)\n\n const manifestLoader = new TurbopackManifestLoader({\n buildId,\n distDir,\n encryptionKey,\n })\n\n const topLevelErrors = []\n const topLevelWarnings = []\n for (const issue of entrypoints.issues) {\n if (issue.severity === 'error' || issue.severity === 'fatal') {\n topLevelErrors.push(formatIssue(issue))\n } else if (isRelevantWarning(issue)) {\n topLevelWarnings.push(formatIssue(issue))\n }\n }\n\n if (topLevelWarnings.length > 0) {\n console.warn(\n `Turbopack build encountered ${\n topLevelWarnings.length\n } warnings:\\n${topLevelWarnings.join('\\n')}`\n )\n }\n\n if (topLevelErrors.length > 0) {\n throw new Error(\n `Turbopack build failed with ${\n topLevelErrors.length\n } errors:\\n${topLevelErrors.join('\\n')}`\n )\n }\n\n const currentEntrypoints = await rawEntrypointsToEntrypoints(entrypoints)\n\n const promises: Promise<any>[] = []\n\n if (!appDirOnly) {\n for (const [page, route] of currentEntrypoints.page) {\n promises.push(\n handleRouteType({\n page,\n route,\n manifestLoader,\n })\n )\n }\n }\n\n for (const [page, route] of currentEntrypoints.app) {\n promises.push(\n handleRouteType({\n page,\n route,\n manifestLoader,\n })\n )\n }\n\n await Promise.all(promises)\n\n await Promise.all([\n // Only load pages router manifests if not app-only\n ...(!appDirOnly\n ? [\n manifestLoader.loadBuildManifest('_app'),\n manifestLoader.loadPagesManifest('_app'),\n manifestLoader.loadFontManifest('_app'),\n manifestLoader.loadPagesManifest('_document'),\n manifestLoader.loadClientBuildManifest('_error'),\n manifestLoader.loadBuildManifest('_error'),\n manifestLoader.loadPagesManifest('_error'),\n manifestLoader.loadFontManifest('_error'),\n ]\n : []),\n entrypoints.instrumentation &&\n manifestLoader.loadMiddlewareManifest(\n 'instrumentation',\n 'instrumentation'\n ),\n entrypoints.middleware &&\n (await manifestLoader.loadMiddlewareManifest(\n 'middleware',\n 'middleware'\n )),\n ])\n\n manifestLoader.writeManifests({\n devRewrites: undefined,\n productionRewrites: rewrites,\n entrypoints: currentEntrypoints,\n })\n\n const shutdownPromise = project.shutdown()\n\n const time = process.hrtime(startTime)\n return {\n duration: time[0] + time[1] / 1e9,\n buildTraceContext: undefined,\n shutdownPromise,\n }\n } catch (err) {\n await project.shutdown()\n throw err\n }\n}\n\nlet shutdownPromise: Promise<void> | undefined\nexport async function workerMain(workerData: {\n buildContext: typeof NextBuildContext\n}): Promise<Awaited<ReturnType<typeof turbopackBuild>>> {\n // setup new build context from the serialized data passed from the parent\n Object.assign(NextBuildContext, workerData.buildContext)\n\n /// load the config because it's not serializable\n NextBuildContext.config = await loadConfig(\n PHASE_PRODUCTION_BUILD,\n NextBuildContext.dir!,\n { debugPrerender: NextBuildContext.debugPrerender }\n )\n\n // Matches handling in build/index.ts\n // https://github.com/vercel/next.js/blob/84f347fc86f4efc4ec9f13615c215e4b9fb6f8f0/packages/next/src/build/index.ts#L815-L818\n // Ensures the `config.distDir` option is matched.\n if (hasCustomExportOutput(NextBuildContext.config)) {\n NextBuildContext.config.distDir = '.next'\n }\n\n // Clone the telemetry for worker\n const telemetry = new Telemetry({\n distDir: NextBuildContext.config.distDir,\n })\n setGlobal('telemetry', telemetry)\n\n const result = await turbopackBuild()\n shutdownPromise = result.shutdownPromise\n return result\n}\n\nexport async function waitForShutdown(): Promise<void> {\n if (shutdownPromise) {\n await shutdownPromise\n }\n}\n"],"names":["turbopackBuild","waitForShutdown","workerMain","config","validateTurboNextConfig","dir","NextBuildContext","isDev","distDir","buildId","encryptionKey","previewProps","hasRewrites","rewrites","appDirOnly","noMangling","currentNodeJsVersion","process","versions","node","startTime","hrtime","bindings","loadBindings","experimental","useWasmBinary","dev","supportedBrowsers","getSupportedBrowsers","persistentCaching","isPersistentCachingEnabled","rootPath","turbopack","root","outputFileTracingRoot","project","turbo","createProject","projectPath","normalizePath","path","relative","nextConfig","watch","enable","env","defineEnv","createDefineEnv","isTurbopack","clientRouterFilters","fetchCacheKeyPrefix","middlewareMatchers","undefined","browserslistQuery","join","memoryLimit","turbopackMemoryLimit","dependencyTracking","isCi","isCI","isShortSession","backgroundLogCompilationEvents","fs","writeFile","mkdir","recursive","entrypoints","writeAllEntrypointsToDisk","manifestLoader","TurbopackManifestLoader","topLevelErrors","topLevelWarnings","issue","issues","severity","push","formatIssue","isRelevantWarning","length","console","warn","Error","currentEntrypoints","rawEntrypointsToEntrypoints","promises","page","route","handleRouteType","app","Promise","all","loadBuildManifest","loadPagesManifest","loadFontManifest","loadClientBuildManifest","instrumentation","loadMiddlewareManifest","middleware","writeManifests","devRewrites","productionRewrites","shutdownPromise","shutdown","time","duration","buildTraceContext","err","workerData","Object","assign","buildContext","loadConfig","PHASE_PRODUCTION_BUILD","debugPrerender","hasCustomExportOutput","telemetry","Telemetry","setGlobal","result"],"mappings":";;;;;;;;;;;;;;;;IAyBsBA,cAAc;eAAdA;;IAiOAC,eAAe;eAAfA;;IA/BAC,UAAU;eAAVA;;;6DA3NL;kCACuB;uBAKjC;8BAC0B;qBACa;mCAIvC;gCACiC;oBACT;2BACQ;+DAChB;wBACe;yBACZ;uBACA;wBACL;mCAC0B;wBACV;+BACP;;;;;;AAEvB,eAAeF;QAuBgBG,sBAMnBA,mBAGHA,oBA+BGA;IA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eAAerH;IACpB,IAAIoG,iBAAiB;QACnB,MAAMA;IACR;AACF","ignoreList":[0]}
|
1
|
+
{"version":3,"sources":["../../../src/build/turbopack-build/impl.ts"],"sourcesContent":["import path from 'path'\nimport { validateTurboNextConfig } from '../../lib/turbopack-warning'\nimport {\n formatIssue,\n isPersistentCachingEnabled,\n isRelevantWarning,\n} from '../../shared/lib/turbopack/utils'\nimport { NextBuildContext } from '../build-context'\nimport { createDefineEnv, loadBindings } from '../swc'\nimport {\n rawEntrypointsToEntrypoints,\n handleRouteType,\n} from '../handle-entrypoints'\nimport { TurbopackManifestLoader } from '../../shared/lib/turbopack/manifest-loader'\nimport { promises as fs } from 'fs'\nimport { PHASE_PRODUCTION_BUILD } from '../../shared/lib/constants'\nimport loadConfig from '../../server/config'\nimport { hasCustomExportOutput } from '../../export/utils'\nimport { Telemetry } from '../../telemetry/storage'\nimport { setGlobal } from '../../trace'\nimport { isCI } from '../../server/ci-info'\nimport { backgroundLogCompilationEvents } from '../../shared/lib/turbopack/compilation-events'\nimport { getSupportedBrowsers } from '../utils'\nimport { normalizePath } from '../../lib/normalize-path'\n\nexport async function turbopackBuild(): Promise<{\n duration: number\n buildTraceContext: undefined\n shutdownPromise: Promise<void>\n}> {\n await validateTurboNextConfig({\n dir: NextBuildContext.dir!,\n isDev: false,\n })\n\n const config = NextBuildContext.config!\n const dir = NextBuildContext.dir!\n const distDir = NextBuildContext.distDir!\n const buildId = NextBuildContext.buildId!\n const encryptionKey = NextBuildContext.encryptionKey!\n const previewProps = NextBuildContext.previewProps!\n const hasRewrites = NextBuildContext.hasRewrites!\n const rewrites = NextBuildContext.rewrites!\n const noMangling = NextBuildContext.noMangling!\n const currentNodeJsVersion = process.versions.node\n\n const startTime = process.hrtime()\n const bindings = await loadBindings(config?.experimental?.useWasmBinary)\n const dev = false\n\n const supportedBrowsers = getSupportedBrowsers(dir, dev)\n\n const persistentCaching = isPersistentCachingEnabled(config)\n const rootPath = config.turbopack?.root || config.outputFileTracingRoot || dir\n const project = await bindings.turbo.createProject(\n {\n rootPath: config.turbopack?.root || config.outputFileTracingRoot || dir,\n projectPath: normalizePath(path.relative(rootPath, dir) || '.'),\n distDir,\n nextConfig: config,\n watch: {\n enable: false,\n },\n dev,\n env: process.env as Record<string, string>,\n defineEnv: createDefineEnv({\n isTurbopack: true,\n clientRouterFilters: NextBuildContext.clientRouterFilters!,\n config,\n dev,\n distDir,\n projectPath: dir,\n fetchCacheKeyPrefix: config.experimental.fetchCacheKeyPrefix,\n hasRewrites,\n // Implemented separately in Turbopack, doesn't have to be passed here.\n middlewareMatchers: undefined,\n rewrites,\n }),\n buildId,\n encryptionKey,\n previewProps,\n browserslistQuery: supportedBrowsers.join(', '),\n noMangling,\n currentNodeJsVersion,\n },\n {\n persistentCaching,\n memoryLimit: config.experimental?.turbopackMemoryLimit,\n dependencyTracking: persistentCaching,\n isCi: isCI,\n isShortSession: true,\n }\n )\n try {\n backgroundLogCompilationEvents(project)\n\n // Write an empty file in a known location to signal this was built with Turbopack\n await fs.writeFile(path.join(distDir, 'turbopack'), '')\n\n await fs.mkdir(path.join(distDir, 'server'), { recursive: true })\n await fs.mkdir(path.join(distDir, 'static', buildId), {\n recursive: true,\n })\n await fs.writeFile(\n path.join(distDir, 'package.json'),\n '{\"type\": \"commonjs\"}'\n )\n\n let appDirOnly = NextBuildContext.appDirOnly!\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const entrypoints = await project.writeAllEntrypointsToDisk(appDirOnly)\n\n const hasPagesEntries = Array.from(entrypoints.routes.values()).some(\n (route) => {\n if (route.type === 'page' || route.type === 'page-api') {\n return true\n }\n return false\n }\n )\n // If there's no pages entries, then we are in app-dir-only mode\n if (!hasPagesEntries) {\n appDirOnly = true\n }\n\n const manifestLoader = new TurbopackManifestLoader({\n buildId,\n distDir,\n encryptionKey,\n })\n\n const topLevelErrors = []\n const topLevelWarnings = []\n for (const issue of entrypoints.issues) {\n if (issue.severity === 'error' || issue.severity === 'fatal') {\n topLevelErrors.push(formatIssue(issue))\n } else if (isRelevantWarning(issue)) {\n topLevelWarnings.push(formatIssue(issue))\n }\n }\n\n if (topLevelWarnings.length > 0) {\n console.warn(\n `Turbopack build encountered ${\n topLevelWarnings.length\n } warnings:\\n${topLevelWarnings.join('\\n')}`\n )\n }\n\n if (topLevelErrors.length > 0) {\n throw new Error(\n `Turbopack build failed with ${\n topLevelErrors.length\n } errors:\\n${topLevelErrors.join('\\n')}`\n )\n }\n\n const currentEntrypoints = await rawEntrypointsToEntrypoints(entrypoints)\n\n const promises: Promise<any>[] = []\n\n if (!appDirOnly) {\n for (const [page, route] of currentEntrypoints.page) {\n promises.push(\n handleRouteType({\n page,\n route,\n manifestLoader,\n })\n )\n }\n }\n\n for (const [page, route] of currentEntrypoints.app) {\n promises.push(\n handleRouteType({\n page,\n route,\n manifestLoader,\n })\n )\n }\n\n await Promise.all(promises)\n\n await Promise.all([\n // Only load pages router manifests if not app-only\n ...(!appDirOnly\n ? [\n manifestLoader.loadBuildManifest('_app'),\n manifestLoader.loadPagesManifest('_app'),\n manifestLoader.loadFontManifest('_app'),\n manifestLoader.loadPagesManifest('_document'),\n manifestLoader.loadClientBuildManifest('_error'),\n manifestLoader.loadBuildManifest('_error'),\n manifestLoader.loadPagesManifest('_error'),\n manifestLoader.loadFontManifest('_error'),\n ]\n : []),\n entrypoints.instrumentation &&\n manifestLoader.loadMiddlewareManifest(\n 'instrumentation',\n 'instrumentation'\n ),\n entrypoints.middleware &&\n (await manifestLoader.loadMiddlewareManifest(\n 'middleware',\n 'middleware'\n )),\n ])\n\n manifestLoader.writeManifests({\n devRewrites: undefined,\n productionRewrites: rewrites,\n entrypoints: currentEntrypoints,\n })\n\n const shutdownPromise = project.shutdown()\n\n const time = process.hrtime(startTime)\n return {\n duration: time[0] + time[1] / 1e9,\n buildTraceContext: undefined,\n shutdownPromise,\n }\n } catch (err) {\n await project.shutdown()\n throw err\n }\n}\n\nlet shutdownPromise: Promise<void> | undefined\nexport async function workerMain(workerData: {\n buildContext: typeof NextBuildContext\n}): Promise<Awaited<ReturnType<typeof turbopackBuild>>> {\n // setup new build context from the serialized data passed from the parent\n Object.assign(NextBuildContext, workerData.buildContext)\n\n /// load the config because it's not serializable\n NextBuildContext.config = await loadConfig(\n PHASE_PRODUCTION_BUILD,\n NextBuildContext.dir!,\n { debugPrerender: NextBuildContext.debugPrerender }\n )\n\n // Matches handling in build/index.ts\n // https://github.com/vercel/next.js/blob/84f347fc86f4efc4ec9f13615c215e4b9fb6f8f0/packages/next/src/build/index.ts#L815-L818\n // Ensures the `config.distDir` option is matched.\n if (hasCustomExportOutput(NextBuildContext.config)) {\n NextBuildContext.config.distDir = '.next'\n }\n\n // Clone the telemetry for worker\n const telemetry = new Telemetry({\n distDir: NextBuildContext.config.distDir,\n })\n setGlobal('telemetry', telemetry)\n\n const result = await turbopackBuild()\n shutdownPromise = result.shutdownPromise\n return result\n}\n\nexport async function waitForShutdown(): Promise<void> {\n if (shutdownPromise) {\n await shutdownPromise\n }\n}\n"],"names":["turbopackBuild","waitForShutdown","workerMain","config","validateTurboNextConfig","dir","NextBuildContext","isDev","distDir","buildId","encryptionKey","previewProps","hasRewrites","rewrites","noMangling","currentNodeJsVersion","process","versions","node","startTime","hrtime","bindings","loadBindings","experimental","useWasmBinary","dev","supportedBrowsers","getSupportedBrowsers","persistentCaching","isPersistentCachingEnabled","rootPath","turbopack","root","outputFileTracingRoot","project","turbo","createProject","projectPath","normalizePath","path","relative","nextConfig","watch","enable","env","defineEnv","createDefineEnv","isTurbopack","clientRouterFilters","fetchCacheKeyPrefix","middlewareMatchers","undefined","browserslistQuery","join","memoryLimit","turbopackMemoryLimit","dependencyTracking","isCi","isCI","isShortSession","backgroundLogCompilationEvents","fs","writeFile","mkdir","recursive","appDirOnly","entrypoints","writeAllEntrypointsToDisk","hasPagesEntries","Array","from","routes","values","some","route","type","manifestLoader","TurbopackManifestLoader","topLevelErrors","topLevelWarnings","issue","issues","severity","push","formatIssue","isRelevantWarning","length","console","warn","Error","currentEntrypoints","rawEntrypointsToEntrypoints","promises","page","handleRouteType","app","Promise","all","loadBuildManifest","loadPagesManifest","loadFontManifest","loadClientBuildManifest","instrumentation","loadMiddlewareManifest","middleware","writeManifests","devRewrites","productionRewrites","shutdownPromise","shutdown","time","duration","buildTraceContext","err","workerData","Object","assign","buildContext","loadConfig","PHASE_PRODUCTION_BUILD","debugPrerender","hasCustomExportOutput","telemetry","Telemetry","setGlobal","result"],"mappings":";;;;;;;;;;;;;;;;IAyBsBA,cAAc;eAAdA;;IA8OAC,eAAe;eAAfA;;IA/BAC,UAAU;eAAVA;;;6DAxOL;kCACuB;uBAKjC;8BAC0B;qBACa;mCAIvC;gCACiC;oBACT;2BACQ;+DAChB;wBACe;yBACZ;uBACA;wBACL;mCAC0B;wBACV;+BACP;;;;;;AAEvB,eAAeF;QAsBgBG,sBAMnBA,mBAGHA,oBA+BGA;IAzDjB,MAAMC,IAAAA,yCAAuB,EAAC;QAC5BC,KAAKC,8BAAgB,CAACD,GAAG;QACzBE,OAAO;IACT;IAEA,MAAMJ,SAASG,8BAAgB,CAACH,MAAM;IACtC,MAAME,MAAMC,8BAAgB,CAACD,GAAG;IAChC,MAAMG,UAAUF,8BAAgB,CAACE,OAAO;IACxC,MAAMC,UAAUH,8BAAgB,CAACG,OAAO;IACxC,MAAMC,gBAAgBJ,8BAAgB,CAACI,aAAa;IACpD,MAAMC,eAAeL,8BAAgB,CAACK,YAAY;IAClD,MAAMC,cAAcN,8BAAgB,CAACM,WAAW;IAChD,MAAMC,WAAWP,8BAAgB,CAACO,QAAQ;IAC1C,MAAMC,aAAaR,8BAAgB,CAACQ,UAAU;IAC9C,MAAMC,uBAAuBC,QAAQC,QAAQ,CAACC,IAAI;IAElD,MAAMC,YAAYH,QAAQI,MAAM;IAChC,MAAMC,WAAW,MAAMC,IAAAA,iBAAY,EAACnB,2BAAAA,uBAAAA,OAAQoB,YAAY,qBAApBpB,qBAAsBqB,aAAa;IACvE,MAAMC,MAAM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AAI,CAAC,EAAE,GAAG;YAC9BE,mBAAmB7D;YACnByD;QACF;IACF,EAAE,OAAOK,KAAK;QACZ,MAAM/E,QAAQ2E,QAAQ;QACtB,MAAMI;IACR;AACF;AAEA,IAAIL;AACG,eAAe1G,WAAWgH,UAEhC;IACC,0EAA0E;IAC1EC,OAAOC,MAAM,CAAC9G,8BAAgB,EAAE4G,WAAWG,YAAY;IAEvD,iDAAiD;IACjD/G,8BAAgB,CAACH,MAAM,GAAG,MAAMmH,IAAAA,eAAU,EACxCC,iCAAsB,EACtBjH,8BAAgB,CAACD,GAAG,EACpB;QAAEmH,gBAAgBlH,8BAAgB,CAACkH,cAAc;IAAC;IAGpD,qCAAqC;IACrC,6HAA6H;IAC7H,kDAAkD;IAClD,IAAIC,IAAAA,6BAAqB,EAACnH,8BAAgB,CAACH,MAAM,GAAG;QAClDG,8BAAgB,CAACH,MAAM,CAACK,OAAO,GAAG;IACpC;IAEA,iCAAiC;IACjC,MAAMkH,YAAY,IAAIC,kBAAS,CAAC;QAC9BnH,SAASF,8BAAgB,CAACH,MAAM,CAACK,OAAO;IAC1C;IACAoH,IAAAA,gBAAS,EAAC,aAAaF;IAEvB,MAAMG,SAAS,MAAM7H;IACrB4G,kBAAkBiB,OAAOjB,eAAe;IACxC,OAAOiB;AACT;AAEO,eAAe5H;IACpB,IAAI2G,iBAAiB;QACnB,MAAMA;IACR;AACF","ignoreList":[0]}
|
@@ -71,8 +71,8 @@ function createEdgeRuntimeManifest(originAssetMap) {
|
|
71
71
|
// edge lowPriorityFiles item: '"/static/" + process.env.__NEXT_BUILD_ID + "/low-priority.js"'.
|
72
72
|
// Since lowPriorityFiles is not fixed and relying on `process.env.__NEXT_BUILD_ID`, we'll produce code creating it dynamically.
|
73
73
|
const lowPriorityFilesCode = `globalThis.__BUILD_MANIFEST.lowPriorityFiles = [\n` + manifestFilenames.map((filename)=>{
|
74
|
-
return `"/static/" + process.env.__NEXT_BUILD_ID + "/${filename}"
|
75
|
-
}).join('
|
74
|
+
return `"/static/" + process.env.__NEXT_BUILD_ID + "/${filename}"`;
|
75
|
+
}).join(',\n') + `\n];`;
|
76
76
|
return manifestDefCode + lowPriorityFilesCode;
|
77
77
|
}
|
78
78
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/build/webpack/plugins/build-manifest-plugin-utils.ts"],"sourcesContent":["import type { CustomRoutes, Rewrite } from '../../../lib/load-custom-routes'\nimport type { BuildManifest } from '../../../server/get-page-files'\n\nexport type ClientBuildManifest = {\n [key: string]: string[]\n}\n\n// Add the runtime ssg manifest file as a lazy-loaded file dependency.\n// We also stub this file out for development mode (when it is not\n// generated).\nexport const srcEmptySsgManifest = `self.__SSG_MANIFEST=new Set;self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB()`\n\nfunction normalizeRewrite(item: {\n source: string\n destination: string\n has?: any\n}): CustomRoutes['rewrites']['beforeFiles'][0] {\n return {\n has: item.has,\n source: item.source,\n destination: item.destination,\n }\n}\n\nexport const processRoute = (r: Rewrite) => {\n const rewrite = { ...r }\n\n // omit external rewrite destinations since these aren't\n // handled client-side\n if (!rewrite?.destination?.startsWith('/')) {\n delete (rewrite as any).destination\n }\n return rewrite\n}\n\nexport function normalizeRewritesForBuildManifest(\n rewrites: CustomRoutes['rewrites']\n): CustomRoutes['rewrites'] {\n return {\n afterFiles: rewrites.afterFiles\n ?.map(processRoute)\n ?.map((item) => normalizeRewrite(item)),\n beforeFiles: rewrites.beforeFiles\n ?.map(processRoute)\n ?.map((item) => normalizeRewrite(item)),\n fallback: rewrites.fallback\n ?.map(processRoute)\n ?.map((item) => normalizeRewrite(item)),\n }\n}\n\nexport function createEdgeRuntimeManifest(\n originAssetMap: Partial<BuildManifest>\n): string {\n const manifestFilenames = ['_buildManifest.js', '_ssgManifest.js']\n\n const assetMap: Partial<BuildManifest> = {\n ...originAssetMap,\n lowPriorityFiles: [],\n }\n\n // we use globalThis here because middleware can be node\n // which doesn't have \"self\"\n const manifestDefCode = `globalThis.__BUILD_MANIFEST = ${JSON.stringify(\n assetMap,\n null,\n 2\n )};\\n`\n // edge lowPriorityFiles item: '\"/static/\" + process.env.__NEXT_BUILD_ID + \"/low-priority.js\"'.\n // Since lowPriorityFiles is not fixed and relying on `process.env.__NEXT_BUILD_ID`, we'll produce code creating it dynamically.\n const lowPriorityFilesCode =\n `globalThis.__BUILD_MANIFEST.lowPriorityFiles = [\\n` +\n manifestFilenames\n .map((filename) => {\n return `\"/static/\" + process.env.__NEXT_BUILD_ID + \"/${filename}\"
|
1
|
+
{"version":3,"sources":["../../../../src/build/webpack/plugins/build-manifest-plugin-utils.ts"],"sourcesContent":["import type { CustomRoutes, Rewrite } from '../../../lib/load-custom-routes'\nimport type { BuildManifest } from '../../../server/get-page-files'\n\nexport type ClientBuildManifest = {\n [key: string]: string[]\n}\n\n// Add the runtime ssg manifest file as a lazy-loaded file dependency.\n// We also stub this file out for development mode (when it is not\n// generated).\nexport const srcEmptySsgManifest = `self.__SSG_MANIFEST=new Set;self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB()`\n\nfunction normalizeRewrite(item: {\n source: string\n destination: string\n has?: any\n}): CustomRoutes['rewrites']['beforeFiles'][0] {\n return {\n has: item.has,\n source: item.source,\n destination: item.destination,\n }\n}\n\nexport const processRoute = (r: Rewrite) => {\n const rewrite = { ...r }\n\n // omit external rewrite destinations since these aren't\n // handled client-side\n if (!rewrite?.destination?.startsWith('/')) {\n delete (rewrite as any).destination\n }\n return rewrite\n}\n\nexport function normalizeRewritesForBuildManifest(\n rewrites: CustomRoutes['rewrites']\n): CustomRoutes['rewrites'] {\n return {\n afterFiles: rewrites.afterFiles\n ?.map(processRoute)\n ?.map((item) => normalizeRewrite(item)),\n beforeFiles: rewrites.beforeFiles\n ?.map(processRoute)\n ?.map((item) => normalizeRewrite(item)),\n fallback: rewrites.fallback\n ?.map(processRoute)\n ?.map((item) => normalizeRewrite(item)),\n }\n}\n\nexport function createEdgeRuntimeManifest(\n originAssetMap: Partial<BuildManifest>\n): string {\n const manifestFilenames = ['_buildManifest.js', '_ssgManifest.js']\n\n const assetMap: Partial<BuildManifest> = {\n ...originAssetMap,\n lowPriorityFiles: [],\n }\n\n // we use globalThis here because middleware can be node\n // which doesn't have \"self\"\n const manifestDefCode = `globalThis.__BUILD_MANIFEST = ${JSON.stringify(\n assetMap,\n null,\n 2\n )};\\n`\n // edge lowPriorityFiles item: '\"/static/\" + process.env.__NEXT_BUILD_ID + \"/low-priority.js\"'.\n // Since lowPriorityFiles is not fixed and relying on `process.env.__NEXT_BUILD_ID`, we'll produce code creating it dynamically.\n const lowPriorityFilesCode =\n `globalThis.__BUILD_MANIFEST.lowPriorityFiles = [\\n` +\n manifestFilenames\n .map((filename) => {\n return `\"/static/\" + process.env.__NEXT_BUILD_ID + \"/${filename}\"`\n })\n .join(',\\n') +\n `\\n];`\n\n return manifestDefCode + lowPriorityFilesCode\n}\n"],"names":["createEdgeRuntimeManifest","normalizeRewritesForBuildManifest","processRoute","srcEmptySsgManifest","normalizeRewrite","item","has","source","destination","r","rewrite","startsWith","rewrites","afterFiles","map","beforeFiles","fallback","originAssetMap","manifestFilenames","assetMap","lowPriorityFiles","manifestDefCode","JSON","stringify","lowPriorityFilesCode","filename","join"],"mappings":";;;;;;;;;;;;;;;;;IAmDgBA,yBAAyB;eAAzBA;;IAhBAC,iCAAiC;eAAjCA;;IAXHC,YAAY;eAAZA;;IAdAC,mBAAmB;eAAnBA;;;AAAN,MAAMA,sBAAsB,CAAC,4EAA4E,CAAC;AAEjH,SAASC,iBAAiBC,IAIzB;IACC,OAAO;QACLC,KAAKD,KAAKC,GAAG;QACbC,QAAQF,KAAKE,MAAM;QACnBC,aAAaH,KAAKG,WAAW;IAC/B;AACF;AAEO,MAAMN,eAAe,CAACO;QAKtBC;IAJL,MAAMA,UAAU;QAAE,GAAGD,CAAC;IAAC;IAEvB,wDAAwD;IACxD,sBAAsB;IACtB,IAAI,EAACC,4BAAAA,uBAAAA,QAASF,WAAW,qBAApBE,qBAAsBC,UAAU,CAAC,OAAM;QAC1C,OAAO,AAACD,QAAgBF,WAAW;IACrC;IACA,OAAOE;AACT;AAEO,SAAST,kCACdW,QAAkC;QAGpBA,0BAAAA,sBAGCA,2BAAAA,uBAGHA,wBAAAA;IAPZ,OAAO;QACLC,UAAU,GAAED,uBAAAA,SAASC,UAAU,sBAAnBD,2BAAAA,qBACRE,GAAG,CAACZ,kCADIU,yBAERE,GAAG,CAAC,CAACT,OAASD,iBAAiBC;QACnCU,WAAW,GAAEH,wBAAAA,SAASG,WAAW,sBAApBH,4BAAAA,sBACTE,GAAG,CAACZ,kCADKU,0BAETE,GAAG,CAAC,CAACT,OAASD,iBAAiBC;QACnCW,QAAQ,GAAEJ,qBAAAA,SAASI,QAAQ,sBAAjBJ,yBAAAA,mBACNE,GAAG,CAACZ,kCADEU,uBAENE,GAAG,CAAC,CAACT,OAASD,iBAAiBC;IACrC;AACF;AAEO,SAASL,0BACdiB,cAAsC;IAEtC,MAAMC,oBAAoB;QAAC;QAAqB;KAAkB;IAElE,MAAMC,WAAmC;QACvC,GAAGF,cAAc;QACjBG,kBAAkB,EAAE;IACtB;IAEA,wDAAwD;IACxD,4BAA4B;IAC5B,MAAMC,kBAAkB,CAAC,8BAA8B,EAAEC,KAAKC,SAAS,CACrEJ,UACA,MACA,GACA,GAAG,CAAC;IACN,+FAA+F;IAC/F,gIAAgI;IAChI,MAAMK,uBACJ,CAAC,kDAAkD,CAAC,GACpDN,kBACGJ,GAAG,CAAC,CAACW;QACJ,OAAO,CAAC,6CAA6C,EAAEA,SAAS,CAAC,CAAC;IACpE,GACCC,IAAI,CAAC,SACR,CAAC,IAAI,CAAC;IAER,OAAOL,kBAAkBG;AAC3B","ignoreList":[0]}
|
@@ -1706,7 +1706,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
1706
1706
|
isClient && new _copyfileplugin.CopyFilePlugin({
|
1707
1707
|
// file path to build output of `@next/polyfill-nomodule`
|
1708
1708
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
1709
|
-
cacheKey: "15.6.0-canary.
|
1709
|
+
cacheKey: "15.6.0-canary.27",
|
1710
1710
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
1711
1711
|
minimize: false,
|
1712
1712
|
info: {
|
@@ -1889,7 +1889,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
1889
1889
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
1890
1890
|
// - Next.js version
|
1891
1891
|
// - next.config.js keys that affect compilation
|
1892
|
-
version: `${__dirname}|${"15.6.0-canary.
|
1892
|
+
version: `${__dirname}|${"15.6.0-canary.27"}|${configVars}`,
|
1893
1893
|
cacheDirectory: _path.default.join(distDir, 'cache', 'webpack'),
|
1894
1894
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
1895
1895
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "appBootstrap", {
|
|
15
15
|
});
|
16
16
|
const _assetprefix = require("./asset-prefix");
|
17
17
|
const _setattributesfromprops = require("./set-attributes-from-props");
|
18
|
-
const version = "15.6.0-canary.
|
18
|
+
const version = "15.6.0-canary.27";
|
19
19
|
window.next = {
|
20
20
|
version,
|
21
21
|
appDir: true
|
package/dist/client/index.js
CHANGED
@@ -61,7 +61,7 @@ const _hooksclientcontextsharedruntime = require("../shared/lib/hooks-client-con
|
|
61
61
|
const _onrecoverableerror = require("./react-client-callbacks/on-recoverable-error");
|
62
62
|
const _tracer = /*#__PURE__*/ _interop_require_default._(require("./tracing/tracer"));
|
63
63
|
const _isnextroutererror = require("./components/is-next-router-error");
|
64
|
-
const version = "15.6.0-canary.
|
64
|
+
const version = "15.6.0-canary.27";
|
65
65
|
let router;
|
66
66
|
const emitter = (0, _mitt.default)();
|
67
67
|
const looseToArray = (input)=>[].slice.call(input);
|