koala-framework / composer-extra-assets

Composer Plugin for installing Assets using native npm/bower
BSD 2-Clause "Simplified" License
42 stars 11 forks source link

Installation directory for Bower / NPM dependencies #7

Closed moufmouf closed 9 years ago

moufmouf commented 9 years ago

Hi @nsams ,

I'm trying to build a "gulp-installer" package, based on composer-extra-assets and I'm currently facing an issue.

My whole idea was to define a NPM dependency in "gulp-installer" composer.json, then, I would let the user define it's own set of NPM plugins in the main composer.json file (see last sample in the README here).

My problem is that composer-extra-assets is not "merging" the NPM dependencies in the global package. Instead, it will install "node_modules" directories in each composer package directory.

So gulp is installed in _vendor/mouf/gulp-installer/nodemodules, while my gulp plugins are installed in _nodemodules. Is there a reason you decided to put individual _nodemodules directories into the composer package directory? Would you accept a pull-request that adds an option to change this behaviour and merge everything in the main directory?

nsams commented 9 years ago

Reason for that is that npm also works that way - for node packages it usually doesn't make sense to merge dependencies.

Idea: what if composer-extra-assets would create a vendor/bin/ script for every node_modules/.bin/ script (root packages only) - which would also include gulp If installed as root dependency.

That would not make gulp-installer necessary at all :)

What do you think?

nsams commented 9 years ago

now implemented