Skip to content

Commit 6f1b684

Browse files
committed
resolved merge conflict
2 parents 8186c36 + fd3d19d commit 6f1b684

1,602 files changed

Lines changed: 132630 additions & 74110 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.

.babelrc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
{
2-
"presets": ["react-app"]
3-
}
2+
"presets": ["@babel/preset-env", "@babel/preset-react"],
3+
"plugins": [
4+
"@babel/plugin-transform-optional-chaining",
5+
"@babel/plugin-transform-nullish-coalescing-operator"
6+
]
7+
}

.eslintignore

Lines changed: 0 additions & 33 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 70 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Close PRs from Forks
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- synchronize
8+
9+
jobs:
10+
check-fork:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
pull-requests: write
14+
steps:
15+
- name: Check if PR is from a fork
16+
id: check
17+
run: |
18+
echo "PR head repo: ${{ github.event.pull_request.head.repo.full_name }}"
19+
echo "Base repo: ${{ github.event.repository.full_name }}"
20+
if [[ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.event.repository.full_name }}" ]]; then
21+
echo "PR is from a fork"
22+
echo "is_fork=true" >> $GITHUB_ENV
23+
else
24+
echo "PR is not from a fork"
25+
echo "is_fork=false" >> $GITHUB_ENV
26+
fi
27+
28+
- name: Close PR and add comment
29+
if: env.is_fork == 'true'
30+
run: |
31+
PR_NUMBER=${{ github.event.pull_request.number }}
32+
GH_REPO=${{ github.repository }}
33+
echo "Closing PR #$PR_NUMBER in repository $GH_REPO"
34+
gh pr close \
35+
"$PR_NUMBER" \
36+
--repo "${{ github.repository }}" \
37+
--comment "This PR has been closed because PRs from forks are not allowed. Please create a branch directly off the origin repository and resubmit your PR."
38+
env:
39+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/deploy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ jobs:
2222
- name: Setup Node.js
2323
uses: actions/setup-node@v4
2424
with:
25-
node-version: 14
26-
cache: 'npm'
25+
node-version: 20
26+
cache: 'yarn'
2727
- name: Install Dependencies
28-
run: npm ci
28+
run: yarn install --frozen-lockfile
2929
# We don't run tests here since we assume it's already done during PR process.
3030
# - name: Update Browser List
3131
# run: npx browserslist@latest --update-db
3232
- name: Build React App
33-
run: npm run build && cp build/index.html build/200.html
33+
run: yarn run build && cp build/index.html build/200.html
3434
env:
3535
NODE_ENV: ${{ github.ref_name == 'main' && 'production' || 'development' }}
3636
REACT_APP_APIENDPOINT: ${{ vars.REACT_APP_API_ENDPOINT }}

.github/workflows/pull_request_test.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,21 @@ name: Pull Request Unit Test
33
on:
44
pull_request:
55
branches:
6-
- main
76
- development
87
jobs:
98
test:
109
runs-on: ubuntu-latest
1110
steps:
1211
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
1314
- uses: actions/setup-node@v4
1415
with:
15-
node-version: 14
16-
cache: 'npm'
16+
node-version: 20
17+
cache: 'yarn'
1718
- name: Install Dependencies
18-
run: npm ci
19-
- name: Run Unit Tests
20-
run: npm test
19+
run: yarn install --frozen-lockfile
20+
- name: Run Unit Tests for Changed Files Only
21+
run: yarn run test:changed
22+
- name: Run Lint
23+
run: yarn run lint

.github/workflows/test.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Test React App
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v3
14+
15+
- name: Set up Node.js & cache Yarn
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: 20
19+
cache: yarn
20+
21+
- name: Install dependencies
22+
run: yarn install
23+
24+
- name: Run tests
25+
run: yarn test
26+
27+
- name: Upload test results
28+
if: failure()
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: test-results
32+
path: test-results # Adjust the path to your test results if necessary

.husky-disabled/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run lint
5+
npm run test

.husky/pre-commit

100644100755
Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
33

4-
npm run lint
5-
npm run test
4+
echo ""
5+
echo "🛡️ Husky pre-commit hook triggered"
6+
echo "🛠️ Attempting to auto-fix lint issues (if possible)..."
7+
echo "🔍 Running ESLint via lint-staged on staged files:"
8+
git diff --cached --name-only --diff-filter=ACM | grep -E '\.(js|jsx|ts|tsx)$' || echo "No JS/TS files staged."
9+
10+
# Run lint-staged only if relevant files are staged
11+
if git diff --cached --name-only | grep -qE '\.(js|jsx|ts|tsx)$'; then
12+
npx lint-staged
13+
lint_exit_code=$?
14+
15+
if [ $lint_exit_code -eq 0 ]; then
16+
echo "✅ Lint passed or was auto-fixed. Proceeding with commit."
17+
else
18+
echo "❌ Lint failed. Some issues couldn't be auto-fixed. Commit aborted."
19+
echo "💡 Please fix the errors and try again."
20+
exit $lint_exit_code
21+
fi
22+
else
23+
echo "ℹ️ No JS/TS files to lint. Skipping lint-staged."
24+
fi

0 commit comments

Comments
 (0)