How to use the signale.success function in signale

To help you get started, we’ve selected a few signale 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 umijs / father / src / preCommit.ts View on Github external
const prettierConfig = getPrettierConfig();

    list.forEach(filePath => {
      if (existsSync(filePath)) {
        const ext = extname(filePath).replace(/^\./, '');
        const text = readFileSync(filePath, 'utf8');
        const formatText = format(text, {
          parser: PRETTIER_PARSER[ext],
          ...prettierConfig,
        });

        writeFileSync(filePath, formatText, 'utf8');
      }
    });

    signale.success(`${chalk.cyan('prettier')} success!`);
  }

  // eslint
  if (preCommitConfig.eslint) {
    const eslintConfig = getEsLintConfig();
    const eslintBin = require.resolve('eslint/bin/eslint');
    const args = [eslintBin, '-c', eslintConfig, ...list, '--fix'];

    try {
      await runCmd('node', args);
    } catch (code) {
      process.exit(code);
    }

    signale.success(`${chalk.cyan('eslint')} success!`);
  }
github alibaba / GGEditor / scripts / start.js View on Github external
function start(name) {
  const contentBase = `examples`;

  // Clean
  rimraf.sync(`${contentBase}/dist`);

  signale.success('Clean success');

  // Watch
  const watcher = rollup.watch({
    input: [`${contentBase}/${name}/index.tsx`],
    output: {
      file: `${contentBase}/dist/bundle.js`,
      format: 'umd',
      globals: {
        react: 'React',
        'react-dom': 'ReactDOM',
        antd: 'antd',
      },
    },
    plugins: [
      postcss({
        modules: {
github alibaba / GGEditor / scripts / build.js View on Github external
],
      external: makeExternalPredicate([...Object.keys(peerDependencies)]),
    });

    await umdBundle.write({
      name: 'GGEditor',
      file: 'dist/index.js',
      format: 'umd',
      globals: {
        react: 'React',
        'react-dom': 'ReactDOM',
      },
      exports: 'named',
    });

    signale.success('Build umd success');
  } catch (error) {
    signale.error(error);
  }

  // Build cjs
  try {
    const cjsBundle = await rollup.rollup({
      input: 'src/index.tsx',
      plugins: [
        resolve(),
        replace({
          'process.env.GG_EDITOR_VERSION': JSON.stringify(version),
        }),
        commonjs(),
        typescript(),
        babel({
github alibaba / GGEditor / scripts / build.js View on Github external
async function build() {
  // Clean
  rimraf.sync('dist');
  rimraf.sync('lib');
  rimraf.sync('es');

  signale.success('Clean success');

  // Build umd
  try {
    const umdBundle = await rollup.rollup({
      input: 'src/index.tsx',
      plugins: [
        resolve(),
        replace({
          'process.env.GG_EDITOR_VERSION': JSON.stringify(version),
        }),
        commonjs(),
        typescript({
          tsconfigOverride: {
            compilerOptions: {
              declaration: false,
            },
github Foveluy / ReStory / bin / client.js View on Github external
function build(previousFileSizes) {
    signale.success('Creating an optimized production client build...')

    let compiler = webpack(config)
    return new Promise((resolve, reject) => {
      compiler.run((err, stats) => {
        if (err) {
          return reject(err)
        }
        const messages = formatWebpackMessages(stats.toJson({}, true))
        if (messages.errors.length) {
          // Only keep the first error. Others are often indicative
          // of the same problem, but confuse the reader with noise.
          if (messages.errors.length > 1) {
            messages.errors.length = 1
          }
          return reject(new Error(messages.errors.join('\n\n')))
        }
github sourcegraph / sourcegraph / browser / scripts / build.ts View on Github external
compiler.run((err, stats) => {
    console.log(stats.toString(tasks.WEBPACK_STATS_OPTIONS))

    if (stats.hasErrors()) {
        signale.error('Webpack compilation error')
        process.exit(1)
    }
    signale.success('Webpack compilation done')

    buildChrome()
    buildFirefox()
    tasks.copyIntegrationAssets()
    signale.success('Build done')
})
github JaeYeopHan / octodirect / scripts / deploy.js View on Github external
async function release(version) {
  try {
    await commit(version)
    await tag(version)
    await push()
    await pushTag()
    signale.success('release completed!')
  } catch (e) {
    signale.warn('Fail to commit or push!', e)
    return false
  }
}
github blurHY / HorizonSpider / ZeroNet / AdminZite.js View on Github external
async reloadSiteList() {
        signale.await("Reloading sites list")
        this.siteList = await this.cmdp("siteList", [])
        this.siteAddrs = this.siteList.map(s => s.address)
        signale.success(`SiteList: ${this.siteList.length}`)
    }
github voorhoede / plek / packages / cli / src / main.js View on Github external
return command().then(output => {
    backendAxios({
      ciEnv,
      flow: 'alias',
      state: 'success',
      targetUrl: `https://${process.env.DOMAIN}`,
    });

    signale.success(output);
    return output;
  });
};
github arnoldczhang / fe-guide / src / signale / signale.js View on Github external
/**
 * signale
 *
 * 美化console
 *
 * 参考:https://github.com/klauscfhq/signale
 * 
 */
const signale = require('signale');

signale.success('Operation successful');
signale.debug('Hello', 'from', 'L59');
signale.pending('Write release notes for 1.2.0');
signale.fatal(new Error('Unable to acquire lock'));
signale.watch('Recursively watching build directory...');
signale.complete({prefix: '[task]', message: 'Fix issue #59', suffix: '(@klauscfhq)'});