diff --git a/template/package.json b/template/package.json index 9a64c38d..4a4102a2 100644 --- a/template/package.json +++ b/template/package.json @@ -96,12 +96,6 @@ "nodemonConfig": { "ignore": ["*-css.js", "*.css"] }, - "husky": { - "hooks": { - "pre-commit": "npm-run-all preCommit test linters bundler postinstall", - "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" - } - }, "release": { "branches": [ "main" @@ -165,7 +159,7 @@ "dist:js": "copyfiles -u 1 -V './src/**/*.js' ./dist", "esLint": "./node_modules/.bin/eslint src/[namespace]-*.js", "linters": "npm-run-all scssLint esLint", - "preCommit":"sh scripts/pre-commit.sh", + "preCommit": "node scripts/pre-commit.js", "postCss:component": "node ./scripts/postCss.js", "postinstall": "node packageScripts/postinstall.js", "sass:render": "sass-render src/*.css -t ./scripts/staticStyles-template.js", diff --git a/template/scripts/pre-commit.js b/template/scripts/pre-commit.js new file mode 100644 index 00000000..cbd42cc0 --- /dev/null +++ b/template/scripts/pre-commit.js @@ -0,0 +1,17 @@ +'use strict'; + +const chalk = require('chalk'); +console.log(chalk.hex('#ffd200')(` + +╭ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ──────────────────────────────╮`) + chalk.hex('#f26135')(` + + Are you familiar with Auro's Definition of Done? + + Please be sure to review`) + chalk.hex('#ffd200')(` + https://auro.alaskaair.com/definition-of-done`) + chalk.hex('#f26135')(` + before submitting your pull request + to ensure that you are compliant.`) + chalk.hex('#ffd200')(` + +╰─────────────────────────────── ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯ +`) +); diff --git a/template/scripts/pre-commit.sh b/template/scripts/pre-commit.sh deleted file mode 100644 index 37206657..00000000 --- a/template/scripts/pre-commit.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -RED='\033[0;31m' -NC='\033[0m' # No Color - -# Read user input, assign stdin to keyboard -exec < /dev/tty - -while read -p " -You have reviewed and are familiar with Auro's Definition of Done? (Y/n) " yn; do - case $yn in - [Yy] ) break;; - [Nn] ) echo " -${RED}Please review https://auro.alaskaair.com/definition-of-done -before submitting your pull request to ensure that you are compliant.${NC}\n"; break;; - * ) break;; - esac -done - -exec <&-