@backstage/cli
Version:
CLI for developing Backstage plugins and apps
53 lines (49 loc) • 2.32 kB
JavaScript
var commander = require('commander');
var lazy = require('../../lib/lazy.cjs.js');
function registerRepoCommands(command) {
command.command("build").description(
"Build packages in the project, excluding bundled app and backend packages."
).option(
"--all",
"Build all packages, including bundled app and backend packages."
).option(
"--since <ref>",
"Only build packages and their dev dependents that changed since the specified ref"
).option(
"--minify",
"Minify the generated code. Does not apply to app package (app is minified by default)."
).action(lazy.lazy(() => import('./commands/repo/build.cjs.js'), "command"));
}
function registerPackageCommands(command) {
command.command("build").description("Build a package for production deployment or publishing").option("--role <name>", "Run the command with an explicit package role").option(
"--minify",
"Minify the generated code. Does not apply to app package (app is minified by default)."
).option(
"--skip-build-dependencies",
"Skip the automatic building of local dependencies. Applies to backend packages only."
).option(
"--stats",
"If bundle stats are available, write them to the output directory. Applies to app packages only."
).option(
"--config <path>",
"Config files to load instead of app-config.yaml. Applies to app packages only.",
(opt, opts) => opts ? [...opts, opt] : [opt],
Array()
).action(lazy.lazy(() => import('./commands/package/build/index.cjs.js'), "command"));
}
function registerCommands(program) {
program.command("build-workspace <workspace-dir> [packages...]").addOption(
new commander.Option(
"--alwaysYarnPack",
"Alias for --alwaysPack for backwards compatibility."
).implies({ alwaysPack: true }).hideHelp(true)
).option(
"--alwaysPack",
"Force workspace output to be a result of running `yarn pack` on each package (warning: very slow)"
).description("Builds a temporary dist workspace from the provided packages").action(lazy.lazy(() => import('./commands/buildWorkspace.cjs.js'), "default"));
}
exports.registerCommands = registerCommands;
exports.registerPackageCommands = registerPackageCommands;
exports.registerRepoCommands = registerRepoCommands;
//# sourceMappingURL=index.cjs.js.map
;