From a31ecc90664d8ec489cea97e8e5ddb8a7ff62b83 Mon Sep 17 00:00:00 2001 From: itsik-avidan <48879394+itsik-avidan@users.noreply.github.com> Date: Sun, 18 Jul 2021 14:06:18 +0300 Subject: [PATCH] chore: rename default branch (#675) * chore: Updating master branch refs into main * chore: updating the validate file to support both main and master branches as an intermidiate step --- .github/workflows/validate.yml | 4 +++- CONTRIBUTING.md | 14 +++++++------- README.md | 13 +++++++------ other/MAINTAINING.md | 2 +- src/keyboard/getNextKeyDef.ts | 2 +- 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 109bd90d..b0c16d04 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -4,6 +4,7 @@ on: branches: [ '+([0-9])?(.{+([0-9]),x}).x', + 'main', 'master', 'next', 'next-major', @@ -46,7 +47,7 @@ jobs: runs-on: ubuntu-latest if: ${{ github.repository == 'testing-library/user-event' && - contains('refs/heads/master,refs/heads/beta,refs/heads/next,refs/heads/alpha', + contains('refs/heads/main,refs/heads/master,refs/heads/beta,refs/heads/next,refs/heads/alpha', github.ref) && github.event_name == 'push' }} steps: - name: ⬇️ Checkout repo @@ -74,6 +75,7 @@ jobs: branches: | [ '+([0-9])?(.{+([0-9]),x}).x', + 'main', 'master', 'next', 'next-major', diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d34423fe..43bc1c16 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,20 +11,20 @@ series [How to Contribute to an Open Source Project on GitHub][egghead] 2. Run `npm run setup -s` to install dependencies and run validation 3. Create a branch for your PR with `git checkout -b pr/your-branch-name` -> Tip: Keep your `master` branch pointing at the original repository and make -> pull requests from branches on your fork. To do this, run: +> Tip: Keep your `main` branch pointing at the original repository and make pull +> requests from branches on your fork. To do this, run: > > ``` > git remote add upstream https://github.com/testing-library/user-event > git fetch upstream -> git branch --set-upstream-to=upstream/master master +> git branch --set-upstream-to=upstream/main main > ``` > > This will add the original repository as a "remote" called "upstream," Then -> fetch the git information from that remote, then set your local `master` -> branch to use the upstream master branch whenever you run `git pull`. Then you -> 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`. +> fetch the git information from that remote, then set your local `main` branch +> to use the upstream main branch whenever you run `git pull`. Then you can make +> all of your pull request branches based on this `main` branch. Whenever you +> want to update your version of `main`, do a regular `git pull`. ## Consistency diff --git a/README.md b/README.md index 5ac8bb77..3dbce070 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ height="80" width="80" alt="dog" - src="https://raw.githubusercontent.com/testing-library/user-event/master/other/dog.png" + src="https://raw.githubusercontent.com/testing-library/user-event/main/other/dog.png" /> @@ -136,7 +136,8 @@ constructor documentation for more options. Note that `click` will trigger hover events before clicking. To disable this, set the `skipHover` option to `true`. Also note that trying to click an element -with `pointer-events` being set to `"none"` (i.e. unclickable) will throw an error. +with `pointer-events` being set to `"none"` (i.e. unclickable) will throw an +error. ### `dblClick(element, eventInit, options)` @@ -323,7 +324,7 @@ userEvent.keyboard('a', {keyboardState}) // press [KeyA] with active ctrlKey mod ``` The mapping of `key` to `code` is performed by a -[default key map](https://github.com/testing-library/user-event/blob/master/src/keyboard/keyMap.ts) +[default key map](https://github.com/testing-library/user-event/blob/main/src/keyboard/keyMap.ts) portraying a "default" US-keyboard. You can provide your own local keyboard mapping per option. @@ -796,7 +797,7 @@ MIT [npm]: https://www.npmjs.com [node]: https://nodejs.org -[build-badge]: https://img.shields.io/github/workflow/status/testing-library/user-event/validate/master?logo=github&style=flat-square +[build-badge]: https://img.shields.io/github/workflow/status/testing-library/user-event/validate/main?logo=github&style=flat-square [build]: https://github.com/testing-library/user-event/actions?query=workflow%3Avalidate [coverage-badge]: https://img.shields.io/codecov/c/github/testing-library/user-event.svg?style=flat-square [coverage]: https://codecov.io/github/testing-library/user-event @@ -805,11 +806,11 @@ MIT [downloads-badge]: https://img.shields.io/npm/dm/@testing-library/user-event.svg?style=flat-square [npmtrends]: http://www.npmtrends.com/@testing-library/user-event [license-badge]: https://img.shields.io/npm/l/@testing-library/user-event.svg?style=flat-square -[license]: https://github.com/testing-library/user-event/blob/master/LICENSE +[license]: https://github.com/testing-library/user-event/blob/main/LICENSE [prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square [prs]: http://makeapullrequest.com [coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square -[coc]: https://github.com/testing-library/user-event/blob/master/other/CODE_OF_CONDUCT.md +[coc]: https://github.com/testing-library/user-event/blob/main/other/CODE_OF_CONDUCT.md [emojis]: https://github.com/all-contributors/all-contributors#emoji-key [all-contributors]: https://github.com/all-contributors/all-contributors [all-contributors-badge]: https://img.shields.io/github/all-contributors/testing-library/user-event?color=orange&style=flat-square diff --git a/other/MAINTAINING.md b/other/MAINTAINING.md index 87d1f70b..a2f1a478 100644 --- a/other/MAINTAINING.md +++ b/other/MAINTAINING.md @@ -61,7 +61,7 @@ to release. See the next section on Releases for more about that. ## Release -Our releases are automatic. They happen whenever code lands into `master`. A +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 diff --git a/src/keyboard/getNextKeyDef.ts b/src/keyboard/getNextKeyDef.ts index 358dee63..a7003894 100644 --- a/src/keyboard/getNextKeyDef.ts +++ b/src/keyboard/getNextKeyDef.ts @@ -142,6 +142,6 @@ function getErrorMessage( text: string, ) { return `Expected ${expected} but found "${found ?? ''}" in "${text}" - See https://github.com/testing-library/user-event/blob/master/README.md#keyboardtext-options + See https://github.com/testing-library/user-event/blob/main/README.md#keyboardtext-options for more information about how userEvent parses your input.` }