Skip to content

Commit 660657c

Browse files
authored
Merge pull request #12 from junekimdev/upgrade-deps
Upgrade deps
2 parents ca82de0 + 13602a1 commit 660657c

File tree

16 files changed

+216
-233
lines changed

16 files changed

+216
-233
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ NEXT_PUBLIC_API_URL=http://api.domain.com
7979
- Website server-side rendering framework: NextJS
8080
- Package management: Webpack (included in NextJS)
8181
- Transpiler: Speedy Web Compiler (included in NextJS)
82-
- State management (client): Recoil
82+
- State management (client): Jotai
8383
- State management (server): TanStack Query
8484
- HTTP interface: fetch API (part of WHATWG Web Standard)
8585
- JavaScript Testing Framework: Jest
8686
- React Testing Library: @testing-library/react
87-
- Browser style normalization script: Normalize
87+
- Browser style normalization script: Modern-normalize
8888
- Stylesheet preprocessor: SCSS
8989
- Stylesheet postprocessor: Postcss (included in NextJS)
9090
- Postcss plugin: Autoprefixer (included in NextJS)
@@ -113,6 +113,10 @@ Root
113113
├── controllers
114114
├── index.ts
115115
├── apiURLs.ts
116+
├── data
117+
├── states.ts
118+
├── types.ts
119+
└── staticQuery.ts
116120
├── net
117121
└── staticQuery.ts
118122
└── moreControllers.ts

codegen.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,12 @@ const main = async () => {
5555
const presenterTemplate = path.join(__dirname, 'templates', 'presenter.ejs');
5656
const scssTemplate = path.join(__dirname, 'templates', 'scss.ejs');
5757
const viewTemplate = path.join(__dirname, 'templates', 'view.ejs');
58-
const typeTemplate = path.join(__dirname, 'templates', 'type.ejs');
59-
const statesTemplate = path.join(__dirname, 'templates', 'states.ejs');
6058

6159
// Output
6260
renderEjs(indexTemplate, name, 'index.ts');
6361
renderEjs(interactorTemplate, name, `${name}Interactor.ts`);
6462
renderEjs(presenterTemplate, name, `${name}Presenter.tsx`);
6563
renderEjs(scssTemplate, name, `${name}.module.scss`);
66-
renderEjs(typeTemplate, name, `${name}Type.ts`);
67-
renderEjs(statesTemplate, name, `${name}States.ts`);
6864
if (v && !V) renderEjs(viewTemplate, name, `${name}View.tsx`);
6965

7066
console.log(`Generated the component: ${name}`);

components/errors/errorsStates.ts

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

components/errors/errorsViewImage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { useAtomValue } from 'jotai';
22
import Image from 'next/image';
33
import Link from 'next/link';
4+
import { stateErrorCode } from '../../controllers/data/states';
45
import imageSrc404 from '../../public/assets/images/404_broken_robot.png';
56
import imageSrc500 from '../../public/assets/images/500_faulty_dog.png';
67
import styles from './errors.module.scss';
7-
import { code } from './errorsStates';
88

99
const View = () => {
10-
const errorCode = useAtomValue(code);
10+
const errorCode = useAtomValue(stateErrorCode);
1111

1212
return (
1313
<div className={styles.errorImage}>

controllers/data/states.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { atom } from 'jotai';
2+
3+
export const stateErrorCode = atom(500);

controllers/data/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export type TypeError = { code: number; message: string };

package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,23 @@
1414
"start": "next start"
1515
},
1616
"dependencies": {
17-
"@tanstack/react-query": "^5.64.1",
18-
"jotai": "^2.11.0",
19-
"next": "^15.1.4",
17+
"@tanstack/react-query": "^5.64.2",
18+
"jotai": "^2.11.1",
19+
"modern-normalize": "^3.0.1",
20+
"next": "^15.1.6",
2021
"react": "^19.0.0",
2122
"react-dom": "^19.0.0",
2223
"sass": "^1.83.4",
2324
"sharp": "^0.33.3"
2425
},
2526
"devDependencies": {
2627
"@eslint/js": "^9.18.0",
27-
"@next/eslint-plugin-next": "^15.1.4",
28+
"@next/eslint-plugin-next": "^15.1.6",
2829
"@stylistic/eslint-plugin": "^2.13.0",
29-
"@tanstack/react-query-devtools": "^5.64.1",
30-
"@testing-library/react": "^16.1.0",
31-
"@types/node": "^22.10.6",
32-
"@types/react": "^19.0.7",
30+
"@tanstack/react-query-devtools": "^5.64.2",
31+
"@testing-library/react": "^16.2.0",
32+
"@types/node": "^22.10.10",
33+
"@types/react": "^19.0.8",
3334
"@types/react-dom": "^19.0.3",
3435
"ejs": "^3.1.9",
3536
"eslint": "^9.18.0",
@@ -39,7 +40,7 @@
3940
"jest-environment-jsdom": "^29.7.0",
4041
"prettier": "^3.4.2",
4142
"typescript": "^5.7.3",
42-
"typescript-eslint": "^8.20.0"
43+
"typescript-eslint": "^8.21.0"
4344
},
4445
"browserslist": {
4546
"production": [

pages/404.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { useSetAtom } from 'jotai';
22
import { useEffect } from 'react';
33
import Errors from '../components/errors';
4-
import { code } from '../components/errors/errorsStates';
54
import Meta from '../components/meta';
5+
import { stateErrorCode } from '../controllers/data/states';
66

77
const Error404 = () => {
88
const publicUrl = process.env.PUBLIC_URL || 'localhost:3000';
9-
const setErrorCode = useSetAtom(code);
9+
const setErrorCode = useSetAtom(stateErrorCode);
1010

1111
useEffect(() => {
1212
setErrorCode(404);

pages/_error.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@ import { useSetAtom } from 'jotai';
22
import { NextPageContext } from 'next';
33
import { useEffect } from 'react';
44
import Errors from '../components/errors';
5-
import { code } from '../components/errors/errorsStates';
65
import Meta from '../components/meta';
6+
import { stateErrorCode } from '../controllers/data/states';
77

8-
type ErrorCodeType = { statusCode: number };
9-
10-
const Error = ({ statusCode }: ErrorCodeType) => {
8+
const Error = ({ statusCode }: { statusCode: number }) => {
119
const publicUrl = process.env.PUBLIC_URL || 'localhost:3000';
12-
const setErrorCode = useSetAtom(code);
10+
const setErrorCode = useSetAtom(stateErrorCode);
1311

1412
useEffect(() => {
1513
window.scrollTo(0, 0);
@@ -34,7 +32,7 @@ export const config = {
3432
};
3533

3634
export const getServerSideProps = async ({ res, err }: NextPageContext) => {
37-
const statusCode = res ? res.statusCode : err ? err.statusCode : 404;
35+
const statusCode = res ? res.statusCode : (err?.statusCode ?? 404);
3836
return { props: { statusCode } };
3937
};
4038

pages/global.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@use '../components/theme.scss';
2-
@import 'https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css';
2+
@import '../node_modules/modern-normalize/modern-normalize.css';
33
@import 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css';
44
//@import 'https://fonts.googleapis.com/css?family=Noto+Sans+KR&display=swap';
55

0 commit comments

Comments
 (0)