Skip to content

Commit

Permalink
chore(fe): use coolify as stage frontend (#2184)
Browse files Browse the repository at this point in the history
* chore(fe): use coolify.codedang.com as stage.codedang.com

* fix(fe): remove force dynamic in main page

* chore(fe): suppress exhausted deps since we use useinterval

* chore(fe): add eslint-config-next as root devDependencies

* chore(fe): exclude next.config.js from linting
  • Loading branch information
jimin9038 authored Nov 6, 2024
1 parent 934942c commit 2c5f257
Show file tree
Hide file tree
Showing 8 changed files with 146 additions and 115 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ jobs:
working-directory: ./apps/iris

- name: Lint (Node.js)
run: git diff --name-only --diff-filter=ACMRUXB origin/main | grep -E "(.ts$|.tsx$|.js$|.jsx$)" | xargs -r pnpm eslint
run: git diff --name-only --diff-filter=ACMRUXB origin/main | grep -E "(.ts$|.tsx$|.js$|.jsx$)" | grep -v 'next.config.js$' | xargs -r pnpm eslint

test-backend:
name: Test Backend
Expand Down
6 changes: 0 additions & 6 deletions apps/frontend/app/(main)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,8 @@ import type { Route } from 'next'
import Link from 'next/link'
import Carousel from './_components/Carousel'
import ContestCards from './_components/ContestCards'
// import ContestCards from './_components/ContestCards'
import ProblemCards from './_components/ProblemCards'

// FIXME: Build error occurs when using static routes
// Disable static routes as a workaround for now
// https://github.com/vercel/next.js/issues/54961
export const dynamic = 'force-dynamic'

const slides = [
{
type: 'codedang',
Expand Down
1 change: 1 addition & 0 deletions apps/frontend/components/ContestStatusTimeDiff.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export default function ContestStatusTimeDiff({

useEffect(() => {
updateContestStatus()
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

useInterval(() => {
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const ACCESS_TOKEN_EXPIRE_TIME = 30 * MILLSECONDS_PER_MINUTE
* The meta base URL for open graph and twitter card.
* @constant
*/
export const metaBaseUrl = process.env.VERCEL_URL || process.env.NEXT_URL
export const metaBaseUrl = process.env.NEXT_URL

/**
* The languages that are supported by the grading system.
Expand Down
4 changes: 1 addition & 3 deletions apps/frontend/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ const nextConfig = {
},
output: 'standalone',
env: {
NEXTAUTH_URL: process.env.VERCEL_URL
? `https://${process.env.VERCEL_URL}/next-auth/api/auth`
: process.env.NEXTAUTH_URL
NEXTAUTH_URL: process.env.NEXTAUTH_URL
}
}

Expand Down
5 changes: 2 additions & 3 deletions apps/infra/stage/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,8 @@ stage.codedang.com {
}

handle {
reverse_proxy https://codedang.vercel.app {
# Must override host to avoid Vercel error
header_up Host codedang.vercel.app
reverse_proxy https://coolify.codedang.com {
header_up Host coolify.codedang.com
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"eslint": "^8.57.1",
"eslint-config-next": "^14.2.16",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-vue": "^9.30.0",
"knip": "^5.36.2",
"lefthook": "^1.8.2",
"prettier": "^3.3.3",
Expand Down
239 changes: 139 additions & 100 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

0 comments on commit 2c5f257

Please sign in to comment.