Contributing to Opal Editor
Thank you for your interest in contributing to Opal Editor! This guide will help you get started with the development process and ensure your contributions align with project standards.Getting Started
Prerequisites
- Node.js: Version 22.19.0 or higher (see
~/workspace/source/package.json:196-198) - npm: Comes with Node.js
- Git: For version control
Development Setup
- Clone the repository
- Install dependencies
patch-package.
- Start the development server
http://localhost:3000.
Development Scripts
Opal Editor provides several npm scripts for development:| Script | Purpose |
|---|---|
npm run dev | Start Vite development server |
npm run dev:all | Run app and build workers in parallel |
npm run build | Build production bundle |
npm run build:workers | Build web workers |
npm run typecheck | Run TypeScript type checking |
npm run lint | Run ESLint checks |
npm test | Run Playwright tests |
~/workspace/source/package.json:6-28 for the complete list.
Code Style and Conventions
TypeScript Configuration
Opal Editor uses strict TypeScript settings (see~/workspace/source/tsconfig.json:1-48):
- Strict mode enabled: All strict type-checking options are on
- No unchecked indexed access: Always check for undefined when accessing array/object properties
- No implicit any: All types must be explicitly defined
- Path aliases: Use
@/*to import fromsrc/*
ESLint Rules
The project enforces code quality through ESLint (see~/workspace/source/eslint.config.mjs:1-52):
Key rules:
- No floating promises: All promises must be properly awaited or handled
- React Hooks exhaustive deps: Dependency arrays must be complete
- Custom hooks:
useAsyncEffect,useRemoteResource,useRunner, anduseResourceare checked for dependencies - Unused variables: Variables starting with
_are ignored
Code Formatting
The project uses Prettier for code formatting:- Use 2 spaces for indentation
- Use double quotes for strings
- Add trailing commas where valid
- Format on save is recommended
Naming Conventions
- Components: PascalCase (e.g.,
WorkspaceList.tsx) - Files: camelCase for utilities, PascalCase for components
- Variables: camelCase
- Constants: UPPER_SNAKE_CASE for true constants
- Types/Interfaces: PascalCase
Development Workflow
1. Find an Issue or Feature
- Check the GitHub Issues for open tasks
- Look for issues labeled
good first issueorhelp wanted - Join the Discord server to discuss ideas
- Comment on an issue to indicate you’re working on it
2. Create a Branch
Create a descriptive branch name:feature/- New featuresfix/- Bug fixesdocs/- Documentation updatesrefactor/- Code refactoringtest/- Test additions or updates
3. Make Your Changes
- Write clean, well-documented code
- Follow the existing code style and patterns
- Add comments for complex logic
- Update documentation as needed
- Ensure TypeScript types are correct
4. Test Your Changes
Run type checking:5. Commit Your Changes
Write clear, descriptive commit messages:feat:- New featuresfix:- Bug fixesdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Test updateschore:- Build process or tooling changes
Pull Request Process
1. Push Your Branch
2. Create a Pull Request
- Go to github.com/rbbydotdev/opal
- Click “Pull requests” > “New pull request”
- Select your branch
- Fill out the PR template with:
- Description: What does this PR do?
- Motivation: Why is this change needed?
- Changes: What files/components were modified?
- Testing: How was this tested?
- Screenshots: For UI changes (if applicable)
3. PR Requirements
Before your PR can be merged:- ✅ All tests must pass
- ✅ Code must pass TypeScript checks (
npm run typecheck) - ✅ Code must pass ESLint checks (
npm run lint) - ✅ No merge conflicts
- ✅ Description clearly explains the changes
- ✅ At least one maintainer approval
4. Address Review Feedback
- Respond to review comments
- Make requested changes
- Push updates to your branch (PR will update automatically)
- Re-request review after making changes
5. Merge
Once approved, a maintainer will merge your PR. Thank you for your contribution!Project Structure
Key directories to know:Architecture Notes
- Local-first: Uses IndexedDB (Dexie) and OPFS for storage
- Git integration: Built on isomorphic-git
- State management: Valtio for reactive state
- Routing: Tanstack Router
- UI: Radix UI + Tailwind CSS
- Editor: MDX Editor (WYSIWYG) + CodeMirror (raw markdown)
Getting Help
- Discord: Join our community
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Code of Conduct
- Be respectful and inclusive
- Provide constructive feedback
- Focus on what is best for the community
- Show empathy towards other community members