question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possibility to run lerna command in changed packages only

See original GitHub issue

Is it possible to somehow pass the result of lerna changed to lerna run --scope or lerna exec -- --scope ? It seems like lerna already does all the git magic necessary to get the packages that changed, but how can you easily use this result to run commands (for example I want to deploy to netlify instead of publish to npm or only run tests in my ci in changed packages) without getting the previous git tag manually yourself (if you are on master branch) to use with the since flag or comparing to master using since if you are on a feature branch?

Expected Behavior

Allow multiple packages to be passed to scope filter or allow lerna changed to be used in conjunction with a flag like since for example.

Current Behavior

It does not, see above.

Possible Solution

See expected behavior.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:17
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

15reactions
csi-lkcommented, Sep 27, 2019

Came across this when searching for the same thing, method seems to be to use lerna run with --since flag

eg

lerna run test --since master

you don’t need to run lerna changed

14reactions
evocateurcommented, Feb 28, 2020

It’s right there in the docs:

If no ref is passed, it defaults to the most-recent tag.

When in master, npx lerna run test --since will do what everyone in this thread seems to want.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to deploy only changed packages in a Lerna Monorepo
Deploy only changed packages. The only command you need to know is “lerna run” , it simply runs an npm script in each...
Read more >
Lerna run only on changed packages - monorepo
It allows us to run commands against staged files. So if you only changed stuff in packageA - linting, prettiering or running tests...
Read more >
@lerna/publish - npm
lerna publish # publish packages that have changed since the last release lerna publish ... When run, this command does one of the...
Read more >
@lerna/changed | Yarn - Package Manager
When you run the new command lerna repair , lerna will execute a series of code migrations/codemods which update your workspace to the...
Read more >
Untitled
When run, this command will: 1. `npm install` all external dependencies of each package. 2. Symlink together all Lerna `packages` that are dependencies...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found