Skip to content

Commit 01974e0

Browse files
chore: update configuration to latest version
1 parent 65d6624 commit 01974e0

File tree

138 files changed

+2490
-496
lines changed

Some content is hidden

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

138 files changed

+2490
-496
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "5.19.2"
2+
"version": "5.19.8"
33
}

examples/app-basic/.config/README.md

+2-2
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, {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Image declarations
2+
declare module '*.gif' {
3+
const src: string;
4+
export default src;
5+
}
6+
7+
declare module '*.jpg' {
8+
const src: string;
9+
export default src;
10+
}
11+
12+
declare module '*.jpeg' {
13+
const src: string;
14+
export default src;
15+
}
16+
17+
declare module '*.png' {
18+
const src: string;
19+
export default src;
20+
}
21+
22+
declare module '*.webp' {
23+
const src: string;
24+
export default src;
25+
}
26+
27+
declare module '*.svg' {
28+
const src: string;
29+
export default src;
30+
}
31+
32+
// Font declarations
33+
declare module '*.woff';
34+
declare module '*.woff2';
35+
declare module '*.eot';
36+
declare module '*.ttf';
37+
declare module '*.otf';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
declare module 'replace-in-file-webpack-plugin' {
2+
import { Compiler, Plugin } from 'webpack';
3+
4+
interface ReplaceRule {
5+
search: string | RegExp;
6+
replace: string | ((match: string) => string);
7+
}
8+
9+
interface ReplaceOption {
10+
dir?: string;
11+
files?: string[];
12+
test?: RegExp | RegExp[];
13+
rules: ReplaceRule[];
14+
}
15+
16+
class ReplaceInFilePlugin extends Plugin {
17+
constructor(options?: ReplaceOption[]);
18+
options: ReplaceOption[];
19+
apply(compiler: Compiler): void;
20+
}
21+
22+
export = ReplaceInFilePlugin;
23+
}
24+
25+
declare module 'webpack-livereload-plugin' {
26+
import { ServerOptions } from 'https';
27+
import { Compiler, Plugin, Stats, Compilation } from 'webpack';
28+
29+
interface Options extends Pick<ServerOptions, 'cert' | 'key' | 'pfx'> {
30+
/**
31+
* protocol for livereload `<script>` src attribute value
32+
* @default protocol of the page, either `http` or `https`
33+
*/
34+
protocol?: string | undefined;
35+
/**
36+
* The desired port for the livereload server.
37+
* If you define port 0, an available port will be searched for, starting from 35729.
38+
* @default 35729
39+
*/
40+
port?: number | undefined;
41+
/**
42+
* he desired hostname for the appended `<script>` (if present) to point to
43+
* @default hostname of the page, like `localhost` or 10.0.2.2
44+
*/
45+
hostname?: string | undefined;
46+
/**
47+
* livereload `<script>` automatically to `<head>`.
48+
* @default false
49+
*/
50+
appendScriptTag?: boolean | undefined;
51+
/**
52+
* RegExp of files to ignore. Null value means ignore nothing.
53+
* It is also possible to define an array and use multiple anymatch patterns
54+
*/
55+
ignore?: RegExp | RegExp[] | null | undefined;
56+
/**
57+
* amount of milliseconds by which to delay the live reload (in case build takes longer)
58+
* @default 0
59+
*/
60+
delay?: number | undefined;
61+
/**
62+
* create hash for each file source and only notify livereload if hash has changed
63+
* @default false
64+
*/
65+
useSourceHash?: boolean | undefined;
66+
}
67+
68+
class LiveReloadPlugin extends Plugin {
69+
readonly isRunning: boolean;
70+
constructor(options?: Options);
71+
72+
apply(compiler: Compiler): void;
73+
74+
start(watching: any, cb: () => void): void;
75+
done(stats: Stats): void;
76+
failed(): void;
77+
autoloadJs(): string;
78+
scriptTag(source: string): string;
79+
applyCompilation(compilation: Compilation): void;
80+
}
81+
82+
export = LiveReloadPlugin;
83+
}

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function hasReadme() {
4040

4141
// Support bundling nested plugins by finding all plugin.json files in src directory
4242
// then checking for a sibling module.[jt]sx? file.
43-
export async function getEntries(): Promise<Record<string, string>> {
43+
export async function getEntries() {
4444
const pluginsJson = await glob('**/src/**/plugin.json', { absolute: true });
4545

4646
const plugins = await Promise.all(
@@ -50,14 +50,14 @@ export async function getEntries(): Promise<Record<string, string>> {
5050
})
5151
);
5252

53-
return plugins.reduce((result, modules) => {
54-
return modules.reduce((result, module) => {
53+
return plugins.reduce<Record<string, string>>((result, modules) => {
54+
return modules.reduce((innerResult, module) => {
5555
const pluginPath = path.dirname(module);
5656
const pluginName = path.relative(process.cwd(), pluginPath).replace(/src\/?/i, '');
5757
const entryName = pluginName === '' ? 'module' : `${pluginName}/module`;
5858

59-
result[entryName] = module;
60-
return result;
59+
innerResult[entryName] = module;
60+
return innerResult;
6161
}, result);
6262
}, {});
6363
}

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

+8-4
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ __webpack_public_path__ =
3434
`,
3535
});
3636

37-
const config = async (env): Promise<Configuration> => {
37+
export type Env = {
38+
[key: string]: true | string | Env;
39+
};
40+
41+
const config = async (env: Env): Promise<Configuration> => {
3842
const baseConfig: Configuration = {
3943
cache: {
4044
type: 'filesystem',
@@ -77,10 +81,10 @@ const config = async (env): Promise<Configuration> => {
7781
// Mark legacy SDK imports as external if their name starts with the "grafana/" prefix
7882
({ request }, callback) => {
7983
const prefix = 'grafana/';
80-
const hasPrefix = (request) => request.indexOf(prefix) === 0;
81-
const stripPrefix = (request) => request.substr(prefix.length);
84+
const hasPrefix = (request: string) => request.indexOf(prefix) === 0;
85+
const stripPrefix = (request: string) => request.substr(prefix.length);
8286

83-
if (hasPrefix(request)) {
87+
if (request && hasPrefix(request)) {
8488
return callback(undefined, stripPrefix(request));
8589
}
8690

examples/app-basic/package-lock.json

+12-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/app-basic/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@grafana/plugin-e2e": "^1.17.1",
2525
"@grafana/plugin-meta-extractor": "^0.0.2",
2626
"@grafana/tsconfig": "^2.0.0",
27-
"@playwright/test": "1.50.1",
27+
"@playwright/test": "^1.52.0",
2828
"@stylistic/eslint-plugin-ts": "^2.9.0",
2929
"@swc/core": "^1.3.90",
3030
"@swc/helpers": "^0.5.0",
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "5.19.2"
2+
"version": "5.19.8"
33
}

examples/app-with-backend/.config/README.md

+2-2
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, {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Image declarations
2+
declare module '*.gif' {
3+
const src: string;
4+
export default src;
5+
}
6+
7+
declare module '*.jpg' {
8+
const src: string;
9+
export default src;
10+
}
11+
12+
declare module '*.jpeg' {
13+
const src: string;
14+
export default src;
15+
}
16+
17+
declare module '*.png' {
18+
const src: string;
19+
export default src;
20+
}
21+
22+
declare module '*.webp' {
23+
const src: string;
24+
export default src;
25+
}
26+
27+
declare module '*.svg' {
28+
const src: string;
29+
export default src;
30+
}
31+
32+
// Font declarations
33+
declare module '*.woff';
34+
declare module '*.woff2';
35+
declare module '*.eot';
36+
declare module '*.ttf';
37+
declare module '*.otf';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
declare module 'replace-in-file-webpack-plugin' {
2+
import { Compiler, Plugin } from 'webpack';
3+
4+
interface ReplaceRule {
5+
search: string | RegExp;
6+
replace: string | ((match: string) => string);
7+
}
8+
9+
interface ReplaceOption {
10+
dir?: string;
11+
files?: string[];
12+
test?: RegExp | RegExp[];
13+
rules: ReplaceRule[];
14+
}
15+
16+
class ReplaceInFilePlugin extends Plugin {
17+
constructor(options?: ReplaceOption[]);
18+
options: ReplaceOption[];
19+
apply(compiler: Compiler): void;
20+
}
21+
22+
export = ReplaceInFilePlugin;
23+
}
24+
25+
declare module 'webpack-livereload-plugin' {
26+
import { ServerOptions } from 'https';
27+
import { Compiler, Plugin, Stats, Compilation } from 'webpack';
28+
29+
interface Options extends Pick<ServerOptions, 'cert' | 'key' | 'pfx'> {
30+
/**
31+
* protocol for livereload `<script>` src attribute value
32+
* @default protocol of the page, either `http` or `https`
33+
*/
34+
protocol?: string | undefined;
35+
/**
36+
* The desired port for the livereload server.
37+
* If you define port 0, an available port will be searched for, starting from 35729.
38+
* @default 35729
39+
*/
40+
port?: number | undefined;
41+
/**
42+
* he desired hostname for the appended `<script>` (if present) to point to
43+
* @default hostname of the page, like `localhost` or 10.0.2.2
44+
*/
45+
hostname?: string | undefined;
46+
/**
47+
* livereload `<script>` automatically to `<head>`.
48+
* @default false
49+
*/
50+
appendScriptTag?: boolean | undefined;
51+
/**
52+
* RegExp of files to ignore. Null value means ignore nothing.
53+
* It is also possible to define an array and use multiple anymatch patterns
54+
*/
55+
ignore?: RegExp | RegExp[] | null | undefined;
56+
/**
57+
* amount of milliseconds by which to delay the live reload (in case build takes longer)
58+
* @default 0
59+
*/
60+
delay?: number | undefined;
61+
/**
62+
* create hash for each file source and only notify livereload if hash has changed
63+
* @default false
64+
*/
65+
useSourceHash?: boolean | undefined;
66+
}
67+
68+
class LiveReloadPlugin extends Plugin {
69+
readonly isRunning: boolean;
70+
constructor(options?: Options);
71+
72+
apply(compiler: Compiler): void;
73+
74+
start(watching: any, cb: () => void): void;
75+
done(stats: Stats): void;
76+
failed(): void;
77+
autoloadJs(): string;
78+
scriptTag(source: string): string;
79+
applyCompilation(compilation: Compilation): void;
80+
}
81+
82+
export = LiveReloadPlugin;
83+
}

0 commit comments

Comments
 (0)