next 14.3.0-canary.80 → 15.0.0-rc.0
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.
Potentially problematic release.
This version of next might be problematic. Click here for more details.
- package/dist/bin/next +1 -1
- package/dist/build/index.js +1 -1
- package/dist/build/swc/index.js +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 +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/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/typescript/rules/config.js +0 -11
- package/dist/esm/server/typescript/rules/config.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/typescript/rules/config.js +0 -11
- package/dist/server/typescript/rules/config.js.map +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
|
@@ -72,7 +72,7 @@ const program = new MyRootCommand();
|
|
|
72
72
|
program.name('next').description('The Next.js CLI allows you to develop, build, start your application, and more.').configureHelp({
|
|
73
73
|
formatHelp: (cmd, helper)=>(0, _formatclihelpoutput.formatCliHelpOutput)(cmd, helper),
|
|
74
74
|
subcommandTerm: (cmd)=>`${cmd.name()} ${cmd.usage()}`
|
|
75
|
-
}).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"
|
|
75
|
+
}).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.0.0-rc.0"}`, '-v, --version', 'Outputs the Next.js version.');
|
|
76
76
|
program.command('build').description('Creates an optimized production build of your application. The output displays information about each route.').argument('[directory]', `A directory on which to build the application. ${(0, _picocolors.italic)('If no directory is provided, the current directory will be used.')}`).option('-d, --debug', 'Enables a more verbose build output.').option('--no-lint', 'Disables linting.').option('--no-mangling', 'Disables mangling.').option('--profile', 'Enables production profiling for React.').option('--experimental-app-only', 'Builds only App Router routes.').addOption(new _commander.Option('--experimental-turbo').hideHelp()).addOption(new _commander.Option('--experimental-build-mode [mode]', 'Uses an experimental build mode.').choices([
|
|
77
77
|
'compile',
|
|
78
78
|
'generate'
|
package/dist/build/index.js
CHANGED
|
@@ -362,7 +362,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
|
|
|
362
362
|
const nextBuildSpan = (0, _trace.trace)('next-build', undefined, {
|
|
363
363
|
buildMode: experimentalBuildMode,
|
|
364
364
|
isTurboBuild: String(turboNextBuild),
|
|
365
|
-
version: "
|
|
365
|
+
version: "15.0.0-rc.0"
|
|
366
366
|
});
|
|
367
367
|
_buildcontext.NextBuildContext.nextBuildSpan = nextBuildSpan;
|
|
368
368
|
_buildcontext.NextBuildContext.dir = dir;
|
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 = "
|
|
133
|
+
const nextVersion = "15.0.0-rc.0";
|
|
134
134
|
const ArchName = (0, _os.arch)();
|
|
135
135
|
const PlatformName = (0, _os.platform)();
|
|
136
136
|
const infoLog = (...args)=>{
|
|
@@ -1493,7 +1493,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1493
1493
|
new _wellknownerrorsplugin.WellKnownErrorsPlugin(),
|
|
1494
1494
|
isClient && new _copyfileplugin.CopyFilePlugin({
|
|
1495
1495
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
|
1496
|
-
cacheKey: "
|
|
1496
|
+
cacheKey: "15.0.0-rc.0",
|
|
1497
1497
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
|
1498
1498
|
minimize: false,
|
|
1499
1499
|
info: {
|
|
@@ -1717,7 +1717,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
|
|
|
1717
1717
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
|
1718
1718
|
// - Next.js version
|
|
1719
1719
|
// - next.config.js keys that affect compilation
|
|
1720
|
-
version: `${__dirname}|${"
|
|
1720
|
+
version: `${__dirname}|${"15.0.0-rc.0"}|${configVars}`,
|
|
1721
1721
|
cacheDirectory: _path.default.join(distDir, 'cache', 'webpack'),
|
|
1722
1722
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
|
1723
1723
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|
package/dist/client/index.js
CHANGED
|
@@ -60,7 +60,7 @@ const _hooksclientcontextsharedruntime = require("../shared/lib/hooks-client-con
|
|
|
60
60
|
const _onrecoverableerror = require("./on-recoverable-error");
|
|
61
61
|
const _tracer = /*#__PURE__*/ _interop_require_default._(require("./tracing/tracer"));
|
|
62
62
|
const _reporttosocket = /*#__PURE__*/ _interop_require_default._(require("./tracing/report-to-socket"));
|
|
63
|
-
const version = "
|
|
63
|
+
const version = "15.0.0-rc.0";
|
|
64
64
|
let router;
|
|
65
65
|
const emitter = (0, _mitt.default)();
|
|
66
66
|
const looseToArray = (input)=>[].slice.call(input);
|
package/dist/esm/build/index.js
CHANGED
|
@@ -306,7 +306,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
|
306
306
|
const nextBuildSpan = trace('next-build', undefined, {
|
|
307
307
|
buildMode: experimentalBuildMode,
|
|
308
308
|
isTurboBuild: String(turboNextBuild),
|
|
309
|
-
version: "
|
|
309
|
+
version: "15.0.0-rc.0"
|
|
310
310
|
});
|
|
311
311
|
NextBuildContext.nextBuildSpan = nextBuildSpan;
|
|
312
312
|
NextBuildContext.dir = dir;
|
|
@@ -10,7 +10,7 @@ import { downloadNativeNextSwc, downloadWasmSwc } from '../../lib/download-swc';
|
|
|
10
10
|
import { isDeepStrictEqual } from 'util';
|
|
11
11
|
import { getDefineEnv } from '../webpack/plugins/define-env-plugin';
|
|
12
12
|
import { getReactCompilerLoader } from '../get-babel-loader-config';
|
|
13
|
-
const nextVersion = "
|
|
13
|
+
const nextVersion = "15.0.0-rc.0";
|
|
14
14
|
const ArchName = arch();
|
|
15
15
|
const PlatformName = platform();
|
|
16
16
|
const infoLog = (...args)=>{
|
|
@@ -1386,7 +1386,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
|
1386
1386
|
new WellKnownErrorsPlugin(),
|
|
1387
1387
|
isClient && new CopyFilePlugin({
|
|
1388
1388
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
|
1389
|
-
cacheKey: "
|
|
1389
|
+
cacheKey: "15.0.0-rc.0",
|
|
1390
1390
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
|
1391
1391
|
minimize: false,
|
|
1392
1392
|
info: {
|
|
@@ -1610,7 +1610,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
|
1610
1610
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
|
1611
1611
|
// - Next.js version
|
|
1612
1612
|
// - next.config.js keys that affect compilation
|
|
1613
|
-
version: `${__dirname}|${"
|
|
1613
|
+
version: `${__dirname}|${"15.0.0-rc.0"}|${configVars}`,
|
|
1614
1614
|
cacheDirectory: path.join(distDir, 'cache', 'webpack'),
|
|
1615
1615
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
|
1616
1616
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|
package/dist/esm/client/index.js
CHANGED
|
@@ -25,7 +25,7 @@ import { SearchParamsContext, PathParamsContext } from '../shared/lib/hooks-clie
|
|
|
25
25
|
import { onRecoverableError } from './on-recoverable-error';
|
|
26
26
|
import tracer from './tracing/tracer';
|
|
27
27
|
import reportToSocket from './tracing/report-to-socket';
|
|
28
|
-
export const version = "
|
|
28
|
+
export const version = "15.0.0-rc.0";
|
|
29
29
|
export let router;
|
|
30
30
|
export const emitter = mitt();
|
|
31
31
|
const looseToArray = (input)=>[].slice.call(input);
|
|
@@ -40,7 +40,7 @@ export async function createHotReloaderTurbopack(opts, serverFields, distDir) {
|
|
|
40
40
|
}
|
|
41
41
|
const hasRewrites = opts.fsChecker.rewrites.afterFiles.length > 0 || opts.fsChecker.rewrites.beforeFiles.length > 0 || opts.fsChecker.rewrites.fallback.length > 0;
|
|
42
42
|
const hotReloaderSpan = trace('hot-reloader', undefined, {
|
|
43
|
-
version: "
|
|
43
|
+
version: "15.0.0-rc.0"
|
|
44
44
|
});
|
|
45
45
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
|
46
46
|
// of the current `next dev` invocation.
|
|
@@ -185,7 +185,7 @@ export default class HotReloaderWebpack {
|
|
|
185
185
|
this.previewProps = previewProps;
|
|
186
186
|
this.rewrites = rewrites;
|
|
187
187
|
this.hotReloaderSpan = trace('hot-reloader', undefined, {
|
|
188
|
-
version: "
|
|
188
|
+
version: "15.0.0-rc.0"
|
|
189
189
|
});
|
|
190
190
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
|
191
191
|
// of the current `next dev` invocation.
|
|
@@ -4,7 +4,7 @@ import { bold, purple } from '../../lib/picocolors';
|
|
|
4
4
|
import { PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_BUILD } from '../../shared/lib/constants';
|
|
5
5
|
import loadConfig, { getEnabledExperimentalFeatures } from '../config';
|
|
6
6
|
export function logStartInfo({ networkUrl, appUrl, envInfo, expFeatureInfo, maxExperimentalFeatures = Infinity }) {
|
|
7
|
-
Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"
|
|
7
|
+
Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"15.0.0-rc.0"}`))}${process.env.TURBOPACK ? ' (turbo)' : ''}`);
|
|
8
8
|
if (appUrl) {
|
|
9
9
|
Log.bootstrap(`- Local: ${appUrl}`);
|
|
10
10
|
}
|
|
@@ -40,7 +40,7 @@ export async function getRequestHandlers({ dir, port, isDev, server, hostname, m
|
|
|
40
40
|
export async function startServer(serverOptions) {
|
|
41
41
|
const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
|
|
42
42
|
let { port } = serverOptions;
|
|
43
|
-
process.title = `next-server (v${"
|
|
43
|
+
process.title = `next-server (v${"15.0.0-rc.0"})`;
|
|
44
44
|
let handlersReady = ()=>{};
|
|
45
45
|
let handlersError = ()=>{};
|
|
46
46
|
let handlersPromise = new Promise((resolve, reject)=>{
|
|
@@ -92,17 +92,6 @@ const API_DOCS = {
|
|
|
92
92
|
maxDuration: {
|
|
93
93
|
description: '`maxDuration` allows you to set max default execution time for your function. If it is not specified, the default value is dependent on your deployment platform and plan.',
|
|
94
94
|
link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#maxduration'
|
|
95
|
-
},
|
|
96
|
-
experimental_ppr: {
|
|
97
|
-
description: `Enables experimental Partial Prerendering (PPR) for this page / layout, when PPR is set to "incremental" mode.`,
|
|
98
|
-
link: 'https://rc.nextjs.org/docs/app/api-reference/next-config-js/ppr',
|
|
99
|
-
options: {
|
|
100
|
-
true: 'Enable PPR for this route',
|
|
101
|
-
false: 'Disable PPR for this route'
|
|
102
|
-
},
|
|
103
|
-
isValid: (value)=>{
|
|
104
|
-
return value === 'true' || value === 'false';
|
|
105
|
-
}
|
|
106
95
|
}
|
|
107
96
|
};
|
|
108
97
|
function visitEntryConfig(fileName, position, callback) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/server/typescript/rules/config.ts"],"sourcesContent":["// This module provides intellisense for page and layout's exported configs.\n\nimport {\n getSource,\n isPositionInsideNode,\n getTs,\n removeStringQuotes,\n} from '../utils'\nimport {\n NEXT_TS_ERRORS,\n ALLOWED_EXPORTS,\n LEGACY_CONFIG_EXPORT,\n} from '../constant'\nimport type tsModule from 'typescript/lib/tsserverlibrary'\n\nconst API_DOCS: Record<\n string,\n {\n description: string\n options?: Record<string, string>\n link?: string\n type?: string\n isValid?: (value: string) => boolean\n getHint?: (value: any) => string | undefined\n }\n> = {\n dynamic: {\n description:\n 'The `dynamic` option provides a few ways to opt in or out of dynamic behavior.',\n options: {\n '\"auto\"':\n 'Heuristic to cache as much as possible but doesn’t prevent any component to opt-in to dynamic behavior.',\n '\"force-dynamic\"':\n 'This disables all caching of fetches and always revalidates. (This is equivalent to `getServerSideProps`.)',\n '\"error\"':\n 'This errors if any dynamic Hooks or fetches are used. (This is equivalent to `getStaticProps`.)',\n '\"force-static\"':\n 'This forces caching of all fetches and returns empty values from `cookies`, `headers` and `useSearchParams`.',\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamic',\n },\n fetchCache: {\n description:\n 'The `fetchCache` option controls how Next.js statically caches fetches. By default it statically caches fetches reachable before any dynamic Hooks are used, and it doesn’t cache fetches that are discovered after that.',\n options: {\n '\"force-no-store\"':\n \"This lets you intentionally opt-out of all caching of data. This option forces all fetches to be refetched every request even if the `cache: 'force-cache'` option is passed to `fetch()`.\",\n '\"only-no-store\"':\n \"This lets you enforce that all data opts out of caching. This option makes `fetch()` reject with an error if `cache: 'force-cache'` is provided. It also changes the default to `no-store`.\",\n '\"default-no-store\"':\n \"Allows any explicit `cache` option to be passed to `fetch()` but if `'default'`, or no option, is provided then it defaults to `'no-store'`. This means that even fetches before a dynamic Hook are considered dynamic.\",\n '\"auto\"':\n 'This is the default option. It caches any fetches with the default `cache` option provided, that happened before a dynamic Hook is used and don’t cache any such fetches if they’re issued after a dynamic Hook.',\n '\"default-cache\"':\n \"Allows any explicit `cache` option to be passed to `fetch()` but if `'default'`, or no option, is provided then it defaults to `'force-cache'`. This means that even fetches before a dynamic Hook are considered dynamic.\",\n '\"only-cache\"':\n \"This lets you enforce that all data opts into caching. This option makes `fetch()` reject with an error if `cache: 'force-cache'` is provided. It also changes the default to `force-cache`. This error can be discovered early during static builds - or dynamically during Edge rendering.\",\n '\"force-cache\"':\n \"This lets you intentionally opt-in to all caching of data. This option forces all fetches to be cache even if the `cache: 'no-store'` option is passed to `fetch()`.\",\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#fetchcache',\n },\n preferredRegion: {\n description:\n 'Specify the perferred region that this layout or page should be deployed to. If the region option is not specified, it inherits the option from the nearest parent layout. The root defaults to `\"auto\"`.\\n\\nYou can also specify a region, such as \"iad1\", or an array of regions, such as `[\"iad1\", \"sfo1\"]`.',\n options: {\n '\"auto\"':\n 'Next.js will first deploy to the `\"home\"` region. Then if it doesn’t detect any waterfall requests after a few requests, it can upgrade that route, to be deployed globally. If it detects any waterfall requests after that, it can eventually downgrade back to `\"home`\".',\n '\"global\"': 'Prefer deploying globally.',\n '\"home\"': 'Prefer deploying to the Home region.',\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#preferredregion',\n isValid: (value: string) => {\n try {\n const parsed = JSON.parse(value)\n return (\n typeof parsed === 'string' ||\n (Array.isArray(parsed) && !parsed.some((v) => typeof v !== 'string'))\n )\n } catch (err) {\n return false\n }\n },\n getHint: (value: any) => {\n if (value === 'auto') return `Automatically chosen by Next.js.`\n if (value === 'global') return `Prefer deploying globally.`\n if (value === 'home') return `Prefer deploying to the Home region.`\n if (Array.isArray(value)) return `Deploy to regions: ${value.join(', ')}.`\n if (typeof value === 'string') return `Deploy to region: ${value}.`\n },\n },\n revalidate: {\n description:\n 'The `revalidate` option sets the default revalidation time for that layout or page. Note that it doesn’t override the value specify by each `fetch()`.',\n type: 'mixed',\n options: {\n false:\n 'This is the default and changes the fetch cache to indefinitely cache anything that uses force-cache or is fetched before a dynamic Hook/fetch.',\n 0: 'Specifying `0` implies that this layout or page should never be static.',\n 30: 'Set the revalidation time to `30` seconds. The value can be `0` or any positive number.',\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#revalidate',\n isValid: (value: string) => {\n return value === 'false' || Number(value.replace(/_/g, '')) >= 0\n },\n getHint: (value: any) => {\n return `Set the default revalidation time to \\`${value}\\` seconds.`\n },\n },\n dynamicParams: {\n description:\n '`dynamicParams` replaces the `fallback` option of `getStaticPaths`. It controls whether we allow `dynamicParams` beyond the generated static params from `generateStaticParams`.',\n options: {\n true: 'Allow rendering dynamic params that are not generated by `generateStaticParams`.',\n false:\n 'Disallow rendering dynamic params that are not generated by `generateStaticParams`.',\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams',\n isValid: (value: string) => {\n return value === 'true' || value === 'false'\n },\n },\n runtime: {\n description:\n 'The `runtime` option controls the preferred runtime to render this route.',\n options: {\n '\"nodejs\"': 'Prefer the Node.js runtime.',\n '\"edge\"': 'Prefer the Edge runtime.',\n '\"experimental-edge\"': `@deprecated\\n\\nThis option is no longer experimental. Use \\`edge\\` instead.`,\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#runtime',\n },\n metadata: {\n description: 'Next.js Metadata configurations',\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/metadata',\n },\n maxDuration: {\n description:\n '`maxDuration` allows you to set max default execution time for your function. If it is not specified, the default value is dependent on your deployment platform and plan.',\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#maxduration',\n },\n experimental_ppr: {\n description: `Enables experimental Partial Prerendering (PPR) for this page / layout, when PPR is set to \"incremental\" mode.`,\n link: 'https://rc.nextjs.org/docs/app/api-reference/next-config-js/ppr',\n options: {\n true: 'Enable PPR for this route',\n false: 'Disable PPR for this route',\n },\n isValid: (value: string) => {\n return value === 'true' || value === 'false'\n },\n },\n}\n\nfunction visitEntryConfig(\n fileName: string,\n position: number,\n callback: (entryEonfig: string, value: tsModule.VariableDeclaration) => void\n) {\n const source = getSource(fileName)\n if (source) {\n const ts = getTs()\n ts.forEachChild(source, function visit(node) {\n // Covered by this node\n if (isPositionInsideNode(position, node)) {\n // Export variable\n if (\n ts.isVariableStatement(node) &&\n node.modifiers?.some((m) => m.kind === ts.SyntaxKind.ExportKeyword)\n ) {\n if (ts.isVariableDeclarationList(node.declarationList)) {\n for (const declaration of node.declarationList.declarations) {\n if (isPositionInsideNode(position, declaration)) {\n // `export const ... = ...`\n const text = declaration.name.getText()\n callback(text, declaration)\n }\n }\n }\n }\n }\n })\n }\n}\n\nfunction createAutoCompletionOptionName(sort: number, name: string) {\n const ts = getTs()\n return {\n name,\n sortText: '!' + sort,\n kind: ts.ScriptElementKind.constElement,\n kindModifiers: ts.ScriptElementKindModifier.exportedModifier,\n labelDetails: {\n description: `Next.js ${name} option`,\n },\n data: {\n exportName: name,\n moduleSpecifier: 'next/typescript/entry_option_name',\n },\n } as tsModule.CompletionEntry\n}\n\nfunction createAutoCompletionOptionValue(\n sort: number,\n name: string,\n apiName: string\n) {\n const ts = getTs()\n const isString = name.startsWith('\"')\n return {\n name,\n insertText: removeStringQuotes(name),\n sortText: '' + sort,\n kind: isString ? ts.ScriptElementKind.string : ts.ScriptElementKind.unknown,\n kindModifiers: ts.ScriptElementKindModifier.none,\n labelDetails: {\n description: `Next.js ${apiName} option`,\n },\n data: {\n exportName: apiName,\n moduleSpecifier: 'next/typescript/entry_option_value',\n },\n } as tsModule.CompletionEntry\n}\n\nfunction getAPIDescription(api: string): string {\n return (\n API_DOCS[api].description +\n '\\n\\n' +\n Object.entries(API_DOCS[api].options || {})\n .map(([key, value]) => `- \\`${key}\\`: ${value}`)\n .join('\\n')\n )\n}\nconst config = {\n // Auto completion for entry exported configs.\n addCompletionsAtPosition(\n fileName: string,\n position: number,\n prior: tsModule.WithMetadata<tsModule.CompletionInfo>\n ) {\n visitEntryConfig(fileName, position, (entryConfig, declaration) => {\n if (!API_DOCS[entryConfig]) {\n if (isPositionInsideNode(position, declaration.name)) {\n prior.entries.push(\n ...Object.keys(API_DOCS).map((name, index) => {\n return createAutoCompletionOptionName(index, name)\n })\n )\n }\n return\n }\n\n prior.entries.push(\n ...Object.keys(API_DOCS[entryConfig].options || {}).map(\n (name, index) => {\n return createAutoCompletionOptionValue(index, name, entryConfig)\n }\n )\n )\n })\n },\n\n // Show docs when hovering on the exported configs.\n getQuickInfoAtPosition(fileName: string, position: number) {\n const ts = getTs()\n\n let overridden: tsModule.QuickInfo | undefined\n visitEntryConfig(fileName, position, (entryConfig, declaration) => {\n if (!API_DOCS[entryConfig]) return\n\n const name = declaration.name\n const value = declaration.initializer\n\n const docsLink = {\n kind: 'text',\n text:\n `\\n\\nRead more about the \"${entryConfig}\" option: ` +\n API_DOCS[entryConfig].link,\n }\n\n if (value && isPositionInsideNode(position, value)) {\n // Hovers the value of the config\n const isString = ts.isStringLiteral(value)\n const text = removeStringQuotes(value.getText())\n const key = isString ? `\"${text}\"` : text\n\n const isValid = API_DOCS[entryConfig].isValid\n ? API_DOCS[entryConfig].isValid?.(key)\n : !!API_DOCS[entryConfig].options?.[key]\n\n if (isValid) {\n overridden = {\n kind: ts.ScriptElementKind.enumElement,\n kindModifiers: ts.ScriptElementKindModifier.none,\n textSpan: {\n start: value.getStart(),\n length: value.getWidth(),\n },\n displayParts: [],\n documentation: [\n {\n kind: 'text',\n text:\n API_DOCS[entryConfig].options?.[key] ||\n API_DOCS[entryConfig].getHint?.(key) ||\n '',\n },\n docsLink,\n ],\n }\n } else {\n // Wrong value, display the docs link\n overridden = {\n kind: ts.ScriptElementKind.enumElement,\n kindModifiers: ts.ScriptElementKindModifier.none,\n textSpan: {\n start: value.getStart(),\n length: value.getWidth(),\n },\n displayParts: [],\n documentation: [docsLink],\n }\n }\n } else {\n // Hovers the name of the config\n overridden = {\n kind: ts.ScriptElementKind.enumElement,\n kindModifiers: ts.ScriptElementKindModifier.none,\n textSpan: {\n start: name.getStart(),\n length: name.getWidth(),\n },\n displayParts: [],\n documentation: [\n {\n kind: 'text',\n text: getAPIDescription(entryConfig),\n },\n docsLink,\n ],\n }\n }\n })\n return overridden\n },\n\n // Show details on the side when auto completing.\n getCompletionEntryDetails(\n entryName: string,\n data: tsModule.CompletionEntryData\n ) {\n const ts = getTs()\n if (\n data &&\n data.moduleSpecifier &&\n data.moduleSpecifier.startsWith('next/typescript')\n ) {\n let content = ''\n if (data.moduleSpecifier === 'next/typescript/entry_option_name') {\n content = getAPIDescription(entryName)\n } else {\n const options = API_DOCS[data.exportName].options\n if (!options) return\n content = options[entryName]\n }\n return {\n name: entryName,\n kind: ts.ScriptElementKind.enumElement,\n kindModifiers: ts.ScriptElementKindModifier.none,\n displayParts: [],\n documentation: [\n {\n kind: 'text',\n text: content,\n },\n ],\n }\n }\n },\n\n // Show errors for invalid export fields.\n getSemanticDiagnosticsForExportVariableStatement(\n source: tsModule.SourceFile,\n node: tsModule.VariableStatement\n ) {\n const ts = getTs()\n\n const diagnostics: tsModule.Diagnostic[] = []\n\n // Check if it has correct option exports\n if (ts.isVariableDeclarationList(node.declarationList)) {\n for (const declaration of node.declarationList.declarations) {\n const name = declaration.name\n if (ts.isIdentifier(name)) {\n if (!ALLOWED_EXPORTS.includes(name.text) && !API_DOCS[name.text]) {\n diagnostics.push({\n file: source,\n category: ts.DiagnosticCategory.Error,\n code: NEXT_TS_ERRORS.INVALID_ENTRY_EXPORT,\n messageText: `\"${name.text}\" is not a valid Next.js entry export value.`,\n start: name.getStart(),\n length: name.getWidth(),\n })\n } else if (API_DOCS[name.text]) {\n // Check if the value is valid\n const value = declaration.initializer\n const options = API_DOCS[name.text].options\n\n if (value && options) {\n let displayedValue = ''\n let errorMessage = ''\n let isInvalid = false\n\n if (\n ts.isStringLiteral(value) ||\n ts.isNoSubstitutionTemplateLiteral(value)\n ) {\n const val = '\"' + removeStringQuotes(value.getText()) + '\"'\n const allowedValues = Object.keys(options).filter((v) =>\n /^['\"]/.test(v)\n )\n\n if (\n !allowedValues.includes(val) &&\n !API_DOCS[name.text].isValid?.(val)\n ) {\n isInvalid = true\n displayedValue = val\n }\n } else if (\n ts.isNumericLiteral(value) ||\n (ts.isPrefixUnaryExpression(value) &&\n ts.isMinusToken((value as any).operator) &&\n (ts.isNumericLiteral((value as any).operand.kind) ||\n (ts.isIdentifier((value as any).operand.kind) &&\n (value as any).operand.kind.getText() === 'Infinity'))) ||\n (ts.isIdentifier(value) && value.getText() === 'Infinity')\n ) {\n const v = value.getText()\n if (!API_DOCS[name.text].isValid?.(v)) {\n isInvalid = true\n displayedValue = v\n }\n } else if (\n value.kind === ts.SyntaxKind.TrueKeyword ||\n value.kind === ts.SyntaxKind.FalseKeyword\n ) {\n const v = value.getText()\n if (!API_DOCS[name.text].isValid?.(v)) {\n isInvalid = true\n displayedValue = v\n }\n } else if (ts.isArrayLiteralExpression(value)) {\n const v = value.getText()\n if (\n !API_DOCS[name.text].isValid?.(\n JSON.stringify(value.elements.map((e) => e.getText()))\n )\n ) {\n isInvalid = true\n displayedValue = v\n }\n } else if (\n // Other literals\n ts.isBigIntLiteral(value) ||\n ts.isObjectLiteralExpression(value) ||\n ts.isRegularExpressionLiteral(value) ||\n ts.isPrefixUnaryExpression(value)\n ) {\n isInvalid = true\n displayedValue = value.getText()\n } else {\n // Not a literal, error because it's not statically analyzable\n isInvalid = true\n displayedValue = value.getText()\n errorMessage = `\"${displayedValue}\" is not a valid value for the \"${name.text}\" option. The configuration must be statically analyzable.`\n }\n\n if (isInvalid) {\n diagnostics.push({\n file: source,\n category: ts.DiagnosticCategory.Error,\n code: NEXT_TS_ERRORS.INVALID_OPTION_VALUE,\n messageText:\n errorMessage ||\n `\"${displayedValue}\" is not a valid value for the \"${name.text}\" option.`,\n start: value.getStart(),\n length: value.getWidth(),\n })\n }\n }\n } else if (name.text === LEGACY_CONFIG_EXPORT) {\n // export const config = { ... }\n // Error if using `amp: ...`\n const value = declaration.initializer\n if (value && ts.isObjectLiteralExpression(value)) {\n for (const prop of value.properties) {\n if (\n ts.isPropertyAssignment(prop) &&\n ts.isIdentifier(prop.name) &&\n prop.name.text === 'amp'\n ) {\n diagnostics.push({\n file: source,\n category: ts.DiagnosticCategory.Error,\n code: NEXT_TS_ERRORS.INVALID_CONFIG_OPTION,\n messageText: `AMP is not supported in the app directory. If you need to use AMP it will continue to be supported in the pages directory.`,\n start: prop.getStart(),\n length: prop.getWidth(),\n })\n }\n }\n }\n }\n }\n }\n }\n\n return diagnostics\n },\n}\n\nexport default config\n"],"names":["getSource","isPositionInsideNode","getTs","removeStringQuotes","NEXT_TS_ERRORS","ALLOWED_EXPORTS","LEGACY_CONFIG_EXPORT","API_DOCS","dynamic","description","options","link","fetchCache","preferredRegion","isValid","value","parsed","JSON","parse","Array","isArray","some","v","err","getHint","join","revalidate","type","false","Number","replace","dynamicParams","true","runtime","metadata","maxDuration","experimental_ppr","visitEntryConfig","fileName","position","callback","source","ts","forEachChild","visit","node","isVariableStatement","modifiers","m","kind","SyntaxKind","ExportKeyword","isVariableDeclarationList","declarationList","declaration","declarations","text","name","getText","createAutoCompletionOptionName","sort","sortText","ScriptElementKind","constElement","kindModifiers","ScriptElementKindModifier","exportedModifier","labelDetails","data","exportName","moduleSpecifier","createAutoCompletionOptionValue","apiName","isString","startsWith","insertText","string","unknown","none","getAPIDescription","api","Object","entries","map","key","config","addCompletionsAtPosition","prior","entryConfig","push","keys","index","getQuickInfoAtPosition","overridden","initializer","docsLink","isStringLiteral","enumElement","textSpan","start","getStart","length","getWidth","displayParts","documentation","getCompletionEntryDetails","entryName","content","getSemanticDiagnosticsForExportVariableStatement","diagnostics","isIdentifier","includes","file","category","DiagnosticCategory","Error","code","INVALID_ENTRY_EXPORT","messageText","displayedValue","errorMessage","isInvalid","isNoSubstitutionTemplateLiteral","val","allowedValues","filter","test","isNumericLiteral","isPrefixUnaryExpression","isMinusToken","operator","operand","TrueKeyword","FalseKeyword","isArrayLiteralExpression","stringify","elements","e","isBigIntLiteral","isObjectLiteralExpression","isRegularExpressionLiteral","INVALID_OPTION_VALUE","prop","properties","isPropertyAssignment","INVALID_CONFIG_OPTION"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,4EAA4E;AAE5E,SACEA,SAAS,EACTC,oBAAoB,EACpBC,KAAK,EACLC,kBAAkB,QACb,WAAU;AACjB,SACEC,cAAc,EACdC,eAAe,EACfC,oBAAoB,QACf,cAAa;AAGpB,MAAMC,WAUF;IACFC,SAAS;QACPC,aACE;QACFC,SAAS;YACP,UACE;YACF,mBACE;YACF,WACE;YACF,kBACE;QACJ;QACAC,MAAM;IACR;IACAC,YAAY;QACVH,aACE;QACFC,SAAS;YACP,oBACE;YACF,mBACE;YACF,sBACE;YACF,UACE;YACF,mBACE;YACF,gBACE;YACF,iBACE;QACJ;QACAC,MAAM;IACR;IACAE,iBAAiB;QACfJ,aACE;QACFC,SAAS;YACP,UACE;YACF,YAAY;YACZ,UAAU;QACZ;QACAC,MAAM;QACNG,SAAS,CAACC;YACR,IAAI;gBACF,MAAMC,SAASC,KAAKC,KAAK,CAACH;gBAC1B,OACE,OAAOC,WAAW,YACjB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A4B;wBAC5B,MAAMS,QAAQuC,YAAYwC,WAAW;wBACrC,IAAI/E,SAAS2B,GAAGiG,yBAAyB,CAAC5H,QAAQ;4BAChD,KAAK,MAAM+H,QAAQ/H,MAAMgI,UAAU,CAAE;gCACnC,IACErG,GAAGsG,oBAAoB,CAACF,SACxBpG,GAAGoE,YAAY,CAACgC,KAAKrF,IAAI,KACzBqF,KAAKrF,IAAI,CAACD,IAAI,KAAK,OACnB;oCACAqD,YAAYpB,IAAI,CAAC;wCACfuB,MAAMvE;wCACNwE,UAAUvE,GAAGwE,kBAAkB,CAACC,KAAK;wCACrCC,MAAMhH,eAAe6I,qBAAqB;wCAC1C3B,aAAa,CAAC,0HAA0H,CAAC;wCACzInB,OAAO2C,KAAK1C,QAAQ;wCACpBC,QAAQyC,KAAKxC,QAAQ;oCACvB;gCACF;4BACF;wBACF;oBACF;gBACF;YACF;QACF;QAEA,OAAOO;IACT;AACF;AAEA,eAAexB,OAAM"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/server/typescript/rules/config.ts"],"sourcesContent":["// This module provides intellisense for page and layout's exported configs.\n\nimport {\n getSource,\n isPositionInsideNode,\n getTs,\n removeStringQuotes,\n} from '../utils'\nimport {\n NEXT_TS_ERRORS,\n ALLOWED_EXPORTS,\n LEGACY_CONFIG_EXPORT,\n} from '../constant'\nimport type tsModule from 'typescript/lib/tsserverlibrary'\n\nconst API_DOCS: Record<\n string,\n {\n description: string\n options?: Record<string, string>\n link?: string\n type?: string\n isValid?: (value: string) => boolean\n getHint?: (value: any) => string | undefined\n }\n> = {\n dynamic: {\n description:\n 'The `dynamic` option provides a few ways to opt in or out of dynamic behavior.',\n options: {\n '\"auto\"':\n 'Heuristic to cache as much as possible but doesn’t prevent any component to opt-in to dynamic behavior.',\n '\"force-dynamic\"':\n 'This disables all caching of fetches and always revalidates. (This is equivalent to `getServerSideProps`.)',\n '\"error\"':\n 'This errors if any dynamic Hooks or fetches are used. (This is equivalent to `getStaticProps`.)',\n '\"force-static\"':\n 'This forces caching of all fetches and returns empty values from `cookies`, `headers` and `useSearchParams`.',\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamic',\n },\n fetchCache: {\n description:\n 'The `fetchCache` option controls how Next.js statically caches fetches. By default it statically caches fetches reachable before any dynamic Hooks are used, and it doesn’t cache fetches that are discovered after that.',\n options: {\n '\"force-no-store\"':\n \"This lets you intentionally opt-out of all caching of data. This option forces all fetches to be refetched every request even if the `cache: 'force-cache'` option is passed to `fetch()`.\",\n '\"only-no-store\"':\n \"This lets you enforce that all data opts out of caching. This option makes `fetch()` reject with an error if `cache: 'force-cache'` is provided. It also changes the default to `no-store`.\",\n '\"default-no-store\"':\n \"Allows any explicit `cache` option to be passed to `fetch()` but if `'default'`, or no option, is provided then it defaults to `'no-store'`. This means that even fetches before a dynamic Hook are considered dynamic.\",\n '\"auto\"':\n 'This is the default option. It caches any fetches with the default `cache` option provided, that happened before a dynamic Hook is used and don’t cache any such fetches if they’re issued after a dynamic Hook.',\n '\"default-cache\"':\n \"Allows any explicit `cache` option to be passed to `fetch()` but if `'default'`, or no option, is provided then it defaults to `'force-cache'`. This means that even fetches before a dynamic Hook are considered dynamic.\",\n '\"only-cache\"':\n \"This lets you enforce that all data opts into caching. This option makes `fetch()` reject with an error if `cache: 'force-cache'` is provided. It also changes the default to `force-cache`. This error can be discovered early during static builds - or dynamically during Edge rendering.\",\n '\"force-cache\"':\n \"This lets you intentionally opt-in to all caching of data. This option forces all fetches to be cache even if the `cache: 'no-store'` option is passed to `fetch()`.\",\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#fetchcache',\n },\n preferredRegion: {\n description:\n 'Specify the perferred region that this layout or page should be deployed to. If the region option is not specified, it inherits the option from the nearest parent layout. The root defaults to `\"auto\"`.\\n\\nYou can also specify a region, such as \"iad1\", or an array of regions, such as `[\"iad1\", \"sfo1\"]`.',\n options: {\n '\"auto\"':\n 'Next.js will first deploy to the `\"home\"` region. Then if it doesn’t detect any waterfall requests after a few requests, it can upgrade that route, to be deployed globally. If it detects any waterfall requests after that, it can eventually downgrade back to `\"home`\".',\n '\"global\"': 'Prefer deploying globally.',\n '\"home\"': 'Prefer deploying to the Home region.',\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#preferredregion',\n isValid: (value: string) => {\n try {\n const parsed = JSON.parse(value)\n return (\n typeof parsed === 'string' ||\n (Array.isArray(parsed) && !parsed.some((v) => typeof v !== 'string'))\n )\n } catch (err) {\n return false\n }\n },\n getHint: (value: any) => {\n if (value === 'auto') return `Automatically chosen by Next.js.`\n if (value === 'global') return `Prefer deploying globally.`\n if (value === 'home') return `Prefer deploying to the Home region.`\n if (Array.isArray(value)) return `Deploy to regions: ${value.join(', ')}.`\n if (typeof value === 'string') return `Deploy to region: ${value}.`\n },\n },\n revalidate: {\n description:\n 'The `revalidate` option sets the default revalidation time for that layout or page. Note that it doesn’t override the value specify by each `fetch()`.',\n type: 'mixed',\n options: {\n false:\n 'This is the default and changes the fetch cache to indefinitely cache anything that uses force-cache or is fetched before a dynamic Hook/fetch.',\n 0: 'Specifying `0` implies that this layout or page should never be static.',\n 30: 'Set the revalidation time to `30` seconds. The value can be `0` or any positive number.',\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#revalidate',\n isValid: (value: string) => {\n return value === 'false' || Number(value.replace(/_/g, '')) >= 0\n },\n getHint: (value: any) => {\n return `Set the default revalidation time to \\`${value}\\` seconds.`\n },\n },\n dynamicParams: {\n description:\n '`dynamicParams` replaces the `fallback` option of `getStaticPaths`. It controls whether we allow `dynamicParams` beyond the generated static params from `generateStaticParams`.',\n options: {\n true: 'Allow rendering dynamic params that are not generated by `generateStaticParams`.',\n false:\n 'Disallow rendering dynamic params that are not generated by `generateStaticParams`.',\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams',\n isValid: (value: string) => {\n return value === 'true' || value === 'false'\n },\n },\n runtime: {\n description:\n 'The `runtime` option controls the preferred runtime to render this route.',\n options: {\n '\"nodejs\"': 'Prefer the Node.js runtime.',\n '\"edge\"': 'Prefer the Edge runtime.',\n '\"experimental-edge\"': `@deprecated\\n\\nThis option is no longer experimental. Use \\`edge\\` instead.`,\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#runtime',\n },\n metadata: {\n description: 'Next.js Metadata configurations',\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/metadata',\n },\n maxDuration: {\n description:\n '`maxDuration` allows you to set max default execution time for your function. If it is not specified, the default value is dependent on your deployment platform and plan.',\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#maxduration',\n },\n}\n\nfunction visitEntryConfig(\n fileName: string,\n position: number,\n callback: (entryEonfig: string, value: tsModule.VariableDeclaration) => void\n) {\n const source = getSource(fileName)\n if (source) {\n const ts = getTs()\n ts.forEachChild(source, function visit(node) {\n // Covered by this node\n if (isPositionInsideNode(position, node)) {\n // Export variable\n if (\n ts.isVariableStatement(node) &&\n node.modifiers?.some((m) => m.kind === ts.SyntaxKind.ExportKeyword)\n ) {\n if (ts.isVariableDeclarationList(node.declarationList)) {\n for (const declaration of node.declarationList.declarations) {\n if (isPositionInsideNode(position, declaration)) {\n // `export const ... = ...`\n const text = declaration.name.getText()\n callback(text, declaration)\n }\n }\n }\n }\n }\n })\n }\n}\n\nfunction createAutoCompletionOptionName(sort: number, name: string) {\n const ts = getTs()\n return {\n name,\n sortText: '!' + sort,\n kind: ts.ScriptElementKind.constElement,\n kindModifiers: ts.ScriptElementKindModifier.exportedModifier,\n labelDetails: {\n description: `Next.js ${name} option`,\n },\n data: {\n exportName: name,\n moduleSpecifier: 'next/typescript/entry_option_name',\n },\n } as tsModule.CompletionEntry\n}\n\nfunction createAutoCompletionOptionValue(\n sort: number,\n name: string,\n apiName: string\n) {\n const ts = getTs()\n const isString = name.startsWith('\"')\n return {\n name,\n insertText: removeStringQuotes(name),\n sortText: '' + sort,\n kind: isString ? ts.ScriptElementKind.string : ts.ScriptElementKind.unknown,\n kindModifiers: ts.ScriptElementKindModifier.none,\n labelDetails: {\n description: `Next.js ${apiName} option`,\n },\n data: {\n exportName: apiName,\n moduleSpecifier: 'next/typescript/entry_option_value',\n },\n } as tsModule.CompletionEntry\n}\n\nfunction getAPIDescription(api: string): string {\n return (\n API_DOCS[api].description +\n '\\n\\n' +\n Object.entries(API_DOCS[api].options || {})\n .map(([key, value]) => `- \\`${key}\\`: ${value}`)\n .join('\\n')\n )\n}\nconst config = {\n // Auto completion for entry exported configs.\n addCompletionsAtPosition(\n fileName: string,\n position: number,\n prior: tsModule.WithMetadata<tsModule.CompletionInfo>\n ) {\n visitEntryConfig(fileName, position, (entryConfig, declaration) => {\n if (!API_DOCS[entryConfig]) {\n if (isPositionInsideNode(position, declaration.name)) {\n prior.entries.push(\n ...Object.keys(API_DOCS).map((name, index) => {\n return createAutoCompletionOptionName(index, name)\n })\n )\n }\n return\n }\n\n prior.entries.push(\n ...Object.keys(API_DOCS[entryConfig].options || {}).map(\n (name, index) => {\n return createAutoCompletionOptionValue(index, name, entryConfig)\n }\n )\n )\n })\n },\n\n // Show docs when hovering on the exported configs.\n getQuickInfoAtPosition(fileName: string, position: number) {\n const ts = getTs()\n\n let overridden: tsModule.QuickInfo | undefined\n visitEntryConfig(fileName, position, (entryConfig, declaration) => {\n if (!API_DOCS[entryConfig]) return\n\n const name = declaration.name\n const value = declaration.initializer\n\n const docsLink = {\n kind: 'text',\n text:\n `\\n\\nRead more about the \"${entryConfig}\" option: ` +\n API_DOCS[entryConfig].link,\n }\n\n if (value && isPositionInsideNode(position, value)) {\n // Hovers the value of the config\n const isString = ts.isStringLiteral(value)\n const text = removeStringQuotes(value.getText())\n const key = isString ? `\"${text}\"` : text\n\n const isValid = API_DOCS[entryConfig].isValid\n ? API_DOCS[entryConfig].isValid?.(key)\n : !!API_DOCS[entryConfig].options?.[key]\n\n if (isValid) {\n overridden = {\n kind: ts.ScriptElementKind.enumElement,\n kindModifiers: ts.ScriptElementKindModifier.none,\n textSpan: {\n start: value.getStart(),\n length: value.getWidth(),\n },\n displayParts: [],\n documentation: [\n {\n kind: 'text',\n text:\n API_DOCS[entryConfig].options?.[key] ||\n API_DOCS[entryConfig].getHint?.(key) ||\n '',\n },\n docsLink,\n ],\n }\n } else {\n // Wrong value, display the docs link\n overridden = {\n kind: ts.ScriptElementKind.enumElement,\n kindModifiers: ts.ScriptElementKindModifier.none,\n textSpan: {\n start: value.getStart(),\n length: value.getWidth(),\n },\n displayParts: [],\n documentation: [docsLink],\n }\n }\n } else {\n // Hovers the name of the config\n overridden = {\n kind: ts.ScriptElementKind.enumElement,\n kindModifiers: ts.ScriptElementKindModifier.none,\n textSpan: {\n start: name.getStart(),\n length: name.getWidth(),\n },\n displayParts: [],\n documentation: [\n {\n kind: 'text',\n text: getAPIDescription(entryConfig),\n },\n docsLink,\n ],\n }\n }\n })\n return overridden\n },\n\n // Show details on the side when auto completing.\n getCompletionEntryDetails(\n entryName: string,\n data: tsModule.CompletionEntryData\n ) {\n const ts = getTs()\n if (\n data &&\n data.moduleSpecifier &&\n data.moduleSpecifier.startsWith('next/typescript')\n ) {\n let content = ''\n if (data.moduleSpecifier === 'next/typescript/entry_option_name') {\n content = getAPIDescription(entryName)\n } else {\n const options = API_DOCS[data.exportName].options\n if (!options) return\n content = options[entryName]\n }\n return {\n name: entryName,\n kind: ts.ScriptElementKind.enumElement,\n kindModifiers: ts.ScriptElementKindModifier.none,\n displayParts: [],\n documentation: [\n {\n kind: 'text',\n text: content,\n },\n ],\n }\n }\n },\n\n // Show errors for invalid export fields.\n getSemanticDiagnosticsForExportVariableStatement(\n source: tsModule.SourceFile,\n node: tsModule.VariableStatement\n ) {\n const ts = getTs()\n\n const diagnostics: tsModule.Diagnostic[] = []\n\n // Check if it has correct option exports\n if (ts.isVariableDeclarationList(node.declarationList)) {\n for (const declaration of node.declarationList.declarations) {\n const name = declaration.name\n if (ts.isIdentifier(name)) {\n if (!ALLOWED_EXPORTS.includes(name.text) && !API_DOCS[name.text]) {\n diagnostics.push({\n file: source,\n category: ts.DiagnosticCategory.Error,\n code: NEXT_TS_ERRORS.INVALID_ENTRY_EXPORT,\n messageText: `\"${name.text}\" is not a valid Next.js entry export value.`,\n start: name.getStart(),\n length: name.getWidth(),\n })\n } else if (API_DOCS[name.text]) {\n // Check if the value is valid\n const value = declaration.initializer\n const options = API_DOCS[name.text].options\n\n if (value && options) {\n let displayedValue = ''\n let errorMessage = ''\n let isInvalid = false\n\n if (\n ts.isStringLiteral(value) ||\n ts.isNoSubstitutionTemplateLiteral(value)\n ) {\n const val = '\"' + removeStringQuotes(value.getText()) + '\"'\n const allowedValues = Object.keys(options).filter((v) =>\n /^['\"]/.test(v)\n )\n\n if (\n !allowedValues.includes(val) &&\n !API_DOCS[name.text].isValid?.(val)\n ) {\n isInvalid = true\n displayedValue = val\n }\n } else if (\n ts.isNumericLiteral(value) ||\n (ts.isPrefixUnaryExpression(value) &&\n ts.isMinusToken((value as any).operator) &&\n (ts.isNumericLiteral((value as any).operand.kind) ||\n (ts.isIdentifier((value as any).operand.kind) &&\n (value as any).operand.kind.getText() === 'Infinity'))) ||\n (ts.isIdentifier(value) && value.getText() === 'Infinity')\n ) {\n const v = value.getText()\n if (!API_DOCS[name.text].isValid?.(v)) {\n isInvalid = true\n displayedValue = v\n }\n } else if (\n value.kind === ts.SyntaxKind.TrueKeyword ||\n value.kind === ts.SyntaxKind.FalseKeyword\n ) {\n const v = value.getText()\n if (!API_DOCS[name.text].isValid?.(v)) {\n isInvalid = true\n displayedValue = v\n }\n } else if (ts.isArrayLiteralExpression(value)) {\n const v = value.getText()\n if (\n !API_DOCS[name.text].isValid?.(\n JSON.stringify(value.elements.map((e) => e.getText()))\n )\n ) {\n isInvalid = true\n displayedValue = v\n }\n } else if (\n // Other literals\n ts.isBigIntLiteral(value) ||\n ts.isObjectLiteralExpression(value) ||\n ts.isRegularExpressionLiteral(value) ||\n ts.isPrefixUnaryExpression(value)\n ) {\n isInvalid = true\n displayedValue = value.getText()\n } else {\n // Not a literal, error because it's not statically analyzable\n isInvalid = true\n displayedValue = value.getText()\n errorMessage = `\"${displayedValue}\" is not a valid value for the \"${name.text}\" option. The configuration must be statically analyzable.`\n }\n\n if (isInvalid) {\n diagnostics.push({\n file: source,\n category: ts.DiagnosticCategory.Error,\n code: NEXT_TS_ERRORS.INVALID_OPTION_VALUE,\n messageText:\n errorMessage ||\n `\"${displayedValue}\" is not a valid value for the \"${name.text}\" option.`,\n start: value.getStart(),\n length: value.getWidth(),\n })\n }\n }\n } else if (name.text === LEGACY_CONFIG_EXPORT) {\n // export const config = { ... }\n // Error if using `amp: ...`\n const value = declaration.initializer\n if (value && ts.isObjectLiteralExpression(value)) {\n for (const prop of value.properties) {\n if (\n ts.isPropertyAssignment(prop) &&\n ts.isIdentifier(prop.name) &&\n prop.name.text === 'amp'\n ) {\n diagnostics.push({\n file: source,\n category: ts.DiagnosticCategory.Error,\n code: NEXT_TS_ERRORS.INVALID_CONFIG_OPTION,\n messageText: `AMP is not supported in the app directory. If you need to use AMP it will continue to be supported in the pages directory.`,\n start: prop.getStart(),\n length: prop.getWidth(),\n })\n }\n }\n }\n }\n }\n }\n }\n\n return diagnostics\n },\n}\n\nexport default config\n"],"names":["getSource","isPositionInsideNode","getTs","removeStringQuotes","NEXT_TS_ERRORS","ALLOWED_EXPORTS","LEGACY_CONFIG_EXPORT","API_DOCS","dynamic","description","options","link","fetchCache","preferredRegion","isValid","value","parsed","JSON","parse","Array","isArray","some","v","err","getHint","join","revalidate","type","false","Number","replace","dynamicParams","true","runtime","metadata","maxDuration","visitEntryConfig","fileName","position","callback","source","ts","forEachChild","visit","node","isVariableStatement","modifiers","m","kind","SyntaxKind","ExportKeyword","isVariableDeclarationList","declarationList","declaration","declarations","text","name","getText","createAutoCompletionOptionName","sort","sortText","ScriptElementKind","constElement","kindModifiers","ScriptElementKindModifier","exportedModifier","labelDetails","data","exportName","moduleSpecifier","createAutoCompletionOptionValue","apiName","isString","startsWith","insertText","string","unknown","none","getAPIDescription","api","Object","entries","map","key","config","addCompletionsAtPosition","prior","entryConfig","push","keys","index","getQuickInfoAtPosition","overridden","initializer","docsLink","isStringLiteral","enumElement","textSpan","start","getStart","length","getWidth","displayParts","documentation","getCompletionEntryDetails","entryName","content","getSemanticDiagnosticsForExportVariableStatement","diagnostics","isIdentifier","includes","file","category","DiagnosticCategory","Error","code","INVALID_ENTRY_EXPORT","messageText","displayedValue","errorMessage","isInvalid","isNoSubstitutionTemplateLiteral","val","allowedValues","filter","test","isNumericLiteral","isPrefixUnaryExpression","isMinusToken","operator","operand","TrueKeyword","FalseKeyword","isArrayLiteralExpression","stringify","elements","e","isBigIntLiteral","isObjectLiteralExpression","isRegularExpressionLiteral","INVALID_OPTION_VALUE","prop","properties","isPropertyAssignment","INVALID_CONFIG_OPTION"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,4EAA4E;AAE5E,SACEA,SAAS,EACTC,oBAAoB,EACpBC,KAAK,EACLC,kBAAkB,QACb,WAAU;AACjB,SACEC,cAAc,EACdC,eAAe,EACfC,oBAAoB,QACf,cAAa;AAGpB,MAAMC,WAUF;IACFC,SAAS;QACPC,aACE;QACFC,SAAS;YACP,UACE;YACF,mBACE;YAC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I,CAAC,SAAS,CAAC;oCAC3E2C,OAAOnF,MAAMoF,QAAQ;oCACrBC,QAAQrF,MAAMsF,QAAQ;gCACxB;4BACF;wBACF;oBACF,OAAO,IAAI7C,KAAKD,IAAI,KAAKjD,sBAAsB;wBAC7C,gCAAgC;wBAChC,4BAA4B;wBAC5B,MAAMS,QAAQsC,YAAYwC,WAAW;wBACrC,IAAI9E,SAAS0B,GAAGiG,yBAAyB,CAAC3H,QAAQ;4BAChD,KAAK,MAAM8H,QAAQ9H,MAAM+H,UAAU,CAAE;gCACnC,IACErG,GAAGsG,oBAAoB,CAACF,SACxBpG,GAAGoE,YAAY,CAACgC,KAAKrF,IAAI,KACzBqF,KAAKrF,IAAI,CAACD,IAAI,KAAK,OACnB;oCACAqD,YAAYpB,IAAI,CAAC;wCACfuB,MAAMvE;wCACNwE,UAAUvE,GAAGwE,kBAAkB,CAACC,KAAK;wCACrCC,MAAM/G,eAAe4I,qBAAqB;wCAC1C3B,aAAa,CAAC,0HAA0H,CAAC;wCACzInB,OAAO2C,KAAK1C,QAAQ;wCACpBC,QAAQyC,KAAKxC,QAAQ;oCACvB;gCACF;4BACF;wBACF;oBACF;gBACF;YACF;QACF;QAEA,OAAOO;IACT;AACF;AAEA,eAAexB,OAAM"}
|
|
@@ -96,7 +96,7 @@ async function createHotReloaderTurbopack(opts, serverFields, distDir) {
|
|
|
96
96
|
}
|
|
97
97
|
const hasRewrites = opts.fsChecker.rewrites.afterFiles.length > 0 || opts.fsChecker.rewrites.beforeFiles.length > 0 || opts.fsChecker.rewrites.fallback.length > 0;
|
|
98
98
|
const hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
|
|
99
|
-
version: "
|
|
99
|
+
version: "15.0.0-rc.0"
|
|
100
100
|
});
|
|
101
101
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
|
102
102
|
// of the current `next dev` invocation.
|
|
@@ -261,7 +261,7 @@ class HotReloaderWebpack {
|
|
|
261
261
|
this.previewProps = previewProps;
|
|
262
262
|
this.rewrites = rewrites;
|
|
263
263
|
this.hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
|
|
264
|
-
version: "
|
|
264
|
+
version: "15.0.0-rc.0"
|
|
265
265
|
});
|
|
266
266
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
|
267
267
|
// of the current `next dev` invocation.
|
|
@@ -67,7 +67,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
67
67
|
return newObj;
|
|
68
68
|
}
|
|
69
69
|
function logStartInfo({ networkUrl, appUrl, envInfo, expFeatureInfo, maxExperimentalFeatures = Infinity }) {
|
|
70
|
-
_log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"
|
|
70
|
+
_log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"15.0.0-rc.0"}`))}${process.env.TURBOPACK ? ' (turbo)' : ''}`);
|
|
71
71
|
if (appUrl) {
|
|
72
72
|
_log.bootstrap(`- Local: ${appUrl}`);
|
|
73
73
|
}
|
|
@@ -108,7 +108,7 @@ async function getRequestHandlers({ dir, port, isDev, server, hostname, minimalM
|
|
|
108
108
|
async function startServer(serverOptions) {
|
|
109
109
|
const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
|
|
110
110
|
let { port } = serverOptions;
|
|
111
|
-
process.title = `next-server (v${"
|
|
111
|
+
process.title = `next-server (v${"15.0.0-rc.0"})`;
|
|
112
112
|
let handlersReady = ()=>{};
|
|
113
113
|
let handlersError = ()=>{};
|
|
114
114
|
let handlersPromise = new Promise((resolve, reject)=>{
|
|
@@ -102,17 +102,6 @@ const API_DOCS = {
|
|
|
102
102
|
maxDuration: {
|
|
103
103
|
description: '`maxDuration` allows you to set max default execution time for your function. If it is not specified, the default value is dependent on your deployment platform and plan.',
|
|
104
104
|
link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#maxduration'
|
|
105
|
-
},
|
|
106
|
-
experimental_ppr: {
|
|
107
|
-
description: `Enables experimental Partial Prerendering (PPR) for this page / layout, when PPR is set to "incremental" mode.`,
|
|
108
|
-
link: 'https://rc.nextjs.org/docs/app/api-reference/next-config-js/ppr',
|
|
109
|
-
options: {
|
|
110
|
-
true: 'Enable PPR for this route',
|
|
111
|
-
false: 'Disable PPR for this route'
|
|
112
|
-
},
|
|
113
|
-
isValid: (value)=>{
|
|
114
|
-
return value === 'true' || value === 'false';
|
|
115
|
-
}
|
|
116
105
|
}
|
|
117
106
|
};
|
|
118
107
|
function visitEntryConfig(fileName, position, callback) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/server/typescript/rules/config.ts"],"sourcesContent":["// This module provides intellisense for page and layout's exported configs.\n\nimport {\n getSource,\n isPositionInsideNode,\n getTs,\n removeStringQuotes,\n} from '../utils'\nimport {\n NEXT_TS_ERRORS,\n ALLOWED_EXPORTS,\n LEGACY_CONFIG_EXPORT,\n} from '../constant'\nimport type tsModule from 'typescript/lib/tsserverlibrary'\n\nconst API_DOCS: Record<\n string,\n {\n description: string\n options?: Record<string, string>\n link?: string\n type?: string\n isValid?: (value: string) => boolean\n getHint?: (value: any) => string | undefined\n }\n> = {\n dynamic: {\n description:\n 'The `dynamic` option provides a few ways to opt in or out of dynamic behavior.',\n options: {\n '\"auto\"':\n 'Heuristic to cache as much as possible but doesn’t prevent any component to opt-in to dynamic behavior.',\n '\"force-dynamic\"':\n 'This disables all caching of fetches and always revalidates. (This is equivalent to `getServerSideProps`.)',\n '\"error\"':\n 'This errors if any dynamic Hooks or fetches are used. (This is equivalent to `getStaticProps`.)',\n '\"force-static\"':\n 'This forces caching of all fetches and returns empty values from `cookies`, `headers` and `useSearchParams`.',\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamic',\n },\n fetchCache: {\n description:\n 'The `fetchCache` option controls how Next.js statically caches fetches. By default it statically caches fetches reachable before any dynamic Hooks are used, and it doesn’t cache fetches that are discovered after that.',\n options: {\n '\"force-no-store\"':\n \"This lets you intentionally opt-out of all caching of data. This option forces all fetches to be refetched every request even if the `cache: 'force-cache'` option is passed to `fetch()`.\",\n '\"only-no-store\"':\n \"This lets you enforce that all data opts out of caching. This option makes `fetch()` reject with an error if `cache: 'force-cache'` is provided. It also changes the default to `no-store`.\",\n '\"default-no-store\"':\n \"Allows any explicit `cache` option to be passed to `fetch()` but if `'default'`, or no option, is provided then it defaults to `'no-store'`. This means that even fetches before a dynamic Hook are considered dynamic.\",\n '\"auto\"':\n 'This is the default option. It caches any fetches with the default `cache` option provided, that happened before a dynamic Hook is used and don’t cache any such fetches if they’re issued after a dynamic Hook.',\n '\"default-cache\"':\n \"Allows any explicit `cache` option to be passed to `fetch()` but if `'default'`, or no option, is provided then it defaults to `'force-cache'`. This means that even fetches before a dynamic Hook are considered dynamic.\",\n '\"only-cache\"':\n \"This lets you enforce that all data opts into caching. This option makes `fetch()` reject with an error if `cache: 'force-cache'` is provided. It also changes the default to `force-cache`. This error can be discovered early during static builds - or dynamically during Edge rendering.\",\n '\"force-cache\"':\n \"This lets you intentionally opt-in to all caching of data. This option forces all fetches to be cache even if the `cache: 'no-store'` option is passed to `fetch()`.\",\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#fetchcache',\n },\n preferredRegion: {\n description:\n 'Specify the perferred region that this layout or page should be deployed to. If the region option is not specified, it inherits the option from the nearest parent layout. The root defaults to `\"auto\"`.\\n\\nYou can also specify a region, such as \"iad1\", or an array of regions, such as `[\"iad1\", \"sfo1\"]`.',\n options: {\n '\"auto\"':\n 'Next.js will first deploy to the `\"home\"` region. Then if it doesn’t detect any waterfall requests after a few requests, it can upgrade that route, to be deployed globally. If it detects any waterfall requests after that, it can eventually downgrade back to `\"home`\".',\n '\"global\"': 'Prefer deploying globally.',\n '\"home\"': 'Prefer deploying to the Home region.',\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#preferredregion',\n isValid: (value: string) => {\n try {\n const parsed = JSON.parse(value)\n return (\n typeof parsed === 'string' ||\n (Array.isArray(parsed) && !parsed.some((v) => typeof v !== 'string'))\n )\n } catch (err) {\n return false\n }\n },\n getHint: (value: any) => {\n if (value === 'auto') return `Automatically chosen by Next.js.`\n if (value === 'global') return `Prefer deploying globally.`\n if (value === 'home') return `Prefer deploying to the Home region.`\n if (Array.isArray(value)) return `Deploy to regions: ${value.join(', ')}.`\n if (typeof value === 'string') return `Deploy to region: ${value}.`\n },\n },\n revalidate: {\n description:\n 'The `revalidate` option sets the default revalidation time for that layout or page. Note that it doesn’t override the value specify by each `fetch()`.',\n type: 'mixed',\n options: {\n false:\n 'This is the default and changes the fetch cache to indefinitely cache anything that uses force-cache or is fetched before a dynamic Hook/fetch.',\n 0: 'Specifying `0` implies that this layout or page should never be static.',\n 30: 'Set the revalidation time to `30` seconds. The value can be `0` or any positive number.',\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#revalidate',\n isValid: (value: string) => {\n return value === 'false' || Number(value.replace(/_/g, '')) >= 0\n },\n getHint: (value: any) => {\n return `Set the default revalidation time to \\`${value}\\` seconds.`\n },\n },\n dynamicParams: {\n description:\n '`dynamicParams` replaces the `fallback` option of `getStaticPaths`. It controls whether we allow `dynamicParams` beyond the generated static params from `generateStaticParams`.',\n options: {\n true: 'Allow rendering dynamic params that are not generated by `generateStaticParams`.',\n false:\n 'Disallow rendering dynamic params that are not generated by `generateStaticParams`.',\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams',\n isValid: (value: string) => {\n return value === 'true' || value === 'false'\n },\n },\n runtime: {\n description:\n 'The `runtime` option controls the preferred runtime to render this route.',\n options: {\n '\"nodejs\"': 'Prefer the Node.js runtime.',\n '\"edge\"': 'Prefer the Edge runtime.',\n '\"experimental-edge\"': `@deprecated\\n\\nThis option is no longer experimental. Use \\`edge\\` instead.`,\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#runtime',\n },\n metadata: {\n description: 'Next.js Metadata configurations',\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/metadata',\n },\n maxDuration: {\n description:\n '`maxDuration` allows you to set max default execution time for your function. If it is not specified, the default value is dependent on your deployment platform and plan.',\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#maxduration',\n },\n experimental_ppr: {\n description: `Enables experimental Partial Prerendering (PPR) for this page / layout, when PPR is set to \"incremental\" mode.`,\n link: 'https://rc.nextjs.org/docs/app/api-reference/next-config-js/ppr',\n options: {\n true: 'Enable PPR for this route',\n false: 'Disable PPR for this route',\n },\n isValid: (value: string) => {\n return value === 'true' || value === 'false'\n },\n },\n}\n\nfunction visitEntryConfig(\n fileName: string,\n position: number,\n callback: (entryEonfig: string, value: tsModule.VariableDeclaration) => void\n) {\n const source = getSource(fileName)\n if (source) {\n const ts = getTs()\n ts.forEachChild(source, function visit(node) {\n // Covered by this node\n if (isPositionInsideNode(position, node)) {\n // Export variable\n if (\n ts.isVariableStatement(node) &&\n node.modifiers?.some((m) => m.kind === ts.SyntaxKind.ExportKeyword)\n ) {\n if (ts.isVariableDeclarationList(node.declarationList)) {\n for (const declaration of node.declarationList.declarations) {\n if (isPositionInsideNode(position, declaration)) {\n // `export const ... = ...`\n const text = declaration.name.getText()\n callback(text, declaration)\n }\n }\n }\n }\n }\n })\n }\n}\n\nfunction createAutoCompletionOptionName(sort: number, name: string) {\n const ts = getTs()\n return {\n name,\n sortText: '!' + sort,\n kind: ts.ScriptElementKind.constElement,\n kindModifiers: ts.ScriptElementKindModifier.exportedModifier,\n labelDetails: {\n description: `Next.js ${name} option`,\n },\n data: {\n exportName: name,\n moduleSpecifier: 'next/typescript/entry_option_name',\n },\n } as tsModule.CompletionEntry\n}\n\nfunction createAutoCompletionOptionValue(\n sort: number,\n name: string,\n apiName: string\n) {\n const ts = getTs()\n const isString = name.startsWith('\"')\n return {\n name,\n insertText: removeStringQuotes(name),\n sortText: '' + sort,\n kind: isString ? ts.ScriptElementKind.string : ts.ScriptElementKind.unknown,\n kindModifiers: ts.ScriptElementKindModifier.none,\n labelDetails: {\n description: `Next.js ${apiName} option`,\n },\n data: {\n exportName: apiName,\n moduleSpecifier: 'next/typescript/entry_option_value',\n },\n } as tsModule.CompletionEntry\n}\n\nfunction getAPIDescription(api: string): string {\n return (\n API_DOCS[api].description +\n '\\n\\n' +\n Object.entries(API_DOCS[api].options || {})\n .map(([key, value]) => `- \\`${key}\\`: ${value}`)\n .join('\\n')\n )\n}\nconst config = {\n // Auto completion for entry exported configs.\n addCompletionsAtPosition(\n fileName: string,\n position: number,\n prior: tsModule.WithMetadata<tsModule.CompletionInfo>\n ) {\n visitEntryConfig(fileName, position, (entryConfig, declaration) => {\n if (!API_DOCS[entryConfig]) {\n if (isPositionInsideNode(position, declaration.name)) {\n prior.entries.push(\n ...Object.keys(API_DOCS).map((name, index) => {\n return createAutoCompletionOptionName(index, name)\n })\n )\n }\n return\n }\n\n prior.entries.push(\n ...Object.keys(API_DOCS[entryConfig].options || {}).map(\n (name, index) => {\n return createAutoCompletionOptionValue(index, name, entryConfig)\n }\n )\n )\n })\n },\n\n // Show docs when hovering on the exported configs.\n getQuickInfoAtPosition(fileName: string, position: number) {\n const ts = getTs()\n\n let overridden: tsModule.QuickInfo | undefined\n visitEntryConfig(fileName, position, (entryConfig, declaration) => {\n if (!API_DOCS[entryConfig]) return\n\n const name = declaration.name\n const value = declaration.initializer\n\n const docsLink = {\n kind: 'text',\n text:\n `\\n\\nRead more about the \"${entryConfig}\" option: ` +\n API_DOCS[entryConfig].link,\n }\n\n if (value && isPositionInsideNode(position, value)) {\n // Hovers the value of the config\n const isString = ts.isStringLiteral(value)\n const text = removeStringQuotes(value.getText())\n const key = isString ? `\"${text}\"` : text\n\n const isValid = API_DOCS[entryConfig].isValid\n ? API_DOCS[entryConfig].isValid?.(key)\n : !!API_DOCS[entryConfig].options?.[key]\n\n if (isValid) {\n overridden = {\n kind: ts.ScriptElementKind.enumElement,\n kindModifiers: ts.ScriptElementKindModifier.none,\n textSpan: {\n start: value.getStart(),\n length: value.getWidth(),\n },\n displayParts: [],\n documentation: [\n {\n kind: 'text',\n text:\n API_DOCS[entryConfig].options?.[key] ||\n API_DOCS[entryConfig].getHint?.(key) ||\n '',\n },\n docsLink,\n ],\n }\n } else {\n // Wrong value, display the docs link\n overridden = {\n kind: ts.ScriptElementKind.enumElement,\n kindModifiers: ts.ScriptElementKindModifier.none,\n textSpan: {\n start: value.getStart(),\n length: value.getWidth(),\n },\n displayParts: [],\n documentation: [docsLink],\n }\n }\n } else {\n // Hovers the name of the config\n overridden = {\n kind: ts.ScriptElementKind.enumElement,\n kindModifiers: ts.ScriptElementKindModifier.none,\n textSpan: {\n start: name.getStart(),\n length: name.getWidth(),\n },\n displayParts: [],\n documentation: [\n {\n kind: 'text',\n text: getAPIDescription(entryConfig),\n },\n docsLink,\n ],\n }\n }\n })\n return overridden\n },\n\n // Show details on the side when auto completing.\n getCompletionEntryDetails(\n entryName: string,\n data: tsModule.CompletionEntryData\n ) {\n const ts = getTs()\n if (\n data &&\n data.moduleSpecifier &&\n data.moduleSpecifier.startsWith('next/typescript')\n ) {\n let content = ''\n if (data.moduleSpecifier === 'next/typescript/entry_option_name') {\n content = getAPIDescription(entryName)\n } else {\n const options = API_DOCS[data.exportName].options\n if (!options) return\n content = options[entryName]\n }\n return {\n name: entryName,\n kind: ts.ScriptElementKind.enumElement,\n kindModifiers: ts.ScriptElementKindModifier.none,\n displayParts: [],\n documentation: [\n {\n kind: 'text',\n text: content,\n },\n ],\n }\n }\n },\n\n // Show errors for invalid export fields.\n getSemanticDiagnosticsForExportVariableStatement(\n source: tsModule.SourceFile,\n node: tsModule.VariableStatement\n ) {\n const ts = getTs()\n\n const diagnostics: tsModule.Diagnostic[] = []\n\n // Check if it has correct option exports\n if (ts.isVariableDeclarationList(node.declarationList)) {\n for (const declaration of node.declarationList.declarations) {\n const name = declaration.name\n if (ts.isIdentifier(name)) {\n if (!ALLOWED_EXPORTS.includes(name.text) && !API_DOCS[name.text]) {\n diagnostics.push({\n file: source,\n category: ts.DiagnosticCategory.Error,\n code: NEXT_TS_ERRORS.INVALID_ENTRY_EXPORT,\n messageText: `\"${name.text}\" is not a valid Next.js entry export value.`,\n start: name.getStart(),\n length: name.getWidth(),\n })\n } else if (API_DOCS[name.text]) {\n // Check if the value is valid\n const value = declaration.initializer\n const options = API_DOCS[name.text].options\n\n if (value && options) {\n let displayedValue = ''\n let errorMessage = ''\n let isInvalid = false\n\n if (\n ts.isStringLiteral(value) ||\n ts.isNoSubstitutionTemplateLiteral(value)\n ) {\n const val = '\"' + removeStringQuotes(value.getText()) + '\"'\n const allowedValues = Object.keys(options).filter((v) =>\n /^['\"]/.test(v)\n )\n\n if (\n !allowedValues.includes(val) &&\n !API_DOCS[name.text].isValid?.(val)\n ) {\n isInvalid = true\n displayedValue = val\n }\n } else if (\n ts.isNumericLiteral(value) ||\n (ts.isPrefixUnaryExpression(value) &&\n ts.isMinusToken((value as any).operator) &&\n (ts.isNumericLiteral((value as any).operand.kind) ||\n (ts.isIdentifier((value as any).operand.kind) &&\n (value as any).operand.kind.getText() === 'Infinity'))) ||\n (ts.isIdentifier(value) && value.getText() === 'Infinity')\n ) {\n const v = value.getText()\n if (!API_DOCS[name.text].isValid?.(v)) {\n isInvalid = true\n displayedValue = v\n }\n } else if (\n value.kind === ts.SyntaxKind.TrueKeyword ||\n value.kind === ts.SyntaxKind.FalseKeyword\n ) {\n const v = value.getText()\n if (!API_DOCS[name.text].isValid?.(v)) {\n isInvalid = true\n displayedValue = v\n }\n } else if (ts.isArrayLiteralExpression(value)) {\n const v = value.getText()\n if (\n !API_DOCS[name.text].isValid?.(\n JSON.stringify(value.elements.map((e) => e.getText()))\n )\n ) {\n isInvalid = true\n displayedValue = v\n }\n } else if (\n // Other literals\n ts.isBigIntLiteral(value) ||\n ts.isObjectLiteralExpression(value) ||\n ts.isRegularExpressionLiteral(value) ||\n ts.isPrefixUnaryExpression(value)\n ) {\n isInvalid = true\n displayedValue = value.getText()\n } else {\n // Not a literal, error because it's not statically analyzable\n isInvalid = true\n displayedValue = value.getText()\n errorMessage = `\"${displayedValue}\" is not a valid value for the \"${name.text}\" option. The configuration must be statically analyzable.`\n }\n\n if (isInvalid) {\n diagnostics.push({\n file: source,\n category: ts.DiagnosticCategory.Error,\n code: NEXT_TS_ERRORS.INVALID_OPTION_VALUE,\n messageText:\n errorMessage ||\n `\"${displayedValue}\" is not a valid value for the \"${name.text}\" option.`,\n start: value.getStart(),\n length: value.getWidth(),\n })\n }\n }\n } else if (name.text === LEGACY_CONFIG_EXPORT) {\n // export const config = { ... }\n // Error if using `amp: ...`\n const value = declaration.initializer\n if (value && ts.isObjectLiteralExpression(value)) {\n for (const prop of value.properties) {\n if (\n ts.isPropertyAssignment(prop) &&\n ts.isIdentifier(prop.name) &&\n prop.name.text === 'amp'\n ) {\n diagnostics.push({\n file: source,\n category: ts.DiagnosticCategory.Error,\n code: NEXT_TS_ERRORS.INVALID_CONFIG_OPTION,\n messageText: `AMP is not supported in the app directory. If you need to use AMP it will continue to be supported in the pages directory.`,\n start: prop.getStart(),\n length: prop.getWidth(),\n })\n }\n }\n }\n }\n }\n }\n }\n\n return diagnostics\n },\n}\n\nexport default config\n"],"names":["API_DOCS","dynamic","description","options","link","fetchCache","preferredRegion","isValid","value","parsed","JSON","parse","Array","isArray","some","v","err","getHint","join","revalidate","type","false","Number","replace","dynamicParams","true","runtime","metadata","maxDuration","experimental_ppr","visitEntryConfig","fileName","position","callback","source","getSource","ts","getTs","forEachChild","visit","node","isPositionInsideNode","isVariableStatement","modifiers","m","kind","SyntaxKind","ExportKeyword","isVariableDeclarationList","declarationList","declaration","declarations","text","name","getText","createAutoCompletionOptionName","sort","sortText","ScriptElementKind","constElement","kindModifiers","ScriptElementKindModifier","exportedModifier","labelDetails","data","exportName","moduleSpecifier","createAutoCompletionOptionValue","apiName","isString","startsWith","insertText","removeStringQuotes","string","unknown","none","getAPIDescription","api","Object","entries","map","key","config","addCompletionsAtPosition","prior","entryConfig","push","keys","index","getQuickInfoAtPosition","overridden","initializer","docsLink","isStringLiteral","enumElement","textSpan","start","getStart","length","getWidth","displayParts","documentation","getCompletionEntryDetails","entryName","content","getSemanticDiagnosticsForExportVariableStatement","diagnostics","isIdentifier","ALLOWED_EXPORTS","includes","file","category","DiagnosticCategory","Error","code","NEXT_TS_ERRORS","INVALID_ENTRY_EXPORT","messageText","displayedValue","errorMessage","isInvalid","isNoSubstitutionTemplateLiteral","val","allowedValues","filter","test","isNumericLiteral","isPrefixUnaryExpression","isMinusToken","operator","operand","TrueKeyword","FalseKeyword","isArrayLiteralExpression","stringify","elements","e","isBigIntLiteral","isObjectLiteralExpression","isRegularExpressionLiteral","INVALID_OPTION_VALUE","LEGACY_CONFIG_EXPORT","prop","properties","isPropertyAssignment","INVALID_CONFIG_OPTION"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,4EAA4E;;;;;+BA2gB5E;;;eAAA;;;uBApgBO;0BAKA;AAGP,MAAMA,WAUF;IACFC,SAAS;QACPC,aACE;QACFC,SAAS;YACP,UACE;YACF,mBACE;YACF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iBAAiB9G,MAAM8C,OAAO;gCAC9BiE,eAAe,CAAC,CAAC,EAAED,eAAe,gCAAgC,EAAEjE,KAAKD,IAAI,CAAC,0DAA0D,CAAC;4BAC3I;4BAEA,IAAIoE,WAAW;gCACbd,YAAYpB,IAAI,CAAC;oCACfwB,MAAM5E;oCACN6E,UAAU3E,GAAG4E,kBAAkB,CAACC,KAAK;oCACrCC,MAAMC,wBAAc,CAACyB,oBAAoB;oCACzCvB,aACEE,gBACA,CAAC,CAAC,EAAED,eAAe,gCAAgC,EAAEjE,KAAKD,IAAI,CAAC,SAAS,CAAC;oCAC3E4C,OAAOxF,MAAMyF,QAAQ;oCACrBC,QAAQ1F,MAAM2F,QAAQ;gCACxB;4BACF;wBACF;oBACF,OAAO,IAAI9C,KAAKD,IAAI,KAAKyF,8BAAoB,EAAE;wBAC7C,gCAAgC;wBAChC,4BAA4B;wBAC5B,MAAMrI,QAAQ0C,YAAYyC,WAAW;wBACrC,IAAInF,SAAS4B,GAAGsG,yBAAyB,CAAClI,QAAQ;4BAChD,KAAK,MAAMsI,QAAQtI,MAAMuI,UAAU,CAAE;gCACnC,IACE3G,GAAG4G,oBAAoB,CAACF,SACxB1G,GAAGuE,YAAY,CAACmC,KAAKzF,IAAI,KACzByF,KAAKzF,IAAI,CAACD,IAAI,KAAK,OACnB;oCACAsD,YAAYpB,IAAI,CAAC;wCACfwB,MAAM5E;wCACN6E,UAAU3E,GAAG4E,kBAAkB,CAACC,KAAK;wCACrCC,MAAMC,wBAAc,CAAC8B,qBAAqB;wCAC1C5B,aAAa,CAAC,0HAA0H,CAAC;wCACzIrB,OAAO8C,KAAK7C,QAAQ;wCACpBC,QAAQ4C,KAAK3C,QAAQ;oCACvB;gCACF;4BACF;wBACF;oBACF;gBACF;YACF;QACF;QAEA,OAAOO;IACT;AACF;MAEA,WAAexB"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/server/typescript/rules/config.ts"],"sourcesContent":["// This module provides intellisense for page and layout's exported configs.\n\nimport {\n getSource,\n isPositionInsideNode,\n getTs,\n removeStringQuotes,\n} from '../utils'\nimport {\n NEXT_TS_ERRORS,\n ALLOWED_EXPORTS,\n LEGACY_CONFIG_EXPORT,\n} from '../constant'\nimport type tsModule from 'typescript/lib/tsserverlibrary'\n\nconst API_DOCS: Record<\n string,\n {\n description: string\n options?: Record<string, string>\n link?: string\n type?: string\n isValid?: (value: string) => boolean\n getHint?: (value: any) => string | undefined\n }\n> = {\n dynamic: {\n description:\n 'The `dynamic` option provides a few ways to opt in or out of dynamic behavior.',\n options: {\n '\"auto\"':\n 'Heuristic to cache as much as possible but doesn’t prevent any component to opt-in to dynamic behavior.',\n '\"force-dynamic\"':\n 'This disables all caching of fetches and always revalidates. (This is equivalent to `getServerSideProps`.)',\n '\"error\"':\n 'This errors if any dynamic Hooks or fetches are used. (This is equivalent to `getStaticProps`.)',\n '\"force-static\"':\n 'This forces caching of all fetches and returns empty values from `cookies`, `headers` and `useSearchParams`.',\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamic',\n },\n fetchCache: {\n description:\n 'The `fetchCache` option controls how Next.js statically caches fetches. By default it statically caches fetches reachable before any dynamic Hooks are used, and it doesn’t cache fetches that are discovered after that.',\n options: {\n '\"force-no-store\"':\n \"This lets you intentionally opt-out of all caching of data. This option forces all fetches to be refetched every request even if the `cache: 'force-cache'` option is passed to `fetch()`.\",\n '\"only-no-store\"':\n \"This lets you enforce that all data opts out of caching. This option makes `fetch()` reject with an error if `cache: 'force-cache'` is provided. It also changes the default to `no-store`.\",\n '\"default-no-store\"':\n \"Allows any explicit `cache` option to be passed to `fetch()` but if `'default'`, or no option, is provided then it defaults to `'no-store'`. This means that even fetches before a dynamic Hook are considered dynamic.\",\n '\"auto\"':\n 'This is the default option. It caches any fetches with the default `cache` option provided, that happened before a dynamic Hook is used and don’t cache any such fetches if they’re issued after a dynamic Hook.',\n '\"default-cache\"':\n \"Allows any explicit `cache` option to be passed to `fetch()` but if `'default'`, or no option, is provided then it defaults to `'force-cache'`. This means that even fetches before a dynamic Hook are considered dynamic.\",\n '\"only-cache\"':\n \"This lets you enforce that all data opts into caching. This option makes `fetch()` reject with an error if `cache: 'force-cache'` is provided. It also changes the default to `force-cache`. This error can be discovered early during static builds - or dynamically during Edge rendering.\",\n '\"force-cache\"':\n \"This lets you intentionally opt-in to all caching of data. This option forces all fetches to be cache even if the `cache: 'no-store'` option is passed to `fetch()`.\",\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#fetchcache',\n },\n preferredRegion: {\n description:\n 'Specify the perferred region that this layout or page should be deployed to. If the region option is not specified, it inherits the option from the nearest parent layout. The root defaults to `\"auto\"`.\\n\\nYou can also specify a region, such as \"iad1\", or an array of regions, such as `[\"iad1\", \"sfo1\"]`.',\n options: {\n '\"auto\"':\n 'Next.js will first deploy to the `\"home\"` region. Then if it doesn’t detect any waterfall requests after a few requests, it can upgrade that route, to be deployed globally. If it detects any waterfall requests after that, it can eventually downgrade back to `\"home`\".',\n '\"global\"': 'Prefer deploying globally.',\n '\"home\"': 'Prefer deploying to the Home region.',\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#preferredregion',\n isValid: (value: string) => {\n try {\n const parsed = JSON.parse(value)\n return (\n typeof parsed === 'string' ||\n (Array.isArray(parsed) && !parsed.some((v) => typeof v !== 'string'))\n )\n } catch (err) {\n return false\n }\n },\n getHint: (value: any) => {\n if (value === 'auto') return `Automatically chosen by Next.js.`\n if (value === 'global') return `Prefer deploying globally.`\n if (value === 'home') return `Prefer deploying to the Home region.`\n if (Array.isArray(value)) return `Deploy to regions: ${value.join(', ')}.`\n if (typeof value === 'string') return `Deploy to region: ${value}.`\n },\n },\n revalidate: {\n description:\n 'The `revalidate` option sets the default revalidation time for that layout or page. Note that it doesn’t override the value specify by each `fetch()`.',\n type: 'mixed',\n options: {\n false:\n 'This is the default and changes the fetch cache to indefinitely cache anything that uses force-cache or is fetched before a dynamic Hook/fetch.',\n 0: 'Specifying `0` implies that this layout or page should never be static.',\n 30: 'Set the revalidation time to `30` seconds. The value can be `0` or any positive number.',\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#revalidate',\n isValid: (value: string) => {\n return value === 'false' || Number(value.replace(/_/g, '')) >= 0\n },\n getHint: (value: any) => {\n return `Set the default revalidation time to \\`${value}\\` seconds.`\n },\n },\n dynamicParams: {\n description:\n '`dynamicParams` replaces the `fallback` option of `getStaticPaths`. It controls whether we allow `dynamicParams` beyond the generated static params from `generateStaticParams`.',\n options: {\n true: 'Allow rendering dynamic params that are not generated by `generateStaticParams`.',\n false:\n 'Disallow rendering dynamic params that are not generated by `generateStaticParams`.',\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams',\n isValid: (value: string) => {\n return value === 'true' || value === 'false'\n },\n },\n runtime: {\n description:\n 'The `runtime` option controls the preferred runtime to render this route.',\n options: {\n '\"nodejs\"': 'Prefer the Node.js runtime.',\n '\"edge\"': 'Prefer the Edge runtime.',\n '\"experimental-edge\"': `@deprecated\\n\\nThis option is no longer experimental. Use \\`edge\\` instead.`,\n },\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#runtime',\n },\n metadata: {\n description: 'Next.js Metadata configurations',\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/metadata',\n },\n maxDuration: {\n description:\n '`maxDuration` allows you to set max default execution time for your function. If it is not specified, the default value is dependent on your deployment platform and plan.',\n link: 'https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#maxduration',\n },\n}\n\nfunction visitEntryConfig(\n fileName: string,\n position: number,\n callback: (entryEonfig: string, value: tsModule.VariableDeclaration) => void\n) {\n const source = getSource(fileName)\n if (source) {\n const ts = getTs()\n ts.forEachChild(source, function visit(node) {\n // Covered by this node\n if (isPositionInsideNode(position, node)) {\n // Export variable\n if (\n ts.isVariableStatement(node) &&\n node.modifiers?.some((m) => m.kind === ts.SyntaxKind.ExportKeyword)\n ) {\n if (ts.isVariableDeclarationList(node.declarationList)) {\n for (const declaration of node.declarationList.declarations) {\n if (isPositionInsideNode(position, declaration)) {\n // `export const ... = ...`\n const text = declaration.name.getText()\n callback(text, declaration)\n }\n }\n }\n }\n }\n })\n }\n}\n\nfunction createAutoCompletionOptionName(sort: number, name: string) {\n const ts = getTs()\n return {\n name,\n sortText: '!' + sort,\n kind: ts.ScriptElementKind.constElement,\n kindModifiers: ts.ScriptElementKindModifier.exportedModifier,\n labelDetails: {\n description: `Next.js ${name} option`,\n },\n data: {\n exportName: name,\n moduleSpecifier: 'next/typescript/entry_option_name',\n },\n } as tsModule.CompletionEntry\n}\n\nfunction createAutoCompletionOptionValue(\n sort: number,\n name: string,\n apiName: string\n) {\n const ts = getTs()\n const isString = name.startsWith('\"')\n return {\n name,\n insertText: removeStringQuotes(name),\n sortText: '' + sort,\n kind: isString ? ts.ScriptElementKind.string : ts.ScriptElementKind.unknown,\n kindModifiers: ts.ScriptElementKindModifier.none,\n labelDetails: {\n description: `Next.js ${apiName} option`,\n },\n data: {\n exportName: apiName,\n moduleSpecifier: 'next/typescript/entry_option_value',\n },\n } as tsModule.CompletionEntry\n}\n\nfunction getAPIDescription(api: string): string {\n return (\n API_DOCS[api].description +\n '\\n\\n' +\n Object.entries(API_DOCS[api].options || {})\n .map(([key, value]) => `- \\`${key}\\`: ${value}`)\n .join('\\n')\n )\n}\nconst config = {\n // Auto completion for entry exported configs.\n addCompletionsAtPosition(\n fileName: string,\n position: number,\n prior: tsModule.WithMetadata<tsModule.CompletionInfo>\n ) {\n visitEntryConfig(fileName, position, (entryConfig, declaration) => {\n if (!API_DOCS[entryConfig]) {\n if (isPositionInsideNode(position, declaration.name)) {\n prior.entries.push(\n ...Object.keys(API_DOCS).map((name, index) => {\n return createAutoCompletionOptionName(index, name)\n })\n )\n }\n return\n }\n\n prior.entries.push(\n ...Object.keys(API_DOCS[entryConfig].options || {}).map(\n (name, index) => {\n return createAutoCompletionOptionValue(index, name, entryConfig)\n }\n )\n )\n })\n },\n\n // Show docs when hovering on the exported configs.\n getQuickInfoAtPosition(fileName: string, position: number) {\n const ts = getTs()\n\n let overridden: tsModule.QuickInfo | undefined\n visitEntryConfig(fileName, position, (entryConfig, declaration) => {\n if (!API_DOCS[entryConfig]) return\n\n const name = declaration.name\n const value = declaration.initializer\n\n const docsLink = {\n kind: 'text',\n text:\n `\\n\\nRead more about the \"${entryConfig}\" option: ` +\n API_DOCS[entryConfig].link,\n }\n\n if (value && isPositionInsideNode(position, value)) {\n // Hovers the value of the config\n const isString = ts.isStringLiteral(value)\n const text = removeStringQuotes(value.getText())\n const key = isString ? `\"${text}\"` : text\n\n const isValid = API_DOCS[entryConfig].isValid\n ? API_DOCS[entryConfig].isValid?.(key)\n : !!API_DOCS[entryConfig].options?.[key]\n\n if (isValid) {\n overridden = {\n kind: ts.ScriptElementKind.enumElement,\n kindModifiers: ts.ScriptElementKindModifier.none,\n textSpan: {\n start: value.getStart(),\n length: value.getWidth(),\n },\n displayParts: [],\n documentation: [\n {\n kind: 'text',\n text:\n API_DOCS[entryConfig].options?.[key] ||\n API_DOCS[entryConfig].getHint?.(key) ||\n '',\n },\n docsLink,\n ],\n }\n } else {\n // Wrong value, display the docs link\n overridden = {\n kind: ts.ScriptElementKind.enumElement,\n kindModifiers: ts.ScriptElementKindModifier.none,\n textSpan: {\n start: value.getStart(),\n length: value.getWidth(),\n },\n displayParts: [],\n documentation: [docsLink],\n }\n }\n } else {\n // Hovers the name of the config\n overridden = {\n kind: ts.ScriptElementKind.enumElement,\n kindModifiers: ts.ScriptElementKindModifier.none,\n textSpan: {\n start: name.getStart(),\n length: name.getWidth(),\n },\n displayParts: [],\n documentation: [\n {\n kind: 'text',\n text: getAPIDescription(entryConfig),\n },\n docsLink,\n ],\n }\n }\n })\n return overridden\n },\n\n // Show details on the side when auto completing.\n getCompletionEntryDetails(\n entryName: string,\n data: tsModule.CompletionEntryData\n ) {\n const ts = getTs()\n if (\n data &&\n data.moduleSpecifier &&\n data.moduleSpecifier.startsWith('next/typescript')\n ) {\n let content = ''\n if (data.moduleSpecifier === 'next/typescript/entry_option_name') {\n content = getAPIDescription(entryName)\n } else {\n const options = API_DOCS[data.exportName].options\n if (!options) return\n content = options[entryName]\n }\n return {\n name: entryName,\n kind: ts.ScriptElementKind.enumElement,\n kindModifiers: ts.ScriptElementKindModifier.none,\n displayParts: [],\n documentation: [\n {\n kind: 'text',\n text: content,\n },\n ],\n }\n }\n },\n\n // Show errors for invalid export fields.\n getSemanticDiagnosticsForExportVariableStatement(\n source: tsModule.SourceFile,\n node: tsModule.VariableStatement\n ) {\n const ts = getTs()\n\n const diagnostics: tsModule.Diagnostic[] = []\n\n // Check if it has correct option exports\n if (ts.isVariableDeclarationList(node.declarationList)) {\n for (const declaration of node.declarationList.declarations) {\n const name = declaration.name\n if (ts.isIdentifier(name)) {\n if (!ALLOWED_EXPORTS.includes(name.text) && !API_DOCS[name.text]) {\n diagnostics.push({\n file: source,\n category: ts.DiagnosticCategory.Error,\n code: NEXT_TS_ERRORS.INVALID_ENTRY_EXPORT,\n messageText: `\"${name.text}\" is not a valid Next.js entry export value.`,\n start: name.getStart(),\n length: name.getWidth(),\n })\n } else if (API_DOCS[name.text]) {\n // Check if the value is valid\n const value = declaration.initializer\n const options = API_DOCS[name.text].options\n\n if (value && options) {\n let displayedValue = ''\n let errorMessage = ''\n let isInvalid = false\n\n if (\n ts.isStringLiteral(value) ||\n ts.isNoSubstitutionTemplateLiteral(value)\n ) {\n const val = '\"' + removeStringQuotes(value.getText()) + '\"'\n const allowedValues = Object.keys(options).filter((v) =>\n /^['\"]/.test(v)\n )\n\n if (\n !allowedValues.includes(val) &&\n !API_DOCS[name.text].isValid?.(val)\n ) {\n isInvalid = true\n displayedValue = val\n }\n } else if (\n ts.isNumericLiteral(value) ||\n (ts.isPrefixUnaryExpression(value) &&\n ts.isMinusToken((value as any).operator) &&\n (ts.isNumericLiteral((value as any).operand.kind) ||\n (ts.isIdentifier((value as any).operand.kind) &&\n (value as any).operand.kind.getText() === 'Infinity'))) ||\n (ts.isIdentifier(value) && value.getText() === 'Infinity')\n ) {\n const v = value.getText()\n if (!API_DOCS[name.text].isValid?.(v)) {\n isInvalid = true\n displayedValue = v\n }\n } else if (\n value.kind === ts.SyntaxKind.TrueKeyword ||\n value.kind === ts.SyntaxKind.FalseKeyword\n ) {\n const v = value.getText()\n if (!API_DOCS[name.text].isValid?.(v)) {\n isInvalid = true\n displayedValue = v\n }\n } else if (ts.isArrayLiteralExpression(value)) {\n const v = value.getText()\n if (\n !API_DOCS[name.text].isValid?.(\n JSON.stringify(value.elements.map((e) => e.getText()))\n )\n ) {\n isInvalid = true\n displayedValue = v\n }\n } else if (\n // Other literals\n ts.isBigIntLiteral(value) ||\n ts.isObjectLiteralExpression(value) ||\n ts.isRegularExpressionLiteral(value) ||\n ts.isPrefixUnaryExpression(value)\n ) {\n isInvalid = true\n displayedValue = value.getText()\n } else {\n // Not a literal, error because it's not statically analyzable\n isInvalid = true\n displayedValue = value.getText()\n errorMessage = `\"${displayedValue}\" is not a valid value for the \"${name.text}\" option. The configuration must be statically analyzable.`\n }\n\n if (isInvalid) {\n diagnostics.push({\n file: source,\n category: ts.DiagnosticCategory.Error,\n code: NEXT_TS_ERRORS.INVALID_OPTION_VALUE,\n messageText:\n errorMessage ||\n `\"${displayedValue}\" is not a valid value for the \"${name.text}\" option.`,\n start: value.getStart(),\n length: value.getWidth(),\n })\n }\n }\n } else if (name.text === LEGACY_CONFIG_EXPORT) {\n // export const config = { ... }\n // Error if using `amp: ...`\n const value = declaration.initializer\n if (value && ts.isObjectLiteralExpression(value)) {\n for (const prop of value.properties) {\n if (\n ts.isPropertyAssignment(prop) &&\n ts.isIdentifier(prop.name) &&\n prop.name.text === 'amp'\n ) {\n diagnostics.push({\n file: source,\n category: ts.DiagnosticCategory.Error,\n code: NEXT_TS_ERRORS.INVALID_CONFIG_OPTION,\n messageText: `AMP is not supported in the app directory. If you need to use AMP it will continue to be supported in the pages directory.`,\n start: prop.getStart(),\n length: prop.getWidth(),\n })\n }\n }\n }\n }\n }\n }\n }\n\n return diagnostics\n },\n}\n\nexport default config\n"],"names":["API_DOCS","dynamic","description","options","link","fetchCache","preferredRegion","isValid","value","parsed","JSON","parse","Array","isArray","some","v","err","getHint","join","revalidate","type","false","Number","replace","dynamicParams","true","runtime","metadata","maxDuration","visitEntryConfig","fileName","position","callback","source","getSource","ts","getTs","forEachChild","visit","node","isPositionInsideNode","isVariableStatement","modifiers","m","kind","SyntaxKind","ExportKeyword","isVariableDeclarationList","declarationList","declaration","declarations","text","name","getText","createAutoCompletionOptionName","sort","sortText","ScriptElementKind","constElement","kindModifiers","ScriptElementKindModifier","exportedModifier","labelDetails","data","exportName","moduleSpecifier","createAutoCompletionOptionValue","apiName","isString","startsWith","insertText","removeStringQuotes","string","unknown","none","getAPIDescription","api","Object","entries","map","key","config","addCompletionsAtPosition","prior","entryConfig","push","keys","index","getQuickInfoAtPosition","overridden","initializer","docsLink","isStringLiteral","enumElement","textSpan","start","getStart","length","getWidth","displayParts","documentation","getCompletionEntryDetails","entryName","content","getSemanticDiagnosticsForExportVariableStatement","diagnostics","isIdentifier","ALLOWED_EXPORTS","includes","file","category","DiagnosticCategory","Error","code","NEXT_TS_ERRORS","INVALID_ENTRY_EXPORT","messageText","displayedValue","errorMessage","isInvalid","isNoSubstitutionTemplateLiteral","val","allowedValues","filter","test","isNumericLiteral","isPrefixUnaryExpression","isMinusToken","operator","operand","TrueKeyword","FalseKeyword","isArrayLiteralExpression","stringify","elements","e","isBigIntLiteral","isObjectLiteralExpression","isRegularExpressionLiteral","INVALID_OPTION_VALUE","LEGACY_CONFIG_EXPORT","prop","properties","isPropertyAssignment","INVALID_CONFIG_OPTION"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC8B,qBAAqB;wCAC1C5B,aAAa,CAAC,0HAA0H,CAAC;wCACzIrB,OAAO8C,KAAK7C,QAAQ;wCACpBC,QAAQ4C,KAAK3C,QAAQ;oCACvB;gCACF;4BACF;wBACF;oBACF;gBACF;YACF;QACF;QAEA,OAAOO;IACT;AACF;MAEA,WAAexB"}
|
|
@@ -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 "
|
|
14
|
+
if (typeof "15.0.0-rc.0" !== 'string') {
|
|
15
15
|
return [];
|
|
16
16
|
}
|
|
17
17
|
const payload = {
|
|
18
|
-
nextVersion: "
|
|
18
|
+
nextVersion: "15.0.0-rc.0",
|
|
19
19
|
nodeVersion: process.version,
|
|
20
20
|
cliCommand: event.cliCommand,
|
|
21
21
|
durationMilliseconds: event.durationMilliseconds,
|
|
@@ -36,12 +36,12 @@ function hasBabelConfig(dir) {
|
|
|
36
36
|
function eventCliSession(dir, nextConfig, event) {
|
|
37
37
|
var _nextConfig_experimental_staleTimes, _nextConfig_experimental_staleTimes1;
|
|
38
38
|
// This should be an invariant, if it fails our build tooling is broken.
|
|
39
|
-
if (typeof "
|
|
39
|
+
if (typeof "15.0.0-rc.0" !== 'string') {
|
|
40
40
|
return [];
|
|
41
41
|
}
|
|
42
42
|
const { images, i18n } = nextConfig || {};
|
|
43
43
|
const payload = {
|
|
44
|
-
nextVersion: "
|
|
44
|
+
nextVersion: "15.0.0-rc.0",
|
|
45
45
|
nodeVersion: process.version,
|
|
46
46
|
cliCommand: event.cliCommand,
|
|
47
47
|
isSrcDir: event.isSrcDir,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0-rc.0",
|
|
4
4
|
"description": "The React Framework",
|
|
5
5
|
"main": "./dist/server/next.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
]
|
|
94
94
|
},
|
|
95
95
|
"dependencies": {
|
|
96
|
-
"@next/env": "
|
|
96
|
+
"@next/env": "15.0.0-rc.0",
|
|
97
97
|
"@swc/helpers": "0.5.11",
|
|
98
98
|
"busboy": "1.6.0",
|
|
99
99
|
"caniuse-lite": "^1.0.30001579",
|
|
@@ -125,15 +125,15 @@
|
|
|
125
125
|
},
|
|
126
126
|
"optionalDependencies": {
|
|
127
127
|
"sharp": "^0.33.4",
|
|
128
|
-
"@next/swc-darwin-arm64": "
|
|
129
|
-
"@next/swc-darwin-x64": "
|
|
130
|
-
"@next/swc-linux-arm64-gnu": "
|
|
131
|
-
"@next/swc-linux-arm64-musl": "
|
|
132
|
-
"@next/swc-linux-x64-gnu": "
|
|
133
|
-
"@next/swc-linux-x64-musl": "
|
|
134
|
-
"@next/swc-win32-arm64-msvc": "
|
|
135
|
-
"@next/swc-win32-ia32-msvc": "
|
|
136
|
-
"@next/swc-win32-x64-msvc": "
|
|
128
|
+
"@next/swc-darwin-arm64": "15.0.0-rc.0",
|
|
129
|
+
"@next/swc-darwin-x64": "15.0.0-rc.0",
|
|
130
|
+
"@next/swc-linux-arm64-gnu": "15.0.0-rc.0",
|
|
131
|
+
"@next/swc-linux-arm64-musl": "15.0.0-rc.0",
|
|
132
|
+
"@next/swc-linux-x64-gnu": "15.0.0-rc.0",
|
|
133
|
+
"@next/swc-linux-x64-musl": "15.0.0-rc.0",
|
|
134
|
+
"@next/swc-win32-arm64-msvc": "15.0.0-rc.0",
|
|
135
|
+
"@next/swc-win32-ia32-msvc": "15.0.0-rc.0",
|
|
136
|
+
"@next/swc-win32-x64-msvc": "15.0.0-rc.0"
|
|
137
137
|
},
|
|
138
138
|
"devDependencies": {
|
|
139
139
|
"@ampproject/toolbox-optimizer": "2.8.3",
|
|
@@ -166,10 +166,10 @@
|
|
|
166
166
|
"@jest/types": "29.5.0",
|
|
167
167
|
"@mswjs/interceptors": "0.23.0",
|
|
168
168
|
"@napi-rs/triples": "1.2.0",
|
|
169
|
-
"@next/polyfill-module": "
|
|
170
|
-
"@next/polyfill-nomodule": "
|
|
171
|
-
"@next/react-refresh-utils": "
|
|
172
|
-
"@next/swc": "
|
|
169
|
+
"@next/polyfill-module": "15.0.0-rc.0",
|
|
170
|
+
"@next/polyfill-nomodule": "15.0.0-rc.0",
|
|
171
|
+
"@next/react-refresh-utils": "15.0.0-rc.0",
|
|
172
|
+
"@next/swc": "15.0.0-rc.0",
|
|
173
173
|
"@opentelemetry/api": "1.6.0",
|
|
174
174
|
"@playwright/test": "1.41.2",
|
|
175
175
|
"@swc/core": "1.5.7",
|