@grafana/create-plugin 4.7.0 → 4.7.1-canary.890.405e4ae.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CONTRIBUTING.md CHANGED
@@ -21,7 +21,9 @@ npm install
21
21
 
22
22
  ### Technologies
23
23
 
24
- - [**`Plop`**](https://github.com/plopjs/plop) - we are using Plop for the CLI tool and for scaffolding
24
+ - [**`minimist`**](https://www.npmjs.com/package/minimist) - for parsing cmd line args
25
+ - [**`enquirer`**](https://www.npmjs.com/package/enquirer) - for prompting users for information
26
+ - [**`handlebars`**](https://www.npmjs.com/package/handlebars) - for file templates
25
27
 
26
28
  ### Folder structure
27
29
 
@@ -32,7 +34,7 @@ npm install
32
34
  │ ├── bin // the entrypoint file
33
35
  │ ├── commands // Code that runs commands
34
36
  │ └── utils // Utilities used by commands
35
- └── templates // Plop templates
37
+ └── templates // Handlebars templates
36
38
  ├── _partials // Composable parts of a template
37
39
  ├── app // Templates specific to scaffolding an app plugin
38
40
  ├── backend // Templates specific to scaffolding backend plugin code
@@ -76,6 +78,6 @@ _Work in progress._
76
78
 
77
79
  ### Developing the templates
78
80
 
79
- The templates are used by Plop to scaffold Grafana plugins. Whilst they appear to be the intended filetype they are infact treated as markdown by Plop when it runs. As such we need to be mindful of syntax and to [escape particular characters](https://handlebarsjs.com/guide/expressions.html#whitespace-control) where necessary. The [github/ci.yml](./templates/github/ci/.github/workflows/ci.yml) file is a good example of this.
81
+ The templates are used by Handlebars to scaffold Grafana plugins. Whilst they appear to be the intended filetype they are infact treated as markdown by Handlebars when it runs. As such we need to be mindful of syntax and to [escape particular characters](https://handlebarsjs.com/guide/expressions.html#whitespace-control) where necessary. The [github/ci.yml](./templates/github/ci/.github/workflows/ci.yml) file is a good example of this.
80
82
 
81
83
  Note that certain files are intentionally named differently (e.g. npmrc, package.json). This is done due to other tooling preventing the files from being packaged for NPM or breaking other tools during local development.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/create-plugin",
3
- "version": "4.7.0",
3
+ "version": "4.7.1-canary.890.405e4ae.0",
4
4
  "repository": {
5
5
  "directory": "packages/create-plugin",
6
6
  "url": "https://github.com/grafana/plugin-tools"
@@ -87,5 +87,5 @@
87
87
  "engines": {
88
88
  "node": ">=20"
89
89
  },
90
- "gitHead": "b18692d9bdc211888da99627436f58b1229d88ad"
90
+ "gitHead": "405e4ae924ae6c4dbb0d2e55e4d13d1c220c64b4"
91
91
  }
package/src/constants.ts CHANGED
@@ -39,7 +39,7 @@ export enum PLUGIN_TYPES {
39
39
  scenes = 'scenesapp',
40
40
  }
41
41
 
42
- // This gets merged into variables coming from user prompts (when using Plop) or any other dynamic variables,
42
+ // This gets merged into variables coming from user prompts (when scaffolding) or any other dynamic variables,
43
43
  // and will be available to use in the templates.
44
44
  // Example: "@grafana/ui": "{{ grafanaVersion }}"
45
45
  export const EXTRA_TEMPLATE_VARIABLES = {
@@ -11,6 +11,7 @@ services:
11
11
  args:
12
12
  grafana_image: ${GRAFANA_IMAGE:-{{~grafanaImage~}} }
13
13
  grafana_version: ${GRAFANA_VERSION:-{{~grafanaVersion~}} }
14
+ development: ${DEVELOPMENT:-true}
14
15
  ports:
15
16
  - 3000:3000/tcp
16
17
  {{#if hasBackend}}
@@ -141,11 +141,6 @@ jobs:
141
141
  runs-on: ubuntu-latest
142
142
  steps:
143
143
  - uses: actions/checkout@v4
144
- with:
145
- sparse-checkout: |
146
- provisioning
147
- tests
148
- .config
149
144
 
150
145
  - name: Download plugin
151
146
  if: needs.build.outputs.has-backend == 'true'
@@ -176,7 +171,7 @@ jobs:
176
171
  - name: Start Grafana
177
172
  run: |
178
173
  docker-compose pull
179
- GRAFANA_VERSION=$\{{ matrix.GRAFANA_IMAGE.VERSION }} GRAFANA_IMAGE=$\{{ matrix.GRAFANA_IMAGE.NAME }} docker-compose up -d
174
+ DEVELOPMENT=false GRAFANA_VERSION=$\{{ matrix.GRAFANA_IMAGE.VERSION }} GRAFANA_IMAGE=$\{{ matrix.GRAFANA_IMAGE.NAME }} docker-compose up -d
180
175
 
181
176
  - name: Wait for Grafana to start
182
177
  uses: nev7n/wait_for_response@v1
@@ -187,7 +182,7 @@ jobs:
187
182
  interval: 500
188
183
 
189
184
  - name: Install Playwright Browsers
190
- run: npx playwright install chromium --with-deps
185
+ run: {{ packageManagerName }} playwright install chromium --with-deps
191
186
 
192
187
  - name: Run Playwright tests
193
188
  id: run-tests
@@ -208,7 +203,7 @@ jobs:
208
203
  name: $\{{ matrix.GRAFANA_IMAGE.NAME }}-v$\{{ matrix.GRAFANA_IMAGE.VERSION }}-$\{{github.run_id}}-server-log
209
204
  path: grafana-server.log
210
205
  retention-days: 5
211
-
206
+
212
207
  # If your repository is public, uploading the Playwright report will make it public on the Internet.
213
208
  # Beware not to expose sensitive information.
214
209
  - name: Upload artifacts
@@ -218,3 +213,14 @@ jobs:
218
213
  name: playwright-report-$\{{ matrix.GRAFANA_IMAGE.NAME }}-v$\{{ matrix.GRAFANA_IMAGE.VERSION }}-$\{{github.run_id}}
219
214
  path: playwright-report/
220
215
  retention-days: 5
216
+
217
+ {{#if_eq orgName "grafana"}}
218
+ # Repos in the grafana Github org can publish the report to GCS so that they can be browsed without having to download them.
219
+ # This will make the report public on the Internet, so beware to skip this step if the report contains sensitive information.
220
+ - name: Publish report to GCS
221
+ if: $\{{ always() && steps.run-tests.outcome == 'failure' }}
222
+ uses: grafana/plugin-actions/publish-report@main
223
+ with:
224
+ grafana-version: ${{ matrix.GRAFANA_IMAGE.VERSION }}
225
+ path: playwright-report
226
+ {{/if_eq}}