UNPKG

@rushstack/heft

Version:

Build all your JavaScript projects the same way: A way that works.

36 lines 1.77 kB
"use strict"; // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. Object.defineProperty(exports, "__esModule", { value: true }); exports.PhaseAction = void 0; const ts_command_line_1 = require("@rushstack/ts-command-line"); const HeftActionRunner_1 = require("../HeftActionRunner"); const Selection_1 = require("../../utilities/Selection"); class PhaseAction extends ts_command_line_1.CommandLineAction { constructor(options) { var _a; super({ actionName: `${options.phase.phaseName}${options.watch ? '-watch' : ''}`, documentation: `Runs to the ${options.phase.phaseName} phase, including all transitive dependencies` + (options.watch ? ', in watch mode.' : '.') + (options.phase.phaseDescription ? ` ${options.phase.phaseDescription}` : ''), summary: `Runs to the ${options.phase.phaseName} phase, including all transitive dependencies` + (options.watch ? ', in watch mode.' : '.') }); this.watch = (_a = options.watch) !== null && _a !== void 0 ? _a : false; this._phase = options.phase; this._actionRunner = new HeftActionRunner_1.HeftActionRunner({ action: this, ...options }); this._actionRunner.defineParameters(); } get selectedPhases() { if (!this._selectedPhases) { this._selectedPhases = Selection_1.Selection.recursiveExpand([this._phase], (phase) => phase.dependencyPhases); } return this._selectedPhases; } async onExecuteAsync() { await this._actionRunner.executeAsync(); } } exports.PhaseAction = PhaseAction; //# sourceMappingURL=PhaseAction.js.map