cli/new/utils: restore scope name logic for now

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2025-02-06 22:30:57 +01:00
parent b78767acc1
commit 023ad46f3b
+7 -4
View File
@@ -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;