Skip to content

Commit 9d26c48

Browse files
Merge pull request #50 from NeedleInAJayStack/fix/dependency-vulnerabilities
Fix/dependency vulnerabilities
2 parents 58929c6 + ad83801 commit 9d26c48

25 files changed

Lines changed: 3287 additions & 3240 deletions

.config/.cprc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"version": "5.14.1"
2+
"version": "7.7.0",
3+
"features": {}
34
}

.config/.eslintrc

Lines changed: 0 additions & 31 deletions
This file was deleted.

.config/README.md

Lines changed: 2 additions & 2 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, {

.config/bundler/externals.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import type { Configuration, ExternalItemFunctionData } from 'webpack';
2+
3+
type ExternalsType = Configuration['externals'];
4+
5+
export const externals: ExternalsType = [
6+
// Required for dynamic publicPath resolution
7+
{ 'amd-module': 'module' },
8+
'lodash',
9+
'jquery',
10+
'moment',
11+
'slate',
12+
'emotion',
13+
'@emotion/react',
14+
'@emotion/css',
15+
'prismjs',
16+
'slate-plain-serializer',
17+
'@grafana/slate-react',
18+
'react',
19+
'react-dom',
20+
'react-redux',
21+
'redux',
22+
'rxjs',
23+
'i18next',
24+
'react-router',
25+
'react-router-dom',
26+
'd3',
27+
'angular',
28+
/^@grafana\/ui/i,
29+
/^@grafana\/runtime/i,
30+
/^@grafana\/data/i,
31+
32+
// Mark legacy SDK imports as external if their name starts with the "grafana/" prefix
33+
({ request }: ExternalItemFunctionData, callback: (error?: Error, result?: string) => void) => {
34+
const prefix = 'grafana/';
35+
const hasPrefix = (request: string) => request.indexOf(prefix) === 0;
36+
const stripPrefix = (request: string) => request.slice(prefix.length);
37+
38+
if (request && hasPrefix(request)) {
39+
return callback(undefined, stripPrefix(request));
40+
}
41+
42+
callback();
43+
},
44+
];

.config/docker-compose-base.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ services:
77
context: .
88
args:
99
grafana_image: ${GRAFANA_IMAGE:-grafana-enterprise}
10-
grafana_version: ${GRAFANA_VERSION:-11.3.2}
10+
grafana_version: ${GRAFANA_VERSION:-12.2.0}
1111
development: ${DEVELOPMENT:-false}
1212
anonymous_auth_enabled: ${ANONYMOUS_AUTH_ENABLED:-true}
1313
ports:

.config/eslint.config.mjs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { defineConfig } from 'eslint/config';
2+
import grafanaConfig from '@grafana/eslint-config/flat.js';
3+
4+
export default defineConfig([
5+
...grafanaConfig,
6+
{
7+
rules: {
8+
'react/prop-types': 'off',
9+
},
10+
},
11+
{
12+
files: ['src/**/*.{ts,tsx}'],
13+
14+
languageOptions: {
15+
parserOptions: {
16+
project: './tsconfig.json',
17+
},
18+
},
19+
20+
rules: {
21+
'@typescript-eslint/no-deprecated': 'warn',
22+
},
23+
},
24+
{
25+
files: ['./tests/**/*'],
26+
27+
rules: {
28+
'react-hooks/rules-of-hooks': 'off',
29+
},
30+
},
31+
]);

.config/jest-setup.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/get-started/set-up-development-environment#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';

.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/get-started/set-up-development-environment#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',

.config/tsconfig.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,25 @@
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/get-started/set-up-development-environment#extend-the-typescript-config
5+
* https://grafana.com/developers/plugin-tools/how-to-guides/extend-configurations#extend-the-typescript-config
66
*/
77
{
88
"compilerOptions": {
99
"alwaysStrict": true,
1010
"declaration": false,
1111
"rootDir": "../src",
12-
"baseUrl": "../src",
1312
"typeRoots": ["../node_modules/@types"],
14-
"resolveJsonModule": true
13+
"resolveJsonModule": true,
14+
"paths": {
15+
"*": ["../src/*"]
16+
}
1517
},
1618
"ts-node": {
1719
"compilerOptions": {
18-
"module": "commonjs",
19-
"target": "es5",
20-
"esModuleInterop": true
20+
"module": "nodenext",
21+
"target": "es2022",
22+
"esModuleInterop": true,
23+
"moduleResolution": "nodenext"
2124
},
2225
"transpileOnly": true
2326
},

0 commit comments

Comments
 (0)