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.

I’m submitting a Feature request

Motivation / Use Case

lerna exec makes it easy to run a command in every package in a repo. lerna run can cover most cases, but if we want to run a simple command like rm -rf ./lib in every package, or a subset of packages with --scope, it would be easier to migrate from Lerna if lerna exec was also part of lerna-lite.

Expected Behavior

Same behavior as Lerna’s lerna exec "my-command"

Other Information

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
eric-burelcommented, May 4, 2022

I don’t see the need to add exec when the only thing you would need to do is add an npm script in each package and use Lerna-Lite run. but anyway I wouldn’t oppose to receiving a PR for it (it would have to optional like run is), but just don’t expect me to do it since I really don’t see the need.

This is necessary in monorepo context, you cannot add scripts in each package this way, it’s too hard to maintain. For instance I use that for “depcheck”: https://github.com/VulcanJS/vulcan-npm/blob/main/package.json I’ve requested this feature in Turborepo as well: https://github.com/vercel/turborepo/discussions/375

Many thanks for releasing this feature, it works just perfect, with all arguments!

1reaction
richardkazuomillercommented, May 1, 2022

@ghiscoding You are amazing!

Read more comments on GitHub >

github_iconTop Results From Across the Web

@lerna/exec - npm
Execute an arbitrary command in each package. Latest version: 6.2.0, last published: 11 days ago. Start using @lerna/exec in your project by ...
Read more >
lerna/exec - lerna/README.md at main · lerna/lerna · GitHub
@lerna/exec. Execute an arbitrary command in each package. Install lerna for access to the lerna CLI. Usage.
Read more >
@lerna/exec | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
How To Manage Monorepos With Lerna - DigitalOcean
To add a package to your project, use the lerna exec command to execute a shell command: lerna exec npm i lite-server --parallel....
Read more >
Getting Started | Lerna
You can incrementally adopt Lerna for existing monorepos or create a new Lerna workspace by running:
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