Skip to content

Docs: Update development docs #242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 21 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,46 @@ Visualize your Google Spreadsheets with Grafana

Check the [docs](https://github.com/grafana/google-sheets-datasource/blob/main/src/README.md) for information on how to use the data source.

## Development
## Development guide

This is a basic guide on how to set up your local environment, make the desired changes and see the result with a fresh Grafana installation.

## Requirements

You need to install the following first:

- [Mage](https://magefile.org/)
- [Yarn](https://yarnpkg.com/)
- [Docker Compose](https://docs.docker.com/compose/)

### Building the Plug-In
## Running the development version

In order to build the plug-in, both front-end and back-end parts, do the following:
### Compiling the Backend

```
yarn install
yarn build
```
If you have made any changes to any `go` files, you can use [mage](https://github.com/magefile/mage) to recompile the plugin.

The built plug-in will be in the dist/ directory.
```sh
mage buildAll
```

### Testing the Plug-In w/ Docker Compose
### Compiling the Frontend

To test the plug-in running inside Grafana, we recommend using our Docker Compose setup:
After you made the desired changes, you can build and test the new version of the plugin using `yarn`:

```BASH
mage buildAll
```sh
yarn run dev # builds and puts the output at ./dist
```

In another terminal
The built plug-in will be in the `dist/` directory.

### Docker Compose

```BASH
To test the plug-in running inside Grafana, we recommend using our Docker Compose setup:

```sh
docker-compose up
```

To restart the plug-in after backend changes:
`./scripts/restart-plugin.sh`

### Test spreadsheet

Need at publicly available spreadsheet to play around with? Feel free to use [this](https://docs.google.com/spreadsheets/d/1TZlZX67Y0s4CvRro_3pCYqRCKuXer81oFp_xcsjPpe8/edit?usp=sharing) demo spreadsheet that is suitable for visualization in graphs and in tables.
Loading