Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cspell/custom-dict.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ speakerdeck
superfences
tiktok
tsc
turbopack
unassigning
unhover
usefixtures
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import authenticationMiddleware from 'middleware'
import { NextRequest, NextResponse } from 'next/server'
import { getToken } from 'next-auth/jwt'
import proxy from 'proxy'

// Mock the external dependencies
jest.mock('next-auth/jwt', () => ({
Expand All @@ -17,7 +17,7 @@ jest.mock('next/server', () => ({
},
}))

describe('Authentication Middleware', () => {
describe('Authentication Proxy', () => {
const mockRequest = (url = 'http://localhost/'): NextRequest =>
({
url,
Expand All @@ -42,7 +42,7 @@ describe('Authentication Middleware', () => {
const request = mockRequest(testCaseInfo.url)
const expectedRedirectUrl = new URL('/auth/login', testCaseInfo.url)

const result = await authenticationMiddleware(request)
const result = await proxy(request)

expect(getToken).toHaveBeenCalledWith({ req: request })
expect(NextResponse.redirect).toHaveBeenCalledWith(expectedRedirectUrl)
Expand All @@ -63,7 +63,7 @@ describe('Authentication Middleware', () => {
;(getToken as jest.Mock).mockResolvedValue(testUser)
const request = mockRequest('http://localhost/dashboard')

const result = await authenticationMiddleware(request)
const result = await proxy(request)

expect(getToken).toHaveBeenCalledWith({ req: request })
expect(NextResponse.next).toHaveBeenCalled()
Expand All @@ -74,7 +74,7 @@ describe('Authentication Middleware', () => {
;(getToken as jest.Mock).mockResolvedValue(testUser)
const request = mockRequest()

const result = await authenticationMiddleware(request)
const result = await proxy(request)

expect(NextResponse.next).toHaveBeenCalled()
expect(result).toEqual({ type: 'next' })
Expand Down
12 changes: 2 additions & 10 deletions frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { dirname } from 'path'
import { fileURLToPath } from 'url'
import { FlatCompat } from '@eslint/eslintrc'
import path from 'path'

import js from '@eslint/js'
import typescriptEslint from '@typescript-eslint/eslint-plugin'
import typescriptParser from '@typescript-eslint/parser'
import tseslint from 'typescript-eslint'
import prettierConfig from 'eslint-config-prettier'
import importPlugin from 'eslint-plugin-import'
import jest from 'eslint-plugin-jest'
Expand All @@ -24,12 +22,8 @@ import noGlobalParseIntRule from './eslint-rules/no-global-parseint.mjs'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)

const compat = new FlatCompat({
baseDirectory: __dirname,
})

const eslintConfig = [
...compat.extends('next/typescript'),
...tseslint.configs.recommended,
react.configs.flat['jsx-runtime'],
{
ignores: [
Expand All @@ -47,7 +41,6 @@ const eslintConfig = [
{
files: ['**/*.{js,jsx,ts,tsx}'],
languageOptions: {
parser: typescriptParser,
ecmaVersion: 2023,
sourceType: 'module',
globals: {
Expand All @@ -58,7 +51,6 @@ const eslintConfig = [
},
},
plugins: {
'@typescript-eslint': typescriptEslint,
'react-hooks': reactHooks,
import: importPlugin,
jest,
Expand Down
2 changes: 1 addition & 1 deletion frontend/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const nextConfig: NextConfig = {
poweredByHeader: false,
// https://nextjs.org/docs/app/api-reference/config/next-config-js/productionBrowserSourceMaps
productionBrowserSourceMaps: true,
serverExternalPackages: ['import-in-the-middle'],
serverExternalPackages: ['import-in-the-middle', 'require-in-the-middle'],
...(isLocal ? {} : { output: 'standalone' }),
}

Expand Down
10 changes: 5 additions & 5 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"private": true,
"scripts": {
"build": "next build",
"build:turbo": "next build --turbo",
"dev": "next dev --port 3000",
"format": "prettier --log-level warn --write .",
"format:check": "prettier --check .",
Expand Down Expand Up @@ -34,8 +33,8 @@
"@heroui/theme": "^2.4.23",
"@heroui/toast": "^2.0.17",
"@heroui/tooltip": "^2.2.24",
"@next/eslint-plugin-next": "^15.5.7",
"@next/third-parties": "^15.5.7",
"@next/eslint-plugin-next": "^16.0.7",
"@next/third-parties": "^16.0.7",
"@sentry/nextjs": "^10.29.0",
"@testing-library/user-event": "^14.6.1",
"@types/lodash": "^4.17.21",
Expand All @@ -55,7 +54,7 @@
"markdown-it": "^14.1.0",
"markdown-it-task-lists": "^2.1.1",
"millify": "^6.1.0",
"next": "^15.5.7",
"next": "^16.0.7",
"next-auth": "^4.24.13",
"next-themes": "^0.4.6",
"react": "^19.2.1",
Expand Down Expand Up @@ -94,7 +93,7 @@
"@typescript-eslint/eslint-plugin": "^8.48.1",
"@typescript-eslint/parser": "^8.48.1",
"eslint": "^9.39.1",
"eslint-config-next": "^15.5.7",
"eslint-config-next": "^16.0.7",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-jest": "^29.2.1",
Expand All @@ -111,6 +110,7 @@
"postcss": "^8.5.6",
"prettier": "^3.7.4",
"prettier-plugin-tailwindcss": "^0.7.2",
"require-in-the-middle": "^8.0.1",
"tailwindcss": "^4.1.17",
"ts-jest": "^29.4.6",
"ts-node": "^10.9.2",
Expand Down
Loading