Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh
. "$(dirname -- "$0")/_/husky.sh"

changed_files=$(git diff --name-only HEAD~1)

app_changed=$(echo "$changed_files" | grep -E '^apps/app/' || true)
space_changed=$(echo "$changed_files" | grep -E '^apps/space/' || true)
echo $app_changed
echo $space_changed

if [ -n "$app_changed" ] && [ -n "$space_changed" ]; then
echo "Changes detected in both apps/app and apps/space. Building..."
yarn run lint
yarn run build
elif [ -n "$app_changed" ]; then
echo "Changes detected in apps/app. Building..."
yarn run lint --filter=app
yarn run build --filter=app
elif [ -n "$space_changed" ]; then
echo "Changes detected in apps/space. Building..."
yarn run lint --filter=space
yarn run build --filter=space
fi
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@
"packages/*"
],
"scripts": {
"prepare": "husky install",
"build": "turbo run build",
"dev": "turbo run dev",
"start": "turbo run start",
"lint": "turbo run lint",
"clean": "turbo run clean"
},

"devDependencies": {
"eslint-config-custom": "*",
"prettier": "latest",
"turbo": "latest"
"turbo": "latest",
"husky": "^8.0.3"
},
"packageManager": "yarn@1.22.19"
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4902,6 +4902,11 @@ https-proxy-agent@^5.0.0:
agent-base "6"
debug "4"

husky@^8.0.3:
version "8.0.3"
resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184"
integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==

idb@^7.0.1:
version "7.1.1"
resolved "https://registry.yarnpkg.com/idb/-/idb-7.1.1.tgz#d910ded866d32c7ced9befc5bfdf36f572ced72b"
Expand Down