From c641d0ae2e05412a9b6ac6f35674758684cff28b Mon Sep 17 00:00:00 2001 From: Sameh Abouel-saad Date: Wed, 11 Jun 2025 14:22:05 +0300 Subject: [PATCH] feat: Update build scripts for crypto_vault_extension --- Makefile | 7 ++++--- build.sh | 26 ++++++++------------------ 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index 9a05159..012c5cb 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,7 @@ build-wasm-app: cd wasm_app && wasm-pack build --target web # Build Hero Vault extension: wasm, copy, then extension -build-hero-vault-extension: - cd wasm_app && wasm-pack build --target web - cd hero_vault_extension && npm run build \ No newline at end of file +build-crypto-vault-extension: build-wasm-app + cp wasm_app/pkg/wasm_app* crypto_vault_extension/wasm/ + cp wasm_app/pkg/*.d.ts crypto_vault_extension/wasm/ + cp wasm_app/pkg/*.js crypto_vault_extension/wasm/ diff --git a/build.sh b/build.sh index 6da007b..9b36b57 100755 --- a/build.sh +++ b/build.sh @@ -17,32 +17,22 @@ cd "$(dirname "$0")/wasm_app" || exit 1 wasm-pack build --target web echo -e "${GREEN}✓ WASM build successful!${RESET}" -# Step 2: Build the frontend extension -echo -e "${BLUE}Building frontend extension...${RESET}" -cd ../hero_vault_extension || exit 1 +# 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..." -mkdir -p public/wasm -cp ../wasm_app/pkg/wasm_app* public/wasm/ -cp ../wasm_app/pkg/*.d.ts public/wasm/ -cp ../wasm_app/pkg/package.json public/wasm/ +cp ../wasm_app/pkg/wasm_app* wasm/ +cp ../wasm_app/pkg/*.d.ts wasm/ +cp ../wasm_app/pkg/*.js wasm/ -# Build the extension without TypeScript checking -echo "Building extension..." -export NO_TYPECHECK=true -npm run build - -# Ensure the background script is properly built -echo "Building background script..." -node scripts/build-background.js -echo -e "${GREEN}✓ Frontend build successful!${RESET}" echo -e "${GREEN}=== Build Complete ===${RESET}" -echo "Extension is ready in: $(pwd)/dist" +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 'dist' directory: $(pwd)/dist" +echo "4. Select the $(pwd) directory"