* add keyboard handler * some cleanup * add l key binding * Fix WASM shared memory generation for Rust nightly 2025-10-20+ Add explicit linker flags for shared memory generation after Rust PR #147225 removed automatic flags with +atomics. This fixes DataCloneError when sharing memory with workers. Changes: - Add --shared-memory, --max-memory, --import-memory flags - Export TLS symbols: __wasm_init_tls, __tls_size, __tls_align, __tls_base - Update both Cargo.toml and package.json build scripts Amp-Thread-ID: https://ampcode.com/threads/T-41d99b69-5754-4fdf-b06e-a46343fa7485 Co-authored-by: Amp <amp@ampcode.com> * add a level-editor crate * remove redundant worker setup * simplify app setup * add SceneBuilder * separate out default scene implementation in a crate * define default method for MeshBuilder --------- Co-authored-by: Amp <amp@ampcode.com>
20 lines
1.2 KiB
Markdown
20 lines
1.2 KiB
Markdown
# Build, Lint, and Test Commands
|
|
- `npm run dev`: Start Vite dev server with hot reload for WASM bundle
|
|
- `npm run build`: Build optimized WASM and JS in `dist/` for development
|
|
- `npm run build-release`: Build optimized WASM and JS for production
|
|
- `cargo check`: Validate Rust sources quickly before full builds
|
|
- `cargo fmt`: Format Rust code with rustfmt
|
|
- No unit tests currently exist; add them as `*_tests.rs` modules
|
|
|
|
# Code Style Guidelines
|
|
- **Rust 2021 idioms**: Use snake_case for modules, files, functions, and variables
|
|
- **Indentation**: 4 spaces (configured in rustfmt)
|
|
- **Imports**: Group std library, external crates, then local modules
|
|
- **Types**: Use descriptive struct fields and enum variants (e.g., `positions`, `normals`)
|
|
- **Error handling**: Use `thiserror` derive macro for custom error types
|
|
- **Naming**: Mirror GLTF semantics explicitly in struct fields
|
|
- **WGSL shaders**: Keep binding names aligned with Rust bind group layouts
|
|
- **JavaScript/TypeScript**: Format with prettier defaults
|
|
- **Comments**: Add documentation comments for public APIs using `///`
|
|
- **Logging**: Use `log::info!`, `log::error!`, etc. from the log crate, not `println!`
|