Skip to content

Commit

Permalink
Merge branch 'main' into olszewski/chore_prysk_parrallel
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyshew authored Dec 20, 2024
2 parents a6ab759 + 9582a5a commit 5b93289
Show file tree
Hide file tree
Showing 68 changed files with 996 additions and 470 deletions.
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Thank you for your interest in contributing to Turborepo!
- [Manually testing `turbo`](#manually-testing-turbo)
- [Repositories to test with](#repositories-to-test-with)
- [Debugging tips](#debugging-tips)
- [Verbose logging](#verbose-logging)
- [Verbose logging](#verbose-logging)
- [Crash logs](#crash-logs)
- [Terminal UI debugging](#terminal-ui-debugging)
- [Publishing `turbo` to the npm registry](#publishing-turbo-to-the-npm-registry)
Expand All @@ -31,8 +31,8 @@ You will need to have these dependences installed on your machine to work on thi

- For running tests locally, `jq` and `zstd` are also required.
- macOS: `brew install jq zstd`
- Linux: ``sudo apt update && sudo apt install jq zstd`
- Windows: `choco install jq zstandard
- Linux: `sudo apt update && sudo apt install jq zstd`
- Windows: `choco install jq zstandard`
- On Linux, ensure LLD (LLVM Linker) is installed, as it's not installed by default on many Linux distributions (e.g. `apt install lld`).

## Structure of the repository
Expand Down Expand Up @@ -64,7 +64,7 @@ out of the box. If you wish to select `native-tls`, you may do so by running `ca
## Running tests

> [!IMPORTANT]
> You will need to have `jq` and `zstd` installed on your system in order to run tests. See [General dDependencies](#general-dependencies) for instructions on how to install these tools.
> You will need to have `jq` and `zstd` installed on your system in order to run tests. See [General dependencies](#general-dependencies) for instructions on how to install these tools.
First, install Turborepo globally with your package manager of choice. For instance, with npm, `npm install -g turbo`. This will install the `turbo` binary in your system's `PATH`, making it globally available.

Expand Down Expand Up @@ -219,4 +219,4 @@ To test out the experience of your example with `create-turbo`, run `create-turb
npx create-turbo@latest --example https://github.com/your-org/your-repo/tree/your-branch/...
```

This will allow you to use the example as a uesr would.
This will allow you to use the example as a user would.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ See [CONTRIBUTING.md](./CONTRIBUTING.md) for more information.

The Turborepo community can be found on [GitHub Discussions](https://github.com/vercel/turborepo/discussions), where you can ask questions, voice ideas, and share your projects.

To chat with other community members, you can join the [Turborepo Discord](https://turbo.build/discord).
To chat with other community members, you can join [Vercel Community's `#turborepo` tag](https://vercel.community/tag/turborepo).

Our [Code of Conduct](https://github.com/vercel/turborepo/blob/main/CODE_OF_CONDUCT.md) applies to all Turborepo community channels.

Expand Down
29 changes: 26 additions & 3 deletions crates/turborepo-env/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use thiserror::Error;

pub mod platform;

const DEFAULT_ENV_VARS: [&str; 1] = ["VERCEL_ANALYTICS_ID"];
const DEFAULT_ENV_VARS: &[&str] = ["VERCEL_ANALYTICS_ID", "VERCEL_ENV"].as_slice();

#[derive(Clone, Debug, Error)]
pub enum Error {
Expand All @@ -22,7 +22,7 @@ pub enum Error {
}

// TODO: Consider using immutable data structures here
#[derive(Clone, Debug, Default, Serialize)]
#[derive(Clone, Debug, Default, Serialize, PartialEq)]
#[serde(transparent)]
pub struct EnvironmentVariableMap(HashMap<String, String>);

Expand Down Expand Up @@ -278,7 +278,7 @@ pub fn get_global_hashable_env_vars(
env_at_execution_start: &EnvironmentVariableMap,
global_env: &[String],
) -> Result<DetailedMap, Error> {
let default_env_var_map = env_at_execution_start.from_wildcards(&DEFAULT_ENV_VARS[..])?;
let default_env_var_map = env_at_execution_start.from_wildcards(DEFAULT_ENV_VARS)?;

let user_env_var_set =
env_at_execution_start.wildcard_map_from_wildcards_unresolved(global_env)?;
Expand Down Expand Up @@ -335,4 +335,27 @@ mod tests {
assert_eq!(actual.get("Turbo"), None);
}
}

#[test_case(&[], &["VERCEL_ANALYTICS_ID", "VERCEL_ENV"] ; "defaults")]
#[test_case(&["!VERCEL*"], &[] ; "removing defaults")]
#[test_case(&["FOO*", "!FOOD"], &["FOO", "FOOBAR", "VERCEL_ANALYTICS_ID", "VERCEL_ENV"] ; "intersecting globs")]
fn test_global_env(inputs: &[&str], expected: &[&str]) {
let env_at_start = EnvironmentVariableMap(
vec![
("VERCEL_ENV", "prod"),
("VERCEL_ANALYTICS_ID", "1"),
("FOO", "bar"),
("FOOBAR", "baz"),
("FOOD", "cheese"),
]
.into_iter()
.map(|(k, v)| (k.to_owned(), v.to_owned()))
.collect(),
);
let inputs = inputs.iter().map(|s| s.to_string()).collect::<Vec<_>>();
let actual = get_global_hashable_env_vars(&env_at_start, &inputs).unwrap();
let mut actual = actual.all.keys().map(|s| s.as_str()).collect::<Vec<_>>();
actual.sort();
assert_eq!(actual, expected);
}
}
2 changes: 1 addition & 1 deletion crates/turborepo-lib/src/cli/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub async fn print_potential_tasks(
let run = run_builder.build(&handler, telemetry).await?;
let potential_tasks = run.get_potential_tasks()?;

println!("No tasks provided, here are some potential ones to run\n",);
println!("No tasks provided, here are some potential ones\n",);

for (task, packages) in potential_tasks
.into_iter()
Expand Down
Loading

0 comments on commit 5b93289

Please sign in to comment.