chore: bump @grafana/create-plugin configuration to 6.7.1 (#2167)
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"version": "5.26.4"
|
||||
"version": "6.7.1",
|
||||
"features": {}
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️
|
||||
*
|
||||
* In order to extend the configuration follow the steps in
|
||||
* https://grafana.com/developers/plugin-tools/how-to-guides/extend-configurations#extend-the-eslint-config
|
||||
*/
|
||||
{
|
||||
"extends": ["@grafana/eslint-config"],
|
||||
"root": true,
|
||||
"rules": {
|
||||
"react/prop-types": "off"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["src/**/*.{ts,tsx}"],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-deprecated": "warn"
|
||||
},
|
||||
"parserOptions": {
|
||||
"project": "./tsconfig.json"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["./tests/**/*"],
|
||||
"rules": {
|
||||
"react-hooks/rules-of-hooks": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
43
.config/bundler/externals.ts
Normal file
43
.config/bundler/externals.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import type { Configuration, ExternalItemFunctionData } from 'webpack';
|
||||
|
||||
type ExternalsType = Configuration['externals'];
|
||||
|
||||
export const externals: ExternalsType = [
|
||||
// Required for dynamic publicPath resolution
|
||||
{ 'amd-module': 'module' },
|
||||
'lodash',
|
||||
'jquery',
|
||||
'moment',
|
||||
'slate',
|
||||
'emotion',
|
||||
'@emotion/react',
|
||||
'@emotion/css',
|
||||
'prismjs',
|
||||
'slate-plain-serializer',
|
||||
'@grafana/slate-react',
|
||||
'react',
|
||||
'react-dom',
|
||||
'react-redux',
|
||||
'redux',
|
||||
'rxjs',
|
||||
'i18next',
|
||||
'react-router',
|
||||
'd3',
|
||||
'angular',
|
||||
/^@grafana\/ui/i,
|
||||
/^@grafana\/runtime/i,
|
||||
/^@grafana\/data/i,
|
||||
|
||||
// Mark legacy SDK imports as external if their name starts with the "grafana/" prefix
|
||||
({ request }: ExternalItemFunctionData, callback: (error?: Error, result?: string) => void) => {
|
||||
const prefix = 'grafana/';
|
||||
const hasPrefix = (request: string) => request.indexOf(prefix) === 0;
|
||||
const stripPrefix = (request: string) => request.slice(prefix.length);
|
||||
|
||||
if (request && hasPrefix(request)) {
|
||||
return callback(undefined, stripPrefix(request));
|
||||
}
|
||||
|
||||
callback();
|
||||
},
|
||||
];
|
||||
@@ -7,7 +7,7 @@ services:
|
||||
context: .
|
||||
args:
|
||||
grafana_image: ${GRAFANA_IMAGE:-grafana-enterprise}
|
||||
grafana_version: ${GRAFANA_VERSION:-12.1.1}
|
||||
grafana_version: ${GRAFANA_VERSION:-12.2.0}
|
||||
development: ${DEVELOPMENT:-false}
|
||||
anonymous_auth_enabled: ${ANONYMOUS_AUTH_ENABLED:-true}
|
||||
ports:
|
||||
|
||||
31
.config/eslint.config.mjs
Normal file
31
.config/eslint.config.mjs
Normal file
@@ -0,0 +1,31 @@
|
||||
import { defineConfig } from 'eslint/config';
|
||||
import grafanaConfig from '@grafana/eslint-config/flat.js';
|
||||
|
||||
export default defineConfig([
|
||||
...grafanaConfig,
|
||||
{
|
||||
rules: {
|
||||
'react/prop-types': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['src/**/*.{ts,tsx}'],
|
||||
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
project: './tsconfig.json',
|
||||
},
|
||||
},
|
||||
|
||||
rules: {
|
||||
'@typescript-eslint/no-deprecated': 'warn',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['./tests/**/*'],
|
||||
|
||||
rules: {
|
||||
'react-hooks/rules-of-hooks': 'off',
|
||||
},
|
||||
},
|
||||
]);
|
||||
1
.config/types/setupTests.d.ts
vendored
Normal file
1
.config/types/setupTests.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
import '@testing-library/jest-dom';
|
||||
@@ -19,6 +19,7 @@ import VirtualModulesPlugin from 'webpack-virtual-modules';
|
||||
import { BuildModeWebpackPlugin } from './BuildModeWebpackPlugin.ts';
|
||||
import { DIST_DIR, SOURCE_DIR } from './constants.ts';
|
||||
import { getCPConfigVersion, getEntries, getPackageJson, getPluginJson, hasReadme, isWSL } from './utils.ts';
|
||||
import { externals } from '../bundler/externals.ts';
|
||||
|
||||
const pluginJson = getPluginJson();
|
||||
const cpVersion = getCPConfigVersion();
|
||||
@@ -55,45 +56,7 @@ const config = async (env: Env): Promise<Configuration> => {
|
||||
|
||||
entry: await getEntries(),
|
||||
|
||||
externals: [
|
||||
// Required for dynamic publicPath resolution
|
||||
{ 'amd-module': 'module' },
|
||||
'lodash',
|
||||
'jquery',
|
||||
'moment',
|
||||
'slate',
|
||||
'emotion',
|
||||
'@emotion/react',
|
||||
'@emotion/css',
|
||||
'prismjs',
|
||||
'slate-plain-serializer',
|
||||
'@grafana/slate-react',
|
||||
'react',
|
||||
'react-dom',
|
||||
'react-redux',
|
||||
'redux',
|
||||
'rxjs',
|
||||
'i18next',
|
||||
'react-router',
|
||||
'd3',
|
||||
'angular',
|
||||
/^@grafana\/ui/i,
|
||||
/^@grafana\/runtime/i,
|
||||
/^@grafana\/data/i,
|
||||
|
||||
// Mark legacy SDK imports as external if their name starts with the "grafana/" prefix
|
||||
({ request }, callback) => {
|
||||
const prefix = 'grafana/';
|
||||
const hasPrefix = (request: string) => request.indexOf(prefix) === 0;
|
||||
const stripPrefix = (request: string) => request.substr(prefix.length);
|
||||
|
||||
if (request && hasPrefix(request)) {
|
||||
return callback(undefined, stripPrefix(request));
|
||||
}
|
||||
|
||||
callback();
|
||||
},
|
||||
],
|
||||
externals,
|
||||
|
||||
// Support WebAssembly according to latest spec - makes WebAssembly module async
|
||||
experiments: {
|
||||
@@ -224,7 +187,8 @@ const config = async (env: Env): Promise<Configuration> => {
|
||||
new ReplaceInFileWebpackPlugin([
|
||||
{
|
||||
dir: DIST_DIR,
|
||||
files: ['plugin.json', 'README.md'],
|
||||
test: [/(^|\/)plugin\.json$/, /(^|\/)README\.md$/],
|
||||
|
||||
rules: [
|
||||
{
|
||||
search: /\%VERSION\%/g,
|
||||
|
||||
Reference in New Issue
Block a user