I’m using silverstripe 4.12 (core + cms).
How do I manage dependencies in a custom module (custom as in, not a real github repo or composer package)?
My module is inside vendor/johndoe/base. It has a composer.json that I created myself with 4 dependencies inside it. 3 of these are third party modules which I would like to be installed like tractorcow/silverstripe-fluent.
{
"name": "johndoe/base",
"description": "Add base code and configs to johndoe's website",
"type": "silverstripe-vendormodule",
"require": {
"silverstripe/framework": "^4",
"phpmailer/phpmailer": "^6.5",
"tractorcow/silverstripe-fluent": "^5",
"symbiote/silverstripe-gridfieldextensions": "^3"
},
"minimum-stability": "dev",
"prefer-stable": true
}
In an ideal situation (this module being a github repo) I would go to the webroot, execute composer require johndoe/base
and it would just get all the third party modules (like tractorcow/silverstripe-fluent). However since my module is just a “fake” module, it won’t do this.
I thought I could fix this by just going to vendor/johndoe/base and execute composer update
there, but that brought in a lot of mess by installing the SS framework inside that module folder.
Back to my question: How can I have all these third party dependencies installed in the right spot with just one command from webroot?