View more context

 

Normann

got a question about composer.json -> extra -> installer-name, recently we developed a vendor module which has a really long name, e.g. mycompany/silverstripe-several-words-very-long and for installation, I want the directory name to be a little shorter than silverstripe-several-words-very-long. I thought the installer-name under extra in composer.json is the place I could customize the directory name, but I am wrong, as I give it a short name there, but it doesn't affect. Anyone knows what do I need to do, instead of using the installer-name.

Firesphere

The vendor-module should be very concise, and not contain silverstripe-, so it would by mycompany/concise-name, and that would make it install in to vendor/mycompany/concise-name

Firesphere

Your repo can still be silverstripe-several-words-very-long though

Normann

@Firesphere thanks. I will try to shorten the module name then.

nightjarnz

For those wondering: installer-name is something specific to "type": "silverstripe-module", and is not a general composer command (afaik). This is also what installed the dependencies into the project root, instead of the vendor directory. This no longer applies with SS4 using "type": "silverstripe-vendormodule" - this puts things in normal PSR-4 style (in vendor - i.e. does nothing special with the install) and exists more for vendor-expose support.

nightjarnz

But, a reminder that the packagist vendor/module-name format doesn't have to mirror the repository address (e.g. on github). Furthermore there is the replace composer config directive which one can use to rename their modules (c.f. friendsofsilverstripe becoming bringyourownideas: https://github.com/bringyourownideas/silverstripe-maintenance/blob/9bfed97108ada9920f1dc289a3f0ad36e5401582/composer.json#L52-L54).

Show 1 attachment(s)
GitHub  
bringyourownideas/silverstripe-maintenance

Helps with the day by day work to run a SilverStripe application or website. - bringyourownideas/silverstripe-maintenance

Hide attachment content
sander_ha

That moment you find what you're looking for in the docs, but then it just says TODO..