@grafana/create-plugin 6.3.0-canary.2320.19632326797.0 → 6.3.0-canary.2320.19638409321.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/create-plugin",
3
- "version": "6.3.0-canary.2320.19632326797.0",
3
+ "version": "6.3.0-canary.2320.19638409321.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": "5b46b985dfd18a905e572b69ca71c8f5148a8043"
64
+ "gitHead": "a85de24ae42ffcfee01d3c1b039257f5b2fd10d2"
65
65
  }
@@ -5,17 +5,24 @@ This guide provides specific instructions for working with migrations and additi
5
5
  ## Agent Behavior
6
6
 
7
7
  - Refer to current migrations and additions typescript files found in @./additions/scripts and @./migrations/scripts
8
- - When creating a new migration add it to the exported migrations object in @./migrations/migrations.ts
9
8
  - Always refer to @./context.ts to know what methods are available on the context class
10
9
  - Always check for file existence using the @./context.ts class before attempting to do anything with it
11
10
  - Never write files with any 3rd party npm library. Use the context for all file operations
12
- - Always return the context for the next migration
11
+ - Always return the context for the next migration/addition
13
12
  - Test thoroughly using the provided utils in @./test-utils.ts where necessary
13
+ - Never attempt to read or write files outside the current working directory
14
+
15
+ ## Migrations
16
+
17
+ Migrations are automatically run during `create-plugin update` to keep plugins compatible with newer versions of the tooling. They are forced upon developers to ensure compatibility and are versioned based on the create-plugin version. Migrations primarily target configuration files or files that are scaffolded by create-plugin.
18
+
19
+ ### Migration Behavior
20
+
21
+ - When creating a new migration add it to the exported migrations object in @./migrations/migrations.ts
14
22
  - Each migration must be idempotent and must include a test case that uses the `.toBeIdempotent` custom matcher found in @../../vitest.setup.ts
15
23
  - Keep migrations focused on one task
16
- - Never attempt to read or write files outside the current working directory
17
24
 
18
- ## Naming Conventions
25
+ ### Migration Naming Conventions
19
26
 
20
27
  - Each migration lives under @./migrations/scripts
21
28
  - Migration filenames follow the format: `NNN-migration-title` where migration-title is, at the most, a three word summary of what the migration does and NNN is the next number in sequence based on the current file name in @./migrations/scripts
@@ -23,3 +30,16 @@ This guide provides specific instructions for working with migrations and additi
23
30
  - `NNN-migration-title.ts` - main migration logic
24
31
  - `NNN-migration-title.test.ts` - migration logic tests
25
32
  - Each migration should export a default function named "migrate"
33
+
34
+ ## Additions
35
+
36
+ Additions are optional features that developers choose to add via `create-plugin add`. They are not versioned and can be run at any time to enhance a plugin with new capabilities.
37
+
38
+ ### Addition Behavior
39
+
40
+ - Additions add new features or capabilities to a plugin (e.g., i18n support, testing frameworks, etc.)
41
+ - Each addition must be idempotent - it should be safe to run multiple times
42
+ - Always use defensive programming: check if features already exist before adding them
43
+ - Use `additionsDebug()` for logging to help with troubleshooting
44
+ - If the addition accepts user input, export a `schema` object using `valibot` for input validation
45
+ - Each addition should export a default function that takes `(context: Context, options?: T)` and returns `Context`
@@ -19,7 +19,7 @@
19
19
  "updated": "%TODAY%"
20
20
  },
21
21
  "dependencies": {
22
- "grafanaDependency": ">=10.4.0",
22
+ "grafanaDependency": ">=11.5.0",
23
23
  "plugins": []
24
24
  }
25
25
  }