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

lerna run - seems broken since 3.14.0 #2117

Closed
revelt opened this issue May 31, 2019 · 3 comments
Closed

lerna run - seems broken since 3.14.0 #2117

revelt opened this issue May 31, 2019 · 3 comments

Comments

@revelt
Copy link
Contributor

revelt commented May 31, 2019

Expected Behavior

lerna run should run a requested script inside each of the packages.

Current Behavior

On 3.14.0 and 3.14.1, Lerna starts the tasks and immediately ends them. Scripts are ran but instantly finish and nothing happens.

immediately_ends

Notice how npm test ran in 87 packages ended within 0.2 seconds. Nothing happened. Requested script is not running in async "in background" either...

Possible Solution

Whatever was introduced in 3.14.0 broke the lerna run feature because lerna run works fine on 3.13.4.

Steps to Reproduce (for bugs)

  1. Create an npm script in monorepo root package.json, for example, test:
"scripts": {
...
"test": "lerna run unittest --concurrency 1",
  1. Trigger lerna using npm run test from monorepo root.
  2. On 3.13.4 Lerna will run as normal. On 3.14.* it will immediately list the tasks as done and end.
lerna.json

{
  "command": {
    "publish": {
      "conventionalCommits": true,
      "message": "[skip ci] chore: Release"
    }
  },
  "ignoreChanges": [
    "packages/*/CHANGELOG.md",
    "packages/*/package.json"
  ],
  "lifecycle": {
    "version": "npm run build && git add ."
  },
  "packages": [
    "packages/*"
  ],
  "version": "independent"
}

Context

I did some investigation, various flags such as --concurrency don't affect anything.

Your Environment

Mac, monorepo of just npm packages https://gitlab.com/codsen/codsen/

Executable Version
lerna --version 3.14.0 and 3.14.1 only not earlier
npm --version 6.9.0
yarn --version n/a, but 1.16.0 is installed
node --version 12.3.1
OS Version
macOS Sierra 10.14.5

Thank you.

@evocateur
Copy link
Member

I spent a few hours messing around with codsen, here's the branch with my progress: https://gitlab.com/evocateur/codsen/tree/feature/dev-tasks-from-root-etc

I actually never got around to testing the latest lerna run, heh, as most of the tasks you use it for in codsen/codsen IMO should be run from the root. Sooooo much repetition in the build/test/lint tasks/config/etc.

@evocateur
Copy link
Member

Just for grins I ran npm i -D lerna@latest in that branch and this command got rather far, until of course lect blew up on email-homey because it didn't generate coverage or something?

npx lerna run test --concurrency 1 --stream --no-prefix

But by no means did it "immediately list the tasks as done and [exit]". Notably, I removed an unused @pectin/cli installation that seems to have resolved some unfortunate nesting of various @lerna/* dependencies.

@revelt
Copy link
Contributor Author

revelt commented Jun 4, 2019

Hi Daniel,
Thank you for investigating. The lerna run seems to work on https://github.com/reggi/lerna-tutorial tester repo fine. It must be something different, something among tasks causing runner to exit. I'll close this ticket, it's not exactly the lerna run, it's something else. Thank you.

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

2 participants