Build and test
onQ is a Node, Svelte, Tauri, and Rust workspace. The desktop shell requires native platform dependencies in addition to npm and Cargo packages.
Requirements
- Node.js 24 or newer
- npm with lockfile support
- Rust stable from
rust-toolchain.toml - Git
- Tauri 2 platform prerequisites
The Cargo workspace declares Rust 1.75 as its minimum package version, but development and CI use current stable Rust.
Clone and install
git clone https://github.com/visorcraft/onQ
cd onQ
npm installCI uses npm ci for a clean lockfile-exact installation.
mongreldb-core resolves from crates.io. Do not add a sibling path or Git checkout.
Linux packages
Ubuntu CI installs:
sudo apt-get update
sudo apt-get install -y \
build-essential \
curl \
wget \
file \
libxdo-dev \
libssl-dev \
libwebkit2gtk-4.1-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
patchelfUse the Tauri prerequisites for other platforms and distributions.
Run
Desktop development:
npm run dev:appFrontend-only Vite server:
npm run devThe browser surface cannot complete Tauri invoke calls without mocks or the desktop shell.
Production desktop bundle:
npm run build:appFrontend production build:
npm run buildValidation commands
Frontend
npm run check
npm run lint
npm test
npm run buildBrowser tests
npm run test:a11y
npm run test:e2eInstall Playwright Chromium when needed:
npx playwright install --with-deps chromiumRust
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace
cargo deny checkDocumentation
npm run docs:dev
npm run docs:build
npm run docs:previewStorybook
npm run storybook
npm run build-storybookPerformance and heavy tests
ONQ_RUN_HEAVY_TESTS=1 cargo test -p onq-core --test embed_real
cargo bench -p onq-core
bash scripts/check-perf-regression.shThe heavy embedding test can download or load the real model. Normal tests use mocks and should stay offline.
CI
.github/workflows/ci.yml has two Ubuntu jobs.
Rust job:
- install native Tauri dependencies;
cargo fmt --all -- --check;- clippy with warnings denied;
cargo deny check;cargo test --workspace.
Frontend job:
- Node 24 and
npm ci; - Svelte check;
- ESLint;
- Vitest;
- Vite production build;
- VitePress documentation build;
- Playwright Chromium accessibility tests.
Run the smallest checks that cover a change while iterating. Run the full relevant lane before opening a pull request.
Repository map
src/ Svelte 5 + TypeScript frontend
lib/api/ one Tauri invoke wrapper per domain
lib/components/ screens, editor pieces, primitives, settings
lib/stores/ application and vault-backed UI state
lib/i18n/ en, th, es, zh, fr, de
lib/styles/ tokens, themes, glass, settings, motion
crates/
onq-app/ Tauri shell and IPC commands
onq-core/ vault, crypto, search, backup, plugins, sync
onq-plugin-sdk/ ABI v1 declarations and export macro
onq-test-utils/ shared Rust fixtures and mocks
docs/ ADRs and plugin authoring source
docs-site/ VitePress public documentation
tests/ Playwright and sample plugin fixture
scripts/ release, legal inventory, performance helpersRead Architecture before changing a cross-layer flow.
Frontend conventions
- TypeScript strict mode.
- Svelte 5 runes such as
$state,$derived, and$props. - Tauri IPC only through
src/lib/api/*. - Keep wrappers aligned with the command registered in
crates/onq-app/src/lib.rs. - Add English i18n keys first, then mirror all six locale catalogs.
- Use existing design tokens and shared settings chrome.
- Colocate Vitest as
*.test.ts. - Mock Tauri at the invoke boundary.
- Preserve keyboard and screen-reader behavior for every UI change.
Storybook-only product components are intentional previews, not automatically dead code.
Rust conventions
- Run
cargo fmt. - Use
snake_casefunctions/modules andPascalCasetypes. - Return
CoreResultand typedthiserrorerrors inonq-core. - Return
Result<T, String>at the Tauri IPC boundary. - Do not use
unwrap()orexpect()on production IPC paths. - Move synchronous MongrelDB, filesystem, model, and keychain work off async runtime threads where appropriate.
- Keep schema IDs stable and migrations monotonic.
- Keep workspace path dependency versions equal to the workspace version.
Tests for behavior changes
Every behavior change needs the smallest test that would fail without it:
- Vitest for Svelte, stores, and frontend helpers;
- Rust unit tests for pure domain logic;
- Rust integration tests for cross-module storage behavior;
- Playwright for critical end-to-end or accessibility behavior.
Do not download the real embedding model in normal unit tests.
Dependency and credits maintenance
After changing Rust or npm dependencies:
cargo update
npm update
bash scripts/regen-credits.shCommit the regenerated:
crates/onq-app/legal/crates.json
crates/onq-app/legal/third-party.md
crates/onq-app/legal/npm-packages.json
crates/onq-app/legal/npm-third-party.mddeny.toml is the authoritative Rust license allow-list. Plugins must remain GPL-3.0-only. Runtime OS libraries belong in acknowledgments and runtime license documents, not generated language-package inventories.
Versions
Release version must match:
package.json
Cargo.toml [workspace.package]
crates/onq-app/tauri.conf.json
workspace path dependency versionsUse:
bash scripts/release.sh <version>The script requires a clean master branch, updates versions and lockfiles, creates a conventional version commit and annotated tag, and pushes both.
The release workflow builds:
- Apple Silicon macOS;
- x86-64 Linux;
- x86-64 Windows;
- signed updater artifacts and
latest.json.
Documentation changes
Public pages live in docs-site/. When behavior changes:
- update the relevant guide;
- update Feature status if an integration boundary moves;
- keep README links current;
- run
npm run docs:build; - verify external statements against code or release workflow.
Documentation on master deploys through GitHub Pages.
Pull requests
- Keep scope focused.
- Use Conventional Commits.
- Explain user-visible behavior.
- Include verification commands.
- Add screenshots for UI changes.
- Never commit passwords, recovery phrases, signing private keys, or vault data.
- Do not add generated-by footers, automated co-author trailers, or bot attribution.
Read CONTRIBUTING.md for the short contributor contract and SECURITY.md for private vulnerability reporting.