next-updateパッケージは、Node.jsパッケージが依存しているパッケージを一時的に最新バージョンに更新し、設定済みのテストを走らせるツール。これによりd(evD)ependenciesを上げても大丈夫かどうかをほぼ確実に確認できる。グローバルにインストールしてコマンドラインから利用する。
Node.jsパッケージのリポジトリで実行するだけであとは勝手にやってくれる。実行すると以下の様にひとつずつ最新バージョンをインストール→テスト→元のバージョンに戻すを繰り返してくれる。
next-update - Tests if module's dependencies can be updated to latest version
version: 0.4.5
author: {"name":"Gleb Bahmutov","email":"gleb.bahmutov@gmail.com"}
checking if the current state works
npm test
current state works
module's current dependencies:
package available
-------- ---------
js-yaml 2.1.3
nodeunit 0.8.2
checking NPM registry
available updates:
package available
-------- ---------
js-yaml 3.0.2
nodeunit 0.9.0
update stats from http://next-update.herokuapp.com
testing js-yaml@3.0.2
could not get update stats js-yaml
installing js-yaml@3.0.2
js-yaml@3.0.2 installed successfully
npm test
js-yaml@3.0.2 works
installing js-yaml@2.1.3
js-yaml@2.1.3 installed successfully
testing nodeunit@0.9.0
could not get update stats nodeunit
installing nodeunit@0.9.0
nodeunit@0.9.0 installed successfully
npm test
nodeunit@0.9.0 works
installing nodeunit@0.8.2
nodeunit@0.8.2 installed successfully
next updates:
js-yaml 3.0.2
nodeunit 0.9.0
Use the following command to install working versions
npm install --save js-yaml@3.0.2
npm install --save-dev nodeunit@0.9.0
最後に更新可能ならインストールのコマンドをdependenciesとdevDependenciesに分けて表示してくれる。それらをコピペで実行すれば最新バージョンのインストールとpackage.jsonの更新が完了。
Node.jsパッケージの依存パッケージが古いかどうかを教えてくれるコマンドやサービスはあるけど、上げても大丈夫かの確認は自分で面倒を見ないとならない。next-updateはその作業を大幅に軽減してくれそうで、機会があったら是非使ってみたい。とはいうもののd(evD)ependenciesは動いてるならそれで良くて、どうしても必要でなければ上げなくても良いと考えているので、なかなか出番はなさそうではある。