From cced7a49ef00f665cca2324ef2240c23d8ef362d Mon Sep 17 00:00:00 2001 From: Benny Powers Date: Tue, 9 May 2023 17:27:02 +0300 Subject: [PATCH] chore: remove husky and patch-package (#983) Co-authored-by: Michael Potter --- .changeset/remove-husky-lintstaged.md | 5 +++++ .husky/post-checkout | 19 ------------------- .husky/pre-commit | 5 ----- package.json | 24 +++++++----------------- 4 files changed, 12 insertions(+), 41 deletions(-) create mode 100644 .changeset/remove-husky-lintstaged.md delete mode 100755 .husky/post-checkout delete mode 100755 .husky/pre-commit diff --git a/.changeset/remove-husky-lintstaged.md b/.changeset/remove-husky-lintstaged.md new file mode 100644 index 0000000000..b042545e3f --- /dev/null +++ b/.changeset/remove-husky-lintstaged.md @@ -0,0 +1,5 @@ +--- +"@rhds/elements": patch +--- + +chore: prevent "command not found" error which could occur when installing the npm package in certain situations diff --git a/.husky/post-checkout b/.husky/post-checkout deleted file mode 100755 index c1a0218919..0000000000 --- a/.husky/post-checkout +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# Don't do it in CI -# Branch checkout, not file checkout -# Not a clone operation -# Old ref and new ref are different (i.e. actually switched branches) -if [ -z "$CI" ] \ - && [ -n "$1" ] \ - && [ "$3" = "1" ] \ - && [ "$1" != "$3" ]; \ -then - NO_FORMAT="\033[0m" - C_YELLOW="\033[38;5;11m" - C_AQUA="\033[38;5;14m" - C_RED="\033[38;5;9m" - REF_NAME=$(git name-rev --name-only --always "$2") - echo -e "\n${C_YELLOW}NOTICE${NO_FORMAT}: Checked out ${C_AQUA}$REF_NAME${NO_FORMAT}. ${C_RED}DELETING${NO_FORMAT} wireit cache." - rm -rf .wireit -fi - diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index 0100309bc4..0000000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - -npx lint-staged -sh scripts/scan-links.sh diff --git a/package.json b/package.json index 3fb164656f..3651d693aa 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,8 @@ "new": "npm init @patternfly/element", "๐Ÿšง-BUILD": "โ“ Make packages and artifacts", "build": "wireit", + "docs": "wireit", + "site": "npm run docs", "๐Ÿงช-TEST": "โ“ Test packages", "test": "wtr --group default", "test:ci": "wtr", @@ -53,18 +55,11 @@ "e2e:update": "playwright test --update-snapshots", "proxy": "npx spandx -c spandx.config.cjs", "๐Ÿšš-DIST": "โ“ Publish packages", - "docs": "wireit", - "site": "npm run docs", - "prepublishOnly": "npm run build", + "prepublishOnly": "wireit", "โš™๏ธ--UTIL": "โ“ Manages the repo", - "clean": "git clean -fX -e node_modules", + "clean": "git clean -dfX -e node_modules", "clean:nuke": "git clean -fX", - "lint": "wireit", - "postinstall": "wireit", - "patch": "patch-package", - "husky": "husky install", - "prepack": "npx pinst --disable", - "postpack": "npx pinst --enable" + "lint": "wireit" }, "wireit": { "start": { @@ -167,16 +162,12 @@ "build" ] }, - "postinstall": { + "prepublishOnly": { "dependencies": [ - "patch", - "husky" + "build" ] } }, - "lint-staged": { - "*.{js,ts}": "eslint --fix" - }, "dependencies": { "@patternfly/elements": "^2.1.0", "@rhds/tokens": "^1.0.0", @@ -204,7 +195,6 @@ "esbuild": "^0.17.18", "git-branch": "^2.0.1", "glob": "^9.3.1", - "husky": "^8.0.3", "leasot": "^13.3.0", "linkedom": "^0.14.25", "markdown-it-anchor": "^8.6.7",