Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing font migration and scaling #99

Merged
merged 11 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .config/.cprc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"version": "2.6.0"
}
14 changes: 13 additions & 1 deletion .config/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,17 @@
"root": true,
"rules": {
"react/prop-types": "off"
}
},
"overrides": [
{
"plugins": ["deprecation"],
"files": ["src/**/*.{ts,tsx}"],
"rules": {
"deprecation/deprecation": "warn"
},
"parserOptions": {
"project": "./tsconfig.json"
}
}
]
}
2 changes: 1 addition & 1 deletion .config/webpack/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const config = async (env): Promise<Configuration> => {
// 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]',
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/is-compatible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: '18'
node-version: '20'
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml

Expand Down Expand Up @@ -76,14 +76,12 @@ 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
Expand All @@ -102,7 +100,6 @@ 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 }} | cut -f1 -d' ' > ${{ steps.metadata.outputs.archive-checksum }}
sha1sum ${{ steps.metadata.outputs.archive }} | cut -f1 -d' ' > ${{ steps.metadata.outputs.archive-sha1sum }}

- name: Validate plugin
Expand All @@ -120,7 +117,6 @@ jobs:
generate_release_notes: true
files: |
./${{ steps.metadata.outputs.archive }}
./${{ steps.metadata.outputs.archive-checksum }}
./${{ steps.metadata.outputs.archive-sha1sum }}
body: |
**This Github draft release has been created for your plugin.**
Expand All @@ -135,7 +131,6 @@ jobs:
- Click the **Submit Plugin** button
- Fill in the Plugin Submission form:
- Paste this [.zip asset link](https://github.com/${{ github.repository }}/releases/download/v${{ steps.metadata.outputs.plugin-version }}/${{ steps.metadata.outputs.archive }}) in the Plugin URL field
- Paste this [.zip.md5 link](https://github.com/${{ github.repository }}/releases/download/v${{ steps.metadata.outputs.plugin-version }}/${{ steps.metadata.outputs.archive-checksum }}) in the MD5 field
- Paste this [.zip.sha1 link](https://github.com/${{ github.repository }}/releases/download/v${{ steps.metadata.outputs.plugin-version }}/${{ steps.metadata.outputs.archive-sha1sum }}) in the SHA1 field

Once done please remove these instructions and publish this release.
9 changes: 9 additions & 0 deletions .levignore.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
removals: [
],
changes: [
/PanelPlugin\.setMigrationHandler/
],
additions: [
],
};
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
20
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All changes noted here.

## v2.0.1 - 2023-11-13

- Fix font sizing during migrations
- Autoscales font according to gauge size

## v2.0.0 - 2023-10-20

- Rewritten from Angular to React
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "briangann-gauge-panel",
"private": true,
"version": "2.0.0",
"version": "2.0.1",
"description": "Grafana D3 Gauge Panel",
"main": "module.js",
"scripts": {
Expand Down Expand Up @@ -38,12 +38,12 @@
"@swc/jest": "^0.2.26",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^12.1.4",
"@types/d3": "7.4.2",
"@types/d3-scale": "4.0.6",
"@types/d3": "7.4.3",
"@types/d3-scale": "4.0.8",
"@types/glob": "^8.0.0",
"@types/jest": "^29.5.0",
"@types/lodash": "^4.14.194",
"@types/node": "18.18.2",
"@types/lodash": "^4.14.201",
"@types/node": "20.9.0",
"copy-webpack-plugin": "^11.0.0",
"cspell": "7.3.8",
"css-loader": "^6.7.3",
Expand All @@ -66,7 +66,8 @@
"typescript": "4.8.4",
"webpack": "^5.86.0",
"webpack-cli": "^5.1.4",
"webpack-livereload-plugin": "^3.0.2"
"webpack-livereload-plugin": "^3.0.2",
"eslint-plugin-deprecation": "^2.0.0"
},
"dependencies": {
"@emotion/css": "^11.1.3",
Expand Down
Loading