1.1.2 • Published 2 years ago

lerna-update-wizard v1.1.2

Weekly downloads
12,878
License
MIT
Repository
github
Last release
2 years ago

Lerna Update Wizard

Command line interface for simplifying the process of bulk updating dependencies across multiple Lerna or Yarn Workspace packages.

Install

$ yarn add --dev lerna-update-wizard

Or via NPM:

$ npm install --save-dev lerna-update-wizard

If installed globally, it can be used independently on any project:

$ yarn global add lerna-update-wizard

Usage

Simply run the lernaupdate command in the root of a Lerna-based project:

$ lernaupdate

Or from the outside by specifying the path to the project:

$ lernaupdate ~/projects/my-lerna-project

Or run it using npx

$ npx lerna-update-wizard

Features

Update dependencies across packages

  1. Search for and select the dependency to upgrade
  2. Select the packages in which you wish to perform the upgrade
  3. Pick the desired version to be installed for the dependency

Update dependency

Add new dependencies across packages

  1. Enter the name of a dependency not already in your project
  2. Select the packages in which to add the dependency
  3. Pick the desired version to be installed for the dependency
  4. When prompted, specify dependency type for each package (normal/dev/peer)

Add packages

Deduplicate dependencies across packages

  1. Run the command with the --dedupe option
  2. Only dependencies installed with 2 or more differing versions will be presented
  3. Complete the flow like normal (described above)

Deduplicate packages

Add/Update multiple dependencies in one session

You can batch updates for multiple dependencies into one session. Choose + Add another after you've specified the details for the first update task.

Add packages

Note: Currently not supported in --noninteractive mode.

Auto-generate Git branch & commit

  1. After installation, choose whether or not you'd like to generate a Git branch for your changes
  2. Then choose whether or not you'd like to make a separate Git commit for your changes.

    A nice commit message with details about the update version range for each affected package will be generated for you.

Git

Non-interactive mode

The script can run without prompting you for input. Simply specify the --non-interactive flag:

$ lernaupdate --non-interactive --dependency lodash@4.2.1 ./my-project

The script will tell you if you need to specify any additional input flags based on the state of your mono repo.

For instance, you might need/wish to include information about which packages to affect and which type of installation to perform if the dependency is a first-time install:

$ lernaupdate --non-interactive \
              --dependency lodash@4.2.1 \
              --packages packages/utils,packages/tools \
              --new-installs-mode dev \
              ./my-project

Note: Git features are not available for --non-interactive mode.

Yarn support

Lerna Update Wizard will automatically detect the package manager used for each package and use the appropriate one for installing the dependency.

Note: If the project root directory contains a yarn.lock file, Yarn will be used to install all packages, in order to support Yarn Workspaces.

NPM

NPM install

Yarn

Yarn install

Yarn Workspaces & lazy installation

When using Yarn Workspaces for your mono-repo, only a single installation is required in the top-level directory after changing a dependency in the package.json file for one or more sub-packages.

To achieve this single "lazy" install, which can significantly speed up the install duration, you can specify the --lazy flag.

If not specified, you will be prompted with the option to enable it at runtime, whenever use of Yarn Workspaces is detected (unless in non-interactive mode).

Notes

Lerna Update Wizard takes Lerna's packages config parameter into account if specified in lerna.json. This means that if you have your packages located in a directory other than packages/, this tool will still work, as long as their parent directory is specified.

1.1.2

2 years ago

1.1.1

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.1.0

2 years ago

0.17.8

4 years ago

0.17.7

4 years ago

0.17.6

4 years ago

0.17.5

4 years ago

0.17.4

4 years ago

0.17.3

4 years ago

0.17.2

4 years ago

0.17.1

4 years ago

0.17.0

4 years ago

0.16.0

5 years ago

0.15.1

5 years ago

0.15.0

5 years ago

0.14.0

5 years ago

0.13.0

5 years ago

0.12.0

5 years ago

0.11.1

5 years ago

0.11.0

5 years ago

0.10.0

5 years ago

0.9.4

6 years ago

0.9.3

6 years ago

0.9.2

6 years ago

0.9.1

6 years ago

0.9.0

6 years ago

0.8.0

6 years ago

0.7.1

6 years ago

0.7.0

6 years ago

0.6.0

6 years ago

0.5.0

6 years ago

0.4.0

6 years ago

0.3.0

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.1

6 years ago