Move styled-jsx type reference (#37964)

Follow-up to https://github.com/vercel/next.js/pull/37902 this moves the reference to avoid a change in `next-env.d.ts`. Also updates our doc note on the `next-env.d.ts` file to be more explicit about it being ignored.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `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`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
This commit is contained in:
JJ Kasper 2022-06-23 14:26:08 -05:00 committed by GitHub
parent 7c484a80a6
commit 7bb247ca8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 9 deletions

View file

@ -64,7 +64,7 @@ npm run dev
You're now ready to start converting files from `.js` to `.tsx` and leveraging the benefits of TypeScript!
> A file named `next-env.d.ts` will be created in the root of your project. This file ensures Next.js types are picked up by the TypeScript compiler. **You cannot remove it or edit it** as it can change at any time.
> A file named `next-env.d.ts` will be created in the root of your project. This file ensures Next.js types are picked up by the TypeScript compiler. **You cannot remove it or edit it** as it can change at any time. As such this file should not be committed and should be ignored by version control.
> TypeScript `strict` mode is turned off by default. When you feel comfortable with TypeScript, it's recommended to turn it on in your `tsconfig.json`.

View file

@ -11,6 +11,7 @@
/// <reference path="./router.d.ts" />
/// <reference path="./script.d.ts" />
/// <reference path="./server.d.ts" />
/// <reference path="./dist/styled-jsx-types/global" />
export { default } from './types'
export * from './types'

View file

@ -30,8 +30,6 @@ export async function writeAppTypeDeclarations(
const content =
'/// <reference types="next" />' +
eol +
'/// <reference types="next/dist/styled-jsx-types/global" />' +
eol +
(imageImportsEnabled
? '/// <reference types="next/image-types/global" />' + eol
: '') +

View file

@ -16,8 +16,6 @@ describe('find config', () => {
const content =
'/// <reference types="next" />' +
eol +
'/// <reference types="next/dist/styled-jsx-types/global" />' +
eol +
(imageImportsEnabled
? '/// <reference types="next/image-types/global" />' + eol
: '') +
@ -39,8 +37,6 @@ describe('find config', () => {
const content =
'/// <reference types="next" />' +
eol +
'/// <reference types="next/dist/styled-jsx-types/global" />' +
eol +
(imageImportsEnabled
? '/// <reference types="next/image-types/global" />' + eol
: '') +
@ -62,8 +58,6 @@ describe('find config', () => {
const content =
'/// <reference types="next" />' +
eol +
'/// <reference types="next/dist/styled-jsx-types/global" />' +
eol +
(imageImportsEnabled
? '/// <reference types="next/image-types/global" />' + eol
: '') +