How to use the consola.success function in consola

To help you get started, we’ve selected a few consola 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 nuxt / nuxt.js / packages / generator / src / generator.js View on Github external
// Make sure the sub folders are created
    await fsExtra.mkdirp(path.dirname(page.path))
    await fsExtra.writeFile(page.path, page.html, 'utf8')

    await this.nuxt.callHook('generate:routeCreated', {
      route,
      path: page.path,
      errors: pageErrors
    })

    if (pageErrors.length) {
      consola.error('Error generating ' + route)
      errors.push(...pageErrors)
    } else {
      consola.success('Generated ' + route)
    }

    return true
  }
github nuxt / nuxt.js / packages / builder / src / builder.js View on Github external
// Wait for nuxt ready
    await this.nuxt.ready()

    // Call before hook
    await this.nuxt.callHook('build:before', this, this.options.build)

    await this.validatePages()

    // Validate template
    try {
      this.validateTemplate()
    } catch (err) {
      consola.fatal(err)
    }

    consola.success('Builder initialized')

    consola.debug(`App root: ${this.options.srcDir}`)

    // Create .nuxt/, .nuxt/components and .nuxt/dist folders
    await fsExtra.remove(r(this.options.buildDir))
    const buildDirs = [r(this.options.buildDir, 'components')]
    if (!this.options.dev) {
      buildDirs.push(
        r(this.options.buildDir, 'dist', 'client'),
        r(this.options.buildDir, 'dist', 'server')
      )
    }
    await Promise.all(buildDirs.map(dir => fsExtra.mkdirp(dir)))

    // Call ready hook
    await this.nuxt.callHook('builder:prepared', this, this.options.build)
github Akryum / nodepack / packages / @nodepack / service / src / commands / build.js View on Github external
for (const error of data.errors) {
              console.log('\n', error.stack || error.message || error)
            }
            onError(`Build failed with errors.`)
            return
          }

          const targetDirShort = path.relative(
            api.service.cwd,
            targetDir,
          )

          if (!args.silent) {
            consola.log(formatStats(stats, targetDirShort, api))

            consola.success(chalk.green('Build complete!'))
            if (args.watch) {
              consola.info(chalk.blue(`Watching for file changes...`))
            }
          }

          resolve()
        }
      }
github universal-vue / uvue / packages / @uvue / vue-cli-plugin-ssr / uvue / CodeFixer.js View on Github external
result = this.fixPluginVueOption(result, 'router');

      if (api.hasPlugin('vuex')) {
        result = this.fixPluginVueOption(result, 'store');
      }

      if (api.hasPlugin('i18n')) {
        result = this.fixPluginVueOption(result, 'i18n');
      }

      if (code !== result) {
        await fs.writeFile(mainPath, result);
      }

      if (!this.options.silent)
        consola.success(`Main: ${path.relative(api.resolve('.'), mainPath)} OK`);
    }
  }
github mya-ake / nuxt-on-lambda / scripts / deploy / src / processors / deleteOldObjects.ts View on Github external
  objectsToDelete.forEach(({ key }) => consola.success(`Deleted: ${key}`));
};
github mya-ake / nuxt-on-lambda / scripts / deploy / src / processors / purgeCDN.ts View on Github external
}: {
  cloudFrontId: string;
  items?: string[];
}): Promise => {
  consola.info('Start purging CDN');
  await createInvalidation({
    DistributionId: cloudFrontId,
    InvalidationBatch: {
      CallerReference: String(new Date().getTime()),
      Paths: {
        Quantity: 1,
        Items: items,
      },
    },
  });
  consola.success('Succeeded in purging CDN');
};
github universal-vue / uvue / packages / @uvue / devtools / cli / utils.js View on Github external
clinicApi.visualize(filepath, `${filepath}.html`, async err => {
        if (err) return reject(err);

        await fs.move(`./${filepath}`, `.devtools/${filepath}`);
        await fs.move(`./${filepath}.html`, `.devtools/${filepath}.html`);

        consola.success('Opening report...');
        await opn(`.devtools/${filepath}.html`);
        resolve();
      });
    });