diff --git a/.config/.cprc.json b/.config/.cprc.json index c71181ca..c09f2588 100644 --- a/.config/.cprc.json +++ b/.config/.cprc.json @@ -1,3 +1,3 @@ { - "version": "5.25.8" + "version": "5.26.9" } diff --git a/.config/bundler/externals.ts b/.config/bundler/externals.ts new file mode 100644 index 00000000..3a287d58 --- /dev/null +++ b/.config/bundler/externals.ts @@ -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(); + }, +]; diff --git a/.config/docker-compose-base.yaml b/.config/docker-compose-base.yaml index 4392cabb..09740092 100644 --- a/.config/docker-compose-base.yaml +++ b/.config/docker-compose-base.yaml @@ -7,7 +7,7 @@ services: context: . args: grafana_image: ${GRAFANA_IMAGE:-grafana-enterprise} - grafana_version: ${GRAFANA_VERSION:-12.1.0} + grafana_version: ${GRAFANA_VERSION:-12.2.0} development: ${DEVELOPMENT:-false} anonymous_auth_enabled: ${ANONYMOUS_AUTH_ENABLED:-true} ports: diff --git a/.config/webpack/webpack.config.ts b/.config/webpack/webpack.config.ts index b340cf44..4fa645f1 100644 --- a/.config/webpack/webpack.config.ts +++ b/.config/webpack/webpack.config.ts @@ -19,9 +19,11 @@ 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(); +const pluginVersion = getPackageJson().version; const virtualPublicPath = new VirtualModulesPlugin({ 'node_modules/grafana-public-path.js': ` @@ -54,44 +56,7 @@ const config = async (env: Env): Promise => { 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/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: { @@ -195,7 +160,8 @@ const config = async (env: Env): Promise => { virtualPublicPath, // Insert create plugin version information into the bundle new webpack.BannerPlugin({ - banner: '/* [create-plugin] version: ' + cpVersion + ' */', + banner: `/* [create-plugin] version: ${cpVersion} */ + /* [create-plugin] plugin: ${pluginJson.id}@${pluginVersion} */`, raw: true, entryOnly: true, }), @@ -225,7 +191,7 @@ const config = async (env: Env): Promise => { rules: [ { search: /\%VERSION\%/g, - replace: getPackageJson().version, + replace: pluginVersion, }, { search: /\%TODAY\%/g, diff --git a/.gitignore b/.gitignore index 7d513061..8588801e 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,11 @@ mage_output_file.go # provisioning /provisioning/ + +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz deleted file mode 100644 index f2390cb6..00000000 Binary files a/.yarn/install-state.gz and /dev/null differ diff --git a/package.json b/package.json index fb309a8b..2ba9c7eb 100644 --- a/package.json +++ b/package.json @@ -21,11 +21,12 @@ }, "dependencies": { "@emotion/css": "11.10.6", - "@grafana/data": "^12.1.0", + "@grafana/data": "^12.2.0", + "@grafana/i18n": "^12.2.0", "@grafana/plugin-ui": "^0.10.9", - "@grafana/runtime": "^12.1.0", - "@grafana/schema": "^12.1.0", - "@grafana/ui": "^12.1.0", + "@grafana/runtime": "^12.2.0", + "@grafana/schema": "^12.2.0", + "@grafana/ui": "^12.2.0", "react": "18.2.0", "react-dom": "18.2.0", "tslib": "2.5.3" @@ -34,8 +35,8 @@ "@babel/core": "^7.21.4", "@changesets/cli": "^2.27.12", "@grafana/e2e-selectors": "12.1.0", - "@grafana/eslint-config": "^8.0.0", - "@grafana/plugin-e2e": "^2.1.7", + "@grafana/eslint-config": "^8.2.0", + "@grafana/plugin-e2e": "^2.1.13", "@grafana/plugin-meta-extractor": "^0.0.2", "@grafana/tsconfig": "^2.0.0", "@playwright/test": "^1.52.0", diff --git a/src/components/Filters.tsx b/src/components/Filters.tsx index fdb6c866..59ab045d 100644 --- a/src/components/Filters.tsx +++ b/src/components/Filters.tsx @@ -99,13 +99,13 @@ export const Filters: React.FC = (props: Props) => { /> {loading === i &&
Loading...
} -