The easiest way to get started is to git clone the project repository
directly into the data/plugins
of your Grafana instance followed
by building it there.
Grafana will read in the dist
folder first. So, to see your changes in
Grafana, you will have to build the plugin once. However, you do not
need to restart your local Grafana server after every change, just
refreshing the page will be sufficient.
The easiest way to invoke a development sandbox is by using Docker.
# Run with Grafana 7
docker run --publish=3000:3000 --volume=$PWD/dist:/var/lib/grafana/plugins/panodata-map-panel grafana/grafana:7.5.10
# Run with Grafana 8
docker run --publish=3000:3000 --volume=$PWD/dist:/var/lib/grafana/plugins/panodata-map-panel --env=GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=panodata-map-panel grafana/grafana:8.0.6
Because the version of node-sass
used as transitive dependency is apparently
not compatible with Node 16 yet, let's use Node 15:
brew install nodeenv
nodeenv --node=15.14.0 .nenv
source .nenv/bin/activate
- Display all tasks from
grafana-toolkit
:npx grafana-toolkit --help
- Install packages:
npx yarn install
- Bundle plugin in dev mode:
npx yarn dev
- Bundle plugin in dev mode and start a watcher:
npx yarn watch
- Upgrade dependencies:
npx yarn upgrade
- Run all tests:
npx yarn test
- Run specific tests:
npx yarn test --testNamePattern "when some fields"
- Make sure your improvement gets accompanied by a corresponding test case
- Run linter/prettier:
npx grafana-toolkit plugin:dev
- Install packages:
npx yarn install
- Bump version within
package.json
and updateCHANGELOG.md
- Commit changes
- Tag repository:
git tag 0.xx.0
- Push repository:
git push && git push --tags
- Build and package:
make package
When this process succeeds, packages can be found within theci/packages/
folder. TheError signing manifest
warning can optionally be ignored, YMMV. - Upload to GitHub release assets:
brew install github-release
export GITHUB_TOKEN=abcdef
make publish