Skip to content
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

Chore/scaffolding #2

Merged
merged 12 commits into from
Oct 10, 2022
Merged

Chore/scaffolding #2

merged 12 commits into from
Oct 10, 2022

Conversation

eunddodi
Copy link
Collaborator

@eunddodi eunddodi commented Oct 7, 2022

closes #1

๐Ÿฅ“ React Native ์„ธํŒ… ๋ฐฉ๋ฒ•

๋งฅ(Mac)์— react native ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ๊ตฌ์ถ•ํ•˜๊ธฐ
์œ„ ๊ธ€์—์„œ react-native ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ ๋ฐ ํ™•์ธ ์ „๊นŒ์ง€ ์ง„ํ–‰ํ•ด์ฃผ์‹œ๊ณ  ์•„๋ž˜ ๋ช…๋ น์–ด๋Œ€๋กœ ํ•ด์ฃผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค!

git clone [๋ ˆํฌ์ง€ํ† ๋ฆฌ ์ฃผ์†Œ]

yarn set version berry
yarn install
npx pod-install

yarn start
react-native run-ios # build ios
react-native run-android # build android

์•ˆ๋“œ๋กœ์ด๋“œ ์—๋ฎฌ๋ ˆ์ดํ„ฐ์™€ Xcode ์‹œ๋ฎฌ๋ ˆ์ดํ„ฐ์— React Native ์ดˆ๊ธฐ ํ™”๋ฉด์ด ๋‚˜์˜ค๋ฉด ์„ฑ๊ณต์ž…๋‹ˆ๋‹ค๐Ÿ‘๐Ÿป ์ œ๊ฐ€ ํ•ด๋ดค์„ ๋•Œ๋Š” ๋ฌธ์ œ ์—†์ด ์ž˜ ๋นŒ๋“œ๋๋Š”๋ฐ, ์ €๋Š” ์ด๋ฏธ ์ปดํ“จํ„ฐ์— RN ์„ธํŒ…์ด ๋˜์–ด์žˆ๋˜ ์ƒํƒœ๋ผ์„œ ์ข€ ๋‹ค๋ฅผ ์ˆ˜๋„ ์žˆ์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ์ž˜ ์•ˆ๋œ๋‹ค๋ฉด ๋ฐ”๋กœ ์•Œ๋ ค์ฃผ์„ธ์š”..

๐Ÿฅ“ ์Šค์บํด๋”ฉ ๋‚ด์šฉ

๋ฏผ๊ทœ๋‹˜์ด ํ•ด์ฃผ์‹  ์Šค์บํด๋”ฉ๊ณผ ์˜๊ฐํƒฑ RN ๋ ˆํฌ์ง€ํ† ๋ฆฌ๋ฅผ ์ฐธ๊ณ ํ–ˆ์Šต๋‹ˆ๋‹ค ๐Ÿซ 

React Native ์„ธํŒ…

yarn ๊ณต์‹ ์‚ฌ์ดํŠธ๋ฅผ ํ™•์ธํ•ด๋ณด๋ฉด Plugโ€™nโ€™Play install์€ React Native์™€ incompatibleํ•˜๋‹ค๊ณ  ๋ช…์‹œ๋˜์–ด ์žˆ๋”๋ผ๊ตฌ์š”. ๊ทธ๋ž˜์„œ ์•ˆ๋‚ด๋œ ๋Œ€๋กœ node_modules plugin์„ ์‚ฌ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค.

yarn install ์‹œ .yarn/cache๋ฅผ ์ฒดํฌํ•ด์„œ node_modules ํด๋”๋ฅผ ์ƒ์„ฑํ•œ๋‹ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ์˜์กด์„ฑ์„ ์ƒˆ๋กœ ๋‹ค์šด ๋ฐ›๋Š” ๊ฑด ์•„๋‹ˆ๊ธฐ ๋•Œ๋ฌธ์— ์ˆœ์ˆ˜ PnP์™€ ๋น„๊ตํ–ˆ์„ ๋•Œ ์‹œ๊ฐ„ ์ฐจ์ด๋Š” ํฌ์ง€ ์•Š๋‹ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค!

eslint

๋ฏผ๊ทœ๋‹˜ eslint์™€ ๋™์ผํ•˜๊ฒŒ ์„ค์ •ํ•˜๋˜ NextJS ๊ด€๋ จ ๋ถ€๋ถ„์„ ์ œ์™ธํ•˜๊ณ  RN plugin ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค.

Husky

  • lint-staged ์ ์šฉ
  • commitlint ์ ์šฉ

prettier์˜ ๊ฒฝ์šฐ lint-staged๋กœ ํ•œ ๋ฒˆ์— ์ ์šฉ ๊ฐ€๋Šฅํ•˜๋‹ค๊ณ  ํ•ด์„œ, ๋ณ„๋„๋กœ ์ถ”๊ฐ€ํ•˜์ง„ ์•Š์•˜์Šต๋‹ˆ๋‹ค.

Github Actions

  • CI
    • ์˜์กด์„ฑ ์„ค์น˜ ๋ฐ ์บ์‹ฑ
    • Lint ์ฒดํฌ
  • auto_assign

