Package.json 정리

­Valentine·2021년 11월 27일
0

Project

목록 보기
7/7
post-thumbnail
post-custom-banner

정리 전

frontend

{
  "name": "frontend",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/react": "^11.1.0",
    "@testing-library/user-event": "^12.1.10",
    "@types/jest": "^26.0.15",
    "@types/paper": "^0.12.3",
    "@types/react-copy-to-clipboard": "^5.0.2",
    "@types/react-dom": "^17.0.0",
    "ansi-regex": "5.0.1",
    "howler": "^2.2.3",
    "paper": "^0.12.15",
    "react": "^17.0.2",
    "react-copy-to-clipboard": "^5.0.4",
    "react-dom": "^17.0.2",
    "react-router-dom": "^5.3.0",
    "react-scripts": "^4.0.3",
    "socket.io-client": "^4.3.2",
    "styled-components": "^5.3.3",
    "typescript": "^4.1.2",
    "web-vitals": "^1.0.1"
  },
  "scripts": {
    "start": "craco start",
    "build": "craco build",
    "test": "craco test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "@craco/craco": "^6.4.0",
    "@types/dotenv": "^8.2.0",
    "@types/howler": "^2.2.4",
    "@types/node": "^12.20.36",
    "@types/react": "^17.0.33",
    "@types/react-router-dom": "^5.3.2",
    "@types/styled-components": "^5.1.15",
    "craco-alias": "^3.0.1",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-prettier": "^4.0.0",
    "prettier": "^2.4.1",
    "react-google-login": "^5.2.2",
    "styled-reset": "^4.3.4",
    "yarn-audit-fix": "^7.1.3"
  }

backend

{
  "name": "backend",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "dev": "cross-env NODE_ENV=development ts-node -r tsconfig-paths/register app.ts",
    "service": "cross-env NODE_ENV=production ts-node -r tsconfig-paths/register app.ts"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@types/dotenv": "^8.2.0",
    "@typescript-eslint/eslint-plugin": "^5.2.0",
    "@typescript-eslint/parser": "^5.2.0",
    "eslint": "^7.2.0",
    "eslint-config-airbnb-base": "^14.2.1",
    "eslint-config-prettier": "^8.3.0",
    "eslint-import-resolver-typescript": "^2.5.0",
    "eslint-plugin-import": "^2.22.1",
    "eslint-plugin-prettier": "^4.0.0",
    "mysql": "^2.18.1",
    "mysql2": "^2.3.2",
    "prettier": "2.4.1",
    "sequelize": "^6.9.0",
    "sequelize-auto": "^0.8.5",
    "sequelize-cli": "^6.2.0",
    "ts-node": "^10.4.0",
    "tsc": "^2.0.3",
    "typescript": "^4.4.4"
  },
  "dependencies": {
    "@types/cookie-parser": "^1.4.2",
    "@types/cors": "^2.8.12",
    "@types/express": "^4.17.13",
    "@types/multer": "^1.4.7",
    "@types/node": "^16.11.6",
    "@types/socket.io": "^3.0.2",
    "cors": "^2.8.5",
    "cross-env": "^7.0.3",
    "express": "^4.17.1",
    "multer": "^1.4.3",
    "path": "^0.12.7",
    "socket.io": "^4.3.2"
  }
}

정렬 기준

  • devDependencies에는 컴파일시에 필요한 것이나 개발시에 필요한 것을 위주로 정리
  • dependencies에는 서비스 운용중에 필요한 것 위주로 정리
  • DB, cors, socket, .env, OAuth 등은 dependencies
  • eslint, prettier, react, typescript 등은 devDependencies

정렬 코드(알파벳 순)

npx sort-package-json

정리 후

frontend

{
  "name": "frontend",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "build": "craco build",
    "eject": "react-scripts eject",
    "start": "craco start",
    "test": "craco test"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "dependencies": {
    "@types/dotenv": "^8.2.0",
    "@types/howler": "^2.2.4",
    "@types/paper": "^0.12.3",
    "@types/react-copy-to-clipboard": "^5.0.2",
    "howler": "^2.2.3",
    "paper": "^0.12.15",
    "react-copy-to-clipboard": "^5.0.4",
    "react-google-login": "^5.2.2",
    "socket.io-client": "^4.3.2"
  },
  "devDependencies": {
    "@craco/craco": "^6.4.0",
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/react": "^11.1.0",
    "@testing-library/user-event": "^12.1.10",
    "@types/jest": "^26.0.15",
    "@types/node": "^12.20.36",
    "@types/react": "^17.0.33",
    "@types/react-dom": "^17.0.0",
    "@types/react-router-dom": "^5.3.2",
    "@types/styled-components": "^5.1.15",
    "ansi-regex": "5.0.1",
    "craco-alias": "^3.0.1",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-prettier": "^4.0.0",
    "prettier": "^2.4.1",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-intersection-observer": "^8.32.3",
    "react-router-dom": "^5.3.0",
    "react-scripts": "^4.0.3",
    "styled-components": "^5.3.3",
    "styled-reset": "^4.3.4",
    "typescript": "^4.1.2",
    "web-vitals": "^1.0.1",
    "yarn-audit-fix": "^7.1.3"
  }
}

backend

{
  "name": "backend",
  "version": "1.0.0",
  "description": "",
  "keywords": [],
  "license": "ISC",
  "author": "",
  "main": "index.js",
  "scripts": {
    "dev": "cross-env NODE_ENV=development ts-node -r tsconfig-paths/register app.ts",
    "service": "cross-env NODE_ENV=production ts-node -r tsconfig-paths/register app.ts"
  },
  "dependencies": {
    "@types/cors": "^2.8.12",
    "@types/dotenv": "^8.2.0",
    "@types/socket.io": "^3.0.2",
    "cors": "^2.8.5",
    "mysql": "^2.18.1",
    "mysql2": "^2.3.2",
    "sequelize": "^6.9.0",
    "sequelize-auto": "^0.8.5",
    "sequelize-cli": "^6.2.0",
    "socket.io": "^4.3.2"
  },
  "devDependencies": {
    "@types/cookie-parser": "^1.4.2",
    "@types/express": "^4.17.13",
    "@types/multer": "^1.4.7",
    "@types/node": "^16.11.6",
    "@typescript-eslint/eslint-plugin": "^5.2.0",
    "@typescript-eslint/parser": "^5.2.0",
    "cross-env": "^7.0.3",
    "eslint": "^7.2.0",
    "eslint-config-airbnb-base": "^14.2.1",
    "eslint-config-prettier": "^8.3.0",
    "eslint-import-resolver-typescript": "^2.5.0",
    "eslint-plugin-import": "^2.22.1",
    "eslint-plugin-prettier": "^4.0.0",
    "express": "^4.17.1",
    "multer": "^1.4.3",
    "path": "^0.12.7",
    "prettier": "2.4.1",
    "ts-node": "^10.4.0",
    "tsc": "^2.0.3",
    "typescript": "^4.4.4"
  }
}
profile
천체관측이 취미
post-custom-banner

0개의 댓글