mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-26 04:53:10 +00:00
Update to NextJS 16
This commit is contained in:
parent
205b018bb4
commit
0e9dcceb83
7 changed files with 375 additions and 315 deletions
|
|
@ -1,38 +1,20 @@
|
||||||
import { dirname } from 'path'
|
import { defineConfig, globalIgnores } from 'eslint/config'
|
||||||
import { fileURLToPath } from 'url'
|
import nextVitals from 'eslint-config-next/core-web-vitals'
|
||||||
import { FlatCompat } from '@eslint/eslintrc'
|
import nextTs from 'eslint-config-next/typescript'
|
||||||
|
import prettier from 'eslint-config-prettier/flat'
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url)
|
const eslintConfig = defineConfig([
|
||||||
const __dirname = dirname(__filename)
|
...nextVitals,
|
||||||
|
...nextTs,
|
||||||
const compat = new FlatCompat({
|
prettier,
|
||||||
baseDirectory: __dirname,
|
// Override default ignores of eslint-config-next.
|
||||||
})
|
globalIgnores([
|
||||||
|
// Default ignores of eslint-config-next:
|
||||||
const eslintConfig = [
|
'.next/**',
|
||||||
...compat.extends('next/core-web-vitals', 'next/typescript'),
|
'out/**',
|
||||||
{
|
'build/**',
|
||||||
rules: {
|
'next-env.d.ts',
|
||||||
'@typescript-eslint/ban-ts-comment': 'warn',
|
]),
|
||||||
'@typescript-eslint/no-empty-object-type': 'warn',
|
])
|
||||||
'@typescript-eslint/no-explicit-any': 'warn',
|
|
||||||
'@typescript-eslint/no-unused-vars': [
|
|
||||||
'warn',
|
|
||||||
{
|
|
||||||
vars: 'all',
|
|
||||||
args: 'after-used',
|
|
||||||
ignoreRestSiblings: false,
|
|
||||||
argsIgnorePattern: '^_',
|
|
||||||
varsIgnorePattern: '^_',
|
|
||||||
destructuredArrayIgnorePattern: '^_',
|
|
||||||
caughtErrorsIgnorePattern: '^(_|ignore)',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ignores: ['.next/'],
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
export default eslintConfig
|
export default eslintConfig
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,7 @@ import { withPayload } from '@payloadcms/next/withPayload'
|
||||||
|
|
||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
// Your Next.js config here
|
cacheComponents: true,
|
||||||
webpack: (webpackConfig) => {
|
|
||||||
webpackConfig.resolve.extensionAlias = {
|
|
||||||
'.cjs': ['.cts', '.cjs'],
|
|
||||||
'.js': ['.ts', '.tsx', '.js', '.jsx'],
|
|
||||||
'.mjs': ['.mts', '.mjs'],
|
|
||||||
}
|
|
||||||
|
|
||||||
return webpackConfig
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default withPayload(nextConfig, { devBundleServerPackages: false })
|
export default withPayload(nextConfig, { devBundleServerPackages: false })
|
||||||
|
|
|
||||||
27
package.json
27
package.json
|
|
@ -26,7 +26,8 @@
|
||||||
"devsafe": "rm -rf .next && cross-env NODE_OPTIONS=--no-deprecation next dev",
|
"devsafe": "rm -rf .next && cross-env NODE_OPTIONS=--no-deprecation next dev",
|
||||||
"generate:importmap": "cross-env NODE_OPTIONS=--no-deprecation payload generate:importmap",
|
"generate:importmap": "cross-env NODE_OPTIONS=--no-deprecation payload generate:importmap",
|
||||||
"generate:types": "cross-env NODE_OPTIONS=--no-deprecation payload generate:types",
|
"generate:types": "cross-env NODE_OPTIONS=--no-deprecation payload generate:types",
|
||||||
"lint": "cross-env NODE_OPTIONS=--no-deprecation next lint",
|
"lint": "cross-env NODE_OPTIONS=--no-deprecation eslint --cache --cache-location .next/cache/eslint/",
|
||||||
|
"lint:fix": "cross-env NODE_OPTIONS=--no-deprecation eslint --fix",
|
||||||
"payload": "cross-env NODE_OPTIONS=--no-deprecation payload",
|
"payload": "cross-env NODE_OPTIONS=--no-deprecation payload",
|
||||||
"start": "cross-env NODE_OPTIONS=--no-deprecation next start",
|
"start": "cross-env NODE_OPTIONS=--no-deprecation next start",
|
||||||
"test": "pnpm run test:int && pnpm run test:e2e",
|
"test": "pnpm run test:int && pnpm run test:e2e",
|
||||||
|
|
@ -42,28 +43,33 @@
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"dotenv": "16.4.7",
|
"dotenv": "16.4.7",
|
||||||
"graphql": "^16.8.1",
|
"graphql": "^16.8.1",
|
||||||
"next": "15.4.11",
|
"next": "^16.1.6",
|
||||||
"payload": "3.76.1",
|
"payload": "3.76.1",
|
||||||
"react": "19.2.1",
|
"react": "^19.2.4",
|
||||||
"react-dom": "19.2.1",
|
"react-dom": "^19.2.4",
|
||||||
"sharp": "0.34.2"
|
"sharp": "0.34.2",
|
||||||
|
"tailwindcss-animate": "^1.0.7",
|
||||||
|
"tw-animate-css": "^1.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@next/eslint-plugin-next": "^16.1.6",
|
||||||
"@playwright/test": "1.58.2",
|
"@playwright/test": "1.58.2",
|
||||||
"@tailwindcss/postcss": "^4.1.18",
|
"@tailwindcss/postcss": "^4.1.18",
|
||||||
"@testing-library/react": "16.3.0",
|
"@testing-library/react": "16.3.0",
|
||||||
"@types/node": "22.19.9",
|
"@types/node": "22.19.9",
|
||||||
"@types/react": "19.2.9",
|
"@types/react": "^19.2.14",
|
||||||
"@types/react-dom": "19.2.3",
|
"@types/react-dom": "^19.2.3",
|
||||||
"@vitejs/plugin-react": "4.5.2",
|
"@vitejs/plugin-react": "4.5.2",
|
||||||
"eslint": "^9.16.0",
|
"eslint": "^9.39.2",
|
||||||
"eslint-config-next": "15.4.11",
|
"eslint-config-next": "^16.1.6",
|
||||||
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"jsdom": "28.0.0",
|
"jsdom": "28.0.0",
|
||||||
"postcss": "^8.5.6",
|
"postcss": "^8.5.6",
|
||||||
"prettier": "^3.4.2",
|
"prettier": "^3.4.2",
|
||||||
"tailwindcss": "^4.1.18",
|
"tailwindcss": "^4.1.18",
|
||||||
"tsx": "4.21.0",
|
"tsx": "4.21.0",
|
||||||
"typescript": "5.7.3",
|
"typescript": "5.7.3",
|
||||||
|
"typescript-eslint": "^8.55.0",
|
||||||
"vite-tsconfig-paths": "6.0.5",
|
"vite-tsconfig-paths": "6.0.5",
|
||||||
"vitest": "4.0.18"
|
"vitest": "4.0.18"
|
||||||
},
|
},
|
||||||
|
|
@ -77,5 +83,6 @@
|
||||||
"esbuild",
|
"esbuild",
|
||||||
"unrs-resolver"
|
"unrs-resolver"
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
"packageManager": "pnpm@10.11.0+sha512.6540583f41cc5f628eb3d9773ecee802f4f9ef9923cc45b69890fb47991d4b092964694ec3a4f738a420c918a333062c8b925d312f42e4f0c263eb603551f977"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
589
pnpm-lock.yaml
589
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
|
@ -5,7 +5,6 @@ import './styles.css'
|
||||||
import { RefreshRouteOnSave } from '@/utilities/RefreshRouteOnSave'
|
import { RefreshRouteOnSave } from '@/utilities/RefreshRouteOnSave'
|
||||||
import { Metadata } from 'next'
|
import { Metadata } from 'next'
|
||||||
import { getCachedGlobal } from '@/utilities/globals'
|
import { getCachedGlobal } from '@/utilities/globals'
|
||||||
import { Media } from '@/payload-types'
|
|
||||||
import { getCachedDocumentById } from '@/utilities/documents'
|
import { getCachedDocumentById } from '@/utilities/documents'
|
||||||
|
|
||||||
export async function generateMetadata(): Promise<Metadata> {
|
export async function generateMetadata(): Promise<Metadata> {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import { revalidateGlobal } from '@/utilities/globals'
|
import { revalidateGlobal } from '@/utilities/globals'
|
||||||
import { revalidateTag } from 'next/cache'
|
|
||||||
import type { GlobalConfig } from 'payload'
|
import type { GlobalConfig } from 'payload'
|
||||||
|
|
||||||
const slug = 'site-settings'
|
const slug = 'site-settings'
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler",
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"jsx": "preserve",
|
"jsx": "react-jsx",
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"plugins": [
|
"plugins": [
|
||||||
{
|
{
|
||||||
|
|
@ -30,15 +30,16 @@
|
||||||
"./src/payload.config.ts"
|
"./src/payload.config.ts"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"target": "ES2022",
|
"target": "ES2022"
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"next-env.d.ts",
|
"next-env.d.ts",
|
||||||
"**/*.ts",
|
"**/*.ts",
|
||||||
"**/*.tsx",
|
"**/*.tsx",
|
||||||
".next/types/**/*.ts"
|
".next/types/**/*.ts",
|
||||||
|
".next/dev/types/**/*.ts"
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules"
|
"node_modules"
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue