Skip to content

Commit

Permalink
refactor: packages 내부 폴더 구조 변경, .prettierrc로 변경, tsconfig 내부 구조 변경 (#345
Browse files Browse the repository at this point in the history
)

* chore(prettier): .prettierrc.cjs에서 .prettierrc로 변경

* chore(configs): packages/tsconfig에서 configs/tsconfig로 변경 및 react-library.json 추가

* chore(configs): packages/eslint-config-custom에서 configs/eslint-config-anifriends로 변경

* chore(shelter, volunteer): tsconfig 변경에 따른 extends 변경

* refactor(packages): 각 항목들 모노레포화에 따른 구조 변경

* chore(package.json): dev에 concurrency 옵션 추가

* chore(pnpm): package 내부 모노레포로 구조 변경에 따른 항목들 추가

* chore(apps/package.json): @anifriends workspace library 추가

* style(shelter, volunteer): @anifriends library 추가에 따른 import 변경
  • Loading branch information
sukvvon authored Jan 16, 2024
1 parent 94eccfa commit e916816
Show file tree
Hide file tree
Showing 261 changed files with 1,556 additions and 688 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
root: true,
extends: ['custom'],
extends: ['anifriends'],
};
14 changes: 14 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"arrowParens": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"endOfLine": "auto",
"jsxSingleQuote": false,
"printWidth": 80,
"semi": true,
"singleAttributePerLine": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}
13 changes: 0 additions & 13 deletions .prettierrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion apps/shelter/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
root: true,
extends: ["custom"],
extends: ['anifriends'],
};
17 changes: 14 additions & 3 deletions apps/shelter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
"preview": "vite preview"
},
"dependencies": {
"@anifriends/apis": "workspace:*",
"@anifriends/assets": "workspace:*",
"@anifriends/components": "workspace:*",
"@anifriends/constants": "workspace:*",
"@anifriends/fonts": "workspace:*",
"@anifriends/hooks": "workspace:*",
"@anifriends/icons": "workspace:*",
"@anifriends/layout": "workspace:*",
"@anifriends/store": "workspace:*",
"@anifriends/theme": "workspace:*",
"@anifriends/utils": "workspace:*",
"@chakra-ui/react": "^2.8.1",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
Expand All @@ -23,19 +34,19 @@
"react-error-boundary": "^4.0.11",
"react-hook-form": "^7.47.0",
"react-router-dom": "^6.17.0",
"shared": "workspace:*",
"zod": "^3.22.4",
"zustand": "^4.4.4"
},
"devDependencies": {
"@anifriends/tsconfig": "workspace:*",
"@anifriends/types": "workspace:*",
"@types/node": "^20.8.10",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@vitejs/plugin-react-swc": "^3.4.0",
"eslint": "^8.45.0",
"eslint-config-custom": "workspace:*",
"eslint-config-anifriends": "workspace:*",
"msw": "^2.0.1",
"tsconfig": "workspace:*",
"typescript": "^5.0.2",
"vite": "^4.4.5"
},
Expand Down
7 changes: 4 additions & 3 deletions apps/shelter/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import Fonts from '@anifriends/fonts';
import theme from '@anifriends/theme';
import { ChakraProvider } from '@chakra-ui/react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { RouterProvider } from 'react-router-dom';
import Fonts from 'shared/fonts';
import theme from 'shared/theme';

import { router } from '@/routes';

const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 50000,
staleTime: 10 * 1000,
gcTime: 10 * 1000,
},
},
});
Expand Down
4 changes: 2 additions & 2 deletions apps/shelter/src/apis/auth.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import axiosInstance from 'shared/apis/axiosInstance';
import { axiosInstance } from '@anifriends/apis';
import type {
ChangePasswordRequestData,
CheckDuplicatedEmailRequestData,
CheckDuplicatedEmailResponseData,
SigninRequestData,
SigninResponseData,
} from 'shared/types/apis/auth';
} from '@anifriends/types';

