Skip to content

Commit c029c2f

Browse files
remote-swe-userremote-swe-app[bot]tmokmss
authored
refactor: feature-based directory structure (#48)
# Refactoring: Feature-Based Directory Structure ## Changes - Refactored to a feature-based directory structure - Moved non-shared components and actions into feature directories - Used Next.js bracketed directory to organize code without affecting URL paths ### New Directory Structure ### Benefits 1. Separation of concerns: Related files for each feature are grouped together 2. Scalability: Easier to extend when adding new features 3. Discoverability: Easier to find code related to specific features 4. Feature independence: Features can be maintained and developed independently --------- Co-authored-by: remote-swe-app[bot] <123456+remote-swe-app[bot]@users.noreply.github.com> Co-authored-by: Masashi Tomooka <tmokmss@users.noreply.github.com>
1 parent 0fed485 commit c029c2f

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
runTranslateJobSchema,
88
updateTodoSchema,
99
updateTodoStatusSchema,
10-
} from './schemas/todo';
10+
} from './schemas';
1111
import { prisma } from '@/lib/prisma';
1212
import { revalidatePath } from 'next/cache';
1313
import { TodoItemStatus } from '@prisma/client';

webapp/src/components/CreateTodoForm.tsx renamed to webapp/src/app/(root)/components/CreateTodoForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import { useState } from 'react';
44
import { zodResolver } from '@hookform/resolvers/zod';
55
import { useHookFormAction } from '@next-safe-action/adapter-react-hook-form/hooks';
6-
import { createTodo } from '@/actions/todo';
7-
import { createTodoSchema } from '@/actions/schemas/todo';
6+
import { createTodo } from '../actions';
7+
import { createTodoSchema } from '../schemas';
88
import { toast } from 'sonner';
99
import { useEventBus } from '@/hooks/use-event-bus';
1010
import { useRouter } from 'next/navigation';

webapp/src/components/TodoItem.tsx renamed to webapp/src/app/(root)/components/TodoItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { TodoItem, TodoItemStatus } from '@prisma/client';
44
import { useState } from 'react';
55
import { useHookFormAction } from '@next-safe-action/adapter-react-hook-form/hooks';
66
import { zodResolver } from '@hookform/resolvers/zod';
7-
import { updateTodo, deleteTodo, updateTodoStatus, runTranslateJob } from '@/actions/todo';
8-
import { updateTodoSchema } from '@/actions/schemas/todo';
7+
import { updateTodo, deleteTodo, updateTodoStatus, runTranslateJob } from '../actions';
8+
import { updateTodoSchema } from '../schemas';
99
import { useAction } from 'next-safe-action/hooks';
1010
import { toast } from 'sonner';
1111

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { prisma } from '@/lib/prisma';
22
import { getSession } from '@/lib/auth';
3-
import TodoItemComponent from '@/components/TodoItem';
4-
import CreateTodoForm from '@/components/CreateTodoForm';
3+
import TodoItemComponent from './components/TodoItem';
4+
import CreateTodoForm from './components/CreateTodoForm';
55
import { TodoItemStatus } from '@prisma/client';
66
import Header from '@/components/Header';
77

0 commit comments

Comments
 (0)