Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
fix(workspace): Update husky configuration for husky5.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomheller committed Mar 26, 2021
1 parent 29d435a commit a0599ab
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
. "$(dirname "$0")/_/husky.sh"

npm run commit-msg
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
. "$(dirname "$0")/_/husky.sh"

npm run pre-commit
11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
"bazel": "bazelisk",
"bazel:test": "bazelisk query \"attr(generator_function, jest, //...)\" | xargs bazelisk test",
"bazel:stylelint": "node tools/scripts/stylelint.js",
"workspace-generator": "nx workspace-generator"
"workspace-generator": "nx workspace-generator",
"prepare-husky": "husky install",
"pre-commit": "nx format:write && git update-index --again",
"commit-msg": "npx commitlint --edit"
},
"author": "Dynatrace",
"license": "SEE LICENSE IN LICENSE",
Expand All @@ -56,12 +59,6 @@
"engines": {
"node": ">=12.10"
},
"husky": {
"hooks": {
"pre-commit": "nx format:write && git update-index --again",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"dependencies": {
"@angular/animations": "^11.2.4",
"@angular/cdk": "^11.0.3",
Expand Down
3 changes: 3 additions & 0 deletions postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ const NGCC_BINARY = resolve(
const NGC_BINARY = resolve('./node_modules/@angular/compiler-cli/src/main.js');

async function main() {
// Apply the husky configuration
await execCommand(`npm run prepare-husky`);

// Applying all the patches to the packages
await execCommand(`node ${require.resolve('patch-package')}`);
// when running with bazel we need to perform a ngcc to compile
Expand Down

0 comments on commit a0599ab

Please sign in to comment.