Skip to content

Latest commit

 

History

History
92 lines (57 loc) · 2.4 KB

DEVELOPMENT.md

File metadata and controls

92 lines (57 loc) · 2.4 KB

Development

The recast-navigation-js repository is structured as a yarn monorepo. You will find all published packages inside ./packages, reference examples in ./examples, and deployed applications in ./apps.

Prerequisites

Node Installation

This project uses node 22.

If you don't already use a node version manager. Give nvm a try if you don't already have one.

https://github.com/nvm-sh/nvm

Yarn Installation

This project uses yarn 4.

If you have Corepack enabled, you should be able to use this project's yarn version without doing anything special. If you don't have Corepack enabled, you can enable it by running the following:

> corepack enable

Python Installation

This project uses Python 3

A python version manager will make your life easier. Give pyenv a try if you don't already have one.

https://github.com/pyenv/pyenv

Emscripten Installation

This project uses Emsdk v3.1.58.

On mac / linux, you can install emscripten with the following instructions.

# enter a directory you're happy to put emscripten in
cd ~/Development

# Clone the emsdk repo
git clone https://github.com/emscripten-core/emsdk.git

# Enter that directory
cd emsdk

# Download and install recast-navigation's required version of emscripten
./emsdk install 3.1.58

# Activate the emsdk version you just installed
./emsdk activate 3.1.58

# Activate PATH and other environment variables in the current terminal
source ./emsdk_env.sh

For the latest installation instructions, as well as windows installation instructions, see the emscripten website: https://emscripten.org/docs/getting_started/downloads.html

After you have installed emscripten, you can sanity check that you have the correct version installed by running:

> emcc --version

Building

Once you have the above installed, run the following to install dependencies and build all packages:

> yarn install
> yarn build

To run the storybooks, run the following:

cd packages/recast-navigation
yarn storybook

Debugging WASM

In order to debug @recast-navigation/wasm, you must build the library in debug mode, then rebuild @recast-navigation/core:

(cd packages/recast-navigation-wasm && yarn build:debug)
(cd packages/recast-navigtion-core && yarn build)

You can then follow these instructions to setup chrome for debugging WASM: https://developer.chrome.com/blog/wasm-debugging-2020/