Skip to content

Remove unused npm watch scripts #41584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

julien-deramond
Copy link
Member

@julien-deramond julien-deramond commented Jul 2, 2025

Warning

Heavily draft

This PR follows up on #41574, which introduced automatic Sass recompilation for Astro.

The goal is to identify and remove watch* npm scripts that are no longer necessary.

Currently, these scripts are only triggered through the main watch script, which runs when executing npm run start. There are no known use cases where the watch-* scripts are run directly.

We'll evaluate them one by one.


🟢 watch-js-docs

Steps:

  1. Remove the watch-js-docs npm script.
  2. Run npm run start.
  3. Edit site/src/assets/stackblitz.js (e.g., change a comment in the HTML).
  4. Confirm that Astro detects the change and recompiles automatically.
  5. Click the “Try it on Stackblitz” button — the updated comment appears as expected.

Conclusion: watch-js-docs is no longer needed and can safely be removed.

🔴 watch-css-docs

Astro can recompile files like site/src/scss/_variables.scss on the fly (e.g., to update the $bd-purple Sass variable), but it doesn’t trigger the linter. That’s why we keep watch-css-docs running to execute npm run lint in real time.


TODO

  • watch-css-main
  • watch-css-dist
  • watch-css-test
  • watch-js-main
  • watchwatch-*
  • startwatch

@github-project-automation github-project-automation bot moved this to To do in v5.3.8 Jul 2, 2025
@julien-deramond julien-deramond moved this from To do to In progress in v5.3.8 Jul 2, 2025
@mdo mdo marked this pull request as ready for review August 5, 2025 09:26
@mdo mdo force-pushed the main-jd-remove-unused-npm-watch-scripts branch from f4efb1d to 48370d5 Compare August 5, 2025 09:26
@julien-deramond
Copy link
Member Author

Closing for now as we need more thoughts on this.
While removing watch-js-docs and other watch-* tasks could still "work", it would mean losing the automatic on-the-fly execution of npm *lint.

Additionally, Astro currently does not reload when files in dist/* change: so updates to component JS code are not hot-reloaded, and CSS changes in a component do not update the example pages (only the main docs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants