From a353f9364c780ebf4c4a600adb8b0abdf133c1d4 Mon Sep 17 00:00:00 2001 From: Cory Steers Date: Mon, 16 Jun 2025 10:42:52 -0500 Subject: [PATCH] implement sugested changes Signed-off-by: Cory Steers --- .../src/handlers/afterWorkspaceDependencyAddition.ts | 5 ++--- .../src/handlers/afterWorkspaceDependencyReplacement.ts | 7 +++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/yarn-plugin/src/handlers/afterWorkspaceDependencyAddition.ts b/packages/yarn-plugin/src/handlers/afterWorkspaceDependencyAddition.ts index 9307790930..219830a8c9 100644 --- a/packages/yarn-plugin/src/handlers/afterWorkspaceDependencyAddition.ts +++ b/packages/yarn-plugin/src/handlers/afterWorkspaceDependencyAddition.ts @@ -33,9 +33,8 @@ export const afterWorkspaceDependencyAddition = async ( ) { try { await getPackageVersion(descriptor, workspace.project.configuration); - // is there a better way to log than console.log? - console.log( - `afterWorkspaceDependencyAddition hook: Setting descriptor range from ${descriptor.range} to 'backstage:^' for ${descriptor.scope}/${descriptor.name}`, + console.info( + `Setting ${descriptor.scope}/${descriptor.name} to ${PROTOCOL}^`, ); descriptor.range = `${PROTOCOL}^`; } catch (_error: any) { diff --git a/packages/yarn-plugin/src/handlers/afterWorkspaceDependencyReplacement.ts b/packages/yarn-plugin/src/handlers/afterWorkspaceDependencyReplacement.ts index a955191244..55a11086fd 100644 --- a/packages/yarn-plugin/src/handlers/afterWorkspaceDependencyReplacement.ts +++ b/packages/yarn-plugin/src/handlers/afterWorkspaceDependencyReplacement.ts @@ -22,7 +22,7 @@ import { PROTOCOL } from '../constants'; export const afterWorkspaceDependencyReplacement = async ( workspace: Workspace, _target: suggestUtils.Target, - fromDescriptor: Descriptor, + _fromDescriptor: Descriptor, toDescriptor: Descriptor, ) => { const toDescriptorRange = structUtils.parseRange(toDescriptor.range); @@ -33,9 +33,8 @@ export const afterWorkspaceDependencyReplacement = async ( ) { try { await getPackageVersion(toDescriptor, workspace.project.configuration); - // is there a better way to log than console.log? - console.log( - `afterWorkspaceDependencyReplacement hook: Setting descriptor range from '${fromDescriptor.range}' to '${toDescriptor.range}' for ${fromDescriptor.scope}/${fromDescriptor.name}. Are you sure you want to be doing that?`, + console.warn( + `${toDescriptor.name} should be set to "${PROTOCOL}^" instead of "${toDescriptor.range}". Make sure this change is intentional and not a mistake.`, ); } catch (_error: any) { // if there's no found version then this is likely a deprecated package