Skip to content

Latest commit

 

History

History
159 lines (111 loc) · 3.52 KB

CONTRIBUTING.md

File metadata and controls

159 lines (111 loc) · 3.52 KB

Contributing to Monacopilot

Thank you for your interest in contributing to Monacopilot! We're thrilled to have you on board. This guide will help you get started with contributing to our monorepo project.

Table of Contents

Project Structure

Monacopilot is organized as a monorepo using PNPM workspaces:

packages/
  ├── core/           # Core functionality and provider implementations
  └── monacopilot/    # Main Monaco Editor integration package
docs/                 # Documentation website
playground/           # NextJS app for testing changes in real-time

Development Setup

  1. Prerequisites

    • Node.js (v16 or higher)
    • PNPM (v9.15.4 or higher)
  2. Clone and Install

    git clone https://github.com/arshad-yaseen/monacopilot.git
    cd monacopilot
    pnpm install

Development Workflow

  1. Start Development Mode

    # For core package
    pnpm dev:core
    
    # For monacopilot package
    pnpm dev:monacopilot
    
    # For documentation
    pnpm dev:docs
    
    # For playground
    pnpm dev:playground

    Note: The development mode includes automatic rebuilding on code changes, so you don't need to run pnpm build manually after each change.

  2. Code Formatting Before committing your changes, run:

    pnpm format
  3. Type Checking

    pnpm tsc
  4. Linting

    pnpm lint

Testing Changes

We provide a playground environment to test your changes in real-time:

  • The playground/ directory contains a NextJS app that automatically reflects changes made to the packages
  • Before starting the playground, create a .env.local file in the playground/ directory and add your OpenAI API key:
    OPENAI_API_KEY=your_api_key_here
    
  • Run pnpm dev:playground to start the playground application
  • When you run pnpm dev:monacopilot or pnpm dev:core, your changes will be immediately visible in the playground
  • Use this playground to verify your changes and test functionality before submitting a PR

Running Tests

To run tests:

pnpm test

Documentation

The documentation is built using VitePress and is located in the docs directory.

To preview documentation locally:

pnpm dev:docs

Commit Guidelines

We follow Conventional Commits specification:

type(scope): description

[optional body]

[optional footer]

Types:

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • style: Code style changes (formatting, etc.)
  • refactor: Code refactoring
  • test: Adding or modifying tests
  • chore: Maintenance tasks

Example:

feat(core): add support for DeepSeek provider

Pull Request Process

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Test your changes using the playground
  5. Run all checks:
    pnpm validate
    pnpm test
  6. Commit your changes following our commit guidelines
  7. Push to your fork
  8. Open a Pull Request

Need Help?

Feel free to open an issue or join our community discussions if you need any assistance.

Thank you for contributing to Monacopilot! ❤️