Change chart.js to a peer dependency
#54
Open
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.
This allows the user to install the preferred chart.js version
For example, I needed some bugfixes from upstream.
The user would obviously need to install
chart.jshimself, so this probably is a breaking change?Edit:
It doesn't seem like this is going to be fixed.
For anyone looking for a work-around - I've started using
yarnovernpm, because it can do something like this, calleddependency resolution:package.json{ "dependencies": { "angular2-chartjs": "^0.5.1" }, "resolutions": { "angular2-chartjs/chart.js": "^2.8.0" } }as you can see - you can modify deep dependencies' versions and such.
Once again - check the documentation.
Also, I'm aware that
npmhas a packagenpm-force-resolutions, but this feature is not natively supported bynpmitself. Andyarnturned out pretty cool for me, so I didn't mind the switch.P.S. - I've even tried generating patches for the deep dependencies'
package.json, but it turns out thatnpmadds a lot of junk that makes the patches unusable, since the changed content differs everytime you re-install dependencies, like after cloning the project. See ds300/patch-package#150 for reference.(
I've even tried making a custom
postinstallscript for npm to run, but turns outthat npm only applies the modifications to
package-lock.jsonfile only AFTER the whole installation, including thepostinstallscript, has finished, effectively meaning that's it's either impossible or really hard/complicated/not worth to do.)