Skip to content

Commit

Permalink
docs(site): fix broken links
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieMason committed Nov 16, 2023
1 parent da78781 commit b17aa50
Show file tree
Hide file tree
Showing 26 changed files with 36 additions and 37 deletions.
4 changes: 2 additions & 2 deletions site/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion site/src/content/docs/config/dependency-types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ All are enabled by default.

:::tip

Learn more about the [`local` dependency type](/guide/local-package-versions).
Learn more about the [`local` dependency type](/syncpack/guide/local-package-versions).

:::
17 changes: 8 additions & 9 deletions site/src/content/docs/guide/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ syncpack list --types local

When setting up a project, I'd recommend that you start small and focus on only production dependencies. Monorepos are large and complex and I think it's better to tackle them in stages.

Create the following config file in the root of your project:
Create the following [config file](/syncpack/config/syncpackrc) at `.syncpackrc` in the root of your project:

```json .syncpackrc
{
Expand Down Expand Up @@ -105,14 +105,13 @@ Now take a look at your production dependencies:
syncpack list
```

You will likely see some warnings, and each warning will display an error code to identify the reason it is invalid. Every warning is explained in the [Error Codes](/status-codes) documentation.
You will likely see some warnings, and each warning will display an error code to identify the reason it is invalid. Every warning is explained in the [Status Codes](/syncpack/guide/status-codes) documentation.

We'll look at how to fix mismatching versions, but first let's look at the semver ranges.

## Semver Ranges

<Details title="Examples of Semver Ranges">

<SupportedRanges />
</Details>

Expand All @@ -137,11 +136,11 @@ Supposing you prefer exact version numbers, you can define a policy to standardi

:::tip

[packages](/config/semver-groups/with-range#packages) and [dependencies](/config/semver-groups/with-range#dependencies) match all by default, so you can remove those properties from your config if you prefer.
[packages](/syncpack/config/semver-groups/with-range#packages) and [dependencies](/syncpack/config/semver-groups/with-range#dependencies) match all by default, so you can remove those properties from your config if you prefer.

:::

What we've created is called a [Semver Group](/config/semver-groups/with-range). Whenever syncpack finds an [instance of a dependency](#whats-an-instance), it walks through your `semverGroups` array in source code order until it finds a match – the first match wins and syncpack stops searching. An instance can only belong to one Semver Group (and one [Version Group](/config/version-groups/standard), which we'll see later) and the groups an instance belongs to define the rules that form its version policy.
What we've created is called a [Semver Group](/syncpack/config/semver-groups/with-range). Whenever syncpack finds an [instance of a dependency](#whats-an-instance), it walks through your `semverGroups` array in source code order until it finds a match – the first match wins and syncpack stops searching. An instance can only belong to one Semver Group (and one [Version Group](/syncpack/config/version-groups/standard), which we'll see later) and the groups an instance belongs to define the rules that form its version policy.

In our case we've decided that every instance under a `dependencies` object must always have a semver range of `""` for an exact version number.

