@grafana/create-plugin 2.11.0-canary.602.da17940.0 → 2.11.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,27 @@
|
|
|
1
|
+
# v2.11.0 (Tue Jan 09 2024)
|
|
2
|
+
|
|
3
|
+
#### 🚀 Enhancement
|
|
4
|
+
|
|
5
|
+
- Create Plugin: Remove Plop [#602](https://github.com/grafana/plugin-tools/pull/602) ([@jackw](https://github.com/jackw))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Jack Westbrook ([@jackw](https://github.com/jackw))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# v2.10.2 (Fri Jan 05 2024)
|
|
14
|
+
|
|
15
|
+
#### 🐛 Bug Fix
|
|
16
|
+
|
|
17
|
+
- Github workflows: Add correct permissions to the release workflow [#642](https://github.com/grafana/plugin-tools/pull/642) ([@leventebalogh](https://github.com/leventebalogh))
|
|
18
|
+
|
|
19
|
+
#### Authors: 1
|
|
20
|
+
|
|
21
|
+
- Levente Balogh ([@leventebalogh](https://github.com/leventebalogh))
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
1
25
|
# v2.10.1 (Thu Dec 14 2023)
|
|
2
26
|
|
|
3
27
|
:tada: This release contains work from a new contributor! :tada:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/create-plugin",
|
|
3
|
-
"version": "2.11.0
|
|
3
|
+
"version": "2.11.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"directory": "packages/create-plugin",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"engines": {
|
|
74
74
|
"node": ">=20"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "b44e3b5fc7f70e374684d349bc20a76f0f17d2ce"
|
|
77
77
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
{{!-- /* 🚨 The `$\{{ }}` Github workflow expressions need to be escaped so they are not being interpreted by Handlebars. (this comment is going to be removed after scaffolding) 🚨 */ --}}
|
|
2
|
+
# This GitHub Action automates the process of building Grafana plugins.
|
|
3
|
+
# (For more information, see https://github.com/grafana/plugin-actions/blob/main/build-plugin/README.md)
|
|
2
4
|
name: Release
|
|
3
5
|
|
|
4
6
|
on:
|
|
@@ -6,16 +8,19 @@ on:
|
|
|
6
8
|
tags:
|
|
7
9
|
- 'v*' # Run workflow on version tags, e.g. v1.0.0.
|
|
8
10
|
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
|
|
9
14
|
jobs:
|
|
10
15
|
release:
|
|
11
16
|
runs-on: ubuntu-latest
|
|
12
17
|
steps:
|
|
13
18
|
- uses: actions/checkout@v3
|
|
14
19
|
- uses: grafana/plugin-actions/build-plugin@release
|
|
15
|
-
#
|
|
20
|
+
# Uncomment to enable plugin signing
|
|
21
|
+
# (For more info on how to generate the access policy token see https://grafana.com/developers/plugin-tools/publish-a-plugin/sign-a-plugin#generate-an-access-policy-token)
|
|
16
22
|
#with:
|
|
17
|
-
#
|
|
18
|
-
# save the value in your repository secrets
|
|
23
|
+
# Make sure to save the token in your repository secrets
|
|
19
24
|
#policy_token: ${{ secrets.GRAFANA_ACCESS_POLICY_TOKEN }}
|
|
20
|
-
#
|
|
25
|
+
# Usage of GRAFANA_API_KEY is deprecated, prefer `policy_token` option above
|
|
21
26
|
#grafana_token: ${{ secrets.GRAFANA_API_KEY }}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
This hideous script is temporarily committed to PR #602 for evaluating the scaffolded output
|
|
3
|
-
from latest `npx -y @grafana/create-plugin@latest` and `npx -y @grafana/create-plugin@2.11.0-canary.602.81e7a0e.0`
|
|
4
|
-
where plop has been removed from the codebase.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import fs from 'fs';
|
|
8
|
-
import path from 'path';
|
|
9
|
-
import { marked } from 'marked';
|
|
10
|
-
import { diffLines } from 'diff';
|
|
11
|
-
import chalk from 'chalk';
|
|
12
|
-
import TerminalRenderer from 'marked-terminal';
|
|
13
|
-
|
|
14
|
-
marked.setOptions({
|
|
15
|
-
renderer: new TerminalRenderer({}),
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const outputDirectory = '/path/to/scaffolded/plugin/withoutPlop/myorg-myplugin-panel';
|
|
19
|
-
const previousOutputDirectory = '/path/to/scaffolded/plugin/withPlop/myorg-myplugin-panel';
|
|
20
|
-
|
|
21
|
-
const changesTable = [
|
|
22
|
-
['File/Directory', 'Change Type', 'Diff'],
|
|
23
|
-
['---', '---', '---'],
|
|
24
|
-
];
|
|
25
|
-
|
|
26
|
-
const compareDirectories = (dir1, dir2) => {
|
|
27
|
-
const entries1 = fs.readdirSync(dir1);
|
|
28
|
-
const entries2 = fs.readdirSync(dir2);
|
|
29
|
-
console.log({ entries1, entries2 });
|
|
30
|
-
entries1.forEach((entry) => {
|
|
31
|
-
const entryPath1 = path.join(dir1, entry);
|
|
32
|
-
const entryPath2 = path.join(dir2, entry);
|
|
33
|
-
|
|
34
|
-
if (fs.statSync(entryPath1).isDirectory()) {
|
|
35
|
-
if (!entries2.includes(entry)) {
|
|
36
|
-
changesTable.push([entry, 'Deleted', '']);
|
|
37
|
-
} else {
|
|
38
|
-
compareDirectories(entryPath1, entryPath2);
|
|
39
|
-
}
|
|
40
|
-
} else {
|
|
41
|
-
const content1 = fs.readFileSync(entryPath1, 'utf8');
|
|
42
|
-
const content2 = fs.readFileSync(entryPath2, 'utf8');
|
|
43
|
-
|
|
44
|
-
if (content1 !== content2) {
|
|
45
|
-
const diff = getDiff(content1, content2);
|
|
46
|
-
changesTable.push([entry, 'Modified', diff]);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
// Check for new files in dir2
|
|
52
|
-
entries2.forEach((entry) => {
|
|
53
|
-
if (!entries1.includes(entry)) {
|
|
54
|
-
changesTable.push([entry, 'Added', '']);
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
compareDirectories(previousOutputDirectory, outputDirectory);
|
|
60
|
-
|
|
61
|
-
function getDiff(text1, text2) {
|
|
62
|
-
const diff = diffLines(text1, text2);
|
|
63
|
-
|
|
64
|
-
let result = '```';
|
|
65
|
-
let inChange = false;
|
|
66
|
-
|
|
67
|
-
diff.forEach((part) => {
|
|
68
|
-
const color = part.added ? 'green' : 'red';
|
|
69
|
-
|
|
70
|
-
if (part.added || part.removed) {
|
|
71
|
-
inChange = true;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (inChange) {
|
|
75
|
-
result += chalk[color](part.value);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (part.value.endsWith('\n')) {
|
|
79
|
-
inChange = false;
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
result += '```';
|
|
84
|
-
return result;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const markdownTable = marked(changesTable.map((row) => `| ${row.join(' | ')} |`).join('\n'));
|
|
88
|
-
|
|
89
|
-
console.log(markdownTable);
|