Skip to content

Commit

Permalink
chore: Add a crate swc_typescript (#9085)
Browse files Browse the repository at this point in the history
**Description:**

This crate will be used for TypeScript Isolated Declaration support
  • Loading branch information
kdy1 committed Jun 21, 2024
1 parent 810461e commit 56f128f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ members = [
"crates/swc_xml",
"crates/swc_x_optimizer",
"crates/swc_transform_common",
"crates/swc_typescript",
]
resolver = "2"

Expand Down
11 changes: 11 additions & 0 deletions crates/swc_typescript/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
authors = ["강동윤 <kdy1997.dev@gmail.com>"]
description = "Proc macro for performance trace of swc"
documentation = "https://rustdoc.swc.rs/swc_trace_macro/"
edition = "2021"
license = "Apache-2.0"
name = "swc_typescript"
repository.workspace = true
version = "0.1.0"

[dependencies]
14 changes: 14 additions & 0 deletions crates/swc_typescript/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit 56f128f

Please sign in to comment.