From 960d44b043db1835eaf1816efb4bc4bab231fd9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=97=A4=EC=9D=B8?= <157036488+Hain-tain@users.noreply.github.com> Date: Wed, 24 Jul 2024 16:16:36 +0900 Subject: [PATCH 1/5] =?UTF-8?q?fix(pages):=20Text=20Title=EC=97=90=20color?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/Template.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/Template.tsx b/frontend/src/pages/Template.tsx index cf206b7cc..d0669175b 100644 --- a/frontend/src/pages/Template.tsx +++ b/frontend/src/pages/Template.tsx @@ -36,7 +36,9 @@ const Template = () => { <> - {template.title} + + {template.title} + {formatRelativeTime(template.modifiedAt)} From 8fe67bb350d1faaaba62cc92d3c73d73f65a746e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=97=A4=EC=9D=B8?= <157036488+Hain-tain@users.noreply.github.com> Date: Wed, 24 Jul 2024 16:20:17 +0900 Subject: [PATCH 2/5] =?UTF-8?q?chore:=20CI=EC=97=90=20Type=20Checking=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80,=20packge.json=20=EC=8A=A4=ED=81=AC=EB=A6=BD?= =?UTF-8?q?=ED=8A=B8=20tsc=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20start=20=3D>?= =?UTF-8?q?=20dev=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/frontend_ci.yml | 4 ++++ frontend/package.json | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/frontend_ci.yml b/.github/workflows/frontend_ci.yml index efd1f4b6d..6ecc33bda 100644 --- a/.github/workflows/frontend_ci.yml +++ b/.github/workflows/frontend_ci.yml @@ -22,6 +22,10 @@ jobs: run: npm install working-directory: ${{ env.frontend-directory }} + - name: Run Type Checking + run: npm tsc + working-directory: ${{ env.frontend-directory }} + - name: Run Tests run: npm test working-directory: ${{ env.frontend-directory }} diff --git a/frontend/package.json b/frontend/package.json index 47f15d7ab..78d9d9f99 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -5,7 +5,8 @@ "main": "index.js", "scripts": { "test": "jest", - "start": "webpack serve --mode development", + "dev": "webpack serve --mode development", + "tsc": "npx tsc --noEmit", "build": "webpack --mode production", "storybook": "storybook dev -p 6006", "build-storybook": "storybook build", From 23ee7e92e11e2c826d68d0dfecd6f485eb5f5a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=97=A4=EC=9D=B8?= <157036488+Hain-tain@users.noreply.github.com> Date: Wed, 24 Jul 2024 16:23:03 +0900 Subject: [PATCH 3/5] =?UTF-8?q?refactor(src):=20contentSummary=20=3D>=20th?= =?UTF-8?q?umbnailContent=20=EB=A1=9C=20=ED=95=84=EB=93=9C=EB=AA=85=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/TemplateItem/TemplateItem.tsx | 2 +- frontend/src/mocks/templateList.json | 10 +++++----- frontend/src/types/template.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/TemplateItem/TemplateItem.tsx b/frontend/src/components/TemplateItem/TemplateItem.tsx index 0e1b03095..baed974ef 100644 --- a/frontend/src/components/TemplateItem/TemplateItem.tsx +++ b/frontend/src/components/TemplateItem/TemplateItem.tsx @@ -29,7 +29,7 @@ const TemplateItem = ({ item }: Props) => { }, }} > - {thumbnailSnippet.contentSummary} + {thumbnailSnippet.thumbnailContent} {formatRelativeTime(modifiedAt)} diff --git a/frontend/src/mocks/templateList.json b/frontend/src/mocks/templateList.json index 4a16229ec..45793b131 100644 --- a/frontend/src/mocks/templateList.json +++ b/frontend/src/mocks/templateList.json @@ -5,7 +5,7 @@ "title": "title1", "thumbnailSnippet": { "filename": "title1.java", - "contentSummary": "import { Flex } from '@/components/Flex';\nimport { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';\nimport { monokaiSublime } from 'react-syntax-highlighter/dist/esm/styles/hljs';\n\nconst Template = () => {\n const content = '';\n return (\n <>\n \n

회원 가입 검증

" + "thumbnailContent": "import { Flex } from '@/components/Flex';\nimport { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';\nimport { monokaiSublime } from 'react-syntax-highlighter/dist/esm/styles/hljs';\n\nconst Template = () => {\n const content = '';\n return (\n <>\n \n

회원 가입 검증

" }, "modifiedAt": "2024-07-11 12:34" }, @@ -14,7 +14,7 @@ "title": "title2", "thumbnailSnippet": { "filename": "title1.java", - "contentSummary": "public class ......" + "thumbnailContent": "public class ......" }, "modifiedAt": "2024-07-10 12:34" }, @@ -23,7 +23,7 @@ "title": "title3", "thumbnailSnippet": { "filename": "title1.java", - "contentSummary": "const GlobalStyles = () => {" + "thumbnailContent": "const GlobalStyles = () => {" }, "modifiedAt": "2024-07-09 12:34" }, @@ -32,7 +32,7 @@ "title": "title4", "thumbnailSnippet": { "filename": "title1.java", - "contentSummary": "public class ......" + "thumbnailContent": "public class ......" }, "modifiedAt": "2024-07-08 12:34" }, @@ -41,7 +41,7 @@ "title": "title5", "thumbnailSnippet": { "filename": "title1.java", - "contentSummary": "public class ......" + "thumbnailContent": "public class ......" }, "modifiedAt": "2024-07-07 12:34" } diff --git a/frontend/src/types/template.ts b/frontend/src/types/template.ts index dfd3c5151..4700f7820 100644 --- a/frontend/src/types/template.ts +++ b/frontend/src/types/template.ts @@ -17,7 +17,7 @@ export interface TemplateListItem { title: string; thumbnailSnippet: { filename: string; - contentSummary: string; + thumbnailContent: string; }; modifiedAt: string; } From 04ded6ea704cbbc40c4af871d85c5b2fa8979f22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=97=A4=EC=9D=B8?= <157036488+Hain-tain@users.noreply.github.com> Date: Wed, 24 Jul 2024 16:33:35 +0900 Subject: [PATCH 4/5] =?UTF-8?q?feat(routes):=20basename=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/routes/router.tsx | 41 ++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/frontend/src/routes/router.tsx b/frontend/src/routes/router.tsx index 3afe161da..0d1f571b6 100644 --- a/frontend/src/routes/router.tsx +++ b/frontend/src/routes/router.tsx @@ -4,24 +4,27 @@ import Template from '@/pages/Template'; import TemplateList from '@/pages/TemplateList'; import TemplateUpload from '@/pages/TemplateUpload'; -const router = createBrowserRouter([ - { - element: , - children: [ - { - path: '/', - element: , - }, - { - path: 'templates/:id', - element: