Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install an asset to a custom path #51

Closed
rodrigoaguilera opened this issue May 22, 2017 · 2 comments
Closed

Install an asset to a custom path #51

rodrigoaguilera opened this issue May 22, 2017 · 2 comments

Comments

@rodrigoaguilera
Copy link

rodrigoaguilera commented May 22, 2017

I had a workflow working to install assets on custom paths but I can't make it work anymore and assets go to vendor/ always.

Here is my composer.json

{
    "name": "oomphinc/composer-test",
    "repositories": [
	{
		"type": "composer",
		"url": "https://asset-packagist.org"
	}
    ],
    "require": {
        "oomphinc/composer-installers-extender": "1.1.2",
        "psr/log": "1.0.2",
        "bower-asset/bootstrap-sass": "3.3.7"
    },
    "extra": {
        "installer-types" : [ "library" ],
        "installer-paths": {
            "otherpath": ["bower-asset/bootstrap-sass"],
            "thispath": ["psr/log"],
            "morepaths": ["type:bower-asset"]
               
        }
    }
} 

The bootstrap-sass always end up in vendor but the psr/log gets installed in a custom path
I also reported it here
oomphinc/composer-installers-extender#6

Have the feeling is because now this repo sets a "type" without a require for composer/installers

https://packagist.org/packages/composer/installers
Here is explained that both things are needed for the custom path to work.

@hiqsol
Copy link
Member

hiqsol commented May 22, 2017

  1. You missed to specify bower-asset among installer-types:
    "extra": {
        "installer-types" : [ "library", "bower-asset"],

in my case it was just enough and everything looks as expected after composer update

  1. But there's still not fixed problem with composer installer plugins.
    For composer/installers or composer-installers-extender to work properly it needs to be processed/installed by composer BEFORE those packages you want to be installed in a specific way.
    But composer has no way to ensure an order of package installation. And this is the deliberate decision of composer creators.
    In my case installation order was:
Package operations: 5 installs, 0 updates, 0 removals
  - Installing composer/installers (v1.3.0): Loading from cache
  - Installing oomphinc/composer-installers-extender (v1.1.2): Loading from cache
  - Installing psr/log (1.0.2): Loading from cache
  - Installing bower-asset/jquery (3.2.1): Loading from cache
  - Installing bower-asset/bootstrap-sass (v3.3.7): Loading from cache

And composer-installers-extender got installed before assets and everything went as expected.
But sometimes it is necessary to run composer install twice...
See oomphinc/composer-installers-extender#6

@rodrigoaguilera
Copy link
Author

Thank you so much!

I thought "installer-types" was just "default for packages with no type" but I get it better.

I am aware of the other problem. I opened the issue because this time that was not the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants