microsoft / microsoft/lage

When passing args to a script, when using yarn, extra "--" argument is added

Open
#920 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
816
Forks
88
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

Unlike with npm, when using yarn to run scripts, it is not necessary to pass -- to separate arguments to the script from the arguments to yarn itself. When doing so, the -- is passed through to the script unchanged. This can cause an issue if the script itself is not expecting to receive this argument.

Note that pnpm also does not require the -- so it appears that npm is currently a special case in this regard.

To Reproduce

Steps to reproduce the behavior:

  1. Create a script in package.json that does something with its arguments, e.g. "test": "echo args:"
  2. Run that script via lage, with arguments, using yarn as the script runner
  3. Notice whether -- is provided as an argument to the script

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the behavior with a package.json script that inspects its arguments, invoking it through lage with yarn as the script runner. Compare the arguments received through yarn with npm and pnpm; done means the extra "--" is no longer passed to the script when it is used only to separate runner arguments.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.