Skip to content

Commit

Permalink
Update some contribution guidelines for the monorepo (#286)
Browse files Browse the repository at this point in the history
## Summary
<!-- Succinctly describe your change, providing context, what you've
changed, and why. -->

Adjusting the contribution guidelines after shifting to a monorepo in
#261.

## Checklist
<!-- Tick these items off as you progress. -->
<!-- If an item isn't applicable, ideally please strikeout the item by
wrapping it in "~~"" and suffix it with "N/A My reason for skipping
this." -->
<!-- e.g. "- [ ] ~~Added tests~~ N/A Only touches docs" -->

- [ ] ~~Added a [docs PR](https://github.com/inngest/website) that
references this PR~~ N/A README only
- [ ] ~~Added unit/integration tests~~ N/A README only
- [x] Added changesets if applicable

## Related
<!-- A space for any related links, issues, or PRs. -->
<!-- Linear issues are autolinked. -->
<!-- e.g. - INN-123 -->
<!-- GitHub issues/PRs can be linked using shorthand. -->
<!-- e.g. "- inngest/inngest#123" -->
<!-- Feel free to remove this section if there are no applicable related
links.-->
- #261
  • Loading branch information
jpwilliams authored Aug 10, 2023
1 parent 5f91d94 commit 5587a15
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 28 deletions.
5 changes: 5 additions & 0 deletions .changeset/pink-kangaroos-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"inngest": patch
---

Updated contribution guidelines
50 changes: 22 additions & 28 deletions packages/inngest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,49 +131,43 @@ inngest.send("app/user.signup", {

## Contributing

Clone the repository, then:
Prerequisites:

```sh
yarn dev # install dependencies, build/lint/test
```

We use [Volta](https://volta.sh/) to manage Node/Yarn versions.

> When making a pull request, make sure to commit the changed `etc/inngest.api.md` file; this is a generated types/docs file that will highlight changes to the exposed API.
1. Clone this repository
2. Intall [`pnpm`](https://pnpm.io/installation)
3. Install [Volta](https://volta.sh/) to manage consistent Node versions (optional)

### Locally linking (`npm|yarn link`)
### Development

To test changes with other local repos, you can link the project like so (replace `npm` for `yarn` if desired):
Run the following command in the `packages/inngest/` directory:

```sh
# in this repo
yarn build
yarn link

# in another repo
yarn link inngest
pnpm dev
```

Alternatively, you can also package the library and ship it with an application. This is a nice way to generate and ship snapshot/test versions of the library to test in production environments without requiring releasing to npm.
This will install dependencies, build, and lint the package. It will watch for changes and re-run appropriate commands.

### Testing the package

To test changes with other local repositories, we recommend packaging the library entirely and directly installing the resulting `.tgz` file. This is often more reliable than linking, which can cause issues when using multiple package managers.

```sh
# in this repo
yarn local:pack
cp inngest.tgz ../some-other-repo-root
# in packages/inngest/
pnpm local:pack # creates inngest.tgz

# in another repo
yarn add ./inngest.tgz
yarn add ~/path/to/packages/inngest/inngest.tgz
```

Some platforms require manually installing the package again at build time to properly link dependencies, so you may have to change your `yarn build` script to be prefixed with this install, e.g.:

```sh
yarn add ./inngest.tgz && framework dev
```
You can also use this method to ship a snapshot of the library with an application. This is a nice way to generate and ship snapshot versions without requiring a release to npm.

### Releasing

To release to production, we use [Changesets](https://github.com/changesets/changesets). This means that releasing and changelog generation is all managed through PRs, where a bot will guide you through the process of announcing changes in PRs and releasing them once merged to `main`.
To release to production, we use [Changesets](https://github.com/changesets/changesets). This means that releasing and changelog generation is all managed through PRs, where a bot will guide you through the process of adding release notes to PRs.

As PRs are merged into `main`, a new PR (usually called **Release @latest**) is created that rolls up all release notes since the last release, allowing you bundle changes together. Once you're happy with the release, merge this new PR and the bot will release the package to npm for you.

Merging PRs to `main` (therefore both introducing a potential change and releasing to npm) requires that tests pass and a contributor has approved the PR.

#### Legacy versions

Expand All @@ -195,7 +189,7 @@ You can see the currently available tags on the [`inngest` npm page](https://www
If the current active version is `v1.1.1`, this is a minor release, and our tag is `foo`, we'd do:

```sh
yarn version v1.2.0-foo.1
yarn version 1.2.0-foo.1
yarn build
npm publish --access public --tag foo
```
Expand Down

0 comments on commit 5587a15

Please sign in to comment.