Skip to content

Commit 83f3eda

Browse files
authored
feat: updates next from 14.2.15 to 15.0.2, eslint 9, flatfile, react 19 (#57)
1 parent e2419c4 commit 83f3eda

38 files changed

+9371
-3160
lines changed

.env.default

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
JEST_TEST_IN_TEST=d1
2+
JEST_TEST_VARIABLE=d2
3+
REACT_APP_JEST_TEST_IN_TEST=d3
4+
REACT_APP_JEST_TEST_VARIABLE=d4

.env.test

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
JEST_TEST_IN_TEST=t1
2+
JEST_TEST_VARIABLE=t2
3+
REACT_APP_JEST_TEST_IN_TEST=t3
4+
REACT_APP_JEST_TEST_VARIABLE=t4

.eslintrc.json

-3
This file was deleted.

.github/pull_request_template.md

-1
This file was deleted.

.github/workflows/build.yml

+10-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@ jobs:
1717
run: |
1818
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
1919
sudo apt-get install -y nodejs
20-
- name: Install pnpm and dependencies
20+
- name: Restore NPM node_modules
21+
uses: actions/cache/restore@v4.1.2
22+
with:
23+
path: node_modules
24+
key: ${{ runner.os }}-node_modules-${{ hashFiles('yarn.lock') }}
25+
restore-keys: |
26+
${{ runner.os }}-node_modules-
27+
- name: Install deps
2128
run: |
2229
corepack enable
2330
corepack prepare pnpm@latest --activate
@@ -26,9 +33,9 @@ jobs:
2633
uses: actions/cache@v4.1.2
2734
with:
2835
path: node_modules
29-
key: ${{ runner.os }}-node-${{ hashFiles('pnpm-lock.yaml') }}
36+
key: ${{ runner.os }}-node_modules-${{ hashFiles('pnpm-lock.yaml') }}
3037
restore-keys: |
31-
${{ runner.os }}-node-
38+
${{ runner.os }}-node_modules-
3239
- name: Disable Next.js Telemetry
3340
run: echo "NEXT_TELEMETRY_DISABLED=1" >> "$GITHUB_ENV"
3441
- name: Run build

.github/workflows/deploy.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ jobs:
3333
run: echo "NEXT_TELEMETRY_DISABLED=1" >> "$GITHUB_ENV"
3434
- name: Run build
3535
run: pnpm run build
36-
- uses: aws-actions/configure-aws-credentials@v4.0.2
36+
- name: Assume role using OIDC
37+
uses: aws-actions/configure-aws-credentials@v4.0.2
3738
with:
3839
aws-region: ${{ secrets.AWS_REGION }}
3940
role-to-assume: ${{ secrets.AWS_ROLE }}

.gitignore

+8-34
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,9 @@
1-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2-
3-
# dependencies
4-
/node_modules
5-
/.pnp
6-
.pnp.js
7-
8-
# testing
9-
/coverage
10-
11-
# next.js
12-
/.next/
13-
/out/
14-
15-
# production
16-
/build
17-
18-
# misc
191
.DS_Store
20-
*.pem
21-
22-
# debug
23-
npm-debug.log*
24-
yarn-debug.log*
25-
yarn-error.log*
26-
27-
# local env files
28-
.env*.local
29-
30-
# vercel
31-
.vercel
32-
33-
# typescript
34-
*.tsbuildinfo
35-
next-env.d.ts
2+
.next/
3+
.swc/
4+
.env
5+
coverage/
6+
dist/
7+
logs/
8+
node_modules/
9+
out/

.mergify.yml

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
queue_rules:
22
- name: default
3+
conditions:
4+
- "#approved-reviews-by>=1"
5+
- -label~=(do-not-merge)
6+
- status-success=build
37
commit_message_template: |-
48
{{ title }} (#{{ number }})
9+
510
{{ body }}
611
merge_method: squash
712
pull_request_rules:
8-
- name: Put PRs in queue (squash)
13+
- name: Automatic merge on approval and successful build
14+
actions:
15+
delete_head_branch: {}
16+
queue:
17+
name: default
918
conditions:
10-
- base = main
1119
- "#approved-reviews-by>=1"
1220
- -label~=(do-not-merge)
1321
- status-success=build
14-
actions:
15-
delete_head_branch:
16-
queue:
17-
merge_method: squash
1822
- name: Label core contributions
1923
actions:
2024
label:

.node-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.7.0

.vscode/extensions.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"recommendations": [
3+
"csstools.postcss", // PostCSS support for Tailwind and other CSS processing
4+
"dbaeumer.vscode-eslint", // ESLint integration for linting and formatting
5+
"eamodio.gitlens", // Enhanced Git features and Git history tracking
6+
"firsttris.vscode-jest-runner", // Jest integration to run tests
7+
"formulahendry.auto-close-tag", // Auto close tags for HTML/JSX
8+
"formulahendry.auto-rename-tag", // Auto rename paired HTML/JSX tags
9+
"foxundermoon.shell-format", // Shell script and dotenv file formatting
10+
"github.vscode-pull-request-github", // GitHub integration for pull requests
11+
"ms-vscode.vscode-typescript-next", // TypeScript and JavaScript tooling
12+
"streetsidesoftware.code-spell-checker", // Spell checker for documentation, code comments, etc.
13+
"syler.sass-indented", // SASS and CSS formatting support
14+
"vscode.typescript-language-features", // TypeScript language features
15+
"yzhang.markdown-all-in-one" // Markdown support for editing README and documentation
16+
]
17+
}

.vscode/settings.json

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"[ignore]": {
3+
"editor.defaultFormatter": "foxundermoon.shell-format"
4+
},
5+
"[dotenv]": {
6+
"editor.defaultFormatter": "foxundermoon.shell-format"
7+
},
8+
"[json]": {
9+
"editor.defaultFormatter": "vscode.json-language-features"
10+
},
11+
"[css]": {
12+
"editor.defaultFormatter": "vscode.css-language-features"
13+
},
14+
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
15+
"editor.formatOnSave": true,
16+
"editor.codeActionsOnSave": {
17+
"source.fixAll.eslint": "always",
18+
"source.organizeImports": "never"
19+
},
20+
"eslint.validate": [
21+
"javascript",
22+
"javascriptreact",
23+
"typescript",
24+
"typescriptreact",
25+
"markdown",
26+
"json",
27+
"jsonc",
28+
"yaml",
29+
"xml",
30+
"html"
31+
],
32+
"typescript.tsdk": "node_modules/typescript/lib",
33+
"typescript.format.enable": false,
34+
"jest.runMode": "on-demand",
35+
"editor.tabSize": 2,
36+
"files.associations": {
37+
"*.test.tsx": "typescriptreact",
38+
"*.test.ts": "typescript"
39+
},
40+
"typescript.suggest.autoImports": true,
41+
"typescript.preferences.importModuleSpecifier": "relative",
42+
"typescript.referencesCodeLens.enabled": true,
43+
"typescript.updateImportsOnFileMove.enabled": "always",
44+
}

