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

Some NPM packages need package.json to be present #10

Closed moufmouf closed 9 years ago

moufmouf commented 9 years ago

Hi @nsams ,

I stumbled through a minor issue while using gulp with composer-extra-assets.

I'm used to the gulp-load-plugins module. What this module does is essentially to automatically "require" gulp plugins based on the list of plugins listed in the package.json file.

Now, I'm sure you see the issue... composer-extra-assets is creating, then deleting the package.json file. Since there is no package.json, we cannot use gulp-load-plugins module (or any other plugin that autoloads packages based on package.json).

Would you consider a pull-request that adds a persist_package_json parameter in the extra section that prevents the package.json file from being deleted?

{
  "extra": {
    "persist_package_json": true
  }
}
nsams commented 9 years ago

We also keep bower.json, I would even consider always keeping package.json

We should probably document better that bower.json, .bowerrc and package.json should be in .gitignore