Skip to content

Commit

Permalink
Merge branch 'turborepo_2' into chrisolszewski/turbo-3275-create-turb…
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-olszewski authored May 28, 2024
2 parents 9b5f8a9 + e468cb1 commit 05199fb
Show file tree
Hide file tree
Showing 225 changed files with 13,476 additions and 1,577 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test-js-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v3

- name: CI related changes
id: ci
uses: technote-space/get-diff-action@v6
Expand Down
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Thanks for your interest in contributing to Turbo!

- [Contributing to Turbo](#contributing-to-turbo)
- [General Dependencies](#general-dependencies)
- [Linux Dependencies](#linux-dependencies)
- [Contributing to Turborepo](#contributing-to-turborepo)
- [Building Turborepo](#building-turborepo)
- [TLS Implementation](#tls-implementation)
Expand Down Expand Up @@ -290,6 +291,14 @@ You can also create a little demo app and run
cargo run -p node-file-trace -- print demo/index.js
```
Updating snapshot tests:
In case of changes that involve updating snapshots you can use the `UPDATE=1` environment variable.
```
UPDATE=1 cargo nextest run
```
### Profiling Turbopack
See [the profiling docs for Turbopack](https://turbo.build/pack/docs/advanced/profiling) for details.
Expand Down
21 changes: 6 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ swc_core = { version = "0.92.5", features = [
"ecma_loader_parking_lot",
] }
swc_emotion = { version = "0.72.13" }
swc_relay = { version = "0.44.13" }
testing = { version = "0.35.24" }
swc_relay = { version = "0.44.14" }
testing = { version = "0.35.25" }
# Temporary: Reference the latest git minor version of pathfinder_simd until it's published.
pathfinder_simd = "0.5.3"

Expand Down Expand Up @@ -240,7 +240,7 @@ indicatif = "0.17.3"
indoc = "2.0.0"
itertools = "0.10.5"
lazy_static = "1.4.0"
lightningcss = { version = "1.0.0-alpha.56", features = [
lightningcss = { version = "1.0.0-alpha.57", features = [
"serde",
"visitor",
"into_owned",
Expand Down
2 changes: 0 additions & 2 deletions crates/turbo-tasks-hash/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ bench = false
workspace = true

[dependencies]
base16 = "0.2.1"
hex = "0.4.3"
md4 = "0.10.1"
turbo-tasks-macros = { workspace = true }
twox-hash = "1.6.3"
4 changes: 0 additions & 4 deletions crates/turbo-tasks-hash/src/base16.rs

This file was deleted.

5 changes: 0 additions & 5 deletions crates/turbo-tasks-hash/src/hex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,3 @@
pub fn encode_hex(n: u64) -> String {
format!("{:01$x}", n, std::mem::size_of::<u64>() * 2)
}

/// Encodes a byte slice into a hex string.
pub fn encode_hex_string(bytes: &[u8]) -> String {
hex::encode(bytes)
}
4 changes: 1 addition & 3 deletions crates/turbo-tasks-hash/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
//! invalidation, and encoding the hash to an hexadecimal string for use in a
//! file name.

mod base16;
mod deterministic_hash;
mod hex;
mod md4;
mod xxh3_hash64;

pub use crate::{
base16::encode_base16,
deterministic_hash::{DeterministicHash, DeterministicHasher},
hex::{encode_hex, encode_hex_string},
hex::encode_hex,
md4::hash_md4,
xxh3_hash64::{hash_xxh3_hash64, Xxh3Hash64Hasher},
};
1 change: 1 addition & 0 deletions crates/turbo-tasks-memory/src/aggregation/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ fn check_invariants<'a>(
false
}
});
#[allow(clippy::never_loop)]
for missing_upper in missing_uppers {
let upper_value = {
let upper = ctx.node(missing_upper);
Expand Down
4 changes: 3 additions & 1 deletion crates/turbopack-core/src/context.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::{bail, Result};
use turbo_tasks::{Value, Vc};
use turbo_tasks_fs::FileSystemPath;
use turbo_tasks_fs::{glob::Glob, FileSystemPath};

use crate::{
compile_time_info::CompileTimeInfo,
Expand Down Expand Up @@ -76,4 +76,6 @@ pub trait AssetContext {

/// Gets a new AssetContext with the transition applied.
fn with_transition(self: Vc<Self>, transition: String) -> Vc<Box<dyn AssetContext>>;

fn side_effect_free_packages(self: Vc<Self>) -> Vc<Glob>;
}
11 changes: 11 additions & 0 deletions crates/turbopack-core/src/resolve/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,17 @@ impl ModuleResolveResult {
}
}

pub fn ignored() -> ModuleResolveResult {
Self::ignored_with_key(RequestKey::default())
}

pub fn ignored_with_key(request_key: RequestKey) -> ModuleResolveResult {
ModuleResolveResult {
primary: indexmap! { request_key => ModuleResolveResultItem::Ignore },
affecting_sources: Vec::new(),
}
}

pub fn module(module: Vc<Box<dyn Module>>) -> ModuleResolveResult {
Self::module_with_key(RequestKey::default(), module)
}
Expand Down
Loading

0 comments on commit 05199fb

Please sign in to comment.