Skip to content

Commit bb97509

Browse files
authored
Merge pull request #691 from danactive/lint
Upgrade Next.js to v16
2 parents 868adc2 + 7777b89 commit bb97509

File tree

28 files changed

+976
-2112
lines changed

28 files changed

+976
-2112
lines changed

.gitignore

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@ node_modules
55
/test-results/
66
playwright-report/
77
/playwright/.cache/
8+
coverage
9+
.nyc_output
810

911
# next.js
1012
/.next/
11-
/out/
13+
next-env.d.ts
1214

1315
# production
1416
/build
1517

16-
1718
# misc
1819
.DS_Store
1920
*.pem
@@ -23,7 +24,6 @@ npm-debug.log*
2324
yarn-debug.log*
2425
yarn-error.log*
2526

26-
2727
# vercel
2828
.vercel
2929

@@ -34,10 +34,10 @@ generated.ts
3434
# IDE
3535
.vscode
3636

37-
coverage
38-
.nyc_output
39-
tmp
40-
public/resized
37+
# Python
4138
models
4239
weights.log
4340
api.log
41+
42+
# Images
43+
public/resized

app/[gallery]/[album]/page.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
import type { Metadata, ResolvingMetadata } from 'next'
1+
import type { Metadata } from 'next'
22
import { Suspense } from 'react'
33

44
import AlbumPageComponent from '../../../src/components/Album/AlbumClient'
55
import getAlbum from '../../../src/lib/album'
66
import getAlbums from '../../../src/lib/albums'
77
import getGalleries from '../../../src/lib/galleries'
8+
import { generateClusters } from '../../../src/lib/generate-clusters'
89
import indexKeywords, { addGeographyToSearch } from '../../../src/lib/search'
910
import type { Album } from '../../../src/types/pages'
10-
import { generateClusters } from '../../../src/lib/generate-clusters'
1111

1212
export async function generateMetadata(
1313
{ params }: { params: Promise<Album.Params> },
14-
parent: ResolvingMetadata,
1514
): Promise<Metadata> {
1615
const album = (await params).album
1716
return { title: `Album ${album} - History App` }

app/[gallery]/page.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@ async function getAlbumsData(gallery: GalleryName): Promise<Gallery.ComponentPro
3131
}
3232
}
3333

34-
export default async function GalleryServer(props: { params: Promise<Gallery.Params> }) {
35-
const params = await props.params
36-
34+
export default async function GalleryServer({ params }: { params: Promise<Gallery.Params> }) {
3735
const {
3836
gallery,
39-
} = params
37+
} = await params
4038

4139
const { albums, indexedKeywords } = await getAlbumsData(gallery)
4240

app/admin/walk/[...path]/page.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { Metadata } from 'next'
22

33
import WalkClient from '../../../../src/components/Walk/WalkClient'
44
import getFilesystems from '../../../../src/lib/filesystems'
5+
import type { Walk } from '../../../../src/types/pages'
56

67
export const metadata: Metadata = {
78
title: 'Admin > Walk - History App',
@@ -31,11 +32,7 @@ async function getAllFolderPaths(path = '/') {
3132
return paths
3233
}
3334

34-
export default async function Page({
35-
params,
36-
}: {
37-
params: Promise<{ path?: string[] }>
38-
}) {
35+
export default async function Page({ params }: { params: Promise<Walk.Params> }) {
3936
const { path: nextRoutePath = [] } = await params
4037
const path = nextRoutePath.join('/')
4138
const fsPath = path ? `/${path}` : '/'

app/api/galleries/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { NextResponse } from 'next/server'
22

33
import get, { errorSchema } from '../../../src/lib/galleries'
44

5-
async function GET(req: Request) {
5+
async function GET() {
66
const out = await get(true)
77
return NextResponse.json(out.body, { status: out.status })
88
}

jest.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const customJestConfig = {
1111
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
1212
moduleDirectories: ['node_modules', '<rootDir>/'],
1313
testEnvironment: 'jest-environment-jsdom',
14-
testMatch: ['**/__tests__/**/*.(j|t)s?(x)', '!**/*.vitest.(j|t)s', '!**/*.e2e.spec.(j|t)s'],
14+
testMatch: ['**/__tests__/**/*.(j|t)s?(x)', '!**/*.vitest.(j|t)s?(x)', '!**/*.e2e.spec.(j|t)s'],
1515
}
1616

1717
// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async

next-env.d.ts

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

next.config.mjs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
/** @type {import('next').NextConfig} */
12
const nextConfig = {
23
reactStrictMode: true,
34
compiler: {
45
styledComponents: true,
56
},
6-
eslint: {
7-
dirs: ['pages', 'src', '__tests__', 'app'],
8-
},
7+
reactCompiler: true,
8+
// images: {
9+
// localPatterns: [{ pathname: '/galleries/*/media/**', search: '' }],
10+
// },
911
}
1012
export default nextConfig

0 commit comments

Comments
 (0)