|
| 1 | +# Contributing to react-use-intercom |
| 2 | + |
| 3 | +## Preparing |
| 4 | + |
| 5 | +1. Install pnpm: |
| 6 | + |
| 7 | +```sh |
| 8 | +npm install -g pnpm@8 |
| 9 | +``` |
| 10 | + |
| 11 | +2. Fork and clone the repository |
| 12 | +3. Install dependencies: |
| 13 | + |
| 14 | +```sh |
| 15 | +pnpm install |
| 16 | +``` |
| 17 | + |
| 18 | +4. The project uses a monorepo structure with pnpm workspaces: |
| 19 | + |
| 20 | +- `/packages/react-use-intercom`: Main library package |
| 21 | +- `/apps/playground`: Development playground |
| 22 | +- `/apps/examples`: Example applications |
| 23 | + |
| 24 | +## Development Workflow |
| 25 | + |
| 26 | +1. Create a new branch for your feature/fix: |
| 27 | + |
| 28 | +```sh |
| 29 | +git checkout -b your-feature-name |
| 30 | +``` |
| 31 | + |
| 32 | +2. Make your changes in the appropriate package |
| 33 | + |
| 34 | +3. To test your changes: |
| 35 | + |
| 36 | + - Start the playground: `pnpm dev` |
| 37 | + - Run the test suite: `pnpm test` |
| 38 | + - Run E2E tests: `pnpm test:e2e` |
| 39 | + |
| 40 | +4. Create a changeset to document your changes: |
| 41 | + |
| 42 | +```sh |
| 43 | +pnpm changeset |
| 44 | +``` |
| 45 | + |
| 46 | +Follow the prompts to describe your changes. This step is required for any user-facing changes. |
| 47 | + |
| 48 | +5. Before submitting your PR: |
| 49 | + - Ensure all tests pass |
| 50 | + - Add or update tests as needed |
| 51 | + - Follow the existing code style |
| 52 | + - Update documentation if necessary |
| 53 | + - Verify your changeset accurately describes the changes |
| 54 | + |
| 55 | +## Pull Request |
| 56 | + |
| 57 | +1. Update the README.md with details of changes if applicable |
| 58 | +2. Ensure your PR includes a changeset if it includes user-facing changes |
| 59 | + |
| 60 | +## Testing |
| 61 | + |
| 62 | +- Write unit tests for new features |
| 63 | +- Update existing tests when modifying features |
| 64 | +- Ensure all tests pass before submitting a PR |
| 65 | +- Add E2E tests for new user-facing features |
| 66 | + |
| 67 | +## Documentation |
| 68 | + |
| 69 | +- Update the README.md if you add or modify features |
| 70 | +- Include JSDoc comments for public APIs |
| 71 | +- Keep documentation clear and concise |
0 commit comments