Skip to content

Commit 58f2602

Browse files
authored
chore(es/transformer): Determine project structure (#11306)
1 parent cee5548 commit 58f2602

File tree

19 files changed

+429
-0
lines changed

19 files changed

+429
-0
lines changed

Cargo.lock

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[package]
2+
authors = ["강동윤 <kdy1997.dev@gmail.com>"]
3+
description = "Compatibility layer for the ECMAScript standard"
4+
documentation = "https://rustdoc.swc.rs/swc_ecma_transformer/"
5+
edition = { workspace = true }
6+
include = ["Cargo.toml", "src/**/*.rs"]
7+
license = { workspace = true }
8+
name = "swc_ecma_transformer"
9+
repository = { workspace = true }
10+
version = "0.1.0"
11+
12+
[lints.rust]
13+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(swc_ast_unknown)'] }
14+
15+
[dependencies]
16+
tracing = { workspace = true }
17+
swc_ecma_ast = { version = "18.0.0", path = "../swc_ecma_ast" }
18+
swc_ecma_hooks = { version = "0.2.0", path = "../swc_ecma_hooks" }
19+
swc_ecma_transforms_base = { version = "30.0.0", path = "../swc_ecma_transforms_base" }
20+
swc_ecma_utils = { version = "24.0.0", path = "../swc_ecma_utils" }
21+
swc_ecma_visit = { version = "18.0.1", path = "../swc_ecma_visit" }
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
use swc_ecma_hooks::VisitMutHook;
2+
3+
use crate::TraverseCtx;
4+
5+
#[derive(Debug, Default)]
6+
pub struct BugfixOptions {}
7+
8+
pub fn hook(options: BugfixOptions) -> impl VisitMutHook<TraverseCtx> {
9+
BugfixPass { options }
10+
}
11+
12+
struct BugfixPass {
13+
options: BugfixOptions,
14+
}
15+
16+
impl VisitMutHook<TraverseCtx> for BugfixPass {}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
use swc_ecma_hooks::VisitMutHook;
2+
3+
use crate::TraverseCtx;
4+
5+
#[derive(Debug, Default)]
6+
pub struct DecoratorOptions {}
7+
8+
pub fn hook(options: DecoratorOptions) -> impl VisitMutHook<TraverseCtx> {
9+
DecoratorPass { options }
10+
}
11+
12+
struct DecoratorPass {
13+
options: DecoratorOptions,
14+
}
15+
16+
impl VisitMutHook<TraverseCtx> for DecoratorPass {}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
use swc_ecma_hooks::VisitMutHook;
2+
3+
use crate::TraverseCtx;
4+
5+
#[derive(Debug, Default)]
6+
pub struct Es2015Options {}
7+
8+
pub fn hook(options: Es2015Options) -> impl VisitMutHook<TraverseCtx> {
9+
Es2015Pass { options }
10+
}
11+
12+
struct Es2015Pass {
13+
options: Es2015Options,
14+
}
15+
16+
impl VisitMutHook<TraverseCtx> for Es2015Pass {}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
use swc_ecma_hooks::VisitMutHook;
2+
3+
use crate::TraverseCtx;
4+
5+
#[derive(Debug, Default)]
6+
pub struct Es2016Options {}
7+
8+
pub fn hook(options: Es2016Options) -> impl VisitMutHook<TraverseCtx> {
9+
Es2016Pass { options }
10+
}
11+
12+
struct Es2016Pass {
13+
options: Es2016Options,
14+
}
15+
16+
impl VisitMutHook<TraverseCtx> for Es2016Pass {}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
use swc_ecma_hooks::VisitMutHook;
2+
3+
use crate::TraverseCtx;
4+
5+
#[derive(Debug, Default)]
6+
pub struct Es2017Options {}
7+
8+
pub fn hook(options: Es2017Options) -> impl VisitMutHook<TraverseCtx> {
9+
Es2017Pass { options }
10+
}
11+
12+
struct Es2017Pass {
13+
options: Es2017Options,
14+
}
15+
16+
impl VisitMutHook<TraverseCtx> for Es2017Pass {}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
use swc_ecma_hooks::VisitMutHook;
2+
3+
use crate::TraverseCtx;
4+
5+
#[derive(Debug, Default)]
6+
pub struct Es2018Options {}
7+
8+
pub fn hook(options: Es2018Options) -> impl VisitMutHook<TraverseCtx> {
9+
Es2018Pass { options }
10+
}
11+
12+
struct Es2018Pass {
13+
options: Es2018Options,
14+
}
15+
16+
impl VisitMutHook<TraverseCtx> for Es2018Pass {}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
use swc_ecma_hooks::VisitMutHook;
2+
3+
use crate::TraverseCtx;
4+
5+
#[derive(Debug, Default)]
6+
pub struct Es2019Options {}
7+
8+
pub fn hook(options: Es2019Options) -> impl VisitMutHook<TraverseCtx> {
9+
Es2019Pass { options }
10+
}
11+
12+
struct Es2019Pass {
13+
options: Es2019Options,
14+
}
15+
16+
impl VisitMutHook<TraverseCtx> for Es2019Pass {}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
use swc_ecma_hooks::VisitMutHook;
2+
3+
use crate::TraverseCtx;
4+
5+
#[derive(Debug, Default)]
6+
pub struct Es2020Options {}
7+
8+
pub fn hook(options: Es2020Options) -> impl VisitMutHook<TraverseCtx> {
9+
Es2020Pass { options }
10+
}
11+
12+
struct Es2020Pass {
13+
options: Es2020Options,
14+
}
15+
16+
impl VisitMutHook<TraverseCtx> for Es2020Pass {}

0 commit comments

Comments
 (0)