-
Notifications
You must be signed in to change notification settings - Fork 233
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
mpeyper
merged 18 commits into
testing-library:master
from
marcosvega91:pr/migrate-kcd-scripts
Dec 6, 2020
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
f8b466e
chore: migrate to kcd-scripts
marcosvega91 e4b7d7f
format: fix linter issues
marcosvega91 f514788
chore: update version to 0.0.0-semantically-released
marcosvega91 1788eff
chore: add typescript
marcosvega91 c34d93e
test: fix src path
marcosvega91 b4f57ff
chore: add .docz and site to ignore
marcosvega91 afd90b8
doc: move ram.png to public folder
marcosvega91 ade428d
doc: remove USERS.md
marcosvega91 1193599
chore: force install [email protected]
marcosvega91 f552987
chore: remove yarn.lock 😓
marcosvega91 f84a7f5
chore: drop test with snapshot update script
marcosvega91 6a97b73
chore: remove travis
marcosvega91 7413125
chore: add @types/testing-library__react-hooks dep
marcosvega91 e09e961
chore: remove @types/jest
marcosvega91 4086a04
chore: drop useless libraries
marcosvega91 6eaf6f0
chore: build library into lib folder
marcosvega91 c520f29
test: move test into the root folder
marcosvega91 6a3b4b2
style: format everything
marcosvega91 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
coverage | ||
lib | ||
.docz | ||
site |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('kcd-scripts/husky') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
coverage | ||
lib | ||
.docz | ||
site |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,10 +49,10 @@ further defined and clarified by project maintainers. | |
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting | ||
the project team at [email protected]. All complaints will be reviewed and investigated and | ||
will result in a response that is deemed necessary and appropriate to the circumstances. The project | ||
team is obligated to maintain confidentiality with regard to the reporter of an incident. Further | ||
details of specific enforcement policies may be posted separately. | ||
the project team at [email protected]. All complaints will be reviewed and investigated and will | ||
result in a response that is deemed necessary and appropriate to the circumstances. The project team | ||
is obligated to maintain confidentiality with regard to the reporter of an incident. Further details | ||
of specific enforcement policies may be posted separately. | ||
|
||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face | ||
temporary or permanent repercussions as determined by other members of the project's leadership. | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const { jest: jestConfig } = require('kcd-scripts/config') | ||
|
||
module.exports = Object.assign(jestConfig, { | ||
roots: ['<rootDir>/src', '<rootDir>/test'], | ||
testMatch: ['<rootDir>/test/*.js'] | ||
}) | ||
mpeyper marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# 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 --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# 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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.