update-versions
Like npm-check-updates but supports Lerna monorepos and enforces strict semver values
Last updated 5 days ago by royston .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install update-versions 
SYNC missed versions from official npm registry.

update-versions

Like npm-check-updates but supports Lerna monorepos and enforces strict semver values

Repository is on GitLab Coverage View dependencies as 2D chart Downloads/Month Code style: prettier MIT License

update

Table of Contents

Install

npm i -g update-versions

Then, call it from the command line using keyword:

upd

TLDR

Update all dependencies on all packages in a monorepo — or single repo — to be the latest as per npm.

Different kinds of monorepos

Here's where life is different between front-end web dev/React/SPA and npm Open Source package worlds: open source JS programs very rarely need any intervention after updating dependencies, even after updates to new major releases. Front-end, React, SPA packages, on other hand, are very fragile — even minor version bump in a dependency can break everything.

Here it assumed you'll always want to update all dependencies to the latest and patch any bugs right away.

That's why using upd in Open Source npm package monorepos is a wise idea but using it in React component monorepos, it's, well, a questionable idea.

PS. Notice how create-react-app uses fixed deps (no caret ^) and gives instructions how to update. Front-end world is fragile!

⬆ back to top

What update-versions does

This CLI will iterate all package.json in a given path and its sub-paths and process each dev- and normal dependency:

  • If it's a monorepo setup and if another package in monorepo exists with such name, that version is set in ^x.x.x format
  • In all other cases, value from npm is fetched using pacote and that value is set in ^x.x.x format

This CLI is a good idea in Lerna monorepos full of owned npm packages (where you bump versions often and effortlessly) but a bad idea in React SPA's (where single minor update might break many things and updating dependencies is a big, complex deal).

⬆ back to top

Opinionated part 1

Lerna bootstrap will not work properly if each dependency is not prefixed with ^, as in ^x.y.z. It's hard to manually enforce that all monorepo packages should have all dependencies in this format. update-versions will force this format.

One exception - if its dependency's value starts with file:.

⬆ back to top

Opinionated part 2

If any dependency is listed on both dependencies and devDependencies, it will be removed from the latter list. It's common sense but we mention this "extra".

Opinionated part 3

If Lerna build goes wrong, key called gitHead is created in package.json. Lerna normally cleans it up but if things go wrong, key might be left there. This CLI removes key called gitHead if such exists, in every processed package.json.

⬆ back to top

Contributing

  • If you see an error, raise an issue.
  • If you want a new feature but can't code it up yourself, also raise an issue. Let's discuss it.
  • If you tried to use this package, but something didn't work out, also raise an issue. We'll try to help.
  • If you want to contribute some code, fork the monorepo via GitLab, then write code, then file a pull request on GitLab. We'll merge it in and release.

In monorepo, npm libraries are located in packages/ folder. Inside, the source code is located either in src/ folder (normal npm library) or in the root, cli.js (if it's a command-line application).

The npm script "dev", the "dev": "rollup -c --dev" builds the development version retaining all console.logs with row numbers. It's handy to have js-row-num-cli installed globally so you can automatically update the row numbers on all console.logs.

⬆ back to top

Licence

MIT License

Copyright (c) 2015-2020 Roy Revelt and other contributors

uses adapted p-progress, MIT Licence, Copyright (c) Sindre Sorhus https://github.com/sindresorhus/p-progress/blob/master/license

Current Tags

  • 2.4.17                                ...           latest (5 days ago)

72 Versions

  • 2.4.17                                ...           5 days ago
  • 2.4.16                                ...           2 months ago
  • 2.4.15                                ...           3 months ago
  • 2.4.14                                ...           3 months ago
  • 2.4.13                                ...           3 months ago
  • 2.4.12                                ...           3 months ago
  • 2.4.11                                ...           3 months ago
  • 2.4.10                                ...           3 months ago
  • 2.4.9                                ...           3 months ago
  • 2.4.8                                ...           4 months ago
  • 2.4.7                                ...           4 months ago
  • 2.4.6                                ...           4 months ago
  • 2.4.5                                ...           4 months ago
  • 2.4.4                                ...           4 months ago
  • 2.4.3                                ...           5 months ago
  • 2.4.2                                ...           5 months ago
  • 2.4.1                                ...           6 months ago
  • 2.4.0                                ...           6 months ago
  • 2.3.7                                ...           6 months ago
  • 2.3.6                                ...           7 months ago
  • 2.3.5                                ...           7 months ago
  • 2.3.4                                ...           7 months ago
  • 2.3.3                                ...           8 months ago
  • 2.3.2                                ...           8 months ago
  • 2.3.1                                ...           8 months ago
  • 2.3.0                                ...           9 months ago
  • 2.2.8                                ...           9 months ago
  • 2.2.7                                ...           9 months ago
  • 2.2.6                                ...           9 months ago
  • 2.2.5                                ...           9 months ago
  • 2.2.4                                ...           10 months ago
  • 2.2.3                                ...           10 months ago
  • 2.2.2                                ...           10 months ago
  • 2.2.1                                ...           10 months ago
  • 2.2.0                                ...           10 months ago
  • 2.1.0                                ...           10 months ago
  • 2.0.1                                ...           10 months ago
  • 2.0.0                                ...           a year ago
  • 1.5.13                                ...           a year ago
  • 1.5.12                                ...           a year ago
  • 1.5.11                                ...           a year ago
  • 1.5.10                                ...           a year ago
  • 1.5.9                                ...           a year ago
  • 1.5.8                                ...           a year ago
  • 1.5.7                                ...           a year ago
  • 1.5.6                                ...           a year ago
  • 1.5.4                                ...           a year ago
  • 1.5.3                                ...           a year ago
  • 1.5.2                                ...           a year ago
  • 1.5.1                                ...           a year ago
  • 1.5.0                                ...           a year ago
  • 1.4.4                                ...           a year ago
  • 1.4.3                                ...           a year ago
  • 1.4.2                                ...           a year ago
  • 1.4.1                                ...           a year ago
  • 1.4.0                                ...           a year ago
  • 1.3.14                                ...           a year ago
  • 1.3.13                                ...           a year ago
  • 1.3.12                                ...           a year ago
  • 1.3.11                                ...           a year ago
  • 1.3.10                                ...           a year ago
  • 1.3.9                                ...           a year ago
  • 1.3.8                                ...           a year ago
  • 1.3.7                                ...           a year ago
  • 1.3.4                                ...           a year ago
  • 1.3.3                                ...           a year ago
  • 1.3.2                                ...           2 years ago
  • 1.3.1                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
  • 1.2.2                                ...           2 years ago
  • 1.2.1                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 35
Last Day 0
Last Week 35
Last Month 1
Dependencies (14)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |