Add version constraint examples to wp package install help#234
Add version constraint examples to wp package install help#234swissspidy merged 2 commits intomainfrom
wp package install help#234Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Agent-Logs-Url: https://github.com/wp-cli/package-command/sessions/c83446da-0b04-4115-9e4a-468a02107f86 Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
wp package install help
There was a problem hiding this comment.
Pull request overview
Adds Composer version-constraint examples to the wp package install command help text to reduce confusion and prevent incorrect version suffix usage when installing WP-CLI packages.
Changes:
- Document installing a specific tagged version via
vendor/package:<version>. - Add examples for caret (
^) and tilde (~) version constraints. - Add an example for installing from a development branch (
dev-main).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * $ wp package install wp-cli/server-command:^1.0 | ||
| * | ||
| * # Install with tilde operator (allows patch-level updates). | ||
| * $ wp package install wp-cli/server-command:~1.2 |
There was a problem hiding this comment.
The description for the tilde constraint is inaccurate for the given example. In Composer, ~1.2 allows updates up to (but not including) 2.0 (i.e., it can include minor releases like 1.3, not just patch-level updates). Either change the text to reflect the actual behavior, or change the example to a three-part version like ~1.2.0 if you want a patch-only range.
| * $ wp package install wp-cli/server-command:~1.2 | |
| * $ wp package install wp-cli/server-command:~1.2.0 |
Users were unclear on how to install specific tagged versions of packages, leading to avoidable dependency resolution failures (e.g. using
dev-main#v2.6.6instead of:v2.6.6).Adds practical examples to the
wp package installcommand docblock covering the full range of Composer version constraint syntax: