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

feature request: --exclude-dependents support for lerna ls #2198

Closed
piperchester opened this issue Jul 24, 2019 · 4 comments
Closed

feature request: --exclude-dependents support for lerna ls #2198

piperchester opened this issue Jul 24, 2019 · 4 comments

Comments

@piperchester
Copy link
Contributor

piperchester commented Jul 24, 2019

Expected Behavior

lerna ls --since HEAD~1

will not include dependents by default.

Current Behavior

lerna ls --since HEAD~1

includes dependent packages by default.

Possible Solution

Wanted to open an issue to start a discussion to see if others feel that this behavior should be changed. I'd be interested in helping contribute a flag so that one can opt out of the behavior if desired.

Something like --no-dependents, perhaps.

Steps to Reproduce (for bugs)

  1. Make a change to a leaf package (ensure that it has dependents that install it)
  2. lerna ls --since HEAD~1

Context

Working on a project that looks at changed packages. If a package is changed, but it has dependents, then lerna ls include that dependent package (even if it hasn't been changed). There might be another command that would help here (I think lerna changed --since would be great, but I don't think lerna changed supports filter flags).

For more context, we're looking for this to implement publishing logic in CI to determine which packages need to be published (and we can't use lerna publish because we just want to npm pack them not actually publish to the registry).

@piperchester piperchester changed the title potential bug: dependents are included by default in Lerna potential bug: dependents are included by default in lerna ls Jul 24, 2019
@evocateur
Copy link
Member

It's definitely by design. #707 etc etc. There are tons of other issues that want this very same thing.

I guess I'm tired of saying no. If people want to shoot themselves in the foot, who am I to stop them? I'm okay with --exclude-dependents in the filter options (the inverse of --include-filtered-dependents, which I think will be renamed --include-dependents in the next major).

lerna changed indeed does not support filter flags, for the same reason lerna publish & lerna version do not.

@piperchester
Copy link
Contributor Author

piperchester commented Jul 24, 2019

Thanks for the quick response @evocateur! Appreciate the link to #707. I'll update the title of this to signify this is (yet another) feature request.

I guess I'm tired of saying no. If people want to shoot themselves in the foot, who am I to stop them? I'm okay with --exclude-dependents in the filter options (the inverse of --include-filtered-dependents, which I think will be renamed --include-dependents in the next major).

That sounds great. If I prioritize the time then I'll open a pull request with the flag. I'd be happy to close this out too if you'd like and I can reference it in the potential PR.

Thank you for all you do! Lerna is a key piece of how we manage some of our packages and it's great to see new features landing all the time (like --graph in v13.6!) 💯

@piperchester piperchester changed the title potential bug: dependents are included by default in lerna ls feature request: --exclude-dependents support for lerna ls Jul 24, 2019
@farooqu
Copy link

farooqu commented Aug 21, 2019

@piperchester, are you working on implementing this? I was considering taking a stab if you haven't started yet.

@piperchester
Copy link
Contributor Author

@piperchester, are you working on implementing this? I was considering taking a stab if you haven't started yet.

Yep! I'm almost done -- feel free to poll me for updates @farooqu.

evocateur added a commit to evocateur/lerna that referenced this issue Oct 5, 2019
evocateur added a commit to evocateur/lerna that referenced this issue Oct 7, 2019
evocateur added a commit to evocateur/lerna that referenced this issue Oct 7, 2019
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

No branches or pull requests

3 participants