Development Setup¶
Guide to setting up a development environment for IFClite.
Prerequisites¶
Required Tools¶
| Tool | Version | Purpose |
|---|---|---|
| Node.js | 18.0+ | JavaScript runtime |
| pnpm | 8.0+ | Package manager |
| Rust | stable | WASM compilation |
| wasm-pack | 0.12+ | WASM toolchain |
Installing Prerequisites¶
# Install Node.js (Ubuntu/Debian)
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
# Install pnpm
npm install -g pnpm
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
# Add WASM target
rustup target add wasm32-unknown-unknown
# Install wasm-pack
cargo install wasm-pack
Clone and Build¶
1. Clone Repository¶
2. Install Dependencies¶
3. Build All Packages¶
4. Verify Build¶
Project Structure¶
ifc-lite/
├── rust/ # Rust crates
│ ├── core/ # Parser crate
│ ├── geometry/ # Geometry crate
│ └── wasm-bindings/ # WASM crate
├── packages/ # TypeScript packages
│ ├── parser/ # @ifc-lite/parser
│ ├── geometry/ # @ifc-lite/geometry
│ ├── renderer/ # @ifc-lite/renderer
│ ├── query/ # @ifc-lite/query
│ ├── data/ # @ifc-lite/data
│ ├── export/ # @ifc-lite/export
│ └── codegen/ # Schema generator
├── apps/
│ └── viewer/ # Demo viewer app
├── docs/ # Documentation
└── plan/ # Specifications
Development Workflow¶
Watch Mode¶
Run all packages in watch mode:
Or specific packages:
Running the Viewer¶
Open http://localhost:5173 in your browser.
Building WASM¶
The output goes to rust/wasm-bindings/pkg/.
Running Rust Tests¶
Generating Documentation¶
Rust Documentation (rustdoc):
# Generate and open in browser
cd rust && cargo doc --no-deps --open
# Generate for specific crate
cd rust/core && cargo doc --open
# Generate without opening
cargo doc --no-deps
# Output: target/doc/index.html
MkDocs (Project Documentation):
IDE Setup¶
VS Code¶
Install recommended extensions:
{
"recommendations": [
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml",
"bradlc.vscode-tailwindcss",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint"
]
}
Settings¶
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[rust]": {
"editor.defaultFormatter": "rust-lang.rust-analyzer"
},
"rust-analyzer.cargo.features": "all"
}
Common Tasks¶
Adding a Dependency¶
TypeScript packages:
Rust crates:
Creating a New Package¶
mkdir packages/new-package
cd packages/new-package
# Initialize
pnpm init
# Add to workspace (update root package.json if needed)
Updating Dependencies¶
Troubleshooting¶
WASM Build Fails¶
Node Modules Issues¶
TypeScript Errors¶
Contributing Changes¶
1. Create a Branch¶
2. Make Changes¶
Make your changes and test them:
3. Create Pull Request¶
Push your branch and open a PR on GitHub:
PR Requirements: - All tests pass - Code builds successfully - Clear description of changes - Reference related issues if applicable
Next Steps¶
- Testing - Testing guide