@grafana/create-plugin 7.15.1 → 7.17.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/CHANGELOG.md +20 -0
- package/dist/codemods/additions/prompts/docs-content.md +1 -1
- package/dist/codemods/additions/scripts/experimental-app-sdk.js +40 -0
- package/dist/codemods/migrations/migrations.js +7 -1
- package/dist/codemods/migrations/scripts/019-remove-glob-dependency.js +93 -0
- package/dist/codemods/utils.ast.js +44 -1
- package/package.json +2 -1
- package/src/codemods/additions/prompts/docs-content.md +1 -1
- package/src/codemods/additions/scripts/docs.test.ts +39 -3
- package/src/codemods/additions/scripts/experimental-app-sdk.test.ts +59 -2
- package/src/codemods/additions/scripts/experimental-app-sdk.ts +55 -0
- package/src/codemods/migrations/migrations.ts +7 -1
- package/src/codemods/migrations/scripts/019-remove-glob-dependency.test.ts +146 -0
- package/src/codemods/migrations/scripts/019-remove-glob-dependency.ts +121 -0
- package/src/codemods/utils.ast.test.ts +151 -0
- package/src/codemods/utils.ast.ts +60 -0
- package/templates/common/.config/bundler/utils.ts +10 -9
- package/templates/common/_package.json +1 -2
- package/templates/docs/app/docs/AGENTS.md +2 -0
- package/templates/docs/app/docs/configure.md +4 -0
- package/templates/docs/app/docs/dashboards.md +4 -0
- package/templates/docs/app/docs/index.md +5 -1
- package/templates/docs/app/docs/troubleshooting.md +5 -1
- package/templates/docs/datasource/docs/AGENTS.md +2 -0
- package/templates/docs/datasource/docs/configure.md +4 -0
- package/templates/docs/datasource/docs/dashboards.md +4 -0
- package/templates/docs/datasource/docs/troubleshooting.md +5 -1
- package/templates/docs/panel/docs/AGENTS.md +2 -0
- package/templates/docs/panel/docs/data-formats.md +4 -0
- package/templates/docs/panel/docs/examples.md +4 -0
|
@@ -12,6 +12,8 @@ sidebar_position: 7
|
|
|
12
12
|
|
|
13
13
|
## Import a dashboard
|
|
14
14
|
|
|
15
|
+
<!-- snippet:import-dashboard -->
|
|
16
|
+
|
|
15
17
|
To import a dashboard that ships with {{{pluginName}}}:
|
|
16
18
|
|
|
17
19
|
1. Click **Connections** > **Data sources** in the left-side menu.
|
|
@@ -21,6 +23,8 @@ To import a dashboard that ships with {{{pluginName}}}:
|
|
|
21
23
|
|
|
22
24
|
Imported dashboards don't update when you upgrade the plugin. When a plugin upgrade ships a newer version of a dashboard, click **Update** next to it. This overwrites any changes you made to it.
|
|
23
25
|
|
|
26
|
+
<!-- /snippet:import-dashboard -->
|
|
27
|
+
|
|
24
28
|
## Included dashboards
|
|
25
29
|
|
|
26
30
|
<!-- section-brief
|
|
@@ -40,7 +40,9 @@ Open each H2 with one sentence on when its errors occur. Add an H3 per symptom,
|
|
|
40
40
|
To see the raw request and response for a panel, open the panel editor and click **Query inspector**.
|
|
41
41
|
{{#if hasBackend}}
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
<!-- snippet:server-debug-logs -->
|
|
44
|
+
|
|
45
|
+
In self-managed Grafana, the Grafana server logs show more detail:
|
|
44
46
|
|
|
45
47
|
1. Set the log level to `debug` in the Grafana configuration file:
|
|
46
48
|
|
|
@@ -52,6 +54,8 @@ In self-managed Grafana, you can also find more detail in the Grafana server log
|
|
|
52
54
|
1. Restart Grafana and reproduce the error.
|
|
53
55
|
1. Look for log lines with `logger=plugin.{{{pluginId}}}`.
|
|
54
56
|
1. Set the log level back to `info` when you're done, to keep the logs small.
|
|
57
|
+
|
|
58
|
+
<!-- /snippet:server-debug-logs -->
|
|
55
59
|
{{/if}}
|
|
56
60
|
|
|
57
61
|
## Get additional help
|
|
@@ -92,6 +92,8 @@ To fill a section:
|
|
|
92
92
|
Briefs are not shown in the preview or the catalog, so a section you haven't written looks like a bare
|
|
93
93
|
heading. `docs:validate` lists every section that still has only its brief.
|
|
94
94
|
|
|
95
|
+
Text between `<!-- snippet:... -->` and `<!-- /snippet:... -->` markers is maintained by Grafana. Never edit inside it - refer to `snippets.md` in the guides.
|
|
96
|
+
|
|
95
97
|
## Validate
|
|
96
98
|
|
|
97
99
|
```bash
|
|
@@ -24,4 +24,8 @@ To see the data the panel receives, open the panel editor, click **Query inspect
|
|
|
24
24
|
|
|
25
25
|
## Reshape data that doesn't match
|
|
26
26
|
|
|
27
|
+
<!-- snippet:reshape-with-transformations -->
|
|
28
|
+
|
|
27
29
|
If a query returns data in a different shape, you can reshape it without changing the query. Select the **Transform data** tab in the panel editor and add a transformation. For more information, refer to [Transform data](https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/transform-data/).
|
|
30
|
+
|
|
31
|
+
<!-- /snippet:reshape-with-transformations -->
|
|
@@ -4,8 +4,12 @@ description: "Worked examples of the {{{yamlEscape pluginName}}} panel."
|
|
|
4
4
|
sidebar_position: 4
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
<!-- snippet:use-example-json -->
|
|
8
|
+
|
|
7
9
|
To use an example, open your dashboard and go to **Dashboard settings** > **JSON Model**. Paste the excerpt into the `panels` array and click **Save changes**.
|
|
8
10
|
|
|
11
|
+
<!-- /snippet:use-example-json -->
|
|
12
|
+
|
|
9
13
|
<!-- section-brief
|
|
10
14
|
Fill this in: Show concrete examples of {{{pluginName}}} configured for real use cases. When the repo has panels of this plugin's type in `provisioning/dashboards/*.json`, take the examples from those before inventing any. Express each example as a `dashboard.json` panel excerpt: `type` and `options`, plus `fieldConfig` and `targets` when the example depends on them. Leave out `id`, `gridPos`, `pluginVersion`, datasource UIDs and timestamps - they are specific to one dashboard and hide the settings that matter. Pair each example with a screenshot of the rendered visualization. Only use a screenshot that the example's JSON produces: open the image and check that what it shows, such as the legend, the values and the number of series, matches the JSON. If no image matches, leave the example without one and flag it. Don't cut settings from an excerpt that its result depends on, such as some of the overrides behind a screenshot.
|
|
11
15
|
|