Skip to content

watch: print name of changed file that triggers restart - #63781

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
marcopiraccini:watch-print-changed-file
Jun 22, 2026
Merged

watch: print name of changed file that triggers restart#63781
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
marcopiraccini:watch-print-changed-file

Conversation

@marcopiraccini

Copy link
Copy Markdown
Contributor

watch: print name of changed file that triggers restart

When running with --watch, Node now prints which file changed before the restart message, so users can tell which save actually triggered the rebuild.

Now:

Change detected in 'data/preliminary.csv'
Restarting 'src/app.js'

Implementation

  • FilesWatcher#onChange records the triggering path and includes it on the debounced changed event as trigger.
  • watch_mode.js prints Change detected in <path> between the screen-clear and the existing Restarting line, so it stays visible and keeps the existing output ordering intact.

Tests in test-watch-mode*.mjs are updated to assert the new line.

Fixes: #63767

@nodejs-github-botnodejs-github-bot added the needs-ci PRs that need a full CI run. label Jun 7, 2026
@marcopiraccini
marcopiraccini marked this pull request as ready for review June 7, 2026 06:16
@marcopiraccini
marcopiracciniforce-pushed the watch-print-changed-file branch from 406e322 to 053ef2eCompareJune 7, 2026 06:18

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

@atlowChemiatlowChemi changed the title feat: print name of changed file that triggers restartwatch: print name of changed file that triggers restartJun 8, 2026
Comment threadlib/internal/main/watch_mode.js Outdated
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
@marcopiraccini
marcopiracciniforce-pushed the watch-print-changed-file branch from 053ef2e to 6011d99CompareJune 8, 2026 12:20
@aduh95aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Jun 8, 2026
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 8, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@trivikrtrivikr added the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 22, 2026
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 22, 2026
@nodejs-github-bot
nodejs-github-bot merged commit ac6ee05 into nodejs:mainJun 22, 2026
86 of 88 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in ac6ee05

aduh95 pushed a commit that referenced this pull request Jun 22, 2026
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
PR-URL: #63781Fixes: #63767
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
aduh95 pushed a commit that referenced this pull request Jun 25, 2026
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
PR-URL: #63781Fixes: #63767
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
aduh95 pushed a commit that referenced this pull request Jul 21, 2026
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
PR-URL: #63781Fixes: #63767
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
aduh95 pushed a commit that referenced this pull request Jul 22, 2026
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
PR-URL: #63781Fixes: #63767
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
aduh95 pushed a commit that referenced this pull request Jul 30, 2026
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
PR-URL: #63781Fixes: #63767
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--watch should print name of changed file that triggers restart

7 participants

@marcopiraccini@nodejs-github-bot@ShogunPanda@aduh95@mertcanaltin@atlowChemi@trivikr