Skip to content

Commit b191354

Browse files
author
Kent C. Dodds
committed
feat: initial release
1 parent e1d1644 commit b191354

23 files changed

+663
-0
lines changed

Diff for: .all-contributorsrc

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"projectName": "react-testing-library",
3+
"projectOwner": "kentcdodds",
4+
"files": [
5+
"README.md"
6+
],
7+
"imageSize": 100,
8+
"commit": false,
9+
"contributors": [
10+
{
11+
"login": "kentcdodds",
12+
"name": "Kent C. Dodds",
13+
"avatar_url": "https://avatars.githubusercontent.com/u/1500684?v=3",
14+
"profile": "https://kentcdodds.com",
15+
"contributions": [
16+
"code",
17+
"doc",
18+
"infra",
19+
"test"
20+
]
21+
}
22+
]
23+
}

Diff for: .gitattributes

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

Diff for: .github/ISSUE_TEMPLATE.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!--
2+
Thanks for your interest in the project. I appreciate bugs filed and PRs submitted!
3+
Please make sure that you are familiar with and follow the Code of Conduct for
4+
this project (found in the CODE_OF_CONDUCT.md file).
5+
6+
Please fill out this template with all the relevant information so we can
7+
understand what's going on and fix the issue.
8+
9+
I'll probably ask you to submit the fix (after giving some direction). If you've
10+
never done that before, that's great! Check this free short video tutorial to
11+
learn how: http://kcd.im/pull-request
12+
-->
13+
14+
* `react-testing-library` version:
15+
* `node` version:
16+
* `npm` (or `yarn`) version:
17+
18+
Relevant code or config
19+
20+
```javascript
21+
```
22+
23+
What you did:
24+
25+
What happened:
26+
27+
<!-- Please provide the full error message/screenshots/anything -->
28+
29+
Reproduction repository:
30+
31+
<!--
32+
If possible, please create a repository that reproduces the issue with the
33+
minimal amount of code possible.
34+
-->
35+
36+
Problem description:
37+
38+
Suggested solution:

Diff for: .github/PULL_REQUEST_TEMPLATE.md

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!--
2+
Thanks for your interest in the project. Bugs filed and PRs submitted are appreciated!
3+
4+
Please make sure that you are familiar with and follow the Code of Conduct for
5+
this project (found in the CODE_OF_CONDUCT.md file).
6+
7+
Also, please make sure you're familiar with and follow the instructions in the
8+
contributing guidelines (found in the CONTRIBUTING.md file).
9+
10+
If you're new to contributing to open source projects, you might find this free
11+
video course helpful: http://kcd.im/pull-request
12+
13+
Please fill out the information below to expedite the review and (hopefully)
14+
merge of your pull request!
15+
-->
16+
17+
<!-- What changes are being made? (What feature/bug is being fixed here?) -->
18+
19+
**What**:
20+
21+
<!-- Why are these changes necessary? -->
22+
23+
**Why**:
24+
25+
<!-- How were these changes implemented? -->
26+
27+
**How**:
28+
29+
<!-- Have you done all of these things? -->
30+
31+
**Checklist**:
32+
33+
<!-- add "N/A" to the end of each line that's irrelevant to your changes -->
34+
35+
<!-- to check an item, place an "x" in the box like so: "- [x] Documentation" -->
36+
37+
* [ ] Documentation
38+
* [ ] Tests
39+
* [ ] Ready to be merged <!-- In your opinion, is this ready to be merged as soon as it's reviewed? -->
40+
* [ ] Added myself to contributors table <!-- this is optional, see the contributing guidelines for instructions -->
41+
42+
<!-- feel free to add additional comments -->

Diff for: .gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
node_modules
2+
coverage
3+
dist
4+
.opt-in
5+
.opt-out
6+
.DS_Store
7+
.eslintcache
8+
9+
# these cause more harm than good
10+
# when working with contributors
11+
package-lock.json
12+
yarn.lock

Diff for: .npmrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
registry=http://registry.npmjs.org/
2+
package-lock=false

