Skip to content

Commit 9ed9a9e

Browse files
upgrade to Next.js 15 (#635)
* upgrade to Next.js 15 * added vercel analytics
1 parent bcab44b commit 9ed9a9e

35 files changed

+12303
-9439
lines changed

.eslintrc.json

Lines changed: 76 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
11
{
2-
"extends": [
3-
"next/core-web-vitals",
4-
"airbnb",
5-
"airbnb-typescript",
6-
"airbnb/hooks",
7-
"prettier",
8-
"plugin:@typescript-eslint/recommended",
9-
"plugin:@typescript-eslint/recommended-requiring-type-checking"
10-
],
11-
"plugins": ["react", "@typescript-eslint", "prettier"],
12-
"env": {
2+
"extends": [
3+
"next/core-web-vitals",
4+
"airbnb",
5+
"airbnb-typescript",
6+
"prettier",
7+
"plugin:@typescript-eslint/recommended"
8+
],
9+
"plugins": ["react", "@typescript-eslint", "prettier"],
10+
"env": {
1311
"browser": true,
14-
"es2021": true,
12+
"es2023": true,
1513
"node": true
16-
},
17-
"parser": "@typescript-eslint/parser",
18-
"parserOptions": {
19-
"project": "./tsconfig.json",
20-
"ecmaFeatures": {
21-
"jsx": true
22-
},
23-
"ecmaVersion": 13,
14+
},
15+
"parser": "@typescript-eslint/parser",
16+
"parserOptions": {
17+
"project": "./tsconfig.json",
18+
"ecmaFeatures": {
19+
"jsx": true
20+
},
21+
"ecmaVersion": "latest",
2422
"sourceType": "module"
25-
},
26-
"rules": {
23+
},
24+
"rules": {
2725
"@typescript-eslint/no-misused-promises": [
28-
"error",
29-
{
30-
"checksConditionals": false,
31-
"checksVoidReturn": false
32-
}
26+
"error",
27+
{
28+
"checksConditionals": false,
29+
"checksVoidReturn": false
30+
}
3331
],
3432
"no-underscore-dangle": "off",
3533
"react/react-in-jsx-scope": "off",
@@ -40,61 +38,68 @@
4038
"import/prefer-default-export": "off",
4139
"no-param-reassign": "off",
4240
"import/extensions": [
43-
"error",
44-
"ignorePackages",
45-
{
46-
"ts": "never",
47-
"tsx": "never"
48-
}
41+
"error",
42+
"ignorePackages",
43+
{
44+
"ts": "never",
45+
"tsx": "never"
46+
}
4947
],
5048
"import/no-unresolved": "error",
5149
"consistent-return": "off",
5250
"arrow-body-style": "off",
5351
"prefer-arrow-callback": "off",
54-
"react/jsx-filename-extension": "off",
52+
"react/jsx-filename-extension": ["error", { "extensions": [".tsx", ".jsx"] }],
5553
"react/function-component-definition": [
56-
"error",
57-
{
58-
"namedComponents": "arrow-function",
59-
"unnamedComponents": "arrow-function"
60-
}
54+
"error",
55+
{
56+
"namedComponents": "arrow-function",
57+
"unnamedComponents": "arrow-function"
58+
}
6159
],
6260
"prettier/prettier": "warn",
63-
"jsx-a11y/anchor-is-valid": [ "error", {
64-
"components": [ "Link" ],
65-
"specialLink": [ "hrefLeft", "hrefRight" ],
66-
"aspects": [ "invalidHref", "preferButton" ]
67-
}],
61+
"jsx-a11y/anchor-is-valid": [
62+
"error",
63+
{
64+
"components": ["Link"],
65+
"specialLink": ["hrefLeft", "hrefRight"],
66+
"aspects": ["invalidHref", "preferButton"]
67+
}
68+
],
6869
"jsx-a11y/label-has-associated-control": [
69-
"error",
70-
{
71-
"required": {
72-
"some": ["nesting", "id"]
73-
}
74-
}
75-
],
76-
"jsx-a11y/label-has-for": [
77-
"error",
78-
{
79-
"required": {
80-
"some": ["nesting", "id"]
81-
}
82-
}
83-
],
70+
"error",
71+
{
72+
"required": {
73+
"some": ["nesting", "id"]
74+
}
75+
}
76+
],
77+
"jsx-a11y/control-has-associated-label": "off", // Added this line
8478
"@next/next/no-img-element": "off",
8579
"react/no-danger": "off",
8680
"no-void": ["error", { "allowAsStatement": true }]
87-
},
88-
"overrides": [
81+
},
82+
"settings": {
83+
"react": {
84+
"version": "detect"
85+
},
86+
"import/resolver": {
87+
"typescript": {},
88+
"node": {
89+
"extensions": [".js", ".jsx", ".ts", ".tsx"]
90+
}
91+
}
92+
},
93+
"overrides": [
8994
{
90-
"files": ["*.js"],
91-
"rules": {
92-
"@typescript-eslint/no-unsafe-assignment": "off",
93-
"@typescript-eslint/no-var-requires": "off",
94-
"@typescript-eslint/no-unsafe-call": "off",
95-
"@typescript-eslint/no-unsafe-member-access": "off",
96-
"@typescript-eslint/no-unsafe-return": "off"
97-
}
95+
"files": ["*.js"],
96+
"rules": {
97+
"@typescript-eslint/no-unsafe-assignment": "off",
98+
"@typescript-eslint/no-var-requires": "off",
99+
"@typescript-eslint/no-unsafe-call": "off",
100+
"@typescript-eslint/no-unsafe-member-access": "off",
101+
"@typescript-eslint/no-unsafe-return": "off"
102+
}
98103
}
99-
]
100-
}
104+
]
105+
}

