Skip to content

Commit

Permalink
fix(storm-ops): Added back husky hooks and removed config from packag…
Browse files Browse the repository at this point in the history
…e.json
  • Loading branch information
sullivanpj committed Nov 4, 2023
1 parent 16fdc67 commit f1b0b85
Show file tree
Hide file tree
Showing 15 changed files with 170 additions and 66 deletions.
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
CI=true
TYPESENSE_API_KEY="xyz"
NODE_OPTIONS="--trace-warnings --heapsnapshot-near-heap-limit=3 --heapsnapshot-signal=SIGTERM"

Expand Down
4 changes: 4 additions & 0 deletions .husky/post-checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

echo $HUSKY_GIT_STDIN | ./packages/git-tools/hooks/post-checkout $HUSKY_GIT_PARAMS
5 changes: 5 additions & 0 deletions .husky/post-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

echo $HUSKY_GIT_STDIN | ./packages/git-tools/hooks/post-commit $HUSKY_GIT_PARAMS

4 changes: 4 additions & 0 deletions .husky/post-merge
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

echo $HUSKY_GIT_STDIN | ./packages/git-tools/hooks/post-merge $HUSKY_GIT_PARAMS
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

echo $HUSKY_GIT_STDIN | packages/git-tools/hooks/pre-commit $HUSKY_GIT_PARAMS
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

echo $HUSKY_GIT_STDIN | ./packages/git-tools/hooks/pre-push $HUSKY_GIT_PARAMS
12 changes: 1 addition & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"e2e": "nx e2e",
"format": "nx format:write",
"help": "nx help",
"preinstall": "pnpm dist/packages/workspace-tools/scripts/pre-install.js || npx -y only-allow pnpm",
"preinstall": "pnpm dist/packages/git-tools/scripts/pre-install.js || npx -y only-allow pnpm",
"install:csb": "corepack enable && pnpm install --frozen-lockfile",
"lint": "pnpm dist/packages/linting-tools/bin/cli.js all --skip-cspell --alex-config=\"dist/packages/linting-tools/alex/.alexrc\" --alex-config=\"dist/packages/linting-tools/alex/.alexignore\"",
"local-registry": "nx local-registry @storm-software/storm-ops",
Expand Down Expand Up @@ -95,7 +95,6 @@
"eslint": "8.53.0",
"eslint-config-prettier": "9.0.0",
"husky": "8.0.3",
"is-ci": "3.0.1",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"jest-environment-node": "29.7.0",
Expand All @@ -119,15 +118,6 @@
"format"
]
},
"husky": {
"hooks": {
"post-checkout": "echo $HUSKY_GIT_STDIN | packages/git-tools/hooks/post-checkout $HUSKY_GIT_PARAMS",
"post-commit": "echo $HUSKY_GIT_STDIN | packages/git-tools/hooks/post-commit $HUSKY_GIT_PARAMS",
"post-merge": "echo $HUSKY_GIT_STDIN | packages/git-tools/hooks/post-merge $HUSKY_GIT_PARAMS",
"pre-commit": "echo $HUSKY_GIT_STDIN | packages/git-tools/hooks/pre-commit $HUSKY_GIT_PARAMS",
"pre-push": "echo $HUSKY_GIT_STDIN | packages/git-tools/hooks/pre-push $HUSKY_GIT_PARAMS"
}
},
"pnpm": {
"overrides": {
"create-storm-workspace": "workspace:*",
Expand Down
1 change: 0 additions & 1 deletion packages/git-tools/hooks/post-checkout
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

changedFiles="$(git diff-tree -r --name-only --no-commit-id $1 $2)"
node ./packages/git-tools/scripts/package-version-warning.js $changedFiles
Expand Down
1 change: 0 additions & 1 deletion packages/git-tools/hooks/post-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-commit.\n"; exit 2; }
git lfs post-commit "$@"
Expand Down
2 changes: 0 additions & 2 deletions packages/git-tools/hooks/post-merge
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"


changedFiles="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
node ./packages/git-tools/scripts/package-version-warning.js $changedFiles
Expand Down
1 change: 0 additions & 1 deletion packages/git-tools/hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm lint-staged --concurrent false --config="./lint-staged.config.js"
1 change: 0 additions & 1 deletion packages/git-tools/hooks/pre-push
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

node ./packages/git-tools/scripts/check-lock-file.js

Expand Down
4 changes: 4 additions & 0 deletions packages/git-tools/scripts/prepare.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const isCi = process.env.CI !== undefined;
if (!isCi) {
require("husky").install();
}
2 changes: 1 addition & 1 deletion packages/workspace-tools/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"allowJs": true,
"types": ["node"]
},
"include": ["src/**/*.ts", "scripts/**/*.js"],
"include": ["src/**/*.ts", "../git-tools/scripts/**/*.js"],
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
}
Loading

0 comments on commit f1b0b85

Please sign in to comment.