Skip to content

Commit

Permalink
Spruce up Remote Cache linking message. (#8494)
Browse files Browse the repository at this point in the history
### Description

Before:
![CleanShot 2024-06-14 at 20 41
32@2x](https://github.com/vercel/turbo/assets/35677084/f697614d-65c6-47f0-be6d-2b2cf2f23bbf)


After:
![CleanShot 2024-06-14 at 20 41
08@2x](https://github.com/vercel/turbo/assets/35677084/644cda22-1636-4375-a51d-859699295d84)

### Testing instructions
👀
  • Loading branch information
anthonyshew committed Jun 17, 2024
1 parent a089655 commit 7e76f0e
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions crates/turborepo-lib/src/commands/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use thiserror::Error;
use turborepo_api_client::{CacheClient, Client};
#[cfg(not(test))]
use turborepo_ui::CYAN;
use turborepo_ui::{DialoguerTheme, BOLD, GREY, UNDERLINE};
use turborepo_ui::{DialoguerTheme, BOLD, GREY};
use turborepo_vercel_api::{CachingStatus, Space, Team};

use crate::{
Expand Down Expand Up @@ -89,11 +89,9 @@ pub(crate) enum SelectedSpace<'a> {
Space(&'a Space),
}

pub(crate) const REMOTE_CACHING_INFO: &str = " Remote Caching shares your cached Turborepo task \
outputs and logs across
all your team’s Vercel projects. It also can share outputs
with other services that enable Remote Caching, like CI/CD systems.
This results in faster build times and deployments for your team.";
pub(crate) const REMOTE_CACHING_INFO: &str =
"Remote Caching makes your caching multiplayer,\nsharing build outputs and logs between \
developers and CI/CD systems.\n\nBuild and deploy faster.";
pub(crate) const REMOTE_CACHING_URL: &str =
"https://turbo.build/repo/docs/core-concepts/remote-caching";
pub(crate) const SPACES_URL: &str = "https://vercel.com/docs/workflow-collaboration/vercel-spaces";
Expand Down Expand Up @@ -179,13 +177,10 @@ pub async fn link(
match target {
LinkTarget::RemoteCache => {
println!(
">>> Remote Caching
{}
For more info, see {}
",
"\n{}\n\n{}\n\nFor more information, visit: {}\n",
base.ui.rainbow(">>> Remote Caching"),
REMOTE_CACHING_INFO,
base.ui.apply(UNDERLINE.apply_to(REMOTE_CACHING_URL))
REMOTE_CACHING_URL
);

if !should_link_remote_cache(base, &repo_root_with_tilde)? {
Expand Down Expand Up @@ -281,7 +276,7 @@ pub async fn link(
For more info, see {}
",
base.ui.apply(UNDERLINE.apply_to(SPACES_URL))
SPACES_URL
);

if !should_link_spaces(base, &repo_root_with_tilde)? {
Expand Down Expand Up @@ -490,11 +485,12 @@ fn should_link_remote_cache(_: &CommandBase, _: &str) -> Result<bool, Error> {
#[cfg(not(test))]
fn should_link_remote_cache(base: &CommandBase, location: &str) -> Result<bool, Error> {
let prompt = format!(
"{}{} {}",
"{}{} {}{}",
base.ui.apply(BOLD.apply_to(GREY.apply_to("? "))),
base.ui
.apply(BOLD.apply_to("Would you like to enable Remote Caching for")),
base.ui.apply(BOLD.apply_to(CYAN.apply_to(location)))
.apply(BOLD.apply_to("Enable Vercel Remote Cache for")),
base.ui.apply(BOLD.apply_to(CYAN.apply_to(location))),
base.ui.apply(BOLD.apply_to(" ?"))
);

Confirm::new()
Expand Down

0 comments on commit 7e76f0e

Please sign in to comment.