-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Utilize post install
Script for Composer
#32657
Conversation
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.
This is testing well and changes make sense. This part though isn't actually correct:
Run pnpm install, it should not build any packages. It will still build the core plugin
WC Admin client isn't built, so only a portion of WooCommerce is useable. Unless this is on purpose and we like the extra command or we're making the decision to handle this later on when the Admin client is migrated, we could change this line to prepare
.
"prepack": "pnpm install && pnpm run lint && pnpm run test && cross-env WC_ADMIN_PHASE=core pnpm run build", |
The rest of the changes are great 👍🏽
d302ff3
to
f9c1a81
Compare
Actually, with the caching @roykho added in #32725, I think I need to add an environment variable that can be set to bypass the installation. I'll check and see, since technically |
Composer will avoid installing if
When would you like to bypass installation? When CI actions use a cache? In that case, probably doesn't matter |
2d51130
to
04438a1
Compare
Thanks to our build orchestration tooling, there is no reason for us to build all of the packages on `install`. In cases where `prepare` was used to build before packaging, this changes it to `prepack` so it will run only under the correct circumstances.
This commit adds a `postinstall` script for the WooCommerce and WooCommerce Beta Tester plugins. This makes it easier to get started since `pnpm install` will ensure all dependencies in every project are ready.
Like Core's `composer.json`, we need to override the platform in order to get a consistent version for dependencies out of Composer.
cd4fba0
to
9a22c62
Compare
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.
I think it would be good to get this merged as is and address remaining questions, if any, later on.
Hi @ObliviousHarmony, thanks for merging this pull request. Please take a look at these follow-up tasks you may need to perform:
|
All Submissions:
Changes proposed in this Pull Request:
This pull request adds
composer install
to thepostinstall
action for our plugins. During this work I also noticed thatprepare
scripts are executing oninstall
, and as a consequence, every package is being built. This was previously necessary, but with our build orchestration tooling, we can rely on that build packages as needed. This should remove any ambiguity around having to run thecomposer-install
executor, as well as speed up updates since they won't build packages anymore.Closes #32652.
How to test the changes in this Pull Request:
node_modules
andvendor
folders in your cloned directorypnpm install
, it should not build any packages. It will still build the core plugin, however, due to a separate install script incomposer.json
.Other information:
pnpm nx affected --target=changelog
?FOR PR REVIEWER ONLY: