From 023ad46f3b72001fe3cbf1089009465a6568a1c5 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 6 Feb 2025 22:30:57 +0100 Subject: [PATCH] cli/new/utils: restore scope name logic for now Signed-off-by: Patrik Oldsberg --- packages/cli/src/lib/new/utils.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/lib/new/utils.ts b/packages/cli/src/lib/new/utils.ts index 4fea5774b4..51448a5a80 100644 --- a/packages/cli/src/lib/new/utils.ts +++ b/packages/cli/src/lib/new/utils.ts @@ -33,14 +33,17 @@ export const resolvePackageName = (options: { }) => { const { baseName, scope, plugin } = options; if (scope) { - const scopeSanitized = scope.replace(/[@/]/g, ''); if (plugin) { - const pluginPrefix = scopeSanitized.startsWith('backstage') + const pluginName = scope.startsWith('backstage') ? 'plugin' : 'backstage-plugin'; - return `@${scopeSanitized}/${pluginPrefix}-${baseName}`; + return scope.includes('/') + ? `@${scope}${pluginName}-${baseName}` + : `@${scope}/${pluginName}-${baseName}`; } - return `@${scopeSanitized}/${baseName}`; + return scope.includes('/') + ? `@${scope}${baseName}` + : `@${scope}/${baseName}`; } return plugin ? `backstage-plugin-${baseName}` : baseName;