You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: runtime/fundamentals/workspaces.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -311,6 +311,35 @@ cd my-package
311
311
deno publish
312
312
```
313
313
314
+
#### Excluding a workspace member from publish
315
+
316
+
Workspaces often contain members that are not meant to be published, such as
317
+
internal helpers, examples, or packages that only exist to host shared `tasks`.
318
+
By 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
+
314
343
#### Managing interdependent packages
315
344
316
345
When publishing packages from a workspace with interdependencies, use consistent
@@ -469,6 +498,7 @@ root and its members:
469
498
| test.include | ✅ | ✅ ||
470
499
| test.exclude | ✅ | ✅ ||
471
500
| 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). |
0 commit comments