Skip to content

Commit d6c9ac5

Browse files
committed
docs(site): document new severity config
1 parent d589d3e commit d6c9ac5

76 files changed

Lines changed: 787 additions & 65 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

site/astro.config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,13 @@ export default defineConfig({
117117
'config/max-concurrent-requests',
118118
'config/minimum-release-age',
119119
{ label: 'semverGroups', link: '/semver-groups/' },
120+
'config/severity',
120121
'config/sort-az',
121122
'config/sort-exports',
122123
'config/sort-first',
123124
'config/sort-packages',
124125
'config/source',
126+
'config/source-mode',
125127
'config/strict',
126128
{ label: 'updateGroups', link: '/update-groups/', badge: 'New' },
127129
{ label: 'versionGroups', link: '/version-groups/' },

site/remark-plugins/link-aliases.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ export function linkAliases() {
2121
CONFIG_SORT_FIRST: '/config/sort-first/',
2222
CONFIG_SORT_PACKAGES: '/config/sort-packages/',
2323
CONFIG_SOURCE: '/config/source/',
24+
CONFIG_SOURCE_MODE: '/config/source-mode/',
25+
CONFIG_STRICT: '/config/strict/',
2426
CONFIG_SYNCPACKRC: '/config/syncpackrc/',
2527
CONFIG_UPDATE_GROUPS: '/update-groups/',
2628
CONFIG_VERSION_GROUPS: '/version-groups/',
@@ -29,8 +31,15 @@ export function linkAliases() {
2931

3032
REF_DEPENDENCY_TYPES: '/dependency-types/',
3133
REF_GLOSSARY: '/glossary/',
34+
REF_SEVERITY: '/config/severity/',
3235
REF_SPECIFIER_TYPES: '/specifier-types/',
36+
3337
REF_STATUS_CODES: '/status/',
38+
REF_STATUS_CODES_VALID: '/status/#valid',
39+
REF_STATUS_CODES_FIXABLE: '/status/#fixable',
40+
REF_STATUS_CODES_SUSPECT: '/status/#suspect',
41+
REF_STATUS_CODES_UNFIXABLE: '/status/#unfixable',
42+
REF_STATUS_CODES_CONFLICT: '/status/#conflict',
3443

3544
TERM_CUSTOM_TYPE: '/glossary/#custom-type',
3645
TERM_DEPENDENCY: '/glossary/#dependency',
@@ -42,6 +51,7 @@ export function linkAliases() {
4251
TERM_SEMVER: '/glossary/#semver',
4352
TERM_SEMVER_GROUP: '/glossary/#semver-group',
4453
TERM_SEMVER_RANGE: '/glossary/#semver-range',
54+
TERM_SEVERITY: '/glossary/#severity',
4555
TERM_SPECIFIER: '/glossary/#specifier',
4656
TERM_SPECIFIER_TYPE: '/glossary/#specifier-type',
4757
TERM_STATUS_CODE: '/glossary/#status-code',

site/src/_partials/how-packages-are-resolved.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ Syncpack will look in the following places for [glob](HREF_GLOB) patterns matchi
99

1010
### Adding sources without replacing discovery
1111

12-
By default, `--source` and `source` *replace* the discovered patterns. To keep workspace discovery and add extra patterns on top, set [`sourceMode`](CONFIG_SOURCE) to `"extend"` (or pass `--source-mode extend`). Discovered patterns come first; your patterns are appended last, so gitignore-style negations such as `!apps/legacy` can exclude discovered entries.
12+
By default, `--source` and `source` replace the discovered patterns. To keep workspace discovery and add extra patterns on top, set [`sourceMode`](CONFIG_SOURCE_MODE) to `"extend"` (or pass `--source-mode extend`). Discovered patterns come first; your patterns are appended last, so gitignore-style negations such as `!apps/legacy` can exclude discovered entries.

site/src/_partials/option/interactive.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ Pick which updates to apply through an interactive prompt instead of writing eve
44

55
Keys:
66

7-
- `` `` navigate
8-
- `space` toggle the highlighted row
9-
- `a` toggle all rows
10-
- `enter` confirm and write selected updates
11-
- `esc` cancel without writing
7+
- `` ``: navigate
8+
- `space`: toggle the highlighted row
9+
- `a`: toggle all rows
10+
- `enter`: confirm and write selected updates
11+
- `esc`: cancel without writing
1212

1313
<Code code={`syncpack ${props.command} --interactive`} lang="bash" />

site/src/_partials/option/reporter-fix.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Code } from "astro:components";
22

3-
Set the output format. Defaults to `pretty` which prints human-readable output with colours and formatting. Use `json` to output one line of newline-delimited JSON (NDJSON) per fixable instance the same shape as the [json](COMMAND_JSON) command.
3+
Set the output format. Defaults to `pretty` which prints human-readable output with colours and formatting. Use `json` to output one line of newline-delimited JSON (NDJSON) per fixable instance, with the same shape as the [json](COMMAND_JSON) command.
44

55
Each line has the type [`JsonOutput`](https://github.com/JamieMason/syncpack/blob/14.1.0/npm/syncpack.ts#L174-L194):
66

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Code } from "astro:components";
2+
3+
Control how `--source` (and the rcfile [`source`](CONFIG_SOURCE)) combine with workspace discovery. `replace` (default) uses only the supplied patterns and skips discovery; `extend` appends them after discovered patterns from `workspaces` / `pnpm-workspace.yaml` / `lerna.json`. Overrides [`sourceMode`](CONFIG_SOURCE_MODE) from the rcfile.
4+
5+
<Code
6+
code={`# Replace discovered patterns with the supplied ones (default)
7+
syncpack ${props.command} --source-mode replace --source 'packages/*/package.json'
8+
# Append the supplied pattern to discovered workspace packages
9+
syncpack ${props.command} --source-mode extend --source 'tools/scripts/package.json'`}
10+
lang="bash"
11+
/>

site/src/_partials/option/target.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Code } from "astro:components";
22

3-
Limit updates to only those within the given semver portion. For per-dependency control, see [updateGroups](CONFIG_UPDATE_GROUPS) — when both apply to the same instance, the stricter of the two wins.
3+
Limit updates to only those within the given semver portion. For per-dependency control, see [updateGroups](CONFIG_UPDATE_GROUPS). When both apply to the same instance, the stricter of the two wins.
44

55
<Code
66
code={`
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { KEYS } from "@partials/severity/keys.js";
2+
3+
Override the default [severity](REF_SEVERITY) of any [status code](#status-codes) this group can produce.
4+
5+
{props.children}
6+
7+
**Permitted keys:**
8+
9+
<ul>
10+
{KEYS[props.group].map((k) => (
11+
<li>
12+
<a href={`/status/${k.slug}/#severity`}>
13+
<code>{k.name}</code>
14+
</a>
15+
</li>
16+
))}
17+
</ul>
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
// Single source of truth for which severity keys each version group accepts.
2+
// Used by:
3+
// - site/src/_partials/severity/group-section.mdx (per-group page rendering)
4+
// - site/src/content/docs/config/severity.mdx ('Configurable keys per group' table)
5+
// When the Rust validation in src/version_group/severity.rs changes, update this map.
6+
7+
export const KEYS = {
8+
banned: [{ name: 'IsBanned', slug: 'is-banned' }],
9+
pinned: [
10+
{ name: 'DiffersToPin', slug: 'differs-to-pin' },
11+
{ name: 'PinOverridesSemverRange', slug: 'pin-overrides-semver-range' },
12+
{
13+
name: 'PinOverridesSemverRangeMismatch',
14+
slug: 'pin-overrides-semver-range-mismatch',
15+
},
16+
{ name: 'RefuseToPinLocal', slug: 'refuse-to-pin-local' },
17+
],
18+
highestSemver: [
19+
{ name: 'SemverRangeMismatch', slug: 'semver-range-mismatch' },
20+
{ name: 'DiffersToLocal', slug: 'differs-to-local' },
21+
{ name: 'DiffersToCatalog', slug: 'differs-to-catalog' },
22+
{
23+
name: 'DiffersToHighestOrLowestSemver',
24+
slug: 'differs-to-highest-or-lowest-semver',
25+
},
26+
],
27+
lowestSemver: [
28+
{ name: 'SemverRangeMismatch', slug: 'semver-range-mismatch' },
29+
{ name: 'DiffersToLocal', slug: 'differs-to-local' },
30+
{ name: 'DiffersToCatalog', slug: 'differs-to-catalog' },
31+
{
32+
name: 'DiffersToHighestOrLowestSemver',
33+
slug: 'differs-to-highest-or-lowest-semver',
34+
},
35+
],
36+
sameRange: [{ name: 'SemverRangeMismatch', slug: 'semver-range-mismatch' }],
37+
sameMinor: [
38+
{
39+
name: 'DiffersToHighestOrLowestSemverMinor',
40+
slug: 'differs-to-highest-or-lowest-semver-minor',
41+
},
42+
{ name: 'SemverRangeMismatch', slug: 'semver-range-mismatch' },
43+
{
44+
name: 'SameMinorOverridesSemverRange',
45+
slug: 'same-minor-overrides-semver-range',
46+
},
47+
{
48+
name: 'SameMinorOverridesSemverRangeMismatch',
49+
slug: 'same-minor-overrides-semver-range-mismatch',
50+
},
51+
],
52+
snappedTo: [
53+
{ name: 'DiffersToSnapTarget', slug: 'differs-to-snap-target' },
54+
{ name: 'SemverRangeMismatch', slug: 'semver-range-mismatch' },
55+
{ name: 'RefuseToSnapLocal', slug: 'refuse-to-snap-local' },
56+
],
57+
catalog: [
58+
{ name: 'NotUsingCatalog', slug: 'not-using-catalog' },
59+
{ name: 'MissingFromCatalog', slug: 'missing-from-catalog' },
60+
],
61+
ignored: [],
62+
};
63+
64+
export const GROUP_LABELS = {
65+
banned: 'Banned',
66+
pinned: 'Pinned',
67+
highestSemver: 'Highest Semver',
68+
lowestSemver: 'Lowest Semver',
69+
sameRange: 'Same Range',
70+
sameMinor: 'Same Minor',
71+
snappedTo: 'Snapped To',
72+
catalog: 'Catalog',
73+
ignored: 'Ignored',
74+
};
75+
76+
export const GROUP_LINKS = {
77+
banned: '/version-groups/banned/',
78+
pinned: '/version-groups/pinned/',
79+
highestSemver: '/version-groups/highest-semver/',
80+
lowestSemver: '/version-groups/lowest-semver/',
81+
sameRange: '/version-groups/same-range/',
82+
sameMinor: '/version-groups/same-minor/',
83+
snappedTo: '/version-groups/snapped-to/',
84+
catalog: '/version-groups/catalog/',
85+
ignored: '/version-groups/ignored/',
86+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Not configurable via [`severity`](REF_SEVERITY){props.reason ? `: ${props.reason}` : ''}. Defaults to `"warn"` (or `"error"` under [`strict: true`](CONFIG_STRICT)).

0 commit comments

Comments
 (0)