@ministryofjustice/hmpps-precommit-hooks 0.0.1-alpha.4 → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Change log
2
2
 
3
+ ## 0.0.1
4
+
5
+ Initial release
6
+
3
7
 
4
8
  ## 0.0.1-alpha.1
5
9
 
package/README.md CHANGED
@@ -4,7 +4,8 @@ This package aims to automatically install and configure husky with gitleaks to
4
4
 
5
5
  ## Status
6
6
 
7
- This library is in alpha. Teams are free to use this library but further breaking changes may occur.
7
+ **This library is currently: ready to adopt.**
8
+ Teams are welcome to use this library. Please provide feedback via slack to the `#typescript` channel.
8
9
 
9
10
  ## Migrating existing projects
10
11
 
package/bin/init.sh CHANGED
@@ -6,11 +6,11 @@
6
6
  set -euo pipefail
7
7
 
8
8
  startStage() {
9
- printf "\x1b[1;97m%s\x1b[0m" "$1"
9
+ printf "%s" "$1"
10
10
  }
11
11
 
12
12
  endStage() {
13
- printf "\x1b[1;97m%s\x1b[0m\n" "$1"
13
+ printf "%s\n" "$1"
14
14
  }
15
15
 
16
16
  printError() {
@@ -18,7 +18,6 @@ printError() {
18
18
  }
19
19
 
20
20
  endStage "Setting up precommit hooks"
21
- endStage "Checking prerequisites..."
22
21
 
23
22
  if ! [ -f ./package.json ]; then
24
23
  printError "Not a node project: $(pwd)! exiting!"
@@ -45,8 +44,6 @@ else
45
44
  npm --silent install
46
45
  fi
47
46
 
48
- endStage "Installing precommit hooks..."
49
-
50
47
  startStage " * Adding npm scripts"
51
48
  npm pkg --silent set scripts.precommit:secrets="gitleaks git --pre-commit --redact --staged --verbose --config .gitleaks/config.toml"
52
49
  npm pkg --silent set scripts.precommit:lint="node_modules/.bin/lint-staged"
package/bin/prepare.sh CHANGED
@@ -6,11 +6,11 @@
6
6
  set -eo pipefail
7
7
 
8
8
  startStage() {
9
- printf "\x1b[1;97m%s\x1b[0m" "$1"
9
+ printf "%s" "$1"
10
10
  }
11
11
 
12
12
  endStage() {
13
- printf "\x1b[1;97m%s\x1b[0m\n" "$1"
13
+ printf "%s\n" "$1"
14
14
  }
15
15
 
16
16
  printError() {
@@ -27,7 +27,7 @@ node_modules/.bin/husky
27
27
 
28
28
  # Check brew exists
29
29
  if ! command -v brew &> /dev/null; then
30
- printError "Brew is not installed, WARNING: no precommit hook protection. exiting..."
30
+ printError "Brew is not installed. You will need to install gitleaks separately and ensure it's on your PATH. exiting..."
31
31
  exit 0
32
32
  fi
33
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ministryofjustice/hmpps-precommit-hooks",
3
- "version": "0.0.1-alpha.4",
3
+ "version": "0.0.1",
4
4
  "description": "Precommit hooks for HMPPS typescript projects",
5
5
  "keywords": [
6
6
  "precommit"
@@ -17,6 +17,9 @@
17
17
  "hmpps-precommit-hooks-prepare": "./bin/prepare.sh",
18
18
  "test-secret-protection": "./bin/test.sh"
19
19
  },
20
+ "scripts": {
21
+ "check-for-updates": "npx npm-check-updates -u"
22
+ },
20
23
  "files": [
21
24
  "*.md",
22
25
  "bin/*.sh",