AppFlowy-Cloud/libs/client-api-wasm
Kilu.He 3bf5fb057d
feat: support client api to wasm (#426)
* feat: support client api to wasm

* fix: cargo fmt

* fix: delete github config

* fix: readme

* feat: add wasm ci

* fix: code review

* fix: add test

* fix: add sign in test

* fix: test error

---------

Co-authored-by: root <root@DESKTOP-RCFUF7L>
Co-authored-by: nathan <nathan@appflowy.io>
2024-04-02 15:19:21 +08:00
..
src feat: support client api to wasm (#426) 2024-04-02 15:19:21 +08:00
.gitignore feat: support client api to wasm (#426) 2024-04-02 15:19:21 +08:00
Cargo.toml feat: support client api to wasm (#426) 2024-04-02 15:19:21 +08:00
README.md feat: support client api to wasm (#426) 2024-04-02 15:19:21 +08:00

README.md

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.