Skip to content

Commit

Permalink
Merge pull request #1 from dev-ahmadbilal/main
Browse files Browse the repository at this point in the history
Main
  • Loading branch information
dev-ahmadbilal authored Aug 30, 2024
2 parents 0e9c3e4 + f5aa207 commit 0e1465f
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 21 deletions.
3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no -- commitlint --edit "$1"
35 changes: 21 additions & 14 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# Run linting
npm run lint

echo "Linting passed. Proceeding with the unit tests."
# Get the list of changed files in the commit
CHANGED_FILES=$(git diff --cached --name-only)

# Check if any of the changed files are under the `src` folder
if echo "$CHANGED_FILES" | grep -q '^src/'; then
echo "Changes detected in the src folder. Running unit tests..."

# Run islam.js unit tests
echo "Running islam.js unit tests..."
npm run test

# Run NestJS unit tests
echo "Running NestJS unit tests..."
npm run test
# Capture the exit code of the tests
TEST_RESULT=$?

# Capture the exit code of the tests
TEST_RESULT=$?
# Check if tests passed
if [ $TEST_RESULT -ne 0 ]; then
echo "Tests failed. Please fix the issues before committing."
exit $TEST_RESULT
fi

# Check if tests passed
if [ $TEST_RESULT -ne 0 ]; then
echo "Tests failed. Please fix the issues before committing."
exit $TEST_RESULT
echo "Tests passed. Proceeding with the commit."
else
echo "No changes detected in the src folder. Skipping unit tests."
fi

echo "Tests passed. Proceeding with the commit."
exit 0
exit 0
2 changes: 0 additions & 2 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run build
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 1.0.0 (2024-08-30)


### Bug Fixes

* disable commit lint from semantic releae commits ([8ccbfe7](https://github.com/dev-ahmadbilal/islam.js/commit/8ccbfe7bddd5f7c6f32353e013e851258501cf08))
* remove deprecated commands from husky hooks ([dff2059](https://github.com/dev-ahmadbilal/islam.js/commit/dff205931d94de346adc516de8cc0ba2f2b2541b))
* update lin script command ([53c39af](https://github.com/dev-ahmadbilal/islam.js/commit/53c39affc0723f288c43d0f0df16dc22b969a9b5))
* update pre commit hook to skip test for outside src changes ([4e11105](https://github.com/dev-ahmadbilal/islam.js/commit/4e11105c6f9ef8b8e46cdaf8bab6052ccadfba5b))


### Features

* **assets:** added pkg assets ([727306b](https://github.com/dev-ahmadbilal/islam.js/commit/727306b493d306bae278c1d28c12601b8970a9e5))
* **classes:** add service classes ([27a3944](https://github.com/dev-ahmadbilal/islam.js/commit/27a39444f5b84f0b047143993538796aeab9dfb9))
* **types:** added pkg types ([8d7f757](https://github.com/dev-ahmadbilal/islam.js/commit/8d7f757c1639f8376e95b90ae78adbbb5e8a9e3f))
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// eslint-disable-next-line no-undef
module.exports = {
extends: ['@commitlint/config-conventional'],
ignores: [(commit) => commit.includes('[skip ci]')],
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"clean": "rm -rf ./lib/",
"release": "semantic-release",
"prepare": "husky install",
"lint": "eslint",
"lint:fix": "eslint --fix",
"lint": "eslint ./src/",
"lint:fix": "eslint ./src/ --fix",
"start": "npx ts-node src/test.ts",
"test": "jest --coverage"
},
Expand Down

0 comments on commit 0e1465f

Please sign in to comment.