Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
4dd4d1e
feat(create-plugin): remove old update command and set useExperimenta…
jackw Sep 3, 2025
0682709
feat(create-plugin): improve messaging when updates are run
jackw Sep 3, 2025
417a1d5
ci(create-plugin): add job to ci for smoke testing update command
jackw Sep 4, 2025
92f75c5
ci(gh-workflows): use --force arg to run update command as not inside…
jackw Sep 4, 2025
d429c1e
ci(gh-workflows): use an earlier version of create-plugin to test upd…
jackw Sep 4, 2025
52a6c93
ci(gh-workflows): do the dependency dance so npm install works in tes…
jackw Sep 4, 2025
2e9adbd
ci(gh-workflows): run the npm pkg commands in the working-directory
jackw Sep 4, 2025
1965f5c
ci(gh-workflows): scaffold plugin during test-updates using 5.19.0
jackw Sep 4, 2025
6191dc0
feat(create-plugin): force plugins to manually bump to last v5 releas…
jackw Sep 5, 2025
710d92d
ci(gh-workflows): set update to use last v5 release and patch bump cr…
jackw Sep 5, 2025
7012678
feat(create-plugin): print migration description when running instead…
jackw Sep 5, 2025
2ffdf1f
feat(create-plugin): auto update plugin to last v5 release before run…
jackw Sep 8, 2025
e3399a6
refactor(create-plugin): delete update.migrate.command file
jackw Sep 8, 2025
b3a497b
feat(create-plugin): exec git add and add error message
jackw Sep 9, 2025
6ccbc1e
fix(create-plugin): promisify exec and tidy command list duplication
jackw Sep 9, 2025
ae64018
refactor(create-plugin): tidy up update command, var names, commands …
jackw Sep 12, 2025
590c165
feat(create-plugin): handle spawned command errors
jackw Sep 13, 2025
ce16298
fix(create-plugin): pass force arg to spawned create-plugin update cmd
jackw Sep 17, 2025
3c1838e
fix(create-plugin): wait for pre-update checks before updating
jackw Sep 17, 2025
f16b135
ci(gh-workflows): remove setting dev dep commands, scaffold with 5.26.5
jackw Sep 19, 2025
052a0bc
refactor(create-plugin): use 5.26.5 for legacy cut off. add comment f…
jackw Sep 19, 2025
ceca074
docs(website): add documentation related to keeping plugin up to date
jackw Sep 24, 2025
49ffa84
docs(website): updates for automate updating your plugin
jackw Sep 24, 2025
a2dc733
refactor(create-plugin): move LEGACY_UPDATE_CUTOFF_VERSION to 5.26.8
jackw Sep 29, 2025
40161d2
refactor(website): move updating plugin to how to guides
jackw Sep 29, 2025
9a4d32c
docs(website): fix broken link due to moving updating-plugin
jackw Sep 29, 2025
0852635
chore(create-plugin): move LEGACY_UPDATE_CUTOFF_VERSION forwards to 5…
jackw Sep 29, 2025
ea61e91
docs(website): add info to suggest using dependabot to keep deps up t…
jackw Sep 30, 2025
be9e29e
Apply suggestions from code review
jackw Oct 1, 2025
936cb50
docs(website): replace usage of recommend with direct command
jackw Oct 1, 2025
dba5a35
Apply suggestions from code review
jackw Oct 1, 2025
6bd079d
feat(create-plugin): move cutoff version forwards to 5.27.0
jackw Oct 7, 2025
c84a49d
refactor(create-plugin): roll cutoff_version forwards to 5.27.1
jackw Oct 7, 2025
ec928d1
feat(create-plugin): on successful update move config.version to curr…
jackw Oct 7, 2025
1ec82f4
test(create-plugin): fix test now updates always write current app ve…
jackw Oct 7, 2025
a9d0caf
fix(create-plugin): 003-update-eslint-deprecation should remove npm p…
jackw Oct 7, 2025
5e113fc
feat: add dependencies for web-based UI
jackw Oct 2, 2025
ea7e0e1
feat: add --ui flag to CLI argument parsing
jackw Oct 2, 2025
cce197c
feat: create basic UI server with port auto-detection
jackw Oct 2, 2025
a7830d8
feat: create basic HTML structure and styling
jackw Oct 2, 2025
02d7a48
feat: implement core web components for migration UI
jackw Oct 2, 2025
56fd6a5
feat: integrate UI mode into update command
jackw Oct 2, 2025
4746829
fix: resolve static file serving issues
jackw Oct 2, 2025
b2dd2b5
refactor(create-plugin): rewrite ui to typescript
jackw Oct 3, 2025
7740b83
build(rollup): add create-plugin static ui build config
jackw Oct 3, 2025
5d35f20
feat(create-plugin): add migrations endpoints to server
jackw Oct 3, 2025
0886ef5
feat(create-plugin): use version information from package and plugin
jackw Oct 3, 2025
f7be7d7
feat(create-plugin): replace select all buttons with a toggle switch
jackw Oct 3, 2025
6ebe552
feat(create-plugin): clean up migrations ui, add css files
jackw Oct 3, 2025
1a97ecc
feat(create-plugin): begin preview migration feature
jackw Oct 3, 2025
d20ce35
feat(create-plugin): begin moving migrations ui to svelte
jackw Oct 3, 2025
19334af
feat(create-plugin): get migration ui toggles working
jackw Oct 3, 2025
b93ab72
Wip
jackw Oct 3, 2025
94d8059
feat(create-plugin): begin adding back preview feature
jackw Oct 3, 2025
d719140
feat(create-plugin): add a diff viewer for previewing migration changes
jackw Oct 3, 2025
3a05ca4
refactor(create-plugin): swap out custom diff algo for diff npm package
jackw Oct 3, 2025
b74c225
feat(create-plugin): add exectution code to drive migrations from the ui
jackw Oct 3, 2025
c0524f1
feat(create-plugin): more tidy, tidy
jackw Oct 3, 2025
abe6f39
chore(create-plugin): put back prepare plugin for migrations
jackw Oct 8, 2025
5556627
feat(create-plugin): rate limit endpoints for codeql
jackw Oct 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .cursor/mcp.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"mcpServers": {
"nx-mcp": {
"url": "http://localhost:9529/sse"
"chrome-devtools": {
"command": "npx",
"args": ["chrome-devtools-mcp@latest", "--yes", "--headless=true", "--isolated=true"]
}
}
}
}
74 changes: 73 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ jobs:
run: npm run build
- name: Lint built packages
run: npm exec nx affected -- --target lint:package --parallel
# Temporarily patch bump create-plugin so it can test update command.
- name: Pack packages for testing
run: |
mkdir ./packed-artifacts
npm version patch --workspace="@grafana/create-plugin" --commit-hooks=false --git-tag-version=false
npm pack --workspace="@grafana/create-plugin" --workspace="@grafana/sign-plugin" --workspace="@grafana/plugin-e2e" --pack-destination="./packed-artifacts"
cp ./.github/knip.json ./packed-artifacts
- name: Upload artifacts for testing
Expand Down Expand Up @@ -97,7 +99,6 @@ jobs:
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'

