Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] env 개발 환경 분리하기 #448

Merged
merged 3 commits into from
Sep 24, 2024
Merged

Conversation

eonseok-jeon
Copy link
Member

@eonseok-jeon eonseok-jeon commented Sep 15, 2024

Related Issue : Closes #447


🧑‍🎤 Summary

  • 개발 환경에 따른 env 분리

🧑‍🎤 Comment

repo를 분리하지 않아도 되게 되었어요
cloudflare에서 1개의 repo로 2개의 빌드가 가능했거든요
스크린샷 2024-09-16 오전 2 05 26

첫 번째 사이트 || 첫 번째 사이트 cloudflare url
두 번째 사이트 || 두 번째 사이트 cloudflare url

둘 다 같은 repo(현재 repo)에서 생성한 웹 페이지예요
이름은 임시로 Test라고 지었지만 이를 sopt용으로 변경하면 됩니다

이에 따라 env를 분리해주면 좋을 거 같단 생각이 들었어요

따라서
스크린샷 2024-09-16 오전 2 08 10

1. .env -> local 용 (makers용에서 api 주소만 localhost로 변경) (어차피 .gitignore에 등록되어 있어서 .env.local 이라 하진 않았어요)
2. .env.makers -> makers 용
3. .env.sopt -> sopt 용

으로 분리 했어요

실행은 아래와 같이 하면 됩니다 (물론 env 파일 총 3개 추가하셔야 해요)

1. yarn build && yarn dev -> makers 용
2. yarn build:development && yarn dev:development -> development 용
3. yarn build:sopt && yarn dev:sopt -> sopt 용

참고자료: Vite의 환경 변수와 모드 | Vite


yarn dev:sopt 하면 현재 500에러 뜨는데 이건 env 분리랑 상관 없이 그냥 코드 상에서 나는 에러예요
axios -> fetch로 변경하면서 수정해야 될 부분이 있어서 그러합니다!
이건 따로 또 이슈 파서 해결해야 할 거 같습니다!
=> 해당 PR에서 해결했습니다!

@eonseok-jeon eonseok-jeon linked an issue Sep 15, 2024 that may be closed by this pull request
Copy link

height bot commented Sep 15, 2024

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

Copy link
Member

@lydiacho lydiacho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인헀습니다 :)

그럼 저희가 그동안 fork 브랜치에서 진행했던 것처럼
main에서 분기에서 release/sopt 브랜치를 만들고

  • main -> 메이커스용 배포브랜치
  • release/sopt -> 솝트용 배포브랜치

이렇게 연결해두고
솝트 한정 하드코딩 필요한 경우 (ex-메타태그) release/sopt에서 작업하면 되는거 맞을까요?

@eonseok-jeon
Copy link
Member Author

eonseok-jeon commented Sep 23, 2024

@lydiacho

main -> 메이커스용 배포브랜치
release/sopt -> 솝트용 배포브랜치
이렇게 연결해두고
솝트 한정 하드코딩 필요한 경우 (ex-메타태그) release/sopt에서 작업하면 되는거 맞을까요?

으음,, 그렇게 할 경우 develop -> main 한 번 develop -> release/sopt 한 번 총 2번을 머지해야하니 귀찮을 거 같아서
맨 처음 방법인 isMakers 이용해서 조건부로 해줘도 될 거 같다는 생각이었어요! develop -> main 한 번만 해도 되게끔
물론 더 좋은 방법이 있다면 그 방법을 택해도 될 거 같은데 아직까지 떠오르진 않았어요 😓
더 좋은 방법 있으시면 언제든지 말씀해주세요!!

@lydiacho
Copy link
Member

@eonseok-jeon
그 브랜치 전략이 완전 베스트인데
아시다시피 그 index.html에 들어가있는 친구들이 로드되는 순서 때문에 react-async-helmet을 써도 isMakers 여부에 따라 동적 렌더링을 못해서,
그부분 어떻게 해결할지 한번 고민해보고 말씀드릴게요 !_!

@eonseok-jeon
Copy link
Member Author

@lydiacho

sopt와 sopt makers 를 둘 다 아우를 수 있는 문구로 메타 데이터를 설정해도 좋을 거 같아요! 고럼 react helmet 사용 안 해도 되니까요!

그부분 어떻게 해결할지 한번 고민해보고 말씀드릴게요 !_!

좋아유 :) 감사합니다~~

Copy link

cloudflare-workers-and-pages bot commented Sep 24, 2024

Deploying sopt-recruiting-frontend-test with  Cloudflare Pages  Cloudflare Pages

Latest commit: 791c2d2
Status: ✅  Deploy successful!
Preview URL: https://c4e1820d.sopt-recruiting-frontend-test.pages.dev
Branch Preview URL: https://feat--447-multiple-env.sopt-recruiting-frontend-test.pages.dev

View logs

