Skip to content

Commit

Permalink
feature : Husky & Prettier Addition - For formatting code (#25)
Browse files Browse the repository at this point in the history
Co-authored-by: Pritish Budhiraja - Juspay <[email protected]>
Co-authored-by: Jeeva Ramachandran <[email protected]>
Co-authored-by: Jeeva Ramachandran <[email protected]>
  • Loading branch information
4 people authored Nov 29, 2023
1 parent 3b93b72 commit 9e2cb7b
Show file tree
Hide file tree
Showing 42 changed files with 82,550 additions and 32,789 deletions.
33 changes: 14 additions & 19 deletions .babelrc
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"
]
}
24 changes: 24 additions & 0 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh

echo "~~~~**** Commit hook started ****~~~~"

commit_msg_file=$1
commit_msg=$(cat "$commit_msg_file")


# For formatting your code
npx prettier --write .
npm run re:format

# Define your commit message convention (e.g., starts with "feature:", "fix:", etc.)
commit_regex="^(merge-commit|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>: <subject> - <description>"
exit 1
fi

# If the commit message matches the convention, the script exits successfully.
echo "~~~~**** Commit hook completed ****~~~~"
exit 0
8 changes: 5 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Type of Change

<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
Expand All @@ -10,10 +11,11 @@
- [ ] CI/CD

## Description
<!-- Describe your changes in detail -->

<!-- Describe your changes in detail -->

## Motivation and Context

<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
Expand All @@ -23,15 +25,15 @@ can focus on the implementation (unless its an obvious bug or documentation fix
that will have little conversation).
-->


## How did you test it?

<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->


## Checklist

<!-- Put an `x` in the boxes that apply -->

- [ ] I ran `npm run re:build`
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20

- name: "Setup yarn"
run: corepack enable

- name: "Install dependencies"
run: yarn install
run: npm install --legacy-peer-deps

- name: "Build"
run: npm run re:build
run: npm run re:build
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ lib/
!.yarn/versions.DS_Store
/public/env-config.js
env-config.js
# yarn.lock
package-lock.json
yarn.lock
#package-lock.json
user_data.sh
*.pem
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ Follow these simple steps to set up Hyperswitch on your local machine.
Feature flags allows the users to enable or disable certain functionalities or flows in the control center.

### Using feature flags
The FeatureFlag.json file can be found under config/FeatueFlag.json. By default, all the feature flags is turned off (`False` value).

The FeatureFlag.json file can be found under config/FeatueFlag.json. By default, all the feature flags is turned off (`False` value).

### Feature flag descriptions

#### Generate report

The `generate_report` feature flag controls the ability to generate detailed reports on payments, refunds, and disputes. When enabled, this allows users to pull reports covering the previous 6 months of transaction data. The reports can provide insights into trends, identify issues, and inform business decisions.
Expand Down Expand Up @@ -264,6 +266,7 @@ curl https://raw.githubusercontent.com/juspay/hyperswitch/main/aws/hyperswitch_c
Once the script is executed, you will receive a Public IP as the response (e.g. http://34.207.75.225). This IP is the base URL for accessing the application's APIs

#### Clean Up

If you want to delete the application from your account simply run the below clean up script. Ypu need to install JQ for this. For more information, [click here](https://jqlang.github.io/jq/download/)

```
Expand Down
7 changes: 2 additions & 5 deletions bsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
"version": 4,
"mode": "classic"
},
"bsc-flags": [
"-bs-super-errors",
"-open RescriptCore"
],
"bsc-flags": ["-bs-super-errors", "-open RescriptCore"],
"sources": {
"dir": "src",
"subdirs": true
Expand All @@ -28,4 +25,4 @@
"rescript-debounce-react",
"@rescript/core"
]
}
}
2 changes: 1 addition & 1 deletion config/FeatureFlag.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"mixpanel": false,
"business_profile": false,
"generate_report": false
}
}
6 changes: 3 additions & 3 deletions jest.config.js
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"],
};
Loading

0 comments on commit 9e2cb7b

Please sign in to comment.