From f19ac916cc63bc680e350072e9061d55863e9ebb Mon Sep 17 00:00:00 2001 From: seanyusa Date: Sun, 12 Dec 2021 19:11:51 -0600 Subject: [PATCH 1/3] improve success output for create-turbo within current directory --- create-turbo/src/index.ts | 67 ++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 36 deletions(-) diff --git a/create-turbo/src/index.ts b/create-turbo/src/index.ts index 633a531670531..81d1c2026e5c6 100644 --- a/create-turbo/src/index.ts +++ b/create-turbo/src/index.ts @@ -199,46 +199,41 @@ async function run() { process.chdir(projectDir); tryGitInit(relativeProjectDir); - if (projectDirIsCurrentDir) { - console; - console.log( - `${chalk.bold( - turboGradient(">>> Success!") - )} Check the README for development and deploy instructions!` - ); - } else { - console.log( - `${chalk.bold( - turboGradient(">>> Success!") - )} Your new Turborepo is ready. ` - ); - console.log(); - console.log(`To build all apps and packages, run the following:`); - console.log(); + console.log( + `${chalk.bold(turboGradient(">>> Success!"))} Your new Turborepo is ready. ` + ); + console.log(); + console.log(`To build all apps and packages, run the following:`); + console.log(); + if (!projectDirIsCurrentDir) { console.log(` cd ${relativeProjectDir}`); - console.log(` ${answers.packageManager} run build`); - console.log(); - console.log(`To develop all apps and packages, run the following:`); - console.log(); + } + console.log(` ${answers.packageManager} run build`); + console.log(); + console.log(`To develop all apps and packages, run the following:`); + console.log(); + if (!projectDirIsCurrentDir) { console.log(` cd ${relativeProjectDir}`); - console.log(` ${answers.packageManager} run dev`); - console.log(); - console.log(`Turborepo will cache locally by default. For an additional`); - console.log(`speed boost, enable Remote Caching (beta) with Vercel by`); - console.log(`entering the following commands:`); - console.log(); + } + console.log(` ${answers.packageManager} run dev`); + console.log(); + console.log(`Turborepo will cache locally by default. For an additional`); + console.log(`speed boost, enable Remote Caching (beta) with Vercel by`); + console.log(`entering the following commands:`); + console.log(); + if (!projectDirIsCurrentDir) { console.log(` cd ${relativeProjectDir}`); - console.log(` npx turbo login`); - console.log(); - console.log( - `For more info, checkout the README in ${chalk.bold(relativeProjectDir)}` - ); - console.log( - `as well as the official Turborepo docs ${chalk.underline( - "https://turborepo.org" - )}` - ); } + console.log(` npx turbo login`); + console.log(); + console.log( + `For more info, checkout the README in ${chalk.bold(relativeProjectDir)}` + ); + console.log( + `as well as the official Turborepo docs ${chalk.underline( + "https://turborepo.org" + )}` + ); } const update = checkForUpdate(cliPkgJson).catch(() => null); From 8ea966029102ebdbc5c8532a37da63631c27c780 Mon Sep 17 00:00:00 2001 From: seanyusa Date: Sun, 12 Dec 2021 19:14:00 -0600 Subject: [PATCH 2/3] update docs link in create-turbo success output --- create-turbo/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/create-turbo/src/index.ts b/create-turbo/src/index.ts index 81d1c2026e5c6..3283115232ea3 100644 --- a/create-turbo/src/index.ts +++ b/create-turbo/src/index.ts @@ -231,7 +231,7 @@ async function run() { ); console.log( `as well as the official Turborepo docs ${chalk.underline( - "https://turborepo.org" + "https://turborepo.org/docs" )}` ); } From f41c8abb6e9f3cad3326717db6e0b21b6dfd8504 Mon Sep 17 00:00:00 2001 From: seanyusa Date: Sun, 12 Dec 2021 19:39:34 -0600 Subject: [PATCH 3/3] check projectDirIsCurrentDir for success output log --- create-turbo/src/index.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/create-turbo/src/index.ts b/create-turbo/src/index.ts index 3283115232ea3..1ecf1c4f7004a 100644 --- a/create-turbo/src/index.ts +++ b/create-turbo/src/index.ts @@ -226,9 +226,13 @@ async function run() { } console.log(` npx turbo login`); console.log(); - console.log( - `For more info, checkout the README in ${chalk.bold(relativeProjectDir)}` - ); + if (projectDirIsCurrentDir) { + console.log(`For more info, checkout the README`); + } else { + console.log( + `For more info, checkout the README in ${chalk.bold(relativeProjectDir)}` + ); + } console.log( `as well as the official Turborepo docs ${chalk.underline( "https://turborepo.org/docs"