Copy link
Member

@wuzoo wuzoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 ~ !!

@eonseok-jeon eonseok-jeon merged commit c349bb1 into develop Sep 24, 2024
1 check passed
@eonseok-jeon eonseok-jeon deleted the feat/#447_multiple-env branch September 24, 2024 11:01
eonseok-jeon added a commit that referenced this pull request Jan 28, 2025
* [Refactor] context provider를 컴포넌트로 분리 (#437)

* refactor: device type provider component로 분리

* chore: alias 추가

* refactor: useDeviceType 적용

* refactor: recruiting info provider component로 분리

* refactor: useRecruitingInfo 적용

* refactor: theme provider component로 분리

* refactor: useTheme 적용

* docs: 기존 파일 제거

* chore: 에러 메세지 수정

* chore: 변수명 통일

* chore: 불필요한 export 제거

* [Refactor] 번들 크기 개선 - 1 (#434)

* buil: bundle size visualizer 설치

* refactor: lottie 관련 필요 기능만 구현하기

* build: light 버전 import

* chore: lottie file size 줄이기

* [Refactor] 번들 크기 개선 - 2 (#435)

* build: date-fns locale import 범위 좁히기

* chore: 코드 복구

* [Refactor] 번들 크기 개선 - 3 (#432)

* refactor: lazy loading 적용

* refactor: dialogs들에도 lazy import 적용

* build: manual chunk 적용

* chore: visualizer 자동 open option 제거

* [Feat] 테스트 코드 초기 세팅 (#439)

* build: library 설치

* feat: lint 설정

* feat: config 설정

* feat: custom render 생성

* build: library 추가 설치

* feat: test setup 파일 추가

* chore: alias 추가

* fix: custon render option 속성 optional 하게 받기

* chore: 주석 제거

* build: test library 버전업

* fix: custom render type 수정

* feat: custom render에 memory router 추가

* feat: custom render에 query client provider 추가

* fix: fillStyle을 null로 설정할 수 없는 에러 해결

* fix: test 환경에 modal div 생성

* fix: custom render에 form provider 추가

* fix: window 함수 선언

* docs: README 수정

* [Chore] reviewer에 주용이 추가 (#443)

* chore: 주용이 추가

* [Refactor] token 필요없는 fetch custom hook 만들기 (#445)

* feat: 기존 axios instace -> fetch instance로 대체

* refactor: 기존 코드 fetch instance로 변경

* refactor: headers type 제한

* feat: instace option method type 제한

* [Refactor] ApplyPage 로직 분리 - 1 (#441)

* chore: 관심사 끼리 분류

* refactor: 페이지 이탈 alert custom hook으로 분리

* refactor: isReview 전역 변수로 빼기

* refactor: apply page loading 제거

* feat: useDialog hook 생성

* refactor: useDialog 적용

* chore: dialog들 Form Provider 바깥으로 빼기

* chore: 오타 제거

* refactor: isReview 전역변수 제거

* feat: useEventListener custom hook 제작

* refactor: useEventListener 적용

* [Feat] env 개발 환경 분리하기 (#448)

* feat: env 분리

* feat: build 명령어 분리

* fix: build 명령어 수정

* [Feat] 환경변수를 활용한 동적 메타태그 구현 (#455)

* install: react-helmet-async 설치

* feat: provider 추가

* feat: index.html에서 helmet으로 이동

* feat: URL 추가

* fix: isMakers context->env로 가져오기

* chore: 테스트용 연산자 제거

* fix: 환경변수 말고 MODE 활용

* fix: useDate 내부 isMakers도 수정

* [Refactor] fetch instance 기능 보강 (#450)

* feat: error 처리 로직 세분화를 위한 custom error 생성

* feat: params 처리

* feat: form data 처리

* refactor: instance 적용

* chore: fetcher로 이름 변경

* [Feat] browserslist 추가 (#452)

* feat: browserslist 추가

* feat: 지원되는 browser 파악하는 regex 생성

* design: 지원 안 되는 브라우저 안내 페이지 생성

* feat: browser 판단 로직 구현

* fix: supported browsers ts로 변경

* [Design] 지원 안 되는 브라우저 안내 페이지 퍼블리싱 (#464)

* design: 지원되지 않는 페이지 퍼블리싱

* fix: icon들 png -> svg 변경

* desing: 반응형 구현

* design: 중앙 정렬

* fix: 문의하기 링크 수정

* design: 높이 수정

* design: header 추가

* design: layout 추가

* design: css 수정

* design: sopt logo 변경

* fix: 비교 연산자 수정

* [Feat] 지원 안 되는 브라우저 안내 페이지 pre render 하기 (#465)

* feat: unsupported page  html 파일 생성하기

* fix: 지원 안되는 브라우저 경로 수정

* design: 문장 사이 공백 추가

* refactor: script 위치 수정

* design: css 파일 추출

* refactor: build 명령어 수정에 따른 html, css 파일 수정

* refactor: renderToStaticMarkup으로 변경

* feat: gitignore에 unsupported.html 추가

* design: css 수정

* [Refactor] lottie-react 재도입 및 patch를 이용한 번들 사이즈 감소 (#466)

* chore: 사용 안되는 컴포넌트 제거

* refactor: lottie-react로 변경

* refactor: patch를 이용하여 lottie-web/light 버전 이용

* docs: read me 수정

* [Feat] MSW 도입 (#453)

* install: msw 설치

* feat: generate worker script

* feat: msw 기본 코드 테스트

* chore: amplitude 주석처리

* chore: 주석 해제

* [Refactor] date-fns 라이브러리 제거 (#469)

* feat: isBefore, isAfter 함수 구현

* feat: differenceInSeconds 함수 구현

* feat: subMinutes 함수 구현

* feat: format 함수 구현

* remove: Intl 덜어내기

* feat: string -> Date 형변환 처리 추가

* remove: test 용 파일 삭제

* remove: date-fns 라이브러리 삭제

* feat: EEEE RegExp 추가

* fix: toDate 함수 분리

* fix: 요일 인덱스 버그 픽스

* fix: toDate 적용 및 throw Error -> console error로 수정

* fix: throw Error 코드 복구

* fix: chrome 판단 regex 수정 (#470)

* [Refactor] OpenAPI를 이용하여 api interface 추출하기 (#472)

* feat: openapi spec을 이용한 api interface 생성

* feat: api interface를 가지는 fetcher 생성

* feat: 각 api에 맞는 interface 추출하기 위한 명령어 작성

* chore: 명령어 실행

* feat: gitattributes 설정

* fix: 명령어 폴더명 수정

* fix: 빌드 에러 수정

* [Refactor] Amplitude tracking 로직 컴포넌트로 분리 (#473)

* feat: amplitude event track component 생성

* feat: Button component에 Amplitude event track component 감싸기

* refactor: amplitude event track component 적용

* fix: build error

* fix: build error

* fix: 지원되지 않는 브라우저 로직 수정

---------

Co-authored-by: lydiacho <[email protected]>
eonseok-jeon added a commit that referenced this pull request Jan 28, 2025
* [Refactor] context provider를 컴포넌트로 분리 (#437)

* refactor: device type provider component로 분리

* chore: alias 추가

* refactor: useDeviceType 적용

* refactor: recruiting info provider component로 분리

* refactor: useRecruitingInfo 적용

* refactor: theme provider component로 분리

* refactor: useTheme 적용

* docs: 기존 파일 제거

* chore: 에러 메세지 수정

* chore: 변수명 통일

* chore: 불필요한 export 제거

* [Refactor] 번들 크기 개선 - 1 (#434)

* buil: bundle size visualizer 설치

* refactor: lottie 관련 필요 기능만 구현하기

* build: light 버전 import

* chore: lottie file size 줄이기

* [Refactor] 번들 크기 개선 - 2 (#435)

* build: date-fns locale import 범위 좁히기

* chore: 코드 복구

* [Refactor] 번들 크기 개선 - 3 (#432)

* refactor: lazy loading 적용

* refactor: dialogs들에도 lazy import 적용

* build: manual chunk 적용

* chore: visualizer 자동 open option 제거

* [Feat] 테스트 코드 초기 세팅 (#439)

* build: library 설치

* feat: lint 설정

* feat: config 설정

* feat: custom render 생성

* build: library 추가 설치

* feat: test setup 파일 추가

* chore: alias 추가

* fix: custon render option 속성 optional 하게 받기

* chore: 주석 제거

* build: test library 버전업

* fix: custom render type 수정

* feat: custom render에 memory router 추가

* feat: custom render에 query client provider 추가

* fix: fillStyle을 null로 설정할 수 없는 에러 해결

* fix: test 환경에 modal div 생성

* fix: custom render에 form provider 추가

* fix: window 함수 선언

* docs: README 수정

* [Chore] reviewer에 주용이 추가 (#443)

* chore: 주용이 추가

* [Refactor] token 필요없는 fetch custom hook 만들기 (#445)

* feat: 기존 axios instace -> fetch instance로 대체

* refactor: 기존 코드 fetch instance로 변경

* refactor: headers type 제한

* feat: instace option method type 제한

* [Refactor] ApplyPage 로직 분리 - 1 (#441)

* chore: 관심사 끼리 분류

* refactor: 페이지 이탈 alert custom hook으로 분리

* refactor: isReview 전역 변수로 빼기

* refactor: apply page loading 제거

* feat: useDialog hook 생성

* refactor: useDialog 적용

* chore: dialog들 Form Provider 바깥으로 빼기

* chore: 오타 제거

* refactor: isReview 전역변수 제거

* feat: useEventListener custom hook 제작

* refactor: useEventListener 적용

* [Feat] env 개발 환경 분리하기 (#448)

* feat: env 분리

* feat: build 명령어 분리

* fix: build 명령어 수정

* [Feat] 환경변수를 활용한 동적 메타태그 구현 (#455)

* install: react-helmet-async 설치

* feat: provider 추가

* feat: index.html에서 helmet으로 이동

* feat: URL 추가

* fix: isMakers context->env로 가져오기

* chore: 테스트용 연산자 제거

* fix: 환경변수 말고 MODE 활용

* fix: useDate 내부 isMakers도 수정

* [Refactor] fetch instance 기능 보강 (#450)

* feat: error 처리 로직 세분화를 위한 custom error 생성

* feat: params 처리

* feat: form data 처리

* refactor: instance 적용

* chore: fetcher로 이름 변경

* [Feat] browserslist 추가 (#452)

* feat: browserslist 추가

* feat: 지원되는 browser 파악하는 regex 생성

* design: 지원 안 되는 브라우저 안내 페이지 생성

* feat: browser 판단 로직 구현

* fix: supported browsers ts로 변경

* [Design] 지원 안 되는 브라우저 안내 페이지 퍼블리싱 (#464)

* design: 지원되지 않는 페이지 퍼블리싱

* fix: icon들 png -> svg 변경

* desing: 반응형 구현

* design: 중앙 정렬

* fix: 문의하기 링크 수정

* design: 높이 수정

* design: header 추가

* design: layout 추가

* design: css 수정

* design: sopt logo 변경

* fix: 비교 연산자 수정

* [Feat] 지원 안 되는 브라우저 안내 페이지 pre render 하기 (#465)

* feat: unsupported page  html 파일 생성하기

* fix: 지원 안되는 브라우저 경로 수정

* design: 문장 사이 공백 추가

* refactor: script 위치 수정

* design: css 파일 추출

* refactor: build 명령어 수정에 따른 html, css 파일 수정

* refactor: renderToStaticMarkup으로 변경

* feat: gitignore에 unsupported.html 추가

* design: css 수정

* [Refactor] lottie-react 재도입 및 patch를 이용한 번들 사이즈 감소 (#466)

* chore: 사용 안되는 컴포넌트 제거

* refactor: lottie-react로 변경

* refactor: patch를 이용하여 lottie-web/light 버전 이용

* docs: read me 수정

* [Feat] MSW 도입 (#453)

* install: msw 설치

* feat: generate worker script

* feat: msw 기본 코드 테스트

* chore: amplitude 주석처리

* chore: 주석 해제

* [Refactor] date-fns 라이브러리 제거 (#469)

* feat: isBefore, isAfter 함수 구현

* feat: differenceInSeconds 함수 구현

* feat: subMinutes 함수 구현

* feat: format 함수 구현

* remove: Intl 덜어내기

* feat: string -> Date 형변환 처리 추가

* remove: test 용 파일 삭제

* remove: date-fns 라이브러리 삭제

* feat: EEEE RegExp 추가

* fix: toDate 함수 분리

* fix: 요일 인덱스 버그 픽스

* fix: toDate 적용 및 throw Error -> console error로 수정

* fix: throw Error 코드 복구

* fix: chrome 판단 regex 수정 (#470)

* [Refactor] OpenAPI를 이용하여 api interface 추출하기 (#472)

* feat: openapi spec을 이용한 api interface 생성

* feat: api interface를 가지는 fetcher 생성

* feat: 각 api에 맞는 interface 추출하기 위한 명령어 작성

* chore: 명령어 실행

* feat: gitattributes 설정

* fix: 명령어 폴더명 수정

* fix: 빌드 에러 수정

* [Refactor] Amplitude tracking 로직 컴포넌트로 분리 (#473)

* feat: amplitude event track component 생성

* feat: Button component에 Amplitude event track component 감싸기

* refactor: amplitude event track component 적용

* fix: build error

* fix: build error

* fix: 지원되지 않는 브라우저 로직 수정

* 배포 전 점검 (#475)

* fix: build 명령어 수정

* fix: 오티 날짜 수정

* refactor: 기수 배열 자동으로 계산

* fix: 이름, 이메일, 전화번호 자동으로 안 채워지는 에러 해결

* fix: 파일 업로드 실패 시 업로드 상태 초기화

* refactor: 불필요한 props 제거

* fix: 임시저장 안 불러와지는 에러 해결

* fix: makers일 경우 knownPath에 빈 값 실어보내기

* fix: 빌드 에러 해결

* fix: 서류 결과 확인 에러 수정

* fix: 최종 결과 페이지 날짜 에러 해결

* chore: 코드 원상복구

---------

Co-authored-by: lydiacho <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feat] env 개발 환경 분리하기
3 participants