Git Product home page Git Product logo

composer-extra-assets's Introduction

Composer Plugin for installing Assets using native npm/bower

This Composer plugin installs assets using native npm/bower. Not only the root package can have dependencies.

Npm packages will be installed in package folder, bower will be installed in root - with all dependencies merged.

Introduction

Example usage

composer.json

"require": {
    "koala-framework/composer-extra-assets": "~1.1"
},
"extra": {
    "require-npm": {
        "grunt": "0.4.*"
    },
    "require-bower": {
        "jquery": "*"
    },
    "require-dev-bower": {
        "qunit": "*"
    },
    "require-dev-npm": {
    }
}

Bower dependencies

Bower dependencies will be installed in the vendor/bower_components directory.

NPM dependencies

NPM dependencies will be installed in the node_modules directory of the package that requires the dependency. Some NPM packages provide binary files (for instance gulp and grunt).

NPM binaries will be exposed in the vendor/bin directory if the NPM dependency is declared in the root Composer package.

If you are writing a package and want a NPM package to be available in the node_modules directory of Composer's root (instead of the node_modules directory of your package), you can add the expose-npm-packages attribute to the composer extra session of your package:

 "require": {
     "koala-framework/composer-extra-assets": "~1.1"
 },
 "extra": {
     "require-npm": {
         "gulp": "*"
     },
     "expose-npm-packages": true
 }

Generated files

This plugin will automatically generate 3 files: .bowerrc, bower.json, package.json/

Unless you have special requirements, you can ignore those 3 files in your VCS. If you are using GIT, add this to your .gitignore:

.gitignore

vendor/
.bowerrc
bower.json
package.json

Lock

This plugin will generate a file named composer-extra-assets.lock which can be used just like composer.lock. Put it under version control if you want to be able to install the exact same dependencies.

Warning

This plugins removes (and re-installs) the complete node_modules folder. Any changes will be lost.

composer-extra-assets's People

Contributors

nsams avatar moufmouf avatar alavieille avatar fraxachun avatar deltachaos avatar xhuberty avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.