https://github.com/leegeunhyeok/sourcemap-explorer
🗺️ Rust based sourcemap explorer for command-line interface
https://github.com/leegeunhyeok/sourcemap-explorer
Last synced: 24 days ago
JSON representation
🗺️ Rust based sourcemap explorer for command-line interface
- Host: GitHub
- URL: https://github.com/leegeunhyeok/sourcemap-explorer
- Owner: leegeunhyeok
- License: bsd-3-clause
- Created: 2024-05-30T16:51:49.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-03-29T07:22:50.000Z (about 1 month ago)
- Last Synced: 2025-03-29T07:23:18.349Z (about 1 month ago)
- Language: Rust
- Homepage:
- Size: 1.13 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sourcemap-explorer
Rust based sourcemap explorer for command-line interface.
## Features
- ⚡️ Light-weight & blazing fast
- 🗺️ Easy to reverse sourcemap mapping
- 🌱 Print original source content## Installation
```bash
# Homebrew
brew tap leegeunhyeok/tap
brew install sourcemap-explorer# Other platforms: TBD
```## Usage
```bash
# Defualt
smx ./fixtures/bundle.js.map 5:19 --content# Hermes
smx ./fixtures/bundle.hbc.map 1:95 \
--type hermes \
--hermes-packager-sourcemap ./fixtures/bundle.js.map \
--content
``````
Sourcemap explorerUsage: smx [OPTIONS]
Arguments:
Sourcemap file path
Position of the source code (eg. 1:549)Options:
--type
Type of runtime [default: default] [possible values: default, hermes]
--hermes-packager-sourcemap
If you use Hermes runtime (--type hermes),
you need to provide the sourcemap file path of the packager (eg. Metro)
--content
Print the original source content
--json
Print the result in JSON format
-h, --help
Print help
-V, --version
Print version
```
Hermes
> This section is a guide to lookup packager sourcemap from Hermes bytecode sourcemap manually.
```bash
./hermesc ./fixtures/bundle.hbc
``````
Hello, world!
Uncaught Error: Boom!
at anonymous (address at ./fixtures/bundle.hbc:1:95)
at global (address at ./fixtures/bundle.hbc:1:9)
``````bash
smx ./fixtures/bundle.hbc.map 1:95# File - ./fixtures/bundle.js
# Position - :5:19
``````js
// `:5:19` in bundle.js
throw new Error('Boom!');
```And you can find the original source code from `index.js`
```bash
smx ./fixtures/bundle.js.map 5:19 --content
```
## Development
```bash
# Run with fixtures
cargo run -- ./fixtures/bundle.js.map 1:549 --content# build
./scripts/build.sh
```## License
[BSD 3-Clause](./LICENSE)