Giter Site home page Giter Site logo

sample-lerna-npm's Introduction

demo how to use lerna with npm

test environment

[email protected] [email protected]

init

If init with 'lerna init', remember to change below:

  1. config 'packages' and 'useWorkspaces=false' in lerna.json
  2. remove 'workspaces' config in package.json
    Reference: https://lerna.js.org/docs/api-reference/configuration
    workspace only works with yarn, it is default option for lerna init.

list

> npx lerna list
lerna notice cli v5.4.2
footer
header
mix
lerna success found 3 packages

if the found packages number is 0, check configurations!

bootstrap

npx lerna bootstrap

it will run 'npm install in each sub package, and link local depends.

run

npm lerna run build

it will run 'npm run build' in each sub pacakge if it has such 'build script'.

publish

npm lerna publish
npm lerna publish --registry=<url>
  1. workspace should be clean
  2. it will bump up version in lerna.json, and change version for all packages
  3. it will commit, tag, and push to remote git
  4. it will publish package to registry

clean

npx clean

remove all node_modules in all packages. If you want to also clean git status:

git clean -xfd
git reset --hard

other commands

https://lerna.js.org/docs/api-reference/commands

sample-lerna-npm's People

Contributors

gengshenghong avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.