@grafana/create-plugin 6.3.0-canary.2314.19530781115.0 β 6.3.0-canary.2314.19540148969.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 +12 -0
- package/dist/codemods/migrations/manager.js +3 -1
- package/package.json +2 -2
- package/src/codemods/migrations/manager.ts +2 -1
- package/templates/panel/.config/AGENTS/instructions.md +83 -0
- package/templates/panel/.config/AGENTS/tasks/add-panel-options.md +8 -6
- package/templates/panel/AGENTS.md +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# v6.2.1 (Thu Nov 20 2025)
|
|
2
|
+
|
|
3
|
+
#### π Bug Fix
|
|
4
|
+
|
|
5
|
+
- Create Plugin: use migration description for commit messages [#2315](https://github.com/grafana/plugin-tools/pull/2315) ([@jackw](https://github.com/jackw))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Jack Westbrook ([@jackw](https://github.com/jackw))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
1
13
|
# v6.2.0 (Thu Nov 20 2025)
|
|
2
14
|
|
|
3
15
|
#### π Enhancement
|
|
@@ -20,7 +20,9 @@ async function runMigrations(migrations, options = {}) {
|
|
|
20
20
|
const context = await runCodemod(migration, options.codemodOptions);
|
|
21
21
|
const shouldCommit = options.commitEachMigration && context.hasChanges();
|
|
22
22
|
if (shouldCommit) {
|
|
23
|
-
await gitCommitNoVerify(`chore: run create-plugin migration - ${migration.name}
|
|
23
|
+
await gitCommitNoVerify(`chore: run create-plugin migration - ${migration.name}
|
|
24
|
+
|
|
25
|
+
${migration.description}`);
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
setRootConfig({ version: CURRENT_APP_VERSION });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/create-plugin",
|
|
3
|
-
"version": "6.3.0-canary.2314.
|
|
3
|
+
"version": "6.3.0-canary.2314.19540148969.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"directory": "packages/create-plugin",
|
|
6
6
|
"url": "https://github.com/grafana/plugin-tools"
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"engines": {
|
|
62
62
|
"node": ">=20"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "57c7ea99cf1008bc7c1fa894c2cb13ffddfc2a70"
|
|
65
65
|
}
|
|
@@ -38,7 +38,8 @@ export async function runMigrations(migrations: Migration[], options: RunMigrati
|
|
|
38
38
|
const shouldCommit = options.commitEachMigration && context.hasChanges();
|
|
39
39
|
|
|
40
40
|
if (shouldCommit) {
|
|
41
|
-
|
|
41
|
+
// for conventional commits we need to add a newline between the title and the description
|
|
42
|
+
await gitCommitNoVerify(`chore: run create-plugin migration - ${migration.name}\n\n${migration.description}`);
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: panel-plugin-agent-fundamentals
|
|
3
|
+
description: Develops Grafana panel plugins
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are an expert Grafana panel plugin developer for this project.
|
|
7
|
+
|
|
8
|
+
## Your role
|
|
9
|
+
|
|
10
|
+
- You are fluent in TypeScript and React
|
|
11
|
+
- You know how to use Grafana dashboards
|
|
12
|
+
|
|
13
|
+
## Project knowledge
|
|
14
|
+
|
|
15
|
+
This repository contains a **Grafana panel plugin**, providing a custom visualization for Grafana dashboards.
|
|
16
|
+
Panel plugins are used to:
|
|
17
|
+
|
|
18
|
+
- Display data from Grafana data sources in custom ways
|
|
19
|
+
- Add interactive behavior (drill-downs, navigation, etc.)
|
|
20
|
+
- Visualize or control external systems (IoT, integrations, custom controls)
|
|
21
|
+
|
|
22
|
+
### Plugin anatomy
|
|
23
|
+
|
|
24
|
+
A typical panel plugin includes:
|
|
25
|
+
|
|
26
|
+
**plugin.json**
|
|
27
|
+
|
|
28
|
+
- Declares plugin ID, type (`panel`), name, version
|
|
29
|
+
- Loaded by Grafana at startup
|
|
30
|
+
|
|
31
|
+
**Main module (`src/module.ts`)**
|
|
32
|
+
|
|
33
|
+
- Exports: `new PanelPlugin(PanelComponent)`
|
|
34
|
+
- Registers panel options, migrations, defaults, ui extensions
|
|
35
|
+
|
|
36
|
+
**Panel component (`src/components/Panel.tsx`)**
|
|
37
|
+
|
|
38
|
+
- React component receiving: `data`, `timeRange`, `width`, `height`, `options`
|
|
39
|
+
- Renders visualization using Grafana data frames and field configs
|
|
40
|
+
|
|
41
|
+
### Repository layout
|
|
42
|
+
|
|
43
|
+
- `plugin.json` β Panel plugin manifest
|
|
44
|
+
- `src/module.ts` β Main plugin entry
|
|
45
|
+
- `src/components/` β Panel React components
|
|
46
|
+
- `src/types.ts` β Option and model types
|
|
47
|
+
- `tests/` β E2E tests (if present)
|
|
48
|
+
- `provisioning/` β Local development provisioning
|
|
49
|
+
- `README.md` β Human documentation
|
|
50
|
+
|
|
51
|
+
## Coding guidelines
|
|
52
|
+
|
|
53
|
+
- Use **TypeScript** and **functional React components**
|
|
54
|
+
- Use **@grafana/ui**, **@grafana/data**, **@grafana/runtime**
|
|
55
|
+
- Respect `width` and `height`; keep layout responsive
|
|
56
|
+
- Avoid unnecessary dependencies; ensure Grafana compatibility
|
|
57
|
+
- Use useTheme2() from @grafana/ui for visual tokens
|
|
58
|
+
- Never hardcode colors, spacing, padding, or font sizes.
|
|
59
|
+
- Use useStyles2(), Emotion and visual tokens from the theme to create styles.
|
|
60
|
+
- Follow existing file structure
|
|
61
|
+
- Keep code typed and predictable
|
|
62
|
+
|
|
63
|
+
## Boundaries
|
|
64
|
+
|
|
65
|
+
You must **not**:
|
|
66
|
+
|
|
67
|
+
- Change plugin IDs or plugin type in `plugin.json`
|
|
68
|
+
- Modify anything under `.config/*`
|
|
69
|
+
- Add a backend β panel plugins are **frontend only**
|
|
70
|
+
- Remove or change existing options without a migration handler
|
|
71
|
+
- Break public APIs (options, field configs, panel props)
|
|
72
|
+
- Store or use credentials.
|
|
73
|
+
|
|
74
|
+
You **should**:
|
|
75
|
+
|
|
76
|
+
- Keep the plugin backward compatible
|
|
77
|
+
- Preserve the existing options schema unless adding a migration handler
|
|
78
|
+
- Mirror patterns from Grafanaβs official panel plugin examples
|
|
79
|
+
- Follow idiomatic React + TypeScript patterns used in official Grafana examples
|
|
80
|
+
|
|
81
|
+
## Instructions for specific tasks
|
|
82
|
+
|
|
83
|
+
- [Add panel options](./tasks/add-panel-options.md)
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Adding a New Panel Option
|
|
2
2
|
|
|
3
|
+
Panel options are settings the user configures to change panel behavior.
|
|
4
|
+
|
|
3
5
|
Always complete **all three steps**:
|
|
4
6
|
|
|
5
7
|
### **1. Extend the options type**
|
|
@@ -13,8 +15,8 @@ export interface SimpleOptions {
|
|
|
13
15
|
}
|
|
14
16
|
```
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
- Property name must match the builder `path`.
|
|
19
|
+
- Type must match expected editor output.
|
|
18
20
|
|
|
19
21
|
---
|
|
20
22
|
|
|
@@ -53,9 +55,9 @@ builder.addXxx({
|
|
|
53
55
|
|
|
54
56
|
Rules:
|
|
55
57
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
- Every option **must** have a `defaultValue`.
|
|
59
|
+
- Put numeric constraints in `settings` (`min`, `max`, `step`).
|
|
60
|
+
- Use `showIf` for conditional display.
|
|
59
61
|
|
|
60
62
|
---
|
|
61
63
|
|
|
@@ -127,4 +129,4 @@ No option may remain unused.
|
|
|
127
129
|
]},
|
|
128
130
|
showIf: (o) => o.showSize,
|
|
129
131
|
})
|
|
130
|
-
```
|
|
132
|
+
```
|
|
@@ -5,4 +5,6 @@ description: Develops Grafana panel plugins
|
|
|
5
5
|
|
|
6
6
|
## Project knowledge
|
|
7
7
|
|
|
8
|
-
This repository contains a **Grafana panel plugin**.
|
|
8
|
+
This repository contains a **Grafana panel plugin**. Follow the [instructions](./.config/AGENTS/instructions.md) before doing any changes.
|
|
9
|
+
|
|
10
|
+
All build, lint, test, and Docker dev-server commands are documented in the "Getting started" section of [README.md](./README.md). Prefer running the non-watch versions of these commands.
|