-
Notifications
You must be signed in to change notification settings - Fork 31
build(dependencies): scope dependencies in lib/Vendor #2136
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
Conversation
024f391 to
e2496ad
Compare
| "post-install-cmd": [ | ||
| "composer bin all install --ansi", | ||
| "vendor/bin/php-scoper add-prefix --force", | ||
| "@php .lib-vendor-organizer.php lib/Vendor/ OCA\\\\Tables\\\\Vendor", | ||
| "cat .scoper-production-dependencies | uniq | xargs -I {} rm -Rf vendor/{} # Remove origins", | ||
| "cat .scoper-production-dependencies | cut -d / -f1 | uniq | xargs -I {} rmdir vendor/{} || true # Remove empty directories", | ||
| "composer dump-autoload -o" | ||
| ], | ||
| "post-update-cmd": [ | ||
| "composer bin all update --ansi", | ||
| "vendor/bin/php-scoper add-prefix --force", | ||
| "@php .lib-vendor-organizer.php lib/Vendor/ OCA\\\\Tables\\\\Vendor", | ||
| "cat .scoper-production-dependencies | uniq | xargs -I {} rm -Rf vendor/{} # Remove origins", | ||
| "cat .scoper-production-dependencies | cut -d / -f1 | uniq | xargs -I {} rmdir vendor/{} || true # Remove empty directories", | ||
| "composer dump-autoload -o" | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At what point does one run these new commands? After installing any new library?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with composer install and composer update, and effectively also with composer require and uninstall. Cf. https://getcomposer.org/doc/articles/scripts.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oooh, cool. What about for scoper:update-deps? When do I run it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After installing, updating or removing a dependency. But CI will also tell you.
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
e2496ad to
159912f
Compare
fixes #2133
Introduces php-scoper to scope our production dependencies (incl. its dependencies 🙃)
Pretty much close to what I described at https://arthur-schiwon.de/isolating-nextcloud-app-dependencies-php-scoper once upon a time, with a few adjustments.
ℹ️ When running this branch, or after merging to main, a
composer install [--no-dev]becomes necessary.