inuitcss / CONTRIBUTING

[DEPRECATED] [go to intuitcss/inuitcss]
https://github.com/inuitcss/inuitcss
11 stars 0 forks source link

Support npm #10

Closed mlmorg closed 9 years ago

mlmorg commented 10 years ago

Can you please support npm? I'd be happy to go through and add package.json's to all components if that's a deterrent.

r4j4h commented 9 years ago

I am not the maintainer but here's some of my thoughts on the issue:

npm pulls in dependencies differently than bower. bower brings all dependencies in as first level children of a hierarchy, while npm brings dependencies in as nested hierarchies. In other words sub-dependencies are handled differently.

For example, let's compare the media repo ( https://github.com/inuitcss/objects.media ). It uses the trumps.spacing repo. Installing via Bower provides you with both the media and trumps.spacing folders as children in bower_components. But npm would provide you with only a media folder in node_modules, with the trumps.spacing folder inside that media folder's node_modules folder. You could also manually include trumps.spacing as a dependency to npm, along with media, and npm would do what it did previously and also provided you with a trumps.spacing folder next to the media folder - similar to what bower does. You would have trumps.spacing twice, once inside the media folder and one alongside it.

For the individual inuit pieces npm should work fine and is desirable, but I think the package repos like starter kit ( https://github.com/inuitcss/starter-kit ) need to be changed. Here is where things diverge:

If we want to include the suggested inuit modules as provided dependencies then the @import lines need to be changed to point to the nested ones they will provide after npm install runs. But if someone uses starter-kit and then one of its included things like generic.box-sizing manually or through a subdependency of another thing then they are going to end up with multiple generic.box-sizings, which is likely to get confusing.

One way we could maintain non-redundancy would be to drop the providing of the dependencies and let the repo just be a simple readme file with both package.json dependency blocks for those dependencies for the user to copy/paste in their own package.json files and the currently existing @import code blocks which should work as is after a simple text/replace of bower_components with node_modules.

florianbouvot commented 9 years ago

npm support has been added by @anselmh, so maybe you can close this issue ;)

anselmh commented 9 years ago

Hey guys, I’ve added basic npm support a few days ago. This means I’ve added them as is to npm without any major changes as @r4j4h suggests. While I do understand that bower and npm are different in their handling it is working with npm right now. Sure you should know what you do and how to write your includes when you use bower or npm. I though expect people to know that when they choose the one or the other dependency manager. I think we could improve the behavior (but removing dependencies from dependencies isn’t cool) but I close this issue now as the basic support is given. Please feel free to open another issue or pull request if you have ideas or needs to be integrated. Thanks :)