2020-03-17 15:57:32 +00:00
# Contributions
2024-01-26 18:55:40 +00:00
We welcome contributions in the form of issues and pull requests. We view the contributions and process as the same for internal and external contributors.
2020-03-17 15:57:32 +00:00
## Issues
2024-01-26 18:55:40 +00:00
Log issues for both bugs and enhancement requests. Logging issues are important for the open community.
2020-03-17 15:57:32 +00:00
2024-01-26 18:55:40 +00:00
Issues in this repository should be for the toolkit packages. General feedback for GitHub Actions should be filed in the [community discussions ](https://github.com/orgs/community/discussions/ ). Runner-specific issues can be filed in the [GitHub Actions runner repository ](https://github.com/actions/runner ).
2020-03-17 15:57:32 +00:00
## Enhancements and Feature Requests
2024-01-26 18:55:40 +00:00
We ask that, before significant time or effort is put into code changes, we have agreement on the change itself.
2020-03-17 15:57:32 +00:00
2024-01-26 18:55:40 +00:00
1. Create a feature request.
1. When we agree to take the enhancement, create an Architectural Decision Record (ADR) to agree on the details of the change.
2020-03-17 15:57:32 +00:00
2024-01-26 18:55:40 +00:00
An ADR provides consensus on the direction forward and also serves as a record of the change and motivation. [Read more here ](../docs/adrs/README.md ).
2020-03-17 15:57:32 +00:00
2024-01-26 18:55:40 +00:00
## Development Lifecycle
2019-08-01 15:26:17 +00:00
This repository uses [Lerna ](https://github.com/lerna/lerna#readme ) to manage multiple packages. Read the documentation there to begin contributing.
2024-01-26 18:55:40 +00:00
> [!NOTE]
>
> Before a PR will be accepted, you must ensure:
>
> - All tests are passing
> - `npm run format` reports no issues
> - `npm run lint` reports no issues
2019-08-01 15:26:17 +00:00
### Useful Scripts
2024-01-26 18:55:40 +00:00
- Install dependencies in this repository's packages and cross-link packages where necessary (runs `lerna exec -- npm install` )
```bash
npm run bootstrap
```
- Compile the TypeScript code in each package (alias for `lerna run tsc` )
> This is especially important if one package relies on changes in another.
```bash
npm run build
```
- Check that formatting complies with this repository's [Prettier configuration ](../.prettierrc.json )
```bash
# Check formatting
npm run format-check
# Apply formatting
npm run format
```
- Run Jest tests in all packages in this repository
```bash
npm test
```
- Run Jest tests for a specific package in this repository
```console
npm test -- packages/toolkit
```
- Automate initial setup of a new package (see [Creating a Package ](#creating-a-package ))
```bash
npm run create-package [name]
```
2019-08-01 15:26:17 +00:00
### Creating a Package
2024-01-26 18:55:40 +00:00
1. Create a new branch
```bash
git checkout -b < branch name >
```
1. Create a new Lerna package
```bash
npm run create-package < package-name >
```
2019-08-01 15:26:17 +00:00
2024-01-26 18:55:40 +00:00
This will ask you some questions about the new package.
2019-08-01 15:26:17 +00:00
2024-01-26 18:55:40 +00:00
- Start with `0.0.0` as the first version.
- Look generally at some of the other packages for how the `package.json` is structured.
2019-08-01 15:26:17 +00:00
2024-01-26 18:55:40 +00:00
1. Add the `tsc` script to the new package's `package.json` file:
2019-08-01 15:26:17 +00:00
2024-01-26 18:55:40 +00:00
```json
{
// ...
"scripts": {
"tsc": "tsc"
}
}
```
2019-08-01 15:26:17 +00:00
2024-01-26 18:55:40 +00:00
1. Start developing 😄