Skip to content

Commit

Permalink
Prepare v4 release
Browse files Browse the repository at this point in the history
  • Loading branch information
6nv committed Nov 17, 2023
1 parent a22c395 commit 3a670e7
Show file tree
Hide file tree
Showing 18 changed files with 58 additions and 40 deletions.
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"
}
16 changes: 14 additions & 2 deletions .config/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
]
}
18 changes: 9 additions & 9 deletions .config/.prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
*/

module.exports = {
"endOfLine": "auto",
"printWidth": 120,
"trailingComma": "es5",
"semi": true,
"jsxSingleQuote": false,
"singleQuote": true,
"useTabs": false,
"tabWidth": 2
};
endOfLine: 'auto',
printWidth: 120,
trailingComma: 'es5',
semi: true,
jsxSingleQuote: false,
singleQuote: true,
useTabs: false,
tabWidth: 2,
};
2 changes: 1 addition & 1 deletion .config/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 3 additions & 4 deletions .config/webpack/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -21,7 +19,7 @@ export function isWSL() {
} catch {
return false;
}
}
}

export function getPackageJson() {
return require(path.resolve(process.cwd(), 'package.json'));
Expand All @@ -40,7 +38,8 @@ export function hasReadme() {
export async function getEntries(): Promise<Record<string, string>> {
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 });
})
Expand Down
6 changes: 3 additions & 3 deletions .config/webpack/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const config = async (env): Promise<Configuration> => {
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"]
use: ['style-loader', 'css-loader'],
},
{
test: /\.s[ac]ss$/,
Expand All @@ -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 All @@ -136,6 +136,7 @@ const config = async (env): Promise<Configuration> => {
},
path: path.resolve(process.cwd(), DIST_DIR),
publicPath: `public/plugins/${pluginJson.id}/`,
uniqueName: pluginJson.id,
},

plugins: [
Expand Down Expand Up @@ -207,7 +208,6 @@ const config = async (env): Promise<Configuration> => {
}

return baseConfig;

};

export default config;
3 changes: 3 additions & 0 deletions .cprc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"features": {}
}
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "./.config/.eslintrc"
}
}
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
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 @@ -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
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 == '' }}

Expand All @@ -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
Expand All @@ -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: |
Expand All @@ -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 }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ e2e-results/
.eslintcache

# Custom
yarn.lock
docs/app.js
docs/logo.svg
package-lock.json
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
20
4 changes: 2 additions & 2 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
// Prettier configuration provided by Grafana scaffolding
...require("./.config/.prettierrc.js")
};
...require('./.config/.prettierrc.js'),
};
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -55,7 +56,7 @@
"webpack-livereload-plugin": "^3.0.2"
},
"engines": {
"node": ">=18"
"node": ">=20"
},
"dependencies": {
"@emotion/css": "^11.1.3",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "./.config/tsconfig.json"
}
}

0 comments on commit 3a670e7

Please sign in to comment.