Docs: add decoupled plugin commands to developer guide (#88286)

* docs(developer-guide): add development commands for building decoupled plugins

* docs(developer-guide): add subheading, tidy up tone

* Apply suggestions from code review

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* docs(developer-guide): plugins section to identify which plugins need additional cmds

---------

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
This commit is contained in:
Jack Westbrook 2024-05-28 14:28:18 +02:00 committed by GitHub
parent f1dbe39533
commit 5ce68c50e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -77,10 +77,37 @@ yarn start
```
This command will generate sass theme files, build all external plugins, then build the frontend assets.
Once `yarn start` has built the assets, it will continue to do so whenever any of the files change. This means you don't have to manually build the assets every time you change the code.
Once `yarn start` has built the assets, it will continue to do so whenever any of the core Grafana application files change. This means you don't have to manually build the assets every time you change the code.
> Troubleshooting: if your first build works, but after pulling updates you see unexpected errors in the "Type-checking in progress..." stage, these can be caused by the [tsbuildinfo cache supporting incremental builds](https://www.typescriptlang.org/tsconfig#incremental). You can `rm tsconfig.tsbuildinfo` and re-try.
#### Plugins
If you are looking to contribute to any of the plugins listed below (that are found within the `public/app/plugins` directory) they require running additional commands to watch and rebuild them.
- azuremonitor
- cloud-monitoring
- grafana-postgresql-datasource
- grafana-pyroscope-datasource
- grafana-testdata-datasource
- jaegar
- mysql
- parca
- tempo
- zipkin
To build and watch all these plugins you can run the following command. Note this can be quite resource intensive as it will start separate build processes for each plugin.
```
yarn plugin:build:dev
```
If, instead, you would like to build and watch a specific plugin you can run the following command. Make sure to substitute `<name_of_plugin>` with the plugins name field found in its package.json. e.g. `@grafana-plugins/tempo`.
```
yarn workspace <name_of_plugin> dev
```
Next, we'll build & run the web server that will serve the frontend assets we just built.
### Backend