Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/capricorn86/happy-dom int…
Browse files Browse the repository at this point in the history
…o task/1186-support-touch-event
  • Loading branch information
capricorn86 committed Jan 29, 2024
2 parents c040d0d + b6ce566 commit 82e6736
Show file tree
Hide file tree
Showing 341 changed files with 27,713 additions and 15,692 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**/node_modules
**/tmp
**/lib
**/cjs
**/tmp
19 changes: 9 additions & 10 deletions packages/happy-dom/.eslintrc.cjs → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const ERROR = 'error';
const OFF = 'off';

const COMMON_CONFIG = {
plugins: ['turbo', 'jsdoc', 'filenames', 'import', 'prettier'],
extends: ['plugin:@typescript-eslint/recommended', 'prettier', 'plugin:prettier/recommended'],
plugins: ['jsdoc', 'filenames', 'import', 'prettier'],
extends: ['prettier', 'plugin:prettier/recommended'],
rules: {
'prettier/prettier': WARN,
'no-underscore-dangle': OFF,
Expand All @@ -25,7 +25,7 @@ const COMMON_CONFIG = {
'one-var': [ERROR, 'never'],
camelcase: [WARN, { properties: 'always', ignoreImports: true }],
'spaced-comment': [WARN, 'always'],
'capitalized-comments': [WARN, 'always', { ignorePattern: 'prettier' }],
'capitalized-comments': OFF,
'no-useless-rename': WARN,
'jsdoc/check-alignment': WARN,
'jsdoc/check-examples': OFF,
Expand All @@ -35,7 +35,7 @@ const COMMON_CONFIG = {
'jsdoc/check-types': WARN,
'jsdoc/implements-on-classes': WARN,
'jsdoc/match-description': OFF,
'jsdoc/newline-after-description': WARN,
'jsdoc/newline-after-description': OFF,
'jsdoc/no-types': OFF,
'jsdoc/no-undefined-types': OFF,
'jsdoc/require-description': OFF,
Expand Down Expand Up @@ -68,9 +68,6 @@ const COMMON_CONFIG = {
const TS_PARSER_FIELDS = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: 2020,
sourceType: 'module'
}
Expand All @@ -79,12 +76,14 @@ const TS_PARSER_FIELDS = {
module.exports = {
env: {
es6: true,
browser: true,
node: true
},
parserOptions: {
ecmaVersion: 2020
},
overrides: [
{
files: ['*.js', '*.jsx', '*.mjs'],
files: ['*.js', '*.jsx', '*.mjs', '*.cjs'],
...TS_PARSER_FIELDS,
plugins: COMMON_CONFIG.plugins,
extends: COMMON_CONFIG.extends,
Expand Down Expand Up @@ -124,7 +123,7 @@ module.exports = {
WARN,
{ assertionStyle: 'angle-bracket' }
],
'@typescript-eslint/no-explicit-any': ERROR,
'@typescript-eslint/no-explicit-any': OFF,
'@typescript-eslint/no-empty-function': OFF,
'@typescript-eslint/no-use-before-define': OFF,
'@typescript-eslint/no-this-alias': OFF,
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/auto-assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Auto Assign
on:
pull_request:
types:
- opened
jobs:
auto-assign:
runs-on: ubuntu-latest
steps:
- name: Set build URL to commit status
run: |
curl \
--request POST \
--url https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.number }} \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data "{
\"assignees\": [\"${{ github.actor }}\"]
}"
22 changes: 14 additions & 8 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on: pull_request
jobs:
build:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
node-version: [16, 18, 20]
Expand All @@ -17,6 +16,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Cache node modules
uses: actions/cache@v3
Expand Down Expand Up @@ -45,12 +45,18 @@ jobs:
path: .turbo
key: turbo-master

- name: Install Dependencies
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: |
npm ci
run: npm ci --ignore-scripts

- name: Validate commit messages
run: node ./node_modules/.bin/happy-validate-pr-commit-messages

- run: node ./bin/validate-commit-messages.js
- run: npm run compile
- run: npm run lint
- run: npm run test
- name: Compile package
run: npm run compile

- name: Lint
run: npm run lint

- name: Test
run: npm run test
34 changes: 16 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
node-version: [16]
node-version: [20]

outputs:
next_version: ${{ steps.versionCheck.outputs.next_version }}
Expand All @@ -36,24 +36,23 @@ jobs:
./packages/*/node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-build-${{ env.cache-name }}-${{ hashFiles('./packages/*/package-lock.json') }}-${{ hashFiles('./package-lock.json') }}

- name: Install Dependencies
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: |
npm ci --ignore-scripts
run: npm ci --ignore-scripts

- id: versionCheck
run: |
echo "next_version=$(node ./bin/print-next-version.js)" >> $GITHUB_OUTPUT
echo "current_version=$(node ./bin/print-latest-version.js)" >> $GITHUB_OUTPUT
echo "next_version=$(node ./node_modules/.bin/happy-next-version)" >> $GITHUB_OUTPUT
echo "current_version=$(node ./node_modules/.bin/happy-current-version)" >> $GITHUB_OUTPUT
publish:
runs-on: ubuntu-latest
needs: [check-next-version]
if: ${{ needs.check-next-version.outputs.next_version != needs.check-next-version.outputs.current_version }}
if: ${{ needs.check-next-version.outputs.next_version != '' }}

strategy:
matrix:
node-version: [16]
node-version: [20]

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -84,13 +83,12 @@ jobs:
restore-keys: |
turbo-master
- name: Install Dependencies
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: |
npm ci --ignore-scripts
run: npm ci --ignore-scripts

- name: Set version
run: node ./bin/set-version.js --version=${{needs.check-next-version.outputs.next_version }}
run: node ./node_modules/.bin/happy-set-workspace-version --version=${{needs.check-next-version.outputs.next_version }}

- name: Compile packages
run: npm run compile
Expand Down Expand Up @@ -127,7 +125,7 @@ jobs:

strategy:
matrix:
node-version: [16]
node-version: [20]

steps:
- uses: actions/checkout@v3
Expand All @@ -150,14 +148,14 @@ jobs:
./packages/*/node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-build-${{ env.cache-name }}-${{ hashFiles('./packages/*/package-lock.json') }}-${{ hashFiles('./package-lock.json') }}

- name: Install Dependencies
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: |
npm ci --ignore-scripts
run: npm ci --ignore-scripts

- run: node ./bin/generate-release-notes.js --latest-version=${{needs.check-next-version.outputs.current_version}} --next-version=${{needs.check-next-version.outputs.next_version}}
- name: Generate release notes
run: node ./node_modules/.bin/happy-release-notes --author=githubUsername > ./RELEASE_NOTES.md

- name: Create Release
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
Expand Down
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

node ./node_modules/.bin/happy-validate-commit-message --commitFile=$1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

node ./node_modules/.bin/happy-lint-changed
4 changes: 4 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

node ./node_modules/.bin/happy-prepare-commit-message --commitFile=$1 --commitType=$2
6 changes: 0 additions & 6 deletions .huskyrc.json

This file was deleted.

1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
README.md
6 changes: 6 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
singleQuote: true,
useTabs: true,
printWidth: 100,
trailingComma: 'none'
};
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@ This package makes it possible to use Happy DOM with [Jest](https://jestjs.io/).

A utility that registers Happy DOM globally, which makes it possible to use Happy DOM for testing in a Node environment.

---

### [![Published on npm](https://img.shields.io/npm/v/@happy-dom/uncaught-exception-observer.svg)](https://www.npmjs.com/package/@happy-dom/uncaught-exception-observer) [uncaught-exception-observer](https://github.com/capricorn86/happy-dom/tree/master/packages/uncaught-exception-observer)

A utility for observing uncaught exceptions thrown in Happy DOM and dispatch them as events on the Happy DOM window.

# Performance

| Operation | JSDOM | Happy DOM |
Expand All @@ -91,6 +85,10 @@ See how the test was done [here](https://github.com/capricorn86/happy-dom-perfor

See [Contributing Guide](https://github.com/capricorn86/happy-dom/blob/master/docs/contributing.md).

# Sister Projects

[<img alt="Happy Conventional Commit" width="120px" src="https://raw.githubusercontent.com/capricorn86/happy-conventional-commit/main/docs/logo_thumbnail.jpg" />](https://github.com/capricorn86/happy-conventional-commit)

# Sponsors

[<img alt="RTVision" width="120px" src="https://avatars.githubusercontent.com/u/8292810?s=200&v=4" />](https://rtvision.com)
59 changes: 0 additions & 59 deletions bin/generate-release-notes.js

This file was deleted.

41 changes: 0 additions & 41 deletions bin/husky-commit-message.js

This file was deleted.

Loading

0 comments on commit 82e6736

Please sign in to comment.