How to use the colorette.dim function in colorette

To help you get started, we’ve selected a few colorette 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 intl-wc / intl / packages / cli / src / commands / init.ts View on Github external
const pattern = /^\.intl\/?\s*$/gm;
        if (!(await inGitIgnore(pattern))) {
            const ignore = '.intl/';
            const header = '# Intl generated schemas (https://intljs.com/docs/schemas)';
            await addToGitIgnore(header, ignore);
        };
    }

    const { language, phrase } = greeting();
    const time = printDuration(Date.now() - startTime);

    console.log(`\n  ${bold(phrase)} ${dim(`(that's "Hello world!" in ${italic(language)})`)}

${green('✔')} Project initialized ${dim(time)}

  ${dim('Next steps:')}
    ${dim(terminalPrompt())} ${green('intl add ')}
    ${dim(terminalPrompt())} ${green(`cd ${srcDir}`)}
`)
}
github biesbjerg / ngx-translate-extract / src / cli / tasks / extract.task.ts View on Github external
protected printEnabledParsers(): void {
		this.out(cyan('Enabled parsers:'));
		if (this.parsers.length) {
			this.out(cyan(dim(this.parsers.map(parser => `- ${parser.constructor.name}`).join('\n'))));
		} else {
			this.out(cyan(dim('(none)')));
		}
		this.out();
	}
github biesbjerg / ngx-translate-extract / src / cli / tasks / extract.task.ts View on Github external
protected printEnabledPostProcessors(): void {
		this.out(cyan('Enabled post processors:'));
		if (this.postProcessors.length) {
			this.out(cyan(dim(this.postProcessors.map(postProcessor => `- ${postProcessor.constructor.name}`).join('\n'))));
		} else {
			this.out(cyan(dim('(none)')));
		}
		this.out();
	}
github biesbjerg / ngx-translate-extract / src / cli / tasks / extract.task.ts View on Github external
protected printEnabledCompiler(): void {
		this.out(cyan('Compiler:'));
		this.out(cyan(dim(`- ${this.compiler.constructor.name}`)));
		this.out();
	}
}
github intl-wc / intl / packages / cli / src / utils / logger.ts View on Github external
let header = '';

    if (d.header && d.header !== 'Build Error') {
        header += d.header;
    }

    if (d.relFilePath) {
        if (header.length > 0) {
            header += ': ';
        }

        header += color.cyan(d.relFilePath);

        if (typeof d.lineNumber === 'number' && d.lineNumber > -1) {
            header += color.dim(`:`);
            header += color.yellow(`${d.lineNumber}`);

            if (typeof d.columnNumber === 'number' && d.columnNumber > -1) {
                header += color.dim(`:`);
                header += color.yellow(`${d.columnNumber}`);
            }
        }
    }

    if (header.length > 0) {
        outputLines.unshift(INDENT + header);
    }

    outputLines.push('');

    if (d.lines && d.lines.length) {
github biesbjerg / ngx-translate-extract / src / cli / tasks / extract.task.ts View on Github external
protected printEnabledPostProcessors(): void {
		this.out(cyan('Enabled post processors:'));
		if (this.postProcessors.length) {
			this.out(cyan(dim(this.postProcessors.map(postProcessor => `- ${postProcessor.constructor.name}`).join('\n'))));
		} else {
			this.out(cyan(dim('(none)')));
		}
		this.out();
	}
github biesbjerg / ngx-translate-extract / src / cli / tasks / extract.task.ts View on Github external
this.readDir(dir, this.options.patterns).forEach(filePath => {
				this.out(dim('- %s'), filePath);
				const contents: string = fs.readFileSync(filePath, 'utf-8');
				this.parsers.forEach(parser => {
					const extracted = parser.extract(contents, filePath);
					if (extracted instanceof TranslationCollection) {
						collection = collection.union(extracted);
					}
				});
			});
		});
github intl-wc / intl / packages / cli / src / utils / logger.ts View on Github external
lines.forEach((l) => {
            if (!isMeaningfulLine(l.text)) {
                return;
            }

            let msg = `L${l.lineNumber}:  `;
            while (msg.length < INDENT.length) {
                msg = ' ' + msg;
            }

            let text = l.text as string;
            if (l.errorCharStart > -1) {
                text = highlightError(text, l.errorCharStart, l.errorLength as number);
            }

            msg = color.dim(msg);
            msg += text;

            outputLines.push(msg);
        });
github saojs / kopy / lib / logger.js View on Github external
fileMoveAction(from, to) {
    if (this.options.logLevel < 3) {
      return
    }
    this.info(
      `${colors.blue('Moved')} ${colors.green(
        path.relative(process.cwd(), from)
      )} ${colors.dim('->')} ${colors.green(path.relative(process.cwd(), to))}`
    )
  }
}