How to use the @carbon/cli-reporter.ConsoleReporter function in @carbon/cli-reporter

To help you get started, we’ve selected a few @carbon/cli-reporter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github carbon-design-system / toolkit / packages / toolkit / src / addCommandToProgram.js View on Github external
'use strict';

const { ConsoleReporter } = require('@carbon/cli-reporter');
const { logger } = require('@carbon/cli-tools');
const packageJson = require('../package.json');

// Initialize our reporter for the console. Used for logging messages
const reporter = new ConsoleReporter();

/**
 * @typedef Option
 * @param {string} flags - specify the flags for the option
 * @param {string} description - the description to show for the option
 * @param {any} defaults - the default value for the option
 */

/**
 * @typedef Command
 * @param {string} name - the name of the command
 * @param {string} description - the description to show for the command
 * @param {Option[]} options - available options for the command
 * @param {Function} action - the function to call when the command is run
 */
github carbon-design-system / toolkit / packages / cli-runtime / src / plugins / create / create.js View on Github external
/* eslint-disable no-console */

'use strict';

const { createClient } = require('@carbon/npm');
const { ConsoleReporter } = require('@carbon/cli-reporter');
const { clearConsole, createLogger, spawn } = require('@carbon/cli-tools');
const fs = require('fs-extra');
const npmWhich = require('npm-which')(__dirname);
const path = require('path');
const util = require('util');

const logger = createLogger('@carbon/cli-plugin-create');
const reporter = new ConsoleReporter();
const which = util.promisify(npmWhich);

/**
 * Create a toolkit project with the given name and options.
 */
async function create(name, options, api, env) {
  const { CLI_ENV, cwd } = env;
  // We support a couple of options for our `create` command, some only exist
  // during development (like link and linkCli).
  const { link, linkCli, npmClient, plugins = [], presets = [], skip } = options;

  const root = path.join(cwd, name);

  logger.trace('Creating project:', name, 'at:', root);

  if (await fs.exists(root)) {

@carbon/cli-reporter

Reporter for CLI-based tools in the Carbon Design System

Apache-2.0
Latest version published 10 months ago

Package Health Score

83 / 100
Full package analysis