Skip to content

Commit b13d567

Browse files
github-actions[bot]grafana-plugins-platform-bot[bot]zoltanbedi
authored
chore: bump @grafana/create-plugin configuration to 5.26.4 (#2082)
Bumps [`@grafana/create-plugin`](https://github.com/grafana/plugin-tools/tree/main/packages/create-plugin) configuration from 4.2.1 to 5.26.4. **Notes for reviewer:** This is an auto-generated PR which ran `@grafana/create-plugin update`. Please consult the create-plugin [CHANGELOG.md](https://github.com/grafana/plugin-tools/blob/main/packages/create-plugin/CHANGELOG.md) to understand what may have changed. Please review the changes thoroughly before merging. --------- Co-authored-by: grafana-plugins-platform-bot[bot] <144369747+grafana-plugins-platform-bot[bot]@users.noreply.github.com> Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
1 parent e76741b commit b13d567

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+15452
-10339
lines changed

.changeset/fine-snails-move.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'grafana-zabbix': major
3+
---
4+
5+
Bump grafana dependency to 11.6.0

.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.2.1"
2+
"version": "5.26.4"
33
}

.config/.eslintrc

Lines changed: 8 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-eslint-config
5+
* https://grafana.com/developers/plugin-tools/how-to-guides/extend-configurations#extend-the-eslint-config
66
*/
77
{
88
"extends": ["@grafana/eslint-config"],
@@ -12,14 +12,19 @@
1212
},
1313
"overrides": [
1414
{
15-
"plugins": ["deprecation"],
1615
"files": ["src/**/*.{ts,tsx}"],
1716
"rules": {
18-
"deprecation/deprecation": "warn"
17+
"@typescript-eslint/no-deprecated": "warn"
1918
},
2019
"parserOptions": {
2120
"project": "./tsconfig.json"
2221
}
22+
},
23+
{
24+
"files": ["./tests/**/*"],
25+
"rules": {
26+
"react-hooks/rules-of-hooks": "off"
27+
}
2328
}
2429
]
2530
}

.config/Dockerfile

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,52 @@ ARG grafana_image=grafana-enterprise
33

44
FROM grafana/${grafana_image}:${grafana_version}
55

6+
ARG anonymous_auth_enabled=true
7+
ARG development=false
8+
ARG TARGETARCH
9+
10+
11+
ENV DEV "${development}"
12+
613
# Make it as simple as possible to access the grafana instance for development purposes
714
# Do NOT enable these settings in a public facing / production grafana instance
815
ENV GF_AUTH_ANONYMOUS_ORG_ROLE "Admin"
9-
ENV GF_AUTH_ANONYMOUS_ENABLED "true"
16+
ENV GF_AUTH_ANONYMOUS_ENABLED "${anonymous_auth_enabled}"
1017
ENV GF_AUTH_BASIC_ENABLED "false"
1118
# Set development mode so plugins can be loaded without the need to sign
1219
ENV GF_DEFAULT_APP_MODE "development"
1320

