From 5abffd75981685bb43cdb0b3974cb3b01f27b624 Mon Sep 17 00:00:00 2001 From: h-takeyeah <61489178+h-takeyeah@users.noreply.github.com> Date: Tue, 16 Apr 2024 21:32:14 +0900 Subject: [PATCH 1/2] fix: move texts to public dir in order to fix not found error --- typing-app/{src/assets => public}/texts/text1.txt | 0 typing-app/{src/assets => public}/texts/text2.txt | 0 typing-app/{src/assets => public}/texts/text3.txt | 0 typing-app/{src/assets => public}/texts/text4.txt | 0 typing-app/{src/assets => public}/texts/text5.txt | 0 typing-app/{src/assets => public}/texts/text6.txt | 0 typing-app/src/app/game/page.tsx | 6 ++++-- 7 files changed, 4 insertions(+), 2 deletions(-) rename typing-app/{src/assets => public}/texts/text1.txt (100%) rename typing-app/{src/assets => public}/texts/text2.txt (100%) rename typing-app/{src/assets => public}/texts/text3.txt (100%) rename typing-app/{src/assets => public}/texts/text4.txt (100%) rename typing-app/{src/assets => public}/texts/text5.txt (100%) rename typing-app/{src/assets => public}/texts/text6.txt (100%) diff --git a/typing-app/src/assets/texts/text1.txt b/typing-app/public/texts/text1.txt similarity index 100% rename from typing-app/src/assets/texts/text1.txt rename to typing-app/public/texts/text1.txt diff --git a/typing-app/src/assets/texts/text2.txt b/typing-app/public/texts/text2.txt similarity index 100% rename from typing-app/src/assets/texts/text2.txt rename to typing-app/public/texts/text2.txt diff --git a/typing-app/src/assets/texts/text3.txt b/typing-app/public/texts/text3.txt similarity index 100% rename from typing-app/src/assets/texts/text3.txt rename to typing-app/public/texts/text3.txt diff --git a/typing-app/src/assets/texts/text4.txt b/typing-app/public/texts/text4.txt similarity index 100% rename from typing-app/src/assets/texts/text4.txt rename to typing-app/public/texts/text4.txt diff --git a/typing-app/src/assets/texts/text5.txt b/typing-app/public/texts/text5.txt similarity index 100% rename from typing-app/src/assets/texts/text5.txt rename to typing-app/public/texts/text5.txt diff --git a/typing-app/src/assets/texts/text6.txt b/typing-app/public/texts/text6.txt similarity index 100% rename from typing-app/src/assets/texts/text6.txt rename to typing-app/public/texts/text6.txt diff --git a/typing-app/src/app/game/page.tsx b/typing-app/src/app/game/page.tsx index ecaa917..658e5e5 100644 --- a/typing-app/src/app/game/page.tsx +++ b/typing-app/src/app/game/page.tsx @@ -1,10 +1,12 @@ import GamePage from "@/components/pages/Game"; import fs from "fs"; + +const filenames = fs.readdirSync("public/texts/"); + export default function Typing() { - const filenames = fs.readdirSync("src/assets/texts/"); const subjectText = fs.readFileSync( - `src/assets/texts/${filenames[Math.floor(Math.random() * filenames.length)]}`, + `public/texts/${filenames[Math.floor(Math.random() * filenames.length)]}`, "utf-8" ); From 45376bbf21d85c5ef0478f39e99ea5c2d8e6d049 Mon Sep 17 00:00:00 2001 From: h-takeyeah <61489178+h-takeyeah@users.noreply.github.com> Date: Tue, 16 Apr 2024 21:43:53 +0900 Subject: [PATCH 2/2] =?UTF-8?q?style:=20prettier=20=E3=82=92=E9=81=A9?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typing-app/src/app/game/page.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/typing-app/src/app/game/page.tsx b/typing-app/src/app/game/page.tsx index 658e5e5..7577daf 100644 --- a/typing-app/src/app/game/page.tsx +++ b/typing-app/src/app/game/page.tsx @@ -1,7 +1,6 @@ import GamePage from "@/components/pages/Game"; import fs from "fs"; - const filenames = fs.readdirSync("public/texts/"); export default function Typing() {