Skip to content

doc: clarify --watch and --watch-path usage with --run#58136

Closed
juanibe wants to merge 3 commits into
nodejs:mainfrom
juanibe:docs/watch-cli-usage
Closed

doc: clarify --watch and --watch-path usage with --run#58136
juanibe wants to merge 3 commits into
nodejs:mainfrom
juanibe:docs/watch-cli-usage

Conversation

@juanibe

@juanibe juanibe commented May 3, 2025

Copy link
Copy Markdown
Contributor

This PR adds a note under the --watch and --watch-path CLI options in cli.md to clarify that these flags require a file path and cannot be used with --run.

Fixes confusion where users might assume --watch-path or --watch work with --run, which currently results in a runtime error.

Helps address issue discussion here

@nodejs-github-bot nodejs-github-bot added cli Issues and PRs related to the Node.js command line interface. doc Issues and PRs related to the documentations. labels May 3, 2025
Comment thread doc/api/cli.md
@juanarbol

Copy link
Copy Markdown
Member

Hi! Thanks for taking care of this.

The PR may need some extra edits. The implies of watch in watch-path is not being shown, and also, just keep in mind that the --run flag has priority; It can not be mixed with watch and its derivatives. Could you please reflect that into your PR?

Refs:
https://github.com/nodejs/node/blob/main/src/node.cc#L1067

@juanibe

juanibe commented May 3, 2025

Copy link
Copy Markdown
Contributor Author

Hi @juanarbol!, thanks for the observation
I added the missing detail that --watch-path implicitly enables --watch and simplified the wording to reduce redundancy (since the reader can now refer to --watch). Let me know if any further clarification or modification is needed

@juanarbol juanarbol left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just some more minor clarifications, I'm sorry I just forgot a couple details, but after this; I'm more than happy with this PR. Thanks again!

Comment thread doc/api/cli.md Outdated
Comment thread doc/api/cli.md Outdated

@juanarbol juanarbol left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

RLGTM

@juanarbol

Copy link
Copy Markdown
Member

Worth reading doc.

https://github.com/nodejs/node/blob/70863fb9dd4b70f1ba6141db4403e69eb7a9eeff/CONTRIBUTING.md :)

@juanibe juanibe changed the title docs: clarify --watch and --watch-path usage with --run doc: clarify --watch and --watch-path usage with --run May 3, 2025

@juanarbol juanarbol left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@juanarbol

Copy link
Copy Markdown
Member

Test failure is already reported.

Refs: #58127

@juanarbol juanarbol added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 3, 2025
@juanibe juanibe force-pushed the docs/watch-cli-usage branch from a0fca22 to b740f44 Compare May 4, 2025 14:33
@juanibe

juanibe commented May 4, 2025

Copy link
Copy Markdown
Contributor Author

Updated the first commit message accordingly by amending it

@juanarbol

Copy link
Copy Markdown
Member

Updated the first commit message accordingly by amending it

Thanks. You don't have to do it now, but if you intend to land a single commit, squash everything into a single commit.

@juanibe juanibe force-pushed the docs/watch-cli-usage branch 2 times, most recently from 90561a2 to c5881e6 Compare May 4, 2025 19:51
@juanibe

juanibe commented May 6, 2025

Copy link
Copy Markdown
Contributor Author

Updated the first commit message accordingly by amending it

Thanks. You don't have to do it now, but if you intend to land a single commit, squash everything into a single commit.

Thanks! I've squashed the commits and the PR should be ready now. Let me know if there's anything else needed from my side.

@juanarbol

Copy link
Copy Markdown
Member

Thanks! I've squashed the commits and the PR should be ready now. Let me know if there's anything else needed from my side.

I'm sorry, CI still not happy due to commit guidelines. Fix it, will approve and wait for more reviews :-)

Humble ping to @nodejs/documentation

Refs:
https://github.com/nodejs/node/actions/runs/14824640752/job/41770212057#step:6:15

@juanibe juanibe force-pushed the docs/watch-cli-usage branch from c5881e6 to e8bef23 Compare May 7, 2025 09:06
@juanibe

juanibe commented May 7, 2025

Copy link
Copy Markdown
Contributor Author

Yeah, missed that part πŸ™.
Already amended it
Thanks!

Comment thread doc/api/cli.md Outdated
Comment thread doc/api/cli.md Outdated
Co-authored-by: Tierney Cyren <accounts@bnb.im>
@juanibe juanibe requested a review from bnb May 12, 2025 09:07
@juanarbol

juanarbol commented May 16, 2025

Copy link
Copy Markdown
Member

@juanibe https://github.com/nodejs/node/actions/runs/14916227242/job/42382918668?pr=58136#step:7:21

Please, please, always run linters/tests before exposing it for review. Once CI is happy, this will be landed.

@juanibe juanibe force-pushed the docs/watch-cli-usage branch from b34c59e to 6cd8d11 Compare May 16, 2025 19:32
@juanibe

juanibe commented May 16, 2025

Copy link
Copy Markdown
Contributor Author

@juanibe https://github.com/nodejs/node/actions/runs/14916227242/job/42382918668?pr=58136#step:7:21

Please, please, always run linters/tests before exposing it for review. Once CI is happy, this will be landed.

Thanks @juanarbol for the reminder I've just run make format-md and pushed the changes. Let me know if there's anything else I should take care of.

