Skip to content

Latest commit

 

History

History
133 lines (93 loc) · 3.54 KB

CONTRIBUTING.md

File metadata and controls

133 lines (93 loc) · 3.54 KB

Contributing to Refract

Thanks for helping improve Refract. This guide explains how to set up the project, make changes, and open a pull request.

Project layout

  • apps/renderer contains the shared React renderer.
  • apps/tauri contains the Tauri shell and Rust backend.
  • packages/core contains shared launcher logic.
  • packages/plugin-api contains the public plugin API.
  • locales contains translation files.

Requirements

  • Node.js 24 LTS, matching CI.
  • pnpm 11, matching CI and dependency installation checks.
  • Rust stable for Tauri work.
  • Platform build tools required by Tauri.

On Windows, Tauri packaging also needs WebView2 and Microsoft C++ build tools.

Setup

git clone https://github.com/RefractMC/Refract_MC.git
cd Refract_MC
pnpm install

On NixOS, nix develop provides Node, pnpm, Rust, Tauri, the supported Java runtimes, and the native libraries needed by Refract and Minecraft. Run pnpm install after entering the shell.

Run the app

pnpm dev

Build commands

Local unsigned build:

pnpm build

Signed release build:

pnpm --filter @refract/tauri-poc build:signed

Signed Tauri builds require TAURI_SIGNING_PRIVATE_KEY and TAURI_SIGNING_PRIVATE_KEY_PASSWORD.

Checks before a pull request

Run the checks that match your change.

pnpm --filter @refract/renderer typecheck
pnpm --filter @refract/renderer test
pnpm check:contracts
pnpm --filter @refract/tauri-poc build:real
pnpm audit --prod

For Rust changes:

cd apps/tauri/src-tauri
cargo fmt --check
cargo check --locked
cargo test --locked

For packaging changes:

pnpm --filter @refract/tauri-poc build
nix flake check
nix build

Pull request rules

Use the pull request template to summarize the change, select its type, and report validation results. Complete the translation section when applicable.

  • Keep changes focused on one feature, fix, or cleanup.
  • Include a short summary of what changed.
  • List the commands you ran to verify the change.
  • Add screenshots or screen recordings for visible UI changes.
  • Do not commit secrets, tokens, private keys, build artifacts, or local logs.
  • Do not rewrite unrelated code while fixing a small issue.
  • Keep generated lockfile changes only when dependency resolution changed.

Code style

  • Prefer existing project patterns over new abstractions.
  • Keep UI text in locale files when the text is user visible.
  • Keep file and path handling defensive in native code.
  • Use clear errors that can be shown to users.
  • Avoid decorative symbols in docs and issue text.
  • Use normal hyphens only. Do not use em dashes.

Translations

Translation files live in locales.

To add a language:

  1. Create locales/<tag>.json, named by a canonical BCP 47 language tag.
  2. Translate values only and keep the JSON keys from en.json. Leave out anything not yet translated; it falls back to English.
  3. Run pnpm check:contracts.

The app discovers the file automatically. See the translation guide for markers and placeholders.

Security

Report sensitive security issues privately when possible. Do not open a public issue with exploit details, tokens, private keys, or user data.

Dependency audit fixes should include:

  • The vulnerable package name.
  • The patched version.
  • The command used to verify the fix.
  • The lockfile changes needed to make CI reproducible.

Release notes

User-visible changes should update CHANGELOG.md when they are part of a release. Keep entries short and concrete.