# Workspaces and monorepos

## Minimal structure

```json title="deno.json"
{
  "workspace": ["./apps/api", "./packages/core"],
  "tasks": {
    "check": "deno task --recursive check"
  }
}
```

Members may have their own `deno.json` and tasks. A workspace shares the lockfile and root configuration while preserving package boundaries.

```text
repo/
├── deno.json
├── deno.lock
├── apps/api/deno.json
└── packages/core/deno.json
```

## Design principles

- Root tasks orchestrate; member tasks verify each package.
- Resolve internal packages through the workspace instead of publishing intermediary versions.
- Public packages declare `exports`, licensing, and publish contents.
- Do not put broad permissions in the root when most members do not need them.

## Verify

```bash
deno task --recursive check
deno test
```

Running `deno test` at the workspace root discovers member tests; `deno task --recursive` invokes matching member tasks. Filtering and npm workspace interop evolve, so run `deno help task` and verify the current guide for complex graphs.

Official reference: [Workspaces](https://docs.deno.com/runtime/fundamentals/workspaces/).
