Skip to content

Latest commit

 

History

History
60 lines (37 loc) · 3.22 KB

CONTRIBUTING.md

File metadata and controls

60 lines (37 loc) · 3.22 KB

Contributing guide

PRs are always a huge help 💛. Check out issues marked as good first issue or help wanted to get started.

First fork, then clone the repo:

git clone git@github.com:your-username/zebar.git

If not already installed, install Rust and Node.js v20, then run:

# Install pnpm (package manager).
npm i -g pnpm

# Install dependencies.
pnpm i

# Start in development mode.
pnpm dev

After making your changes, push to your fork and submit a pull request. Please try to address only a single feature or fix in the PR so that it's easy to review.

Installing Rust

rustup is the de-facto way to set up the Rust toolchain.

Installing Node.js

Install Node.js via the official download or a version manager like NVM (download - works on Unix and WSL/Git Bash on Windows).

Architecture

Zebar is split into 2 packages:

  • desktop

A Tauri desktop application which acts as the backend for spawning and communicating with windows.

  • client-api

JS package for communicating with the Tauri backend. Published to npm as zebar.

How to create a new provider?

  1. Add the client-side logic for the provider. Most providers aren't client-side heavy, and simply subscribe to some outputs sent from the Tauri backend (eg. create-ip-provider.ts).

    1. Add a new provider under client-api/src/providers/<YOUR_PROVIDER>.
    2. Modify create-provider.ts to add the new provider to the ProviderConfigMap and ProviderMap types, and to create the provider in the switch statement within createProvider.
    3. Export the provider's types from client-api/src/providers/index.ts.
  2. Add the backend logic for the provider.

    1. Add the logic for the provider under desktop/src/providers/<YOUR_PROVIDER>.
    2. Add the provider's config to the ProviderConfig enum.
    3. Add the provider's outputs to the ProviderOutput enum.
    4. Add the provider to the switch statement in create_provider(...).
    5. Add the provider's exports to desktop/src/providers/mod.rs