Sure, here is the updated contributing guide with the specified files included in the file structure and the table below it:
Thank you for your interest in contributing to Monacopilot! We're thrilled to have you on board. By contributing, you’re helping to make Monacopilot better for everyone. Please take a moment to review this guide before getting started.
If you have any questions or need assistance, feel free to open an issue on GitHub.
- About This Repository
- Repository Structure
- Development
- Testing Monacopilot Locally
- Documentation
- Commit Conventions
- Requesting New Features or Components
- Testing
- Final Steps
Here's a quick overview of the technologies we use:
- PNPM Workspaces: For managing monorepos.
- Tsup: A TypeScript bundler for building the project.
- Vitest: Our testing framework.
Understanding the repository structure will help you navigate the project effectively.
monacopilot
├── src
│ ├── classes
│ ├── constants
│ ├── core
│ │ └── completion
│ │ ├── handler.ts
│ │ └── register.ts
│ ├── helpers
│ ├── types
│ └── utils
└── tests
├── ui
└── *.test.ts
Path | Description |
---|---|
src/classes |
Core classes |
src/constants |
Constants and configs |
src/core |
Core functionality |
src/core/completion |
Completion handlers and registration |
src/core/completion/handler.ts |
InlineCompletionsProvider implementation |
src/core/completion/register.ts |
Completion provider registration |
src/helpers |
Helper functions |
src/types |
Type definitions |
src/utils |
Utility functions |
tests |
Test files |
tests/ui |
Test UI |
tests/*.test.ts |
Unit tests |
Follow these steps to set up your development environment and start contributing to Monacopilot.
- Navigate to the Monacopilot GitHub repository.
- Click the Fork button in the top-right corner to create a copy of the repository under your GitHub account.
Clone your forked repository to your local machine using the following command:
git clone https://github.com/your-username/monacopilot.git
Move into the project directory:
cd monacopilot
Create a new branch for your work to keep changes organized:
git checkout -b my-new-feature
Monacopilot uses PNPM for managing dependencies. Install them by running:
pnpm install
To build the package, execute the following command:
pnpm build
This command uses Tsup to bundle the project.
For automatic rebuilds on file changes, start the watch mode with:
pnpm dev
This is useful for continuous development and testing.
To test Monacopilot locally, follow these steps:
-
Set Up Environment Variables
You need to set the OpenAI API key as an environment variable. Create a
.env.local
file in thetests/ui
directory with the following content:OPENAI_API_KEY=your_api_key
Replace
your_api_key
with your actual OpenAI API key. -
Run the Test UI
Execute the following command to start the testing environment:
pnpm dev:test-ui
This will launch the UI in a local development environment, allowing you to test changes in real-time.
Comprehensive documentation is essential.
- Location: The documentation is located within the
README.md
file at the root of the repository. - Format: Documentation is written using Markdown.
To view the documentation, simply open the README.md
file in your preferred text editor or view it directly on GitHub.
Adhering to a consistent commit message format helps maintain a clear project history and facilitates collaboration.
Commit Message Format:
category(scope): message
Categories:
feat
/feature
: Introduces new features or functionality.fix
: Addresses and resolves bugs.refactor
: Code changes that neither fix a bug nor add a feature.docs
: Updates or additions to documentation.build
: Changes related to the build process or dependencies.test
: Adding or modifying tests.ci
: Changes to continuous integration configurations.chore
: Miscellaneous tasks that do not fit into the above categories.
Examples:
feat(completion): add new inline completion provider
fix(core): resolve token handling issue in completion handler
docs: update API usage guide for Monacopilot
For detailed guidelines, refer to the Conventional Commits specification.
If you have ideas for new features or components, we’d love to hear them!
-
Open an Issue:
- Navigate to the Issues section of the repository.
- Click on New Issue and provide a clear and detailed description of your request.
Ensuring that your contributions do not introduce regressions is crucial.
Monacopilot uses Vitest for testing. To run all tests, execute:
pnpm test
When adding new features or components, include corresponding tests to maintain code quality.
Before submitting a pull request, ensure all tests pass:
pnpm test
-
Commit Your Changes:
Ensure your commits follow the Commit Conventions outlined above.
-
Push to Your Fork:
git push origin my-new-feature
-
Create a Pull Request:
- Navigate to your forked repository on GitHub.
- Click on Compare & pull request.
- Provide a clear description of your changes and submit the pull request.
Thank you for contributing to Monacopilot! Your efforts help make the project better for everyone.