- name: Download packed artifacts
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
Expand Down Expand Up @@ -164,6 +165,77 @@ jobs:
run: sign-plugin --rootUrls http://www.example.com --signatureType private
working-directory: ./${{ env.WORKING_DIR }}

test-updates:
name: Test create-plugin update command
runs-on: ubuntu-x64
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
needs: [test]
env:
WORKING_DIR: 'myorg-nobackend-panel'
steps:
- name: Scaffold plugin using the earliest create-plugin version mentioned in migrations
run: npx -y @grafana/[email protected] --plugin-name='no-backend' --org-name='myorg' --plugin-type='panel'

- name: Install generated plugin dependencies
run: npm install --no-audit
working-directory: ./${{ env.WORKING_DIR }}

- name: Download packed artifacts
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: packed-artifacts
path: ./packed-artifacts

- name: Install npm packages globally
run: for file in *.tgz; do npm install -g "$file"; done
working-directory: ./packed-artifacts

- name: Test create-plugin update command
run: npx create-plugin update --force
working-directory: ./${{ env.WORKING_DIR }}

- name: Lint plugin frontend
run: npm run lint
working-directory: ./${{ env.WORKING_DIR }}

- name: Typecheck plugin frontend
run: npm run typecheck
working-directory: ./${{ env.WORKING_DIR }}

- name: Build plugin frontend
run: npm run build
working-directory: ./${{ env.WORKING_DIR }}

- name: Test plugin frontend
run: npm run test:ci
working-directory: ./${{ env.WORKING_DIR }}

- name: Install playwright dependencies
run: npm exec playwright install --with-deps chromium
working-directory: ./${{ env.WORKING_DIR }}

- name: Start grafana server for e2e tests (10.4.0)
run: |
ANONYMOUS_AUTH_ENABLED=false docker compose build --no-cache
docker compose up -d
env:
GRAFANA_VERSION: '10.4.0'
working-directory: ./${{ env.WORKING_DIR }}