@juanarbol juanarbol added the commit-queue Add this label to land a pull request using GitHub Actions. label May 19, 2025
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels May 19, 2025
@nodejs-github-bot

This comment was marked as outdated.

@juanarbol juanarbol added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels May 19, 2025
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels May 19, 2025
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator
Commit Queue failed
- Loading data for nodejs/node/pull/58136
βœ”  Done loading data for nodejs/node/pull/58136
----------------------------------- PR info ------------------------------------
Title      doc: clarify --watch and --watch-path usage with --run (#58136)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     juanibe:docs/watch-cli-usage -> nodejs:main
Labels     doc, cli, author ready
Commits    3
 - doc: clarify behavior of --watch-path and --watch flags
 - Update doc/api/cli.md
 - doc: clarify context of --run incompatibility
Committers 2
 - Juan Ignacio Benito <benitojuanignacio@gmail.com>
 - GitHub <noreply@github.com>
PR-URL: https://github.com/nodejs/node/pull/58136
Reviewed-By: Juan JosΓ© Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ulises GascΓ³n <ulisesgascongonzalez@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/58136
Reviewed-By: Juan JosΓ© Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ulises GascΓ³n <ulisesgascongonzalez@gmail.com>
--------------------------------------------------------------------------------
   β„Ή  This PR was created on Sat, 03 May 2025 10:10:31 GMT
   βœ”  Approvals: 4
   βœ”  - Juan JosΓ© Arboleda (@juanarbol): https://github.com/nodejs/node/pull/58136#pullrequestreview-2851757702
   βœ”  - Tierney Cyren (@bnb): https://github.com/nodejs/node/pull/58136#pullrequestreview-2833848422
   βœ”  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/58136#pullrequestreview-2834775904
   βœ”  - Ulises GascΓ³n (@UlisesGascon): https://github.com/nodejs/node/pull/58136#pullrequestreview-2835351578
   βœ”  Last GitHub CI successful
   β„Ή  Green GitHub CI is sufficient
--------------------------------------------------------------------------------
   βœ”  No git cherry-pick in progress
   βœ”  No git am in progress
   βœ”  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
βœ”  origin/main is now up-to-date
- Downloading patch for 58136
From https://github.com/nodejs/node
 * branch                  refs/pull/58136/merge -> FETCH_HEAD
βœ”  Fetched commits as b395420a99ff..6cd8d116fc9b
--------------------------------------------------------------------------------
Auto-merging doc/api/cli.md
[main 1fe793a132] doc: clarify behavior of --watch-path and --watch flags
 Author: Juan Ignacio Benito <benitojuanignacio@gmail.com>
 Date: Sat May 3 11:07:24 2025 +0100
 1 file changed, 7 insertions(+)
Auto-merging doc/api/cli.md
[main 35555b9788] Update doc/api/cli.md
 Author: juanibe <39571376+juanibe@users.noreply.github.com>
 Date: Thu May 8 17:13:01 2025 +0100
 1 file changed, 1 insertion(+), 1 deletion(-)
Auto-merging doc/api/cli.md
[main 0eee13a752] doc: clarify context of --run incompatibility
 Author: Juan Ignacio Benito <benitojuanignacio@gmail.com>
 Date: Thu May 8 22:10:55 2025 +0100
 1 file changed, 3 insertions(+), 3 deletions(-)
   βœ”  Patches applied
There are 3 commits in the PR. Attempting autorebase.
Rebasing (2/6)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
doc: clarify behavior of --watch-path and --watch flags

PR-URL: #58136
Reviewed-By: Juan JosΓ© Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ulises GascΓ³n <ulisesgascongonzalez@gmail.com>

[detached HEAD de56f98f63] doc: clarify behavior of --watch-path and --watch flags
Author: Juan Ignacio Benito <benitojuanignacio@gmail.com>
Date: Sat May 3 11:07:24 2025 +0100
1 file changed, 7 insertions(+)
Rebasing (3/6)
Rebasing (4/6)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
Update doc/api/cli.md

Co-authored-by: Tierney Cyren <accounts@bnb.im>
PR-URL: #58136
Reviewed-By: Juan JosΓ© Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ulises GascΓ³n <ulisesgascongonzalez@gmail.com>

[detached HEAD 22b2e8356b] Update doc/api/cli.md
Author: juanibe <39571376+juanibe@users.noreply.github.com>
Date: Thu May 8 17:13:01 2025 +0100
1 file changed, 1 insertion(+), 1 deletion(-)
Rebasing (5/6)
Rebasing (6/6)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
doc: clarify context of --run incompatibility

PR-URL: #58136
Reviewed-By: Juan JosΓ© Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ulises GascΓ³n <ulisesgascongonzalez@gmail.com>

[detached HEAD 3f60e3ef87] doc: clarify context of --run incompatibility
Author: Juan Ignacio Benito <benitojuanignacio@gmail.com>
Date: Thu May 8 22:10:55 2025 +0100
1 file changed, 3 insertions(+), 3 deletions(-)
Successfully rebased and updated refs/heads/main.

β„Ή Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/15121317393

@juanarbol juanarbol added commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels May 19, 2025
@juanarbol

juanarbol commented May 22, 2025

Copy link
Copy Markdown
Member

Landed in 0d3e1b3 πŸŽ‰

Congrats on the contribution! Thanks!

@juanarbol juanarbol closed this May 22, 2025
@juanarbol juanarbol removed the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. cli Issues and PRs related to the Node.js command line interface. doc Issues and PRs related to the documentations.