Skip to content

Commit a0ed528

Browse files
Update dependencies with create-plugin (#305)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 7388b46 commit a0ed528

18 files changed

+1688
-1586
lines changed

.config/.cprc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "4.11.4"
2+
"version": "5.11.1"
33
}

.config/.eslintrc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️
33
*
44
* In order to extend the configuration follow the steps in
5-
* https://grafana.com/developers/plugin-tools/create-a-plugin/extend-a-plugin/extend-configurations#extend-the-eslint-config
5+
* https://grafana.com/developers/plugin-tools/get-started/set-up-development-environment#extend-the-eslint-config
66
*/
77
{
88
"extends": ["@grafana/eslint-config"],
@@ -20,6 +20,12 @@
2020
"parserOptions": {
2121
"project": "./tsconfig.json"
2222
}
23+
},
24+
{
25+
"files": ["./tests/**/*"],
26+
"rules": {
27+
"react-hooks/rules-of-hooks": "off",
28+
},
2329
}
2430
]
2531
}

.config/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ ARG grafana_image=grafana-enterprise
44
FROM grafana/${grafana_image}:${grafana_version}
55

66
ARG development=false
7+
ARG TARGETARCH
78

89
ARG GO_VERSION=1.21.6
9-
ARG GO_ARCH=amd64
10+
ARG GO_ARCH=${TARGETARCH:-amd64}
1011

1112
ENV DEV "${development}"
1213

