Skip to content

Commit 49a9424

Browse files
committed
feat: Optional TURBO_SITE environment variable at compilation time for development.
1 parent 3543736 commit 49a9424

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,16 @@ There are many open-source Turborepos out in the community that you can test wit
144144

145145
## Debugging tips
146146

147+
### Links in error messages
148+
149+
Many of Turborepo's error messages include links to information or documentation to help end users.
150+
151+
The base URL for the links can be set to a value of your choosing by providing a `TURBO_SITE` environment variable at compilation time.
152+
153+
```bash
154+
TURBO_SITE="http://localhost:3000" cargo build
155+
```
156+
147157
### Verbose logging
148158

149159
Verbose logging can be enabled by using the `-v`, `-vv`, or `-vvv` flag on your `turbo` command, depending on the level of logging you're looking for.

crates/turborepo-errors/src/lib.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ use miette::{Diagnostic, NamedSource, SourceSpan};
99
use serde::{Deserialize, Serialize};
1010
use thiserror::Error;
1111

12-
pub const TURBO_SITE: &str = "https://turbo.build";
12+
/// Base URL for links supplied in error messages. You can use the TURBO_SITE
13+
/// environment variable at compile time to set a base URL for easier debugging.
14+
///
15+
/// When TURBO_SITE is not provided at compile time, the production site will be
16+
/// used.
17+
pub const TURBO_SITE: &str = match option_env!("TURBO_SITE") {
18+
Some(url) => url,
19+
None => "https://turbo.build",
20+
};
1321

1422
/// A little helper to convert from biome's syntax errors to miette.
1523
#[derive(Debug, Error, Diagnostic)]

0 commit comments

Comments
 (0)