Skip to content

Tooling: Use correct var name and tweak output in jetpack watch#47484

Merged
tbradsha merged 3 commits intotrunkfrom
fix/tooling/use_correct_var_name
Mar 9, 2026
Merged

Tooling: Use correct var name and tweak output in jetpack watch#47484
tbradsha merged 3 commits intotrunkfrom
fix/tooling/use_correct_var_name

Conversation

@tbradsha
Copy link
Contributor

@tbradsha tbradsha commented Mar 6, 2026

Proposed changes:

This updates an typo per a PR review (https://github.com/Automattic/jetpack/pull/46686/changes#r2716347873): packageJsoncomposerJson

It also tweaks the output:

$ jetpack watch plugins/jetpack
Watching 'plugins/jetpack'...
Go write some code.

There should not be any function change.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

Does this pull request change what data or activity we track or use?

Testing instructions:

Run jetpack watch plugins/jetpack and see the new output.

Changelog

  • Generate changelog entries for this PR (using AI).

@tbradsha tbradsha requested a review from a team March 6, 2026 13:53
@tbradsha tbradsha self-assigned this Mar 6, 2026
@tbradsha tbradsha added the [Status] Needs Review This PR is ready for review. label Mar 6, 2026
Copilot AI review requested due to automatic review settings March 6, 2026 13:53
@github-actions github-actions bot added the [Tools] Development CLI The tools/cli to assist during JP development. label Mar 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@tbradsha tbradsha mentioned this pull request Mar 6, 2026
3 tasks
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the jetpack watch CLI command implementation to use the correct variable name for parsed composer.json data and adjusts the user-facing console output when watch mode starts.

Changes:

  • Rename the watch() function parameter from packageJson to composerJson for correctness/consistency with readComposerJson.
  • Update jetpack watch startup message to the new, simpler wording.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 6, 2026 15:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +88 to 89
const command = hasWatchStep( project, composerJson, hot );
if ( command === false ) {
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hasWatchStep() currently returns a boolean, but the local variable is named command and checked via command === false, which is misleading. Consider renaming it to something like hasWatch/hasWatchScript and using a direct boolean check to make the intent clearer.

Suggested change
const command = hasWatchStep( project, composerJson, hot );
if ( command === false ) {
const hasWatch = hasWatchStep( project, composerJson, hot );
if ( ! hasWatch ) {

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@anomiex anomiex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems ok. Didn't test.

@tbradsha tbradsha merged commit d550c7f into trunk Mar 9, 2026
71 checks passed
@tbradsha tbradsha deleted the fix/tooling/use_correct_var_name branch March 9, 2026 16:07
@github-actions github-actions bot removed the [Status] Needs Review This PR is ready for review. label Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Tools] Development CLI The tools/cli to assist during JP development.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants