Skip to content

fix(typescript): move typings to DefinitelyTyped #437

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 2 commits into from
Aug 15, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
35 changes: 3 additions & 32 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,45 +26,16 @@ series [How to Contribute to an Open Source Project on GitHub][egghead]
> can make all of your pull request branches based on this `master` branch.
> Whenever you want to update your version of `master`, do a regular `git pull`.

## Add yourself as a contributor
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that cleaning up random things in an unrelated PR is poor practice, but I couldn't help myself 😅

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear, this is managed via a bot... Which I'm about to use :)


This project follows the [all contributors][all-contributors] specification. To
add yourself to the table of contributors on the `README.md`, please use the
automated script as part of your PR:

```console
npm run add-contributor
```

Follow the prompt and commit `.all-contributorsrc` and `README.md` in the PR. If
you've already added yourself to the list and are making a new type of
contribution, you can run it again and select the added contribution type.

## Committing and Pushing changes

Please make sure to run the tests before you commit your changes. You can run
`npm run test:update` which will update any snapshots that need updating. Make
sure to include those changes (if they exist) in your commit.

### opt into git hooks

There are git hooks set up with this project that are automatically installed
when you install dependencies. They're really handy, but are turned off by
default (so as to not hinder new contributors). You can opt into these by
creating a file called `.opt-in` at the root of the project and putting this
inside:

```
pre-commit
```

### Add typings
### Update Typings

If your PR introduced some changes in the API, you are more than welcome to
modify the Typescript type definition to reflect those changes. Just modify the
`/typings/index.d.ts` file accordingly. If you have never seen Typescript
definitions before, you can read more about it in its
[documentation pages](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html)
The TypeScript type definitions are in the
[DefinitelyTyped repo](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/testing-library__react)

## Help needed

Expand Down
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"description": "Simple and complete React DOM testing utilities that encourage good testing practices.",
"main": "dist/index.js",
"module": "dist/@testing-library/react.esm.js",
"typings": "typings/index.d.ts",
"engines": {
"node": ">=8"
},
Expand All @@ -23,7 +22,6 @@
},
"files": [
"dist",
"typings",
"cleanup-after-each.js",
"dont-cleanup-after-each.js",
"pure.js"
Expand All @@ -45,13 +43,11 @@
"dependencies": {
"@babel/runtime": "^7.5.5",
"@testing-library/dom": "^6.0.0",
"@types/react-dom": "*"
"@types/testing-library__react": "^9.1.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need the react-dom typings as a dep because they'll come along with testing-library__react :)

},
"devDependencies": {
"@reach/router": "^1.2.1",
"@testing-library/jest-dom": "^4.0.0",
"@types/react": "^16.9.1",
"@types/react-dom": "^16.8.5",
"kcd-scripts": "^1.5.2",
"react": "^16.9.0",
"react-dom": "^16.9.0"
Expand Down
49 changes: 0 additions & 49 deletions typings/index.d.ts

This file was deleted.