Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Aram <[email protected]>
  • Loading branch information
VincentSmedinga and alimpens authored Apr 25, 2024
1 parent bba0452 commit 63c89c7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions documentation/publishing.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ To fix this, check whether any closed PRs still have the `autorelease: pending`

We’ve established dependencies between our packages for smoother installation.
For instance, our React package relies on our CSS package.
When you install React, the corresponding version of our CSS package is automatically included.
When you install our React package, the corresponding version of our CSS package is automatically included.

Here’s the dependency structure:

Expand All @@ -81,7 +81,7 @@ graph LR
```

Managing these dependencies requires extra attention when publishing.
We use [PNPM’s workspace feature](https://pnpm.io/workspaces#publishing-workspace-packages) to define dependencies among our packages.
We use [PNPM’s workspace feature](https://pnpm.io/workspaces#publishing-workspace-packages) to define dependencies between our packages.
When we publish upstream packages like CSS and React, the latest specific versions of downstream packages (Tokens, Assets, and React Icons) get listed as dependencies.

This setup works well when we update both CSS and React in a release.
Expand All @@ -90,9 +90,9 @@ The latest version of CSS then depends on an older version of Tokens.

To resolve this, we can manually let CSS depend on the latest version of Tokens.
We replace `"@amsterdam/design-system-tokens": "workspace:*"` with `"@amsterdam/design-system-tokens": "x.y.z"` and run `pnpm i` to update the lockfile.
These changes enable a correct peer dependency in the new CSS package.
We then release a new version of our CSS package, with the correct peer dependency.

After that, restore the dynamic dependency (`workspace:*`) and run `pnpm i` again.

The most extreme case requires us to release a new version of Tokens or Assets only, then update and release CSS , then update and release React.
The most extreme case requires us to release a new version of Tokens or Assets only, then update and release CSS, then update and release React.
Although infrequent, this scenario might occur in the future.

0 comments on commit 63c89c7

Please sign in to comment.