# Lerna

# Setup

yarn global add lerna
lerna init

lerna.json

{
  "lerna": "2.11.0",
  "packages": ["packages/*"],
  "version": "0.0.0",
  "npmClient": "yarn",
  "useWorkspaces": true
}

package.json

{
  "private": true,
  "workspaces": ["packages/*"]
}
yarn
lerna bootstrap

# command

# run command for each packages

lerna exec yarn test # with console
lerna run test # with NO console

# γƒˆγƒƒγƒ—γ«ι›†η΄„γ—γ¦γ‚‚ε•ι‘Œγͺさそうγͺパッケージパヒ

  • babel-core
  • babel-jest
  • babel-preset-env
  • eslintι–’δΏ‚
  • jest
  • regenerator-runtime (babel-jest γŒδ½Ώη”¨)

# 参考

One vs. manyβ€Šβ€”β€ŠWhy we moved from multiple git repos to a monorepo and how we set it up (opens new window)