Skip to content

Commit 8670bff

Browse files
authored
docs: improve catalog documentation
1 parent 4d410a9 commit 8670bff

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

packages/publish/README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ lerna will run [npm lifecycle scripts](https://docs.npmjs.com/cli/v8/using-npm/s
579579

580580
# `catalog:` protocol
581581

582-
The `catalog:` protocol ([pnpm catalog](https://pnpm.io/catalogs)) can be recognized by Lerna-Lite. When publishing, they will be replaced as is and use the version range defined in your global catalog. If you need to bump the version of a package in a catalog, you will need to edit `pnpm-workspace.yaml` manually. If you wish them to be bumped automatically, then we suggest using [`workspace:`](#workspace-protocol) protocol instead for any workspace dependencies.
582+
The `catalog:` protocol ([pnpm catalog](https://pnpm.io/catalogs)) can be recognized by Lerna-Lite. When publishing, they will be replaced "as is" by reading and using the version range defined in your global catalog. If you need to bump the version of a package in a catalog, you will need to edit `pnpm-workspace.yaml` manually. If you wish them to be bumped automatically, then we strongly suggest that you use the [`workspace:`](#workspace-protocol) protocol instead which is better for local workspace dependencies.
583583

584584
So for example, if our `pnpm-workspace.yaml` file has the following configuration
585585

@@ -594,17 +594,16 @@ catalog:
594594

595595
# named catalogs are also supported
596596
catalogs:
597-
# Can be referenced through "catalog:react17"
597+
# Can be referenced through "catalog:react17" or "catalog:react18"
598598
react17:
599599
react: ^17.0.0
600600
react-dom: ^17.0.0
601-
# Can be referenced through "catalog:react18"
602601
react18:
603602
react: ^18.2.0
604603
react-dom: ^18.2.0
605604
```
606605
607-
and then one of our package with the following dependencies defined in our `package.json`
606+
and then if one of our package has the following dependencies defined in our `package.json`
608607

609608
```json
610609
{
@@ -623,7 +622,7 @@ and then one of our package with the following dependencies defined in our `pack
623622

624623
#### versions that will be published
625624

626-
Lerna-Lite will replace all `catalog:` protocol with the version ranges defined in the global catalog(s) and publish the following:
625+
Lerna-Lite will resolve all `catalog:` protocol by extracting the version ranges defined in the global catalog(s) and will publish the following:
627626

628627
```json
629628
{
@@ -642,7 +641,7 @@ Lerna-Lite will replace all `catalog:` protocol with the version ranges defined
642641

643642
# `workspace:` protocol
644643

645-
The `workspace:` protocol ([pnpm workspace](https://pnpm.io/workspaces), [yarn workspace](https://yarnpkg.com/features/workspaces#workspace-ranges-workspace)) is also supported by Lerna-Lite. We also strongly suggest that you use this in combo with the new [`--sync-workspace-lock`](https://github.com/lerna-lite/lerna-lite/tree/main/packages/version#--sync-workspace-lock) flag to properly update your root project lock file. When publishing, it will replace any `workspace:` dependencies by:
644+
The `workspace:` protocol ([pnpm workspace](https://pnpm.io/workspaces), [yarn workspace](https://yarnpkg.com/features/workspaces#workspace-ranges-workspace)) is also supported by Lerna-Lite. You could also use this in combo with the new [`--sync-workspace-lock`](https://github.com/lerna-lite/lerna-lite/tree/main/packages/version#--sync-workspace-lock) flag to properly update your root project lock file. When publishing, it will replace any `workspace:` dependencies by:
646645

647646
- the corresponding version in the target workspace (if you use `workspace:*`, `workspace:~`, or `workspace:^`)
648647
- the associated semver range (for any other range type)
@@ -677,6 +676,8 @@ The library is doing a strict match and it will transform and publish the follow
677676
}
678677
```
679678

679+
> **Note** semver range with an operator (ie `workspace:>=2.0.0`) are also supported but will never be mutated.
680+
680681
## FAQ
681682

682683
### Recovering from a network error

0 commit comments

Comments
 (0)