From a6631d994f976eec6e68e79acfc74b1c92c31a12 Mon Sep 17 00:00:00 2001 From: Will Binns-Smith Date: Thu, 4 Jul 2024 07:52:45 -0700 Subject: [PATCH] Turbopack + Relay: correctly implement artifact_directory to fix multi-project test (#67403) Previously, if `artifact_directory` were set, artifacts would be resolved at a fixed location relative to each file. This correctly resolves them from the project root. Test Plan: `TURBOPACK_BUILD=1 TURBOPACK=1 pnpm test-dev test/integration/relay-graphql-swc-multi-project/test/index.test.js` --------- Co-authored-by: Tobias Koppers --- Cargo.lock | 74 +++++------ Cargo.toml | 6 +- .../next-core/src/next_client/context.rs | 2 +- .../next-core/src/next_server/context.rs | 2 +- .../src/next_shared/transforms/relay.rs | 13 +- packages/next/package.json | 2 +- pnpm-lock.yaml | 10 +- .../test/index.test.js | 117 +++++++++--------- 8 files changed, 116 insertions(+), 110 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0c410a8afa..d88e42188d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -321,7 +321,7 @@ dependencies = [ [[package]] name = "auto-hash-map" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "serde", "smallvec", @@ -3111,7 +3111,7 @@ dependencies = [ [[package]] name = "node-file-trace" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "serde", @@ -6978,12 +6978,12 @@ dependencies = [ [[package]] name = "turbo-prehash" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" [[package]] name = "turbo-tasks" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "async-trait", @@ -7017,7 +7017,7 @@ dependencies = [ [[package]] name = "turbo-tasks-build" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "cargo-lock", @@ -7030,7 +7030,7 @@ dependencies = [ [[package]] name = "turbo-tasks-bytes" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "bytes", @@ -7044,7 +7044,7 @@ dependencies = [ [[package]] name = "turbo-tasks-env" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "dotenvs", @@ -7058,7 +7058,7 @@ dependencies = [ [[package]] name = "turbo-tasks-fetch" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "lazy_static", @@ -7074,7 +7074,7 @@ dependencies = [ [[package]] name = "turbo-tasks-fs" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "auto-hash-map", @@ -7106,7 +7106,7 @@ dependencies = [ [[package]] name = "turbo-tasks-hash" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "md4", "turbo-tasks-macros", @@ -7116,7 +7116,7 @@ dependencies = [ [[package]] name = "turbo-tasks-macros" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "proc-macro-error", @@ -7130,7 +7130,7 @@ dependencies = [ [[package]] name = "turbo-tasks-macros-shared" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "proc-macro2", "quote", @@ -7140,7 +7140,7 @@ dependencies = [ [[package]] name = "turbo-tasks-malloc" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "mimalloc", ] @@ -7148,7 +7148,7 @@ dependencies = [ [[package]] name = "turbo-tasks-memory" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "auto-hash-map", @@ -7176,7 +7176,7 @@ dependencies = [ [[package]] name = "turbopack" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "async-recursion", @@ -7206,7 +7206,7 @@ dependencies = [ [[package]] name = "turbopack-binding" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "auto-hash-map", "mdxjs", @@ -7247,7 +7247,7 @@ dependencies = [ [[package]] name = "turbopack-browser" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7270,7 +7270,7 @@ dependencies = [ [[package]] name = "turbopack-cli-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "clap", @@ -7287,7 +7287,7 @@ dependencies = [ [[package]] name = "turbopack-core" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "async-recursion", @@ -7316,7 +7316,7 @@ dependencies = [ [[package]] name = "turbopack-css" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7343,7 +7343,7 @@ dependencies = [ [[package]] name = "turbopack-dev-server" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "async-compression", @@ -7379,7 +7379,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "async-trait", @@ -7414,7 +7414,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-hmr-protocol" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "serde", "serde_json", @@ -7425,7 +7425,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-plugins" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "async-trait", @@ -7450,7 +7450,7 @@ dependencies = [ [[package]] name = "turbopack-ecmascript-runtime" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "indoc", @@ -7466,7 +7466,7 @@ dependencies = [ [[package]] name = "turbopack-env" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7482,7 +7482,7 @@ dependencies = [ [[package]] name = "turbopack-image" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "base64 0.21.4", @@ -7501,7 +7501,7 @@ dependencies = [ [[package]] name = "turbopack-json" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "serde", @@ -7516,7 +7516,7 @@ dependencies = [ [[package]] name = "turbopack-mdx" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "mdxjs", @@ -7531,7 +7531,7 @@ dependencies = [ [[package]] name = "turbopack-node" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "async-stream", @@ -7565,7 +7565,7 @@ dependencies = [ [[package]] name = "turbopack-nodejs" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7585,7 +7585,7 @@ dependencies = [ [[package]] name = "turbopack-resolve" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -7603,7 +7603,7 @@ dependencies = [ [[package]] name = "turbopack-static" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "serde", @@ -7619,7 +7619,7 @@ dependencies = [ [[package]] name = "turbopack-swc-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "swc_core", "turbo-tasks", @@ -7630,7 +7630,7 @@ dependencies = [ [[package]] name = "turbopack-trace-server" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "either", @@ -7650,7 +7650,7 @@ dependencies = [ [[package]] name = "turbopack-trace-utils" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "crossbeam-channel", @@ -7666,7 +7666,7 @@ dependencies = [ [[package]] name = "turbopack-wasm" version = "0.1.0" -source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240703.1#69bb5947d173f3b84a3f9cef9f338485c931dc9f" +source = "git+https://github.com/vercel/turbo.git?tag=turbopack-240704.3#8ef95da2a4c8a0ca009a43f6dc82f04c4c9360cc" dependencies = [ "anyhow", "indexmap 1.9.3", diff --git a/Cargo.toml b/Cargo.toml index 467733344a..bc4157c2bd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,11 +38,11 @@ swc_core = { version = "0.95.4", features = [ testing = { version = "0.36.0" } # Turbo crates -turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240703.1" } +turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240704.3" } # [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros.. -turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240703.1" } +turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240704.3" } # [TODO]: need to refactor embed_directory! macro usage in next-core -turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240703.1" } +turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240704.3" } # General Deps diff --git a/packages/next-swc/crates/next-core/src/next_client/context.rs b/packages/next-swc/crates/next-core/src/next_client/context.rs index 5b8e112c4b..525f68ea1f 100644 --- a/packages/next-swc/crates/next-core/src/next_client/context.rs +++ b/packages/next-swc/crates/next-core/src/next_client/context.rs @@ -245,7 +245,7 @@ pub async fn get_client_module_options_context( get_next_client_transforms_rules(next_config, ty.into_value(), mode, true).await?; let additional_rules: Vec = vec![ get_swc_ecma_transform_plugin_rule(next_config, project_path).await?, - get_relay_transform_rule(next_config).await?, + get_relay_transform_rule(next_config, project_path).await?, get_emotion_transform_rule(next_config).await?, get_styled_components_transform_rule(next_config).await?, get_styled_jsx_transform_rule(next_config, target_browsers).await?, diff --git a/packages/next-swc/crates/next-core/src/next_server/context.rs b/packages/next-swc/crates/next-core/src/next_server/context.rs index fb9404d7b5..5b3176c089 100644 --- a/packages/next-swc/crates/next-core/src/next_server/context.rs +++ b/packages/next-swc/crates/next-core/src/next_server/context.rs @@ -466,7 +466,7 @@ pub async fn get_server_module_options_context( // A set of custom ecma transform rules being applied to server context. let source_transform_rules: Vec = vec![ get_swc_ecma_transform_plugin_rule(next_config, project_path).await?, - get_relay_transform_rule(next_config).await?, + get_relay_transform_rule(next_config, project_path).await?, get_emotion_transform_rule(next_config).await?, ] .into_iter() diff --git a/packages/next-swc/crates/next-core/src/next_shared/transforms/relay.rs b/packages/next-swc/crates/next-core/src/next_shared/transforms/relay.rs index 6e46714b14..a9bfff3532 100644 --- a/packages/next-swc/crates/next-core/src/next_shared/transforms/relay.rs +++ b/packages/next-swc/crates/next-core/src/next_shared/transforms/relay.rs @@ -1,5 +1,6 @@ use anyhow::Result; use turbo_tasks::Vc; +use turbo_tasks_fs::FileSystemPath; use turbopack_binding::turbopack::{ ecmascript_plugin::transform::relay::RelayTransformer, turbopack::module_options::ModuleRule, }; @@ -8,11 +9,19 @@ use super::get_ecma_transform_rule; use crate::next_config::NextConfig; /// Returns a transform rule for the relay graphql transform. -pub async fn get_relay_transform_rule(next_config: Vc) -> Result> { +pub async fn get_relay_transform_rule( + next_config: Vc, + project_path: Vc, +) -> Result> { let enable_mdx_rs = next_config.mdx_rs().await?.is_some(); + let project_path = &*project_path.await?; let module_rule = next_config.await?.compiler.as_ref().and_then(|value| { value.relay.as_ref().map(|config| { - get_ecma_transform_rule(Box::new(RelayTransformer::new(config)), enable_mdx_rs, true) + get_ecma_transform_rule( + Box::new(RelayTransformer::new(config, project_path)), + enable_mdx_rs, + true, + ) }) }); diff --git a/packages/next/package.json b/packages/next/package.json index 5c58c8d94a..5e0f0e77f6 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -205,7 +205,7 @@ "@types/ws": "8.2.0", "@vercel/ncc": "0.34.0", "@vercel/nft": "0.27.1", - "@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240703.1", + "@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240704.3", "acorn": "8.11.3", "amphtml-validator": "1.0.35", "anser": "1.4.9", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e2064a62aa..b6d2dcaff0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1111,8 +1111,8 @@ importers: specifier: 0.27.1 version: 0.27.1(encoding@0.1.13) '@vercel/turbopack-ecmascript-runtime': - specifier: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240703.1 - version: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240703.1 + specifier: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240704.3 + version: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240704.3 acorn: specifier: 8.11.3 version: 8.11.3 @@ -5111,8 +5111,8 @@ packages: resolution: {integrity: sha512-OTe0KE37F5Y2eTys6eMnfopC+P4qr2ooXUTFyFPTplYSPwowmFk/HLD1FXtbKLjqsIH0SgekcJWad+C5uX4nkg==} engines: {node: '>=16'} - '@vercel/turbopack-ecmascript-runtime@https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240703.1': - resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240703.1} + '@vercel/turbopack-ecmascript-runtime@https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240704.3': + resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240704.3} version: 0.0.0 '@webassemblyjs/ast@1.11.6': @@ -19673,7 +19673,7 @@ snapshots: satori: 0.10.9 yoga-wasm-web: 0.3.3 - '@vercel/turbopack-ecmascript-runtime@https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240703.1': + '@vercel/turbopack-ecmascript-runtime@https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240704.3': dependencies: '@types/node': 20.12.3 diff --git a/test/integration/relay-graphql-swc-multi-project/test/index.test.js b/test/integration/relay-graphql-swc-multi-project/test/index.test.js index 852eb99a56..b924b7f9cc 100644 --- a/test/integration/relay-graphql-swc-multi-project/test/index.test.js +++ b/test/integration/relay-graphql-swc-multi-project/test/index.test.js @@ -33,71 +33,68 @@ const runRelayCompiler = () => { } // TODO: Support for Turbopack -;(process.env.TURBOPACK ? describe.skip : describe)( - 'Relay Compiler Transform - Multi Project Config', - () => { - beforeAll(() => { - runRelayCompiler() - }) - ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)( - 'development mode', - () => { - describe('project-a', () => { - beforeAll(async () => { - appPort = await findPort() - app = await launchApp(projectAAppDir, appPort, { - cwd: projectAAppDir, - }) +describe('Relay Compiler Transform - Multi Project Config', () => { + beforeAll(() => { + runRelayCompiler() + }) + ;(process.env.TURBOPACK_BUILD ? describe.skip : describe)( + 'development mode', + () => { + describe('project-a', () => { + beforeAll(async () => { + appPort = await findPort() + app = await launchApp(projectAAppDir, appPort, { + cwd: projectAAppDir, }) - - afterAll(() => killApp(app)) - - runTests('Project A') }) - describe('project-b', () => { - beforeAll(async () => { - appPort = await findPort() - app = await launchApp(projectBAppDir, appPort, { - cwd: projectBAppDir, - }) + afterAll(() => killApp(app)) + + runTests('Project A') + }) + + describe('project-b', () => { + beforeAll(async () => { + appPort = await findPort() + app = await launchApp(projectBAppDir, appPort, { + cwd: projectBAppDir, }) - - afterAll(() => killApp(app)) - - runTests('Project B') - }) - } - ) - ;(process.env.TURBOPACK_DEV ? describe.skip : describe)( - 'production mode', - () => { - // eslint-disable-next-line jest/no-identical-title - describe('project-a', () => { - beforeAll(async () => { - await nextBuild(projectAAppDir, [], { cwd: projectAAppDir }) - appPort = await findPort() - app = await nextStart(projectAAppDir, appPort) - }) - - afterAll(() => killApp(app)) - - runTests('Project A') }) - // eslint-disable-next-line jest/no-identical-title - describe('project-b', () => { - beforeAll(async () => { - await nextBuild(projectBAppDir, [], { cwd: projectBAppDir }) - appPort = await findPort() - app = await nextStart(projectBAppDir, appPort) - }) + afterAll(() => killApp(app)) - afterAll(() => killApp(app)) - - runTests('Project B') + runTests('Project B') + }) + } + ) + ;(process.env.TURBOPACK_DEV ? describe.skip : describe)( + 'production mode', + () => { + // eslint-disable-next-line jest/no-identical-title + describe('project-a', () => { + beforeAll(async () => { + await nextBuild(projectAAppDir, [], { cwd: projectAAppDir }) + appPort = await findPort() + app = await nextStart(projectAAppDir, appPort) }) - } - ) - } -) + + afterAll(() => killApp(app)) + + runTests('Project A') + }) + + // eslint-disable-next-line jest/no-identical-title + describe('project-b', () => { + beforeAll(async () => { + await nextBuild(projectBAppDir, [], { cwd: projectBAppDir }) + appPort = await findPort() + app = await nextStart(projectBAppDir, appPort) + }) + + afterAll(() => killApp(app)) + + runTests('Project B') + }) + } + ) +})