Unverified Commit be2d4136 authored by Shu Ding's avatar Shu Ding Committed by GitHub

chore: Rename internal Webpack plugin (#46088)

Rename `FlightTypesPlugin` to `NextTypesPlugin` as it's more general now (handles https://beta.nextjs.org/docs/configuring/typescript#statically-typed-links as well).

`test/integration/app-link-types` was a non-existing test that I accidentally committed previously.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
parent 70c087e4
...@@ -48,7 +48,7 @@ import { regexLikeCss } from './webpack/config/blocks/css' ...@@ -48,7 +48,7 @@ import { regexLikeCss } from './webpack/config/blocks/css'
import { CopyFilePlugin } from './webpack/plugins/copy-file-plugin' import { CopyFilePlugin } from './webpack/plugins/copy-file-plugin'
import { FlightManifestPlugin } from './webpack/plugins/flight-manifest-plugin' import { FlightManifestPlugin } from './webpack/plugins/flight-manifest-plugin'
import { FlightClientEntryPlugin } from './webpack/plugins/flight-client-entry-plugin' import { FlightClientEntryPlugin } from './webpack/plugins/flight-client-entry-plugin'
import { FlightTypesPlugin } from './webpack/plugins/flight-types-plugin' import { NextTypesPlugin } from './webpack/plugins/next-types-plugin'
import type { import type {
Feature, Feature,
SWC_TARGET_TRIPLE, SWC_TARGET_TRIPLE,
...@@ -2177,7 +2177,7 @@ export default async function getBaseWebpackConfig( ...@@ -2177,7 +2177,7 @@ export default async function getBaseWebpackConfig(
})), })),
hasAppDir && hasAppDir &&
!isClient && !isClient &&
new FlightTypesPlugin({ new NextTypesPlugin({
dir, dir,
distDir: config.distDir, distDir: config.distDir,
appDir, appDir,
......
...@@ -6,7 +6,7 @@ import { WEBPACK_LAYERS } from '../../../lib/constants' ...@@ -6,7 +6,7 @@ import { WEBPACK_LAYERS } from '../../../lib/constants'
import { normalizeAppPath } from '../../../shared/lib/router/utils/app-paths' import { normalizeAppPath } from '../../../shared/lib/router/utils/app-paths'
import { isDynamicRoute } from '../../../shared/lib/router/utils' import { isDynamicRoute } from '../../../shared/lib/router/utils'
const PLUGIN_NAME = 'FlightTypesPlugin' const PLUGIN_NAME = 'NextTypesPlugin'
interface Options { interface Options {
dir: string dir: string
...@@ -191,7 +191,7 @@ declare module 'next' { ...@@ -191,7 +191,7 @@ declare module 'next' {
}` }`
} }
export class FlightTypesPlugin { export class NextTypesPlugin {
dir: string dir: string
distDir: string distDir: string
appDir: string appDir: string
......
...@@ -79,7 +79,7 @@ import { ...@@ -79,7 +79,7 @@ import {
import { getDefineEnv } from '../../build/webpack-config' import { getDefineEnv } from '../../build/webpack-config'
import loadJsConfig from '../../build/load-jsconfig' import loadJsConfig from '../../build/load-jsconfig'
import { formatServerError } from '../../lib/format-server-error' import { formatServerError } from '../../lib/format-server-error'
import { pageFiles } from '../../build/webpack/plugins/flight-types-plugin' import { pageFiles } from '../../build/webpack/plugins/next-types-plugin'
import { import {
DevRouteMatcherManager, DevRouteMatcherManager,
RouteEnsurer, RouteEnsurer,
......
{
"compilerOptions": {
"target": "ES6",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"baseUrl": ".",
"plugins": [
{
"name": "next"
}
]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
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