From 95955c21f28ac07c05bae543f9a810fc0a6bb660 Mon Sep 17 00:00:00 2001 From: Cory Steers Date: Fri, 30 May 2025 10:47:15 -0500 Subject: [PATCH] update with doc on new hooks added Signed-off-by: Cory Steers --- packages/yarn-plugin/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/yarn-plugin/README.md b/packages/yarn-plugin/README.md index 073669b9a5..49b57fe0ef 100644 --- a/packages/yarn-plugin/README.md +++ b/packages/yarn-plugin/README.md @@ -82,3 +82,12 @@ specific Backstage repository. As such, when publishing packages, all `backstage:^` versions should be removed from the package.json and replaced with the appropriate npm version ranges. This is handled by the `beforeWorkspacePacking` hook. + +### `afterWorkspaceDependencyAddition` hook + +\_Replaces npm version ranges with `backstage:^` ranges for `@backstage/*` dependencies added after +the plugin has converted existing dependencies to `backstage:^` range + +### `afterWorkspaceDependencyReplacement` hook + +\_warns user with console message when running `yarn add` for a `@backstage/*` scoped dependency that is already a dependency in the target package. Doing so will remove the `backstage:^` scope and replace it with the actual npm version range, which may not be desired.