6.0.0-alpha.2 • Published 3 years ago

@lerna/run v6.0.0-alpha.2

Weekly downloads
1,065,937
License
MIT
Repository
github
Last release
3 years ago

@lerna/run

Run an npm script in each package that contains that script

Install lerna for access to the lerna CLI.

Usage

$ lerna run <script> -- [..args] # runs npm run my-script in all packages that have it
$ lerna run test
$ lerna run build

# watch all packages and transpile on change, streaming prefixed output
$ lerna run --parallel watch

Run an npm script in each package that contains that script. A double-dash (--) is necessary to pass dashed arguments to the script execution.

Options

lerna run accepts all filter flags.

$ lerna run --scope my-component test

--npm-client <client>

Must be an executable that knows how to run npm lifecycle scripts. The default --npm-client is npm.

$ lerna run build --npm-client=yarn

May also be configured in lerna.json:

{
  "command": {
    "run": {
      "npmClient": "yarn"
    }
  }
}

--stream

Stream output from child processes immediately, prefixed with the originating package name. This allows output from different packages to be interleaved.

$ lerna run watch --stream

--parallel

Similar to --stream, but completely disregards concurrency and topological sorting, running a given command or script immediately in all matching packages with prefixed streaming output. This is the preferred flag for long-running processes such as npm run watch run over many packages.

$ lerna run watch --parallel

Note: It is advised to constrain the scope of this command when using the --parallel flag, as spawning dozens of subprocesses may be harmful to your shell's equanimity (or maximum file descriptor limit, for example). YMMV

--no-bail

# Run an npm script in all packages that contain it, ignoring non-zero (error) exit codes
$ lerna run --no-bail test

By default, lerna run will exit with an error if any script run returns a non-zero exit code. Pass --no-bail to disable this behavior, running the script in all packages that contain it regardless of exit code.

--no-prefix

Disable package name prefixing when output is streaming (--stream or --parallel). This option can be useful when piping results to other processes, such as editor plugins.

--profile

Profiles the script executions and produces a performance profile which can be analyzed using DevTools in a Chromium-based browser (direct url: devtools://devtools/bundled/devtools_app.html). The profile shows a timeline of the script executions where each execution is assigned to an open slot. The number of slots is determined by the --concurrency option and the number of open slots is determined by --concurrency minus the number of ongoing operations. The end result is a visualization of the parallel execution of your scripts.

The default location of the performance profile output is at the root of your project.

$ lerna run build --profile

Note: Lerna will only profile when topological sorting is enabled (i.e. without --parallel and --no-sort).

--profile-location <location>

You can provide a custom location for the performance profile output. The path provided will be resolved relative to the current working directory.

$ lerna run build --profile --profile-location=logs/profile/

useNx=false

By setting useNx to false you can use the legacy task running implementations in lerna (p-map and p-queue) instead of using the default modern task runner implementation powered by Nx.

6.6.2

3 years ago

6.6.1

3 years ago

6.6.0

3 years ago

6.5.0

3 years ago

6.5.0-alpha.1

3 years ago

6.5.0-alpha.0

3 years ago

6.5.0-alpha.2

3 years ago

6.5.1

3 years ago

6.3.1-beta.8

3 years ago

6.3.1-beta.6

3 years ago

6.3.1-beta.5

3 years ago

6.3.1-beta.4

3 years ago

6.1.0

3 years ago

6.3.1-beta.3

3 years ago

6.3.1-beta.2

3 years ago

6.3.1-beta.1

3 years ago

6.3.1-beta.0

3 years ago

6.4.2-beta.0

3 years ago

6.2.0

3 years ago

6.3.0

3 years ago

6.0.3

3 years ago

6.4.1

3 years ago

6.4.0

3 years ago

6.0.0-alpha.0

3 years ago

6.0.0-alpha.1

3 years ago

6.0.0-alpha.2

3 years ago

5.6.2

3 years ago

5.6.1

3 years ago

5.6.0

3 years ago

6.0.1

3 years ago

6.0.0

3 years ago

6.0.2

3 years ago

5.5.4

3 years ago

5.5.3

3 years ago

5.5.1

3 years ago

5.5.0

3 years ago

5.5.2

3 years ago

5.1.5

4 years ago

5.1.4

4 years ago

5.1.3

4 years ago

5.3.0

4 years ago

5.1.2

4 years ago

5.4.3

3 years ago

5.4.2

3 years ago

5.4.1

3 years ago

5.4.0

3 years ago

5.2.0

4 years ago

5.1.8

4 years ago

5.1.7

4 years ago

5.1.6

4 years ago

5.1.1

4 years ago

5.1.0

4 years ago

5.0.0-alpha.2

4 years ago

5.0.0-alpha.1

4 years ago

5.0.0-alpha.0

4 years ago

5.0.0

4 years ago

5.1.0-alpha.0

4 years ago

4.0.0

5 years ago

3.21.0

6 years ago

3.20.0

6 years ago

3.18.5

6 years ago

3.18.4

6 years ago

3.18.0

6 years ago

3.16.5

6 years ago

3.16.0

7 years ago

3.15.0

7 years ago

3.14.2

7 years ago

3.14.0

7 years ago

3.13.3

7 years ago

3.13.1

7 years ago

3.13.0

7 years ago

3.12.1

7 years ago

3.12.0

7 years ago

3.11.0

7 years ago

3.10.6

7 years ago

3.10.1

7 years ago

3.10.0

7 years ago

3.9.0

7 years ago

3.8.5

7 years ago

3.8.1

7 years ago

3.7.2

7 years ago

3.7.1

7 years ago

3.7.0

7 years ago

3.6.0

7 years ago

3.5.0

7 years ago

3.3.2

7 years ago

3.3.0

7 years ago

3.1.3

7 years ago

3.1.2

7 years ago

3.1.0

7 years ago

3.0.6

7 years ago

3.0.5

7 years ago

3.0.2

7 years ago

3.0.0

7 years ago

3.0.0-rc.0

8 years ago

3.0.0-beta.21

8 years ago

3.0.0-beta.20

8 years ago

3.0.0-beta.19

8 years ago

3.0.0-beta.18

8 years ago

3.0.0-beta.17

8 years ago

3.0.0-beta.15

8 years ago

3.0.0-beta.14

8 years ago

3.0.0-beta.13

8 years ago

3.0.0-beta.12

8 years ago

3.0.0-beta.11

8 years ago

3.0.0-beta.10

8 years ago

3.0.0-beta.9

8 years ago

3.0.0-beta.7

8 years ago

3.0.0-beta.4

8 years ago

3.0.0-beta.3

8 years ago

3.0.0-beta.2

8 years ago

3.0.0-beta.1

8 years ago

3.0.0-beta.0

8 years ago