-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
83 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,15 +56,15 @@ in the folder with module *foo*. Here is the example output: | |
0.2.6 PASS | ||
0.2.7 PASS | ||
0.2.8 PASS | ||
|
||
> next updates: | ||
express 3.21.2 -> 4.15.3 | ||
async 3.21.2 -> 0.2.8 | ||
|
||
> kept working updates | ||
|
||
If your tests pass, the dependencies will be upgraded to the new working versions in | ||
*package.json* and the *node_modules* folder. | ||
|
||
Both *package.json* file and *node_modules* folder are left unchanged, | ||
and now you know that you can safely upgrade both libraries to later versions. | ||
|
||
#### It even tells you the install command ;) | ||
|
||
Use the following command to install working versions | ||
npm install --save [email protected] | ||
|
||
This might not appear like a big deal for a single module that is using | ||
popular 3rd party libraries with stable apis only. *next-update* is most useful | ||
|
@@ -89,29 +89,30 @@ grunt-bump 0.0.13 0.0.12 100% 4 | |
|
||
### Install | ||
|
||
You can install this tool globally: | ||
You can install this tool globally | ||
|
||
npm install -g next-update // install module globally | ||
next-update --help // show command line options | ||
npm install -g next-update // installs module globally | ||
next-update --help // shows command line options | ||
|
||
Then run inside any package folder: | ||
Then run inside any package folder | ||
|
||
/git/my-awesome-module | ||
$ next-update | ||
|
||
Or you can use this module as a devDependency and a script command: | ||
Or you can use this module as a devDependency and a script command | ||
|
||
npm install --save-dev next-update | ||
|
||
```json | ||
{ | ||
"scripts": { | ||
"next-update": "next-update --tldr" | ||
"next-update": "next-update -k true --tldr" | ||
} | ||
} | ||
``` | ||
|
||
This command will use the `--tldr` flag, which causes it to be less verbose when run. | ||
This command will keep the successfuly version upgrades in the package.json file, | ||
but will not be very verbose when run. | ||
|
||
### Anonymous usage collection | ||
|
||
|
@@ -230,8 +231,7 @@ like this `changed foo` (*foo* is package name) | |
* install new versions of the desired modules using standard `npm i dependency@version --save` | ||
* You can use custom test command, for example `next-update -t "grunt test"` | ||
* `npm test` is used by default. | ||
* You can disable the behavior to automatically upgrade to new working versions by passing | ||
the `--keep false` option. | ||
* You can keep each working version in package.json by using `--keep` flag. | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
'use strict' | ||
|
||
var la = require('lazy-ass') | ||
var is = require('check-more-types') | ||
var pause = 30 * 1000 | ||
var chdir = require('chdir-promise') | ||
var join = require('path').join | ||
var testFolder = join(__dirname, 'test-file-deps') | ||
|
||
/* global describe, it */ | ||
describe('scoped packages', function () { | ||
var nextUpdate = require('../src/next-update') | ||
|
||
it('is an object', function () { | ||
la(is.object(nextUpdate)) | ||
}) | ||
|
||
it('has available method', function () { | ||
la(is.fn(nextUpdate.available)) | ||
}) | ||
|
||
it('handles file: package names', function () { | ||
this.timeout(pause) | ||
return chdir | ||
.to(testFolder) | ||
.then(function () { | ||
return nextUpdate.available() | ||
}) | ||
.then(function (available) { | ||
console.log('available', available) | ||
}) | ||
.then(chdir.back) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
registry=http://registry.npmjs.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log('do nothing') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log('local dependency') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "local-dependency", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "test-scoped-names", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "node index.js" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"local-dependency": "file:./local-dependency" | ||
} | ||
} |