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.

lerna run --scope ignored if pass paramaters to the underlying script

See original GitHub issue

If i call my npm script (using lerna run) without any args and scoped (using --scope ) then the scope is successfully applied

lerna run --scope @my/package  publish 
# lerna notice filter including "@my/package"
# lerna info filter [ '@my/package' ]
# lerna info Executing command in 1 package: "yarn run package"

if i call my npm script (using lerna run) with args and scoped (using --scope ) the scope is ignored and runs for all packages with the publish command

lerna run --scope @my/package  publish -- -- --stage dev 
# lerna info Executing command in 6 packages: "yarn run package --stage dev"

Expected Behavior

Scope should still be applied

Current Behavior

Scope is not applied

Context

Paramaters are provided by my CI depending on environment i want to publish for in this example, so i need to be able to pass arguments to the script, which i can but i also need the scope to still be applied and it is not.

Your Environment

Executable Version
lerna --version 3.2.0
npm --version 6.13.4
yarn --version 1.18.0
node --version 12.14.1
OS Version
NAME VERSION

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:6

github_iconTop GitHub Comments

2reactions
s1mrankaurcommented, Mar 16, 2021

Any update on this?

2reactions
ed-sparkescommented, Jun 22, 2020

any thoughts on this greatly appreciated

Read more comments on GitHub >

github_iconTop Results From Across the Web

@lerna/run | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
@lerna/run - npm
Run an npm script in each package that contains that script. A double-dash ( -- ) is necessary to pass dashed arguments to...
Read more >
Untitled
When you run `lerna publish`, if a module has been updated since the last time ... `lerna bootstrap` respects the `--ignore`, `--ignore-scripts`, `--scope` ......
Read more >
Project Configuration - Nx
Projects can be configured in package.json (if you use npm scripts and not Nx ... the actual command here is arbitrary "ignored": "exit...
Read more >
Managing multiples projects with Lerna and Yarn Workspaces
The second, lerna exec <command> , will execute the command (not script) in all the packages. This is useful if you want to...
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