README.md

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p align="center">
2-
<img src="https://img.shields.io/badge/node-v10.16.0-brightgreen.svg?style=flat-square" alt="node" />
3-
<img src="https://img.shields.io/badge/npm-v5.6.0-blue.svg?style=flat-square" alt="npm" />
2+
<img src="https://img.shields.io/badge/node-v18.18.0-brightgreen.svg?style=flat-square" alt="node" />
3+
<img src="https://img.shields.io/badge/npm-v9.0.0-blue.svg?style=flat-square" alt="npm" />
44
<a href="https://github.com/Vets-Who-Code/vwc-site/blob/master/LICENSE">
55
<img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square" alt="License: MIT" />
66
</a>
@@ -22,14 +22,16 @@ Hey there, Soldier! Welcome to the **Vets Who Code Web App**. This project serve
2222

2323
## What's Under The Hood 🧰
2424

25-
This app is built using a jam-packed tech stack including:
25+
This app is built using a modern tech stack including:
2626

27-
- Tailwind
28-
- Next.js
29-
- Playwright
30-
- Typescript
31-
- MDX
32-
- Lerna architecture
27+
- Next.js 15
28+
- TypeScript
29+
- Tailwind CSS
30+
- Playwright for testing
31+
- MDX for content
32+
- shadcn/ui components
33+
- Server Actions
34+
- Server Components
3335

3436
### Our Mission :dart:
3537

@@ -46,10 +48,9 @@ To get a local copy up and running, you'll need a few things installed on your m
4648
### Prerequisites 🛠️
4749

