Skip to content

Commit

Permalink
🆙 Update dependencies (nextjs14) (#22)
Browse files Browse the repository at this point in the history
* 🆙 Update dependencies (nextjs14)

* Fix nginx config for ws error

https://gist.github.com/kocisov/2a9567eb51b83dfef48efce02ef3ab06

* Fix `Warning: Extra attributes from the server: class,style` in console

It looks like this is a bug in shadcn w/ next-themes

cf.
shadcn/next-contentlayer#7

* ♻️ Stop using `src` directory for Next.js

* Add Makefile target `update` to update dependencies

* Fix frontend Dockerfile to copy package-lock.json (Fix #20)
  • Loading branch information
usatie authored Nov 2, 2023
1 parent c217896 commit 9cce0e9
Show file tree
Hide file tree
Showing 30 changed files with 345 additions and 252 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@ prod:
.PHONY: fmt
fmt:
npx prettier --write frontend/src backend/src

.PHONY: update
update:
docker compose run frontend npx npm-check-updates -i
docker compose run backend yarn upgrade-interactive
8 changes: 4 additions & 4 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@
"typescript": "^5.1.3"
},
"jest": {
"moduleNameMapper": {
"^src/(.*)$": "<rootDir>/$1"
},
"moduleNameMapper": {
"^src/(.*)$": "<rootDir>/$1"
},
"moduleFileExtensions": [
"js",
"json",
"ts",
"tsx"
"tsx"
],
"rootDir": "src",
"testRegex": ".*\\.spec\\.ts$",
Expand Down
437 changes: 255 additions & 182 deletions backend/yarn.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ services:
web:
volumes:
- ./web/html:/var/www/playground
- ./web/nginx.conf:/etc/nginx/nginx.conf
frontend:
volumes:
- ./frontend:/app
Expand Down
2 changes: 1 addition & 1 deletion frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM node:20

WORKDIR /app

COPY package.json ./
COPY package.json package-lock.json ./
RUN npm install

COPY . .
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion frontend/src/app/layout.tsx → frontend/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function RootLayout({
children: React.ReactNode;
}) {
return (
<html lang="en">
<html lang="en" suppressHydrationWarning>
<body className={inter.className}>
<ThemeProvider
attribute="class"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export default function Nav() {
src="/vercel.svg"
alt="Vercel Logo"
className="dark:invert"
width={100}
height={24}
width={300 / 3}
height={68 / 3}
priority
/>
</li>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
114 changes: 57 additions & 57 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"@radix-ui/react-toast": "^1.1.5",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"lucide-react": "^0.288.0",
"next": "13.5.6",
"lucide-react": "^0.291.0",
"next": "14.0.1",
"next-themes": "^0.2.1",
"react": "^18",
"react-dom": "^18",
Expand All @@ -29,7 +29,7 @@
"@types/react-dom": "^18",
"autoprefixer": "^10",
"eslint": "^8",
"eslint-config-next": "13.5.6",
"eslint-config-next": "14.0.1",
"postcss": "^8",
"tailwindcss": "^3",
"typescript": "^5"
Expand Down
2 changes: 1 addition & 1 deletion frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
],
"paths": {
"@/*": ["./src/*"]
"@/*": ["./*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
Expand Down
16 changes: 16 additions & 0 deletions web/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,25 @@ http {
}
location / {
proxy_pass http://frontend:3000;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
location /api {
proxy_pass http://backend:3000;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
}
}

0 comments on commit 9cce0e9

Please sign in to comment.