当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript chalk.grey函数代码示例

本文整理汇总了TypeScript中chalk.grey函数的典型用法代码示例。如果您正苦于以下问题:TypeScript grey函数的具体用法?TypeScript grey怎么用?TypeScript grey使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了grey函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1:

files.forEach(str => {
  console.log(
    fs.statSync(str).isDirectory() ? chalk.cyan(str) :
    str[0] === '.' ? chalk.grey(str) :
    chalk.red(str)
  )
})
开发者ID:ZombieHippie,项目名称:fantastic-repository,代码行数:7,代码来源:upload-artifacts.ts

示例2: setImmediate

              setImmediate(() => {
                const prettyQuery = printGraphql(definitelyQueryDocumentAst)
                  .replace(/\s+/g, ' ')
                  .trim();
                const errorCount = (result.errors || []).length;
                const ms = timeDiff[0] * 1e3 + timeDiff[1] * 1e-6;

                let message: string;
                if (resultStatusCode === 401) {
                  // Users requested that JWT errors were raised differently:
                  //
                  //   https://github.com/graphile/postgraphile/issues/560
                  message = chalk.red(`401 authentication error`);
                } else if (resultStatusCode === 403) {
                  message = chalk.red(`403 forbidden error`);
                } else {
                  message = chalk[errorCount === 0 ? 'green' : 'red'](`${errorCount} error(s)`);
                }

                // tslint:disable-next-line no-console
                console.log(
                  `${message} ${
                    pgRole != null ? `as ${chalk.magenta(pgRole)} ` : ''
                  }in ${chalk.grey(`${ms.toFixed(2)}ms`)} :: ${prettyQuery}`,
                );
              });
开发者ID:calebmer,项目名称:postgraphql,代码行数:26,代码来源:createPostGraphileHttpRequestHandler.ts

示例3: task

task(':publish', async () => {
  const tag = argv['tag'];
  const version = buildConfig.projectVersion;
  const currentDir = process.cwd();

  console.log();
  if (!tag) {
    console.log(grey('> You can specify the tag by passing --tag=labelName.\n'));
    console.log(green(`Publishing version "${version}" to the latest tag...`));
  } else {
    console.log(yellow(`Publishing version "${version}" to the ${tag} tag...`));
  }
  console.log();

  if (releasePackages.length > 1) {
    console.warn(yellow('Warning: Multiple packages will be released.'));
    console.warn(yellow('Warning: Packages to be released:', releasePackages.join(', ')));
    console.warn();
  }

  console.log(yellow('> Make sure to check the "requiredAngularVersion" in the package.json.'));
  console.log(yellow('> The version in the config defines the peer dependency of Angular.'));
  console.log();

  // Iterate over every declared release package and publish it on NPM.
  for (const packageName of releasePackages) {
    await _execNpmPublish(tag, packageName);
  }

  process.chdir(currentDir);
});
开发者ID:shlomiassaf,项目名称:material2,代码行数:31,代码来源:publish-task.ts

示例4: reportDiagnostic

    public static reportDiagnostic( diagnostic: ts.Diagnostic ) {
        if ( !diagnostic ) {
            return;
        }

        var output = "";

        if ( diagnostic.file ) {
            var loc = ts.getLineAndCharacterOfPosition( diagnostic.file, diagnostic.start );

            output += chalk.gray( `${ diagnostic.file.fileName }(${ loc.line + 1 },${ loc.character + 1 }): ` );
        }

        var category;

        switch ( diagnostic.category ) {
            case ts.DiagnosticCategory.Error:
                category = chalk.red( ts.DiagnosticCategory[diagnostic.category].toLowerCase() );
                break;
            case ts.DiagnosticCategory.Warning:
                category = chalk.yellow( ts.DiagnosticCategory[diagnostic.category].toLowerCase() );
                break;
            default:
                category = chalk.green( ts.DiagnosticCategory[diagnostic.category].toLowerCase() );
        }

        output += `${category} TS${chalk.white( diagnostic.code + '' )}: ${chalk.grey( ts.flattenDiagnosticMessageText( diagnostic.messageText, "\n" ) )}`;

        Logger.log( output );
    }
开发者ID:danielmoore,项目名称:tsproject,代码行数:30,代码来源:DiagnosticsReporter.ts

示例5:

 group.commits = group.commits.filter((commit: any) => {
   // Note that we cannot compare the SHA's because the commits will have a different SHA
   // if they are being cherry-picked into a different branch.
   if (previousContent.includes(commit.header)) {
     console.log(grey(`Skipping: "${commit.header}" (${commit.hash})`));
     return false;
   }
   return true;
 });
开发者ID:shlomiassaf,项目名称:material2,代码行数:9,代码来源:changelog.ts

示例6: authenticator

    authenticator({client: {jwt, publicKeyPath, columns: 100}}, (message:string, isSuccess:boolean) => {

      expect(authService.verify).toHaveBeenCalledWith(jwt, '/tmp/path/to/key');

      expect(vantageScope.log)
        .toHaveBeenCalledWith(chalk.grey(`You were authenticated with a JSON Web token verified against the public key at /tmp/path/to/key`));

      expect(isSuccess).toBe(true);
      expect(message).toBe(null);
      cb();
    });
