mirror of
https://github.com/grafana/grafana.git
synced 2026-01-09 13:37:42 +08:00
Compare commits
25 Commits
v12.3.1
...
jackw/rspa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a19b14a54a | ||
|
|
48793907a0 | ||
|
|
c611c0bbd4 | ||
|
|
1a492a0eb8 | ||
|
|
8df4243a8c | ||
|
|
156e160cfa | ||
|
|
8d03ea95af | ||
|
|
5174fd803e | ||
|
|
79f13e6280 | ||
|
|
7166eb8fc4 | ||
|
|
b9392dd8a9 | ||
|
|
3dfd0b923c | ||
|
|
3b850fa1df | ||
|
|
ed879eef40 | ||
|
|
eafb09b302 | ||
|
|
e955b3c864 | ||
|
|
ecaba8b054 | ||
|
|
e764556aba | ||
|
|
6c31fe645c | ||
|
|
0402709e68 | ||
|
|
a301c22e2b | ||
|
|
f90c4b9cad | ||
|
|
f7d1a86122 | ||
|
|
bbda8c6b6b | ||
|
|
32af00eff9 |
@@ -3,8 +3,8 @@
|
||||
"version": "11.6.0-pre",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "webpack -c ./webpack.config.ts --env production",
|
||||
"dev": "webpack -w -c ./webpack.config.ts --env development",
|
||||
"build": "rspack -c ./rspack.config.ts --env production",
|
||||
"dev": "rspack -w -c ./rspack.config.ts --env development",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"lint": "eslint --cache --ignore-path ./.gitignore --ext .js,.jsx,.ts,.tsx ."
|
||||
},
|
||||
@@ -12,6 +12,7 @@
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@grafana/plugin-configs": "workspace:*",
|
||||
"@rspack/cli": "1.2.3",
|
||||
"@types/lodash": "4.17.7",
|
||||
"@types/node": "22.10.2",
|
||||
"@types/prismjs": "1.26.4",
|
||||
@@ -22,7 +23,6 @@
|
||||
"glob": "10.4.1",
|
||||
"ts-node": "10.9.2",
|
||||
"typescript": "5.5.4",
|
||||
"webpack": "5.95.0",
|
||||
"webpack-merge": "5.10.0"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
36
e2e/test-plugins/grafana-extensionstest-app/rspack.config.ts
Normal file
36
e2e/test-plugins/grafana-extensionstest-app/rspack.config.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import rspack from '@rspack/core';
|
||||
import grafanaConfig from '@grafana/plugin-configs/rspack.config';
|
||||
import { mergeWithCustomize, unique } from 'webpack-merge';
|
||||
import { Configuration } from 'webpack';
|
||||
|
||||
const config = async (env: Record<string, unknown>): Promise<Configuration> => {
|
||||
const baseConfig = await grafanaConfig(env);
|
||||
const customConfig = {
|
||||
plugins: [
|
||||
new rspack.CopyRspackPlugin({
|
||||
patterns: [
|
||||
// To `compiler.options.output`
|
||||
{ from: 'README.md', to: '.', force: true },
|
||||
{ from: 'plugin.json', to: '.' },
|
||||
{ from: 'CHANGELOG.md', to: '.', force: true },
|
||||
{
|
||||
from: '**/*.json',
|
||||
to: '.',
|
||||
globOptions: { ignore: ['**/dist/**', '**/tsconfig.json', '**/package.json', '**/project.json'] },
|
||||
},
|
||||
{ from: '**/*.svg', to: '.', noErrorOnMissing: true, globOptions: { ignore: ['**/dist/**'] } }, // Optional
|
||||
],
|
||||
}),
|
||||
],
|
||||
};
|
||||
|
||||
return mergeWithCustomize({
|
||||
customizeArray: unique(
|
||||
'plugins',
|
||||
[rspack.CopyRspackPlugin.name],
|
||||
(plugin) => plugin.constructor && plugin.constructor.name
|
||||
),
|
||||
})(baseConfig, customConfig);
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -1,44 +0,0 @@
|
||||
import CopyWebpackPlugin from 'copy-webpack-plugin';
|
||||
import grafanaConfig from '@grafana/plugin-configs/webpack.config';
|
||||
import { mergeWithCustomize, unique } from 'webpack-merge';
|
||||
import { Configuration } from 'webpack';
|
||||
|
||||
function skipFiles(f: string): boolean {
|
||||
if (f.includes('/dist/')) {
|
||||
// avoid copying files already in dist
|
||||
return false;
|
||||
}
|
||||
if (f.includes('/node_modules/')) {
|
||||
// avoid copying tsconfig.json
|
||||
return false;
|
||||
}
|
||||
if (f.includes('/package.json')) {
|
||||
// avoid copying package.json
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
const config = async (env: Record<string, unknown>): Promise<Configuration> => {
|
||||
const baseConfig = await grafanaConfig(env);
|
||||
const customConfig = {
|
||||
plugins: [
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [
|
||||
// To `compiler.options.output`
|
||||
{ from: 'README.md', to: '.', force: true },
|
||||
{ from: 'plugin.json', to: '.' },
|
||||
{ from: 'CHANGELOG.md', to: '.', force: true },
|
||||
{ from: '**/*.json', to: '.', filter: skipFiles },
|
||||
{ from: '**/*.svg', to: '.', noErrorOnMissing: true, filter: skipFiles }, // Optional
|
||||
],
|
||||
}),
|
||||
],
|
||||
};
|
||||
|
||||
return mergeWithCustomize({
|
||||
customizeArray: unique('plugins', ['CopyPlugin'], (plugin) => plugin.constructor && plugin.constructor.name),
|
||||
})(baseConfig, customConfig);
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -3,8 +3,8 @@
|
||||
"version": "11.6.0-pre",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "webpack -c ./webpack.config.ts --env production",
|
||||
"dev": "webpack -w -c ./webpack.config.ts --env development",
|
||||
"build": "rspack -c ./rspack.config.ts --env production",
|
||||
"dev": "rspack -w -c ./rspack.config.ts --env development",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"lint": "eslint --cache --ignore-path ./.gitignore --ext .js,.jsx,.ts,.tsx ."
|
||||
},
|
||||
@@ -12,6 +12,7 @@
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@grafana/plugin-configs": "workspace:*",
|
||||
"@rspack/cli": "1.2.3",
|
||||
"@types/lodash": "4.17.7",
|
||||
"@types/node": "22.10.2",
|
||||
"@types/prismjs": "1.26.4",
|
||||
@@ -22,7 +23,6 @@
|
||||
"glob": "10.4.1",
|
||||
"ts-node": "10.9.2",
|
||||
"typescript": "5.5.4",
|
||||
"webpack": "5.95.0",
|
||||
"webpack-merge": "5.10.0"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
36
e2e/test-plugins/grafana-test-datasource/rspack.config.ts
Normal file
36
e2e/test-plugins/grafana-test-datasource/rspack.config.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import rspack from '@rspack/core';
|
||||
import grafanaConfig from '@grafana/plugin-configs/rspack.config';
|
||||
import { mergeWithCustomize, unique } from 'webpack-merge';
|
||||
import { Configuration } from 'webpack';
|
||||
|
||||
const config = async (env: Record<string, unknown>): Promise<Configuration> => {
|
||||
const baseConfig = await grafanaConfig(env);
|
||||
const customConfig = {
|
||||
plugins: [
|
||||
new rspack.CopyRspackPlugin({
|
||||
patterns: [
|
||||
// To `compiler.options.output`
|
||||
{ from: 'README.md', to: '.', force: true },
|
||||
{ from: 'plugin.json', to: '.' },
|
||||
{ from: 'CHANGELOG.md', to: '.', force: true },
|
||||
{
|
||||
from: '**/*.json',
|
||||
to: '.',
|
||||
globOptions: { ignore: ['**/dist/**', '**/tsconfig.json', '**/package.json', '**/project.json'] },
|
||||
},
|
||||
{ from: '**/*.svg', to: '.', noErrorOnMissing: true, globOptions: { ignore: ['**/dist/**'] } }, // Optional
|
||||
],
|
||||
}),
|
||||
],
|
||||
};
|
||||
|
||||
return mergeWithCustomize({
|
||||
customizeArray: unique(
|
||||
'plugins',
|
||||
[rspack.CopyRspackPlugin.name],
|
||||
(plugin) => plugin.constructor && plugin.constructor.name
|
||||
),
|
||||
})(baseConfig, customConfig);
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -1,44 +0,0 @@
|
||||
import CopyWebpackPlugin from 'copy-webpack-plugin';
|
||||
import grafanaConfig from '@grafana/plugin-configs/webpack.config';
|
||||
import { mergeWithCustomize, unique } from 'webpack-merge';
|
||||
import { Configuration } from 'webpack';
|
||||
|
||||
function skipFiles(f: string): boolean {
|
||||
if (f.includes('/dist/')) {
|
||||
// avoid copying files already in dist
|
||||
return false;
|
||||
}
|
||||
if (f.includes('/node_modules/')) {
|
||||
// avoid copying tsconfig.json
|
||||
return false;
|
||||
}
|
||||
if (f.includes('/package.json')) {
|
||||
// avoid copying package.json
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
const config = async (env: Record<string, unknown>): Promise<Configuration> => {
|
||||
const baseConfig = await grafanaConfig(env);
|
||||
const customConfig = {
|
||||
plugins: [
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [
|
||||
// To `compiler.options.output`
|
||||
{ from: 'README.md', to: '.', force: true },
|
||||
{ from: 'plugin.json', to: '.' },
|
||||
{ from: 'CHANGELOG.md', to: '.', force: true },
|
||||
{ from: '**/*.json', to: '.', filter: skipFiles },
|
||||
{ from: '**/*.svg', to: '.', noErrorOnMissing: true, filter: skipFiles }, // Optional
|
||||
],
|
||||
}),
|
||||
],
|
||||
};
|
||||
|
||||
return mergeWithCustomize({
|
||||
customizeArray: unique('plugins', ['CopyPlugin'], (plugin) => plugin.constructor && plugin.constructor.name),
|
||||
})(baseConfig, customConfig);
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -8,19 +8,19 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@grafana/tsconfig": "^2.0.0",
|
||||
"@rspack/cli": "1.2.3",
|
||||
"@rspack/core": "1.2.3",
|
||||
"@swc/core": "1.10.12",
|
||||
"@types/eslint": "9.6.1",
|
||||
"@types/webpack-bundle-analyzer": "^4.7.0",
|
||||
"copy-webpack-plugin": "12.0.2",
|
||||
"eslint": "9.19.0",
|
||||
"eslint-webpack-plugin": "4.2.0",
|
||||
"fork-ts-checker-webpack-plugin": "9.0.2",
|
||||
"glob": "11.0.1",
|
||||
"imports-loader": "^5.0.0",
|
||||
"replace-in-file-webpack-plugin": "1.0.6",
|
||||
"swc-loader": "0.2.6",
|
||||
"rspack-plugin-virtual-module": "^0.1.13",
|
||||
"typescript": "5.7.3",
|
||||
"webpack": "5.97.1",
|
||||
"webpack-bundle-analyzer": "^4.10.2"
|
||||
"webpack": "5.97.1"
|
||||
},
|
||||
"packageManager": "yarn@4.6.0"
|
||||
}
|
||||
|
||||
262
packages/grafana-plugin-configs/rspack.config.ts
Normal file
262
packages/grafana-plugin-configs/rspack.config.ts
Normal file
@@ -0,0 +1,262 @@
|
||||
/*
|
||||
* ⚠️⚠️⚠️ 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/get-started/set-up-development-environment#extend-the-webpack-config
|
||||
*/
|
||||
|
||||
import rspack, { type Configuration } from '@rspack/core';
|
||||
import ESLintPlugin from 'eslint-webpack-plugin';
|
||||
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
|
||||
import path from 'path';
|
||||
// @ts-ignore
|
||||
import ReplaceInFileWebpackPlugin from 'replace-in-file-webpack-plugin';
|
||||
import { RspackVirtualModulePlugin } from 'rspack-plugin-virtual-module';
|
||||
|
||||
import { DIST_DIR } from './constants';
|
||||
import { getEntries, getPackageJson, getPluginJson, hasLicense } from './utils';
|
||||
|
||||
const pluginJson = getPluginJson();
|
||||
|
||||
const virtualPublicPath = new RspackVirtualModulePlugin({
|
||||
'grafana-public-path': `
|
||||
import amdMetaModule from 'amd-module';
|
||||
|
||||
__webpack_public_path__ =
|
||||
amdMetaModule && amdMetaModule.uri
|
||||
? amdMetaModule.uri.slice(0, amdMetaModule.uri.lastIndexOf('/') + 1)
|
||||
: 'public/plugins/${pluginJson.id}/';
|
||||
`,
|
||||
});
|
||||
|
||||
const config = async (env: Record<string, unknown>): Promise<Configuration> => {
|
||||
const baseConfig: Configuration = {
|
||||
amd: {},
|
||||
context: process.cwd(),
|
||||
|
||||
devtool: 'source-map',
|
||||
|
||||
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',
|
||||
'react-router',
|
||||
'd3',
|
||||
'angular',
|
||||
'@grafana/ui',
|
||||
'@grafana/runtime',
|
||||
'@grafana/data',
|
||||
|
||||
// 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 (hasPrefix(request)) {
|
||||
return callback(undefined, stripPrefix(request));
|
||||
}
|
||||
|
||||
callback();
|
||||
},
|
||||
],
|
||||
|
||||
// Support WebAssembly according to latest spec - makes WebAssembly module async
|
||||
experiments: {
|
||||
asyncWebAssembly: true,
|
||||
},
|
||||
|
||||
mode: env.production ? 'production' : 'development',
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
// This must come first in the rules array otherwise it breaks sourcemaps.
|
||||
{
|
||||
test: /src\/(?:.*\/)?module\.tsx?$/,
|
||||
use: [
|
||||
{
|
||||
loader: require.resolve('imports-loader'),
|
||||
options: {
|
||||
imports: `side-effects grafana-public-path`,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
// HACKS: Workaround for rspack not outputting UMD modules as webpack does.
|
||||
// We have systemjs amd define which doesn't work like standard amd define so we need to disable it,
|
||||
// in any umd module otherwise it will break at runtime.
|
||||
// {
|
||||
// test: [require.resolve('json-logic-js'), require.resolve('classnames')],
|
||||
// use: [
|
||||
// {
|
||||
// loader: require.resolve('imports-loader'),
|
||||
// options: {
|
||||
// additionalCode: 'var define = false; /* Disable AMD for misbehaving libraries */',
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
exclude: /(node_modules)/,
|
||||
test: /\.[tj]sx?$/,
|
||||
use: {
|
||||
loader: 'builtin:swc-loader',
|
||||
options: {
|
||||
jsc: {
|
||||
externalHelpers: true,
|
||||
loose: false,
|
||||
parser: {
|
||||
syntax: 'typescript',
|
||||
tsx: true,
|
||||
},
|
||||
transform: {
|
||||
react: {
|
||||
development: !env.production,
|
||||
refresh: false,
|
||||
runtime: 'automatic',
|
||||
},
|
||||
},
|
||||
},
|
||||
env: {
|
||||
target: 'es2020',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: ['style-loader', 'css-loader'],
|
||||
},
|
||||
{
|
||||
test: /\.s[ac]ss$/,
|
||||
use: ['style-loader', 'css-loader', 'sass-loader'],
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg)$/,
|
||||
type: 'asset/resource',
|
||||
generator: {
|
||||
filename: Boolean(env.production) ? '[hash][ext]' : '[file]',
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.(woff|woff2|eot|ttf|otf)(\?v=\d+\.\d+\.\d+)?$/,
|
||||
type: 'asset/resource',
|
||||
generator: {
|
||||
filename: Boolean(env.production) ? '[hash][ext]' : '[file]',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
output: {
|
||||
clean: true,
|
||||
filename: '[name].js',
|
||||
library: {
|
||||
type: 'amd',
|
||||
},
|
||||
path: path.resolve(process.cwd(), DIST_DIR),
|
||||
publicPath: `public/plugins/${pluginJson.id}/`,
|
||||
uniqueName: pluginJson.id,
|
||||
},
|
||||
|
||||
plugins: [
|
||||
virtualPublicPath,
|
||||
new rspack.CopyRspackPlugin({
|
||||
patterns: [
|
||||
// If src/README.md exists use it; otherwise the root README
|
||||
// To `compiler.options.output`
|
||||
{ from: 'README.md', to: '.', force: true },
|
||||
{ from: 'plugin.json', to: '.' },
|
||||
{ from: hasLicense() ? 'LICENSE' : '../../../../../LICENSE', to: '.' }, // Point to Grafana License by default
|
||||
{ from: 'CHANGELOG.md', to: '.', force: true },
|
||||
{
|
||||
from: '**/*.json',
|
||||
to: '.',
|
||||
globOptions: { ignore: ['**/dist/**', '**/tsconfig.json', '**/package.json', '**/project.json'] },
|
||||
}, // Optional
|
||||
{ from: '**/*.svg', to: '.', noErrorOnMissing: true, globOptions: { ignore: ['**/dist/**'] } }, // Optional
|
||||
{ from: '**/*.png', to: '.', noErrorOnMissing: true, globOptions: { ignore: ['**/dist/**'] } }, // Optional
|
||||
{ from: '**/*.html', to: '.', noErrorOnMissing: true, globOptions: { ignore: ['**/dist/**'] } }, // Optional
|
||||
{ from: 'img/**/*', to: '.', noErrorOnMissing: true, globOptions: { ignore: ['**/dist/**'] } }, // Optional
|
||||
{ from: 'libs/**/*', to: '.', noErrorOnMissing: true, globOptions: { ignore: ['**/dist/**'] } }, // Optional
|
||||
{ from: 'static/**/*', to: '.', noErrorOnMissing: true, globOptions: { ignore: ['**/dist/**'] } }, // Optional
|
||||
{ from: '**/query_help.md', to: '.', noErrorOnMissing: true, globOptions: { ignore: ['**/dist/**'] } }, // Optional
|
||||
],
|
||||
}),
|
||||
// Replace certain template-variables in the README and plugin.json
|
||||
new ReplaceInFileWebpackPlugin([
|
||||
{
|
||||
dir: DIST_DIR,
|
||||
files: ['plugin.json', 'README.md'],
|
||||
rules: [
|
||||
{
|
||||
search: /\%VERSION\%/g,
|
||||
replace: env.commit ? `${getPackageJson().version}-${env.commit}` : getPackageJson().version,
|
||||
},
|
||||
{
|
||||
search: /\%TODAY\%/g,
|
||||
replace: new Date().toISOString().substring(0, 10),
|
||||
},
|
||||
{
|
||||
search: /\%PLUGIN_ID\%/g,
|
||||
replace: pluginJson.id,
|
||||
},
|
||||
],
|
||||
},
|
||||
]),
|
||||
...(env.development
|
||||
? [
|
||||
new ForkTsCheckerWebpackPlugin({
|
||||
async: Boolean(env.development),
|
||||
issue: {
|
||||
include: [{ file: '**/*.{ts,tsx}' }],
|
||||
},
|
||||
typescript: { configFile: path.join(process.cwd(), 'tsconfig.json') },
|
||||
}),
|
||||
new ESLintPlugin({
|
||||
extensions: ['.ts', '.tsx'],
|
||||
lintDirtyModulesOnly: true, // don't lint on start, only lint changed files
|
||||
cacheLocation: path.resolve(
|
||||
__dirname,
|
||||
'../../node_modules/.cache/eslint-webpack-plugin',
|
||||
path.basename(process.cwd()),
|
||||
'.eslintcache'
|
||||
),
|
||||
}),
|
||||
]
|
||||
: []),
|
||||
],
|
||||
|
||||
resolve: {
|
||||
extensions: ['.ts', '.tsx', '.js', '.jsx'],
|
||||
// handle resolving "rootDir" paths
|
||||
modules: [path.resolve(process.cwd(), 'src'), 'node_modules'],
|
||||
},
|
||||
|
||||
stats: env.production ? 'normal' : 'minimal',
|
||||
|
||||
watchOptions: {
|
||||
ignored: ['**/node_modules', '**/dist', '**/.yarn'],
|
||||
},
|
||||
};
|
||||
|
||||
return baseConfig;
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -27,6 +27,7 @@
|
||||
"devDependencies": {
|
||||
"@grafana/e2e-selectors": "11.6.0-pre",
|
||||
"@grafana/plugin-configs": "11.6.0-pre",
|
||||
"@rspack/cli": "1.2.3",
|
||||
"@testing-library/dom": "10.4.0",
|
||||
"@testing-library/jest-dom": "6.6.3",
|
||||
"@testing-library/react": "16.2.0",
|
||||
@@ -46,9 +47,9 @@
|
||||
"@grafana/runtime": "*"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "webpack -c ./webpack.config.ts --env production",
|
||||
"build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)",
|
||||
"dev": "webpack -w -c ./webpack.config.ts --env development"
|
||||
"build": "rspack -c ./rspack.config.ts --env production",
|
||||
"build:commit": "rspack -c ./rspack.config.ts --env production --env commit=$(git rev-parse --short HEAD)",
|
||||
"dev": "rspack -w -c rspack.config.ts --env development"
|
||||
},
|
||||
"packageManager": "yarn@4.6.0"
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Configuration } from 'webpack';
|
||||
import type { Configuration } from '@rspack/core';
|
||||
import { merge } from 'webpack-merge';
|
||||
|
||||
import grafanaConfig from '@grafana/plugin-configs/webpack.config';
|
||||
import grafanaConfig from '@grafana/plugin-configs/rspack.config';
|
||||
|
||||
const config = async (env: Record<string, unknown>): Promise<Configuration> => {
|
||||
const baseConfig = await grafanaConfig(env);
|
||||
@@ -11,4 +11,5 @@ const config = async (env: Record<string, unknown>): Promise<Configuration> => {
|
||||
});
|
||||
};
|
||||
|
||||
// eslint-disable-next-line no-barrel-files/no-barrel-files
|
||||
export default config;
|
||||
@@ -28,6 +28,7 @@
|
||||
"devDependencies": {
|
||||
"@grafana/e2e-selectors": "11.6.0-pre",
|
||||
"@grafana/plugin-configs": "11.6.0-pre",
|
||||
"@rspack/cli": "1.2.3",
|
||||
"@testing-library/dom": "10.4.0",
|
||||
"@testing-library/jest-dom": "6.6.3",
|
||||
"@testing-library/react": "16.2.0",
|
||||
@@ -41,16 +42,15 @@
|
||||
"@types/react-dom": "18.3.5",
|
||||
"react-select-event": "5.5.1",
|
||||
"ts-node": "10.9.2",
|
||||
"typescript": "5.7.3",
|
||||
"webpack": "5.97.1"
|
||||
"typescript": "5.7.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@grafana/runtime": "*"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "webpack -c ./webpack.config.ts --env production",
|
||||
"build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)",
|
||||
"dev": "webpack -w -c ./webpack.config.ts --env development"
|
||||
"build": "rspack -c ./rspack.config.ts --env production",
|
||||
"build:commit": "rspack -c ./rspack.config.ts --env production --env commit=$(git rev-parse --short HEAD)",
|
||||
"dev": "rspack -w -c ./rspack.config.ts --env development"
|
||||
},
|
||||
"packageManager": "yarn@4.6.0"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import config from '@grafana/plugin-configs/webpack.config';
|
||||
import config from '@grafana/plugin-configs/rspack.config';
|
||||
|
||||
// eslint-disable-next-line no-barrel-files/no-barrel-files
|
||||
export default config;
|
||||
@@ -1,3 +0,0 @@
|
||||
import config from '@grafana/plugin-configs/webpack.config';
|
||||
|
||||
export default config;
|
||||
@@ -18,6 +18,7 @@
|
||||
"devDependencies": {
|
||||
"@grafana/e2e-selectors": "11.6.0-pre",
|
||||
"@grafana/plugin-configs": "11.6.0-pre",
|
||||
"@rspack/cli": "1.2.3",
|
||||
"@testing-library/dom": "10.4.0",
|
||||
"@testing-library/react": "16.2.0",
|
||||
"@testing-library/user-event": "14.6.1",
|
||||
@@ -26,16 +27,15 @@
|
||||
"@types/node": "22.12.0",
|
||||
"@types/react": "18.3.18",
|
||||
"ts-node": "10.9.2",
|
||||
"typescript": "5.7.3",
|
||||
"webpack": "5.97.1"
|
||||
"typescript": "5.7.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@grafana/runtime": "*"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "webpack -c ./webpack.config.ts --env production",
|
||||
"build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)",
|
||||
"dev": "webpack -w -c ./webpack.config.ts --env development"
|
||||
"build": "rspack -c ./rspack.config.ts --env production",
|
||||
"build:commit": "rspack -c ./rspack.config.ts --env production --env commit=$(git rev-parse --short HEAD)",
|
||||
"dev": "rspack -w -c ./rspack.config.ts --env development"
|
||||
},
|
||||
"packageManager": "yarn@4.6.0"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import config from '@grafana/plugin-configs/webpack.config';
|
||||
import config from '@grafana/plugin-configs/rspack.config';
|
||||
|
||||
// eslint-disable-next-line no-barrel-files/no-barrel-files
|
||||
export default config;
|
||||
@@ -21,6 +21,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@grafana/plugin-configs": "11.6.0-pre",
|
||||
"@rspack/cli": "1.2.3",
|
||||
"@testing-library/dom": "10.4.0",
|
||||
"@testing-library/jest-dom": "6.6.3",
|
||||
"@testing-library/react": "16.2.0",
|
||||
@@ -35,16 +36,15 @@
|
||||
"jest": "29.7.0",
|
||||
"style-loader": "4.0.0",
|
||||
"ts-node": "10.9.2",
|
||||
"typescript": "5.7.3",
|
||||
"webpack": "5.97.1"
|
||||
"typescript": "5.7.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@grafana/runtime": "*"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "webpack -c ./webpack.config.ts --env production",
|
||||
"build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)",
|
||||
"dev": "webpack -w -c ./webpack.config.ts --env development"
|
||||
"build": "rspack -c ./rspack.config.ts --env production",
|
||||
"build:commit": "rspack -c ./rspack.config.ts --env production --env commit=$(git rev-parse --short HEAD)",
|
||||
"dev": "rspack -w -c ./rspack.config.ts --env development"
|
||||
},
|
||||
"packageManager": "yarn@4.6.0"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import config from '@grafana/plugin-configs/webpack.config';
|
||||
import config from '@grafana/plugin-configs/rspack.config';
|
||||
|
||||
const configWithFallback = async (env: Record<string, unknown>) => {
|
||||
const response = await config(env);
|
||||
@@ -23,6 +23,7 @@
|
||||
"devDependencies": {
|
||||
"@grafana/e2e-selectors": "11.6.0-pre",
|
||||
"@grafana/plugin-configs": "11.6.0-pre",
|
||||
"@rspack/cli": "1.2.3",
|
||||
"@testing-library/dom": "10.4.0",
|
||||
"@testing-library/react": "16.2.0",
|
||||
"@testing-library/user-event": "14.6.1",
|
||||
@@ -34,16 +35,15 @@
|
||||
"@types/react-dom": "18.3.5",
|
||||
"@types/uuid": "10.0.0",
|
||||
"ts-node": "10.9.2",
|
||||
"typescript": "5.7.3",
|
||||
"webpack": "5.97.1"
|
||||
"typescript": "5.7.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@grafana/runtime": "*"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "webpack -c ./webpack.config.ts --env production",
|
||||
"build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)",
|
||||
"dev": "webpack -w -c ./webpack.config.ts --env development"
|
||||
"build": "rspack -c ./rspack.config.ts --env production",
|
||||
"build:commit": "rspack -c ./rspack.config.ts --env production --env commit=$(git rev-parse --short HEAD)",
|
||||
"dev": "rspack -w -c ./rspack.config.ts --env development"
|
||||
},
|
||||
"packageManager": "yarn@4.6.0"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import config from '@grafana/plugin-configs/webpack.config';
|
||||
import config from '@grafana/plugin-configs/rspack.config';
|
||||
|
||||
// eslint-disable-next-line no-barrel-files/no-barrel-files
|
||||
export default config;
|
||||
@@ -1,3 +0,0 @@
|
||||
import config from '@grafana/plugin-configs/webpack.config';
|
||||
|
||||
export default config;
|
||||
@@ -24,6 +24,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@grafana/plugin-configs": "workspace:*",
|
||||
"@rspack/cli": "1.2.3",
|
||||
"@testing-library/dom": "10.4.0",
|
||||
"@testing-library/jest-dom": "6.6.3",
|
||||
"@testing-library/react": "16.2.0",
|
||||
@@ -44,9 +45,9 @@
|
||||
"@grafana/runtime": "*"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "webpack -c ./webpack.config.ts --env production",
|
||||
"build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)",
|
||||
"dev": "webpack -w -c ./webpack.config.ts --env development"
|
||||
"build": "rspack -c ./rspack.config.ts --env production",
|
||||
"build:commit": "rspack -c ./rspack.config.ts --env production --env commit=$(git rev-parse --short HEAD)",
|
||||
"dev": "rspack -w -c ./rspack.config.ts --env development"
|
||||
},
|
||||
"packageManager": "yarn@4.6.0"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import config from '@grafana/plugin-configs/webpack.config';
|
||||
import config from '@grafana/plugin-configs/rspack.config';
|
||||
|
||||
const configWithFallback = async (env: Record<string, unknown>) => {
|
||||
const response = await config(env);
|
||||
@@ -11,4 +11,5 @@ const configWithFallback = async (env: Record<string, unknown>) => {
|
||||
return response;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line no-barrel-files/no-barrel-files
|
||||
export default configWithFallback;
|
||||
@@ -18,6 +18,7 @@
|
||||
"devDependencies": {
|
||||
"@grafana/e2e-selectors": "11.6.0-pre",
|
||||
"@grafana/plugin-configs": "11.6.0-pre",
|
||||
"@rspack/cli": "1.2.3",
|
||||
"@testing-library/dom": "10.4.0",
|
||||
"@testing-library/react": "16.2.0",
|
||||
"@testing-library/user-event": "14.6.1",
|
||||
@@ -26,16 +27,15 @@
|
||||
"@types/node": "22.12.0",
|
||||
"@types/react": "18.3.18",
|
||||
"ts-node": "10.9.2",
|
||||
"typescript": "5.7.3",
|
||||
"webpack": "5.97.1"
|
||||
"typescript": "5.7.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@grafana/runtime": "*"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "webpack -c ./webpack.config.ts --env production",
|
||||
"build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)",
|
||||
"dev": "webpack -w -c ./webpack.config.ts --env development"
|
||||
"build": "rspack -c ./rspack.config.ts --env production",
|
||||
"build:commit": "rspack -c ./rspack.config.ts --env production --env commit=$(git rev-parse --short HEAD)",
|
||||
"dev": "rspack -w -c ./rspack.config.ts --env development"
|
||||
},
|
||||
"packageManager": "yarn@4.6.0"
|
||||
}
|
||||
|
||||
4
public/app/plugins/datasource/mssql/rspack.config.ts
Normal file
4
public/app/plugins/datasource/mssql/rspack.config.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import config from '@grafana/plugin-configs/rspack.config';
|
||||
|
||||
// eslint-disable-next-line no-barrel-files/no-barrel-files
|
||||
export default config;
|
||||
@@ -18,6 +18,7 @@
|
||||
"devDependencies": {
|
||||
"@grafana/e2e-selectors": "11.6.0-pre",
|
||||
"@grafana/plugin-configs": "11.6.0-pre",
|
||||
"@rspack/cli": "1.2.3",
|
||||
"@testing-library/dom": "10.4.0",
|
||||
"@testing-library/react": "16.2.0",
|
||||
"@testing-library/user-event": "14.6.1",
|
||||
@@ -26,16 +27,15 @@
|
||||
"@types/node": "22.12.0",
|
||||
"@types/react": "18.3.18",
|
||||
"ts-node": "10.9.2",
|
||||
"typescript": "5.7.3",
|
||||
"webpack": "5.97.1"
|
||||
"typescript": "5.7.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@grafana/runtime": "*"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "webpack -c ./webpack.config.ts --env production",
|
||||
"build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)",
|
||||
"dev": "webpack -w -c ./webpack.config.ts --env development"
|
||||
"build": "rspack -c ./rspack.config.ts --env production",
|
||||
"build:commit": "rspack -c ./rspack.config.ts --env production --env commit=$(git rev-parse --short HEAD)",
|
||||
"dev": "rspack -w -c ./rspack.config.ts --env development"
|
||||
},
|
||||
"packageManager": "yarn@4.6.0"
|
||||
}
|
||||
|
||||
4
public/app/plugins/datasource/mysql/rspack.config.ts
Normal file
4
public/app/plugins/datasource/mysql/rspack.config.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import config from '@grafana/plugin-configs/rspack.config';
|
||||
|
||||
// eslint-disable-next-line no-barrel-files/no-barrel-files
|
||||
export default config;
|
||||
@@ -19,6 +19,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@grafana/plugin-configs": "11.6.0-pre",
|
||||
"@rspack/cli": "1.2.3",
|
||||
"@testing-library/dom": "10.4.0",
|
||||
"@testing-library/react": "16.2.0",
|
||||
"@testing-library/user-event": "14.6.1",
|
||||
@@ -27,16 +28,15 @@
|
||||
"@types/react": "18.3.18",
|
||||
"@types/react-dom": "18.3.5",
|
||||
"ts-node": "10.9.2",
|
||||
"typescript": "5.7.3",
|
||||
"webpack": "5.97.1"
|
||||
"typescript": "5.7.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@grafana/runtime": "*"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "webpack -c ./webpack.config.ts --env production",
|
||||
"build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)",
|
||||
"dev": "webpack -w -c ./webpack.config.ts --env development"
|
||||
"build": "rspack -c ./rspack.config.ts --env production",
|
||||
"build:commit": "rspack -c ./rspack.config.ts --env production --env commit=$(git rev-parse --short HEAD)",
|
||||
"dev": "rspack -w -c ./rspack.config.ts --env development"
|
||||
},
|
||||
"packageManager": "yarn@4.6.0"
|
||||
}
|
||||
|
||||
4
public/app/plugins/datasource/parca/rspack.config.ts
Normal file
4
public/app/plugins/datasource/parca/rspack.config.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import config from '@grafana/plugin-configs/rspack.config';
|
||||
|
||||
// eslint-disable-next-line no-barrel-files/no-barrel-files
|
||||
export default config;
|
||||
@@ -1,3 +0,0 @@
|
||||
import config from '@grafana/plugin-configs/webpack.config';
|
||||
|
||||
export default config;
|
||||
@@ -40,6 +40,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@grafana/plugin-configs": "11.6.0-pre",
|
||||
"@rspack/cli": "1.2.3",
|
||||
"@testing-library/dom": "10.4.0",
|
||||
"@testing-library/jest-dom": "6.6.3",
|
||||
"@testing-library/react": "16.2.0",
|
||||
@@ -55,17 +56,16 @@
|
||||
"glob": "11.0.1",
|
||||
"react-select-event": "5.5.1",
|
||||
"ts-node": "10.9.2",
|
||||
"typescript": "5.7.3",
|
||||
"webpack": "5.97.1"
|
||||
"typescript": "5.7.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@grafana/runtime": "*"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "webpack -c ./webpack.config.ts --env production",
|
||||
"build": "rspack -c ./rspack.config.ts --env production",
|
||||
"build:stats": "yarn build --env stats --profile --json=compilation-stats.json",
|
||||
"build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)",
|
||||
"dev": "webpack -w -c ./webpack.config.ts --env development"
|
||||
"build:commit": "rspack -c ./rspack.config.ts --env production --env commit=$(git rev-parse --short HEAD)",
|
||||
"dev": "rspack -w -c ./rspack.config.ts --env development"
|
||||
},
|
||||
"packageManager": "yarn@4.6.0"
|
||||
}
|
||||
|
||||
4
public/app/plugins/datasource/tempo/rspack.config.ts
Normal file
4
public/app/plugins/datasource/tempo/rspack.config.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import config from '@grafana/plugin-configs/rspack.config';
|
||||
|
||||
// eslint-disable-next-line no-barrel-files/no-barrel-files
|
||||
export default config;
|
||||
@@ -1,3 +0,0 @@
|
||||
import config from '@grafana/plugin-configs/webpack.config';
|
||||
|
||||
export default config;
|
||||
@@ -21,6 +21,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@grafana/plugin-configs": "workspace:*",
|
||||
"@rspack/cli": "1.2.3",
|
||||
"@testing-library/dom": "10.4.0",
|
||||
"@testing-library/jest-dom": "6.6.3",
|
||||
"@testing-library/react": "16.2.0",
|
||||
@@ -30,16 +31,15 @@
|
||||
"@types/react": "18.3.18",
|
||||
"@types/react-dom": "18.3.5",
|
||||
"ts-node": "10.9.2",
|
||||
"typescript": "5.7.3",
|
||||
"webpack": "5.97.1"
|
||||
"typescript": "5.7.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@grafana/runtime": "*"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "webpack -c ./webpack.config.ts --env production",
|
||||
"build:commit": "webpack -c ./webpack.config.ts --env production --env commit=$(git rev-parse --short HEAD)",
|
||||
"dev": "webpack -w -c ./webpack.config.ts --env development"
|
||||
"build": "rspack -c ./rspack.config.ts --env production",
|
||||
"build:commit": "rspack -c ./rspack.config.ts --env production --env commit=$(git rev-parse --short HEAD)",
|
||||
"dev": "rspack -w -c ./rspack.config.ts --env development"
|
||||
},
|
||||
"packageManager": "yarn@4.6.0"
|
||||
}
|
||||
|
||||
4
public/app/plugins/datasource/zipkin/rspack.config.ts
Normal file
4
public/app/plugins/datasource/zipkin/rspack.config.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import config from '@grafana/plugin-configs/rspack.config';
|
||||
|
||||
// eslint-disable-next-line no-barrel-files/no-barrel-files
|
||||
export default config;
|
||||
@@ -1,3 +0,0 @@
|
||||
import config from '@grafana/plugin-configs/webpack.config';
|
||||
|
||||
export default config;
|
||||
Reference in New Issue
Block a user