feat(swc): Improve swc as a crate (#2026)

]swc_ecmascript:
 - Expose `swc_ecma_preset_env`.

swc:
 - Expose `swc_atoms`.
 - Expose `swc_common`.
 - Expose `swc_ecmascript`.
This commit is contained in:
강동윤 2021-08-07 02:41:50 +09:00 committed by GitHub
parent 403f647752
commit 4cdb45ff2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 6 deletions

8
Cargo.lock generated
View File

@ -2255,7 +2255,7 @@ checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c"
[[package]]
name = "swc"
version = "0.35.0"
version = "0.35.1"
dependencies = [
"ahash 0.7.4",
"anyhow",
@ -2285,6 +2285,7 @@ dependencies = [
"swc_ecma_transforms_base",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_ecmascript",
"swc_node_base",
"swc_visit",
"testing",
@ -2624,7 +2625,7 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_classes"
version = "0.12.0"
version = "0.12.1"
dependencies = [
"swc_atoms",
"swc_common",
@ -2835,13 +2836,14 @@ dependencies = [
[[package]]
name = "swc_ecmascript"
version = "0.52.0"
version = "0.52.1"
dependencies = [
"swc_ecma_ast",
"swc_ecma_codegen",
"swc_ecma_dep_graph",
"swc_ecma_minifier",
"swc_ecma_parser",
"swc_ecma_preset_env",
"swc_ecma_transforms",
"swc_ecma_utils",
"swc_ecma_visit",

View File

@ -9,7 +9,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc"
repository = "https://github.com/swc-project/swc.git"
version = "0.35.0"
version = "0.35.1"
[lib]
name = "swc"
@ -49,6 +49,7 @@ swc_ecma_transforms = {version = "0.63.0", path = "./ecmascript/transforms", fea
swc_ecma_transforms_base = {version = "0.26.0", path = "./ecmascript/transforms/base"}
swc_ecma_utils = {version = "0.41.0", path = "./ecmascript/utils"}
swc_ecma_visit = {version = "0.35.0", path = "./ecmascript/visit"}
swc_ecmascript = {version = "0.52.0", path = "./ecmascript"}
swc_node_base = {version = "0.2.0", path = "./node/base"}
swc_visit = {version = "0.2.3", path = "./visit"}

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.52.0"
version = "0.52.1"
[package.metadata.docs.rs]
all-features = true
@ -17,6 +17,7 @@ default = ["typescript-parser"]
dep_graph = ["swc_ecma_dep_graph"]
minifier = ["swc_ecma_minifier"]
parser = ["swc_ecma_parser"]
preset_env = ["swc_ecma_preset_env"]
transforms = ["swc_ecma_transforms"]
utils = ["swc_ecma_utils"]
visit = ["swc_ecma_visit"]
@ -36,6 +37,7 @@ swc_ecma_codegen = {version = "0.66.0", path = "./codegen", optional = true}
swc_ecma_dep_graph = {version = "0.34.0", path = "./dep-graph", optional = true}
swc_ecma_minifier = {version = "0.18.0", path = "./minifier", optional = true}
swc_ecma_parser = {version = "0.66.0", path = "./parser", optional = true, default-features = false}
swc_ecma_preset_env = {version = "0.33.0", path = "./preset-env", optional = true}
swc_ecma_transforms = {version = "0.63.0", path = "./transforms", optional = true}
swc_ecma_utils = {version = "0.41.0", path = "./utils", optional = true}
swc_ecma_visit = {version = "0.35.0", path = "./visit", optional = true}

View File

@ -5,6 +5,8 @@ pub use swc_ecma_codegen as codegen;
pub use swc_ecma_dep_graph as dep_graph;
#[cfg(feature = "parser")]
pub use swc_ecma_parser as parser;
#[cfg(feature = "preset_env")]
pub use swc_ecma_preset_env as preset_env;
#[cfg(feature = "transforms")]
pub use swc_ecma_transforms as transforms;
#[cfg(feature = "utils")]

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_transforms_classes"
repository = "https://github.com/swc-project/swc.git"
version = "0.12.0"
version = "0.12.1"
[dependencies]
swc_atoms = {version = "0.2.6", path = "../../../atoms"}

View File

@ -1,5 +1,9 @@
#![deny(unused)]
pub extern crate swc_atoms as atoms;
pub extern crate swc_common as common;
pub extern crate swc_ecmascript as ecmascript;
pub use crate::builder::PassBuilder;
use crate::config::{
BuiltConfig, Config, ConfigFile, InputSourceMap, JscTarget, Merge, Options, Rc, RootMode,