diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100644 index 00000000..f0f7d343 --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,3 @@ +#!/bin/sh + +npm run pre-commit diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 998b0652..80741a41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,10 @@ on: - 'beta' pull_request: {} +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build_test_release: strategy: @@ -34,4 +38,3 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} CI: true - HUSKY: 0 diff --git a/.husky/_/husky.sh b/.husky/_/husky.sh deleted file mode 100644 index 6809ccca..00000000 --- a/.husky/_/husky.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -if [ -z "$husky_skip_init" ]; then - debug () { - if [ "$HUSKY_DEBUG" = "1" ]; then - echo "husky (debug) - $1" - fi - } - - readonly hook_name="$(basename "$0")" - debug "starting $hook_name..." - - if [ "$HUSKY" = "0" ]; then - debug "HUSKY env variable is set to 0, skipping hook" - exit 0 - fi - - if [ -f ~/.huskyrc ]; then - debug "sourcing ~/.huskyrc" - . ~/.huskyrc - fi - - export readonly husky_skip_init=1 - sh -e "$0" "$@" - exitCode="$?" - - if [ $exitCode != 0 ]; then - echo "husky - $hook_name hook exited with code $exitCode (error)" - fi - - exit $exitCode -fi diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100644 index d0612ad3..00000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -npm run pre-commit diff --git a/.node-version b/.node-version new file mode 100644 index 00000000..b6a7d89c --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +16 diff --git a/lint-staged.config.js b/lint-staged.config.js index a10d3ccf..ebb35d3b 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1,4 +1,4 @@ module.exports = { - '*.{ts,js}': ['eslint --fix', 'git add'], - '*.{json,md}': ['prettier --write', 'git add'], + '*.{ts,js}': ['eslint --fix'], + '*.{json,md}': ['prettier --write'], }; diff --git a/package.json b/package.json index 7b514db6..977d7a88 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "format:check": "nx format:check", "pre-commit": "lint-staged", "semantic-release": "semantic-release", - "prepare": "husky install" + "prepare": "git config core.hookspath .githooks" }, "dependencies": { "@angular/animations": "13.1.1", @@ -77,7 +77,6 @@ "eslint-plugin-jest": "~25.3.4", "eslint-plugin-jest-dom": "~4.0.1", "eslint-plugin-testing-library": "~5.0.1", - "husky": "^7.0.0", "jasmine-core": "^3.10.1", "jasmine-spec-reporter": "^7.0.0", "jest": "27.4.7",