cli: allow explicit null pluginId in package metadata

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-06-12 17:22:36 +02:00
parent 8f63f0a85b
commit a854f89318
2 changed files with 2 additions and 2 deletions
@@ -50,7 +50,7 @@ export interface BackstagePackageJson {
/**
* The ID of the plugin if this is a plugin package. Must always be set for plugin and module packages, and may be set for library packages.
*/
pluginId?: string;
pluginId?: string | null;
/**
* The parent plugin package of a module. Must always and only be set for module packages.
+1 -1
View File
@@ -277,7 +277,7 @@ export function fixPluginId(pkg: FixablePackage) {
const currentId = pkg.packageJson.backstage?.pluginId;
if (currentId !== undefined) {
if (typeof currentId !== 'string') {
if (typeof currentId !== 'string' && currentId !== null) {
throw new Error(
`Invalid 'backstage.pluginId' field in "${pkg.packageJson.name}", must be a string`,
);