Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
^target/
target
tests/*/instrumented.*
pkg/
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.

20 changes: 15 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,28 @@ 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]
wasm = ["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 = { version = "1", features = ["derive"] }

# wasm
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"
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
# Orchestion-JS

Orchestrion is a library for instrumenting Node.js libraries at build or load time.
It provides [`VisitMut`] implementations for SWC's AST nodes, which can be used to insert tracing code into matching functions.
It's entirely configurable via a YAML string, and can be used in SWC plugins, or anything else that mutates JavaScript ASTs using SWC.
Orchestrion is a library for instrumenting Node.js libraries at build or load
time.

It provides `VisitMut` implementations for SWC's AST nodes, which can be used to
insert tracing code into matching functions. It can be used in SWC plugins, or
anything else that mutates JavaScript ASTs using SWC.

Orchestrion can also be built as a JavaScript module, which can be used from
Node.js.

To build the JavaScript module, ensure you have
[Rust installed](https://www.rust-lang.org/tools/install) and then run:

```bash
npm install && npm run build
```

## Contributing

Expand All @@ -11,5 +24,3 @@ See CONTRIBUTING.md
## License

See LICENSE

[`VisitMut`]: https://rustdoc.swc.rs/swc_core/ecma/visit/trait.VisitMut.html
Loading