From dc2261984069b376414925b1d3e58bd646b93379 Mon Sep 17 00:00:00 2001 From: Shawn Date: Tue, 31 Dec 2024 15:43:16 +0900 Subject: [PATCH] refactor: refine file directory --- src/app/job/page.tsx | 4 ++-- src/app/memo/[slug]/page.tsx | 2 +- .../post/utils => app/memo/_utils}/fetchPostContent.ts | 2 +- .../post/utils => app/memo/_utils}/fetchPostImages.ts | 0 src/app/memo/_utils/getPostBySlug.ts | 4 ++-- src/app/memo/_utils/getPosts.ts | 2 +- .../post/utils => app/memo/_utils}/renderPostContent.tsx | 2 +- tsconfig.json | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) rename src/{features/post/utils => app/memo/_utils}/fetchPostContent.ts (89%) rename src/{features/post/utils => app/memo/_utils}/fetchPostImages.ts (100%) rename src/{features/post/utils => app/memo/_utils}/renderPostContent.tsx (98%) diff --git a/src/app/job/page.tsx b/src/app/job/page.tsx index 1e13d52..592dea7 100644 --- a/src/app/job/page.tsx +++ b/src/app/job/page.tsx @@ -1,5 +1,5 @@ -import { fetchPostContent } from '@/features/post/utils/fetchPostContent'; -import { renderPostContent } from '@/features/post/utils/renderPostContent'; +import { fetchPostContent } from '@/app/memo/_utils/fetchPostContent'; +import { renderPostContent } from '@/app/memo/_utils/renderPostContent'; import { sharedMetadata } from '@/libs/utils/meta'; import type { Metadata } from 'next'; diff --git a/src/app/memo/[slug]/page.tsx b/src/app/memo/[slug]/page.tsx index c3b38f3..906f7e3 100644 --- a/src/app/memo/[slug]/page.tsx +++ b/src/app/memo/[slug]/page.tsx @@ -6,7 +6,7 @@ import { PostImage } from '@/app/memo/_components/PostImage'; import { PostTag } from '@/app/memo/_components/PostTag'; import { getPostBySlug } from '@/app/memo/_utils/getPostBySlug'; import { getPosts } from '@/app/memo/_utils/getPosts'; -import { renderPostContent } from '@/features/post/utils/renderPostContent'; +import { renderPostContent } from '@/app/memo/_utils/renderPostContent'; import { getImageUrl } from '@/libs/api/cloudinary'; import { formatDate } from '@/libs/utils/date'; import { sharedMetadata } from '@/libs/utils/meta'; diff --git a/src/features/post/utils/fetchPostContent.ts b/src/app/memo/_utils/fetchPostContent.ts similarity index 89% rename from src/features/post/utils/fetchPostContent.ts rename to src/app/memo/_utils/fetchPostContent.ts index 5492c2a..f9e15b8 100644 --- a/src/features/post/utils/fetchPostContent.ts +++ b/src/app/memo/_utils/fetchPostContent.ts @@ -1,4 +1,4 @@ -import { fetchPostImages } from '@/features/post/utils/fetchPostImages'; +import { fetchPostImages } from '@/app/memo/_utils/fetchPostImages'; import { fetchBlocks } from '@/libs/api/notion/api/fetchBlocks'; import { cache } from 'react'; diff --git a/src/features/post/utils/fetchPostImages.ts b/src/app/memo/_utils/fetchPostImages.ts similarity index 100% rename from src/features/post/utils/fetchPostImages.ts rename to src/app/memo/_utils/fetchPostImages.ts diff --git a/src/app/memo/_utils/getPostBySlug.ts b/src/app/memo/_utils/getPostBySlug.ts index cab44ff..a3fc7dc 100644 --- a/src/app/memo/_utils/getPostBySlug.ts +++ b/src/app/memo/_utils/getPostBySlug.ts @@ -1,6 +1,6 @@ import { getCoverImageId } from '@/app/memo/_utils/cover'; -import { fetchPostContent } from '@/features/post/utils/fetchPostContent'; -import { fetchPostImages } from '@/features/post/utils/fetchPostImages'; +import { fetchPostContent } from '@/app/memo/_utils/fetchPostContent'; +import { fetchPostImages } from '@/app/memo/_utils/fetchPostImages'; import { fetchMemoPosts } from '@/libs/api/notion/api/fetchMemoPosts'; import { convertRichTextToPlainText } from '@/libs/api/notion/utils'; import { draftMode } from 'next/headers'; diff --git a/src/app/memo/_utils/getPosts.ts b/src/app/memo/_utils/getPosts.ts index 18dd16e..cba4d5c 100644 --- a/src/app/memo/_utils/getPosts.ts +++ b/src/app/memo/_utils/getPosts.ts @@ -1,5 +1,5 @@ import { getCoverImageId } from '@/app/memo/_utils/cover'; -import { fetchPostImages } from '@/features/post/utils/fetchPostImages'; +import { fetchPostImages } from '@/app/memo/_utils/fetchPostImages'; import { fetchMemoPosts } from '@/libs/api/notion/api/fetchMemoPosts'; import { convertRichTextToPlainText } from '@/libs/api/notion/utils'; import { draftMode } from 'next/headers'; diff --git a/src/features/post/utils/renderPostContent.tsx b/src/app/memo/_utils/renderPostContent.tsx similarity index 98% rename from src/features/post/utils/renderPostContent.tsx rename to src/app/memo/_utils/renderPostContent.tsx index 1653f2d..0f7c2eb 100644 --- a/src/features/post/utils/renderPostContent.tsx +++ b/src/app/memo/_utils/renderPostContent.tsx @@ -1,6 +1,6 @@ import type React from 'react'; import type { Block } from '@/libs/api/notion/api/fetchBlocks'; -import type { fetchPostImages } from '@/features/post/utils/fetchPostImages'; +import type { fetchPostImages } from '@/app/memo/_utils/fetchPostImages'; import { cn } from '@/libs/utils/classNames'; import { PostImage } from '@/app/memo/_components/PostImage'; import { convertRichTextToPlainText } from '@/libs/api/notion/utils'; diff --git a/tsconfig.json b/tsconfig.json index 197f515..e1b71a2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -41,5 +41,5 @@ "incremental": true }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], - "exclude": ["node_modules"] + "exclude": ["node_modules", ".next"] }