Skip to content

Commit d0ef9c3

Browse files
committed
docs(workspaces): document publish: false to skip a workspace member
1 parent 930282d commit d0ef9c3

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

runtime/fundamentals/workspaces.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,35 @@ cd my-package
311311
deno publish
312312
```
313313

314+
#### Excluding a workspace member from publish
315+
316+
Workspaces often contain members that are not meant to be published — internal
317+
helpers, examples, or packages that only exist to host shared `tasks`. By
318+
default `deno publish` will try to publish every workspace member that has a
319+
`name` and `exports`, and will error if any of them is missing a `version`.
320+
321+
To opt a member out of `deno publish`, set `"publish": false` in that member's
322+
`deno.json`:
323+
324+
```jsonc title="internal-helpers/deno.json"
325+
{
326+
"name": "@scope/internal-helpers",
327+
"tasks": {
328+
"build": "deno run -A scripts/build.ts"
329+
},
330+
"publish": false
331+
}
332+
```
333+
334+
The member is still part of the workspace — its `tasks` run, its `imports` are
335+
resolved, and other members can depend on it — but `deno publish` skips it
336+
entirely and won't complain about a missing `version`.
337+
338+
This applies to `deno.json` members only. Workspace members defined solely by a
339+
`package.json` are npm packages and are never candidates for `deno publish`
340+
(which targets JSR), so no opt-out is needed for them. `package.json`'s
341+
`"private": true` field is not read by Deno.
342+
314343
#### Managing interdependent packages
315344

316345
When publishing packages from a workspace with interdependencies, use consistent
@@ -469,6 +498,7 @@ root and its members:
469498
| test.include ||| |
470499
| test.exclude ||| |
471500
| test.files | ⚠️ || Deprecated |
501+
| publish ||| Set to `false` to exclude a member from `deno publish`. See [Excluding a workspace member from publish](#excluding-a-workspace-member-from-publish). |
472502
| publish.include ||| |
473503
| publish.exclude ||| |
474504
| bench.include ||| |

0 commit comments

Comments
 (0)