Jackson H
Jackson H

Reputation: 87

Why does pnpm seem to detect an extra workspace?

I have set up a new project with pnpm and I'm unsure about some of the output I'm seeing when I run recursive commands. Specifically, it seems like pnpm is detecting 3 workspaces when I expect there should only be 2.

The project structure looks like this:

| workbooks/
|-- workbook-one/
|---- package.json
|-- workbook-two/
|---- package.json
|
| package.json
| pnpm-workspace.yaml

The pnpm-workspace.yaml file is:

packages:
  - "workbooks/*"

I have a build command in the top-level package.json like so:

{
  ...
  "scripts": {
    "project:deploy": "pnpm -r --if-present --workspace-concurrency=1 project:deploy"
  }
  ...
}

Each of the two workspaces has a project:deploy script. However, when I run pnpm project:deploy I see this in the output:

> pnpm -r --if-present --workspace-concurrency=1 project:deploy

Scope: 2 of 3 workspace projects

Why is the scope "2 of 3", rather than "2 of 2"?

Upvotes: 5

Views: 972

Answers (1)

Eliav Louski
Eliav Louski

Reputation: 5274

usually the root directory is also included if is has package.json file. you can use pnpm list -r --depth=-1 command to list all workspaces to find out what is the extra workspace you are not expecting

Upvotes: 3

Related Questions