Diff for: .prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package.json
2+
node_modules
3+
dist
4+
coverage

Diff for: .prettierrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"printWidth": 80,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": false,
6+
"singleQuote": true,
7+
"trailingComma": 'all',
8+
"bracketSpacing": false,
9+
"jsxBracketSameLine": false
10+
}

Diff for: .travis.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
sudo: false
2+
language: node_js
3+
cache:
4+
directories:
5+
- ~/.npm
6+
notifications:
7+
email: false
8+
node_js: '8'
9+
install: npm install
10+
script: npm run validate
11+
after_success: kcd-scripts travis-after-success
12+
branches:
13+
only: master

Diff for: CHANGELOG.md

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

Diff for: CONTRIBUTING.md

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Contributing
2+
3+
Thanks for being willing to contribute!
4+
5+
**Working on your first Pull Request?** You can learn how from this _free_ series
6+
[How to Contribute to an Open Source Project on GitHub][egghead]
7+
8+
## Project setup
9+
10+
1. Fork and clone the repo
11+
2. Run `npm run setup -s` to install dependencies and run validation
12+
3. Create a branch for your PR with `git checkout -b pr/your-branch-name`
13+
14+
> Tip: Keep your `master` branch pointing at the original repository and make
15+
> pull requests from branches on your fork. To do this, run:
16+
>
17+
> ```
18+
> git remote add upstream https://github.com/kentcdodds/react-testing-library.git
19+
> git fetch upstream
20+
> git branch --set-upstream-to=upstream/master master
21+
> ```
22+
>
23+
> This will add the original repository as a "remote" called "upstream,"
24+
> Then fetch the git information from that remote, then set your local `master`
25+
> branch to use the upstream master branch whenever you run `git pull`.
26+
> Then you can make all of your pull request branches based on this `master`
27+
> branch. Whenever you want to update your version of `master`, do a regular
28+
> `git pull`.
29+
30+
## Add yourself as a contributor
31+
32+
This project follows the [all contributors][all-contributors] specification.
33+
To add yourself to the table of contributors on the `README.md`, please use the
34+
automated script as part of your PR:
35+
36+
```console
37+
npm run add-contributor
38+
```
39+
40+
Follow the prompt and commit `.all-contributorsrc` and `README.md` in the PR.
41+
If you've already added yourself to the list and are making
42+
a new type of contribution, you can run it again and select the added
43+
contribution type.
44+
45+
## Committing and Pushing changes
46+
47+
Please make sure to run the tests before you commit your changes. You can run
48+
`npm run test:update` which will update any snapshots that need updating.
49+
Make sure to include those changes (if they exist) in your commit.
50+
51+
### opt into git hooks
52+
53+
There are git hooks set up with this project that are automatically installed
54+
when you install dependencies. They're really handy, but are turned off by
55+
default (so as to not hinder new contributors). You can opt into these by
56+
creating a file called `.opt-in` at the root of the project and putting this
57+
inside:
58+
59+
```
60+
pre-commit
61+
```
62+
63+
## Help needed
64+
65+
Please checkout the [the open issues][issues]
66+
67+
Also, please watch the repo and respond to questions/bug reports/feature
68+
requests! Thanks!
69+
70+
[egghead]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github
71+
[all-contributors]: https://github.com/kentcdodds/all-contributors
72+
[issues]: https://github.com/kentcdodds/react-testing-library/issues

Diff for: LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
Copyright (c) 2017 Kent C. Dodds
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy
5+
of this software and associated documentation files (the "Software"), to deal
6+
in the Software without restriction, including without limitation the rights
7+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the Software is
9+
furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in all
12+
copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
SOFTWARE.

Diff for: other/CODE_OF_CONDUCT.md

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, gender identity and expression, level of experience,
9+
nationality, personal appearance, race, religion, or sexual identity and
10+
orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at [http://contributor-covenant.org/version/1/4][version]
72+
73+
[homepage]: http://contributor-covenant.org
74+
[version]: http://contributor-covenant.org/version/1/4/

Diff for: other/MAINTAINING.md

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

0 commit comments

Comments
 (0)