4850
- [Git](http://git-scm.com/)
49-
- [Node](http://nodejs.org/)
51+
- [Node.js](http://nodejs.org/) (v18.18.0 or higher)
5052
- [NVM](https://github.com/creationix/nvm)
51-
- [Yarn](https://yarnpkg.com/)
52-
- [NextJS](https://nextjs.org/)
53+
- [pnpm](https://pnpm.io/) (recommended) or npm
5354

5455
### Installation Steps :wrench:
5556

@@ -58,16 +59,16 @@ Fire up your terminal and run:
5859
```sh
5960
$ git clone https://github.com/Vets-Who-Code/vets-who-code-app.git
6061
$ cd vets-who-code-app
61-
$ nvm install
62-
$ yarn add
62+
$ nvm use
63+
$ npm install
6364
$ npm run dev
6465
```
6566

66-
And boom! Navigate to `http://localhost:3000/` to see the app.
67+
Navigate to `http://localhost:3000/` to see the app in action.
6768

6869
## Development using Dev Container (Optional) 🐳
6970

70-
We have a development container to help you quickly set up your dev environment. This is completely optional but can make getting started easier.
71+
We support development containers for an easier setup experience.
7172

7273
### Requirements
7374

@@ -87,15 +88,11 @@ We have a development container to help you quickly set up your dev environment.
8788
2. **Open in VS Code**
8889

8990
- Open the root directory in VS Code.
90-
- A notification will appear asking if you would like to reopen the project in a dev container. Choose "Reopen in Container".
91-
- If you don't see the notification, open the Command Palette (`F1`) and run `Remote-Containers: Reopen in Container`.
91+
- When prompted, choose "Reopen in Container"
92+
- Or use Command Palette (`F1`) and run `Remote-Containers: Reopen in Container`.
9293

93-
3. **Wait for the Build**
94-
95-
- The dev container will build based on the `Dockerfile` and `devcontainer.json` configuration. This may take a few minutes the first time.
96-
97-
4. **Start Developing**
98-
- After the container is built, VS Code will attach to it. You're now developing inside the container!
94+
3. **Start Developing**
95+
- Once the container is built and running, you're ready to code!
9996
10097
Remember, this is optional. If you prefer to set up your development environment manually, you can continue to do so.
10198
@@ -109,4 +106,4 @@ Curious about upcoming features? Check our [Roadmap](https://github.com/orgs/Vet
109106
110107
## License :scroll:
111108
112-
This project is under the MIT License - see the [License](https://github.com/Vets-Who-Code/vwc-site/blob/master/LICENSE) for more details.
109+
This project is under the MIT License - see the [License](https://github.com/Vets-Who-Code/vwc-site/blob/master/LICENSE) for more details.

next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/basic-features/typescript for more information.
5+
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.

next.config.js

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,47 @@
11
/** @type {import('next').NextConfig} */
2+
const withPWA = require("next-pwa")({
3+
dest: "public",
4+
disable: process.env.NODE_ENV === "development",
5+
register: true,
6+
runtimeCaching: require("next-pwa/cache"),
7+
buildExcludes: [
8+
/middleware-manifest\.json$/,
9+
/middleware-runtime\.js$/,
10+
/_middleware\.js$/,
11+
/^.+\\_middleware\.js$/,
12+
],
13+
publicExcludes: ["!robots.txt"],
14+
});
15+
216
const nextConfig = {
3-
reactStrictMode: false,
17+
reactStrictMode: true,
18+
19+
webpack(config, { isServer }) {
20+
// Handle SVG files
21+
config.module.rules.push({
22+
test: /\.svg$/,
23+
use: ["@svgr/webpack"],
24+
});
25+
26+
// Handle fs fallback for client-side
27+
if (!isServer) {
28+
config.resolve.fallback = {
29+
fs: false,
30+
};
31+
}
32+
33+
return config;
34+
},
35+
36+
images: {
37+
domains: [],
38+
remotePatterns: [],
39+
},
40+
41+
experimental: {},
442
};
5-
const withPWA = require("next-pwa");
6-
const runtimeCaching = require("next-pwa/cache");
7-
const withReactSvg = require("next-react-svg");
8-
const path = require("path");
43+
44+
// Load environment variables
945
require("dotenv").config();
1046

11-
module.exports = withPWA(
12-
withReactSvg({
13-
pwa: {
14-
disable: process.env.NODE_ENV === "development",
15-
dest: "public",
16-
register: true,
17-
runtimeCaching,
18-
buildExcludes: [
19-
/\/*server\/middleware-chunks\/[0-9]*[a-z]*[A-Z]*\.js$/,
20-
/middleware-manifest\.json$/,
21-
/middleware-runtime\.js$/,
22-
/_middleware\.js$/,
23-
/^.+\\_middleware\.js$/,
24-
],
25-
publicExcludes: ["!robots.txt"],
26-
},
27-
nextConfig,
28-
include: path.resolve(__dirname, "src/assets/svgs"),
29-
webpack(config) {
30-
return config;
31-
},
32-
})
33-
);
47+
module.exports = withPWA(nextConfig);

0 commit comments

Comments
 (0)