Skip to content

Commit

Permalink
Merge branch 'main' into mischnic/mdx-sourcetransform
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic authored Jul 22, 2024
2 parents ff83eba + 5d31f76 commit 749b748
Show file tree
Hide file tree
Showing 217 changed files with 4,191 additions and 14,037 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.config/ast-grep/rule-tests/__snapshots__/** linguist-generated=true
crates/turbo-tasks-macros-tests/tests/**/*.stderr linguist-generated=true
crates/turbopack-ecmascript/tests/tree-shaker/analyzer/**/output.md linguist-generated=true
crates/turbopack-tests/tests/snapshot/**/output/** linguist-generated=true
crates/turborepo-lockfiles/fixtures/*.lock text eol=lf
17 changes: 12 additions & 5 deletions .github/workflows/test-js-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
docs: ${{ steps.docs.outputs.diff != '' }}

js_packages:
name: JS Package Tests
name: "JS Package Tests (${{matrix.os.name}}, Node ${{matrix.node-version}})"
timeout-minutes: 30
if: needs.determine_jobs.outputs.ci == 'true' || needs.determine_jobs.outputs.packages == 'true' || needs.determine_jobs.outputs.docs == 'true'
needs: [determine_jobs]
Expand All @@ -69,6 +69,9 @@ jobs:
- "metal"
- name: macos
runner: macos-12
node-version:
- 18
- 20
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
Expand All @@ -88,11 +91,13 @@ jobs:
ref: ${{ github.ref }}
fetch-depth: ${{ steps.fetch-depth.outputs.depth }}

- name: Setup Turborepo Environment
uses: ./.github/actions/setup-turborepo-environment
- name: "Setup Node"
uses: ./.github/actions/setup-node
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
node-version: "20"
extra-flags: --no-optional
node-version: ${{ matrix.node-version }}
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1

- name: Install Global Turbo
uses: ./.github/actions/install-global-turbo
Expand All @@ -104,6 +109,8 @@ jobs:
# changes, and we don't want to enable that beahvior for _all_ our JS packages.
run: |
TURBO_API= turbo run check-types test --filter="!turborepo-repository" --filter={./packages/*}...[${{ github.event.pull_request.base.sha || 'HEAD^1' }}] --color --env-mode=strict
env:
NODE_VERSION: ${{ matrix.node-version }}

summary:
name: Turborepo JS Test Summary
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/turborepo-native-lib-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:

jobs:
js_native_packages:
name: JS Native Package Tests
name: "@turbo/repository (${{matrix.os.name}}, Node ${{matrix.node-version}})"
timeout-minutes: 30
runs-on: ${{ matrix.os.runner }}
strategy:
Expand All @@ -26,6 +26,9 @@ jobs:
- "metal"
- name: macos
runner: macos-latest
node-version:
- 18
- 20
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
Expand All @@ -46,9 +49,8 @@ jobs:
- name: Setup Turborepo Environment
uses: ./.github/actions/setup-turborepo-environment
with:
windows: ${{ matrix.os.name == 'windows' }}
github-token: "${{ secrets.GITHUB_TOKEN }}"
node-version: "20"
node-version: ${{ matrix.node-version }}

- name: Install Global Turbo
uses: ./.github/actions/install-global-turbo
Expand All @@ -57,3 +59,5 @@ jobs:
# Manually set TURBO_API to an empty string to override Hetzner env
run: |
TURBO_API= turbo run test --filter "turborepo-repository" --color --env-mode=strict
env:
NODE_VERSION: ${{ matrix.node-version }}
2 changes: 1 addition & 1 deletion .github/workflows/turborepo-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ jobs:
needs: [determine_jobs, build_turborepo]
if: needs.determine_jobs.outputs.turborepo_integration == 'true'
runs-on: ${{ matrix.os.runner }}
timeout-minutes: 30
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
Expand Down
32 changes: 5 additions & 27 deletions Cargo.lock

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

4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ camino = { version = "1.1.4", features = ["serde1"] }
chrono = "0.4.23"
clap = "4.5.2"
clap_complete = "4.5.1"
concurrent-queue = "2.1.0"
concurrent-queue = "2.5.0"
console = "0.15.5"
console-subscriber = "0.1.8"
criterion = "0.4.0"
Expand All @@ -252,8 +252,6 @@ lightningcss = { version = "1.0.0-alpha.57", features = [
] }
mime = "0.3.16"
notify = "6.1.1"
notify-debouncer-full = "0.3.1"
notify-debouncer-mini = { version = "0.3.0", default-features = false }
once_cell = "1.17.1"
owo-colors = "3.5.0"
parcel_selectors = "0.26.0"
Expand Down
27 changes: 3 additions & 24 deletions crates/turbo-tasks-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use turbo_tasks_macros_shared::{
get_impl_function_ident, get_native_function_ident, get_path_ident,
get_register_trait_methods_ident, get_register_value_type_ident,
get_trait_default_impl_function_ident, get_trait_impl_function_ident, get_trait_type_ident,
get_type_ident, GenericTypeInput, PrimitiveInput, ValueTraitArguments,
get_type_ident, GenericTypeInput, PrimitiveInput,
};

pub fn generate_register() {
Expand Down Expand Up @@ -361,10 +361,10 @@ impl<'a> RegisterContext<'a> {
}

fn process_trait_inner(&mut self, trait_item: &ItemTrait) -> Result<()> {
if let Some(attr) = trait_item
if trait_item
.attrs
.iter()
.find(|a| is_turbo_attribute(a, "value_trait"))
.any(|a| is_turbo_attribute(a, "value_trait"))
{
let trait_ident = &trait_item.ident;

Expand All @@ -388,16 +388,6 @@ impl<'a> RegisterContext<'a> {

let trait_type_ident = get_trait_type_ident(trait_ident);
self.register(trait_type_ident, self.get_global_name(&[trait_ident]))?;

let trait_args: ValueTraitArguments = parse_attr_args(attr)?.unwrap_or_default();
if trait_args.debug {
self.register_debug_impl(
&get_type_ident(&parse_quote! {
Box<dyn #trait_ident>
})
.unwrap(),
)?;
}
}
Ok(())
}
Expand Down Expand Up @@ -610,14 +600,3 @@ fn is_cfg_attribute(attr: &Attribute) -> bool {
.get_ident()
.is_some_and(|ident| ident == "cfg" || ident == "cfg_attr")
}

fn parse_attr_args<T>(attr: &Attribute) -> syn::Result<Option<T>>
where
T: syn::parse::Parse,
{
if attr.tokens.is_empty() {
Ok(None)
} else {
Ok(Some(attr.parse_args_with(T::parse)?))
}
}
1 change: 0 additions & 1 deletion crates/turbo-tasks-fs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ indexmap = { workspace = true }
jsonc-parser = { version = "0.21.0", features = ["serde"] }
mime = { workspace = true }
notify = { workspace = true }
notify-debouncer-full = { workspace = true }
parking_lot = { workspace = true }
serde = { workspace = true, features = ["rc"] }
serde_json = { workspace = true }
Expand Down
12 changes: 3 additions & 9 deletions crates/turbo-tasks-fs/benches/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ use criterion::{
measurement::{Measurement, WallTime},
BenchmarkId, Criterion,
};
use notify_debouncer_full::{
new_debouncer,
notify::{RecursiveMode, Watcher},
};
use notify::{Config, RecommendedWatcher, RecursiveMode, Watcher};
use tokio::runtime::Runtime;
use turbo_tasks::event::Event;
use turbo_tasks_fs::rope::{Rope, RopeBuilder};
Expand All @@ -38,11 +35,8 @@ fn bench_file_watching(c: &mut Criterion) {
let (tx, rx) = channel();
let event = Arc::new(Event::new(|| "test event".to_string()));

let mut watcher = new_debouncer(Duration::from_micros(1), None, tx).unwrap();
watcher
.watcher()
.watch(temp_path, RecursiveMode::Recursive)
.unwrap();
let mut watcher = RecommendedWatcher::new(tx, Config::default()).unwrap();
watcher.watch(temp_path, RecursiveMode::Recursive).unwrap();

let t = thread::spawn({
let event = event.clone();
Expand Down
Loading

0 comments on commit 749b748

Please sign in to comment.