feat: make the web version fully working (#67)

Reviewed-on: #67
This commit was merged in pull request #67.
This commit is contained in:
2026-10-25 13:10:51 +00:00
parent 3212951ed4
commit 0824b1825b
42 changed files with 2948 additions and 936 deletions
+8 -10
View File
@@ -1,4 +1,4 @@
.PHONY: help dev build-wasm build-web build clean install
.PHONY: help dev build-wasm build-wasm-dev build-web build-web-prod build build-prod preview clean install watch-wasm
help: ## Show help information
@echo "Coop - Available commands:"
@@ -7,11 +7,9 @@ help: ## Show help information
install: ## Install all dependencies
@echo "Checking Rust WASM target..."
@rustup target add wasm32-unknown-unknown || true
@echo "Checking wasm-bindgen-cli..."
@cargo install wasm-bindgen-cli || true
@rustup target add wasm32-unknown-unknown --toolchain nightly || true
@echo "Installing frontend dependencies..."
@cd www && deno install
@cd www && npm install
build-wasm: ## Build WASM (release mode)
@./script/build-wasm.sh --release
@@ -20,20 +18,20 @@ build-wasm-dev: ## Build WASM (debug mode)
@./script/build-wasm.sh
build-web: ## Build frontend
@cd www && deno task build
@cd www && npm run build
build-web-prod: ## Build frontend for production (GitHub Pages)
@cd www && deno install && NODE_ENV=production deno task build
@cd www && npm install && NODE_ENV=production npm run build
build: build-wasm build-web ## Build complete project (WASM + frontend)
build-prod: build-wasm build-web-prod ## Build complete project for production
dev: build-wasm-dev ## Start development server
@cd www && deno install && deno task dev
@cd www && npm install && npm run dev
preview: ## Preview production build
@cd www && deno task preview
@cd www && npm run preview
clean: ## Clean build artifacts
@echo "Cleaning build artifacts..."
@@ -43,4 +41,4 @@ clean: ## Clean build artifacts
watch-wasm: ## Watch Rust code changes and auto-rebuild WASM
@echo "Watching WASM changes..."
@cargo watch -x 'build --target wasm32-unknown-unknown' -s './script/build-wasm.sh'
@cargo watch -w ../crates -w ../Cargo.toml -w ../Cargo.lock -s './script/build-wasm.sh'