@openuiai/next 16.0.6 → 16.0.7
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/webpack/loaders/css-loader/src/utils.js +2 -1
- package/dist/build/webpack/loaders/css-loader/src/utils.js.map +1 -1
- package/dist/build/webpack/plugins/jsconfig-paths-plugin.js +4 -0
- package/dist/build/webpack/plugins/jsconfig-paths-plugin.js.map +1 -1
- package/dist/build/webpack/plugins/profiling-plugin.js +4 -1
- package/dist/build/webpack/plugins/profiling-plugin.js.map +1 -1
- package/dist/build/webpack/plugins/react-loadable-plugin.js +2 -0
- package/dist/build/webpack/plugins/react-loadable-plugin.js.map +1 -1
- package/dist/build/webpack/plugins/wellknown-errors-plugin/parseNotFoundError.js +8 -0
- package/dist/build/webpack/plugins/wellknown-errors-plugin/parseNotFoundError.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/esm/build/index.js +3 -3
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/webpack/loaders/css-loader/src/utils.js +2 -1
- package/dist/esm/build/webpack/loaders/css-loader/src/utils.js.map +1 -1
- package/dist/esm/build/webpack/plugins/jsconfig-paths-plugin.js +4 -0
- package/dist/esm/build/webpack/plugins/jsconfig-paths-plugin.js.map +1 -1
- package/dist/esm/build/webpack/plugins/profiling-plugin.js +4 -1
- package/dist/esm/build/webpack/plugins/profiling-plugin.js.map +1 -1
- package/dist/esm/build/webpack/plugins/react-loadable-plugin.js +2 -0
- package/dist/esm/build/webpack/plugins/react-loadable-plugin.js.map +1 -1
- package/dist/esm/build/webpack/plugins/wellknown-errors-plugin/parseNotFoundError.js +8 -0
- package/dist/esm/build/webpack/plugins/wellknown-errors-plugin/parseNotFoundError.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-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/errors/canary-only-config-error.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/errors/canary-only-config-error.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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/build/webpack/plugins/wellknown-errors-plugin/parseNotFoundError.ts"],"sourcesContent":["import { bold, cyan, green, red, yellow } from '../../../../lib/picocolors'\nimport { SimpleWebpackError } from './simpleWebpackError'\nimport {\n createOriginalStackFrame,\n getIgnoredSources,\n} from '../../../../server/dev/middleware-webpack'\nimport type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport type { RawSourceMap } from 'next/dist/compiled/source-map08'\n\n// Based on https://github.com/webpack/webpack/blob/fcdd04a833943394bbb0a9eeb54a962a24cc7e41/lib/stats/DefaultStatsFactoryPlugin.js#L422-L431\n/*\nCopyright JS Foundation and other contributors\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\nfunction getModuleTrace(input: any, compilation: any) {\n const visitedModules = new Set()\n const moduleTrace = []\n let current = input.module\n while (current) {\n if (visitedModules.has(current)) break // circular (technically impossible, but who knows)\n visitedModules.add(current)\n const origin = compilation.moduleGraph.getIssuer(current)\n if (!origin) break\n moduleTrace.push({ origin, module: current })\n current = origin\n }\n\n return moduleTrace\n}\n\nfunction sourceMapIgnoreListsEverything(\n sourceMap: RawSourceMap & { ignoreList?: number[] }\n): boolean {\n return sourceMap.sources.length === sourceMap.ignoreList?.length\n}\n\nasync function getSourceFrame(\n input: any,\n fileName: any,\n compilation: any\n): Promise<{ frame: string; line1: string; column1: string }> {\n try {\n const loc =\n input.loc || input.dependencies.map((d: any) => d.loc).filter(Boolean)[0]\n const module = input.module as webpack.Module\n const originalSource = module.originalSource()\n const sourceMap = originalSource?.map() ?? undefined\n\n if (sourceMap) {\n const moduleId = compilation.chunkGraph.getModuleId(module)\n\n const result = await createOriginalStackFrame({\n ignoredByDefault: sourceMapIgnoreListsEverything(sourceMap),\n source: {\n type: 'bundle',\n sourceMap,\n ignoredSources: getIgnoredSources(sourceMap),\n compilation,\n moduleId,\n moduleURL: fileName,\n },\n rootDirectory: compilation.options.context!,\n frame: {\n arguments: [],\n file: fileName,\n methodName: '',\n line1: loc.start.line,\n // loc is 0-based but columns in stack frames are 1-based.\n column1: (loc.start.column ?? 0) + 1,\n },\n })\n\n return {\n frame: result?.originalCodeFrame ?? '',\n line1: result?.originalStackFrame?.line1?.toString() ?? '',\n column1: result?.originalStackFrame?.column1?.toString() ?? '',\n }\n }\n } catch {}\n\n return { frame: '', line1: '', column1: '' }\n}\n\nfunction getFormattedFileName(\n fileName: string,\n module: any,\n lineNumber?: string,\n column?: string\n): string {\n if (\n module.loaders?.find((loader: any) =>\n /next-font-loader[/\\\\]index.js/.test(loader.loader)\n )\n ) {\n // Parse the query and get the path of the file where the font function was called.\n // provided by next-swc next-transform-font\n return JSON.parse(module.resourceResolveData.query.slice(1)).path\n } else {\n let formattedFileName: string = cyan(fileName)\n if (lineNumber && column) {\n formattedFileName += `:${yellow(lineNumber)}:${yellow(column)}`\n }\n\n return formattedFileName\n }\n}\n\nexport async function getNotFoundError(\n compilation: webpack.Compilation,\n input: any,\n fileName: string,\n module: any\n) {\n if (\n input.name !== 'ModuleNotFoundError' &&\n !(\n input.name === 'ModuleBuildError' &&\n /Error: Can't resolve '.+' in /.test(input.message)\n )\n ) {\n return false\n }\n\n try {\n const { frame, line1, column1 } = await getSourceFrame(\n input,\n fileName,\n compilation\n )\n\n const errorMessage = input.error.message\n .replace(/ in '.*?'/, '')\n .replace(/Can't resolve '(.*)'/, `Can't resolve '${green('$1')}'`)\n\n const importTrace = () => {\n const moduleTrace = getModuleTrace(input, compilation)\n .map(({ origin }) =>\n origin.readableIdentifier(compilation.requestShortener)\n )\n .filter(\n (name) =>\n name &&\n !/next-(app|middleware|client-pages|route|flight-(client|server|client-entry))-loader/.test(\n name\n ) &&\n !/css-loader.+\\.js/.test(name)\n )\n if (moduleTrace.length === 0) return ''\n\n return `\\nImport trace for requested module:\\n${moduleTrace.join('\\n')}`\n }\n\n let message =\n red(bold('Module not found')) +\n `: ${errorMessage}` +\n '\\n' +\n frame +\n (frame !== '' ? '\\n' : '') +\n '\\nhttps://nextjs.org/docs/messages/module-not-found\\n' +\n importTrace()\n\n const formattedFileName = getFormattedFileName(\n fileName,\n module,\n line1,\n column1\n )\n\n return new SimpleWebpackError(formattedFileName, message)\n } catch (err) {\n // Don't fail on failure to resolve sourcemaps\n return input\n }\n}\n\nexport async function getImageError(\n compilation: any,\n input: any,\n err: Error\n): Promise<SimpleWebpackError | false> {\n if (err.name !== 'InvalidImageFormatError') {\n return false\n }\n\n const moduleTrace = getModuleTrace(input, compilation)\n const { origin, module } = moduleTrace[0] || {}\n if (!origin || !module) {\n return false\n }\n const page = origin.rawRequest.replace(/^private-next-pages/, './pages')\n const importedFile = module.rawRequest\n const source = origin.originalSource().buffer().toString('utf8') as string\n let lineNumber = -1\n source.split('\\n').some((line) => {\n lineNumber++\n return line.includes(importedFile)\n })\n return new SimpleWebpackError(\n `${cyan(page)}:${yellow(lineNumber.toString())}`,\n red(bold('Error')).concat(\n `: Image import \"${importedFile}\" is not a valid image file. The image may be corrupted or an unsupported format.`\n )\n )\n}\n"],"names":["bold","cyan","green","red","yellow","SimpleWebpackError","createOriginalStackFrame","getIgnoredSources","getModuleTrace","input","compilation","visitedModules","Set","moduleTrace","current","module","has","add","origin","moduleGraph","getIssuer","push","sourceMapIgnoreListsEverything","sourceMap","sources","length","ignoreList","getSourceFrame","fileName","loc","dependencies","map","d","filter","Boolean","originalSource","undefined","result","moduleId","chunkGraph","getModuleId","ignoredByDefault","source","type","ignoredSources","moduleURL","rootDirectory","options","context","frame","arguments","file","methodName","line1","start","line","column1","column","originalCodeFrame","originalStackFrame","toString","getFormattedFileName","lineNumber","loaders","find","loader","test","JSON","parse","resourceResolveData","query","slice","path","formattedFileName","getNotFoundError","name","message","errorMessage","error","replace","importTrace","readableIdentifier","requestShortener","join","err","getImageError","page","rawRequest","importedFile","buffer","split","some","includes","concat"],"mappings":"AAAA,SAASA,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAEC,GAAG,EAAEC,MAAM,QAAQ,6BAA4B;AAC3E,SAASC,kBAAkB,QAAQ,uBAAsB;AACzD,SACEC,wBAAwB,EACxBC,iBAAiB,QACZ,4CAA2C;AAIlD,6IAA6I;AAC7I;;;;;;;;;;;;;;;;;;;;;;AAsBA,GACA,SAASC,eAAeC,KAAU,EAAEC,WAAgB;IAClD,MAAMC,iB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,OAAO;IACT;IACA,MAAMuE,OAAOpE,OAAOqE,UAAU,CAACR,OAAO,CAAC,uBAAuB;IAC9D,MAAMS,eAAezE,OAAOwE,UAAU;IACtC,MAAM7C,SAASxB,OAAOiB,cAAc,GAAGsD,MAAM,GAAG7B,QAAQ,CAAC;IACzD,IAAIE,aAAa,CAAC;IAClBpB,OAAOgD,KAAK,CAAC,MAAMC,IAAI,CAAC,CAACpC;QACvBO;QACA,OAAOP,KAAKqC,QAAQ,CAACJ;IACvB;IACA,OAAO,IAAInF,mBACT,GAAGJ,KAAKqF,MAAM,CAAC,EAAElF,OAAO0D,WAAWF,QAAQ,KAAK,EAChDzD,IAAIH,KAAK,UAAU6F,MAAM,CACvB,CAAC,gBAAgB,EAAEL,aAAa,iFAAiF,CAAC;AAGxH","ignoreList":[0]}
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/build/webpack/plugins/wellknown-errors-plugin/parseNotFoundError.ts"],"sourcesContent":["import { bold, cyan, green, red, yellow } from '../../../../lib/picocolors'\nimport { SimpleWebpackError } from './simpleWebpackError'\nimport {\n createOriginalStackFrame,\n getIgnoredSources,\n} from '../../../../server/dev/middleware-webpack'\nimport type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport type { RawSourceMap } from 'next/dist/compiled/source-map08'\n\n// Based on https://github.com/webpack/webpack/blob/fcdd04a833943394bbb0a9eeb54a962a24cc7e41/lib/stats/DefaultStatsFactoryPlugin.js#L422-L431\n/*\nCopyright JS Foundation and other contributors\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\nfunction getModuleTrace(input: any, compilation: any) {\n const visitedModules = new Set()\n const moduleTrace = []\n let current = input.module\n while (current) {\n if (visitedModules.has(current)) break // circular (technically impossible, but who knows)\n visitedModules.add(current)\n const origin = compilation.moduleGraph.getIssuer(current)\n if (!origin) break\n moduleTrace.push({ origin, module: current })\n current = origin\n }\n\n return moduleTrace\n}\n\nfunction sourceMapIgnoreListsEverything(\n sourceMap: RawSourceMap & { ignoreList?: number[] }\n): boolean {\n return sourceMap.sources.length === sourceMap.ignoreList?.length\n}\n\nasync function getSourceFrame(\n input: any,\n fileName: any,\n compilation: any\n): Promise<{ frame: string; line1: string; column1: string }> {\n try {\n const loc =\n input.loc || input.dependencies.map((d: any) => d.loc).filter(Boolean)[0]\n const module = input.module as webpack.Module\n const originalSource = module.originalSource()\n const sourceMap = originalSource?.map() ?? undefined\n\n if (sourceMap) {\n const moduleId = compilation.chunkGraph.getModuleId(module)\n // Skip if moduleId is undefined (Bun compatibility)\n if (moduleId === undefined || moduleId === null) {\n return { frame: '', line1: '', column1: '' }\n }\n\n const result = await createOriginalStackFrame({\n ignoredByDefault: sourceMapIgnoreListsEverything(sourceMap),\n source: {\n type: 'bundle',\n sourceMap,\n ignoredSources: getIgnoredSources(sourceMap),\n compilation,\n moduleId,\n moduleURL: fileName,\n },\n rootDirectory: compilation.options.context!,\n frame: {\n arguments: [],\n file: fileName,\n methodName: '',\n line1: loc.start.line,\n // loc is 0-based but columns in stack frames are 1-based.\n column1: (loc.start.column ?? 0) + 1,\n },\n })\n\n return {\n frame: result?.originalCodeFrame ?? '',\n line1: result?.originalStackFrame?.line1?.toString() ?? '',\n column1: result?.originalStackFrame?.column1?.toString() ?? '',\n }\n }\n } catch {}\n\n return { frame: '', line1: '', column1: '' }\n}\n\nfunction getFormattedFileName(\n fileName: string,\n module: any,\n lineNumber?: string,\n column?: string\n): string {\n if (\n module.loaders?.find((loader: any) =>\n /next-font-loader[/\\\\]index.js/.test(loader.loader)\n )\n ) {\n // Parse the query and get the path of the file where the font function was called.\n // provided by next-swc next-transform-font\n return JSON.parse(module.resourceResolveData.query.slice(1)).path\n } else {\n let formattedFileName: string = cyan(fileName)\n if (lineNumber && column) {\n formattedFileName += `:${yellow(lineNumber)}:${yellow(column)}`\n }\n\n return formattedFileName\n }\n}\n\nexport async function getNotFoundError(\n compilation: webpack.Compilation,\n input: any,\n fileName: string,\n module: any\n) {\n if (\n input.name !== 'ModuleNotFoundError' &&\n !(\n input.name === 'ModuleBuildError' &&\n /Error: Can't resolve '.+' in /.test(input.message)\n )\n ) {\n return false\n }\n\n try {\n const { frame, line1, column1 } = await getSourceFrame(\n input,\n fileName,\n compilation\n )\n\n const errorMessage = input.error.message\n .replace(/ in '.*?'/, '')\n .replace(/Can't resolve '(.*)'/, `Can't resolve '${green('$1')}'`)\n\n const importTrace = () => {\n const moduleTrace = getModuleTrace(input, compilation)\n .map(({ origin }) =>\n origin.readableIdentifier(compilation.requestShortener)\n )\n .filter(\n (name) =>\n name &&\n !/next-(app|middleware|client-pages|route|flight-(client|server|client-entry))-loader/.test(\n name\n ) &&\n !/css-loader.+\\.js/.test(name)\n )\n if (moduleTrace.length === 0) return ''\n\n return `\\nImport trace for requested module:\\n${moduleTrace.join('\\n')}`\n }\n\n let message =\n red(bold('Module not found')) +\n `: ${errorMessage}` +\n '\\n' +\n frame +\n (frame !== '' ? '\\n' : '') +\n '\\nhttps://nextjs.org/docs/messages/module-not-found\\n' +\n importTrace()\n\n const formattedFileName = getFormattedFileName(\n fileName,\n module,\n line1,\n column1\n )\n\n return new SimpleWebpackError(formattedFileName, message)\n } catch (err) {\n // Don't fail on failure to resolve sourcemaps\n return input\n }\n}\n\nexport async function getImageError(\n compilation: any,\n input: any,\n err: Error\n): Promise<SimpleWebpackError | false> {\n if (err.name !== 'InvalidImageFormatError') {\n return false\n }\n\n const moduleTrace = getModuleTrace(input, compilation)\n const { origin, module } = moduleTrace[0] || {}\n if (!origin || !module) {\n return false\n }\n const page = origin.rawRequest.replace(/^private-next-pages/, './pages')\n const importedFile = module.rawRequest\n const source = origin.originalSource().buffer().toString('utf8') as string\n let lineNumber = -1\n source.split('\\n').some((line) => {\n lineNumber++\n return line.includes(importedFile)\n })\n return new SimpleWebpackError(\n `${cyan(page)}:${yellow(lineNumber.toString())}`,\n red(bold('Error')).concat(\n `: Image import \"${importedFile}\" is not a valid image file. The image may be corrupted or an unsupported format.`\n )\n )\n}\n"],"names":["bold","cyan","green","red","yellow","SimpleWebpackError","createOriginalStackFrame","getIgnoredSources","getModuleTrace","input","compilation","visitedModules","Set","moduleTrace","current","module","has","add","origin","moduleGraph","getIssuer","push","sourceMapIgnoreListsEverything","sourceMap","sources","length","ignoreList","getSourceFrame","fileName","loc","dependencies","map","d","filter","Boolean","originalSource","undefined","result","moduleId","chunkGraph","getModuleId","frame","line1","column1","ignoredByDefault","source","type","ignoredSources","moduleURL","rootDirectory","options","context","arguments","file","methodName","start","line","column","originalCodeFrame","originalStackFrame","toString","getFormattedFileName","lineNumber","loaders","find","loader","test","JSON","parse","resourceResolveData","query","slice","path","formattedFileName","getNotFoundError","name","message","errorMessage","error","replace","importTrace","readableIdentifier","requestShortener","join","err","getImageError","page","rawRequest","importedFile","buffer","split","some","includes","concat"],"mappings":"AAAA,SAASA,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAEC,GAAG,EAAEC,MAAM,QAAQ,6BAA4B;AAC3E,SAASC,kBAAkB,QAAQ,uBAAsB;AACzD,SACEC,wBAAwB,EACxBC,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gB,EAChBD,KAAU,EACV2E,GAAU;IAEV,IAAIA,IAAIT,IAAI,KAAK,2BAA2B;QAC1C,OAAO;IACT;IAEA,MAAM9D,cAAcL,eAAeC,OAAOC;IAC1C,MAAM,EAAEQ,MAAM,EAAEH,MAAM,EAAE,GAAGF,WAAW,CAAC,EAAE,IAAI,CAAC;IAC9C,IAAI,CAACK,UAAU,CAACH,QAAQ;QACtB,OAAO;IACT;IACA,MAAMuE,OAAOpE,OAAOqE,UAAU,CAACR,OAAO,CAAC,uBAAuB;IAC9D,MAAMS,eAAezE,OAAOwE,UAAU;IACtC,MAAM1C,SAAS3B,OAAOiB,cAAc,GAAGsD,MAAM,GAAG7B,QAAQ,CAAC;IACzD,IAAIE,aAAa,CAAC;IAClBjB,OAAO6C,KAAK,CAAC,MAAMC,IAAI,CAAC,CAACnC;QACvBM;QACA,OAAON,KAAKoC,QAAQ,CAACJ;IACvB;IACA,OAAO,IAAInF,mBACT,GAAGJ,KAAKqF,MAAM,CAAC,EAAElF,OAAO0D,WAAWF,QAAQ,KAAK,EAChDzD,IAAIH,KAAK,UAAU6F,MAAM,CACvB,CAAC,gBAAgB,EAAEL,aAAa,iFAAiF,CAAC;AAGxH","ignoreList":[0]}
|
|
@@ -1610,7 +1610,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
|
1610
1610
|
isClient && new CopyFilePlugin({
|
|
1611
1611
|
// file path to build output of `@next/polyfill-nomodule`
|
|
1612
1612
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
|
1613
|
-
cacheKey: "16.0.
|
|
1613
|
+
cacheKey: "16.0.7",
|
|
1614
1614
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
|
1615
1615
|
minimize: false,
|
|
1616
1616
|
info: {
|
|
@@ -1801,7 +1801,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
|
1801
1801
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
|
1802
1802
|
// - Next.js version
|
|
1803
1803
|
// - next.config.js keys that affect compilation
|
|
1804
|
-
version: `${__dirname}|${"16.0.
|
|
1804
|
+
version: `${__dirname}|${"16.0.7"}|${configVars}`,
|
|
1805
1805
|
cacheDirectory: path.join(distDir, 'cache', 'webpack'),
|
|
1806
1806
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
|
1807
1807
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* - next/script with `beforeInteractive` strategy
|
|
6
6
|
*/ import { getAssetPrefix } from './asset-prefix';
|
|
7
7
|
import { setAttributesFromProps } from './set-attributes-from-props';
|
|
8
|
-
const version = "16.0.
|
|
8
|
+
const version = "16.0.7";
|
|
9
9
|
window.next = {
|
|
10
10
|
version,
|
|
11
11
|
appDir: true
|
package/dist/esm/client/index.js
CHANGED
|
@@ -25,7 +25,7 @@ import { SearchParamsContext, PathParamsContext } from '../shared/lib/hooks-clie
|
|
|
25
25
|
import { onRecoverableError } from './react-client-callbacks/on-recoverable-error';
|
|
26
26
|
import tracer from './tracing/tracer';
|
|
27
27
|
import { isNextRouterError } from './components/is-next-router-error';
|
|
28
|
-
export const version = "16.0.
|
|
28
|
+
export const version = "16.0.7";
|
|
29
29
|
export let router;
|
|
30
30
|
export const emitter = mitt();
|
|
31
31
|
const looseToArray = (input)=>[].slice.call(input);
|
|
@@ -163,7 +163,7 @@ export default class HotReloaderWebpack {
|
|
|
163
163
|
this.previewProps = previewProps;
|
|
164
164
|
this.rewrites = rewrites;
|
|
165
165
|
this.hotReloaderSpan = trace('hot-reloader', undefined, {
|
|
166
|
-
version: "16.0.
|
|
166
|
+
version: "16.0.7"
|
|
167
167
|
});
|
|
168
168
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
|
169
169
|
// of the current `next dev` invocation.
|
|
@@ -20,7 +20,7 @@ export function logStartInfo({ networkUrl, appUrl, envInfo, experimentalFeatures
|
|
|
20
20
|
if (parts.length > 0) {
|
|
21
21
|
versionSuffix = ` (${parts.join(', ')})`;
|
|
22
22
|
}
|
|
23
|
-
Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"16.0.
|
|
23
|
+
Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"16.0.7"}`))}${versionSuffix}`);
|
|
24
24
|
if (appUrl) {
|
|
25
25
|
Log.bootstrap(`- Local: ${appUrl}`);
|
|
26
26
|
}
|
|
@@ -110,7 +110,7 @@ export async function getRequestHandlers({ dir, port, isDev, onDevServerCleanup,
|
|
|
110
110
|
export async function startServer(serverOptions) {
|
|
111
111
|
const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
|
|
112
112
|
let { port } = serverOptions;
|
|
113
|
-
process.title = `next-server (v${"16.0.
|
|
113
|
+
process.title = `next-server (v${"16.0.7"})`;
|
|
114
114
|
let handlersReady = ()=>{};
|
|
115
115
|
let handlersError = ()=>{};
|
|
116
116
|
let handlersPromise = new Promise((resolve, reject)=>{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function isStableBuild() {
|
|
2
|
-
return !"16.0.
|
|
2
|
+
return !"16.0.7"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
|
|
3
3
|
}
|
|
4
4
|
export class CanaryOnlyConfigError extends Error {
|
|
5
5
|
constructor(arg){
|
|
@@ -231,7 +231,7 @@ class HotReloaderWebpack {
|
|
|
231
231
|
this.previewProps = previewProps;
|
|
232
232
|
this.rewrites = rewrites;
|
|
233
233
|
this.hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
|
|
234
|
-
version: "16.0.
|
|
234
|
+
version: "16.0.7"
|
|
235
235
|
});
|
|
236
236
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
|
237
237
|
// of the current `next dev` invocation.
|
|
@@ -88,7 +88,7 @@ function logStartInfo({ networkUrl, appUrl, envInfo, experimentalFeatures, logBu
|
|
|
88
88
|
if (parts.length > 0) {
|
|
89
89
|
versionSuffix = ` (${parts.join(', ')})`;
|
|
90
90
|
}
|
|
91
|
-
_log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"16.0.
|
|
91
|
+
_log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"16.0.7"}`))}${versionSuffix}`);
|
|
92
92
|
if (appUrl) {
|
|
93
93
|
_log.bootstrap(`- Local: ${appUrl}`);
|
|
94
94
|
}
|
|
@@ -178,7 +178,7 @@ async function getRequestHandlers({ dir, port, isDev, onDevServerCleanup, server
|
|
|
178
178
|
async function startServer(serverOptions) {
|
|
179
179
|
const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
|
|
180
180
|
let { port } = serverOptions;
|
|
181
|
-
process.title = `next-server (v${"16.0.
|
|
181
|
+
process.title = `next-server (v${"16.0.7"})`;
|
|
182
182
|
let handlersReady = ()=>{};
|
|
183
183
|
let handlersError = ()=>{};
|
|
184
184
|
let handlersPromise = new Promise((resolve, reject)=>{
|
|
@@ -21,7 +21,7 @@ _export(exports, {
|
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
function isStableBuild() {
|
|
24
|
-
return !"16.0.
|
|
24
|
+
return !"16.0.7"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
|
|
25
25
|
}
|
|
26
26
|
class CanaryOnlyConfigError extends Error {
|
|
27
27
|
constructor(arg){
|
|
@@ -11,11 +11,11 @@ Object.defineProperty(exports, "eventCliSessionStopped", {
|
|
|
11
11
|
const EVENT_VERSION = 'NEXT_CLI_SESSION_STOPPED';
|
|
12
12
|
function eventCliSessionStopped(event) {
|
|
13
13
|
// This should be an invariant, if it fails our build tooling is broken.
|
|
14
|
-
if (typeof "16.0.
|
|
14
|
+
if (typeof "16.0.7" !== 'string') {
|
|
15
15
|
return [];
|
|
16
16
|
}
|
|
17
17
|
const payload = {
|
|
18
|
-
nextVersion: "16.0.
|
|
18
|
+
nextVersion: "16.0.7",
|
|
19
19
|
nodeVersion: process.version,
|
|
20
20
|
cliCommand: event.cliCommand,
|
|
21
21
|
durationMilliseconds: event.durationMilliseconds,
|
|
@@ -12,12 +12,12 @@ const EVENT_VERSION = 'NEXT_CLI_SESSION_STARTED';
|
|
|
12
12
|
function eventCliSession(nextConfig, event) {
|
|
13
13
|
var _nextConfig_experimental_staleTimes, _nextConfig_experimental_staleTimes1, _nextConfig_reactCompiler, _nextConfig_reactCompiler1;
|
|
14
14
|
// This should be an invariant, if it fails our build tooling is broken.
|
|
15
|
-
if (typeof "16.0.
|
|
15
|
+
if (typeof "16.0.7" !== 'string') {
|
|
16
16
|
return [];
|
|
17
17
|
}
|
|
18
18
|
const { images, i18n } = nextConfig || {};
|
|
19
19
|
const payload = {
|
|
20
|
-
nextVersion: "16.0.
|
|
20
|
+
nextVersion: "16.0.7",
|
|
21
21
|
nodeVersion: process.version,
|
|
22
22
|
cliCommand: event.cliCommand,
|
|
23
23
|
isSrcDir: event.isSrcDir,
|