์ ˆ๋Œ€๊ฒฝ๋กœ(babel-plugin-module-resolver)

srcํด๋”์˜ ํ•˜์œ„ ํด๋”๋“ค์„ @ํด๋”๋ช…์œผ๋กœ ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ๊ฒŒ ์„ค์ • ํ•ด๋†“์•˜์Šต๋‹ˆ๋‹ค! ๊ฐ€์žฅ ๊ธฐ๋ณธ์ ์ธ ํด๋”๋“ค์˜ ๊ฒฝ๋กœ๋งŒ ์ถ”๊ฐ€ํ•ด๋‘” ์ƒํƒœ๋ผ, ์›ํ•˜์‹œ๋ฉด babel.config.js ํŒŒ์ผ์—์„œ ์ถ”๊ฐ€ํ•˜์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

etc

  • dotenv ํ™˜๊ฒฝ๋ณ€์ˆ˜(react-native-dotenv)
  • CODEOWNERS
  • PR ํ…œํ”Œ๋ฆฟ

References

PnP compatibility table
react-native-community : yarn PnP ์ง€์› ๊ด€๋ จ issue
How to use Yarn 3 with React Native
Prettier: Pre-commit Hook

@eunddodi
Copy link
Collaborator Author

eunddodi commented Oct 7, 2022

๋น ๋œจ๋ ธ๊ฑฐ๋‚˜ ์ ์šฉ ์•ˆ๋œ ๋ถ€๋ถ„์ด ์žˆ๋‹ค๋ฉด ์•Œ๋ ค์ฃผ์‹ญ์‡ผ ๐Ÿ™€

@eunddodi eunddodi self-assigned this Oct 7, 2022
Copy link
Member

@hyesungoh hyesungoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๊ณ ์ƒํ•˜์…จ์–ด์š”!

๐Ÿ’ฏ ๐Ÿฅ‡

tsconfig.json Outdated
Comment on lines 6 to 12
"baseUrl": "./src",
"paths": {
"~/*": ["./*"],
"@components/*": ["components/*"],
"@screens/*": ["screens/*"],
"@assets/*": ["assets/*"],
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด ๋ถ€๋ถ„ ์›น ํ”„๋กœ์ ํŠธ ์ฒ˜๋Ÿผ @/์œผ๋กœ ํ†ต์ผํ•ด๋„ ์ข‹์„ ๊ฑฐ ๊ฐ™์œผ๋‚˜, ์ด๋Œ€๋กœ ๊ฐ€๋„ ์ข‹์•„์š”!

package.json Outdated
"postinstall": "husky install"
},
"dependencies": {
"@types/react-native-dotenv": "^0.2.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"@types/react-native-dotenv": "^0.2.0",
devDependencies: {
...
"@types/react-native-dotenv": "^0.2.0",
...
}

๊ฐœ๋ฐœ ์˜์กด์„ฑ์œผ๋กœ ์˜ฎ๊ฒจ๋„ ๋  ๊ฑฐ ๊ฐ™์•„์š”!

@@ -0,0 +1 @@
nodeLinker: node-modules
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๐Ÿ’ฏ

package.json Outdated
"@types/react-native-dotenv": "^0.2.0",
"react": "18.1.0",
"react-native": "0.70.1",
"react-native-dotenv": "^3.3.1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ถ”๊ฐ€์ ์œผ๋กœ react-native-webview ์„ค์น˜ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ถ”๊ฐ€์ ์œผ๋กœ react-native-webview ์„ค์น˜ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค!

๋„ต ํ˜œ์„ฑ๋‹˜์ด ๋ฐฐํฌํ•˜์‹  ๊ทธ ๋งํฌ๋กœ ์šฐ์„  ์„ธํŒ…ํ•ด๋†“๊ฒ ์Šต๋‹ˆ๋‹ค~!

eunddodi added 4 commits October 8, 2022 23:17
- react-native-dotenv devDependency๋กœ ์ด๋™
- ์ ˆ๋Œ€๊ฒฝ๋กœ ์›น ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์™€ ํ†ต์ผ
@hyesungoh hyesungoh self-requested a review October 9, 2022 08:52
Copy link
Member

@hyesungoh hyesungoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๊ณ ์ƒํ•˜์…จ์–ด์š”!! ๐Ÿ‘ ๐Ÿ’ฏ ๐Ÿฅ‡ ๐Ÿ‘ ๐Ÿ’ฏ ๐Ÿฅ‡ ๐Ÿ‘ ๐Ÿ’ฏ ๐Ÿฅ‡

Comment on lines +11 to +13
<SafeAreaView style={{ flex: 1 }}>
<WebView source={{ uri: BASE_URL }} />
</SafeAreaView>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘

@eunddodi eunddodi merged commit 0ca45be into main Oct 10, 2022
@eunddodi eunddodi deleted the chore/scaffolding branch October 10, 2022 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

๊ฐœ๋ฐœ ํ™˜๊ฒฝ ์„ธํŒ…
2 participants