@grafana/create-plugin 4.7.0 → 4.8.0-canary.779.b3ed39b.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/CONTRIBUTING.md +5 -3
- package/package.json +2 -2
- package/src/constants.ts +1 -1
package/CONTRIBUTING.md
CHANGED
|
@@ -21,7 +21,9 @@ npm install
|
|
|
21
21
|
|
|
22
22
|
### Technologies
|
|
23
23
|
|
|
24
|
-
- [**`
|
|
24
|
+
- [**`minimist`**](https://www.npmjs.com/package/minimist) - for parsing cmd line args
|
|
25
|
+
- [**`enquirer`**](https://www.npmjs.com/package/enquirer) - for prompting users for information
|
|
26
|
+
- [**`handlebars`**](https://www.npmjs.com/package/handlebars) - for file templates
|
|
25
27
|
|
|
26
28
|
### Folder structure
|
|
27
29
|
|
|
@@ -32,7 +34,7 @@ npm install
|
|
|
32
34
|
│ ├── bin // the entrypoint file
|
|
33
35
|
│ ├── commands // Code that runs commands
|
|
34
36
|
│ └── utils // Utilities used by commands
|
|
35
|
-
└── templates //
|
|
37
|
+
└── templates // Handlebars templates
|
|
36
38
|
├── _partials // Composable parts of a template
|
|
37
39
|
├── app // Templates specific to scaffolding an app plugin
|
|
38
40
|
├── backend // Templates specific to scaffolding backend plugin code
|
|
@@ -76,6 +78,6 @@ _Work in progress._
|
|
|
76
78
|
|
|
77
79
|
### Developing the templates
|
|
78
80
|
|
|
79
|
-
The templates are used by
|
|
81
|
+
The templates are used by Handlebars to scaffold Grafana plugins. Whilst they appear to be the intended filetype they are infact treated as markdown by Handlebars when it runs. As such we need to be mindful of syntax and to [escape particular characters](https://handlebarsjs.com/guide/expressions.html#whitespace-control) where necessary. The [github/ci.yml](./templates/github/ci/.github/workflows/ci.yml) file is a good example of this.
|
|
80
82
|
|
|
81
83
|
Note that certain files are intentionally named differently (e.g. npmrc, package.json). This is done due to other tooling preventing the files from being packaged for NPM or breaking other tools during local development.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/create-plugin",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.8.0-canary.779.b3ed39b.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"directory": "packages/create-plugin",
|
|
6
6
|
"url": "https://github.com/grafana/plugin-tools"
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"engines": {
|
|
88
88
|
"node": ">=20"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "b3ed39b4063d5ca56412b4014915402dffb94611"
|
|
91
91
|
}
|
package/src/constants.ts
CHANGED
|
@@ -39,7 +39,7 @@ export enum PLUGIN_TYPES {
|
|
|
39
39
|
scenes = 'scenesapp',
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
// This gets merged into variables coming from user prompts (when
|
|
42
|
+
// This gets merged into variables coming from user prompts (when scaffolding) or any other dynamic variables,
|
|
43
43
|
// and will be available to use in the templates.
|
|
44
44
|
// Example: "@grafana/ui": "{{ grafanaVersion }}"
|
|
45
45
|
export const EXTRA_TEMPLATE_VARIABLES = {
|