Skip to content

Commit a676768

Browse files
mrr11kanthonyshew
andauthored
docs: added pnpm catalogs (#10463)
### Description Added [pnpm catalogs](https://pnpm.io/catalogs) as another option to keep dependency versions in sync across packages. ### Testing Instructions None, just docs. <!-- Give a quick description of steps to test your changes. --> --------- Co-authored-by: Anthony Shew <[email protected]>
1 parent 13f3210 commit a676768

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

docs/site/content/docs/crafting-your-repository/managing-dependencies.mdx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,12 @@ You can use your package manager to update dependency versions in one command.
180180
<PackageManagerTabs>
181181

182182
<Tab value="pnpm">
183+
183184
```bash title="Terminal"
184185
pnpm up --recursive typescript@latest
185186
```
186-
<small>[→ pnpm documentation](https://pnpm.io/cli/update#--recursive--r)</small>
187+
188+
<small>[→ pnpm documentation](https://pnpm.io/cli/update#--recursive--r)</small>
187189

188190
</Tab>
189191

@@ -220,6 +222,12 @@ No equivalent
220222
</Tab>
221223
</PackageManagerTabs>
222224

225+
#### pnpm catalogs
226+
227+
In pnpm v9.5+, you can use catalogs to define dependency version ranges as reusable constants. This will keep dependencies on the same version since you're referencing the same value across the workspace.
228+
229+
To learn more, [visit the pnpm catalogs documentation](https://pnpm.io/catalogs).
230+
223231
#### Using an IDE
224232

225233
Your IDE's refactoring tooling can find and replace the version of a dependency across all `package.json` files in your repository at once. Try using a regex like `"next": ".*"` on `package.json` files to find all instances of the `next` package and replace them with the version you want. When you're done, make sure to run your package manager's install command to update your lockfile.

0 commit comments

Comments
 (0)