#!/bin/bash # Main build script for Hero Vault Extension # This script handles the complete build process in one step set -e # Exit on any error # Colors for better readability GREEN="\033[0;32m" BLUE="\033[0;34m" RESET="\033[0m" echo -e "${BLUE}=== Building Hero Vault Extension ===${RESET}" # Step 1: Build the WASM package echo -e "${BLUE}Building WASM package...${RESET}" cd "$(dirname "$0")/wasm_app" || exit 1 wasm-pack build --target web echo -e "${GREEN}✓ WASM build successful!${RESET}" # Step 2: Prepare the frontend extension echo -e "${BLUE}Preparing frontend extension...${RESET}" cd ../crypto_vault_extension || exit 1 # Copy WASM files to the extension's public directory echo "Copying WASM files..." cp ../wasm_app/pkg/wasm_app* wasm/ cp ../wasm_app/pkg/*.d.ts wasm/ cp ../wasm_app/pkg/*.js wasm/ echo -e "${GREEN}=== Build Complete ===${RESET}" echo "Extension is ready in: $(pwd)" echo "" echo -e "${BLUE}To load the extension in Chrome:${RESET}" echo "1. Go to chrome://extensions/" echo "2. Enable Developer mode (toggle in top-right)" echo "3. Click 'Load unpacked'" echo "4. Select the $(pwd) directory"