Skip to content

Commit 02d3586

Browse files
committed
docs(site): improve command descriptions
1 parent c4c364b commit 02d3586

File tree

6 files changed

+45
-13
lines changed

6 files changed

+45
-13
lines changed

site/src/content/docs/command/fix.mdx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Badge } from "@astrojs/starlight/components";
66
import ConfigOption from "@partials/option/config.mdx";
77
import DependenciesOption from "@partials/option/dependencies.mdx";
88
import DependencyTypesOption from "@partials/option/dependency-types.mdx";
9+
import DryRunOption from "@partials/option/dry-run.mdx";
910
import HelpOption from "@partials/option/help.mdx";
1011
import LogLevelsOption from "@partials/option/log-levels.mdx";
1112
import NoAnsiOption from "@partials/option/no-ansi.mdx";
@@ -16,17 +17,21 @@ import SpecifierTypesOption from "@partials/option/specifier-types.mdx";
1617

1718
import QuoteFilters from "@partials/tips/quote-filters.mdx";
1819

19-
Fix every autofixable issue found by `syncpack lint`.
20+
Fix version mismatches in your monorepo. When the same dependency has different versions across packages, `fix` updates them to match your configuration rules. Use this to resolve issues reported by `lint`. Does not fix formatting—use `format` for that.
2021

2122
## Examples
2223

2324
```bash
24-
# Only fix issues in dependencies and devDependencies
25+
# Preview changes without modifying files
26+
syncpack fix --dry-run
27+
# Fix only dependencies and devDependencies (exclude peer, optional)
2528
syncpack fix --dependency-types prod,dev
26-
# Only fix inconsistencies with exact versions (eg "1.2.3")
29+
# Fix inconsistencies with exact versions only (eg "1.2.3", not "^1.2.3")
2730
syncpack fix --specifier-types exact
28-
# Only fix issues in "react" specifically
31+
# Fix issues in "react" across all packages
2932
syncpack fix --dependencies react
33+
# Fix scoped packages like @types/* but exclude others
34+
syncpack fix --dependencies '@types/**'
3035
# See more examples
3136
syncpack fix --help
3237
# See a short summary of options
@@ -49,6 +54,10 @@ syncpack fix -h
4954

5055
<DependencyTypesOption command="fix" />
5156

57+
### --dry-run
58+
59+
<DryRunOption command="fix" />
60+
5261
### --log-levels <Badge text="<comma-separated-log-level-names>" />
5362

5463
<LogLevelsOption command="fix" />

site/src/content/docs/command/format.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import NoAnsiOption from "@partials/option/no-ansi.mdx";
1212
import QuoteFilters from "@partials/tips/quote-filters.mdx";
1313
import SourceOption from "@partials/option/source.mdx";
1414

15-
Sort package.json fields into a predictable order and nested fields alphabetically.
15+
Format package.json files in your monorepo. Sorts fields into consistent order and alphabetises nested fields. Use this to maintain readable, diff-friendly package.json files. Does not change version numbers—use `fix` for that.
1616

1717
## Examples
1818

site/src/content/docs/command/json.mdx

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ import SpecifierTypesOption from "@partials/option/specifier-types.mdx";
1717

1818
import QuoteFilters from "@partials/tips/quote-filters.mdx";
1919

20-
Output the state of every instance of every dependency as a JSON object, one per line. This command is best used with tools like [`jq`](https://jqlang.org/) for filtering and processing.
21-
22-
## TypeScript
23-
24-
Each instance printed by `syncpack json` has the type [`JsonOutput`](https://github.com/JamieMason/syncpack/blob/main/npm/syncpack.ts).
20+
Export dependency data from your monorepo as JSON. Outputs one line per dependency instance with version, location, and status information. Use with tools like [`jq`](https://jqlang.org/) to analyse, filter, or pipe into other commands.
2521

2622
## Examples
2723

@@ -38,6 +34,33 @@ syncpack json --help
3834
syncpack json -h
3935
```
4036

37+
## TypeScript
38+
39+
Each instance printed by `syncpack json` has the type [`JsonOutput`](https://github.com/JamieMason/syncpack/blob/main/npm/syncpack.ts).
40+
41+
```ts
42+
/** Each Instance printed by `syncpack json` */
43+
export type JsonOutput = {
44+
dependency: string;
45+
dependencyGroup: string;
46+
dependencyType: DependencyType;
47+
package: string;
48+
property: ["dependencies"];
49+
strategy: CustomType.Any["strategy"];
50+
versionGroup: VersionGroupVariant;
51+
preferredSemverRange: SemverRange | null;
52+
statusCode: StatusCode;
53+
actual: {
54+
raw: string;
55+
type: SpecifierType;
56+
};
57+
expected: {
58+
raw: string;
59+
type: SpecifierType;
60+
} | null;
61+
};
62+
```
63+
4164
## Options
4265

4366
<QuoteFilters />

site/src/content/docs/command/lint.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import SortOption from "@partials/option/sort.mdx";
1515
import SourceOption from "@partials/option/source.mdx";
1616
import SpecifierTypesOption from "@partials/option/specifier-types.mdx";
1717

18-
Lint all versions and ranges and exit with 0 or 1 based on whether all files match your Syncpack configuration file.
18+
Check for version mismatches in your monorepo. Reports dependencies that don't match your configuration rules and exits with status code 1 if issues are found. Use `fix` to resolve reported issues. Does not check formatting—use `format --check` for that.
1919

2020
## Examples
2121

site/src/content/docs/command/list.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import SortOption from "@partials/option/sort.mdx";
1515
import SourceOption from "@partials/option/source.mdx";
1616
import SpecifierTypesOption from "@partials/option/specifier-types.mdx";
1717

18-
Query and inspect all dependencies in your project, both valid and invalid.
18+
List all dependencies in your monorepo with their versions and locations. Shows which dependencies have mismatches, are ignored, or follow your rules. Use this to explore what's installed before running `lint` or `fix`.
1919

2020
## Examples
2121

site/src/content/docs/command/update.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import SourceOption from "@partials/option/source.mdx";
1818
import SpecifierTypesOption from "@partials/option/specifier-types.mdx";
1919
import TargetOption from "@partials/option/target.mdx";
2020

21-
Update to the latest versions on the npm registry.
21+
Update dependencies in your monorepo to newer versions from the npm registry. Checks for available updates and modifies package.json files to use them. Unlike `fix` which synchronises versions across packages, `update` fetches the latest published versions. Use `--target` to control update strategy (latest, minor, patch).
2222

2323
## Examples
2424

0 commit comments

Comments
 (0)