Expand Down Expand Up @@ -227,7 +226,7 @@ Now that we're using consistent semver ranges under `dependencies`, let's return
syncpack list-mismatches
```

The most common of syncpack's [Status Codes](/guide/status-codes) is `HighestSemverMismatch` which tells us that all versions used for that dependency are valid semver, but they are not identical and the one with the highest semver version should be used by all.
The most common of syncpack's [Status Codes](/syncpack/guide/status-codes) is `HighestSemverMismatch` which tells us that all versions used for that dependency are valid semver, but they are not identical and the one with the highest semver version should be used by all.

If you don't have any special requirements, they can be fixed automatically

Expand All @@ -245,11 +244,11 @@ syncpack prompt

### Adding overrides

We saw earlier how to handle overrides for [Semver Groups](/config/semver-groups/with-range) and [Version Groups](/config/version-groups/standard) work in exactly the same way.
We saw earlier how to handle overrides for [Semver Groups](/syncpack/config/semver-groups/with-range) and [Version Groups](/syncpack/config/version-groups/standard) work in exactly the same way.

A group can be applied to an entire monorepo, specific instances, or anything in between. Groups can be layered over others to apply overrides as we saw in the previous section.

You should hopefully now have a good intuition for how instances get assigned to groups. All that remains is to choose groups which exhibit the behaviour you need and to apply combinations of the [dependencies](/config/version-groups/standard#dependencies), [dependencyTypes](/config/version-groups/standard#dependencyTypes), and [packages](/config/version-groups/standard#packages) properties to them to target the instances you need to.
You should hopefully now have a good intuition for how instances get assigned to groups. All that remains is to choose groups which exhibit the behaviour you need and to apply combinations of the [dependencies](/syncpack/config/version-groups/standard#dependencies), [dependencyTypes](/syncpack/config/version-groups/standard#dependencyTypes), and [packages](/syncpack/config/version-groups/standard#packages) properties to them to target the instances you need to.

Version Groups provide a lot of really useful functionality, let's look at them some more.

Expand Down Expand Up @@ -310,7 +309,7 @@ A 3rd party framework has had a major update which requires breaking changes but

:::caution[Remember, We've only been linting "dependencies"]

At the start of this guide we used [dependencyTypes](/config/dependency-types) to configure syncpack to only look at `dependencies`, so the rest of our monorepo is currently being ignored.
At the start of this guide we used [dependencyTypes](/syncpack/config/dependency-types) to configure syncpack to only look at `dependencies`, so the rest of our monorepo is currently being ignored.

Move onto `dev` for `devDependencies` next and repeat the process we just followed.

Expand Down
6 changes: 3 additions & 3 deletions site/src/content/docs/guide/local-package-versions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import PinWorkspaceExample from '@site/partials/examples/_pin-workspace.mdx';
import SameRangeExample from '@site/partials/examples/_same-range.mdx';
import Details from '@site/components/details.astro';

This is an addendum to the [Getting Started](/guide/getting-started) guide.
This is an addendum to the [Getting Started](/syncpack/guide/getting-started) guide.

When some of the packages developed in your monorepo are installed as dependencies in other packages developed in your monorepo, syncpack can check that the versions used are valid and consistent.

Expand Down Expand Up @@ -58,7 +58,7 @@ The Developers of this project:

## The `local` dependency type

The "local" [`dependencyType`](/config/dependency-types) relates to the [`version`]({import.meta.env.HREF_VERSION}) properties of the package.json files from your own packages being developed in your monorepo.
The "local" [`dependencyType`](/syncpack/config/dependency-types) relates to the [`version`]({import.meta.env.HREF_VERSION}) properties of the package.json files from your own packages being developed in your monorepo.

When `local` is enabled, syncpack can see that:

Expand All @@ -83,7 +83,7 @@ Let's look at `workspace:*` under `devDependencies` first and decide on a rule f

</Details>

The fix for the Peer Dependency of `^1.0.0` can also be used to fix the use of `workspace:\*</code>. Since the current version of `1.2.1` of the Client is satisfied by both of these ranges, a [Same Range Version Group](/config/version-groups/same-range) can be used.
The fix for the Peer Dependency of `^1.0.0` can also be used to fix the use of `workspace:\*</code>. Since the current version of `1.2.1` of the Client is satisfied by both of these ranges, a [Same Range Version Group](/syncpack/config/version-groups/same-range) can be used.

The versions will be considered a match unless eg. `2.0.0` of the Client is released, or one of its dependents uses a range which does not include its current version.

Expand Down
2 changes: 1 addition & 1 deletion site/src/content/docs/guide/semver-groups.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Semver Groups
---

This is an addendum to the [Getting Started](/guide/getting-started) guide.
This is an addendum to the [Getting Started](/syncpack/guide/getting-started) guide.

Allow some packages to have different semver range rules to the rest of your monorepo. Each dependency can only belong to one semver group, the first rule which matches a given dependency and package will apply.

Expand Down
2 changes: 1 addition & 1 deletion site/src/content/docs/guide/version-groups.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Version Groups
---

This is an addendum to the [Getting Started](/guide/getting-started) guide.
This is an addendum to the [Getting Started](/syncpack/guide/getting-started) guide.

Version groups are an array of objects which partition your monorepo into isolated sections which each have their own rules/policy/strategy for how versions should be managed.

Expand Down
2 changes: 1 addition & 1 deletion site/src/partials/_intellisense.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
To enable validation and autocompletion for your [configuration file](/config/syncpackrc), you must use a JavaScript config file and annotate in keeping with the below example:
To enable validation and autocompletion for your [configuration file](/syncpack/config/syncpackrc), you must use a JavaScript config file and annotate in keeping with the below example:

```js title=".syncpackrc.js"
// @ts-check
Expand Down
2 changes: 1 addition & 1 deletion site/src/partials/examples/_engines-node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ syncpack list

<Hx level={props.level}>4. Relax the rules (optional)</Hx>

