@grafana/create-plugin 2.0.1-canary.441.b3db721.0 → 2.0.2
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 +28 -0
- package/dist/commands/generate.plopfile.js +1 -3
- package/dist/commands/version.command.js +12 -2
- package/package.json +2 -2
- package/src/commands/generate.plopfile.ts +1 -3
- package/src/commands/types.ts +0 -1
- package/src/commands/version.command.ts +12 -1
- package/templates/backend/pkg/plugin/datasource.go +2 -2
- package/templates/backend-app/pkg/plugin/app.go +3 -3
- package/templates/common/.config/.eslintrc +1 -1
- package/templates/common/.config/webpack/webpack.config.ts +1 -1
- package/templates/common/package.json +1 -1
- package/dist/utils/utils.version.js +0 -15
- package/src/utils/utils.version.ts +0 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
# v2.0.2 (Wed Oct 04 2023)
|
|
2
|
+
|
|
3
|
+
:tada: This release contains work from a new contributor! :tada:
|
|
4
|
+
|
|
5
|
+
Thank you, null[@mikkancso](https://github.com/mikkancso), for all your work!
|
|
6
|
+
|
|
7
|
+
#### 🐛 Bug Fix
|
|
8
|
+
|
|
9
|
+
- Create-plugin: Make baseURL absolute and bump swc/core [#424](https://github.com/grafana/plugin-tools/pull/424) ([@mikkancso](https://github.com/mikkancso))
|
|
10
|
+
|
|
11
|
+
#### Authors: 1
|
|
12
|
+
|
|
13
|
+
- [@mikkancso](https://github.com/mikkancso)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# v2.0.1 (Tue Oct 03 2023)
|
|
18
|
+
|
|
19
|
+
#### 🐛 Bug Fix
|
|
20
|
+
|
|
21
|
+
- Add fixes for backend sdk v0.177.0 [#437](https://github.com/grafana/plugin-tools/pull/437) ([@wbrowne](https://github.com/wbrowne))
|
|
22
|
+
|
|
23
|
+
#### Authors: 1
|
|
24
|
+
|
|
25
|
+
- Will Browne ([@wbrowne](https://github.com/wbrowne))
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
1
29
|
# v2.0.0 (Mon Oct 02 2023)
|
|
2
30
|
|
|
3
31
|
#### 🐛 Bug Fix
|
|
@@ -29,7 +29,6 @@ var path_1 = __importDefault(require("path"));
|
|
|
29
29
|
var constants_1 = require("../constants");
|
|
30
30
|
var utils_handlebars_1 = require("../utils/utils.handlebars");
|
|
31
31
|
var utils_path_1 = require("../utils/utils.path");
|
|
32
|
-
var utils_version_1 = require("../utils/utils.version");
|
|
33
32
|
var utils_packageManager_1 = require("../utils/utils.packageManager");
|
|
34
33
|
var print_success_message_1 = require("./generate-actions/print-success-message");
|
|
35
34
|
var update_go_sdk_and_packages_1 = require("./generate-actions/update-go-sdk-and-packages");
|
|
@@ -108,8 +107,7 @@ function default_1(plop) {
|
|
|
108
107
|
packageManagerInstallCmd: packageManagerInstallCmd,
|
|
109
108
|
packageManagerVersion: packageManagerVersion,
|
|
110
109
|
isAppType: isAppType,
|
|
111
|
-
isNPM: packageManagerName === 'npm'
|
|
112
|
-
packageVersion: (0, utils_version_1.getVersion)()
|
|
110
|
+
isNPM: packageManagerName === 'npm'
|
|
113
111
|
};
|
|
114
112
|
var commonActions = getActionsForTemplateFolder({
|
|
115
113
|
folderPath: constants_1.TEMPLATE_PATHS.common,
|
|
@@ -37,11 +37,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
exports.__esModule = true;
|
|
39
39
|
exports.version = void 0;
|
|
40
|
-
var
|
|
40
|
+
var path_1 = require("path");
|
|
41
|
+
var fs_1 = require("fs");
|
|
41
42
|
var version = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
42
43
|
return __generator(this, function (_a) {
|
|
43
44
|
try {
|
|
44
|
-
console.log(
|
|
45
|
+
console.log(getVersion());
|
|
45
46
|
}
|
|
46
47
|
catch (error) {
|
|
47
48
|
console.error(error);
|
|
@@ -51,3 +52,12 @@ var version = function () { return __awaiter(void 0, void 0, void 0, function ()
|
|
|
51
52
|
});
|
|
52
53
|
}); };
|
|
53
54
|
exports.version = version;
|
|
55
|
+
var getVersion = function () {
|
|
56
|
+
var packageJsonPath = (0, path_1.resolve)(__dirname, '..', '..', 'package.json');
|
|
57
|
+
var pkg = (0, fs_1.readFileSync)(packageJsonPath, 'utf8');
|
|
58
|
+
var version = JSON.parse(pkg).version;
|
|
59
|
+
if (!version) {
|
|
60
|
+
throw "Could not find the version of sign-plugin";
|
|
61
|
+
}
|
|
62
|
+
return version;
|
|
63
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/create-plugin",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"directory": "packages/create-plugin",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"engines": {
|
|
67
67
|
"node": ">=18"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "a935c3d30a844512ff5209cd4dee677b80f9c304"
|
|
70
70
|
}
|
|
@@ -5,7 +5,6 @@ import type { ModifyActionConfig, NodePlopAPI } from 'plop';
|
|
|
5
5
|
import { EXTRA_TEMPLATE_VARIABLES, IS_DEV, PARTIALS_DIR, PLUGIN_TYPES, TEMPLATE_PATHS } from '../constants';
|
|
6
6
|
import { ifEq, normalizeId } from '../utils/utils.handlebars';
|
|
7
7
|
import { getExportPath } from '../utils/utils.path';
|
|
8
|
-
import { getVersion } from '../utils/utils.version';
|
|
9
8
|
import { getPackageManagerInstallCmd, getPackageManagerFromUserAgent } from '../utils/utils.packageManager';
|
|
10
9
|
import { printGenerateSuccessMessage } from './generate-actions/print-success-message';
|
|
11
10
|
import { updateGoSdkAndModules } from './generate-actions/update-go-sdk-and-packages';
|
|
@@ -96,8 +95,7 @@ export default function (plop: NodePlopAPI) {
|
|
|
96
95
|
packageManagerInstallCmd,
|
|
97
96
|
packageManagerVersion,
|
|
98
97
|
isAppType,
|
|
99
|
-
isNPM: packageManagerName === 'npm'
|
|
100
|
-
packageVersion: getVersion(),
|
|
98
|
+
isNPM: packageManagerName === 'npm'
|
|
101
99
|
};
|
|
102
100
|
// Copy over files that are shared between plugins types
|
|
103
101
|
const commonActions = getActionsForTemplateFolder({
|
package/src/commands/types.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resolve } from 'path';
|
|
2
|
+
import { readFileSync } from 'fs';
|
|
2
3
|
|
|
3
4
|
export const version = async () => {
|
|
4
5
|
try {
|
|
@@ -8,3 +9,13 @@ export const version = async () => {
|
|
|
8
9
|
process.exit(1);
|
|
9
10
|
}
|
|
10
11
|
};
|
|
12
|
+
|
|
13
|
+
const getVersion = () => {
|
|
14
|
+
const packageJsonPath = resolve(__dirname, '..', '..', 'package.json');
|
|
15
|
+
const pkg = readFileSync(packageJsonPath, 'utf8');
|
|
16
|
+
const { version } = JSON.parse(pkg);
|
|
17
|
+
if (!version) {
|
|
18
|
+
throw `Could not find the version of sign-plugin`;
|
|
19
|
+
}
|
|
20
|
+
return version;
|
|
21
|
+
};
|
|
@@ -16,7 +16,7 @@ import (
|
|
|
16
16
|
// since otherwise we will only get a not implemented error response from plugin in
|
|
17
17
|
// runtime. In this example datasource instance implements backend.QueryDataHandler,
|
|
18
18
|
// backend.CheckHealthHandler interfaces. Plugin should not implement all these
|
|
19
|
-
// interfaces- only those which are required for a particular task.
|
|
19
|
+
// interfaces - only those which are required for a particular task.
|
|
20
20
|
var (
|
|
21
21
|
_ backend.QueryDataHandler = (*Datasource)(nil)
|
|
22
22
|
_ backend.CheckHealthHandler = (*Datasource)(nil)
|
|
@@ -24,7 +24,7 @@ var (
|
|
|
24
24
|
)
|
|
25
25
|
|
|
26
26
|
// NewDatasource creates a new datasource instance.
|
|
27
|
-
func NewDatasource(_ backend.DataSourceInstanceSettings) (instancemgmt.Instance, error) {
|
|
27
|
+
func NewDatasource(_ context.Context, _ backend.DataSourceInstanceSettings) (instancemgmt.Instance, error) {
|
|
28
28
|
return &Datasource{}, nil
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -2,10 +2,11 @@ package plugin
|
|
|
2
2
|
|
|
3
3
|
import (
|
|
4
4
|
"context"
|
|
5
|
+
"net/http"
|
|
6
|
+
|
|
5
7
|
"github.com/grafana/grafana-plugin-sdk-go/backend"
|
|
6
8
|
"github.com/grafana/grafana-plugin-sdk-go/backend/instancemgmt"
|
|
7
9
|
"github.com/grafana/grafana-plugin-sdk-go/backend/resource/httpadapter"
|
|
8
|
-
"net/http"
|
|
9
10
|
)
|
|
10
11
|
|
|
11
12
|
// Make sure App implements required interfaces. This is important to do
|
|
@@ -24,7 +25,7 @@ type App struct {
|
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
// NewApp creates a new example *App instance.
|
|
27
|
-
func NewApp(_ backend.AppInstanceSettings) (instancemgmt.Instance, error) {
|
|
28
|
+
func NewApp(_ context.Context, _ backend.AppInstanceSettings) (instancemgmt.Instance, error) {
|
|
28
29
|
var app App
|
|
29
30
|
|
|
30
31
|
// Use a httpadapter (provided by the SDK) for resource calls. This allows us
|
|
@@ -50,4 +51,3 @@ func (a *App) CheckHealth(_ context.Context, _ *backend.CheckHealthRequest) (*ba
|
|
|
50
51
|
Message: "ok",
|
|
51
52
|
}, nil
|
|
52
53
|
}
|
|
53
|
-
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* In order to extend the configuration follow the steps in
|
|
5
5
|
* https://grafana.com/developers/plugin-tools/create-a-plugin/extend-a-plugin/extend-configurations#extend-the-eslint-config
|
|
6
6
|
*/
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@grafana/e2e-selectors": "{{ grafanaVersion }}",
|
|
24
24
|
"@grafana/eslint-config": "^6.0.0",
|
|
25
25
|
"@grafana/tsconfig": "^1.2.0-rc1",
|
|
26
|
-
"@swc/core": "1.3.
|
|
26
|
+
"@swc/core": "^1.3.90",
|
|
27
27
|
"@swc/helpers": "^0.5.0",
|
|
28
28
|
"@swc/jest": "^0.2.26",
|
|
29
29
|
"@testing-library/jest-dom": "^5.16.5",
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
exports.__esModule = true;
|
|
3
|
-
exports.getVersion = void 0;
|
|
4
|
-
var path_1 = require("path");
|
|
5
|
-
var fs_1 = require("fs");
|
|
6
|
-
var getVersion = function () {
|
|
7
|
-
var packageJsonPath = (0, path_1.resolve)(__dirname, '..', '..', 'package.json');
|
|
8
|
-
var pkg = (0, fs_1.readFileSync)(packageJsonPath, 'utf8');
|
|
9
|
-
var version = JSON.parse(pkg).version;
|
|
10
|
-
if (!version) {
|
|
11
|
-
throw "Could not find the version of create-plugin";
|
|
12
|
-
}
|
|
13
|
-
return version;
|
|
14
|
-
};
|
|
15
|
-
exports.getVersion = getVersion;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { resolve } from 'path';
|
|
2
|
-
import { readFileSync } from 'fs';
|
|
3
|
-
|
|
4
|
-
export const getVersion = () => {
|
|
5
|
-
const packageJsonPath = resolve(__dirname, '..', '..', 'package.json');
|
|
6
|
-
const pkg = readFileSync(packageJsonPath, 'utf8');
|
|
7
|
-
const { version } = JSON.parse(pkg);
|
|
8
|
-
if (!version) {
|
|
9
|
-
throw `Could not find the version of create-plugin`;
|
|
10
|
-
}
|
|
11
|
-
return version;
|
|
12
|
-
};
|