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: site/src/content/docs/guide/getting-started.mdx
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,14 +23,14 @@ Some of the things it can do are:
23
23
24
24
The fastest way to try syncpack is via [npx](HREF_NPX).
25
25
26
-
Run this command from the root directory of a monorepo and it will list every dependency installed under a [`dependencies`](HREF_DEPENDENCIES) property of a package.json file in the project.
27
-
28
-
Syncpack uses your package manager's workspace configuration to locate your package.json files, or you can target specific files using the [`source`](CONFIG_SOURCE) configuration or `--source` option.
29
-
30
26
```bash
31
27
npx syncpack@alpha list --dependency-types prod
32
28
```
33
29
30
+
Run this command from the root directory of a monorepo and it will list every dependency installed under a [`dependencies`](HREF_DEPENDENCIES) property of a package.json file in the project.
31
+
32
+
Syncpack uses your package manager's workspace configuration to locate your package.json files, or you can target specific files using the [`source`](CONFIG_SOURCE) configuration or `--source` option.
33
+
34
34
For any given command, browse a summary of its options with `-h`
35
35
36
36
```bash
@@ -60,24 +60,16 @@ npm exec syncpack -- list
60
60
## Introduction
61
61
62
62
:::note
63
-
64
-
For the rest of this guide I will run syncpack as if it was installed globally
65
-
66
-
```
67
-
npm install -g syncpack@alpha
68
-
```
69
-
63
+
The examples below assume syncpack is installed globally. Replace `syncpack` with `npx syncpack@alpha` if you haven't installed it or `npm exec syncpack` if you have installed it locally.
70
64
:::
71
65
72
-
We're going to run a few commands to better understand not only syncpack, but our own project as well. Monorepos can be _huge_, it's not easy to drill down and see all of the many dependencies we might be using, and harder still to know where any inconsistencies are.
73
-
74
66
Let's see which dependencies we use the most.
75
67
76
68
```bash
77
69
syncpack list --dependency-types prod --sort count
78
70
```
79
71
80
-
Some of our dependencies might have errors next to them, if our Terminal supports it we can command + click each error to view its documentation, or each filename to open the file.
72
+
Some of our dependencies might have [status codes](REF_STATUS_CODES) next to them, if our Terminal supports it we can command + click each error to view its documentation, or each filename to open the file.
81
73
82
74
To focus only on dependencies with errors, use `lint` instead of `list`.
83
75
@@ -91,6 +83,10 @@ If the suggested changes look ok, we can autofix them.
91
83
syncpack fix --dependency-types prod
92
84
```
93
85
86
+
:::tip
87
+
After running `fix` or `update`, run your package manager (`npm install`, `pnpm install`, etc.) to update your lockfile.
88
+
:::
89
+
94
90
Or we could choose to only autofix one of them, for this example I've chosen `react`.
95
91
96
92
```bash
@@ -133,12 +129,16 @@ And by removing the `--check` option we can write the newer versions to our file
133
129
syncpack update --dependencies react
134
130
```
135
131
136
-
I'm hoping by this point that you're starting to develop an intuition for how syncpack works and how its options can be combined. Take a look at the `--help`documentation of each command to see examples and what options are available.
132
+
Each command supports `--help`for examples and available options.
137
133
138
134
```bash
139
135
syncpack list --help
140
136
```
141
137
138
+
## Configuration
139
+
140
+
Create a `.syncpackrc` file in your repo root to customise behaviour. See [Configuration](CONFIG_SYNCPACKRC) for all options.
141
+
142
142
## Further reading
143
143
144
144
1. Read the [`Peer Dependencies`](GUIDE_PEER_DEPENDENCIES) guide if your projects uses them, it will be important to understand them from a version consistency point of view.
0 commit comments