diff --git a/.all-contributorsrc b/.all-contributorsrc index 6950e596..a621a1e6 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -4,7 +4,7 @@ "repoType": "github", "repoHost": "https://github.com", "files": [ - "README.md" + "CONTRIBUTORS.md" ], "imageSize": 100, "commit": true, @@ -50,7 +50,8 @@ "avatar_url": "https://avatars3.githubusercontent.com/u/6643991?v=4", "profile": "https://michaeldeboey.be", "contributions": [ - "doc" + "doc", + "ideas" ] }, { @@ -423,7 +424,9 @@ "question", "code", "test", - "doc" + "doc", + "infra", + "ideas" ] }, { @@ -432,7 +435,8 @@ "avatar_url": "https://avatars1.githubusercontent.com/u/28659384?v=4", "profile": "http://timdeschryver.dev", "contributions": [ - "test" + "test", + "doc" ] }, { @@ -568,7 +572,11 @@ "profile": "https://github.com/ph-fritsche", "contributions": [ "code", - "test" + "test", + "bug", + "ideas", + "infra", + "maintenance" ] }, { @@ -957,6 +965,239 @@ "contributions": [ "code" ] + }, + { + "login": "patricklizon", + "name": "Patrick LizoΕ", + "avatar_url": "https://avatars.githubusercontent.com/u/12571855?v=4", + "profile": "https://github.com/patricklizon", + "contributions": [ + "code" + ] + }, + { + "login": "malipramod", + "name": "Pramod Mali", + "avatar_url": "https://avatars.githubusercontent.com/u/13375870?v=4", + "profile": "https://pramodmali.tech/", + "contributions": [ + "ideas" + ] + }, + { + "login": "wolfe111", + "name": "wolfe111", + "avatar_url": "https://avatars.githubusercontent.com/u/15180314?v=4", + "profile": "https://github.com/wolfe111", + "contributions": [ + "bug" + ] + }, + { + "login": "tyler2grass", + "name": "Tyler Grass", + "avatar_url": "https://avatars.githubusercontent.com/u/88393125?v=4", + "profile": "https://github.com/tyler2grass", + "contributions": [ + "bug" + ] + }, + { + "login": "micscopau", + "name": "Michael Pauly", + "avatar_url": "https://avatars.githubusercontent.com/u/7364791?v=4", + "profile": "https://www.linkedin.com/in/michael-s-pauly/", + "contributions": [ + "bug" + ] + }, + { + "login": "rbrady-hs", + "name": "rbrady-hs", + "avatar_url": "https://avatars.githubusercontent.com/u/83345629?v=4", + "profile": "https://github.com/rbrady-hs", + "contributions": [ + "ideas" + ] + }, + { + "login": "Dm1Korneev", + "name": "Dmitriy Πorneev", + "avatar_url": "https://avatars.githubusercontent.com/u/7955306?v=4", + "profile": "https://github.com/Dm1Korneev", + "contributions": [ + "bug" + ] + }, + { + "login": "kumachan-mis", + "name": "Kumachan", + "avatar_url": "https://avatars.githubusercontent.com/u/29433058?v=4", + "profile": "https://github.com/kumachan-mis", + "contributions": [ + "bug" + ] + }, + { + "login": "themadtitanmathos", + "name": "Matthew Lloyd Williamson", + "avatar_url": "https://avatars.githubusercontent.com/u/54560914?v=4", + "profile": "https://github.com/themadtitanmathos", + "contributions": [ + "ideas" + ] + }, + { + "login": "bamthomas", + "name": "Bruno Thomas", + "avatar_url": "https://avatars.githubusercontent.com/u/551723?v=4", + "profile": "https://github.com/bamthomas", + "contributions": [ + "bug" + ] + }, + { + "login": "antfu", + "name": "Anthony Fu", + "avatar_url": "https://avatars.githubusercontent.com/u/11247099?v=4", + "profile": "https://antfu.me/", + "contributions": [ + "bug" + ] + }, + { + "login": "mohetti", + "name": "momokolo", + "avatar_url": "https://avatars.githubusercontent.com/u/73931283?v=4", + "profile": "https://github.com/mohetti", + "contributions": [ + "bug" + ] + }, + { + "login": "dannyharding10", + "name": "Danny", + "avatar_url": "https://avatars.githubusercontent.com/u/11875246?v=4", + "profile": "https://github.com/dannyharding10", + "contributions": [ + "bug" + ] + }, + { + "login": "lucaslcode", + "name": "Lucas Levin", + "avatar_url": "https://avatars.githubusercontent.com/u/32044095?v=4", + "profile": "https://lucas-levin.com/", + "contributions": [ + "bug" + ] + }, + { + "login": "MatanBobi", + "name": "Matan Borenkraout", + "avatar_url": "https://avatars.githubusercontent.com/u/12711091?v=4", + "profile": "https://matan.io/", + "contributions": [ + "doc" + ] + }, + { + "login": "kentcdodds", + "name": "Kent C. Dodds", + "avatar_url": "https://avatars.githubusercontent.com/u/1500684?v=4", + "profile": "https://kentcdodds.com/", + "contributions": [ + "code", + "infra", + "maintenance", + "review", + "test" + ] + }, + { + "login": "Dennis273", + "name": "Dennis273", + "avatar_url": "https://avatars.githubusercontent.com/u/19815164?v=4", + "profile": "https://github.com/Dennis273", + "contributions": [ + "bug", + "code", + "test" + ] + }, + { + "login": "piecyk", + "name": "Damian Pieczynski", + "avatar_url": "https://avatars.githubusercontent.com/u/82964?v=4", + "profile": "https://twitter.com/piecu", + "contributions": [ + "bug" + ] + }, + { + "login": "Gudahtt", + "name": "Mark Stacey", + "avatar_url": "https://avatars.githubusercontent.com/u/2459287?v=4", + "profile": "https://github.com/Gudahtt", + "contributions": [ + "bug", + "code" + ] + }, + { + "login": "lifeiscontent", + "name": "Aaron Reisman", + "avatar_url": "https://avatars.githubusercontent.com/u/180963?v=4", + "profile": "https://lifeiscontent.net/", + "contributions": [ + "ideas" + ] + }, + { + "login": "markwoon", + "name": "Mark Woon", + "avatar_url": "https://avatars.githubusercontent.com/u/215141?v=4", + "profile": "https://github.com/markwoon", + "contributions": [ + "bug" + ] + }, + { + "login": "joshunger", + "name": "Josh Unger", + "avatar_url": "https://avatars.githubusercontent.com/u/2301847?v=4", + "profile": "https://github.com/joshunger", + "contributions": [ + "bug" + ] + }, + { + "login": "robcaldecott", + "name": "Rob Caldecott", + "avatar_url": "https://avatars.githubusercontent.com/u/796702?v=4", + "profile": "https://github.com/robcaldecott", + "contributions": [ + "bug", + "code" + ] + }, + { + "login": "tbertrand7", + "name": "Tom Bertrand", + "avatar_url": "https://avatars.githubusercontent.com/u/14081248?v=4", + "profile": "https://github.com/tbertrand7", + "contributions": [ + "bug" + ] + }, + { + "login": "wKovacs64", + "name": "Justin Hall", + "avatar_url": "https://avatars.githubusercontent.com/u/1288694?v=4", + "profile": "https://justinrhall.dev", + "contributions": [ + "bug" + ] } ], "commitConvention": "none", diff --git a/.codesandbox/ci.json b/.codesandbox/ci.json index f0384a94..f7903d87 100644 --- a/.codesandbox/ci.json +++ b/.codesandbox/ci.json @@ -1,4 +1,4 @@ { "node": "14", - "sandboxes": ["vbcvs"] + "sandboxes": ["djcc7b", "vbcvs"] } diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..ae409af0 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +/coverage +/dist +/node_modules diff --git a/.eslintrc.js b/.eslintrc.js index b9e85808..ff712056 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,14 +1,18 @@ module.exports = { extends: './node_modules/kcd-scripts/eslint.js', + parserOptions: { + project: ['./tsconfig.json', './tests/tsconfig.json'], + }, settings: { 'import/resolver': { - node: { - extensions: ['.js', '.ts'], - }, + typescript: {}, }, }, rules: { + 'no-await-in-loop': 0, 'testing-library/no-dom-import': 0, '@typescript-eslint/non-nullable-type-assertion-style': 0, + // ES2022 will be released in June 2022 + 'prefer-object-has-own': 0, }, } diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index eaa68de9..00000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,54 +0,0 @@ - - -- `@testing-library/user-event` version: - - -- Testing Framework and version: - -- DOM Environment: - - - - -Relevant code or config - -```javascript - -``` - -What you did: - -What happened: - - - -Reproduction repository: - - - -Problem description: - -Suggested solution: diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000..30e1f510 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,105 @@ +name: π Bug report +description: Create a report to help us improve +labels: + - needs assessment + - bug +body: + - type: markdown + attributes: + value: > + Thanks for taking the time to fill out this form. β€ + + Bug reports are an important contribution to the library! + + + A clear and concise description of the bug helps to identify problems in + the implementation and validate proposed solutions. + - type: input + attributes: + label: Reproduction example + description: | + Please set up an online code example at https://codesandbox.io. + + You can use one of the following templates as a starting point: + Native DOM: https://codesandbox.io/s/djcc7b?file=/src/App.js + React: https://codesandbox.io/s/vbcvs?file=/src/App.js + validations: + required: true + - type: textarea + attributes: + label: Prerequisites + description: | + The minimal requirements to reproduce the described behavior. + placeholder: | + 1. Render `` element. + 2. Select the `b` per mouse. + 3. Press `x` on the keyboard. + validations: + required: true + - type: textarea + attributes: + label: Expected behavior + description: | + A clear and concise description of what you expected to happen. + + Try to include a test asserting this behavior in the codesandbox example above. + + If the expected behavior is described e.g. at MDN, please include a link as reference. + placeholder: | + Input element value changes to `axc` and the cursor is at position 2. + validations: + required: true + - type: textarea + attributes: + label: Actual behavior + description: | + A clear and concise description of what did happen. + placeholder: | + Input element value changes to `Well, that was unexpected.`. + validations: + required: true + - type: input + attributes: + label: User-event version + description: | + Please make sure that you are using at least the latest stable version. + See https://github.com/testing-library/user-event/releases?q=prerelease%3Afalse + placeholder: 14.0.0 + validations: + required: true + - type: textarea + attributes: + label: Environment + description: > + If the bug is not reproducible per Codesandbox, please include at least + the following information about the environment. + + If any other third-party libraries are necessary for reproducing the + bug, please consider filing an issue with that library and/or open a + [Discussion](https://github.com/testing-library/user-event/discussions/new?category=q-a). + value: | + Testing Library framework: + + + JS framework: + + Test environment: + + + DOM implementation: + + - type: textarea + attributes: + label: Additional context + description: | + Any additional information on the topic you'd like to include. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..923f0fe2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: π Discussions + url: https://github.com/testing-library/user-event/discussions/new?category=q-a + about: Please ask and answer questions in the Discussions. + - name: π¬ Discord + url: https://discord.gg/testing-library + about: Join our community at Discord. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 00000000..66f56993 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,50 @@ +name: π€ Feature request +description: Suggest an idea for this project +labels: + - needs assessment + - enhancement +body: + - type: markdown + attributes: + value: > + Thanks for taking the time to fill out this form. β€ + + A clear and concise description is a huge part of making a new feature + happen. + - type: textarea + attributes: + label: Problem description + description: | + The problem you are trying to solve. + What is it you are trying to achieve? + + Detail the minimal requirements to reproduce the problem. + + If you want to test e.g. certain features of your software, include a minimal component that implements the feature. + + Please set up an online code example at https://codesandbox.io. + + You can use one of the following templates as a starting point: + Native DOM: https://codesandbox.io/s/djcc7b?file=/src/App.js + React: https://codesandbox.io/s/vbcvs?file=/src/App.js + + If the problem is specific to some environment and/or is not reproducible per Codesandbox, + please provide the information necessary to reproduce it. + validations: + required: true + - type: textarea + attributes: + label: Suggested solution + description: | + Please describe what you want to happen. + + If you happen to have an idea of how this could be implemented, please include this information here. + + If aspects of the missing feature are described e.g. at MDN, please include links as reference. + validations: + required: true + - type: textarea + attributes: + label: Additional context + description: | + Any additional information on the topic. diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index b0c16d04..95f15dd2 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -5,7 +5,6 @@ on: [ '+([0-9])?(.{+([0-9]),x}).x', 'main', - 'master', 'next', 'next-major', 'beta', @@ -33,6 +32,7 @@ jobs: uses: bahmutov/npm-install@v1 with: useLockFile: false + install-command: yarn --silent env: HUSKY_SKIP_INSTALL: true @@ -47,8 +47,8 @@ jobs: runs-on: ubuntu-latest if: ${{ github.repository == 'testing-library/user-event' && - contains('refs/heads/main,refs/heads/master,refs/heads/beta,refs/heads/next,refs/heads/alpha', - github.ref) && github.event_name == 'push' }} + contains('refs/heads/main,refs/heads/beta,refs/heads/alpha', github.ref) + && github.event_name == 'push' }} steps: - name: β¬οΈ Checkout repo uses: actions/checkout@v2 @@ -62,6 +62,7 @@ jobs: uses: bahmutov/npm-install@v1 with: useLockFile: false + install-command: yarn --silent env: HUSKY_SKIP_INSTALL: true @@ -69,19 +70,7 @@ jobs: run: npm run build - name: π Release - uses: cycjimmy/semantic-release-action@v2 - with: - semantic_version: 17 - branches: | - [ - '+([0-9])?(.{+([0-9]),x}).x', - 'main', - 'master', - 'next', - 'next-major', - {name: 'beta', prerelease: true}, - {name: 'alpha', prerelease: true} - ] + uses: ph-fritsche/action-release@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md new file mode 100644 index 00000000..2411fb2a --- /dev/null +++ b/CONTRIBUTORS.md @@ -0,0 +1,179 @@ +## Contributors + +Thanks goes to these wonderful people ([emoji key][emojis]): + + + + +