2017 © Pedro Peláez
 

composer-plugin composer-assets-installer

image

reputation-vip/composer-assets-installer

  • Monday, April 3, 2017
  • by Neverdane
  • Repository
  • 10 Watchers
  • 13 Stars
  • 18,484 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 7 Versions
  • 2 % Grown

The README.md

Composer Assets Installer Build Status

Composer Assets Installer provides a fast and easy way to copy the assets of your Composer packages into your public folder. You only have to chose one or multiple asset directories of the target in your "composer.json" file., (*1)

Code Example

Here is the composer.json file of a distant Composer package we want to use in our project :, (*2)

{
    "require": {
        "reputation-vip/composer-assets-installer": "~1.0"
    },
    "name": "reputation-vip/required-distant-package",
    "extra": {
        "assets-dir" : "public"
    }
}

Here is the composer.json file of our project :, (*3)

{
    "require": {
        "reputation-vip/composer-assets-installer": "~1.0",
        "my/required-distant-package": "~1.0"
    },
    "extra": {
        "assets-dir" : "web"
    }
}

Then, the assets will be accessible through the following path: web/my/required-distant-package., (*4)

Motivation

As members of the Reputation VIP's development team, we are used to creating full Composer packages, embedding a javascript logic and a css layer., (*5)

When we first started using Composer, we were somehow frustrated by it's lack of asset handling. Indeed, Composer forced us to manually copy the assets into our public directory. Furthermore, every time we updated the package, we had to repeat this task., (*6)

That's why we needed a tested, documented and easily configurable Composer plugin which allowed us to keep control on the asset directories., (*7)

Installation

You simply have to add the following line to the requirements of your composer.json file:, (*8)

"require": {
    "reputation-vip/composer-assets-installer": "~1.0"
}

Then, you can specify the target for your asset directory (web for example):, (*9)

"extra": {
    "assets-dir": "web"
}

API Reference

With this solution, you can specify as many targets as you want:, (*10)

"extra": {
    "assets-dir": {
        "js": "web/js",
        "css": "web/css"
     }
}

The Versions

03/04 2017

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alban Pommeret

03/04 2017

v2.0.0

2.0.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alban Pommeret

09/03 2015

1.0.4

1.0.4.0

  Sources   Download

The Requires

 

The Development Requires

by Alban Pommeret

05/03 2015

1.0.3

1.0.3.0

  Sources   Download

The Requires

 

The Development Requires

by Alban Pommeret

08/02 2015

1.0.2

1.0.2.0

  Sources   Download

The Requires

 

The Development Requires

by Alban Pommeret

27/01 2015

1.0.1

1.0.1.0

  Sources   Download

The Requires

  • composer-plugin-api ~1.0

 

The Development Requires

by Alban Pommeret

17/12 2014

1.0.0

1.0.0.0

  Sources   Download

The Requires

  • composer-plugin-api ~1.0

 

The Development Requires

by Alban Pommeret