From b42e9220f95a171e6d454aaa857ee617de3cf1bc Mon Sep 17 00:00:00 2001 From: Tim Deschryver <28659384+timdeschryver@users.noreply.github.com> Date: Wed, 9 Feb 2022 19:06:01 +0100 Subject: [PATCH 1/3] chore: add .node-version and remove husky --- .githooks/pre-commit | 3 +++ .github/workflows/ci.yml | 1 - .husky/_/husky.sh | 31 ------------------------------- .husky/pre-commit | 4 ---- .node-version | 1 + package.json | 3 +-- 6 files changed, 5 insertions(+), 38 deletions(-) create mode 100644 .githooks/pre-commit delete mode 100644 .husky/_/husky.sh delete mode 100644 .husky/pre-commit create mode 100644 .node-version 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..793818cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,4 +34,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/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", From 085f2e8bf60aa55f8f2ae47a648dc08435aaa2c7 Mon Sep 17 00:00:00 2001 From: Tim Deschryver <28659384+timdeschryver@users.noreply.github.com> Date: Wed, 9 Feb 2022 19:07:20 +0100 Subject: [PATCH 2/3] ci: cancel previous workflow --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 793818cd..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: From 0995099464df97b40d3e1e6047fe525f130675a7 Mon Sep 17 00:00:00 2001 From: Tim Deschryver <28659384+timdeschryver@users.noreply.github.com> Date: Wed, 9 Feb 2022 19:08:23 +0100 Subject: [PATCH 3/3] chore: remove git add on lint --- lint-staged.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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'], };