Skip to content

Commit e056f43

Browse files
authored
feat: next version (#394)
* docs: upgrade documentation * docs: add @nuxt/types-edge note * fix(build): fix tsx support
1 parent a6ee94d commit e056f43

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1314
-3491
lines changed

2.9_MIGRATION_GUIDE.md

-83
This file was deleted.

docs/.vuepress/config.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,7 @@ function getMainSidebar (prefix, guide, cookbook) {
168168
prefix + '/cookbook/modules',
169169
prefix + '/cookbook/server-middlewares'
170170
]
171-
},
172-
prefix + '/migration'
171+
}
173172
]
174173
}
175174

@@ -209,7 +208,7 @@ function generateExampleMarkdown (apiName, level, options = {}) {
209208
content += `# ${apiName[0].toUpperCase()}${apiName.slice(1)} API example (${level})\n\n`
210209

211210
if (!exampleExists) {
212-
content += '### Coming Soon ...\n\n'
211+
content += `### Contribute and propose your ${level} example on [Github](https://github.com/nuxt/typescript) !\n\n`
213212
content += `<!-- <Example name="${apiName}-api/${level}" /> -->\n`
214213
} else {
215214
content += `<Example name="${apiName}-api/${level}" />\n`

docs/cookbook/configuration.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Configuration (Runtime)
22

33
```ts
4-
import { Configuration } from '@nuxt/types'
4+
import { NuxtConfig } from '@nuxt/types'
55

6-
const config: Configuration = {
6+
const config: NuxtConfig = {
77
// Define your configuration with auto-completion & type checking
88
}
99

docs/es/cookbook/configuration.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Configuración (Tiempo de Ejecución)
22

33
```ts
4-
import { Configuration } from '@nuxt/types'
4+
import { NuxtConfig } from '@nuxt/types'
55

6-
const config: Configuration = {
6+
const config: NuxtConfig = {
77
// Defina tu configuracion con auto completado y verificación de tipos
88
}
99

docs/es/guide/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ El soporte de Nuxt TypeScript viene con 3 paquetes :
88

99
Contiene las definiciones de tipos de Nuxt Typescript
1010

11-
Es usado por ambos paquetes **@nuxt/typescript-build** y **@nuxt/typescript-runtime**.
11+
Se mantienen a lo largo del código central de Nuxt en [`nuxt/nuxt.js` repositorio](https://github.com/nuxt/nuxt.js/tree/dev/packages/types).
1212
:::
1313

1414
::: tip @nuxt/typescript-build

docs/es/guide/lint.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,12 @@ Si usted desea tener una runtime lint (teniendo ESLint corriendo despues de que
5353
export default {
5454
typescript: {
5555
typeCheck: {
56-
eslint: true
56+
eslint: {
57+
files: './src/**/*.{ts,js,vue}'
58+
}
5759
}
5860
}
5961
}
6062
```
6163

62-
::: tip
63-
Usted tambien puede dar opciones especificas de ESLint con `typeCheck.eslintOptions`
64-
:::
65-
6664
Esto va a verificar los tipos y va a lintear su código cada vez que guarde archivos.

docs/es/guide/runtime.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ Todo lo que necesitas es actualizar tu archivo **package.json**:
2929
"start": "nuxt-ts start"
3030
},
3131
"dependencies": {
32-
"@nuxt/typescript-runtime",
33-
"nuxt"
32+
"@nuxt/typescript-runtime": "latest",
33+
"nuxt": "latest",
3434
},
3535
"devDependencies": {
36-
"@nuxt/typescript-build"
36+
"@nuxt/types": "latest",
37+
"@nuxt/typescript-build": "latest"
3738
}
3839
```
3940

docs/es/guide/setup.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Aqui están las guias para instalar y configurarlo.
77
## Instalación
88

99
```sh
10-
yarn add --dev @nuxt/typescript-build
10+
yarn add --dev @nuxt/typescript-build @nuxt/types
1111
# O
12-
npm install --save-dev @nuxt/typescript-build
12+
npm install --save-dev @nuxt/typescript-build @nuxt/types
1313
```
1414

1515
## Configuración
@@ -27,10 +27,6 @@ y crear un archivo **`tsconfig.json`** :
2727

2828
<<< @/shared/tsconfig.json
2929

30-
::: tip
31-
`@nuxt/typescript-build` incluye `@nuxt/types`, asi que no necesitas instalarlo de forma independiente.
32-
:::
33-
3430
::: tip
3531

3632
Revisar la [documentación oficial de TypeScript](https://www.typescriptlang.org/docs/handbook/compiler-options.html) para aprender acerca de las diferentes opciones del compilador.

docs/es/migration.md

-75
This file was deleted.

docs/guide/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Nuxt TypeScript Support comes with 3 packages :
88

99
Contains Nuxt TypeScript type definitions.
1010

11-
It is shipped by both **@nuxt/typescript-build** and **@nuxt/typescript-runtime** packages.
11+
They are maintained along Nuxt core code on [`nuxt/nuxt.js` repository](https://github.com/nuxt/nuxt.js/tree/dev/packages/types).
1212
:::
1313

1414
::: tip @nuxt/typescript-build

docs/guide/lint.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,12 @@ If you want to have runtime lint (having ESLint running after a file has been sa
5353
export default {
5454
typescript: {
5555
typeCheck: {
56-
eslint: true
56+
eslint: {
57+
files: './src/**/*.{ts,js,vue}'
58+
}
5759
}
5860
}
5961
}
6062
```
6163

62-
::: tip
63-
You can also give specific ESLint options with `typeCheck.eslintOptions`
64-
:::
65-
6664
It will both type-check and lint your code whenever you're saving files.

docs/guide/runtime.md

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ All you need to do is update your **package.json** file:
3333
"nuxt": "latest"
3434
},
3535
"devDependencies": {
36+
"@nuxt/types": "latest",
3637
"@nuxt/typescript-build": "latest"
3738
}
3839
```

docs/guide/setup.md

+24-9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,36 @@
11
# Setup
22

3-
Nuxt TypeScript Support mainly comes through a Nuxt module, **@nuxt/typescript-build**.
3+
Nuxt TypeScript Support mainly comes through a Nuxt module, **@nuxt/typescript-build**, and its types **@nuxt/types**.
44

5-
Here are the guidelines to install & configure it.
5+
Here are the guidelines to install & configure them.
66

77
## Installation
88

99
```sh
10-
yarn add --dev @nuxt/typescript-build
10+
yarn add --dev @nuxt/typescript-build @nuxt/types
1111
# OR
12-
npm install --save-dev @nuxt/typescript-build
12+
npm install --save-dev @nuxt/typescript-build @nuxt/types
1313
```
1414

15+
::: tip Types version
16+
You may want to install specific types version to match your Nuxt version if its not latest :
17+
18+
```sh
19+
yarn add --dev @nuxt/[email protected]
20+
# OR
21+
npm install --save-dev @nuxt/[email protected]
22+
```
23+
24+
If you're using `nuxt-edge` :
25+
```sh
26+
yarn add --dev @nuxt/types@npm:@nuxt/types-edge
27+
# OR
28+
npm install --save-dev @nuxt/types@npm:@nuxt/types-edge
29+
```
30+
31+
Types versioning match Nuxt versioning since [2.13.0](https://github.com/nuxt/nuxt.js/releases/tag/v2.13.0).
32+
:::
33+
1534
## Configuration
1635

1736
All you need to do is add **`@nuxt/typescript-build`** to your **`buildModules`** in **`nuxt.config.js`**
@@ -28,7 +47,7 @@ and create a **`tsconfig.json`** file :
2847
<<< @/shared/tsconfig.json
2948

3049
::: tip
31-
Notice that **es2018** target is needed to be able to use [**Optional Chaining**](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#optional-chaining) and [**Nullish Coalescing**](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#nullish-coalescing), as **esnext** target doesn't seem to support these features for now.
50+
Notice that **ES2018** target is needed to be able to use [**Optional Chaining**](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#optional-chaining) and [**Nullish Coalescing**](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#nullish-coalescing), as **ESNext** target doesn't seem to support these features for now.
3251
:::
3352

3453
You will also need to provide types for Vue files by adding the following type declaration:
@@ -45,10 +64,6 @@ declare module "*.vue" {
4564
You can place this file in the root directory of your project or a directory named `types`. You can place it in a custom directory, but you'll need to configure [`typeRoots`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html#types-typeroots-and-types) in the `tsconfig.json` file.
4665
:::
4766

48-
::: tip
49-
`@nuxt/typescript-build` ships `@nuxt/types`, so there's no need to install it independently.
50-
:::
51-
5267
::: tip
5368

5469
Check official [TypeScript documentation](https://www.typescriptlang.org/docs/handbook/compiler-options.html) to learn about the different compiler options.

docs/ja/cookbook/configuration.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# 設定(ランタイム)
22

33
```ts
4-
import { Configuration } from '@nuxt/types'
4+
import { NuxtConfig } from '@nuxt/types'
55

6-
const config: Configuration = {
6+
const config: NuxtConfig = {
77
// 自動補完と型判定による設定の定義
88
}
99

docs/ja/guide/index.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ Nuxt の TypeScript サポートは 3 つのパッケージからなっていま
88

99
Nuxt TypeScript 型定義が含まれています。
1010

11-
**@nuxt/typescript-build** パッケージ と **@nuxt/typescript-runtime** パッケージに同梱されています。
11+
12+
それらはNuxtコアコードに沿って維持されます[リポジトリ `nuxt/nuxt.js`](https://github.com/nuxt/nuxt.js/tree/dev/packages/types)
1213
:::
1314

1415
::: tip @nuxt/typescript-build

0 commit comments

Comments
 (0)