- name: Wait for grafana server (10.4.0)
uses: grafana/plugin-actions/wait-for-grafana@wait-for-grafana/v1.0.1
with:
url: http://localhost:3000/login

- name: Run e2e tests (10.4.0)
id: run-e2e-tests-min-version
run: npm run e2e
working-directory: ./${{ env.WORKING_DIR }}

- name: Stop grafana docker (10.4.0)
run: docker compose down
working-directory: ./${{ env.WORKING_DIR }}

generate-plugins:
name: Test plugin scaffolding
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
Expand Down
73 changes: 73 additions & 0 deletions docusaurus/docs/how-to-guides/updating-a-plugin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
description: Learn how to use create-plugin update to automatically update configuration files, workflows, and dependencies.
keywords:
- grafana
- plugin
- update
- config
- dependencies
---

import UpdateNPM from '@shared/createplugin-update.md';
import UpdateNPMCommit from '@shared/createplugin-update-commit.md';
import UpdateNPMForce from '@shared/createplugin-update-force.md';

# Automate updating your plugin

It's important for the health of your Grafana plugin to keep its tooling up to date. Doing so, however, can be a laborious task. To help solve this, `create-plugin` provides the `update` command to help you automate tooling updates, including:

- **configuration file changes** to take advantage of updates in Grafana, development tooling, and create-plugin
- **dependency updates** to navigate major version bumps in development tooling
- **code refactors** to align with changes to configuration files or major dependency updates

:::info[Git branch status]

Create a git branch before proceeding. If there are uncommitted changes, stash or commit them first otherwise the update command will exit early.

:::

To update your plugin, run:

<UpdateNPM />

After the update is finished, run your development and build scripts to validate your plugin environment is still operating as expected.

## Options and flags

### `--commit`

The commit flag will commit the changes to the current branch on each successful migration. This is useful for debugging and reviewing changes made by the update command.

<UpdateNPMCommit />

### `--force`

The force flag can be used to bypass all safety checks related to uncommitted changes. Use with discretion.

<UpdateNPMForce />

## How it works

The update command applies a series of changes, known as migrations, to your plugin to align it with the latest 'create-plugin' standards.

When run, it:

- Detects the current create-plugin version
- Determines which migrations need to run to bring your plugin up to date
- Runs each migration sequentially

As each migration runs, its name and description are output to the terminal, along with a list of any files the migration has changed. If a migration updates any dependencies, it will also install and update any lock files.

If you pass the `--commit` flag, after each migration finishes it adds a Git commit to the current branch with the name of the migration.

## Automate updates via CI

To make it even easier to keep your plugin up to date, we provide a GitHub workflow that runs the update command and automatically opens a PR if there are any changes. You can follow [these steps](/set-up/set-up-github#the-create-plugin-update-workflow) to enable it in your repository.

## Automate dependency updates

`create-plugin` will only update dependencies if they are required for other changes to function correctly. Besides running the update command regularly, use [dependabot](https://docs.github.com/en/code-security/getting-started/dependabot-quickstart-guide) or [renovatebot](https://docs.renovatebot.com/) to keep all dependencies up to date.

## Getting help

If you experience issues, please [open a bug report](https://github.com/grafana/plugin-tools/issues/new?template=bug_report.yml).
1 change: 1 addition & 0 deletions docusaurus/docs/key-concepts/best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Is something missing from this list? [Let us know](https://github.com/grafana/pl
- **Include a well-written README** - Give users a deeper understanding of how to configure and use your plugin, but don’t make it essential reading. You want users to be able to understand your plugin intuitively without referring to the documentation if possible.
- **Allow incremental learning** - Hide advanced options using switches or categories, and let users learn about advanced features when they’re ready.
- **Get beta testers** - Enlist users in your target audience to try out your plugin before you submit it. Get feedback to help improve your plugin before it's published.
- **Keep tooling up to date** - Take advantage of the [create-plugin update](/how-to-guides/updating-a-plugin.md) command to keep your plugin up to date.

## Panel plugins

Expand Down
3 changes: 3 additions & 0 deletions docusaurus/docs/shared/createplugin-update-commit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```shell npm2yarn
npx @grafana/create-plugin@latest update --commit
```
1 change: 1 addition & 0 deletions docusaurus/website/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ const sidebars: SidebarsConfig = {
items: ['how-to-guides/plugin-internationalization-grafana-11'],
},
'how-to-guides/runtime-checks',
'how-to-guides/updating-a-plugin',
'how-to-guides/debugging-plugins',
],
},
Expand Down
Loading