.config/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,6 @@ services:
159159
grafana_image: ${GRAFANA_IMAGE:-grafana}
160160
```
161161
162-
In this example, we assign the environment variable `GRAFANA_IMAGE` to the build arg `grafana_image` with a default value of `grafana`. This will allow you to set the value while running the docker-compose commands, which might be convenient in some scenarios.
162+
In this example, we assign the environment variable `GRAFANA_IMAGE` to the build arg `grafana_image` with a default value of `grafana`. This will allow you to set the value while running the docker compose commands, which might be convenient in some scenarios.
163163

164164
---

.config/jest-setup.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️
33
*
44
* In order to extend the configuration follow the steps in
5-
* https://grafana.com/developers/plugin-tools/create-a-plugin/extend-a-plugin/extend-configurations#extend-the-jest-config
5+
* https://grafana.com/developers/plugin-tools/get-started/set-up-development-environment#extend-the-jest-config
66
*/
77

88
import '@testing-library/jest-dom';
@@ -13,7 +13,7 @@ Object.assign(global, { TextDecoder, TextEncoder });
1313
// https://jestjs.io/docs/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom
1414
Object.defineProperty(global, 'matchMedia', {
1515
writable: true,
16-
value: jest.fn().mockImplementation((query) => ({
16+
value: (query) => ({
1717
matches: false,
1818
media: query,
1919
onchange: null,
@@ -22,7 +22,7 @@ Object.defineProperty(global, 'matchMedia', {
2222
addEventListener: jest.fn(),
2323
removeEventListener: jest.fn(),
2424
dispatchEvent: jest.fn(),
25-
})),
25+
}),
2626
});
2727

2828
HTMLCanvasElement.prototype.getContext = () => {};

.config/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️
33
*
44
* In order to extend the configuration follow the steps in
5-
* https://grafana.com/developers/plugin-tools/create-a-plugin/extend-a-plugin/extend-configurations#extend-the-jest-config
5+
* https://grafana.com/developers/plugin-tools/get-started/set-up-development-environment#extend-the-jest-config
66
*/
77

88
const path = require('path');

.config/jest/utils.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ const grafanaESModules = [
2323
'react-colorful',
2424
'rxjs',
2525
'uuid',
26-
'monaco-promql',
2726
];
2827

2928
module.exports = {

.config/supervisord/supervisord.conf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ user=root
55
[program:grafana]
66
user=root
77
directory=/var/lib/grafana
8-
command=bash -c 'while [ ! -f /root/grafana-prometheusamazon-datasource/dist/gpx_prometheus_amazon* ]; do sleep 1; done; /run.sh'
8+
command=bash -c 'while [ ! -f /root/grafana-amazonprometheus-datasource/dist/gpx_amazonprometheus* ]; do sleep 1; done; /run.sh'
99
stdout_logfile=/dev/fd/1
1010
stdout_logfile_maxbytes=0
1111
redirect_stderr=true
@@ -15,7 +15,7 @@ autostart=true
1515

1616
[program:delve]
1717
user=root
18-
command=/bin/bash -c 'pid=""; while [ -z "$pid" ]; do pid=$(pgrep -f gpx_prometheus_amazon); done; /root/go/bin/dlv attach --api-version=2 --headless --continue --accept-multiclient --listen=:2345 $pid'
18+
command=/bin/bash -c 'pid=""; while [ -z "$pid" ]; do pid=$(pgrep -f gpx_amazonprometheus); done; /root/go/bin/dlv attach --api-version=2 --headless --continue --accept-multiclient --listen=:2345 $pid'
1919
stdout_logfile=/dev/fd/1
2020
stdout_logfile_maxbytes=0
2121
redirect_stderr=true
@@ -26,7 +26,7 @@ autorestart=true
2626

2727
[program:build-watcher]
2828
user=root
29-
command=/bin/bash -c 'while inotifywait -e modify,create,delete -r /var/lib/grafana/plugins/grafana-prometheusamazon-datasource; do echo "Change detected, restarting delve...";supervisorctl restart delve; done'
29+
command=/bin/bash -c 'while inotifywait -e modify,create,delete -r /var/lib/grafana/plugins/grafana-amazonprometheus-datasource; do echo "Change detected, restarting delve...";supervisorctl restart delve; done'
3030
stdout_logfile=/dev/fd/1
3131
stdout_logfile_maxbytes=0
3232
redirect_stderr=true
@@ -37,8 +37,8 @@ autostart=true
3737
[program:mage-watcher]
3838
user=root
3939
environment=PATH="/usr/local/go/bin:/root/go/bin:%(ENV_PATH)s"
40-
directory=/root/grafana-prometheusamazon-datasource
41-
command=/bin/bash -c 'git config --global --add safe.directory /root/grafana-prometheusamazon-datasource && mage -v watch'
40+
directory=/root/grafana-amazonprometheus-datasource
41+
command=/bin/bash -c 'git config --global --add safe.directory /root/grafana-amazonprometheus-datasource && mage -v watch'
4242
stdout_logfile=/dev/fd/1
4343
stdout_logfile_maxbytes=0
4444
redirect_stderr=true

.config/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️
33
*
44
* In order to extend the configuration follow the steps in
5-
* https://grafana.com/developers/plugin-tools/create-a-plugin/extend-a-plugin/extend-configurations#extend-the-typescript-config
5+
* https://grafana.com/developers/plugin-tools/get-started/set-up-development-environment#extend-the-typescript-config
66
*/
77
{
88
"compilerOptions": {
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import * as webpack from 'webpack';
2+
3+
const PLUGIN_NAME = 'BuildModeWebpack';
4+
5+
export class BuildModeWebpackPlugin {
6+
apply(compiler: webpack.Compiler) {
7+
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
8+
compilation.hooks.processAssets.tap(
9+
{
10+
name: PLUGIN_NAME,
11+
stage: webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS,
12+
},
13+
async () => {
14+
const assets = compilation.getAssets();
15+
for (const asset of assets) {
16+
if (asset.name.endsWith('plugin.json')) {
17+
const pluginJsonString = asset.source.source().toString();
18+
const pluginJsonWithBuildMode = JSON.stringify(
19+
{
20+
...JSON.parse(pluginJsonString),
21+
buildMode: compilation.options.mode,
22+
},
23+
null,
24+
4
25+
);
26+
compilation.updateAsset(asset.name, new webpack.sources.RawSource(pluginJsonWithBuildMode));
27+
}
28+
}
29+
}
30+
);
31+
});
32+
}
33+
}

0 commit comments

Comments
 (0)