Skip to content

Commit 1799692

Browse files
chore: update configuration to latest version
1 parent f4c0b61 commit 1799692

Some content is hidden

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

42 files changed

+196
-154
lines changed

examples/app-basic/.config/.cprc.json

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

examples/app-basic/.config/webpack/BuildModeWebpackPlugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as webpack from 'webpack';
1+
import webpack, { type Compiler } from 'webpack';
22

33
const PLUGIN_NAME = 'BuildModeWebpack';
44

examples/app-basic/.config/webpack/utils.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import process from 'process';
33
import os from 'os';
44
import path from 'path';
55
import { glob } from 'glob';
6-
import { SOURCE_DIR } from './constants';
6+
import { SOURCE_DIR } from './constants.ts';
77

88
export function isWSL() {
99
if (process.platform !== 'linux') {
@@ -21,17 +21,22 @@ export function isWSL() {
2121
}
2222
}
2323

24+
function loadJson(path: string) {
25+
const rawJson = fs.readFileSync(path, 'utf8');
26+
return JSON.parse(rawJson);
27+
}
28+
2429
export function getPackageJson() {
25-
return require(path.resolve(process.cwd(), 'package.json'));
30+
return loadJson(path.resolve(process.cwd(), 'package.json'));
2631
}
2732

2833
export function getPluginJson() {
29-
return require(path.resolve(process.cwd(), `${SOURCE_DIR}/plugin.json`));
34+
return loadJson(path.resolve(process.cwd(), `${SOURCE_DIR}/plugin.json`));
3035
}
3136

3237
export function getCPConfigVersion() {
33-
const cprcJson = path.resolve(__dirname, '../', '.cprc.json');
34-
return fs.existsSync(cprcJson) ? require(cprcJson).version : { version: 'unknown' };
38+
const cprcJson = path.resolve(process.cwd(), './.config', '.cprc.json');
39+
return fs.existsSync(cprcJson) ? loadJson(cprcJson).version : { version: 'unknown' };
3540
}
3641

3742
export function hasReadme() {

examples/app-basic/.config/webpack/webpack.config.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import path from 'path';
1212
import ReplaceInFileWebpackPlugin from 'replace-in-file-webpack-plugin';
1313
import TerserPlugin from 'terser-webpack-plugin';
1414
import { SubresourceIntegrityPlugin } from 'webpack-subresource-integrity';
15-
import { type Configuration, BannerPlugin } from 'webpack';
15+
import webpack, { type Configuration } from 'webpack';
1616
import LiveReloadPlugin from 'webpack-livereload-plugin';
1717
import VirtualModulesPlugin from 'webpack-virtual-modules';
1818

19-
import { BuildModeWebpackPlugin } from './BuildModeWebpackPlugin';
20-
import { DIST_DIR, SOURCE_DIR } from './constants';
21-
import { getCPConfigVersion, getEntries, getPackageJson, getPluginJson, hasReadme, isWSL } from './utils';
19+
import { BuildModeWebpackPlugin } from './BuildModeWebpackPlugin.ts';
20+
import { DIST_DIR, SOURCE_DIR } from './constants.ts';
21+
import { getCPConfigVersion, getEntries, getPackageJson, getPluginJson, hasReadme, isWSL } from './utils.ts';
2222

2323
const pluginJson = getPluginJson();
2424
const cpVersion = getCPConfigVersion();
@@ -43,7 +43,8 @@ const config = async (env: Env): Promise<Configuration> => {
4343
cache: {
4444
type: 'filesystem',
4545
buildDependencies: {
46-
config: [__filename],
46+
// __filename doesnt work in Node 24
47+
config: [path.resolve(process.cwd(), '.config', 'webpack', 'webpack.config.ts')],
4748
},
4849
},
4950

@@ -193,7 +194,7 @@ const config = async (env: Env): Promise<Configuration> => {
193194
new BuildModeWebpackPlugin(),
194195
virtualPublicPath,
195196
// Insert create plugin version information into the bundle
196-
new BannerPlugin({
197+
new webpack.BannerPlugin({
197198
banner: '/* [create-plugin] version: ' + cpVersion + ' */',
198199
raw: true,
199200
entryOnly: true,

examples/app-basic/package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/app-basic/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"@grafana/e2e-selectors": "11.2.2",
2222
"@grafana/eslint-config": "^8.0.0",
2323
"@grafana/eslint-plugin-plugins": "^0.1.0",
24-
"@grafana/plugin-e2e": "^2.0.1",
24+
"@grafana/plugin-e2e": "^2.0.2",
2525
"@grafana/plugin-meta-extractor": "^0.0.2",
2626
"@grafana/tsconfig": "^2.0.0",
2727
"@playwright/test": "^1.52.0",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "5.20.1"
2+
"version": "5.22.0"
33
}

examples/datasource-basic/.config/webpack/BuildModeWebpackPlugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as webpack from 'webpack';
1+
import webpack, { type Compiler } from 'webpack';
22

33
const PLUGIN_NAME = 'BuildModeWebpack';
44

examples/datasource-basic/.config/webpack/utils.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import process from 'process';
33
import os from 'os';
44
import path from 'path';
55
import { glob } from 'glob';
6-
import { SOURCE_DIR } from './constants';
6+
import { SOURCE_DIR } from './constants.ts';
77

88
export function isWSL() {
99
if (process.platform !== 'linux') {
@@ -21,17 +21,22 @@ export function isWSL() {
2121
}
2222
}
2323

24+
function loadJson(path: string) {
25+
const rawJson = fs.readFileSync(path, 'utf8');
26+
return JSON.parse(rawJson);
27+
}
28+
2429
export function getPackageJson() {
25-
return require(path.resolve(process.cwd(), 'package.json'));
30+
return loadJson(path.resolve(process.cwd(), 'package.json'));
2631
}
2732

2833
export function getPluginJson() {
29-
return require(path.resolve(process.cwd(), `${SOURCE_DIR}/plugin.json`));
34+
return loadJson(path.resolve(process.cwd(), `${SOURCE_DIR}/plugin.json`));
3035
}
3136

3237
export function getCPConfigVersion() {
33-
const cprcJson = path.resolve(__dirname, '../', '.cprc.json');
34-
return fs.existsSync(cprcJson) ? require(cprcJson).version : { version: 'unknown' };
38+
const cprcJson = path.resolve(process.cwd(), './.config', '.cprc.json');
39+
return fs.existsSync(cprcJson) ? loadJson(cprcJson).version : { version: 'unknown' };
3540
}
3641

3742
export function hasReadme() {

examples/datasource-basic/.config/webpack/webpack.config.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import path from 'path';
1212
import ReplaceInFileWebpackPlugin from 'replace-in-file-webpack-plugin';
1313
import TerserPlugin from 'terser-webpack-plugin';
1414
import { SubresourceIntegrityPlugin } from 'webpack-subresource-integrity';
15-
import { type Configuration, BannerPlugin } from 'webpack';
15+
import webpack, { type Configuration } from 'webpack';
1616
import LiveReloadPlugin from 'webpack-livereload-plugin';
1717
import VirtualModulesPlugin from 'webpack-virtual-modules';
1818

19-
import { BuildModeWebpackPlugin } from './BuildModeWebpackPlugin';
20-
import { DIST_DIR, SOURCE_DIR } from './constants';
21-
import { getCPConfigVersion, getEntries, getPackageJson, getPluginJson, hasReadme, isWSL } from './utils';
19+
import { BuildModeWebpackPlugin } from './BuildModeWebpackPlugin.ts';
20+
import { DIST_DIR, SOURCE_DIR } from './constants.ts';
21+
import { getCPConfigVersion, getEntries, getPackageJson, getPluginJson, hasReadme, isWSL } from './utils.ts';
2222

2323
const pluginJson = getPluginJson();
2424
const cpVersion = getCPConfigVersion();
@@ -43,7 +43,8 @@ const config = async (env: Env): Promise<Configuration> => {
4343
cache: {
4444
type: 'filesystem',
4545
buildDependencies: {
46-
config: [__filename],
46+
// __filename doesnt work in Node 24
47+
config: [path.resolve(process.cwd(), '.config', 'webpack', 'webpack.config.ts')],
4748
},
4849
},
4950

@@ -194,7 +195,7 @@ const config = async (env: Env): Promise<Configuration> => {
194195
new BuildModeWebpackPlugin(),
195196
virtualPublicPath,
196197
// Insert create plugin version information into the bundle
197-
new BannerPlugin({
198+
new webpack.BannerPlugin({
198199
banner: '/* [create-plugin] version: ' + cpVersion + ' */',
199200
raw: true,
200201
entryOnly: true,

0 commit comments

Comments
 (0)