Skip to content
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

feat(watch): Add lerna watch command #3466

Merged
merged 15 commits into from Jan 5, 2023
Merged

Conversation

fahslaj
Copy link
Contributor

@fahslaj fahslaj commented Dec 22, 2022

Adds a command that supports watching for changes within Lerna packages.

Description

lerna watch can be used to run arbitrary commands when any of a package's files change on disk. See /core/lerna/commands/watch/README.md for examples.

Motivation and Context

This solves a common problem for package-based monorepos, which is to trigger rebuilds of packages when their files change.

How Has This Been Tested?

This has been tested manually as well as with dedicated e2e tests.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (change that has absolutely no effect on users)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@fahslaj fahslaj force-pushed the lerna-watch branch 2 times, most recently from 72a896b to 16a4df9 Compare December 28, 2022 18:03
@fahslaj fahslaj marked this pull request as ready for review December 28, 2022 20:14
@JamesHenry JamesHenry force-pushed the lerna-watch branch 2 times, most recently from 5213351 to b4c0f19 Compare January 1, 2023 15:48
@fahslaj
Copy link
Contributor Author

fahslaj commented Jan 3, 2023

@JamesHenry The issue was specific to Nx workspaces with a npmScope defined in nx.json. The watch command has been updated to properly mimic this behavior when nx.json has this property. An e2e test was also added to cover this case.

@JamesHenry JamesHenry merged commit 008b995 into lerna:main Jan 5, 2023
@JamesHenry
Copy link
Member

JamesHenry commented Jan 5, 2023

🎉

@fahslaj fahslaj deleted the lerna-watch branch January 5, 2023 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants