Skip to content

Conversation

@kiprasmel
Copy link

@kiprasmel kiprasmel commented Jun 25, 2019

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.js himself, 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 yarn over npm, because it can do something like this, called dependency 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 npm has a package npm-force-resolutions, but this feature is not natively supported by npm itself. And yarn turned 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 that npm adds 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 postinstall script for npm to run, but turns out
that npm only applies the modifications to package-lock.json file only AFTER the whole installation, including the postinstall script, has finished, effectively meaning that's it's either impossible or really hard/complicated/not worth to do.
)

This allows the user to install the preferred chart.js version

For example, I needed some bugfixes from upstream.
Though that this might be more appropriate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant