Skip to content

Commit

Permalink
Upgraded nextjs deps and configuration (#6388)
Browse files Browse the repository at this point in the history
  • Loading branch information
pnicolli authored and sneridagh committed Oct 18, 2024
1 parent ae697a8 commit 8cc1fc0
Show file tree
Hide file tree
Showing 11 changed files with 155 additions and 231 deletions.
10 changes: 0 additions & 10 deletions apps/nextjs/.eslintrc.js

This file was deleted.

9 changes: 9 additions & 0 deletions apps/nextjs/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": ["next/core-web-vitals", "next/typescript"],
"ignorePatterns": [".next/**", "dist/**", "node_modules/**"],
"settings": {
"next": {
"rootDir": "apps/nextjs/"
}
}
}
1 change: 1 addition & 0 deletions apps/nextjs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Plone Foundation
Copyright (c) 2024 Plone Foundation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions apps/nextjs/next.config.js → apps/nextjs/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const path = require('path');
import path from 'path';

/** @type {import('next').NextConfig} */
const nextConfig = {
Expand Down Expand Up @@ -46,4 +46,4 @@ const nextConfig = {
},
};

module.exports = nextConfig;
export default nextConfig;
11 changes: 6 additions & 5 deletions apps/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,22 @@
"@plone/blocks": "workspace: *",
"@plone/client": "workspace: *",
"@plone/components": "workspace: *",
"@plone/registry": "workspace: *",
"@plone/providers": "workspace: *",
"@tanstack/react-query": "^5.37.1",
"next": "14.2.2",
"@plone/registry": "workspace: *",
"@tanstack/react-query": "^5.59.0",
"next": "14.2.14",
"react": "^18",
"react-aria-components": "^1.4.0",
"react-dom": "^18"
},
"devDependencies": {
"@tanstack/react-query-devtools": "^5.37.1",
"@plone/types": "workspace: *",
"@tanstack/react-query-devtools": "^5.59.0",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "14.2.2",
"eslint-config-next": "14.2.14",
"typescript": "^5.6.3"
}
}
2 changes: 1 addition & 1 deletion apps/nextjs/src/app/Providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const Providers: React.FC<{
}),
);

let router = useRouter();
const router = useRouter();

return (
<RouterProvider navigate={router.push}>
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/src/app/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import '@plone/components/dist/basic.css';
export default function Content() {
const { getContentQuery } = usePloneClient();
const pathname = usePathname();
const { data, isLoading } = useQuery(getContentQuery({ path: pathname }));
const { data } = useQuery(getContentQuery({ path: pathname }));

if (data) {
return (
Expand Down
3 changes: 0 additions & 3 deletions apps/nextjs/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';

export function middleware(request: NextRequest) {
// Clone the request headers and set a new header `x-hello-from-middleware1`
const requestHeaders = new Headers(request.headers);
// console.log(request.nextUrl.pathname);
// requestHeaders.set('x-hello-from-middleware1', 'hello');

// You can also set request headers in NextResponse.rewrite
const response = NextResponse.next({
Expand Down
66 changes: 31 additions & 35 deletions apps/nextjs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,34 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
]
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"**/*.js",
"**/*.jx",
".next/types/**/*.ts"
"compilerOptions": {
"forceConsistentCasingInFileNames": true,
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"exclude": [
"node_modules",
]
"paths": {
"@/*": ["./src/*"]
}
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"**/*.js",
"**/*.jsx",
".next/types/**/*.ts"
],
"exclude": ["node_modules"]
}
Loading

0 comments on commit 8cc1fc0

Please sign in to comment.