mirror of
https://github.com/swc-project/swc.git
synced 2024-12-23 13:51:19 +03:00
feat(es/parser): Allow stripping out typescript parser (#1962)
swc_ecma_parser: - Add a cargo feature to remove typescript parser.
This commit is contained in:
parent
cd4a564eea
commit
85a216ef56
14
Cargo.toml
14
Cargo.toml
@ -9,7 +9,7 @@ edition = "2018"
|
||||
license = "Apache-2.0/MIT"
|
||||
name = "swc"
|
||||
repository = "https://github.com/swc-project/swc.git"
|
||||
version = "0.30.0"
|
||||
version = "0.31.0"
|
||||
|
||||
[lib]
|
||||
name = "swc"
|
||||
@ -29,15 +29,15 @@ serde = {version = "1", features = ["derive"]}
|
||||
serde_json = "1"
|
||||
sourcemap = "6"
|
||||
swc_atoms = {version = "0.2", path = "./atoms"}
|
||||
swc_bundler = {version = "0.46.0", path = "./bundler"}
|
||||
swc_bundler = {version = "0.47.0", path = "./bundler"}
|
||||
swc_common = {version = "0.11.0", path = "./common", features = ["sourcemap", "concurrent"]}
|
||||
swc_ecma_ast = {version = "0.49.0", path = "./ecmascript/ast"}
|
||||
swc_ecma_codegen = {version = "0.62.0", path = "./ecmascript/codegen"}
|
||||
swc_ecma_ext_transforms = {version = "0.21.0", path = "./ecmascript/ext-transforms"}
|
||||
swc_ecma_codegen = {version = "0.63.0", path = "./ecmascript/codegen"}
|
||||
swc_ecma_ext_transforms = {version = "0.22.0", path = "./ecmascript/ext-transforms"}
|
||||
swc_ecma_loader = {version = "0.11.0", path = "./ecmascript/loader", features = ["lru", "node", "tsc"]}
|
||||
swc_ecma_parser = {version = "0.63.0", path = "./ecmascript/parser"}
|
||||
swc_ecma_preset_env = {version = "0.29.0", path = "./ecmascript/preset-env"}
|
||||
swc_ecma_transforms = {version = "0.59.0", path = "./ecmascript/transforms", features = [
|
||||
swc_ecma_parser = {version = "0.64.0", path = "./ecmascript/parser"}
|
||||
swc_ecma_preset_env = {version = "0.30.0", path = "./ecmascript/preset-env"}
|
||||
swc_ecma_transforms = {version = "0.60.0", path = "./ecmascript/transforms", features = [
|
||||
"compat",
|
||||
"module",
|
||||
"optimization",
|
||||
|
@ -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.46.0"
|
||||
version = "0.47.0"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
[features]
|
||||
@ -34,10 +34,10 @@ retain_mut = "0.1.2"
|
||||
swc_atoms = {version = "0.2.4", path = "../atoms"}
|
||||
swc_common = {version = "0.11.0", path = "../common"}
|
||||
swc_ecma_ast = {version = "0.49.0", path = "../ecmascript/ast"}
|
||||
swc_ecma_codegen = {version = "0.62.0", path = "../ecmascript/codegen"}
|
||||
swc_ecma_codegen = {version = "0.63.0", path = "../ecmascript/codegen"}
|
||||
swc_ecma_loader = {version = "0.11.0", path = "../ecmascript/loader"}
|
||||
swc_ecma_parser = {version = "0.63.0", path = "../ecmascript/parser"}
|
||||
swc_ecma_transforms = {version = "0.59.0", path = "../ecmascript/transforms", features = ["optimization"]}
|
||||
swc_ecma_parser = {version = "0.64.0", path = "../ecmascript/parser"}
|
||||
swc_ecma_transforms = {version = "0.60.0", path = "../ecmascript/transforms", features = ["optimization"]}
|
||||
swc_ecma_utils = {version = "0.40.0", path = "../ecmascript/utils"}
|
||||
swc_ecma_visit = {version = "0.35.0", path = "../ecmascript/visit"}
|
||||
|
||||
@ -46,7 +46,7 @@ hex = "0.4"
|
||||
ntest = "0.7.2"
|
||||
reqwest = {version = "0.10.8", features = ["blocking"]}
|
||||
sha-1 = "0.9"
|
||||
swc_ecma_transforms = {version = "0.59.0", path = "../ecmascript/transforms", features = ["react", "typescript"]}
|
||||
swc_ecma_transforms = {version = "0.60.0", path = "../ecmascript/transforms", features = ["react", "typescript"]}
|
||||
tempfile = "3.1.0"
|
||||
testing = {version = "0.11.0", path = "../testing"}
|
||||
url = "2.1.1"
|
||||
|
@ -6,13 +6,14 @@ edition = "2018"
|
||||
license = "Apache-2.0/MIT"
|
||||
name = "swc_ecmascript"
|
||||
repository = "https://github.com/swc-project/swc.git"
|
||||
version = "0.46.0"
|
||||
version = "0.47.0"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
|
||||
[features]
|
||||
codegen = ["swc_ecma_codegen"]
|
||||
default = ["typescript-parser"]
|
||||
dep_graph = ["swc_ecma_dep_graph"]
|
||||
minifier = ["swc_ecma_minifier"]
|
||||
parser = ["swc_ecma_parser"]
|
||||
@ -20,20 +21,22 @@ transforms = ["swc_ecma_transforms"]
|
||||
utils = ["swc_ecma_utils"]
|
||||
visit = ["swc_ecma_visit"]
|
||||
|
||||
typescript-parser = ["swc_ecma_parser/typescript"]
|
||||
|
||||
compat = ["swc_ecma_transforms/compat"]
|
||||
module = ["swc_ecma_transforms/module"]
|
||||
optimization = ["swc_ecma_transforms/optimization"]
|
||||
proposal = ["swc_ecma_transforms/proposal"]
|
||||
react = ["swc_ecma_transforms/react"]
|
||||
typescript = ["swc_ecma_transforms/typescript"]
|
||||
typescript = ["typescript-parser", "swc_ecma_transforms/typescript"]
|
||||
|
||||
[dependencies]
|
||||
swc_ecma_ast = {version = "0.49.0", path = "./ast"}
|
||||
swc_ecma_codegen = {version = "0.62.0", path = "./codegen", optional = true}
|
||||
swc_ecma_dep_graph = {version = "0.31.0", path = "./dep-graph", optional = true}
|
||||
swc_ecma_minifier = {version = "0.12.0", path = "./minifier", optional = true}
|
||||
swc_ecma_parser = {version = "0.63.0", path = "./parser", optional = true}
|
||||
swc_ecma_transforms = {version = "0.59.0", path = "./transforms", optional = true}
|
||||
swc_ecma_codegen = {version = "0.63.0", path = "./codegen", optional = true}
|
||||
swc_ecma_dep_graph = {version = "0.32.0", path = "./dep-graph", optional = true}
|
||||
swc_ecma_minifier = {version = "0.13.0", path = "./minifier", optional = true}
|
||||
swc_ecma_parser = {version = "0.64.0", path = "./parser", optional = true, default-features = false}
|
||||
swc_ecma_transforms = {version = "0.60.0", path = "./transforms", optional = true}
|
||||
swc_ecma_utils = {version = "0.40.0", path = "./utils", optional = true}
|
||||
swc_ecma_visit = {version = "0.35.0", path = "./visit", optional = true}
|
||||
|
||||
|
@ -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.62.1"
|
||||
version = "0.63.0"
|
||||
|
||||
[dependencies]
|
||||
bitflags = "1"
|
||||
@ -17,7 +17,7 @@ swc_atoms = {version = "0.2", path = "../../atoms"}
|
||||
swc_common = {version = "0.11.0", path = "../../common"}
|
||||
swc_ecma_ast = {version = "0.49.0", path = "../ast"}
|
||||
swc_ecma_codegen_macros = {version = "0.5.2", path = "./macros"}
|
||||
swc_ecma_parser = {version = "0.63.0", path = "../parser"}
|
||||
swc_ecma_parser = {version = "0.64.0", path = "../parser"}
|
||||
|
||||
[dev-dependencies]
|
||||
swc_common = {version = "0.11.0", path = "../../common", features = ["sourcemap"]}
|
||||
|
@ -6,7 +6,7 @@ edition = "2018"
|
||||
license = "Apache-2.0/MIT"
|
||||
name = "swc_ecma_dep_graph"
|
||||
repository = "https://github.com/swc-project/swc.git"
|
||||
version = "0.31.0"
|
||||
version = "0.32.0"
|
||||
|
||||
[dependencies]
|
||||
swc_atoms = {version = "0.2", path = "../../atoms"}
|
||||
@ -15,5 +15,5 @@ swc_ecma_ast = {version = "0.49.0", path = "../ast"}
|
||||
swc_ecma_visit = {version = "0.35.0", path = "../visit"}
|
||||
|
||||
[dev-dependencies]
|
||||
swc_ecma_parser = {version = "0.63.0", path = "../parser"}
|
||||
swc_ecma_parser = {version = "0.64.0", path = "../parser"}
|
||||
testing = {version = "0.11.0", path = "../../testing"}
|
||||
|
@ -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.21.0"
|
||||
version = "0.22.0"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@ -14,6 +14,6 @@ phf = {version = "0.8.0", features = ["macros"]}
|
||||
swc_atoms = {version = "0.2", path = "../../atoms"}
|
||||
swc_common = {version = "0.11.0", path = "../../common"}
|
||||
swc_ecma_ast = {version = "0.49.0", path = "../ast"}
|
||||
swc_ecma_parser = {version = "0.63.0", path = "../parser"}
|
||||
swc_ecma_parser = {version = "0.64.0", path = "../parser"}
|
||||
swc_ecma_utils = {version = "0.40.0", path = "../utils"}
|
||||
swc_ecma_visit = {version = "0.35.0", path = "../visit"}
|
||||
|
@ -5,7 +5,7 @@ documentation = "https://rustdoc.swc.rs/jsdoc/"
|
||||
edition = "2018"
|
||||
license = "Apache-2.0/MIT"
|
||||
name = "jsdoc"
|
||||
version = "0.31.0"
|
||||
version = "0.32.0"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@ -19,6 +19,6 @@ swc_common = {version = "0.11.0", path = "../../common"}
|
||||
anyhow = "1"
|
||||
dashmap = "4.0.2"
|
||||
swc_ecma_ast = {version = "0.49.0", path = "../ast"}
|
||||
swc_ecma_parser = {version = "0.63.0", path = "../parser"}
|
||||
swc_ecma_parser = {version = "0.64.0", path = "../parser"}
|
||||
testing = {version = "0.11.0", path = "../../testing"}
|
||||
walkdir = "2"
|
||||
|
@ -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.12.0"
|
||||
version = "0.13.0"
|
||||
|
||||
[features]
|
||||
debug = []
|
||||
@ -25,10 +25,10 @@ serde_regex = "1.1.0"
|
||||
swc_atoms = {version = "0.2", path = "../../atoms"}
|
||||
swc_common = {version = "0.11.0", path = "../../common"}
|
||||
swc_ecma_ast = {version = "0.49.0", path = "../ast"}
|
||||
swc_ecma_codegen = {version = "0.62.0", path = "../codegen"}
|
||||
swc_ecma_parser = {version = "0.63.0", path = "../parser"}
|
||||
swc_ecma_transforms = {version = "0.59.0", path = "../transforms/", features = ["optimization"]}
|
||||
swc_ecma_transforms_base = {version = "0.22.0", path = "../transforms/base"}
|
||||
swc_ecma_codegen = {version = "0.63.0", path = "../codegen"}
|
||||
swc_ecma_parser = {version = "0.64.0", path = "../parser"}
|
||||
swc_ecma_transforms = {version = "0.60.0", path = "../transforms/", features = ["optimization"]}
|
||||
swc_ecma_transforms_base = {version = "0.23.0", path = "../transforms/base"}
|
||||
swc_ecma_utils = {version = "0.40.0", path = "../utils"}
|
||||
swc_ecma_visit = {version = "0.35.0", path = "../visit"}
|
||||
|
||||
|
@ -7,10 +7,14 @@ 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.63.0"
|
||||
version = "0.64.0"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
|
||||
[features]
|
||||
default = []
|
||||
default = ["typescript"]
|
||||
typescript = []
|
||||
|
||||
[dependencies]
|
||||
either = {version = "1.4"}
|
||||
|
@ -127,6 +127,8 @@ pub enum Syntax {
|
||||
/// Standard
|
||||
#[serde(rename = "ecmascript")]
|
||||
Es(EsConfig),
|
||||
/// This variant requires the cargo feature `typescript` to be enabled.
|
||||
#[cfg(feature = "typescript")]
|
||||
#[serde(rename = "typescript")]
|
||||
Typescript(TsConfig),
|
||||
}
|
||||
@ -230,7 +232,14 @@ impl Syntax {
|
||||
}
|
||||
|
||||
/// Should we pare typescript?
|
||||
pub fn typescript(self) -> bool {
|
||||
#[cfg(not(feature = "typescript"))]
|
||||
pub const fn typescript(self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
/// Should we pare typescript?
|
||||
#[cfg(feature = "typescript")]
|
||||
pub const fn typescript(self) -> bool {
|
||||
match self {
|
||||
Syntax::Typescript(..) => true,
|
||||
_ => false,
|
||||
|
@ -546,6 +546,10 @@ impl<I: Tokens> Parser<I> {
|
||||
&mut self,
|
||||
token_to_eat: &'static Token,
|
||||
) -> PResult<Option<Box<TsType>>> {
|
||||
if !cfg!(feature = "typescript") {
|
||||
return Ok(Default::default());
|
||||
}
|
||||
|
||||
self.in_type().parse_with(|p| {
|
||||
if !p.input.eat(token_to_eat) {
|
||||
return Ok(None);
|
||||
@ -1191,6 +1195,10 @@ impl<I: Tokens> Parser<I> {
|
||||
readonly: bool,
|
||||
is_static: bool,
|
||||
) -> PResult<Option<TsIndexSignature>> {
|
||||
if !cfg!(feature = "typescript") {
|
||||
return Ok(Default::default());
|
||||
}
|
||||
|
||||
if !(is!(self, '[') && self.ts_look_ahead(|p| p.is_ts_unambiguously_index_signature())?) {
|
||||
return Ok(None);
|
||||
}
|
||||
@ -1576,6 +1584,10 @@ impl<I: Tokens> Parser<I> {
|
||||
}
|
||||
|
||||
fn try_parse_ts_tuple_element_name(&mut self) -> Option<Pat> {
|
||||
if !cfg!(feature = "typescript") {
|
||||
return Default::default();
|
||||
}
|
||||
|
||||
self.try_parse_ts(|p| {
|
||||
let start = cur_pos!(p);
|
||||
|
||||
@ -1752,6 +1764,10 @@ impl<I: Tokens> Parser<I> {
|
||||
|
||||
#[allow(clippy::vec_box)]
|
||||
fn parse_ts_tpl_type_elements(&mut self) -> PResult<(Vec<Box<TsType>>, Vec<TplElement>)> {
|
||||
if !cfg!(feature = "typescript") {
|
||||
return Ok(Default::default());
|
||||
}
|
||||
|
||||
trace_cur!(self, parse_tpl_elements);
|
||||
|
||||
let mut types = vec![];
|
||||
@ -1776,6 +1792,10 @@ impl<I: Tokens> Parser<I> {
|
||||
///
|
||||
/// Eats ')` at the end but does not eat `(` at start.
|
||||
fn parse_ts_binding_list_for_signature(&mut self) -> PResult<Vec<TsFnParam>> {
|
||||
if !cfg!(feature = "typescript") {
|
||||
return Ok(Default::default());
|
||||
}
|
||||
|
||||
debug_assert!(self.input.syntax().typescript());
|
||||
|
||||
let params = self.parse_formal_params()?;
|
||||
@ -1803,6 +1823,10 @@ impl<I: Tokens> Parser<I> {
|
||||
///
|
||||
/// Used for parsing return types.
|
||||
fn try_parse_ts_type_or_type_predicate_ann(&mut self) -> PResult<Option<TsTypeAnn>> {
|
||||
if !cfg!(feature = "typescript") {
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
if is!(self, ':') {
|
||||
self.parse_ts_type_or_type_predicate_ann(&tok!(':'))
|
||||
.map(Some)
|
||||
@ -1813,6 +1837,10 @@ impl<I: Tokens> Parser<I> {
|
||||
|
||||
/// `tsTryParseTypeAnnotation`
|
||||
pub(super) fn try_parse_ts_type_ann(&mut self) -> PResult<Option<TsTypeAnn>> {
|
||||
if !cfg!(feature = "typescript") {
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
if is!(self, ':') {
|
||||
let pos = cur_pos!(self);
|
||||
return self.parse_ts_type_ann(/* eat_colon */ true, pos).map(Some);
|
||||
@ -1823,11 +1851,19 @@ impl<I: Tokens> Parser<I> {
|
||||
|
||||
/// `tsTryParseType`
|
||||
fn try_parse_ts_type(&mut self) -> PResult<Option<Box<TsType>>> {
|
||||
if !cfg!(feature = "typescript") {
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
self.eat_then_parse_ts_type(&tok!(':'))
|
||||
}
|
||||
|
||||
/// `tsTryParseTypeParameters`
|
||||
pub(super) fn try_parse_ts_type_params(&mut self) -> PResult<Option<TsTypeParamDecl>> {
|
||||
if !cfg!(feature = "typescript") {
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
if is!(self, '<') {
|
||||
return self.parse_ts_type_params().map(Some);
|
||||
}
|
||||
@ -1837,6 +1873,9 @@ impl<I: Tokens> Parser<I> {
|
||||
/// `tsParseNonArrayType`
|
||||
#[allow(clippy::cognitive_complexity)]
|
||||
fn parse_ts_non_array_type(&mut self) -> PResult<Box<TsType>> {
|
||||
if !cfg!(feature = "typescript") {
|
||||
unreachable!()
|
||||
}
|
||||
trace_cur!(self, parse_ts_non_array_type);
|
||||
debug_assert!(self.input.syntax().typescript());
|
||||
|
||||
@ -2091,6 +2130,10 @@ impl<I: Tokens> Parser<I> {
|
||||
decorators: Vec<Decorator>,
|
||||
expr: Ident,
|
||||
) -> PResult<Option<Decl>> {
|
||||
if !cfg!(feature = "typescript") {
|
||||
return Ok(Default::default());
|
||||
}
|
||||
|
||||
let start = expr.span().lo();
|
||||
|
||||
match &*expr.sym {
|
||||
@ -2161,6 +2204,10 @@ impl<I: Tokens> Parser<I> {
|
||||
start: BytePos,
|
||||
decorators: Vec<Decorator>,
|
||||
) -> PResult<Option<Decl>> {
|
||||
if !self.syntax().typescript() {
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
assert!(
|
||||
!is!(self, "declare"),
|
||||
"try_parse_ts_declare should be called after eating `declare`"
|
||||
@ -2280,6 +2327,10 @@ impl<I: Tokens> Parser<I> {
|
||||
decorators: Vec<Decorator>,
|
||||
value: JsWord,
|
||||
) -> Option<Decl> {
|
||||
if !cfg!(feature = "typescript") {
|
||||
return None;
|
||||
}
|
||||
|
||||
self.try_parse_ts(|p| {
|
||||
let start = cur_pos!(p);
|
||||
let opt = p.parse_ts_decl(start, decorators, value, true)?;
|
||||
@ -2302,6 +2353,10 @@ impl<I: Tokens> Parser<I> {
|
||||
value: JsWord,
|
||||
next: bool,
|
||||
) -> PResult<Option<Decl>> {
|
||||
if !cfg!(feature = "typescript") {
|
||||
return Ok(Default::default());
|
||||
}
|
||||
|
||||
match value {
|
||||
js_word!("abstract") => {
|
||||
if next || (is!(self, "class") && !self.input.had_line_break_before_cur()) {
|
||||
@ -2405,6 +2460,10 @@ impl<I: Tokens> Parser<I> {
|
||||
&mut self,
|
||||
start: BytePos,
|
||||
) -> PResult<Option<ArrowExpr>> {
|
||||
if !cfg!(feature = "typescript") {
|
||||
return Ok(Default::default());
|
||||
}
|
||||
|
||||
let res = if is_one_of!(self, '<', JSXTagStart) {
|
||||
self.try_parse_ts(|p| {
|
||||
let type_params = p.parse_ts_type_params()?;
|
||||
|
@ -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.29.0"
|
||||
version = "0.30.0"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@ -22,13 +22,13 @@ string_enum = {version = "0.3.1", path = "../../macros/string_enum"}
|
||||
swc_atoms = {version = "0.2", path = "../../atoms"}
|
||||
swc_common = {version = "0.11.0", path = "../../common"}
|
||||
swc_ecma_ast = {version = "0.49.0", path = "../ast"}
|
||||
swc_ecma_transforms = {version = "0.59.0", path = "../transforms", features = ["compat", "proposal"]}
|
||||
swc_ecma_transforms = {version = "0.60.0", path = "../transforms", features = ["compat", "proposal"]}
|
||||
swc_ecma_utils = {version = "0.40.0", path = "../utils"}
|
||||
swc_ecma_visit = {version = "0.35.0", path = "../visit"}
|
||||
walkdir = "2"
|
||||
|
||||
[dev-dependencies]
|
||||
pretty_assertions = "0.6"
|
||||
swc_ecma_codegen = {version = "0.62.0", path = "../codegen"}
|
||||
swc_ecma_parser = {version = "0.63.0", path = "../parser"}
|
||||
swc_ecma_codegen = {version = "0.63.0", path = "../codegen"}
|
||||
swc_ecma_parser = {version = "0.64.0", path = "../parser"}
|
||||
testing = {version = "0.11.0", path = "../../testing"}
|
||||
|
@ -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.59.0"
|
||||
version = "0.60.0"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
@ -24,14 +24,14 @@ typescript = ["swc_ecma_transforms_typescript"]
|
||||
swc_atoms = {version = "0.2.0", path = "../../atoms"}
|
||||
swc_common = {version = "0.11.0", path = "../../common"}
|
||||
swc_ecma_ast = {version = "0.49.0", path = "../ast"}
|
||||
swc_ecma_parser = {version = "0.63.0", path = "../parser"}
|
||||
swc_ecma_transforms_base = {version = "0.22.0", path = "./base"}
|
||||
swc_ecma_transforms_compat = {version = "0.25.0", path = "./compat", optional = true}
|
||||
swc_ecma_transforms_module = {version = "0.26.0", path = "./module", optional = true}
|
||||
swc_ecma_transforms_optimization = {version = "0.29.0", path = "./optimization", optional = true}
|
||||
swc_ecma_transforms_proposal = {version = "0.26.0", path = "./proposal", optional = true}
|
||||
swc_ecma_transforms_react = {version = "0.27.0", path = "./react", optional = true}
|
||||
swc_ecma_transforms_typescript = {version = "0.28.0", path = "./typescript", optional = true}
|
||||
swc_ecma_parser = {version = "0.64.0", path = "../parser"}
|
||||
swc_ecma_transforms_base = {version = "0.23.0", path = "./base"}
|
||||
swc_ecma_transforms_compat = {version = "0.26.0", path = "./compat", optional = true}
|
||||
swc_ecma_transforms_module = {version = "0.27.0", path = "./module", optional = true}
|
||||
swc_ecma_transforms_optimization = {version = "0.30.0", path = "./optimization", optional = true}
|
||||
swc_ecma_transforms_proposal = {version = "0.27.0", path = "./proposal", optional = true}
|
||||
swc_ecma_transforms_react = {version = "0.28.0", path = "./react", optional = true}
|
||||
swc_ecma_transforms_typescript = {version = "0.29.0", path = "./typescript", optional = true}
|
||||
swc_ecma_utils = {version = "0.40.0", path = "../utils"}
|
||||
swc_ecma_visit = {version = "0.35.0", path = "../visit"}
|
||||
unicode-xid = "0.2"
|
||||
@ -39,8 +39,8 @@ unicode-xid = "0.2"
|
||||
[dev-dependencies]
|
||||
pretty_assertions = "0.6"
|
||||
sourcemap = "6"
|
||||
swc_ecma_codegen = {version = "0.62.0", path = "../codegen"}
|
||||
swc_ecma_transforms_testing = {version = "0.22.0", path = "./testing"}
|
||||
swc_ecma_codegen = {version = "0.63.0", path = "../codegen"}
|
||||
swc_ecma_transforms_testing = {version = "0.23.0", path = "./testing"}
|
||||
tempfile = "3"
|
||||
testing = {version = "0.11.0", path = "../../testing"}
|
||||
walkdir = "2"
|
||||
|
@ -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.22.3"
|
||||
version = "0.23.0"
|
||||
|
||||
[dependencies]
|
||||
fxhash = "0.2.1"
|
||||
@ -17,10 +17,10 @@ smallvec = "1.6.0"
|
||||
swc_atoms = {version = "0.2", path = "../../../atoms"}
|
||||
swc_common = {version = "0.11.0", path = "../../../common"}
|
||||
swc_ecma_ast = {version = "0.49.0", path = "../../ast"}
|
||||
swc_ecma_parser = {version = "0.63.0", path = "../../parser"}
|
||||
swc_ecma_parser = {version = "0.64.0", path = "../../parser"}
|
||||
swc_ecma_utils = {version = "0.40.0", path = "../../utils"}
|
||||
swc_ecma_visit = {version = "0.35.0", path = "../../visit"}
|
||||
|
||||
[dev-dependencies]
|
||||
swc_ecma_codegen = {version = "0.62.0", path = "../../codegen"}
|
||||
swc_ecma_codegen = {version = "0.63.0", path = "../../codegen"}
|
||||
testing = {version = "0.11.0", path = "../../../testing"}
|
||||
|
@ -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.8.0"
|
||||
version = "0.9.0"
|
||||
|
||||
[dependencies]
|
||||
swc_atoms = {version = "0.2.6", path = "../../../atoms"}
|
||||
swc_common = {version = "0.11.0", path = "../../../common"}
|
||||
swc_ecma_ast = {version = "0.49.0", path = "../../ast"}
|
||||
swc_ecma_transforms_base = {version = "0.22.0", path = "../base"}
|
||||
swc_ecma_transforms_base = {version = "0.23.0", path = "../base"}
|
||||
swc_ecma_utils = {version = "0.40.0", path = "../../utils"}
|
||||
swc_ecma_visit = {version = "0.35.0", path = "../../visit"}
|
||||
|
@ -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.25.2"
|
||||
version = "0.26.0"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
@ -21,13 +21,13 @@ smallvec = "1.6.0"
|
||||
swc_atoms = {version = "0.2.5", path = "../../../atoms"}
|
||||
swc_common = {version = "0.11.0", path = "../../../common"}
|
||||
swc_ecma_ast = {version = "0.49.0", path = "../../ast"}
|
||||
swc_ecma_transforms_base = {version = "0.22.0", path = "../base"}
|
||||
swc_ecma_transforms_classes = {version = "0.8.0", path = "../classes"}
|
||||
swc_ecma_transforms_base = {version = "0.23.0", path = "../base"}
|
||||
swc_ecma_transforms_classes = {version = "0.9.0", path = "../classes"}
|
||||
swc_ecma_transforms_macros = {version = "0.2.1", path = "../macros"}
|
||||
swc_ecma_utils = {version = "0.40.0", path = "../../utils"}
|
||||
swc_ecma_visit = {version = "0.35.0", path = "../../visit"}
|
||||
|
||||
[dev-dependencies]
|
||||
swc_ecma_parser = {version = "0.63.0", path = "../../parser"}
|
||||
swc_ecma_transforms_testing = {version = "0.22.0", path = "../testing"}
|
||||
swc_ecma_parser = {version = "0.64.0", path = "../../parser"}
|
||||
swc_ecma_transforms_testing = {version = "0.23.0", path = "../testing"}
|
||||
testing = {version = "0.11.0", path = "../../../testing"}
|
||||
|
@ -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.26.2"
|
||||
version = "0.27.0"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
@ -20,12 +20,12 @@ swc_atoms = {version = "0.2", path = "../../../atoms"}
|
||||
swc_common = {version = "0.11.0", path = "../../../common"}
|
||||
swc_ecma_ast = {version = "0.49.0", path = "../../ast"}
|
||||
swc_ecma_loader = {version = "0.11.0", path = "../../loader", features = ["node"]}
|
||||
swc_ecma_parser = {version = "0.63.0", path = "../../parser"}
|
||||
swc_ecma_transforms_base = {version = "0.22.0", path = "../base"}
|
||||
swc_ecma_parser = {version = "0.64.0", path = "../../parser"}
|
||||
swc_ecma_transforms_base = {version = "0.23.0", path = "../base"}
|
||||
swc_ecma_utils = {version = "0.40.0", path = "../../utils"}
|
||||
swc_ecma_visit = {version = "0.35.0", path = "../../visit"}
|
||||
|
||||
[dev-dependencies]
|
||||
swc_ecma_transforms_compat = {version = "0.25.0", path = "../compat"}
|
||||
swc_ecma_transforms_testing = {version = "0.22.0", path = "../testing/"}
|
||||
swc_ecma_transforms_compat = {version = "0.26.0", path = "../compat"}
|
||||
swc_ecma_transforms_testing = {version = "0.23.0", path = "../testing/"}
|
||||
testing = {version = "0.11.0", path = "../../../testing/"}
|
||||
|
@ -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.29.1"
|
||||
version = "0.30.0"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
@ -20,16 +20,16 @@ serde_json = "1.0.61"
|
||||
swc_atoms = {version = "0.2", path = "../../../atoms"}
|
||||
swc_common = {version = "0.11.0", path = "../../../common"}
|
||||
swc_ecma_ast = {version = "0.49.0", path = "../../ast"}
|
||||
swc_ecma_parser = {version = "0.63.0", path = "../../parser"}
|
||||
swc_ecma_transforms_base = {version = "0.22.0", path = "../base"}
|
||||
swc_ecma_parser = {version = "0.64.0", path = "../../parser"}
|
||||
swc_ecma_transforms_base = {version = "0.23.0", path = "../base"}
|
||||
swc_ecma_utils = {version = "0.40.0", path = "../../utils"}
|
||||
swc_ecma_visit = {version = "0.35.0", path = "../../visit"}
|
||||
|
||||
[dev-dependencies]
|
||||
swc_ecma_transforms_compat = {version = "0.25.0", path = "../compat"}
|
||||
swc_ecma_transforms_module = {version = "0.26.0", path = "../module"}
|
||||
swc_ecma_transforms_proposal = {version = "0.26.0", path = "../proposal"}
|
||||
swc_ecma_transforms_react = {version = "0.27.0", path = "../react"}
|
||||
swc_ecma_transforms_testing = {version = "0.22.0", path = "../testing"}
|
||||
swc_ecma_transforms_typescript = {version = "0.28.0", path = "../typescript"}
|
||||
swc_ecma_transforms_compat = {version = "0.26.0", path = "../compat"}
|
||||
swc_ecma_transforms_module = {version = "0.27.0", path = "../module"}
|
||||
swc_ecma_transforms_proposal = {version = "0.27.0", path = "../proposal"}
|
||||
swc_ecma_transforms_react = {version = "0.28.0", path = "../react"}
|
||||
swc_ecma_transforms_testing = {version = "0.23.0", path = "../testing"}
|
||||
swc_ecma_transforms_typescript = {version = "0.29.0", path = "../typescript"}
|
||||
testing = {version = "0.11.0", path = "../../../testing"}
|
||||
|
@ -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.26.1"
|
||||
version = "0.27.0"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@ -23,13 +23,13 @@ swc_atoms = {version = "0.2", path = "../../../atoms"}
|
||||
swc_common = {version = "0.11.0", path = "../../../common"}
|
||||
swc_ecma_ast = {version = "0.49.0", path = "../../ast"}
|
||||
swc_ecma_loader = {version = "0.11.0", path = "../../loader", optional = true}
|
||||
swc_ecma_parser = {version = "0.63.0", path = "../../parser"}
|
||||
swc_ecma_transforms_base = {version = "0.22.0", path = "../base"}
|
||||
swc_ecma_transforms_classes = {version = "0.8.0", path = "../classes"}
|
||||
swc_ecma_parser = {version = "0.64.0", path = "../../parser"}
|
||||
swc_ecma_transforms_base = {version = "0.23.0", path = "../base"}
|
||||
swc_ecma_transforms_classes = {version = "0.9.0", path = "../classes"}
|
||||
swc_ecma_utils = {version = "0.40.0", path = "../../utils"}
|
||||
swc_ecma_visit = {version = "0.35.0", path = "../../visit"}
|
||||
|
||||
[dev-dependencies]
|
||||
swc_ecma_transforms_compat = {version = "0.25.0", path = "../compat"}
|
||||
swc_ecma_transforms_module = {version = "0.26.0", path = "../module"}
|
||||
swc_ecma_transforms_testing = {version = "0.22.0", path = "../testing"}
|
||||
swc_ecma_transforms_compat = {version = "0.26.0", path = "../compat"}
|
||||
swc_ecma_transforms_module = {version = "0.27.0", path = "../module"}
|
||||
swc_ecma_transforms_testing = {version = "0.23.0", path = "../testing"}
|
||||
|
@ -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.27.0"
|
||||
version = "0.28.0"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
@ -22,14 +22,14 @@ string_enum = {version = "0.3.1", path = "../../../macros/string_enum"}
|
||||
swc_atoms = {version = "0.2", path = "../../../atoms"}
|
||||
swc_common = {version = "0.11.0", path = "../../../common"}
|
||||
swc_ecma_ast = {version = "0.49.0", path = "../../ast"}
|
||||
swc_ecma_parser = {version = "0.63.0", path = "../../parser"}
|
||||
swc_ecma_transforms_base = {version = "0.22.0", path = "../base"}
|
||||
swc_ecma_parser = {version = "0.64.0", path = "../../parser"}
|
||||
swc_ecma_transforms_base = {version = "0.23.0", path = "../base"}
|
||||
swc_ecma_utils = {version = "0.40.0", path = "../../utils"}
|
||||
swc_ecma_visit = {version = "0.35.0", path = "../../visit"}
|
||||
|
||||
[dev-dependencies]
|
||||
swc_ecma_codegen = {version = "0.62.0", path = "../../codegen/"}
|
||||
swc_ecma_transforms_compat = {version = "0.25.0", path = "../compat/"}
|
||||
swc_ecma_transforms_module = {version = "0.26.0", path = "../module"}
|
||||
swc_ecma_transforms_testing = {version = "0.22.0", path = "../testing/"}
|
||||
swc_ecma_codegen = {version = "0.63.0", path = "../../codegen/"}
|
||||
swc_ecma_transforms_compat = {version = "0.26.0", path = "../compat/"}
|
||||
swc_ecma_transforms_module = {version = "0.27.0", path = "../module"}
|
||||
swc_ecma_transforms_testing = {version = "0.23.0", path = "../testing/"}
|
||||
testing = {version = "0.11.0", path = "../../../testing"}
|
||||
|
@ -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.22.0"
|
||||
version = "0.23.0"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@ -16,9 +16,9 @@ serde = "1"
|
||||
serde_json = "1"
|
||||
swc_common = {version = "0.11.0", path = "../../../common"}
|
||||
swc_ecma_ast = {version = "0.49.0", path = "../../ast"}
|
||||
swc_ecma_codegen = {version = "0.62.0", path = "../../codegen"}
|
||||
swc_ecma_parser = {version = "0.63.0", path = "../../parser"}
|
||||
swc_ecma_transforms_base = {version = "0.22.0", path = "../base"}
|
||||
swc_ecma_codegen = {version = "0.63.0", path = "../../codegen"}
|
||||
swc_ecma_parser = {version = "0.64.0", path = "../../parser"}
|
||||
swc_ecma_transforms_base = {version = "0.23.0", path = "../base"}
|
||||
swc_ecma_utils = {version = "0.40.0", path = "../../utils"}
|
||||
swc_ecma_visit = {version = "0.35.0", path = "../../visit"}
|
||||
tempfile = "3.1.0"
|
||||
|
@ -6,7 +6,7 @@ edition = "2018"
|
||||
license = "Apache-2.0/MIT"
|
||||
name = "swc_ecma_transforms_typescript"
|
||||
repository = "https://github.com/swc-project/swc.git"
|
||||
version = "0.28.2"
|
||||
version = "0.29.0"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
@ -15,16 +15,16 @@ serde = {version = "1.0.118", features = ["derive"]}
|
||||
swc_atoms = {version = "0.2", path = "../../../atoms"}
|
||||
swc_common = {version = "0.11.0", path = "../../../common"}
|
||||
swc_ecma_ast = {version = "0.49.0", path = "../../ast"}
|
||||
swc_ecma_parser = {version = "0.63.0", path = "../../parser"}
|
||||
swc_ecma_transforms_base = {version = "0.22.0", path = "../base"}
|
||||
swc_ecma_parser = {version = "0.64.0", path = "../../parser"}
|
||||
swc_ecma_transforms_base = {version = "0.23.0", path = "../base"}
|
||||
swc_ecma_utils = {version = "0.40.0", path = "../../utils"}
|
||||
swc_ecma_visit = {version = "0.35.0", path = "../../visit"}
|
||||
|
||||
[dev-dependencies]
|
||||
swc_ecma_codegen = {version = "0.62.0", path = "../../codegen"}
|
||||
swc_ecma_transforms_compat = {version = "0.25.0", path = "../compat"}
|
||||
swc_ecma_transforms_module = {version = "0.26.0", path = "../module"}
|
||||
swc_ecma_transforms_proposal = {version = "0.26.0", path = "../proposal/"}
|
||||
swc_ecma_transforms_testing = {version = "0.22.0", path = "../testing"}
|
||||
swc_ecma_codegen = {version = "0.63.0", path = "../../codegen"}
|
||||
swc_ecma_transforms_compat = {version = "0.26.0", path = "../compat"}
|
||||
swc_ecma_transforms_module = {version = "0.27.0", path = "../module"}
|
||||
swc_ecma_transforms_proposal = {version = "0.27.0", path = "../proposal/"}
|
||||
swc_ecma_transforms_testing = {version = "0.23.0", path = "../testing"}
|
||||
testing = {version = "0.11.0", path = "../../../testing"}
|
||||
walkdir = "2.3.1"
|
||||
|
@ -129,17 +129,18 @@ var load = __spack_require__.bind(void 0, function(module, exports) {
|
||||
// don't natively support it.
|
||||
var IteratorPrototype = {
|
||||
};
|
||||
IteratorPrototype[iteratorSymbol] = function() {
|
||||
define(IteratorPrototype, iteratorSymbol, function() {
|
||||
return this;
|
||||
};
|
||||
});
|
||||
var getProto = Object.getPrototypeOf;
|
||||
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
||||
if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) // This environment has a native %IteratorPrototype%; use it instead
|
||||
// of the polyfill.
|
||||
IteratorPrototype = NativeIteratorPrototype;
|
||||
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
||||
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
||||
GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
||||
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
||||
define(Gp, "constructor", GeneratorFunctionPrototype);
|
||||
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
||||
GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");
|
||||
// Helper for defining the .next, .throw, and .return methods of the
|
||||
// Iterator interface in terms of a single ._invoke method.
|
||||
@ -231,9 +232,9 @@ var load = __spack_require__.bind(void 0, function(module, exports) {
|
||||
this._invoke = enqueue;
|
||||
}
|
||||
defineIteratorMethods(AsyncIterator.prototype);
|
||||
AsyncIterator.prototype[asyncIteratorSymbol] = function() {
|
||||
define(AsyncIterator.prototype, asyncIteratorSymbol, function() {
|
||||
return this;
|
||||
};
|
||||
});
|
||||
exports1.AsyncIterator = AsyncIterator;
|
||||
// Note that simple async functions are implemented on top of
|
||||
// AsyncIterator objects; they just return a Promise for the value of
|
||||
@ -371,12 +372,12 @@ var load = __spack_require__.bind(void 0, function(module, exports) {
|
||||
// iterator prototype chain incorrectly implement this, causing the Generator
|
||||
// object to not be returned from this call. This ensures that doesn't happen.
|
||||
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
||||
Gp[iteratorSymbol] = function() {
|
||||
define(Gp, iteratorSymbol, function() {
|
||||
return this;
|
||||
};
|
||||
Gp.toString = function() {
|
||||
});
|
||||
define(Gp, "toString", function() {
|
||||
return "[object Generator]";
|
||||
};
|
||||
});
|
||||
function pushTryEntry(locs) {
|
||||
var entry = {
|
||||
tryLoc: locs[0]
|
||||
@ -607,14 +608,16 @@ var load = __spack_require__.bind(void 0, function(module, exports) {
|
||||
} catch (accidentalStrictMode) {
|
||||
// This module should not be running in strict mode, so the above
|
||||
// assignment should always work unless something is misconfigured. Just
|
||||
// in case runtime.js accidentally runs in strict mode, we can escape
|
||||
// in case runtime.js accidentally runs in strict mode, in modern engines
|
||||
// we can explicitly access globalThis. In older engines we can escape
|
||||
// strict mode using a global Function call. This could conceivably fail
|
||||
// if a Content Security Policy forbids using Function, but in that case
|
||||
// the proper solution is to fix the accidental strict mode problem. If
|
||||
// you've misconfigured your bundler to force strict mode and applied a
|
||||
// CSP to forbid Function, and you're not willing to fix either of those
|
||||
// problems, please detail your unique predicament in a GitHub issue.
|
||||
Function("r", "regeneratorRuntime = r")(runtime);
|
||||
if (typeof globalThis === "object") globalThis.regeneratorRuntime = runtime;
|
||||
else Function("r", "regeneratorRuntime = r")(runtime);
|
||||
}
|
||||
});
|
||||
var { default: regeneratorRuntime } = load();
|
||||
|
Loading…
Reference in New Issue
Block a user