"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const core_1 = require("@oclif/core");
const _ = require("lodash");
const command_base_tenantless_1 = require("../../command-base-tenantless");
class PkgList extends command_base_tenantless_1.CommandBaseTenantless {
    run() {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            this.bootstrap();
            const { args, flags } = yield this.parse(PkgList);
            if (this._projCfg.packages && !_.isEmpty(this._projCfg.packages)) {
                let list = [];
                for (let name in this._projCfg.packages) {
                    let pkg = this._projCfg.packages[name];
                    list.push(`${name} (${pkg.definitionFile})`);
                }
                this._ui.userMessage(`Package Exports:`);
                this._ui.userMessage(list.map(p => "  " + p).join("\n"));
            }
            else {
                this._ui.userMessage(`No packages are configured as an exports in this project.`);
            }
        });
    }
}
exports.default = PkgList;
PkgList.description = 'Renders the list of packages that are configured as project exports.';
PkgList.flags = {
    help: core_1.Flags.help({ char: 'h' })
};
PkgList.args = {};
//# sourceMappingURL=list.js.map