We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ca82de0 + 13602a1 commit 660657cCopy full SHA for 660657c
README.md
@@ -79,12 +79,12 @@ NEXT_PUBLIC_API_URL=http://api.domain.com
79
- Website server-side rendering framework: NextJS
80
- Package management: Webpack (included in NextJS)
81
- Transpiler: Speedy Web Compiler (included in NextJS)
82
-- State management (client): Recoil
+- State management (client): Jotai
83
- State management (server): TanStack Query
84
- HTTP interface: fetch API (part of WHATWG Web Standard)
85
- JavaScript Testing Framework: Jest
86
- React Testing Library: @testing-library/react
87
-- Browser style normalization script: Normalize
+- Browser style normalization script: Modern-normalize
88
- Stylesheet preprocessor: SCSS
89
- Stylesheet postprocessor: Postcss (included in NextJS)
90
- Postcss plugin: Autoprefixer (included in NextJS)
@@ -113,6 +113,10 @@ Root
113
├── controllers
114
├── index.ts
115
├── apiURLs.ts
116
+ ├── data
117
+ ├── states.ts
118
+ ├── types.ts
119
+ └── staticQuery.ts
120
├── net
121
└── staticQuery.ts
122
└── moreControllers.ts
codegen.js
@@ -55,16 +55,12 @@ const main = async () => {
55
const presenterTemplate = path.join(__dirname, 'templates', 'presenter.ejs');
56
const scssTemplate = path.join(__dirname, 'templates', 'scss.ejs');
57
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');
60
61
// Output
62
renderEjs(indexTemplate, name, 'index.ts');
63
renderEjs(interactorTemplate, name, `${name}Interactor.ts`);
64
renderEjs(presenterTemplate, name, `${name}Presenter.tsx`);
65
renderEjs(scssTemplate, name, `${name}.module.scss`);
66
- renderEjs(typeTemplate, name, `${name}Type.ts`);
67
- renderEjs(statesTemplate, name, `${name}States.ts`);
68
if (v && !V) renderEjs(viewTemplate, name, `${name}View.tsx`);
69
70
console.log(`Generated the component: ${name}`);
components/errors/errorsStates.ts
components/errors/errorsViewImage.tsx
@@ -1,13 +1,13 @@
1
import { useAtomValue } from 'jotai';
2
import Image from 'next/image';
3
import Link from 'next/link';
4
+import { stateErrorCode } from '../../controllers/data/states';
5
import imageSrc404 from '../../public/assets/images/404_broken_robot.png';
6
import imageSrc500 from '../../public/assets/images/500_faulty_dog.png';
7
import styles from './errors.module.scss';
-import { code } from './errorsStates';
8
9
const View = () => {
10
- const errorCode = useAtomValue(code);
+ const errorCode = useAtomValue(stateErrorCode);
11
12
return (
13
<div className={styles.errorImage}>
controllers/data/states.ts
@@ -0,0 +1,3 @@
+import { atom } from 'jotai';
+
+export const stateErrorCode = atom(500);
controllers/data/types.ts
@@ -0,0 +1 @@
+export type TypeError = { code: number; message: string };
package.json
@@ -14,22 +14,23 @@
14
"start": "next start"
15
},
16
"dependencies": {
17
- "@tanstack/react-query": "^5.64.1",
18
- "jotai": "^2.11.0",
19
- "next": "^15.1.4",
+ "@tanstack/react-query": "^5.64.2",
+ "jotai": "^2.11.1",
+ "modern-normalize": "^3.0.1",
20
+ "next": "^15.1.6",
21
"react": "^19.0.0",
22
"react-dom": "^19.0.0",
23
"sass": "^1.83.4",
24
"sharp": "^0.33.3"
25
26
"devDependencies": {
27
"@eslint/js": "^9.18.0",
- "@next/eslint-plugin-next": "^15.1.4",
28
+ "@next/eslint-plugin-next": "^15.1.6",
29
"@stylistic/eslint-plugin": "^2.13.0",
- "@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",
+ "@tanstack/react-query-devtools": "^5.64.2",
+ "@testing-library/react": "^16.2.0",
+ "@types/node": "^22.10.10",
33
+ "@types/react": "^19.0.8",
34
"@types/react-dom": "^19.0.3",
35
"ejs": "^3.1.9",
36
"eslint": "^9.18.0",
@@ -39,7 +40,7 @@
39
40
"jest-environment-jsdom": "^29.7.0",
41
"prettier": "^3.4.2",
42
"typescript": "^5.7.3",
- "typescript-eslint": "^8.20.0"
43
+ "typescript-eslint": "^8.21.0"
44
45
"browserslist": {
46
"production": [
pages/404.tsx
@@ -1,12 +1,12 @@
import { useSetAtom } from 'jotai';
import { useEffect } from 'react';
import Errors from '../components/errors';
-import { code } from '../components/errors/errorsStates';
import Meta from '../components/meta';
+import { stateErrorCode } from '../controllers/data/states';
const Error404 = () => {
const publicUrl = process.env.PUBLIC_URL || 'localhost:3000';
- const setErrorCode = useSetAtom(code);
+ const setErrorCode = useSetAtom(stateErrorCode);
useEffect(() => {
setErrorCode(404);
pages/_error.tsx
@@ -2,14 +2,12 @@ import { useSetAtom } from 'jotai';
import { NextPageContext } from 'next';
-type ErrorCodeType = { statusCode: number };
-
-const Error = ({ statusCode }: ErrorCodeType) => {
+const Error = ({ statusCode }: { statusCode: number }) => {
window.scrollTo(0, 0);
@@ -34,7 +32,7 @@ export const config = {
};
export const getServerSideProps = async ({ res, err }: NextPageContext) => {
37
- const statusCode = res ? res.statusCode : err ? err.statusCode : 404;
+ const statusCode = res ? res.statusCode : (err?.statusCode ?? 404);
38
return { props: { statusCode } };
pages/global.scss
@@ -1,5 +1,5 @@
@use '../components/theme.scss';
-@import 'https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css';
+@import '../node_modules/modern-normalize/modern-normalize.css';
@import 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css';
//@import 'https://fonts.googleapis.com/css?family=Noto+Sans+KR&display=swap';
0 commit comments