Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Erik Guzman
Erik Guzman

Posted on

     

Zeal 11/1/2019 - Learning Lerna with Matti

Checkout the stream @https://www.twitch.tv/codingzeal

What the VOD of the whole stream to follow along:
https://www.twitch.tv/videos/502681554

Today Objectives

  • [x] Learn about Lerna
  • [x] Learn about mono-repos

Notes

  • Mono-repos: Some reason why you might one to use them.
    • One place to test and manage packages
    • One place to file and manage issues
  • If you want to customize yourcreate-react-app webpack con
  • esm - YOU DONT HAVE TO USE BABEL WITH THIS!!!https://www.npmjs.com/package/esmThe brilliantly simple, babel-less, bundle-less ECMAScript module loader.
  • Level up your command line with more information:https://starship.rs
  • Lerna
    • Help manage multiple package in your mono-repo
    • If you use Yarn workspaces with lerna it will host all dependencies to top level for you. Reduces a lot of node_modules to install
      • Just have to tweak lerna.json and package.json to make the dream happen
    • create-react-app for yarn workspaces, if doesnt work out of the box
    • Something to look over about using lerna with Rails and React front-end, maybe good idea?
    • Commands:https://github.com/lerna/lerna/tree/master/commands
      • npx lerna init - to generate you project
      • lerna create common - scaffolds out package, like npm init
      • lerna import - Import existing packages into lerna for you
      • lerna exec — command_to_run - Runs a shell command in all packages
      • lerna add package_name —scope={other_packge_name} - Add a package dependency and link to other packages in lerna
      • lerna bootstrap - like yarn/npm install
        • lerna bootstrap —hosit - "Hoists" up common dependencies to top level node_modules
      • lerna diff - Like git diff between release version
      • lerna ls - Show public packages for your repos
      • lerna add package_name - Installs a package to all projects
        • lerna add —scope={packages_to_instal_to, another_package}
      • lerna clean - Automatically delete node_modules in all packages
      • lerna run command_name - Runs a package command in all your packages

Shoutouts and Thanks

  • Matti for walking us through lerna and monorepos AND having some great examples to work through

Future action items

  • [ ] Try out lerna on my own projects!!!!

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Developer, streamer, Microsoft MVP and Twitch dev contributer. I love to code and share the knowledge. Check me out at https://www.twitch.tv/talk2megooseman
  • Location
    San Diego
  • Work
    Full Stack Engineer at Coding Zeal
  • Joined

More fromErik Guzman

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp