From 3d4a64c811bafc36c3366b41758310c4e578f8e0 Mon Sep 17 00:00:00 2001 From: Dunqing <29533304+Dunqing@users.noreply.github.com> Date: Fri, 30 Aug 2024 09:30:15 +0000 Subject: [PATCH] feat(transformer): make `Targets` public (#5335) --- crates/oxc_transformer/src/env/mod.rs | 6 +++++- crates/oxc_transformer/src/env/options.rs | 2 +- crates/oxc_transformer/src/env/targets/mod.rs | 1 + crates/oxc_transformer/src/lib.rs | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/oxc_transformer/src/env/mod.rs b/crates/oxc_transformer/src/env/mod.rs index 7c7176e3426a8..73f79ff274656 100644 --- a/crates/oxc_transformer/src/env/mod.rs +++ b/crates/oxc_transformer/src/env/mod.rs @@ -2,4 +2,8 @@ mod data; mod options; mod targets; -pub use self::{data::can_enable_plugin, options::EnvOptions, targets::Versions}; +pub use self::{ + data::can_enable_plugin, + options::EnvOptions, + targets::{Targets, Versions}, +}; diff --git a/crates/oxc_transformer/src/env/options.rs b/crates/oxc_transformer/src/env/options.rs index dfb97e9ee0d77..b2d77355ec3bf 100644 --- a/crates/oxc_transformer/src/env/options.rs +++ b/crates/oxc_transformer/src/env/options.rs @@ -12,7 +12,7 @@ fn default_as_true() -> bool { #[serde(default, rename_all = "camelCase", deny_unknown_fields)] pub struct EnvOptions { #[serde(default)] - targets: Targets, + pub targets: Targets, #[serde(default = "default_as_true")] pub bugfixes: bool, diff --git a/crates/oxc_transformer/src/env/targets/mod.rs b/crates/oxc_transformer/src/env/targets/mod.rs index 8a2eca93ebaab..5f469a8fe9a46 100644 --- a/crates/oxc_transformer/src/env/targets/mod.rs +++ b/crates/oxc_transformer/src/env/targets/mod.rs @@ -12,6 +12,7 @@ use serde::Deserialize; use self::version::Version; +pub use self::query::Targets; pub mod query; pub mod version; diff --git a/crates/oxc_transformer/src/lib.rs b/crates/oxc_transformer/src/lib.rs index cbde6cfa7a6f6..e2c7fc5e3554d 100644 --- a/crates/oxc_transformer/src/lib.rs +++ b/crates/oxc_transformer/src/lib.rs @@ -44,7 +44,7 @@ use oxc_traverse::{traverse_mut, Traverse, TraverseCtx}; pub use crate::{ compiler_assumptions::CompilerAssumptions, - env::EnvOptions, + env::{EnvOptions, Targets}, es2015::{ArrowFunctionsOptions, ES2015Options}, options::{BabelOptions, TransformOptions}, react::{ReactJsxRuntime, ReactOptions, ReactRefreshOptions},