Skip to content

Commit

Permalink
feat: rewrite compiler in rust, first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
alekitto committed Oct 15, 2023
0 parents commit 66bfe74
Show file tree
Hide file tree
Showing 35 changed files with 4,904 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/target
/Cargo.lock
/node_modules
3 changes: 3 additions & 0 deletions .mocha.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Inject jest's assertion (expect) into global scope for the Mocha
// to use same assertion between node-swc & rest.
global.expect = require("expect");
12 changes: 12 additions & 0 deletions .mocharc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* https://github.com/swc-project/swc/pull/3009
*
* There are 2 test runners in this repo:
* - jest is being used for unit testing node-swc packages with javascript test cases
* - mocha is being used for cargo's test requires js runtime to validate its transform.
*
* This config is for the mocha test runner invoked by cargo to resolve its global setup file.
*/
module.exports = {
require: require.resolve("./.mocha.setup.js"),
};
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
46 changes: 46 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[package]
name = "jymfony-compiler"
version = "0.1.0"
edition = "2021"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
anyhow = { version = "1", features = ["backtrace"] }
base64 = "0.21.4"
getrandom = { version = "0.2.10", features = ["js"] }
js-sys = "0.3"
lazy_static = "1.4.0"
rand = "0.8.5"
rustc-hash = "1.1.0"
serde = { version = "1.0", features = ["derive"] }
serde-wasm-bindgen = "0.6"
sourcemap = "6.4.1"
swc_atoms = "0.6.0"
swc_common = { version = "0.33.0", features = ["anyhow", "sourcemap"] }
swc_ecma_ast = "0.110.0"
swc_ecma_codegen = "0.146.1"
swc_ecma_parser = "0.141.1"
swc_ecma_transforms_base = "0.134.3"
swc_ecma_transforms_compat = "0.160.4"
swc_ecma_transforms_module = "0.177.4"
swc_ecma_transforms_proposal = "0.168.6"
swc_ecma_transforms_typescript = "0.184.6"
swc_ecma_visit = "0.96.0"
swc_ecma_utils = "0.124.3"
url = "2.4"
wasm-bindgen = { version = "0.2", features = ["serde-serialize"] }
wasm-bindgen-derive = "0.2"

[dev-dependencies]
ansi_term = "0.12.1"
hex = "0.4.3"
sha1 = "0.10.6"
swc_ecma_transforms_testing = "0.137.4"
tempfile = "3.8.0"
testing = "0.35.0"
wasm-bindgen-test = "0.3"

[profile.release]
opt-level = 3
Loading

0 comments on commit 66bfe74

Please sign in to comment.