You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
run composer install, it detects & generates the subpackage autoload 🎉
Trying APIs
Use API throught REST client
Directly through REST client, everything seems to work 👌
API Docs
I can resolve asset, when I search in autoloader, there is no asset Class loaded. Even if I try to add in monorepo.json : "vendor/symfony/asset", it is not resolved. I tried to install it, reference it, ... It is required by api-platform/api-pack.
Running all tests (behat)
Some tests failed. Seems there is some problem with autoload providers for faker in Fixtures, error are not clear on this.
Add to that, I have this when I run any console command:
PHP Warning: Class 'Nette\DI\Config\Adapter' not found in /var/www/vendor/nette/di/src/compatibility.php on line 10
PHP Stack trace:
PHP 1. {main}() /var/www/vendor/behat/behat/bin/behat:0
PHP 2. require() /var/www/vendor/behat/behat/bin/behat:15
PHP 3. require_once() /var/www/api/vendor/autoload.php:5
PHP 4. composerRequireOnce8cfb30f5c45c15f7ff26872515d65e35() /var/www/api/vendor/composer/autoload_real.php:56
PHP 5. require_once() /var/www/api/vendor/composer/autoload_real.php:61
PHP 6. class_alias() /var/www/vendor/nette/di/src/compatibility.php:10
PHP Warning: Class 'Nette\DI\Definitions\Statement' not found in /var/www/vendor/nette/di/src/compatibility.php on line 11
PHP Stack trace:
PHP 1. {main}() /var/www/vendor/behat/behat/bin/behat:0
PHP 2. require() /var/www/vendor/behat/behat/bin/behat:15
PHP 3. require_once() /var/www/api/vendor/autoload.php:5
PHP 4. composerRequireOnce8cfb30f5c45c15f7ff26872515d65e35() /var/www/api/vendor/composer/autoload_real.php:56
PHP 5. require_once() /var/www/api/vendor/composer/autoload_real.php:61
PHP 6. class_alias() /var/www/vendor/nette/di/src/compatibility.php:11
PHP Warning: Class 'Nette\DI\Definitions\ServiceDefinition' not found in /var/www/vendor/nette/di/src/compatibility.php on line 12
PHP Stack trace:
PHP 1. {main}() /var/www/vendor/behat/behat/bin/behat:0
PHP 2. require() /var/www/vendor/behat/behat/bin/behat:15
PHP 3. require_once() /var/www/api/vendor/autoload.php:5
PHP 4. composerRequireOnce8cfb30f5c45c15f7ff26872515d65e35() /var/www/api/vendor/composer/autoload_real.php:56
PHP 5. require_once() /var/www/api/vendor/composer/autoload_real.php:61
PHP 6. class_alias() /var/www/vendor/nette/di/src/compatibility.php:12
PHPStan, not working at all
Same problem with Nette\DI\Config\Adapter, seems it has not been included into the autoloader.
$ vendor/bin/phpstan analyse -c phpstan.neon src/ --level=7 --memory-limit=512M
PHP Warning: Class 'Nette\DI\Config\Adapter' not found in /var/www/vendor/nette/di/src/compatibility.php on line 10
PHP Stack trace:
PHP 1. {main}() /var/www/vendor/phpstan/phpstan/bin/phpstan:0
PHP 2. require_once() /var/www/vendor/phpstan/phpstan/bin/phpstan:14
PHP 3. require_once() /var/www/api/vendor/autoload.php:5
PHP 4. composerRequireOnce8cfb30f5c45c15f7ff26872515d65e35() /var/www/api/vendor/composer/autoload_real.php:56
PHP 5. require_once() /var/www/api/vendor/composer/autoload_real.php:61
PHP 6. class_alias() /var/www/vendor/nette/di/src/compatibility.php:10
PHP Warning: Class 'Nette\DI\Definitions\Statement' not found in /var/www/vendor/nette/di/src/compatibility.php on line 11
PHP Stack trace:
PHP 1. {main}() /var/www/vendor/phpstan/phpstan/bin/phpstan:0
PHP 2. require_once() /var/www/vendor/phpstan/phpstan/bin/phpstan:14
PHP 3. require_once() /var/www/api/vendor/autoload.php:5
PHP 4. composerRequireOnce8cfb30f5c45c15f7ff26872515d65e35() /var/www/api/vendor/composer/autoload_real.php:56
PHP 5. require_once() /var/www/api/vendor/composer/autoload_real.php:61
PHP 6. class_alias() /var/www/vendor/nette/di/src/compatibility.php:11
PHP Warning: Class 'Nette\DI\Definitions\ServiceDefinition' not found in /var/www/vendor/nette/di/src/compatibility.php on line 12
PHP Stack trace:
PHP 1. {main}() /var/www/vendor/phpstan/phpstan/bin/phpstan:0
PHP 2. require_once() /var/www/vendor/phpstan/phpstan/bin/phpstan:14
PHP 3. require_once() /var/www/api/vendor/autoload.php:5
PHP 4. composerRequireOnce8cfb30f5c45c15f7ff26872515d65e35() /var/www/api/vendor/composer/autoload_real.php:56
PHP 5. require_once() /var/www/api/vendor/composer/autoload_real.php:61
PHP 6. class_alias() /var/www/vendor/nette/di/src/compatibility.php:12
PHP Fatal error: Cannot redeclare Zend\Diactoros\createUploadedFile() (previously declared in /var/www/vendor/zendframework/zend-diactoros/src/functions/create_uploaded_file.php:19) in /var/www/vendor/zendframework/zend-diactoros/src/functions/create_uploaded_file.php on line 39
PHP Stack trace:
PHP 1. {main}() /var/www/vendor/phpstan/phpstan/bin/phpstan:0
PHP 2. {closure:/var/www/vendor/phpstan/phpstan/bin/phpstan:17-36}() /var/www/vendor/phpstan/phpstan/bin/phpstan:38
PHP 3. require_once() /var/www/vendor/phpstan/phpstan/bin/phpstan:27
PHP 4. ComposerAutoloaderInit43c17f21039003d818a50fbd4ff86312::getLoader() /var/www/vendor/autoload.php:7
PHP 5. composerRequire43c17f21039003d818a50fbd4ff86312() /var/www/vendor/composer/autoload_real.php:56
Going further
I think this composer plugin works pretty well but I am stuck with weird cases I need to resolved.
Add to that, I build Docker image to ship my API, is there a command to hard copy dependencies of a specific project into it's vendor folder such as composer monorepo:package-vendor (to avoid copy all root vendor folder into Docker image).
Let me know if you want another insight!
If you have any tips to fix some issues thanks in advance!
The text was updated successfully, but these errors were encountered:
I'm planning to move my collection of api-platform services to a monorepo, in order to reuse helms, vendors, and other shareable stuff. Did you manage to solve your issues? Any suggestion before I start?
At the end, I moved to https://github.com/symplify/monorepo-builder but it's really annoying... duplicates vendors, and a huge overhead to manage this. Hope you will find a better solution and you can share it here 👌
Hey,
I would like to share my feedback on this promising tool to manage multiple PHP project in the same repository.
Here is what I want to achieve
I look at
fiddler
)Walk-through my exploration with this tool
Scaffolding
Migration Multiple API projects to Monorepo
First, I had to change
symfony/flex
forsymfony/symfony
. Symfony Flex will install all recipe at the monorepo root which is really annoying.Create the root
composer.json
And configure
monorepo.json
intoapi-*
foldersComposer install 🚀
run
composer install
, it detects & generates the subpackage autoload 🎉Trying APIs
Directly through REST client, everything seems to work 👌
I can resolve asset, when I search in autoloader, there is no asset Class loaded. Even if I try to add in
monorepo.json : "vendor/symfony/asset"
, it is not resolved. I tried to install it, reference it, ... It is required byapi-platform/api-pack
.Some tests failed. Seems there is some problem with autoload providers for faker in Fixtures, error are not clear on this.
Add to that, I have this when I run any console command:
Same problem with
Nette\DI\Config\Adapter
, seems it has not been included into the autoloader.Going further
I think this composer plugin works pretty well but I am stuck with weird cases I need to resolved.
Add to that, I build Docker image to ship my API, is there a command to hard copy dependencies of a specific project into it's vendor folder such as composer
monorepo:package-vendor
(to avoid copy all root vendor folder into Docker image).Let me know if you want another insight!
If you have any tips to fix some issues thanks in advance!
The text was updated successfully, but these errors were encountered: