Add CLI module deduplication and improve conflict reporting
Individual CLI modules now silently take precedence over array-sourced modules (e.g. from cli-defaults) when their commands overlap. Conflict errors between non-array modules include both package names for easier debugging. Commands reference their parent module instead of storing a raw package name string. createCliModule now validates that packageJson has a name. Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com> Made-with: Cursor
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CliCommand } from '@backstage/cli-node';
|
||||
import { CliCommand, CliModule } from '@backstage/cli-node';
|
||||
import { OpaqueType } from '@internal/opaque';
|
||||
|
||||
/** @internal */
|
||||
@@ -47,6 +47,7 @@ export const OpaqueCommandLeafNode = OpaqueType.create<{
|
||||
readonly version: 'v1';
|
||||
readonly name: string;
|
||||
readonly command: CliCommand;
|
||||
readonly module?: CliModule;
|
||||
};
|
||||
}>({
|
||||
type: '@backstage/CommandLeafNode',
|
||||
|
||||
Reference in New Issue
Block a user