diff --git a/deps/npm/.travis.yml b/deps/npm/.travis.yml
new file mode 100644
index 00000000000..0fbe8dc335f
--- /dev/null
+++ b/deps/npm/.travis.yml
@@ -0,0 +1,5 @@
+language: node_js
+script: "npm run-script tap"
+node_js:
+ - "0.11"
+ - "0.10"
diff --git a/deps/npm/Makefile b/deps/npm/Makefile
index b0b85216d89..870965b52e4 100644
--- a/deps/npm/Makefile
+++ b/deps/npm/Makefile
@@ -169,7 +169,6 @@ publish: link doc
git push origin &&\
git push origin --tags &&\
npm publish &&\
- npm tag npm@$(shell npm -v) $(shell npm -v | awk -F. '{print $$1 "." $$2}') &&\
make doc-publish &&\
make zip-publish
diff --git a/deps/npm/README.md b/deps/npm/README.md
index 676d2003b34..2383245b88b 100644
--- a/deps/npm/README.md
+++ b/deps/npm/README.md
@@ -1,6 +1,6 @@
npm(1) -- node package manager
==============================
-
+[](https://travis-ci.org/npm/npm)
## SYNOPSIS
This is just enough info to get you up and running.
diff --git a/deps/npm/doc/files/package.json.md b/deps/npm/doc/files/package.json.md
index c987948b4c5..9e1bf6eff56 100644
--- a/deps/npm/doc/files/package.json.md
+++ b/deps/npm/doc/files/package.json.md
@@ -404,6 +404,40 @@ can consume the functionality without requiring them to compile it
themselves. In dev mode (ie, locally running `npm install`), it'll
run this script as well, so that you can test it easily.
+## peerDependencies
+
+In some cases, you want to express the compatibility of your package with an
+host tool or library, while not necessarily doing a `require` of this host.
+This is usually refered to as a *plugin*. Notably, your module may be exposing
+a specific interface, expected and specified by the host documentation.
+
+For example:
+
+ {
+ "name": "tea-latte",
+ "version": "1.3.5"
+ "peerDependencies": {
+ "tea": "2.x"
+ }
+ }
+
+This ensures your package `tea-latte` can be installed *along* with the second
+major version of the host package `tea` only. The host package is automatically
+installed if needed. `npm install tea-latte` could possibly yield the following
+dependency graph:
+
+ ├── tea-latte@1.3.5
+ └── tea@2.2.0
+
+Trying to install another plugin with a conflicting requirement will cause an
+error. For this reason, make sure your plugin requirement is as broad as
+possible, and not to lock it down to specific patch versions.
+
+Assuming the host complies with [semver](http://semver.org/), only changes in
+the host package's major version will break your plugin. Thus, if you've worked
+with every 1.x version of the host package, use `"^1.0"` or `"1.x"` to express
+this. If you depend on features introduced in 1.5.2, use `">= 1.5.2 < 2"`.
+
## bundledDependencies
Array of package names that will be bundled when publishing the package.
diff --git a/deps/npm/doc/misc/npm-config.md b/deps/npm/doc/misc/npm-config.md
index e54e2bb7bb8..a70de812162 100644
--- a/deps/npm/doc/misc/npm-config.md
+++ b/deps/npm/doc/misc/npm-config.md
@@ -648,6 +648,19 @@ devDependencies hash.
Only works if there is already a package.json file present.
+### save-prefix
+
+* Default: '^'
+* Type: String
+
+Configure how versions of packages installed to a package.json file via
+`--save` or `--save-dev` get prefixed.
+
+For example if a package has version `1.2.3`, by default it's version is
+set to `^1.2.3` which allows minor upgrades for that package, but after
+`npm config set save-prefix='~'` it would be set to `~1.2.3` which only allows
+patch upgrades.
+
### searchopts
* Default: ""
diff --git a/deps/npm/doc/misc/npm-faq.md b/deps/npm/doc/misc/npm-faq.md
index 31ce3745189..08160523057 100644
--- a/deps/npm/doc/misc/npm-faq.md
+++ b/deps/npm/doc/misc/npm-faq.md
@@ -77,7 +77,7 @@ npm will not help you do something that is known to be a bad idea.
Mikeal Rogers answered this question very well:
- node package manager ![Build Status
+## SYNOPSIS This is just enough info to get you up and running.npm
SYNOPSIS
+
npm.bin
member.
man 3 npm-<command>
for programmatic usage.
npm rebuild <pkg>
if you make any changes.
packages
parameter.
packages
parameter.
packages
parameter.
packages
parameter.
1.4.6
+1.4.7
npm.deref
method to find the real name.
package.json
in the current folder and use the name
package.json
file in its root.
name
property.
"notepad"
on Windows.node_modules
folder.npm ls promzard
in npm's source tree will show:
-npm@1.4.6 /path/to/npm
+npm@1.4.7 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
@@ -86,5 +87,5 @@ project.
-
+
diff --git a/deps/npm/html/doc/cli/npm-outdated.html b/deps/npm/html/doc/cli/npm-outdated.html
index 015d9120c32..52f46b27daf 100644
--- a/deps/npm/html/doc/cli/npm-outdated.html
+++ b/deps/npm/html/doc/cli/npm-outdated.html
@@ -3,6 +3,7 @@
npm-outdated
+
@@ -70,5 +71,5 @@ project.
-
+
diff --git a/deps/npm/html/doc/cli/npm-owner.html b/deps/npm/html/doc/cli/npm-owner.html
index 542228cf412..9887040b88a 100644
--- a/deps/npm/html/doc/cli/npm-owner.html
+++ b/deps/npm/html/doc/cli/npm-owner.html
@@ -3,6 +3,7 @@
npm-owner
+
@@ -46,5 +47,5 @@ that is not implemented at this time.
-
+
diff --git a/deps/npm/html/doc/cli/npm-pack.html b/deps/npm/html/doc/cli/npm-pack.html
index 99608776fa9..d3ebdba9c54 100644
--- a/deps/npm/html/doc/cli/npm-pack.html
+++ b/deps/npm/html/doc/cli/npm-pack.html
@@ -3,6 +3,7 @@
npm-pack
+
@@ -41,5 +42,5 @@ overwritten the second time.
-
+
diff --git a/deps/npm/html/doc/cli/npm-prefix.html b/deps/npm/html/doc/cli/npm-prefix.html
index e7a8eebbb91..35ea1ab30df 100644
--- a/deps/npm/html/doc/cli/npm-prefix.html
+++ b/deps/npm/html/doc/cli/npm-prefix.html
@@ -3,6 +3,7 @@
npm-prefix
+
@@ -32,5 +33,5 @@
-
+
diff --git a/deps/npm/html/doc/cli/npm-prune.html b/deps/npm/html/doc/cli/npm-prune.html
index baf66973504..8fc7298b4c8 100644
--- a/deps/npm/html/doc/cli/npm-prune.html
+++ b/deps/npm/html/doc/cli/npm-prune.html
@@ -3,6 +3,7 @@
npm-prune
+
@@ -41,5 +42,5 @@ packages specified in your devDependencies
.
-
+
diff --git a/deps/npm/html/doc/cli/npm-publish.html b/deps/npm/html/doc/cli/npm-publish.html
index f11179ed98e..3ff10e9d94c 100644
--- a/deps/npm/html/doc/cli/npm-publish.html
+++ b/deps/npm/html/doc/cli/npm-publish.html
@@ -3,6 +3,7 @@
npm-publish
+
@@ -48,5 +49,5 @@ it is removed with npm-unpublish(1).
-
+
diff --git a/deps/npm/html/doc/cli/npm-rebuild.html b/deps/npm/html/doc/cli/npm-rebuild.html
index f2ff2f5ba9a..0dc90210b23 100644
--- a/deps/npm/html/doc/cli/npm-rebuild.html
+++ b/deps/npm/html/doc/cli/npm-rebuild.html
@@ -3,6 +3,7 @@
npm-rebuild
+
@@ -38,5 +39,5 @@ the new binary.
-
+
diff --git a/deps/npm/html/doc/cli/npm-repo.html b/deps/npm/html/doc/cli/npm-repo.html
index bbf00663de9..7d6bda4fca5 100644
--- a/deps/npm/html/doc/cli/npm-repo.html
+++ b/deps/npm/html/doc/cli/npm-repo.html
@@ -3,6 +3,7 @@
npm-repo
+
@@ -44,5 +45,5 @@ a package.json
in the current folder and use the name
-
+
diff --git a/deps/npm/html/doc/cli/npm-restart.html b/deps/npm/html/doc/cli/npm-restart.html
index f36b69282ac..17caa3c6afd 100644
--- a/deps/npm/html/doc/cli/npm-restart.html
+++ b/deps/npm/html/doc/cli/npm-restart.html
@@ -3,6 +3,7 @@
npm-restart
+
@@ -36,5 +37,5 @@ the "start" script.
-
+
diff --git a/deps/npm/html/doc/cli/npm-rm.html b/deps/npm/html/doc/cli/npm-rm.html
index 8d06cca21d2..aa98f3f2699 100644
--- a/deps/npm/html/doc/cli/npm-rm.html
+++ b/deps/npm/html/doc/cli/npm-rm.html
@@ -3,6 +3,7 @@
npm-rm
+
@@ -36,5 +37,5 @@ on its behalf.
-
+
diff --git a/deps/npm/html/doc/cli/npm-root.html b/deps/npm/html/doc/cli/npm-root.html
index a4e0bd24c42..85b7f6d87ce 100644
--- a/deps/npm/html/doc/cli/npm-root.html
+++ b/deps/npm/html/doc/cli/npm-root.html
@@ -3,6 +3,7 @@
npm-root
+
@@ -32,5 +33,5 @@
-
+
diff --git a/deps/npm/html/doc/cli/npm-run-script.html b/deps/npm/html/doc/cli/npm-run-script.html
index 13d2d43053e..e410640ac15 100644
--- a/deps/npm/html/doc/cli/npm-run-script.html
+++ b/deps/npm/html/doc/cli/npm-run-script.html
@@ -3,6 +3,7 @@
npm-run-script
+
@@ -35,5 +36,5 @@ called directly, as well.
-
+
diff --git a/deps/npm/html/doc/cli/npm-search.html b/deps/npm/html/doc/cli/npm-search.html
index f66445b01a0..6fc04160651 100644
--- a/deps/npm/html/doc/cli/npm-search.html
+++ b/deps/npm/html/doc/cli/npm-search.html
@@ -3,6 +3,7 @@
npm-search
+
@@ -49,5 +50,5 @@ fall on multiple lines.
-
+
diff --git a/deps/npm/html/doc/cli/npm-shrinkwrap.html b/deps/npm/html/doc/cli/npm-shrinkwrap.html
index ca5da85f4a2..a882921091b 100644
--- a/deps/npm/html/doc/cli/npm-shrinkwrap.html
+++ b/deps/npm/html/doc/cli/npm-shrinkwrap.html
@@ -3,6 +3,7 @@
npm-shrinkwrap
+
@@ -195,5 +196,5 @@ contents rather than versions.
-
+
diff --git a/deps/npm/html/doc/cli/npm-star.html b/deps/npm/html/doc/cli/npm-star.html
index a0761b533a3..034b5eac5ba 100644
--- a/deps/npm/html/doc/cli/npm-star.html
+++ b/deps/npm/html/doc/cli/npm-star.html
@@ -3,6 +3,7 @@
npm-star
+
@@ -38,5 +39,5 @@ a vaguely positive way to show that you care.
-
+
diff --git a/deps/npm/html/doc/cli/npm-stars.html b/deps/npm/html/doc/cli/npm-stars.html
index 067c4154333..b8d3f7f53d7 100644
--- a/deps/npm/html/doc/cli/npm-stars.html
+++ b/deps/npm/html/doc/cli/npm-stars.html
@@ -3,6 +3,7 @@
npm-stars
+
@@ -37,5 +38,5 @@ you will most certainly enjoy this command.
-
+
diff --git a/deps/npm/html/doc/cli/npm-start.html b/deps/npm/html/doc/cli/npm-start.html
index 0208291c2e0..0756eb6bb28 100644
--- a/deps/npm/html/doc/cli/npm-start.html
+++ b/deps/npm/html/doc/cli/npm-start.html
@@ -3,6 +3,7 @@
npm-start
+
@@ -32,5 +33,5 @@
-
+
diff --git a/deps/npm/html/doc/cli/npm-stop.html b/deps/npm/html/doc/cli/npm-stop.html
index 71b9bb66a1a..d7d66ecfc39 100644
--- a/deps/npm/html/doc/cli/npm-stop.html
+++ b/deps/npm/html/doc/cli/npm-stop.html
@@ -3,6 +3,7 @@
npm-stop
+
@@ -32,5 +33,5 @@
-
+
diff --git a/deps/npm/html/doc/cli/npm-submodule.html b/deps/npm/html/doc/cli/npm-submodule.html
index cd574596512..ed73b38bb90 100644
--- a/deps/npm/html/doc/cli/npm-submodule.html
+++ b/deps/npm/html/doc/cli/npm-submodule.html
@@ -3,6 +3,7 @@
npm-submodule
+
@@ -45,5 +46,5 @@ dependencies into the submodule folder.
-
+
diff --git a/deps/npm/html/doc/cli/npm-tag.html b/deps/npm/html/doc/cli/npm-tag.html
index b0d248c6902..51f529fd9e2 100644
--- a/deps/npm/html/doc/cli/npm-tag.html
+++ b/deps/npm/html/doc/cli/npm-tag.html
@@ -3,6 +3,7 @@
npm-tag
+
@@ -46,5 +47,5 @@ of using a specific version number:
-
+
diff --git a/deps/npm/html/doc/cli/npm-test.html b/deps/npm/html/doc/cli/npm-test.html
index f11d1de7486..0afbd5b8229 100644
--- a/deps/npm/html/doc/cli/npm-test.html
+++ b/deps/npm/html/doc/cli/npm-test.html
@@ -3,6 +3,7 @@
npm-test
+
@@ -36,5 +37,5 @@ true.
-
+
diff --git a/deps/npm/html/doc/cli/npm-uninstall.html b/deps/npm/html/doc/cli/npm-uninstall.html
index 7f24b1ae2b9..bfdeca120b9 100644
--- a/deps/npm/html/doc/cli/npm-uninstall.html
+++ b/deps/npm/html/doc/cli/npm-uninstall.html
@@ -3,6 +3,7 @@
npm-uninstall
+
@@ -52,5 +53,5 @@ npm uninstall dtrace-provider --save-optional
1.4.6
+1.4.7
packa
-
+
diff --git a/deps/npm/html/doc/files/npm-global.html b/deps/npm/html/doc/files/npm-global.html
index 77a674b512f..75e44e25409 100644
--- a/deps/npm/html/doc/files/npm-global.html
+++ b/deps/npm/html/doc/files/npm-global.html
@@ -3,6 +3,7 @@
npm-folders
+
@@ -217,5 +218,5 @@ cannot be found elsewhere. See packa
-
+
diff --git a/deps/npm/html/doc/files/npm-json.html b/deps/npm/html/doc/files/npm-json.html
index 9dbb57d6d2a..b8dc0d46b29 100644
--- a/deps/npm/html/doc/files/npm-json.html
+++ b/deps/npm/html/doc/files/npm-json.html
@@ -3,6 +3,7 @@
package.json
+
@@ -396,6 +397,40 @@ can consume the functionality without requiring them to compile it
themselves. In dev mode (ie, locally running npm install
), it'll
run this script as well, so that you can test it easily.
+peerDependencies
+
+In some cases, you want to express the compatibility of your package with an
+host tool or library, while not necessarily doing a require
of this host.
+This is usually refered to as a plugin. Notably, your module may be exposing
+a specific interface, expected and specified by the host documentation.
+
+For example:
+
+{
+ "name": "tea-latte",
+ "version": "1.3.5"
+ "peerDependencies": {
+ "tea": "2.x"
+ }
+}
+
+This ensures your package tea-latte
can be installed along with the second
+major version of the host package tea
only. The host package is automatically
+installed if needed. npm install tea-latte
could possibly yield the following
+dependency graph:
+
+├── tea-latte@1.3.5
+└── tea@2.2.0
+
+Trying to install another plugin with a conflicting requirement will cause an
+error. For this reason, make sure your plugin requirement is as broad as
+possible, and not to lock it down to specific patch versions.
+
+Assuming the host complies with semver, only changes in
+the host package's major version will break your plugin. Thus, if you've worked
+with every 1.x version of the host package, use "^1.0"
or "1.x"
to express
+this. If you depend on features introduced in 1.5.2, use ">= 1.5.2 < 2"
.
+
bundledDependencies
Array of package names that will be bundled when publishing the package.
@@ -554,5 +589,5 @@ ignored.
-
+
diff --git a/deps/npm/html/doc/files/npmrc.html b/deps/npm/html/doc/files/npmrc.html
index f003e807e75..608c4976c4f 100644
--- a/deps/npm/html/doc/files/npmrc.html
+++ b/deps/npm/html/doc/files/npmrc.html
@@ -3,6 +3,7 @@
npmrc
+
@@ -71,5 +72,5 @@ manner.
-
+
diff --git a/deps/npm/html/doc/files/package.json.html b/deps/npm/html/doc/files/package.json.html
index 9dbb57d6d2a..b8dc0d46b29 100644
--- a/deps/npm/html/doc/files/package.json.html
+++ b/deps/npm/html/doc/files/package.json.html
@@ -3,6 +3,7 @@
package.json
+
@@ -396,6 +397,40 @@ can consume the functionality without requiring them to compile it
themselves. In dev mode (ie, locally running npm install
), it'll
run this script as well, so that you can test it easily.
+peerDependencies
+
+In some cases, you want to express the compatibility of your package with an
+host tool or library, while not necessarily doing a require
of this host.
+This is usually refered to as a plugin. Notably, your module may be exposing
+a specific interface, expected and specified by the host documentation.
+
+For example:
+
+{
+ "name": "tea-latte",
+ "version": "1.3.5"
+ "peerDependencies": {
+ "tea": "2.x"
+ }
+}
+
+This ensures your package tea-latte
can be installed along with the second
+major version of the host package tea
only. The host package is automatically
+installed if needed. npm install tea-latte
could possibly yield the following
+dependency graph:
+
+├── tea-latte@1.3.5
+└── tea@2.2.0
+
+Trying to install another plugin with a conflicting requirement will cause an
+error. For this reason, make sure your plugin requirement is as broad as
+possible, and not to lock it down to specific patch versions.
+
+Assuming the host complies with semver, only changes in
+the host package's major version will break your plugin. Thus, if you've worked
+with every 1.x version of the host package, use "^1.0"
or "1.x"
to express
+this. If you depend on features introduced in 1.5.2, use ">= 1.5.2 < 2"
.
+
bundledDependencies
Array of package names that will be bundled when publishing the package.
@@ -554,5 +589,5 @@ ignored.
-
+
diff --git a/deps/npm/html/doc/index.html b/deps/npm/html/doc/index.html
index 1c673fa198e..a8897284d8c 100644
--- a/deps/npm/html/doc/index.html
+++ b/deps/npm/html/doc/index.html
@@ -3,6 +3,7 @@
npm-index
+
@@ -428,5 +429,5 @@
-
+
diff --git a/deps/npm/html/doc/misc/npm-coding-style.html b/deps/npm/html/doc/misc/npm-coding-style.html
index 5e1992443cc..b3c373ca114 100644
--- a/deps/npm/html/doc/misc/npm-coding-style.html
+++ b/deps/npm/html/doc/misc/npm-coding-style.html
@@ -3,6 +3,7 @@
npm-coding-style
+
@@ -194,5 +195,5 @@ set to anything."
-
+
diff --git a/deps/npm/html/doc/misc/npm-config.html b/deps/npm/html/doc/misc/npm-config.html
index 5f4dec5acab..1c44de37f3e 100644
--- a/deps/npm/html/doc/misc/npm-config.html
+++ b/deps/npm/html/doc/misc/npm-config.html
@@ -3,6 +3,7 @@
npm-config
+
@@ -565,6 +566,17 @@ devDependencies hash.
Only works if there is already a package.json file present.
+save-prefix
+
+- Default: '^'
- Type: String
+
+Configure how versions of packages installed to a package.json file via
+--save
or --save-dev
get prefixed.
+
+For example if a package has version 1.2.3
, by default it's version is
+set to ^1.2.3
which allows minor upgrades for that package, but after
npm config set save-prefix='~'
it would be set to ~1.2.3
which only allows
+patch upgrades.
+
searchopts
- Default: ""
- Type: String
@@ -731,5 +743,5 @@ hash, and exit successfully.
-
+
diff --git a/deps/npm/html/doc/misc/npm-developers.html b/deps/npm/html/doc/misc/npm-developers.html
index 25a6348ca78..a3cfc32b89b 100644
--- a/deps/npm/html/doc/misc/npm-developers.html
+++ b/deps/npm/html/doc/misc/npm-developers.html
@@ -3,6 +3,7 @@
npm-developers
+
@@ -186,5 +187,5 @@ from a fresh checkout.
-
+
diff --git a/deps/npm/html/doc/misc/npm-disputes.html b/deps/npm/html/doc/misc/npm-disputes.html
index 87cf6b2fd37..15dfd2a3c80 100644
--- a/deps/npm/html/doc/misc/npm-disputes.html
+++ b/deps/npm/html/doc/misc/npm-disputes.html
@@ -3,6 +3,7 @@
npm-disputes
+
@@ -104,5 +105,5 @@ things into it.
-
+
diff --git a/deps/npm/html/doc/misc/npm-faq.html b/deps/npm/html/doc/misc/npm-faq.html
index 298b44548b8..7e310072daa 100644
--- a/deps/npm/html/doc/misc/npm-faq.html
+++ b/deps/npm/html/doc/misc/npm-faq.html
@@ -3,6 +3,7 @@
npm-faq
+
@@ -85,7 +86,7 @@ in a shell script if you really wanted to.
Mikeal Rogers answered this question very well:
-http://www.mikealrogers.com/posts/nodemodules-in-git.html
+http://www.futurealoof.com/posts/nodemodules-in-git.html
tl;dr
@@ -360,5 +361,5 @@ good folks at npm, Inc.
-
+
diff --git a/deps/npm/html/doc/misc/npm-index.html b/deps/npm/html/doc/misc/npm-index.html
index b92a2147317..4afdf117e09 100644
--- a/deps/npm/html/doc/misc/npm-index.html
+++ b/deps/npm/html/doc/misc/npm-index.html
@@ -3,6 +3,7 @@
npm-index
+
@@ -428,5 +429,5 @@
-
+
diff --git a/deps/npm/html/doc/misc/npm-registry.html b/deps/npm/html/doc/misc/npm-registry.html
index 79c9957b753..3c0fea26890 100644
--- a/deps/npm/html/doc/misc/npm-registry.html
+++ b/deps/npm/html/doc/misc/npm-registry.html
@@ -3,6 +3,7 @@
npm-registry
+
@@ -83,5 +84,5 @@ effectively implement the entire CouchDB API anyway.
-
+
diff --git a/deps/npm/html/doc/misc/npm-scripts.html b/deps/npm/html/doc/misc/npm-scripts.html
index 16f9a53e619..1e41008cdce 100644
--- a/deps/npm/html/doc/misc/npm-scripts.html
+++ b/deps/npm/html/doc/misc/npm-scripts.html
@@ -3,6 +3,7 @@
npm-scripts
+
@@ -235,5 +236,5 @@ the user will sudo the npm command in question.
-
+
diff --git a/deps/npm/html/doc/misc/removing-npm.html b/deps/npm/html/doc/misc/removing-npm.html
index c79e6775426..40dab55b444 100644
--- a/deps/npm/html/doc/misc/removing-npm.html
+++ b/deps/npm/html/doc/misc/removing-npm.html
@@ -3,6 +3,7 @@
removing-npm
+
@@ -70,5 +71,5 @@ modules. To track those down, you can do the following:
-
+
diff --git a/deps/npm/html/doc/misc/semver.html b/deps/npm/html/doc/misc/semver.html
index 893858ab407..51473c703a9 100644
--- a/deps/npm/html/doc/misc/semver.html
+++ b/deps/npm/html/doc/misc/semver.html
@@ -3,6 +3,7 @@
semver
+
@@ -129,5 +130,5 @@ range, use the satisfies(version, range)
function.
-
+
diff --git a/deps/npm/html/dochead.html b/deps/npm/html/dochead.html
index f2c8a6bad1a..e2f0e83d78e 100644
--- a/deps/npm/html/dochead.html
+++ b/deps/npm/html/dochead.html
@@ -3,6 +3,7 @@
@NAME@
+
diff --git a/deps/npm/lib/cache.js b/deps/npm/lib/cache.js
index 3b9a46f6978..b17da0cf925 100644
--- a/deps/npm/lib/cache.js
+++ b/deps/npm/lib/cache.js
@@ -241,9 +241,10 @@ function add (args, cb) {
log.verbose("cache add", "name=%j spec=%j args=%j", name, spec, args)
-
if (!name && !spec) return cb(usage)
+ cb = afterAdd([name, spec], cb)
+
// see if the spec is a url
// otherwise, treat as name@version
var p = url.parse(spec) || {}
@@ -265,6 +266,23 @@ function add (args, cb) {
add_(name, spec, p, cb)
}
+function afterAdd (arg, cb) { return function (er, data) {
+ if (er || !data || !data.name || !data.version) {
+ return cb(er, data)
+ }
+
+ // Save the resolved, shasum, etc. into the data so that the next
+ // time we load from this cached data, we have all the same info.
+ var name = data.name
+ var ver = data.version
+ var pj = path.join(npm.cache, name, ver, "package", "package.json")
+ fs.writeFile(pj, JSON.stringify(data), "utf8", function (er) {
+ cb(er, data)
+ })
+}}
+
+
+
function maybeFile (spec, p, cb) {
fs.stat(spec, function (er, stat) {
if (!er) {
@@ -316,7 +334,15 @@ function fetchAndShaCheck (u, tmp, shasum, cb) {
log.error("fetch failed", u)
return cb(er, response)
}
- if (!shasum) return cb(null, response)
+
+ if (!shasum) {
+ // Well, we weren't given a shasum, so at least sha what we have
+ // in case we want to compare it to something else later
+ return sha.get(tmp, function (er, shasum) {
+ cb(er, response, shasum)
+ })
+ }
+
// validate that the url we just downloaded matches the expected shasum.
sha.check(tmp, shasum, function (er) {
if (er != null && er.message) {
@@ -331,7 +357,8 @@ function fetchAndShaCheck (u, tmp, shasum, cb) {
// Only have a single download action at once for a given url
// additional calls stack the callbacks.
var inFlightURLs = {}
-function addRemoteTarball (u, shasum, name, cb_) {
+function addRemoteTarball (u, shasum, name, version, cb_) {
+ if (typeof cb_ !== "function") cb_ = version, version = ""
if (typeof cb_ !== "function") cb_ = name, name = ""
if (typeof cb_ !== "function") cb_ = shasum, shasum = null
@@ -343,6 +370,7 @@ function addRemoteTarball (u, shasum, name, cb_) {
function cb (er, data) {
if (data) {
data._from = u
+ data._shasum = data._shasum || shasum
data._resolved = u
}
unlock(u, function () {
@@ -366,7 +394,7 @@ function addRemoteTarball (u, shasum, name, cb_) {
function done (er, resp, shasum) {
if (er) return cb(er)
- addLocalTarball(tmp, name, shasum, cb)
+ addLocalTarball(tmp, name, version, shasum, cb)
}
}
@@ -791,9 +819,15 @@ function addNameVersion (name, v, data, cb) {
response = null
return next()
}
- registry.get(name + "/" + ver, function (er, d, json, resp) {
+ registry.get(name, function (er, d, json, resp) {
if (er) return cb(er)
- data = d
+ data = d && d.versions[ver]
+ if (!data) {
+ er = new Error('version not found: ' + name + '@' + ver)
+ er.package = name
+ er.statusCode = 404
+ return cb(er)
+ }
response = resp
next()
})
@@ -853,7 +887,8 @@ function addNameVersion (name, v, data, cb) {
}
return addRemoteTarball( tb
, dist.shasum
- , name+"-"+ver
+ , name
+ , ver
, cb )
}
}
@@ -924,13 +959,23 @@ function maybeGithub (p, name, er, cb) {
}
}
-function addLocalTarball (p, name, shasum, cb_) {
+function addLocalTarball (p, name, version, shasum, cb_) {
if (typeof cb_ !== "function") cb_ = shasum, shasum = null
+ if (typeof cb_ !== "function") cb_ = version, version = ""
if (typeof cb_ !== "function") cb_ = name, name = ""
+
+ // If we don't have a shasum yet, then get the shasum now.
+ if (!shasum) {
+ return sha.get(p, function (er, shasum) {
+ if (er) return cb_(er)
+ addLocalTarball(p, name, version, shasum, cb_)
+ })
+ }
+
// if it's a tar, and not in place,
// then unzip to .tmp, add the tmp folder, and clean up tmp
if (pathIsInside(p, npm.tmp))
- return addTmpTarball(p, name, shasum, cb_)
+ return addTmpTarball(p, name, version, shasum, cb_)
if (pathIsInside(p, npm.cache)) {
if (path.basename(p) !== "package.tgz") return cb_(new Error(
@@ -939,7 +984,10 @@ function addLocalTarball (p, name, shasum, cb_) {
}
function cb (er, data) {
- if (data) data._resolved = p
+ if (data) {
+ data._resolved = p
+ data._shasum = data._shasum || shasum
+ }
return cb_(er, data)
}
@@ -962,7 +1010,7 @@ function addLocalTarball (p, name, shasum, cb_) {
log.verbose("chmod", tmp, npm.modes.file.toString(8))
fs.chmod(tmp, npm.modes.file, function (er) {
if (er) return cb(er)
- addTmpTarball(tmp, name, shasum, cb)
+ addTmpTarball(tmp, name, null, shasum, cb)
})
})
from.pipe(to)
@@ -1188,6 +1236,10 @@ function addLocalDirectory (p, name, shasum, cb) {
, data.version, "package.tgz" )
, placeDirect = path.basename(p) === "package"
, tgz = placeDirect ? placed : tmptgz
+ , version = data.version
+
+ name = data.name
+
getCacheStat(function (er, cs) {
mkdir(path.dirname(tgz), function (er, made) {
if (er) return cb(er)
@@ -1207,7 +1259,7 @@ function addLocalDirectory (p, name, shasum, cb) {
chownr(made || tgz, cs.uid, cs.gid, function (er) {
if (er) return cb(er)
- addLocalTarball(tgz, name, shasum, cb)
+ addLocalTarball(tgz, name, version, shasum, cb)
})
})
})
@@ -1215,21 +1267,75 @@ function addLocalDirectory (p, name, shasum, cb) {
})
}
-function addTmpTarball (tgz, name, shasum, cb) {
- if (!cb) cb = name, name = ""
+// XXX This is where it should be fixed
+// Right now it's unpacking to a "package" folder, and then
+// adding that local folder, for historical reasons.
+// Instead, unpack to the *cache* folder, and then copy the
+// tgz into place in the cache, so the shasum doesn't change.
+function addTmpTarball (tgz, name, version, shasum, cb) {
+ // Just have a placeholder here so we can move it into place after.
+ var tmp = false
+ if (!version) {
+ tmp = true
+ version = 'tmp_' + crypto.randomBytes(6).toString('hex')
+ }
+ if (!name) {
+ tmp = true
+ name = 'tmp_' + crypto.randomBytes(6).toString('hex')
+ }
+ if (!tmp) {
+ var pdir = path.resolve(npm.cache, name, version, "package")
+ } else {
+ var pdir = path.resolve(npm.cache, name + version + "package")
+ }
+
getCacheStat(function (er, cs) {
if (er) return cb(er)
- var contents = path.dirname(tgz)
- tar.unpack( tgz, path.resolve(contents, "package")
- , null, null
- , cs.uid, cs.gid
- , function (er) {
- if (er) {
- return cb(er)
- }
- addLocalDirectory(path.resolve(contents, "package"), name, shasum, cb)
- })
+ tar.unpack(tgz, pdir, null, null, cs.uid, cs.gid, next)
})
+
+ function next (er) {
+ if (er) return cb(er)
+ // it MUST be able to get a version now!
+ var pj = path.resolve(pdir, "package.json")
+ readJson(pj, function (er, data) {
+ if (er) return cb(er)
+ if (version === data.version && name === data.name && !tmp) {
+ addTmpTarball_(tgz, data, name, version, shasum, cb)
+ } else {
+ var old = pdir
+ name = data.name
+ version = data.version
+ pdir = path.resolve(npm.cache, name, version, "package")
+ mkdir(path.dirname(pdir), function(er) {
+ if (er) return cb(er)
+ rm(pdir, function(er) {
+ if (er) return cb(er)
+ fs.rename(old, pdir, function(er) {
+ if (er) return cb(er)
+ rm(old, function(er) {
+ if (er) return cb(er)
+ addTmpTarball_(tgz, data, name, version, shasum, cb)
+ })
+ })
+ })
+ })
+ }
+ })
+ }
+}
+
+function addTmpTarball_ (tgz, data, name, version, shasum, cb) {
+ cb = once(cb)
+ var target = path.resolve(npm.cache, name, version, "package.tgz")
+ var read = fs.createReadStream(tgz)
+ var write = fs.createWriteStream(target)
+ read.on("error", cb).pipe(write).on("error", cb).on("close", done)
+
+ function done() {
+ data._shasum = data._shasum || shasum
+ cb(null, data)
+ }
}
function unpack (pkg, ver, unpackTarget, dMode, fMode, uid, gid, cb) {
diff --git a/deps/npm/lib/dedupe.js b/deps/npm/lib/dedupe.js
index 55823d96768..0c2b18a7842 100644
--- a/deps/npm/lib/dedupe.js
+++ b/deps/npm/lib/dedupe.js
@@ -354,4 +354,3 @@ function whoDepends_ (pkg, who, test) {
})
return who
}
-
diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js
index 39c98ecff27..8bc009349b6 100644
--- a/deps/npm/lib/install.js
+++ b/deps/npm/lib/install.js
@@ -337,6 +337,7 @@ function save (where, installed, tree, pretty, hasArguments, cb) {
}
var saveBundle = npm.config.get('save-bundle')
+ var savePrefix = npm.config.get('save-prefix') || "^";
// each item in the tree is a top-level thing that should be saved
// to the package.json file.
@@ -353,7 +354,7 @@ function save (where, installed, tree, pretty, hasArguments, cb) {
var rangeDescriptor = semver.valid(k[1], true) &&
semver.gte(k[1], "0.1.0", true) &&
!npm.config.get("save-exact")
- ? "^" : ""
+ ? savePrefix : ""
set[k[0]] = rangeDescriptor + k[1]
return set
}, {})
diff --git a/deps/npm/lib/shrinkwrap.js b/deps/npm/lib/shrinkwrap.js
index 48a3e4ae12e..ef5732590e0 100644
--- a/deps/npm/lib/shrinkwrap.js
+++ b/deps/npm/lib/shrinkwrap.js
@@ -59,7 +59,7 @@ function shrinkwrap_ (pkginfo, silent, dev, cb) {
function save (pkginfo, silent, cb) {
// copy the keys over in a well defined order
// because javascript objects serialize arbitrarily
- pkginfo.dependencies = sortedObject(pkginfo.dependencies)
+ pkginfo.dependencies = sortedObject(pkginfo.dependencies || {})
try {
var swdata = JSON.stringify(pkginfo, null, 2) + "\n"
} catch (er) {
diff --git a/deps/npm/lib/utils/error-handler.js b/deps/npm/lib/utils/error-handler.js
index 4286a1c2910..9777c6a50b0 100644
--- a/deps/npm/lib/utils/error-handler.js
+++ b/deps/npm/lib/utils/error-handler.js
@@ -146,9 +146,10 @@ function errorHandler (er) {
case "E404":
er.code = "E404"
+ var msg = [er.message]
if (er.pkgid && er.pkgid !== "-") {
- var msg = ["'"+er.pkgid+"' is not in the npm registry."
- ,"You should bug the author to publish it"]
+ msg.push("", "'"+er.pkgid+"' is not in the npm registry."
+ ,"You should bug the author to publish it")
if (er.parent) {
msg.push("It was specified as a dependency of '"+er.parent+"'")
}
@@ -161,8 +162,8 @@ function errorHandler (er) {
}
msg.push("\nNote that you can also install from a"
,"tarball, folder, or http url, or git url.")
- log.error("404", msg.join("\n"))
}
+ log.error("404", msg.join("\n"))
break
case "EPUBLISHCONFLICT":
diff --git a/deps/npm/lib/utils/lifecycle.js b/deps/npm/lib/utils/lifecycle.js
index e6ef925b304..d1493700d04 100644
--- a/deps/npm/lib/utils/lifecycle.js
+++ b/deps/npm/lib/utils/lifecycle.js
@@ -1,4 +1,3 @@
-
exports = module.exports = lifecycle
exports.cmd = cmd
@@ -161,7 +160,9 @@ function runCmd (note, cmd, pkg, env, stage, wd, unsafe, cb) {
var user = unsafe ? null : npm.config.get("user")
, group = unsafe ? null : npm.config.get("group")
- console.log(note)
+ if (log.level !== 'silent') {
+ console.log(note)
+ }
log.verbose("unsafe-perm in lifecycle", unsafe)
if (process.platform === "win32") {
diff --git a/deps/npm/lib/view.js b/deps/npm/lib/view.js
index f7ba5a9541c..18484b2bd1a 100644
--- a/deps/npm/lib/view.js
+++ b/deps/npm/lib/view.js
@@ -58,13 +58,24 @@ function view (args, silent, cb) {
// get the data about this package
registry.get(name, function (er, data) {
if (er) return cb(er)
- if (data["dist-tags"].hasOwnProperty(version)) {
+ if (data["dist-tags"] && data["dist-tags"].hasOwnProperty(version)) {
version = data["dist-tags"][version]
}
+
+ if (data.time && data.time.unpublished) {
+ var u = data.time.unpublished
+ var er = new Error("Unpublished by " + u.name + " on " + u.time)
+ er.statusCode = 404
+ er.code = "E404"
+ er.pkgid = data._id
+ return cb(er, data)
+ }
+
+
var results = []
, error = null
- , versions = data.versions
- data.versions = Object.keys(data.versions).sort(semver.compareLoose)
+ , versions = data.versions || {}
+ data.versions = Object.keys(versions).sort(semver.compareLoose)
if (!args.length) args = [""]
// remove readme unless we asked for it
diff --git a/deps/npm/man/man1/npm-README.1 b/deps/npm/man/man1/npm-README.1
index b9d79a83e6c..6118efec7a0 100644
--- a/deps/npm/man/man1/npm-README.1
+++ b/deps/npm/man/man1/npm-README.1
@@ -1,12 +1,13 @@
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM" "1" "March 2014" "" ""
+.TH "NPM" "1" "April 2014" "" ""
.
.SH "NAME"
-\fBnpm\fR \-\- node package manager
+\fBnpm\fR \-\- node package manager {
.fi
.
.SH "VERSION"
-1.4.6
+1.4.7
.
.SH "DESCRIPTION"
This is the API documentation for npm\.
diff --git a/deps/npm/man/man5/npm-folders.5 b/deps/npm/man/man5/npm-folders.5
index 194bb9b6d36..cc93fdee849 100644
--- a/deps/npm/man/man5/npm-folders.5
+++ b/deps/npm/man/man5/npm-folders.5
@@ -1,7 +1,7 @@
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-FOLDERS" "5" "March 2014" "" ""
+.TH "NPM\-FOLDERS" "5" "April 2014" "" ""
.
.SH "NAME"
\fBnpm-folders\fR \-\- Folder Structures Used by npm
diff --git a/deps/npm/man/man5/npm-global.5 b/deps/npm/man/man5/npm-global.5
index 194bb9b6d36..cc93fdee849 100644
--- a/deps/npm/man/man5/npm-global.5
+++ b/deps/npm/man/man5/npm-global.5
@@ -1,7 +1,7 @@
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-FOLDERS" "5" "March 2014" "" ""
+.TH "NPM\-FOLDERS" "5" "April 2014" "" ""
.
.SH "NAME"
\fBnpm-folders\fR \-\- Folder Structures Used by npm
diff --git a/deps/npm/man/man5/npm-json.5 b/deps/npm/man/man5/npm-json.5
index a0cd2c9b6fc..c08044a9a06 100644
--- a/deps/npm/man/man5/npm-json.5
+++ b/deps/npm/man/man5/npm-json.5
@@ -1,7 +1,7 @@
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "PACKAGE\.JSON" "5" "March 2014" "" ""
+.TH "PACKAGE\.JSON" "5" "April 2014" "" ""
.
.SH "NAME"
\fBpackage.json\fR \-\- Specifics of npm\'s package\.json handling
@@ -567,6 +567,57 @@ can consume the functionality without requiring them to compile it
themselves\. In dev mode (ie, locally running \fBnpm install\fR), it\'ll
run this script as well, so that you can test it easily\.
.
+.SH "peerDependencies"
+In some cases, you want to express the compatibility of your package with an
+host tool or library, while not necessarily doing a \fBrequire\fR of this host\.
+This is usually refered to as a \fIplugin\fR\|\. Notably, your module may be exposing
+a specific interface, expected and specified by the host documentation\.
+.
+.P
+For example:
+.
+.IP "" 4
+.
+.nf
+{
+ "name": "tea\-latte",
+ "version": "1\.3\.5"
+ "peerDependencies": {
+ "tea": "2\.x"
+ }
+}
+.
+.fi
+.
+.IP "" 0
+.
+.P
+This ensures your package \fBtea\-latte\fR can be installed \fIalong\fR with the second
+major version of the host package \fBtea\fR only\. The host package is automatically
+installed if needed\. \fBnpm install tea\-latte\fR could possibly yield the following
+dependency graph:
+.
+.IP "" 4
+.
+.nf
+├── tea\-latte@1\.3\.5
+└── tea@2\.2\.0
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Trying to install another plugin with a conflicting requirement will cause an
+error\. For this reason, make sure your plugin requirement is as broad as
+possible, and not to lock it down to specific patch versions\.
+.
+.P
+Assuming the host complies with semver \fIhttp://semver\.org/\fR, only changes in
+the host package\'s major version will break your plugin\. Thus, if you\'ve worked
+with every 1\.x version of the host package, use \fB"^1\.0"\fR or \fB"1\.x"\fR to express
+this\. If you depend on features introduced in 1\.5\.2, use \fB">= 1\.5\.2 < 2"\fR\|\.
+.
.SH "bundledDependencies"
Array of package names that will be bundled when publishing the package\.
.
diff --git a/deps/npm/man/man5/npmrc.5 b/deps/npm/man/man5/npmrc.5
index e8a740abd35..8ac6b3ba8f2 100644
--- a/deps/npm/man/man5/npmrc.5
+++ b/deps/npm/man/man5/npmrc.5
@@ -1,7 +1,7 @@
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPMRC" "5" "March 2014" "" ""
+.TH "NPMRC" "5" "April 2014" "" ""
.
.SH "NAME"
\fBnpmrc\fR \-\- The npm config files
diff --git a/deps/npm/man/man5/package.json.5 b/deps/npm/man/man5/package.json.5
index a0cd2c9b6fc..c08044a9a06 100644
--- a/deps/npm/man/man5/package.json.5
+++ b/deps/npm/man/man5/package.json.5
@@ -1,7 +1,7 @@
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "PACKAGE\.JSON" "5" "March 2014" "" ""
+.TH "PACKAGE\.JSON" "5" "April 2014" "" ""
.
.SH "NAME"
\fBpackage.json\fR \-\- Specifics of npm\'s package\.json handling
@@ -567,6 +567,57 @@ can consume the functionality without requiring them to compile it
themselves\. In dev mode (ie, locally running \fBnpm install\fR), it\'ll
run this script as well, so that you can test it easily\.
.
+.SH "peerDependencies"
+In some cases, you want to express the compatibility of your package with an
+host tool or library, while not necessarily doing a \fBrequire\fR of this host\.
+This is usually refered to as a \fIplugin\fR\|\. Notably, your module may be exposing
+a specific interface, expected and specified by the host documentation\.
+.
+.P
+For example:
+.
+.IP "" 4
+.
+.nf
+{
+ "name": "tea\-latte",
+ "version": "1\.3\.5"
+ "peerDependencies": {
+ "tea": "2\.x"
+ }
+}
+.
+.fi
+.
+.IP "" 0
+.
+.P
+This ensures your package \fBtea\-latte\fR can be installed \fIalong\fR with the second
+major version of the host package \fBtea\fR only\. The host package is automatically
+installed if needed\. \fBnpm install tea\-latte\fR could possibly yield the following
+dependency graph:
+.
+.IP "" 4
+.
+.nf
+├── tea\-latte@1\.3\.5
+└── tea@2\.2\.0
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Trying to install another plugin with a conflicting requirement will cause an
+error\. For this reason, make sure your plugin requirement is as broad as
+possible, and not to lock it down to specific patch versions\.
+.
+.P
+Assuming the host complies with semver \fIhttp://semver\.org/\fR, only changes in
+the host package\'s major version will break your plugin\. Thus, if you\'ve worked
+with every 1\.x version of the host package, use \fB"^1\.0"\fR or \fB"1\.x"\fR to express
+this\. If you depend on features introduced in 1\.5\.2, use \fB">= 1\.5\.2 < 2"\fR\|\.
+.
.SH "bundledDependencies"
Array of package names that will be bundled when publishing the package\.
.
diff --git a/deps/npm/man/man7/npm-coding-style.7 b/deps/npm/man/man7/npm-coding-style.7
index 710aa660471..a15a004e1b7 100644
--- a/deps/npm/man/man7/npm-coding-style.7
+++ b/deps/npm/man/man7/npm-coding-style.7
@@ -1,7 +1,7 @@
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-CODING\-STYLE" "7" "March 2014" "" ""
+.TH "NPM\-CODING\-STYLE" "7" "April 2014" "" ""
.
.SH "NAME"
\fBnpm-coding-style\fR \-\- npm\'s "funny" coding style
diff --git a/deps/npm/man/man7/npm-config.7 b/deps/npm/man/man7/npm-config.7
index 60577f4ee41..a7069c811bb 100644
--- a/deps/npm/man/man7/npm-config.7
+++ b/deps/npm/man/man7/npm-config.7
@@ -1,7 +1,7 @@
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-CONFIG" "7" "March 2014" "" ""
+.TH "NPM\-CONFIG" "7" "April 2014" "" ""
.
.SH "NAME"
\fBnpm-config\fR \-\- More than you probably want to know about npm configuration
@@ -1137,6 +1137,27 @@ devDependencies hash\.
.P
Only works if there is already a package\.json file present\.
.
+.SS "save\-prefix"
+.
+.IP "\(bu" 4
+Default: \'^\'
+.
+.IP "\(bu" 4
+Type: String
+.
+.IP "" 0
+.
+.P
+Configure how versions of packages installed to a package\.json file via \fB\-\-save\fR or \fB\-\-save\-dev\fR get prefixed\.
+.
+.P
+For example if a package has version \fB1\.2\.3\fR, by default it\'s version is
+set to \fB^1\.2\.3\fR which allows minor upgrades for that package, but after
+.
+.br
+\fBnpm config set save\-prefix=\'~\'\fR it would be set to \fB~1\.2\.3\fR which only allows
+patch upgrades\.
+.
.SS "searchopts"
.
.IP "\(bu" 4
diff --git a/deps/npm/man/man7/npm-developers.7 b/deps/npm/man/man7/npm-developers.7
index b50705ba1af..acd9593a6bd 100644
--- a/deps/npm/man/man7/npm-developers.7
+++ b/deps/npm/man/man7/npm-developers.7
@@ -1,7 +1,7 @@
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-DEVELOPERS" "7" "March 2014" "" ""
+.TH "NPM\-DEVELOPERS" "7" "April 2014" "" ""
.
.SH "NAME"
\fBnpm-developers\fR \-\- Developer Guide
diff --git a/deps/npm/man/man7/npm-disputes.7 b/deps/npm/man/man7/npm-disputes.7
index 3afd7e571ec..1d59103d3f5 100644
--- a/deps/npm/man/man7/npm-disputes.7
+++ b/deps/npm/man/man7/npm-disputes.7
@@ -1,7 +1,7 @@
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-DISPUTES" "7" "March 2014" "" ""
+.TH "NPM\-DISPUTES" "7" "April 2014" "" ""
.
.SH "NAME"
\fBnpm-disputes\fR \-\- Handling Module Name Disputes
diff --git a/deps/npm/man/man7/npm-faq.7 b/deps/npm/man/man7/npm-faq.7
index ce7453fa04c..9793e51436a 100644
--- a/deps/npm/man/man7/npm-faq.7
+++ b/deps/npm/man/man7/npm-faq.7
@@ -1,7 +1,7 @@
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-FAQ" "7" "March 2014" "" ""
+.TH "NPM\-FAQ" "7" "April 2014" "" ""
.
.SH "NAME"
\fBnpm-faq\fR \-\- Frequently Asked Questions
@@ -94,7 +94,7 @@ npm will not help you do something that is known to be a bad idea\.
Mikeal Rogers answered this question very well:
.
.P
-\fIhttp://www\.mikealrogers\.com/posts/nodemodules\-in\-git\.html\fR
+\fIhttp://www\.futurealoof\.com/posts/nodemodules\-in\-git\.html\fR
.
.P
tl;dr
diff --git a/deps/npm/man/man7/npm-index.7 b/deps/npm/man/man7/npm-index.7
index 8e17a3d7a52..24abdf9e36c 100644
--- a/deps/npm/man/man7/npm-index.7
+++ b/deps/npm/man/man7/npm-index.7
@@ -1,7 +1,7 @@
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-INDEX" "7" "March 2014" "" ""
+.TH "NPM\-INDEX" "7" "April 2014" "" ""
.
.SH "NAME"
\fBnpm-index\fR \-\- Index of all npm documentation
diff --git a/deps/npm/man/man7/npm-registry.7 b/deps/npm/man/man7/npm-registry.7
index 5a62ae6fcbf..94b915a9a6b 100644
--- a/deps/npm/man/man7/npm-registry.7
+++ b/deps/npm/man/man7/npm-registry.7
@@ -1,7 +1,7 @@
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-REGISTRY" "7" "March 2014" "" ""
+.TH "NPM\-REGISTRY" "7" "April 2014" "" ""
.
.SH "NAME"
\fBnpm-registry\fR \-\- The JavaScript Package Registry
diff --git a/deps/npm/man/man7/npm-scripts.7 b/deps/npm/man/man7/npm-scripts.7
index bc16a8d6ef9..8ccf99db7dc 100644
--- a/deps/npm/man/man7/npm-scripts.7
+++ b/deps/npm/man/man7/npm-scripts.7
@@ -1,7 +1,7 @@
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-SCRIPTS" "7" "March 2014" "" ""
+.TH "NPM\-SCRIPTS" "7" "April 2014" "" ""
.
.SH "NAME"
\fBnpm-scripts\fR \-\- How npm handles the "scripts" field
diff --git a/deps/npm/man/man7/removing-npm.7 b/deps/npm/man/man7/removing-npm.7
index d3fd8696d91..947046a8f61 100644
--- a/deps/npm/man/man7/removing-npm.7
+++ b/deps/npm/man/man7/removing-npm.7
@@ -1,7 +1,7 @@
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-REMOVAL" "1" "March 2014" "" ""
+.TH "NPM\-REMOVAL" "1" "April 2014" "" ""
.
.SH "NAME"
\fBnpm-removal\fR \-\- Cleaning the Slate
diff --git a/deps/npm/man/man7/semver.7 b/deps/npm/man/man7/semver.7
index 567e28f4d03..6e2e984debd 100644
--- a/deps/npm/man/man7/semver.7
+++ b/deps/npm/man/man7/semver.7
@@ -1,7 +1,7 @@
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "SEMVER" "7" "March 2014" "" ""
+.TH "SEMVER" "7" "April 2014" "" ""
.
.SH "NAME"
\fBsemver\fR \-\- The semantic versioner for npm
diff --git a/deps/npm/node_modules/npm-registry-client/lib/request.js b/deps/npm/node_modules/npm-registry-client/lib/request.js
index c11dc9ca3d8..3cbb07228b9 100644
--- a/deps/npm/node_modules/npm-registry-client/lib/request.js
+++ b/deps/npm/node_modules/npm-registry-client/lib/request.js
@@ -112,6 +112,8 @@ function regRequest (method, where, what, etag, nofollow, cb_) {
self.log.info("retry", "will retry, error on last attempt: " + er)
return
}
+ if (response)
+ this.log.verbose("headers", response.headers)
cb.apply(null, arguments)
}.bind(this))
}.bind(this))
@@ -189,6 +191,12 @@ function decodeResponseBody(cb) {
return function (er, response, data) {
if (er) return cb(er, response, data)
+ // don't ever re-use connections that had server errors.
+ // those sockets connect to the Bad Place!
+ if (response.socket && response.statusCode > 500) {
+ response.socket.destroy()
+ }
+
if (response.headers['content-encoding'] !== 'gzip') return cb(er, response, data)
zlib.gunzip(data, function (er, buf) {
diff --git a/deps/npm/node_modules/npm-registry-client/package.json b/deps/npm/node_modules/npm-registry-client/package.json
index 17d1f782c72..0a9d7314368 100644
--- a/deps/npm/node_modules/npm-registry-client/package.json
+++ b/deps/npm/node_modules/npm-registry-client/package.json
@@ -6,7 +6,7 @@
},
"name": "npm-registry-client",
"description": "Client for the npm registry",
- "version": "0.4.5",
+ "version": "0.4.7",
"repository": {
"url": "git://github.com/isaacs/npm-registry-client"
},
@@ -38,6 +38,6 @@
"url": "https://github.com/isaacs/npm-registry-client/issues"
},
"homepage": "https://github.com/isaacs/npm-registry-client",
- "_id": "npm-registry-client@0.4.5",
+ "_id": "npm-registry-client@0.4.7",
"_from": "npm-registry-client@latest"
}
diff --git a/deps/npm/node_modules/npmconf/config-defs.js b/deps/npm/node_modules/npmconf/config-defs.js
index 1815870f6ff..2760a452e6e 100644
--- a/deps/npm/node_modules/npmconf/config-defs.js
+++ b/deps/npm/node_modules/npmconf/config-defs.js
@@ -188,6 +188,7 @@ Object.defineProperty(exports, "defaults", {get: function () {
, "save-dev" : false
, "save-exact" : false
, "save-optional" : false
+ , "save-prefix": "^"
, searchopts: ""
, searchexclude: null
, searchsort: "name"
@@ -290,6 +291,7 @@ exports.types =
, "save-dev" : Boolean
, "save-exact" : Boolean
, "save-optional" : Boolean
+ , "save-prefix": String
, searchopts : String
, searchexclude: [null, String]
, searchsort: [ "name", "-name"
diff --git a/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json b/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json
index b7117440c60..a7349f06b7a 100644
--- a/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json
+++ b/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json
@@ -29,9 +29,7 @@
},
"homepage": "https://github.com/isaacs/proto-list",
"_id": "proto-list@1.2.2",
- "dist": {
- "shasum": "48b88798261ec2c4a785720cdfec6200d57d3326"
- },
+ "_shasum": "48b88798261ec2c4a785720cdfec6200d57d3326",
"_from": "proto-list@~1.2.1",
"_resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.2.tgz"
}
diff --git a/deps/npm/node_modules/npmconf/node_modules/config-chain/package.json b/deps/npm/node_modules/npmconf/node_modules/config-chain/package.json
index 72ab798b72b..2f8695410e5 100644
--- a/deps/npm/node_modules/npmconf/node_modules/config-chain/package.json
+++ b/deps/npm/node_modules/npmconf/node_modules/config-chain/package.json
@@ -28,9 +28,7 @@
"url": "https://github.com/dominictarr/config-chain/issues"
},
"_id": "config-chain@1.1.8",
- "dist": {
- "shasum": "a3b9ae699dedb3a7837615001f3cf646ca37c77a"
- },
+ "_shasum": "0943d0b7227213a20d4eaff4434f4a1c0a052cad",
"_from": "config-chain@~1.1.8",
"_resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.8.tgz"
}
diff --git a/deps/npm/node_modules/npmconf/package.json b/deps/npm/node_modules/npmconf/package.json
index 89b8fc80871..b87c1def93f 100644
--- a/deps/npm/node_modules/npmconf/package.json
+++ b/deps/npm/node_modules/npmconf/package.json
@@ -1,6 +1,6 @@
{
"name": "npmconf",
- "version": "0.1.13",
+ "version": "0.1.14",
"description": "The config thing npm uses",
"main": "npmconf.js",
"directories": {
@@ -45,6 +45,7 @@
"url": "https://github.com/isaacs/npmconf/issues"
},
"homepage": "https://github.com/isaacs/npmconf",
- "_id": "npmconf@0.1.13",
+ "_id": "npmconf@0.1.14",
+ "_shasum": "aea4bc12c5a84191a32cd350e325da4fe8b127e7",
"_from": "npmconf@latest"
}
diff --git a/deps/npm/node_modules/read-installed/package.json b/deps/npm/node_modules/read-installed/package.json
index 7887f71a9d8..41a980f76eb 100644
--- a/deps/npm/node_modules/read-installed/package.json
+++ b/deps/npm/node_modules/read-installed/package.json
@@ -1,7 +1,7 @@
{
"name": "read-installed",
"description": "Read all the installed packages in a folder, and return a tree structure with all the data.",
- "version": "2.0.1",
+ "version": "2.0.2",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/read-installed"
@@ -35,6 +35,6 @@
"url": "https://github.com/isaacs/read-installed/issues"
},
"homepage": "https://github.com/isaacs/read-installed",
- "_id": "read-installed@2.0.1",
+ "_id": "read-installed@2.0.2",
"_from": "read-installed@latest"
}
diff --git a/deps/npm/node_modules/read-installed/read-installed.js b/deps/npm/node_modules/read-installed/read-installed.js
index f9104934d3e..a33758b1720 100644
--- a/deps/npm/node_modules/read-installed/read-installed.js
+++ b/deps/npm/node_modules/read-installed/read-installed.js
@@ -334,10 +334,13 @@ function findUnmet (obj, opts) {
dependency = obj.parent.dependencies && obj.parent.dependencies[d]
}
- if (!dependency) return
-
- if (!semver.satisfies(dependency.version, peerDeps[d], true)) {
+ if (!dependency) {
+ // mark as a missing dep!
+ obj.dependencies[d] = peerDeps[d]
+ } else if (!semver.satisfies(dependency.version, peerDeps[d], true)) {
dependency.peerInvalid = true
+ } else {
+ dependency.extraneous = false
}
})
diff --git a/deps/npm/package.json b/deps/npm/package.json
index 6e5004af72c..76b1f02fd8b 100644
--- a/deps/npm/package.json
+++ b/deps/npm/package.json
@@ -1,5 +1,5 @@
{
- "version": "1.4.6",
+ "version": "1.4.7",
"name": "npm",
"publishConfig": {
"proprietary-attribs": false
@@ -61,9 +61,9 @@
"node-gyp": "~0.13.0",
"nopt": "~2.2.0",
"npm-install-checks": "~1.0.0",
- "npm-registry-client": "~0.4.5",
+ "npm-registry-client": "~0.4.7",
"npm-user-validate": "0.0.3",
- "npmconf": "~0.1.13",
+ "npmconf": "~0.1.14",
"npmlog": "0.0.6",
"once": "~1.3.0",
"opener": "~1.3.0",
@@ -138,7 +138,7 @@
"which"
],
"devDependencies": {
- "npm-registry-mock": "~0.5",
+ "npm-registry-mock": "~0.6.3",
"ronn": "~0.3.6",
"tap": "~0.4.0"
},
@@ -147,11 +147,12 @@
"npm": "1"
},
"scripts": {
- "test": "node ./test/run.js && tap test/tap/*.js",
- "tap": "tap test/tap/*.js",
+ "test-legacy": "node ./test/run.js",
+ "test": "tap --timeout 120 test/tap/*.js",
+ "tap": "tap --timeout 120 test/tap/*.js",
+ "test-all": "node ./test/run.js && tap test/tap/*.js",
"prepublish": "node bin/npm-cli.js prune --prefix=. --no-global && rm -rf test/*/*/node_modules && make -j32 doc",
- "dumpconf": "env | grep npm | sort | uniq",
- "echo": "node bin/npm-cli.js"
+ "dumpconf": "env | grep npm | sort | uniq"
},
"license": "Artistic-2.0"
}
diff --git a/deps/npm/scripts/doc-build.sh b/deps/npm/scripts/doc-build.sh
index 849ffce3f7d..cd8d4fa7710 100755
--- a/deps/npm/scripts/doc-build.sh
+++ b/deps/npm/scripts/doc-build.sh
@@ -53,11 +53,13 @@ case $dest in
exit $?
;;
*.html)
+ url=${dest/html\//}
(cat html/dochead.html && \
./node_modules/.bin/ronn -f $src &&
cat html/docfoot.html)\
| sed "s|@NAME@|$name|g" \
| sed "s|@DATE@|$date|g" \
+ | sed "s|@URL@|$url|g" \
| sed "s|@VERSION@|$version|g" \
| perl -pi -e 's/([^\(]*\([0-9]\)) -- (.*?)<\/h1>/\1<\/h1>
\2<\/p>/g' \
| perl -pi -e 's/npm-npm/npm/g' \
diff --git a/deps/npm/test/tap/00-check-mock-dep.js b/deps/npm/test/tap/00-check-mock-dep.js
new file mode 100644
index 00000000000..c4d2ff2c224
--- /dev/null
+++ b/deps/npm/test/tap/00-check-mock-dep.js
@@ -0,0 +1,15 @@
+console.log("TAP Version 13")
+
+process.on("uncaughtException", function(er) {
+ console.log("not ok - Failed checking mock registry dep. Expect much fail!")
+ console.log("1..1")
+ process.exit(1)
+})
+
+var assert = require("assert")
+var semver = require("semver")
+var mock = require("npm-registry-mock/package.json").version
+var req = require("../../package.json").devDependencies["npm-registry-mock"]
+assert(semver.satisfies(mock, req))
+console.log("ok")
+console.log("1..1")
diff --git a/deps/npm/test/tap/404-parent.js b/deps/npm/test/tap/404-parent.js
index a7eff25b6e6..b3c353827f7 100644
--- a/deps/npm/test/tap/404-parent.js
+++ b/deps/npm/test/tap/404-parent.js
@@ -7,6 +7,7 @@ var fs = require('fs')
var rimraf = require('rimraf')
var mkdirp = require('mkdirp')
var pkg = path.resolve(__dirname, '404-parent')
+var mr = require("npm-registry-mock")
test('404-parent: if parent exists, specify parent in error message', function(t) {
setup()
@@ -41,9 +42,12 @@ function setup() {
}
function performInstall(cb) {
- npm.load(function() {
- npm.commands.install(pkg, [], function(err) {
- cb(err)
+ mr(common.port, function (s) { // create mock registry.
+ npm.load({registry: common.registry}, function() {
+ npm.commands.install(pkg, [], function(err) {
+ cb(err)
+ s.close() // shutdown mock npm server.
+ })
})
})
}
diff --git a/deps/npm/test/tap/cache-shasum.js b/deps/npm/test/tap/cache-shasum.js
new file mode 100644
index 00000000000..460f2ee3ff1
--- /dev/null
+++ b/deps/npm/test/tap/cache-shasum.js
@@ -0,0 +1,60 @@
+var npm = require.resolve("../../")
+var test = require("tap").test
+var path = require("path")
+var fs = require("fs")
+var rimraf = require("rimraf")
+var mkdirp = require("mkdirp")
+var mr = require("npm-registry-mock")
+var common = require("../common-tap.js")
+var cache = path.resolve(__dirname, "cache-shasum")
+var spawn = require("child_process").spawn
+var sha = require("sha")
+var server
+
+test("mock reg", function(t) {
+ rimraf.sync(cache)
+ mkdirp.sync(cache)
+ mr(common.port, function (s) {
+ server = s
+ t.pass("ok")
+ t.end()
+ })
+})
+
+test("npm cache add request", function(t) {
+ var c = spawn(process.execPath, [
+ npm, "cache", "add", "request@2.27.0",
+ "--cache=" + cache,
+ "--registry=" + common.registry,
+ "--loglevel=quiet"
+ ])
+ c.stderr.pipe(process.stderr)
+
+ c.stdout.on("data", function(d) {
+ t.fail("Should not get data on stdout: " + d)
+ })
+
+ c.on("close", function(code) {
+ t.notOk(code, "exit ok")
+ t.end()
+ })
+})
+
+test("compare", function(t) {
+ var d = path.resolve(__dirname, "cache-shasum/request")
+ var p = path.resolve(d, "2.27.0/package.tgz")
+ var r = require(path.resolve(d, ".cache.json"))
+ var rshasum = r.versions['2.27.0'].dist.shasum
+ sha.get(p, function (er, pshasum) {
+ if (er)
+ throw er
+ t.equal(pshasum, rshasum)
+ t.end()
+ })
+})
+
+test("cleanup", function(t) {
+ server.close()
+ rimraf.sync(cache)
+ t.end()
+})
diff --git a/deps/npm/test/tap/dedupe.js b/deps/npm/test/tap/dedupe.js
index 9a8b31a7991..b4b7495aa87 100644
--- a/deps/npm/test/tap/dedupe.js
+++ b/deps/npm/test/tap/dedupe.js
@@ -4,17 +4,19 @@ var test = require("tap").test
, existsSync = fs.existsSync || path.existsSync
, npm = require("../../")
, rimraf = require("rimraf")
+ , mr = require("npm-registry-mock")
+ , common = require('../common-tap.js')
test("dedupe finds the common module and moves it up one level", function (t) {
- t.plan(2)
-
- setup(function () {
+ setup(function (s) {
npm.install(".", function (err) {
if (err) return t.fail(err)
npm.dedupe(function(err) {
if (err) return t.fail(err)
t.ok(existsSync(path.join(__dirname, "dedupe", "node_modules", "minimist")))
- t.ok(!existsSync(path.join(__dirname, "dedupe", "node_modules", "prime")))
+ t.ok(!existsSync(path.join(__dirname, "dedupe", "node_modules", "checker")))
+ s.close() // shutdown mock registry.
+ t.end()
})
})
})
@@ -22,9 +24,11 @@ test("dedupe finds the common module and moves it up one level", function (t) {
function setup (cb) {
process.chdir(path.join(__dirname, "dedupe"))
- npm.load(function () {
- rimraf.sync(path.join(__dirname, "dedupe", "node_modules"))
- fs.mkdirSync(path.join(__dirname, "dedupe", "node_modules"))
- cb()
+ mr(common.port, function (s) { // create mock registry.
+ npm.load({registry: common.registry}, function() {
+ rimraf.sync(path.join(__dirname, "dedupe", "node_modules"))
+ fs.mkdirSync(path.join(__dirname, "dedupe", "node_modules"))
+ cb(s)
+ })
})
}
diff --git a/deps/npm/test/tap/dedupe/package.json b/deps/npm/test/tap/dedupe/package.json
index d0f79ff2023..842d4b2b2d7 100644
--- a/deps/npm/test/tap/dedupe/package.json
+++ b/deps/npm/test/tap/dedupe/package.json
@@ -4,8 +4,6 @@
"version": "0.0.0",
"dependencies": {
"optimist": "0.6.0",
- "clean": "2.1.6",
- "informal": "0.0.1",
- "pathogen": "0.1.5"
+ "clean": "2.1.6"
}
}
diff --git a/deps/npm/test/tap/git-cache-locking.js b/deps/npm/test/tap/git-cache-locking.js
index dcecad9ebf3..b9b328f30c6 100644
--- a/deps/npm/test/tap/git-cache-locking.js
+++ b/deps/npm/test/tap/git-cache-locking.js
@@ -21,6 +21,9 @@ test("setup", function (t) {
test("git-cache-locking: install a git dependency", function (t) {
+ // disable git integration tests on Travis.
+ if (process.env.TRAVIS) return t.end()
+
// package c depends on a.git#master and b.git#master
// package b depends on a.git#master
var child = spawn(node, [npm, "install", "git://github.com/nigelzor/npm-4503-c.git"], {
diff --git a/deps/npm/test/tap/ignore-scripts.js b/deps/npm/test/tap/ignore-scripts.js
index b742cf92e8a..0115b7571d8 100644
--- a/deps/npm/test/tap/ignore-scripts.js
+++ b/deps/npm/test/tap/ignore-scripts.js
@@ -35,7 +35,7 @@ var scripts = [
]
scripts.forEach(function(script) {
- test("ignore-scripts: run-script"+script+" using the option", function(t) {
+ test("ignore-scripts: run-script "+script+" using the option", function(t) {
createChild([npm, "--ignore-scripts", "run-script", script])
.on("close", function(code) {
t.equal(code, 0)
@@ -57,7 +57,8 @@ function createChild (args) {
var env = {
HOME: process.env.HOME,
Path: process.env.PATH,
- PATH: process.env.PATH
+ PATH: process.env.PATH,
+ npm_config_loglevel: "silent"
}
if (process.platform === "win32")
diff --git a/deps/npm/test/tap/install-save-prefix.js b/deps/npm/test/tap/install-save-prefix.js
new file mode 100644
index 00000000000..0ce6e02fa11
--- /dev/null
+++ b/deps/npm/test/tap/install-save-prefix.js
@@ -0,0 +1,140 @@
+var common = require('../common-tap.js')
+var test = require('tap').test
+var npm = require('../../')
+var osenv = require('osenv')
+var path = require('path')
+var fs = require('fs')
+var rimraf = require('rimraf')
+var mkdirp = require('mkdirp')
+var pkg = path.join(__dirname, 'install-save-prefix')
+var mr = require("npm-registry-mock")
+
+test("setup", function (t) {
+ mkdirp.sync(pkg)
+ mkdirp.sync(path.resolve(pkg, 'node_modules'))
+ process.chdir(pkg)
+ t.end()
+})
+
+test('"npm install --save with default save-prefix should install local pkg versioned to allow minor updates', function(t) {
+ resetPackageJSON(pkg)
+ mr(common.port, function (s) {
+ npm.load({
+ cache: pkg + "/cache",
+ loglevel: 'silent',
+ registry: common.registry }, function(err) {
+ t.ifError(err)
+ npm.config.set('save', true)
+ npm.commands.install(['underscore@1.3.1'], function(err) {
+ t.ifError(err)
+ var p = path.resolve(pkg, 'node_modules/underscore/package.json')
+ t.ok(JSON.parse(fs.readFileSync(p)))
+ var pkgJson = JSON.parse(fs.readFileSync(pkg + '/package.json', 'utf8'))
+ t.deepEqual(pkgJson.dependencies, {
+ 'underscore': '^1.3.1'
+ }, 'Underscore dependency should specify ^1.3.1')
+ npm.config.set('save', undefined)
+ s.close()
+ t.end()
+ })
+ })
+ })
+})
+
+test('"npm install --save-dev with default save-prefix should install local pkg to dev dependencies versioned to allow minor updates', function(t) {
+ resetPackageJSON(pkg)
+ mr(common.port, function (s) {
+ npm.load({
+ cache: pkg + "/cache",
+ loglevel: 'silent',
+ registry: common.registry }, function(err) {
+ t.ifError(err)
+ npm.config.set('save-dev', true)
+ npm.commands.install(['underscore@1.3.1'], function(err) {
+ t.ifError(err)
+ var p = path.resolve(pkg, 'node_modules/underscore/package.json')
+ t.ok(JSON.parse(fs.readFileSync(p)))
+ var pkgJson = JSON.parse(fs.readFileSync(pkg + '/package.json', 'utf8'))
+ t.deepEqual(pkgJson.devDependencies, {
+ 'underscore': '^1.3.1'
+ }, 'Underscore devDependency should specify ^1.3.1')
+ npm.config.set('save-dev', undefined)
+ s.close()
+ t.end()
+ })
+ })
+ })
+})
+
+test('"npm install --save with "~" save-prefix should install local pkg versioned to allow patch updates', function(t) {
+ resetPackageJSON(pkg)
+ mr(common.port, function (s) {
+ npm.load({
+ cache: pkg + "/cache",
+ loglevel: 'silent',
+ registry: common.registry }, function(err) {
+ t.ifError(err)
+ npm.config.set('save', true)
+ npm.config.set('save-prefix', '~')
+ npm.commands.install(['underscore@1.3.1'], function(err) {
+ t.ifError(err)
+ var p = path.resolve(pkg, 'node_modules/underscore/package.json')
+ t.ok(JSON.parse(fs.readFileSync(p)))
+ var pkgJson = JSON.parse(fs.readFileSync(pkg + '/package.json', 'utf8'))
+ t.deepEqual(pkgJson.dependencies, {
+ 'underscore': '~1.3.1'
+ }, 'Underscore dependency should specify ~1.3.1')
+ npm.config.set('save', undefined)
+ npm.config.set('save-prefix', undefined)
+ s.close()
+ t.end()
+ })
+ })
+ })
+})
+
+test('"npm install --save-dev with "~" save-prefix should install local pkg to dev dependencies versioned to allow patch updates', function(t) {
+ resetPackageJSON(pkg)
+ mr(common.port, function (s) {
+ npm.load({
+ cache: pkg + "/cache",
+ loglevel: 'silent',
+ registry: common.registry }, function(err) {
+ t.ifError(err)
+ npm.config.set('save-dev', true)
+ npm.config.set('save-prefix', '~')
+ npm.commands.install(['underscore@1.3.1'], function(err) {
+ t.ifError(err)
+ var p = path.resolve(pkg, 'node_modules/underscore/package.json')
+ t.ok(JSON.parse(fs.readFileSync(p)))
+ var pkgJson = JSON.parse(fs.readFileSync(pkg + '/package.json', 'utf8'))
+ t.deepEqual(pkgJson.devDependencies, {
+ 'underscore': '~1.3.1'
+ }, 'Underscore devDependency should specify ~1.3.1')
+ npm.config.set('save-dev', undefined)
+ npm.config.set('save-prefix', undefined)
+ s.close()
+ t.end()
+ })
+ })
+ })
+})
+
+test('cleanup', function(t) {
+ process.chdir(__dirname)
+ rimraf.sync(path.resolve(pkg, 'node_modules'))
+ rimraf.sync(path.resolve(pkg, 'cache'))
+ resetPackageJSON(pkg)
+ t.end()
+})
+
+function resetPackageJSON(pkg) {
+ var pkgJson = JSON.parse(fs.readFileSync(pkg + '/package.json', 'utf8'))
+ delete pkgJson.dependencies
+ delete pkgJson.devDependencies
+ delete pkgJson.optionalDependencies
+ var json = JSON.stringify(pkgJson, null, 2) + "\n"
+ fs.writeFileSync(pkg + '/package.json', json, "ascii")
+}
+
+
diff --git a/deps/npm/test/tap/install-save-prefix/README.md b/deps/npm/test/tap/install-save-prefix/README.md
new file mode 100644
index 00000000000..aca67ff17d2
--- /dev/null
+++ b/deps/npm/test/tap/install-save-prefix/README.md
@@ -0,0 +1 @@
+# just a test
diff --git a/deps/npm/test/tap/install-save-prefix/index.js b/deps/npm/test/tap/install-save-prefix/index.js
new file mode 100644
index 00000000000..33c1891f81e
--- /dev/null
+++ b/deps/npm/test/tap/install-save-prefix/index.js
@@ -0,0 +1 @@
+module.exports = true
diff --git a/deps/npm/test/tap/install-save-prefix/package.json b/deps/npm/test/tap/install-save-prefix/package.json
new file mode 100644
index 00000000000..84789fc224f
--- /dev/null
+++ b/deps/npm/test/tap/install-save-prefix/package.json
@@ -0,0 +1,7 @@
+{
+ "name": "bla",
+ "description": "fixture",
+ "version": "0.0.1",
+ "main": "index.js",
+ "repository": "git://github.com/robertkowalski/bogusfixture"
+}
diff --git a/deps/npm/test/tap/lifecycle-signal.js b/deps/npm/test/tap/lifecycle-signal.js
index e39e891e15b..9d88fbd79b8 100644
--- a/deps/npm/test/tap/lifecycle-signal.js
+++ b/deps/npm/test/tap/lifecycle-signal.js
@@ -7,11 +7,19 @@ var pkg = path.resolve(__dirname, "lifecycle-signal")
test("lifecycle signal abort", function (t) {
// windows does not use lifecycle signals, abort
- if (process.platform === "win32") return t.end()
+ if (process.platform === "win32" || process.env.TRAVIS) return t.end()
+
var child = spawn(node, [npm, "install"], {
cwd: pkg
})
child.on("close", function (code, signal) {
+ // GNU shell returns a code, no signal
+ if (process.platform === "linux") {
+ t.equal(code, 1)
+ t.equal(signal, null)
+ return t.end()
+ }
+
t.equal(code, null)
t.equal(signal, "SIGSEGV")
t.end()
diff --git a/deps/npm/test/tap/outdated-color.js b/deps/npm/test/tap/outdated-color.js
index e729d56a85f..f20bcea93cf 100644
--- a/deps/npm/test/tap/outdated-color.js
+++ b/deps/npm/test/tap/outdated-color.js
@@ -5,6 +5,7 @@ var mkdirp = require("mkdirp")
var rimraf = require("rimraf")
var mr = require("npm-registry-mock")
var exec = require('child_process').exec
+var mr = require("npm-registry-mock")
var pkg = __dirname + '/outdated'
var NPM_BIN = __dirname + '/../../bin/npm-cli.js'
@@ -25,12 +26,15 @@ function ansiTrim (str) {
// it's not running in a tty
test("does not use ansi styling", function (t) {
t.plan(3)
- exec('node ' + NPM_BIN + ' outdated --color false', {
- cwd: pkg
- }, function(err, stdout) {
- t.ifError(err)
- t.ok(stdout, stdout.length)
- t.ok(!hasControlCodes(stdout))
+ mr(common.port, function (s) { // create mock registry.
+ exec('node ' + NPM_BIN + ' outdated --registry ' + common.registry + ' --color false underscore', {
+ cwd: pkg
+ }, function(err, stdout) {
+ t.ifError(err)
+ t.ok(stdout, stdout.length)
+ t.ok(!hasControlCodes(stdout))
+ s.close()
+ })
})
})
@@ -38,4 +42,3 @@ test("cleanup", function (t) {
rimraf.sync(pkg + "/cache")
t.end()
})
-
diff --git a/deps/npm/test/tap/peer-deps-invalid.js b/deps/npm/test/tap/peer-deps-invalid.js
index 50c961e7b9a..2392c928a22 100644
--- a/deps/npm/test/tap/peer-deps-invalid.js
+++ b/deps/npm/test/tap/peer-deps-invalid.js
@@ -4,18 +4,19 @@ var test = require("tap").test
var rimraf = require("rimraf")
var npm = require("../../")
var http = require("http")
+var mr = require("npm-registry-mock")
var okFile = new Buffer(
-'/**package\n' +
-' * { "name": "npm-test-peer-deps-file"\n' +
-' * , "main": "index.js"\n' +
-' * , "version": "1.2.3"\n' +
-' * , "description":"No package.json in sight!"\n' +
-' * , "peerDependencies": { "dict": "1.1.0" }\n' +
-' * , "dependencies": { "opener": "1.3.0" }\n' +
-' * }\n' +
-' **/\n' +
-'\n' +
+'/**package\n' +
+' * { "name": "npm-test-peer-deps-file"\n' +
+' * , "main": "index.js"\n' +
+' * , "version": "1.2.3"\n' +
+' * , "description":"No package.json in sight!"\n' +
+' * , "peerDependencies": { "underscore": "1.3.1" }\n' +
+' * , "dependencies": { "mkdirp": "0.3.5" }\n' +
+' * }\n' +
+' **/\n' +
+'\n' +
'module.exports = "I\'m just a lonely index, naked as the day I was born."\n'
)
@@ -25,7 +26,7 @@ var failFile = new Buffer(
' * , "main": "index.js"\n' +
' * , "version": "1.2.3"\n' +
' * , "description":"This one should conflict with the other one"\n' +
-' * , "peerDependencies": { "dict": "1.0.0" }\n' +
+' * , "peerDependencies": { "underscore": "1.3.3" }\n' +
' * }\n' +
' **/\n' +
'\n' +
@@ -51,20 +52,25 @@ test("setup", function(t) {
-test("installing dependencies that having conflicting peerDependencies", function (t) {
+test("installing dependencies that have conflicting peerDependencies", function (t) {
rimraf.sync(__dirname + "/peer-deps-invalid/node_modules")
process.chdir(__dirname + "/peer-deps-invalid")
- npm.load(function () {
- console.error('back from load')
- npm.commands.install([], function (err) {
- console.error('back from install')
- if (!err) {
- t.fail("No error!")
- } else {
- t.equal(err.code, "EPEERINVALID")
- }
- t.end()
+ // we're already listening on common.port,
+ // use an alternative port for this test.
+ mr(1331, function (s) { // create mock registry.
+ npm.load({registry: "http://localhost:1331"}, function () {
+ console.error('back from load')
+ npm.commands.install([], function (err) {
+ console.error('back from install')
+ if (!err) {
+ t.fail("No error!")
+ } else {
+ t.equal(err.code, "EPEERINVALID")
+ }
+ t.end()
+ s.close() // shutdown mock registry.
+ })
})
})
})
diff --git a/deps/npm/test/tap/peer-deps-without-package-json.js b/deps/npm/test/tap/peer-deps-without-package-json.js
index 9f987c5ee51..ce7c5e81542 100644
--- a/deps/npm/test/tap/peer-deps-without-package-json.js
+++ b/deps/npm/test/tap/peer-deps-without-package-json.js
@@ -3,7 +3,7 @@ var fs = require("fs")
var test = require("tap").test
var rimraf = require("rimraf")
var npm = require("../../")
-
+var mr = require("npm-registry-mock")
var http = require("http")
@@ -13,8 +13,8 @@ var js = new Buffer(
' * , "main": "index.js"\n' +
' * , "version": "1.2.3"\n' +
' * , "description":"No package.json in sight!"\n' +
-' * , "peerDependencies": { "dict": "1.1.0" }\n' +
-' * , "dependencies": { "opener": "1.3.0" }\n' +
+' * , "peerDependencies": { "underscore": "1.3.1" }\n' +
+' * , "dependencies": { "mkdirp": "0.3.5" }\n' +
' * }\n' +
' **/\n' +
'\n' +
@@ -38,15 +38,20 @@ test("installing a peerDependencies-using package without a package.json present
fs.mkdirSync(__dirname + "/peer-deps-without-package-json/node_modules")
process.chdir(__dirname + "/peer-deps-without-package-json")
- npm.load(function () {
- npm.install(common.registry, function (err) {
- if (err) {
- t.fail(err)
- } else {
- t.ok(fs.existsSync(__dirname + "/peer-deps-without-package-json/node_modules/npm-test-peer-deps-file"))
- t.ok(fs.existsSync(__dirname + "/peer-deps-without-package-json/node_modules/dict"))
- }
- t.end()
+ // we're already listening on common.port,
+ // use an alternative port for this test.
+ mr(1331, function (s) { // create mock registry.
+ npm.load({registry: 'http://localhost:1331'}, function () {
+ npm.install(common.registry, function (err) {
+ if (err) {
+ t.fail(err)
+ } else {
+ t.ok(fs.existsSync(__dirname + "/peer-deps-without-package-json/node_modules/npm-test-peer-deps-file"))
+ t.ok(fs.existsSync(__dirname + "/peer-deps-without-package-json/node_modules/underscore"))
+ }
+ t.end()
+ s.close() // shutdown mock registry.
+ })
})
})
})
diff --git a/deps/npm/test/tap/shrinkwrap-empty-deps.js b/deps/npm/test/tap/shrinkwrap-empty-deps.js
new file mode 100644
index 00000000000..9ec8e71e0ba
--- /dev/null
+++ b/deps/npm/test/tap/shrinkwrap-empty-deps.js
@@ -0,0 +1,47 @@
+var test = require("tap").test
+ , npm = require("../../")
+ , mr = require("npm-registry-mock")
+ , common = require("../common-tap.js")
+ , path = require("path")
+ , fs = require("fs")
+ , osenv = require("osenv")
+ , rimraf = require("rimraf")
+ , pkg = __dirname + "/shrinkwrap-empty-deps"
+
+test("returns a list of removed items", function (t) {
+ var desiredResultsPath = path.resolve(pkg, "npm-shrinkwrap.json")
+
+ cleanup()
+
+ mr(common.port, function (s) {
+ setup(function () {
+ npm.shrinkwrap([], function (err) {
+ if (err) return t.fail(err)
+ fs.readFile(desiredResultsPath, function (err, desired) {
+ if (err) return t.fail(err)
+ t.deepEqual({
+ "name": "npm-test-shrinkwrap-empty-deps",
+ "version": "0.0.0",
+ "dependencies": {}
+ }, JSON.parse(desired))
+ cleanup()
+ s.close()
+ t.end()
+ })
+ })
+ })
+ })
+})
+
+function setup (cb) {
+ cleanup()
+ process.chdir(pkg)
+ npm.load({cache: pkg + "/cache", registry: common.registry}, function () {
+ cb()
+ })
+}
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(path.resolve(pkg, "npm-shrinkwrap.json"))
+}
diff --git a/deps/npm/test/tap/shrinkwrap-empty-deps/package.json b/deps/npm/test/tap/shrinkwrap-empty-deps/package.json
new file mode 100644
index 00000000000..9a51088c7ee
--- /dev/null
+++ b/deps/npm/test/tap/shrinkwrap-empty-deps/package.json
@@ -0,0 +1,7 @@
+{
+ "author": "Rockbert",
+ "name": "npm-test-shrinkwrap-empty-deps",
+ "version": "0.0.0",
+ "dependencies": {},
+ "devDependencies": {}
+}
diff --git a/deps/npm/test/tap/sorted-package-json.js b/deps/npm/test/tap/sorted-package-json.js
index 0d978997f69..41c90855a87 100644
--- a/deps/npm/test/tap/sorted-package-json.js
+++ b/deps/npm/test/tap/sorted-package-json.js
@@ -24,7 +24,7 @@ test("sorting dependencies", function (t) {
var before = JSON.parse(fs.readFileSync(packageJson).toString())
- mr({port: common.port}, function (s) {
+ mr(common.port, function (s) {
// underscore is already in the package.json,
// but --save will trigger a rewrite with sort
var child = spawn(node, [npm, "install", "--save", "underscore@1.3.3"], {