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

Allow to use --parallel without monorepo (in a single project) #6692

Closed
1 task
ai opened this issue Jun 20, 2023 · 2 comments · Fixed by #6785
Closed
1 task

Allow to use --parallel without monorepo (in a single project) #6692

ai opened this issue Jun 20, 2023 · 2 comments · Fixed by #6785

Comments

@ai
Copy link
Contributor

ai commented Jun 20, 2023

Describe the user story

I found pnpm as a pretty powerful task runner with --parallel task execution.

But I found that I can use it only in monorepo with multiple projects. If I have a simple project, I will get:

{
  "private": true,
  "scripts": {
    "build": "vite build -m production",
    "test:types": "tsc --noEmit && eslint . && stylelint **/*.css",
    "test:js": "eslint .",
    "test:css": "stylelint **/*.css",
    "test:audit": "pnpm audit --prod --audit-level high",
    "test:build": "pnpm build && size-limit",
    "test": "pnpm run --parallel /^test:/"
  }
}
❯ pnpm test

> oklch-picker@ test /home/ai/Dev/oklch-picker
> pnpm run --parallel /^test:/

No projects matched the filters in "/home/ai/Dev/oklch-picker"

Describe the solution you'd like

Allow to use --parallel if a user pass a RegExp for tasks,

Describe the drawbacks of your solution

Don’t see any

Describe alternatives you've considered

N/A

@zkochan
Copy link
Member

zkochan commented Jul 8, 2023

Why do you need pnpm run --parallel /^test:/? pnpm run /^test:/ is already running all scripts that match the regex in parallel.

You may run multiple scripts at the same time by using a regex instead of the script name.

source: https://pnpm.io/cli/run#running-multiple-scripts

The --parallel flag is needed if you run scripts in many projects of the workspace and you don't care in what order they will run (they still actually run in parallel, even without the option, but dependency projects run before dependent projects). In case of scripts all scripts are equal, they don't depend on each other, so all scripts start immediately.

@ai
Copy link
Contributor Author

ai commented Jul 8, 2023

pnpm run /^test:/ is already running all scripts that match the regex in parallel.

  1. If it already does, it's great. I thought that I should enable it somehow. But let’s avoid the error, since other users can think that like me that you need a special argument.
  2. I also need that pnpm -r test UI which print output of every script in separated “window”.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants