Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: CI
on: [push]
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
RUST_VERSION: 1.84.1
Expand All @@ -14,6 +14,10 @@ jobs:
run: rustup toolchain install ${{ env.RUST_VERSION }} --component clippy --component rustfmt && rustup default ${{ env.RUST_VERSION }}
- name: Cache
uses: Swatinem/rust-cache@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
- name: Build
run: cargo build --all
- name: Run tests
Expand All @@ -22,6 +26,8 @@ jobs:
run: cargo clippy --all -- -D warnings
- name: Run fmt
run: cargo fmt --all -- --check
- name: Build and Test wasm
run: npm install && npm run build && npm test
- name: Install license tool
run: cargo install dd-rust-license-tool
- name: Run license tool
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
^target/
target
tests/*/instrumented.*
pkg/
node_modules/
package-lock.json
137 changes: 107 additions & 30 deletions Cargo.lock

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

23 changes: 18 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,31 @@ rust-version = "1.84.1"
license = "Apache-2.0"

[lib]
# crate-type = ["cdylib"]
# This was originally set as above, but commented to run tests in tests folder.
crate-type = ["cdylib", "rlib"]

[profile.release]
lto = true
[features]
serde = ["serde/derive"]
wasm = ['serde', "wasm-bindgen", "tsify", "getrandom"]

[dependencies]
nodejs-semver = "4"
nodejs-semver = { version = "4", features = ["serde"] }
swc = "21"
swc_core = { version = "22", features = ["ecma_plugin_transform","ecma_quote"] }
swc_ecma_parser = "11"
swc_ecma_visit = { version = "8", features = ["path"] }

# serde feature
serde = { version = "1", features = ["derive"], optional = true }

# wasm feature
wasm-bindgen = { version = "0.2", optional = true }
tsify = { version='0.5', features = ["js"], optional = true}
# we need this to enable the js feature
getrandom = { version = "*", features = ["js"], optional = true }

[dev-dependencies]
assert_cmd = "2"

[profile.release]
lto = true
opt-level = "s"
Loading