Skip to content

Commit 4be6dc0

Browse files
committed
fix frontend faliure workflow
1 parent e5931e2 commit 4be6dc0

File tree

9 files changed

+20
-17
lines changed

9 files changed

+20
-17
lines changed

.github/workflows/workflow_backend.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Node.js CI
1+
name: Backend CI
22

33
on:
44
push:
@@ -30,11 +30,8 @@ jobs:
3030
node-version: '20.x'
3131

3232
- name: Install Dependencies
33-
run: npm install --prefix backend
33+
run: npm install
3434

3535
- name: Run ESLint
36-
run: cd.. && npm run format
37-
38-
- name: Run Tests
39-
run: npm test --prefix backend
36+
run: npm run format
4037

.github/workflows/workflow_frontend.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ jobs:
1515
build:
1616

1717
runs-on: ubuntu-latest
18+
defaults:
19+
run:
20+
working-directory: ./frontend
1821

1922
steps:
2023
- uses: actions/checkout@v2
@@ -28,10 +31,10 @@ jobs:
2831
node-version: '20.x'
2932

3033
- name: Install Dependencies
31-
run: npm install --prefix frontend
34+
run: npm install
3235

33-
- name: Run ESLint
34-
run: npx eslint . --ext .js,.jsx
36+
- name: Install Vite
37+
run: npm install vite
3538

36-
- name: Build
37-
run: npm run build
39+
- name: Run ESLint
40+
run: npm run format

backend/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"start": "node -r dotenv/config --experimental-json-modules index.js",
99
"dev": "nodemon -r dotenv/config --experimental-json-modules index.js",
1010
"test": "jest",
11-
"build": "npm i"
11+
"build": "npm i",
12+
"format": "cd .. && npm run format"
1213
},
1314
"keywords": [],
1415
"author": "",

backend/utils/secToDuration.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Helper function to convert total seconds to the duration format
2+
23
export default function convertSecondsToDuration (totalSeconds) {
34
const hours = Math.floor(totalSeconds / 3600)
45
const minutes = Math.floor((totalSeconds % 3600) / 60)

frontend/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"build": "vite build",
99
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
1010
"preview": "vite preview",
11-
"test": "vitest"
11+
"test": "vitest",
12+
"format": "cd .. && npm run format"
1213
},
1314
"dependencies": {
1415
"@ramonak/react-progress-bar": "^5.0.3",

frontend/src/components/common/Footer.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { FooterLink2 } from '../../data/footer-links'
22
import { Link } from 'react-router-dom'
3-
// Images
43
import Logo from '../../assets/Logo/Logo-Full-Light.png'
5-
// Icons
64
import { FaFacebook, FaGoogle, FaTwitter, FaYoutube } from 'react-icons/fa'
75

86
const BottomFooter = ['Privacy Policy', 'Cookie Policy', 'Terms']

frontend/src/hooks/useRouteMatch.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ export default function useRouteMatch (path) {
44
const location = useLocation()
55
return matchPath(location.pathname, { path })
66
}
7-
87
// this custom hook check if current location is same as path or not;

frontend/vite.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import react from '@vitejs/plugin-react'
44
// https://vitejs.dev/config/
55
export default defineConfig({
66
plugins: [react()],
7+
optimizeDeps: {
8+
include: ['react-dom'],
9+
},
710
build: {
811
chunkSizeWarningLimit: 1600,
912
rollupOptions: {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"start:server": "cd backend && npm run dev",
1111
"start:client": "cd frontend && npm run dev",
1212
"dev": "concurrently -n \"server,client\" -c \"red,blue\" \"npm run start:server\" \"npm run start:client\"",
13-
"format": "eslint --fix . && eslint --ext .jsx . --fix"
13+
"format": "npx eslint . --ext .js,.jsx"
1414
},
1515
"devDependencies": {
1616
"eslint-config-standard": "^17.1.0",

0 commit comments

Comments
 (0)