@backstage/cli
Version:
CLI for developing Backstage plugins and apps
65 lines (60 loc) • 2.28 kB
JavaScript
Object.defineProperty(exports, '__esModule', { value: true });
var factory = require('../../wiring/factory.cjs.js');
var commander = require('commander');
var lazy = require('../../lib/lazy.cjs.js');
var removed = require('../../lib/removed.cjs.js');
var index = factory.createCliPlugin({
pluginId: "new",
init: async (reg) => {
reg.addCommand({
path: ["new"],
description: "Open up an interactive guide to creating new things in your app",
execute: async ({ args }) => {
const command = new commander.Command();
const defaultCommand = command.storeOptionsAsProperties(false).description(
"Open up an interactive guide to creating new things in your app"
).option(
"--select <name>",
"Select the thing you want to be creating upfront"
).option(
"--option <name>=<value>",
"Pre-fill options for the creation process",
(opt, arr) => [...arr, opt],
[]
).option(
"--skip-install",
`Skips running 'yarn install' and 'yarn lint --fix'`
).option("--scope <scope>", "The scope to use for new packages").option(
"--npm-registry <URL>",
"The package registry to use for new packages"
).option(
"--baseVersion <version>",
"The version to use for any new packages (default: 0.1.0)"
).option(
"--license <license>",
"The license to use for any new packages (default: Apache-2.0)"
).option("--no-private", "Do not mark new packages as private").action(lazy.lazy(() => import('./commands/new.cjs.js'), "default"));
await defaultCommand.parseAsync(args, { from: "user" });
}
});
reg.addCommand({
path: ["create"],
description: "Create a new Backstage app",
deprecated: true,
execute: async () => {
removed.removed("use 'backstage-cli new' instead")();
}
});
reg.addCommand({
path: ["create-plugin"],
description: "Create a new Backstage plugin",
deprecated: true,
execute: async () => {
removed.removed("use 'backstage-cli new' instead")();
}
});
}
});
exports.default = index;
//# sourceMappingURL=index.cjs.js.map
;