Welcome Contributors
Thanks for your interest in contributing to Emdash! We favor small, focused PRs and clear intent over big changes. This guide explains our workflow, conventions, and quality standards.Getting Started
Fork and clone
Fork the Emdash repository on GitHub, then clone your fork:
Set up your environment
Use the correct Node.js version:Install dependencies and start the dev server:
Development Workflow
1. Create a Feature Branch
Always work on a feature branch, never directly onmain:
2. Make Your Changes
Keep PRs small and focused:- One logical change per PR
- Prefer a series of small PRs over one large one
- Include UI screenshots/GIFs when modifying the interface
- Update documentation when behavior changes
- TypeScript strict mode (no
anyunless necessary) - Functional React components with hooks
- Explicit types over inference when it improves clarity
3. Run Quality Checks
Before committing, always run these commands:Pre-commit hooks run automatically via Husky + lint-staged:
- Staged files are auto-formatted with Prettier
- Linting runs on staged files
- Type checking and tests run in CI
git commit --no-verify4. Commit with Conventional Commits
Use Conventional Commits format:Commit Types
feat:— New user-facing capabilityfix:— Bug fixrefactor:— Code restructuring without behavior changedocs:— Documentation changeschore:— Maintenance tasks (deps, config)test:— Adding or updating testsperf:— Performance improvements
Commit Examples
5. Open a Pull Request
When you’re ready:-
Push your branch to your fork:
-
Open a PR on GitHub from your branch to
generalaction/emdash:main -
Fill out the PR description:
- What: Describe the change
- Why: Explain the rationale
- Testing: List testing steps
- Screenshots: Include for UI changes
- Related Issues: Link with
Fixes #123orRelated to #456
- Keep the PR title in Conventional Commit format
Code Style
TypeScript
React Components
File Naming Conventions
- Components:
PascalCase.tsx(e.g.,FileExplorer.tsx) - Hooks:
camelCase.tswithuseprefix (e.g.,useTaskManagement.ts,use-toast.ts) - Services:
PascalCase.ts(e.g.,WorktreeService.ts) - Utilities:
camelCase.ts(e.g.,shellEscape.ts) - Tests:
*.test.ts(e.g.,WorktreeService.test.ts)
Error Handling
Git Workflow
Branching Strategy
main: Production-ready code- Feature branches:
feat/*,fix/*,refactor/*, etc. - Never commit directly to
main
- Worktrees created at
../worktrees/{task-name}-{hash}/ - Branch format:
{prefix}/{task-name}-{hash}(default prefix:emdash)
Conventional Commits Format
Every commit should follow this pattern:Pre-PR Checklist
Before opening a PR, verify:- Dev server runs:
pnpm run dstarts cleanly - Code is formatted:
pnpm run format(or pre-commit hook ran) - Lint passes:
pnpm run lint - Types check:
pnpm run type-check - Tests pass:
pnpm exec vitest run - No stray files: Check for build artifacts, secrets, or temp files
- Documentation updated: If behavior changed
- Conventional commit: Commit messages follow the format
Code Review Process
- Open PR: Submit PR with clear description
- CI checks: Automated checks must pass:
- Format check
- Type check
- Lint check
- Test suite
- Code review: Maintainers review code
- Address feedback: Make requested changes
- Merge: Maintainer merges when approved
Project-Specific Guidelines
Database Migrations
To add a database field:- Edit
src/main/db/schema.ts - Generate migration:
pnpm exec drizzle-kit generate - Test locally with a fresh database
- Commit both schema and migration files
Native Modules
Never upgrade casually:sqlite3node-ptykeytar
pnpm run rebuild and can break across platforms.
IPC Handlers
When adding new IPC methods:- Create handler in
src/main/ipc/or colocate in service - Register in
main.ts - Add type definition to
src/renderer/types/electron-api.d.ts - Return consistent format:
{ success: boolean, data?: any, error?: string }
Services Pattern
All services follow this pattern:Testing Requirements
See the Testing guide for detailed patterns.
When to Add Tests
- Always: New services or significant features
- Recommended: Bug fixes (add regression test)
- Optional: Simple UI tweaks
Test Coverage
We don’t enforce coverage percentage, but aim to test:- Critical business logic
- Database operations
- Git/worktree operations
- PTY management
- IPC handlers
Guardrails
Issue Reports and Feature Requests
Open GitHub Issues with:-
Bug reports:
- OS and Node.js version
- Steps to reproduce
- Expected vs actual behavior
- Relevant logs or error messages
- Screenshots/GIFs for UI issues
-
Feature requests:
- Use case and motivation
- Proposed solution
- Alternative approaches considered
- Willingness to contribute
Getting Help
GitHub Issues
Report bugs or request features
Discord Community
Ask questions and discuss ideas
Community Guidelines
- Be respectful: Treat everyone with kindness
- Be constructive: Offer helpful feedback
- Be patient: Maintainers review PRs as time allows
- Be collaborative: Discuss big changes before implementing
Release Process (Maintainers)
For maintainers releasing new versions:- Updates
package.jsonandpnpm-lock.yaml - Creates a git commit
- Creates a git tag (e.g.,
v0.4.25)
- macOS: Signed .dmg (arm64)
- Linux: AppImage, deb, rpm (x64)
- Windows: nsis, msi (x64)
Next Steps
Development Setup
Set up your local environment
Testing
Learn the testing framework
Thank you for contributing to Emdash! Every contribution, no matter how small, helps make the project better.