import { SignupRequestData } from '@/types/apis/auth';

Expand Down
2 changes: 1 addition & 1 deletion apps/shelter/src/apis/recruitment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import axiosInstance from 'shared/apis/axiosInstance';
import { axiosInstance } from '@anifriends/apis';

import {
ApplicantsApprovalRequest,
Expand Down
2 changes: 1 addition & 1 deletion apps/shelter/src/apis/shelter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import axiosInstance from 'shared/apis/axiosInstance';
import { axiosInstance } from '@anifriends/apis';

import { ShelterInfo, UpdateShelterInfo } from '@/types/apis/shetler';

Expand Down
2 changes: 1 addition & 1 deletion apps/shelter/src/apis/volunteers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import axiosInstance from 'shared/apis/axiosInstance';
import { axiosInstance } from '@anifriends/apis';

import {
VolunteerCompletedsRequestParams,
Expand Down
2 changes: 1 addition & 1 deletion apps/shelter/src/pages/animals/detail/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useDetailHeaderStore } from '@anifriends/store';
import { useEffect } from 'react';
import useDetailHeaderStore from 'shared/store/detailHeaderStore';

const handleDeletePost = (postId: number) => {
// TODO: AnimalPost delete API 호출
Expand Down
2 changes: 1 addition & 1 deletion apps/shelter/src/pages/animals/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import NotReady from 'shared/components/NotReady';
import { NotReady } from '@anifriends/components';

export default function AnimalsPage() {
return <NotReady />;
Expand Down
2 changes: 1 addition & 1 deletion apps/shelter/src/pages/animals/search/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useSearchHeaderStore } from '@anifriends/store';
import { useEffect } from 'react';
import useSearchHeaderStore from 'shared/store/searchHeaderStore';

const handleSearchkeyword = (keyword: string) => {
// TODO: AnimalList 검색 API 호출
Expand Down
2 changes: 1 addition & 1 deletion apps/shelter/src/pages/chattings/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import NotReady from 'shared/components/NotReady';
import { NotReady } from '@anifriends/components';

export default function ChattingsPage() {
return <NotReady />;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ApplicantStatus } from '@anifriends/components';
import { Flex, Text } from '@chakra-ui/react';
import ApplicantStatus from 'shared/components/ApplicantStatus';

type ApplyInfoItemProps = {
currentRecuritmentCount: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Label } from '@anifriends/components';
import { PERSON_GENDER_KOR } from '@anifriends/constants';
import { getAge, updateToast } from '@anifriends/utils';
import { Button, Flex, HStack, Text, useToast, VStack } from '@chakra-ui/react';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import Label from 'shared/components/Label';
import { PERSON_GENDER_KOR } from 'shared/constants/gender';
import { getAge } from 'shared/utils/date';
import { updateToast } from 'shared/utils/toast';

import { updateShelterRecruitmentApplicant } from '@/apis/recruitment';
import CkCheck from '@/assets/CkCheck';
Expand Down
18 changes: 10 additions & 8 deletions apps/shelter/src/pages/my/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import {
InfoItem,
InfoList,
InfoTextItem,
ProfileInfo,
SettingGroup,
} from '@anifriends/components';
import { APP_TYPE } from '@anifriends/constants';
import { useAuthStore } from '@anifriends/store';
import { removeItemFromStorage } from '@anifriends/utils';
import { Box, Divider, Switch, useToast, VStack } from '@chakra-ui/react';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { ChangeEvent, Suspense, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import InfoItem from 'shared/components/InfoItem';
import InfoList from 'shared/components/InfoList';
import InfoTextItem from 'shared/components/InfoTextItem';
import ProfileInfo from 'shared/components/ProfileInfo';
import SettingGroup from 'shared/components/SettingGroup';
import APP_TYPE from 'shared/constants/appType';
import useAuthStore from 'shared/store/authStore';
import { removeItemFromStorage } from 'shared/utils/localStorage';

import { updateAddressStatusAPI } from '@/apis/shelter';
import { ShelterInfo } from '@/types/apis/shetler';
Expand Down
5 changes: 2 additions & 3 deletions apps/shelter/src/pages/my/reviews/VolunteerProfile.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import NextIcon from '@anifriends/assets/icon_review_next.svg';
import { InfoSubtext, Label } from '@anifriends/components';
import { Avatar, Box, HStack, Image, Text } from '@chakra-ui/react';
import NextIcon from 'shared/assets/icon_review_next.svg';
import InfoSubtext from 'shared/components/InfoSubtext';
import Label from 'shared/components/Label';

type VolunteerProfileprops = {
volunteerName: string;
Expand Down
7 changes: 3 additions & 4 deletions apps/shelter/src/pages/my/reviews/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { ReviewItem, ReviewItemSkeletonList } from '@anifriends/components';
import { useIntersect } from '@anifriends/hooks';
import { createFormattedTime } from '@anifriends/utils';
import { Box, Heading, VStack } from '@chakra-ui/react';
import { Suspense } from 'react';
import { useNavigate } from 'react-router-dom';
import ReviewItem from 'shared/components/ReviewItem';
import ReviewItemSkeletonList from 'shared/components/ReviewItemSkeletonList';
import useIntersect from 'shared/hooks/useIntersection';
import { createFormattedTime } from 'shared/utils/date';

import useFetchShelterReviews from './hooks/useFetchShelterReviews';
import VolunteerProfile from './VolunteerProfile';
Expand Down
2 changes: 1 addition & 1 deletion apps/shelter/src/pages/notifications/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import NotReady from 'shared/components/NotReady';
import { NotReady } from '@anifriends/components';

export default function NotificationsPage() {
return <NotReady />;
Expand Down
2 changes: 1 addition & 1 deletion apps/shelter/src/pages/settings/account/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { usePhotoUpload } from '@anifriends/hooks';
import {
Avatar,
Box,
Expand All @@ -17,7 +18,6 @@ import { zodResolver } from '@hookform/resolvers/zod';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { Suspense, useCallback, useEffect } from 'react';
import { useForm } from 'react-hook-form';
import { usePhotoUpload } from 'shared/hooks/usePhotoUpload';
import { z } from 'zod';

import { updateShelterInfo } from '@/apis/shelter';
Expand Down
19 changes: 9 additions & 10 deletions apps/shelter/src/pages/settings/password/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
import { LogoImageBox } from '@anifriends/components';
import { useToggle } from '@anifriends/hooks';
import { IoEyeOff, IoEyeSharp } from '@anifriends/icons';
import { ChangePasswordRequestData } from '@anifriends/types';
import {
newPassword,
newPasswordConfirm,
oldPassword,
} from '@anifriends/utils';
import {
Box,
Button,
Expand All @@ -14,16 +23,6 @@ import {
import { zodResolver } from '@hookform/resolvers/zod';
import { useMutation } from '@tanstack/react-query';
import { useForm } from 'react-hook-form';
import IoEyeOff from 'shared/assets/IoEyeOff';
import IoEyeSharp from 'shared/assets/IoEyeSharp';
import LogoImageBox from 'shared/components/LogoImageBox';
import useToggle from 'shared/hooks/useToggle';
import { ChangePasswordRequestData } from 'shared/types/apis/auth';
import {
newPassword,
newPasswordConfirm,
oldPassword,
} from 'shared/utils/validations';
import * as z from 'zod';

import { changeShelterPassword } from '@/apis/auth';
Expand Down
26 changes: 13 additions & 13 deletions apps/shelter/src/pages/signin/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
import AnimalfriendsLogo from '@anifriends/assets/image-anifriends-logo.png';
import { APP_TYPE } from '@anifriends/constants';
import { useToggle } from '@anifriends/hooks';
import { IoEyeOff, IoEyeSharp } from '@anifriends/icons';
import { useAuthStore } from '@anifriends/store';
import type { SigninRequestData } from '@anifriends/types';
import {
email,
password,
removeItemFromStorage,
setItemToStorage,
updateToast,
} from '@anifriends/utils';
import {
Box,
Button,
Expand All @@ -18,19 +31,6 @@ import { useMutation } from '@tanstack/react-query';
import { useEffect, useId } from 'react';
import { useForm } from 'react-hook-form';
import { useNavigate } from 'react-router-dom';
import AnimalfriendsLogo from 'shared/assets/image-anifriends-logo.png';
import IoEyeOff from 'shared/assets/IoEyeOff';
import IoEyeSharp from 'shared/assets/IoEyeSharp';
import APP_TYPE from 'shared/constants/appType';
import useToggle from 'shared/hooks/useToggle';
import useAuthStore from 'shared/store/authStore';
import { SigninRequestData } from 'shared/types/apis/auth';
import {
removeItemFromStorage,
setItemToStorage,
} from 'shared/utils/localStorage';
import { updateToast } from 'shared/utils/toast';
import { email, password } from 'shared/utils/validations';
import * as z from 'zod';

import { signinShelter } from '@/apis/auth';
Expand Down
35 changes: 17 additions & 18 deletions apps/shelter/src/pages/signup/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
import AnimalfriendsLogo from '@anifriends/assets/image-anifriends-logo.png';
import { useToggle } from '@anifriends/hooks';
import { IoEyeOff, IoEyeSharp } from '@anifriends/icons';
import { CheckDuplicatedEmailRequestData } from '@anifriends/types';
import {
address,
addressDetail,
email,
isEmailDuplicated,
isOpenedAddress,
name,
password,
passwordConfirm,
phoneNumber,
sparePhoneNumber,
updateToast,
} from '@anifriends/utils';
import {
Box,
Button,
Expand All @@ -22,24 +39,6 @@ import { useMutation } from '@tanstack/react-query';
import { useId } from 'react';
import { Controller, useForm } from 'react-hook-form';
import { useNavigate } from 'react-router-dom';
import AnimalfriendsLogo from 'shared/assets/image-anifriends-logo.png';
import IoEyeOff from 'shared/assets/IoEyeOff';
import IoEyeSharp from 'shared/assets/IoEyeSharp';
import useToggle from 'shared/hooks/useToggle';
import { CheckDuplicatedEmailRequestData } from 'shared/types/apis/auth';
import { updateToast } from 'shared/utils/toast';
import {
address,
addressDetail,
email,
isEmailDuplicated,
isOpenedAddress,
name,
password,
passwordConfirm,
phoneNumber,
sparePhoneNumber,
} from 'shared/utils/validations';
import * as z from 'zod';

import { checkDuplicatedShelterEmail, signupShelter } from '@/apis/auth';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import {
ApplicantStatus,
Label,
LabelText,
OptionMenu,
} from '@anifriends/components';
import { Box, HStack, MenuItem, Text, VStack } from '@chakra-ui/react';
import ApplicantStatus from 'shared/components/ApplicantStatus';
import Label from 'shared/components/Label';
import LabelText from 'shared/components/LabelText';
import OptionMenu from 'shared/components/OptionMenu';

import VolunteerRecruitItemButton from '@/pages/volunteers/_components/VolunteerRecruitItemButton';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ErrorResponseData } from '@anifriends/types';
import {
InfiniteData,
infiniteQueryOptions,
UseInfiniteQueryOptions,
} from '@tanstack/react-query';
import { AxiosError, AxiosResponse } from 'axios';
import { ErrorResponseData } from 'shared/types/apis/error';

import { getShelterRecruitments } from '@/apis/recruitment';
import {
Expand Down
2 changes: 1 addition & 1 deletion apps/shelter/src/pages/volunteers/_utils/recruitment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createFormattedTime, getDDay } from 'shared/utils/date';
import { createFormattedTime, getDDay } from '@anifriends/utils';

import { Recruitment } from '@/types/apis/recruitment';

Expand Down
Loading

0 comments on commit e916816

Please sign in to comment.