From 53d5eb9236c1a63b4665b4b70835ab26e04222a5 Mon Sep 17 00:00:00 2001 From: Yue Yang Date: Mon, 18 Dec 2023 15:46:22 +0800 Subject: [PATCH] refactor!: deprecate Angular support (#59) * chore: init Signed-off-by: Yue Yang * refactor: rewrite query Signed-off-by: Yue Yang * feat: allow custom/clear value Signed-off-by: Yue Yang * refactor: rewrite variables Signed-off-by: Yue Yang * chore: remove semicolons Signed-off-by: Yue Yang * chore: add default annotations Signed-off-by: Yue Yang * refactor: reimplement annotations Signed-off-by: Yue Yang * chore: update plugin info Signed-off-by: Yue Yang --------- Signed-off-by: Yue Yang --- .config/.cprc.json | 3 + .config/.eslintrc | 25 + .config/.prettierrc.js | 16 + .config/Dockerfile | 16 + .config/README.md | 164 + .config/jest-setup.js | 25 + .config/jest.config.js | 43 + .config/jest/mocks/react-inlinesvg.tsx | 25 + .config/jest/utils.js | 31 + .config/tsconfig.json | 26 + .config/types/custom.d.ts | 37 + .config/webpack/constants.ts | 2 + .config/webpack/utils.ts | 58 + .config/webpack/webpack.config.ts | 214 + .cprc.json | 3 + .eslintrc | 3 + .github/workflows/ci.yml | 86 +- .github/workflows/is-compatible.yml | 22 + .github/workflows/release.yml | 164 +- .gitignore | 5 + .husky/pre-commit | 4 +- .npmrc | 17 + .nvmrc | 1 + .prettierrc.js | 18 +- CHANGELOG.md | 15 +- README.md | 64 +- cypress.json | 3 + cypress/integration/01-smoke.spec.ts | 10 + docker-compose.yaml | 16 + jest-setup.js | 2 + jest.config.js | 14 +- package.json | 85 +- pnpm-lock.yaml | 11142 ++++++++++++ src/@types/global.d.ts | 2 +- src/AnnotationQueryEditor.ts | 31 - src/ChaosMeshSettings.tsx | 80 - src/ConfigEditor.tsx | 41 - src/QueryEditor.tsx | 81 - src/VariableQueryEditor.tsx | 93 - .../ConfigEditor.tsx} | 32 +- src/components/QueryEditor.tsx | 77 + src/components/VariableQueryEditor.tsx | 105 + src/datasource.ts | 322 +- src/img/annotations.png | Bin 34324 -> 81907 bytes src/img/settings.png | Bin 690431 -> 49810 bytes src/img/variables.png | Bin 188900 -> 72618 bytes src/module.ts | 20 +- src/partials/annotations.editor.html | 26 - src/plugin.json | 18 +- src/types.ts | 46 +- tsconfig.json | 8 +- yarn.lock | 14346 ---------------- 52 files changed, 12518 insertions(+), 15169 deletions(-) create mode 100644 .config/.cprc.json create mode 100644 .config/.eslintrc create mode 100644 .config/.prettierrc.js create mode 100644 .config/Dockerfile create mode 100644 .config/README.md create mode 100644 .config/jest-setup.js create mode 100644 .config/jest.config.js create mode 100644 .config/jest/mocks/react-inlinesvg.tsx create mode 100644 .config/jest/utils.js create mode 100644 .config/tsconfig.json create mode 100644 .config/types/custom.d.ts create mode 100644 .config/webpack/constants.ts create mode 100644 .config/webpack/utils.ts create mode 100644 .config/webpack/webpack.config.ts create mode 100644 .cprc.json create mode 100644 .eslintrc create mode 100644 .github/workflows/is-compatible.yml create mode 100644 .npmrc create mode 100644 .nvmrc create mode 100644 cypress.json create mode 100644 cypress/integration/01-smoke.spec.ts create mode 100644 docker-compose.yaml create mode 100644 jest-setup.js create mode 100644 pnpm-lock.yaml delete mode 100644 src/AnnotationQueryEditor.ts delete mode 100644 src/ChaosMeshSettings.tsx delete mode 100644 src/ConfigEditor.tsx delete mode 100644 src/QueryEditor.tsx delete mode 100644 src/VariableQueryEditor.tsx rename src/{ChaosMeshSettings.test.tsx => components/ConfigEditor.tsx} (55%) create mode 100644 src/components/QueryEditor.tsx create mode 100644 src/components/VariableQueryEditor.tsx delete mode 100644 src/partials/annotations.editor.html delete mode 100644 yarn.lock diff --git a/.config/.cprc.json b/.config/.cprc.json new file mode 100644 index 0000000..386d41a --- /dev/null +++ b/.config/.cprc.json @@ -0,0 +1,3 @@ +{ + "version": "2.10.1" +} diff --git a/.config/.eslintrc b/.config/.eslintrc new file mode 100644 index 0000000..1486ed2 --- /dev/null +++ b/.config/.eslintrc @@ -0,0 +1,25 @@ +/* + * ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️ + * + * 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 new file mode 100644 index 0000000..bf506f5 --- /dev/null +++ b/.config/.prettierrc.js @@ -0,0 +1,16 @@ +/* + * ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️ + * + * In order to extend the configuration follow the steps in .config/README.md + */ + +module.exports = { + endOfLine: 'auto', + printWidth: 120, + trailingComma: 'es5', + semi: true, + jsxSingleQuote: false, + singleQuote: true, + useTabs: false, + tabWidth: 2, +}; diff --git a/.config/Dockerfile b/.config/Dockerfile new file mode 100644 index 0000000..35d89bd --- /dev/null +++ b/.config/Dockerfile @@ -0,0 +1,16 @@ +ARG grafana_version=latest +ARG grafana_image=grafana-enterprise + +FROM grafana/${grafana_image}:${grafana_version} + +# Make it as simple as possible to access the grafana instance for development purposes +# Do NOT enable these settings in a public facing / production grafana instance +ENV GF_AUTH_ANONYMOUS_ORG_ROLE "Admin" +ENV GF_AUTH_ANONYMOUS_ENABLED "true" +ENV GF_AUTH_BASIC_ENABLED "false" +# Set development mode so plugins can be loaded without the need to sign +ENV GF_DEFAULT_APP_MODE "development" + +# Inject livereload script into grafana index.html +USER root +RUN sed -i 's/<\/body><\/html>/