@react-native-webapis/scan
is a tool for scanning your code bases for
potential uses of Web APIs.
- Install Rust
- Build:
cargo build --release
A binary will be output at target/release/scan
. Make note of this location or
copy the binary somewhere that you can easily access later.
./scan
This is currently a very simple tool. It takes no arguments and simply scans all
.js
and .ts
files it finds in the current working directory. For each file
it finds, it tries to parse using SWC. Once parsed, it will
try to count all references to navigator.*
and any identifiers listed in
src/web_apis.rs
. Files or directories that are listed in src/ignored_dirs.rs
are skipped.
You can see examples of output in merge.mjs
. This is a script we use to
aggregate the output from multiple repositories.