Skip to content

Commit 8d12b47

Browse files
upgrade packages
1 parent 4af00d1 commit 8d12b47

File tree

12 files changed

+1459
-1627
lines changed

12 files changed

+1459
-1627
lines changed

.babelrc

Lines changed: 0 additions & 24 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
]
6262
},
6363
"import/resolver": {
64-
"babel-module": {},
6564
"typescript": {}
6665
},
6766
"react": {

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/node_modules
33
.next
44
.vscode
5+
tsconfig.tsbuildinfo
56

67
# testing
78
/coverage

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"noSemi": true,
44
"semi": false,
55
"trailingComma": "all",
6-
"printWidth": 120,
6+
"printWidth": 120
77
}

.swcrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"jsc": {
3+
"baseUrl": ".",
4+
"paths": {
5+
"@src/*": [
6+
"./src/*"
7+
]
8+
}
9+
}
10+
}

jest.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ module.exports = {
88
globals: {
99
'ts-jest': {
1010
tsconfig: '<rootDir>/tsconfig.jest.json',
11-
babelConfig: true,
1211
diagnostics: false,
1312
},
1413
},

next-env.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/types/global" />
3+
/// <reference types="next/image-types/global" />
4+
5+
// NOTE: This file should not be edited
6+
// see https://nextjs.org/docs/basic-features/typescript for more information.

package.json

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,52 +17,45 @@
1717
"production:clean": "rimraf out/"
1818
},
1919
"dependencies": {
20-
"@chakra-ui/react": "^1.6.8",
21-
"@emotion/react": "^11.4.1",
20+
"@chakra-ui/react": "^1.6.10",
21+
"@emotion/react": "^11.5.0",
2222
"@emotion/styled": "^11.3.0",
2323
"dotenv": "^10.0.0",
24-
"framer-motion": "^4.1.17",
25-
"next": "^11.1.2",
24+
"framer-motion": "^5.0.0",
25+
"next": "^12.0.1",
2626
"react": "^17.0.2",
2727
"react-dom": "^17.0.2"
2828
},
2929
"devDependencies": {
30-
"@babel/core": "^7.15.5",
31-
"@testing-library/react": "^12.1.1",
30+
"@testing-library/react": "^12.1.2",
3231
"@types/jest": "^27.0.2",
33-
"@types/node": "^16.10.1",
34-
"@types/react": "^17.0.24",
35-
"@types/react-addons-test-utils": "^0.14.26",
36-
"@types/react-dom": "^17.0.9",
32+
"@types/node": "^16.11.6",
33+
"@types/react": "^17.0.33",
34+
"@types/react-addons-test-utils": "^15.6.0",
35+
"@types/react-dom": "^17.0.10",
3736
"@types/react-test-renderer": "^17.0.1",
38-
"@typescript-eslint/eslint-plugin": "^4.32.0",
39-
"@typescript-eslint/parser": "^4.32.0",
40-
"babel-eslint": "^10.1.0",
41-
"babel-jest": "^27.2.3",
42-
"babel-plugin-module-resolver": "^4.1.0",
37+
"@typescript-eslint/eslint-plugin": "^5.2.0",
38+
"@typescript-eslint/parser": "^5.2.0",
4339
"cross-env": "^7.0.3",
44-
"eslint": "^7.2.0",
40+
"eslint": "^8.1.0",
4541
"eslint-config-airbnb": "18.2.1",
46-
"eslint-config-airbnb-typescript": "^14.0.0",
47-
"eslint-config-next": "^11.1.2",
42+
"eslint-config-airbnb-typescript": "^14.0.1",
43+
"eslint-config-next": "^12.0.1",
4844
"eslint-config-prettier": "^8.3.0",
4945
"eslint-config-react-app": "^6.0.0",
50-
"eslint-import-resolver-babel-module": "^5.3.1",
5146
"eslint-import-resolver-typescript": "^2.5.0",
52-
"eslint-plugin-flowtype": "^6.1.0",
53-
"eslint-plugin-import": "^2.24.2",
54-
"eslint-plugin-jest": "^24.4.3",
47+
"eslint-plugin-import": "^2.25.2",
48+
"eslint-plugin-jest": "^25.2.2",
5549
"eslint-plugin-jsx-a11y": "^6.4.1",
5650
"eslint-plugin-prettier": "^4.0.0",
57-
"eslint-plugin-react": "^7.21.5",
51+
"eslint-plugin-react": "^7.26.1",
5852
"eslint-plugin-react-hooks": "^4.2.0",
59-
"jest": "^27.2.3",
53+
"jest": "^27.3.1",
6054
"npm-run-all": "^4.1.5",
6155
"prettier": "^2.4.1",
62-
"react-addons-test-utils": "^15.6.2",
6356
"rimraf": "^3.0.2",
64-
"ts-jest": "^27.0.5",
65-
"typescript": "^4.4.3",
57+
"ts-jest": "^27.0.7",
58+
"typescript": "^4.4.4",
6659
"yarn-or-npm": "^3.0.1"
6760
}
6861
}

readme.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,56 @@ All source code is located in the `src/` directory:
4747

4848
If you feel like changing the directory structure, please change the appropriate settings in the following files:
4949

50-
- `.babelrc`
50+
- `.swcrc`
5151
- `jest.config.js`
5252
- `tsconfig.json`
5353
- The `lint` and the `format` scripts in `package.json`
5454

5555
## Note
5656

5757
1. This project removes the `x-powered-by` response header via `next.config.js` by marking the `poweredByHeader` property as `false`.
58+
59+
2. If you wish to use Babel instead of SWC (introduced with the Next.js v12 upgrade), please remove the `.swcrc` file and add a `.babelrc` file at the root with the following:
60+
61+
```
62+
{
63+
"presets": [
64+
"next/babel"
65+
],
66+
"plugins": [
67+
[
68+
"module-resolver",
69+
{
70+
"root": [
71+
"./"
72+
],
73+
"alias": {
74+
"@src": "./src"
75+
},
76+
"extensions": [
77+
".js",
78+
".jsx",
79+
".ts",
80+
".tsx"
81+
]
82+
}
83+
]
84+
]
85+
}
86+
```
87+
88+
Then, open `./jest.config.js` and find the `globals` config. Add `babelConfig` to it, like so:
89+
90+
```
91+
{
92+
globals: {
93+
'ts-jest': {
94+
tsconfig: '<rootDir>/tsconfig.jest.json',
95+
babelConfig: true,
96+
diagnostics: false,
97+
},
98+
},
99+
}
100+
```
101+
102+
Also, run `yarn add -D @babel/core babel-plugin-module-resolver eslint-import-resolver-babel-module` to install Babel's dependencies.

src/pages/_app.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/* eslint-disable react/jsx-props-no-spreading */
22
import React from 'react'
3-
import { AppProps } from 'next/app'
3+
// import { AppProps } from 'next/app'
44
import { ChakraProvider } from '@chakra-ui/react'
55

66
import ChakraTheme from '@src/styles/chakra-theme'
77

8-
const App = ({ Component, pageProps }: AppProps) => (
8+
const App = ({ Component, pageProps }: any) => (
99
<ChakraProvider theme={ChakraTheme}>
1010
<Component {...pageProps} />
1111
</ChakraProvider>

0 commit comments

Comments
 (0)