- Vue.js๋ฅผ ์ฌ์ฉํ๋ Moreden
- React.js๋ฅผ ์ฌ์ฉํ๋ Medistream
๋ ์ฌ์ดํธ ๋ชจ๋ ๋์ผํ UI ์ปดํฌ๋ํธ๋ค์ ์ฌ์ฉํ๊ณ ์์ผ๋, ํ๋ ์์ํฌ๊ฐ ๋ค๋ฅด๊ธฐ ๋๋ฌธ์ ๊ฐ๊ธฐ ๋ค๋ฅธ ์ ์ฅ์์์ ๊ด๋ฆฌ ์ค์ด์์.
์ปดํฌ๋ํธ์ ์ ๋ฐ์ดํธ๊ฐ ์๊ธฐ๋ฉด ๋ ์ ์ฅ์์์ ๋ชจ๋ ์์ ํด์ผ ํ๋ค๋ ๋ฒ๊ฑฐ๋ก์์ด ์์๊ธฐ ๋๋ฌธ์, ํจ์จ๋๋ฅผ ๋์ด๊ธฐ ์ํด์ ๋ค์ํ ํ๋ ์์ํฌ๋ค์ ํ๋์ ์ ์ฅ์์์ ๊ด๋ฆฌํ ์ ์๋๋ก ํ๋ค.
๐ก ๋ชฉํํ ๋ฐ๋ฅผ ์ด๋ฃจ๊ณ ์ Storybook
์ composition
๊ธฐ๋ฅ์ ํ์ฉํ์ฌ ๊ตฌ์กฐ๋ฅผ ์ค๊ณํ๋ค.
- Storybook ํํ ๋ฆฌ์ผ ์ฝ์ด๋ณด๊ธฐ
- UI ์ปดํฌ๋ํธ ์์ฑ ํ ๋์์ธ ์์คํ ์ผ๋ก ์ ์ํ๋ ๋ฐฉ๋ฒ
- ๊ณต์ ๋ฌธ์ ์ฝ์ด๋ณด๊ธฐ
- Composition ๊ธฐ๋ฅ์ ๋ํด ์ฝ์ด๋ณด๊ธฐ
(ํธ์์ React library๋ฅผ framework๋ก ์ง์นญํจ.)
2๊ฐ ์ด์์ ํ๋ ์์ํฌ๋ฅผ ํ๋์ Storybook์ผ๋ก ํฉ์ณ์ ํ๋์ ๋ ํฌ๋ก ๊ด๋ฆฌํ๋ค. ์ด๋ฅผ ํตํด ๋ค์์ ํ๋ ์์ํฌ๋ก ์์ฑ๋ UI๋ค์ ํจ์จ์ ์ผ๋ก ๊ด๋ฆฌํ ์ ์๋๋ก ํ๋ค.
root
ใด .storybook
story๋ ์๊ณ , react์ vue๋ฅผ compositionํ๋ storybook.
ใด stories
root-storybook์ด ๋์ํ๊ธฐ ์ํ ์ต์ ํ๋ ์ด์์ story๊ฐ ์กด์ฌํ๋ค.
ใด components
UI ์ปดํฌ๋ํธ ๊ตฌ์ฑํ๋ jsx, vue ํ์ผ๋ค์ด ๋ชจ์ฌ์๋ค.
ใด [+] react-storybook
components ๋ด jsx๋ฅผ importํ๋ story๋ค์ด ๋ชจ์ฌ์๋ค.
ใด [+] vue-storybook
components ๋ด vue๋ฅผ importํ๋ story๋ค์ด ๋ชจ์ฌ์๋ค.
๋ณธ ํ๋ก์ ํธ๋ root storybook
์ ์ ์ธํ ๊ฐ Framework Storybook๋ค์ Chromatic
์ ์ด์ฉํ์ฌ ๋ฐฐํฌํ๋ค.
root storybook
์ ํ์ฌ ๋ด ๊ท์ ๋๋กAWS S3
๋ฅผ ์ด์ฉํ์ฌ ๋ฐฐํฌํจ.
pipelines:
branches:
develop:
- step:
name: Build
deployment: Production
image: node:18
script:
- npm install
- npm run build-storybook
artifacts:
- storybook-static/**
- step:
name: Deploy to S3
image: atlassian/pipelines-awscli
script:
- aws s3 sync --delete ./storybook-static s3://ui.integrationcorp.co.kr
- aws cloudfront create-invalidation --distribution-id E2J4QL6EK16P4D --paths "/*"
react:
- step:
name: Build & Deploy
deployment: Production
image: node:18
script:
- npm install
- cd storybook-react
- npm install
- npm run build-storybook
- npx chromatic --project-token $REACT_STORYBOOK_TOKEN --exit-zero-on-changes
artifacts:
- storybook-react/storybook-static/**
vue:
- step:
name: Build & Deploy
deployment: Production
image: node:16
script:
- npm install
- cd storybook-vue
- npm install
- npm run build-storybook
- npx chromatic --project-token $VUE_STORYBOOK_TOKEN --exit-zero-on-changes
artifacts:
- storybook-vue/storybook-static/**
tags:
production-*:
- step:
name: Build
deployment: Production
image: node:18
script:
- npm install
- npm run build-storybook
artifacts:
- storybook-static/**
- step:
name: Deploy to S3
image: atlassian/pipelines-awscli
script:
- aws s3 sync --delete ./storybook-static s3://ui.integrationcorp.co.kr
- aws cloudfront create-invalidation --distribution-id E2J4QL6EK16P4D --paths "/*"
npm scripts | commands |
---|---|
"storybook" |
"storybook dev -p 6006" |
"storybook:react" |
"cd storybook-react && npm install && npm run storybook" |
"storybook:vue" |
"cd storybook-vue && npm install && npm run storybook" |
"build-storybook" |
"storybook build" |
"build-storybook:react" |
"cd storybook-react && npm install && npm run build-storybook" |
"build-storybook:vue" |
"cd storybook-vue && npm install && npm run build-storybook" |