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

pnpm7 filter by directory issue #3480

Closed
AntoineKM opened this issue Jan 26, 2023 · 3 comments
Closed

pnpm7 filter by directory issue #3480

AntoineKM opened this issue Jan 26, 2023 · 3 comments
Labels
area: docs Improvements or additions to documentation

Comments

@AntoineKM
Copy link
Contributor

AntoineKM commented Jan 26, 2023

Same as #1920, but with pnpm 7

ok looks like with yarn3 it needs single quotation marks in when defining script --filter='./apps/*'

Originally posted by @gbkwiatt in #1920 (comment)

AntoineKM added a commit to tonightpass/kitchn that referenced this issue Jan 26, 2023
@chris-olszewski
Copy link
Member

@AntoineKM Does the quoting the filter not work here? Are there docs that need updating?

If you could provide the error message you're getting that would be helpful

@AntoineKM
Copy link
Contributor Author

AntoineKM commented Jan 30, 2023

Hi @chris-olszewski, thanks for the answer, I will give you more details but yes I think the doc needs a little update!

I just followed the following instructions on the kitchen repo (https://github.com/tonightpass/kitchen):
https://turbo.build/repo/docs/core-concepts/monorepos/filtering#filter-by-directory
image

First try without the quotes (fail):
Input:
turbo run build --filter=./examples/*

Output:

...\tonightpass\kitchen> pnpm build:examples

> @tonightpass/root@ build:examples ...\tonightpass\kitchen
> turbo run build --filter=./examples/*

No matches found: "--filter=./examples/*"
 ELIFECYCLE  Command failed with exit code 1.

Second try with quotes (work):
Input:
turbo run build --filter='./examples/*'

Output:

...\tonightpass\kitchen> pnpm build:examples

> @tonightpass/root@ build:examples ...\tonightpass\kitchen
> turbo run build --filter='./examples/*'

• Packages in scope: expo-typescript, next-typescript
• Running build in 2 packages
• Remote caching disabled

...classic logs...

 Tasks:    2 successful, 2 total
Cached:    0 cached, 2 total
  Time:    1m45.257s 

⠏ ...writing to cache...  [3s]

but before using pnpm on kitchen I was using yarn and I think this command was working without quotes (to be checked by your side, and thanks again for your attention on this issue)

@chris-olszewski chris-olszewski added area: docs Improvements or additions to documentation and removed needs: author input labels Jan 31, 2023
@chris-olszewski
Copy link
Member

Thanks for reporting this. Did a quick check and this is pnpm intercepting the --filter argument before it gets sent to us. I'll update the docs to quote the filter to avoid future confusion.

chris-olszewski added a commit that referenced this issue Feb 1, 2023
As reported in #3480 pnpm seems to intercept filter syntax before it
reaches turbo if a package script uses `--filter=./dir/*` without
quotes.

Since quotes are also required to use a directory with a glob via ZSH it
seems to make sense to add them to our docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: docs Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants