From a2645e2fa0a55c4dbe519b6f8baa9e83a69bb2f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Fri, 21 Jun 2024 22:25:16 +0900 Subject: [PATCH] feat(swc_core): Reexport `swc_typescript` (#9092) --- Cargo.lock | 1 + crates/swc_core/Cargo.toml | 4 ++++ crates/swc_core/src/lib.rs | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 9b114803548d..e420e82b9b63 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3975,6 +3975,7 @@ dependencies = [ "swc_plugin_runner", "swc_trace_macro", "swc_transform_common", + "swc_typescript", "testing", "vergen", ] diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index 203b22317e69..02c761fe9eea 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -192,6 +192,9 @@ ecma_plugin_transform = ["common_plugin_transform", "__ecma_plugin_transform"] # Use `stacker` to avoid stack overflow. stacker = ["swc_ecma_parser/stacker", "swc_ecma_utils/stacker"] + +typescript = ["swc_typescript"] + # Host features to enable plugin `runner` runtime. # native feature is for the host environment does not have, or cannot access # to the wasm runtime (i.e cli, or @swc/core node bindings). @@ -375,6 +378,7 @@ swc_plugin_macro = { optional = true, version = "0.9.16", path = swc_plugin_proxy = { optional = true, version = "0.44.0", path = "../swc_plugin_proxy" } swc_trace_macro = { optional = true, version = "0.1.3", path = "../swc_trace_macro" } swc_transform_common = { optional = true, version = "0.1.0", path = "../swc_transform_common" } +swc_typescript = { optional = true, version = "0.1.1", path = "../swc_typescript" } testing = { optional = true, version = "0.36.0", path = "../testing" } # TODO: eventually swc_plugin_runner needs to remove default features swc_plugin_runner = { optional = true, version = "0.109.0", path = "../swc_plugin_runner", default-features = false } diff --git a/crates/swc_core/src/lib.rs b/crates/swc_core/src/lib.rs index 94e8bf7b9871..41b281198345 100644 --- a/crates/swc_core/src/lib.rs +++ b/crates/swc_core/src/lib.rs @@ -190,6 +190,12 @@ pub mod transform_common { pub use swc_transform_common::*; } +#[cfg(feature = "typescript")] +#[cfg_attr(docsrs, doc(cfg(feature = "typescript")))] +pub mod typescript { + pub use swc_typescript::*; +} + // swc_bundler #[cfg(feature = "__bundler")] #[cfg_attr(docsrs, doc(cfg(feature = "__bundler")))]