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
* Update some v5 and plugin sdk docs
* Update docusaurus/docs/dev-docs/migration/v4-to-v5/introduction-and-faq.md
* Preserve initial intent and structure of the tutorial
---------
Co-authored-by: Pierre Wizla <pwizla@users.noreply.github.com>
Co-authored-by: Pierre Wizla <pwizla+github@gmail.com>
Copy file name to clipboardExpand all lines: docusaurus/docs/dev-docs/migration/v4-to-v5/introduction-and-faq.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,9 +35,9 @@ All of the following available resources will help you upgrade your application
35
35
The following questions and their answers should help you cover the most common use cases:
36
36
37
37
<detailsstyle={detailsStyle}>
38
-
<summarystyle={summaryStyle}>How can I handle the upgrade and the installation of the latest dependencies?How can I handle the breaking changes in the code and adapt my code to Strapi 5?</summary>
38
+
<summarystyle={summaryStyle}>How can I handle the upgrade and the installation of the latest dependencies?<br/>How can I handle the breaking changes in the code and adapt my code to Strapi 5?</summary>
39
39
40
-
Strapi provides a tool, the [upgrade tool](/dev-docs/upgrade-tool). The upgrade tool is a command line tool with some commands that handle the upgrade of the dependencies and the execution of **codemods** <Codemods/>.
40
+
Strapi provides an [upgrade tool](/dev-docs/upgrade-tool) to ease the process. The upgrade tool is a command line tool with some commands that handle the upgrade of the dependencies and the execution of **codemods** <Codemods/>.
41
41
42
42
Follow the <ahref="/dev-docs/migration/v4-to-v5/step-by-step">step-by-step guide</a> to learn how to use this tool in the context of upgrading to Strapi 5.
43
43
@@ -47,8 +47,8 @@ Strapi 5 docs also provide a [complete breaking changes database](/dev-docs/migr
47
47
48
48
<detailsstyle={detailsStyle}>
49
49
<summarystyle={summaryStyle}>How can I handle the data migration, ensuring that in Strapi 5 the application will still be working?</summary>
50
-
<p>Strapi 5 integrates a data migration script that is run once the application starts for the first time in Strapi 5.</p>
51
-
<p>However, please <strong>always backup your database file</strong> (found at <codestyle={codeStyle}>.tmp/data.db</code> by default if using a SQL database) before performing any upgrade, as instructed in the <ahref="/dev-docs/migration/v4-to-v5/step-by-step">step-by-step guide</a>.</p>
50
+
<p>Strapi 5 integrates a series of data migration scripts that are run once the application starts for the first time in Strapi 5.</p>
51
+
<p>However, please <strong>always backup your database</strong> (found at <codestyle={codeStyle}>.tmp/data.db</code> by default if using a SQL database) before performing any upgrade, as instructed in the <ahref="/dev-docs/migration/v4-to-v5/step-by-step">step-by-step guide</a>.</p>
Copy file name to clipboardExpand all lines: docusaurus/docs/dev-docs/migration/v4-to-v5/step-by-step.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ Before getting into the upgrade process itself, take the following precautions:
31
31
32
32
1.**Backup your database**.
33
33
34
-
If you are using SQLite (the default database provided with Strapi), your database file is named `data.db` and is located in the `.tmp/` folder at the root of your Strapi application.
34
+
If you are using SQLite with the default configuration (the default database provided with Strapi), your database file is named `data.db` and is located in the `.tmp/` folder at the root of your Strapi application.
35
35
36
36
If you are using another type of database, please refer to their official documentation (see [PostgreSQL docs](https://www.postgresql.org/docs/) and [MySQL docs](https://dev.mysql.com/doc/)).
37
37
@@ -105,7 +105,7 @@ For each of them, read the indicated breaking change entry and check if some man
105
105
1. Some environment variables are handled by the server configuration 👉 see [breaking change](/dev-docs/migration/v4-to-v5/breaking-changes/removed-support-for-some-env-options)
106
106
2. Custom configuration must meet specific requirements 👉 see [breaking change](/dev-docs/migration/v4-to-v5/breaking-changes/strict-requirements-config-files)
107
107
3.**Admin panel customization**:
108
-
* The helper-plugin has been deprecated 👉 see [migration reference](/dev-docs/migration/v4-to-v5/additional-resources/helper-plugin)
108
+
* The helper-plugin has been removed 👉 see [migration reference](/dev-docs/migration/v4-to-v5/additional-resources/helper-plugin)
109
109
110
110
👉 Finally, go over the rest of the [breaking changes database](/dev-docs/migration/v4-to-v5/breaking-changes) for any edge case you might be concerned about.
Copy file name to clipboardExpand all lines: docusaurus/docs/dev-docs/plugins/development/create-a-plugin.md
+15-49Lines changed: 15 additions & 49 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,10 +23,16 @@ The present guide covers creating a plugin from scratch, linking it to an existi
23
23
This guide assumes you want to develop a plugin external to your Strapi project. However, the steps largely remain the same if you want to develop a plugin within your existing project. If you are not [using a monorepo](#working-with-the-plugin-cli-in-a-monorepo-environment) the steps are exactly the same.
24
24
:::
25
25
26
+
:::prerequisites
27
+
[yalc](https://www.npmjs.com/package/yalc) must be installed globally (with `npm install -g yalc` or `yarn global add yalc`).
28
+
:::
29
+
26
30
## Getting started with the Plugin SDK
27
31
28
32
The Plugin SDK helps you creating a plugin, linking it to an existing Strapi project, and building it for publishing.
29
33
34
+
The full list of commands and their parameters are available in the [Plugin SDK reference](/dev-docs/plugins/development/plugin-sdk). The present page will guide on using the main ones.
35
+
30
36
### Creating the plugin
31
37
32
38
To create your plugin, ensure you are in the parent directory of where you want it to be created and run the following command:
@@ -57,33 +63,11 @@ You will be ran through a series of prompts to help you setup your plugin. If yo
57
63
58
64
### Linking the plugin to your project
59
65
60
-
Once you created your plugin, you will want to register it with the [yalc](https://github.com/wclr/yalc) repository (it's local to your machine). To do this, run the following command:
61
-
62
-
<TabsgroupId="yarn-npm">
63
-
64
-
<TabItemvalue="yarn"label="Yarn">
66
+
In order to test your plugin during its development, the recommended approach is to link it to a Strapi project.
65
67
66
-
```bash
67
-
cd my-strapi-plugin
68
-
yarn install
69
-
yarn watch:link
70
-
```
68
+
Linking your plugin to a project is done with the `watch:link` command. The command will output explanations on how to link your plugin to a Strapi project.
71
69
72
-
</TabItem>
73
-
74
-
<TabItemvalue="npm"label="NPM">
75
-
76
-
```bash
77
-
cd my-strapi-plugin
78
-
npm install
79
-
npm run watch:link
80
-
```
81
-
82
-
</TabItem>
83
-
84
-
</Tabs>
85
-
86
-
This will then produce an output explaing how to link your plugin to your Strapi project. Open a new terminal window to do the next steps:
70
+
In a new terminal window, run the following commands:
In the above examples we use the name of the plugin when linking it to the project. This is the name of the package, not the name of the folder.
95
+
In the above examples we use the name of the plugin (`my-strapi-plugin`) when linking it to the project. This is the name of the package, not the name of the folder.
112
96
:::
113
97
114
-
Because this plugin is installed via `node_modules` you won't need to explicity add it to your `plugins`[configuration file](/dev-docs/configurations/plugins), so running the [`develop command`](../../cli.md#strapi-develop) will automatically pick up your plugin. However, to improve your experience we recommend you run Strapi with the `--watch-admin` flag so that your admin panel is automatically rebuilt when you make changes to your plugin:
115
-
116
-
<TabsgroupId="yarn-npm">
117
-
118
-
<TabItemvalue="yarn"label="Yarn">
119
-
120
-
```bash
121
-
yarn develop --watch-admin
122
-
```
123
-
124
-
</TabItem>
125
-
126
-
<TabItemvalue="npm"label="NPM">
98
+
Because this plugin is installed via `node_modules` you won't need to explicity add it to your `plugins`[configuration file](/dev-docs/configurations/plugins), so running the [`develop command`](../../cli.md#strapi-develop) to start your Strapi project will automatically pick up your plugin.
127
99
128
-
```bash
129
-
npm run develop --watch-admin
130
-
```
131
-
132
-
</TabItem>
133
-
134
-
</Tabs>
100
+
Now that your plugin is linked to a project, run `yarn develop` or `npm run develop` to start the Strapi application.
135
101
136
102
You are now ready to develop your plugin how you see fit! If you are making server changes, you will need to restart your server for them to take effect.
137
103
@@ -168,15 +134,15 @@ If you are working with a monorepo environment to develop your plugin, you don't
168
134
However, if you are writing admin code, you might add an `alias` that targets the source code of your plugin to make it easier to work with within the context of the admin panel:
Copy file name to clipboardExpand all lines: docusaurus/docs/dev-docs/plugins/development/plugin-sdk.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ npx @strapi/sdk-plugin init
34
34
35
35
## strapi-plugin build
36
36
37
-
Bundle the strapi plugin for publishing.
37
+
Bundle the Strapi plugin for publishing.
38
38
39
39
```bash
40
40
strapi-plugin build
@@ -52,6 +52,8 @@ strapi-plugin build
52
52
53
53
Recompiles the plugin automatically on changes and runs `yalc push --publish`.
54
54
55
+
For testing purposes, it is very convenient to link your plugin to an existing application to experiment with it in real condition. This command is made to help you streamline this process.
56
+
55
57
```bash
56
58
strapi-plugin watch:link
57
59
```
@@ -63,7 +65,7 @@ strapi-plugin watch:link
63
65
64
66
## strapi-plugin watch
65
67
66
-
Watch and compile the Strapi plugin for local development.
68
+
Watch the plugin source code for any change and rebuild it everytime. Useful when implementing your plugin and testing it in an application.
0 commit comments