You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mark the ts auto type generation as experimental (#1767)
* Mark the ts auto type generation as experimental
* Update docusaurus/docs/dev-docs/configurations/typescript.md
Co-authored-by: Ben Irvin <[email protected]>
---------
Co-authored-by: Ben Irvin <[email protected]>
Copy file name to clipboardExpand all lines: docusaurus/docs/dev-docs/configurations/typescript.md
+12-11Lines changed: 12 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,29 +1,32 @@
1
1
---
2
2
title: TypeScript configuration
3
3
displayed_sidebar: devDocsSidebar
4
-
description: How to configure Strapi for TypeScript development.
5
-
4
+
description: How to configure Strapi for TypeScript development.
6
5
---
7
6
8
7
# TypeScript configuration
9
8
10
9
[TypeScript](/dev-docs/typescript)-enabled Strapi projects have a specific project structure and handle TypeScript project configuration through [`tsconfig.json` files](#project-structure-and-typescript-specific-configuration-files).
11
10
12
11
Strapi also has dedicated TypeScript features that are configured [in the `config/typescript.js|ts` file](#strapi-specific-configuration-for-typescript).
13
-
12
+
14
13
## Project structure and TypeScript-specific configuration files
15
14
16
15
TypeScript-enabled Strapi applications have a specific [project structure](/dev-docs/project-structure) with the following dedicated folders and configuration files:
17
16
18
-
| TypeScript-specific directories and files | Location | Purpose |
|`./dist` directory | application root | Adds the location for compiling the project JavaScript source code. |
21
-
|`build` directory |`./dist`| Contains the compiled administration panel JavaScript source code. The directory is created on the first `yarn build` or `npm run build` command |
22
-
|`tsconfig.json` file | application root | Manages TypeScript compilation for the server. |
23
-
|`tsconfig.json` file |`./src/admin/`| Manages TypeScript compilation for the admin panel. |
17
+
| TypeScript-specific directories and files | Location | Purpose |
|`./dist` directory | application root | Adds the location for compiling the project JavaScript source code. |
20
+
|`build` directory |`./dist`| Contains the compiled administration panel JavaScript source code. The directory is created on the first `yarn build` or `npm run build` command |
21
+
|`tsconfig.json` file | application root | Manages TypeScript compilation for the server. |
22
+
|`tsconfig.json` file |`./src/admin/`| Manages TypeScript compilation for the admin panel. |
24
23
25
24
## Strapi-specific configuration for TypeScript
26
25
26
+
:::caution 🚧 This feature is considered experimental.
27
+
These settings are considered experimental and might have issues or break some features.
28
+
:::
29
+
27
30
Types generated by Strapi are based on the user project structure. Once the type definitions are emitted into their dedicated files, Strapi reads the type definitions to adapt the autocompletion results accordingly.
28
31
29
32
To avoid having to [manually generate types](/dev-docs/typescript#generate-typings-for-project-schemas) every time the server restarts, an optional `config/typescript.js|ts` configuration file can be added, which currently accepts only one parameter:
@@ -39,7 +42,6 @@ To avoid having to [manually generate types](/dev-docs/typescript#generate-typin
0 commit comments