From 08f4684620aad6bb1203887f0ddeaa99a3747eb5 Mon Sep 17 00:00:00 2001 From: JoseSantosAMD Date: Mon, 17 Jul 2023 12:46:05 -0500 Subject: [PATCH] Migrate to @grafana/create-plugin Signed-off-by: JoseSantosAMD --- grafana_plugins/svg_plugin/.prettierrc.js | 5 +- grafana_plugins/svg_plugin/package.json | 65 +++++++++++++++++++---- grafana_plugins/svg_plugin/tsconfig.json | 12 +---- 3 files changed, 59 insertions(+), 23 deletions(-) diff --git a/grafana_plugins/svg_plugin/.prettierrc.js b/grafana_plugins/svg_plugin/.prettierrc.js index f60eb1d252..aaa5045c6e 100644 --- a/grafana_plugins/svg_plugin/.prettierrc.js +++ b/grafana_plugins/svg_plugin/.prettierrc.js @@ -1,3 +1,4 @@ module.exports = { - ...require("./node_modules/@grafana/toolkit/src/config/prettier.plugin.config.json"), - }; \ No newline at end of file + // Prettier configuration provided by Grafana scaffolding + ...require("./.config/.prettierrc.js") +}; \ No newline at end of file diff --git a/grafana_plugins/svg_plugin/package.json b/grafana_plugins/svg_plugin/package.json index fb88025c1d..aa445bd25d 100644 --- a/grafana_plugins/svg_plugin/package.json +++ b/grafana_plugins/svg_plugin/package.json @@ -3,29 +3,72 @@ "version": "1.0.0", "description": "", "scripts": { - "build": "grafana-toolkit plugin:build", - "test": "grafana-toolkit plugin:test", - "dev": "grafana-toolkit plugin:dev", - "watch": "grafana-toolkit plugin:dev --watch", - "sign": "grafana-toolkit plugin:sign", - "start": "yarn watch" + "build": "webpack -c ./.config/webpack/webpack.config.ts --env production", + "dev": "webpack -w -c ./.config/webpack/webpack.config.ts --env development", + "e2e": "yarn exec cypress install && yarn exec grafana-e2e run", + "e2e:update": "yarn exec cypress install && yarn exec grafana-e2e run --update-screenshots", + "lint": "eslint --cache --ignore-path ./.gitignore --ext .js,.jsx,.ts,.tsx .", + "lint:fix": "yarn run lint --fix", + "server": "docker-compose up --build", + "sign": "npx --yes @grafana/sign-plugin@latest", + "start": "yarn watch", + "test": "jest --watch --onlyChanged", + "test:ci": "jest --passWithNoTests --maxWorkers 4", + "typecheck": "tsc --noEmit" }, "author": "Audacious Software Group", "license": "MIT", "devDependencies": { - "@grafana/toolkit": "latest", + "@babel/core": "^7.21.4", + "@grafana/e2e": "9.5.3", + "@grafana/e2e-selectors": "9.5.3", + "@grafana/eslint-config": "^6.0.0", + "@grafana/tsconfig": "^1.2.0-rc1", + "@swc/core": "^1.3.62", + "@swc/helpers": "^0.5.0", + "@swc/jest": "^0.2.26", + "@testing-library/jest-dom": "^5.16.5", + "@testing-library/react": "^12.1.4", + "@types/jest": "^29.5.0", + "@types/lodash": "^4.14.194", + "@types/node": "^18.15.11", + "copy-webpack-plugin": "^11.0.0", + "css-loader": "^6.7.3", "emotion": "10.0.27", + "eslint-webpack-plugin": "^4.0.1", + "fork-ts-checker-webpack-plugin": "^8.0.0", + "glob": "^10.2.7", + "identity-obj-proxy": "3.0.0", + "jest": "^29.5.0", + "jest-environment-jsdom": "^29.5.0", + "prettier": "^2.8.7", "react-monaco-editor": "^0.44.0", - "tslib": "^2.3.1" + "replace-in-file-webpack-plugin": "^1.0.6", + "sass": "1.63.2", + "sass-loader": "13.3.1", + "style-loader": "3.3.3", + "swc-loader": "^0.2.3", + "ts-node": "^10.9.1", + "tsconfig-paths": "^4.2.0", + "tslib": "^2.3.1", + "typescript": "4.8.4", + "webpack": "^5.86.0", + "webpack-cli": "^5.1.4", + "webpack-livereload-plugin": "^3.0.2" }, "engines": { "node": ">=14" }, "dependencies": { - "@grafana/runtime": "9.1.2", + "@emotion/css": "^11.1.3", "@grafana/data": "9.1.2", + "@grafana/runtime": "9.1.2", "@grafana/ui": "9.1.2", - "@svgdotjs/svg.js": "^3.1.1" + "@svgdotjs/svg.js": "^3.1.1", + "react": "17.0.2", + "react-dom": "17.0.2", + "tslib": "2.5.3" }, - "_comments": "Dependencies are not included as part of Omniperf. It's the user's responsibility to accept any licensing implications before building the project." + "_comments": "Dependencies are not included as part of Omniperf. It's the user's responsibility to accept any licensing implications before building the project.", + "packageManager": "yarn@1.22.19" } diff --git a/grafana_plugins/svg_plugin/tsconfig.json b/grafana_plugins/svg_plugin/tsconfig.json index 7e6657d2fe..d294745aa8 100644 --- a/grafana_plugins/svg_plugin/tsconfig.json +++ b/grafana_plugins/svg_plugin/tsconfig.json @@ -1,11 +1,3 @@ { - "extends": "./node_modules/@grafana/toolkit/src/config/tsconfig.plugin.json", - "include": ["src", "types"], - "compilerOptions": { - "types": ["@emotion/core"], - "rootDir": "./src", - "baseUrl": "./src", - "typeRoots": ["./node_modules/@types"], - "jsx": "react" - } -} + "extends": "./.config/tsconfig.json" +} \ No newline at end of file