Skip to content

Commit d7178fc

Browse files
Merge pull request #5190 from OneCommunityGlobal/development
Frontend Release to Main [4.86]
2 parents 3b88381 + d377ed1 commit d7178fc

150 files changed

Lines changed: 13602 additions & 7345 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.husky/pre-commit

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ fi
1010
echo ""
1111
echo "🛡️ Husky pre-commit hook triggered"
1212

13+
if git rev-parse -q --verify MERGE_HEAD >/dev/null 2>&1; then
14+
echo "ℹ️ Merge commit detected. Skipping lint-staged auto-fix on the merged file set."
15+
exit 0
16+
fi
17+
1318
# Block plain .css files (except .module.css and index.css)
1419
for file in $(git diff --cached --name-only --diff-filter=ACM | grep '\.css$'); do
1520
case "$file" in
@@ -40,4 +45,4 @@ if git diff --cached --name-only | grep -qE '\.(js|jsx|ts|tsx|css)$'; then
4045
fi
4146
else
4247
echo "ℹ️ No JS/TS/CSS files to lint. Skipping lint-staged."
43-
fi
48+
fi

.husky/pre-push

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,51 @@
33
export NVM_DIR="$HOME/.nvm"
44
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
55
# Use Node 20 if available (or install if needed)
6-
if [ -f .nvmrc ]; then
6+
if command -v nvm >/dev/null 2>&1 && [ -f .nvmrc ]; then
77
nvm use 20 2>/dev/null || nvm install 20 && nvm use 20
88
fi
99

1010
. "$(dirname "$0")/_/husky.sh"
1111

12-
echo "🧪 Running tests before push..."
13-
npm run test -- --bail=1
14-
test_status=$?
12+
changed_files=$(git diff --name-only @{upstream}...HEAD 2>/dev/null)
1513

16-
echo "🧹 Running lint before push..."
17-
npm run lint
18-
lint_status=$?
14+
if [ -z "$changed_files" ]; then
15+
echo "ℹ️ No outgoing changes to validate. Skipping pre-push checks."
16+
exit 0
17+
fi
18+
19+
if ! printf '%s\n' "$changed_files" | grep -qvE '^\.husky/'; then
20+
echo "ℹ️ Only Husky hook changes detected. Skipping full test and lint checks."
21+
exit 0
22+
fi
23+
24+
js_files=$(printf '%s\n' "$changed_files" | grep -E '\.(js|jsx|ts|tsx)$' || true)
25+
style_files=$(printf '%s\n' "$changed_files" | grep -E '\.(css|scss|sass)$' || true)
26+
27+
test_status=0
28+
lint_status=0
29+
style_status=0
30+
31+
if [ -n "$js_files" ]; then
32+
echo "🧪 Running related tests before push..."
33+
npx vitest related --run $js_files
34+
test_status=$?
35+
36+
echo "🧹 Running ESLint on changed files before push..."
37+
npx eslint $js_files
38+
lint_status=$?
39+
fi
40+
41+
if [ -n "$style_files" ]; then
42+
echo "🎨 Running Stylelint on changed files before push..."
43+
npx stylelint $style_files
44+
style_status=$?
45+
fi
1946

2047
# Block push if either fails
21-
if [ $test_status -ne 0 ] || [ $lint_status -ne 0 ]; then
22-
echo "❌ Push blocked: Lint or test failed."
48+
if [ $test_status -ne 0 ] || [ $lint_status -ne 0 ] || [ $style_status -ne 0 ]; then
49+
echo "❌ Push blocked: changed-file validation failed."
2350
exit 1
2451
fi
2552

26-
echo "✅ All checks passed. Proceeding with push..."
53+
echo "✅ All checks passed. Proceeding with push..."

.yarnrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Avoid stale persisted package tarballs in CI/Netlify.
2+
cache-folder "/tmp/hgn-yarn-cache"

jsconfig.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"compilerOptions": {
3-
"baseUrl": "src"
4-
}
3+
"baseUrl": "src",
4+
"paths": {
5+
"~/*": ["./*"]
6+
}
7+
},
8+
"include": ["src"]
59
}
10+

0 commit comments

Comments
 (0)