Unverified Commit d1418740 authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

Bump TypeScript to 6.0 (#91257)

parent 6d82715d
import type { Metadata } from 'next' import type { Metadata } from 'next'
import type React from 'react' import type React from 'react'
// @ts-expect-error - Fixed once Next.js 16.2.0 is used.
import './globals.css' import './globals.css'
export const metadata: Metadata = { export const metadata: Metadata = {
......
...@@ -39,6 +39,6 @@ ...@@ -39,6 +39,6 @@
"postcss": "^8.5", "postcss": "^8.5",
"tailwindcss": "^4.1.9", "tailwindcss": "^4.1.9",
"tw-animate-css": "1.3.3", "tw-animate-css": "1.3.3",
"typescript": "^5" "typescript": "6.0.2"
} }
} }
...@@ -26,6 +26,6 @@ ...@@ -26,6 +26,6 @@
"eslint": "9.37.0", "eslint": "9.37.0",
"eslint-config-next": "canary", "eslint-config-next": "canary",
"tailwindcss": "4.1.13", "tailwindcss": "4.1.13",
"typescript": "^5" "typescript": "6.0.2"
} }
} }
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
"jsx": "react-jsx", "jsx": "react-jsx",
"lib": ["ESNext", "DOM"], "lib": ["ESNext", "DOM"],
"target": "esnext", "target": "esnext",
"ignoreDeprecations": "6.0",
// modules // modules
"baseUrl": ".", "baseUrl": ".",
"module": "node16", "module": "node16",
......
...@@ -142,11 +142,11 @@ ...@@ -142,11 +142,11 @@
"@next/eslint-plugin-next": "workspace:*", "@next/eslint-plugin-next": "workspace:*",
"@next/font": "workspace:*", "@next/font": "workspace:*",
"@next/mdx": "workspace:*", "@next/mdx": "workspace:*",
"@next/playwright": "workspace:*",
"@next/plugin-storybook": "workspace:*", "@next/plugin-storybook": "workspace:*",
"@next/polyfill-module": "workspace:*", "@next/polyfill-module": "workspace:*",
"@next/polyfill-nomodule": "workspace:*", "@next/polyfill-nomodule": "workspace:*",
"@next/swc": "workspace:*", "@next/swc": "workspace:*",
"@next/playwright": "workspace:*",
"@next/third-parties": "workspace:*", "@next/third-parties": "workspace:*",
"@opentelemetry/api": "1.4.1", "@opentelemetry/api": "1.4.1",
"@picocss/pico": "1.5.10", "@picocss/pico": "1.5.10",
...@@ -302,7 +302,7 @@ ...@@ -302,7 +302,7 @@
"tsec": "0.2.1", "tsec": "0.2.1",
"tsx": "4.19.2", "tsx": "4.19.2",
"turbo": "2.9.4", "turbo": "2.9.4",
"typescript": "5.9.2", "typescript": "6.0.2",
"typescript-eslint": "8.46.0", "typescript-eslint": "8.46.0",
"unfetch": "4.2.0", "unfetch": "4.2.0",
"wait-port": "0.2.2", "wait-port": "0.2.2",
...@@ -349,7 +349,9 @@ ...@@ -349,7 +349,9 @@
"@types/node@20.17.6": "patches/@types__node@20.17.6.patch", "@types/node@20.17.6": "patches/@types__node@20.17.6.patch",
"taskr@1.1.0": "patches/taskr@1.1.0.patch", "taskr@1.1.0": "patches/taskr@1.1.0.patch",
"minizlib@3.1.0": "patches/minizlib@3.1.0.patch", "minizlib@3.1.0": "patches/minizlib@3.1.0.patch",
"http-proxy@1.18.1": "patches/http-proxy@1.18.1.patch" "http-proxy@1.18.1": "patches/http-proxy@1.18.1.patch",
"web-vitals@4.2.1": "patches/web-vitals@4.2.1.patch",
"@rspack/core@1.6.7": "patches/@rspack__core@1.6.7.patch"
} }
} }
} }
...@@ -5,7 +5,10 @@ ...@@ -5,7 +5,10 @@
"strict": true, "strict": true,
"resolveJsonModule": true, "resolveJsonModule": true,
"esModuleInterop": true, "esModuleInterop": true,
"outDir": "dist",
"rootDir": ".",
"skipLibCheck": false "skipLibCheck": false
}, },
"exclude": ["templates", "dist"] "exclude": ["templates", "dist"],
"files": ["index.ts"]
} }
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
"devDependencies": { "devDependencies": {
"@types/eslint": "9.6.1", "@types/eslint": "9.6.1",
"@types/eslint-plugin-jsx-a11y": "6.10.1", "@types/eslint-plugin-jsx-a11y": "6.10.1",
"typescript": "5.9.2" "typescript": "6.0.2"
}, },
"scripts": { "scripts": {
"dev": "pnpm build", "dev": "pnpm build",
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
"scripts": { "scripts": {
"dev": "pnpm build", "dev": "pnpm build",
"build": "swc -d dist src && pnpm types", "build": "swc -d dist src && pnpm types",
"types": "tsc src/index.ts --skipLibCheck --declaration --emitDeclarationOnly --esModuleInterop --declarationDir dist", "types": "tsc --project tsconfig.json --skipLibCheck --declaration --emitDeclarationOnly --esModuleInterop --declarationDir dist",
"prepublishOnly": "cd ../../ && turbo run build" "prepublishOnly": "cd ../../ && turbo run build"
} }
} }
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
"compilerOptions": { "compilerOptions": {
"module": "commonjs", "module": "commonjs",
"target": "es2019", "target": "es2019",
"esModuleInterop": true "esModuleInterop": true,
"noImplicitAny": false,
"rootDir": "src",
"strictNullChecks": false
}, },
"include": ["src/**/*"], "include": ["src/**/*"],
"exclude": ["node_modules"] "exclude": ["node_modules"]
......
...@@ -25,6 +25,6 @@ ...@@ -25,6 +25,6 @@
"@types/fontkit": "2.0.0", "@types/fontkit": "2.0.0",
"@vercel/ncc": "0.34.0", "@vercel/ncc": "0.34.0",
"fontkit": "2.0.2", "fontkit": "2.0.2",
"typescript": "5.9.2" "typescript": "6.0.2"
} }
} }
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
"esModuleInterop": true, "esModuleInterop": true,
"target": "es2019", "target": "es2019",
"outDir": "dist", "outDir": "dist",
"rootDir": "src" "rootDir": "src",
"types": ["jest", "node"]
}, },
"include": ["src/**/*.ts"] "include": ["src/**/*.ts"]
} }
...@@ -40,6 +40,6 @@ ...@@ -40,6 +40,6 @@
"@types/jscodeshift": "0.11.0", "@types/jscodeshift": "0.11.0",
"@types/prompts": "2.4.2", "@types/prompts": "2.4.2",
"@types/semver": "7.3.1", "@types/semver": "7.3.1",
"typescript": "5.9.2" "typescript": "6.0.2"
} }
} }
import type { Element as CheerioElement, Node as CheerioNode } from 'cheerio'
import fs from 'fs' import fs from 'fs'
import path from 'path' import path from 'path'
import execa from 'execa' import execa from 'execa'
...@@ -196,11 +198,14 @@ class CraTransform { ...@@ -196,11 +198,14 @@ class CraTransform {
const documentPage = path.join(this.pagesDir, `_document.${pageExt}`) const documentPage = path.join(this.pagesDir, `_document.${pageExt}`)
const catchAllPage = path.join(this.pagesDir, `[[...slug]].${pageExt}`) const catchAllPage = path.join(this.pagesDir, `[[...slug]].${pageExt}`)
const gatherTextChildren = (children: CheerioElement[]) => { const gatherTextChildren = (children: CheerioNode[]) => {
return children return children
.map((child) => { .map((child) => {
if (child.type === 'text') { if (child.type === 'text') {
return child.data // `data` only exists on Data nodes according to types so this is sus.
// @ts-expect-error - Found when upgrading to TypeScript 6.0.
const text = child.data
return text
} }
return '' return ''
}) })
......
...@@ -3,9 +3,15 @@ ...@@ -3,9 +3,15 @@
"module": "commonjs", "module": "commonjs",
"sourceMap": true, "sourceMap": true,
"esModuleInterop": true, "esModuleInterop": true,
"noImplicitAny": false,
"target": "ES2022", "target": "ES2022",
"downlevelIteration": true, "downlevelIteration": true,
"preserveWatchOutput": true "ignoreDeprecations": "6.0",
"preserveWatchOutput": true,
"strictFunctionTypes": false,
"strictNullChecks": false,
"types": ["node"],
"useUnknownInCatchVariables": false
}, },
"include": ["**/*.ts"], "include": ["**/*.ts"],
"exclude": ["node_modules", "transforms/__testfixtures__/**"] "exclude": ["node_modules", "transforms/__testfixtures__/**"]
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"compilerOptions": { "compilerOptions": {
"target": "es2015", "target": "es2015",
"moduleResolution": "node", "moduleResolution": "node",
"ignoreDeprecations": "6.0",
"strict": true, "strict": true,
"resolveJsonModule": true, "resolveJsonModule": true,
"esModuleInterop": true, "esModuleInterop": true,
......
...@@ -27,6 +27,6 @@ ...@@ -27,6 +27,6 @@
}, },
"devDependencies": { "devDependencies": {
"@playwright/test": "1.58.2", "@playwright/test": "1.58.2",
"typescript": "5.9.2" "typescript": "6.0.2"
} }
} }
...@@ -3,10 +3,12 @@ ...@@ -3,10 +3,12 @@
"strict": true, "strict": true,
"esModuleInterop": true, "esModuleInterop": true,
"target": "es2019", "target": "es2019",
"lib": ["dom", "dom.iterable", "esnext"],
"outDir": "dist", "outDir": "dist",
"module": "commonjs", "module": "commonjs",
"rootDir": "src", "rootDir": "src",
"declaration": true "declaration": true,
"types": ["node"]
}, },
"include": ["src/**/*.ts"], "include": ["src/**/*.ts"],
"exclude": ["node_modules"] "exclude": ["node_modules"]
......
...@@ -2,11 +2,14 @@ ...@@ -2,11 +2,14 @@
"compilerOptions": { "compilerOptions": {
"target": "es2022", "target": "es2022",
"moduleResolution": "node", "moduleResolution": "node",
"ignoreDeprecations": "6.0",
"strict": true, "strict": true,
"resolveJsonModule": true, "resolveJsonModule": true,
"esModuleInterop": true, "esModuleInterop": true,
"skipLibCheck": false, "skipLibCheck": false,
"lib": ["es2022", "dom"] "lib": ["es2022", "dom"],
"rootDir": "src",
"types": ["jest"]
}, },
"include": ["src/**/*.ts"], "include": ["src/**/*.ts"],
"exclude": ["node_modules", "dist"] "exclude": ["node_modules", "dist"]
......
...@@ -343,7 +343,7 @@ ...@@ -343,7 +343,7 @@
"text-table": "0.2.0", "text-table": "0.2.0",
"timers-browserify": "2.0.12", "timers-browserify": "2.0.12",
"tty-browserify": "0.0.1", "tty-browserify": "0.0.1",
"typescript": "5.9.2", "typescript": "6.0.2",
"ua-parser-js": "1.0.35", "ua-parser-js": "1.0.35",
"unistore": "3.4.1", "unistore": "3.4.1",
"util": "0.12.4", "util": "0.12.4",
......
// imports polyfill from `@next/polyfill-module` after build.
export {}
...@@ -16,75 +16,78 @@ function shouldIgnorePath(modulePath: string): boolean { ...@@ -16,75 +16,78 @@ function shouldIgnorePath(modulePath: string): boolean {
) )
} }
export const base = curry(function base( export const base: (
ctx: ConfigurationContext, ctx: ConfigurationContext
config: webpack.Configuration ) => (config: webpack.Configuration) => webpack.Configuration = curry(
) { function base(ctx: ConfigurationContext, config: webpack.Configuration) {
config.mode = ctx.isDevelopment ? 'development' : 'production' config.mode = ctx.isDevelopment ? 'development' : 'production'
config.name = ctx.isServer config.name = ctx.isServer
? ctx.isEdgeRuntime ? ctx.isEdgeRuntime
? COMPILER_NAMES.edgeServer ? COMPILER_NAMES.edgeServer
: COMPILER_NAMES.server : COMPILER_NAMES.server
: COMPILER_NAMES.client : COMPILER_NAMES.client
config.target = !ctx.targetWeb config.target = !ctx.targetWeb
? 'node18.17' // Same version defined in packages/next/package.json#engines ? 'node18.17' // Same version defined in packages/next/package.json#engines
: ctx.isEdgeRuntime : ctx.isEdgeRuntime
? ['web', 'es6'] ? ['web', 'es6']
: ['web', 'es6'] : ['web', 'es6']
// https://webpack.js.org/configuration/devtool/#development // https://webpack.js.org/configuration/devtool/#development
if (ctx.isDevelopment) { if (ctx.isDevelopment) {
// `eval-source-map` provides full-fidelity source maps for the // `eval-source-map` provides full-fidelity source maps for the
// original source, including columns and original variable names. // original source, including columns and original variable names.
// This is desirable so the in-browser debugger can correctly pause // This is desirable so the in-browser debugger can correctly pause
// and show scoped variables with their original names. // and show scoped variables with their original names.
config.devtool = 'eval-source-map' config.devtool = 'eval-source-map'
} else {
if (
ctx.isEdgeRuntime ||
(ctx.isServer && ctx.serverSourceMaps) ||
// Enable browser sourcemaps:
(ctx.productionBrowserSourceMaps && ctx.isClient)
) {
config.devtool = 'source-map'
} else { } else {
config.devtool = false if (
ctx.isEdgeRuntime ||
(ctx.isServer && ctx.serverSourceMaps) ||
// Enable browser sourcemaps:
(ctx.productionBrowserSourceMaps && ctx.isClient)
) {
config.devtool = 'source-map'
} else {
config.devtool = false
}
} }
}
if (!config.module) { if (!config.module) {
config.module = { rules: [] } config.module = { rules: [] }
} }
config.plugins ??= [] config.plugins ??= []
if (config.devtool === 'source-map' && !process.env.NEXT_RSPACK) { if (config.devtool === 'source-map' && !process.env.NEXT_RSPACK) {
config.plugins.push(
new DevToolsIgnorePlugin({
shouldIgnorePath,
})
)
} else if (config.devtool === 'eval-source-map') {
// We're using a fork of `eval-source-map`
config.devtool = false
if (process.env.NEXT_RSPACK) {
config.plugins.push( config.plugins.push(
new (getRspackCore().EvalSourceMapDevToolPlugin)({ new DevToolsIgnorePlugin({
moduleFilenameTemplate: config.output?.devtoolModuleFilenameTemplate,
})
)
} else {
config.plugins.push(
new EvalSourceMapDevToolPlugin({
moduleFilenameTemplate: config.output?.devtoolModuleFilenameTemplate,
shouldIgnorePath, shouldIgnorePath,
}) })
) )
} else if (config.devtool === 'eval-source-map') {
// We're using a fork of `eval-source-map`
config.devtool = false
if (process.env.NEXT_RSPACK) {
config.plugins.push(
new (getRspackCore().EvalSourceMapDevToolPlugin)({
moduleFilenameTemplate:
config.output?.devtoolModuleFilenameTemplate,
})
)
} else {
config.plugins.push(
new EvalSourceMapDevToolPlugin({
moduleFilenameTemplate:
config.output?.devtoolModuleFilenameTemplate,
shouldIgnorePath,
})
)
}
} }
}
// TODO: add codemod for "Should not import the named export" with JSON files // TODO: add codemod for "Should not import the named export" with JSON files
// config.module.strictExportPresence = !isWebpack5 // config.module.strictExportPresence = !isWebpack5
return config return config
}) }
)
...@@ -6,27 +6,31 @@ import { pipe } from '../../utils' ...@@ -6,27 +6,31 @@ import { pipe } from '../../utils'
import type { ConfigurationContext, ConfigurationFn } from '../../utils' import type { ConfigurationContext, ConfigurationFn } from '../../utils'
import { getCustomDocumentImageError } from './messages' import { getCustomDocumentImageError } from './messages'
export const images = curry(async function images( export const images: (
_ctx: ConfigurationContext, ctx: ConfigurationContext
config: webpack.Configuration ) => (config: webpack.Configuration) => Promise<webpack.Configuration> = curry(
) { async function images(
const fns: ConfigurationFn[] = [ _ctx: ConfigurationContext,
loader({ config: webpack.Configuration
oneOf: [ ) {
{ const fns: ConfigurationFn[] = [
test: nextImageLoaderRegex, loader({
use: { oneOf: [
loader: 'error-loader', {
options: { test: nextImageLoaderRegex,
reason: getCustomDocumentImageError(), use: {
loader: 'error-loader',
options: {
reason: getCustomDocumentImageError(),
},
}, },
issuer: /pages[\\/]_document\./,
}, },
issuer: /pages[\\/]_document\./, ],
}, }),
], ]
}),
]
const fn = pipe(...fns) const fn = pipe(...fns)
return fn(config) return fn(config)
}) }
)
import curry from 'next/dist/compiled/lodash.curry' import curry from 'next/dist/compiled/lodash.curry'
import type { webpack } from 'next/dist/compiled/webpack/webpack' import type { webpack } from 'next/dist/compiled/webpack/webpack'
export const loader = curry(function loader( export const loader: (
rule: webpack.RuleSetRule, rule: webpack.RuleSetRule
config: webpack.Configuration ) => (config: webpack.Configuration) => webpack.Configuration = curry(
) { function loader(rule: webpack.RuleSetRule, config: webpack.Configuration) {
if (!config.module) { if (!config.module) {
config.module = { rules: [] } config.module = { rules: [] }
}
if (rule.oneOf) {
const existing = config.module.rules?.find(
(arrayRule) =>
arrayRule && typeof arrayRule === 'object' && arrayRule.oneOf
)
if (existing && typeof existing === 'object') {
existing.oneOf!.push(...rule.oneOf)
return config
} }
}
config.module.rules?.push(rule) if (rule.oneOf) {
return config const existing = config.module.rules?.find(
}) (arrayRule) =>
arrayRule && typeof arrayRule === 'object' && arrayRule.oneOf
)
if (existing && typeof existing === 'object') {
existing.oneOf!.push(...rule.oneOf)
return config
}
}
export const unshiftLoader = curry(function unshiftLoader( config.module.rules?.push(rule)
rule: webpack.RuleSetRule, return config
config: webpack.Configuration
) {
if (!config.module) {
config.module = { rules: [] }
} }
)
if (rule.oneOf) { export const unshiftLoader: (
const existing = config.module.rules?.find( rule: webpack.RuleSetRule
(arrayRule) => ) => (config: webpack.Configuration) => webpack.Configuration = curry(
arrayRule && typeof arrayRule === 'object' && arrayRule.oneOf function unshiftLoader(
) rule: webpack.RuleSetRule,
if (existing && typeof existing === 'object') { config: webpack.Configuration
existing.oneOf?.unshift(...rule.oneOf) ) {
return config if (!config.module) {
config.module = { rules: [] }
} }
}
config.module.rules?.unshift(rule) if (rule.oneOf) {
return config const existing = config.module.rules?.find(
}) (arrayRule) =>
arrayRule && typeof arrayRule === 'object' && arrayRule.oneOf
)
if (existing && typeof existing === 'object') {
existing.oneOf?.unshift(...rule.oneOf)
return config
}
}
config.module.rules?.unshift(rule)
return config
}
)
export const plugin = curry(function plugin( export const plugin: (
p: webpack.WebpackPluginInstance, p: webpack.WebpackPluginInstance
config: webpack.Configuration ) => (config: webpack.Configuration) => webpack.Configuration = curry(
) { function plugin(
if (!config.plugins) { p: webpack.WebpackPluginInstance,
config.plugins = [] config: webpack.Configuration
) {
if (!config.plugins) {
config.plugins = []
}
config.plugins.push(p)
return config
} }
config.plugins.push(p) )
return config
})
const GlobalURLPattern = const GlobalURLPattern =
// @ts-expect-error: URLPattern is not available in Node.js
typeof URLPattern === 'undefined' ? undefined : URLPattern typeof URLPattern === 'undefined' ? undefined : URLPattern
export { GlobalURLPattern as URLPattern } export { GlobalURLPattern as URLPattern }
{ {
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "src"
},
// Copied from tsconfig.json to not overwrite. // Copied from tsconfig.json to not overwrite.
"exclude": [ "exclude": [
"dist", "dist",
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
"module": "ESNext", "module": "ESNext",
"target": "ES2018", "target": "ES2018",
"moduleResolution": "node", "moduleResolution": "node",
"ignoreDeprecations": "6.0",
"types": ["trusted-types", "jest", "node"],
"paths": { "paths": {
// Required absolute paths. // Required absolute paths.
// We rewrite these here so that they aren't also input files which would fail tsc with // We rewrite these here so that they aren't also input files which would fail tsc with
......
declare module 'react-refresh/runtime' {
export function injectIntoGlobalHook(...args: any[]): void
export function register(...args: any[]): void
export function createSignatureFunctionForTransform(...args: any[]): any
export function getFamilyByType(...args: any[]): any
export function isLikelyComponentType(...args: any[]): boolean
export function performReactRefresh(...args: any[]): void
const RefreshRuntime: {
injectIntoGlobalHook: typeof injectIntoGlobalHook
register: typeof register
createSignatureFunctionForTransform: typeof createSignatureFunctionForTransform
getFamilyByType: typeof getFamilyByType
isLikelyComponentType: typeof isLikelyComponentType
performReactRefresh: typeof performReactRefresh
}
export default RefreshRuntime
}
...@@ -2,12 +2,16 @@ ...@@ -2,12 +2,16 @@
"compilerOptions": { "compilerOptions": {
"module": "commonjs", "module": "commonjs",
"sourceMap": true, "sourceMap": true,
"strict": false,
"esModuleInterop": true, "esModuleInterop": true,
"target": "es2015", "target": "es2015",
"lib": ["dom"], "lib": ["dom", "es2020"],
"downlevelIteration": true, "downlevelIteration": true,
"ignoreDeprecations": "6.0",
"preserveWatchOutput": true, "preserveWatchOutput": true,
"skipLibCheck": true,
"outDir": "dist", "outDir": "dist",
"types": ["node"],
"paths": { "paths": {
"webpack": ["../../node_modules/webpack5"] "webpack": ["../../node_modules/webpack5"]
} }
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
"next": "16.2.1-canary.38", "next": "16.2.1-canary.38",
"outdent": "0.8.0", "outdent": "0.8.0",
"prettier": "2.5.1", "prettier": "2.5.1",
"typescript": "5.9.2" "typescript": "6.0.2"
}, },
"peerDependencies": { "peerDependencies": {
"next": "^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0-beta.0", "next": "^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0-beta.0",
......
diff --git a/dist/Compilation.d.ts b/dist/Compilation.d.ts
index 271fec0c74ef7fc7a12e9a917dbc5e8cd4f67302..fc02438b27889e4cbffd3561efa0619bbb13ad94 100644
--- a/dist/Compilation.d.ts
+++ b/dist/Compilation.d.ts
@@ -414,4 +414,6 @@ export declare class Entries implements Map<string, EntryData> {
delete(key: string): boolean;
get(key: string): EntryData | undefined;
keys(): ReturnType<Map<string, EntryData>["keys"]>;
+ getOrInsert(key: string, defaultValue: EntryData): EntryData;
+ getOrInsertComputed(key: string, callback: (key: string) => EntryData): EntryData;
}
diff --git a/dist/modules/types.d.ts b/dist/modules/types.d.ts
index 080d3667303398f9ee8cf782c43f2230ea72ef53..cdfe14ad4bdbe07023301dae36e7ea64a5048bf4 100644
--- a/dist/modules/types.d.ts
+++ b/dist/modules/types.d.ts
@@ -27,7 +27,8 @@ declare global {
}
interface PerformanceEventTiming extends PerformanceEntry {
duration: DOMHighResTimeStamp;
- interactionId: number;
+ // Waiting for https://github.com/GoogleChrome/web-vitals/commit/a92f8a78bce9e400366bc29db5fc23fdf23db469
+ readonly interactionId: number;
}
interface LayoutShiftAttribution {
node?: Node;
This diff is collapsed.
...@@ -86,6 +86,7 @@ describe('typescript-plugin - client-boundary', () => { ...@@ -86,6 +86,7 @@ describe('typescript-plugin - client-boundary', () => {
length: diagnostic.length, length: diagnostic.length,
})) }))
// TODO: Should flag _arrowFunctionConditional in TypeScript 6.x.
expect(totalDiagnostics).toMatchInlineSnapshot(` expect(totalDiagnostics).toMatchInlineSnapshot(`
{ {
"app/non-serializable-props.tsx": [ "app/non-serializable-props.tsx": [
...@@ -101,12 +102,6 @@ describe('typescript-plugin - client-boundary', () => { ...@@ -101,12 +102,6 @@ describe('typescript-plugin - client-boundary', () => {
"messageText": "Props must be serializable for components in the "use client" entry file. "_arrowFunctionTypeAlias" is a function that's not a Server Action. Rename "_arrowFunctionTypeAlias" either to "action" or have its name end with "Action" e.g. "_arrowFunctionTypeAliasAction" to indicate it is a Server Action.", "messageText": "Props must be serializable for components in the "use client" entry file. "_arrowFunctionTypeAlias" is a function that's not a Server Action. Rename "_arrowFunctionTypeAlias" either to "action" or have its name end with "Action" e.g. "_arrowFunctionTypeAliasAction" to indicate it is a Server Action.",
"start": 197, "start": 197,
}, },
{
"code": 71007,
"length": 19,
"messageText": "Props must be serializable for components in the "use client" entry file. "_arrowFunctionConditional" is a function that's not a Server Action. Rename "_arrowFunctionConditional" either to "action" or have its name end with "Action" e.g. "_arrowFunctionConditionalAction" to indicate it is a Server Action.",
"start": 249,
},
{ {
"code": 71007, "code": 71007,
"length": 5, "length": 5,
......
/** @type {import('next').NextConfig} */
const nextConfig = {
typescript: {
// Using import assertions which are not supported since TypeScript 6.0
ignoreBuildErrors: true,
},
}
module.exports = nextConfig
...@@ -47,7 +47,7 @@ describe('css-url-deployment-id', () => { ...@@ -47,7 +47,7 @@ describe('css-url-deployment-id', () => {
} }
// Extract all url() references from the CSS // Extract all url() references from the CSS
const urlMatches = allCssContent.match(/url\([^)]+\)/g) || [] const urlMatches: string[] = allCssContent.match(/url\([^)]+\)/g) || []
// Filter to only asset URLs (images and fonts), excluding data URIs // Filter to only asset URLs (images and fonts), excluding data URIs
const assetUrls = urlMatches.filter( const assetUrls = urlMatches.filter(
...@@ -95,7 +95,8 @@ describe('css-url-deployment-id', () => { ...@@ -95,7 +95,8 @@ describe('css-url-deployment-id', () => {
} }
// Find image references from CSS modules (page.module.css) // Find image references from CSS modules (page.module.css)
const imageUrls = allCssContent.match(/url\([^)]+\.png[^)]*\)/g) || [] const imageUrls: string[] =
allCssContent.match(/url\([^)]+\.png[^)]*\)/g) || []
expect(imageUrls.length).toBeGreaterThanOrEqual(1) expect(imageUrls.length).toBeGreaterThanOrEqual(1)
for (const imageUrl of imageUrls) { for (const imageUrl of imageUrls) {
...@@ -103,7 +104,8 @@ describe('css-url-deployment-id', () => { ...@@ -103,7 +104,8 @@ describe('css-url-deployment-id', () => {
} }
// Find font references from CSS modules // Find font references from CSS modules
const fontUrls = allCssContent.match(/url\([^)]+\.woff2[^)]*\)/g) || [] const fontUrls: string[] =
allCssContent.match(/url\([^)]+\.woff2[^)]*\)/g) || []
expect(fontUrls.length).toBeGreaterThanOrEqual(1) expect(fontUrls.length).toBeGreaterThanOrEqual(1)
for (const fontUrl of fontUrls) { for (const fontUrl of fontUrls) {
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
"module": "ESNext", "module": "ESNext",
"target": "ESNext", "target": "ESNext",
"moduleResolution": "node", "moduleResolution": "node",
"ignoreDeprecations": "6.0",
"types": ["react", "jest", "node", "trusted-types", "jest-extended"], "types": ["react", "jest", "node", "trusted-types", "jest-extended"],
"paths": { "paths": {
"development-sandbox": ["./test/lib/development-sandbox"], "development-sandbox": ["./test/lib/development-sandbox"],
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
"jsx": "react-jsx", "jsx": "react-jsx",
"lib": ["ESNext", "DOM"], "lib": ["ESNext", "DOM"],
"target": "esnext", "target": "esnext",
"ignoreDeprecations": "6.0",
// modules // modules
"baseUrl": ".", "baseUrl": ".",
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
// environment // environment
"lib": ["ESNext"], "lib": ["ESNext"],
"target": "esnext", "target": "esnext",
"ignoreDeprecations": "6.0",
// modules // modules
"baseUrl": ".", "baseUrl": ".",
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
"strict": true, "strict": true,
"target": "ES2022", "target": "ES2022",
"module": "NodeNext", "module": "NodeNext",
"rootDir": ".",
"types": ["node"], "types": ["node"],
"outDir": "dist", "outDir": "dist",
"declaration": true, "declaration": true,
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
"target": "ES2018", "target": "ES2018",
"module": "commonjs", "module": "commonjs",
"moduleResolution": "node", "moduleResolution": "node",
"ignoreDeprecations": "6.0",
"strict": true, "strict": true,
"importHelpers": false, "importHelpers": false,
"noEmitHelpers": false, "noEmitHelpers": false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment