UNPKG

@backstage/cli

Version:

CLI for developing Backstage plugins and apps

87 lines (82 loc) 3.13 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var commander = require('commander'); var factory = require('../../wiring/factory.cjs.js'); var lazy = require('../../lib/lazy.cjs.js'); var index = factory.createCliPlugin({ pluginId: "maintenance", init: async (reg) => { reg.addCommand({ path: ["package", "clean"], description: "Delete cache directories", execute: async ({ args }) => { const command = new commander.Command(); const defaultCommand = command.action( lazy.lazy(() => import('./commands/package/clean.cjs.js'), "default") ); await defaultCommand.parseAsync(args, { from: "user" }); } }); reg.addCommand({ path: ["package", "prepack"], description: "Prepares a package for packaging before publishing", execute: async ({ args }) => { const command = new commander.Command(); const defaultCommand = command.action( lazy.lazy(() => import('./commands/package/pack.cjs.js'), "pre") ); await defaultCommand.parseAsync(args, { from: "user" }); } }); reg.addCommand({ path: ["package", "postpack"], description: "Restores the changes made by the prepack command", execute: async ({ args }) => { const command = new commander.Command(); const defaultCommand = command.action( lazy.lazy(() => import('./commands/package/pack.cjs.js'), "post") ); await defaultCommand.parseAsync(args, { from: "user" }); } }); reg.addCommand({ path: ["repo", "fix"], description: "Automatically fix packages in the project", execute: async ({ args }) => { const command = new commander.Command(); const defaultCommand = command.option( "--publish", "Enable additional fixes that only apply when publishing packages" ).option( "--check", "Fail if any packages would have been changed by the command" ).action(lazy.lazy(() => import('./commands/repo/fix.cjs.js'), "command")); await defaultCommand.parseAsync(args, { from: "user" }); } }); reg.addCommand({ path: ["repo", "clean"], description: "Delete cache and output directories", execute: async ({ args }) => { const command = new commander.Command(); const defaultCommand = command.action( lazy.lazy(() => import('./commands/repo/clean.cjs.js'), "command") ); await defaultCommand.parseAsync(args, { from: "user" }); } }); reg.addCommand({ path: ["repo", "list-deprecations"], description: "List deprecations", execute: async ({ args }) => { const command = new commander.Command(); const defaultCommand = command.option("--json", "Output as JSON").action( lazy.lazy(() => import('./commands/repo/list-deprecations.cjs.js'), "command") ); await defaultCommand.parseAsync(args, { from: "user" }); } }); } }); exports.default = index; //# sourceMappingURL=index.cjs.js.map