전체 글
-
NestJS에서 nest-cli로 실행 시킬때 src폴더 외 루트 경로 인식 못할때Nest.js 2024. 4. 17. 21:33
NestJS에서 start:dev나 start 그리고 build 명령어를 사용하면 dist 폴더가 생성된다. 하지만 src 밖에 생성되는것들을 인식 하지 못한다. // nest-cli.json { "$schema": "https://json.schemastore.org/nest-cli", "collection": "@nestjs/schematics", "sourceRoot": "src", "compilerOptions": { "deleteOutDir": true } } nest-cli.json에서 sourceRoot를 src를 해두면 dis폴더에 src에 있는것들이 빌드되어 생성된다. src 외부에 루트경로에 있는것들을 nest cli 명령어로 시작해서 생성된 dist 폴더에서 인식 하게 해주려면 따로..
-
vite+ typescript + react+ emotion + storybookReact.js 2024. 4. 17. 10:47
vite를 통해 react를 설치한다 // 더블대시가 필요함 주의 # npm 7+, extra double-dash is needed: $ npm create vite@latest my-vue-app -- --template react-ts emotion 설치 $ npm install --save @emotion/react $ npm install --save @emotion/styled react-router-dom 설치 $ npm i react-router-dom 절대 경로 설정을 위한 vite-tsconfig-paths 설치 $ npm i -D vite-tsconfig-paths @types/node vite-env.d.ts 는 타입스크립트에서 환경변수를 추론하게 도와줌 https://velog.i..
-
jest unit 테스트 경로와 e2e 테스트 경로 잡아주기Nest.js/TDD 2024. 4. 16. 18:58
tsconfig.json { "compilerOptions": { .... "paths": { "@/*": ["src/*"], "test/*": ["test/*"] } } } import path를 유용하게 잡기 위해 paths 옵션을 주었을때와 루트 디렉토리 경로에서 src폴더와 별개로 테스트 파일들을 한곳에 모아서 관리하고 싶었다. 프로젝트 구조 /src /test /test/unit /test/e2e /test/jest-e2e.json Unit 테스트 파일 경로 설정하기 // 기존 package.json ... "jest": { "moduleFileExtensions": [ "js", "json", "ts" ], "rootDir": "src", "testRegex": ".*\\.spec\\.ts$"..
-
-
python 버전관리Python 2024. 4. 14. 14:54
pyenv 를 이용한 버전관리https://www.daleseo.com/python-pyenv/ 여러 버전의 파이썬 관리하기 (pyenv)Engineering Blog by Dale Seowww.daleseo.comhttps://github.com/pyenv/pyenv#installation GitHub - pyenv/pyenv: Simple Python version managementSimple Python version management. Contribute to pyenv/pyenv development by creating an account on GitHub.github.comhttps://shawn-dev.oopy.io/fe911cba-0b25-474c-9..
-
react mention 기능 구현React.js 2024. 4. 13. 11:03
1. react-mentions 라이브러리 설치 $ npm i react-mentions $ npm i -D @types/react-mentions 2. 문서 확인 https://react-mentions.vercel.app/ React mentions react-mentions.vercel.app https://github.com/signavio/react-mentions GitHub - signavio/react-mentions: @mention people in a textarea @mention people in a textarea. Contribute to signavio/react-mentions development by creating an account on GitHub. github.c..
-
SSE 통신을 위한 EventSource 대체할것React.js 2024. 4. 12. 13:48
클라이언트에서 사용하는 EventSource의 아쉬운점은 header를 넣지 못한다는 점이다. http 통신을 그대로 이용할 수 있다는점에서 단방향 통신으로 SSE통신방식이 굉장히 매력적으로 다가왔으나 hader에 Bearer 토큰을 넣어서 인증하는 방식을 사용 할 수 없다면 backend에서 다른방식으로 처리하는 코드가 늘어나게 되면서 authorization 하는 하나의 gaurd로 처리하는게 아니라 다른 guard를 만들거나 검증하는 다른 방법을 모색 해야한다. 굉장히 불편하다. https://eightify.app/dev/http-authorization-header-in-eventsource-server-sent-events 해당 좋은글을 발견했다. 확장성 있는 http-authorization..
-
TypeOrm을 사용할때 식별관계 테이블에서 find 메서드에 skip과 take 사용시 주의 해야할점Nest.js/TypeOrm 2024. 4. 10. 22:23
// repository await this.repository.find({ select: { id: true, notificationTitle: true, notificationFeedId: true, createdAt: true, }, where: { recipientId, }, relations: { sender: true, }, skip, take, }); 해당 쿼리가 대충 아래처럼 실행 될것이라고 예상 했지만 그렇지 않았다. FK를 가르키는 senderId를 찾을 수 없다는 에러가 나왔다. select fn."senderId", fn."id", fn."notificationTitle", fn."createdAt", fn."senderId", fn."notificationFeedId" from f..