๐Ÿชด ์„ฑ์žฅ์ผ์ง€

์ฑ… ํ–‰๋ณตํ•œ ์ด๊ธฐ์ฃผ์˜์ž(์›จ์ธ ๋‹ค์ด์–ด)์˜ ๋‚ด์šฉ์— ์ž๊ทน๋ฐ›์•„ ์‹œ์ž‘ํ•˜๋Š” ์†Œ๋ฐ•ํ•œ ์„ฑ์žฅ๊ธฐ๋ก

์‚ด์•„์žˆ๋Š” ๊ฝƒ๊ณผ ์ฃฝ์€ ๊ฝƒ์€ ์–ด๋–ป๊ฒŒ ๊ตฌ๋ณ„ํ•˜๋Š”๊ฐ€?
์„ฑ์žฅํ•˜๊ณ  ์žˆ๋Š” ๊ฒƒ์ด ์‚ด์•„ ์žˆ๋Š” ๊ฒƒ์ด๋‹ค.
์ƒ๋ช…์˜ ์œ ์ผํ•œ ์ฆ๊ฑฐ๋Š” ์„ฑ์žฅ์ด๋‹ค!

๐ŸŒณ ํ‚ค์›Œ๋“œ ์ตœ๋Œ€ํ•œ ๊ฐ„๋‹จํ•˜๊ฒŒ ์ •๋ฆฌ, ์ถ”ํ›„์— ๋ณด๋ฉด์„œ ์Šค์Šค๋กœ ์„ค๋ช…

Project jaybnb

์˜ค๋Š˜์€ ํ”„๋กœ์ ํŠธ ์‹œ์ž‘์— ์•ž์„œ, ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์„ ์„ธํŒ…ํ•˜๊ณ  ๊นƒํ—ˆ๋ธŒ ๋ธŒ๋žœ์น˜๋ถ€ํ„ฐ ์ปค๋ฐ‹๋ฉ”์„ธ์ง€ convention์„ ๊ณต๋ถ€ํ–ˆ๋‹ค.
์†”์งํžˆ ํ”„๋กœ์ ํŠธ ์„ธํŒ…์ด ๋ญ ์–ผ๋งˆ๋‚˜ ๋ณต์žกํ• ๊นŒ ์ƒ๊ฐํ–ˆ๋Š”๋ฐ, ์ƒ๊ฐ๋ณด๋‹ค ๊นŠ์ด ๋“ค์–ด๊ฐ€๋‹ˆ๊นŒ ์•Œ์•„๋‘๋ฉด ์ข‹์€ ๋‚ด์šฉ๋“ค์ด ์ •๋ง ๋งŽ์•˜๋‹ค.

JavaScript Webpack Babel

# npm์œผ๋กœ ํด๋”๊ด€๋ฆฌ ์‹œ์ž‘
npm init -y

# webpack ์„ค์น˜
# -D๋Š” --save-dev์™€ ๊ฐ™์œผ๋ฉฐ ๊ฐœ๋ฐœ ์˜์กด์„ฑ์„ ๊ฐ€์ง€๋ฉฐ ํŒจํ‚ค์ง€๊ฐ€ ์„ค์น˜๋œ๋‹ค.
# ๋นŒ๋“œ ์‹œ ๋ฐฐํฌ์šฉ๊ณผ ๊ฐœ๋ฐœ์šฉ์„ ๋‚˜๋ˆ„๊ธฐ ์œ„ํ•จ์ด๋‹ค.(๊ตณ์ด ๋ฐฐํฌ์šฉ์—๋Š” ์ด ํŒจํ‚ค์ง€๊ฐ€ ํ•„์š”์—†๊ธฐ ๋•Œ๋ฌธ!)
npm install -D webpack web-cli

# ๋ฐ”๋ฒจ๊ณผ ๊ด€๋ จํ•œ ํŒจํ‚ค์ง€ ๋ฐ ํ”Œ๋Ÿฌ๊ทธ์ธ ์„ค์น˜
# babel-loader๋Š” webpack์œผ๋กœ ๋ฒˆ๋“ค๋งํ•  ๋•Œ, ๋™์‹œ์— ๋ฐ”๋ฒจ๋กœ ํŠธ๋žœ์ŠคํŒŒ์ผ๋ง๊นŒ์ง€ ํ•˜๊ฒŒ ํ•ด์ฃผ๋Š”
# ๋ง ๊ทธ๋Œ€๋กœ ๋ฐ”๋ฒจ์„ ๋ถˆ๋Ÿฌ์™€์ฃผ๋Š” ๋…€์„!!(์›นํŒฉ์—์„œ ์ง€์›ํ•˜๋Š” ๋‹ค์–‘ํ•œ loader๋“ค์ด ์žˆ๋‹ค.)
npm install -D @babel/core @babel/cli @babel/preset-env babel-loader

# css-loader: webpack์œผ๋กœ jsํŒŒ์ผ์„ ๋ฒˆ๋“ค๋งํ•  ๋•Œ, jsํŒŒ์ผ์— css๋ฅผ ๋ชจ๋“ˆ์ฒ˜๋Ÿผ importํ•˜๋ฉด
# css๋„ ๊ฐ™์ด ๋ฒˆ๋“ค๋งํ•ด์ฃผ๋Š” loader
# style-loader: css-loader๋กœ ๋ฒˆ๋“ค๋ง ํ›„ ํ•ด๋‹น css ์ฝ”๋“œ๋ฅผ style ํƒœ๊ทธ์— ๋„ฃ์–ด์ฃผ๋Š” ์—ญํ• 
npm install -D css-loader style-loader

package.json(npm init ์‹œ ์ƒ์„ฑ)

{
  "name": "jaybnb",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "webpack -w" # โญ npm run build -> webpack -w๊ฐ€ ์‹คํ–‰๋˜๊ฒŒ ํ•ด์ค€๋‹ค.
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/f-lab-edu/jaybnb.git"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/f-lab-edu/jaybnb/issues"
  },
  "homepage": "https://github.com/f-lab-edu/jaybnb#readme",
  "devDependencies": {
    "@babel/cli": "^7.18.10",
    "@babel/core": "^7.19.0",
    "@babel/preset-env": "^7.19.0",
    "css-loader": "^6.7.1",
    "style-loader": "^3.3.1",
    "webpack": "^5.74.0",
    "webpack-cli": "^4.10.0"
  }
}

webpack.config.js(์›นํŒฉ ์„ค์ • ํ›„ ๋”ฐ๋กœ ๋งŒ๋“ค์–ด์ค˜์•ผํ•œ๋‹ค.)

const path = require('path');

module.exports = {
  entry: './src/js/main.js', // ๋ฒˆ๋“ค๋ง์˜ ์ž…๊ตฌ(entry)๊ฐ€ ๋˜๋Š” ํŒŒ์ผ(์ด ํŒŒ์ผ์— ์—ฌ๋Ÿฌ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ๋ชจ๋“ˆ ํŒŒ์ผ์„ importํ•˜์ž)
  output: {
    filename: 'bundle.js', // ๋ฒˆ๋“ค๋ง ํ›„ ์ƒ์„ฑ๋  js ํŒŒ์ผ
    path: path.resolve(__dirname, 'dist'), // __dirname์€ nodeJS์—์„œ ํ˜„์žฌ ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ๋‚˜ํƒ€๋‚ธ๋‹ค.
  },
  module: {
    // ๋ฒˆ๋“ค๋ง ์‹œ, ์ง„ํ–‰ํ•  ๊ทœ์น™๋“ค
    rules: [
      {
        test: /\.js$/,
        include: [path.resolve(__dirname, 'src/js')],
        exclude: /node_modules/,
        use: {
          loader: 'babel-loader',
          options: {
            presets: ['@babel/preset-env'],
          },
        },
      },
      {
        test: /\.css$/i,
        use: ['style-loader', 'css-loader'],
      },
    ],
  },
  devtool: 'source-map',
  mode: 'development',
};

Git Github

์ผ๋ฐ˜์ ์œผ๋กœ ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ ์‹œ main์—์„œ๋Š” ์ž‘์—…ํ•˜์ง€ ์•Š๋Š”๋‹ค.

  • main: ์ œํ’ˆ์œผ๋กœ ์ถœ์‹œ ๊ฐ€๋Šฅํ•œ ๋ธŒ๋žœ์น˜. ๊ฐœ๋ฐœ ์ž‘์—…์ด ์•„๋‹Œ ๋ฐฐํฌ ์ด๋ ฅ์„ ๊ด€๋ฆฌํ•˜๋Š” ๋ธŒ๋žœ์น˜๋กœ ์‚ฌ์šฉํ•œ๋‹ค.
  • develop: ๊ฐœ๋ฐœ ์ž‘์—…์„ ์œ„ํ•œ ๋ธŒ๋žœ์น˜๋กœ ๊ฐ ๊ธฐ๋Šฅ์— ๋งž๋Š” ์ƒˆ๋กœ์šด branch๋ฅผ ์žก๊ณ  develop์— mergeํ•˜๋ฉด์„œ ์ง„ํ–‰ํ•œ๋‹ค.
    • feature/aaa: aaa๋ผ๋Š” ๊ธฐ๋Šฅ์„ ๊ฐœ๋ฐœํ•˜๊ธฐ ์œ„ํ•œ ๋ธŒ๋žœ์น˜
    • release-1.2: ์ด๋ฒˆ ์ถœ์‹œ ๋ฒ„์ „(1.2)์„ ์ค€๋น„ํ•˜๋Š” ๋ธŒ๋žœ์น˜
    • hotfix-1.2.1: ์ถœ์‹œ ๋ฒ„์ „์—์„œ ๊ธ‰ํ•˜๊ฒŒ ๋ฒ„๊ทธ๋ฅผ ์žก์„ ๋•Œ ์‚ฌ์šฉํ•˜๋Š” ๋ธŒ๋žœ์น˜(1.2๋ฒ„์ „์„ ์ˆ˜์ •ํ•˜์—ฌ 1.2.1๋กœ ์—…๊ทธ๋ ˆ์ด๋“œ)

