neveldo / jQuery-Mapael

jQuery plugin based on raphael.js that allows you to display dynamic vector maps
https://www.vincentbroute.fr/mapael/
MIT License
1.01k stars 195 forks source link

Better dependencies / installation instructions #329

Closed Indigo744 closed 7 years ago

Indigo744 commented 7 years ago

I've had this update in my head for a while: provide an explanation on how to install Mapael.

While doing some test with NPM/Bower, I stumble over some issues:

  1. npm/bower install would download the whole GH repository (with examples, tests, etc..)
  2. If my project uses jQuery 2.x (or even 1.x), npm would give an error and download jQuery 3.x (which is something I wouldn't want!)

So, I propose the following enhancement for the package:

  1. Add a list of ignored file in bower.json (i.e. blacklist) to limit the number of downloaded files
  2. Add a list of files to include in package.json (i.e. whitelist) to limit the number of downloaded files
  3. Add jQuery as peer dependency (and why it should be both in dependencies and peerDependencies)
  4. Set Mousewheel as optional dependency (so it may be ignored by a user)
  5. Loosen jQuery and Raphael version constraint to allow different version

What do you think?

Indigo744 commented 7 years ago

For Bower, I think there is no harm to keep it for now.

Regarding package.json, I actually tested with NPM (latest) and Yarn by setting up a fake new project (with old and new jQuery/Raphael dependencies) and everything seems to work fine...

neveldo commented 7 years ago

Thanks for having checked on NPM / Yarn with different version of jQuery / Raphael ! Ok for bower, you're right it's still maintened for now.