From ca3711a1260471bd51d6360546ce084417b6da5b Mon Sep 17 00:00:00 2001 From: hrmny Date: Fri, 12 May 2023 19:34:16 +0200 Subject: [PATCH] `turbo-binding` -> `turbopack-binding` --- Cargo.toml | 2 +- packages/next-swc/crates/core/Cargo.toml | 6 ++--- .../crates/core/src/amp_attributes.rs | 2 +- .../next-swc/crates/core/src/auto_cjs/mod.rs | 2 +- .../src/disallow_re_export_all_in_page.rs | 2 +- packages/next-swc/crates/core/src/lib.rs | 27 ++++++++++--------- .../next-swc/crates/core/src/next_dynamic.rs | 2 +- packages/next-swc/crates/core/src/next_ssg.rs | 2 +- .../next-swc/crates/core/src/page_config.rs | 2 +- .../core/src/react_remove_properties.rs | 2 +- .../core/src/react_server_components.rs | 2 +- .../crates/core/src/remove_console.rs | 2 +- .../crates/core/src/server_actions.rs | 2 +- .../next-swc/crates/core/src/shake_exports.rs | 2 +- .../core/src/top_level_binding_collector.rs | 2 +- packages/next-swc/crates/core/tests/errors.rs | 2 +- .../next-swc/crates/core/tests/fixture.rs | 6 ++--- packages/next-swc/crates/core/tests/full.rs | 18 ++++++------- .../next-swc/crates/core/tests/telemetry.rs | 2 +- packages/next-swc/crates/napi/Cargo.toml | 10 +++---- packages/next-swc/crates/napi/build.rs | 2 +- .../next-swc/crates/napi/src/app_structure.rs | 2 +- packages/next-swc/crates/napi/src/lib.rs | 5 ++-- packages/next-swc/crates/napi/src/mdx.rs | 2 +- packages/next-swc/crates/napi/src/minify.rs | 10 +++---- packages/next-swc/crates/napi/src/parse.rs | 6 ++--- .../next-swc/crates/napi/src/transform.rs | 4 +-- .../next-swc/crates/napi/src/turbotrace.rs | 2 +- .../next-swc/crates/next-build/Cargo.toml | 6 ++--- packages/next-swc/crates/next-build/build.rs | 2 +- .../next-swc/crates/next-build/src/lib.rs | 4 +-- packages/next-swc/crates/next-core/Cargo.toml | 12 ++++----- packages/next-swc/crates/next-core/build.rs | 2 +- .../crates/next-core/src/app_render/mod.rs | 2 +- .../next_layout_entry_transition.rs | 2 +- .../next-core/src/app_segment_config.rs | 6 ++--- .../crates/next-core/src/app_source.rs | 4 +-- .../crates/next-core/src/app_structure.rs | 8 +++--- .../crates/next-core/src/asset_helpers.rs | 4 +-- .../next-swc/crates/next-core/src/babel.rs | 10 +++---- .../crates/next-core/src/bootstrap.rs | 6 ++--- .../next-swc/crates/next-core/src/embed_js.rs | 4 +-- packages/next-swc/crates/next-core/src/env.rs | 2 +- .../next-swc/crates/next-core/src/fallback.rs | 4 +-- packages/next-swc/crates/next-core/src/lib.rs | 2 +- .../next-swc/crates/next-core/src/manifest.rs | 10 +++---- .../crates/next-core/src/next_build.rs | 4 +-- .../next-core/src/next_client/context.rs | 6 ++--- .../src/next_client/runtime_entry.rs | 2 +- .../next-core/src/next_client/transforms.rs | 2 +- .../next-core/src/next_client/transition.rs | 4 +-- .../client_chunks_transition.rs | 4 +-- .../in_chunking_context_asset.rs | 4 +-- .../src/next_client_chunks/with_chunks.rs | 2 +- .../server_to_client_transition.rs | 4 +-- .../ssr_client_module_transition.rs | 2 +- .../with_chunking_context_scope_asset.rs | 4 +-- .../with_client_chunks.rs | 4 +-- .../crates/next-core/src/next_config.rs | 16 +++++------ .../crates/next-core/src/next_edge/context.rs | 4 +-- .../next-core/src/next_edge/transition.rs | 2 +- .../next-core/src/next_font/font_fallback.rs | 2 +- .../src/next_font/google/font_fallback.rs | 4 +-- .../next-core/src/next_font/google/mod.rs | 10 ++++--- .../next-core/src/next_font/google/options.rs | 4 +-- .../src/next_font/google/stylesheet.rs | 2 +- .../next-core/src/next_font/google/util.rs | 2 +- .../crates/next-core/src/next_font/issue.rs | 4 +-- .../src/next_font/local/font_fallback.rs | 2 +- .../next-core/src/next_font/local/mod.rs | 2 +- .../next-core/src/next_font/local/options.rs | 4 +-- .../next-core/src/next_font/local/request.rs | 2 +- .../src/next_font/local/stylesheet.rs | 2 +- .../next-core/src/next_font/local/util.rs | 2 +- .../next-core/src/next_font/stylesheet.rs | 2 +- .../crates/next-core/src/next_font/util.rs | 4 +-- .../src/next_image/content_source.rs | 6 ++--- .../crates/next-core/src/next_image/module.rs | 2 +- .../next-core/src/next_image/source_asset.rs | 2 +- .../crates/next-core/src/next_import_map.rs | 8 +++--- .../next-core/src/next_route_matcher/all.rs | 2 +- .../next-core/src/next_route_matcher/mod.rs | 2 +- .../src/next_route_matcher/path_regex.rs | 2 +- .../src/next_route_matcher/prefix_suffix.rs | 2 +- .../next-core/src/next_server/context.rs | 6 ++--- .../next-core/src/next_server/resolve.rs | 4 +-- .../next-core/src/next_server/transforms.rs | 2 +- .../next-core/src/next_shared/resolve.rs | 4 +-- .../src/next_shared/transforms/mod.rs | 4 +-- .../transforms/modularize_imports.rs | 6 ++--- .../next_shared/transforms/next_dynamic.rs | 2 +- .../src/next_shared/transforms/next_font.rs | 2 +- .../transforms/next_strip_page_exports.rs | 2 +- .../src/next_shared/transforms/relay.rs | 2 +- .../crates/next-core/src/page_loader.rs | 4 +-- .../crates/next-core/src/page_source.rs | 12 ++++----- .../crates/next-core/src/pages_structure.rs | 8 +++--- .../next-swc/crates/next-core/src/router.rs | 14 +++++----- .../crates/next-core/src/router_source.rs | 4 +-- .../next-swc/crates/next-core/src/runtime.rs | 2 +- .../crates/next-core/src/transform_options.rs | 2 +- .../next-swc/crates/next-core/src/util.rs | 12 ++++----- .../crates/next-core/src/web_entry_source.rs | 2 +- .../next-swc/crates/next-dev-tests/Cargo.toml | 6 ++--- .../next-swc/crates/next-dev-tests/build.rs | 2 +- .../next-dev-tests/tests/integration.rs | 4 +-- packages/next-swc/crates/next-dev/Cargo.toml | 12 ++++----- .../crates/next-dev/benches/bundler.rs | 2 +- .../next-swc/crates/next-dev/benches/mod.rs | 2 +- packages/next-swc/crates/next-dev/build.rs | 2 +- .../crates/next-dev/src/devserver_options.rs | 2 +- packages/next-swc/crates/next-dev/src/lib.rs | 10 +++---- packages/next-swc/crates/next-dev/src/main.rs | 5 ++-- .../crates/next-dev/src/turbo_tasks_viz.rs | 4 +-- packages/next-swc/crates/wasm/Cargo.toml | 4 +-- packages/next-swc/crates/wasm/src/lib.rs | 10 +++---- packages/next-swc/crates/wasm/src/mdx.rs | 2 +- 117 files changed, 262 insertions(+), 257 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 85a0fe3896449..7d2b6d9d17eff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ swc_core = { version = "0.75.41" } testing = { version = "0.33.4" } # Turbo crates -turbo-binding = { package = "turbopack-binding", git = "https://github.com/vercel/turbo.git", tag = "turbopack-230511.3" } +turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230511.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-230511.3" } # [TODO]: need to refactor embed_directory! macro usage in next-core diff --git a/packages/next-swc/crates/core/Cargo.toml b/packages/next-swc/crates/core/Cargo.toml index e4d18622a1e35..d7fc2a94ccb32 100644 --- a/packages/next-swc/crates/core/Cargo.toml +++ b/packages/next-swc/crates/core/Cargo.toml @@ -5,7 +5,7 @@ version = "0.0.0" publish = false [features] -plugin = ["turbo-binding/__swc_core_binding_napi_plugin"] +plugin = ["turbopack-binding/__swc_core_binding_napi_plugin"] [dependencies] chrono = "0.4" @@ -22,7 +22,7 @@ serde_json = "1" sha1 = "0.10.1" tracing = { version = "0.1.37" } -turbo-binding = { workspace = true, features = [ +turbopack-binding = { workspace = true, features = [ "__swc_core", "__swc_core_next_core", "__swc_transform_styled_jsx", @@ -33,7 +33,7 @@ turbo-binding = { workspace = true, features = [ ] } [dev-dependencies] -turbo-binding = { workspace = true, features = [ +turbopack-binding = { workspace = true, features = [ "__swc_core_testing_transform", "__swc_testing", ] } diff --git a/packages/next-swc/crates/core/src/amp_attributes.rs b/packages/next-swc/crates/core/src/amp_attributes.rs index a30634217a8aa..31d34eaa8b7b1 100644 --- a/packages/next-swc/crates/core/src/amp_attributes.rs +++ b/packages/next-swc/crates/core/src/amp_attributes.rs @@ -1,4 +1,4 @@ -use turbo_binding::swc::core::ecma::{ +use turbopack_binding::swc::core::ecma::{ ast::{Ident, JSXAttr, JSXAttrName, JSXAttrOrSpread, JSXElementName, JSXOpeningElement}, atoms::JsWord, visit::Fold, diff --git a/packages/next-swc/crates/core/src/auto_cjs/mod.rs b/packages/next-swc/crates/core/src/auto_cjs/mod.rs index 3a3d096d31a14..9e357f547089d 100644 --- a/packages/next-swc/crates/core/src/auto_cjs/mod.rs +++ b/packages/next-swc/crates/core/src/auto_cjs/mod.rs @@ -1,4 +1,4 @@ -use turbo_binding::swc::core::ecma::{ +use turbopack_binding::swc::core::ecma::{ ast::*, visit::{Visit, VisitWith}, }; diff --git a/packages/next-swc/crates/core/src/disallow_re_export_all_in_page.rs b/packages/next-swc/crates/core/src/disallow_re_export_all_in_page.rs index 62c951f2b7de1..ae058a06dc9ff 100644 --- a/packages/next-swc/crates/core/src/disallow_re_export_all_in_page.rs +++ b/packages/next-swc/crates/core/src/disallow_re_export_all_in_page.rs @@ -1,4 +1,4 @@ -use turbo_binding::swc::core::{ +use turbopack_binding::swc::core::{ common::errors::HANDLER, ecma::{ ast::ExportAll, diff --git a/packages/next-swc/crates/core/src/lib.rs b/packages/next-swc/crates/core/src/lib.rs index 7163d673a2a00..790492a29ab50 100644 --- a/packages/next-swc/crates/core/src/lib.rs +++ b/packages/next-swc/crates/core/src/lib.rs @@ -37,7 +37,7 @@ use either::Either; use fxhash::FxHashSet; use next_transform_font::next_font_loaders; use serde::Deserialize; -use turbo_binding::swc::core::{ +use turbopack_binding::swc::core::{ common::{chain, comments::Comments, pass::Optional, FileName, SourceFile, SourceMap}, ecma::{ ast::EsVersion, parser::parse_file_as_module, transforms::base::pass::noop, visit::Fold, @@ -61,7 +61,7 @@ mod top_level_binding_collector; #[serde(rename_all = "camelCase")] pub struct TransformOptions { #[serde(flatten)] - pub swc: turbo_binding::swc::core::base::config::Options, + pub swc: turbopack_binding::swc::core::base::config::Options, #[serde(default)] pub disable_next_ssg: bool, @@ -91,7 +91,8 @@ pub struct TransformOptions { pub styled_jsx: bool, #[serde(default)] - pub styled_components: Option, + pub styled_components: + Option, #[serde(default)] pub remove_console: Option, @@ -101,7 +102,7 @@ pub struct TransformOptions { #[serde(default)] #[cfg(not(target_arch = "wasm32"))] - pub relay: Option, + pub relay: Option, #[allow(unused)] #[serde(default)] @@ -113,11 +114,11 @@ pub struct TransformOptions { pub shake_exports: Option, #[serde(default)] - pub emotion: Option, + pub emotion: Option, #[serde(default)] pub modularize_imports: - Option, + Option, #[serde(default)] pub font_loaders: Option, @@ -142,7 +143,7 @@ where #[cfg(not(target_arch = "wasm32"))] let relay_plugin = { if let Some(config) = &opts.relay { - Either::Left(turbo_binding::swc::custom_transform::relay::relay( + Either::Left(turbopack_binding::swc::custom_transform::relay::relay( config, file.name.clone(), current_dir().unwrap(), @@ -156,13 +157,13 @@ where let mut modularize_imports_config = match &opts.modularize_imports { Some(config) => config.clone(), - None => turbo_binding::swc::custom_transform::modularize_imports::Config { + None => turbopack_binding::swc::custom_transform::modularize_imports::Config { packages: std::collections::HashMap::new(), }, }; modularize_imports_config.packages.insert( "next/server".to_string(), - turbo_binding::swc::custom_transform::modularize_imports::PackageConfig { + turbopack_binding::swc::custom_transform::modularize_imports::PackageConfig { transform: "next/dist/server/web/exports/{{ kebabCase member }}".to_string(), prevent_full_import: false, skip_default_conversion: false, @@ -183,7 +184,7 @@ where }, if opts.styled_jsx { Either::Left( - turbo_binding::swc::custom_transform::styled_jsx::visitor::styled_jsx( + turbopack_binding::swc::custom_transform::styled_jsx::visitor::styled_jsx( cm.clone(), file.name.clone(), ), @@ -193,7 +194,7 @@ where }, match &opts.styled_components { Some(config) => Either::Left( - turbo_binding::swc::custom_transform::styled_components::styled_components( + turbopack_binding::swc::custom_transform::styled_components::styled_components( file.name.clone(), file.src_hash, config.clone(), @@ -247,7 +248,7 @@ where if let FileName::Real(path) = &file.name { path.to_str().map(|_| { Either::Left( - turbo_binding::swc::custom_transform::emotion::EmotionTransformer::new( + turbopack_binding::swc::custom_transform::emotion::EmotionTransformer::new( config.clone(), path, file.src_hash as u32, @@ -261,7 +262,7 @@ where } }) .unwrap_or_else(|| Either::Right(noop())), - turbo_binding::swc::custom_transform::modularize_imports::modularize_imports( + turbopack_binding::swc::custom_transform::modularize_imports::modularize_imports( modularize_imports_config ), match &opts.font_loaders { diff --git a/packages/next-swc/crates/core/src/next_dynamic.rs b/packages/next-swc/crates/core/src/next_dynamic.rs index b929cfc3ca4a0..7539c6945319f 100644 --- a/packages/next-swc/crates/core/src/next_dynamic.rs +++ b/packages/next-swc/crates/core/src/next_dynamic.rs @@ -1,7 +1,7 @@ use std::path::{Path, PathBuf}; use pathdiff::diff_paths; -use turbo_binding::swc::core::{ +use turbopack_binding::swc::core::{ common::{errors::HANDLER, FileName, DUMMY_SP}, ecma::{ ast::{ diff --git a/packages/next-swc/crates/core/src/next_ssg.rs b/packages/next-swc/crates/core/src/next_ssg.rs index 6820ac9538b5a..a72a22d33a899 100644 --- a/packages/next-swc/crates/core/src/next_ssg.rs +++ b/packages/next-swc/crates/core/src/next_ssg.rs @@ -2,7 +2,7 @@ use std::{cell::RefCell, mem::take, rc::Rc}; use easy_error::{bail, Error}; use fxhash::FxHashSet; -use turbo_binding::swc::core::{ +use turbopack_binding::swc::core::{ common::{ errors::HANDLER, pass::{Repeat, Repeated}, diff --git a/packages/next-swc/crates/core/src/page_config.rs b/packages/next-swc/crates/core/src/page_config.rs index 645d5bff4d763..2cd97f79783bd 100644 --- a/packages/next-swc/crates/core/src/page_config.rs +++ b/packages/next-swc/crates/core/src/page_config.rs @@ -1,5 +1,5 @@ use chrono::Utc; -use turbo_binding::swc::core::{ +use turbopack_binding::swc::core::{ common::{errors::HANDLER, Span, DUMMY_SP}, ecma::{ ast::*, diff --git a/packages/next-swc/crates/core/src/react_remove_properties.rs b/packages/next-swc/crates/core/src/react_remove_properties.rs index bfe3ec045a0b3..449d4e4f06e22 100644 --- a/packages/next-swc/crates/core/src/react_remove_properties.rs +++ b/packages/next-swc/crates/core/src/react_remove_properties.rs @@ -1,6 +1,6 @@ use regex::Regex; use serde::Deserialize; -use turbo_binding::swc::core::ecma::{ +use turbopack_binding::swc::core::ecma::{ ast::*, visit::{noop_fold_type, Fold, FoldWith}, }; diff --git a/packages/next-swc/crates/core/src/react_server_components.rs b/packages/next-swc/crates/core/src/react_server_components.rs index c3b14975304fd..7d6c74355994e 100644 --- a/packages/next-swc/crates/core/src/react_server_components.rs +++ b/packages/next-swc/crates/core/src/react_server_components.rs @@ -2,7 +2,7 @@ use std::{collections::HashMap, path::PathBuf}; use regex::Regex; use serde::Deserialize; -use turbo_binding::swc::core::{ +use turbopack_binding::swc::core::{ common::{ comments::{Comment, CommentKind, Comments}, errors::HANDLER, diff --git a/packages/next-swc/crates/core/src/remove_console.rs b/packages/next-swc/crates/core/src/remove_console.rs index 6eaa8c16618d5..3fdb4498d810c 100644 --- a/packages/next-swc/crates/core/src/remove_console.rs +++ b/packages/next-swc/crates/core/src/remove_console.rs @@ -1,5 +1,5 @@ use serde::Deserialize; -use turbo_binding::swc::core::{ +use turbopack_binding::swc::core::{ common::{collections::AHashSet, DUMMY_SP}, ecma::{ ast::*, diff --git a/packages/next-swc/crates/core/src/server_actions.rs b/packages/next-swc/crates/core/src/server_actions.rs index c75d969ebcfef..418a24eeb61c5 100644 --- a/packages/next-swc/crates/core/src/server_actions.rs +++ b/packages/next-swc/crates/core/src/server_actions.rs @@ -3,7 +3,7 @@ use std::convert::{TryFrom, TryInto}; use hex::encode as hex_encode; use serde::Deserialize; use sha1::{Digest, Sha1}; -use turbo_binding::swc::core::{ +use turbopack_binding::swc::core::{ common::{ comments::{Comment, CommentKind, Comments}, errors::HANDLER, diff --git a/packages/next-swc/crates/core/src/shake_exports.rs b/packages/next-swc/crates/core/src/shake_exports.rs index 9ea89dd669758..70a05c157b71e 100644 --- a/packages/next-swc/crates/core/src/shake_exports.rs +++ b/packages/next-swc/crates/core/src/shake_exports.rs @@ -1,5 +1,5 @@ use serde::Deserialize; -use turbo_binding::swc::core::{ +use turbopack_binding::swc::core::{ common::Mark, ecma::{ ast::*, diff --git a/packages/next-swc/crates/core/src/top_level_binding_collector.rs b/packages/next-swc/crates/core/src/top_level_binding_collector.rs index 79366d4a22ab5..d315c97e053e7 100644 --- a/packages/next-swc/crates/core/src/top_level_binding_collector.rs +++ b/packages/next-swc/crates/core/src/top_level_binding_collector.rs @@ -1,6 +1,6 @@ use std::hash::Hash; -use turbo_binding::swc::core::{ +use turbopack_binding::swc::core::{ common::{collections::AHashSet, SyntaxContext}, ecma::{ ast::{ diff --git a/packages/next-swc/crates/core/tests/errors.rs b/packages/next-swc/crates/core/tests/errors.rs index ff1e61d0a71fd..95180a857d8c4 100644 --- a/packages/next-swc/crates/core/tests/errors.rs +++ b/packages/next-swc/crates/core/tests/errors.rs @@ -8,7 +8,7 @@ use next_swc::{ server_actions::{self, server_actions}, }; use next_transform_font::{next_font_loaders, Config as FontLoaderConfig}; -use turbo_binding::swc::{ +use turbopack_binding::swc::{ core::{ common::{chain, FileName, Mark}, ecma::{ diff --git a/packages/next-swc/crates/core/tests/fixture.rs b/packages/next-swc/crates/core/tests/fixture.rs index 6b0401b54249e..ac7a28d0ec162 100644 --- a/packages/next-swc/crates/core/tests/fixture.rs +++ b/packages/next-swc/crates/core/tests/fixture.rs @@ -12,7 +12,7 @@ use next_swc::{ shake_exports::{shake_exports, Config as ShakeExportsConfig}, }; use next_transform_font::{next_font_loaders, Config as FontLoaderConfig}; -use turbo_binding::swc::{ +use turbopack_binding::swc::{ core::{ common::{chain, comments::SingleThreadedComments, FileName, Mark}, ecma::{ @@ -110,7 +110,7 @@ fn next_ssg_fixture(input: PathBuf) { let jsx = jsx::( tr.cm.clone(), None, - turbo_binding::swc::core::ecma::transforms::react::Options { + turbopack_binding::swc::core::ecma::transforms::react::Options { next: false.into(), runtime: None, import_source: Some("".into()), @@ -151,7 +151,7 @@ fn page_config_fixture(input: PathBuf) { #[fixture("tests/fixture/relay/**/input.ts*")] fn relay_no_artifact_dir_fixture(input: PathBuf) { let output = input.parent().unwrap().join("output.js"); - let config = turbo_binding::swc::custom_transform::relay::Config { + let config = turbopack_binding::swc::custom_transform::relay::Config { language: RelayLanguageConfig::TypeScript, artifact_directory: Some(PathBuf::from("__generated__")), ..Default::default() diff --git a/packages/next-swc/crates/core/tests/full.rs b/packages/next-swc/crates/core/tests/full.rs index 91588f0220354..98920786b657f 100644 --- a/packages/next-swc/crates/core/tests/full.rs +++ b/packages/next-swc/crates/core/tests/full.rs @@ -2,7 +2,7 @@ use std::path::{Path, PathBuf}; use next_swc::{custom_before_pass, TransformOptions}; use serde::de::DeserializeOwned; -use turbo_binding::swc::{ +use turbopack_binding::swc::{ core::{ base::Compiler, common::comments::SingleThreadedComments, @@ -14,12 +14,12 @@ use turbo_binding::swc::{ testing::{NormalizedOutput, Tester}, }; -#[turbo_binding::swc::testing::fixture("tests/full/**/input.js")] +#[turbopack_binding::swc::testing::fixture("tests/full/**/input.js")] fn full(input: PathBuf) { test(&input, true); } -#[turbo_binding::swc::testing::fixture("tests/loader/**/input.js")] +#[turbopack_binding::swc::testing::fixture("tests/loader/**/input.js")] fn loader(input: PathBuf) { test(&input, false); } @@ -34,16 +34,16 @@ fn test(input: &Path, minify: bool) { let fm = cm.load_file(input).expect("failed to load file"); let options = TransformOptions { - swc: turbo_binding::swc::core::base::config::Options { + swc: turbopack_binding::swc::core::base::config::Options { swcrc: true, output_path: Some(output.clone()), - config: turbo_binding::swc::core::base::config::Config { - is_module: Some(turbo_binding::swc::core::base::config::IsModule::Bool( - true, - )), + config: turbopack_binding::swc::core::base::config::Config { + is_module: Some( + turbopack_binding::swc::core::base::config::IsModule::Bool(true), + ), - jsc: turbo_binding::swc::core::base::config::JscConfig { + jsc: turbopack_binding::swc::core::base::config::JscConfig { minify: if minify { Some(assert_json("{ \"compress\": true, \"mangle\": true }")) } else { diff --git a/packages/next-swc/crates/core/tests/telemetry.rs b/packages/next-swc/crates/core/tests/telemetry.rs index db2ef8b660b21..6d2d113dc83b6 100644 --- a/packages/next-swc/crates/core/tests/telemetry.rs +++ b/packages/next-swc/crates/core/tests/telemetry.rs @@ -3,7 +3,7 @@ use std::{cell::RefCell, rc::Rc, sync::Arc}; use fxhash::FxHashSet; use next_swc::next_ssg::next_ssg; use once_cell::sync::Lazy; -use turbo_binding::swc::core::{ +use turbopack_binding::swc::core::{ base::{try_with_handler, Compiler}, common::{comments::SingleThreadedComments, FileName, FilePathMapping, SourceMap, GLOBALS}, ecma::transforms::base::pass::noop, diff --git a/packages/next-swc/crates/napi/Cargo.toml b/packages/next-swc/crates/napi/Cargo.toml index 3e3d0349c9ef9..cc563e6b7723b 100644 --- a/packages/next-swc/crates/napi/Cargo.toml +++ b/packages/next-swc/crates/napi/Cargo.toml @@ -13,7 +13,7 @@ default = ["rustls-tls"] # when build (i.e napi --build --features plugin), same for the wasm as well. # this is due to some of transitive dependencies have features cannot be enabled at the same time # (i.e wasmer/default vs wasmer/js-default) while cargo merges all the features at once. -plugin = ["turbo-binding/__swc_core_binding_napi_plugin", "next-swc/plugin"] +plugin = ["turbopack-binding/__swc_core_binding_napi_plugin", "next-swc/plugin"] sentry_native_tls = ["sentry", "sentry/native-tls", "native-tls"] sentry_rustls = ["sentry", "sentry/rustls", "rustls-tls"] @@ -58,7 +58,7 @@ tracing = { version = "0.1.37" } tracing-futures = "0.2.5" tracing-subscriber = "0.3.9" tracing-chrome = "0.5.0" -turbo-binding = { workspace = true, features = [ +turbopack-binding = { workspace = true, features = [ "__swc_core_binding_napi", "__feature_node_file_trace", "__feature_mdx_rs", @@ -69,7 +69,7 @@ turbo-binding = { workspace = true, features = [ ] } [target.'cfg(not(all(target_os = "linux", target_env = "musl", target_arch = "aarch64")))'.dependencies] -turbo-binding = { workspace = true, features = [ +turbopack-binding = { workspace = true, features = [ "__turbo_tasks_malloc" ] } @@ -88,6 +88,6 @@ sentry = { version = "0.27.0", default-features = false, features = [ napi-build = "2" serde = "1" serde_json = "1" -turbo-binding = { workspace = true, features = [ +turbopack-binding = { workspace = true, features = [ "__turbo_tasks_build" -]} \ No newline at end of file +]} diff --git a/packages/next-swc/crates/napi/build.rs b/packages/next-swc/crates/napi/build.rs index 454837b40bec4..cb93580b6297d 100644 --- a/packages/next-swc/crates/napi/build.rs +++ b/packages/next-swc/crates/napi/build.rs @@ -5,7 +5,7 @@ use std::{ path::Path, }; -use turbo_binding::turbo::tasks_build::generate_register; +use turbopack_binding::turbo::tasks_build::generate_register; extern crate napi_build; diff --git a/packages/next-swc/crates/napi/src/app_structure.rs b/packages/next-swc/crates/napi/src/app_structure.rs index a06700cf3951a..1824f99d202f7 100644 --- a/packages/next-swc/crates/napi/src/app_structure.rs +++ b/packages/next-swc/crates/napi/src/app_structure.rs @@ -11,7 +11,7 @@ use next_core::app_structure::{ EntrypointsVc, LoaderTree, LoaderTreeVc, MetadataWithAltItem, }; use serde::{Deserialize, Serialize}; -use turbo_binding::{ +use turbopack_binding::{ turbo::{ tasks, tasks::{ diff --git a/packages/next-swc/crates/napi/src/lib.rs b/packages/next-swc/crates/napi/src/lib.rs index d33e192acf418..db1dd3db698a5 100644 --- a/packages/next-swc/crates/napi/src/lib.rs +++ b/packages/next-swc/crates/napi/src/lib.rs @@ -41,7 +41,7 @@ use std::{ use backtrace::Backtrace; use fxhash::FxHashSet; use napi::bindgen_prelude::*; -use turbo_binding::swc::core::{ +use turbopack_binding::swc::core::{ base::{Compiler, TransformOutput}, common::{sync::Lazy, FilePathMapping, SourceMap}, }; @@ -63,7 +63,8 @@ pub mod util; feature = "__internal_dhat-ad-hoc" )))] #[global_allocator] -static ALLOC: turbo_binding::turbo::malloc::TurboMalloc = turbo_binding::turbo::malloc::TurboMalloc; +static ALLOC: turbopack_binding::turbo::malloc::TurboMalloc = + turbopack_binding::turbo::malloc::TurboMalloc; #[cfg(feature = "__internal_dhat-heap")] #[global_allocator] diff --git a/packages/next-swc/crates/napi/src/mdx.rs b/packages/next-swc/crates/napi/src/mdx.rs index 3dfa7cb29b771..d3f32d6992810 100644 --- a/packages/next-swc/crates/napi/src/mdx.rs +++ b/packages/next-swc/crates/napi/src/mdx.rs @@ -1,5 +1,5 @@ use napi::bindgen_prelude::*; -use turbo_binding::features::mdxjs::{compile, Options}; +use turbopack_binding::features::mdxjs::{compile, Options}; pub struct MdxCompileTask { pub input: String, diff --git a/packages/next-swc/crates/napi/src/minify.rs b/packages/next-swc/crates/napi/src/minify.rs index e3e7a5dd7c240..8fb75d06a3c98 100644 --- a/packages/next-swc/crates/napi/src/minify.rs +++ b/packages/next-swc/crates/napi/src/minify.rs @@ -30,7 +30,7 @@ use std::sync::Arc; use fxhash::FxHashMap; use napi::bindgen_prelude::*; use serde::Deserialize; -use turbo_binding::swc::core::{ +use turbopack_binding::swc::core::{ base::{try_with_handler, TransformOutput}, common::{errors::ColorConfig, sync::Lrc, FileName, SourceFile, SourceMap, GLOBALS}, }; @@ -38,9 +38,9 @@ use turbo_binding::swc::core::{ use crate::{get_compiler, util::MapErr}; pub struct MinifyTask { - c: Arc, + c: Arc, code: MinifyTarget, - opts: turbo_binding::swc::core::base::config::JsMinifyOptions, + opts: turbopack_binding::swc::core::base::config::JsMinifyOptions, } #[derive(Deserialize)] @@ -80,7 +80,7 @@ impl Task for MinifyTask { fn compute(&mut self) -> napi::Result { try_with_handler( self.c.cm.clone(), - turbo_binding::swc::core::base::HandlerOpts { + turbopack_binding::swc::core::base::HandlerOpts { color: ColorConfig::Never, skip_filename: true, }, @@ -127,7 +127,7 @@ pub fn minify_sync(input: Buffer, opts: Buffer) -> napi::Result try_with_handler( c.cm.clone(), - turbo_binding::swc::core::base::HandlerOpts { + turbopack_binding::swc::core::base::HandlerOpts { color: ColorConfig::Never, skip_filename: true, }, diff --git a/packages/next-swc/crates/napi/src/parse.rs b/packages/next-swc/crates/napi/src/parse.rs index c6deda1c3248e..0df7489849ff8 100644 --- a/packages/next-swc/crates/napi/src/parse.rs +++ b/packages/next-swc/crates/napi/src/parse.rs @@ -2,7 +2,7 @@ use std::sync::Arc; use anyhow::Context as _; use napi::bindgen_prelude::*; -use turbo_binding::swc::core::{ +use turbopack_binding::swc::core::{ base::{config::ParseOptions, try_with_handler}, common::{ comments::Comments, errors::ColorConfig, FileName, FilePathMapping, SourceMap, GLOBALS, @@ -24,7 +24,7 @@ impl Task for ParseTask { fn compute(&mut self) -> napi::Result { GLOBALS.set(&Default::default(), || { - let c = turbo_binding::swc::core::base::Compiler::new(Arc::new(SourceMap::new( + let c = turbopack_binding::swc::core::base::Compiler::new(Arc::new(SourceMap::new( FilePathMapping::empty(), ))); @@ -39,7 +39,7 @@ impl Task for ParseTask { c.cm.new_source_file(self.filename.clone(), self.src.clone()); let program = try_with_handler( c.cm.clone(), - turbo_binding::swc::core::base::HandlerOpts { + turbopack_binding::swc::core::base::HandlerOpts { color: ColorConfig::Never, skip_filename: false, }, diff --git a/packages/next-swc/crates/napi/src/transform.rs b/packages/next-swc/crates/napi/src/transform.rs index 85563fb1932c9..1c52fbd61031d 100644 --- a/packages/next-swc/crates/napi/src/transform.rs +++ b/packages/next-swc/crates/napi/src/transform.rs @@ -38,7 +38,7 @@ use anyhow::{anyhow, bail, Context as _}; use fxhash::FxHashSet; use napi::bindgen_prelude::*; use next_swc::{custom_before_pass, TransformOptions}; -use turbo_binding::swc::core::{ +use turbopack_binding::swc::core::{ base::{try_with_handler, Compiler, TransformOutput}, common::{comments::SingleThreadedComments, errors::ColorConfig, FileName, GLOBALS}, ecma::transforms::base::pass::noop, @@ -76,7 +76,7 @@ impl Task for TransformTask { let res = catch_unwind(AssertUnwindSafe(|| { try_with_handler( self.c.cm.clone(), - turbo_binding::swc::core::base::HandlerOpts { + turbopack_binding::swc::core::base::HandlerOpts { color: ColorConfig::Always, skip_filename: skip_filename(), }, diff --git a/packages/next-swc/crates/napi/src/turbotrace.rs b/packages/next-swc/crates/napi/src/turbotrace.rs index e261129c49c9a..8afe5f6ee056c 100644 --- a/packages/next-swc/crates/napi/src/turbotrace.rs +++ b/packages/next-swc/crates/napi/src/turbotrace.rs @@ -1,7 +1,7 @@ use std::sync::Arc; use napi::bindgen_prelude::*; -use turbo_binding::{ +use turbopack_binding::{ features::node_file_trace::{start, Args}, turbo::{tasks::TurboTasks, tasks_memory::MemoryBackend}, turbopack::turbopack::{ diff --git a/packages/next-swc/crates/next-build/Cargo.toml b/packages/next-swc/crates/next-build/Cargo.toml index b79641757ff16..804333c3ce07f 100644 --- a/packages/next-swc/crates/next-build/Cargo.toml +++ b/packages/next-swc/crates/next-build/Cargo.toml @@ -9,16 +9,16 @@ autobenches = false [features] native-tls = ["next-core/native-tls"] rustls-tls = ["next-core/rustls-tls"] -custom_allocator = ["turbo-binding/__turbo_tasks_malloc", "turbo-binding/__turbo_tasks_malloc_custom_allocator"] +custom_allocator = ["turbopack-binding/__turbo_tasks_malloc", "turbopack-binding/__turbo_tasks_malloc_custom_allocator"] [dependencies] anyhow = "1.0.47" next-core = { workspace = true } -turbo-binding = { workspace = true, features = ["__turbo_tasks", "__turbo_tasks_memory"] } +turbopack-binding = { workspace = true, features = ["__turbo_tasks", "__turbo_tasks_memory"] } [build-dependencies] -turbo-binding = { workspace = true, features = ["__turbo_tasks_build"] } +turbopack-binding = { workspace = true, features = ["__turbo_tasks_build"] } vergen = { version = "7.3.2", default-features = false, features = [ "cargo", "build", diff --git a/packages/next-swc/crates/next-build/build.rs b/packages/next-swc/crates/next-build/build.rs index fe7deb8608b61..5979850164cfd 100644 --- a/packages/next-swc/crates/next-build/build.rs +++ b/packages/next-swc/crates/next-build/build.rs @@ -1,4 +1,4 @@ -use turbo_binding::turbo::tasks_build::generate_register; +use turbopack_binding::turbo::tasks_build::generate_register; use vergen::{vergen, Config}; fn main() { diff --git a/packages/next-swc/crates/next-build/src/lib.rs b/packages/next-swc/crates/next-build/src/lib.rs index 17b3b828aa1f6..bdcfbc7c876e6 100644 --- a/packages/next-swc/crates/next-build/src/lib.rs +++ b/packages/next-swc/crates/next-build/src/lib.rs @@ -1,10 +1,10 @@ -use turbo_binding::turbo::{ +use turbopack_binding::turbo::{ tasks::{NothingVc, StatsType, TurboTasks, TurboTasksBackendApi}, tasks_memory::MemoryBackend, }; pub fn register() { - turbo_binding::turbo::tasks::register(); + turbopack_binding::turbo::tasks::register(); include!(concat!(env!("OUT_DIR"), "/register.rs")); } diff --git a/packages/next-swc/crates/next-core/Cargo.toml b/packages/next-swc/crates/next-core/Cargo.toml index 39463bf3726d1..49f5be4dfd164 100644 --- a/packages/next-swc/crates/next-core/Cargo.toml +++ b/packages/next-swc/crates/next-core/Cargo.toml @@ -23,7 +23,7 @@ indoc = { workspace = true } allsorts = { workspace = true } futures = { workspace = true } lazy_static = { workspace = true } -turbo-binding = { workspace = true, features = [ +turbopack-binding = { workspace = true, features = [ "__swc_transform_modularize_imports", "__swc_transform_relay", "__feature_auto_hash_map", @@ -57,16 +57,16 @@ swc_core = { workspace = true, features = [ ] } [build-dependencies] -turbo-binding = { workspace = true, features = ["__turbo_tasks_build"] } +turbopack-binding = { workspace = true, features = ["__turbo_tasks_build"] } [features] next-font-local = [] -native-tls = ["turbo-binding/__turbo_tasks_fetch_native-tls"] -rustls-tls = ["turbo-binding/__turbo_tasks_fetch_rustls-tls"] +native-tls = ["turbopack-binding/__turbo_tasks_fetch_native-tls"] +rustls-tls = ["turbopack-binding/__turbo_tasks_fetch_rustls-tls"] # Internal only. Enabled when building for the Next.js integration test suite. __internal_nextjs_integration_test = [] # enable "HMR" for embedded assets dynamic_embed_contents = [ - "turbo-binding/__turbo_tasks_fs_dynamic_embed_contents", - "turbo-binding/__turbopack_dev_dynamic_embed_contents", + "turbopack-binding/__turbo_tasks_fs_dynamic_embed_contents", + "turbopack-binding/__turbopack_dev_dynamic_embed_contents", ] diff --git a/packages/next-swc/crates/next-core/build.rs b/packages/next-swc/crates/next-core/build.rs index d600ae626e1b6..23e4bcb55d922 100644 --- a/packages/next-swc/crates/next-core/build.rs +++ b/packages/next-swc/crates/next-core/build.rs @@ -1,4 +1,4 @@ -use turbo_binding::turbo::tasks_build::generate_register; +use turbopack_binding::turbo::tasks_build::generate_register; fn main() { generate_register(); diff --git a/packages/next-swc/crates/next-core/src/app_render/mod.rs b/packages/next-swc/crates/next-core/src/app_render/mod.rs index c3d3e4f4d6ddb..e1436002e3e0b 100644 --- a/packages/next-swc/crates/next-core/src/app_render/mod.rs +++ b/packages/next-swc/crates/next-core/src/app_render/mod.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use turbo_binding::turbo::tasks_fs::FileSystemPathVc; +use turbopack_binding::turbo::tasks_fs::FileSystemPathVc; pub mod next_layout_entry_transition; diff --git a/packages/next-swc/crates/next-core/src/app_render/next_layout_entry_transition.rs b/packages/next-swc/crates/next-core/src/app_render/next_layout_entry_transition.rs index 6b6c257de6d39..472b2a9f554ff 100644 --- a/packages/next-swc/crates/next-core/src/app_render/next_layout_entry_transition.rs +++ b/packages/next-swc/crates/next-core/src/app_render/next_layout_entry_transition.rs @@ -1,5 +1,5 @@ use anyhow::{bail, Result}; -use turbo_binding::{ +use turbopack_binding::{ turbo::tasks_fs::FileSystemPathVc, turbopack::{ core::{asset::AssetVc, compile_time_info::CompileTimeInfoVc}, diff --git a/packages/next-swc/crates/next-core/src/app_segment_config.rs b/packages/next-swc/crates/next-core/src/app_segment_config.rs index a51eeb3c9c6f2..d771881d144a9 100644 --- a/packages/next-swc/crates/next-core/src/app_segment_config.rs +++ b/packages/next-swc/crates/next-core/src/app_segment_config.rs @@ -7,7 +7,9 @@ use swc_core::{ common::{source_map::Pos, Span, Spanned}, ecma::ast::{Expr, Ident, Program}, }; -use turbo_binding::turbopack::{ +use turbo_tasks::{primitives::StringVc, trace::TraceRawVcs}; +use turbo_tasks_fs::FileSystemPathVc; +use turbopack_binding::turbopack::{ core::{ asset::{Asset, AssetVc}, ident::AssetIdentVc, @@ -21,8 +23,6 @@ use turbo_binding::turbopack::{ EcmascriptModuleAssetVc, }, }; -use turbo_tasks::{primitives::StringVc, trace::TraceRawVcs}; -use turbo_tasks_fs::FileSystemPathVc; use crate::util::NextRuntime; diff --git a/packages/next-swc/crates/next-core/src/app_source.rs b/packages/next-swc/crates/next-core/src/app_source.rs index ee8fdd970e1f4..f99afe59a9daa 100644 --- a/packages/next-swc/crates/next-core/src/app_source.rs +++ b/packages/next-swc/crates/next-core/src/app_source.rs @@ -3,7 +3,8 @@ use std::{collections::HashMap, io::Write, iter::once}; use anyhow::Result; use async_recursion::async_recursion; use indexmap::{indexmap, IndexMap}; -use turbo_binding::{ +use turbo_tasks::{primitives::JsonValueVc, TryJoinIterExt, ValueToString}; +use turbopack_binding::{ turbo::{ tasks::{ primitives::{OptionStringVc, StringVc}, @@ -60,7 +61,6 @@ use turbo_binding::{ }, }, }; -use turbo_tasks::{primitives::JsonValueVc, TryJoinIterExt, ValueToString}; use crate::{ app_render::next_layout_entry_transition::NextServerComponentTransition, diff --git a/packages/next-swc/crates/next-core/src/app_structure.rs b/packages/next-swc/crates/next-core/src/app_structure.rs index c9524bbecabcb..fb59ea914c2b4 100644 --- a/packages/next-swc/crates/next-core/src/app_structure.rs +++ b/packages/next-swc/crates/next-core/src/app_structure.rs @@ -8,16 +8,16 @@ use indexmap::{indexmap, map::Entry, IndexMap}; use once_cell::sync::Lazy; use regex::Regex; use serde::{Deserialize, Serialize}; -use turbo_binding::{ - turbo::tasks_fs::{DirectoryContent, DirectoryEntry, FileSystemEntryType, FileSystemPathVc}, - turbopack::core::issue::{Issue, IssueSeverity, IssueSeverityVc, IssueVc}, -}; use turbo_tasks::{ debug::ValueDebugFormat, primitives::{StringVc, StringsVc}, trace::TraceRawVcs, CompletionVc, CompletionsVc, }; +use turbopack_binding::{ + turbo::tasks_fs::{DirectoryContent, DirectoryEntry, FileSystemEntryType, FileSystemPathVc}, + turbopack::core::issue::{Issue, IssueSeverity, IssueSeverityVc, IssueVc}, +}; use crate::next_config::NextConfigVc; diff --git a/packages/next-swc/crates/next-core/src/asset_helpers.rs b/packages/next-swc/crates/next-core/src/asset_helpers.rs index 6dc253261d4f7..d6d37bb3c60c5 100644 --- a/packages/next-swc/crates/next-core/src/asset_helpers.rs +++ b/packages/next-swc/crates/next-core/src/asset_helpers.rs @@ -1,4 +1,5 @@ -use turbo_binding::turbopack::{ +use turbo_tasks::Value; +use turbopack_binding::turbopack::{ core::{ asset::AssetVc, context::{AssetContext, AssetContextVc}, @@ -8,7 +9,6 @@ use turbo_binding::turbopack::{ EcmascriptModuleAssetVc, }, }; -use turbo_tasks::Value; pub(crate) fn as_es_module_asset( asset: AssetVc, diff --git a/packages/next-swc/crates/next-core/src/babel.rs b/packages/next-swc/crates/next-core/src/babel.rs index 96782ab744aef..18805f600ceec 100644 --- a/packages/next-swc/crates/next-core/src/babel.rs +++ b/packages/next-swc/crates/next-core/src/babel.rs @@ -1,5 +1,9 @@ use anyhow::Result; -use turbo_binding::{ +use turbo_tasks::{ + primitives::{BoolVc, StringVc}, + Value, +}; +use turbopack_binding::{ turbo::tasks_fs::{FileSystemEntryType, FileSystemPathVc}, turbopack::{ core::{ @@ -13,10 +17,6 @@ use turbo_binding::{ }, }, }; -use turbo_tasks::{ - primitives::{BoolVc, StringVc}, - Value, -}; const BABEL_CONFIG_FILES: &[&str] = &[ ".babelrc", diff --git a/packages/next-swc/crates/next-core/src/bootstrap.rs b/packages/next-swc/crates/next-core/src/bootstrap.rs index 115f410de268f..efc7472fc7f73 100644 --- a/packages/next-swc/crates/next-core/src/bootstrap.rs +++ b/packages/next-swc/crates/next-core/src/bootstrap.rs @@ -1,6 +1,8 @@ use anyhow::{bail, Context, Result}; use indexmap::{indexmap, IndexMap}; -use turbo_binding::turbopack::{ +use turbo_tasks::Value; +use turbo_tasks_fs::{File, FileSystemPathVc}; +use turbopack_binding::turbopack::{ core::{ asset::{Asset, AssetVc}, context::{AssetContext, AssetContextVc}, @@ -15,8 +17,6 @@ use turbo_binding::turbopack::{ InnerAssetsVc, }, }; -use turbo_tasks::Value; -use turbo_tasks_fs::{File, FileSystemPathVc}; use crate::asset_helpers::as_es_module_asset; diff --git a/packages/next-swc/crates/next-core/src/embed_js.rs b/packages/next-swc/crates/next-core/src/embed_js.rs index d078ad0814ea0..9eb05823527d4 100644 --- a/packages/next-swc/crates/next-core/src/embed_js.rs +++ b/packages/next-swc/crates/next-core/src/embed_js.rs @@ -1,4 +1,4 @@ -use turbo_binding::{ +use turbopack_binding::{ turbo::tasks_fs::{FileContentVc, FileSystem, FileSystemPathVc, FileSystemVc}, turbopack::core::{asset::AssetVc, source_asset::SourceAssetVc}, }; @@ -7,7 +7,7 @@ pub const VIRTUAL_PACKAGE_NAME: &str = "@vercel/turbopack-next"; #[turbo_tasks::function] pub(crate) fn next_js_fs() -> FileSystemVc { - // [TODO]: macro need to be refactored to be used via turbo-binding + // [TODO]: macro need to be refactored to be used via turbopack-binding turbo_tasks_fs::embed_directory!("next", "$CARGO_MANIFEST_DIR/js/src") } diff --git a/packages/next-swc/crates/next-core/src/env.rs b/packages/next-swc/crates/next-core/src/env.rs index 86e37d2e50491..10a8756a3e0b7 100644 --- a/packages/next-swc/crates/next-core/src/env.rs +++ b/packages/next-swc/crates/next-core/src/env.rs @@ -1,6 +1,6 @@ use anyhow::Result; use indexmap::indexmap; -use turbo_binding::{ +use turbopack_binding::{ turbo::tasks_env::{ CustomProcessEnvVc, EnvMapVc, FilterProcessEnvVc, ProcessEnv, ProcessEnvVc, }, diff --git a/packages/next-swc/crates/next-core/src/fallback.rs b/packages/next-swc/crates/next-core/src/fallback.rs index f8b13ca2e68b8..8a0409ee95836 100644 --- a/packages/next-swc/crates/next-core/src/fallback.rs +++ b/packages/next-swc/crates/next-core/src/fallback.rs @@ -1,7 +1,8 @@ use std::collections::HashMap; use anyhow::{bail, Result}; -use turbo_binding::{ +use turbo_tasks::Value; +use turbopack_binding::{ turbo::{tasks_env::ProcessEnvVc, tasks_fs::FileSystemPathVc}, turbopack::{ core::{ @@ -17,7 +18,6 @@ use turbo_binding::{ }, }, }; -use turbo_tasks::Value; use crate::{ next_client::context::{ diff --git a/packages/next-swc/crates/next-core/src/lib.rs b/packages/next-swc/crates/next-core/src/lib.rs index 31d4c91071e8a..fa1ea6f643372 100644 --- a/packages/next-swc/crates/next-core/src/lib.rs +++ b/packages/next-swc/crates/next-core/src/lib.rs @@ -37,7 +37,7 @@ mod web_entry_source; pub use app_source::create_app_source; pub use page_source::create_page_source; -pub use turbo_binding::{turbopack::node::source_map, *}; +pub use turbopack_binding::{turbopack::node::source_map, *}; pub use web_entry_source::create_web_entry_source; pub fn register() { diff --git a/packages/next-swc/crates/next-core/src/manifest.rs b/packages/next-swc/crates/next-core/src/manifest.rs index 9ed0f825e0791..c62a6b1571819 100644 --- a/packages/next-swc/crates/next-core/src/manifest.rs +++ b/packages/next-swc/crates/next-core/src/manifest.rs @@ -2,7 +2,11 @@ use anyhow::{Context, Result}; use indexmap::IndexMap; use mime::{APPLICATION_JAVASCRIPT_UTF_8, APPLICATION_JSON}; use serde::Serialize; -use turbo_binding::{ +use turbo_tasks::{ + graph::{GraphTraversal, NonDeterministic}, + primitives::{StringReadRef, StringVc, StringsVc}, +}; +use turbopack_binding::{ turbo::{tasks::TryJoinIterExt, tasks_fs::File}, turbopack::{ core::{ @@ -18,10 +22,6 @@ use turbo_binding::{ }, }, }; -use turbo_tasks::{ - graph::{GraphTraversal, NonDeterministic}, - primitives::{StringReadRef, StringVc, StringsVc}, -}; use crate::{ embed_js::next_js_file, diff --git a/packages/next-swc/crates/next-core/src/next_build.rs b/packages/next-swc/crates/next-core/src/next_build.rs index b406394529d02..4492520144917 100644 --- a/packages/next-swc/crates/next-core/src/next_build.rs +++ b/packages/next-swc/crates/next-core/src/next_build.rs @@ -1,9 +1,9 @@ use anyhow::Result; -use turbo_binding::{ +use turbo_tasks::primitives::StringVc; +use turbopack_binding::{ turbo::tasks_fs::FileSystemPathVc, turbopack::core::resolve::options::{ImportMapping, ImportMappingVc}, }; -use turbo_tasks::primitives::StringVc; use crate::next_import_map::get_next_package; 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 d302e08343ef5..077936dcf8969 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 @@ -2,7 +2,9 @@ use core::{default::Default, result::Result::Ok}; use std::collections::HashMap; use anyhow::Result; -use turbo_binding::{ +use turbo_tasks::{primitives::StringVc, Value}; +use turbo_tasks_fs::FileSystem; +use turbopack_binding::{ turbo::{tasks_env::ProcessEnvVc, tasks_fs::FileSystemPathVc}, turbopack::{ core::{ @@ -37,8 +39,6 @@ use turbo_binding::{ }, }, }; -use turbo_tasks::{primitives::StringVc, Value}; -use turbo_tasks_fs::FileSystem; use super::transforms::get_next_client_transforms_rules; use crate::{ diff --git a/packages/next-swc/crates/next-core/src/next_client/runtime_entry.rs b/packages/next-swc/crates/next-core/src/next_client/runtime_entry.rs index 06d50db2ee676..234e44c4e332e 100644 --- a/packages/next-swc/crates/next-core/src/next_client/runtime_entry.rs +++ b/packages/next-swc/crates/next-core/src/next_client/runtime_entry.rs @@ -1,5 +1,5 @@ use anyhow::{bail, Result}; -use turbo_binding::{ +use turbopack_binding::{ turbo::{tasks::ValueToString, tasks_fs::FileSystemPathVc}, turbopack::{ core::{ diff --git a/packages/next-swc/crates/next-core/src/next_client/transforms.rs b/packages/next-swc/crates/next-core/src/next_client/transforms.rs index 22e62506e4801..0cf21c38e23ca 100644 --- a/packages/next-swc/crates/next-core/src/next_client/transforms.rs +++ b/packages/next-swc/crates/next-core/src/next_client/transforms.rs @@ -1,6 +1,6 @@ use anyhow::Result; use next_transform_strip_page_exports::ExportFilter; -use turbo_binding::turbopack::turbopack::module_options::ModuleRule; +use turbopack_binding::turbopack::turbopack::module_options::ModuleRule; use crate::{ next_client::context::ClientContextType, diff --git a/packages/next-swc/crates/next-core/src/next_client/transition.rs b/packages/next-swc/crates/next-core/src/next_client/transition.rs index a8799a443aa73..f02e1169847c5 100644 --- a/packages/next-swc/crates/next-core/src/next_client/transition.rs +++ b/packages/next-swc/crates/next-core/src/next_client/transition.rs @@ -1,6 +1,7 @@ use anyhow::{bail, Result}; use indexmap::indexmap; -use turbo_binding::turbopack::{ +use turbo_tasks::{primitives::OptionStringVc, Value}; +use turbopack_binding::turbopack::{ core::{ asset::AssetVc, chunk::{ChunkingContext, ChunkingContextVc}, @@ -19,7 +20,6 @@ use turbo_binding::turbopack::{ ModuleAssetContextVc, }, }; -use turbo_tasks::{primitives::OptionStringVc, Value}; use super::runtime_entry::RuntimeEntriesVc; use crate::embed_js::next_asset; diff --git a/packages/next-swc/crates/next-core/src/next_client_chunks/client_chunks_transition.rs b/packages/next-swc/crates/next-core/src/next_client_chunks/client_chunks_transition.rs index 09e9d60502461..a8097a2b7c84c 100644 --- a/packages/next-swc/crates/next-core/src/next_client_chunks/client_chunks_transition.rs +++ b/packages/next-swc/crates/next-core/src/next_client_chunks/client_chunks_transition.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_binding::{ +use turbo_tasks::Value; +use turbopack_binding::{ turbo::tasks_fs::FileSystemPathVc, turbopack::{ core::{asset::AssetVc, chunk::ChunkingContextVc, compile_time_info::CompileTimeInfoVc}, @@ -13,7 +14,6 @@ use turbo_binding::{ }, }, }; -use turbo_tasks::Value; use super::with_chunks::WithChunksAsset; use crate::{ diff --git a/packages/next-swc/crates/next-core/src/next_client_chunks/in_chunking_context_asset.rs b/packages/next-swc/crates/next-core/src/next_client_chunks/in_chunking_context_asset.rs index 4917c63c2fe8c..0abd6fee1e721 100644 --- a/packages/next-swc/crates/next-core/src/next_client_chunks/in_chunking_context_asset.rs +++ b/packages/next-swc/crates/next-core/src/next_client_chunks/in_chunking_context_asset.rs @@ -1,5 +1,6 @@ use anyhow::{bail, Result}; -use turbo_binding::turbopack::{ +use turbo_tasks::{primitives::StringVc, Value}; +use turbopack_binding::turbopack::{ core::{ asset::{Asset, AssetContentVc, AssetVc}, chunk::{ @@ -15,7 +16,6 @@ use turbo_binding::turbopack::{ EcmascriptChunkVc, EcmascriptExportsVc, }, }; -use turbo_tasks::{primitives::StringVc, Value}; #[turbo_tasks::function] fn modifier() -> StringVc { diff --git a/packages/next-swc/crates/next-core/src/next_client_chunks/with_chunks.rs b/packages/next-swc/crates/next-core/src/next_client_chunks/with_chunks.rs index c3be574dca380..afa1886e58da8 100644 --- a/packages/next-swc/crates/next-core/src/next_client_chunks/with_chunks.rs +++ b/packages/next-swc/crates/next-core/src/next_client_chunks/with_chunks.rs @@ -2,7 +2,7 @@ use std::io::Write; use anyhow::{bail, Result}; use indoc::writedoc; -use turbo_binding::{ +use turbopack_binding::{ turbo::{ tasks::{primitives::StringVc, TryJoinIterExt, Value}, tasks_fs::rope::RopeBuilder, diff --git a/packages/next-swc/crates/next-core/src/next_client_component/server_to_client_transition.rs b/packages/next-swc/crates/next-core/src/next_client_component/server_to_client_transition.rs index a9667f9857dfc..d2c9bb7ec3505 100644 --- a/packages/next-swc/crates/next-core/src/next_client_component/server_to_client_transition.rs +++ b/packages/next-swc/crates/next-core/src/next_client_component/server_to_client_transition.rs @@ -1,6 +1,7 @@ use anyhow::Result; use indexmap::indexmap; -use turbo_binding::turbopack::{ +use turbo_tasks::{primitives::OptionStringVc, Value}; +use turbopack_binding::turbopack::{ core::{ asset::AssetVc, context::AssetContext, @@ -15,7 +16,6 @@ use turbo_binding::turbopack::{ ModuleAssetContextVc, }, }; -use turbo_tasks::{primitives::OptionStringVc, Value}; use crate::embed_js::next_asset; diff --git a/packages/next-swc/crates/next-core/src/next_client_component/ssr_client_module_transition.rs b/packages/next-swc/crates/next-core/src/next_client_component/ssr_client_module_transition.rs index 4399cdc61f2ea..c353ae965a6a8 100644 --- a/packages/next-swc/crates/next-core/src/next_client_component/ssr_client_module_transition.rs +++ b/packages/next-swc/crates/next-core/src/next_client_component/ssr_client_module_transition.rs @@ -1,5 +1,5 @@ use anyhow::Result; -use turbo_binding::turbopack::{ +use turbopack_binding::turbopack::{ core::{asset::AssetVc, compile_time_info::CompileTimeInfoVc}, turbopack::{ ecmascript::chunk::EcmascriptChunkPlaceableVc, diff --git a/packages/next-swc/crates/next-core/src/next_client_component/with_chunking_context_scope_asset.rs b/packages/next-swc/crates/next-core/src/next_client_component/with_chunking_context_scope_asset.rs index 34ed6e62f4436..d2dda180f15cb 100644 --- a/packages/next-swc/crates/next-core/src/next_client_component/with_chunking_context_scope_asset.rs +++ b/packages/next-swc/crates/next-core/src/next_client_component/with_chunking_context_scope_asset.rs @@ -1,5 +1,6 @@ use anyhow::{Context, Result}; -use turbo_binding::turbopack::{ +use turbo_tasks::{primitives::StringVc, Value}; +use turbopack_binding::turbopack::{ core::{ asset::{Asset, AssetContentVc, AssetVc}, chunk::{ @@ -15,7 +16,6 @@ use turbo_binding::turbopack::{ EcmascriptChunkVc, EcmascriptExportsVc, }, }; -use turbo_tasks::{primitives::StringVc, Value}; #[turbo_tasks::function] fn modifier() -> StringVc { diff --git a/packages/next-swc/crates/next-core/src/next_client_component/with_client_chunks.rs b/packages/next-swc/crates/next-core/src/next_client_component/with_client_chunks.rs index 69f682705460c..503678f9e698e 100644 --- a/packages/next-swc/crates/next-core/src/next_client_component/with_client_chunks.rs +++ b/packages/next-swc/crates/next-core/src/next_client_component/with_client_chunks.rs @@ -1,6 +1,7 @@ use anyhow::{Context, Result}; use indoc::formatdoc; -use turbo_binding::{ +use turbo_tasks::{primitives::StringVc, TryJoinIterExt, Value, ValueToString, ValueToStringVc}; +use turbopack_binding::{ turbo::tasks_fs::FileSystemPathVc, turbopack::{ core::{ @@ -30,7 +31,6 @@ use turbo_binding::{ }, }, }; -use turbo_tasks::{primitives::StringVc, TryJoinIterExt, Value, ValueToString, ValueToStringVc}; #[turbo_tasks::function] fn modifier() -> StringVc { diff --git a/packages/next-swc/crates/next-core/src/next_config.rs b/packages/next-swc/crates/next-core/src/next_config.rs index 898a1fff4cb3d..f9eb63e478ec0 100644 --- a/packages/next-swc/crates/next-core/src/next_config.rs +++ b/packages/next-swc/crates/next-core/src/next_config.rs @@ -2,7 +2,13 @@ use anyhow::{Context, Result}; use indexmap::IndexMap; use serde::{Deserialize, Serialize}; use serde_json::Value as JsonValue; -use turbo_binding::{ +use turbo_tasks::{ + primitives::{BoolVc, StringsVc}, + trace::TraceRawVcs, + CompletionVc, Value, +}; +use turbo_tasks_fs::json::parse_json_with_source_context; +use turbopack_binding::{ turbo::{tasks_env::EnvMapVc, tasks_fs::FileSystemPathVc}, turbopack::{ core::{ @@ -35,12 +41,6 @@ use turbo_binding::{ turbopack::evaluate_context::node_evaluate_asset_context, }, }; -use turbo_tasks::{ - primitives::{BoolVc, StringsVc}, - trace::TraceRawVcs, - CompletionVc, Value, -}; -use turbo_tasks_fs::json::parse_json_with_source_context; use crate::{embed_js::next_asset, next_shared::transforms::ModularizeImportPackageConfig}; @@ -646,7 +646,7 @@ pub async fn load_next_config_internal( ) .await?; - let turbo_binding::turbo::tasks_bytes::stream::SingleValue::Single(val) = config_value.try_into_single().await.context("Evaluation of Next.js config failed")? else { + let turbopack_binding::turbo::tasks_bytes::stream::SingleValue::Single(val) = config_value.try_into_single().await.context("Evaluation of Next.js config failed")? else { return Ok(NextConfig::default().cell()); }; let next_config: NextConfig = parse_json_with_source_context(val.to_str()?)?; diff --git a/packages/next-swc/crates/next-core/src/next_edge/context.rs b/packages/next-swc/crates/next-core/src/next_edge/context.rs index 2f2fc0705f8a6..97637b6bc01e7 100644 --- a/packages/next-swc/crates/next-core/src/next_edge/context.rs +++ b/packages/next-swc/crates/next-core/src/next_edge/context.rs @@ -1,5 +1,6 @@ use anyhow::Result; -use turbo_binding::{ +use turbo_tasks::Value; +use turbopack_binding::{ turbo::tasks_fs::FileSystemPathVc, turbopack::{ core::{ @@ -18,7 +19,6 @@ use turbo_binding::{ turbopack::resolve_options_context::{ResolveOptionsContext, ResolveOptionsContextVc}, }, }; -use turbo_tasks::Value; use crate::{ next_config::NextConfigVc, next_import_map::get_next_edge_import_map, diff --git a/packages/next-swc/crates/next-core/src/next_edge/transition.rs b/packages/next-swc/crates/next-core/src/next_edge/transition.rs index 7b565bbdd23c2..e64598522e1b0 100644 --- a/packages/next-swc/crates/next-core/src/next_edge/transition.rs +++ b/packages/next-swc/crates/next-core/src/next_edge/transition.rs @@ -1,6 +1,6 @@ use anyhow::Result; use indexmap::indexmap; -use turbo_binding::{ +use turbopack_binding::{ turbo::tasks_fs::FileSystemPathVc, turbopack::{ core::{asset::AssetVc, chunk::ChunkingContextVc, compile_time_info::CompileTimeInfoVc}, diff --git a/packages/next-swc/crates/next-core/src/next_font/font_fallback.rs b/packages/next-swc/crates/next-core/src/next_font/font_fallback.rs index f35e68fab74f1..c6864422396bb 100644 --- a/packages/next-swc/crates/next-core/src/next_font/font_fallback.rs +++ b/packages/next-swc/crates/next-core/src/next_font/font_fallback.rs @@ -1,7 +1,7 @@ use anyhow::Result; use once_cell::sync::Lazy; use serde::{Deserialize, Serialize}; -use turbo_binding::turbo::tasks::{ +use turbopack_binding::turbo::tasks::{ primitives::{StringVc, StringsVc}, trace::TraceRawVcs, }; diff --git a/packages/next-swc/crates/next-core/src/next_font/google/font_fallback.rs b/packages/next-swc/crates/next-core/src/next_font/google/font_fallback.rs index 36eb51ddff6b8..90253af4c2ddf 100644 --- a/packages/next-swc/crates/next-core/src/next_font/google/font_fallback.rs +++ b/packages/next-swc/crates/next-core/src/next_font/google/font_fallback.rs @@ -4,11 +4,11 @@ use anyhow::{Context, Result}; use once_cell::sync::Lazy; use regex::Regex; use serde::{Deserialize, Serialize}; -use turbo_binding::{turbo::tasks_fs::FileSystemPathVc, turbopack::core::issue::IssueSeverity}; use turbo_tasks::{ primitives::{StringVc, StringsVc, U32Vc}, trace::TraceRawVcs, }; +use turbopack_binding::{turbo::tasks_fs::FileSystemPathVc, turbopack::core::issue::IssueSeverity}; use super::options::NextFontGoogleOptionsVc; use crate::{ @@ -180,7 +180,7 @@ fn lookup_fallback( #[cfg(test)] mod tests { use anyhow::Result; - use turbo_binding::turbo::tasks_fs::json::parse_json_with_source_context; + use turbopack_binding::turbo::tasks_fs::json::parse_json_with_source_context; use super::{FontAdjustment, FontMetricsMap}; use crate::next_font::google::font_fallback::{lookup_fallback, Fallback}; diff --git a/packages/next-swc/crates/next-core/src/next_font/google/mod.rs b/packages/next-swc/crates/next-core/src/next_font/google/mod.rs index 18fcaa44523c0..f67c381f849ec 100644 --- a/packages/next-swc/crates/next-core/src/next_font/google/mod.rs +++ b/packages/next-swc/crates/next-core/src/next_font/google/mod.rs @@ -1,7 +1,7 @@ use anyhow::{bail, Context, Result}; use indexmap::IndexMap; use indoc::formatdoc; -use turbo_binding::{ +use turbopack_binding::{ turbo::{ tasks::{ primitives::{OptionStringVc, StringVc, U32Vc}, @@ -209,7 +209,9 @@ impl ImportMappingReplacement for NextFontGoogleCssModuleReplacer { #[cfg(not(feature = "__internal_nextjs_integration_test"))] let stylesheet_str = { - use turbo_binding::{turbo::tasks_fetch::fetch, turbopack::core::issue::IssueSeverity}; + use turbopack_binding::{ + turbo::tasks_fetch::fetch, turbopack::core::issue::IssueSeverity, + }; let stylesheet_res = fetch( stylesheet_url, @@ -304,7 +306,7 @@ async fn get_stylesheet_url_from_options( let mut css_url: Option = None; #[cfg(debug_assertions)] { - use turbo_binding::turbo::tasks_env::{CommandLineProcessEnvVc, ProcessEnv}; + use turbopack_binding::turbo::tasks_env::{CommandLineProcessEnvVc, ProcessEnv}; let env = CommandLineProcessEnvVc::new(); if let Some(url) = &*env.read("TURBOPACK_TEST_ONLY_MOCK_SERVER").await? { @@ -396,7 +398,7 @@ async fn get_mock_stylesheet( ) -> Result> { use std::{collections::HashMap, path::Path}; - use turbo_binding::{ + use turbopack_binding::{ turbo::{ tasks::CompletionVc, tasks_bytes::stream::SingleValue, diff --git a/packages/next-swc/crates/next-core/src/next_font/google/options.rs b/packages/next-swc/crates/next-core/src/next_font/google/options.rs index 911551097876a..8a325d5ffc9a3 100644 --- a/packages/next-swc/crates/next-core/src/next_font/google/options.rs +++ b/packages/next-swc/crates/next-core/src/next_font/google/options.rs @@ -1,7 +1,7 @@ use anyhow::{anyhow, Context, Result}; use indexmap::{indexset, IndexMap, IndexSet}; use serde::{Deserialize, Serialize}; -use turbo_binding::turbo::tasks::{primitives::StringVc, trace::TraceRawVcs, Value}; +use turbopack_binding::turbo::tasks::{primitives::StringVc, trace::TraceRawVcs, Value}; use super::request::{NextFontRequest, OneOrManyStrings}; @@ -198,7 +198,7 @@ pub(super) fn options_from_request( mod tests { use anyhow::Result; use indexmap::IndexMap; - use turbo_binding::turbo::tasks_fs::json::parse_json_with_source_context; + use turbopack_binding::turbo::tasks_fs::json::parse_json_with_source_context; use super::{options_from_request, FontDataEntry, NextFontGoogleOptions}; use crate::next_font::google::{options::FontWeights, request::NextFontRequest}; diff --git a/packages/next-swc/crates/next-core/src/next_font/google/stylesheet.rs b/packages/next-swc/crates/next-core/src/next_font/google/stylesheet.rs index 9d5444ce0099f..e90f788088b3d 100644 --- a/packages/next-swc/crates/next-core/src/next_font/google/stylesheet.rs +++ b/packages/next-swc/crates/next-core/src/next_font/google/stylesheet.rs @@ -1,5 +1,5 @@ use anyhow::Result; -use turbo_binding::turbo::tasks::primitives::{OptionStringVc, StringVc}; +use turbopack_binding::turbo::tasks::primitives::{OptionStringVc, StringVc}; use super::FontCssPropertiesVc; use crate::next_font::{ diff --git a/packages/next-swc/crates/next-core/src/next_font/google/util.rs b/packages/next-swc/crates/next-core/src/next_font/google/util.rs index 291b9d4c85cf0..067f0bedd4b85 100644 --- a/packages/next-swc/crates/next-core/src/next_font/google/util.rs +++ b/packages/next-swc/crates/next-core/src/next_font/google/util.rs @@ -231,7 +231,7 @@ pub(super) fn get_stylesheet_url( mod tests { use anyhow::Result; use indexmap::indexset; - use turbo_binding::turbo::tasks_fs::json::parse_json_with_source_context; + use turbopack_binding::turbo::tasks_fs::json::parse_json_with_source_context; use super::get_font_axes; use crate::next_font::google::{ diff --git a/packages/next-swc/crates/next-core/src/next_font/issue.rs b/packages/next-swc/crates/next-core/src/next_font/issue.rs index 7af685a196b36..dffd743e70288 100644 --- a/packages/next-swc/crates/next-core/src/next_font/issue.rs +++ b/packages/next-swc/crates/next-core/src/next_font/issue.rs @@ -1,8 +1,8 @@ -use turbo_binding::{ +use turbo_tasks::primitives::StringVc; +use turbopack_binding::{ turbo::tasks_fs::FileSystemPathVc, turbopack::core::issue::{Issue, IssueSeverityVc, IssueVc}, }; -use turbo_tasks::primitives::StringVc; #[turbo_tasks::value(shared)] pub(crate) struct NextFontIssue { diff --git a/packages/next-swc/crates/next-core/src/next_font/local/font_fallback.rs b/packages/next-swc/crates/next-core/src/next_font/local/font_fallback.rs index 4b35bb4f8f423..01ac89a573bed 100644 --- a/packages/next-swc/crates/next-core/src/next_font/local/font_fallback.rs +++ b/packages/next-swc/crates/next-core/src/next_font/local/font_fallback.rs @@ -3,7 +3,7 @@ use allsorts::{ Font, }; use anyhow::{bail, Context, Result}; -use turbo_binding::turbo::{ +use turbopack_binding::turbo::{ tasks::primitives::{StringVc, StringsVc, U32Vc}, tasks_fs::{FileContent, FileSystemPathVc}, }; diff --git a/packages/next-swc/crates/next-core/src/next_font/local/mod.rs b/packages/next-swc/crates/next-core/src/next_font/local/mod.rs index cd4f76a151e12..18a00b305d4fb 100644 --- a/packages/next-swc/crates/next-core/src/next_font/local/mod.rs +++ b/packages/next-swc/crates/next-core/src/next_font/local/mod.rs @@ -1,6 +1,6 @@ use anyhow::{bail, Context, Result}; use indoc::formatdoc; -use turbo_binding::{ +use turbopack_binding::{ turbo::{ tasks::{ primitives::{OptionStringVc, U32Vc}, diff --git a/packages/next-swc/crates/next-core/src/next_font/local/options.rs b/packages/next-swc/crates/next-core/src/next_font/local/options.rs index 037b0f17020ef..00d945762ef8c 100644 --- a/packages/next-swc/crates/next-core/src/next_font/local/options.rs +++ b/packages/next-swc/crates/next-core/src/next_font/local/options.rs @@ -2,7 +2,7 @@ use std::{fmt::Display, str::FromStr}; use anyhow::{Context, Result}; use serde::{Deserialize, Serialize}; -use turbo_binding::turbo::tasks::{primitives::StringVc, trace::TraceRawVcs, Value}; +use turbopack_binding::turbo::tasks::{primitives::StringVc, trace::TraceRawVcs, Value}; use super::request::{ AdjustFontFallback, NextFontLocalRequest, NextFontLocalRequestArguments, SrcDescriptor, @@ -173,7 +173,7 @@ pub(super) fn options_from_request(request: &NextFontLocalRequest) -> Result = ["@vercel/og"].into(); diff --git a/packages/next-swc/crates/next-core/src/next_shared/transforms/mod.rs b/packages/next-swc/crates/next-core/src/next_shared/transforms/mod.rs index 0f388c0ab19c6..c1d258e11e895 100644 --- a/packages/next-swc/crates/next-core/src/next_shared/transforms/mod.rs +++ b/packages/next-swc/crates/next-core/src/next_shared/transforms/mod.rs @@ -9,11 +9,11 @@ pub use next_dynamic::get_next_dynamic_transform_rule; pub use next_font::get_next_font_transform_rule; pub use next_strip_page_exports::get_next_pages_transforms_rule; pub use relay::get_relay_transform_plugin; -use turbo_binding::turbopack::{ +use turbo_tasks::Value; +use turbopack_binding::turbopack::{ core::reference_type::{ReferenceType, UrlReferenceSubType}, turbopack::module_options::{ModuleRule, ModuleRuleCondition, ModuleRuleEffect, ModuleType}, }; -use turbo_tasks::Value; use crate::next_image::{module::BlurPlaceholderMode, StructuredImageModuleTypeVc}; diff --git a/packages/next-swc/crates/next-core/src/next_shared/transforms/modularize_imports.rs b/packages/next-swc/crates/next-core/src/next_shared/transforms/modularize_imports.rs index 9be81b756d9b8..5f079c7edbc0b 100644 --- a/packages/next-swc/crates/next-core/src/next_shared/transforms/modularize_imports.rs +++ b/packages/next-swc/crates/next-core/src/next_shared/transforms/modularize_imports.rs @@ -11,7 +11,8 @@ use swc_core::{ visit::FoldWith, }, }; -use turbo_binding::{ +use turbo_tasks::trace::TraceRawVcs; +use turbopack_binding::{ swc::custom_transform::modularize_imports::{modularize_imports, PackageConfig}, turbopack::{ ecmascript::{ @@ -21,7 +22,6 @@ use turbo_binding::{ turbopack::module_options::{ModuleRule, ModuleRuleEffect}, }, }; -use turbo_tasks::trace::TraceRawVcs; use super::module_rule_match_js_no_url; @@ -80,7 +80,7 @@ impl CustomTransformer for ModularizeImportsTransformer { async fn transform(&self, program: &mut Program, _ctx: &TransformContext<'_>) -> Result<()> { let p = std::mem::replace(program, Program::Module(Module::dummy())); *program = p.fold_with(&mut modularize_imports( - turbo_binding::swc::custom_transform::modularize_imports::Config { + turbopack_binding::swc::custom_transform::modularize_imports::Config { packages: self.packages.clone(), }, )); diff --git a/packages/next-swc/crates/next-core/src/next_shared/transforms/next_dynamic.rs b/packages/next-swc/crates/next-core/src/next_shared/transforms/next_dynamic.rs index 469d75865fb36..21794f75c0ee4 100644 --- a/packages/next-swc/crates/next-core/src/next_shared/transforms/next_dynamic.rs +++ b/packages/next-swc/crates/next-core/src/next_shared/transforms/next_dynamic.rs @@ -10,7 +10,7 @@ use swc_core::{ visit::FoldWith, }, }; -use turbo_binding::{ +use turbopack_binding::{ turbo::tasks_fs::FileSystemPathVc, turbopack::{ ecmascript::{ diff --git a/packages/next-swc/crates/next-core/src/next_shared/transforms/next_font.rs b/packages/next-swc/crates/next-core/src/next_shared/transforms/next_font.rs index 1c2989525b32f..12fa0d2fb9409 100644 --- a/packages/next-swc/crates/next-core/src/next_shared/transforms/next_font.rs +++ b/packages/next-swc/crates/next-core/src/next_shared/transforms/next_font.rs @@ -1,7 +1,7 @@ use anyhow::Result; use async_trait::async_trait; use swc_core::ecma::{ast::Program, atoms::JsWord, visit::VisitMutWith}; -use turbo_binding::turbopack::{ +use turbopack_binding::turbopack::{ ecmascript::{ CustomTransformer, EcmascriptInputTransform, EcmascriptInputTransformsVc, TransformContext, TransformPluginVc, diff --git a/packages/next-swc/crates/next-core/src/next_shared/transforms/next_strip_page_exports.rs b/packages/next-swc/crates/next-core/src/next_shared/transforms/next_strip_page_exports.rs index 3bd5c86d71804..1b4f3353adfe0 100644 --- a/packages/next-swc/crates/next-core/src/next_shared/transforms/next_strip_page_exports.rs +++ b/packages/next-swc/crates/next-core/src/next_shared/transforms/next_strip_page_exports.rs @@ -8,7 +8,7 @@ use swc_core::{ visit::FoldWith, }, }; -use turbo_binding::{ +use turbopack_binding::{ turbo::tasks_fs::FileSystemPathVc, turbopack::{ ecmascript::{ 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 7b2b929e375fb..0670b845f991c 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,5 @@ use anyhow::Result; -use turbo_binding::turbopack::{ +use turbopack_binding::turbopack::{ ecmascript::{OptionTransformPluginVc, TransformPluginVc}, ecmascript_plugin::transform::relay::RelayTransformer, }; diff --git a/packages/next-swc/crates/next-core/src/page_loader.rs b/packages/next-swc/crates/next-core/src/page_loader.rs index b20cd1ea19600..a570fd48764bd 100644 --- a/packages/next-swc/crates/next-core/src/page_loader.rs +++ b/packages/next-swc/crates/next-core/src/page_loader.rs @@ -2,7 +2,8 @@ use std::io::Write; use anyhow::{bail, Result}; use indexmap::indexmap; -use turbo_binding::{ +use turbo_tasks::{primitives::StringVc, TryJoinIterExt, Value}; +use turbopack_binding::{ turbo::tasks_fs::{rope::RopeBuilder, File, FileContent, FileSystemPathVc}, turbopack::{ core::{ @@ -22,7 +23,6 @@ use turbo_binding::{ }, }, }; -use turbo_tasks::{primitives::StringVc, TryJoinIterExt, Value}; use crate::{embed_js::next_js_file_path, util::get_asset_path_from_pathname}; diff --git a/packages/next-swc/crates/next-core/src/page_source.rs b/packages/next-swc/crates/next-core/src/page_source.rs index fe484b9026be1..17bda0bc7e4e3 100644 --- a/packages/next-swc/crates/next-core/src/page_source.rs +++ b/packages/next-swc/crates/next-core/src/page_source.rs @@ -1,7 +1,12 @@ use anyhow::Result; use indexmap::indexmap; use serde::{Deserialize, Serialize}; -use turbo_binding::{ +use turbo_tasks::{ + primitives::{JsonValueVc, OptionStringVc, StringVc, StringsVc}, + trace::TraceRawVcs, + Value, +}; +use turbopack_binding::{ turbo::{ tasks_env::{CustomProcessEnvVc, EnvMapVc, ProcessEnvVc}, tasks_fs::{FileContent, FileSystemPathVc}, @@ -42,11 +47,6 @@ use turbo_binding::{ turbopack::{transition::TransitionsByNameVc, ModuleAssetContextVc}, }, }; -use turbo_tasks::{ - primitives::{JsonValueVc, OptionStringVc, StringVc, StringsVc}, - trace::TraceRawVcs, - Value, -}; use crate::{ embed_js::next_asset, diff --git a/packages/next-swc/crates/next-core/src/pages_structure.rs b/packages/next-swc/crates/next-core/src/pages_structure.rs index 32b37278f6bd5..678815e7dd7cb 100644 --- a/packages/next-swc/crates/next-core/src/pages_structure.rs +++ b/packages/next-swc/crates/next-core/src/pages_structure.rs @@ -1,12 +1,12 @@ use anyhow::Result; -use turbo_binding::{ - turbo::tasks_fs::{DirectoryContent, DirectoryEntry, FileSystemEntryType, FileSystemPathVc}, - turbopack::dev_server::source::specificity::SpecificityVc, -}; use turbo_tasks::{ primitives::{BoolVc, StringsVc}, CompletionVc, }; +use turbopack_binding::{ + turbo::tasks_fs::{DirectoryContent, DirectoryEntry, FileSystemEntryType, FileSystemPathVc}, + turbopack::dev_server::source::specificity::SpecificityVc, +}; use crate::next_config::NextConfigVc; diff --git a/packages/next-swc/crates/next-core/src/router.rs b/packages/next-swc/crates/next-core/src/router.rs index a3e980b4aa31a..5bd51f64902a5 100644 --- a/packages/next-swc/crates/next-core/src/router.rs +++ b/packages/next-swc/crates/next-core/src/router.rs @@ -3,7 +3,13 @@ use futures::StreamExt; use indexmap::indexmap; use serde::Deserialize; use serde_json::json; -use turbo_binding::{ +use turbo_tasks::{ + primitives::{JsonValueVc, StringsVc}, + util::SharedError, + CompletionVc, CompletionsVc, Value, +}; +use turbo_tasks_fs::json::parse_json_with_source_context; +use turbopack_binding::{ turbo::{ tasks_bytes::{Bytes, Stream}, tasks_fs::{to_sys_path, File, FileSystemPathVc}, @@ -37,12 +43,6 @@ use turbo_binding::{ }, }, }; -use turbo_tasks::{ - primitives::{JsonValueVc, StringsVc}, - util::SharedError, - CompletionVc, CompletionsVc, Value, -}; -use turbo_tasks_fs::json::parse_json_with_source_context; use crate::{ asset_helpers::as_es_module_asset, diff --git a/packages/next-swc/crates/next-core/src/router_source.rs b/packages/next-swc/crates/next-core/src/router_source.rs index a802cb8d4e088..076dc688b4f66 100644 --- a/packages/next-swc/crates/next-core/src/router_source.rs +++ b/packages/next-swc/crates/next-core/src/router_source.rs @@ -1,7 +1,8 @@ use anyhow::{anyhow, Context, Result}; use futures::{Stream, TryStreamExt}; use indexmap::IndexSet; -use turbo_binding::turbopack::{ +use turbo_tasks::{primitives::StringVc, CompletionVc, CompletionsVc, Value}; +use turbopack_binding::turbopack::{ core::{ environment::ServerAddrVc, introspect::{Introspectable, IntrospectableChildrenVc, IntrospectableVc}, @@ -13,7 +14,6 @@ use turbo_binding::turbopack::{ }, node::execution_context::ExecutionContextVc, }; -use turbo_tasks::{primitives::StringVc, CompletionVc, CompletionsVc, Value}; use crate::{ app_structure::OptionAppDirVc, diff --git a/packages/next-swc/crates/next-core/src/runtime.rs b/packages/next-swc/crates/next-core/src/runtime.rs index 562aadf86de0a..8f4cf75a1654b 100644 --- a/packages/next-swc/crates/next-core/src/runtime.rs +++ b/packages/next-swc/crates/next-core/src/runtime.rs @@ -1,5 +1,5 @@ use anyhow::{bail, Result}; -use turbo_binding::turbopack::{ +use turbopack_binding::turbopack::{ core::{ issue::{IssueSeverity, OptionIssueSourceVc}, resolve::{origin::ResolveOriginVc, parse::RequestVc}, diff --git a/packages/next-swc/crates/next-core/src/transform_options.rs b/packages/next-swc/crates/next-core/src/transform_options.rs index c112f0bbb1cd1..f671c9515b559 100644 --- a/packages/next-swc/crates/next-core/src/transform_options.rs +++ b/packages/next-swc/crates/next-core/src/transform_options.rs @@ -1,5 +1,5 @@ use anyhow::Result; -use turbo_binding::{ +use turbopack_binding::{ turbo::tasks_fs::{FileJsonContentVc, FileSystemPathVc}, turbopack::{ core::{ diff --git a/packages/next-swc/crates/next-core/src/util.rs b/packages/next-swc/crates/next-core/src/util.rs index 2ea1a15fc57be..5d2a3186a83b1 100644 --- a/packages/next-swc/crates/next-core/src/util.rs +++ b/packages/next-swc/crates/next-core/src/util.rs @@ -1,7 +1,12 @@ use anyhow::{anyhow, bail, Context, Result}; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use swc_core::ecma::ast::Program; -use turbo_binding::{ +use turbo_tasks::{ + primitives::{JsonValue, JsonValueVc, StringVc}, + trace::TraceRawVcs, + Value, ValueToString, +}; +use turbopack_binding::{ turbo::tasks_fs::{json::parse_json_rope_with_source_context, FileContent, FileSystemPathVc}, turbopack::{ core::{ @@ -22,11 +27,6 @@ use turbo_binding::{ turbopack::condition::ContextCondition, }, }; -use turbo_tasks::{ - primitives::{JsonValue, JsonValueVc, StringVc}, - trace::TraceRawVcs, - Value, ValueToString, -}; use crate::next_config::{NextConfigVc, OutputType}; diff --git a/packages/next-swc/crates/next-core/src/web_entry_source.rs b/packages/next-swc/crates/next-core/src/web_entry_source.rs index 5863b021d218d..3bf315e6f0cf4 100644 --- a/packages/next-swc/crates/next-core/src/web_entry_source.rs +++ b/packages/next-swc/crates/next-core/src/web_entry_source.rs @@ -1,5 +1,5 @@ use anyhow::{anyhow, Result}; -use turbo_binding::{ +use turbopack_binding::{ turbo::{ tasks::{TryJoinIterExt, Value}, tasks_fs::FileSystemPathVc, diff --git a/packages/next-swc/crates/next-dev-tests/Cargo.toml b/packages/next-swc/crates/next-dev-tests/Cargo.toml index 5f84882ab068b..a6afcd4a82698 100644 --- a/packages/next-swc/crates/next-dev-tests/Cargo.toml +++ b/packages/next-swc/crates/next-dev-tests/Cargo.toml @@ -13,7 +13,7 @@ publish = false tokio_console = [ "dep:console-subscriber", "tokio/tracing", - "turbo-binding/__turbo_tasks_tokio_tracing", + "turbopack-binding/__turbo_tasks_tokio_tracing", ] [dependencies] @@ -42,7 +42,7 @@ tokio = { workspace = true, features = ["full"] } # For matching on errors from chromiumoxide. Keep in # sync with chromiumoxide's tungstenite requirement. tungstenite = { workspace = true } -turbo-binding = { workspace = true, features = [ +turbopack-binding = { workspace = true, features = [ "__turbo_tasks_malloc", "__turbo_tasks_memory", "__turbo_tasks", @@ -61,6 +61,6 @@ url = { workspace = true } webbrowser = { workspace = true } [build-dependencies] -turbo-binding = { workspace = true, features = [ +turbopack-binding = { workspace = true, features = [ "__turbo_tasks_build" ]} diff --git a/packages/next-swc/crates/next-dev-tests/build.rs b/packages/next-swc/crates/next-dev-tests/build.rs index 3dc0548a15542..8ff772ae9eded 100644 --- a/packages/next-swc/crates/next-dev-tests/build.rs +++ b/packages/next-swc/crates/next-dev-tests/build.rs @@ -1,4 +1,4 @@ -use turbo_binding::turbo::tasks_build::{generate_register, rerun_if_glob}; +use turbopack_binding::turbo::tasks_build::{generate_register, rerun_if_glob}; fn main() { generate_register(); diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration.rs b/packages/next-swc/crates/next-dev-tests/tests/integration.rs index 4980338476b2f..40fe16f21056d 100644 --- a/packages/next-swc/crates/next-dev-tests/tests/integration.rs +++ b/packages/next-swc/crates/next-dev-tests/tests/integration.rs @@ -41,7 +41,7 @@ use tokio::{ task::JoinSet, }; use tungstenite::{error::ProtocolError::ResetWithoutClosingHandshake, Error::Protocol}; -use turbo_binding::{ +use turbopack_binding::{ turbo::{ tasks::{ debug::{ValueDebug, ValueDebugStringReadRef}, @@ -278,7 +278,7 @@ async fn run_test(resource: PathBuf) -> JsResult { .eager_compile(false) .hostname(requested_addr.ip()) .port(requested_addr.port()) - .log_level(turbo_binding::turbopack::core::issue::IssueSeverity::Warning) + .log_level(turbopack_binding::turbopack::core::issue::IssueSeverity::Warning) .log_detail(true) .issue_reporter(Box::new(move || { TestIssueReporterVc::new(issue_tx.clone()).into() diff --git a/packages/next-swc/crates/next-dev/Cargo.toml b/packages/next-swc/crates/next-dev/Cargo.toml index d5c214344ebad..2d7d32259d900 100644 --- a/packages/next-swc/crates/next-dev/Cargo.toml +++ b/packages/next-swc/crates/next-dev/Cargo.toml @@ -33,7 +33,7 @@ tokio_console = [ "turbo-tasks/tokio_tracing", ] profile = [] -custom_allocator = ["turbo-binding/__turbo_tasks_malloc", "turbo-binding/__turbo_tasks_malloc_custom_allocator"] +custom_allocator = ["turbopack-binding/__turbo_tasks_malloc", "turbopack-binding/__turbo_tasks_malloc_custom_allocator"] native-tls = ["next-core/native-tls"] rustls-tls = ["next-core/rustls-tls"] # Internal only. Enabled when building for the Next.js integration test suite. @@ -43,8 +43,8 @@ __internal_nextjs_integration_test = [ # enable "HMR" for embedded assets dynamic_embed_contents = [ "next-core/dynamic_embed_contents", - "turbo-binding/__turbopack_node_dynamic_embed_contents", - "turbo-binding/__turbopack_dev_dynamic_embed_contents", + "turbopack-binding/__turbopack_node_dynamic_embed_contents", + "turbopack-binding/__turbopack_dev_dynamic_embed_contents", ] [dependencies] @@ -59,7 +59,7 @@ next-core = { workspace = true } owo-colors = { workspace = true } serde = { workspace = true } tokio = { workspace = true, features = ["full"] } -turbo-binding = { workspace = true, features = [ +turbopack-binding = { workspace = true, features = [ "__turbo_tasks_memory", "__turbo_tasks_env", "__turbo_tasks_fs", @@ -87,7 +87,7 @@ regex = { workspace = true } serde_json = { workspace = true } tempfile = { workspace = true } tungstenite = { workspace = true } -turbo-binding = { workspace = true, features = [ +turbopack-binding = { workspace = true, features = [ "__turbopack_bench", ]} url = { workspace = true } @@ -96,7 +96,7 @@ url = { workspace = true } nix = "0.26.1" [build-dependencies] -turbo-binding = { workspace = true, features = [ +turbopack-binding = { workspace = true, features = [ "__turbo_tasks_build" ]} vergen = { version = "7.3.2", default-features = false, features = [ diff --git a/packages/next-swc/crates/next-dev/benches/bundler.rs b/packages/next-swc/crates/next-dev/benches/bundler.rs index a9c19271c8cc9..3619517ed093d 100644 --- a/packages/next-swc/crates/next-dev/benches/bundler.rs +++ b/packages/next-swc/crates/next-dev/benches/bundler.rs @@ -6,7 +6,7 @@ use std::{ use anyhow::{anyhow, Context, Result}; use regex::Regex; -use turbo_binding::turbopack::bench::{ +use turbopack_binding::turbopack::bench::{ bundlers::{Bundler, RenderType}, util::{ npm::{self, NpmPackage}, diff --git a/packages/next-swc/crates/next-dev/benches/mod.rs b/packages/next-swc/crates/next-dev/benches/mod.rs index fbc1375fb4974..bb04c66e10881 100644 --- a/packages/next-swc/crates/next-dev/benches/mod.rs +++ b/packages/next-swc/crates/next-dev/benches/mod.rs @@ -1,5 +1,5 @@ use criterion::{criterion_group, criterion_main, Criterion}; -use turbo_binding::turbopack::{ +use turbopack_binding::turbopack::{ bench as turbopack_bench, bench::bundlers::{Bundler, RenderType}, }; diff --git a/packages/next-swc/crates/next-dev/build.rs b/packages/next-swc/crates/next-dev/build.rs index fe7deb8608b61..5979850164cfd 100644 --- a/packages/next-swc/crates/next-dev/build.rs +++ b/packages/next-swc/crates/next-dev/build.rs @@ -1,4 +1,4 @@ -use turbo_binding::turbo::tasks_build::generate_register; +use turbopack_binding::turbo::tasks_build::generate_register; use vergen::{vergen, Config}; fn main() { diff --git a/packages/next-swc/crates/next-dev/src/devserver_options.rs b/packages/next-swc/crates/next-dev/src/devserver_options.rs index 9be88d161489f..5760030eba5df 100644 --- a/packages/next-swc/crates/next-dev/src/devserver_options.rs +++ b/packages/next-swc/crates/next-dev/src/devserver_options.rs @@ -2,7 +2,7 @@ use std::{net::IpAddr, path::PathBuf}; #[cfg(feature = "cli")] use clap::Parser; -use turbo_binding::turbopack::cli_utils::issue::IssueSeverityCliOption; +use turbopack_binding::turbopack::cli_utils::issue::IssueSeverityCliOption; #[derive(Debug)] #[cfg_attr(feature = "cli", derive(Parser))] diff --git a/packages/next-swc/crates/next-dev/src/lib.rs b/packages/next-swc/crates/next-dev/src/lib.rs index 5601c0f75b5d3..bb510501f5045 100644 --- a/packages/next-swc/crates/next-dev/src/lib.rs +++ b/packages/next-swc/crates/next-dev/src/lib.rs @@ -26,7 +26,11 @@ use next_core::{ router_source::NextRouterContentSourceVc, source_map::NextSourceMapTraceContentSourceVc, }; use owo_colors::OwoColorize; -use turbo_binding::{ +use turbo_tasks::{ + util::{FormatBytes, FormatDuration}, + StatsType, TransientInstance, TurboTasks, TurboTasksBackendApi, UpdateInfo, Value, +}; +use turbopack_binding::{ turbo::{ malloc::TurboMalloc, tasks_env::{CustomProcessEnvVc, EnvMapVc, ProcessEnvVc}, @@ -57,10 +61,6 @@ use turbo_binding::{ turbopack::evaluate_context::node_build_environment, }, }; -use turbo_tasks::{ - util::{FormatBytes, FormatDuration}, - StatsType, TransientInstance, TurboTasks, TurboTasksBackendApi, UpdateInfo, Value, -}; #[derive(Clone)] pub enum EntryRequest { diff --git a/packages/next-swc/crates/next-dev/src/main.rs b/packages/next-swc/crates/next-dev/src/main.rs index 942c08462e38a..dc0f9014f7a4a 100644 --- a/packages/next-swc/crates/next-dev/src/main.rs +++ b/packages/next-swc/crates/next-dev/src/main.rs @@ -6,7 +6,8 @@ use anyhow::Result; use clap::Parser; #[global_allocator] -static ALLOC: turbo_binding::turbo::malloc::TurboMalloc = turbo_binding::turbo::malloc::TurboMalloc; +static ALLOC: turbopack_binding::turbo::malloc::TurboMalloc = + turbopack_binding::turbo::malloc::TurboMalloc; #[cfg(not(feature = "cli"))] fn main() -> Result<()> { @@ -15,7 +16,7 @@ fn main() -> Result<()> { #[cfg(feature = "cli")] fn main() { - use turbo_binding::turbo::malloc::TurboMalloc; + use turbopack_binding::turbo::malloc::TurboMalloc; tokio::runtime::Builder::new_multi_thread() .enable_all() diff --git a/packages/next-swc/crates/next-dev/src/turbo_tasks_viz.rs b/packages/next-swc/crates/next-dev/src/turbo_tasks_viz.rs index be224ecdf0535..897598e86079a 100644 --- a/packages/next-swc/crates/next-dev/src/turbo_tasks_viz.rs +++ b/packages/next-swc/crates/next-dev/src/turbo_tasks_viz.rs @@ -2,7 +2,8 @@ use std::{sync::Arc, time::Duration}; use anyhow::Result; use mime::TEXT_HTML_UTF_8; -use turbo_binding::{ +use turbo_tasks::{get_invalidator, TurboTasks, TurboTasksBackendApi, Value}; +use turbopack_binding::{ turbo::{ tasks_fs::File, tasks_memory::{ @@ -18,7 +19,6 @@ use turbo_binding::{ }, }, }; -use turbo_tasks::{get_invalidator, TurboTasks, TurboTasksBackendApi, Value}; #[turbo_tasks::value(serialization = "none", eq = "manual", cell = "new", into = "new")] pub struct TurboTasksSource { diff --git a/packages/next-swc/crates/wasm/Cargo.toml b/packages/next-swc/crates/wasm/Cargo.toml index f925f1ca60b15..d224cb39b2fa3 100644 --- a/packages/next-swc/crates/wasm/Cargo.toml +++ b/packages/next-swc/crates/wasm/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib"] default = ["swc_v1"] swc_v1 = [] -plugin = ["getrandom/js", "turbo-binding/__swc_core_binding_wasm_plugin"] +plugin = ["getrandom/js", "turbopack-binding/__swc_core_binding_wasm_plugin"] [dependencies] anyhow = "1.0.66" @@ -28,7 +28,7 @@ wasm-bindgen-futures = "0.4.8" getrandom = { version = "0.2.5", optional = true, default-features = false } js-sys = "0.3.59" serde-wasm-bindgen = "0.4.3" -turbo-binding = { workspace = true, features = [ +turbopack-binding = { workspace = true, features = [ "__swc_core_binding_wasm", "__feature_mdx_rs", ] } diff --git a/packages/next-swc/crates/wasm/src/lib.rs b/packages/next-swc/crates/wasm/src/lib.rs index c4db38879edef..32b9d35118f2e 100644 --- a/packages/next-swc/crates/wasm/src/lib.rs +++ b/packages/next-swc/crates/wasm/src/lib.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use anyhow::{Context, Error}; use js_sys::JsString; use next_swc::{custom_before_pass, TransformOptions}; -use turbo_binding::swc::core::{ +use turbopack_binding::swc::core::{ base::{ config::{JsMinifyOptions, ParseOptions}, try_with_handler, Compiler, @@ -34,7 +34,7 @@ pub fn minify_sync(s: JsString, opts: JsValue) -> Result { let value = try_with_handler( c.cm.clone(), - turbo_binding::swc::core::base::HandlerOpts { + turbopack_binding::swc::core::base::HandlerOpts { color: ColorConfig::Never, skip_filename: false, }, @@ -71,7 +71,7 @@ pub fn transform_sync(s: JsValue, opts: JsValue) -> Result { let s = s.dyn_into::(); let out = try_with_handler( c.cm.clone(), - turbo_binding::swc::core::base::HandlerOpts { + turbopack_binding::swc::core::base::HandlerOpts { color: ColorConfig::Never, skip_filename: false, }, @@ -136,14 +136,14 @@ pub fn transform(s: JsValue, opts: JsValue) -> js_sys::Promise { pub fn parse_sync(s: JsString, opts: JsValue) -> Result { console_error_panic_hook::set_once(); - let c = turbo_binding::swc::core::base::Compiler::new(Arc::new(SourceMap::new( + let c = turbopack_binding::swc::core::base::Compiler::new(Arc::new(SourceMap::new( FilePathMapping::empty(), ))); let opts: ParseOptions = serde_wasm_bindgen::from_value(opts)?; try_with_handler( c.cm.clone(), - turbo_binding::swc::core::base::HandlerOpts { + turbopack_binding::swc::core::base::HandlerOpts { ..Default::default() }, |handler| { diff --git a/packages/next-swc/crates/wasm/src/mdx.rs b/packages/next-swc/crates/wasm/src/mdx.rs index 6fd2cb0d4ab2f..89a44c45f92f3 100644 --- a/packages/next-swc/crates/wasm/src/mdx.rs +++ b/packages/next-swc/crates/wasm/src/mdx.rs @@ -1,5 +1,5 @@ use js_sys::JsString; -use turbo_binding::features::mdxjs::{compile, Options}; +use turbopack_binding::features::mdxjs::{compile, Options}; use wasm_bindgen::prelude::*; use wasm_bindgen_futures::future_to_promise;