@grafana/create-plugin 5.9.0-canary.1298.dd906d7.0 → 5.9.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 CHANGED
@@ -1,3 +1,43 @@
1
+ # v5.9.0 (Mon Nov 11 2024)
2
+
3
+ #### šŸš€ Enhancement
4
+
5
+ - Support node 22 [#1298](https://github.com/grafana/plugin-tools/pull/1298) ([@sunker](https://github.com/sunker))
6
+ - Create Plugin: Add plugin.json check step to CI [#1307](https://github.com/grafana/plugin-tools/pull/1307) ([@oshirohugo](https://github.com/oshirohugo))
7
+ - ref: set testdata-db DS for panel plugin [#1282](https://github.com/grafana/plugin-tools/pull/1282) ([@s4kh](https://github.com/s4kh) [@josmperez](https://github.com/josmperez))
8
+
9
+ #### šŸ› Bug Fix
10
+
11
+ - Update dependency @grafana/scenes to v5.23.4 [#1311](https://github.com/grafana/plugin-tools/pull/1311) ([@renovate[bot]](https://github.com/renovate[bot]))
12
+ - Update dependency @grafana/scenes to v5.23.2 [#1310](https://github.com/grafana/plugin-tools/pull/1310) ([@renovate[bot]](https://github.com/renovate[bot]))
13
+ - Create plugin: Remove console.log from webpack buildmode plugin [#1306](https://github.com/grafana/plugin-tools/pull/1306) ([@jackw](https://github.com/jackw))
14
+ - Update dependency marked to v14 [#1220](https://github.com/grafana/plugin-tools/pull/1220) ([@renovate[bot]](https://github.com/renovate[bot]) [@jackw](https://github.com/jackw))
15
+ - Update dependency @grafana/scenes to v5.23.1 [#1299](https://github.com/grafana/plugin-tools/pull/1299) ([@renovate[bot]](https://github.com/renovate[bot]))
16
+ - Update dependency @grafana/plugin-e2e to v1.11.3 [#1303](https://github.com/grafana/plugin-tools/pull/1303) ([@renovate[bot]](https://github.com/renovate[bot]))
17
+
18
+ #### Authors: 6
19
+
20
+ - [@renovate[bot]](https://github.com/renovate[bot])
21
+ - Erik Sundell ([@sunker](https://github.com/sunker))
22
+ - Hugo Kiyodi Oshiro ([@oshirohugo](https://github.com/oshirohugo))
23
+ - Jack Westbrook ([@jackw](https://github.com/jackw))
24
+ - Joseph Perez ([@josmperez](https://github.com/josmperez))
25
+ - Syerikjan Kh ([@s4kh](https://github.com/s4kh))
26
+
27
+ ---
28
+
29
+ # v5.8.2 (Mon Nov 04 2024)
30
+
31
+ #### šŸ› Bug Fix
32
+
33
+ - Update dependency @grafana/plugin-e2e to v1.11.2 [#1295](https://github.com/grafana/plugin-tools/pull/1295) ([@renovate[bot]](https://github.com/renovate[bot]))
34
+
35
+ #### Authors: 1
36
+
37
+ - [@renovate[bot]](https://github.com/renovate[bot])
38
+
39
+ ---
40
+
1
41
  # v5.8.1 (Fri Nov 01 2024)
2
42
 
3
43
  #### šŸ› Bug Fix
@@ -1,14 +1,12 @@
1
1
  import { marked } from 'marked';
2
2
  import chalk from 'chalk';
3
3
  import boxen from 'boxen';
4
- import TerminalRenderer from 'marked-terminal';
4
+ import { markedTerminal } from 'marked-terminal';
5
5
  import Enquirer from 'enquirer';
6
6
  const { prompt } = Enquirer;
7
- marked.setOptions({
8
- renderer: new TerminalRenderer({
9
- firstHeading: chalk.hex('#ff9900').underline.bold,
10
- }),
11
- });
7
+ marked.use(markedTerminal({
8
+ firstHeading: chalk.hex('#ff9900').underline.bold,
9
+ }));
12
10
  export function displayAsMarkdown(msg) {
13
11
  return marked(msg);
14
12
  }
@@ -19,7 +17,7 @@ export function printMessage(msg) {
19
17
  console.log(displayAsMarkdown(`\n${msg}`));
20
18
  }
21
19
  export function printSuccessMessage(msg) {
22
- console.log(displayAsMarkdown(`\nāœ” ${msg}`).trim());
20
+ console.log(displayAsMarkdown(`\nāœ” ${msg}`));
23
21
  }
24
22
  export function printError(error) {
25
23
  console.error(displayAsMarkdown(`\nāŒ ${error}`));
@@ -28,19 +26,21 @@ export function printWarning(error) {
28
26
  console.warn(displayAsMarkdown(`\nāš ļø ${error}`));
29
27
  }
30
28
  export async function confirmPrompt(message) {
29
+ const mkdMessage = await displayAsMarkdown(message);
31
30
  const question = await prompt({
32
31
  name: 'confirmPrompt',
33
32
  type: 'confirm',
34
- message: displayAsMarkdown(message),
33
+ message: mkdMessage,
35
34
  });
36
35
  return question['confirmPrompt'];
37
36
  }
38
37
  export async function selectPrompt(message, choices) {
38
+ const mkdMessage = await displayAsMarkdown(message);
39
39
  const question = await prompt({
40
40
  name: 'selectPrompt',
41
41
  type: 'select',
42
42
  choices,
43
- message: displayAsMarkdown(message),
43
+ message: mkdMessage,
44
44
  });
45
45
  return question['selectPrompt'];
46
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/create-plugin",
3
- "version": "5.9.0-canary.1298.dd906d7.0",
3
+ "version": "5.9.0",
4
4
  "repository": {
5
5
  "directory": "packages/create-plugin",
6
6
  "url": "https://github.com/grafana/plugin-tools"
@@ -53,7 +53,7 @@
53
53
  "find-up": "^7.0.0",
54
54
  "glob": "^11.0.0",
55
55
  "handlebars": "^4.7.8",
56
- "marked": "^10.0.0",
56
+ "marked": "^14.0.0",
57
57
  "marked-terminal": "^7.0.0",
58
58
  "minimist": "^1.2.8",
59
59
  "semver": "^7.3.5",
@@ -67,7 +67,7 @@
67
67
  },
68
68
  "overrides": {
69
69
  "@types/marked-terminal": {
70
- "marked": "^10.0.0"
70
+ "marked": "^14.0.0"
71
71
  }
72
72
  },
73
73
  "nodemonConfig": {
@@ -86,5 +86,5 @@
86
86
  "engines": {
87
87
  "node": ">=20"
88
88
  },
89
- "gitHead": "dd906d7d4540741a5926e2de06670c8d8c8071f9"
89
+ "gitHead": "299e32af527467fa058a75fbfa0a777c6c90c755"
90
90
  }
@@ -1,16 +1,17 @@
1
- import { marked } from 'marked';
1
+ import { marked, MarkedExtension } from 'marked';
2
2
  import chalk, { type ForegroundColorName } from 'chalk';
3
3
  import boxen from 'boxen';
4
- import TerminalRenderer from 'marked-terminal';
4
+ import { markedTerminal } from 'marked-terminal';
5
5
  import Enquirer from 'enquirer';
6
6
 
7
7
  const { prompt } = Enquirer;
8
8
 
9
- marked.setOptions({
10
- renderer: new TerminalRenderer({
9
+ // They're compatible but this type assertion is required because @types/marked-terminal needs changes.
10
+ marked.use(
11
+ markedTerminal({
11
12
  firstHeading: chalk.hex('#ff9900').underline.bold,
12
- }),
13
- });
13
+ }) as MarkedExtension
14
+ );
14
15
 
15
16
  export function displayAsMarkdown(msg: string) {
16
17
  return marked(msg);
@@ -25,7 +26,7 @@ export function printMessage(msg: string) {
25
26
  }
26
27
 
27
28
  export function printSuccessMessage(msg: string) {
28
- console.log(displayAsMarkdown(`\nāœ” ${msg}`).trim());
29
+ console.log(displayAsMarkdown(`\nāœ” ${msg}`));
29
30
  }
30
31
 
31
32
  export function printError(error: string) {
@@ -37,21 +38,23 @@ export function printWarning(error: string) {
37
38
  }
38
39
 
39
40
  export async function confirmPrompt(message: string): Promise<boolean> {
41
+ const mkdMessage = await displayAsMarkdown(message);
40
42
  const question: Record<string, boolean> = await prompt({
41
43
  name: 'confirmPrompt',
42
44
  type: 'confirm',
43
- message: displayAsMarkdown(message),
45
+ message: mkdMessage,
44
46
  });
45
47
 
46
48
  return question['confirmPrompt'];
47
49
  }
48
50
 
49
51
  export async function selectPrompt(message: string, choices: string[]): Promise<string> {
52
+ const mkdMessage = await displayAsMarkdown(message);
50
53
  const question: Record<string, string> = await prompt({
51
54
  name: 'selectPrompt',
52
55
  type: 'select',
53
56
  choices,
54
- message: displayAsMarkdown(message),
57
+ message: mkdMessage,
55
58
  });
56
59
 
57
60
  return question['selectPrompt'];
@@ -14,7 +14,6 @@ export class BuildModeWebpackPlugin {
14
14
  const assets = compilation.getAssets();
15
15
  for (const asset of assets) {
16
16
  if (asset.name.endsWith('plugin.json')) {
17
- console.log(asset.name);
18
17
  const pluginJsonString = asset.source.source().toString();
19
18
  const pluginJsonWithBuildMode = JSON.stringify(
20
19
  {
@@ -22,7 +22,7 @@
22
22
  "@grafana/e2e": "^11.0.7",
23
23
  "@grafana/e2e-selectors": "^11.3.0",{{/if}}
24
24
  "@grafana/eslint-config": "^7.0.0",{{#if usePlaywright}}
25
- "@grafana/plugin-e2e": "^1.11.2",{{/if}}
25
+ "@grafana/plugin-e2e": "^1.11.3",{{/if}}
26
26
  "@grafana/tsconfig": "^2.0.0",{{#if usePlaywright}}
27
27
  "@playwright/test": "^1.41.2",{{/if}}
28
28
  "@swc/core": "^1.3.90",
@@ -70,7 +70,7 @@
70
70
  "@grafana/runtime": "^11.3.0",
71
71
  "@grafana/ui": "^11.3.0",
72
72
  "@grafana/schema": "^11.3.0",{{#if_eq pluginType "scenesapp"}}
73
- "@grafana/scenes": "^5.21.2",{{/if_eq}}
73
+ "@grafana/scenes": "^5.23.4",{{/if_eq}}
74
74
  "react": "18.2.0",
75
75
  "react-dom": "18.2.0",{{#if isAppType}}
76
76
  "react-router-dom": "^{{ reactRouterVersion }}",
@@ -108,6 +108,12 @@ jobs:
108
108
  mv dist $\{{ steps.metadata.outputs.plugin-id }}
109
109
  zip $\{{ steps.metadata.outputs.archive }} $\{{ steps.metadata.outputs.plugin-id }} -r
110
110
 
111
+ - name: Check plugin.json
112
+ run: |
113
+ docker run --pull=always \
114
+ -v $PWD/${{ steps.metadata.outputs.archive }}:/archive.zip \
115
+ grafana/plugin-validator-cli -analyzer=metadatavalid /archive.zip
116
+
111
117
  - name: Archive Build
112
118
  uses: actions/upload-artifact@v4
113
119
  with:
@@ -24,8 +24,8 @@
24
24
  "panels": [
25
25
  {
26
26
  "datasource": {
27
- "type": "grafana",
28
- "uid": "grafana"
27
+ "type": "grafana-testdata-datasource",
28
+ "uid": "trlxrdZVk"
29
29
  },
30
30
  "gridPos": {
31
31
  "h": 8,
@@ -42,14 +42,15 @@
42
42
  "targets": [
43
43
  {
44
44
  "datasource": {
45
- "type": "datasource",
46
- "uid": "grafana"
45
+ "type": "grafana-testdata-datasource",
46
+ "uid": "db84e60d-b92a-4089-82cb-34842fb1754b"
47
47
  },
48
- "queryType": "randomWalk",
49
- "refId": "A"
48
+ "refId": "A",
49
+ "scenarioId": "raw_frame",
50
+ "rawFrameContent": "[\n {\n \"columns\": [\n {\n \"text\": \"Time\",\n \"type\": \"time\"\n },\n {\n \"text\": \"Label\",\n \"type\": \"string\"\n },\n {\n \"text\": \"Value\",\n \"type\": \"number\"\n }\n ],\n \"rows\": [\n [1609459200000, \"A\", 10],\n [1609462800000, \"B\", 20],\n [1609466400000, \"C\", 15],\n [1609470000000, \"D\", 25],\n [1609473600000, \"E\", 30]\n ]\n },\n{\n \"columns\": [\n {\n \"text\": \"Time\",\n \"type\": \"time\"\n },\n {\n \"text\": \"Label\",\n \"type\": \"string\"\n },\n {\n \"text\": \"Value\",\n \"type\": \"number\"\n }\n ],\n \"rows\": [\n [1609459200000, \"A\", 40],\n [1609462800000, \"B\", 50],\n [1609466400000, \"C\", 45],\n [1609470000000, \"D\", 55],\n [1609473600000, \"E\", 60]\n ]\n }\n]"
50
51
  }
51
52
  ],
52
- "title": "Panel Title",
53
+ "title": "Sample Panel Title",
53
54
  "type": "{{ pluginId }}"
54
55
  },
55
56
  {
@@ -80,7 +81,7 @@
80
81
  "scenarioId": "no_data_points"
81
82
  }
82
83
  ],
83
- "title": "Panel Title",
84
+ "title": "Sample Panel Title",
84
85
  "type": "{{ pluginId }}"
85
86
  }
86
87
  ],