-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad389e8
commit 9b48b85
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Wild GraphQL Datasource | ||
|
||
This is a Grafana datasource that aims to make requesting timeseries data via a GraphQL endpoint easy. | ||
|
||
## Building and Development | ||
|
||
### Setup your system | ||
|
||
* Web requirements | ||
* Install nvm https://github.com/nvm-sh/nvm#installing-and-updating | ||
* Backend requirements | ||
* Install go https://go.dev/doc/install | ||
* Install Mage https://magefile.org/ | ||
* Grafana requirements | ||
* Install Docker: https://docs.docker.com/engine/install/ | ||
* `npm run server` command uses `docker compose` to bring up Grafana | ||
* Make sure your user is part of the `docker` group | ||
|
||
An example of commands you *could* run. | ||
Customize this setup to your liking. | ||
|
||
```shell | ||
# install nvm https://github.com/nvm-sh/nvm#installing-and-updating | ||
nvm install 20 | ||
|
||
# NOTICE: This `rm` command will remove your existing go installation | ||
rm -rf ~/go | ||
wget -c https://dl.google.com/go/go1.21.5.linux-amd64.tar.gz -O - | tar -xz -C ~/ | ||
echo 'export PATH="$PATH:$HOME/go/bin"' >> ~/.bashrc | ||
|
||
cd ~/Documents/Clones | ||
git clone https://github.com/magefile/mage | ||
cd mage | ||
go run bootstrap.go | ||
|
||
# *docker installation not shown* | ||
# *adding $USER to docker group not shown* | ||
``` | ||
|
||
### Setup build environment | ||
|
||
```shell | ||
go get -u github.com/grafana/grafana-plugin-sdk-go | ||
go mod tidy | ||
mage -v | ||
mage -l | ||
|
||
npm install | ||
npm run dev | ||
npm run build | ||
``` | ||
|
||
### Test inside Grafana instance | ||
|
||
Note that `npm run server` uses `docker compose` under the hood. | ||
|
||
```shell | ||
npm run server | ||
``` | ||
|
||
### Recommended development environment | ||
|
||
You may choose to use VS Code, which has free tools for developing TypeScript and Go code. | ||
IntelliJ IDEA Ultimate is a non-free choice that has support for both TypeScript and Go code. | ||
Alternatively, WebStorm (also not free) covers TypeScript development and GoLand covers Go development. | ||
|