From 4bba3223a0d1fd8a18dadd57b21690ef227f2f2c Mon Sep 17 00:00:00 2001 From: Esteban Beltran Date: Fri, 2 Sep 2022 17:49:39 +0200 Subject: [PATCH] Grafana/toolkit: Update README.md to include an alternative way to run local grafana/toolkit (#54203) * Update README.md * Run prettier --- packages/grafana-toolkit/README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/grafana-toolkit/README.md b/packages/grafana-toolkit/README.md index a1da1ee4689..8b853ac6b41 100644 --- a/packages/grafana-toolkit/README.md +++ b/packages/grafana-toolkit/README.md @@ -336,7 +336,19 @@ You can contribute to grafana-toolkit by helping develop it or by debugging it. ### Develop grafana-toolkit -Typically plugins should be developed using the `@grafana/toolkit` installed from npm. However, when working on the toolkit, you might want to use the local version. Follow the steps below to develop with a local version: +Typically plugins should be developed using the `@grafana/toolkit` installed from npm. However, when working on the toolkit, you might want to use the local version. There are two ways to run the local toolkit version: + +### Using `NODE_OPTIONS` to load the yarn pnp file: + +You can run grafana toolkit directly from the grafana repository with this command. + +`NODE_OPTIONS="--require $GRAFANA_REPO/.pnp.cjs" $GRAFANA_REPO/packages/grafana-toolkit/dist/bin/grafana-toolkit.js [command]` + +You can replace `$GRAFANA_REPO` with the path to your grafana clone or set it in your environment. e.g.: `export GRAFANA_REPO=/home/dev/your_grafana_clone` + +> Note: This will run grafana toolkit from your local clone but it won't change the dependencies of what you are trying to build. + +### Using yarn berry linking. #### Prerequisites