@grafana/create-plugin 5.4.0-canary.999.f39e44c.0 → 5.4.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 +50 -0
- package/dist/commands/generate.command.js +1 -1
- package/dist/commands/update.command.js +8 -6
- package/package.json +4 -3
- package/src/commands/generate.command.ts +1 -1
- package/src/commands/update.command.ts +9 -7
- package/templates/common/.config/webpack/webpack.config.ts +0 -5
- package/templates/common/_package.json +2 -4
- package/templates/datasource/src/datasource.ts +3 -4
- /package/dist/{commands/generate/update-go-sdk-and-packages.js → utils/utils.goSdk.js} +0 -0
- /package/src/{commands/generate/update-go-sdk-and-packages.ts → utils/utils.goSdk.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,53 @@
|
|
|
1
|
+
# v5.4.0 (Mon Sep 30 2024)
|
|
2
|
+
|
|
3
|
+
#### 🚀 Enhancement
|
|
4
|
+
|
|
5
|
+
- Create Plugin: Update go sdk when running update cmd [#1143](https://github.com/grafana/plugin-tools/pull/1143) ([@jackw](https://github.com/jackw))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Jack Westbrook ([@jackw](https://github.com/jackw))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# v5.3.12 (Mon Sep 30 2024)
|
|
14
|
+
|
|
15
|
+
#### 🐛 Bug Fix
|
|
16
|
+
|
|
17
|
+
- Switch to createDataFrame [#1133](https://github.com/grafana/plugin-tools/pull/1133) ([@tolzhabayev](https://github.com/tolzhabayev))
|
|
18
|
+
|
|
19
|
+
#### Authors: 1
|
|
20
|
+
|
|
21
|
+
- Timur Olzhabayev ([@tolzhabayev](https://github.com/tolzhabayev))
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
# v5.3.11 (Wed Sep 25 2024)
|
|
26
|
+
|
|
27
|
+
#### 🐛 Bug Fix
|
|
28
|
+
|
|
29
|
+
- Feat: Adding provenance publish config [#1127](https://github.com/grafana/plugin-tools/pull/1127) ([@tolzhabayev](https://github.com/tolzhabayev))
|
|
30
|
+
- Update dependency @grafana/scenes to v5.14.7 [#1119](https://github.com/grafana/plugin-tools/pull/1119) ([@renovate[bot]](https://github.com/renovate[bot]))
|
|
31
|
+
|
|
32
|
+
#### Authors: 2
|
|
33
|
+
|
|
34
|
+
- [@renovate[bot]](https://github.com/renovate[bot])
|
|
35
|
+
- Timur Olzhabayev ([@tolzhabayev](https://github.com/tolzhabayev))
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
# v5.3.10 (Mon Sep 09 2024)
|
|
40
|
+
|
|
41
|
+
#### 🐛 Bug Fix
|
|
42
|
+
|
|
43
|
+
- Update grafana dependencies [#1094](https://github.com/grafana/plugin-tools/pull/1094) ([@renovate[bot]](https://github.com/renovate[bot]))
|
|
44
|
+
|
|
45
|
+
#### Authors: 1
|
|
46
|
+
|
|
47
|
+
- [@renovate[bot]](https://github.com/renovate[bot])
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
1
51
|
# v5.3.9 (Thu Sep 05 2024)
|
|
2
52
|
|
|
3
53
|
#### 🐛 Bug Fix
|
|
@@ -10,7 +10,7 @@ import { renderTemplateFromFile, getTemplateData } from '../utils/utils.template
|
|
|
10
10
|
import { prettifyFiles } from '../utils/utils.prettifyFiles.js';
|
|
11
11
|
import { printGenerateSuccessMessage } from './generate/print-success-message.js';
|
|
12
12
|
import { promptUser } from './generate/prompt-user.js';
|
|
13
|
-
import { updateGoSdkAndModules } from '
|
|
13
|
+
import { updateGoSdkAndModules } from '../utils/utils.goSdk.js';
|
|
14
14
|
export const generate = async (argv) => {
|
|
15
15
|
const answers = await promptUser(argv);
|
|
16
16
|
const templateData = getTemplateData({ ...answers });
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
import { printRedBox, printBlueBox } from '../utils/utils.console.js';
|
|
3
|
-
import { updatePackageJson, updateNpmScripts } from '../utils/utils.npm.js';
|
|
4
|
-
import { isGitDirectory, isGitDirectoryClean } from '../utils/utils.git.js';
|
|
5
|
-
import { isPluginDirectory, updateDotConfigFolder } from '../utils/utils.plugin.js';
|
|
6
|
-
import { getVersion, getGrafanaRuntimeVersion } from '../utils/utils.version.js';
|
|
7
|
-
import { getPackageManagerFromUserAgent } from '../utils/utils.packageManager.js';
|
|
8
2
|
import { UDPATE_CONFIG } from '../constants.js';
|
|
3
|
+
import { printBlueBox, printRedBox } from '../utils/utils.console.js';
|
|
9
4
|
import { getOnlyExistingInCwd, removeFilesInCwd } from '../utils/utils.files.js';
|
|
5
|
+
import { isGitDirectory, isGitDirectoryClean } from '../utils/utils.git.js';
|
|
6
|
+
import { updateGoSdkAndModules } from '../utils/utils.goSdk.js';
|
|
7
|
+
import { updateNpmScripts, updatePackageJson } from '../utils/utils.npm.js';
|
|
8
|
+
import { getPackageManagerFromUserAgent } from '../utils/utils.packageManager.js';
|
|
9
|
+
import { isPluginDirectory, updateDotConfigFolder } from '../utils/utils.plugin.js';
|
|
10
|
+
import { getGrafanaRuntimeVersion, getVersion } from '../utils/utils.version.js';
|
|
10
11
|
export const update = async (argv) => {
|
|
11
12
|
const { packageManagerName } = getPackageManagerFromUserAgent();
|
|
12
13
|
try {
|
|
@@ -42,6 +43,7 @@ In case you want to proceed as is please use the ${chalk.bold('--force')} flag.)
|
|
|
42
43
|
onlyOutdated: true,
|
|
43
44
|
ignoreGrafanaDependencies: false,
|
|
44
45
|
});
|
|
46
|
+
await updateGoSdkAndModules(process.cwd());
|
|
45
47
|
const filesToRemove = getOnlyExistingInCwd(UDPATE_CONFIG.filesToRemove);
|
|
46
48
|
if (filesToRemove.length) {
|
|
47
49
|
removeFilesInCwd(filesToRemove);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/create-plugin",
|
|
3
|
-
"version": "5.4.0
|
|
3
|
+
"version": "5.4.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"directory": "packages/create-plugin",
|
|
6
6
|
"url": "https://github.com/grafana/plugin-tools"
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
},
|
|
18
18
|
"publishConfig": {
|
|
19
19
|
"registry": "https://registry.npmjs.org/",
|
|
20
|
-
"access": "public"
|
|
20
|
+
"access": "public",
|
|
21
|
+
"provenance": true
|
|
21
22
|
},
|
|
22
23
|
"scripts": {
|
|
23
24
|
"clean": "rm -rf ./dist ./generated",
|
|
@@ -87,5 +88,5 @@
|
|
|
87
88
|
"engines": {
|
|
88
89
|
"node": ">=20"
|
|
89
90
|
},
|
|
90
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "c6429b48ae503aac19c1c56f5ae2e3017514c6cb"
|
|
91
92
|
}
|
|
@@ -11,7 +11,7 @@ import { renderTemplateFromFile, getTemplateData } from '../utils/utils.template
|
|
|
11
11
|
import { prettifyFiles } from '../utils/utils.prettifyFiles.js';
|
|
12
12
|
import { printGenerateSuccessMessage } from './generate/print-success-message.js';
|
|
13
13
|
import { promptUser } from './generate/prompt-user.js';
|
|
14
|
-
import { updateGoSdkAndModules } from '
|
|
14
|
+
import { updateGoSdkAndModules } from '../utils/utils.goSdk.js';
|
|
15
15
|
import { TemplateData } from '../types.js';
|
|
16
16
|
|
|
17
17
|
export const generate = async (argv: minimist.ParsedArgs) => {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import minimist from 'minimist';
|
|
2
1
|
import chalk from 'chalk';
|
|
3
|
-
import
|
|
4
|
-
import { updatePackageJson, updateNpmScripts } from '../utils/utils.npm.js';
|
|
5
|
-
import { isGitDirectory, isGitDirectoryClean } from '../utils/utils.git.js';
|
|
6
|
-
import { isPluginDirectory, updateDotConfigFolder } from '../utils/utils.plugin.js';
|
|
7
|
-
import { getVersion, getGrafanaRuntimeVersion } from '../utils/utils.version.js';
|
|
8
|
-
import { getPackageManagerFromUserAgent } from '../utils/utils.packageManager.js';
|
|
2
|
+
import minimist from 'minimist';
|
|
9
3
|
import { UDPATE_CONFIG } from '../constants.js';
|
|
4
|
+
import { printBlueBox, printRedBox } from '../utils/utils.console.js';
|
|
10
5
|
import { getOnlyExistingInCwd, removeFilesInCwd } from '../utils/utils.files.js';
|
|
6
|
+
import { isGitDirectory, isGitDirectoryClean } from '../utils/utils.git.js';
|
|
7
|
+
import { updateGoSdkAndModules } from '../utils/utils.goSdk.js';
|
|
8
|
+
import { updateNpmScripts, updatePackageJson } from '../utils/utils.npm.js';
|
|
9
|
+
import { getPackageManagerFromUserAgent } from '../utils/utils.packageManager.js';
|
|
10
|
+
import { isPluginDirectory, updateDotConfigFolder } from '../utils/utils.plugin.js';
|
|
11
|
+
import { getGrafanaRuntimeVersion, getVersion } from '../utils/utils.version.js';
|
|
11
12
|
|
|
12
13
|
export const update = async (argv: minimist.ParsedArgs) => {
|
|
13
14
|
const { packageManagerName } = getPackageManagerFromUserAgent();
|
|
@@ -55,6 +56,7 @@ In case you want to proceed as is please use the ${chalk.bold('--force')} flag.)
|
|
|
55
56
|
onlyOutdated: true,
|
|
56
57
|
ignoreGrafanaDependencies: false,
|
|
57
58
|
});
|
|
59
|
+
await updateGoSdkAndModules(process.cwd());
|
|
58
60
|
|
|
59
61
|
const filesToRemove = getOnlyExistingInCwd(UDPATE_CONFIG.filesToRemove);
|
|
60
62
|
if (filesToRemove.length) {
|
|
@@ -11,7 +11,6 @@ import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
|
|
|
11
11
|
import path from 'path';
|
|
12
12
|
import ReplaceInFileWebpackPlugin from 'replace-in-file-webpack-plugin';
|
|
13
13
|
import TerserPlugin from 'terser-webpack-plugin';
|
|
14
|
-
import { SubresourceIntegrityPlugin } from "webpack-subresource-integrity";
|
|
15
14
|
import { type Configuration, BannerPlugin } from 'webpack';
|
|
16
15
|
import LiveReloadPlugin from 'webpack-livereload-plugin';
|
|
17
16
|
import VirtualModulesPlugin from 'webpack-virtual-modules';
|
|
@@ -183,7 +182,6 @@ const config = async (env): Promise<Configuration> => {
|
|
|
183
182
|
path: path.resolve(process.cwd(), DIST_DIR),
|
|
184
183
|
publicPath: `public/plugins/${pluginJson.id}/`,
|
|
185
184
|
uniqueName: pluginJson.id,
|
|
186
|
-
crossOriginLoading: 'anonymous',
|
|
187
185
|
},
|
|
188
186
|
|
|
189
187
|
plugins: [
|
|
@@ -233,9 +231,6 @@ const config = async (env): Promise<Configuration> => {
|
|
|
233
231
|
],
|
|
234
232
|
},
|
|
235
233
|
]),
|
|
236
|
-
new SubresourceIntegrityPlugin({
|
|
237
|
-
hashFuncNames: ["sha256"],
|
|
238
|
-
}),
|
|
239
234
|
...(env.development ? [
|
|
240
235
|
new LiveReloadPlugin(),
|
|
241
236
|
new ForkTsCheckerWebpackPlugin({
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@grafana/e2e": "^11.0.4",
|
|
23
23
|
"@grafana/e2e-selectors": "^11.2.0",{{/if}}
|
|
24
24
|
"@grafana/eslint-config": "^7.0.0",{{#if usePlaywright}}
|
|
25
|
-
"@grafana/plugin-e2e": "^1.7.
|
|
25
|
+
"@grafana/plugin-e2e": "^1.7.2",{{/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",
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
"@testing-library/jest-dom": "6.1.4",
|
|
32
32
|
"@testing-library/react": "14.0.0",
|
|
33
33
|
"@types/jest": "^29.5.0",
|
|
34
|
-
"@types/lodash": "^4.14.194",
|
|
35
34
|
"@types/node": "^20.8.7",{{#unless useReactRouterV6}}
|
|
36
35
|
"@types/react-router-dom": "^{{ reactRouterVersion }}",{{/unless}}
|
|
37
36
|
"@types/testing-library__jest-dom": "5.14.8",
|
|
@@ -58,7 +57,6 @@
|
|
|
58
57
|
"webpack": "^5.94.0",
|
|
59
58
|
"webpack-cli": "^5.1.4",
|
|
60
59
|
"webpack-livereload-plugin": "^3.0.2",
|
|
61
|
-
"webpack-subresource-integrity": "^5.1.0",
|
|
62
60
|
"webpack-virtual-modules": "^0.6.2"
|
|
63
61
|
},
|
|
64
62
|
"engines": {
|
|
@@ -70,7 +68,7 @@
|
|
|
70
68
|
"@grafana/runtime": "^11.2.0",
|
|
71
69
|
"@grafana/ui": "^11.2.0",
|
|
72
70
|
"@grafana/schema": "^10.4.0",{{#if_eq pluginType "scenesapp"}}
|
|
73
|
-
"@grafana/scenes": "^5.
|
|
71
|
+
"@grafana/scenes": "^5.14.7",{{/if_eq}}
|
|
74
72
|
"react": "18.2.0",
|
|
75
73
|
"react-dom": "18.2.0",{{#if isAppType}}
|
|
76
74
|
"react-router-dom": "^{{ reactRouterVersion }}",
|
|
@@ -5,13 +5,12 @@ import {
|
|
|
5
5
|
DataQueryResponse,
|
|
6
6
|
DataSourceApi,
|
|
7
7
|
DataSourceInstanceSettings,
|
|
8
|
-
|
|
8
|
+
createDataFrame,
|
|
9
9
|
FieldType,
|
|
10
10
|
} from '@grafana/data';
|
|
11
11
|
|
|
12
12
|
import { MyQuery, MyDataSourceOptions, DEFAULT_QUERY, DataSourceResponse } from './types';
|
|
13
13
|
import { lastValueFrom } from 'rxjs';
|
|
14
|
-
import _ from 'lodash';
|
|
15
14
|
|
|
16
15
|
export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
|
|
17
16
|
baseUrl: string;
|
|
@@ -37,7 +36,7 @@ export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
|
|
|
37
36
|
|
|
38
37
|
// Return a constant for each query.
|
|
39
38
|
const data = options.targets.map((target) => {
|
|
40
|
-
return
|
|
39
|
+
return createDataFrame({
|
|
41
40
|
refId: target.refId,
|
|
42
41
|
fields: [
|
|
43
42
|
{ name: 'Time', values: [from, to], type: FieldType.time },
|
|
@@ -77,7 +76,7 @@ export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
|
|
|
77
76
|
}
|
|
78
77
|
} catch (err) {
|
|
79
78
|
let message = '';
|
|
80
|
-
if (
|
|
79
|
+
if (typeof err === 'string') {
|
|
81
80
|
message = err;
|
|
82
81
|
} else if (isFetchError(err)) {
|
|
83
82
|
message = 'Fetch error: ' + (err.statusText ? err.statusText : defaultErrorMessage);
|
|
File without changes
|
|
File without changes
|