Create-Plugin: Ignore grafana dependencies when migrating #119
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
This PR prevents create-plugin from updating any
@grafana/
dependencies that are already listed in a pluginspackage.json
when runningnpx @create-plugin migrate
. Doing so should ease the pain for a plugin developer migrating without needing to edit source code to deal with typescript errors in build or test.This feels a little tricky to implement as we rely heavily on the templates for location of dependencies and delete
@grafana/**
dependencies that are listed asdevDependencies
when they should bedependencies
etc. This led me to opt for to storing references to the "original" package versions then, when calculating the NPM updates, use these references instead to keep the moving / deleting logic without changing the package versions.Which issue(s) this PR fixes:
Fixes #49
Special notes for your reviewer:
Bear in mind create-plugin will still introduce
@grafana
dependencies with the "latest" version if they are not present in the pluginspackage.json
. An example of this is clock-panel that has no e2e setup however during migratione2e
ande2e-selectors
are added along with a docker compose that reference 9.1.2. I don't really think we should get too smart with this and I'm leaning towards us adding a "next steps" document for post migration that covers these sorts of things to aid developers to make the most out of the setup create-plugin migration will provide.