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

Add --parallel flag to lerna run #796

Merged
merged 1 commit into from May 1, 2017
Merged

Conversation

evocateur
Copy link
Member

@evocateur evocateur commented May 1, 2017

Description

Provide a new flag, --parallel, to facilitate easier and less error-prone spawning of long-running watchers from npm scripts (e.g., lerna run watch).

Motivation and Context

This allows simpler invocation of watch scripts, with the caveat that concurrency and topological sorting are completely ignored. This is generally the intention when calling lerna run watch and other similar script targets, hence the additional flag.

# the following commands are equivalent
$ lerna run watch --concurrency=1000 --stream
$ lerna run watch --parallel

Package filtering (--scope and --ignore) is still available when this new flag is being used, and it is advised to narrow the scope of parallel execution when you have more than a dozen packages or so (YMMV).

How Has This Been Tested?

local monorepo dev and copious unit and integration tests.

Types of changes

  • New feature (non-breaking change which adds functionality)

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.

describe: "Stream output with lines prefixed by package."
}
describe: "Stream output with lines prefixed by package.",
type: "boolean",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discovered during the writing of new integration tests, without this explicit type one could cause a mangling of the arguments passed in by innocently re-ordering them. Obviously not very ideal.

@evocateur
Copy link
Member Author

Argh, I'm getting bitten by this line on Windows. 😡Ⓜ️

This allows simpler invocation of `watch` scripts, with the caveat that
concurrency and topological sorting are _completely_ ignored.
This is generally the intention when calling `lerna run watch` and other
similar script targets, hence the additional flag.

    # the following commands are equivalent
    lerna run watch --concurrency=1000 --stream
    lerna run watch --parallel

Package filtering (`--scope` and `--ignore`) is still available when this
new flag is being used, and it is advised to narrow the scope of parallel
execution when you have more than a dozen packages or so (YMMV).
@evocateur evocateur merged commit 9e3dd48 into lerna:master May 1, 2017
@evocateur evocateur deleted the run-parallel branch May 1, 2017 16:23
@aeneasr
Copy link

aeneasr commented May 14, 2017

Awesome, exactly what I'm looking for! Would it be possible to release this change @evocateur ? :)

@evocateur
Copy link
Member Author

evocateur commented May 14, 2017 via email

@lock
Copy link

lock bot commented Dec 27, 2018

This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants