plugin-tools
plugin-tools copied to clipboard
Bug: create plugin update clobbers overridden build/build:dev/dev scripts
Which package(s) does this bug affect?
- [X] Create Plugin
- [ ] Sign Plugin
- [ ] Plugin E2E
Package versions
@grafana/[email protected]
What happened?
I have a custom webpack.config.ts so modified the scripts in my package.json to point to ./webpack.config.ts instead of ./.config/webpack/webpack.config.ts. When I run yarn create @grafana/plugin update, it always overrides the scripts back to using the original webpack config file.
What you expected to happen
If the scripts have been customised, they should be ignored by the update process.
How to reproduce it (as minimally and precisely as possible)
- Create a plugin
- Modify the build script to point to a different webpack config
- Run
yarn create @grafana/plugin update - Notice that the build script has been modified
Environment
❯ npx envinfo --system --binaries --browsers --npmPackages="@grafana/*"
System:
OS: macOS 14.4
CPU: (8) arm64 Apple M1
Memory: 474.27 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.11.0 - ~/Library/Caches/fnm_multishells/30971_1710406991088/bin/node
Yarn: 1.22.19 - ~/Library/Caches/fnm_multishells/30971_1710406991088/bin/yarn
npm: 10.2.4 - ~/Library/Caches/fnm_multishells/30971_1710406991088/bin/npm
Browsers:
Chrome: 122.0.6261.129
Firefox: 123.0.1
Safari: 17.4
npmPackages:
@grafana/eslint-config: ^6.0.1 => 6.0.1
### Additional context
_No response_
@jackw mind taking a quick look? If just needs putting on the backlog as a bug feel free to do so and remove yourself as assignee if not able to look at in the near term
This is a known issue that we're gonna need to put some thought into to help devs selectively update the various parts of their project when running the command. I'm gonna remove myself for the time being and try to get a proposal together on how that could look.