next 15.6.0-canary.37 → 15.6.0-canary.38
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 +3 -3
- package/dist/bin/next.map +1 -1
- package/dist/build/index.d.ts +1 -2
- package/dist/build/index.js +25 -35
- package/dist/build/index.js.map +1 -1
- package/dist/build/swc/index.js +1 -1
- package/dist/build/webpack-config.js +2 -2
- package/dist/cli/next-build.d.ts +0 -1
- package/dist/cli/next-build.js +5 -3
- package/dist/cli/next-build.js.map +1 -1
- package/dist/cli/next-dev.d.ts +0 -1
- package/dist/cli/next-dev.js +13 -13
- package/dist/cli/next-dev.js.map +1 -1
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/index.js +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.runtime.dev.js +1 -1
- package/dist/compiled/next-server/pages.runtime.dev.js.map +1 -1
- package/dist/esm/build/index.js +25 -35
- package/dist/esm/build/index.js.map +1 -1
- package/dist/esm/build/swc/index.js +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/lib/turbopack-warning.js +7 -19
- package/dist/esm/lib/turbopack-warning.js.map +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/server/next.js +1 -2
- package/dist/esm/server/next.js.map +1 -1
- package/dist/esm/shared/lib/canary-only.js +1 -1
- package/dist/lib/turbopack-warning.d.ts +2 -3
- package/dist/lib/turbopack-warning.js +6 -18
- package/dist/lib/turbopack-warning.js.map +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/server/next.js +1 -2
- package/dist/server/next.js.map +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/esm/lib/bundler.js +0 -81
- package/dist/esm/lib/bundler.js.map +0 -1
- package/dist/lib/bundler.d.ts +0 -25
- package/dist/lib/bundler.js +0 -95
- package/dist/lib/bundler.js.map +0 -1
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.38";
|
134
134
|
const ArchName = (0, _os.arch)();
|
135
135
|
const PlatformName = (0, _os.platform)();
|
136
136
|
function infoLog(...args) {
|
@@ -1702,7 +1702,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
1702
1702
|
isClient && new _copyfileplugin.CopyFilePlugin({
|
1703
1703
|
// file path to build output of `@next/polyfill-nomodule`
|
1704
1704
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
1705
|
-
cacheKey: "15.6.0-canary.
|
1705
|
+
cacheKey: "15.6.0-canary.38",
|
1706
1706
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
1707
1707
|
minimize: false,
|
1708
1708
|
info: {
|
@@ -1885,7 +1885,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
1885
1885
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
1886
1886
|
// - Next.js version
|
1887
1887
|
// - next.config.js keys that affect compilation
|
1888
|
-
version: `${__dirname}|${"15.6.0-canary.
|
1888
|
+
version: `${__dirname}|${"15.6.0-canary.38"}|${configVars}`,
|
1889
1889
|
cacheDirectory: _path.default.join(distDir, 'cache', 'webpack'),
|
1890
1890
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
1891
1891
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|
package/dist/cli/next-build.d.ts
CHANGED
package/dist/cli/next-build.js
CHANGED
@@ -19,7 +19,6 @@ const _iserror = /*#__PURE__*/ _interop_require_default(require("../lib/is-error
|
|
19
19
|
const _getprojectdir = require("../lib/get-project-dir");
|
20
20
|
const _startup = require("../lib/memory/startup");
|
21
21
|
const _shutdown = require("../lib/memory/shutdown");
|
22
|
-
const _bundler = require("../lib/bundler");
|
23
22
|
function _interop_require_default(obj) {
|
24
23
|
return obj && obj.__esModule ? obj : {
|
25
24
|
default: obj
|
@@ -53,8 +52,11 @@ const nextBuild = (options, directory)=>{
|
|
53
52
|
if (!(0, _fs.existsSync)(dir)) {
|
54
53
|
(0, _utils.printAndExit)(`> No such directory exists as the project root: ${dir}`);
|
55
54
|
}
|
56
|
-
const
|
57
|
-
|
55
|
+
const isTurbopack = Boolean(options.turbo || options.turbopack || process.env.IS_TURBOPACK_TEST);
|
56
|
+
if (isTurbopack) {
|
57
|
+
process.env.TURBOPACK = '1';
|
58
|
+
}
|
59
|
+
return (0, _build.default)(dir, profile, debug || Boolean(process.env.NEXT_DEBUG_BUILD), debugPrerender, lint, !mangling, experimentalAppOnly, isTurbopack, experimentalBuildMode, traceUploadUrl).catch((err)=>{
|
58
60
|
if (experimentalDebugMemoryUsage) {
|
59
61
|
(0, _shutdown.disableMemoryDebuggingMode)();
|
60
62
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/cli/next-build.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport '../server/lib/cpu-profile'\nimport { existsSync } from 'fs'\nimport { italic } from '../lib/picocolors'\nimport build from '../build'\nimport { warn } from '../build/output/log'\nimport { printAndExit } from '../server/lib/utils'\nimport isError from '../lib/is-error'\nimport { getProjectDir } from '../lib/get-project-dir'\nimport { enableMemoryDebuggingMode } from '../lib/memory/startup'\nimport { disableMemoryDebuggingMode } from '../lib/memory/shutdown'\
|
1
|
+
{"version":3,"sources":["../../src/cli/next-build.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport '../server/lib/cpu-profile'\nimport { existsSync } from 'fs'\nimport { italic } from '../lib/picocolors'\nimport build from '../build'\nimport { warn } from '../build/output/log'\nimport { printAndExit } from '../server/lib/utils'\nimport isError from '../lib/is-error'\nimport { getProjectDir } from '../lib/get-project-dir'\nimport { enableMemoryDebuggingMode } from '../lib/memory/startup'\nimport { disableMemoryDebuggingMode } from '../lib/memory/shutdown'\n\nexport type NextBuildOptions = {\n debug?: boolean\n debugPrerender?: boolean\n profile?: boolean\n lint: boolean\n mangling: boolean\n turbo?: boolean\n turbopack?: boolean\n experimentalDebugMemoryUsage: boolean\n experimentalAppOnly?: boolean\n experimentalTurbo?: boolean\n experimentalBuildMode: 'default' | 'compile' | 'generate' | 'generate-env'\n experimentalUploadTrace?: string\n}\n\nconst nextBuild = (options: NextBuildOptions, directory?: string) => {\n process.on('SIGTERM', () => process.exit(143))\n process.on('SIGINT', () => process.exit(130))\n\n const {\n debug,\n debugPrerender,\n experimentalDebugMemoryUsage,\n profile,\n lint,\n mangling,\n experimentalAppOnly,\n experimentalBuildMode,\n experimentalUploadTrace,\n } = options\n\n let traceUploadUrl: string | undefined\n if (experimentalUploadTrace && !process.env.NEXT_TRACE_UPLOAD_DISABLED) {\n traceUploadUrl = experimentalUploadTrace\n }\n\n if (!lint) {\n warn('Linting is disabled.')\n }\n\n if (!mangling) {\n warn(\n `Mangling is disabled. ${italic('Note: This may affect performance and should only be used for debugging purposes.')}`\n )\n }\n\n if (profile) {\n warn(\n `Profiling is enabled. ${italic('Note: This may affect performance.')}`\n )\n }\n\n if (debugPrerender) {\n warn(\n `Prerendering is running in debug mode. ${italic(\n 'Note: This may affect performance and should not be used for production.'\n )}`\n )\n }\n\n if (experimentalDebugMemoryUsage) {\n process.env.EXPERIMENTAL_DEBUG_MEMORY_USAGE = '1'\n enableMemoryDebuggingMode()\n }\n\n const dir = getProjectDir(directory)\n\n if (!existsSync(dir)) {\n printAndExit(`> No such directory exists as the project root: ${dir}`)\n }\n\n const isTurbopack = Boolean(\n options.turbo || options.turbopack || process.env.IS_TURBOPACK_TEST\n )\n if (isTurbopack) {\n process.env.TURBOPACK = '1'\n }\n\n return build(\n dir,\n profile,\n debug || Boolean(process.env.NEXT_DEBUG_BUILD),\n debugPrerender,\n lint,\n !mangling,\n experimentalAppOnly,\n isTurbopack,\n experimentalBuildMode,\n traceUploadUrl\n )\n .catch((err) => {\n if (experimentalDebugMemoryUsage) {\n disableMemoryDebuggingMode()\n }\n console.error('')\n if (\n isError(err) &&\n (err.code === 'INVALID_RESOLVE_ALIAS' ||\n err.code === 'WEBPACK_ERRORS' ||\n err.code === 'BUILD_OPTIMIZATION_FAILED' ||\n err.code === 'NEXT_EXPORT_ERROR' ||\n err.code === 'NEXT_STATIC_GEN_BAILOUT' ||\n err.code === 'EDGE_RUNTIME_UNSUPPORTED_API')\n ) {\n printAndExit(`> ${err.message}`)\n } else {\n console.error('> Build error occurred')\n printAndExit(err)\n }\n })\n .finally(() => {\n if (experimentalDebugMemoryUsage) {\n disableMemoryDebuggingMode()\n }\n })\n}\n\nexport { nextBuild }\n"],"names":["nextBuild","options","directory","process","on","exit","debug","debugPrerender","experimentalDebugMemoryUsage","profile","lint","mangling","experimentalAppOnly","experimentalBuildMode","experimentalUploadTrace","traceUploadUrl","env","NEXT_TRACE_UPLOAD_DISABLED","warn","italic","EXPERIMENTAL_DEBUG_MEMORY_USAGE","enableMemoryDebuggingMode","dir","getProjectDir","existsSync","printAndExit","isTurbopack","Boolean","turbo","turbopack","IS_TURBOPACK_TEST","TURBOPACK","build","NEXT_DEBUG_BUILD","catch","err","disableMemoryDebuggingMode","console","error","isError","code","message","finally"],"mappings":";;;;;+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B,QAAQa,GAAG,CAACe,SAAS,GAAG;IAC1B;IAEA,OAAOC,IAAAA,cAAK,EACVV,KACAb,SACAH,SAASqB,QAAQxB,QAAQa,GAAG,CAACiB,gBAAgB,GAC7C1B,gBACAG,MACA,CAACC,UACDC,qBACAc,aACAb,uBACAE,gBAECmB,KAAK,CAAC,CAACC;QACN,IAAI3B,8BAA8B;YAChC4B,IAAAA,oCAA0B;QAC5B;QACAC,QAAQC,KAAK,CAAC;QACd,IACEC,IAAAA,gBAAO,EAACJ,QACPA,CAAAA,IAAIK,IAAI,KAAK,2BACZL,IAAIK,IAAI,KAAK,oBACbL,IAAIK,IAAI,KAAK,+BACbL,IAAIK,IAAI,KAAK,uBACbL,IAAIK,IAAI,KAAK,6BACbL,IAAIK,IAAI,KAAK,8BAA6B,GAC5C;YACAf,IAAAA,mBAAY,EAAC,CAAC,EAAE,EAAEU,IAAIM,OAAO,EAAE;QACjC,OAAO;YACLJ,QAAQC,KAAK,CAAC;YACdb,IAAAA,mBAAY,EAACU;QACf;IACF,GACCO,OAAO,CAAC;QACP,IAAIlC,8BAA8B;YAChC4B,IAAAA,oCAA0B;QAC5B;IACF;AACJ","ignoreList":[0]}
|
package/dist/cli/next-dev.d.ts
CHANGED
package/dist/cli/next-dev.js
CHANGED
@@ -30,7 +30,6 @@ const _os = /*#__PURE__*/ _interop_require_default(require("os"));
|
|
30
30
|
const _nodeevents = require("node:events");
|
31
31
|
const _timers = require("timers");
|
32
32
|
const _trace = require("../trace");
|
33
|
-
const _bundler = require("../lib/bundler");
|
34
33
|
function _interop_require_default(obj) {
|
35
34
|
return obj && obj.__esModule ? obj : {
|
36
35
|
default: obj
|
@@ -81,11 +80,11 @@ let dir;
|
|
81
80
|
let child;
|
82
81
|
// The config in next-dev is only used to access config.distDir for telemetry and trace.
|
83
82
|
let config;
|
84
|
-
let
|
83
|
+
let isTurboSession = false;
|
85
84
|
let traceUploadUrl;
|
86
85
|
let sessionStopHandled = false;
|
87
|
-
|
88
|
-
|
86
|
+
let sessionStarted = Date.now();
|
87
|
+
let sessionSpan = (0, _trace.trace)('next-dev');
|
89
88
|
// How long should we wait for the child to cleanly exit after sending
|
90
89
|
// SIGINT/SIGTERM to the child process before sending SIGKILL?
|
91
90
|
const CHILD_EXIT_TIMEOUT_MS = parseInt(process.env.NEXT_EXIT_TIMEOUT_MS ?? '100', 10);
|
@@ -122,11 +121,9 @@ const handleSessionStop = async (signal)=>{
|
|
122
121
|
let telemetry = _shared.traceGlobals.get('telemetry') || new _storage.Telemetry({
|
123
122
|
distDir: _path.default.join(dir, config.distDir)
|
124
123
|
});
|
125
|
-
// Reading the config can modify environment variables that influence the bundler selection.
|
126
|
-
bundler = (0, _bundler.finalizeBundlerFromConfig)(bundler);
|
127
124
|
telemetry.record(eventCliSessionStopped({
|
128
125
|
cliCommand: 'dev',
|
129
|
-
turboFlag:
|
126
|
+
turboFlag: isTurboSession,
|
130
127
|
durationMilliseconds: Date.now() - sessionStarted,
|
131
128
|
pagesDir,
|
132
129
|
appDir
|
@@ -142,7 +139,7 @@ const handleSessionStop = async (signal)=>{
|
|
142
139
|
mode: 'dev',
|
143
140
|
projectDir: dir,
|
144
141
|
distDir: config.distDir,
|
145
|
-
isTurboSession
|
142
|
+
isTurboSession
|
146
143
|
});
|
147
144
|
}
|
148
145
|
// ensure we re-enable the terminal cursor before exiting
|
@@ -156,7 +153,11 @@ process.on('SIGTERM', ()=>handleSessionStop('SIGTERM'));
|
|
156
153
|
// exit event must be synchronous
|
157
154
|
process.on('exit', ()=>child == null ? void 0 : child.kill('SIGKILL'));
|
158
155
|
const nextDev = async (options, portSource, directory)=>{
|
159
|
-
|
156
|
+
const isTurbopack = Boolean(options.turbo || options.turbopack || process.env.IS_TURBOPACK_TEST);
|
157
|
+
if (isTurbopack) {
|
158
|
+
process.env.TURBOPACK = '1';
|
159
|
+
}
|
160
|
+
isTurboSession = isTurbopack;
|
160
161
|
dir = (0, _getprojectdir.getProjectDir)(process.env.NEXT_PRIVATE_DEV_DIR || directory);
|
161
162
|
// Check if pages dir exists and warn if not
|
162
163
|
if (!await (0, _fileexists.fileExists)(dir, _fileexists.FileType.Directory)) {
|
@@ -237,8 +238,8 @@ const nextDev = async (options, portSource, directory)=>{
|
|
237
238
|
stdio: 'inherit',
|
238
239
|
env: {
|
239
240
|
...defaultEnv,
|
240
|
-
...
|
241
|
-
TURBOPACK:
|
241
|
+
...isTurbopack ? {
|
242
|
+
TURBOPACK: '1'
|
242
243
|
} : undefined,
|
243
244
|
NEXT_PRIVATE_WORKER: '1',
|
244
245
|
NEXT_PRIVATE_TRACE_ID: _shared.traceId,
|
@@ -281,13 +282,12 @@ const nextDev = async (options, portSource, directory)=>{
|
|
281
282
|
config = config || await (0, _config.default)(_constants.PHASE_DEVELOPMENT_SERVER, dir, {
|
282
283
|
silent: true
|
283
284
|
});
|
284
|
-
bundler = (0, _bundler.finalizeBundlerFromConfig)(bundler);
|
285
285
|
(0, _uploadtrace.default)({
|
286
286
|
traceUploadUrl,
|
287
287
|
mode: 'dev',
|
288
288
|
projectDir: dir,
|
289
289
|
distDir: config.distDir,
|
290
|
-
isTurboSession
|
290
|
+
isTurboSession,
|
291
291
|
sync: true
|
292
292
|
});
|
293
293
|
}
|
package/dist/cli/next-dev.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/cli/next-dev.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport '../server/lib/cpu-profile'\nimport type { StartServerOptions } from '../server/lib/start-server'\nimport {\n RESTART_EXIT_CODE,\n getNodeDebugType,\n getParsedDebugAddress,\n getMaxOldSpaceSize,\n getParsedNodeOptionsWithoutInspect,\n printAndExit,\n formatNodeOptions,\n formatDebugAddress,\n} from '../server/lib/utils'\nimport * as Log from '../build/output/log'\nimport { getProjectDir } from '../lib/get-project-dir'\nimport { PHASE_DEVELOPMENT_SERVER } from '../shared/lib/constants'\nimport path from 'path'\nimport type { NextConfigComplete } from '../server/config-shared'\nimport { traceGlobals } from '../trace/shared'\nimport { Telemetry } from '../telemetry/storage'\nimport loadConfig from '../server/config'\nimport { findPagesDir } from '../lib/find-pages-dir'\nimport { fileExists, FileType } from '../lib/file-exists'\nimport { getNpxCommand } from '../lib/helpers/get-npx-command'\nimport { createSelfSignedCertificate } from '../lib/mkcert'\nimport type { SelfSignedCertificate } from '../lib/mkcert'\nimport uploadTrace from '../trace/upload-trace'\nimport { initialEnv } from '@next/env'\nimport { fork } from 'child_process'\nimport type { ChildProcess } from 'child_process'\nimport {\n getReservedPortExplanation,\n isPortIsReserved,\n} from '../lib/helpers/get-reserved-port'\nimport os from 'os'\nimport { once } from 'node:events'\nimport { clearTimeout } from 'timers'\nimport { flushAllTraces, trace } from '../trace'\nimport { traceId } from '../trace/shared'\nimport {\n Bundler,\n finalizeBundlerFromConfig,\n parseBundlerArgs,\n} from '../lib/bundler'\n\nexport type NextDevOptions = {\n disableSourceMaps: boolean\n turbo?: boolean\n turbopack?: boolean\n webpack?: boolean\n port: number\n hostname?: string\n experimentalHttps?: boolean\n experimentalHttpsKey?: string\n experimentalHttpsCert?: string\n experimentalHttpsCa?: string\n experimentalUploadTrace?: string\n}\n\ntype PortSource = 'cli' | 'default' | 'env'\n\nlet dir: string\nlet child: undefined | ChildProcess\n// The config in next-dev is only used to access config.distDir for telemetry and trace.\nlet config: NextConfigComplete\nlet bundler: Bundler\nlet traceUploadUrl: string\nlet sessionStopHandled = false\nconst sessionStarted = Date.now()\nconst sessionSpan = trace('next-dev')\n\n// How long should we wait for the child to cleanly exit after sending\n// SIGINT/SIGTERM to the child process before sending SIGKILL?\nconst CHILD_EXIT_TIMEOUT_MS = parseInt(\n process.env.NEXT_EXIT_TIMEOUT_MS ?? '100',\n 10\n)\n\nconst handleSessionStop = async (signal: NodeJS.Signals | number | null) => {\n if (signal != null && child?.pid) child.kill(signal)\n if (sessionStopHandled) return\n sessionStopHandled = true\n\n // Capture the child's exit code if it has already exited and caused the\n // session stop (via the 'exit' event), otherwise assume success (0).\n const exitCode = child?.exitCode || 0\n\n if (\n signal != null &&\n child?.pid &&\n child.exitCode === null &&\n child.signalCode === null\n ) {\n let exitTimeout = setTimeout(() => {\n child?.kill('SIGKILL')\n }, CHILD_EXIT_TIMEOUT_MS)\n await once(child, 'exit').catch(() => {})\n clearTimeout(exitTimeout)\n }\n\n sessionSpan.stop()\n await flushAllTraces({ end: true })\n\n try {\n const { eventCliSessionStopped } =\n require('../telemetry/events/session-stopped') as typeof import('../telemetry/events/session-stopped')\n\n let pagesDir: boolean = !!traceGlobals.get('pagesDir')\n let appDir: boolean = !!traceGlobals.get('appDir')\n\n if (\n typeof traceGlobals.get('pagesDir') === 'undefined' ||\n typeof traceGlobals.get('appDir') === 'undefined'\n ) {\n const pagesResult = findPagesDir(dir)\n appDir = !!pagesResult.appDir\n pagesDir = !!pagesResult.pagesDir\n }\n\n config =\n config ||\n (await loadConfig(PHASE_DEVELOPMENT_SERVER, dir, { silent: true }))\n\n let telemetry =\n (traceGlobals.get('telemetry') as InstanceType<\n typeof import('../telemetry/storage').Telemetry\n >) ||\n new Telemetry({\n distDir: path.join(dir, config.distDir),\n })\n // Reading the config can modify environment variables that influence the bundler selection.\n bundler = finalizeBundlerFromConfig(bundler)\n\n telemetry.record(\n eventCliSessionStopped({\n cliCommand: 'dev',\n turboFlag: bundler === Bundler.Turbopack,\n durationMilliseconds: Date.now() - sessionStarted,\n pagesDir,\n appDir,\n }),\n true\n )\n telemetry.flushDetached('dev', dir)\n } catch (_) {\n // errors here aren't actionable so don't add\n // noise to the output\n }\n\n if (traceUploadUrl) {\n uploadTrace({\n traceUploadUrl,\n mode: 'dev',\n projectDir: dir,\n distDir: config.distDir,\n isTurboSession: bundler === Bundler.Turbopack,\n })\n }\n\n // ensure we re-enable the terminal cursor before exiting\n // the program, or the cursor could remain hidden\n process.stdout.write('\\x1B[?25h')\n process.stdout.write('\\n')\n process.exit(exitCode)\n}\n\nprocess.on('SIGINT', () => handleSessionStop('SIGINT'))\nprocess.on('SIGTERM', () => handleSessionStop('SIGTERM'))\n\n// exit event must be synchronous\nprocess.on('exit', () => child?.kill('SIGKILL'))\n\nconst nextDev = async (\n options: NextDevOptions,\n portSource: PortSource,\n directory?: string\n) => {\n bundler = parseBundlerArgs(options)\n\n dir = getProjectDir(process.env.NEXT_PRIVATE_DEV_DIR || directory)\n\n // Check if pages dir exists and warn if not\n if (!(await fileExists(dir, FileType.Directory))) {\n printAndExit(`> No such directory exists as the project root: ${dir}`)\n }\n\n async function preflight(skipOnReboot: boolean) {\n const { getPackageVersion, getDependencies } = (await Promise.resolve(\n require('../lib/get-package-version') as typeof import('../lib/get-package-version')\n )) as typeof import('../lib/get-package-version')\n\n const [sassVersion, nodeSassVersion] = await Promise.all([\n getPackageVersion({ cwd: dir, name: 'sass' }),\n getPackageVersion({ cwd: dir, name: 'node-sass' }),\n ])\n if (sassVersion && nodeSassVersion) {\n Log.warn(\n 'Your project has both `sass` and `node-sass` installed as dependencies, but should only use one or the other. ' +\n 'Please remove the `node-sass` dependency from your project. ' +\n ' Read more: https://nextjs.org/docs/messages/duplicate-sass'\n )\n }\n\n if (!skipOnReboot) {\n const { dependencies, devDependencies } = await getDependencies({\n cwd: dir,\n })\n\n // Warn if @next/font is installed as a dependency. Ignore `workspace:*` to not warn in the Next.js monorepo.\n if (\n dependencies['@next/font'] ||\n (devDependencies['@next/font'] &&\n devDependencies['@next/font'] !== 'workspace:*')\n ) {\n const command = getNpxCommand(dir)\n Log.warn(\n 'Your project has `@next/font` installed as a dependency, please use the built-in `next/font` instead. ' +\n 'The `@next/font` package will be removed in Next.js 14. ' +\n `You can migrate by running \\`${command} @next/codemod@latest built-in-next-font .\\`. Read more: https://nextjs.org/docs/messages/built-in-next-font`\n )\n }\n }\n }\n\n let port = options.port\n\n if (isPortIsReserved(port)) {\n printAndExit(getReservedPortExplanation(port), 1)\n }\n\n // If neither --port nor PORT were specified, it's okay to retry new ports.\n const allowRetry = portSource === 'default'\n\n // We do not set a default host value here to prevent breaking\n // some set-ups that rely on listening on other interfaces\n const host = options.hostname\n\n if (\n options.experimentalUploadTrace &&\n !process.env.NEXT_TRACE_UPLOAD_DISABLED\n ) {\n traceUploadUrl = options.experimentalUploadTrace\n }\n\n const devServerOptions: StartServerOptions = {\n dir,\n port,\n allowRetry,\n isDev: true,\n hostname: host,\n }\n\n const startServerPath = require.resolve('../server/lib/start-server')\n\n async function startServer(startServerOptions: StartServerOptions) {\n return new Promise<void>((resolve) => {\n let resolved = false\n const defaultEnv = (initialEnv || process.env) as typeof process.env\n\n const nodeOptions = getParsedNodeOptionsWithoutInspect()\n const nodeDebugType = getNodeDebugType()\n\n let maxOldSpaceSize: string | number | undefined = getMaxOldSpaceSize()\n if (!maxOldSpaceSize && !process.env.NEXT_DISABLE_MEM_OVERRIDE) {\n const totalMem = os.totalmem()\n const totalMemInMB = Math.floor(totalMem / 1024 / 1024)\n maxOldSpaceSize = Math.floor(totalMemInMB * 0.5).toString()\n\n nodeOptions['max-old-space-size'] = maxOldSpaceSize\n\n // Ensure the max_old_space_size is not also set.\n delete nodeOptions['max_old_space_size']\n }\n\n if (options.disableSourceMaps) {\n delete nodeOptions['enable-source-maps']\n } else {\n nodeOptions['enable-source-maps'] = true\n }\n\n if (nodeDebugType) {\n const address = getParsedDebugAddress()\n address.port = address.port + 1\n nodeOptions[nodeDebugType] = formatDebugAddress(address)\n }\n\n child = fork(startServerPath, {\n stdio: 'inherit',\n env: {\n ...defaultEnv,\n ...(bundler === Bundler.Turbopack\n ? { TURBOPACK: process.env.TURBOPACK }\n : undefined),\n NEXT_PRIVATE_WORKER: '1',\n NEXT_PRIVATE_TRACE_ID: traceId,\n NODE_EXTRA_CA_CERTS: startServerOptions.selfSignedCertificate\n ? startServerOptions.selfSignedCertificate.rootCA\n : defaultEnv.NODE_EXTRA_CA_CERTS,\n NODE_OPTIONS: formatNodeOptions(nodeOptions),\n // There is a node.js bug on MacOS which causes closing file watchers to be really slow.\n // This limits the number of watchers to mitigate the issue.\n // https://github.com/nodejs/node/issues/29949\n WATCHPACK_WATCHER_LIMIT:\n os.platform() === 'darwin' ? '20' : undefined,\n },\n })\n\n child.on('message', (msg: any) => {\n if (msg && typeof msg === 'object') {\n if (msg.nextWorkerReady) {\n child?.send({ nextWorkerOptions: startServerOptions })\n } else if (msg.nextServerReady && !resolved) {\n if (msg.port) {\n // Store the used port in case a random one was selected, so that\n // it can be re-used on automatic dev server restarts.\n port = parseInt(msg.port, 10)\n }\n\n resolved = true\n resolve()\n }\n }\n })\n\n child.on('exit', async (code, signal) => {\n if (sessionStopHandled || signal) {\n return\n }\n if (code === RESTART_EXIT_CODE) {\n // Starting the dev server will overwrite the `.next/trace` file, so we\n // must upload the existing contents before restarting the server to\n // preserve the metrics.\n if (traceUploadUrl) {\n // Postpone loading next config when we need to get\n // config.distDir for upload trace.\n config =\n config ||\n (await loadConfig(PHASE_DEVELOPMENT_SERVER, dir, {\n silent: true,\n }))\n bundler = finalizeBundlerFromConfig(bundler)\n uploadTrace({\n traceUploadUrl,\n mode: 'dev',\n projectDir: dir,\n distDir: config.distDir,\n isTurboSession: bundler === Bundler.Turbopack,\n sync: true,\n })\n }\n\n return startServer({ ...startServerOptions, port })\n }\n // Call handler (e.g. upload telemetry). Don't try to send a signal to\n // the child, as it has already exited.\n await handleSessionStop(/* signal */ null)\n })\n })\n }\n\n const runDevServer = async (reboot: boolean) => {\n try {\n if (!!options.experimentalHttps) {\n Log.warn(\n 'Self-signed certificates are currently an experimental feature, use with caution.'\n )\n\n let certificate: SelfSignedCertificate | undefined\n\n const key = options.experimentalHttpsKey\n const cert = options.experimentalHttpsCert\n const rootCA = options.experimentalHttpsCa\n\n if (key && cert) {\n certificate = {\n key: path.resolve(key),\n cert: path.resolve(cert),\n rootCA: rootCA ? path.resolve(rootCA) : undefined,\n }\n } else {\n certificate = await createSelfSignedCertificate(host)\n }\n\n await startServer({\n ...devServerOptions,\n selfSignedCertificate: certificate,\n })\n } else {\n await startServer(devServerOptions)\n }\n\n await preflight(reboot)\n } catch (err) {\n console.error(err)\n process.exit(1)\n }\n }\n\n await runDevServer(false)\n}\n\nexport { nextDev }\n"],"names":["nextDev","dir","child","config","bundler","traceUploadUrl","sessionStopHandled","sessionStarted","Date","now","sessionSpan","trace","CHILD_EXIT_TIMEOUT_MS","parseInt","process","env","NEXT_EXIT_TIMEOUT_MS","handleSessionStop","signal","pid","kill","exitCode","signalCode","exitTimeout","setTimeout","once","catch","clearTimeout","stop","flushAllTraces","end","eventCliSessionStopped","require","pagesDir","traceGlobals","get","appDir","pagesResult","findPagesDir","loadConfig","PHASE_DEVELOPMENT_SERVER","silent","telemetry","Telemetry","distDir","path","join","finalizeBundlerFromConfig","record","cliCommand","turboFlag","Bundler","Turbopack","durationMilliseconds","flushDetached","_","uploadTrace","mode","projectDir","isTurboSession","stdout","write","exit","on","options","portSource","directory","parseBundlerArgs","getProjectDir","NEXT_PRIVATE_DEV_DIR","fileExists","FileType","Directory","printAndExit","preflight","skipOnReboot","getPackageVersion","getDependencies","Promise","resolve","sassVersion","nodeSassVersion","all","cwd","name","Log","warn","dependencies","devDependencies","command","getNpxCommand","port","isPortIsReserved","getReservedPortExplanation","allowRetry","host","hostname","experimentalUploadTrace","NEXT_TRACE_UPLOAD_DISABLED","devServerOptions","isDev","startServerPath","startServer","startServerOptions","resolved","defaultEnv","initialEnv","nodeOptions","getParsedNodeOptionsWithoutInspect","nodeDebugType","getNodeDebugType","maxOldSpaceSize","getMaxOldSpaceSize","NEXT_DISABLE_MEM_OVERRIDE","totalMem","os","totalmem","totalMemInMB","Math","floor","toString","disableSourceMaps","address","getParsedDebugAddress","formatDebugAddress","fork","stdio","TURBOPACK","undefined","NEXT_PRIVATE_WORKER","NEXT_PRIVATE_TRACE_ID","traceId","NODE_EXTRA_CA_CERTS","selfSignedCertificate","rootCA","NODE_OPTIONS","formatNodeOptions","WATCHPACK_WATCHER_LIMIT","platform","msg","nextWorkerReady","send","nextWorkerOptions","nextServerReady","code","RESTART_EXIT_CODE","sync","runDevServer","reboot","experimentalHttps","certificate","key","experimentalHttpsKey","cert","experimentalHttpsCert","experimentalHttpsCa","createSelfSignedCertificate","err","console","error"],"mappings":";;;;;+BAkZSA;;;eAAAA;;;QAhZF;uBAWA;6DACc;+BACS;2BACW;6DACxB;wBAEY;yBACH;+DACH;8BACM;4BACQ;+BACP;wBACc;oEAEpB;qBACG;+BACN;iCAKd;2DACQ;4BACM;wBACQ;uBACS;yBAM/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBP,IAAIC;AACJ,IAAIC;AACJ,wFAAwF;AACxF,IAAIC;AACJ,IAAIC;AACJ,IAAIC;AACJ,IAAIC,qBAAqB;AACzB,MAAMC,iBAAiBC,KAAKC,GAAG;AAC/B,MAAMC,cAAcC,IAAAA,YAAK,EAAC;AAE1B,sEAAsE;AACtE,8DAA8D;AAC9D,MAAMC,wBAAwBC,SAC5BC,QAAQC,GAAG,CAACC,oBAAoB,IAAI,OACpC;AAGF,MAAMC,oBAAoB,OAAOC;IAC/B,IAAIA,UAAU,SAAQhB,yBAAAA,MAAOiB,GAAG,GAAEjB,MAAMkB,IAAI,CAACF;IAC7C,IAAIZ,oBAAoB;IACxBA,qBAAqB;IAErB,wEAAwE;IACxE,qEAAqE;IACrE,MAAMe,WAAWnB,CAAAA,yBAAAA,MAAOmB,QAAQ,KAAI;IAEpC,IACEH,UAAU,SACVhB,yBAAAA,MAAOiB,GAAG,KACVjB,MAAMmB,QAAQ,KAAK,QACnBnB,MAAMoB,UAAU,KAAK,MACrB;QACA,IAAIC,cAAcC,WAAW;YAC3BtB,yBAAAA,MAAOkB,IAAI,CAAC;QACd,GAAGR;QACH,MAAMa,IAAAA,gBAAI,EAACvB,OAAO,QAAQwB,KAAK,CAAC,KAAO;QACvCC,IAAAA,oBAAY,EAACJ;IACf;IAEAb,YAAYkB,IAAI;IAChB,MAAMC,IAAAA,qBAAc,EAAC;QAAEC,KAAK;IAAK;IAEjC,IAAI;QACF,MAAM,EAAEC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AQC,KAAK,CAACF;YACd/I,QAAQgD,IAAI,CAAC;QACf;IACF;IAEA,MAAMqF,aAAa;AACrB","ignoreList":[0]}
|
1
|
+
{"version":3,"sources":["../../src/cli/next-dev.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport '../server/lib/cpu-profile'\nimport type { StartServerOptions } from '../server/lib/start-server'\nimport {\n RESTART_EXIT_CODE,\n getNodeDebugType,\n getParsedDebugAddress,\n getMaxOldSpaceSize,\n getParsedNodeOptionsWithoutInspect,\n printAndExit,\n formatNodeOptions,\n formatDebugAddress,\n} from '../server/lib/utils'\nimport * as Log from '../build/output/log'\nimport { getProjectDir } from '../lib/get-project-dir'\nimport { PHASE_DEVELOPMENT_SERVER } from '../shared/lib/constants'\nimport path from 'path'\nimport type { NextConfigComplete } from '../server/config-shared'\nimport { traceGlobals } from '../trace/shared'\nimport { Telemetry } from '../telemetry/storage'\nimport loadConfig from '../server/config'\nimport { findPagesDir } from '../lib/find-pages-dir'\nimport { fileExists, FileType } from '../lib/file-exists'\nimport { getNpxCommand } from '../lib/helpers/get-npx-command'\nimport { createSelfSignedCertificate } from '../lib/mkcert'\nimport type { SelfSignedCertificate } from '../lib/mkcert'\nimport uploadTrace from '../trace/upload-trace'\nimport { initialEnv } from '@next/env'\nimport { fork } from 'child_process'\nimport type { ChildProcess } from 'child_process'\nimport {\n getReservedPortExplanation,\n isPortIsReserved,\n} from '../lib/helpers/get-reserved-port'\nimport os from 'os'\nimport { once } from 'node:events'\nimport { clearTimeout } from 'timers'\nimport { flushAllTraces, trace } from '../trace'\nimport { traceId } from '../trace/shared'\n\nexport type NextDevOptions = {\n disableSourceMaps: boolean\n turbo?: boolean\n turbopack?: boolean\n port: number\n hostname?: string\n experimentalHttps?: boolean\n experimentalHttpsKey?: string\n experimentalHttpsCert?: string\n experimentalHttpsCa?: string\n experimentalUploadTrace?: string\n}\n\ntype PortSource = 'cli' | 'default' | 'env'\n\nlet dir: string\nlet child: undefined | ChildProcess\n// The config in next-dev is only used to access config.distDir for telemetry and trace.\nlet config: NextConfigComplete\nlet isTurboSession = false\nlet traceUploadUrl: string\nlet sessionStopHandled = false\nlet sessionStarted = Date.now()\nlet sessionSpan = trace('next-dev')\n\n// How long should we wait for the child to cleanly exit after sending\n// SIGINT/SIGTERM to the child process before sending SIGKILL?\nconst CHILD_EXIT_TIMEOUT_MS = parseInt(\n process.env.NEXT_EXIT_TIMEOUT_MS ?? '100',\n 10\n)\n\nconst handleSessionStop = async (signal: NodeJS.Signals | number | null) => {\n if (signal != null && child?.pid) child.kill(signal)\n if (sessionStopHandled) return\n sessionStopHandled = true\n\n // Capture the child's exit code if it has already exited and caused the\n // session stop (via the 'exit' event), otherwise assume success (0).\n const exitCode = child?.exitCode || 0\n\n if (\n signal != null &&\n child?.pid &&\n child.exitCode === null &&\n child.signalCode === null\n ) {\n let exitTimeout = setTimeout(() => {\n child?.kill('SIGKILL')\n }, CHILD_EXIT_TIMEOUT_MS)\n await once(child, 'exit').catch(() => {})\n clearTimeout(exitTimeout)\n }\n\n sessionSpan.stop()\n await flushAllTraces({ end: true })\n\n try {\n const { eventCliSessionStopped } =\n require('../telemetry/events/session-stopped') as typeof import('../telemetry/events/session-stopped')\n\n let pagesDir: boolean = !!traceGlobals.get('pagesDir')\n let appDir: boolean = !!traceGlobals.get('appDir')\n\n if (\n typeof traceGlobals.get('pagesDir') === 'undefined' ||\n typeof traceGlobals.get('appDir') === 'undefined'\n ) {\n const pagesResult = findPagesDir(dir)\n appDir = !!pagesResult.appDir\n pagesDir = !!pagesResult.pagesDir\n }\n\n config =\n config ||\n (await loadConfig(PHASE_DEVELOPMENT_SERVER, dir, { silent: true }))\n\n let telemetry =\n (traceGlobals.get('telemetry') as InstanceType<\n typeof import('../telemetry/storage').Telemetry\n >) ||\n new Telemetry({\n distDir: path.join(dir, config.distDir),\n })\n\n telemetry.record(\n eventCliSessionStopped({\n cliCommand: 'dev',\n turboFlag: isTurboSession,\n durationMilliseconds: Date.now() - sessionStarted,\n pagesDir,\n appDir,\n }),\n true\n )\n telemetry.flushDetached('dev', dir)\n } catch (_) {\n // errors here aren't actionable so don't add\n // noise to the output\n }\n\n if (traceUploadUrl) {\n uploadTrace({\n traceUploadUrl,\n mode: 'dev',\n projectDir: dir,\n distDir: config.distDir,\n isTurboSession,\n })\n }\n\n // ensure we re-enable the terminal cursor before exiting\n // the program, or the cursor could remain hidden\n process.stdout.write('\\x1B[?25h')\n process.stdout.write('\\n')\n process.exit(exitCode)\n}\n\nprocess.on('SIGINT', () => handleSessionStop('SIGINT'))\nprocess.on('SIGTERM', () => handleSessionStop('SIGTERM'))\n\n// exit event must be synchronous\nprocess.on('exit', () => child?.kill('SIGKILL'))\n\nconst nextDev = async (\n options: NextDevOptions,\n portSource: PortSource,\n directory?: string\n) => {\n const isTurbopack = Boolean(\n options.turbo || options.turbopack || process.env.IS_TURBOPACK_TEST\n )\n if (isTurbopack) {\n process.env.TURBOPACK = '1'\n }\n\n isTurboSession = isTurbopack\n\n dir = getProjectDir(process.env.NEXT_PRIVATE_DEV_DIR || directory)\n\n // Check if pages dir exists and warn if not\n if (!(await fileExists(dir, FileType.Directory))) {\n printAndExit(`> No such directory exists as the project root: ${dir}`)\n }\n\n async function preflight(skipOnReboot: boolean) {\n const { getPackageVersion, getDependencies } = (await Promise.resolve(\n require('../lib/get-package-version') as typeof import('../lib/get-package-version')\n )) as typeof import('../lib/get-package-version')\n\n const [sassVersion, nodeSassVersion] = await Promise.all([\n getPackageVersion({ cwd: dir, name: 'sass' }),\n getPackageVersion({ cwd: dir, name: 'node-sass' }),\n ])\n if (sassVersion && nodeSassVersion) {\n Log.warn(\n 'Your project has both `sass` and `node-sass` installed as dependencies, but should only use one or the other. ' +\n 'Please remove the `node-sass` dependency from your project. ' +\n ' Read more: https://nextjs.org/docs/messages/duplicate-sass'\n )\n }\n\n if (!skipOnReboot) {\n const { dependencies, devDependencies } = await getDependencies({\n cwd: dir,\n })\n\n // Warn if @next/font is installed as a dependency. Ignore `workspace:*` to not warn in the Next.js monorepo.\n if (\n dependencies['@next/font'] ||\n (devDependencies['@next/font'] &&\n devDependencies['@next/font'] !== 'workspace:*')\n ) {\n const command = getNpxCommand(dir)\n Log.warn(\n 'Your project has `@next/font` installed as a dependency, please use the built-in `next/font` instead. ' +\n 'The `@next/font` package will be removed in Next.js 14. ' +\n `You can migrate by running \\`${command} @next/codemod@latest built-in-next-font .\\`. Read more: https://nextjs.org/docs/messages/built-in-next-font`\n )\n }\n }\n }\n\n let port = options.port\n\n if (isPortIsReserved(port)) {\n printAndExit(getReservedPortExplanation(port), 1)\n }\n\n // If neither --port nor PORT were specified, it's okay to retry new ports.\n const allowRetry = portSource === 'default'\n\n // We do not set a default host value here to prevent breaking\n // some set-ups that rely on listening on other interfaces\n const host = options.hostname\n\n if (\n options.experimentalUploadTrace &&\n !process.env.NEXT_TRACE_UPLOAD_DISABLED\n ) {\n traceUploadUrl = options.experimentalUploadTrace\n }\n\n const devServerOptions: StartServerOptions = {\n dir,\n port,\n allowRetry,\n isDev: true,\n hostname: host,\n }\n\n const startServerPath = require.resolve('../server/lib/start-server')\n\n async function startServer(startServerOptions: StartServerOptions) {\n return new Promise<void>((resolve) => {\n let resolved = false\n const defaultEnv = (initialEnv || process.env) as typeof process.env\n\n const nodeOptions = getParsedNodeOptionsWithoutInspect()\n const nodeDebugType = getNodeDebugType()\n\n let maxOldSpaceSize: string | number | undefined = getMaxOldSpaceSize()\n if (!maxOldSpaceSize && !process.env.NEXT_DISABLE_MEM_OVERRIDE) {\n const totalMem = os.totalmem()\n const totalMemInMB = Math.floor(totalMem / 1024 / 1024)\n maxOldSpaceSize = Math.floor(totalMemInMB * 0.5).toString()\n\n nodeOptions['max-old-space-size'] = maxOldSpaceSize\n\n // Ensure the max_old_space_size is not also set.\n delete nodeOptions['max_old_space_size']\n }\n\n if (options.disableSourceMaps) {\n delete nodeOptions['enable-source-maps']\n } else {\n nodeOptions['enable-source-maps'] = true\n }\n\n if (nodeDebugType) {\n const address = getParsedDebugAddress()\n address.port = address.port + 1\n nodeOptions[nodeDebugType] = formatDebugAddress(address)\n }\n\n child = fork(startServerPath, {\n stdio: 'inherit',\n env: {\n ...defaultEnv,\n ...(isTurbopack ? { TURBOPACK: '1' } : undefined),\n NEXT_PRIVATE_WORKER: '1',\n NEXT_PRIVATE_TRACE_ID: traceId,\n NODE_EXTRA_CA_CERTS: startServerOptions.selfSignedCertificate\n ? startServerOptions.selfSignedCertificate.rootCA\n : defaultEnv.NODE_EXTRA_CA_CERTS,\n NODE_OPTIONS: formatNodeOptions(nodeOptions),\n // There is a node.js bug on MacOS which causes closing file watchers to be really slow.\n // This limits the number of watchers to mitigate the issue.\n // https://github.com/nodejs/node/issues/29949\n WATCHPACK_WATCHER_LIMIT:\n os.platform() === 'darwin' ? '20' : undefined,\n },\n })\n\n child.on('message', (msg: any) => {\n if (msg && typeof msg === 'object') {\n if (msg.nextWorkerReady) {\n child?.send({ nextWorkerOptions: startServerOptions })\n } else if (msg.nextServerReady && !resolved) {\n if (msg.port) {\n // Store the used port in case a random one was selected, so that\n // it can be re-used on automatic dev server restarts.\n port = parseInt(msg.port, 10)\n }\n\n resolved = true\n resolve()\n }\n }\n })\n\n child.on('exit', async (code, signal) => {\n if (sessionStopHandled || signal) {\n return\n }\n if (code === RESTART_EXIT_CODE) {\n // Starting the dev server will overwrite the `.next/trace` file, so we\n // must upload the existing contents before restarting the server to\n // preserve the metrics.\n if (traceUploadUrl) {\n // Postpone loading next config when we need to get\n // config.distDir for upload trace.\n config =\n config ||\n (await loadConfig(PHASE_DEVELOPMENT_SERVER, dir, {\n silent: true,\n }))\n uploadTrace({\n traceUploadUrl,\n mode: 'dev',\n projectDir: dir,\n distDir: config.distDir,\n isTurboSession,\n sync: true,\n })\n }\n\n return startServer({ ...startServerOptions, port })\n }\n // Call handler (e.g. upload telemetry). Don't try to send a signal to\n // the child, as it has already exited.\n await handleSessionStop(/* signal */ null)\n })\n })\n }\n\n const runDevServer = async (reboot: boolean) => {\n try {\n if (!!options.experimentalHttps) {\n Log.warn(\n 'Self-signed certificates are currently an experimental feature, use with caution.'\n )\n\n let certificate: SelfSignedCertificate | undefined\n\n const key = options.experimentalHttpsKey\n const cert = options.experimentalHttpsCert\n const rootCA = options.experimentalHttpsCa\n\n if (key && cert) {\n certificate = {\n key: path.resolve(key),\n cert: path.resolve(cert),\n rootCA: rootCA ? path.resolve(rootCA) : undefined,\n }\n } else {\n certificate = await createSelfSignedCertificate(host)\n }\n\n await startServer({\n ...devServerOptions,\n selfSignedCertificate: certificate,\n })\n } else {\n await startServer(devServerOptions)\n }\n\n await preflight(reboot)\n } catch (err) {\n console.error(err)\n process.exit(1)\n }\n }\n\n await runDevServer(false)\n}\n\nexport { nextDev }\n"],"names":["nextDev","dir","child","config","isTurboSession","traceUploadUrl","sessionStopHandled","sessionStarted","Date","now","sessionSpan","trace","CHILD_EXIT_TIMEOUT_MS","parseInt","process","env","NEXT_EXIT_TIMEOUT_MS","handleSessionStop","signal","pid","kill","exitCode","signalCode","exitTimeout","setTimeout","once","catch","clearTimeout","stop","flushAllTraces","end","eventCliSessionStopped","require","pagesDir","traceGlobals","get","appDir","pagesResult","findPagesDir","loadConfig","PHASE_DEVELOPMENT_SERVER","silent","telemetry","Telemetry","distDir","path","join","record","cliCommand","turboFlag","durationMilliseconds","flushDetached","_","uploadTrace","mode","projectDir","stdout","write","exit","on","options","portSource","directory","isTurbopack","Boolean","turbo","turbopack","IS_TURBOPACK_TEST","TURBOPACK","getProjectDir","NEXT_PRIVATE_DEV_DIR","fileExists","FileType","Directory","printAndExit","preflight","skipOnReboot","getPackageVersion","getDependencies","Promise","resolve","sassVersion","nodeSassVersion","all","cwd","name","Log","warn","dependencies","devDependencies","command","getNpxCommand","port","isPortIsReserved","getReservedPortExplanation","allowRetry","host","hostname","experimentalUploadTrace","NEXT_TRACE_UPLOAD_DISABLED","devServerOptions","isDev","startServerPath","startServer","startServerOptions","resolved","defaultEnv","initialEnv","nodeOptions","getParsedNodeOptionsWithoutInspect","nodeDebugType","getNodeDebugType","maxOldSpaceSize","getMaxOldSpaceSize","NEXT_DISABLE_MEM_OVERRIDE","totalMem","os","totalmem","totalMemInMB","Math","floor","toString","disableSourceMaps","address","getParsedDebugAddress","formatDebugAddress","fork","stdio","undefined","NEXT_PRIVATE_WORKER","NEXT_PRIVATE_TRACE_ID","traceId","NODE_EXTRA_CA_CERTS","selfSignedCertificate","rootCA","NODE_OPTIONS","formatNodeOptions","WATCHPACK_WATCHER_LIMIT","platform","msg","nextWorkerReady","send","nextWorkerOptions","nextServerReady","code","RESTART_EXIT_CODE","sync","runDevServer","reboot","experimentalHttps","certificate","key","experimentalHttpsKey","cert","experimentalHttpsCert","experimentalHttpsCa","createSelfSignedCertificate","err","console","error"],"mappings":";;;;;+BA8YSA;;;eAAAA;;;QA5YF;uBAWA;6DACc;+BACS;2BACW;6DACxB;wBAEY;yBACH;+DACH;8BACM;4BACQ;+BACP;wBACc;oEAEpB;qBACG;+BACN;iCAKd;2DACQ;4BACM;wBACQ;uBACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBtC,IAAIC;AACJ,IAAIC;AACJ,wFAAwF;AACxF,IAAIC;AACJ,IAAIC,iBAAiB;AACrB,IAAIC;AACJ,IAAIC,qBAAqB;AACzB,IAAIC,iBAAiBC,KAAKC,GAAG;AAC7B,IAAIC,cAAcC,IAAAA,YAAK,EAAC;AAExB,sEAAsE;AACtE,8DAA8D;AAC9D,MAAMC,wBAAwBC,SAC5BC,QAAQC,GAAG,CAACC,oBAAoB,IAAI,OACpC;AAGF,MAAMC,oBAAoB,OAAOC;IAC/B,IAAIA,UAAU,SAAQhB,yBAAAA,MAAOiB,GAAG,GAAEjB,MAAMkB,IAAI,CAACF;IAC7C,IAAIZ,oBAAoB;IACxBA,qBAAqB;IAErB,wEAAwE;IACxE,qEAAqE;IACrE,MAAMe,WAAWnB,CAAAA,yBAAAA,MAAOmB,QAAQ,KAAI;IAEpC,IACE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CAACmC,OAAO,CAACsD,UAAUN;oBAC1C;gBACF,OAAO;oBACLsB,cAAc,MAAMM,IAAAA,mCAA2B,EAAC5D;gBAClD;gBAEA,MAAMO,YAAY;oBAChB,GAAGH,gBAAgB;oBACnBiC,uBAAuBiB;gBACzB;YACF,OAAO;gBACL,MAAM/C,YAAYH;YACpB;YAEA,MAAMzB,UAAUyE;QAClB,EAAE,OAAOS,KAAK;YACZC,QAAQC,KAAK,CAACF;YACd/I,QAAQ4C,IAAI,CAAC;QACf;IACF;IAEA,MAAMyF,aAAa;AACrB","ignoreList":[0]}
|
@@ -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.38";
|
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.38";
|
65
65
|
let router;
|
66
66
|
const emitter = (0, _mitt.default)();
|
67
67
|
const looseToArray = (input)=>[].slice.call(input);
|