> ## Documentation Index
> Fetch the complete documentation index at: https://docs.commonality.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Workspaces

Commonality will automatically infer the directories in which to search for packages based on your package manager's workspaces configuration.

<Info>
  Commonality supports all glob expressions that are supported by
  [micromatch](https://github.com/micromatch/micromatch).
</Info>

## Automatic configuration

### npm, yarn, and bun

For these package managers, Commonality will read the [workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces) property in the `package.json` at the root of your project.

```json package.json theme={null}
{
  "workspaces": ["apps/*", "packages/**", "!**/dist/**"]
}
```

### pnpm

For pnpm, Commonality will read the [packages](https://pnpm.io/pnpm-workspace_yaml) property in the `pnpm-workspace.yaml` file at the root of your project.

```yaml pnpm-workspace.yaml theme={null}
packages:
  - 'apps/*'
  - 'packages/**'
  - '!**/dist/**'
```

## Manual configuration

Workspaces can also be set manually in the [project configuration](http://localhost:3000/reference/project-configuration#workspaces) file.

This property can be helpful in integrated monorepos where setting workspaces in your package manager's configuration would cause unintended side-effects.

<Info>
  Setting this property will override the workspaces inferred from your package
  manager.
</Info>

```json .commonality/config.json theme={null}
{
  "workspaces": ["apps/*", "packages/**", "!**/dist/**"]
}
```
