From b1c0c15db3ad10de4809ce733b5bb6baf127ef4f Mon Sep 17 00:00:00 2001 From: rieulp Date: Fri, 8 Nov 2024 03:35:37 +0900 Subject: [PATCH 1/6] =?UTF-8?q?pr=20check=20action=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/action-check-pr.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/action-check-pr.yaml b/.github/workflows/action-check-pr.yaml index 1f7173a..b4f28e6 100644 --- a/.github/workflows/action-check-pr.yaml +++ b/.github/workflows/action-check-pr.yaml @@ -17,27 +17,27 @@ jobs: with: node-version: '18' - name: Install pnpm - run: npm install -g pnpm # pnpm을 전역으로 설치 + run: npm install -g pnpm # pnpm을 전역으로 설치 - name: Install Dependencies - run: pnpm install # pnpm을 사용하여 의존성 설치 + run: pnpm install # pnpm을 사용하여 의존성 설치 - name: Run Lint - run: pnpm lint # 린트 실행 + run: pnpm lint # 린트 실행 - name: Run Prettier - run: pnpm format --check # 프리티어 체크 + run: pnpm format --check # 프리티어 체크 - - name: Build - run: pnpm build # 빌드 실행 + - name: Build # 머지하려는 브랜치가 main 브랜치이면 build:prod, dev 브랜치이면 build:dev + run: pnpm build:${{ github.event.pull_request.base.ref == 'main' && 'prod' || 'dev' }} label: runs-on: ubuntu-latest - needs: check # check 작업이 완료된 후 실행 + needs: check # check 작업이 완료된 후 실행 steps: - name: Add Labels - if: github.event.pull_request.draft == false # 드래프트가 아닐 경우에만 실행 + if: github.event.pull_request.draft == false # 드래프트가 아닐 경우에만 실행 uses: actions/add-labels@v1 with: - labels: ${{ github.event.pull_request.base.ref == 'dev' && 'dev' || github.event.pull_request.base.ref == 'main' && 'main'}} # dev로 머지 시 dev 라벨, main으로 머지 시 main 라벨 + labels: ${{ github.event.pull_request.base.ref == 'dev' && 'dev' || github.event.pull_request.base.ref == 'main' && 'main'}} # dev로 머지 시 dev 라벨, main으로 머지 시 main 라벨 From 7dff23e0fc5b7ae8edb3a71d4f8a93a9dccd8751 Mon Sep 17 00:00:00 2001 From: rieulp Date: Fri, 8 Nov 2024 03:57:36 +0900 Subject: [PATCH 2/6] =?UTF-8?q?gitignore=20prettier=20=EC=84=A4=EC=A0=95?= =?UTF-8?q?=20=ED=8F=AC=ED=95=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- .prettierrc | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .prettierrc diff --git a/.gitignore b/.gitignore index 39baa62..dd87e2d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ node_modules -.prettierrc +build diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..19a716b --- /dev/null +++ b/.prettierrc @@ -0,0 +1,7 @@ +{ + "semi": true, + "singleQuote": true, + "trailingComma": "es5", + "tabWidth": 2, + "printWidth": 120 +} From f9817fd74efcc6cb999ca93274fb3d2557a7f66e Mon Sep 17 00:00:00 2001 From: rieulp Date: Fri, 8 Nov 2024 03:58:30 +0900 Subject: [PATCH 3/6] =?UTF-8?q?path=20alias=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EB=B0=8F=20index.html=20public=20=ED=95=98=EC=9C=84=EB=A1=9C?= =?UTF-8?q?=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- index.html => public/index.html | 0 src/index.tsx | 2 +- webpack.config.js | 9 ++++++--- 4 files changed, 9 insertions(+), 6 deletions(-) rename index.html => public/index.html (100%) diff --git a/package.json b/package.json index 6237ebf..e961426 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "dev": "cross-env NODE_ENV=development webpack serve --open", "build:dev": "cross-env NODE_ENV=development webpack", "build:prod": "cross-env NODE_ENV=production webpack", - "start:dev": "npm run build:dev && node dist/bundle.js", - "start:prod": "npm run build:prod && node dist/bundle.js" + "start:dev": "npm run build:dev && serve -s build", + "start:prod": "npm run build:prod && serve -s build" }, "keywords": [], "author": "", diff --git a/index.html b/public/index.html similarity index 100% rename from index.html rename to public/index.html diff --git a/src/index.tsx b/src/index.tsx index fd9883d..3693e97 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,6 +1,6 @@ import React from 'react'; import ReactDOM from 'react-dom/client'; -import App from 'App'; +import App from '@/App'; const root = ReactDOM.createRoot(document.getElementById('root')!); root.render( diff --git a/webpack.config.js b/webpack.config.js index fa366c8..3f44d94 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -7,16 +7,19 @@ module.exports = { entry: './src/index.tsx', output: { filename: 'bundle.js', - path: path.resolve(__dirname, 'dist'), + path: path.resolve(__dirname, 'build'), clean: true, // 이전 빌드 파일 삭제 }, resolve: { + alias: { + '@': path.resolve(__dirname, 'src'), + }, extensions: ['.ts', '.tsx', '.js', '.jsx'], // 처리할 파일 확장자 }, module: { rules: [ { - test: /\.tsx?$/, // 타입스크립트 파일 처리 + test: /\.tsx?$/, // 타입스크립트 파일 처리 ts, tsx use: 'ts-loader', exclude: /node_modules/, }, @@ -25,7 +28,7 @@ module.exports = { mode: process.env.NODE_ENV || 'development', plugins: [ new HtmlWebpackPlugin({ - template: './index.html', // 기본 HTML 템플릿 + template: './public/index.html', // 기본 HTML 템플릿 }), ], devtool: process.env.NODE_ENV === 'development' ? 'source-map' : false, // 소스 맵 From 0321eb83ad62999bc66baec567a959db62048bd7 Mon Sep 17 00:00:00 2001 From: rieulp Date: Fri, 8 Nov 2024 04:09:17 +0900 Subject: [PATCH 4/6] =?UTF-8?q?action=20=EB=9D=BC=EB=B2=A8=20=EB=9D=BC?= =?UTF-8?q?=EC=9D=B4=EB=B8=8C=EB=9F=AC=EB=A6=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/action-check-pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/action-check-pr.yaml b/.github/workflows/action-check-pr.yaml index b4f28e6..77ac38d 100644 --- a/.github/workflows/action-check-pr.yaml +++ b/.github/workflows/action-check-pr.yaml @@ -38,6 +38,6 @@ jobs: steps: - name: Add Labels if: github.event.pull_request.draft == false # 드래프트가 아닐 경우에만 실행 - uses: actions/add-labels@v1 + uses: actions-ecosystem/action-add-labels@v1 # 라벨 추가 액션 with: labels: ${{ github.event.pull_request.base.ref == 'dev' && 'dev' || github.event.pull_request.base.ref == 'main' && 'main'}} # dev로 머지 시 dev 라벨, main으로 머지 시 main 라벨 From aa0e02e2fa7b4d84e9a77b1d6ebe1e282d01671a Mon Sep 17 00:00:00 2001 From: rieulp Date: Fri, 8 Nov 2024 04:13:31 +0900 Subject: [PATCH 5/6] =?UTF-8?q?=EB=9D=BC=EB=B2=A8=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=EB=A5=BC=20=EC=9C=84=ED=95=9C=20=EA=B6=8C=ED=95=9C=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/action-check-pr.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/action-check-pr.yaml b/.github/workflows/action-check-pr.yaml index 77ac38d..c82a129 100644 --- a/.github/workflows/action-check-pr.yaml +++ b/.github/workflows/action-check-pr.yaml @@ -4,6 +4,10 @@ on: pull_request: types: [opened, edited, synchronize, reopened, ready_for_review] + permissions: + pull-requests: write # PR에 대한 쓰기 권한 부여 + issues: write # 이슈에 대한 쓰기 권한 부여 (라벨 추가를 위한) + jobs: check: runs-on: ubuntu-latest From bc188207b952e85d390e5e3b8dd34330c6858aa3 Mon Sep 17 00:00:00 2001 From: rieulp Date: Fri, 8 Nov 2024 04:15:09 +0900 Subject: [PATCH 6/6] =?UTF-8?q?=EC=95=A1=EC=85=98=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/action-check-pr.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/action-check-pr.yaml b/.github/workflows/action-check-pr.yaml index c82a129..6690ab9 100644 --- a/.github/workflows/action-check-pr.yaml +++ b/.github/workflows/action-check-pr.yaml @@ -4,9 +4,9 @@ on: pull_request: types: [opened, edited, synchronize, reopened, ready_for_review] - permissions: - pull-requests: write # PR에 대한 쓰기 권한 부여 - issues: write # 이슈에 대한 쓰기 권한 부여 (라벨 추가를 위한) +permissions: + pull-requests: write # PR에 대한 쓰기 권한 부여 + issues: write # 이슈에 대한 쓰기 권한 부여 (라벨 추가를 위한) jobs: check: