Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spruce up Remote Cache linking message. #8494

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we not repeat "caching" twice if we're going to change the language? how about:

Suggested change
"Remote Caching makes your caching multiplayer,\nsharing build outputs and logs between \
"Remote Caching makes your tasks multiplayer,\nsharing build outputs and logs between \

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is task caching better? I get that that doesn't make it not say "caching" twice but tasks leaves room for interpretation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷🏾 I don't like task caching that much better, but not going to block on it either!

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
Loading