From da70ebed692d734ac4c042cd6a67fee9da793731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Fri, 31 May 2024 09:56:21 +0900 Subject: [PATCH] feat(x): Initialize project (#8999) **Description:** SWC X will be a cross-module optimizer that utilizes an enormous amount of information. After merging this, I'll experiment with several approaches. --- Cargo.lock | 4 ++++ Cargo.toml | 1 + crates/swc_x_optimizer/Cargo.toml | 11 +++++++++++ crates/swc_x_optimizer/src/lib.rs | 14 ++++++++++++++ 4 files changed, 30 insertions(+) create mode 100644 crates/swc_x_optimizer/Cargo.toml create mode 100644 crates/swc_x_optimizer/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 1118a1a88d04..0559ceb0146f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5299,6 +5299,10 @@ dependencies = [ "syn 2.0.55", ] +[[package]] +name = "swc_x_optimizer" +version = "0.1.0" + [[package]] name = "swc_xml" version = "0.13.22" diff --git a/Cargo.toml b/Cargo.toml index 6cc4837e1bdf..1ef222523e6d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,6 +21,7 @@ members = [ "crates/swc_plugin_proxy", "crates/swc_timer", "crates/swc_xml", + "crates/swc_x_optimizer", ] resolver = "2" diff --git a/crates/swc_x_optimizer/Cargo.toml b/crates/swc_x_optimizer/Cargo.toml new file mode 100644 index 000000000000..2447d6b0335d --- /dev/null +++ b/crates/swc_x_optimizer/Cargo.toml @@ -0,0 +1,11 @@ +[package] +authors = ["강동윤 "] +description = "Cross-module optimizer built on SWC" +edition = "2021" +license = "Apache-2.0" +name = "swc_x_optimizer" +repository = "https://github.com/swc-project/swc.git" +version = "0.1.0" + + +[dependencies] diff --git a/crates/swc_x_optimizer/src/lib.rs b/crates/swc_x_optimizer/src/lib.rs new file mode 100644 index 000000000000..7d12d9af8195 --- /dev/null +++ b/crates/swc_x_optimizer/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +}