Contributing
Memospot contributor’s guide.
License
Section titled “License”By contributing, you agree that all your contributions will be licensed under the MIT License.
In short, when you submit code changes, your submissions are understood to be under the same MIT License that covers the project. Feel free to contact the maintainer if that’s a concern.
Localization
Section titled “Localization”This project is available in multiple languages. You can join the Crowdin platform to help make it accessible to a broader audience!
Development
Section titled “Development”The recommended code editors are Zed and Visual Studio Code. The project has a pre-configured workspace, which will prompt you to install the recommended extensions.
Coding style
Section titled “Coding style”- Try your best to match the existing code style.
- Run
just pre-commiton the repository before submitting a pull request. This will run all the code formatters, linters and tests.
Container build
Section titled “Container build”It’s possible to build the app for Linux and Windows (NSIS installer only) using Docker Bake. It just needs a working Docker installation.
This bypasses the need to setup the tooling on the host OS.
How to
Available actions:
- CI
linttest
- Release
linuxwindows
- Release (no-bundle)
linux-no-bundlewindows-no-bundle
just bake [action]or
docker buildx bake [action]See docker-bake.hcl for all available targets.
Pruning caches
Section titled “Pruning caches”just bake pruneor
docker builder du && docker builder prune -aPre-requisites for host machine
Section titled “Pre-requisites for host machine”- A package manager: Homebrew or winget.
- A system WebView (Edge WebView2, Safari, or WebKitGTK).
- A modern computer, with at least 8 GB of RAM and a decent CPU.
- 20 GB of free disk space, for Rust artifacts.
OS-specific dependencies
Section titled “OS-specific dependencies”See also: Tauri Prerequisites
sudo apt update -y &&sudo apt install --no-install-recommends -qq \ autoconf \ autotools-dev \ build-essential \ ca-certificates \ curl \ file \ patchelf \ wget \ git \ unzip \ nsis \ clang \ lld \ llvm \ libayatana-appindicator3-dev \ libgtk-3-dev \ librsvg2-dev \ libssl-dev \ libwebkit2gtk-4.1-dev \ libxdo-dev \ jq \ -yxcode-select --installwinget install --id Git.Git -e --source wingetwinget install -e --id Microsoft.VisualStudio.2022.BuildTools --override "--passive --wait --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended"winget install --id=Microsoft.EdgeWebView2Runtime -eTooling
Section titled “ Tooling”Bun is a fast JavaScript/TypeScript runtime, bundler, test runner, and package manager. It’s used to bundle the front end and to run build scripts.
brew install oven-sh/bun/bunwinget install --id Oven-sh.Bunjq is a lightweight and flexible command-line JSON processor.
brew install jqwinget install --id=jqlang.jq -ebrew install rustup-initrustup-init -ysource "$HOME/.cargo/env"winget install --id Rustlang.RustupRust toolchain
Section titled “Rust toolchain”rustup default stablerustup component add clippy rust-analyzerCargo binstall
Section titled “Cargo binstall”Binstall is a tool for installing pre-built Rust binaries.
brew install cargo-binstallSet-ExecutionPolicy Unrestricted -Scope Process; `iex (iwr "https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.ps1").Contentcargo install cargo-binstall --lockedRust tools
Section titled “Rust tools”- cargo-cache: Utility to manage
cargocache. - cargo-edit: Utility to manage
cargodependencies. - cargo-xwin: Cross compile Cargo projects to Windows.
- dprint: A pluggable code formatter.
- just: A command runner.
cargo binstall \ --disable-telemetry \ --locked \ --force \ --targets=$(rustc -vV | sed -n 's|host: ||p') \ cargo-cache@0.8.3 \ cargo-edit@0.13.8 \ cargo-xwin@0.20.2 \ dprint@0.50.2 \ just@1.45.0 \ tauri-cli@2.9.5 \ -ycargo binstall ` --disable-telemetry ` --locked ` --force ` --targets=$(& rustc -vV | Select-String -Pattern "^host:" | ForEach-Object {$_.Line.Split(':')[1].Trim()}) ` cargo-cache@0.8.3 ` cargo-edit@0.13.8 ` dprint@0.50.2 ` just@1.45.0 ` tauri-cli@2.9.5 ` -yMemos server build
Section titled “Memos server build”Memos server is built separately on the repository memos-builds.
A pre-build hook script will automatically download the latest release from the companion repository and put it in the server-dist folder, with the appropriate name.
Downloaded files will be reused on subsequent builds.
Manual server build
Sample valid server binary names:
- Windows:
memos-x86_64-pc-windows-msvc.exe - Linux:
memos-x86_64-unknown-linux-gnu - macOS:
memos-x86_64-apple-darwinmemos-aarch64-apple-darwin
Cloning the repository
Section titled “Cloning the repository”git clone https://github.com/memospot/memospot.gitcd memospotAt this point, everything should be ready to go.
Using Just
Section titled “Using Just”This project’s workflow is heavily based on Just, a modern alternative to Makefiles and scripts.
A justfile is available with several pre-configured recipes for this project.
Just installation is covered under the Cargo binstall section.
Common recipes
Section titled “Common recipes”just dev | Run the app in development mode |
just build | Build the app |
just fmt | Run all code formatters |
just lint | Run all code checkers/linters |
just test | Run all available tests |
just clean | Remove build artifacts and caches |
List all available Just recipes
Section titled “List all available Just recipes”just --listTroubleshooting
Section titled “Troubleshooting”soup3-sys
Section titled “soup3-sys”Should you experience an error regarding soup3-sys, set
PKG_CONFIG_PATH manually:
export PKG_CONFIG_PATH="/usr/lib/x86_64-linux-gnu/pkgconfig/:/usr/share/pkgconfig"You can make this permanent by adding that line to your shell profile (~/.bashrc, ~/.zshrc, etc).
cargo-tauri
Section titled “cargo-tauri”Should you experience issues with cargo-tauri, like bad CPU type in executable, try building it manually:
cargo install --locked --force --target=$(rustc -vV | sed -n 's|host: ||p') tauri-cli