Skip to content

Commit 457735d

Browse files
authored
Merge pull request #502 from marcosvega91/pr/migrate-kcd-scripts
chore: migrate to kcd
2 parents e61fa80 + 6a3b4b2 commit 457735d

37 files changed

+332
-124
lines changed

.babelrc

-12
This file was deleted.

.eslintignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
coverage
3+
lib
4+
.docz
5+
site

.eslintrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "./node_modules/kcd-scripts/eslint.js",
3+
"rules": {
4+
"max-lines-per-function": "off",
5+
"no-constant-condition": "off",
6+
"no-await-in-loop": "off",
7+
"react-hooks/rules-of-hooks": "off",
8+
"no-console": "off"
9+
}
10+
}

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/ISSUE_TEMPLATE/---feature-request.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ about: "I have a suggestion (and might want to implement myself \U0001F642)!"
44
title: ''
55
labels: enhancement
66
assignees: ''
7-
87
---
98

109
<!--

.github/workflows/validate.yml

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: validate
2+
on:
3+
push:
4+
branches:
5+
- '+([0-9])?(.{+([0-9]),x}).x'
6+
- 'main'
7+
- 'next'
8+
- 'next-major'
9+
- 'beta'
10+
- 'alpha'
11+
- '!all-contributors/**'
12+
pull_request: {}
13+
jobs:
14+
main:
15+
# ignore all-contributors PRs
16+
if: ${{ !contains(github.head_ref, 'all-contributors') }}
17+
strategy:
18+
matrix:
19+
node: [10.13, 12, 14, 15]
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: 🛑 Cancel Previous Runs
23+
uses: styfle/[email protected]
24+
with:
25+
access_token: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: ⬇️ Checkout repo
28+
uses: actions/checkout@v2
29+
30+
- name: ⎔ Setup node
31+
uses: actions/setup-node@v1
32+
with:
33+
node-version: ${{ matrix.node }}
34+
35+
- name: 📥 Download deps
36+
uses: bahmutov/npm-install@v1
37+
with:
38+
useLockFile: false
39+
40+
- name: ▶️ Run validate script
41+
run: npm run validate
42+
43+
- name: ⬆️ Upload coverage report
44+
uses: codecov/codecov-action@v1
45+
46+
release:
47+
needs: main
48+
runs-on: ubuntu-latest
49+
if:
50+
${{ github.repository == 'testing-library/react-hooks-testing-library' &&
51+
contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha',
52+
github.ref) && github.event_name == 'push' }}
53+
steps:
54+
- name: 🛑 Cancel Previous Runs
55+
uses: styfle/[email protected]
56+
with:
57+
access_token: ${{ secrets.GITHUB_TOKEN }}
58+
59+
- name: ⬇️ Checkout repo
60+
uses: actions/checkout@v2
61+
62+
- name: ⎔ Setup node
63+
uses: actions/setup-node@v1
64+
with:
65+
node-version: 14
66+
67+
- name: 📥 Download deps
68+
uses: bahmutov/npm-install@v1
69+
with:
70+
useLockFile: false
71+
72+
- name: 🏗 Run build script
73+
run: npm run build
74+
75+
- name: 🚀 Release
76+
uses: cycjimmy/semantic-release-action@v2
77+
with:
78+
semantic_version: 17
79+
branches: |
80+
[
81+
'+([0-9])?(.{+([0-9]),x}).x',
82+
'main',
83+
'next',
84+
'next-major',
85+
{name: 'beta', prerelease: true},
86+
{name: 'alpha', prerelease: true}
87+
]
88+
env:
89+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.huskyrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('kcd-scripts/husky')

.prettierignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
coverage
3+
lib
4+
.docz
5+
site

.prettierrc.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
printWidth: 100,
3+
semi: false,
4+
singleQuote: true,
5+
arrowParens: 'always',
6+
proseWrap: 'always',
7+
trailingComma: 'none'
8+
}

.travis.yml

