-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
강원대 FE_김정윤_1주차 과제 Step2, 3 #80
Open
wjdsbs
wants to merge
16
commits into
kakao-tech-campus-2nd-step2:wjdsbs
Choose a base branch
from
wjdsbs:step2
base: wjdsbs
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 13 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
ca9c29d
feat : CRA 사용하여 TypeScript 기반 React 프로젝트 초기화
wjdsbs 61caab7
docs: README 기능 목록 업데이트
wjdsbs 5a3338c
refactor: 폴더 구조 정리
wjdsbs 876592f
chore: 사용하지 않는 파일 및 코드 삭제
wjdsbs eb8a1ef
build: craco 사용하여 alias 설정 추가
wjdsbs 4f6e0b0
chore: ESLint, Prettier 추가 및 Airbnb룰 세팅
wjdsbs 3bcd614
feat: reset.css 추가
wjdsbs e98a5dc
feat: emotion 라이브러리 추가
wjdsbs 2ce312e
docs: README.md 업데이트
wjdsbs b3c0e0a
feat: Storybook 추가
wjdsbs fa68a50
feat: 스토리북 Button 및 Input 컴포넌트 구현
wjdsbs b22f6ef
feat: 스토리북 Image 컴포넌트 추가
wjdsbs 074a276
docs: README.md 업데이트(STEP3)
wjdsbs 5689205
chore: STEP1 변경사항 반영
wjdsbs fe118a0
chore: plugin:prettier/recommended를 마지막 item으로 이동
wjdsbs e127dc2
refactor: style.css 정의 및 컴포넌트 별 폴더 구성
wjdsbs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module.exports = { | ||
extends: ['airbnb', 'plugin:prettier/recommended', 'plugin:storybook/recommended'], | ||
rules: { | ||
'prettier/prettier': ['error', { endOfLine: 'auto' }], | ||
'operator-linebreak': ['error', 'before'], | ||
'max-depth': ['error', 2], | ||
'react/jsx-filename-extension': [1, { extensions: ['.tsx'] }], | ||
}, | ||
settings: { | ||
'import/parsers': { | ||
'@typescript-eslint/parser': ['.ts', '.tsx'], | ||
}, | ||
'import/resolver': { | ||
typescript: {}, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
*storybook.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules/ | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
printWidth: 80, | ||
tabWidth: 2, | ||
useTabs: false, | ||
semi: true, | ||
singleQuote: true, | ||
trailingComma: 'all', | ||
bracketSpacing: true, | ||
arrowParens: 'avoid', | ||
proseWrap: 'never', | ||
endOfLine: 'auto', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import type { StorybookConfig } from '@storybook/react-webpack5'; | ||
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); | ||
|
||
const config: StorybookConfig = { | ||
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], | ||
addons: [ | ||
'@storybook/preset-create-react-app', | ||
'@storybook/addon-onboarding', | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@chromatic-com/storybook', | ||
'@storybook/addon-interactions', | ||
], | ||
framework: { | ||
name: '@storybook/react-webpack5', | ||
options: {}, | ||
}, | ||
staticDirs: ['..\\public'], | ||
webpackFinal: async config => { | ||
if (!config) { | ||
throw new Error('webpackFinal received an undefined config.'); | ||
} | ||
|
||
return { | ||
...config, | ||
plugins: | ||
config.plugins?.filter(plugin => { | ||
// ESLintWebpackPlugin 플러그인을 필터링하여 제거 | ||
if (plugin?.constructor?.name === 'ESLintWebpackPlugin') { | ||
return false; | ||
} | ||
return true; | ||
}) || [], | ||
}; | ||
}, | ||
}; | ||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import type { Preview } from '@storybook/react'; | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default preview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,65 @@ | ||
# react-gift-react-foundation | ||
|
||
FE 카카오 선물하기 1주차 과제: React 기초 | ||
|
||
## ✔️ 기능 구현 목록 | ||
|
||
### 프로젝트 초기화 | ||
|
||
- [x] Create React App 기반 프로젝트 생성 | ||
|
||
- [x] Typescript 세팅 | ||
|
||
### 프로젝트 관리 | ||
|
||
- [x] .gitignore 추가 | ||
|
||
- [x] 폴더 구조 관리 | ||
``` | ||
assets : 이미지, 폰트 관리 | ||
components : 컴포넌트 관리 | ||
pages : 페이지 컴포넌트 관리 | ||
styles : css 파일 관리 | ||
utils : 재사용 가능한 유틸리티 함수 관리 | ||
``` | ||
- [x] 불필요한 코드 정리 | ||
|
||
- [x] 절대 경로로 Import 할 수 있도록 alias를 설정 | ||
|
||
- [x] tsconfig 구성 확인 후 자유롭게 설정 | ||
|
||
### 코드 스타일 | ||
|
||
- [x] ESLint 추가 | ||
|
||
- [x] Prettier 추가 | ||
|
||
- [x] Lint 룰 세팅 | ||
|
||
### 스타일 | ||
|
||
- [x] emotion 스타일 라이브러리 추가 | ||
|
||
- [x] reset.css 적용 | ||
|
||
## ✔️ 유념해야 할 사항 | ||
|
||
1. 본인만의 폴더 구조 기준을 세우고 반영 | ||
|
||
2. 본인만의 기준으로 일관된 코드를 작성 | ||
|
||
3. 기능 단위로 나누어 커밋 | ||
|
||
## 1주차 질문 - STEP 3 과제 | ||
|
||
### 질문 1. webpack은 무엇이고 어떤 역할을 하고 있나요? | ||
|
||
오픈소스 자바스크립트 모듈 번들러로, 여러개로 나누어져 있는 파일들(JS, CSS, 이미지 등)을 하나의 자바스크립트 코드로 압축하고 최적화 하는 역할을 한다. | ||
|
||
### 질문 2. 브라우저는 어떻게 JSX 파일을 읽을 수 있나요? | ||
|
||
Babel을 통해 JSX파일이 JS파일로 변환되고, 브라우저가 읽을 수 있게 된다. | ||
|
||
### 질문 3. React에서 상태 변화가 생겼을 때 어떻게 변화를 알아챌 수 있나요? | ||
|
||
setState와 Hooks를 통해 상태 변화를 감지한다. setState는 상태를 변경하고 해당 컴포넌트의 리렌더링(re-render)을 발생시키도록 스케줄링한다. useEffect Hooks은 상태나 props가 변경될 때 특정 작업을 수행할 수 있도록 한다. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { CracoAliasPlugin } = require('react-app-alias'); | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
plugins: [ | ||
{ | ||
plugin: CracoAliasPlugin, | ||
options: { | ||
aliases: { | ||
'@components': path.resolve(__dirname, 'src/components'), | ||
'@assets': path.resolve(__dirname, 'src/assets'), | ||
'@pages': path.resolve(__dirname, 'src/pages'), | ||
'@styles': path.resolve(__dirname, 'src/styles'), | ||
'@utils': path.resolve(__dirname, 'src/utils'), | ||
}, | ||
}, | ||
}, | ||
], | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eslint-plugin-prettier github README를 보면 아래와 같은 내용이 있는데요
사용하시기 전에 이런 README를 한번씩 읽어보셔도 좋을거 같네요 ㅎㅎ