-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Let wp-scripts packages-update
install packages for a specific version of WordPress.
#36005
Conversation
…ion of WordPress. This is to mitigate the problems related to DEWP usage mentioned in WordPress#35630. This allows a plugin developer to install to-be-extracted dependencies at the lowest version of their plugin targets. To be able to run local tests and linters against that version. To give some insight to the developer, on what is the lowest anticipated version of an individual package.
@gziolo Would you find some time to take a look at this?
|
One observation for the proposed command: wp-scripts packages-update --wpVersion=5.6 While this works perfectly fine outside of the https://github.com/WordPress/wordpress-develop repository, it might be unclear what is supposed to do when running the same command from https://github.com/WordPress/wordpress-develop. We primarily use If I understand correctly the new flag is more a way to mirror an existing configuration in WordPress Core. So maybe we should reflect that in the name of the flag. I'm really tempted now to refine the Gutenberg plugin release so it also includes npm publishing so you could replicate the same thing for the plugin. It would be more complex as you would have to read the version from each individual package, but I think it's doable. |
Thanks for pointing that, I didn't think about it before. I double-checked locally how it behaves.
But, yes, the main purpose of this feature to me is for external plugins. In following scenarios:
I hope the above points explain a bit more my motivation and rationale behind the feature. In short, it's to make local packages (
Do you have something in mind?
👍 That would be awesome! So we could do something like
(somewhat related to |
I'll probably, need that anyway. For a plugin that is a WooCommerce extension, I'd need to inspect the individual packages. Unless, Gutenberg or WooCommerce-admin would expose a map of their releases to individual versions, in some other form. I think such a map could deliver value on its own. As would give a quick, and both machine- & human-readable source to check the connected versions. But that would require as you already mentioned, a change in the release process. |
Resharing my comment from #24376 (comment) where we discuss the proposal for using npm-dist-tag for plugin and core releases. It feels like when that happens we can simplify this proposal to allowing passing a dist-tag when running the command, example:
|
I think so, but with few caveats:
|
Right, it would work only for newly published WordPress packages, but it would be an issue only for a few months. We can always set dist-tags manually for older versions of WordPress based on the configuration of branches in https://github.com/WordPress/wordpress-develop. |
I opened an alternative PR that implements my comment from earlier: #40514. We need that to have a better workflow for WordPress 6.0 release. |
Description
This is to mitigate the problems related to DEWP usage mentioned in #35630.
This allows a plugin developer to install to-be-extracted dependencies at the lowest version of their plugin targets. To be able to run local tests and linters against that version. To give some insight to the developer, on what is the lowest anticipated version of an individual package.
How has this been tested?
git clone https://github.com/woocommerce/google-listings-and-ads.git && npm install
node_modules/@wordpress/scripts
with the content of this branchnpm run packages-update
/wp-scripts packages-update
, to see it still installs thelatest
by defaultnpm run packages-update -- --wpVersion=5.6
/wp-scripts packages-update--wpVersion=5.6
, to see it installs the versions from https://github.com/WordPress/wordpress-develop/blob/5.6/package.json#L79-L154Screenshots
Types of changes
New feature
Checklist:
*.native.js
files for terms that need renaming or removal).Additional notes: