@rushstack/lockfile-explorer
Version:
Rush Lockfile Explorer: The UI for solving version conflicts quickly in a large monorepo
35 lines • 1.91 kB
JavaScript
;
// 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.LintCommandLineParser = void 0;
const terminal_1 = require("@rushstack/terminal");
const ts_command_line_1 = require("@rushstack/ts-command-line");
const node_core_library_1 = require("@rushstack/node-core-library");
const InitAction_1 = require("./actions/InitAction");
const CheckAction_1 = require("./actions/CheckAction");
const LINT_TOOL_FILENAME = 'lockfile-lint';
class LintCommandLineParser extends ts_command_line_1.CommandLineParser {
constructor() {
super({
toolFilename: LINT_TOOL_FILENAME,
toolDescription: 'Lockfile Lint applies configured policies to find and report dependency issues in your PNPM workspace.'
});
this._terminalProvider = new terminal_1.ConsoleTerminalProvider();
this.globalTerminal = new terminal_1.Terminal(this._terminalProvider);
this._populateActions();
}
async onExecuteAsync() {
const lockfileExplorerProjectRoot = node_core_library_1.PackageJsonLookup.instance.tryGetPackageFolderFor(__dirname);
const lockfileExplorerPackageJson = node_core_library_1.JsonFile.load(`${lockfileExplorerProjectRoot}/package.json`);
const appVersion = lockfileExplorerPackageJson.version;
this.globalTerminal.writeLine(terminal_1.Colorize.bold(`\nRush Lockfile Lint ${appVersion}`) + terminal_1.Colorize.cyan(' - https://lfx.rushstack.io/\n'));
await super.onExecuteAsync();
}
_populateActions() {
this.addAction(new InitAction_1.InitAction(this));
this.addAction(new CheckAction_1.CheckAction(this));
}
}
exports.LintCommandLineParser = LintCommandLineParser;
//# sourceMappingURL=LintCommandLineParser.js.map