Skip to content

Commit 91adac6

Browse files
committed
docs(publish): mention publish: false for excluding workspace members
1 parent d0ef9c3 commit 91adac6

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

runtime/reference/cli/publish.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,25 @@ Example:
3636
Before you publish your package, you must create it in the registry by visiting
3737
[JSR - Publish a package](https://jsr.io/new).
3838

39+
## Excluding a workspace member
40+
41+
When run inside a [workspace](/runtime/fundamentals/workspaces/), `deno publish`
42+
tries to publish every member that has a `name` and `exports`, and errors if any
43+
of them is missing a `version`. To opt a member out — for example an internal
44+
helper package that only exists to host shared `tasks` — set `"publish": false`
45+
in that member's `deno.json`:
46+
47+
```jsonc title="internal-helpers/deno.json"
48+
{
49+
"name": "@scope/internal-helpers",
50+
"publish": false
51+
}
52+
```
53+
54+
The member stays part of the workspace but is skipped by `deno publish`. See
55+
[Excluding a workspace member from publish](/runtime/fundamentals/workspaces/#excluding-a-workspace-member-from-publish)
56+
for the full discussion.
57+
3958
## Examples
4059

4160
Publish your current workspace

0 commit comments

Comments
 (0)