Skip to content

chore: migrate to kcd #502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Dec 6, 2020
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .babelrc

This file was deleted.

5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
coverage
dist
.docz
site
10 changes: 10 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./node_modules/kcd-scripts/eslint.js",
"rules": {
"max-lines-per-function": "off",
"no-constant-condition": "off",
"no-await-in-loop": "off",
"react-hooks/rules-of-hooks": "off",
"no-console": "off"
}
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
90 changes: 90 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: validate
on:
push:
branches:
- '+([0-9])?(.{+([0-9]),x}).x'
- 'main'
- 'next'
- 'next-major'
- 'beta'
- 'alpha'
- '!all-contributors/**'
pull_request: {}
jobs:
main:
# ignore all-contributors PRs
if: ${{ !contains(github.head_ref, 'all-contributors') }}
strategy:
matrix:
node: [10.13, 12, 14, 15]
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}

- name: ⬇️ Checkout repo
uses: actions/checkout@v2

- name: ⎔ Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false

- name: ▶️ Run validate script
run: npm run validate

- name: ⬆️ Upload coverage report
uses: codecov/codecov-action@v1

release:
needs: main
runs-on: ubuntu-latest
if:
${{ github.repository == 'testing-library/react-hooks-testing-library' &&
contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha',
github.ref) && github.event_name == 'push' }}
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}

- name: ⬇️ Checkout repo
uses: actions/checkout@v2

- name: ⎔ Setup node
uses: actions/setup-node@v1
with:
node-version: 14

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false

- name: 🏗 Run build script
run: npm run build

- name: 🚀 Release
uses: cycjimmy/semantic-release-action@v2
with:
semantic_version: 17
branches: |
[
'+([0-9])?(.{+([0-9]),x}).x',
'main',
'next',
'next-major',
{name: 'beta', prerelease: true},
{name: 'alpha', prerelease: true}
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
node_modules
coverage
lib
dist
.docz
site
1 change: 1 addition & 0 deletions .huskyrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('kcd-scripts/husky')
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
coverage
dist
.docz
site
8 changes: 8 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
printWidth: 100,
semi: false,
singleQuote: true,
arrowParens: 'always',
proseWrap: 'always',
trailingComma: 'none',
}
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# CHANGELOG

