Contributing
Read this page if you want to change canvist itself. Everything here is for contributors; you don’t need any of it to use canvist.
Set up
canvist uses devenv for a reproducible toolchain: Rust, Deno, Node, Dart, Flutter, and the native SDKs.
git clone https://github.com/canvist/canvist
cd canvist
direnv allow . # or: devenv shell
install:allCursor cloud agents on Linux run .cursor/install.sh, which installs single-user Nix (flakes and nix-command enabled) and devenv, trusts the devenv binary cache, and warms devenv shell. After that, use the same devenv shell commands as anywhere else. CI does not use Nix or devenv: GitHub Actions installs the Rust toolchain from rust-toolchain.toml and the other tools it needs directly. .cursor/start.sh starts Postgres for local cloud integration tests (CANVIST_TEST_DATABASE_URL=postgres://canvist:canvist@localhost:5432/canvist_test). iOS and Android checks still need those hosts.
Make a change
-
Branch from
mainwith a conventional prefix:feat/,fix/,docs/,test/,refactor/. -
Make focused commits, and add tests with the code.
-
Run the checks:
fix:all # format and fix lints test:all # Rust tests and doc tests lint:style # readability and complexity gates -
Add a changeset if your change affects a package, with
mc change(see Changesets and releases). -
Open a pull request. CI runs formatting, clippy, a Linux build, and the unit tests of
canvist,canvist_model,canvist_core, andcanvist_headless.
Changesets and releases
canvist releases with monochange, configured in monochange.toml. Two release units move independently:
sdk: every library (the Rust crates,@canvist/headlesson npm, the Dart and Flutter packages, and the Swift and Android bindings). They share one version and are taggedv<version>.app: the website and canvist Cloud, deployed to Railway and taggedapp/v<version>.
Every pull request that changes a package needs a file in .changeset/. Its frontmatter names the packages and a change type, and its body starts with a # Summary heading:
---
canvist_core: feat
---
# Add soft line breaks
`Shift+Enter` inserts a hard break inside the current block.Changesets have two audiences, and one file serves exactly one:
- Developers (
breaking,feat,change,fix,refactor,perf,security,docs,test,none) end up in the package changelogs and GitHub releases. Usemc change. - People who use canvist (
user_feature,user_fix,user_change,pricing) end up on the website’s/changelogpage, and nowhere else. Usemc user-change, targetapp, and explain the outcome under a## User impactheading in plain language, with no API names or implementation detail.
A change that matters to both audiences gets two files. mc check lints changesets, and mc preview shows the next release.
On every push to main, the release-pr workflow opens or updates a release pull request with the version bumps and changelogs. Merging it tags the release, publishes each package to its registry, and deploys the app.
Where things live
| Folder | What’s in it |
|---|---|
crates/ | The Rust core: model, editor, extensions, layout, collaboration, and headless API |
packages/ | JavaScript packages, including @canvist/headless |
platforms/ | Dart, Flutter, iOS, and Android bindings |
services/cloud | The canvist Cloud server |
conformance/ | Language-neutral test fixtures every binding must pass |
docs/src | These docs |
docs/internal | Design records, research, and plans for contributors |
website/ | The website, which renders these docs at /docs |
Rules worth knowing
- Performance numbers live in the guide. Performance records budgets and how to measure them locally with
cargo bench. CI does not run those comparisons. - Every binding passes the same fixtures. A change to behaviour updates
conformance/fixtures, so Rust, TypeScript, and Dart stay identical. - Docs samples are tested. Rust samples run as doc tests through
docs/src/lib.rs. TypeScript and Dart samples are type-checked and run bydocs/check-snippets.ts. A sample’s expected output goes in comments after the line that prints it. - Style: hard tabs and edition 2024 in Rust, and a doc comment on every public item.
The design decisions behind canvist, with the alternatives considered, are in docs/internal/architecture.md.