How to use the @carbon/cli-reporter.reporter.error 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 / carbon / packages / icons-angular / src / build.js View on Github external
async function build() {
  reporter.log('Cleaning build dirs...');
  try {
    await clean();

    await Promise.all([fs.mkdir(paths.STORIES), fs.mkdir(paths.TS)]);
  } catch (err) {
    reporter.error(err);
  }
  reporter.log('Generating source components...');
  await generateComponents();
  reporter.log('Compiling and generating modules...');
  // run the angular compiler over everything
  ngc.main(['-p', './config/tsconfig-aot.json']);
  reporter.log('Bundling...');
  await buildUMD();
  // build the storybook examples
  reporter.log('Generating storybook examples...');
  buildExamples();
}
github carbon-design-system / carbon / packages / icons-angular / src / build.js View on Github external
.replace('es', 'ts')
      .replace('.js', '.ts');
    // try to write out the component
    try {
      await fs.ensureDir(dirname(outputPath));
      await fs.writeFile(
        outputPath,
        componentTemplate(
          selectorName,
          className,
          rawSvg,
          icon.descriptor.attrs
        )
      );
    } catch (err) {
      reporter.error(err);
    }
  }
}
github carbon-design-system / carbon / packages / bundler / src / commands / measure.js View on Github external
errors.forEach(error => {
      const { formatted, filepath } = error;
      reporter.error(`Error compiling ${path.relative(cwd, filepath)}`);
      console.log(chalk.gray(formatted));
    });
    process.exit(1);
github carbon-design-system / carbon / packages / bundler / src / commands / bundle.js View on Github external
async function bundle(entrypoint, options, info) {
  const { cwd } = info;
  const extension = path.extname(entrypoint);

  if (!bundlers.has(extension)) {
    reporter.error(
      `Invalid extension: \`${extension}\` on entrypoint: \`${entrypoint}\``
    );
    process.exit(1);
  }

  try {
    const bundle = bundlers.get(extension);
    await bundle(path.join(cwd, entrypoint), options, info);
  } catch (error) {
    reporter.error(`Unexpected error occurred while bundling ${entrypoint}:`);
    console.log(error);
    process.exit(1);
  }

  reporter.success('Done! 🎉');
}
github carbon-design-system / carbon / packages / bundler / src / commands / check.js View on Github external
errors.forEach(error => {
      const { formatted, file } = error;
      reporter.error(`Error compiling ${path.relative(cwd, file)}`);
      console.log(chalk.gray(formatted));
    });
    process.exit(1);
github carbon-design-system / carbon / packages / bundler / src / commands / sassdoc.js View on Github external
const files = await glob(pattern, {
    cwd,
    ignore,
  });

  if (json) {
    reporter.info(
      `Creating sassdoc json for pattern: '${pattern}', ignoring: '${ignore}'`
    );

    try {
      const jsonFile = await createJson(files);
      await fs.ensureDir(DOCS_DIR);
      await fs.writeFile(JSON_FILE, JSON.stringify(jsonFile, null, 2));
    } catch (error) {
      reporter.error(`Sassdoc error: ${error}`);
      process.exit(1);
    }

    reporter.success('Done! 🎉');
  } else {
    reporter.info(
      `Creating sassdoc markdown for pattern: '${pattern}', ignoring: '${ignore}'`
    );

    try {
      const markdownFile = await createMarkdown(files);
      await fs.ensureDir(DOCS_DIR);
      await fs.writeFile(MARKDOWN_FILE, markdownFile);
    } catch (error) {
      reporter.error(`Sassdoc error: ${error}`);
      process.exit(1);

@carbon/cli-reporter

Reporter for CLI-based tools in the Carbon Design System

Apache-2.0
Latest version published 1 year ago

Package Health Score

76 / 100
Full package analysis