|
| 1 | +# How to contribute |
| 2 | + |
| 3 | +We ❤️ pull requests. If you'd like to fix a bug, contribute a feature or just correct a typo, please feel free to do so, as long as you follow our [Code of Conduct](https://github.com/Shopify/slate/blob/master/CODE_OF_CONDUCT.md). |
| 4 | + |
| 5 | +If you're thinking of adding a big new feature, consider opening an issue first to discuss it to ensure it aligns to the direction of the project (and potentially save yourself some time!). |
| 6 | + |
| 7 | +This repo is a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md) consisting of multiple packages and is managed using [Lerna](https://github.com/lerna/lerna). |
| 8 | + |
| 9 | +## Getting Started |
| 10 | + |
| 11 | +To start working on the codebase, first fork the repo, then clone it: |
| 12 | + |
| 13 | +``` |
| 14 | +git clone [email protected]:your-username/slate.git |
| 15 | +``` |
| 16 | + |
| 17 | +_Note: replace "your-username" with your GitHub handle_ |
| 18 | + |
| 19 | +Install all package dependencies and link local packages: |
| 20 | + |
| 21 | +``` |
| 22 | +yarn bootstrap |
| 23 | +``` |
| 24 | + |
| 25 | +Write some features. Run the tests with: |
| 26 | + |
| 27 | +``` |
| 28 | +yarn test |
| 29 | +``` |
| 30 | + |
| 31 | +## Documentation |
| 32 | + |
| 33 | +If your change affects how people use the project (i.e. adding or removing |
| 34 | +functionality, changing the return value of a function, etc), |
| 35 | +please ensure the documentation is also updated to |
| 36 | +reflect this. |
| 37 | + |
| 38 | +## Changelog |
| 39 | + |
| 40 | +The changelog is updated by the repo's maintainers since a [personal access token](https://github.com/settings/tokens) with repository access is needed to handle GitHub's API call limits. |
| 41 | + |
| 42 | +If this is your first time generating changelog entries, add your personal access token with `public_repo` privileges to the `GITHUB_AUTH` environment variable by adding the following to your `.bashrc` file: |
| 43 | + |
| 44 | +``` |
| 45 | +# Lerna Changelog Personal Access Token for shopify/slate repo |
| 46 | +export GITHUB_AUTH=your_personal_access_token |
| 47 | +``` |
| 48 | + |
| 49 | +_Note: replace "your_personal_access_token" with your GitHub personal access token_ |
| 50 | + |
| 51 | +Run the changelog generator: |
| 52 | + |
| 53 | +``` |
| 54 | +npm run changelog |
| 55 | +``` |
| 56 | + |
| 57 | +If nothing appears, you may not have any PRs tagged with appropriate labels in this release or you may have already published those changes. If you just released `v0.12.1` and the previous version was `v0.12.0`, run the following command to get the changes since `v0.12.0`: |
| 58 | + |
| 59 | +``` |
| 60 | +npm run changelog -- --tag-from=v0.12.0 |
| 61 | +``` |
| 62 | + |
| 63 | +Copy the generated markdown from your terminal into [CHANGELOG.md](https://github.com/Shopify/slate/blob/master/CHANGELOG.md) and add any additional comments you wish to include. If the title of the autogenerated changelog is `Unreleased`, make sure you change it the new version name. |
| 64 | + |
| 65 | +Commit the changes directly to `master` branch, with a commit title of: |
| 66 | + |
| 67 | +``` |
| 68 | +Changelog vX.X.X |
| 69 | +``` |
| 70 | + |
| 71 | +_Note: replace "X.X.X" with new repo version number_ |
| 72 | + |
| 73 | +Finally, paste the updates you made to the changelog in the release tag notes, see example: [v0.10.0 tag notes](https://github.com/Shopify/slate/releases/tag/v0.10.0). |
| 74 | + |
| 75 | +## Publishing |
| 76 | + |
| 77 | +1. Merge any changes you want to include in your next release into `master`. |
| 78 | + |
| 79 | +_Note: If you are merging multiple PRs into `master` with a single PR (e.g. you are merging a working branch called v0.11.0 with multiple fixes made from multiple PRs into `master`), then **do not squash and merge this PR** because you will loose valuable details in the auto generated changelog_ |
| 80 | + |
| 81 | +2. Update the [CHANGELOG.md](https://github.com/Shopify/slate/blob/master/CHANGELOG.md) as described above |
| 82 | + |
| 83 | +3. To select a new version number, and publish packages to NPM, run: |
| 84 | + |
| 85 | +``` |
| 86 | +npm run publish |
| 87 | +``` |
| 88 | + |
| 89 | +_Note: Make sure you are logged into your Shopify NPM account before publishing_ |
0 commit comments