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

workspace option is not actually working when using PNPM #123

Open
AndreaPontrandolfo opened this issue Mar 24, 2024 · 3 comments · May be fixed by #130
Open

workspace option is not actually working when using PNPM #123

AndreaPontrandolfo opened this issue Mar 24, 2024 · 3 comments · May be fixed by #130

Comments

@AndreaPontrandolfo
Copy link

Environment

nypm: v0.3.8
node: v20.10.0
pnpm: v8.14.0

Reproduction

placeholder

Describe the bug

Pnpm requires --filter arg to install a dependency into a specified workspace.
I saw in the source code that you use the -F argument, which is correct.
However, it doesn't seem to be working, because the passed arg to execa is actually --dir, which is incorrect (pnpm doesn't understand it).

Additional context

No response

Logs

~ executeCommand ~ args: [
  'add',
  '--dir',
  'cli-playground',
  '-D',
  'eslint@latest',
  'eslint-define-config@latest',
  'eslint-config-sheriff@latest'
]
~ executeCommand ~ command: pnpm
~ executeCommand ~ execaArgs: [
  'corepack',
  [
    'pnpm',
    'add',
    '--dir',
    'cli-playground',
    '-D',
    'eslint@latest',
    'eslint-define-config@latest',
    'eslint-config-sheriff@latest'
  ]
]
@AndreaPontrandolfo
Copy link
Author

I'll try to come up with a repro ASAP.

@AndreaPontrandolfo
Copy link
Author

Is the repro needed? Can you provide guidance on that?

@AndreaPontrandolfo AndreaPontrandolfo changed the title workspace option is not actually working when usign PNPM workspace option is not actually working when using PNPM Mar 26, 2024
@AndreaPontrandolfo
Copy link
Author

So, i analyzed the situation again, and actually i need to rectify.
The problem is exactly on this line return workspacePkg ? ["--dir", workspacePkg] : ["--workspace-root"];.
Yes, PNPM understand the "dir" argument, but it's actually incorrect for reaching a workspace package. The right argument is filter.
I'm gonna patch-package this for my own project, for now.
Do you plan to fix this? I don't think this is the intended behaviour.

@DamianGlowala DamianGlowala linked a pull request May 15, 2024 that will close this issue
8 tasks
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

Successfully merging a pull request may close this issue.

1 participant