|
1 | | -# Set up for local development |
| 1 | +# Contributing to frames.js |
2 | 2 |
|
3 | | -First, ensure that the following are installed globally on your machine: |
| 3 | +Thank you for your interest in contributing to frames.js! This guide will help you get started. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +Ensure that the following are installed globally on your machine: |
4 | 8 |
|
5 | 9 | - Node.js 18.7+ |
6 | | -- Yarn |
| 10 | +- Yarn (1.22.x) |
| 11 | + |
| 12 | +## Set up for local development |
| 13 | + |
| 14 | +1. Clone the repository: |
| 15 | + ```bash |
| 16 | + git clone https://github.com/framesjs/frames.js.git |
| 17 | + cd frames.js |
| 18 | + ``` |
| 19 | + |
| 20 | +2. Install dependencies: |
| 21 | + ```bash |
| 22 | + yarn install |
| 23 | + ``` |
| 24 | + |
| 25 | +3. Run all packages in development mode: |
| 26 | + ```bash |
| 27 | + yarn dev |
| 28 | + ``` |
| 29 | + |
| 30 | +4. To run any individual package from its directory: |
| 31 | + ```bash |
| 32 | + cd packages/<package-name> |
| 33 | + yarn dev |
| 34 | + ``` |
| 35 | + Note: You may need to rebuild other packages first. |
| 36 | + |
| 37 | +## Running Tests |
| 38 | + |
| 39 | +Run the full test suite: |
| 40 | +```bash |
| 41 | +yarn test:ci |
| 42 | +``` |
| 43 | + |
| 44 | +Run tests in watch mode (for development): |
| 45 | +```bash |
| 46 | +yarn test |
| 47 | +``` |
| 48 | + |
| 49 | +## Code Style |
7 | 50 |
|
8 | | -1. In the root directory, run `yarn install` |
9 | | -2. Run all packages by running `yarn dev` from the root folder. |
10 | | -3. To run any individual package from it's directory, run `yarn dev`, but you may need to rebuild any other packages |
| 51 | +- We use Prettier for code formatting. Run `yarn format` to format your code. |
| 52 | +- Follow TypeScript best practices and ensure your code passes linting with `yarn lint`. |
| 53 | +- Add JSDoc comments to public functions and classes. |
11 | 54 |
|
12 | | -# Changesets |
| 55 | +## Changesets |
13 | 56 |
|
14 | 57 | All PRs with meaningful changes should have a changeset which is a short description of the modifications being made to each package. Changesets are automatically converted into a changelog when the repo manager runs a release process. |
15 | 58 |
|
16 | | -## Add a new changeset |
| 59 | +### Add a new changeset |
17 | 60 |
|
| 61 | +```bash |
18 | 62 | yarn changeset |
| 63 | +``` |
19 | 64 |
|
20 | | -## Create new versions of packages |
| 65 | +### Create new versions of packages |
21 | 66 |
|
| 67 | +```bash |
22 | 68 | yarn changeset version |
| 69 | +``` |
23 | 70 |
|
24 | | -## Publish all changed packages to npm |
| 71 | +### Publish all changed packages to npm |
25 | 72 |
|
| 73 | +```bash |
26 | 74 | yarn changeset publish |
27 | 75 | git push --follow-tags origin main |
| 76 | +``` |
| 77 | + |
| 78 | +## Pull Request Checklist |
| 79 | + |
| 80 | +Before submitting your PR, please ensure: |
| 81 | + |
| 82 | +- [ ] Code follows the project's coding standards |
| 83 | +- [ ] All tests pass (`yarn test:ci`) |
| 84 | +- [ ] Linting passes (`yarn lint`) |
| 85 | +- [ ] You've added a changeset if applicable |
| 86 | +- [ ] You've added/updated tests for your changes |
| 87 | +- [ ] You've updated documentation if needed |
| 88 | +- [ ] Your commit messages follow conventional commits format |
| 89 | + |
| 90 | +## Troubleshooting |
| 91 | + |
| 92 | +### TypeScript Config Issues |
| 93 | + |
| 94 | +If you encounter TypeScript configuration errors, try: |
| 95 | +```bash |
| 96 | +yarn build:ci |
| 97 | +``` |
| 98 | + |
| 99 | +This will build all packages and resolve type dependencies. |
| 100 | + |
| 101 | +### Dependency Issues |
| 102 | + |
| 103 | +If packages aren't resolving correctly: |
| 104 | +```bash |
| 105 | +rm -rf node_modules |
| 106 | +yarn install |
| 107 | +``` |
| 108 | + |
| 109 | +## Need Help? |
| 110 | + |
| 111 | +- Join the [/frames-dev](https://warpcast.com/frames-dev) channel on Farcaster |
| 112 | +- Check existing issues on GitHub |
| 113 | +- Read the [documentation](https://framesjs.org) |
0 commit comments