Tooling: Use correct var name and tweak output in jetpack watch#47484
Tooling: Use correct var name and tweak output in jetpack watch#47484
jetpack watch#47484Conversation
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
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:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
There was a problem hiding this comment.
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 frompackageJsontocomposerJsonfor correctness/consistency withreadComposerJson. - Update
jetpack watchstartup 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>
There was a problem hiding this comment.
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.
| const command = hasWatchStep( project, composerJson, hot ); | ||
| if ( command === false ) { |
There was a problem hiding this comment.
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.
| const command = hasWatchStep( project, composerJson, hot ); | |
| if ( command === false ) { | |
| const hasWatch = hasWatchStep( project, composerJson, hot ); | |
| if ( ! hasWatch ) { |
Proposed changes:
This updates an typo per a PR review (https://github.com/Automattic/jetpack/pull/46686/changes#r2716347873):
packageJson→composerJsonIt also tweaks the output:
There should not be any function change.
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
Run
jetpack watch plugins/jetpackand see the new output.Changelog