node icon indicating copy to clipboard operation
node copied to clipboard

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

Open juanibe opened this issue 8 months ago • 6 comments

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

juanibe avatar May 03 '25 10:05 juanibe

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

juanarbol avatar May 03 '25 16:05 juanarbol

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

juanibe avatar May 03 '25 17:05 juanibe

Worth reading doc.

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

juanarbol avatar May 03 '25 18:05 juanarbol

Test failure is already reported.

Refs: https://github.com/nodejs/node/issues/58127

juanarbol avatar May 03 '25 23:05 juanarbol

Updated the first commit message accordingly by amending it

juanibe avatar May 04 '25 14:05 juanibe

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.

juanarbol avatar May 04 '25 17:05 juanarbol

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.

juanibe avatar May 06 '25 08:05 juanibe

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

juanarbol avatar May 07 '25 04:05 juanarbol

Yeah, missed that part 🙏. Already amended it Thanks!

juanibe avatar May 07 '25 09:05 juanibe

@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.

juanarbol avatar May 16 '25 19:05 juanarbol

@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.

juanibe avatar May 16 '25 19:05 juanibe

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 <[email protected]>
 - GitHub <[email protected]>
PR-URL: https://github.com/nodejs/node/pull/58136
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Tierney Cyren <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ulises Gascón <[email protected]>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/58136
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Tierney Cyren <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ulises Gascón <[email protected]>
--------------------------------------------------------------------------------
   ⚠  Commits were pushed since the last approving review:
   ⚠  - doc: clarify behavior of --watch-path and --watch flags
   ⚠  - Update doc/api/cli.md
   ⚠  - doc: clarify context of --run incompatibility
   ℹ  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-2813296863
   ✔  - 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
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/15119328441

nodejs-github-bot avatar May 19 '25 17:05 nodejs-github-bot

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 <[email protected]>
 - GitHub <[email protected]>
PR-URL: https://github.com/nodejs/node/pull/58136
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Tierney Cyren <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ulises Gascón <[email protected]>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/58136
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Tierney Cyren <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ulises Gascón <[email protected]>
--------------------------------------------------------------------------------
   ℹ  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 <[email protected]>
 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 <[email protected]>
 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 <[email protected]>
 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: https://github.com/nodejs/node/pull/58136 Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Tierney Cyren <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ulises Gascón <[email protected]>

[detached HEAD de56f98f63] doc: clarify behavior of --watch-path and --watch flags Author: Juan Ignacio Benito <[email protected]> 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 <[email protected]> PR-URL: https://github.com/nodejs/node/pull/58136 Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Tierney Cyren <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ulises Gascón <[email protected]>

[detached HEAD 22b2e8356b] Update doc/api/cli.md Author: juanibe <[email protected]> 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: https://github.com/nodejs/node/pull/58136 Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Tierney Cyren <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ulises Gascón <[email protected]>

[detached HEAD 3f60e3ef87] doc: clarify context of --run incompatibility Author: Juan Ignacio Benito <[email protected]> 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

nodejs-github-bot avatar May 19 '25 19:05 nodejs-github-bot

Landed in 0d3e1b3985ad 🎉

Congrats on the contribution! Thanks!

juanarbol avatar May 22 '25 17:05 juanarbol