diff --git a/.config/.cprc.json b/.config/.cprc.json new file mode 100644 index 0000000..93cec15 --- /dev/null +++ b/.config/.cprc.json @@ -0,0 +1,3 @@ +{ + "version": "2.6.0" +} diff --git a/.config/.eslintrc b/.config/.eslintrc index 15ae260..1486ed2 100644 --- a/.config/.eslintrc +++ b/.config/.eslintrc @@ -4,10 +4,22 @@ * In order to extend the configuration follow the steps in * https://grafana.com/developers/plugin-tools/create-a-plugin/extend-a-plugin/extend-configurations#extend-the-eslint-config */ - { +{ "extends": ["@grafana/eslint-config"], "root": true, "rules": { "react/prop-types": "off" - } + }, + "overrides": [ + { + "plugins": ["deprecation"], + "files": ["src/**/*.{ts,tsx}"], + "rules": { + "deprecation/deprecation": "warn" + }, + "parserOptions": { + "project": "./tsconfig.json" + } + } + ] } diff --git a/.config/.prettierrc.js b/.config/.prettierrc.js index 66a76ec..bf506f5 100644 --- a/.config/.prettierrc.js +++ b/.config/.prettierrc.js @@ -5,12 +5,12 @@ */ module.exports = { - "endOfLine": "auto", - "printWidth": 120, - "trailingComma": "es5", - "semi": true, - "jsxSingleQuote": false, - "singleQuote": true, - "useTabs": false, - "tabWidth": 2 -}; \ No newline at end of file + endOfLine: 'auto', + printWidth: 120, + trailingComma: 'es5', + semi: true, + jsxSingleQuote: false, + singleQuote: true, + useTabs: false, + tabWidth: 2, +}; diff --git a/.config/tsconfig.json b/.config/tsconfig.json index a606c5c..207b28f 100644 --- a/.config/tsconfig.json +++ b/.config/tsconfig.json @@ -4,7 +4,7 @@ * In order to extend the configuration follow the steps in * https://grafana.com/developers/plugin-tools/create-a-plugin/extend-a-plugin/extend-configurations#extend-the-typescript-config */ - { +{ "compilerOptions": { "alwaysStrict": true, "declaration": false, diff --git a/.config/webpack/utils.ts b/.config/webpack/utils.ts index 144ea19..07eea6e 100644 --- a/.config/webpack/utils.ts +++ b/.config/webpack/utils.ts @@ -2,11 +2,9 @@ import fs from 'fs'; import process from 'process'; import os from 'os'; import path from 'path'; -import util from 'util'; import { glob } from 'glob'; import { SOURCE_DIR } from './constants'; - export function isWSL() { if (process.platform !== 'linux') { return false; @@ -21,7 +19,7 @@ export function isWSL() { } catch { return false; } -} +} export function getPackageJson() { return require(path.resolve(process.cwd(), 'package.json')); @@ -40,7 +38,8 @@ export function hasReadme() { export async function getEntries(): Promise> { const pluginsJson = await glob('**/src/**/plugin.json', { absolute: true }); - const plugins = await Promise.all(pluginsJson.map((pluginJson) => { + const plugins = await Promise.all( + pluginsJson.map((pluginJson) => { const folder = path.dirname(pluginJson); return glob(`${folder}/module.{ts,tsx,js,jsx}`, { absolute: true }); }) diff --git a/.config/webpack/webpack.config.ts b/.config/webpack/webpack.config.ts index faab612..24dfd32 100644 --- a/.config/webpack/webpack.config.ts +++ b/.config/webpack/webpack.config.ts @@ -97,7 +97,7 @@ const config = async (env): Promise => { }, { test: /\.css$/, - use: ["style-loader", "css-loader"] + use: ['style-loader', 'css-loader'], }, { test: /\.s[ac]ss$/, @@ -110,7 +110,7 @@ const config = async (env): Promise => { // Keep publicPath relative for host.com/grafana/ deployments publicPath: `public/plugins/${pluginJson.id}/img/`, outputPath: 'img/', - filename: Boolean(env.production) ? '[hash][ext]' : '[name][ext]', + filename: Boolean(env.production) ? '[hash][ext]' : '[file]', }, }, { @@ -136,6 +136,7 @@ const config = async (env): Promise => { }, path: path.resolve(process.cwd(), DIST_DIR), publicPath: `public/plugins/${pluginJson.id}/`, + uniqueName: pluginJson.id, }, plugins: [ @@ -207,7 +208,6 @@ const config = async (env): Promise => { } return baseConfig; - }; export default config; diff --git a/.cprc.json b/.cprc.json new file mode 100644 index 0000000..219acb6 --- /dev/null +++ b/.cprc.json @@ -0,0 +1,3 @@ +{ + "features": {} +} diff --git a/.eslintrc b/.eslintrc index 01e61df..476a147 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,3 +1,3 @@ { "extends": "./.config/.eslintrc" -} \ No newline at end of file +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4c38a9..ebbb8e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '18' + node-version: '20' - name: Install dependencies run: npm i @@ -44,7 +44,7 @@ jobs: if: steps.check-for-backend.outputs.has-backend == 'true' uses: actions/setup-go@v3 with: - go-version: '1.20' + go-version: '1.21' - name: Test backend if: steps.check-for-backend.outputs.has-backend == 'true' diff --git a/.github/workflows/is-compatible.yml b/.github/workflows/is-compatible.yml index 3b4ef66..d5328e6 100644 --- a/.github/workflows/is-compatible.yml +++ b/.github/workflows/is-compatible.yml @@ -18,7 +18,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '18' + node-version: '20' - name: Install dependencies run: npm i - name: Build plugin diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e118836..b8b05fc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,12 +17,12 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '18' + node-version: '20' - name: Setup Go environment uses: actions/setup-go@v3 with: - go-version: '1.19' + go-version: '1.21' - name: Install dependencies run: npm i @@ -54,7 +54,7 @@ jobs: - name: Warn missing Grafana access policy token run: | - echo Please generate a Grafana access policy token: https://grafana.com/docs/grafana/latest/developers/plugins/sign-a-plugin/#generate-a-token + echo Please generate a Grafana access policy token: https://grafana.com/developers/plugin-tools/publish-a-plugin/sign-a-plugin#generate-an-access-policy-token echo Once done please follow the instructions found here: https://github.com/${{github.repository}}/blob/main/README.md#using-github-actions-release-workflow if: ${{ env.GRAFANA_ACCESS_POLICY_TOKEN == '' }} @@ -71,13 +71,13 @@ jobs: export GRAFANA_PLUGIN_VERSION=$(cat dist/plugin.json | jq -r .info.version) export GRAFANA_PLUGIN_TYPE=$(cat dist/plugin.json | jq -r .type) export GRAFANA_PLUGIN_ARTIFACT=${GRAFANA_PLUGIN_ID}-${GRAFANA_PLUGIN_VERSION}.zip - export GRAFANA_PLUGIN_ARTIFACT_CHECKSUM=${GRAFANA_PLUGIN_ARTIFACT}.md5 + export GRAFANA_PLUGIN_ARTIFACT_SHA1SUM=${GRAFANA_PLUGIN_ARTIFACT}.sha1 echo "plugin-id=${GRAFANA_PLUGIN_ID}" >> $GITHUB_OUTPUT echo "plugin-version=${GRAFANA_PLUGIN_VERSION}" >> $GITHUB_OUTPUT echo "plugin-type=${GRAFANA_PLUGIN_TYPE}" >> $GITHUB_OUTPUT echo "archive=${GRAFANA_PLUGIN_ARTIFACT}" >> $GITHUB_OUTPUT - echo "archive-checksum=${GRAFANA_PLUGIN_ARTIFACT_CHECKSUM}" >> $GITHUB_OUTPUT + echo "archive-sha1sum=${GRAFANA_PLUGIN_ARTIFACT_SHA1SUM}" >> $GITHUB_OUTPUT echo "github-tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT @@ -95,8 +95,7 @@ jobs: run: | mv dist ${{ steps.metadata.outputs.plugin-id }} zip ${{ steps.metadata.outputs.archive }} ${{ steps.metadata.outputs.plugin-id }} -r - md5sum ${{ steps.metadata.outputs.archive }} > ${{ steps.metadata.outputs.archive-checksum }} - echo "checksum=$(cat ./${{ steps.metadata.outputs.archive-checksum }} | cut -d' ' -f1)" >> $GITHUB_OUTPUT + sha1sum ${{ steps.metadata.outputs.archive }} | cut -f1 -d' ' > ${{ steps.metadata.outputs.archive-sha1sum }} - name: Validate plugin run: | @@ -114,5 +113,5 @@ jobs: generate_release_notes: false files: | ./${{ steps.metadata.outputs.archive }} - ./${{ steps.metadata.outputs.archive-checksum }} + ./${{ steps.metadata.outputs.archive-sha1sum }} body_path: ${{ steps.changelog.outputs.path }} diff --git a/.gitignore b/.gitignore index 7bcb99d..b14eae0 100644 --- a/.gitignore +++ b/.gitignore @@ -35,7 +35,6 @@ e2e-results/ .eslintcache # Custom -yarn.lock docs/app.js docs/logo.svg package-lock.json diff --git a/.nvmrc b/.nvmrc index 19c7bdb..209e3ef 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16 \ No newline at end of file +20 diff --git a/.prettierrc.js b/.prettierrc.js index aaa5045..6c79e24 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,4 +1,4 @@ module.exports = { // Prettier configuration provided by Grafana scaffolding - ...require("./.config/.prettierrc.js") -}; \ No newline at end of file + ...require('./.config/.prettierrc.js'), +}; diff --git a/CHANGELOG.md b/CHANGELOG.md index bcdd946..3fdcff9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [Unreleased] +## 4.0.0 - Psychart now has the ability to render multiple data series - Options are shown as nested options under `Data options` in the panel editor @@ -12,6 +12,8 @@ - Reference files with relative paths without the `./` - Data points now just store dry bulb + `other` value + measurement type, where `other` is either wet bulb, dew point, or relative humidity, depending on the measurement type - Add version number in `README.md` +- Update to the latest version of `@grafana/create-plugin` (2.6.0) + - Node version upgraded to `v20` ## 3.3.1 diff --git a/docker-compose.yaml b/docker-compose.yaml index 3996017..e10818c 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -7,7 +7,7 @@ services: context: ./.config args: grafana_image: ${GRAFANA_IMAGE:-grafana-enterprise} - grafana_version: ${GRAFANA_VERSION:-9.5.3} + grafana_version: ${GRAFANA_VERSION:-10.0.3} ports: - 3000:3000/tcp volumes: diff --git a/package.json b/package.json index 74cd743..4d51e58 100644 --- a/package.json +++ b/package.json @@ -32,9 +32,10 @@ "@testing-library/react": "^12.1.4", "@types/jest": "^29.5.0", "@types/lodash": "^4.14.194", - "@types/node": "^18.15.11", + "@types/node": "^20.8.7", "copy-webpack-plugin": "^11.0.0", "css-loader": "^6.7.3", + "eslint-plugin-deprecation": "^2.0.0", "eslint-webpack-plugin": "^4.0.1", "fork-ts-checker-webpack-plugin": "^8.0.0", "glob": "^10.2.7", @@ -55,7 +56,7 @@ "webpack-livereload-plugin": "^3.0.2" }, "engines": { - "node": ">=18" + "node": ">=20" }, "dependencies": { "@emotion/css": "^11.1.3", diff --git a/tsconfig.json b/tsconfig.json index d294745..102e45b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,3 +1,3 @@ { "extends": "./.config/tsconfig.json" -} \ No newline at end of file +}