Skip to main content

Welcome Contributors!

Thank you for your interest in contributing to Polaris IDE! This guide will help you get started with contributing code, documentation, and bug reports.

Getting Started

1

Fork the repository

Visit github.com/code-with-antonio/polaris and click the “Fork” button.
2

Clone your fork

git clone https://github.com/YOUR_USERNAME/polaris.git
cd polaris
3

Set up development environment

Follow the Setup Guide to install dependencies and configure environment variables.
4

Create a feature branch

git checkout -b feature/your-feature-name
Use prefixes:
  • feature/ - New features
  • fix/ - Bug fixes
  • docs/ - Documentation changes
  • refactor/ - Code refactoring
  • test/ - Test additions/changes

Code Standards

TypeScript Guidelines

  • Enable strict mode in tsconfig.json
  • Avoid any types - use unknown or proper types
  • Use type inference where possible
  • Define explicit return types for functions
// ❌ Bad
function getData(id: any) {
  return fetch(`/api/${id}`);
}

// ✅ Good
async function getData(id: string): Promise<User> {
  const response = await fetch(`/api/users/${id}`);
  return response.json();
}
Use functional components with TypeScript:
// ✅ Good
interface EditorProps {
  content: string;
  onChange: (value: string) => void;
  language?: string;
}

export function Editor({ content, onChange, language = "typescript" }: EditorProps) {
  // Component implementation
}
All database operations must:
  • Verify authentication first
  • Use proper indexes
  • Handle errors gracefully
export const getProject = query({
  args: { id: v.id("projects") },
  handler: async (ctx, args) => {
    // ✅ Always verify auth first
    const identity = await verifyAuth(ctx);
    
    const project = await ctx.db.get(args.id);
    if (!project) {
      throw new Error("Project not found");
    }
    
    // ✅ Check ownership
    if (project.ownerId !== identity.subject) {
      throw new Error("Unauthorized");
    }
    
    return project;
  }
});
  • Use descriptive error messages
  • Log errors to Sentry in production
  • Show user-friendly messages in UI
try {
  await createProject(name);
} catch (error) {
  // ✅ User-friendly message
  toast.error("Failed to create project. Please try again.");
  
  // ✅ Detailed logging
  console.error("Project creation failed:", error);
  Sentry.captureException(error);
}

Code Style

  • Use ESLint for code quality
  • 2 spaces for indentation
  • Single quotes for strings
  • Semicolons required
  • Trailing commas in multiline
# Run linter
npm run lint

# Auto-fix issues
npm run lint -- --fix

Testing

Unit Tests

# Run all tests
npm test

# Run tests in watch mode
npm run test:ui

# Run with coverage
npm run test:coverage
All new features should include unit tests. Aim for >80% code coverage.

E2E Tests

# Run Playwright tests
npm run test:e2e

# Run with UI
npm run test:e2e:ui

Pull Request Process

1

Ensure code quality

Before submitting:
npm run lint
2

Commit your changes

Use conventional commit messages:
# Format: type(scope): description

feat(editor): add syntax highlighting for Python
fix(auth): resolve token refresh issue
docs(readme): update installation instructions
refactor(files): simplify file tree rendering
test(projects): add tests for project creation
Types:
  • feat - New feature
  • fix - Bug fix
  • docs - Documentation
  • refactor - Code restructuring
  • test - Tests
  • chore - Maintenance
3

Push to your fork

git push origin feature/your-feature-name
4

Create Pull Request

  1. Go to the original repository
  2. Click “New Pull Request”
  3. Select your fork and branch
  4. Fill out the PR template:
## Description
Brief description of changes

## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update

## Testing
- [ ] Unit tests pass
- [ ] E2E tests pass
- [ ] Manual testing completed

## Screenshots (if applicable)

## Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Comments added for complex code
- [ ] Documentation updated
- [ ] No new warnings
5

Address review feedback

  • Respond to all comments
  • Make requested changes
  • Push updates to the same branch
  • Re-request review when ready

Development Workflow

Feature Development

# Create feature branch
git checkout -b feature/ai-autocomplete

# Start dev servers
npm run dev
npx convex dev
npm run dev:trigger

Common Contribution Areas

CodeMirror Extensions

Add new editor features:
  • Language support
  • Custom themes
  • Editor widgets
  • Keybindings
See Custom Extensions Guide

AI Features

Enhance AI capabilities:
  • New AI tools
  • Prompt improvements
  • Model integrations
  • Context optimization

UI Components

Improve user interface:
  • shadcn/ui components
  • Layouts and panels
  • Responsive design
  • Accessibility

Documentation

Help others learn:
  • Guides and tutorials
  • API documentation
  • Code examples
  • Video walkthroughs

Community Guidelines

  • Be respectful and inclusive
  • Welcome newcomers
  • Focus on constructive feedback
  • Report inappropriate behavior
  • Check existing issues first
  • Use GitHub Discussions for questions
  • Join the Discord community
  • Tag maintainers when needed
When reporting bugs:
  1. Search existing issues
  2. Use the bug report template
  3. Include reproduction steps
  4. Provide environment details
  5. Add screenshots/videos if helpful

Recognition

Contributors are recognized in:
  • CONTRIBUTORS.md file
  • Release notes
  • GitHub contributor graph
  • Special mentions in announcements
First-time contributors receive a special welcome and guidance from maintainers!

Next Steps

Setup Guide

Set up your development environment

Architecture

Understand the system design

Custom Extensions

Build CodeMirror extensions

Background Jobs

Work with Trigger.dev tasks

Build docs developers (and LLMs) love