How to use terminal-link - 10 common examples

To help you get started, we’ve selected a few terminal-link 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 googledatastudio / tooling / packages / dscc-gen / src / connector / index.ts View on Github external
await cloneAppsScriptProject(projectPath, config);
    } else {
      await createAppsScriptProject(
        projectPath,
        projectName,
        execOptions,
        config
      );
    }
    await manageDeployments(projectPath, config);

    // Remove temp directory.
    files.remove(projectPath, 'temp');

    const connectorOverview = format.blue(
      terminalLink(
        'connector overview',
        'https://developers.google.com/datastudio/connector/'
      )
    );
    const styledProjectName = format.green(projectName);
    const cdDirection = format.yellow(`cd ${projectName}`);
    const runCmd = config.yarn ? 'yarn' : 'npm run';
    const open = format.red(`${runCmd} open`);
    const push = format.blue(`${runCmd} push`);
    const watch = format.green(`${runCmd} watch`);
    const prettier = format.yellow(`${runCmd} prettier`);
    const tryLatest = format.red(`${runCmd} try_latest`);
    const tryProduction = format.blue(`${runCmd} try_production`);
    const updateProduction = format.green(`${runCmd} update_production`);

    console.log(
github keystonejs / keystone / packages / app-graphql-playground / lib / devQuery.js View on Github external
// Store the loadable GraphiQL URL against that id
  const queryParams = buildGraphiqlQueryParams(req.body);
  devQueryLog[id] = `${graphiqlPath}?${queryParams}`;

  const ast = gql(req.body.query);

  const operations = ast.definitions.map(
    def => `${def.operation} ${def.name ? `${def.name.value} ` : ''}{ .. }`
  );

  // Make the queries clickable in the terminal where supported
  console.log(
    terminalLink(
      `${chalk.blue(operations.map(op => chalkColour.bold(op)).join(', '))}${
        terminalLink.isSupported ? ` (πŸ‘ˆ click to view)` : ''
      }`,
      `${req.protocol}://${req.get('host')}${devQueryPath}?id=${id}`,
      {
        // Otherwise, show the link on a new line
        fallback: (text, url) => `${text}\n${chalkColour.gray(` β€· inspect @ ${url}`)}`,
      }
    )
  );

  // finally pass requests to the actual graphql endpoint
  next();
};
github umijs / umi / packages / umi-build-dev / src / plugins / commands / block / util.ts View on Github external
blockItems.forEach(block => {
      if (block.type === 'block') {
        const blockName = join(parentPath, block.path);
        const { previewUrl } = block;
        let name = `πŸ“¦  ${chalk.cyan(blockName)}  `;
        if (hasLink) {
          // ι“ΎζŽ₯到 pro ηš„ι’„θ§ˆη•Œι’
          // AccountCenter -> account/center
          const link = terminalLink('ι’„θ§ˆ', `https://preview.pro.ant.design/${previewUrl}`);
          // ε’žεŠ δΈ€δΈͺι’„θ§ˆηš„η•Œι’
          name += link;
        }
        blockArray.push({
          name,
          value: blockName,
          key: blockName,
        });
      }
      if (block.type === 'dir') {
        return loopBlocks(block.blocks, block.path);
      }
      return null;
    });
  };
github googledatastudio / tooling / packages / dscc-scripts / src / connector.ts View on Github external
const openTemplate = async (): Promise => {
  const manifest = await getAppsScriptManifest();
  const templatePath = ['dataStudio', 'templates', 'default'];
  const templateId = templatePath.reduce((acc, property) => {
    return acc === undefined ? undefined : acc[property];
  }, manifest);
  if (templateId === undefined) {
    throw invalidAppsScriptManifest(templatePath);
  }
  const templateUrl = `https://datastudio.google.com/c/reporting/${templateId}`;
  const formattedUrl = format.green(terminalLink(`open template`, templateUrl));
  console.log(`Opening: ${formattedUrl}`);
  await open(templateUrl);
};
github TradeMe / tractor / packages / server / src / application.ts View on Github external
server.listen(tractor.config.port, () => {
        const link = terminalLink('tractor', `http://localhost:${(server.address() as AddressInfo).port}`, {
            fallback: (_, url): string => url
        });
        info(`tractor is running at ${link}`);
    });
}, 'tractor', 'server');
github jamiebuilds / is-mergeable / src / cli.ts View on Github external
result.pullRequestTitle,
		result.repoOwner,
		result.repoName,
		result.pullRequestNumber,
	)
	println(
		"{dim.italic {bold @%s} wants to merge %s %s into {bold %s} from {bold %s}}",
		result.pullRequestCreator,
		result.pullRequestCommits,
		result.pullRequestCommits === 1 ? "commit" : "commits",
		result.pullRequestBaseRef,
		result.pullRequestHeadRef,
	)
	println(
		"{blue %s}",
		terminalLink(result.pullRequestUrl, result.pullRequestUrl, {
			fallback: text => text,
		}),
	)
	println("")

	if (result.pullRequestState === "open") {
		println("  {green {bold βœ“ Open}}")
	} else {
		println("  {red {bold βœ— Closed}}")
	}

	if (result.pullRequeseGitMergeable) {
		println("  {green {bold βœ“ Mergeable}}")
	} else {
		println("  {yellow {bold βœ— Mergeable}}")
	}
github splash-cli / splash-cli / src / extra / utils.js View on Github external
export function errorHandler(error) {
	const spinner = new Ora();
	spinner.stop();
	printBlock(
		'',
		chalk`{bold {red OOps! We got an error!}}`,
		'',
		chalk`Please report it: {underline {green ${terminalLink(
			'on GitHub',
			'https://github.com/splash-cli/splash-cli/issues',
		)}}}`,
		'',
		chalk`{yellow {bold Splash Error}:}`,
		'',
	);

	logger.error(error);
}
github twilio-labs / twilio-run / src / printers / deploy.ts View on Github external
function prettyPrintDeployedResources(
  config: DeployLocalProjectConfig,
  result: DeployResult
) {
  const twilioConsoleLogsLink = terminalLink(
    'Open the Twilio Console',
    getTwilioConsoleDeploymentUrl(result.serviceSid, result.environmentSid),
    {
      fallback: (text: string, url: string) => chalk.dim(url),
    }
  );

  writeOutput(
    chalk`
{bold.cyan.underline Deployment Details}
{bold.cyan Domain:} ${result.domain}
{bold.cyan Service:}
   ${config.serviceName} {dim (${result.serviceSid})}
{bold.cyan Environment:}
   ${config.functionsEnv} {dim (${result.environmentSid})} 
{bold.cyan Build SID:}
github sindresorhus / np / source / util.js View on Github external
exports.linkifyCommit = (url, commit) => {
	if (!(url && terminalLink.isSupported)) {
		return commit;
	}

	return terminalLink(commit, `${url}/commit/${commit}`);
};

terminal-link

Create clickable links in the terminal

MIT
Latest version published 4 years ago

Package Health Score

70 / 100
Full package analysis

Popular terminal-link functions