The changelog is automatically updated using
[semantic-release](https://github.com/semantic-release/semantic-release). You
can see it on the [releases page](../../releases).
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->


- [react-hooks-testing-library](#react-hooks-testing-library)
- [The problem](#the-problem)
- [The solution](#the-solution)
- [When to use this library](#when-to-use-this-library)
- [When not to use this library](#when-not-to-use-this-library)
- [Example](#example)
- [`useCounter.js`](#usecounterjs)
- [`useCounter.test.js`](#usecountertestjs)
- [Installation](#installation)
- [Peer Dependencies](#peer-dependencies)
- [API](#api)
- [Contributors](#contributors)
- [Issues](#issues)
- [🐛 Bugs](#-bugs)
- [💡 Feature Requests](#-feature-requests)
- [❓ Questions](#-questions)
- [LICENSE](#license)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

<div align="center">
<h1>react-hooks-testing-library</h1>

Expand All @@ -6,7 +30,7 @@
height="80"
width="80"
alt="ram"
src="https://raw.githubusercontent.com/testing-library/react-hooks-testing-library/master/other/ram.png"
src="https://raw.githubusercontent.com/testing-library/react-hooks-testing-library/master/public/ram.png"
/>
</a>

Expand Down
2 changes: 1 addition & 1 deletion docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ route: '/'
height="80"
width="80"
alt="ram"
src="https://raw.githubusercontent.com/mpeyper/react-hooks-testing-library/master/other/ram.png"
src="https://raw.githubusercontent.com/mpeyper/react-hooks-testing-library/master/public/ram.png"
/>
</a>

Expand Down
2 changes: 1 addition & 1 deletion doczrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export default {
files: '**/*.{md,mdx}',
src: 'docs',
dest: 'site',
public: './other',
public: './public',
ignore: ['CODE_OF_CONDUCT.md', 'CONTRIBUTING.md', 'LICENSE.md'],
htmlContext: {
favicon: '/public/ram.png'
Expand Down
84 changes: 84 additions & 0 deletions other/MAINTAINING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Maintaining

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

**Table of Contents**

- [Code of Conduct](#code-of-conduct)
- [Issues](#issues)
- [Pull Requests](#pull-requests)
- [Release](#release)
- [Thanks!](#thanks)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

This is documentation for maintainers of this project.

## Code of Conduct

Please review, understand, and be an example of it. Violations of the code of
conduct are taken seriously, even (especially) for maintainers.

## Issues

We want to support and build the community. We do that best by helping people
learn to solve their own problems. We have an issue template and hopefully most
folks follow it. If it's not clear what the issue is, invite them to create a
minimal reproduction of what they're trying to accomplish or the bug they think
they've found.

Once it's determined that a code change is necessary, point people to
[makeapullrequest.com](https://makeapullrequest.com) and invite them to make a
pull request. If they're the one who needs the feature, they're the one who can
build it. If they need some hand holding and you have time to lend a hand,
please do so. It's an investment into another human being, and an investment
into a potential maintainer.

Remember that this is open source, so the code is not yours, it's ours. If
someone needs a change in the codebase, you don't have to make it happen
yourself. Commit as much time to the project as you want/need to. Nobody can ask
any more of you than that.

## Pull Requests

As a maintainer, you're fine to make your branches on the main repo or on your
own fork. Either way is fine.

When we receive a pull request, a GitHub Action is kicked off automatically (see
the `.github/workflows/validate.yml` for what runs in the Action). We avoid
merging anything that breaks the GitHub Action.

Please review PRs and focus on the code rather than the individual. You never
know when this is someone's first ever PR and we want their experience to be as
positive as possible, so be uplifting and constructive.

When you merge the pull request, 99% of the time you should use the
[Squash and merge](https://help.github.com/articles/merging-a-pull-request/)
feature. This keeps our git history clean, but more importantly, this allows us
to make any necessary changes to the commit message so we release what we want
to release. See the next section on Releases for more about that.

## Release

Our releases are automatic. They happen whenever code lands into `main`. A
GitHub Action gets kicked off and if it's successful, a tool called
[`semantic-release`](https://github.com/semantic-release/semantic-release) is
used to automatically publish a new release to npm as well as a changelog to
GitHub. It is only able to determine the version and whether a release is
necessary by the git commit messages. With this in mind, **please brush up on
[the commit message convention][commit] which drives our releases.**

> One important note about this: Please make sure that commit messages do NOT
> contain the words "BREAKING CHANGE" in them unless we want to push a major
> version. I've been burned by this more than once where someone will include
> "BREAKING CHANGE: None" and it will end up releasing a new major version. Not
> a huge deal honestly, but kind of annoying...

## Thanks!

Thank you so much for helping to maintain this project!

<!-- prettier-ignore-start -->
[commit]: https://github.com/conventional-changelog-archived-repos/conventional-changelog-angular/blob/ed32559941719a130bb0327f886d6a32a8cbc2ba/convention.md
<!-- prettier-ignore-end -->
44 changes: 44 additions & 0 deletions other/manual-releases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# manual-releases

This project has an automated release set up. So things are only released when
there are useful changes in the code that justify a release. But sometimes
things get messed up one way or another and we need to trigger the release
ourselves. When this happens, simply bump the number below and commit that with
the following commit message based on your needs:

**Major**

```
fix(release): manually release a major version

There was an issue with a major release, so this manual-releases.md
change is to release a new major version.

Reference: #<the number of a relevant pull request, issue, or commit>

BREAKING CHANGE: <mention any relevant breaking changes (this is what triggers the major version change so don't skip this!)>
```

**Minor**

```
feat(release): manually release a minor version

There was an issue with a minor release, so this manual-releases.md
change is to release a new minor version.

Reference: #<the number of a relevant pull request, issue, or commit>
```

**Patch**

```
fix(release): manually release a patch version

There was an issue with a patch release, so this manual-releases.md
change is to release a new patch version.

Reference: #<the number of a relevant pull request, issue, or commit>
```

The number of times we've had to do a manual release is: 0
Loading