chore: Fix typo (#2472)

This commit is contained in:
Donny/강동윤 2021-10-19 17:25:57 +09:00 committed by GitHub
parent ee880d63ae
commit 123c1f5d02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
95 changed files with 1498 additions and 693 deletions

5
.husky/pre-commit Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
# TODO: lint-staged
# cargo fmt --all -- --check

5
.husky/pre-push Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
# yarn run cspell "**/src/**/*.rs"
cargo fmt --all -- --check

View File

@ -18,4 +18,6 @@
"editor.formatOnSave": true,
"git.ignoreLimitWarning": true,
"eslint.enable": false,
"cSpell.allowCompoundWords": true,
"cSpell.caseSensitive": true,
}

134
Cargo.lock generated
View File

@ -930,13 +930,13 @@ dependencies = [
[[package]]
name = "jsdoc"
version = "0.43.0"
version = "0.44.0"
dependencies = [
"anyhow",
"dashmap",
"nom",
"serde",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_ecma_ast",
"swc_ecma_parser",
@ -1192,7 +1192,7 @@ dependencies = [
"serde",
"serde_json",
"swc",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_bundler",
"swc_common",
"swc_ecma_ast",
@ -1959,9 +1959,9 @@ dependencies = [
[[package]]
name = "reqwest"
version = "0.11.5"
version = "0.11.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51c732d463dd300362ffb44b7b125f299c23d2990411a4253824630ebc7467fb"
checksum = "66d2927ca2f685faf0fc620ac4834690d29e7abb153add10f5812eef20b5e280"
dependencies = [
"base64 0.13.0",
"bytes",
@ -2324,7 +2324,7 @@ checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c"
[[package]]
name = "swc"
version = "0.73.1"
version = "0.74.0"
dependencies = [
"ahash",
"anyhow",
@ -2339,7 +2339,7 @@ dependencies = [
"serde",
"serde_json",
"sourcemap",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_ecma_ast",
"swc_ecma_codegen",
@ -2365,6 +2365,8 @@ dependencies = [
[[package]]
name = "swc_atoms"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a20e0ff436c9967b5cbafbc0872f384fef5be6f9913ce92fb5f017427e95c7e"
dependencies = [
"string_cache",
"string_cache_codegen",
@ -2372,9 +2374,7 @@ dependencies = [
[[package]]
name = "swc_atoms"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a20e0ff436c9967b5cbafbc0872f384fef5be6f9913ce92fb5f017427e95c7e"
version = "0.2.9"
dependencies = [
"string_cache",
"string_cache_codegen",
@ -2386,7 +2386,7 @@ version = "0.1.0"
dependencies = [
"serde",
"serde_json",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_node_base",
]
@ -2403,7 +2403,7 @@ dependencies = [
"serde",
"serde_json",
"swc",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_babel_ast",
"swc_babel_visit",
"swc_common",
@ -2422,14 +2422,14 @@ version = "0.1.0"
dependencies = [
"serde",
"serde_json",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_babel_ast",
"swc_visit",
]
[[package]]
name = "swc_bundler"
version = "0.73.1"
version = "0.74.0"
dependencies = [
"ahash",
"anyhow",
@ -2449,7 +2449,7 @@ dependencies = [
"reqwest",
"retain_mut",
"sha-1",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_ecma_ast",
"swc_ecma_codegen",
@ -2471,7 +2471,7 @@ dependencies = [
[[package]]
name = "swc_common"
version = "0.14.0"
version = "0.14.1"
dependencies = [
"ahash",
"arbitrary",
@ -2512,12 +2512,12 @@ dependencies = [
[[package]]
name = "swc_css_ast"
version = "0.18.0"
version = "0.18.1"
dependencies = [
"is-macro",
"serde",
"string_enum",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
]
@ -2527,7 +2527,7 @@ version = "0.18.0"
dependencies = [
"auto_impl",
"bitflags",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_css_ast",
"swc_css_codegen_macros",
@ -2555,7 +2555,7 @@ dependencies = [
"lexical",
"serde",
"serde_json",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_css_ast",
"swc_css_visit",
@ -2567,7 +2567,7 @@ dependencies = [
name = "swc_css_utils"
version = "0.15.0"
dependencies = [
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_css_ast",
"swc_css_visit",
@ -2577,7 +2577,7 @@ dependencies = [
name = "swc_css_visit"
version = "0.17.0"
dependencies = [
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_css_ast",
"swc_visit",
@ -2593,20 +2593,20 @@ dependencies = [
"serde",
"serde_json",
"string_enum",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
]
[[package]]
name = "swc_ecma_codegen"
version = "0.76.0"
version = "0.77.0"
dependencies = [
"bitflags",
"memchr",
"num-bigint",
"once_cell",
"sourcemap",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_ecma_ast",
"swc_ecma_codegen_macros",
@ -2629,9 +2629,9 @@ dependencies = [
[[package]]
name = "swc_ecma_dep_graph"
version = "0.43.0"
version = "0.44.0"
dependencies = [
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_ecma_ast",
"swc_ecma_parser",
@ -2641,10 +2641,10 @@ dependencies = [
[[package]]
name = "swc_ecma_ext_transforms"
version = "0.33.0"
version = "0.34.0"
dependencies = [
"phf",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_ecma_ast",
"swc_ecma_parser",
@ -2666,7 +2666,7 @@ dependencies = [
"regex",
"serde",
"serde_json",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_ecma_ast",
"swc_ecma_visit",
@ -2676,7 +2676,7 @@ dependencies = [
[[package]]
name = "swc_ecma_minifier"
version = "0.42.2"
version = "0.43.0"
dependencies = [
"ansi_term 0.12.1",
"anyhow",
@ -2690,7 +2690,7 @@ dependencies = [
"serde",
"serde_json",
"serde_regex",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_ecma_ast",
"swc_ecma_codegen",
@ -2708,7 +2708,7 @@ dependencies = [
[[package]]
name = "swc_ecma_parser"
version = "0.74.0"
version = "0.75.0"
dependencies = [
"either",
"enum_kind",
@ -2719,7 +2719,7 @@ dependencies = [
"serde",
"serde_json",
"smallvec 1.7.0",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_ecma_ast",
"swc_ecma_visit",
@ -2733,7 +2733,7 @@ dependencies = [
[[package]]
name = "swc_ecma_preset_env"
version = "0.57.1"
version = "0.58.0"
dependencies = [
"ahash",
"dashmap",
@ -2745,7 +2745,7 @@ dependencies = [
"serde_json",
"st-map",
"string_enum",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_ecma_ast",
"swc_ecma_codegen",
@ -2759,11 +2759,11 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms"
version = "0.86.1"
version = "0.87.0"
dependencies = [
"pretty_assertions 0.6.1",
"sourcemap",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_ecma_ast",
"swc_ecma_codegen",
@ -2786,14 +2786,14 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_base"
version = "0.39.1"
version = "0.40.0"
dependencies = [
"once_cell",
"phf",
"rayon",
"scoped-tls",
"smallvec 1.7.0",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_ecma_ast",
"swc_ecma_codegen",
@ -2806,9 +2806,9 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_classes"
version = "0.25.1"
version = "0.26.0"
dependencies = [
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_ecma_ast",
"swc_ecma_transforms_base",
@ -2818,7 +2818,7 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_compat"
version = "0.44.3"
version = "0.45.0"
dependencies = [
"ahash",
"arrayvec",
@ -2829,7 +2829,7 @@ dependencies = [
"rayon",
"serde",
"smallvec 1.7.0",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_ecma_ast",
"swc_ecma_parser",
@ -2855,7 +2855,7 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_module"
version = "0.50.1"
version = "0.51.0"
dependencies = [
"Inflector",
"ahash",
@ -2863,7 +2863,7 @@ dependencies = [
"indexmap",
"pathdiff",
"serde",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_ecma_ast",
"swc_ecma_loader",
@ -2878,7 +2878,7 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_optimization"
version = "0.56.1"
version = "0.57.0"
dependencies = [
"ahash",
"dashmap",
@ -2887,7 +2887,7 @@ dependencies = [
"rayon",
"retain_mut",
"serde_json",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_ecma_ast",
"swc_ecma_parser",
@ -2907,13 +2907,13 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_proposal"
version = "0.50.1"
version = "0.51.0"
dependencies = [
"either",
"serde",
"serde_json",
"smallvec 1.7.0",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_ecma_ast",
"swc_ecma_loader",
@ -2931,7 +2931,7 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_react"
version = "0.52.1"
version = "0.53.0"
dependencies = [
"ahash",
"base64 0.13.0",
@ -2942,7 +2942,7 @@ dependencies = [
"serde",
"sha-1",
"string_enum",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_ecma_ast",
"swc_ecma_codegen",
@ -2959,7 +2959,7 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_testing"
version = "0.40.1"
version = "0.41.0"
dependencies = [
"ansi_term 0.12.1",
"anyhow",
@ -2978,10 +2978,10 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_typescript"
version = "0.53.1"
version = "0.54.0"
dependencies = [
"serde",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_ecma_ast",
"swc_ecma_codegen",
@ -3005,7 +3005,7 @@ dependencies = [
"once_cell",
"rayon",
"scoped-tls",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_ecma_ast",
"swc_ecma_visit",
@ -3018,7 +3018,7 @@ name = "swc_ecma_visit"
version = "0.41.0"
dependencies = [
"num-bigint",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_ecma_ast",
"swc_visit",
@ -3026,7 +3026,7 @@ dependencies = [
[[package]]
name = "swc_ecmascript"
version = "0.78.1"
version = "0.79.0"
dependencies = [
"swc_ecma_ast",
"swc_ecma_codegen",
@ -3081,7 +3081,7 @@ dependencies = [
"serde_json",
"string_enum",
"swc",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_bundler",
"swc_common",
"swc_ecma_ast",
@ -3106,7 +3106,7 @@ dependencies = [
"anyhow",
"serde",
"serde_json",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_ecma_ast",
"swc_ecma_visit",
@ -3114,14 +3114,14 @@ dependencies = [
[[package]]
name = "swc_plugin_runner"
version = "0.11.0"
version = "0.12.0"
dependencies = [
"abi_stable",
"anyhow",
"libloading",
"serde",
"serde_json",
"swc_atoms 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"swc_atoms 0.2.8",
"swc_common",
"swc_ecma_ast",
"swc_ecma_codegen",
@ -3132,10 +3132,10 @@ dependencies = [
[[package]]
name = "swc_plugin_testing"
version = "0.12.0"
version = "0.13.0"
dependencies = [
"anyhow",
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_ecma_ast",
"swc_ecma_codegen",
@ -3148,7 +3148,7 @@ dependencies = [
name = "swc_stylis"
version = "0.17.0"
dependencies = [
"swc_atoms 0.2.8",
"swc_atoms 0.2.9",
"swc_common",
"swc_css_ast",
"swc_css_codegen",
@ -3160,7 +3160,7 @@ dependencies = [
[[package]]
name = "swc_visit"
version = "0.2.7"
version = "0.2.8"
dependencies = [
"either",
"swc_visit_macros",
@ -3214,7 +3214,7 @@ dependencies = [
[[package]]
name = "testing"
version = "0.15.0"
version = "0.15.1"
dependencies = [
"ansi_term 0.12.1",
"difference",

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.73.1"
version = "0.74.0"
[lib]
name = "swc"
@ -61,13 +61,13 @@ 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.55.0", path = "./ecmascript/ast"}
swc_ecma_codegen = {version = "0.76.0", path = "./ecmascript/codegen"}
swc_ecma_ext_transforms = {version = "0.33.0", path = "./ecmascript/ext-transforms"}
swc_ecma_codegen = {version = "0.77.0", path = "./ecmascript/codegen"}
swc_ecma_ext_transforms = {version = "0.34.0", path = "./ecmascript/ext-transforms"}
swc_ecma_loader = {version = "0.22.0", path = "./ecmascript/loader", features = ["lru", "node", "tsc"]}
swc_ecma_minifier = {version = "0.42.2", path = "./ecmascript/minifier"}
swc_ecma_parser = {version = "0.74.0", path = "./ecmascript/parser"}
swc_ecma_preset_env = {version = "0.57.1", path = "./ecmascript/preset-env"}
swc_ecma_transforms = {version = "0.86.1", path = "./ecmascript/transforms", features = [
swc_ecma_minifier = {version = "0.43.0", path = "./ecmascript/minifier"}
swc_ecma_parser = {version = "0.75.0", path = "./ecmascript/parser"}
swc_ecma_preset_env = {version = "0.58.0", path = "./ecmascript/preset-env"}
swc_ecma_transforms = {version = "0.87.0", path = "./ecmascript/transforms", features = [
"compat",
"module",
"optimization",
@ -75,12 +75,12 @@ swc_ecma_transforms = {version = "0.86.1", path = "./ecmascript/transforms", fea
"react",
"typescript",
]}
swc_ecma_transforms_base = {version = "0.39.1", path = "./ecmascript/transforms/base"}
swc_ecma_transforms_compat = {version = "0.44.1", path = "./ecmascript/transforms/compat"}
swc_ecma_transforms_optimization = {version = "0.56.1", path = "./ecmascript/transforms/optimization"}
swc_ecma_transforms_base = {version = "0.40.0", path = "./ecmascript/transforms/base"}
swc_ecma_transforms_compat = {version = "0.45.0", path = "./ecmascript/transforms/compat"}
swc_ecma_transforms_optimization = {version = "0.57.0", path = "./ecmascript/transforms/optimization"}
swc_ecma_utils = {version = "0.48.0", path = "./ecmascript/utils"}
swc_ecma_visit = {version = "0.41.0", path = "./ecmascript/visit"}
swc_ecmascript = {version = "0.78.1", path = "./ecmascript"}
swc_ecmascript = {version = "0.79.0", path = "./ecmascript"}
swc_visit = {version = "0.2.3", path = "./visit"}
tracing = "0.1.28"

View File

@ -7,7 +7,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_atoms"
repository = "https://github.com/swc-project/swc.git"
version = "0.2.8"
version = "0.2.9"
[dependencies]
string_cache = "0.8.2"

View File

@ -1,7 +1,7 @@
//! [JsWord] is an interened string.
//! [JsWord] is an interned string.
//!
//! This type should be used instead of [String] for values, because lots of
//! values are duplicated. For example, if an identifer is named `myVariable`,
//! values are duplicated. For example, if an identifier is named `myVariable`,
//! there will be lots of identifier usages with the value `myVariable`.
//!
//! This type

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.73.1"
version = "0.74.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
@ -39,11 +39,11 @@ 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.55.0", path = "../ecmascript/ast"}
swc_ecma_codegen = {version = "0.76.0", path = "../ecmascript/codegen"}
swc_ecma_codegen = {version = "0.77.0", path = "../ecmascript/codegen"}
swc_ecma_loader = {version = "0.22.0", path = "../ecmascript/loader"}
swc_ecma_parser = {version = "0.74.0", path = "../ecmascript/parser"}
swc_ecma_transforms_base = {version = "0.39.1", path = "../ecmascript/transforms/base"}
swc_ecma_transforms_optimization = {version = "0.56.1", path = "../ecmascript/transforms/optimization"}
swc_ecma_parser = {version = "0.75.0", path = "../ecmascript/parser"}
swc_ecma_transforms_base = {version = "0.40.0", path = "../ecmascript/transforms/base"}
swc_ecma_transforms_optimization = {version = "0.57.0", path = "../ecmascript/transforms/optimization"}
swc_ecma_utils = {version = "0.48.0", path = "../ecmascript/utils"}
swc_ecma_visit = {version = "0.41.0", path = "../ecmascript/visit"}
tracing = "0.1.28"
@ -55,8 +55,8 @@ path-clean = "=0.1.0"
reqwest = {version = "0.11.4", features = ["blocking"]}
sha-1 = "0.9"
swc_ecma_loader = {version = "0.22.0", path = "../ecmascript/loader", features = ["node", "lru"]}
swc_ecma_transforms_react = {version = "0.52.1", path = "../ecmascript/transforms/react"}
swc_ecma_transforms_typescript = {version = "0.53.1", path = "../ecmascript/transforms/typescript"}
swc_ecma_transforms_react = {version = "0.53.0", path = "../ecmascript/transforms/react"}
swc_ecma_transforms_typescript = {version = "0.54.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

@ -137,7 +137,7 @@ fn wrap_module(
},
});
// var load = __spack_require__.bind(void 0, moduleDecl)
// var load = __swcpack_require__.bind(void 0, moduleDecl)
let load_var_init = Stmt::Decl(Decl::Var(VarDecl {
span: DUMMY_SP,
kind: VarDeclKind::Var,
@ -147,9 +147,12 @@ fn wrap_module(
name: Pat::Ident(load_var.clone().into()),
init: Some(Box::new(Expr::Call(CallExpr {
span: DUMMY_SP,
callee: Ident::new("__spack_require__".into(), DUMMY_SP.with_ctxt(helper_ctxt))
.make_member(Ident::new("bind".into(), DUMMY_SP))
.as_callee(),
callee: Ident::new(
"__swcpack_require__".into(),
DUMMY_SP.with_ctxt(helper_ctxt),
)
.make_member(Ident::new("bind".into(), DUMMY_SP))
.as_callee(),
args: vec![undefined(DUMMY_SP).as_arg(), module_fn.as_arg()],
type_args: None,
}))),
@ -241,7 +244,7 @@ where
let load_var = self.bundler.make_cjs_load_var(&dep_module, i.span);
// Replace import progress from 'progress';
// Side effech import
// Side effect import
if i.specifiers.is_empty() {
self.replaced = true;
*node = ModuleItem::Stmt(

View File

@ -47,7 +47,7 @@ where
v.found
};
let mut addtional_items = vec![];
let mut additional_items = vec![];
module.iter().for_each(|(module_id, item)| {
match item {
@ -73,7 +73,7 @@ where
exported: Some(exported.clone()),
is_type_only: false,
});
addtional_items.push((
additional_items.push((
module_id,
ModuleItem::ModuleDecl(ModuleDecl::ExportNamed(
NamedExport {
@ -101,7 +101,7 @@ where
};
let mut module = module.fold_with(&mut export_visitor);
module.append_all(addtional_items);
module.append_all(additional_items);
let return_stmt = Stmt::Return(ReturnStmt {
span: DUMMY_SP,

View File

@ -101,7 +101,7 @@ where
let all_deps_of_entry =
self.collect_all_deps(&ctx.graph, entry_id, &mut Default::default());
tracing::debug!("Merging dependenciess: {:?}", all_deps_of_entry);
tracing::debug!("Merging dependencies: {:?}", all_deps_of_entry);
let deps = all_deps_of_entry.iter().map(|id| {
let dep_info = self.scope.get_module(*id).unwrap();
@ -223,7 +223,7 @@ where
));
}
// We have to exlcude some ids because there are already declared.
// We have to exclude some ids because there are already declared.
// See https://github.com/denoland/deno/issues/8725
//
// Let's say D is a dependency which contains export * from './foo';
@ -539,10 +539,6 @@ where
module = self.wrap_esm(ctx, info.id, module)?;
}
// if !is_entry {
// module = module.fold_with(&mut Unexporter);
// }
Ok(module)
}
@ -620,9 +616,9 @@ where
{
let esm_id =
self.scope.wrapped_esm_id(src.module_id).expect(
"If a namespace impoet specifier is preserved, it \
means failutre of deblobbing and as a result \
module should be marked as wrpaped esm",
"If a namespace import specifier is preserved, it \
means failure of deblobbing and as a result \
module should be marked as wrapped esm",
);
new.push(
esm_id
@ -647,7 +643,7 @@ where
// One item is `const local_default = expr` and another one is
// `export { local_default as default }`.
//
// To allow using identifier of the declaration in the originsl module, we
// To allow using identifier of the declaration in the original module, we
// create `const local_default = orig_ident` if original identifier exists.
let local =
@ -1072,8 +1068,9 @@ where
}
None => {
unreachable!(
"Modules rexported with `export * as foo from \
'./foo'` should be marked as a wrapped esm"
"Modules reexported with `export * as foo \
from './foo'` should be marked as a wrapped \
esm"
)
}
}
@ -1178,9 +1175,9 @@ where
{
let esm_id =
self.scope.wrapped_esm_id(src.module_id).expect(
"If a namespace impoet specifier is preserved, it \
means failutre of deblobbing and as a result \
module should be marked as wrpaped esm",
"If a namespace import specifier is preserved, it \
means failure of deblobbing and as a result \
module should be marked as wrapped esm",
);
vars.push((
module_id,

View File

@ -7,7 +7,7 @@ use swc_ecma_utils::{drop_span, prepend_stmts};
#[derive(Debug, Default)]
pub(crate) struct Helpers {
/// `__spack_require__`
/// `__swcpack_require__`
pub require: AtomicBool,
}
@ -49,7 +49,7 @@ macro_rules! define {
}
define!(require {
build: build_spack_require
build: build_swcpack_require
});
impl Helpers {
@ -63,7 +63,7 @@ impl Helpers {
let mut buf = vec![];
if self.require.load(SeqCst) {
build_spack_require(&mut buf);
build_swcpack_require(&mut buf);
}
prepend_stmts(to, buf.into_iter());

View File

@ -147,7 +147,7 @@ where
L: Load,
R: Resolve,
{
/// Retursn (local, export)
/// Returns (local, export)
fn ctxt_for(&self, src: &JsWord) -> Option<(SyntaxContext, SyntaxContext)> {
// Don't apply mark if it's a core module.
if self
@ -308,7 +308,7 @@ where
if e.computed {
// If a module is accessed with unknown key, we should import
// everyrthing from it.
// everything from it.
self.add_forced_ns_for(obj.to_id());
return;
}

View File

@ -12,7 +12,7 @@ pub(super) struct Scope {
loaded_modules: CloneMap<ModuleId, ()>,
/// Cached after applying basical transformations.
/// Cached after applying basic transformations.
transformed_modules: CloneMap<ModuleId, TransformedModule>,
accessed_with_computed_key: CloneMap<ModuleId, Lrc<AtomicBool>>,

View File

@ -9,7 +9,7 @@ pub struct ModuleData {
pub module: Module,
/// Used helpers
///
/// # Exmaple
/// # Example
///
/// ```rust,ignore
///

View File

@ -11,7 +11,7 @@ mod sort;
pub struct Modules {
/// Indicates that a statement is injected.
///
/// Note: This context shoulod be shared for a bundle.
/// Note: This context should be shared for a bundle.
pub(crate) injected_ctxt: SyntaxContext,
// We will change this into `Vec<Module>`.

View File

@ -157,7 +157,7 @@ fn toposort_real_module_ids<'a>(
cycles: &'a Vec<Vec<ModuleId>>,
) -> impl 'a + Iterator<Item = Vec<ModuleId>> {
let mut done = AHashSet::<ModuleId>::default();
let mut errored = AHashSet::<ModuleId>::default();
let mut errorred = AHashSet::<ModuleId>::default();
from_fn(move || {
while let Some(id) = queue.pop_front() {
@ -177,7 +177,7 @@ fn toposort_real_module_ids<'a>(
// Emit
done.insert(id);
errored.clear();
errorred.clear();
return Some(vec![id]);
}
@ -212,7 +212,7 @@ fn toposort_real_module_ids<'a>(
// dbg!(&deps_of_circle);
if !deps_of_circle.is_empty() {
if errored.insert(id) {
if errorred.insert(id) {
queue.push_front(id);
// Handle dependencies first.
@ -230,7 +230,7 @@ fn toposort_real_module_ids<'a>(
// Emit
done.extend(all_modules_in_circle.iter().copied());
errored.clear();
errorred.clear();
return Some(all_modules_in_circle.into_iter().collect());
}

View File

@ -6,7 +6,7 @@ use petgraph::{
use std::{collections::VecDeque, iter::repeat};
use swc_common::collections::AHashSet;
/// Is dependancy between nodes hard?
/// Is dependency between nodes hard?
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub(super) enum Required {
/// Required to evaluate

View File

@ -1,7 +1,7 @@
use super::graph::Required;
use crate::{id::Id, modules::sort::graph::StmtDepGraph};
use indexmap::IndexSet;
use petgraph::EdgeDirection::{Incoming as Dependants, Outgoing as Dependancies};
use petgraph::EdgeDirection::{Incoming as Dependants, Outgoing as Dependencies};
use std::{collections::VecDeque, iter::from_fn, ops::Range};
use swc_atoms::js_word;
use swc_common::{
@ -181,7 +181,7 @@ fn iter<'a>(
// We
{
let deps = graph
.neighbors_directed(idx, Dependancies)
.neighbors_directed(idx, Dependencies)
.filter(|dep| {
let declared_in_same_module = match &current_range {
Some(v) => v.contains(&dep),
@ -197,7 +197,7 @@ fn iter<'a>(
}
}
// Exlcude emitted items
// Exclude emitted items
!done.contains(dep)
})
.collect::<Vec<_>>();
@ -267,7 +267,7 @@ fn iter<'a>(
// dbg!(&dependants);
// We only emit free items because we want to emit statements from same module
// to emitted closedly.
// to emitted closely.
for dependant in dependants {
if !done.contains(&dependant) && free.contains(&dependant) {
stack.push_front(dependant);
@ -307,7 +307,7 @@ fn iter<'a>(
// dbg!(&dependants);
// We only emit free items because we want to emit statements from same module
// to emitted closedly.
// to emitted closely.
for dependant in dependants {
if !done.contains(&dependant) && free.contains(&dependant) {
stack.push_front(dependant);
@ -506,7 +506,7 @@ impl Visit for InitializerFinder {
/// We do not care about variables created by current statement.
/// But we care about modifications.
#[derive(Default)]
struct RequirementCalculartor {
struct RequirementCalculator {
required_ids: IndexSet<(Id, Required), ahash::RandomState>,
/// While bundling, there can be two bindings with same name and syntax
/// context, in case of wrapped es modules. We exclude them from dependency
@ -531,7 +531,7 @@ macro_rules! weak {
};
}
impl RequirementCalculartor {
impl RequirementCalculator {
fn insert(&mut self, i: Id) {
self.required_ids.insert((
i,
@ -544,7 +544,7 @@ impl RequirementCalculartor {
}
}
impl Visit for RequirementCalculartor {
impl Visit for RequirementCalculator {
noop_visit_type!();
weak!(visit_arrow_expr, ArrowExpr);
@ -642,7 +642,7 @@ fn calc_deps(new: &[ModuleItem]) -> StmtDepGraph {
// We start by calculating ids created by statements. Note that we don't need to
// analyze bodies of functions nor members of classes, because it's not
// evaludated until they are called.
// evaluated until they are called.
match item {
// We only check declarations because ids are created by declarations.
@ -736,10 +736,10 @@ fn calc_deps(new: &[ModuleItem]) -> StmtDepGraph {
for (idx, item) in new.iter().enumerate() {
// We then calculate which ids a statement require to be executed.
// Again, we don't need to analyze non-top-level idents because they
// are not evaluated while lpoading module.
// Again, we don't need to analyze non-top-level identifiers because they
// are not evaluated while loading module.
let mut visitor = RequirementCalculartor::default();
let mut visitor = RequirementCalculator::default();
item.visit_with(&Invalid { span: DUMMY_SP }, &mut visitor);
@ -772,7 +772,7 @@ fn calc_deps(new: &[ModuleItem]) -> StmtDepGraph {
// );
if cfg!(debug_assertions) {
let deps: Vec<_> =
graph.neighbors_directed(idx, Dependancies).collect();
graph.neighbors_directed(idx, Dependencies).collect();
assert!(deps.contains(&declarator_index));
}
}
@ -786,7 +786,7 @@ fn calc_deps(new: &[ModuleItem]) -> StmtDepGraph {
#[cfg(test)]
mod tests {
use super::{calc_deps, Dependancies};
use super::{calc_deps, Dependencies};
use crate::{bundler::tests::suite, debug::print_hygiene};
use swc_common::DUMMY_SP;
use swc_ecma_ast::*;
@ -806,7 +806,7 @@ mod tests {
}
let deps = graph
.neighbors_directed(i, Dependancies)
.neighbors_directed(i, Dependencies)
.collect::<Vec<_>>();
for dep in deps {

View File

@ -171,12 +171,12 @@ impl VisitMut for HygieneRemover {
pub(crate) use rayon::join;
#[cfg(not(feature = "rayon"))]
pub(crate) fn join<A, B, RA, RB>(oper_a: A, oper_b: B) -> (RA, RB)
pub(crate) fn join<A, B, RA, RB>(op_a: A, op_b: B) -> (RA, RB)
where
A: FnOnce() -> RA,
B: FnOnce() -> RB,
{
(oper_a(), oper_b())
(op_a(), op_b())
}
#[cfg(feature = "rayon")]

View File

@ -11,7 +11,7 @@ function __spack_require__(mod) {
cache = module.exports;
return cache;
}
var load = __spack_require__.bind(void 0, function(module, exports) {
var load = __swcpack_require__.bind(void 0, function(module, exports) {
function lodash(value) {
console.log('lodash');
}

View File

@ -11,7 +11,7 @@ function __spack_require__(mod) {
cache = module.exports;
return cache;
}
var load = __spack_require__.bind(void 0, function(module, exports) {
var load = __swcpack_require__.bind(void 0, function(module, exports) {
function lodash(value) {
console.log('lodash');
}

View File

@ -11,7 +11,7 @@ function __spack_require__(mod) {
cache = module.exports;
return cache;
}
var load = __spack_require__.bind(void 0, function(module, exports) {
var load = __swcpack_require__.bind(void 0, function(module, exports) {
function lodash(value) {
console.log('lodash');
}

View File

@ -11,7 +11,7 @@ function __spack_require__(mod) {
cache = module.exports;
return cache;
}
var load = __spack_require__.bind(void 0, function(module, exports) {
var load = __swcpack_require__.bind(void 0, function(module, exports) {
function lodash(value) {
console.log('lodash');
}

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_common"
repository = "https://github.com/swc-project/swc.git"
version = "0.14.0"
version = "0.14.1"
[features]
concurrent = ["parking_lot"]

View File

@ -717,7 +717,7 @@ impl Handler {
/// The caller must then teach the user about such a diagnostic.
///
/// Used to suppress emitting the same error multiple times with extended
/// explanation when calling `-Zteach`.
/// explanation when calling `-Z teach`.
pub fn must_teach(&self, code: &DiagnosticId) -> bool {
self.taught_diagnostics.borrow_mut().insert(code.clone())
}

View File

@ -526,7 +526,7 @@ impl EmitterWriter {
// or the next are vertical line placeholders.
|| (annotation.takes_space() // If either this or the next annotation is
&& next.has_label()) // multiline start/end, move it to a new line
|| (annotation.has_label() // so as not to overlap the orizontal lines.
|| (annotation.has_label() // so as not to overlap the horizontal lines.
&& next.takes_space())
|| (annotation.takes_space() && next.takes_space())
|| (overlaps(next, annotation, l)
@ -556,7 +556,7 @@ impl EmitterWriter {
return vec![];
}
// Write the colunmn separator.
// Write the column separator.
//
// After this we will have:
//

View File

@ -103,7 +103,6 @@ pub enum FileName {
/// Command line
Anon,
/// Hack in src/libsyntax/parse.rs
/// FIXME(jseyfried)
MacroExpansion,
ProcMacroSourceCode,
Url(Url),

122
cspell.json Normal file
View File

@ -0,0 +1,122 @@
{
"version": "0.2",
"language": "en",
"allowCompoundWords": true,
"words": [
"aarch",
"ahash",
"anonymized",
"ANONYMIZED",
"Ansi",
"armv",
"arrayvec",
"ascii",
"babelify",
"Babelify",
"bools",
"bpos",
"BUILTINS",
"canonicalization",
"canonicalize",
"chpos",
"cmpeq",
"cmplt",
"cmts",
"cname",
"combinator",
"Combinator",
"Cond",
"constness",
"corejs",
"ctxt",
"ctxts",
"Cutomizing",
"dedup",
"dejavu",
"delim",
"Delim",
"deno",
"Deno",
"deps",
"Deque",
"Deser",
"dont",
"DWORD",
"ecmascript",
"eddyb",
"elems",
"esbuild",
"esms",
"Eval",
"exponentation",
"fargs",
"finalizer",
"fnames",
"gnueabihf",
"hasher",
"idents",
"iife",
"impls",
"indexmap",
"instanceof",
"interner",
"intrinsics",
"ints",
"jsonify",
"jsxs",
"jszip",
"kaios",
"keyof",
"linebpos",
"linechpos",
"loadu",
"LPCSTR",
"LPSECURITY",
"mbcs",
"mimalloc",
"minifier",
"miri",
"mkdir",
"msvc",
"napi",
"nncs",
"noinline",
"NOINLINE",
"paren",
"Paren",
"pmutil",
"pointee",
"prec",
"PREC",
"punct",
"putc",
"qself",
"regs",
"repr",
"rfind",
"rpos",
"rposition",
"rsplit",
"rustc",
"sabi",
"seqs",
"sess",
"skippable",
"smallvec",
"spanx",
"stmts",
"succ",
"sugg",
"swcpack",
"swcrc",
"termcolor",
"typeofs",
"uncons",
"Unexported",
"Unexporter",
"unimpl"
],
"flagWords": [
"actally"
]
}

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_css_ast"
repository = "https://github.com/swc-project/swc.git"
version = "0.18.0"
version = "0.18.1"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -58,7 +58,7 @@ pub enum SubclassSelector {
#[tag("ClassSelector")]
Class(ClassSelector),
#[tag("AttrributeSelctor")]
#[tag("AttributeSelector")]
Attr(AttrSelector),
#[tag("PseudoClassSelector")]

View File

@ -83,7 +83,7 @@ pub struct BinValue {
#[ast_node("FnValue")]
pub struct FnValue {
/// Span starting from the `lo` of identifer and to the end of `)`.
/// Span starting from the `lo` of identifier and to the end of `)`.
pub span: Span,
pub name: Text,

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.78.1"
version = "0.79.0"
[package.metadata.docs.rs]
all-features = true
@ -33,12 +33,12 @@ typescript = ["typescript-parser", "swc_ecma_transforms/typescript"]
[dependencies]
swc_ecma_ast = {version = "0.55.0", path = "./ast"}
swc_ecma_codegen = {version = "0.76.0", path = "./codegen", optional = true}
swc_ecma_dep_graph = {version = "0.43.0", path = "./dep-graph", optional = true}
swc_ecma_minifier = {version = "0.42.2", path = "./minifier", optional = true}
swc_ecma_parser = {version = "0.74.0", path = "./parser", optional = true, default-features = false}
swc_ecma_preset_env = {version = "0.57.1", path = "./preset-env", optional = true}
swc_ecma_transforms = {version = "0.86.1", path = "./transforms", optional = true}
swc_ecma_codegen = {version = "0.77.0", path = "./codegen", optional = true}
swc_ecma_dep_graph = {version = "0.44.0", path = "./dep-graph", optional = true}
swc_ecma_minifier = {version = "0.43.0", path = "./minifier", optional = true}
swc_ecma_parser = {version = "0.75.0", path = "./parser", optional = true, default-features = false}
swc_ecma_preset_env = {version = "0.58.0", path = "./preset-env", optional = true}
swc_ecma_transforms = {version = "0.87.0", path = "./transforms", optional = true}
swc_ecma_utils = {version = "0.48.0", path = "./utils", optional = true}
swc_ecma_visit = {version = "0.41.0", path = "./visit", optional = true}

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.76.0"
version = "0.77.0"
[dependencies]
bitflags = "1"
@ -19,7 +19,7 @@ swc_atoms = {version = "0.2", path = "../../atoms"}
swc_common = {version = "0.14.0", path = "../../common"}
swc_ecma_ast = {version = "0.55.0", path = "../ast"}
swc_ecma_codegen_macros = {version = "0.6.0", path = "./macros"}
swc_ecma_parser = {version = "0.74.0", path = "../parser"}
swc_ecma_parser = {version = "0.75.0", path = "../parser"}
tracing = "0.1"
[dev-dependencies]

View File

@ -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.43.0"
version = "0.44.0"
[dependencies]
swc_atoms = {version = "0.2", path = "../../atoms"}
@ -15,5 +15,5 @@ swc_ecma_ast = {version = "0.55.0", path = "../ast"}
swc_ecma_visit = {version = "0.41.0", path = "../visit"}
[dev-dependencies]
swc_ecma_parser = {version = "0.74.0", path = "../parser"}
swc_ecma_parser = {version = "0.75.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.33.0"
version = "0.34.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.14.0", path = "../../common"}
swc_ecma_ast = {version = "0.55.0", path = "../ast"}
swc_ecma_parser = {version = "0.74.0", path = "../parser"}
swc_ecma_parser = {version = "0.75.0", path = "../parser"}
swc_ecma_utils = {version = "0.48.0", path = "../utils"}
swc_ecma_visit = {version = "0.41.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.43.0"
version = "0.44.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.14.0", path = "../../common"}
anyhow = "1"
dashmap = "4.0.2"
swc_ecma_ast = {version = "0.55.0", path = "../ast"}
swc_ecma_parser = {version = "0.74.0", path = "../parser"}
swc_ecma_parser = {version = "0.75.0", path = "../parser"}
testing = {version = "0.15.0", path = "../../testing"}
walkdir = "2"

View File

@ -96,8 +96,8 @@ pub enum Tag {
Generator(GeneratorTag),
#[tag("FunctionTag")]
Function(FunctionTag),
#[tag("FilelTag")]
File(FilelTag),
#[tag("FileTag")]
File(FileTag),
#[tag("ConstructsTag")]
Constructs(ConstructsTag),
#[tag("CopyrightTag")]
@ -542,7 +542,7 @@ pub struct DeprecatedTag {
}
#[ast_node]
pub struct FilelTag {
pub struct FileTag {
pub span: Span,
pub text: Text,
}

View File

@ -192,7 +192,7 @@ pub fn parse_tag_item(i: Input) -> IResult<Input, TagItem> {
"file" | "fileoverview" | "overview" => {
let (input, text) = parse_line(i)?;
i = input;
Tag::File(FilelTag { span, text })
Tag::File(FileTag { span, text })
}
"fires" | "emits" => {

View File

@ -45,7 +45,7 @@
value: Atom('overview' type=dynamic),
},
tag: File(
FilelTag {
FileTag {
span: Span {
lo: BytePos(
0,

View File

@ -45,7 +45,7 @@
value: Atom('fileoverview' type=dynamic),
},
tag: File(
FilelTag {
FileTag {
span: Span {
lo: BytePos(
0,

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.42.2"
version = "0.43.0"
[features]
debug = ["backtrace"]
@ -26,10 +26,10 @@ 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.55.0", path = "../ast"}
swc_ecma_codegen = {version = "0.76.0", path = "../codegen"}
swc_ecma_parser = {version = "0.74.0", path = "../parser"}
swc_ecma_transforms = {version = "0.86.1", path = "../transforms/", features = ["optimization"]}
swc_ecma_transforms_base = {version = "0.39.1", path = "../transforms/base"}
swc_ecma_codegen = {version = "0.77.0", path = "../codegen"}
swc_ecma_parser = {version = "0.75.0", path = "../parser"}
swc_ecma_transforms = {version = "0.87.0", path = "../transforms/", features = ["optimization"]}
swc_ecma_transforms_base = {version = "0.40.0", path = "../transforms/base"}
swc_ecma_utils = {version = "0.48.0", path = "../utils"}
swc_ecma_visit = {version = "0.41.0", path = "../visit"}
tracing = "0.1.28"

View File

@ -433,7 +433,7 @@ where
}
fn visit_mut_module(&mut self, n: &mut Module) {
let is_bundle_mode = n.span.has_mark(self.marks.bundle_of_standalones);
let is_bundle_mode = n.span.has_mark(self.marks.bundle_of_standalone);
if is_bundle_mode {
self.left_parallel_depth = MAX_PAR_DEPTH - 1;

View File

@ -33,7 +33,7 @@ where
/// throw x();
/// }
/// ```
pub(super) fn optimize_in_fn_termiation(&mut self, e: &mut Expr) {
pub(super) fn optimize_in_fn_termination(&mut self, e: &mut Expr) {
if !self.options.dead_code {
return;
}
@ -45,7 +45,7 @@ where
match e {
Expr::Assign(assign) => {
self.optimize_in_fn_termiation(&mut assign.right);
self.optimize_in_fn_termination(&mut assign.right);
// We only handle identifiers on lhs for now.
match &assign.left {

View File

@ -2,7 +2,7 @@ use super::Optimizer;
use crate::{
compress::util::is_directive,
mode::Mode,
util::{sort::is_sorted_by, MoudleItemExt},
util::{sort::is_sorted_by, ModuleItemExt},
DISABLE_BUGGY_PASSES,
};
use std::cmp::Ordering;
@ -16,7 +16,7 @@ where
/// Calls `reorder_stmts_inner` after splitting stmts.
pub(super) fn reorder_stmts<T>(&mut self, stmts: &mut Vec<T>)
where
T: MoudleItemExt,
T: ModuleItemExt,
{
if self.ctx.in_asm {
return;
@ -28,7 +28,7 @@ where
/// Sorts given statements.
fn reorder_stmts_inner<T>(&mut self, stmts: &mut Vec<T>)
where
T: MoudleItemExt,
T: ModuleItemExt,
{
if !self.options.join_vars {
return;

View File

@ -8,7 +8,7 @@ use crate::{
marks::Marks,
mode::Mode,
option::CompressOptions,
util::{contains_leaping_yield, make_number, MoudleItemExt},
util::{contains_leaping_yield, make_number, ModuleItemExt},
};
use retain_mut::RetainMut;
use std::{fmt::Write, mem::take};
@ -59,7 +59,7 @@ pub(super) fn optimizer<'a, M>(
data: &'a ProgramData,
state: &'a mut OptimizerState,
mode: &'a M,
debug_inifinite_loop: bool,
debug_infinite_loop: bool,
) -> impl 'a + VisitMut + Repeated
where
M: Mode,
@ -89,7 +89,7 @@ where
done_ctxt,
label: Default::default(),
mode,
debug_inifinite_loop,
debug_infinite_loop,
}
}
@ -137,7 +137,7 @@ struct Ctx {
in_bang_arg: bool,
in_var_decl_of_for_in_or_of_loop: bool,
/// `true` while handling inner statements of a labelled statement.
stmt_lablled: bool,
stmt_labelled: bool,
dont_use_negated_iife: bool,
@ -224,7 +224,7 @@ struct Optimizer<'a, M> {
mode: &'a M,
debug_inifinite_loop: bool,
debug_infinite_loop: bool,
}
impl<M> Repeated for Optimizer<'_, M> {
@ -243,7 +243,7 @@ where
{
fn handle_stmt_likes<T>(&mut self, stmts: &mut Vec<T>)
where
T: StmtLike + ModuleItemLike + MoudleItemExt + VisitMutWith<Self>,
T: StmtLike + ModuleItemLike + ModuleItemExt + VisitMutWith<Self>,
Vec<T>: VisitMutWith<Self> + VisitWith<UsageAnalyzer>,
{
match self.data {
@ -1582,7 +1582,7 @@ where
fn visit_mut_block_stmt(&mut self, n: &mut BlockStmt) {
let ctx = Ctx {
stmt_lablled: false,
stmt_labelled: false,
top_level: false,
in_block: true,
scope: n.span.ctxt,
@ -1939,7 +1939,7 @@ where
fn visit_mut_function(&mut self, n: &mut Function) {
{
let ctx = Ctx {
stmt_lablled: false,
stmt_labelled: false,
..self.ctx
};
n.decorators.visit_mut_with(&mut *self.with_ctx(ctx));
@ -1958,7 +1958,7 @@ where
{
let ctx = Ctx {
skip_standalone: self.ctx.skip_standalone || is_standalone,
stmt_lablled: false,
stmt_labelled: false,
in_fn_like: true,
scope: n.span.ctxt,
can_inline_arguments: true,
@ -2013,7 +2013,7 @@ where
fn visit_mut_labeled_stmt(&mut self, n: &mut LabeledStmt) {
let ctx = Ctx {
stmt_lablled: true,
stmt_labelled: true,
..self.ctx
};
let old_label = self.label.take();
@ -2148,7 +2148,7 @@ where
n.visit_mut_children_with(self);
if let Some(arg) = &mut n.arg {
self.optimize_in_fn_termiation(&mut **arg);
self.optimize_in_fn_termination(&mut **arg);
}
}
@ -2218,7 +2218,7 @@ where
}
fn visit_mut_stmt(&mut self, s: &mut Stmt) {
let _tracing = if cfg!(feature = "debug") && self.debug_inifinite_loop {
let _tracing = if cfg!(feature = "debug") && self.debug_infinite_loop {
let text = dump(&*s);
if text.lines().count() < 10 {
@ -2242,7 +2242,7 @@ where
};
s.visit_mut_children_with(&mut *self.with_ctx(ctx));
if cfg!(feature = "debug") && self.debug_inifinite_loop {
if cfg!(feature = "debug") && self.debug_infinite_loop {
let text = dump(&*s);
if text.lines().count() < 10 {
@ -2318,7 +2318,7 @@ where
self.optimize_switches(s);
if cfg!(feature = "debug") && self.debug_inifinite_loop {
if cfg!(feature = "debug") && self.debug_infinite_loop {
let text = dump(&*s);
if text.lines().count() < 10 {
@ -2387,7 +2387,7 @@ where
fn visit_mut_throw_stmt(&mut self, n: &mut ThrowStmt) {
n.visit_mut_children_with(self);
self.optimize_in_fn_termiation(&mut n.arg);
self.optimize_in_fn_termination(&mut n.arg);
}
fn visit_mut_tpl(&mut self, n: &mut Tpl) {
@ -2598,7 +2598,7 @@ fn is_callee_this_aware(callee: &Expr) -> bool {
..
}) => match &**obj {
Expr::Ident(obj) => {
if &*obj.sym == "consoole" {
if &*obj.sym == "console" {
return false;
}
}

View File

@ -7,7 +7,7 @@ use crate::{
debug::dump,
mode::Mode,
option::CompressOptions,
util::{idents_used_by, idents_used_by_ignoring_nested, ExprOptExt, MoudleItemExt},
util::{idents_used_by, idents_used_by_ignoring_nested, ExprOptExt, ModuleItemExt},
};
use retain_mut::RetainMut;
use std::mem::take;
@ -25,7 +25,7 @@ where
M: Mode,
{
///
/// # Exmaple
/// # Example
///
///
/// ## Input
@ -416,7 +416,7 @@ where
}
self.changed = true;
tracing::debug!(
"sequences: Splitted a sequence exprssion to multiple expression statements"
"sequences: Splitted a sequence expression to multiple expression statements"
);
*stmts = new_stmts;
}
@ -482,7 +482,7 @@ where
e.exprs = new_exprs;
}
/// Hoist varaibles in subscope.
/// Hoist variables in subscope.
///
/// I don't know why it depends on `sequences`.
pub(super) fn extract_vars_in_subscopes(&mut self, s: &mut Stmt) {
@ -504,7 +504,7 @@ where
/// Move `var` in subscope to current scope.
///
/// This mehod acutally `hoist`s [VarDecl]s declared with `var`.
/// This method actually `hoist`s [VarDecl]s declared with `var`.
fn extract_vars(&mut self, s: &mut Stmt) {
let mut found_other = false;
match s {
@ -641,7 +641,7 @@ where
#[cfg_attr(feature = "debug", tracing::instrument(skip(self, stmts)))]
pub(super) fn merge_sequences_in_stmts<T>(&mut self, stmts: &mut Vec<T>)
where
T: MoudleItemExt,
T: ModuleItemExt,
{
if !self.options.sequences() && !self.options.collapse_vars {
if cfg!(feature = "debug") {

View File

@ -14,7 +14,7 @@ where
/// Handle switches in the case where we can know which branch will be
/// taken.
pub(super) fn optimize_const_switches(&mut self, s: &mut Stmt) {
if !self.options.switches || self.ctx.stmt_lablled {
if !self.options.switches || self.ctx.stmt_labelled {
return;
}
@ -320,7 +320,7 @@ where
}
pub(super) fn optimize_switches(&mut self, _s: &mut Stmt) {
if !self.options.switches || self.ctx.stmt_lablled {
if !self.options.switches || self.ctx.stmt_labelled {
return;
}

View File

@ -1,6 +1,6 @@
use self::ctx::Ctx;
use crate::{
debug::dump, marks::Marks, mode::Mode, option::CompressOptions, util::MoudleItemExt,
debug::dump, marks::Marks, mode::Mode, option::CompressOptions, util::ModuleItemExt,
MAX_PAR_DEPTH,
};
use rayon::prelude::*;
@ -71,7 +71,7 @@ where
{
fn handle_stmt_likes<T>(&mut self, stmts: &mut Vec<T>)
where
T: MoudleItemExt,
T: ModuleItemExt,
Vec<T>: VisitWith<self::vars::VarWithOutInitCounter>
+ VisitMutWith<self::vars::VarPrepender>
+ VisitMutWith<self::vars::VarMover>,

View File

@ -4,7 +4,7 @@ use swc_common::Mark;
#[derive(Debug, Clone, Copy)]
pub struct Marks {
/// [Mark] applied to non-top level varaibles which is injected while
/// [Mark] applied to non-top level variables which is injected while
/// inlining.
///
/// In other words, AST nodes marked with this mark will not be treated as a
@ -31,8 +31,8 @@ pub struct Marks {
/// nested.
pub(crate) standalone: Mark,
//// Appied to [swc_ecma_ast::Module].
pub(crate) bundle_of_standalones: Mark,
//// Applied to [swc_ecma_ast::Module].
pub(crate) bundle_of_standalone: Mark,
/// `/** @const */`.
pub(crate) const_ann: Mark,
@ -54,7 +54,7 @@ impl Marks {
non_top_level: m(),
synthesized_seq: m(),
standalone: m(),
bundle_of_standalones: m(),
bundle_of_standalone: m(),
const_ann: m(),
noinline: m(),
pure: m(),

View File

@ -177,7 +177,7 @@ impl VisitMut for InfoMarker<'_> {
if self.state.is_bundle {
tracing::info!("Running minifier in the bundle mode");
m.span = m.span.apply_mark(self.marks.bundle_of_standalones);
m.span = m.span.apply_mark(self.marks.bundle_of_standalone);
} else {
tracing::info!("Running minifier in the normal mode");
}

View File

@ -2,7 +2,7 @@ use crate::{
analyzer::{analyze, ProgramData, UsageAnalyzer},
marks::Marks,
option::CompressOptions,
util::MoudleItemExt,
util::ModuleItemExt,
};
use swc_atoms::js_word;
use swc_common::{collections::AHashMap, util::take::Take};
@ -44,7 +44,7 @@ struct Ctx {
impl PrecompressOptimizer<'_> {
fn handle_stmts<T>(&mut self, stmts: &mut Vec<T>)
where
T: for<'aa> VisitMutWith<PrecompressOptimizer<'aa>> + MoudleItemExt,
T: for<'aa> VisitMutWith<PrecompressOptimizer<'aa>> + ModuleItemExt,
Vec<T>: for<'aa> VisitMutWith<PrecompressOptimizer<'aa>> + VisitWith<UsageAnalyzer>,
{
if self.data.is_some() {

View File

@ -21,7 +21,7 @@ pub(crate) fn make_number(span: Span, value: f64) -> Expr {
Expr::Lit(Lit::Num(Number { span, value }))
}
pub trait MoudleItemExt:
pub trait ModuleItemExt:
StmtLike + ModuleItemLike + From<Stmt> + Spanned + std::fmt::Debug
{
fn as_module_decl(&self) -> Result<&ModuleDecl, &Stmt>;
@ -40,7 +40,7 @@ pub trait MoudleItemExt:
fn as_stmt_mut(&mut self) -> Option<&mut Stmt>;
}
impl MoudleItemExt for Stmt {
impl ModuleItemExt for Stmt {
fn as_module_decl(&self) -> Result<&ModuleDecl, &Stmt> {
Err(self)
}
@ -58,7 +58,7 @@ impl MoudleItemExt for Stmt {
}
}
impl MoudleItemExt for ModuleItem {
impl ModuleItemExt for ModuleItem {
fn as_module_decl(&self) -> Result<&ModuleDecl, &Stmt> {
match self {
ModuleItem::ModuleDecl(v) => Ok(v),

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.74.0"
version = "0.75.0"
[package.metadata.docs.rs]
all-features = true

View File

@ -63,7 +63,7 @@ pub enum SyntaxError {
EscapeInReservedWord {
word: JsWord,
},
UnterminatedRegxp,
UnterminatedRegExp,
UnterminatedTpl,
IdentAfterNum,
UnexpectedChar {
@ -272,7 +272,7 @@ impl SyntaxError {
SyntaxError::EscapeInReservedWord { ref word } => {
format!("Unexpected escape sequence in reserved word: {}", word).into()
}
SyntaxError::UnterminatedRegxp => "Unterminated regexp literal".into(),
SyntaxError::UnterminatedRegExp => "Unterminated regexp literal".into(),
SyntaxError::UnterminatedTpl => "Unterminated template".into(),
SyntaxError::IdentAfterNum => "Identifier cannot follow number".into(),
SyntaxError::UnexpectedChar { c } => format!("Unexpected character {:?}", c).into(),

View File

@ -905,7 +905,7 @@ impl<'a, I: Input> Lexer<'a, I> {
// This is ported from babel.
// Seems like regexp literal cannot contain linebreak.
if c.is_line_terminator() {
l.error(start, SyntaxError::UnterminatedRegxp)?;
l.error(start, SyntaxError::UnterminatedRegExp)?;
}
if escaped {
@ -931,7 +931,7 @@ impl<'a, I: Input> Lexer<'a, I> {
// input is terminated without following `/`
if !self.is(b'/') {
self.error(start, SyntaxError::UnterminatedRegxp)?;
self.error(start, SyntaxError::UnterminatedRegExp)?;
}
self.bump(); // '/'

View File

@ -90,12 +90,12 @@
//!
//! ### Null character after `\`
//!
//! Becuase [String] of rust should only contain valid utf-8 characters while
//! javascript allows non-utf8 chraceters, the parser stores invalid utf8
//! chracters in escpaed form.
//! Because [String] of rust should only contain valid utf-8 characters while
//! javascript allows non-utf8 characters, the parser stores invalid utf8
//! characters in escaped form.
//!
//! As a result, swc needs a way to distinguish invalid-utf8 code points and
//! input specified by the user. The parser stores a null chracter right after
//! input specified by the user. The parser stores a null character right after
//! `\\` for non-utf8 code points. Note that other parts of swc is aware of this
//! fact.
//!

View File

@ -751,7 +751,7 @@ impl<'a, I: Tokens> Parser<I> {
Ok(&Token::BinOp(..)) => {
// ) is required
self.emit_err(self.input.cur_span(), SyntaxError::TS1005);
let errored_expr =
let errorred_expr =
self.parse_bin_op_recursively(Box::new(arrow_expr.into()), 0)?;
if !is!(self, ';') {
@ -759,7 +759,7 @@ impl<'a, I: Tokens> Parser<I> {
self.emit_err(self.input.cur_span(), SyntaxError::TS1005);
}
return Ok(errored_expr);
return Ok(errorred_expr);
}
_ => {}
},

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.57.1"
version = "0.58.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.14.0", path = "../../common"}
swc_ecma_ast = {version = "0.55.0", path = "../ast"}
swc_ecma_transforms = {version = "0.86.1", path = "../transforms", features = ["compat", "proposal"]}
swc_ecma_transforms = {version = "0.87.0", path = "../transforms", features = ["compat", "proposal"]}
swc_ecma_utils = {version = "0.48.0", path = "../utils"}
swc_ecma_visit = {version = "0.41.0", path = "../visit"}
walkdir = "2"
[dev-dependencies]
pretty_assertions = "0.6"
swc_ecma_codegen = {version = "0.76.0", path = "../codegen"}
swc_ecma_parser = {version = "0.74.0", path = "../parser"}
swc_ecma_codegen = {version = "0.77.0", path = "../codegen"}
swc_ecma_parser = {version = "0.75.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.86.1"
version = "0.87.0"
[package.metadata.docs.rs]
all-features = true
@ -25,14 +25,14 @@ typescript = ["swc_ecma_transforms_typescript"]
swc_atoms = {version = "0.2.0", path = "../../atoms"}
swc_common = {version = "0.14.0", path = "../../common"}
swc_ecma_ast = {version = "0.55.0", path = "../ast"}
swc_ecma_parser = {version = "0.74.0", path = "../parser"}
swc_ecma_transforms_base = {version = "0.39.1", path = "./base"}
swc_ecma_transforms_compat = {version = "0.44.1", path = "./compat", optional = true}
swc_ecma_transforms_module = {version = "0.50.1", path = "./module", optional = true}
swc_ecma_transforms_optimization = {version = "0.56.1", path = "./optimization", optional = true}
swc_ecma_transforms_proposal = {version = "0.50.1", path = "./proposal", optional = true}
swc_ecma_transforms_react = {version = "0.52.1", path = "./react", optional = true}
swc_ecma_transforms_typescript = {version = "0.53.1", path = "./typescript", optional = true}
swc_ecma_parser = {version = "0.75.0", path = "../parser"}
swc_ecma_transforms_base = {version = "0.40.0", path = "./base"}
swc_ecma_transforms_compat = {version = "0.45.0", path = "./compat", optional = true}
swc_ecma_transforms_module = {version = "0.51.0", path = "./module", optional = true}
swc_ecma_transforms_optimization = {version = "0.57.0", path = "./optimization", optional = true}
swc_ecma_transforms_proposal = {version = "0.51.0", path = "./proposal", optional = true}
swc_ecma_transforms_react = {version = "0.53.0", path = "./react", optional = true}
swc_ecma_transforms_typescript = {version = "0.54.0", path = "./typescript", optional = true}
swc_ecma_utils = {version = "0.48.0", path = "../utils"}
swc_ecma_visit = {version = "0.41.0", path = "../visit"}
unicode-xid = "0.2"
@ -40,8 +40,8 @@ unicode-xid = "0.2"
[dev-dependencies]
pretty_assertions = "0.6"
sourcemap = "6"
swc_ecma_codegen = {version = "0.76.0", path = "../codegen"}
swc_ecma_transforms_testing = {version = "0.40.1", path = "./testing"}
swc_ecma_codegen = {version = "0.77.0", path = "../codegen"}
swc_ecma_transforms_testing = {version = "0.41.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.39.1"
version = "0.40.0"
[features]
concurrent = [
@ -23,11 +23,11 @@ smallvec = "1.6.0"
swc_atoms = {version = "0.2", path = "../../../atoms"}
swc_common = {version = "0.14.0", path = "../../../common"}
swc_ecma_ast = {version = "0.55.0", path = "../../ast"}
swc_ecma_parser = {version = "0.74.0", path = "../../parser"}
swc_ecma_parser = {version = "0.75.0", path = "../../parser"}
swc_ecma_utils = {version = "0.48.0", path = "../../utils"}
swc_ecma_visit = {version = "0.41.0", path = "../../visit"}
[dev-dependencies]
swc_ecma_codegen = {version = "0.76.0", path = "../../codegen"}
swc_ecma_codegen = {version = "0.77.0", path = "../../codegen"}
swc_ecma_transforms_macros = {version = "0.2.3", 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.25.1"
version = "0.26.0"
[dependencies]
swc_atoms = {version = "0.2.6", path = "../../../atoms"}
swc_common = {version = "0.14.0", path = "../../../common"}
swc_ecma_ast = {version = "0.55.0", path = "../../ast"}
swc_ecma_transforms_base = {version = "0.39.1", path = "../base"}
swc_ecma_transforms_base = {version = "0.40.0", path = "../base"}
swc_ecma_utils = {version = "0.48.0", path = "../../utils"}
swc_ecma_visit = {version = "0.41.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.44.3"
version = "0.45.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
@ -29,13 +29,13 @@ 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.55.0", path = "../../ast"}
swc_ecma_transforms_base = {version = "0.39.1", path = "../base"}
swc_ecma_transforms_classes = {version = "0.25.1", path = "../classes"}
swc_ecma_transforms_base = {version = "0.40.0", path = "../base"}
swc_ecma_transforms_classes = {version = "0.26.0", path = "../classes"}
swc_ecma_transforms_macros = {version = "0.2.3", path = "../macros"}
swc_ecma_utils = {version = "0.48.0", path = "../../utils"}
swc_ecma_visit = {version = "0.41.0", path = "../../visit"}
[dev-dependencies]
swc_ecma_parser = {version = "0.74.0", path = "../../parser"}
swc_ecma_transforms_testing = {version = "0.40.1", path = "../testing"}
swc_ecma_parser = {version = "0.75.0", path = "../../parser"}
swc_ecma_transforms_testing = {version = "0.41.0", path = "../testing"}
testing = {version = "0.15.0", path = "../../../testing"}

View File

@ -1197,7 +1197,7 @@ fn handle_await_for(stmt: Stmt) -> Stmt {
let catch_clause = {
// _didIteratorError = true;
let mark_as_errored = Stmt::Expr(ExprStmt {
let mark_as_errorred = Stmt::Expr(ExprStmt {
span: DUMMY_SP,
expr: Box::new(Expr::Assign(AssignExpr {
span: DUMMY_SP,
@ -1225,7 +1225,7 @@ fn handle_await_for(stmt: Stmt) -> Stmt {
param: Some(Pat::Ident(err_param.clone().into())),
body: BlockStmt {
span: DUMMY_SP,
stmts: vec![mark_as_errored, store_error],
stmts: vec![mark_as_errorred, store_error],
},
}
};

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.50.1"
version = "0.51.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.14.0", path = "../../../common"}
swc_ecma_ast = {version = "0.55.0", path = "../../ast"}
swc_ecma_loader = {version = "0.22.0", path = "../../loader", features = ["node"]}
swc_ecma_parser = {version = "0.74.0", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.39.1", path = "../base"}
swc_ecma_parser = {version = "0.75.0", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.40.0", path = "../base"}
swc_ecma_utils = {version = "0.48.0", path = "../../utils"}
swc_ecma_visit = {version = "0.41.0", path = "../../visit"}
[dev-dependencies]
swc_ecma_transforms_compat = {version = "0.44.1", path = "../compat"}
swc_ecma_transforms_testing = {version = "0.40.1", path = "../testing/"}
swc_ecma_transforms_compat = {version = "0.45.0", path = "../compat"}
swc_ecma_transforms_testing = {version = "0.41.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.56.1"
version = "0.57.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
@ -28,18 +28,18 @@ 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.55.0", path = "../../ast"}
swc_ecma_parser = {version = "0.74.0", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.39.1", path = "../base"}
swc_ecma_parser = {version = "0.75.0", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.40.0", path = "../base"}
swc_ecma_transforms_macros = {version = "0.2.3", path = "../macros"}
swc_ecma_utils = {version = "0.48.0", path = "../../utils"}
swc_ecma_visit = {version = "0.41.0", path = "../../visit"}
tracing = "0.1.28"
[dev-dependencies]
swc_ecma_transforms_compat = {version = "0.44.1", path = "../compat"}
swc_ecma_transforms_module = {version = "0.50.1", path = "../module"}
swc_ecma_transforms_proposal = {version = "0.50.1", path = "../proposal"}
swc_ecma_transforms_react = {version = "0.52.1", path = "../react"}
swc_ecma_transforms_testing = {version = "0.40.1", path = "../testing"}
swc_ecma_transforms_typescript = {version = "0.53.1", path = "../typescript"}
swc_ecma_transforms_compat = {version = "0.45.0", path = "../compat"}
swc_ecma_transforms_module = {version = "0.51.0", path = "../module"}
swc_ecma_transforms_proposal = {version = "0.51.0", path = "../proposal"}
swc_ecma_transforms_react = {version = "0.53.0", path = "../react"}
swc_ecma_transforms_testing = {version = "0.41.0", path = "../testing"}
swc_ecma_transforms_typescript = {version = "0.54.0", path = "../typescript"}
testing = {version = "0.15.0", path = "../../../testing"}

View File

@ -373,7 +373,7 @@ fn test_string_number_comparison() {
}
#[test]
fn test_na_ncomparison() {
fn test_nan_comparison() {
fold("NaN < NaN", "false");
fold("NaN >= NaN", "false");
fold("NaN == NaN", "false");
@ -441,7 +441,7 @@ fn test_unary_ops_1() {
fold("a=+false", "a=0");
fold_same("a=+foo()");
fold_same("a=+f");
// fold("a=+(f?true:false)", "a=+(f?1:0)"); // TODO(johnlenz): foldable
// fold("a=+(f?true:false)", "a=+(f?1:0)");
}
#[test]
@ -530,7 +530,7 @@ fn test_fold_logical_op_2() {
// Really not foldable, because it would change the type of the
// expression if foo() returns something truthy but not true.
// Cf. FoldConstants.tryFoldAndOr().
// An example would be if foo() is 1 (truthy) and bar() is 0 (falsey):
// An example would be if foo() is 1 (truthy) and bar() is 0 (falsy):
// (1 && true) || 0 == true
// 1 || 0 == 1, but true =/= 1
fold_same("x = foo() && true || bar()");

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.50.1"
version = "0.51.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -22,16 +22,16 @@ swc_atoms = {version = "0.2", path = "../../../atoms"}
swc_common = {version = "0.14.0", path = "../../../common"}
swc_ecma_ast = {version = "0.55.0", path = "../../ast"}
swc_ecma_loader = {version = "0.22.0", path = "../../loader", optional = true}
swc_ecma_parser = {version = "0.74.0", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.39.1", path = "../base"}
swc_ecma_transforms_classes = {version = "0.25.1", path = "../classes"}
swc_ecma_parser = {version = "0.75.0", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.40.0", path = "../base"}
swc_ecma_transforms_classes = {version = "0.26.0", path = "../classes"}
swc_ecma_transforms_macros = {version = "0.2.3", path = "../macros"}
swc_ecma_utils = {version = "0.48.0", path = "../../utils"}
swc_ecma_visit = {version = "0.41.0", path = "../../visit"}
[dev-dependencies]
serde_json = "1.0.66"
swc_ecma_transforms_compat = {version = "0.44.1", path = "../compat"}
swc_ecma_transforms_module = {version = "0.50.1", path = "../module"}
swc_ecma_transforms_testing = {version = "0.40.1", path = "../testing"}
swc_ecma_transforms_compat = {version = "0.45.0", path = "../compat"}
swc_ecma_transforms_module = {version = "0.51.0", path = "../module"}
swc_ecma_transforms_testing = {version = "0.41.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.52.1"
version = "0.53.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
@ -23,15 +23,15 @@ 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.55.0", path = "../../ast"}
swc_ecma_parser = {version = "0.74.0", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.39.1", path = "../base"}
swc_ecma_parser = {version = "0.75.0", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.40.0", path = "../base"}
swc_ecma_transforms_macros = {version = "0.2.3", path = "../macros"}
swc_ecma_utils = {version = "0.48.0", path = "../../utils"}
swc_ecma_visit = {version = "0.41.0", path = "../../visit"}
[dev-dependencies]
swc_ecma_codegen = {version = "0.76.0", path = "../../codegen/"}
swc_ecma_transforms_compat = {version = "0.44.1", path = "../compat/"}
swc_ecma_transforms_module = {version = "0.50.1", path = "../module"}
swc_ecma_transforms_testing = {version = "0.40.1", path = "../testing/"}
swc_ecma_codegen = {version = "0.77.0", path = "../../codegen/"}
swc_ecma_transforms_compat = {version = "0.45.0", path = "../compat/"}
swc_ecma_transforms_module = {version = "0.51.0", path = "../module"}
swc_ecma_transforms_testing = {version = "0.41.0", path = "../testing/"}
testing = {version = "0.15.0", path = "../../../testing"}

View File

@ -666,7 +666,7 @@ where
}
}
/// Runtiem; `classic`
/// Runtime; `classic`
fn fold_attrs_for_next_classic(&mut self, attrs: Vec<JSXAttrOrSpread>) -> Box<Expr> {
if attrs.is_empty() {
return Box::new(Expr::Lit(Lit::Null(Null { span: DUMMY_SP })));

View File

@ -749,13 +749,13 @@ impl<C: Comments> Fold for Refresh<C> {
for stmt in &n.stmts {
stmt.collect_ident(&mut current_scope);
}
let orig_bindinga = self.scope_binding.len();
let orig_bindings = self.scope_binding.len();
self.scope_binding.extend(current_scope.into_iter());
let orig_hook = mem::replace(&mut self.curr_hook_fn, Vec::new());
let mut n = n.fold_children_with(self);
let curr_hook = mem::replace(&mut self.curr_hook_fn, orig_hook);
self.scope_binding.truncate(orig_bindinga);
self.scope_binding.truncate(orig_bindings);
if curr_hook.len() > 0 {
let stmt_count = n.stmts.len();

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.40.1"
version = "0.41.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -17,9 +17,9 @@ serde = "1"
serde_json = "1"
swc_common = {version = "0.14.0", path = "../../../common"}
swc_ecma_ast = {version = "0.55.0", path = "../../ast"}
swc_ecma_codegen = {version = "0.76.0", path = "../../codegen"}
swc_ecma_parser = {version = "0.74.0", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.39.1", path = "../base"}
swc_ecma_codegen = {version = "0.77.0", path = "../../codegen"}
swc_ecma_parser = {version = "0.75.0", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.40.0", path = "../base"}
swc_ecma_utils = {version = "0.48.0", path = "../../utils"}
swc_ecma_visit = {version = "0.41.0", path = "../../visit"}
tempfile = "3.1.0"

View File

@ -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.53.1"
version = "0.54.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
@ -14,17 +14,17 @@ 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.55.0", path = "../../ast"}
swc_ecma_parser = {version = "0.74.0", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.39.1", path = "../base"}
swc_ecma_transforms_react = {version = "0.52.1", path = "../react"}
swc_ecma_parser = {version = "0.75.0", path = "../../parser"}
swc_ecma_transforms_base = {version = "0.40.0", path = "../base"}
swc_ecma_transforms_react = {version = "0.53.0", path = "../react"}
swc_ecma_utils = {version = "0.48.0", path = "../../utils"}
swc_ecma_visit = {version = "0.41.0", path = "../../visit"}
[dev-dependencies]
swc_ecma_codegen = {version = "0.76.0", path = "../../codegen"}
swc_ecma_transforms_compat = {version = "0.44.1", path = "../compat"}
swc_ecma_transforms_module = {version = "0.50.1", path = "../module"}
swc_ecma_transforms_proposal = {version = "0.50.1", path = "../proposal/"}
swc_ecma_transforms_testing = {version = "0.40.1", path = "../testing"}
swc_ecma_codegen = {version = "0.77.0", path = "../../codegen"}
swc_ecma_transforms_compat = {version = "0.45.0", path = "../compat"}
swc_ecma_transforms_module = {version = "0.51.0", path = "../module"}
swc_ecma_transforms_proposal = {version = "0.51.0", path = "../proposal/"}
swc_ecma_transforms_testing = {version = "0.41.0", path = "../testing"}
testing = {version = "0.15.0", path = "../../../testing"}
walkdir = "2.3.1"

View File

@ -11,16 +11,16 @@ function __spack_require__(mod) {
cache = module.exports;
return cache;
}
var load = __spack_require__.bind(void 0, function(module, exports) {
var load = __swcpack_require__.bind(void 0, function(module, exports) {
module.exports = class Common {
};
});
var load1 = __spack_require__.bind(void 0, function(module, exports) {
var load1 = __swcpack_require__.bind(void 0, function(module, exports) {
const Common = load();
module.exports = class A extends Common {
};
});
var load2 = __spack_require__.bind(void 0, function(module, exports) {
var load2 = __swcpack_require__.bind(void 0, function(module, exports) {
const Common = load();
module.exports = class B extends Common {
};

View File

@ -11,7 +11,7 @@ function __spack_require__(mod) {
cache = module.exports;
return cache;
}
var load = __spack_require__.bind(void 0, function(module, exports) {
var load = __swcpack_require__.bind(void 0, function(module, exports) {
console.log('foo');
console.log('bar');
});

View File

@ -11,13 +11,13 @@ function __spack_require__(mod) {
cache = module.exports;
return cache;
}
var load = __spack_require__.bind(void 0, function(module, exports) {
var load = __swcpack_require__.bind(void 0, function(module, exports) {
console.log('a');
});
var load1 = __spack_require__.bind(void 0, function(module, exports) {
var load1 = __swcpack_require__.bind(void 0, function(module, exports) {
console.log('b');
});
var load2 = __spack_require__.bind(void 0, function(module, exports) {
var load2 = __swcpack_require__.bind(void 0, function(module, exports) {
console.log('c');
});
load();

View File

@ -11,23 +11,23 @@ function __spack_require__(mod) {
cache = module.exports;
return cache;
}
var load = __spack_require__.bind(void 0, function(module, exports) {
var load = __swcpack_require__.bind(void 0, function(module, exports) {
module.exports = {
default: 'a-a-a'
};
});
var load1 = __spack_require__.bind(void 0, function(module, exports) {
var load1 = __swcpack_require__.bind(void 0, function(module, exports) {
module.exports = load();
});
var load2 = __spack_require__.bind(void 0, function(module, exports) {
var load2 = __swcpack_require__.bind(void 0, function(module, exports) {
console.log('a-b');
exports.default = 'ab';
});
var load3 = __spack_require__.bind(void 0, function(module, exports) {
var load3 = __swcpack_require__.bind(void 0, function(module, exports) {
console.log('b');
module.exports = 'b';
});
var load7 = __spack_require__.bind(void 0, function(module, exports) {
var load7 = __swcpack_require__.bind(void 0, function(module, exports) {
var aa = load1();
var bb = load2();
load3();
@ -36,7 +36,7 @@ var load7 = __spack_require__.bind(void 0, function(module, exports) {
bb: bb
};
});
var load8 = __spack_require__.bind(void 0, function(module, exports) {
var load8 = __swcpack_require__.bind(void 0, function(module, exports) {
console.log('c');
});
load7();

View File

@ -11,10 +11,10 @@ function __spack_require__(mod) {
cache = module.exports;
return cache;
}
var load = __spack_require__.bind(void 0, function(module, exports) {
var load = __swcpack_require__.bind(void 0, function(module, exports) {
module.exports = 1;
});
var load1 = __spack_require__.bind(void 0, function(module, exports) {
var load1 = __swcpack_require__.bind(void 0, function(module, exports) {
module.exports = load();
});
var { default: a } = load1();

View File

@ -11,10 +11,10 @@ function __spack_require__(mod) {
cache = module.exports;
return cache;
}
var load = __spack_require__.bind(void 0, function(module, exports) {
var load = __swcpack_require__.bind(void 0, function(module, exports) {
module.exports = 1;
});
var load1 = __spack_require__.bind(void 0, function(module, exports) {
var load1 = __swcpack_require__.bind(void 0, function(module, exports) {
module.exports = load();
});
const a = load1();

View File

@ -11,7 +11,7 @@ function __spack_require__(mod) {
cache = module.exports;
return cache;
}
var load = __spack_require__.bind(void 0, function(module, exports) {
var load = __swcpack_require__.bind(void 0, function(module, exports) {
module.exports = {
"version": "1.2.47"
};

View File

@ -11,7 +11,7 @@ function __spack_require__(mod) {
cache = module.exports;
return cache;
}
var load = __spack_require__.bind(void 0, function(module, exports) {
var load = __swcpack_require__.bind(void 0, function(module, exports) {
module.exports = {
"version": "1.2.47"
};

View File

@ -40,7 +40,7 @@ function _asyncToGenerator(fn) {
});
};
}
var load = __spack_require__.bind(void 0, function(module, exports) {
var load = __swcpack_require__.bind(void 0, function(module, exports) {
/**
* Copyright (c) 2014-present, Facebook, Inc.
*

View File

@ -11,7 +11,7 @@ function __spack_require__(mod) {
cache = module.exports;
return cache;
}
var load = __spack_require__.bind(void 0, function(module, exports) {
var load = __swcpack_require__.bind(void 0, function(module, exports) {
// This is a minimal reproduction from lodash@4.17.21
function lodash(value) {
console.log('lodash');

View File

@ -11,7 +11,7 @@ function __spack_require__(mod) {
cache = module.exports;
return cache;
}
var load = __spack_require__.bind(void 0, function(module, exports) {
var load = __swcpack_require__.bind(void 0, function(module, exports) {
/*!
* node-progress
* Copyright(c) 2011 TJ Holowaychuk <tj@vision-media.ca>
@ -189,7 +189,7 @@ var load = __spack_require__.bind(void 0, function(module, exports) {
} else this.stream.write('\n');
};
});
var load1 = __spack_require__.bind(void 0, function(module, exports) {
var load1 = __swcpack_require__.bind(void 0, function(module, exports) {
module.exports = load();
});
var { default: progress } = load1();

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
"license": "Apache-2.0 AND MIT",
"keywords": [
"swc",
"spack",
"swcpack",
"babel",
"typescript",
"rust",
@ -50,6 +50,7 @@
},
"types": "./index.d.ts",
"scripts": {
"prepare": "husky install",
"artifacts": "napi artifacts --dist scripts/npm",
"prepublishOnly": "tsc -d && napi prepublish -p scripts/npm --tagstyle npm",
"build": "tsc -d && napi build --platform --release --cargo-name node --cargo-flags=\"-p node\"",
@ -75,6 +76,8 @@
"browserslist": "^4.16.6",
"core-js": "^2.6.11",
"cross-env": "^7.0.3",
"cspell": "^5.12.3",
"husky": "^7.0.2",
"jest": "^27.0.1",
"lodash": "^4.17.21",
"progress": "^2.0.3",

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.11.0"
version = "0.12.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
@ -18,9 +18,9 @@ serde_json = "1.0.64"
swc_atoms = "0.2.7"
swc_common = {version = "0.14.0", path = "../../common"}
swc_ecma_ast = {version = "0.55.0", path = "../../ecmascript/ast"}
swc_ecma_parser = {version = "0.74.0", path = "../../ecmascript/parser"}
swc_ecma_parser = {version = "0.75.0", path = "../../ecmascript/parser"}
swc_plugin = {version = "0.8.0", path = "../"}
[dev-dependencies]
swc_ecma_codegen = {version = "0.76.0", path = "../../ecmascript/codegen"}
swc_ecma_codegen = {version = "0.77.0", path = "../../ecmascript/codegen"}
testing = {version = "0.15.0", path = "../../testing"}

View File

@ -23,7 +23,7 @@ pub fn apply_js_plugin(program: &Program, path: &Path) -> Result<Program, Error>
let new = match new_ast {
RResult::ROk(v) => v,
RResult::RErr(err) => return Err(anyhow!("plugin returned an errror\n{}", err)),
RResult::RErr(err) => return Err(anyhow!("plugin returned an error\n{}", err)),
};
let new = new.into_string();

View File

@ -1,4 +1,4 @@
/// Reexported for convinience.
/// Reexported for convenience.
use abi_stable::{
library::RootModule,
package_version_strings,

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.12.0"
version = "0.13.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -15,7 +15,7 @@ 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.55.0", path = "../../ecmascript/ast"}
swc_ecma_codegen = {version = "0.76.0", path = "../../ecmascript/codegen"}
swc_ecma_codegen = {version = "0.77.0", path = "../../ecmascript/codegen"}
swc_ecma_utils = {version = "0.48.0", path = "../../ecmascript/utils"}
swc_ecma_visit = {version = "0.41.0", path = "../../ecmascript/visit"}
swc_plugin = {version = "0.8.0", path = "../"}

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "testing"
repository = "https://github.com/swc-project/swc.git"
version = "0.15.0"
version = "0.15.1"
[dependencies]
ansi_term = "0.12.1"

View File

@ -261,7 +261,7 @@ pub fn diff(l: &str, r: &str) -> String {
/// Used for assertions.
///
/// Prints string without escpaing special characters on failure.
/// Prints string without escaping special characters on failure.
#[derive(PartialEq, Eq)]
pub struct DebugUsingDisplay<'a>(pub &'a str);

View File

@ -5,7 +5,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_visit"
repository = "https://github.com/swc-project/swc.git"
version = "0.2.7"
version = "0.2.8"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -17,7 +17,7 @@
//!
//! # `Fold`
//!
//! > WARNING: `Fold` is slow, and it's recommended to use VisiMut if you are
//! > WARNING: `Fold` is slow, and it's recommended to use VisitMut if you are
//! experienced.
//!
//!
@ -68,7 +68,7 @@
//! different code if a `this` expression is used.
//!
//! You can use your `Visit` implementation like `node.visit_with(&Invalid{
//! span: DUMY_SP, }, &mut visitor`. I think API is misdesigned, but it works
//! span: DUMMY_SP, }, &mut visitor`. I think API is mis-designed, but it works
//! and there are really lots of code using `Visit` already.
pub use either::Either;

681
yarn.lock

File diff suppressed because it is too large Load Diff