14-
# Inject livereload script into grafana index.html
21+
22+
LABEL maintainer="Grafana Labs <hello@grafana.com>"
23+
24+
ENV GF_PATHS_HOME="/usr/share/grafana"
25+
WORKDIR $GF_PATHS_HOME
26+
1527
USER root
28+
29+
# Installing supervisor and inotify-tools
30+
RUN if [ "${development}" = "true" ]; then \
31+
if grep -i -q alpine /etc/issue; then \
32+
apk add supervisor inotify-tools git; \
33+
elif grep -i -q ubuntu /etc/issue; then \
34+
DEBIAN_FRONTEND=noninteractive && \
35+
apt-get update && \
36+
apt-get install -y supervisor inotify-tools git && \
37+
rm -rf /var/lib/apt/lists/*; \
38+
else \
39+
echo 'ERROR: Unsupported base image' && /bin/false; \
40+
fi \
41+
fi
42+
43+
COPY supervisord/supervisord.conf /etc/supervisor.d/supervisord.ini
44+
COPY supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
45+
46+
47+
48+
# Inject livereload script into grafana index.html
1649
RUN sed -i 's|</body>|<script src="http://localhost:35729/livereload.js"></script></body>|g' /usr/share/grafana/public/views/index.html
50+
51+
52+
COPY entrypoint.sh /entrypoint.sh
53+
RUN chmod +x /entrypoint.sh
54+
ENTRYPOINT ["/entrypoint.sh"]

.config/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ We are going to use [`webpack-merge`](https://github.com/survivejs/webpack-merge
106106
// webpack.config.ts
107107
import type { Configuration } from 'webpack';
108108
import { merge } from 'webpack-merge';
109-
import grafanaConfig from './.config/webpack/webpack.config';
109+
import grafanaConfig, { type Env } from './.config/webpack/webpack.config';
110110

111-
const config = async (env): Promise<Configuration> => {
111+
const config = async (env: Env): Promise<Configuration> => {
112112
const baseConfig = await grafanaConfig(env);
113113

114114
return merge(baseConfig, {
@@ -151,14 +151,15 @@ version: '3.7'
151151

152152
services:
153153
grafana:
154-
container_name: 'myorg-basic-app'
154+
extends:
155+
file: .config/docker-compose-base.yaml
156+
service: grafana
155157
build:
156-
context: ./.config
157158
args:
158159
grafana_version: ${GRAFANA_VERSION:-9.1.2}
159160
grafana_image: ${GRAFANA_IMAGE:-grafana}
160161
```
161162
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.
163+
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.
163164

164165
---

.config/docker-compose-base.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
services:
2+
grafana:
3+
user: root
4+
container_name: 'alexanderzobnin-zabbix-app'
5+
6+
build:
7+
context: .
8+
args:
9+
grafana_image: ${GRAFANA_IMAGE:-grafana-enterprise}
10+
grafana_version: ${GRAFANA_VERSION:-12.1.1}
11+
development: ${DEVELOPMENT:-false}
12+
anonymous_auth_enabled: ${ANONYMOUS_AUTH_ENABLED:-true}
13+
ports:
14+
- 3000:3000/tcp
15+
volumes:
16+
- ../dist:/var/lib/grafana/plugins/alexanderzobnin-zabbix-app
17+
- ../provisioning:/etc/grafana/provisioning
18+
- ..:/root/alexanderzobnin-zabbix-app
19+
20+
environment:
21+
NODE_ENV: development
22+
GF_LOG_FILTERS: plugin.alexanderzobnin-zabbix-app:debug
23+
GF_LOG_LEVEL: debug
24+
GF_DATAPROXY_LOGGING: 1
25+
GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS: alexanderzobnin-zabbix-app

.config/entrypoint.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
3+
if [ "${DEV}" = "false" ]; then
4+
echo "Starting test mode"
5+
exec /run.sh
6+
fi
7+
8+
echo "Starting development mode"
9+
10+
if grep -i -q alpine /etc/issue; then
11+
exec /usr/bin/supervisord -c /etc/supervisord.conf
12+
elif grep -i -q ubuntu /etc/issue; then
13+
exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
14+
else
15+
echo 'ERROR: Unsupported base image'
16+
exit 1
17+
fi
18+

.config/jest-setup.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@
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/how-to-guides/extend-configurations#extend-the-jest-config
66
*/
77

88
import '@testing-library/jest-dom';
9+
import { TextEncoder, TextDecoder } from 'util';
10+
11+
Object.assign(global, { TextDecoder, TextEncoder });
912

1013
// https://jestjs.io/docs/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom
1114
Object.defineProperty(global, 'matchMedia', {
1215
writable: true,
13-
value: jest.fn().mockImplementation((query) => ({
16+
value: (query) => ({
1417
matches: false,
1518
media: query,
1619
onchange: null,
@@ -19,7 +22,7 @@ Object.defineProperty(global, 'matchMedia', {
1922
addEventListener: jest.fn(),
2023
removeEventListener: jest.fn(),
2124
dispatchEvent: jest.fn(),
22-
})),
25+
}),
2326
});
2427

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

.config/jest.config.js

Lines changed: 2 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-jest-config
5+
* https://grafana.com/developers/plugin-tools/how-to-guides/extend-configurations#extend-the-jest-config
66
*/
77

88
const path = require('path');
@@ -40,4 +40,5 @@ module.exports = {
4040
// Jest will throw `Cannot use import statement outside module` if it tries to load an
4141
// ES module without it being transformed first. ./config/README.md#esm-errors-with-jest
4242
transformIgnorePatterns: [nodeModulesToTransform(grafanaESModules)],
43+
watchPathIgnorePatterns: ['<rootDir>/node_modules', '<rootDir>/dist'],
4344
};

.config/jest/utils.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@ const nodeModulesToTransform = (moduleNames) => `node_modules\/(?!.*(${moduleNam
1414
const grafanaESModules = [
1515
'.pnpm', // Support using pnpm symlinked packages
1616
'@grafana/schema',
17+
'@wojtekmaj/date-utils',
1718
'd3',
1819
'd3-color',
1920
'd3-force',
2021
'd3-interpolate',
2122
'd3-scale-chromatic',
23+
'get-user-locale',
24+
'marked',
25+
'memoize',
26+
'mimic-function',
2227
'ol',
28+
'react-calendar',
2329
'react-colorful',
2430
'rxjs',
2531
'uuid',

0 commit comments

Comments
 (0)