- Add `pnpm build:rapier2d` command to automate Rapier2D WASM build process - Fix gen-src.mjs path to correctly locate thirdparty/rapier.js - Update init.ts to work with new wasm-pack web target (auto-initialization) - Fix behavior-tree-editor build config for asset-system dependency - Update README_CN.md and README.md with simplified build instructions
3.1 KiB
3.1 KiB
ESEngine Editor
A cross-platform desktop visual editor built with Tauri 2.x + React 18.
Prerequisites
Before running the editor, ensure you have the following installed:
- Node.js >= 18.x
- pnpm >= 10.x
- Rust >= 1.70 (for Tauri and WASM builds)
- wasm-pack (for building Rapier2D physics engine)
- Platform-specific dependencies:
- Windows: Microsoft Visual Studio C++ Build Tools
- macOS: Xcode Command Line Tools (
xcode-select --install) - Linux: See Tauri prerequisites
Installing wasm-pack
# Using cargo
cargo install wasm-pack
# Or using the official installer script (Linux/macOS)
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
Quick Start
1. Clone and Install
git clone https://github.com/esengine/esengine.git
cd esengine
pnpm install
2. Build Rapier2D WASM
The editor depends on Rapier2D physics engine WASM artifacts. First-time setup only requires one command:
pnpm build:rapier2d
This command automatically:
- Prepares the Rust project
- Builds WASM
- Copies artifacts to
packages/physics/rapier2d/pkg - Generates TypeScript source code
Note
: Requires Rust and wasm-pack to be installed.
3. Build Editor
From the project root:
pnpm build:editor
4. Run Editor
cd packages/editor/editor-app
pnpm tauri:dev
Available Scripts
| Script | Description |
|---|---|
pnpm build:rapier2d |
Build Rapier2D WASM (required for first-time setup) |
pnpm build:editor |
Build editor and all dependencies |
pnpm tauri:dev |
Run editor in development mode with hot-reload |
pnpm tauri:build |
Build production application |
pnpm build:sdk |
Build editor-runtime SDK |
Project Structure
editor-app/
├── src/ # React application source
│ ├── components/ # UI components
│ ├── panels/ # Editor panels
│ └── services/ # Core services
├── src-tauri/ # Tauri (Rust) backend
├── public/ # Static assets
└── scripts/ # Build scripts
Troubleshooting
Rapier2D WASM Build Failed
Error: Could not resolve "../pkg/rapier_wasm2d"
Cause: Missing Rapier2D WASM artifacts.
Solution:
- Ensure
wasm-packis installed:cargo install wasm-pack - Run
pnpm build:rapier2d - Verify
packages/physics/rapier2d/pkg/directory exists and containsrapier_wasm2d_bg.wasmfile
Build Errors
pnpm clean
pnpm install
pnpm build:editor
Rust/Tauri Errors
rustup update
Windows Users Building WASM
The pnpm build:rapier2d script works directly on Windows. If you encounter issues:
- Use Git Bash or WSL
- Or download pre-built WASM artifacts from Releases
Documentation
License
MIT License