cli: allow frontend modules to not define a pluginId

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-06-12 17:22:56 +02:00
parent a854f89318
commit 4f2084267e
2 changed files with 7 additions and 4 deletions
+2 -1
View File
@@ -363,7 +363,8 @@ export function fixPluginPackages(
if (
role === 'common-library' ||
role === 'web-library' ||
role === 'node-library'
role === 'node-library' ||
role === 'frontend-plugin-module' // TODO(Rugvip): Remove this once frontend modules are required to have a plugin ID
) {
return;
}
+5 -3
View File
@@ -30,8 +30,9 @@ export function publishPreflightCheck(pkg: BackstagePackage): void {
if (
role === 'backend-plugin' ||
role === 'backend-plugin-module' ||
role === 'frontend-plugin' ||
role === 'frontend-plugin-module'
role === 'frontend-plugin'
// TODO(Rugvip): We currently support plugin-less frontend modules for the new frontend system, but it needs a different solution
// || role === 'frontend-plugin-module'
) {
if (!backstage.pluginId) {
throw new Error(
@@ -62,7 +63,8 @@ export function publishPreflightCheck(pkg: BackstagePackage): void {
}
if (role === 'backend-plugin-module' || role === 'frontend-plugin-module') {
if (!backstage.pluginPackage) {
// TODO(Rugvip): Remove this .pluginId check once frontend modules are required to have a plugin ID
if (backstage.pluginId && !backstage.pluginPackage) {
throw new Error(
`Plugin module package ${name} is missing a backstage.pluginPackage, please run 'backstage-cli repo fix --publish'`,
);