@grafana/create-plugin 7.15.0 → 7.16.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.
Files changed (32) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/codemods/additions/prompts/docs-content.md +10 -4
  3. package/dist/codemods/additions/scripts/docs.js +32 -8
  4. package/dist/codemods/additions/scripts/experimental-app-sdk.js +40 -0
  5. package/dist/codemods/migrations/manager.js +6 -0
  6. package/dist/commands/update.command.js +7 -1
  7. package/package.json +2 -1
  8. package/src/codemods/additions/prompts/docs-content.md +10 -4
  9. package/src/codemods/additions/scripts/docs.test.ts +137 -39
  10. package/src/codemods/additions/scripts/docs.ts +47 -7
  11. package/src/codemods/additions/scripts/experimental-app-sdk.test.ts +59 -2
  12. package/src/codemods/additions/scripts/experimental-app-sdk.ts +55 -0
  13. package/src/codemods/migrations/manager.test.ts +10 -0
  14. package/src/codemods/migrations/manager.ts +10 -0
  15. package/src/commands/update.command.ts +9 -1
  16. package/templates/common/.config/docker-compose-base.yaml +1 -1
  17. package/templates/common/_package.json +6 -6
  18. package/templates/docs/app/docs/AGENTS.md +4 -0
  19. package/templates/docs/app/docs/configure.md +5 -1
  20. package/templates/docs/app/docs/dashboards.md +4 -0
  21. package/templates/docs/app/docs/index.md +6 -2
  22. package/templates/docs/app/docs/permissions.md +1 -1
  23. package/templates/docs/app/docs/troubleshooting.md +5 -1
  24. package/templates/docs/app/feature-page.md +7 -5
  25. package/templates/docs/datasource/docs/AGENTS.md +2 -0
  26. package/templates/docs/datasource/docs/configure.md +6 -2
  27. package/templates/docs/datasource/docs/dashboards.md +4 -0
  28. package/templates/docs/datasource/docs/troubleshooting.md +5 -1
  29. package/templates/docs/panel/docs/AGENTS.md +2 -0
  30. package/templates/docs/panel/docs/data-formats.md +4 -0
  31. package/templates/docs/panel/docs/examples.md +5 -1
  32. package/templates/docs/panel/docs/options.md +1 -1
@@ -4,10 +4,14 @@ 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
- 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.
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
 
12
16
  If the repo ships a complete dashboard, for example under `provisioning/dashboards/`, link to it for readers who want the full JSON. Use the file's `https://` URL in your repository - relative links can't point outside the docs folder.
13
17
  -->
@@ -22,7 +22,7 @@ Fill this in: Emit a markdown table with these columns - one row per option regi
22
22
 
23
23
  - _Option_: the `name` value from the `setPanelOptions` `.add*({...})` call, verbatim.
24
24
  - _Type_: a short label for the editor the option uses, derived from the builder method (`addBooleanSwitch` → Toggle, `addSelect` → Select, `addNumberInput` → Number, `addFieldNamePicker` → Field picker). For a custom editor, name what it is, such as Color picker, rather than writing Custom.
25
- - _Default_: the value a reader sees in the panel editor, rendered as inline code. Resolve enum members, constants and translation calls to that value - `ClockMode.time` becomes `Time`. Keep the source expression only when it can't be resolved. When there is no default but the code falls back to a value while the option is unset, give that fallback value. Leave the cell empty only when there is neither.
25
+ - _Default_: the value a reader sees in the panel editor, rendered as inline code. Resolve enum members, constants and translation calls to that value - `ClockMode.time` becomes `Time`. Keep the source expression only when it can't be resolved. When there is no default but the code falls back to a value while the option is unset, give that fallback value. Leave the cell empty only when there is neither. When the default matches none of the values the option offers, such as a different case, give what the panel actually does with it.
26
26
  - _Description_: the `description` value, verbatim. If the verbatim text causes a `docs:validate` warning, reword it as little as possible and keep its meaning. When source has none, write one short sentence describing what the option does, based on how the panel code uses it. Don't guess beyond what the code shows.
27
27
 
28
28
  If the panel does not call `setPanelOptions`, remove this section entirely.