How to use the common-tags.stripIndent function in common-tags

To help you get started, we’ve selected a few common-tags 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 thebespokepixel / trucolor / src / cli / index.js View on Github external
	const titling = mode => stripIndent(colorReplacer)`
		${`title|${metadata.name}`}${`dim| │ v${metadata.version()}`}
		Mode: ${mode}
	`
	switch (argv.verbose) {
github twilio-labs / twilio-run / src / printers / list.ts View on Github external
function prettyPrintBuilds(build: BuildResource): string {
  let status = chalk.reset.yellow(build.status);
  if (build.status === 'completed') {
    status = chalk.reset.green(`${logSymbols.success} ${build.status}`);
  } else if (build.status === 'failed') {
    status = chalk.reset.red(`${logSymbols.error} ${build.status}`);
  }
  return stripIndent(chalk`
      {bold ${build.sid}} {dim [${status}]}
      {dim │} {cyan Date:} {dim ${formatDate(build.date_updated)}}
  `);
}
github 4Catalyzer / astroturf / src / plugin.js View on Github external
styles.forEach(({ absoluteFilePath, value }) => {
          outputFileSync(absoluteFilePath, stripIndent([value]));
        });
      }
github dotansimha / graphql-code-generator / packages / graphql-codegen-cli / src / utils / listr-renderer.ts View on Github external
.map(({ msg, rawError }, i) => {
            const source: string | Source | undefined = (err.errors[i] as any).source;

            msg = msg ? chalk.gray(indentString(stripIndent(`${msg}`), 4)) : null;
            const stack = rawError.stack ? chalk.gray(indentString(stripIndent(rawError.stack), 4)) : null;

            if (source) {
              const sourceOfError = typeof source === 'string' ? source : source.name;
              const title = indentString(`${logSymbol.error} ${sourceOfError}`, 2);

              return [title, msg, stack, stack].filter(Boolean).join('\n');
            }

            return [msg, stack].filter(Boolean).join('\n');
          })
          .join('\n\n');
github lttb / reshadow / packages / babel / index.js View on Github external
isInsideComment = getIsInsideComment(isInsideComment, value.raw);

            const node = expressions[i];
            if (node) {
                if (isInsideComment) {
                    code += `\${${
                        t.isIdentifier(node) ? node.name : 'someVar'
                    }}`;
                } else {
                    const index = getIndex(node, i);
                    code += `var(${getCSSVarName(index)})`;
                }
            }
        });

        code = stripIndent(code);

        const append = t.taggedTemplateExpression(
            t.identifier(addImport('css')),
            t.templateLiteral(
                [
                    t.templateElement({
                        raw: code,
                        cooked: code,
                    }),
                ],
                [],
            ),
        );

        return append;
    };
github twilio-labs / twilio-run / src / printers / list.ts View on Github external
function printListResultTerminal(result: ListResult, config: ListConfig): void {
  const sections = Object.keys(result) as ListOptions[];
  const output = sections
    .map(section => prettyPrintSection(section, result[section]))
    .join(`\n\n${chalk.dim(LONG_LINE)}\n\n`);

  let metaInfo = stripIndent(chalk`
    {cyan.bold Account}      ${config.accountSid}
    {cyan.bold Token}        ${redactPartOfString(config.authToken)}
  `);

  if (config.serviceSid || config.serviceName) {
    metaInfo += chalk`\n{cyan.bold Service}      ${config.serviceSid ||
      config.serviceName}`;
  }

  if (config.environment) {
    metaInfo += chalk`\n{cyan.bold Environment}  ${config.environment}`;
  }

  logger.info(metaInfo + '\n');
  writeOutput(output);
}
github react-bootstrap / react-bootstrap / www / src / components / CodeBlock.js View on Github external
const CodeBlock = mapProps(({ mode, codeText, ...props }) => ({
  ...props,
  dangerouslySetInnerHTML: {
    __html:
      mode === null ? codeText : prism(stripIndent([codeText]), mode || 'jsx'),
  },
}))(
  styled('pre')`
github twilio-labs / twilio-run / src / printers / activate.ts View on Github external
export function printActivateResult(result: ActivateResult) {
  logger.info(chalk.cyan.bold('\nActive build available at:'));
  writeOutput(result.domain);

  const twilioConsoleLogsLink = terminalLink(
    'Open the Twilio Console',
    getTwilioConsoleDeploymentUrl(result.serviceSid, result.environmentSid),
    {
      fallback: (text: string, url: string) => chalk.dim(url),
    }
  );

  logger.info(
    '\n' +
      stripIndent(chalk`
    {cyan.bold View Live Logs:}
      ${twilioConsoleLogsLink}
  `)
  );
}
github cypress-io / cypress / cli / lib / cli.js View on Github external
This will work, but it's not recommended.

    If you are trying to pass multiple arguments, separate them with commas instead:
      cypress run --${flag} arg1,arg2,arg3
  `

  if (flag === 'spec') {
    msg += `
    The most common cause of this warning is using an unescaped glob pattern. If you are
    trying to pass a glob pattern, escape it using quotes:
      cypress run --spec "**/*.spec.js"
    `
  }

  logger.log()
  logger.warn(stripIndent(msg))
  logger.log()
}