์ปค๋ฐ‹ ๋ฉ”์‹œ์ง€ ์ปจ๋ฒค์…˜

type: subject

body

footer

type

  • feat: ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ์ถ”๊ฐ€
  • fix: ๋ฒ„๊ทธ ์ˆ˜์ •
  • docs: ๋ฌธ์„œ ์ˆ˜์ •
  • style: ์ฝ”๋“œ ํฌ๋งทํŒ…, ์„ธ๋ฏธ์ฝœ๋ก  ๋ˆ„๋ฝ, ์ฝ”๋“œ ๋ณ€๊ฒฝ์ด ์—†๋Š” ๊ฒฝ์šฐ
  • refactor: ์ฝ”๋“œ ๋ฆฌํŒฉํ† ๋ง ํ•œ ๊ฒฝ์šฐ
  • test: ํ…Œ์ŠคํŠธ ์ฝ”๋“œ, ๋ฆฌํŽ™ํ† ๋ง ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ์ถ”๊ฐ€ํ•œ ๊ฒฝ์šฐ
  • chore: ๋นŒ๋“œ ์—…๋ฌด ์ˆ˜์ •, ํŒจํ‚ค์ง€ ๋งค๋‹ˆ์ € ์ˆ˜์ • ๋“ฑ

subject

์ œ๋ชฉ์€ 50์ž๋ฅผ ๋„˜๊ธฐ์ง€ ์•Š์œผ๋ฉฐ, ์ฒซ ๊ธ€์ž๋Š” ๋Œ€๋ฌธ์ž, ๋งˆ์นจํ‘œ๋Š” ๋ถ™์ด์ง€ ์•Š๋Š”๋‹ค.
๋˜ํ•œ, ๊ณผ๊ฑฐ ์‹œ์ œ๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ  ๋ช…๋ น์–ด๋กœ ์ž‘์„ฑํ•œ๋‹ค.

body

์„ ํƒ์‚ฌํ•ญ์ด๋ฉฐ 72์ž ์ดํ•˜, ์ œ๋ชฉ๊ณผ ๊ตฌ๋ถ„์„ ์œ„ํ•ด ํ•œ ์ค„ ๋„์šด๋‹ค.
๋ถ€์—ฐ์„ค๋ช…, ์ปค๋ฐ‹์˜ ์ด์œ  ๋“ฑ์„ ์ ๋Š”๋‹ค.

์„ ํƒ์‚ฌํ•ญ์ด๋ฉฐ ์ฃผ๋กœ issue tracker id๋ฅผ ์ž‘์„ฑํ•  ๋•Œ ์‚ฌ์šฉํ•œ๋‹ค.

์˜ˆ์‹œ) ์‚ฌ์‹ค์ƒ body์™€ footer๋Š” ํ•„์ˆ˜๊ฐ€ ์•„๋‹ˆ๋‹ค.

feat: Add abcdef
chore: Build dev-env

๊ฐœ๋ฐœ ํ™˜๊ฒฝ ์„ธํŒ…์€ ๋ฐ˜๋“œ์‹œ ๊ณต์‹ ๋ฌธ์„œ๋ฅผ ์ฐธ๊ณ ํ•˜๋ฉด์„œ ๋‚ด ํ”„๋กœ์ ํŠธ์— ํ•„์š”ํ•œ ํ™˜๊ฒฝ์„ ์ƒ๊ฐํ•˜์—ฌ ์ž‘์„ฑํ•˜๋„๋ก ํ•˜์ž! ์‹œ๊ฐ„์ด ๊ฑธ๋ ค๋„ ๊ธฐ์ดˆ๋ฅผ ๋‹ค์ ธ๋†“๊ณ  ์–ด๋–ป๊ฒŒ ํ”„๋กœ์ ํŠธ๋ฅผ ๊ตฌ์„ฑํ•˜๊ณ  ์„ค๊ณ„ํ• ์ง€๋ฅผ ๊ณ ๋ฏผํ•˜๊ณ  ์‹œ์ž‘ํ•  ์ˆ˜ ์žˆ๋„๋ก! ํ’€๋ฆฌํ€˜์ŠคํŠธ, ์ปค๋ฐ‹ ์ปจ๋ฒค์…˜์€ ์ตœ๋Œ€ํ•œ ์ฐพ์•„๋ณด๋ฉด์„œ ์ต์ˆ™ํ•ด์ง€๋Š” ๊ฒŒ ์ข‹์„ ๊ฒƒ ๊ฐ™๋‹ค.