added the frontend-extension-bundle role

Co-authored-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Camila Belo <camilaibs@gmail.com>
Co-authored-by: blam <ben@blam.sh>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2024-08-08 16:15:57 +02:00
parent 9c38ce914d
commit 8669210f3b
13 changed files with 57 additions and 18 deletions
+1
View File
@@ -200,6 +200,7 @@ function createConfigForRole(dir, role, extraConfig = {}) {
case 'web-library':
case 'frontend':
case 'frontend-plugin':
case 'frontend-extension-bundle':
case 'frontend-plugin-module':
case 'frontend-dynamic-container':
return createConfig(dir, {
+1
View File
@@ -54,6 +54,7 @@ function getRoleConfig(role) {
case 'web-library':
case 'common-library':
case 'frontend-plugin':
case 'frontend-extension-bundle':
case 'frontend-plugin-module':
return { testEnvironment: require.resolve('jest-environment-jsdom') };
case 'cli':
+3
View File
@@ -246,6 +246,8 @@ function guessPluginId(role: PackageRole, pkgName: string): string | undefined {
case 'frontend':
case 'frontend-plugin':
return pkgName.match(/plugin-(.*)/)?.[1];
case 'frontend-extension-bundle':
return undefined;
case 'frontend-plugin-module':
return pkgName.match(/plugin-(.*)-module-/)?.[1];
case 'backend-plugin':
@@ -364,6 +366,7 @@ export function fixPluginPackages(
role === 'common-library' ||
role === 'web-library' ||
role === 'node-library' ||
role === 'frontend-extension-bundle' ||
role === 'frontend-plugin-module' // TODO(Rugvip): Remove this once frontend modules are required to have a plugin ID
) {
return;
@@ -46,6 +46,7 @@ export async function command(opts: OptionValues): Promise<void> {
});
case 'web-library':
case 'frontend-plugin':
case 'frontend-extension-bundle':
case 'frontend-plugin-module':
return startFrontend({ entry: 'dev/index', ...options });
case 'frontend-dynamic-container' as PackageRole: // experimental
@@ -84,9 +84,11 @@ async function detectPackages(
{ paths: [targetPath] },
));
if (
['frontend-plugin', 'frontend-plugin-module'].includes(
depPackageJson.backstage?.role ?? '',
)
[
'frontend-plugin',
'frontend-extension-bundle',
'frontend-plugin-module',
].includes(depPackageJson.backstage?.role ?? '')
) {
// Include alpha entry point if available. If there's no default export it will be ignored
const exp = depPackageJson.exports;