Skip to content

Commit 8377171

Browse files
Fixed profiling and added DevOps integration
1 parent 0f6d48c commit 8377171

File tree

9 files changed

+333
-78
lines changed

9 files changed

+333
-78
lines changed

.eslintrc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "next/core-web-vitals",
3+
"parserOptions": {
4+
"project": "./tsconfig.json"
5+
},
6+
"rules": {
7+
"@typescript-eslint/no-explicit-any": "warn"
8+
}
9+
}

.github/workflows/build-test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Use Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 20
21+
22+
- name: Cache node modules
23+
uses: actions/cache@v4
24+
with:
25+
path: ~/.npm
26+
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
27+
restore-keys: |
28+
${{ runner.os }}-node-
29+
30+
- name: Install dependencies
31+
run: npm ci
32+
33+
- name: Audit dependencies
34+
run: npm audit --audit-level=moderate || true
35+
36+
- name: Run tests
37+
run: npm test
38+
39+
- name: Build project
40+
run: npm run build

.idea/codeStyles/Project.xml

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// // components/ContributorCard.tsx
2+
// import { FC, memo } from 'react'
3+
// import Image from 'next/image'
4+
// import Link from 'next/link'
5+
//
6+
// const ContributorCard: FC<{ contributor: any }> = memo(({ contributor }) => (
7+
// <div className="flex flex-col items-center rounded-lg bg-white p-6 shadow-md transition-all duration-200 hover:shadow-lg">
8+
// <Link
9+
// href={contributor.url}
10+
// target="_blank"
11+
// rel="noopener noreferrer"
12+
// className="group relative"
13+
// >
14+
// <Image
15+
// src={contributor.avatar}
16+
// alt={`${contributor.name}'s avatar`}
17+
// width={120}
18+
// height={120}
19+
// className="rounded-full transition-transform duration-200 group-hover:scale-105"
20+
// loading="lazy"
21+
// placeholder="blur"
22+
// blurDataURL="/placeholder.png"
23+
// />
24+
// </Link>
25+
// <h3 className="mt-4 text-lg font-semibold text-gray-900">
26+
// {contributor.name}
27+
// </h3>
28+
// <Link
29+
// href={contributor.url}
30+
// target="_blank"
31+
// rel="noopener noreferrer"
32+
// className="mt-2 text-modern-purple hover:text-modern-purple/80"
33+
// >
34+
// View Profile
35+
// </Link>
36+
// </div>
37+
// ))
38+
//
39+
// export default ContributorCard

next.config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,31 @@ const nextConfig = {
4545
}
4646
};
4747

48+
const withBundleAnalyzer = require('@next/bundle-analyzer')({
49+
enabled: process.env.ANALYZE === 'true',
50+
})
51+
module.exports = withBundleAnalyzer({
52+
reactStrictMode: true,
53+
})
54+
55+
// const nextConfig1 = {
56+
// async headers() {
57+
// return [
58+
// {
59+
// source: "/:all*(svg|jpg|png|webp|ico|js|css|woff2)",
60+
// headers: [
61+
// {
62+
// key: "Cache-Control",
63+
// value: "public, max-age=31536000, immutable"
64+
// }
65+
// ],
66+
// },
67+
// ]
68+
// },
69+
// }
70+
// module.exports = nextConfig1
71+
72+
4873
module.exports = nextConfig;
4974

5075

package.json

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,39 @@
1717
"@clerk/nextjs": "^4.31.5",
1818
"@clerk/themes": "^2.2.3",
1919
"@heroicons/react": "^2.0.18",
20+
"@jest/globals": "^29.7.0",
21+
"@testing-library/react": "^16.3.0",
22+
"expect": "^29.7.0",
2023
"framer-motion": "^12.0.0",
2124
"next": "^14.1.0",
2225
"react": "18.3.1",
2326
"react-dom": "18.3.1",
24-
"react-intersection-observer": "^9.15.1"
27+
"react-intersection-observer": "^9.15.1",
28+
"react-window": "^2.2.3"
2529
},
2630
"devDependencies": {
2731
"@babel/preset-env": "^7.28.3",
2832
"@babel/preset-react": "^7.27.1",
2933
"@babel/preset-typescript": "^7.27.1",
30-
"@eslint/eslintrc": "^3.3.1",
31-
"@jest/globals": "^29.7.0",
34+
"@next/bundle-analyzer": "^16.0.0",
3235
"@testing-library/jest-dom": "^6.9.1",
33-
"@testing-library/react": "^16.3.0",
3436
"@types/jest": "^30.0.0",
3537
"@types/node": "24.7.2",
3638
"@types/react": "18.3.12",
3739
"@types/react-dom": "18.3.1",
40+
"@types/react-window": "^1.8.8",
41+
"@types/testing-library__jest-dom": "^5.14.9",
42+
"@typescript-eslint/eslint-plugin": "^8.46.2",
43+
"@typescript-eslint/parser": "^8.46.2",
3844
"autoprefixer": "10.4.21",
3945
"babel-jest": "^29.7.0",
40-
"eslint": "9.38.0",
41-
"eslint-config-next": "15.5.6",
42-
"expect": "^30.2.0",
46+
"eslint": "^9.37.0",
47+
"eslint-config-next": "15.5.5",
4348
"jest": "^29.7.0",
4449
"jest-environment-jsdom": "^29.7.0",
4550
"postcss": "8.5.6",
4651
"prettier": "^3.5.3",
47-
"prettier-plugin-tailwindcss": "^0.7.1",
52+
"prettier-plugin-tailwindcss": "^0.6.11",
4853
"tailwindcss": "3.4.15",
4954
"ts-jest": "^29.4.5",
5055
"typescript": "5.9.3"

pages/community/[community].tsx

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,37 @@
11
import { useRouter } from 'next/router'
2+
import dynamic from 'next/dynamic'
23
import React from 'react'
3-
import Discussions from '../../components/communityComponents/Discussions'
4-
import Events from '../../components/communityComponents/Events'
5-
import CommunityNotSupported from '../../components/communityComponents/CommunityNotSupported'
4+
5+
const Discussions = dynamic(
6+
() => import('../../components/communityComponents/Discussions'),
7+
{ ssr: false }
8+
)
9+
const Events = dynamic(
10+
() => import('../../components/communityComponents/Events'),
11+
{ ssr: false }
12+
)
13+
const CommunityNotSupported = dynamic(
14+
() => import('../../components/communityComponents/CommunityNotSupported'),
15+
{ ssr: false }
16+
)
617

718
const CommunityPage = () => {
819
const router = useRouter()
920
const { community } = router.query
1021

11-
const renderContent = () => {
12-
switch (community) {
13-
case 'discussions':
14-
return (
15-
<div className='bg-primary min-h-screen'>
16-
<Discussions />
17-
</div>
18-
)
19-
case 'events':
20-
return (
21-
<div className='bg-primary min-h-screen'>
22-
<Events />
23-
</div>
24-
)
25-
26-
default:
27-
return <CommunityNotSupported />
28-
}
22+
let Content
23+
switch (community) {
24+
case 'discussions':
25+
Content = <Discussions />
26+
break
27+
case 'events':
28+
Content = <Events />
29+
break
30+
default:
31+
Content = <CommunityNotSupported />
2932
}
3033

31-
return <div className='bg-primary'>{renderContent()}</div>
34+
return <div className="bg-primary min-h-screen">{Content}</div>
3235
}
3336

34-
export default CommunityPage
37+
export default CommunityPage

0 commit comments

Comments
 (0)