From 1c4854d298c727a966cb3994280f8933b841629c Mon Sep 17 00:00:00 2001 From: baegyeong Date: Thu, 14 Nov 2024 21:58:25 +0900 Subject: [PATCH 1/9] =?UTF-8?q?=F0=9F=90=9B=20fix:=20tailwind=20config=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=EC=9D=84=20=EB=B6=88=EB=9F=AC=EC=98=A4?= =?UTF-8?q?=EC=A7=80=20=EB=AA=BB=ED=95=98=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/styles/theme/darkTheme.ts | 12 ++++++------ packages/frontend/src/styles/theme/lightTheme.ts | 10 +++++----- packages/frontend/src/utils/getHistogramColorData.ts | 2 +- .../{tailwind.config.js => tailwind.config.ts} | 9 ++++++--- packages/frontend/tsconfig.app.json | 2 +- 5 files changed, 19 insertions(+), 16 deletions(-) rename packages/frontend/{tailwind.config.js => tailwind.config.ts} (81%) diff --git a/packages/frontend/src/styles/theme/darkTheme.ts b/packages/frontend/src/styles/theme/darkTheme.ts index 2ea53c4e..e6e492cf 100644 --- a/packages/frontend/src/styles/theme/darkTheme.ts +++ b/packages/frontend/src/styles/theme/darkTheme.ts @@ -1,19 +1,19 @@ import resolveConfig from 'tailwindcss/resolveConfig'; import { ChartTheme } from '.'; -import tailwindConfig from '@/../tailwind.config.js'; +import tailwindConfig from '@/../tailwind.config'; const colorConfig = resolveConfig(tailwindConfig).theme.colors; - +console.log(colorConfig.red); export const darkTheme: ChartTheme = { background: '#1a1a1a', textColor: '#ffffffe6', gridLines: '#334158', borderColor: '#485c7b', candlestick: { - upColor: colorConfig.red, - downColor: colorConfig.blue, - borderUpColor: colorConfig.red, - borderDownColor: colorConfig.blue, + upColor: colorConfig.red.toString(), + downColor: colorConfig.blue.toString(), + borderUpColor: colorConfig.red.toString(), + borderDownColor: colorConfig.blue.toString(), wickUpColor: '#838ca1', wickDownColor: '#838ca1', }, diff --git a/packages/frontend/src/styles/theme/lightTheme.ts b/packages/frontend/src/styles/theme/lightTheme.ts index 94b9e2c1..c1f2698d 100644 --- a/packages/frontend/src/styles/theme/lightTheme.ts +++ b/packages/frontend/src/styles/theme/lightTheme.ts @@ -1,6 +1,6 @@ import resolveConfig from 'tailwindcss/resolveConfig'; import { ChartTheme } from '.'; -import tailwindConfig from '@/../tailwind.config.js'; +import tailwindConfig from '@/../tailwind.config'; const colorConfig = resolveConfig(tailwindConfig).theme.colors; @@ -10,10 +10,10 @@ export const lightTheme: ChartTheme = { gridLines: '#e0e3eb', borderColor: '#d6dcde', candlestick: { - upColor: colorConfig.red, - downColor: colorConfig.blue, - borderUpColor: colorConfig.red, - borderDownColor: colorConfig.blue, + upColor: colorConfig.red.toString(), + downColor: colorConfig.blue.toString(), + borderUpColor: colorConfig.red.toString(), + borderDownColor: colorConfig.blue.toString(), wickUpColor: '#737375', wickDownColor: '#737375', }, diff --git a/packages/frontend/src/utils/getHistogramColorData.ts b/packages/frontend/src/utils/getHistogramColorData.ts index 0a347645..86524a45 100644 --- a/packages/frontend/src/utils/getHistogramColorData.ts +++ b/packages/frontend/src/utils/getHistogramColorData.ts @@ -1,5 +1,5 @@ import resolveConfig from 'tailwindcss/resolveConfig'; -import tailwindConfig from '@/../tailwind.config.js'; +import tailwindConfig from '@/../tailwind.config'; // TODO: api 나오면 객체/위치 수정 interface VolumeData { diff --git a/packages/frontend/tailwind.config.js b/packages/frontend/tailwind.config.ts similarity index 81% rename from packages/frontend/tailwind.config.js rename to packages/frontend/tailwind.config.ts index 69c2addd..10590b9f 100644 --- a/packages/frontend/tailwind.config.js +++ b/packages/frontend/tailwind.config.ts @@ -1,5 +1,6 @@ -/** @type {import('tailwindcss').Config} */ -export default { +import type { Config } from 'tailwindcss' + +const config: Config = { content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'], theme: { extend: {}, @@ -18,4 +19,6 @@ export default { }, }, plugins: [], -}; +} + +export default config \ No newline at end of file diff --git a/packages/frontend/tsconfig.app.json b/packages/frontend/tsconfig.app.json index 374f7514..24c6800d 100644 --- a/packages/frontend/tsconfig.app.json +++ b/packages/frontend/tsconfig.app.json @@ -25,5 +25,5 @@ "composite": true }, - "include": ["src", "src/**/*.json"] + "include": ["src", "src/**/*.json", "tailwind.config.ts"] } From 577a8b2bb1f9b5ccb9d9465e37d329b2fca89f7d Mon Sep 17 00:00:00 2001 From: baegyeong Date: Thu, 14 Nov 2024 21:58:47 +0900 Subject: [PATCH 2/9] =?UTF-8?q?=F0=9F=90=9B=20fix:=20=EA=B8=B0=EB=B3=B8=20?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=95=84=EC=9B=83=20css=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/components/layouts/Layout.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/components/layouts/Layout.tsx b/packages/frontend/src/components/layouts/Layout.tsx index e37b3f2a..ad7fb7e8 100644 --- a/packages/frontend/src/components/layouts/Layout.tsx +++ b/packages/frontend/src/components/layouts/Layout.tsx @@ -3,9 +3,9 @@ import { Sidebar } from './Sidebar'; export const Layout = () => { return ( -
+
-
+
From 9bbec3306f822df6cb00913b3861643432f5a1e7 Mon Sep 17 00:00:00 2001 From: baegyeong Date: Thu, 14 Nov 2024 21:59:06 +0900 Subject: [PATCH 3/9] =?UTF-8?q?=E2=9C=A8=20feat:=20trading=20chart=20?= =?UTF-8?q?=EA=B8=B0=EB=B3=B8=20=ED=85=8C=EB=A7=88=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/pages/stock-detail/TradingChart.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/pages/stock-detail/TradingChart.tsx b/packages/frontend/src/pages/stock-detail/TradingChart.tsx index fd3053b2..198dedb0 100644 --- a/packages/frontend/src/pages/stock-detail/TradingChart.tsx +++ b/packages/frontend/src/pages/stock-detail/TradingChart.tsx @@ -1,13 +1,13 @@ import { useRef } from 'react'; import { useChart } from './hooks/useChart'; import { useChartResize } from './hooks/useChartResize'; -import { ChartTheme, darkTheme } from '@/styles/theme'; +import { ChartTheme, lightTheme } from '@/styles/theme'; interface TradingChartProps { theme?: ChartTheme; } -export const TradingChart = ({ theme = darkTheme }: TradingChartProps) => { +export const TradingChart = ({ theme = lightTheme }: TradingChartProps) => { const containerRef = useRef(null); const chart = useChart({ containerRef, theme }); From 9495552c213a3d67a12444ff31877e41aa84395d Mon Sep 17 00:00:00 2001 From: baegyeong Date: Thu, 14 Nov 2024 21:59:35 +0900 Subject: [PATCH 4/9] =?UTF-8?q?=F0=9F=93=A6=EF=B8=8F=20ci:=20build=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=9C=84=ED=95=B4=20pr=20?= =?UTF-8?q?=EC=8B=9C=20=EB=8F=8C=EC=95=84=EA=B0=80=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/storybook.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml index 80167f3b..4a8d8098 100644 --- a/.github/workflows/storybook.yml +++ b/.github/workflows/storybook.yml @@ -3,6 +3,8 @@ name: storybook deploy on: push: branches: ['dev-fe'] + pull_request: + branches: ['dev-fe'] workflow_dispatch: From a5a0430d5ebda8efd06e544fb1bfd5fa44e7855f Mon Sep 17 00:00:00 2001 From: baegyeong Date: Thu, 14 Nov 2024 22:03:19 +0900 Subject: [PATCH 5/9] =?UTF-8?q?=F0=9F=93=A6=EF=B8=8F=20ci:=20build=20?= =?UTF-8?q?=ED=8F=B4=EB=8D=94=EB=AA=85=20=EC=88=98=EC=A0=95=20-\>=20dist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/storybook.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml index 4a8d8098..5397e084 100644 --- a/.github/workflows/storybook.yml +++ b/.github/workflows/storybook.yml @@ -47,12 +47,12 @@ jobs: - name: Build app run: | yarn client build - cp ./packages/frontend/build/index.html ./packages/frontend/build/404.html + cp ./packages/frontend/dist/index.html ./packages/frontend/dist/404.html - name: Build storybook run: | yarn client build-storybook - mv ./packages/frontend/storybook-static ./packages/frontend/build/storybook + mv ./packages/frontend/storybook-static ./packages/frontend/dist/storybook - name: Deploy to gh-pages branch uses: peaceiris/actions-gh-pages@v3 From 43f1461b506791aa963508c806c9b1dc8976c8f1 Mon Sep 17 00:00:00 2001 From: baegyeong Date: Thu, 14 Nov 2024 22:09:15 +0900 Subject: [PATCH 6/9] =?UTF-8?q?=F0=9F=93=A6=EF=B8=8F=20ci:=20frontend=20de?= =?UTF-8?q?ploy=20workflow=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-frontend.yml | 65 +++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/deploy-frontend.yml diff --git a/.github/workflows/deploy-frontend.yml b/.github/workflows/deploy-frontend.yml new file mode 100644 index 00000000..79cd98e2 --- /dev/null +++ b/.github/workflows/deploy-frontend.yml @@ -0,0 +1,65 @@ +name: Deploy Frontend in Monorepo + +on: + push: + branches: + - dev-fe + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + services: + docker: + image: docker:20.10.7 + options: --privileged + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Cache Yarn dependencies + uses: actions/cache@v3 + with: + path: | + **/node_modules + ~/.yarn-cache + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'yarn' + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Build frontend + run: | + yarn workspace frontend build + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push backend Docker image + run: | + docker build -t ${{ secrets.DOCKER_USERNAME }}/backend:latest -f packages/backend/Dockerfile . + docker push ${{ secrets.DOCKER_USERNAME }}/backend:latest + + - name: Deploy to server + uses: appleboy/ssh-action@v1.1.0 + with: + host: ${{ secrets.SERVER_HOST }} + username: ${{ secrets.SERVER_USER }} + key: ${{ secrets.SERVER_SSH_KEY}} + port: ${{ secrets.SERVER_PORT }} + script: | + docker pull ${{ secrets.DOCKER_USERNAME }}/frontend:latest + docker-compose down + docker-compose up -d From 83634145ff3f511589133ea971e285edf68bc6c2 Mon Sep 17 00:00:00 2001 From: baegyeong Date: Thu, 14 Nov 2024 22:15:35 +0900 Subject: [PATCH 7/9] =?UTF-8?q?=F0=9F=93=A6=EF=B8=8F=20ci:=20workflow?= =?UTF-8?q?=EC=9D=98=20build=20dir=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/storybook.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml index 5397e084..e43536d0 100644 --- a/.github/workflows/storybook.yml +++ b/.github/workflows/storybook.yml @@ -58,4 +58,4 @@ jobs: uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./build + publish_dir: ./packages/frontend/dist From c24982cc43a2a97b5c40de6636fe4ed8d3cdc490 Mon Sep 17 00:00:00 2001 From: baegyeong Date: Thu, 14 Nov 2024 22:44:58 +0900 Subject: [PATCH 8/9] =?UTF-8?q?=F0=9F=93=A6=EF=B8=8F=20ci:=20github=20page?= =?UTF-8?q?s=20=EB=A9=94=EC=9D=B8=EC=97=90=20storybook=EC=9D=84=20?= =?UTF-8?q?=EB=B0=B0=ED=8F=AC=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/storybook.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml index e43536d0..081dcd53 100644 --- a/.github/workflows/storybook.yml +++ b/.github/workflows/storybook.yml @@ -44,18 +44,12 @@ jobs: PUBLIC_URL=$(echo $GITHUB_REPOSITORY | sed -r 's/^.+\/(.+)$/\/\1\//') echo PUBLIC_URL=$PUBLIC_URL > .env - - name: Build app - run: | - yarn client build - cp ./packages/frontend/dist/index.html ./packages/frontend/dist/404.html - - name: Build storybook run: | yarn client build-storybook - mv ./packages/frontend/storybook-static ./packages/frontend/dist/storybook - name: Deploy to gh-pages branch uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./packages/frontend/dist + publish_dir: ./packages/frontend/storybook-static From 2b98d57d241aed18007c04f22ddff1141285d781 Mon Sep 17 00:00:00 2001 From: baegyeong Date: Thu, 14 Nov 2024 22:54:33 +0900 Subject: [PATCH 9/9] =?UTF-8?q?=F0=9F=93=A6=EF=B8=8F=20ci:=20pr=20?= =?UTF-8?q?=EB=82=A0=EB=A6=B4=20=EB=95=8C=20workflow=20=EB=8F=8C=EC=95=84?= =?UTF-8?q?=EA=B0=80=EB=8A=94=20=EC=BD=94=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/storybook.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml index 081dcd53..9df02eff 100644 --- a/.github/workflows/storybook.yml +++ b/.github/workflows/storybook.yml @@ -3,8 +3,6 @@ name: storybook deploy on: push: branches: ['dev-fe'] - pull_request: - branches: ['dev-fe'] workflow_dispatch: