#!/bin/bash set -e echo "๐Ÿ”จ Building atproto-plc WASM module..." echo "" # Check if wasm-pack is installed if ! command -v wasm-pack &> /dev/null; then echo "โŒ Error: wasm-pack is not installed" echo " Install it with: cargo install wasm-pack" exit 1 fi # Check if wasm32 target is installed if ! rustup target list | grep -q "wasm32-unknown-unknown (installed)"; then echo "๐Ÿ“ฆ Installing wasm32-unknown-unknown target..." rustup target add wasm32-unknown-unknown fi # Clean previous build if [ -d "pkg" ]; then echo "๐Ÿงน Cleaning previous build..." rm -rf pkg fi # Build for Node.js echo "๐Ÿ”ง Building WASM module for Node.js..." cd .. wasm-pack build \ --target nodejs \ --out-dir wasm/pkg \ --features wasm \ --release cd wasm echo "" echo "โœ… Build complete!" echo "" echo "๐Ÿ“ฆ WASM module output:" ls -lh pkg/*.wasm echo "" echo "๐Ÿ“ Next steps:" echo " 1. Install Node.js dependencies: npm install" echo " 2. Run the tool: node plc-audit.js did:plc:z72i7hdynmk6r22z27h6tvur"