If you don't want the Node.js version to be identical in every package but do want them all to be compatible with each other, you can use a [Same Range](/config/version-groups/same-range) Version Group.
If you don't want the Node.js version to be identical in every package but do want them all to be compatible with each other, you can use a [Same Range](/syncpack/config/version-groups/same-range) Version Group.

```json title=".syncpackrc"
{
Expand Down
2 changes: 1 addition & 1 deletion site/src/partials/examples/_engines.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ syncpack list

<Hx level={props.level}>4. Relax the rules (optional)</Hx>

If you don't want the Node.js version to be identical in every package but do want them all to be compatible with each other, you can use a [Same Range](/config/version-groups/same-range) Version Group. This defines an exception which only applies to Node.js, leaving anything else found under `engines` unaffected.
If you don't want the Node.js version to be identical in every package but do want them all to be compatible with each other, you can use a [Same Range](/syncpack/config/version-groups/same-range) Version Group. This defines an exception which only applies to Node.js, leaving anything else found under `engines` unaffected.

```json title=".syncpackrc"
{
Expand Down
2 changes: 1 addition & 1 deletion site/src/partials/examples/_pin-workspace.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const level = 'h1';

Add a [Pinned Version Group](/config/version-groups/pinned) so that local packages are always installed using `workspace:*` when they are used in `devDependencies`.
Add a [Pinned Version Group](/syncpack/config/version-groups/pinned) so that local packages are always installed using `workspace:*` when they are used in `devDependencies`.

- An optional **label** can be added to document the rule.
- The **dependencies** array defines the names of the dependencies we want to target.
Expand Down
2 changes: 1 addition & 1 deletion site/src/partials/examples/_same-range.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const level = 'h1';

Add a [Same Range Version Group](/config/version-groups/same-range) which allows local packages installed in `devDependencies` or `peerDependencies` to use different semver ranges, as long as they all match the local package version.
Add a [Same Range Version Group](/syncpack/config/version-groups/same-range) which allows local packages installed in `devDependencies` or `peerDependencies` to use different semver ranges, as long as they all match the local package version.

- An optional **label** can be added to document the rule.
- The **dependencies** array defines the names of the dependencies we want to target.
Expand Down
2 changes: 1 addition & 1 deletion site/src/partials/option/_indent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-i, --indent [value]
```

Override your [indent](/config/indent) configuration, which is 2 spaces by default.
Override your [indent](/syncpack/config/indent) configuration, which is 2 spaces by default.

{/* prettier-ignore-start */}
<pre><code>{`
Expand Down
2 changes: 1 addition & 1 deletion site/src/partials/option/_source.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const issueHref = 'https://github.com/JamieMason/syncpack/issues/66#issue
-s, --source [pattern]
```

Override your [source](/config/source) configuration to run `syncpack {props.command}` on only some package.json files.
Override your [source](/syncpack/config/source) configuration to run `syncpack {props.command}` on only some package.json files.

{/* prettier-ignore-start */}
<pre><code>{`
Expand Down
2 changes: 1 addition & 1 deletion site/src/partials/option/_types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-t, --types <names>
```

Override your [dependencyTypes](/config/dependency-types) configuration to run `syncpack {props.command}` on only eg. `peerDependencies` in every package in your monorepo.
Override your [dependencyTypes](/syncpack/config/dependency-types) configuration to run `syncpack {props.command}` on only eg. `peerDependencies` in every package in your monorepo.

{/* prettier-ignore-start */}
<pre><code>{`
Expand Down
2 changes: 1 addition & 1 deletion site/src/partials/status-codes/_banned.mdx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
This instance was matched by a [Banned](/config/version-groups/banned) Version Group, it is not allowed in the location it's in and should be removed.
This instance was matched by a [Banned](/syncpack/config/version-groups/banned) Version Group, it is not allowed in the location it's in and should be removed.
2 changes: 1 addition & 1 deletion site/src/partials/status-codes/_filtered-out.mdx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
This instance did not match the RegExp provided for the [filter](/command/list#filter) option and will be ignored.
This instance did not match the RegExp provided for the [filter](/syncpack/command/list#filter) option and will be ignored.
2 changes: 1 addition & 1 deletion site/src/partials/status-codes/_ignored.mdx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
This instance was matched by an [Ignored](/config/version-groups/ignored) Version Group, it is ignored completely by Syncpack.
This instance was matched by an [Ignored](/syncpack/config/version-groups/ignored) Version Group, it is ignored completely by Syncpack.
2 changes: 1 addition & 1 deletion site/src/partials/status-codes/_local-package-mismatch.mdx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
This dependency is a package developed in your monorepo and the `local` [dependencyType](/config/dependency-types) is enabled. The `version` property of its package.json file is considered the canonical source of truth for the correct version to be used by all instances – but one of more of them are not identical to it.
This dependency is a package developed in your monorepo and the `local` [dependencyType](/syncpack/config/dependency-types) is enabled. The `version` property of its package.json file is considered the canonical source of truth for the correct version to be used by all instances – but one of more of them are not identical to it.
2 changes: 1 addition & 1 deletion site/src/partials/status-codes/_lowest-semver-mismatch.mdx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Every instance of this dependency has a valid semver version number, but they are not all identical. Of those versions currently in use, the one with the lowest semver version should be used. The lowest version should be used because these instances belong to a [Lowest Version](/config/version-groups/lowest-version) Group.
Every instance of this dependency has a valid semver version number, but they are not all identical. Of those versions currently in use, the one with the lowest semver version should be used. The lowest version should be used because these instances belong to a [Lowest Version](/syncpack/config/version-groups/lowest-version) Group.
2 changes: 1 addition & 1 deletion site/src/partials/status-codes/_missing-local-version.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
This dependency is a package developed in your monorepo and the `local` [dependencyType](/config/dependency-types) is enabled. The `version` property of its package.json file is missing, so the correct version to be used by all instances can not be determined.
This dependency is a package developed in your monorepo and the `local` [dependencyType](/syncpack/config/dependency-types) is enabled. The `version` property of its package.json file is missing, so the correct version to be used by all instances can not be determined.

Syncpack can't know what to do and this will need to be manually resolved.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
This instance was matched by a [Snapped To](/config/version-groups/snapped-to) Version Group, the version it should use is the one set in the packages named in the `snapTo` array of this Version Group – but none of those packages depend on this dependency.
This instance was matched by a [Snapped To](/syncpack/config/version-groups/snapped-to) Version Group, the version it should use is the one set in the packages named in the `snapTo` array of this Version Group – but none of those packages depend on this dependency.

Syncpack can't know what to do and this will need to be manually resolved.
2 changes: 1 addition & 1 deletion site/src/partials/status-codes/_pinned-mismatch.mdx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
This instance was matched by a [Pinned](/config/version-groups/pinned) Version Group, its version should be identical to the `pinVersion` property of the Version Group, but is is not.
This instance was matched by a [Pinned](/syncpack/config/version-groups/pinned) Version Group, its version should be identical to the `pinVersion` property of the Version Group, but is is not.
2 changes: 1 addition & 1 deletion site/src/partials/status-codes/_same-range-mismatch.mdx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
These instances were matched by a [Same Range](/config/version-groups/same-range) Version Group, the version numbers do not have to be identical but they do all need to have a semver range which satisfies **all of the others**. In this case, one or more of the version numbers do not match all of the others.
These instances were matched by a [Same Range](/syncpack/config/version-groups/same-range) Version Group, the version numbers do not have to be identical but they do all need to have a semver range which satisfies **all of the others**. In this case, one or more of the version numbers do not match all of the others.
2 changes: 1 addition & 1 deletion site/src/partials/status-codes/_semver-range-mismatch.mdx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
This instance belongs to a [With Range](/config/semver-groups/with-range) Semver Group, but the semver range it is using does not match the one defined on the `range` property of that group.
This instance belongs to a [With Range](/syncpack/config/semver-groups/with-range) Semver Group, but the semver range it is using does not match the one defined on the `range` property of that group.
2 changes: 1 addition & 1 deletion site/src/partials/status-codes/_snapped-to-mismatch.mdx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
This instance was matched by a [Snapped To](/config/version-groups/snapped-to) Version Group, the version it should use is the one set in the first package named in the `snapTo` array of this Version Group which depends on this dependency – but its version is not identical to that.
This instance was matched by a [Snapped To](/syncpack/config/version-groups/snapped-to) Version Group, the version it should use is the one set in the first package named in the `snapTo` array of this Version Group which depends on this dependency – but its version is not identical to that.
2 changes: 1 addition & 1 deletion site/src/partials/tips/_custom-types.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:::tip

You can extend syncpack to inspect more parts of your package.json files by defining your own [`customTypes`](/config/custom-types).
You can extend syncpack to inspect more parts of your package.json files by defining your own [`customTypes`](/syncpack/config/custom-types).

:::

0 comments on commit b17aa50

Please sign in to comment.