Rename BackstageCommand to CliCommand and CommandContext to CliCommandContext
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com> Made-with: Cursor
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import { OpaqueCliPlugin } from '@internal/cli';
|
||||
import { BackstageCommand, CliPlugin } from './types';
|
||||
import { CliCommand, CliPlugin } from './types';
|
||||
|
||||
/**
|
||||
* Creates a new CLI plugin that provides commands to the Backstage CLI.
|
||||
@@ -52,10 +52,10 @@ export function createCliPlugin(options: {
|
||||
*/
|
||||
init: (registry: {
|
||||
/** Registers a new command with the CLI. */
|
||||
addCommand: (command: BackstageCommand) => void;
|
||||
addCommand: (command: CliCommand) => void;
|
||||
}) => Promise<void>;
|
||||
}): CliPlugin {
|
||||
const commands: BackstageCommand[] = [];
|
||||
const commands: CliCommand[] = [];
|
||||
const commandsPromise = options
|
||||
.init({ addCommand: command => commands.push(command) })
|
||||
.then(() => commands);
|
||||
|
||||
@@ -15,4 +15,4 @@
|
||||
*/
|
||||
|
||||
export { createCliPlugin } from './createCliPlugin';
|
||||
export type { BackstageCommand, CommandContext, CliPlugin } from './types';
|
||||
export type { CliCommand, CliCommandContext, CliPlugin } from './types';
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface CommandContext {
|
||||
export interface CliCommandContext {
|
||||
/**
|
||||
* The remaining arguments passed to the command after the command path
|
||||
* has been resolved. This includes both positional arguments and flags.
|
||||
@@ -61,7 +61,7 @@ export interface CommandContext {
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface BackstageCommand {
|
||||
export interface CliCommand {
|
||||
/**
|
||||
* The path segments that define the command's position in the CLI tree.
|
||||
* For example, `['repo', 'test']` maps to `backstage-cli repo test`.
|
||||
@@ -99,10 +99,10 @@ export interface BackstageCommand {
|
||||
* ```
|
||||
*/
|
||||
execute:
|
||||
| ((context: CommandContext) => Promise<void>)
|
||||
| ((context: CliCommandContext) => Promise<void>)
|
||||
| {
|
||||
loader: () => Promise<{
|
||||
default: (context: CommandContext) => Promise<void>;
|
||||
default: (context: CliCommandContext) => Promise<void>;
|
||||
}>;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user