|
| 1 | +# Contributing to Stream Deck SDK |
| 2 | + |
| 3 | +Thank you for your interest in contributing to the Stream Deck SDK! We welcome contributions from the community and are grateful for your support. |
| 4 | + |
| 5 | +## Table of Contents |
| 6 | + |
| 7 | +- [Code of Conduct](#code-of-conduct) |
| 8 | +- [Contributing](#contributing) |
| 9 | + - [Feature Requests](#feature-requests) |
| 10 | + - [Fixing Issues](#fixing-issues) |
| 11 | +- [AI Policy](#ai-policy) |
| 12 | +- [Development](#development) |
| 13 | + - [Prerequisites](#rrerequisites) |
| 14 | + - [Installation](#installation) |
| 15 | +- [Testing](#testing) |
| 16 | + - [Running Tests](#running-tests) |
| 17 | + - [Writing Tests](#writing-tests) |
| 18 | +- [Code Style](#code-style) |
| 19 | + - [Linting](#linting) |
| 20 | + - [Style Guidelines](#style-guidelines) |
| 21 | + |
| 22 | +## Code of Conduct |
| 23 | + |
| 24 | +By participating in this project, you agree to maintain a respectful and inclusive environment for all contributors. Please be considerate and professional in all interactions. |
| 25 | + |
| 26 | +## Contributing |
| 27 | + |
| 28 | +Before submitting a pull request, we kindly ask that you first create an issue to discuss your proposed changes. This helps ensure that your contribution aligns with the project's goals, and allows maintainers and the community to provide feedback early in the process. |
| 29 | + |
| 30 | +### Feature Requests |
| 31 | + |
| 32 | +We welcome feature requests; to propose a new feature: |
| 33 | + |
| 34 | +1. Search existing issues to see if it has already been requested. |
| 35 | +2. Create a new issue if needed, including: |
| 36 | + - The problem it solves. |
| 37 | + - How you envision it working. |
| 38 | + - Any alternatives you've considered. |
| 39 | + - Whether you're willing to contribute the implementation. |
| 40 | + |
| 41 | +### Fixing Issues |
| 42 | + |
| 43 | +If you find a bug or have a problem with the SDK: |
| 44 | + |
| 45 | +1. Search existing issues to see if it has already been reported. |
| 46 | +2. Create a new issue if needed. |
| 47 | + |
| 48 | +## AI Policy |
| 49 | + |
| 50 | +We welcome contributions that leverage AI tools as assistants in the development process. However, we require that: |
| 51 | + |
| 52 | +- You must fully understand all code you submit. |
| 53 | +- You are responsible for the quality and correctness of your code. |
| 54 | +- Automated or low-quality AI pull requests will be rejected. |
| 55 | + |
| 56 | +## Development |
| 57 | + |
| 58 | +### Prerequisites |
| 59 | + |
| 60 | +- **Node.js v20.5.1 or higher** - we recommend using a version manager such as [nvm](https://github.com/nvm-sh/nvm) (macOS) or [nvm-windows](https://github.com/coreybutler/nvm-windows) (Windows). |
| 61 | +- **npm** (comes with Node.js). |
| 62 | + |
| 63 | +### Installation |
| 64 | + |
| 65 | +1. Install dependencies: |
| 66 | + |
| 67 | + ```bash |
| 68 | + npm install |
| 69 | + ``` |
| 70 | + |
| 71 | +2. Build the project: |
| 72 | + |
| 73 | + ```bash |
| 74 | + npm run build |
| 75 | + ``` |
| 76 | + |
| 77 | +3. Watch for changes during development: |
| 78 | + ```bash |
| 79 | + npm run watch |
| 80 | + ``` |
| 81 | + |
| 82 | +## Testing |
| 83 | + |
| 84 | +We use [Vitest](https://vitest.dev/) for testing. Please ensure all tests pass before submitting your changes. |
| 85 | + |
| 86 | +### Running Tests |
| 87 | + |
| 88 | +- Run all tests: |
| 89 | + |
| 90 | + ```bash |
| 91 | + npm test |
| 92 | + ``` |
| 93 | + |
| 94 | +- Run tests in watch mode: |
| 95 | + |
| 96 | + ```bash |
| 97 | + npm run test:watch |
| 98 | + ``` |
| 99 | + |
| 100 | +- Run tests with coverage: |
| 101 | + ```bash |
| 102 | + npm run test:coverage |
| 103 | + ``` |
| 104 | + |
| 105 | +### Writing Tests |
| 106 | + |
| 107 | +- Place test files in `__tests__` directories next to the code they test |
| 108 | +- Name test files with the `.test.ts` pattern (e.g., `action.test.ts`) |
| 109 | +- Write clear, descriptive test names that explain what is being tested |
| 110 | +- Aim for high test coverage, especially for public APIs and critical functionality |
| 111 | + |
| 112 | +## Code Style |
| 113 | + |
| 114 | +This project uses ESLint and Prettier to maintain consistent code style. |
| 115 | + |
| 116 | +### Linting |
| 117 | + |
| 118 | +- Check for linting errors: |
| 119 | + |
| 120 | + ```bash |
| 121 | + npm run lint |
| 122 | + ``` |
| 123 | + |
| 124 | +- Auto-fix linting and formatting issues: |
| 125 | + ```bash |
| 126 | + npm run lint:fix |
| 127 | + ``` |
| 128 | + |
| 129 | +### Style Guidelines |
| 130 | + |
| 131 | +- Use TypeScript for all code. |
| 132 | +- Follow existing patterns and conventions in the codebase. |
| 133 | +- Write clear, self-documenting code with meaningful variable and function names. |
| 134 | +- Add JSDoc comments for public APIs. |
| 135 | +- Keep functions focused and concise. |
0 commit comments