-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature : Husky & Prettier Addition - For formatting code
- Loading branch information
Pritish Budhiraja - Juspay
committed
Nov 28, 2023
1 parent
4ac89db
commit a81d313
Showing
23 changed files
with
227 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,16 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-env", | ||
"@babel/preset-react" | ||
"presets": ["@babel/preset-env", "@babel/preset-react"], | ||
"plugins": [ | ||
[ | ||
"module-resolver", | ||
{ | ||
"root": ["./src"], | ||
"alias": { | ||
"test": "./test", | ||
"underscore": "lodash" | ||
} | ||
} | ||
], | ||
"plugins": [ | ||
[ | ||
"module-resolver", | ||
{ | ||
"root": [ | ||
"./src" | ||
], | ||
"alias": { | ||
"test": "./test", | ||
"underscore": "lodash" | ||
} | ||
} | ||
], | ||
"@babel/plugin-transform-async-to-generator" | ||
] | ||
} | ||
"@babel/plugin-transform-async-to-generator" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
commit_msg_file=$1 | ||
commit_msg=$(cat "$commit_msg_file") | ||
|
||
|
||
# Define your commit message convention (e.g., starts with "feat:", "fix:", etc.) | ||
commit_regex="^(feature|bugfix|chore|docs|style|refactor|test|enhancement) .+" | ||
|
||
if ! echo "$commit_msg" | grep -E "$commit_regex" ; then | ||
echo "Aborting commit. Your commit message does not follow the conventional format." | ||
echo "Example - <feature|bugfix|chore|docs|style|refactor|test|enhancement>: (<scope>) - <description>" | ||
exit 1 | ||
fi | ||
|
||
# If the commit message matches the convention, the script exits successfully. | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
|
||
npm run re:build | ||
|
||
npx prettier --write . | ||
|
||
npm run re:format | ||
|
||
# Check that the code is compiling properly | ||
if [ $? -ne 0 ]; then | ||
echo "ReScript build failed. Aborting commit." | ||
exit 1 | ||
else | ||
echo "✨ Code compiled successfully. ✨" | ||
exit 0 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,4 @@ | |
"mixpanel": false, | ||
"business_profile": false, | ||
"generate_report": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports = { | ||
testEnvironment: "jsdom", | ||
moduleFileExtensions: ["js", "mjs"], | ||
testMatch: ["**/tests/**/*Test.bs.js"], | ||
testEnvironment: "jsdom", | ||
moduleFileExtensions: ["js", "mjs"], | ||
testMatch: ["**/tests/**/*Test.bs.js"], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ | |
"author": "Shiva Nandan <[email protected]>", | ||
"license": "MIT", | ||
"scripts": { | ||
"pre-commit": "git config core.hooksPath .githooks && chmod +x .githooks/commit-msg && bash .githooks/commit-msg", | ||
"pre-push": "git config core.hooksPath .githooks && chmod +x .githooks/pre-push && bash .githooks/pre-push", | ||
"start": "chmod +x ./replace_env.sh && ./replace_env.sh && cp env-config.js ./public/hyperswitch && APP_VERSION=$npm_package_version && appName=hyperswitch webpack serve --config webpack.dev.js", | ||
"start:server_compiler": "webpack --config webpack.server.js --watch", | ||
"prod:start": "webpack serve --config webpack.dev.js", | ||
|
@@ -23,20 +25,28 @@ | |
"unit:test": "cd tests && npx rescript build -with-deps && jest unit_test", | ||
"revert:test": "cd tests && npx rescript clean -with-deps && cd .. && npx rescript build -with-deps" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "npm run pre-commit", | ||
"pre-push": "npm run pre-push" | ||
} | ||
}, | ||
"devDependencies": { | ||
"@glennsl/rescript-jest": "^0.10.0", | ||
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.1", | ||
"copy-webpack-plugin": "^9.0.0", | ||
"css-loader": "^5.0.1", | ||
"css-minimizer-webpack-plugin": "^5.0.1", | ||
"file-loader": "^6.2.0", | ||
"husky": "^8.0.3", | ||
"jest-environment-jsdom": "^29.6.4", | ||
"mini-css-extract-plugin": "^1.3.1", | ||
"monaco-editor-webpack-plugin": "^7.0.1", | ||
"node-fetch": "^2.6.1", | ||
"postcss": "^8.3.6", | ||
"postcss-loader": "^4.1.0", | ||
"postcss-preset-env": "^6.7.0", | ||
"prettier": "^3.1.0", | ||
"react-refresh": "^0.10.0", | ||
"rescript": "^10.1.2", | ||
"serve": "^14.2.1", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
.highcharts-data-label-connector { | ||
stroke-dasharray: 2, 2; | ||
stroke: #151A1F; | ||
opacity: 0.3; | ||
stroke-width: 2px; | ||
} | ||
stroke-dasharray: 2, 2; | ||
stroke: #151a1f; | ||
opacity: 0.3; | ||
stroke-width: 2px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
.highchart-sankey .highcharts-link { | ||
fill: rgba(109, 115, 127, 0.2); | ||
|
||
fill: rgba(109, 115, 127, 0.2); | ||
} | ||
|
||
.highchart-sankey .highcharts-link:hover, | ||
.highchart-sankey .highcharts-link.highcharts-point-hover { | ||
fill: rgba(109, 115, 127, 0.6); | ||
fill: rgba(109, 115, 127, 0.6); | ||
} | ||
|
||
.highchart-sankey .highcharts-label-box.highcharts-tooltip-box { | ||
stroke: none; | ||
stroke: none; | ||
} | ||
|
||
.highchart-sankey .highcharts-label tspan.highcharts-text-outline { | ||
stroke: transparent; | ||
stroke: transparent; | ||
} | ||
|
||
span.highcharts-title { | ||
width: 100% !important; | ||
padding-right: 20px; | ||
width: 100% !important; | ||
padding-right: 20px; | ||
} | ||
|
||
.highcharts-yaxis-grid .highcharts-grid-line { | ||
stroke-dasharray: 4, 6; | ||
.highcharts-yaxis-grid .highcharts-grid-line { | ||
stroke-dasharray: 4, 6; | ||
} |
Oops, something went wrong.