Skip to content

feat: add native source-map-parser CLI (crates/cli) - #14

Merged
MasonChow merged 1 commit into
mainfrom
codex/github-mention-feat-clicrates/cli,-node/wasm
Jul 15, 2026
Merged

MasonChow merged 1 commit into
mainfrom
codex/github-mention-feat-clicrates/cli,-node/wasm

Conversation

@MasonChow

Copy link
Copy Markdown
Owner

Motivation

  • Provide a native single-file CLI so callers can map minified JS stacks without Node/WASM or npm dependencies.
  • Expose the three primary library operations (map / lookup / unpack) as subcommands so behavior aligns with the Rust API surface.
  • Replace the existing template-based resolver with a safe --map-url-template string replacement (no eval/JS execution) and add an option to disable network fetches.

Description

  • Add a new workspace member crates/cli implementing a source-map-parser [[bin]] with map, lookup, and unpack subcommands and global --output/--pretty/--quiet flags.
  • Implement map semantics with mutually-exclusive --map / --map-dir / --map-url-template, per-frame context (--context), --no-fetch, JSON output shaped as { success: [...], fail: [...] }, and exit codes per the spec.
  • Reuse the existing library APIs and parsers (crates/source_map_parser and stack_transform) for mapping, token lookup (with optional context), and unpacking sources instead of reimplementing sourcemap logic.
  • Update Cargo.toml to include crates/cli in the workspace and extend .github/workflows/release.yml to build the native binary on the existing platform matrix and stage/upload source-map-parser-<platform>-<arch> artifacts with checksums; also adjust a few lifetime signatures in stack_transform to silence warnings.

Testing

  • Ran cargo check --workspace --exclude source_map_parser_node and it completed successfully.
  • Ran cargo test --workspace --exclude source_map_parser_node --all-features and all unit and integration tests passed.
  • Verified the CLI entrypoints with cargo run -q -p source-map-parser-cli -- --help and cargo run -q -p source-map-parser-cli -- map --help, which produced the expected help and usage text.
  • Local build/format/check cycles (cargo fmt, cargo check, cargo build during CI changes) completed without errors.

Codex Task

@MasonChow
MasonChow merged commit 268bb3d into main Jul 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant