@grafana/create-plugin tool does not install the latest grafana, react and other libraries

Hello everybody,

As we know, to create a plugin, we use the tool @grafana/create-plugin, which quickly scaffolds the necessary structure to work with Grafana and its respective libraries. However, if you use this command now, for example:

npx @grafana/create-plugin@latest

It does not install the latest Grafana version and the it’s dependencies. This is the result in your panel plugin’s package.json.

{
“name”: “totest”,
“version”: “1.0.0”,
“description”: “”,
“scripts”: {
“build”: “webpack -c ./.config/webpack/webpack.config.ts --env production”,
“dev”: “webpack -w -c ./.config/webpack/webpack.config.ts --env development”,
“test”: “jest --watch --onlyChanged”,
“test:ci”: “jest --passWithNoTests --maxWorkers 4”,
“typecheck”: “tsc --noEmit”,
“lint”: “eslint --cache --ignore-path ./.gitignore --ext .js,.jsx,.ts,.tsx .”,
“lint:fix”: “npm run lint – --fix”,
“e2e”: “npm exec cypress install && npm exec grafana-e2e run”,
“e2e:update”: “npm exec cypress install && npm exec grafana-e2e run --update-screenshots”,
“server”: “docker-compose up --build”,
“sign”: “npx --yes @grafana/sign-plugin@latest”
},
“author”: “Turtles”,
“license”: “Apache-2.0”,
“devDependencies”: {
@babel/core”: “^7.21.4”,
@grafana/e2e”: “10.0.3”,
@grafana/e2e-selectors”: “10.0.3”,
@grafana/eslint-config”: “^6.0.0”,
@grafana/tsconfig”: “^1.2.0-rc1”,
@swc/core”: “^1.3.90”,
@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”,
“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”,
“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”,
“typescript”: “4.8.4”,
“webpack”: “^5.86.0”,
“webpack-cli”: “^5.1.4”,
“webpack-livereload-plugin”: “^3.0.2”
},
“engines”: {
“node”: “>=18”
},
“dependencies”: {
@emotion/css”: “^11.1.3”,
@grafana/data”: “10.0.3”,
@grafana/runtime”: “10.0.3”,
@grafana/ui”: “10.0.3”,
“react”: “17.0.2”,
“react-dom”: “17.0.2”,
“tslib”: “2.5.3”
},
“packageManager”: “npm@8.3.1”
}

As you can see, there are some outdated libraries, including Grafana itself at version 10.0.3. We already have version 10.1.4 available, and React is also outdated as we are now at React 18, not 17.

Am I missing a point? It seems that the tool simply not updated, and we need to update the libraries in the package.json…

Thanks!

You can go ahead and update those packages to your liking and see if it rolls, once the whol thing is scaffolded it is yours to do what you like

1 Like

Hi @companymvms It is intended that the tool is not using the latest grafana at all times. We manually review that the tool is producing correct configurations for the version of grafana we target. Imagine there could be type mismatches or other conflicting configuration.

We manually review and update the version often, most of the time it is perfectly possible to upgrade the versions without any problems, but sometimes we must do fixes, that’s why you don’t always see the latest version in the dependencies.