Skip to content

Commit f92c34b

Browse files
committed
docs(site): suggest a starting config
1 parent 8edfa81 commit f92c34b

File tree

1 file changed

+58
-1
lines changed

1 file changed

+58
-1
lines changed

site/src/content/docs/guide/getting-started.mdx

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,64 @@ syncpack list --help
137137

138138
## Configuration
139139

140-
Create a `.syncpackrc` file in your repo root to customise behaviour. See [Configuration](CONFIG_SYNCPACKRC) for all options.
140+
Create a [.syncpackrc](CONFIG_SYNCPACKRC) file in the root of your repo to customise behaviour. One way to get started is to focus on production dependencies, then gradually broaden out as you feel comfortable. This is done using [`Version Groups`](CONFIG_VERSION_GROUPS).
141+
142+
```json
143+
{
144+
"versionGroups": [
145+
{
146+
"label": "Sync all production dependencies",
147+
"dependencyTypes": ["prod"]
148+
},
149+
{
150+
"label": "Ignore everything else",
151+
"isIgnored": true
152+
}
153+
]
154+
}
155+
```
156+
157+
Or you could focus on specific dependencies and fix those first:
158+
159+
```json
160+
{
161+
"versionGroups": [
162+
{
163+
"label": "Sync react dependencies only",
164+
"dependencies": ["react", "react-dom"],
165+
"dependencyTypes": ["prod"]
166+
},
167+
{
168+
"label": "Ignore everything else",
169+
"isIgnored": true
170+
}
171+
]
172+
}
173+
```
174+
175+
### `workspace:*` dependencies
176+
177+
This is a popular configuration which ensures that `workspace:*` is always used when you depend on a package which is developed in your monorepo.
178+
179+
```json
180+
{
181+
"versionGroups": [
182+
{
183+
"label": "Use `workspace:*` protocol for local packages",
184+
// for packages developed in your monorepo
185+
"dependencies": ["$LOCAL"],
186+
// when they are installed as prod or dev dependencies
187+
"dependencyTypes": ["dev", "prod"],
188+
// always use the workspace protocol to reference them
189+
"pinVersion": "workspace:*"
190+
},
191+
{
192+
"label": "Ignore everything else",
193+
"isIgnored": true
194+
}
195+
]
196+
}
197+
```
141198

142199
## Further reading
143200

0 commit comments

Comments
 (0)