From 564b52b426785f730655219ec2cab1b3d7016609 Mon Sep 17 00:00:00 2001 From: yubin Date: Sun, 14 Jul 2024 20:37:42 +0900 Subject: [PATCH 1/3] =?UTF-8?q?Chore:=20ESLint=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20-=20Rule=EC=97=90=20=EA=B0=81=EC=A2=85=20o?= =?UTF-8?q?ff=20=EC=84=A4=EC=A0=95=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.json | 20 +++++++++++++++++++- src/app/layout.tsx | 2 +- src/mocks/MSWComponent.tsx | 1 + 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 9641079..bb8beac 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -5,6 +5,7 @@ "es2021": true }, "extends": [ + "next/core-web-vitals", "eslint:recommended", "plugin:react/recommended", "plugin:@typescript-eslint/recommended", @@ -26,6 +27,23 @@ "prettier/prettier": "error", "react/react-in-jsx-scope": "off", "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": "warn" + "@typescript-eslint/no-unused-vars": "warn", + "import/extensions": [ + "error", + "ignorePackages", + { + "js": "never", + "jsx": "never", + "ts": "never", + "tsx": "never" + } + ], + "no-console": "off", + "react/require-default-props": "off", + "react/jsx-props-no-spreading": "off", + "import/prefer-default-export": "off", + "react/function-component-definition": "off", + "react/jsx-no-useless-fragment": "off", + "import/no-extraneous-dependencies": "off" } } diff --git a/src/app/layout.tsx b/src/app/layout.tsx index edc089f..3b57d92 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,7 +1,7 @@ import type { Metadata } from 'next'; import { Inter as FontSans } from 'next/font/google'; import { cn } from '@/utils/tailwind'; -import './../styles/globals.css'; +import '../styles/globals.css'; import { MSWComponent } from '@/mocks/MSWComponent'; import Link from 'next/link'; diff --git a/src/mocks/MSWComponent.tsx b/src/mocks/MSWComponent.tsx index e645cfe..5456f14 100644 --- a/src/mocks/MSWComponent.tsx +++ b/src/mocks/MSWComponent.tsx @@ -1,4 +1,5 @@ 'use client'; + import { useEffect, useState } from 'react'; export const MSWComponent = ({ children }: { children: React.ReactNode }) => { From e6a4883021cb715a9165a0c258200316d4857d21 Mon Sep 17 00:00:00 2001 From: yubin Date: Sun, 14 Jul 2024 20:43:36 +0900 Subject: [PATCH 2/3] =?UTF-8?q?Ci:=20workflow=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_check.yml | 37 +++++++++++++++++++++++++++ .github/workflows/deploy_dispatch.yml | 24 +++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .github/workflows/build_check.yml create mode 100644 .github/workflows/deploy_dispatch.yml diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml new file mode 100644 index 0000000..b372cb9 --- /dev/null +++ b/.github/workflows/build_check.yml @@ -0,0 +1,37 @@ +name: Build Check + +on: + pull_request: + branches: [main] + types: [opened, synchronize, reopened] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Check Node version + run: node -v + + - name: Cache dependencies + id: cache + uses: actions/cache@v3 + with: + path: '**/node_modules' + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Install dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: npm install + + - name: Build project + run: npm run build diff --git a/.github/workflows/deploy_dispatch.yml b/.github/workflows/deploy_dispatch.yml new file mode 100644 index 0000000..583b41f --- /dev/null +++ b/.github/workflows/deploy_dispatch.yml @@ -0,0 +1,24 @@ +name: Vercel Production Deployment +env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} +on: + push: + branches: + - main +jobs: + Deploy-Production: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Vercel CLI + run: npm install --global vercel@latest + + - name: Pull Vercel Environment Information + run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} + + - name: Build Project Artifacts + run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} + + - name: Deploy Project Artifacts to Vercel + run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} From bfacc67a12118133af6ef4831065819488c937ea Mon Sep 17 00:00:00 2001 From: yubin Date: Sun, 14 Jul 2024 20:48:22 +0900 Subject: [PATCH 3/3] =?UTF-8?q?Ci:=20deploy=20dispatch=EC=9A=A9=20workflow?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy_dispatch.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy_dispatch.yml b/.github/workflows/deploy_dispatch.yml index 583b41f..4984f8e 100644 --- a/.github/workflows/deploy_dispatch.yml +++ b/.github/workflows/deploy_dispatch.yml @@ -3,9 +3,8 @@ env: VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} on: - push: - branches: - - main + workflow_dispatch: + jobs: Deploy-Production: runs-on: ubuntu-latest