How to use the colors-cli/safe.cyan function in colors-cli

To help you get started, we’ve selected a few colors-cli 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 kktjs / kkt-ssr / packages / create-kkt-app / lib / loadExample.js View on Github external
if (appPkg) {
        if (appPkg.dependencies && appPkg.dependencies[dependName]) {
          appPkg.dependencies[dependName] = `^${pkg.data.version}`;
        }
        if (appPkg.devDependencies && appPkg.devDependencies[dependName]) {
          appPkg.devDependencies[dependName] = `^${pkg.data.version}`;
        }
        fs.writeFileSync(appPkgPath, JSON.stringify(appPkg, null, 2));
      }
      output.success(
        `Dependent on ${output.cmd(dependName)} version has been set.`
      );
    }
    await installDeps(projectPath, 'npm');
    // eslint-disable-next-line
    console.log(`🎉  ${color.green('✔')} successfully installed ${color.cyan(projectName)} dependencies..`);
    // eslint-disable-next-line
    console.log(
      '👉  Get started with the following commands:\n\n' +
      `${projectPath === process.cwd() ? '' : color.cyan(`   ${color.white('$')} cd ${projectName}\n`)}` +
      `   ${color.cyan(`${color.white('$')} npm run start\n\n`)}`
    );
  }).catch((err) => {
    stopExampleSpinner();
github kktjs / kkt / script / create / loadExample.js View on Github external
if (appPkg) {
        if (appPkg.dependencies && appPkg.dependencies[dependName]) {
          appPkg.dependencies[dependName] = `^${pkg.data.version}`;
        }
        if (appPkg.devDependencies && appPkg.devDependencies[dependName]) {
          appPkg.devDependencies[dependName] = `^${pkg.data.version}`;
        }
        fs.writeFileSync(appPkgPath, JSON.stringify(appPkg, null, 2));
      }
      output.success(
        `Dependent on ${output.cmd(dependName)} version has been set.`
      );
    }
    await installDeps(projectPath, 'npm');
    // eslint-disable-next-line
    console.log(`🎉  ${color.green('✔')} successfully installed ${color.cyan(projectName)} dependencies..`);
    // eslint-disable-next-line
    console.log(
      '👉  Get started with the following commands:\n\n' +
      `${projectPath === process.cwd() ? '' : color.cyan(`   ${color.white('$')} cd ${projectName}\n`)}` +
      `   ${color.cyan(`${color.white('$')} npm run start\n\n`)}`
    );
  }).catch((err) => {
    stopExampleSpinner();
github kktjs / kkt / src / Creator.js View on Github external
stopSpinner();
    // commit initial state
    let gitCommitFailed = false;
    if (tempDir) {
      const copyTemp = await copyTemplate(tempDir, targetDir, { name, KKT_VERSION });
      if (copyTemp && copyTemp.length > 0) {
        copyTemp.sort().forEach((createdFile) => {
          log(`   ${'create'.green} ${createdFile.replace(targetDir, `${name}`)}`);
        });
        log('\n⚙  Installing dependencies. This might take a while...\n');
        await installDeps(targetDir, 'npm', cliOptions.registry);
        log(`\n🎉 ${'✔'.green} Successfully created project ${name.yellow}.`);
        log(
          '👉 Get started with the following commands:\n\n' +
          `${targetDir === process.cwd() ? '' : chalk.cyan(`   ${chalk.white('$')} cd ${name}\n`)}` +
          `   ${chalk.cyan(`${chalk.white('$')} npm run start\n\n`)}`
        );
        // 提交第一次记录
        if (shouldInitGit) {
          await this.run('pwd');
          await this.run('git add -A');
          const msg = typeof cliOptions.git === 'string' ? cliOptions.git : 'Initial commit';
          try {
            await this.run('git', ['commit', '-m', msg]);
          } catch (e) {
            gitCommitFailed = true;
          }
        }
      } else {
        return log(`  Copy Tamplate Error: ${copyTemp} !!!`.red);
      }
    }