README.md

+25-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,36 @@
1-
P6M7G8.com website
1+
p6m7g8.com Website
22

33
# p6m7g8.com Website
44

55
## Table of Contents
66

77
- [p6m7g8.com Website](#p6m7g8com-website)
88
- [Table of Contents](#table-of-contents)
9+
- [Summary](#summary)
10+
- [Local dev](#local-dev)
11+
- [Build](#build)
912
- [Author](#author)
1013

11-
## Author
14+
## Summary
15+
16+
- Next v15
17+
- Typescript
18+
- React
19+
- Tailwind
20+
- Eslint v9 w/ Flatfile
21+
22+
### Local dev
23+
24+
```bash
25+
pnpm run dev
26+
```
1227

13-
Philip M . Gollucci <pgollucci@p6m7g8.com>
28+
### Build
29+
30+
```bash
31+
npx run build
32+
```
33+
34+
## Author
1435

36+
Philip M . Gollucci <philip@p6m7g8.com>

SECURITY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ Only HEAD.
66

77
## Reporting a Vulnerability
88

9-
Email security@gollucci.com
9+
Email security@p6m7g8.com

eslint.config.mjs

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import antfu from '@antfu/eslint-config'
2+
import nextPlugin from '@next/eslint-plugin-next'
3+
import react from 'eslint-plugin-react'
4+
import reactHooks from 'eslint-plugin-react-hooks'
5+
import tailwindcss from 'eslint-plugin-tailwindcss'
6+
7+
export default antfu({
8+
ignores: [
9+
'.github/',
10+
'.mergify.yml',
11+
'.pnpm-store/',
12+
'.vscode',
13+
'next-env.d.ts',
14+
'out/',
15+
'package.json',
16+
'src/dotenv.ts',
17+
'src/pages/index.tsx',
18+
'tsconfig.json',
19+
],
20+
plugins: {
21+
react,
22+
'react-hooks': reactHooks,
23+
'next': nextPlugin,
24+
tailwindcss,
25+
},
26+
extends: ['next/core-web-vitals'],
27+
languageOptions: {
28+
ecmaVersion: 'latest',
29+
parserOptions: {
30+
ecmaFeatures: {
31+
jsx: true,
32+
},
33+
},
34+
},
35+
rules: {
36+
'react/jsx-uses-react': 'off',
37+
'react/react-in-jsx-scope': 'off',
38+
'react-hooks/rules-of-hooks': 'error',
39+
'react-hooks/exhaustive-deps': 'error',
40+
'next/no-img-element': 'error',
41+
'next/no-page-custom-font': 'error',
42+
'next/no-sync-scripts': 'error',
43+
'next/google-font-display': 'error',
44+
'next/no-css-tags': 'error',
45+
'next/no-document-import-in-page': 'error',
46+
'next/next-script-for-ga': 'error',
47+
'next/no-html-link-for-pages': 'error',
48+
'next/no-assign-module-variable': 'error',
49+
'next/no-before-interactive-script-outside-document': 'error',
50+
'tailwindcss/classnames-order': 'error',
51+
},
52+
settings: {
53+
react: {
54+
version: 'detect',
55+
},
56+
},
57+
})

jest.config.ts

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import type { Config } from 'jest'
2+
import nextJest from 'next/jest'
3+
4+
// Adjust the path to your Next.js app's root directory
5+
const createJestConfig = nextJest({
6+
dir: './src',
7+
})
8+
9+
const customJestConfig: Config = {
10+
testEnvironment: 'jsdom',
11+
moduleNameMapper: {
12+
'^@/(.*)$': '<rootDir>/src/$1',
13+
},
14+
testMatch: ['<rootDir>/test/**/*.test.{ts,tsx}'],
15+
testPathIgnorePatterns: ['/node_modules/', '/.next/'],
16+
17+
transform: {
18+
'^.+\\.(js|jsx|ts|tsx)$': '@swc/jest',
19+
},
20+
setupFilesAfterEnv: ['<rootDir>/jest.setup.tsx'],
21+
collectCoverage: true,
22+
coverageDirectory: 'coverage',
23+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], // moduleFileExtensions must include 'js' even though I don't use them
24+
}
25+
26+
export default createJestConfig(customJestConfig)

jest.setup.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import type { ReactNode } from 'react'
2+
import dotenv from 'dotenv'
3+
import React from 'react'
4+
5+
import '@testing-library/jest-dom'
6+
7+
dotenv.config({ path: '.env.test' })
8+
9+
jest.mock('next/head', () => {
10+
return ({ children }: { children: ReactNode }) => <>{children}</>
11+
})

next-env.d.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.

next.config.js

-7
This file was deleted.

next.config.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import type { NextConfig } from 'next'
2+
3+
const config: NextConfig = {
4+
images: {
5+
unoptimized: true,
6+
},
7+
output: 'export',
8+
}
9+
10+
export default config

0 commit comments

Comments
 (0)