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

feat(tui): Set TURBO_IS_TUI environment variable when using TUI. #8897

Merged
merged 3 commits into from
Aug 1, 2024

Conversation

anthonyshew
Copy link
Contributor

@anthonyshew anthonyshew commented Aug 1, 2024

Description

Tools being used inside Turborepo tasks may want to know if they are being ran in our multiplexer, similar to the way other terminal tooling set environment variables that other programs can read (e.g. ZSH,TMUX, ALACRITTY_WINDOW_ID).

In this PR, we're exposing a TURBO_IS_TUI variable for this purpose.

Testing Instructions

Using the with-shell-commands example, I edited one of the build scripts to echo the value.

With TUI:

TURBO_UI devturbo build --force --skip-infer

<omitted for brevity>

┌ pkg-b#build > cache bypass, force executing 33b029c222753bd2
│
│
│ > pkg-b@ prebuild /Users/anthonyshew/projects/debugs/with-shell-commands/packages/pkg-b
│ > echo "Executing pre-build step..."
│
│ Executing pre-build step...
│
│ > pkg-b@ build /Users/anthonyshew/projects/debugs/with-shell-commands/packages/pkg-b
│ > echo $TURBO_IS_TUI
│
│ true
└────>

Without TUI:

TURBO_UI=0 devturbo build --force --skip-infer --filter=pkg-b
turbo 2.0.11

• Packages in scope: pkg-b
• Running build in 1 packages
• Remote caching disabled

pkg-b:prebuild: > echo "Executing pre-build step..."
pkg-b:prebuild:
pkg-b:prebuild: Executing pre-build step...
pkg-b:build: cache bypass, force executing 33b029c222753bd2
pkg-b:build:
pkg-b:build:
pkg-b:build: > pkg-b@ prebuild /Users/anthonyshew/projects/debugs/with-shell-commands/packages/pkg-b
pkg-b:build: > echo "Executing pre-build step..."
pkg-b:build:
pkg-b:build: Executing pre-build step...
pkg-b:build:
pkg-b:build: > pkg-b@ build /Users/anthonyshew/projects/debugs/with-shell-commands/packages/pkg-b
pkg-b:build: > echo $TURBO_IS_TUI
pkg-b:build:
pkg-b:build:

Copy link

vercel bot commented Aug 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 1, 2024 4:56am
9 Skipped Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview Aug 1, 2024 4:56am
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview Aug 1, 2024 4:56am
examples-gatsby-web ⬜️ Ignored (Inspect) Visit Preview Aug 1, 2024 4:56am
examples-kitchensink-blog ⬜️ Ignored (Inspect) Visit Preview Aug 1, 2024 4:56am
examples-native-web ⬜️ Ignored (Inspect) Visit Preview Aug 1, 2024 4:56am
examples-svelte-web ⬜️ Ignored (Inspect) Visit Preview Aug 1, 2024 4:56am
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview Aug 1, 2024 4:56am
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview Aug 1, 2024 4:56am
rust-docs ⬜️ Ignored (Inspect) Visit Preview Aug 1, 2024 4:56am

Copy link
Contributor

github-actions bot commented Aug 1, 2024

🟢 Turbopack Benchmark CI successful 🟢

Thanks

Copy link
Contributor

github-actions bot commented Aug 1, 2024

🟢 CI successful 🟢

Thanks

@thdxr
Copy link

thdxr commented Aug 1, 2024

LGTM

Copy link
Contributor

@arlyon arlyon left a comment

Choose a reason for hiding this comment

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

Approving but what is the purpose of the grep file?

@chris-olszewski chris-olszewski merged commit 3437a3c into main Aug 1, 2024
69 checks passed
@chris-olszewski chris-olszewski deleted the shew-7e0cd branch August 1, 2024 12:31
@anthonyshew
Copy link
Contributor Author

@arlyon Oops, I was doing stuff and used a > instead of | at some point. Fixed in #8903

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: docs Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants