ast-grep-wasm

Crates.ioast-grep-wasm
lib.rsast-grep-wasm
version0.1.5
sourcesrc
created_at2022-09-06 05:10:38.63966
updated_at2022-09-22 03:21:48.136217
descriptionSearch and Rewrite code at large scale using precise AST pattern
homepage
repositoryhttps://github.com/ast-grep/ast-grep
max_upload_size
id659289
size6,833
Herrington Darkholme (HerringtonDarkholme)

documentation

README

Setup Guide

Unfortunately wasm-pack does not support compiling C dependency with stdlib. We have to use emcc.

We have to use web-tree-sitter

~~

  1. Install emcc
  2. rustup target add wasm32-unknown-emscripten
  3. cargo install -f wasm-bindgen-cli
  4. EMCC_CFLAGS="-s ERROR_ON_UNDEFINED_SYMBOLS=0 --no-entry" cargo build --target wasm32-unknown-emscripten
  5. wasm-bindgen --target web ../../target/wasm32-unknown-emscripten/debug/ast_grep_wasm.wasm --out-dir pkg

Reference

https://github.com/MolotovCherry/tree-sitter-wasm https://github.com/rustwasm/wasm-pack/issues/741 https://stackoverflow.com/questions/67474533/error-in-compiling-rust-into-webassembly-using-emscripten-on-windows https://github.com/rustwasm/wasm-pack/blob/master/src/command/build.rs ~~

Commit count: 2784

cargo fmt