Skip to content

Commit 980d6ef

Browse files
committed
chore(docs): update readme
1 parent 6776a78 commit 980d6ef

1 file changed

Lines changed: 71 additions & 24 deletions

File tree

README.md

Lines changed: 71 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# syncpack
22

33
<p align="center">
4-
<img src="https://jamiemason.github.io/syncpack/logo.svg" width="200" height="179" alt="">
4+
<img src="https://jamiemason.github.io/syncpack/logo.svg" width="134" height="120" alt="">
55
<br>Consistent dependency versions in large JavaScript Monorepos.
66
<br><a href="https://jamiemason.github.io/syncpack">https://jamiemason.github.io/syncpack</a>
77
</p>
@@ -14,41 +14,88 @@ npm install --save-dev syncpack
1414

1515
## Commands
1616

17-
### [fix-mismatches](https://jamiemason.github.io/syncpack/command/fix-mismatches)
17+
> All command line options can be combined to target packages and dependencies in multiple ways.
1818
19-
Ensure that multiple packages requiring the same dependency define the same version, so that every package requires eg. `react@16.4.2`, instead of a combination of `react@16.4.2`, `react@0.15.9`, and `react@16.0.0`.
20-
21-
### [format](https://jamiemason.github.io/syncpack/command/format)
22-
23-
Organise package.json files according to a conventional format, where fields appear in a predictable order and nested fields are ordered alphabetically. Shorthand properties are used where available, such as the `"repository"` and `"bugs"` fields.
19+
### [lint](https://jamiemason.github.io/syncpack/command/lint) and [fix](https://jamiemason.github.io/syncpack/command/fix)
2420

25-
### [lint](https://jamiemason.github.io/syncpack/command/lint)
26-
27-
Lint all versions and ranges and exit with 0 or 1 based on whether all files match your Syncpack configuration file.
28-
29-
### [lint-semver-ranges](https://jamiemason.github.io/syncpack/command/lint-semver-ranges)
30-
31-
Check whether dependency versions used within "dependencies", "devDependencies", etc follow a consistent format.
21+
Ensure that multiple packages requiring the same dependency define the same version, so that every package requires eg. `react@16.4.2`, instead of a combination of `react@16.4.2`, `react@0.15.9`, and `react@16.0.0`.
3222

33-
### [list](https://jamiemason.github.io/syncpack/command/list)
23+
#### Examples
3424

35-
List all dependencies required by your packages.
25+
```bash
26+
# Find every issue in "dependencies" or "devDependencies"
27+
syncpack lint --dependency-types prod,dev
28+
# Look for issues in dependencies containing "react" in the name
29+
syncpack lint --dependencies '**react**'
30+
# Autofix the above issues
31+
syncpack fix --dependencies '**react**'
32+
# Find issues everywhere except "peerDependencies"
33+
syncpack lint --dependency-types '!peer'
34+
# Only look for issues where an exact version is used
35+
syncpack lint --specifier-types exact
36+
# Only look for issues where an exact version is specified
37+
syncpack lint --specifier-types exact
38+
# Sort dependencies by how many times they are used
39+
syncpack lint --sort count
40+
# Show a lot more detail about the issues
41+
syncpack lint --show hints,ignored,instances,statuses
42+
# See more examples
43+
syncpack lint --help
44+
syncpack fix --help
45+
# See a short summary of options
46+
syncpack lint -h
47+
syncpack fix -h
48+
```
3649

37-
### [list-mismatches](https://jamiemason.github.io/syncpack/command/list-mismatches)
50+
### [update](https://jamiemason.github.io/syncpack/command/update)
3851

39-
List dependencies which are required by multiple packages, where the version is not the same across every package.
52+
Update packages to the latest versions from the npm registry, wherever they are in your monorepo.<br/>Semver range preferences are preserved when updating.
4053

41-
### [prompt](https://jamiemason.github.io/syncpack/command/prompt)
54+
#### Examples
4255

43-
Displays a series of prompts to fix mismatches which syncpack cannot fix automatically.
56+
```bash
57+
# Accept any update in latest (x.x.x)
58+
syncpack update --target latest
59+
# Only update minor versions (1.x.x)
60+
syncpack update --target minor
61+
# Only update patch versions (1.2.x)
62+
syncpack update --target patch
63+
# Check for outdated dependencies in one package
64+
syncpack update --check --source 'packages/pingu/package.json'
65+
# Update dependencies and devDependencies in the whole monorepo
66+
syncpack update --dependency-types dev,prod
67+
# Only update dependencies with a semver range specifier (^, ~, etc.)
68+
syncpack update --specifier-types range
69+
# Update dependencies where name exactly matches 'react'
70+
syncpack update --dependencies 'react'
71+
# Update dependencies where name contains 'react'
72+
syncpack update --dependencies '**react**'
73+
# Update dependencies with the '@aws-sdk' scope
74+
syncpack update --dependencies '@aws-sdk/**'
75+
# See more examples
76+
syncpack update --help
77+
# See a short summary of options
78+
syncpack update -h
79+
```
4480

45-
### [set-semver-ranges](https://jamiemason.github.io/syncpack/command/set-semver-ranges)
81+
### [format](https://jamiemason.github.io/syncpack/command/format)
4682

47-
Ensure dependency versions used within `"dependencies"`, `"devDependencies"` etc follow a consistent format.
83+
Organise package.json files according to a conventional format, where fields appear in a predictable order and nested fields are ordered alphabetically. Shorthand properties are used where available, such as the `"repository"` and `"bugs"` fields.
4884

49-
### [update](https://jamiemason.github.io/syncpack/command/update)
85+
#### Examples
5086

51-
Interactively update packages to the latest versions from the npm registry, wherever they are in your monorepo. You can update every dependency, just dev/peer/prod dependencies, just packages which match a name filter, and more.
87+
```bash
88+
# Fix every formatting issue in the monorepo
89+
syncpack format
90+
# List all formatting issues in the monorepo
91+
syncpack format --check
92+
# Check the formatting of one package
93+
syncpack format --check --source 'packages/pingu/package.json'
94+
# See more examples
95+
syncpack format --help
96+
# See a short summary of options
97+
syncpack format -h
98+
```
5299

53100
## Badges
54101

0 commit comments

Comments
 (0)