@backstage/cli
Version:
CLI for developing Backstage plugins and apps
53 lines (48 loc) • 1.79 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 index = factory.createCliPlugin({
pluginId: "test",
init: async (reg) => {
reg.addCommand({
path: ["repo", "test"],
description: "Run tests, forwarding args to Jest, defaulting to watch mode",
execute: async ({ args }) => {
const command = new commander.Command();
command.allowUnknownOption(true);
command.option(
"--since <ref>",
"Only test packages that changed since the specified ref"
);
command.option("--successCache", "Enable success caching");
command.option(
"--successCacheDir <path>",
"Set the success cache location, (default: node_modules/.cache/backstage-cli)"
);
command.option(
"--jest-help",
"Show help for Jest CLI options, which are passed through"
);
command.action(lazy.lazy(() => import('./commands/repo/test.cjs.js'), "command"));
await command.parseAsync(args, { from: "user" });
}
});
reg.addCommand({
path: ["package", "test"],
description: "Run tests, forwarding args to Jest, defaulting to watch mode",
execute: async ({ args }) => {
const command = new commander.Command();
command.allowUnknownOption(true);
command.helpOption(", --backstage-cli-help");
command.action(
lazy.lazy(() => import('./commands/package/test.cjs.js'), "default")
);
await command.parseAsync(args, { from: "user" });
}
});
}
});
exports.default = index;
//# sourceMappingURL=index.cjs.js.map
;