Skip to content

Commit e823e5a

Browse files
authored
Merge pull request #104 from eruptionjs/chore/upgrade-packages
chore(project): upgrade packages (React 19 🎉)
2 parents f3b94b9 + f260474 commit e823e5a

15 files changed

+51
-148
lines changed

.eslintignore

-6
This file was deleted.

.eslintrc.cjs

-82
This file was deleted.

.prettierrc

-18
This file was deleted.

.prettierrc.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { default as eruptionPrettierConfig } from "@eruptionjs/config/prettier"
2+
export default {
3+
...eruptionPrettierConfig,
4+
}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Then, Husky will start the pre-commit hook and run lint-staged, who will run `pr
5454

5555
After that, if everything is validated correctly, Husky will proceed with the commit-msg hook, where it will evaluate if your commit message is following the Conventional Commit's best practice and later run the tests of your project. If any of the tests are broken, the commit will be aborted. You must fix the tests before proceed.
5656

57-
You can also commit your files with the help of the CLI. To do so, just run `npm run commit`. From there, the CLI will assist you in the proccess. As before: if your changes fails the validation, you must fix it before proceed.
57+
You can also commit your files with the help of the CLI. To do so, just run `npm run commit`. From there, the CLI will assist you in the process. As before: if your changes fails the validation, you must fix it before proceed.
5858

5959
As a best practice, it is strongly recommended that you do not skip the validations. If you need to change the way your commit messages are written, just go to file `commitlint.config.ts` and you will find there the config needed.
6060

bun.lockb

50.7 KB
Binary file not shown.

eslint.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { default as eruptionESLintConfig } from '@eruptionjs/config/eslint'
2+
3+
export default [...eruptionESLintConfig]

package.json

+13-22
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "eruption",
33
"description": "Next Generation Boilerplate for React/Typescript, built on top of Vite ⚡️",
44
"private": false,
5-
"version": "1.11",
5+
"version": "1.12",
66
"type": "module",
77
"main": "src/main.tsx",
88
"license": "MIT",
@@ -45,36 +45,27 @@
4545
"bun": "^1.1.x"
4646
},
4747
"dependencies": {
48-
"react": "^18.x",
49-
"react-dom": "^18.x"
48+
"react": "^19.x",
49+
"react-dom": "^19.x"
5050
},
5151
"devDependencies": {
5252
"@commitlint/cli": "^19.x",
5353
"@commitlint/config-conventional": "^19.x",
5454
"@commitlint/prompt-cli": "^19.x",
5555
"@commitlint/types": "^19.x",
56+
"@eruptionjs/config": "^0.5.0",
5657
"@testing-library/jest-dom": "^6.x",
57-
"@testing-library/react": "^15.x",
58+
"@testing-library/react": "^16.x",
5859
"@testing-library/user-event": "^14.x",
59-
"@trivago/prettier-plugin-sort-imports": "^4.x",
6060
"@types/bun": "^1.x",
61-
"@types/react": "^18.x",
62-
"@types/react-dom": "^18.x",
63-
"@typescript-eslint/eslint-plugin": "^7.x",
64-
"@typescript-eslint/parser": "^7.x",
61+
"@types/react": "^19.x",
62+
"@types/react-dom": "^19.x",
6563
"@vitejs/plugin-react-swc": "^3.x",
66-
"@vitest/coverage-v8": "^1.x",
67-
"@vitest/ui": "^1.x",
68-
"c8": "^9.x",
69-
"eslint": "^8.x",
70-
"eslint-config-prettier": "^9.x",
71-
"eslint-plugin-import": "^2.x",
72-
"eslint-plugin-jsx-a11y": "^6.x",
73-
"eslint-plugin-prettier": "^5.x",
74-
"eslint-plugin-react": "^7.x",
75-
"eslint-plugin-react-hooks": "^4.x",
76-
"eslint-plugin-react-refresh": "^0.x",
77-
"happy-dom": "^14.x",
64+
"@vitest/coverage-v8": "^2.x",
65+
"@vitest/ui": "^2.x",
66+
"c8": "^10.x",
67+
"eslint": "^9.x",
68+
"happy-dom": "^15.x",
7869
"husky": "^9.x",
7970
"lint-staged": "^15.x",
8071
"msw": "^2.x",
@@ -87,7 +78,7 @@
8778
"vite-bundle-visualizer": "^1.x",
8879
"vite-plugin-compression2": "^1.x",
8980
"vite-plugin-qrcode": "^0.x",
90-
"vitest": "^1.x",
81+
"vitest": "^2.x",
9182
"web-vitals": "^3.x"
9283
},
9384
"msw": {

src/App/App.spec.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ describe('App', () => {
1010
expect(screen.getByText('Vite + React/TS = EruptionJS')).toBeInTheDocument()
1111
})
1212

13-
test('should return 1 when the user click one time at button', () => {
13+
test('should return 1 when the user click one time at button', async () => {
1414
render(<App />)
1515

1616
const buttonElement = screen.getByRole('button')
1717
expect(screen.queryByText('count is 0')).toBeInTheDocument()
1818

19-
userEvent.click(buttonElement)
19+
await userEvent.click(buttonElement)
2020

21-
waitFor(() => expect(screen.queryByText('count is 1')).toBeInTheDocument())
21+
await waitFor(() => expect(screen.queryByText('count is 1')).toBeInTheDocument())
2222
})
2323
})

src/App/App.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
import { useState } from 'react'
1+
import { useEffect, useState } from 'react'
22

33
import './App.css'
44
import reactLogo from './react.svg'
55

66
const App = () => {
77
const [count, setCount] = useState(0)
88

9+
useEffect(() => {
10+
console.log('count', count)
11+
}, [count])
12+
913
return (
1014
<div className="App">
1115
<div className="flex">

src/main.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import './index.css'
88
const root = createRoot(document.getElementById('root') as HTMLElement)
99

1010
if (import.meta.env.MODE === 'test') {
11-
import('@/__mocks__/browser')
11+
void import('@/__mocks__/browser')
1212
.then(({ worker }) => {
13-
worker.start()
13+
void worker.start()
1414
})
1515
.then(() => {
1616
root.render(

src/reportWebVitals.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { ReportCallback } from 'web-vitals'
1+
import { type ReportCallback } from 'web-vitals'
22

33
const reportWebVitals = (onPerfEntry?: ReportCallback) => {
44
if (onPerfEntry && onPerfEntry instanceof Function) {
5-
import('web-vitals').then(({ onCLS, onFID, onFCP, onLCP, onTTFB }) => {
5+
void import('web-vitals').then(({ onCLS, onFID, onFCP, onLCP, onTTFB }) => {
66
onCLS(onPerfEntry)
77
onFID(onPerfEntry)
88
onFCP(onPerfEntry)

tsconfig.node.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"moduleResolution": "Bundler",
77
"allowSyntheticDefaultImports": true
88
},
9-
"include": ["vite.config.ts"]
9+
"include": ["vite.config.ts", "vitest.config.ts"]
1010
}

vite.config.ts

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
/// <reference types="vitest" />
21
import react from '@vitejs/plugin-react-swc'
32
import { resolve } from 'path'
4-
import { defineConfig } from 'vite'
3+
import { type UserConfig, defineConfig } from 'vite'
54
import { compression } from 'vite-plugin-compression2'
65
import { qrcode } from 'vite-plugin-qrcode'
76

8-
// https://vitejs.dev/config/
97
export default defineConfig({
108
resolve: {
119
alias: {
@@ -25,12 +23,6 @@ export default defineConfig({
2523
exclude: [/\.(br)$/, /\.(gz)$/],
2624
}),
2725
],
28-
test: {
29-
globals: true,
30-
watch: false,
31-
environment: 'happy-dom',
32-
setupFiles: './src/setup-test.ts',
33-
},
3426
build: {
3527
sourcemap: true,
3628
target: 'esnext',
@@ -47,4 +39,4 @@ export default defineConfig({
4739
},
4840
},
4941
},
50-
})
42+
}) satisfies UserConfig

vitest.config.ts

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { defineConfig, mergeConfig } from 'vitest/config'
2+
3+
import viteConfig from './vite.config'
4+
5+
export default mergeConfig(
6+
viteConfig,
7+
defineConfig({
8+
test: {
9+
globals: true,
10+
watch: false,
11+
environment: 'happy-dom',
12+
setupFiles: './src/setup-test.ts',
13+
},
14+
}),
15+
)

0 commit comments

Comments
 (0)