-10
This file was deleted.

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# CHANGELOG
2+
3+
The changelog is automatically updated using
4+
[semantic-release](https://github.com/semantic-release/semantic-release). You can see it on the
5+
[releases page](../../releases).

CODE_OF_CONDUCT.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ further defined and clarified by project maintainers.
4949
## Enforcement
5050

5151
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting
52-
the project team at [email protected]. All complaints will be reviewed and investigated and
53-
will result in a response that is deemed necessary and appropriate to the circumstances. The project
54-
team is obligated to maintain confidentiality with regard to the reporter of an incident. Further
55-
details of specific enforcement policies may be posted separately.
52+
the project team at [email protected]. All complaints will be reviewed and investigated and will
53+
result in a response that is deemed necessary and appropriate to the circumstances. The project team
54+
is obligated to maintain confidentiality with regard to the reporter of an incident. Further details
55+
of specific enforcement policies may be posted separately.
5656

5757
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face
5858
temporary or permanent repercussions as determined by other members of the project's leadership.

CONTRIBUTING.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ Please make sure to run the tests before you commit your changes. You can do so
2929

3030
### Update Typings
3131

32-
The TypeScript type definitions can be found in the [DefinitelyTyped repo](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/testing-library__react-hooks).
32+
The TypeScript type definitions can be found in the
33+
[DefinitelyTyped repo](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/testing-library__react-hooks).
3334

3435
## Help needed
3536

README.md

+24-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
2+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
3+
4+
- [react-hooks-testing-library](#react-hooks-testing-library)
5+
- [The problem](#the-problem)
6+
- [The solution](#the-solution)
7+
- [When to use this library](#when-to-use-this-library)
8+
- [When not to use this library](#when-not-to-use-this-library)
9+
- [Example](#example)
10+
- [`useCounter.js`](#usecounterjs)
11+
- [`useCounter.test.js`](#usecountertestjs)
12+
- [Installation](#installation)
13+
- [Peer Dependencies](#peer-dependencies)
14+
- [API](#api)
15+
- [Contributors](#contributors)
16+
- [Issues](#issues)
17+
- [🐛 Bugs](#-bugs)
18+
- [💡 Feature Requests](#-feature-requests)
19+
- [❓ Questions](#-questions)
20+
- [LICENSE](#license)
21+
22+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
23+
124
<div align="center">
225
<h1>react-hooks-testing-library</h1>
326

@@ -6,7 +29,7 @@
629
height="80"
730
width="80"
831
alt="ram"
9-
src="https://raw.githubusercontent.com/testing-library/react-hooks-testing-library/master/other/ram.png"
32+
src="https://raw.githubusercontent.com/testing-library/react-hooks-testing-library/master/public/ram.png"
1033
/>
1134
</a>
1235

docs/api-reference.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ function waitForValueToChange(selector: function(): any, options?: {
236236
}): Promise<void>
237237
```
238238

239-
Returns a `Promise` that resolves if the value returned from the provided selector changes. It is
240-
expected that the [`result` of `renderHook`](/reference/api#result) will be used to select the
241-
value for comparison.
239+
Returns a `Promise` that resolves if the value returned from the provided selector changes. It is
240+
expected that the [`result` of `renderHook`](/reference/api#result) will be used to select the value
241+
for comparison.
242242

243243
#### `interval`
244244

docs/introduction.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ route: '/'
1111
height="80"
1212
width="80"
1313
alt="ram"
14-
src="https://raw.githubusercontent.com/mpeyper/react-hooks-testing-library/master/other/ram.png"
14+
src="https://raw.githubusercontent.com/mpeyper/react-hooks-testing-library/master/public/ram.png"
1515
/>
1616
</a>
1717

doczrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export default {
33
files: '**/*.{md,mdx}',
44
src: 'docs',
55
dest: 'site',
6-
public: './other',
6+
public: './public',
77
ignore: ['CODE_OF_CONDUCT.md', 'CONTRIBUTING.md', 'LICENSE.md'],
88
htmlContext: {
99
favicon: '/public/ram.png'

jest.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const { jest: jestConfig } = require('kcd-scripts/config')
2+
3+
module.exports = Object.assign(jestConfig, {
4+
roots: ['<rootDir>/src', '<rootDir>/test'],
5+
testMatch: ['<rootDir>/test/*.js']
6+
})

other/MAINTAINING.md

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Maintaining
2+
3+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
4+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
5+
6+
**Table of Contents**
7+
8+
- [Code of Conduct](#code-of-conduct)
9+
- [Issues](#issues)
10+
- [Pull Requests](#pull-requests)
11+
- [Release](#release)
12+
- [Thanks!](#thanks)
13+
14+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
15+
16+
This is documentation for maintainers of this project.
17+
18+
## Code of Conduct
19+
20+
Please review, understand, and be an example of it. Violations of the code of conduct are taken
21+
seriously, even (especially) for maintainers.
22+
23+
## Issues
24+
25+
We want to support and build the community. We do that best by helping people learn to solve their
26+
own problems. We have an issue template and hopefully most folks follow it. If it's not clear what
27+
the issue is, invite them to create a minimal reproduction of what they're trying to accomplish or
28+
the bug they think they've found.
29+
30+
Once it's determined that a code change is necessary, point people to
31+
[makeapullrequest.com](https://makeapullrequest.com) and invite them to make a pull request. If
32+
they're the one who needs the feature, they're the one who can build it. If they need some hand
33+
holding and you have time to lend a hand, please do so. It's an investment into another human being,
34+
and an investment into a potential maintainer.
35+
36+
Remember that this is open source, so the code is not yours, it's ours. If someone needs a change in
37+
the codebase, you don't have to make it happen yourself. Commit as much time to the project as you
38+
want/need to. Nobody can ask any more of you than that.
39+
40+
## Pull Requests
41+
42+
As a maintainer, you're fine to make your branches on the main repo or on your own fork. Either way
43+
is fine.
44+
45+
When we receive a pull request, a GitHub Action is kicked off automatically (see the
46+
`.github/workflows/validate.yml` for what runs in the Action). We avoid merging anything that breaks
47+
the GitHub Action.
48+
49+
Please review PRs and focus on the code rather than the individual. You never know when this is
50+
someone's first ever PR and we want their experience to be as positive as possible, so be uplifting
51+
and constructive.
52+
53+
When you merge the pull request, 99% of the time you should use the
54+
[Squash and merge](https://help.github.com/articles/merging-a-pull-request/) feature. This keeps our
55+
git history clean, but more importantly, this allows us to make any necessary changes to the commit
56+
message so we release what we want to release. See the next section on Releases for more about that.
57+
58+
## Release
59+
60+
Our releases are automatic. They happen whenever code lands into `main`. A GitHub Action gets kicked
61+
off and if it's successful, a tool called
62+
[`semantic-release`](https://github.com/semantic-release/semantic-release) is used to automatically
63+
publish a new release to npm as well as a changelog to GitHub. It is only able to determine the
64+
version and whether a release is necessary by the git commit messages. With this in mind, **please
65+
brush up on [the commit message convention][commit] which drives our releases.**
66+
67+
> One important note about this: Please make sure that commit messages do NOT contain the words
68+
> "BREAKING CHANGE" in them unless we want to push a major version. I've been burned by this more
69+
> than once where someone will include "BREAKING CHANGE: None" and it will end up releasing a new
70+
> major version. Not a huge deal honestly, but kind of annoying...
71+
72+
## Thanks!
73+
74+
Thank you so much for helping to maintain this project!
75+
76+
<!-- prettier-ignore-start -->
77+
[commit]: https://github.com/conventional-changelog-archived-repos/conventional-changelog-angular/blob/ed32559941719a130bb0327f886d6a32a8cbc2ba/convention.md
78+
<!-- prettier-ignore-end -->

other/manual-releases.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# manual-releases
2+
3+
This project has an automated release set up. So things are only released when there are useful
4+
changes in the code that justify a release. But sometimes things get messed up one way or another
5+
and we need to trigger the release ourselves. When this happens, simply bump the number below and
6+
commit that with the following commit message based on your needs:
7+
8+
**Major**
9+
10+
```
11+
fix(release): manually release a major version
12+
13+
There was an issue with a major release, so this manual-releases.md
14+
change is to release a new major version.
15+
16+
Reference: #<the number of a relevant pull request, issue, or commit>
17+
18+
BREAKING CHANGE: <mention any relevant breaking changes (this is what triggers the major version change so don't skip this!)>
19+
```
20+
21+
**Minor**
22+
23+
```
24+
feat(release): manually release a minor version
25+
26+
There was an issue with a minor release, so this manual-releases.md
27+
change is to release a new minor version.
28+
29+
Reference: #<the number of a relevant pull request, issue, or commit>
30+
```
31+
32+
**Patch**
33+
34+
```
35+
fix(release): manually release a patch version
36+
37+
There was an issue with a patch release, so this manual-releases.md
38+
change is to release a new patch version.
39+
40+
Reference: #<the number of a relevant pull request, issue, or commit>
41+
```
42+
43+
The number of times we've had to do a manual release is: 0

0 commit comments

Comments
 (0)