开发者ID:ubiquits,项目名称:ubiquits,代码行数:11,代码来源:jwtAuthStrategy.spec.ts

示例7: lint

export default async function lint() {
  // typescript
  const typescriptFileFailures = await lintAsync();
  if (typescriptFileFailures.length) {
    // log all failures with some basic formatting
    error('');
    for (const fileFailure of typescriptFileFailures) {
      error(`Found ${yellow(fileFailure.failureCount.toString())} failure(s) in ${yellow(fileFailure.failures[0].getFileName())}:`);
      for (const failure of fileFailure.failures) {
        const fileName = failure.getFileName();
        if (!sourceFileLines[fileName]) {
          // attention: sourceFile is a private property!
          sourceFileLines[fileName] = (failure as any).sourceFile.text.split('\n');
        }
        const lines = sourceFileLines[fileName];

        const { line, character } = failure.getStartPosition().getLineAndCharacter();
        error(`  ${failure.getFailure()} ${grey(`(at [${line + 1}:${character + 1}]: ${lines[line].trim()})`)}`);

      }
      error('');
    }
  }

  // documentation
  const documentationFailures = [];
  if (!project.private) {
    if (!(await existsAsync(join(process.cwd(), 'README.md')))) {
      documentationFailures.push(`You have ${yellow('no README.md')}.`);
    }
    if (!project.keywords || !project.keywords.length) {
      documentationFailures.push(`You have ${yellow('no keywords')} set in your ${yellow('package.json')}.`);
    }
    if (!(await existsAsync(join(process.cwd(), 'examples')))) {
      documentationFailures.push(`You have ${yellow('no examples/')} directory.`);
    } else {
      const contents = (await readdirAsync(join(process.cwd(), 'examples'))).filter(content => content !== '.DS_Store');
      if (!contents.length) {
        documentationFailures.push(`Your ${yellow('examples/')} directory ${yellow('is empty')}.`);
      }
    }
  }
  if (documentationFailures.length) {
    error('');
    error(`You're project ${yellow(`isn't private`)}, but it has ${yellow(documentationFailures.length.toString())} documentation failure(s).`);
    documentationFailures.forEach(msg => error(`  ${msg}`));
    error('');
  }

  if (typescriptFileFailures.length || documentationFailures.length) {
    throw `${cyan('lint')} failed.`;
  }
};
开发者ID:Mercateo,项目名称:typedocs,代码行数:53,代码来源:lint.ts

示例8:

 cols.forEach(colDescription => {
     console.log(chalk.bold(colDescription.name + ': ' + colDescription.count + ' builds'));
     var collection = db.getCollection(colDescription.name);
     var successfulBuilds = collection.find({result: 'SUCCESS'});
     var failedBuilds = collection.find({result: 'FAILURE'});
     var abortedBuilds = collection.find({result: 'ABORTED'});
     var buildingNow = collection.find({building: true});
     
     console.log('\tBuilding now: ' + chalk.bold(buildingNow.length));
     console.log('\tSuccessful builds: ' + chalk.green(successfulBuilds.length));
     console.log('\tFailed builds: ' + chalk.red(failedBuilds.length));
     console.log('\tAborted builds: ' + chalk.grey(abortedBuilds.length));
 });
开发者ID:pierreca,项目名称:dashboards,代码行数:13,代码来源:jenkins.ts

示例9: bannerBg

          .then((payload: any) => {
            remoteCliContext.logger.info(`${payload.username} has been authenticated with token`)
              .debug('Token:', token);
            let displayBanner = `Hi ${payload.username}, Welcome to Ubiquits runtime cli.`;
            if (args.client.columns >= 80) {
              displayBanner = bannerBg(undefined, token);
            }
            this.log(chalk.grey(`You were authenticated with a JSON Web token verified against the public key at ${keyPath}`));
            this.log(displayBanner);
            this.log(` Type 'help' for a list of available commands`);

            return cb(null, true);
          })
开发者ID:ubiquits,项目名称:ubiquits,代码行数:13,代码来源:jwtAuthStrategy.ts

示例10: logQuery

 /**
  * Log a database query to the console
  * @param query SQL query to log
  * @param params values to place in SQL query's placeholders
  * @param t number of ms elapsed while query was running
  */
 protected logQuery(query: string, params: JSONArray, t: number) {
   let tv = timeVal(t);
   let timestring =
     t < 5
       ? chalk.bgGreenBright.black(tv)
       : t < 100 ? chalk.bgYellowBright.black(tv) : chalk.bgRedBright.white(tv);
   logger.info(
     [
       colorizeQuery(query) + ` (${timestring})`,
       `${chalk.grey('PARAMS:')} ${JSON.stringify(params)}`
     ].join('\n')
   );
   return t;
 }
开发者ID:qjac,项目名称:sql-fundamentals,代码行数:20,代码来源:db.ts


注:本文中的chalk.grey函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。