UNPKG

@pega/custom-dx-components

Version:

Utility for building custom UI components

46 lines (32 loc) 1.36 kB
import fs from 'fs'; import path from 'path'; import chalk from 'chalk'; import { showVersion, getLibraryBased, addDebugLog, getConfigDefaults, getComponents, checkLibraryAndArchives } from '../../util.js'; export const showCurrentStatus = async () => { const configDefaults = getConfigDefaults(); const componentList = await getComponents(); console.log(""); console.log("\tCurrent status"); console.log("\t---------------------"); console.log(`\tOrganization:\t ${chalk.bold.green(`${configDefaults.organization}`)}`); console.log(`\tLibrary:\t ${chalk.bold.green(`${configDefaults.library}`)}`); console.log(`\tVersion:\t ${chalk.bold.green(`${configDefaults.buildVersion}`)}`); if (!configDefaults.devBuild) { console.log(`\tPermanent:\t ${chalk.bold.magentaBright(`${!configDefaults.devBuild}`)}`); } else { console.log(`\tPermanent:\t ${chalk.bold.green(`${!configDefaults.devBuild}`)}`); } console.log(`\tComponent count: ${chalk.bold.green(`${componentList.length}`)}`); console.log(""); } export default async options => { const isLibraryBased = getLibraryBased(); if (!isLibraryBased) { console.log(`Command only supported for ${chalk.bold.green('library mode')} components.`); process.exit(); } await showVersion(); await checkLibraryAndArchives(); await showCurrentStatus(); }