From 4f180f8d98ff0dd58f2c2c6a42e1d4643fb4b24e Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 11 Aug 2026 08:54:13 +0000 Subject: [PATCH 1/2] Point Composer users to package-command when `wp package` is missing `wp-cli/package-command` is a dev dependency since #846, so Composer-based installations of the bundle no longer have `wp package` available. Until now those users only got a generic "'package' is not a registered wp command" error. Declare a hint via `extra.command-hints` so WP-CLI can explain why the command is missing and how to get it back. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01G27BNpnRNerEeSGjvefzBf --- composer.json | 3 +++ composer.lock | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f454d7497..c74d1408e 100644 --- a/composer.json +++ b/composer.json @@ -64,6 +64,9 @@ "extra": { "branch-alias": { "dev-main": "2.12.x-dev" + }, + "command-hints": { + "package": "The 'package' command is bundled with the WP-CLI Phar, but is an optional dependency of Composer-based installations. Run `composer require wp-cli/package-command` to add it, or manage WP-CLI packages as regular Composer dependencies of your project instead." } }, "autoload-dev": { diff --git a/composer.lock b/composer.lock index 2f041a57b..0b1042850 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f03ac6fe341ad9e168f2681ba5f5f1eb", + "content-hash": "3b6e0c3cf150c6bf331db35ffb72814e", "packages": [ { "name": "composer/semver", From 80f8b699c85edd8017c33a09af20e597c82149a0 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 11 Aug 2026 09:39:26 +0000 Subject: [PATCH 2/2] Add CI check that `wp package` explains itself without dev dependencies Installs the bundle with `--no-dev`, the state Composer-based users end up in, and asserts that `wp package` fails with the hint rather than a bare "not a registered wp command". This guards against the hint metadata being dropped or misnested, and against the framework renaming the `extra` key it reads. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01G27BNpnRNerEeSGjvefzBf --- .github/workflows/testing.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index e601fac63..61e61b16e 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -14,6 +14,34 @@ jobs: test: uses: wp-cli/.github/.github/workflows/reusable-testing.yml@main + package-command-guidance: + name: Guidance for `wp package` without dev dependencies + runs-on: ubuntu-latest + steps: + - name: Check out source code + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Set up PHP environment + uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2 + with: + php-version: 'latest' + coverage: none + + - name: Install without dev dependencies + run: composer install --no-dev --no-interaction --prefer-dist + + - name: Check that `wp package` points at package-command + run: | + if vendor/bin/wp package > stdout.txt 2> stderr.txt; then + echo 'Expected `wp package` to fail without wp-cli/package-command.' + exit 1 + fi + + cat stderr.txt + grep -qF 'composer require wp-cli/package-command' stderr.txt + minimum-php-guard: name: Minimum PHP guard - PHP ${{ matrix.php }} runs-on: ubuntu-22.04