Skip to content

Commit 5698590

Browse files
IldySilvasigurdmparlough
authored
Glob support in workspaces (#7062)
Resolves #6927 --------- Co-authored-by: Sigurd Meldgaard <sigurdm@google.com> Co-authored-by: Parker Lougheed <parlough@gmail.com>
1 parent 91de066 commit 5698590

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

src/content/tools/pub/workspaces.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,37 @@ To use pub workspaces, all your workspace packages (but not your dependencies)
115115
must have an SDK version constraint of `^3.6.0` or higher.
116116
:::
117117

118-
<a name='stray-files'></a>
118+
## Glob pattern support
119+
120+
:::version-note
121+
Glob pattern support requires Dart 3.11 or later.
122+
If you use an earlier version, use explicit paths instead.
123+
:::
124+
125+
The `workspace` entry supports glob patterns to
126+
automatically include packages:
127+
128+
```yaml
129+
workspace:
130+
- packages/*
131+
```
132+
133+
This includes all subdirectories in
134+
`packages/` that contain a `pubspec.yaml` file,
135+
eliminating the need to manually list each package.
136+
This is especially useful for large or frequently growing monorepos.
137+
138+
Instead of:
139+
140+
```yaml
141+
workspace:
142+
- packages/shared
143+
- packages/client_package
144+
- packages/server_package
145+
```
146+
147+
You can use a glob pattern that automatically picks up new packages.
148+
119149
## Stray files
120150

121151
When you migrate an existing monorepo to use Pub workspaces, there will

0 commit comments

Comments
 (0)