rucken
Version:
Console tools and scripts for nx and not only that I (EndyKaufman) use to automate the workflow and speed up the development process
28 lines (27 loc) • 1.07 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Console = exports.Command = exports.InjectCli = void 0;
/**
* @module Decorators
*/
const common_1 = require("@nestjs/common");
const constants_1 = require("./constants");
/**
* A Param decorator to inject the root cli
*/
const InjectCli = () => (0, common_1.Inject)(constants_1.CLI_SERVICE_TOKEN);
exports.InjectCli = InjectCli;
/**
* The Command decorator is used to decorate a method in a class
* You can use it in a class that is deecorated by a "@Console" decorator
*/
const Command = (options) => (target, method) => Reflect.defineMetadata(constants_1.COMMAND_METADATA_NAME, options, target, method);
exports.Command = Command;
/**
* The Console decorator is used to decorate a class
* All commands in class that are decorated by a "@Console" with identical name will be grouped
*
* eg "@Console({name: "mycommand"})"
*/
const Console = (options) => (target) => Reflect.defineMetadata(constants_1.CONSOLE_METADATA_NAME, options || {}, target);
exports.Console = Console;