feat(es/ast): Add utils (#2657)

swc_ecma_ast:
 - Add `as_ident` to `PatOrExpr`.
 - Add `as_ident_mut` to `PatOrExpr`.
 - Replace `Is` macro for `ParOrExpr` with custom impl.
This commit is contained in:
Donny/강동윤 2021-11-05 16:09:08 +09:00 committed by GitHub
parent 224972f487
commit 994c9655c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
39 changed files with 357 additions and 280 deletions

56
Cargo.lock generated
View File

@ -950,7 +950,7 @@ dependencies = [
[[package]]
name = "jsdoc"
version = "0.45.1"
version = "0.46.0"
dependencies = [
"anyhow",
"dashmap",
@ -2350,7 +2350,7 @@ checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c"
[[package]]
name = "swc"
version = "0.81.1"
version = "0.82.0"
dependencies = [
"ahash",
"anyhow",
@ -2456,7 +2456,7 @@ dependencies = [
[[package]]
name = "swc_bundler"
version = "0.78.1"
version = "0.80.0"
dependencies = [
"ahash",
"anyhow",
@ -2616,7 +2616,7 @@ dependencies = [
[[package]]
name = "swc_ecma_ast"
version = "0.56.1"
version = "0.57.0"
dependencies = [
"arbitrary",
"is-macro",
@ -2630,7 +2630,7 @@ dependencies = [
[[package]]
name = "swc_ecma_codegen"
version = "0.78.1"
version = "0.79.0"
dependencies = [
"bitflags",
"memchr",
@ -2660,7 +2660,7 @@ dependencies = [
[[package]]
name = "swc_ecma_dep_graph"
version = "0.45.1"
version = "0.46.0"
dependencies = [
"swc_atoms 0.2.9",
"swc_common",
@ -2672,7 +2672,7 @@ dependencies = [
[[package]]
name = "swc_ecma_ext_transforms"
version = "0.36.1"
version = "0.37.0"
dependencies = [
"phf",
"swc_atoms 0.2.9",
@ -2685,7 +2685,7 @@ dependencies = [
[[package]]
name = "swc_ecma_loader"
version = "0.23.0"
version = "0.24.0"
dependencies = [
"ahash",
"anyhow",
@ -2707,7 +2707,7 @@ dependencies = [
[[package]]
name = "swc_ecma_minifier"
version = "0.48.4"
version = "0.49.0"
dependencies = [
"ahash",
"ansi_term 0.12.1",
@ -2740,7 +2740,7 @@ dependencies = [
[[package]]
name = "swc_ecma_parser"
version = "0.76.3"
version = "0.77.0"
dependencies = [
"either",
"enum_kind",
@ -2765,7 +2765,7 @@ dependencies = [
[[package]]
name = "swc_ecma_preset_env"
version = "0.63.1"
version = "0.64.0"
dependencies = [
"ahash",
"dashmap",
@ -2791,7 +2791,7 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms"
version = "0.92.1"
version = "0.93.0"
dependencies = [
"pretty_assertions 0.6.1",
"sourcemap",
@ -2818,7 +2818,7 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_base"
version = "0.42.1"
version = "0.43.0"
dependencies = [
"once_cell",
"phf",
@ -2839,7 +2839,7 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_classes"
version = "0.28.1"
version = "0.29.0"
dependencies = [
"swc_atoms 0.2.9",
"swc_common",
@ -2851,7 +2851,7 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_compat"
version = "0.49.4"
version = "0.50.0"
dependencies = [
"ahash",
"arrayvec",
@ -2889,7 +2889,7 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_module"
version = "0.55.2"
version = "0.56.0"
dependencies = [
"Inflector",
"ahash",
@ -2912,7 +2912,7 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_optimization"
version = "0.62.1"
version = "0.63.0"
dependencies = [
"ahash",
"dashmap",
@ -2941,7 +2941,7 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_proposal"
version = "0.55.1"
version = "0.56.0"
dependencies = [
"either",
"serde",
@ -2965,7 +2965,7 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_react"
version = "0.57.1"
version = "0.58.0"
dependencies = [
"ahash",
"base64 0.13.0",
@ -2993,7 +2993,7 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_testing"
version = "0.43.1"
version = "0.44.0"
dependencies = [
"ansi_term 0.12.1",
"anyhow",
@ -3014,7 +3014,7 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_typescript"
version = "0.58.3"
version = "0.59.0"
dependencies = [
"serde",
"swc_atoms 0.2.9",
@ -3036,7 +3036,7 @@ dependencies = [
[[package]]
name = "swc_ecma_utils"
version = "0.50.1"
version = "0.51.0"
dependencies = [
"once_cell",
"rayon",
@ -3050,7 +3050,7 @@ dependencies = [
[[package]]
name = "swc_ecma_visit"
version = "0.42.0"
version = "0.43.0"
dependencies = [
"num-bigint",
"swc_atoms 0.2.9",
@ -3061,7 +3061,7 @@ dependencies = [
[[package]]
name = "swc_ecmascript"
version = "0.84.1"
version = "0.85.0"
dependencies = [
"swc_ecma_ast",
"swc_ecma_codegen",
@ -3135,7 +3135,7 @@ dependencies = [
[[package]]
name = "swc_plugin"
version = "0.11.0"
version = "0.12.0"
dependencies = [
"abi_stable",
"anyhow",
@ -3150,7 +3150,7 @@ dependencies = [
[[package]]
name = "swc_plugin_api"
version = "0.2.0"
version = "0.3.0"
dependencies = [
"abi_stable",
"anyhow",
@ -3164,7 +3164,7 @@ dependencies = [
[[package]]
name = "swc_plugin_runner"
version = "0.15.0"
version = "0.16.0"
dependencies = [
"abi_stable",
"anyhow",
@ -3182,7 +3182,7 @@ dependencies = [
[[package]]
name = "swc_plugin_testing"
version = "0.17.0"
version = "0.18.0"
dependencies = [
"anyhow",
"swc_atoms 0.2.9",

View File

@ -21,7 +21,7 @@ include = ["Cargo.toml", "src/**/*.rs"]
license = "Apache-2.0/MIT"
name = "swc"
repository = "https://github.com/swc-project/swc.git"
version = "0.81.1"
version = "0.82.0"
[lib]
name = "swc"
@ -61,14 +61,14 @@ serde_json = "1"
sourcemap = "6"
swc_atoms = {version = "0.2", path = "./atoms"}
swc_common = {version = "0.14.0", path = "./common", features = ["sourcemap", "concurrent"]}
swc_ecma_ast = {version = "0.56.0", path = "./ecmascript/ast"}
swc_ecma_codegen = {version = "0.78.1", path = "./ecmascript/codegen"}
swc_ecma_ext_transforms = {version = "0.36.1", path = "./ecmascript/ext-transforms"}
swc_ecma_loader = {version = "0.23.0", path = "./ecmascript/loader", features = ["lru", "node", "tsc"]}
swc_ecma_minifier = {version = "0.48.1", path = "./ecmascript/minifier"}
swc_ecma_parser = {version = "0.76.3", path = "./ecmascript/parser"}
swc_ecma_preset_env = {version = "0.63.1", path = "./ecmascript/preset-env"}
swc_ecma_transforms = {version = "0.92.1", path = "./ecmascript/transforms", features = [
swc_ecma_ast = {version = "0.57.0", path = "./ecmascript/ast"}
swc_ecma_codegen = {version = "0.79.0", path = "./ecmascript/codegen"}
swc_ecma_ext_transforms = {version = "0.37.0", path = "./ecmascript/ext-transforms"}
swc_ecma_loader = {version = "0.24.0", path = "./ecmascript/loader", features = ["lru", "node", "tsc"]}
swc_ecma_minifier = {version = "0.49.0", path = "./ecmascript/minifier"}
swc_ecma_parser = {version = "0.77.0", path = "./ecmascript/parser"}
swc_ecma_preset_env = {version = "0.64.0", path = "./ecmascript/preset-env"}
swc_ecma_transforms = {version = "0.93.0", path = "./ecmascript/transforms", features = [
"compat",
"module",
"optimization",
@ -76,12 +76,12 @@ swc_ecma_transforms = {version = "0.92.1", path = "./ecmascript/transforms", fea
"react",
"typescript",
]}
swc_ecma_transforms_base = {version = "0.42.1", path = "./ecmascript/transforms/base"}
swc_ecma_transforms_compat = {version = "0.49.1", path = "./ecmascript/transforms/compat"}
swc_ecma_transforms_optimization = {version = "0.62.1", path = "./ecmascript/transforms/optimization"}
swc_ecma_utils = {version = "0.50.0", path = "./ecmascript/utils"}
swc_ecma_visit = {version = "0.42.0", path = "./ecmascript/visit"}
swc_ecmascript = {version = "0.84.1", path = "./ecmascript"}
swc_ecma_transforms_base = {version = "0.43.0", path = "./ecmascript/transforms/base"}
swc_ecma_transforms_compat = {version = "0.50.0", path = "./ecmascript/transforms/compat"}
swc_ecma_transforms_optimization = {version = "0.63.0", path = "./ecmascript/transforms/optimization"}
swc_ecma_utils = {version = "0.51.0", path = "./ecmascript/utils"}
swc_ecma_visit = {version = "0.43.0", path = "./ecmascript/visit"}
swc_ecmascript = {version = "0.85.0", path = "./ecmascript"}
swc_visit = {version = "0.2.3", path = "./visit"}
tracing = "0.1.28"

View File

@ -9,7 +9,7 @@ include = ["Cargo.toml", "build.rs", "src/**/*.rs", "src/**/*.js"]
license = "Apache-2.0/MIT"
name = "swc_bundler"
repository = "https://github.com/swc-project/swc.git"
version = "0.78.1"
version = "0.80.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
@ -38,14 +38,14 @@ relative-path = "1.2"
retain_mut = "0.1.2"
swc_atoms = {version = "0.2.4", path = "../atoms"}
swc_common = {version = "0.14.0", path = "../common"}
swc_ecma_ast = {version = "0.56.0", path = "../ecmascript/ast"}
swc_ecma_codegen = {version = "0.78.1", path = "../ecmascript/codegen"}
swc_ecma_loader = {version = "0.23.0", path = "../ecmascript/loader"}
swc_ecma_parser = {version = "0.76.3", path = "../ecmascript/parser"}
swc_ecma_transforms_base = {version = "0.42.1", path = "../ecmascript/transforms/base"}
swc_ecma_transforms_optimization = {version = "0.62.1", path = "../ecmascript/transforms/optimization"}
swc_ecma_utils = {version = "0.50.0", path = "../ecmascript/utils"}
swc_ecma_visit = {version = "0.42.0", path = "../ecmascript/visit"}
swc_ecma_ast = {version = "0.57.0", path = "../ecmascript/ast"}
swc_ecma_codegen = {version = "0.79.0", path = "../ecmascript/codegen"}
swc_ecma_loader = {version = "0.24.0", path = "../ecmascript/loader"}
swc_ecma_parser = {version = "0.77.0", path = "../ecmascript/parser"}
swc_ecma_transforms_base = {version = "0.43.0", path = "../ecmascript/transforms/base"}
swc_ecma_transforms_optimization = {version = "0.63.0", path = "../ecmascript/transforms/optimization"}
swc_ecma_utils = {version = "0.51.0", path = "../ecmascript/utils"}
swc_ecma_visit = {version = "0.43.0", path = "../ecmascript/visit"}
tracing = "0.1.28"
[dev-dependencies]
@ -54,10 +54,10 @@ ntest = "0.7.2"
path-clean = "=0.1.0"
reqwest = {version = "0.11.4", features = ["blocking"]}
sha-1 = "0.9"
swc_ecma_loader = {version = "0.23.0", path = "../ecmascript/loader", features = ["node", "lru"]}
swc_ecma_minifier = {version = "0.48.1", path = "../ecmascript/minifier"}
swc_ecma_transforms_react = {version = "0.57.1", path = "../ecmascript/transforms/react"}
swc_ecma_transforms_typescript = {version = "0.58.1", path = "../ecmascript/transforms/typescript"}
swc_ecma_loader = {version = "0.24.0", path = "../ecmascript/loader", features = ["node", "lru"]}
swc_ecma_minifier = {version = "0.49.0", path = "../ecmascript/minifier"}
swc_ecma_transforms_react = {version = "0.58.0", path = "../ecmascript/transforms/react"}
swc_ecma_transforms_typescript = {version = "0.59.0", path = "../ecmascript/transforms/typescript"}
swc_node_base = {version = "0.5.0", path = "../node/base"}
tempfile = "3.1.0"
testing = {version = "0.15.0", path = "../testing"}

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecmascript"
repository = "https://github.com/swc-project/swc.git"
version = "0.84.1"
version = "0.85.0"
[package.metadata.docs.rs]
all-features = true
@ -32,14 +32,14 @@ react = ["swc_ecma_transforms/react"]
typescript = ["typescript-parser", "swc_ecma_transforms/typescript"]
[dependencies]
swc_ecma_ast = {version = "0.56.0", path = "./ast"}
swc_ecma_codegen = {version = "0.78.1", path = "./codegen", optional = true}
swc_ecma_dep_graph = {version = "0.45.1", path = "./dep-graph", optional = true}
swc_ecma_minifier = {version = "0.48.1", path = "./minifier", optional = true}
swc_ecma_parser = {version = "0.76.3", path = "./parser", optional = true, default-features = false}
swc_ecma_preset_env = {version = "0.63.1", path = "./preset-env", optional = true}
swc_ecma_transforms = {version = "0.92.1", path = "./transforms", optional = true}
swc_ecma_utils = {version = "0.50.0", path = "./utils", optional = true}
swc_ecma_visit = {version = "0.42.0", path = "./visit", optional = true}
swc_ecma_ast = {version = "0.57.0", path = "./ast"}
swc_ecma_codegen = {version = "0.79.0", path = "./codegen", optional = true}
swc_ecma_dep_graph = {version = "0.46.0", path = "./dep-graph", optional = true}
swc_ecma_minifier = {version = "0.49.0", path = "./minifier", optional = true}
swc_ecma_parser = {version = "0.77.0", path = "./parser", optional = true, default-features = false}
swc_ecma_preset_env = {version = "0.64.0", path = "./preset-env", optional = true}
swc_ecma_transforms = {version = "0.93.0", path = "./transforms", optional = true}
swc_ecma_utils = {version = "0.51.0", path = "./utils", optional = true}
swc_ecma_visit = {version = "0.43.0", path = "./visit", optional = true}
[dev-dependencies]

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_ast"
repository = "https://github.com/swc-project/swc.git"
version = "0.56.1"
version = "0.57.0"
[features]
default = []

View File

@ -745,7 +745,7 @@ impl Take for BlockStmtOrExpr {
}
#[ast_node]
#[derive(Eq, Hash, Is, EqIgnoreSpan)]
#[derive(Eq, Hash, EqIgnoreSpan)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
pub enum PatOrExpr {
#[tag("ThisExpression")]
@ -790,6 +790,125 @@ pub enum PatOrExpr {
Pat(Box<Pat>),
}
impl PatOrExpr {
/// Returns the [Pat] if this is a pattern, otherwise returns [None].
pub fn pat(self) -> Option<Box<Pat>> {
match self {
PatOrExpr::Expr(_) => None,
PatOrExpr::Pat(p) => Some(p),
}
}
/// Returns the [Expr] if this is an expression, otherwise returns
/// `None`.
pub fn expr(self) -> Option<Box<Expr>> {
match self {
PatOrExpr::Expr(e) => Some(e),
PatOrExpr::Pat(p) => match *p {
Pat::Expr(e) => Some(e),
_ => None,
},
}
}
#[track_caller]
pub fn expect_pat(self) -> Box<Pat> {
self.pat()
.expect("expect_pat is called but it was not a pattern")
}
#[track_caller]
pub fn expect_expr(self) -> Box<Expr> {
self.expr()
.expect("expect_expr is called but it was not a pattern")
}
pub fn as_pat(&self) -> Option<&Pat> {
match self {
PatOrExpr::Expr(_) => None,
PatOrExpr::Pat(p) => Some(p),
}
}
pub fn as_expr(&self) -> Option<&Expr> {
match self {
PatOrExpr::Expr(e) => Some(e),
PatOrExpr::Pat(p) => match &**p {
Pat::Expr(e) => Some(e),
_ => None,
},
}
}
pub fn is_pat(&self) -> bool {
self.as_pat().is_some()
}
pub fn is_expr(&self) -> bool {
self.as_expr().is_some()
}
pub fn as_ident(&self) -> Option<&Ident> {
match self {
PatOrExpr::Expr(v) => match &**v {
Expr::Ident(i) => Some(i),
_ => None,
},
PatOrExpr::Pat(v) => match &**v {
Pat::Ident(i) => Some(&i.id),
Pat::Expr(v) => match &**v {
Expr::Ident(i) => Some(i),
_ => None,
},
_ => None,
},
}
}
pub fn as_ident_mut(&mut self) -> Option<&mut Ident> {
match self {
PatOrExpr::Expr(v) => match &mut **v {
Expr::Ident(i) => Some(i),
_ => None,
},
PatOrExpr::Pat(v) => match &mut **v {
Pat::Ident(i) => Some(&mut i.id),
Pat::Expr(v) => match &mut **v {
Expr::Ident(i) => Some(i),
_ => None,
},
_ => None,
},
}
}
pub fn normalize_expr(self) -> Self {
match self {
PatOrExpr::Pat(pat) => match *pat {
Pat::Expr(expr) => PatOrExpr::Expr(expr),
_ => return PatOrExpr::Pat(pat),
},
_ => self,
}
}
pub fn normalize_ident(self) -> Self {
match self {
PatOrExpr::Expr(expr) => match *expr {
Expr::Ident(i) => PatOrExpr::Pat(Box::new(Pat::Ident(i.into()))),
_ => PatOrExpr::Expr(expr),
},
PatOrExpr::Pat(pat) => match *pat {
Pat::Expr(expr) => match *expr {
Expr::Ident(i) => PatOrExpr::Pat(Box::new(Pat::Ident(i.into()))),
_ => PatOrExpr::Expr(expr),
},
_ => PatOrExpr::Pat(pat),
},
}
}
}
impl Take for PatOrExpr {
fn dummy() -> Self {
PatOrExpr::Pat(Take::dummy())

View File

@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"]
license = "Apache-2.0/MIT"
name = "swc_ecma_codegen"
repository = "https://github.com/swc-project/swc.git"
version = "0.78.1"
version = "0.79.0"
[dependencies]
bitflags = "1"
@ -17,9 +17,9 @@ once_cell = "1.8.0"
sourcemap = "6"
swc_atoms = {version = "0.2", path = "../../atoms"}
swc_common = {version = "0.14.0", path = "../../common"}
swc_ecma_ast = {version = "0.56.0", path = "../ast"}
swc_ecma_ast = {version = "0.57.0", path = "../ast"}
swc_ecma_codegen_macros = {version = "0.6.0", path = "./macros"}
swc_ecma_parser = {version = "0.76.3", path = "../parser"}
swc_ecma_parser = {version = "0.77.0", path = "../parser"}
tracing = "0.1"
[dev-dependencies]

View File

@ -6,14 +6,14 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_dep_graph"
repository = "https://github.com/swc-project/swc.git"
version = "0.45.1"
version = "0.46.0"
[dependencies]
swc_atoms = {version = "0.2", path = "../../atoms"}
swc_common = {version = "0.14.0", path = "../../common"}
swc_ecma_ast = {version = "0.56.0", path = "../ast"}
swc_ecma_visit = {version = "0.42.0", path = "../visit"}
swc_ecma_ast = {version = "0.57.0", path = "../ast"}
swc_ecma_visit = {version = "0.43.0", path = "../visit"}
[dev-dependencies]
swc_ecma_parser = {version = "0.76.3", path = "../parser"}
swc_ecma_parser = {version = "0.77.0", path = "../parser"}
testing = {version = "0.15.0", path = "../../testing"}

View File

@ -5,7 +5,7 @@ documentation = "https://rustdoc.swc.rs/swc_ecma_ext_transforms/"
edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_ext_transforms"
version = "0.36.1"
version = "0.37.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -13,7 +13,7 @@ version = "0.36.1"
phf = {version = "0.8.0", features = ["macros"]}
swc_atoms = {version = "0.2", path = "../../atoms"}
swc_common = {version = "0.14.0", path = "../../common"}
swc_ecma_ast = {version = "0.56.0", path = "../ast"}
swc_ecma_parser = {version = "0.76.3", path = "../parser"}
swc_ecma_utils = {version = "0.50.0", path = "../utils"}
swc_ecma_visit = {version = "0.42.0", path = "../visit"}
swc_ecma_ast = {version = "0.57.0", path = "../ast"}
swc_ecma_parser = {version = "0.77.0", path = "../parser"}
swc_ecma_utils = {version = "0.51.0", path = "../utils"}
swc_ecma_visit = {version = "0.43.0", path = "../visit"}

View File

@ -5,7 +5,7 @@ documentation = "https://rustdoc.swc.rs/jsdoc/"
edition = "2018"
license = "Apache-2.0/MIT"
name = "jsdoc"
version = "0.45.1"
version = "0.46.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -18,7 +18,7 @@ swc_common = {version = "0.14.0", path = "../../common"}
[dev-dependencies]
anyhow = "1"
dashmap = "4.0.2"
swc_ecma_ast = {version = "0.56.0", path = "../ast"}
swc_ecma_parser = {version = "0.76.3", path = "../parser"}
swc_ecma_ast = {version = "0.57.0", path = "../ast"}
swc_ecma_parser = {version = "0.77.0", path = "../parser"}
testing = {version = "0.15.0", path = "../../testing"}
walkdir = "2"

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_loader"
repository = "https://github.com/swc-project/swc.git"
version = "0.23.0"
version = "0.24.0"
[package.metadata.docs.rs]
all-features = true
@ -31,8 +31,8 @@ serde = {version = "1.0.126", optional = true}
serde_json = {version = "1.0.64", optional = true}
swc_atoms = {version = "0.2.3", path = "../../atoms"}
swc_common = {version = "0.14.0", path = "../../common"}
swc_ecma_ast = {version = "0.56.0", path = "../ast"}
swc_ecma_visit = {version = "0.42.0", path = "../visit"}
swc_ecma_ast = {version = "0.57.0", path = "../ast"}
swc_ecma_visit = {version = "0.43.0", path = "../visit"}
tracing = "0.1.28"
[dev-dependencies]

View File

@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "src/lists/*.json"]
license = "Apache-2.0/MIT"
name = "swc_ecma_minifier"
repository = "https://github.com/swc-project/swc.git"
version = "0.48.4"
version = "0.49.0"
[features]
debug = ["backtrace"]
@ -26,13 +26,13 @@ serde_json = "1.0.61"
serde_regex = "1.1.0"
swc_atoms = {version = "0.2", path = "../../atoms"}
swc_common = {version = "0.14.0", path = "../../common"}
swc_ecma_ast = {version = "0.56.0", path = "../ast"}
swc_ecma_codegen = {version = "0.78.1", path = "../codegen"}
swc_ecma_parser = {version = "0.76.3", path = "../parser"}
swc_ecma_transforms = {version = "0.92.1", path = "../transforms/", features = ["optimization"]}
swc_ecma_transforms_base = {version = "0.42.1", path = "../transforms/base"}
swc_ecma_utils = {version = "0.50.0", path = "../utils"}
swc_ecma_visit = {version = "0.42.0", path = "../visit"}
swc_ecma_ast = {version = "0.57.0", path = "../ast"}
swc_ecma_codegen = {version = "0.79.0", path = "../codegen"}
swc_ecma_parser = {version = "0.77.0", path = "../parser"}
swc_ecma_transforms = {version = "0.93.0", path = "../transforms/", features = ["optimization"]}
swc_ecma_transforms_base = {version = "0.43.0", path = "../transforms/base"}
swc_ecma_utils = {version = "0.51.0", path = "../utils"}
swc_ecma_visit = {version = "0.43.0", path = "../visit"}
tracing = "0.1.28"
unicode-xid = "0.2.2"

View File

@ -2,7 +2,7 @@ use super::{is_pure_undefined, Optimizer};
use crate::{
compress::{
optimize::util::replace_id_with_expr,
util::{get_lhs_ident, get_lhs_ident_mut, is_directive, is_ident_used_by, replace_expr},
util::{is_directive, is_ident_used_by, replace_expr},
},
debug::dump,
mode::Mode,
@ -241,7 +241,7 @@ where
..
}) => {
if !has_conflict
&& get_lhs_ident_mut(left).is_some()
&& left.as_ident().is_some()
&& match &**right {
Expr::Lit(Lit::Regex(..)) => false,
Expr::Lit(..) => true,
@ -568,7 +568,7 @@ where
match &*e.exprs[e.exprs.len() - 2] {
Expr::Assign(assign @ AssignExpr { op: op!("="), .. }) => {
if let Some(lhs) = get_lhs_ident(&assign.left) {
if let Some(lhs) = assign.left.as_ident() {
if lhs.sym == last_id.sym && lhs.span.ctxt == last_id.span.ctxt {
e.exprs.pop();
self.changed = true;
@ -878,7 +878,7 @@ where
}
Expr::Assign(e) => {
let left_id = get_lhs_ident(&e.left);
let left_id = e.left.as_ident();
let left_id = match left_id {
Some(v) => v,
_ => return false,
@ -1070,7 +1070,7 @@ where
}
Expr::Assign(b) => {
let b_left = get_lhs_ident(&b.left);
let b_left = b.left.as_ident();
let b_left = match b_left {
Some(v) => v.clone(),
None => return Ok(false),
@ -1275,7 +1275,7 @@ where
}) => {
match &**arg {
Expr::Ident(a_id) => {
let mut v = UsageCoutner {
let mut v = UsageCounter {
expr_usage: Default::default(),
pat_usage: Default::default(),
target: &*a_id,
@ -1331,7 +1331,7 @@ where
//
// (console.log(a = 5))
let left_id = match get_lhs_ident(left) {
let left_id = match left.as_ident() {
Some(v) => v,
None => {
tracing::trace!("[X] sequences: Aborting because lhs is not an id");
@ -1434,7 +1434,7 @@ where
}
{
let mut v = UsageCoutner {
let mut v = UsageCounter {
expr_usage: Default::default(),
pat_usage: Default::default(),
target: &left_id,
@ -1475,7 +1475,7 @@ where
}
}
struct UsageCoutner<'a> {
struct UsageCounter<'a> {
expr_usage: usize,
pat_usage: usize,
@ -1483,7 +1483,7 @@ struct UsageCoutner<'a> {
in_lhs: bool,
}
impl Visit for UsageCoutner<'_> {
impl Visit for UsageCounter<'_> {
noop_visit_type!();
fn visit_ident(&mut self, i: &Ident, _: &dyn Node) {
@ -1535,7 +1535,7 @@ impl Mergable<'_> {
_ => None,
},
Mergable::Expr(s) => match &**s {
Expr::Assign(s) => get_lhs_ident(&s.left).map(|v| v.to_id()),
Expr::Assign(s) => s.left.as_ident().map(|v| v.to_id()),
_ => None,
},
}

View File

@ -1,5 +1,5 @@
use super::Pure;
use crate::{compress::util::get_lhs_ident, mode::Mode};
use crate::mode::Mode;
use swc_common::{util::take::Take, SyntaxContext, DUMMY_SP};
use swc_ecma_ast::*;
use swc_ecma_utils::{ExprExt, ExprFactory};
@ -163,7 +163,7 @@ where
..
}),
) => {
let var_name = get_lhs_ident(&a_assign.left);
let var_name = a_assign.left.as_ident();
let var_name = match var_name {
Some(v) => v,
None => continue,

View File

@ -374,40 +374,6 @@ pub(crate) fn is_valid_identifier(s: &str, ascii_only: bool) -> bool {
&& !s.is_reserved()
}
pub(crate) fn get_lhs_ident(e: &PatOrExpr) -> Option<&Ident> {
match e {
PatOrExpr::Expr(v) => match &**v {
Expr::Ident(i) => Some(i),
_ => None,
},
PatOrExpr::Pat(v) => match &**v {
Pat::Ident(i) => Some(&i.id),
Pat::Expr(v) => match &**v {
Expr::Ident(i) => Some(i),
_ => None,
},
_ => None,
},
}
}
pub(crate) fn get_lhs_ident_mut(e: &mut PatOrExpr) -> Option<&mut Ident> {
match e {
PatOrExpr::Expr(v) => match &mut **v {
Expr::Ident(i) => Some(i),
_ => None,
},
PatOrExpr::Pat(v) => match &mut **v {
Pat::Ident(i) => Some(&mut i.id),
Pat::Expr(v) => match &mut **v {
Expr::Ident(i) => Some(i),
_ => None,
},
_ => None,
},
}
}
pub(crate) fn is_directive(e: &Stmt) -> bool {
match e {
Stmt::Expr(s) => match &*s.expr {

View File

@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "examples/**/*.rs"]
license = "Apache-2.0/MIT"
name = "swc_ecma_parser"
repository = "https://github.com/swc-project/swc.git"
version = "0.76.3"
version = "0.77.0"
[package.metadata.docs.rs]
all-features = true
@ -27,8 +27,8 @@ serde = {version = "1", features = ["derive"]}
smallvec = "1"
swc_atoms = {version = "0.2.3", path = "../../atoms"}
swc_common = {version = "0.14.0", path = "../../common"}
swc_ecma_ast = {version = "0.56.0", path = "../ast"}
swc_ecma_visit = {version = "0.42.0", path = "../visit"}
swc_ecma_ast = {version = "0.57.0", path = "../ast"}
swc_ecma_visit = {version = "0.43.0", path = "../visit"}
tracing = "0.1.28"
typed-arena = "2.0.1"
unicode-xid = "0.2"

View File

@ -5,7 +5,7 @@ documentation = "https://rustdoc.swc.rs/swc_ecma_preset_env/"
edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_preset_env"
version = "0.63.1"
version = "0.64.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -21,14 +21,14 @@ st-map = "0.1.2"
string_enum = {version = "0.3.1", path = "../../macros/string_enum"}
swc_atoms = {version = "0.2", path = "../../atoms"}
swc_common = {version = "0.14.0", path = "../../common"}
swc_ecma_ast = {version = "0.56.0", path = "../ast"}
swc_ecma_transforms = {version = "0.92.1", path = "../transforms", features = ["compat", "proposal"]}
swc_ecma_utils = {version = "0.50.0", path = "../utils"}
swc_ecma_visit = {version = "0.42.0", path = "../visit"}
swc_ecma_ast = {version = "0.57.0", path = "../ast"}
swc_ecma_transforms = {version = "0.93.0", path = "../transforms", features = ["compat", "proposal"]}
swc_ecma_utils = {version = "0.51.0", path = "../utils"}
swc_ecma_visit = {version = "0.43.0", path = "../visit"}
walkdir = "2"
[dev-dependencies]
pretty_assertions = "0.6"
swc_ecma_codegen = {version = "0.78.1", path = "../codegen"}
swc_ecma_parser = {version = "0.76.3", path = "../parser"}
swc_ecma_codegen = {version = "0.79.0", path = "../codegen"}
swc_ecma_parser = {version = "0.77.0", path = "../parser"}
testing = {version = "0.15.0", path = "../../testing"}

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_transforms"
repository = "https://github.com/swc-project/swc.git"
version = "0.92.1"
version = "0.93.0"
[package.metadata.docs.rs]
all-features = true
@ -24,24 +24,24 @@ typescript = ["swc_ecma_transforms_typescript"]
[dependencies]
swc_atoms = {version = "0.2.0", path = "../../atoms"}
swc_common = {version = "0.14.0", path = "../../common"}
swc_ecma_ast = {version = "0.56.0", path = "../ast"}
swc_ecma_parser = {version = "0.76.3", path = "../parser"}
swc_ecma_transforms_base = {version = "0.42.1", path = "./base"}
swc_ecma_transforms_compat = {version = "0.49.1", path = "./compat", optional = true}
swc_ecma_transforms_module = {version = "0.55.1", path = "./module", optional = true}
swc_ecma_transforms_optimization = {version = "0.62.1", path = "./optimization", optional = true}
swc_ecma_transforms_proposal = {version = "0.55.1", path = "./proposal", optional = true}
swc_ecma_transforms_react = {version = "0.57.1", path = "./react", optional = true}
swc_ecma_transforms_typescript = {version = "0.58.1", path = "./typescript", optional = true}
swc_ecma_utils = {version = "0.50.0", path = "../utils"}
swc_ecma_visit = {version = "0.42.0", path = "../visit"}
swc_ecma_ast = {version = "0.57.0", path = "../ast"}
swc_ecma_parser = {version = "0.77.0", path = "../parser"}
swc_ecma_transforms_base = {version = "0.43.0", path = "./base"}
swc_ecma_transforms_compat = {version = "0.50.0", path = "./compat", optional = true}
swc_ecma_transforms_module = {version = "0.56.0", path = "./module", optional = true}
swc_ecma_transforms_optimization = {version = "0.63.0", path = "./optimization", optional = true}
swc_ecma_transforms_proposal = {version = "0.56.0", path = "./proposal", optional = true}
swc_ecma_transforms_react = {version = "0.58.0", path = "./react", optional = true}
swc_ecma_transforms_typescript = {version = "0.59.0", path = "./typescript", optional = true}
swc_ecma_utils = {version = "0.51.0", path = "../utils"}
swc_ecma_visit = {version = "0.43.0", path = "../visit"}
unicode-xid = "0.2"
[dev-dependencies]
pretty_assertions = "0.6"
sourcemap = "6"
swc_ecma_codegen = {version = "0.78.1", path = "../codegen"}
swc_ecma_transforms_testing = {version = "0.43.1", path = "./testing"}
swc_ecma_codegen = {version = "0.79.0", path = "../codegen"}
swc_ecma_transforms_testing = {version = "0.44.0", path = "./testing"}
tempfile = "3"
testing = {version = "0.15.0", path = "../../testing"}
walkdir = "2"

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_transforms_base"
repository = "https://github.com/swc-project/swc.git"
version = "0.42.1"
version = "0.43.0"
[features]
concurrent = [
@ -22,13 +22,13 @@ scoped-tls = "1.0.0"
smallvec = "1.6.0"
swc_atoms = {version = "0.2", path = "../../../atoms"}
swc_common = {version = "0.14.0", path = "../../../common"}
swc_ecma_ast = {version = "0.56.0", path = "../../ast"}
swc_ecma_parser = {version = "0.76.3", path = "../../parser"}
swc_ecma_utils = {version = "0.50.0", path = "../../utils"}
swc_ecma_visit = {version = "0.42.0", path = "../../visit"}
swc_ecma_ast = {version = "0.57.0", path = "../../ast"}
swc_ecma_parser = {version = "0.77.0", path = "../../parser"}
swc_ecma_utils = {version = "0.51.0", path = "../../utils"}
swc_ecma_visit = {version = "0.43.0", path = "../../visit"}
tracing = "0.1"
[dev-dependencies]
swc_ecma_codegen = {version = "0.78.1", path = "../../codegen"}
swc_ecma_codegen = {version = "0.79.0", path = "../../codegen"}
swc_ecma_transforms_macros = {version = "0.3.0", path = "../macros"}
testing = {version = "0.15.0", path = "../../../testing"}

View File

@ -6,12 +6,12 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_transforms_classes"
repository = "https://github.com/swc-project/swc.git"
version = "0.28.1"
version = "0.29.0"
[dependencies]
swc_atoms = {version = "0.2.6", path = "../../../atoms"}
swc_common = {version = "0.14.0", path = "../../../common"}
swc_ecma_ast = {version = "0.56.0", path = "../../ast"}
swc_ecma_transforms_base = {version = "0.42.1", path = "../base"}
swc_ecma_utils = {version = "0.50.0", path = "../../utils"}
swc_ecma_visit = {version = "0.42.0", path = "../../visit"}
swc_ecma_ast = {version = "0.57.0", path = "../../ast"}
swc_ecma_transforms_base = {version = "0.43.0", path = "../base"}
swc_ecma_utils = {version = "0.51.0", path = "../../utils"}
swc_ecma_visit = {version = "0.43.0", path = "../../visit"}

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_transforms_compat"
repository = "https://github.com/swc-project/swc.git"
version = "0.49.4"
version = "0.50.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
@ -28,15 +28,15 @@ serde = {version = "1.0.118", features = ["derive"]}
smallvec = "1.6.0"
swc_atoms = {version = "0.2.5", path = "../../../atoms"}
swc_common = {version = "0.14.0", path = "../../../common"}
swc_ecma_ast = {version = "0.56.0", path = "../../ast"}
swc_ecma_transforms_base = {version = "0.42.1", path = "../base"}
swc_ecma_transforms_classes = {version = "0.28.1", path = "../classes"}
swc_ecma_ast = {version = "0.57.0", path = "../../ast"}
swc_ecma_transforms_base = {version = "0.43.0", path = "../base"}
swc_ecma_transforms_classes = {version = "0.29.0", path = "../classes"}
swc_ecma_transforms_macros = {version = "0.3.0", path = "../macros"}
swc_ecma_utils = {version = "0.50.0", path = "../../utils"}
swc_ecma_visit = {version = "0.42.0", path = "../../visit"}
swc_ecma_utils = {version = "0.51.0", path = "../../utils"}
swc_ecma_visit = {version = "0.43.0", path = "../../visit"}
[dev-dependencies]
serde_json = "1.0.66"
swc_ecma_parser = {version = "0.76.3", path = "../../parser"}
swc_ecma_transforms_testing = {version = "0.43.1", path = "../testing"}
swc_ecma_parser = {version = "0.77.0", path = "../../parser"}
swc_ecma_transforms_testing = {version = "0.44.0", path = "../testing"}
testing = {version = "0.15.0", path = "../../../testing"}

View File

@ -1,6 +1,6 @@
use swc_common::util::take::Take;
use swc_ecma_ast::*;
use swc_ecma_transforms_base::{ext::PatOrExprExt, perf::Parallel};
use swc_ecma_transforms_base::perf::Parallel;
use swc_ecma_transforms_macros::parallel;
use swc_ecma_utils::{private_ident, UsageFinder};
use swc_ecma_visit::{as_folder, noop_visit_mut_type, Fold, VisitMut, VisitMutWith};

View File

@ -1,9 +1,6 @@
use swc_common::{util::take::Take, Span, Spanned, DUMMY_SP};
use swc_ecma_ast::*;
use swc_ecma_transforms_base::{
ext::PatOrExprExt,
perf::{ParExplode, Parallel},
};
use swc_ecma_transforms_base::perf::{ParExplode, Parallel};
use swc_ecma_transforms_macros::parallel;
use swc_ecma_utils::{member_expr, private_ident, ExprFactory};
use swc_ecma_visit::{as_folder, noop_visit_mut_type, Fold, VisitMut, VisitMutWith};

View File

@ -2,10 +2,7 @@ use std::{iter, mem};
use swc_atoms::JsWord;
use swc_common::{collections::AHashSet, util::take::Take, Mark, Spanned, SyntaxContext, DUMMY_SP};
use swc_ecma_ast::*;
use swc_ecma_transforms_base::{
ext::{AsOptExpr, PatOrExprExt},
helper,
};
use swc_ecma_transforms_base::helper;
use swc_ecma_utils::{alias_ident_for, alias_if_required, prepend, quote_ident, ExprFactory};
use swc_ecma_visit::{noop_fold_type, noop_visit_mut_type, Fold, FoldWith, VisitMut, VisitMutWith};

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_transforms_module"
repository = "https://github.com/swc-project/swc.git"
version = "0.55.2"
version = "0.56.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
@ -18,14 +18,14 @@ pathdiff = "0.2.0"
serde = {version = "1.0.118", features = ["derive"]}
swc_atoms = {version = "0.2", path = "../../../atoms"}
swc_common = {version = "0.14.0", path = "../../../common"}
swc_ecma_ast = {version = "0.56.0", path = "../../ast"}
swc_ecma_loader = {version = "0.23.0", path = "../../loader", features = ["node"]}
swc_ecma_parser = {version = "0.76.3", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.42.1", path = "../base"}
swc_ecma_utils = {version = "0.50.0", path = "../../utils"}
swc_ecma_visit = {version = "0.42.0", path = "../../visit"}
swc_ecma_ast = {version = "0.57.0", path = "../../ast"}
swc_ecma_loader = {version = "0.24.0", path = "../../loader", features = ["node"]}
swc_ecma_parser = {version = "0.77.0", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.43.0", path = "../base"}
swc_ecma_utils = {version = "0.51.0", path = "../../utils"}
swc_ecma_visit = {version = "0.43.0", path = "../../visit"}
[dev-dependencies]
swc_ecma_transforms_compat = {version = "0.49.1", path = "../compat"}
swc_ecma_transforms_testing = {version = "0.43.1", path = "../testing/"}
swc_ecma_transforms_compat = {version = "0.50.0", path = "../compat"}
swc_ecma_transforms_testing = {version = "0.44.0", path = "../testing/"}
testing = {version = "0.15.0", path = "../../../testing/"}

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_transforms_optimization"
repository = "https://github.com/swc-project/swc.git"
version = "0.62.1"
version = "0.63.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
@ -28,19 +28,19 @@ retain_mut = "0.1.2"
serde_json = "1.0.61"
swc_atoms = {version = "0.2", path = "../../../atoms"}
swc_common = {version = "0.14.0", path = "../../../common"}
swc_ecma_ast = {version = "0.56.0", path = "../../ast"}
swc_ecma_parser = {version = "0.76.3", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.42.1", path = "../base"}
swc_ecma_ast = {version = "0.57.0", path = "../../ast"}
swc_ecma_parser = {version = "0.77.0", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.43.0", path = "../base"}
swc_ecma_transforms_macros = {version = "0.3.0", path = "../macros"}
swc_ecma_utils = {version = "0.50.0", path = "../../utils"}
swc_ecma_visit = {version = "0.42.0", path = "../../visit"}
swc_ecma_utils = {version = "0.51.0", path = "../../utils"}
swc_ecma_visit = {version = "0.43.0", path = "../../visit"}
tracing = "0.1.28"
[dev-dependencies]
swc_ecma_transforms_compat = {version = "0.49.1", path = "../compat"}
swc_ecma_transforms_module = {version = "0.55.1", path = "../module"}
swc_ecma_transforms_proposal = {version = "0.55.1", path = "../proposal"}
swc_ecma_transforms_react = {version = "0.57.1", path = "../react"}
swc_ecma_transforms_testing = {version = "0.43.1", path = "../testing"}
swc_ecma_transforms_typescript = {version = "0.58.1", path = "../typescript"}
swc_ecma_transforms_compat = {version = "0.50.0", path = "../compat"}
swc_ecma_transforms_module = {version = "0.56.0", path = "../module"}
swc_ecma_transforms_proposal = {version = "0.56.0", path = "../proposal"}
swc_ecma_transforms_react = {version = "0.58.0", path = "../react"}
swc_ecma_transforms_testing = {version = "0.44.0", path = "../testing"}
swc_ecma_transforms_typescript = {version = "0.59.0", path = "../typescript"}
testing = {version = "0.15.0", path = "../../../testing"}

View File

@ -11,7 +11,6 @@ use swc_common::{
Mark, DUMMY_SP,
};
use swc_ecma_ast::*;
use swc_ecma_transforms_base::ext::PatOrExprExt;
use swc_ecma_utils::{
collect_decls, ident::IdentLike, ExprExt, Id, IsEmpty, ModuleItemLike, StmtLike, Value,
};

View File

@ -6,7 +6,7 @@ use swc_common::{
DUMMY_SP,
};
use swc_ecma_ast::*;
use swc_ecma_transforms_base::{ext::PatOrExprExt, pass::RepeatedJsPass, scope::IdentType};
use swc_ecma_transforms_base::{pass::RepeatedJsPass, scope::IdentType};
use swc_ecma_utils::{contains_this_expr, find_ids, ident::IdentLike, undefined, Id};
use swc_ecma_visit::{
as_folder, noop_visit_mut_type, noop_visit_type, Node, Visit, VisitMut, VisitMutWith, VisitWith,

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_transforms_proposal"
repository = "https://github.com/swc-project/swc.git"
version = "0.55.1"
version = "0.56.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -20,18 +20,18 @@ serde = {version = "1.0.118", features = ["derive"]}
smallvec = "1.6.0"
swc_atoms = {version = "0.2", path = "../../../atoms"}
swc_common = {version = "0.14.0", path = "../../../common"}
swc_ecma_ast = {version = "0.56.0", path = "../../ast"}
swc_ecma_loader = {version = "0.23.0", path = "../../loader", optional = true}
swc_ecma_parser = {version = "0.76.3", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.42.1", path = "../base"}
swc_ecma_transforms_classes = {version = "0.28.1", path = "../classes"}
swc_ecma_ast = {version = "0.57.0", path = "../../ast"}
swc_ecma_loader = {version = "0.24.0", path = "../../loader", optional = true}
swc_ecma_parser = {version = "0.77.0", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.43.0", path = "../base"}
swc_ecma_transforms_classes = {version = "0.29.0", path = "../classes"}
swc_ecma_transforms_macros = {version = "0.3.0", path = "../macros"}
swc_ecma_utils = {version = "0.50.0", path = "../../utils"}
swc_ecma_visit = {version = "0.42.0", path = "../../visit"}
swc_ecma_utils = {version = "0.51.0", path = "../../utils"}
swc_ecma_visit = {version = "0.43.0", path = "../../visit"}
[dev-dependencies]
serde_json = "1.0.66"
swc_ecma_transforms_compat = {version = "0.49.1", path = "../compat"}
swc_ecma_transforms_module = {version = "0.55.1", path = "../module"}
swc_ecma_transforms_testing = {version = "0.43.1", path = "../testing"}
swc_ecma_transforms_compat = {version = "0.50.0", path = "../compat"}
swc_ecma_transforms_module = {version = "0.56.0", path = "../module"}
swc_ecma_transforms_testing = {version = "0.44.0", path = "../testing"}
testing = {version = "0.15.0", path = "../../../testing"}

View File

@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"]
license = "Apache-2.0/MIT"
name = "swc_ecma_transforms_react"
repository = "https://github.com/swc-project/swc.git"
version = "0.57.1"
version = "0.58.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
@ -22,16 +22,16 @@ sha-1 = "0.9.4"
string_enum = {version = "0.3.1", path = "../../../macros/string_enum"}
swc_atoms = {version = "0.2", path = "../../../atoms"}
swc_common = {version = "0.14.0", path = "../../../common"}
swc_ecma_ast = {version = "0.56.0", path = "../../ast"}
swc_ecma_parser = {version = "0.76.3", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.42.1", path = "../base"}
swc_ecma_ast = {version = "0.57.0", path = "../../ast"}
swc_ecma_parser = {version = "0.77.0", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.43.0", path = "../base"}
swc_ecma_transforms_macros = {version = "0.3.0", path = "../macros"}
swc_ecma_utils = {version = "0.50.0", path = "../../utils"}
swc_ecma_visit = {version = "0.42.0", path = "../../visit"}
swc_ecma_utils = {version = "0.51.0", path = "../../utils"}
swc_ecma_visit = {version = "0.43.0", path = "../../visit"}
[dev-dependencies]
swc_ecma_codegen = {version = "0.78.1", path = "../../codegen/"}
swc_ecma_transforms_compat = {version = "0.49.1", path = "../compat/"}
swc_ecma_transforms_module = {version = "0.55.1", path = "../module"}
swc_ecma_transforms_testing = {version = "0.43.1", path = "../testing/"}
swc_ecma_codegen = {version = "0.79.0", path = "../../codegen/"}
swc_ecma_transforms_compat = {version = "0.50.0", path = "../compat/"}
swc_ecma_transforms_module = {version = "0.56.0", path = "../module"}
swc_ecma_transforms_testing = {version = "0.44.0", path = "../testing/"}
testing = {version = "0.15.0", path = "../../../testing"}

View File

@ -2,7 +2,6 @@ use std::ops::DerefMut;
use swc_atoms::js_word;
use swc_common::DUMMY_SP;
use swc_ecma_ast::*;
use swc_ecma_transforms_base::ext::{AsOptExpr, PatOrExprExt};
use swc_ecma_utils::quote_ident;
use swc_ecma_visit::{as_folder, noop_visit_mut_type, Fold, VisitMut, VisitMutWith};

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_transforms_testing"
repository = "https://github.com/swc-project/swc.git"
version = "0.43.1"
version = "0.44.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -18,11 +18,11 @@ serde = "1"
serde_json = "1"
sha-1 = "0.9.8"
swc_common = {version = "0.14.0", path = "../../../common"}
swc_ecma_ast = {version = "0.56.0", path = "../../ast"}
swc_ecma_codegen = {version = "0.78.1", path = "../../codegen"}
swc_ecma_parser = {version = "0.76.3", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.42.1", path = "../base"}
swc_ecma_utils = {version = "0.50.0", path = "../../utils"}
swc_ecma_visit = {version = "0.42.0", path = "../../visit"}
swc_ecma_ast = {version = "0.57.0", path = "../../ast"}
swc_ecma_codegen = {version = "0.79.0", path = "../../codegen"}
swc_ecma_parser = {version = "0.77.0", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.43.0", path = "../base"}
swc_ecma_utils = {version = "0.51.0", path = "../../utils"}
swc_ecma_visit = {version = "0.43.0", path = "../../visit"}
tempfile = "3.1.0"
testing = {version = "0.15.0", path = "../../../testing"}

View File

@ -6,25 +6,25 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_transforms_typescript"
repository = "https://github.com/swc-project/swc.git"
version = "0.58.3"
version = "0.59.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
serde = {version = "1.0.118", features = ["derive"]}
swc_atoms = {version = "0.2", path = "../../../atoms"}
swc_common = {version = "0.14.0", path = "../../../common"}
swc_ecma_ast = {version = "0.56.0", path = "../../ast"}
swc_ecma_parser = {version = "0.76.3", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.42.1", path = "../base"}
swc_ecma_transforms_react = {version = "0.57.1", path = "../react"}
swc_ecma_utils = {version = "0.50.0", path = "../../utils"}
swc_ecma_visit = {version = "0.42.0", path = "../../visit"}
swc_ecma_ast = {version = "0.57.0", path = "../../ast"}
swc_ecma_parser = {version = "0.77.0", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.43.0", path = "../base"}
swc_ecma_transforms_react = {version = "0.58.0", path = "../react"}
swc_ecma_utils = {version = "0.51.0", path = "../../utils"}
swc_ecma_visit = {version = "0.43.0", path = "../../visit"}
[dev-dependencies]
swc_ecma_codegen = {version = "0.78.1", path = "../../codegen"}
swc_ecma_transforms_compat = {version = "0.49.1", path = "../compat"}
swc_ecma_transforms_module = {version = "0.55.1", path = "../module"}
swc_ecma_transforms_proposal = {version = "0.55.1", path = "../proposal/"}
swc_ecma_transforms_testing = {version = "0.43.1", path = "../testing"}
swc_ecma_codegen = {version = "0.79.0", path = "../../codegen"}
swc_ecma_transforms_compat = {version = "0.50.0", path = "../compat"}
swc_ecma_transforms_module = {version = "0.56.0", path = "../module"}
swc_ecma_transforms_proposal = {version = "0.56.0", path = "../proposal/"}
swc_ecma_transforms_testing = {version = "0.44.0", path = "../testing"}
testing = {version = "0.15.0", path = "../../../testing"}
walkdir = "2.3.1"

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_utils"
repository = "https://github.com/swc-project/swc.git"
version = "0.50.1"
version = "0.51.0"
[features]
# Process in parallel.
@ -20,8 +20,8 @@ once_cell = "1"
rayon = {version = "1.5.1", optional = true}
swc_atoms = {version = "0.2.0", path = "../../atoms"}
swc_common = {version = "0.14.3", path = "../../common"}
swc_ecma_ast = {version = "0.56.0", path = "../ast"}
swc_ecma_visit = {version = "0.42.0", path = "../visit"}
swc_ecma_ast = {version = "0.57.0", path = "../ast"}
swc_ecma_visit = {version = "0.43.0", path = "../visit"}
unicode-xid = "0.2"
[dev-dependencies]

View File

@ -6,11 +6,11 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_visit"
repository = "https://github.com/swc-project/swc.git"
version = "0.42.0"
version = "0.43.0"
[dependencies]
num-bigint = {version = "0.2", features = ["serde"]}
swc_atoms = {version = "0.2", path = "../../atoms"}
swc_common = {version = "0.14.0", path = "../../common"}
swc_ecma_ast = {version = "0.56.0", path = "../ast"}
swc_ecma_ast = {version = "0.57.0", path = "../ast"}
swc_visit = {version = "0.2.3", path = "../../visit"}

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_plugin"
repository = "https://github.com/swc-project/swc.git"
version = "0.11.0"
version = "0.12.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -17,6 +17,6 @@ serde = "1.0.126"
serde_json = "1.0.64"
swc_atoms = {version = "0.2.7", path = "../atoms"}
swc_common = {version = "0.14.0", path = "../common", features = ["plugin-mode"]}
swc_ecma_ast = {version = "0.56.0", path = "../ecmascript/ast"}
swc_ecma_visit = {version = "0.42.0", path = "../ecmascript/visit"}
swc_plugin_api = {version = "0.2.0", path = "./api"}
swc_ecma_ast = {version = "0.57.0", path = "../ecmascript/ast"}
swc_ecma_visit = {version = "0.43.0", path = "../ecmascript/visit"}
swc_plugin_api = {version = "0.3.0", path = "./api"}

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_plugin_api"
repository = "https://github.com/swc-project/swc.git"
version = "0.2.0"
version = "0.3.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -17,5 +17,5 @@ serde = "1.0.126"
serde_json = "1"
swc_atoms = {version = "0.2.7", path = "../../atoms"}
swc_common = {version = "0.14.5", path = "../../common", features = ["plugin-base"]}
swc_ecma_ast = {version = "0.56.0", path = "../../ecmascript/ast"}
swc_ecma_visit = {version = "0.42.0", path = "../../ecmascript/visit"}
swc_ecma_ast = {version = "0.57.0", path = "../../ecmascript/ast"}
swc_ecma_visit = {version = "0.43.0", path = "../../ecmascript/visit"}

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_plugin_runner"
repository = "https://github.com/swc-project/swc.git"
version = "0.15.0"
version = "0.16.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
@ -17,10 +17,10 @@ serde = {version = "1.0.126", features = ["derive"]}
serde_json = "1.0.64"
swc_atoms = "0.2.7"
swc_common = {version = "0.14.0", path = "../../common", features = ["plugin-rt"]}
swc_ecma_ast = {version = "0.56.0", path = "../../ecmascript/ast"}
swc_ecma_parser = {version = "0.76.3", path = "../../ecmascript/parser"}
swc_plugin_api = {version = "0.2.0", path = "../api"}
swc_ecma_ast = {version = "0.57.0", path = "../../ecmascript/ast"}
swc_ecma_parser = {version = "0.77.0", path = "../../ecmascript/parser"}
swc_plugin_api = {version = "0.3.0", path = "../api"}
[dev-dependencies]
swc_ecma_codegen = {version = "0.78.1", path = "../../ecmascript/codegen"}
swc_ecma_codegen = {version = "0.79.0", path = "../../ecmascript/codegen"}
testing = {version = "0.15.0", path = "../../testing"}

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_plugin_testing"
repository = "https://github.com/swc-project/swc.git"
version = "0.17.0"
version = "0.18.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -14,8 +14,8 @@ version = "0.17.0"
anyhow = "1.0.41"
swc_atoms = {version = "0.2.7", path = "../../atoms"}
swc_common = {version = "0.14.0", path = "../../common"}
swc_ecma_ast = {version = "0.56.0", path = "../../ecmascript/ast"}
swc_ecma_codegen = {version = "0.78.1", path = "../../ecmascript/codegen"}
swc_ecma_utils = {version = "0.50.0", path = "../../ecmascript/utils"}
swc_ecma_visit = {version = "0.42.0", path = "../../ecmascript/visit"}
swc_plugin_api = {version = "0.2.0", path = "../api"}
swc_ecma_ast = {version = "0.57.0", path = "../../ecmascript/ast"}
swc_ecma_codegen = {version = "0.79.0", path = "../../ecmascript/codegen"}
swc_ecma_utils = {version = "0.51.0", path = "../../ecmascript/utils"}
swc_ecma_visit = {version = "0.43.0", path = "../../ecmascript/visit"}
swc_plugin_api = {version = "0.3.0", path = "../api"}