From a854f893184c567aee910e3550be288f55804373 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 12 Jun 2024 17:22:36 +0200 Subject: [PATCH] cli: allow explicit null pluginId in package metadata Signed-off-by: Patrik Oldsberg --- packages/cli-node/src/monorepo/PackageGraph.ts | 2 +- packages/cli/src/commands/repo/fix.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli-node/src/monorepo/PackageGraph.ts b/packages/cli-node/src/monorepo/PackageGraph.ts index afa5eed888..027099fe40 100644 --- a/packages/cli-node/src/monorepo/PackageGraph.ts +++ b/packages/cli-node/src/monorepo/PackageGraph.ts @@ -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. diff --git a/packages/cli/src/commands/repo/fix.ts b/packages/cli/src/commands/repo/fix.ts index 370e5c0cb1..4e7aefdaa7 100644 --- a/packages/cli/src/commands/repo/fix.ts +++ b/packages/cli/src/commands/repo/fix.ts @@ -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`, );