AppFlowy-Cloud/libs/client-api-wasm
Nathan.fooo a371912c61
chore: enable chat with provided context (#713)
* chore: enable chat with provided context

* chore: rename

* chore: update create chat message api endpoint

* chore: use list context

* chore: use list context

* chore: fix test

* chore: update api endpoint

* chore: rename client api function

* chore: rename client api function

* chore: expose entity

* chore: update sqlx files

* chore: update test
2024-08-05 14:06:44 +08:00
..
src chore: enable chat with provided context (#713) 2024-08-05 14:06:44 +08:00
.gitignore feat: support client api to wasm (#426) 2024-04-02 15:19:21 +08:00
Cargo.toml feat: support publish interfaces for wasm (#654) 2024-07-23 17:47:21 +08:00
README.md feat: support client api to wasm (#426) 2024-04-02 15:19:21 +08:00

Client API WASM

Client-API to WebAssembly Compiler

🚴 Usage

🐑 Prepare

# Clone the repository (if you haven't already)
git clone https://github.com/AppFlowy-IO/AppFlowy-Cloud.git

# Navigate to the client-for-wasm directory
cd libs/client-api-wasm

# Install the dependencies (if you haven't already)
cargo install wasm-pack

🛠️ Build with wasm-pack build

wasm-pack build

🔬 Test in Headless Browsers with wasm-pack test

# Ensure you have geckodriver installed
wasm-pack test --headless --firefox

# or
# Ensure you have chromedriver installed
# https://googlechromelabs.github.io/chrome-for-testing/
# Example (Linux):
# 1. wget https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.86/linux64/chromedriver-linux64.zip
# 2. unzip chromedriver-linux64.zip
# 3. sudo mv chromedriver /usr/local/bin
# 4. chromedriver -v
# If you see the version, then you have successfully installed chromedriver
# Note: the version of chromedriver should match the version of chrome installed on your system
wasm-pack test --headless --chrome

🎁 Publish to NPM with wasm-pack publish

Don't publish in local development, only publish in github actions
wasm-pack publish

📦 Use your package as a dependency

npm install --save @appflowy/client-api-for-wasm

📝 How to use the package in development?

See the README.md in the AppFlowy Repository.