From aa742ddf80f104bc4f13321668a4ede0c518cd4a Mon Sep 17 00:00:00 2001 From: isaacs Date: Wed, 9 Jan 2013 15:21:30 -0800 Subject: [PATCH] npm: Upgrade to v1.2.0 --- deps/npm/doc/cli/json.md | 4 +- deps/npm/doc/cli/scripts.md | 53 ++++++++- deps/npm/doc/cli/semver.md | 6 +- deps/npm/html/api/bin.html | 2 +- deps/npm/html/api/bugs.html | 2 +- deps/npm/html/api/commands.html | 2 +- deps/npm/html/api/config.html | 2 +- deps/npm/html/api/deprecate.html | 2 +- deps/npm/html/api/docs.html | 2 +- deps/npm/html/api/edit.html | 2 +- deps/npm/html/api/explore.html | 2 +- deps/npm/html/api/help-search.html | 2 +- deps/npm/html/api/init.html | 2 +- deps/npm/html/api/install.html | 2 +- deps/npm/html/api/link.html | 2 +- deps/npm/html/api/load.html | 2 +- deps/npm/html/api/ls.html | 2 +- deps/npm/html/api/npm.html | 4 +- deps/npm/html/api/outdated.html | 2 +- deps/npm/html/api/owner.html | 2 +- deps/npm/html/api/pack.html | 2 +- deps/npm/html/api/prefix.html | 2 +- deps/npm/html/api/prune.html | 2 +- deps/npm/html/api/publish.html | 2 +- deps/npm/html/api/rebuild.html | 2 +- deps/npm/html/api/restart.html | 2 +- deps/npm/html/api/root.html | 2 +- deps/npm/html/api/run-script.html | 2 +- deps/npm/html/api/search.html | 2 +- deps/npm/html/api/shrinkwrap.html | 2 +- deps/npm/html/api/start.html | 2 +- deps/npm/html/api/stop.html | 2 +- deps/npm/html/api/submodule.html | 2 +- deps/npm/html/api/tag.html | 2 +- deps/npm/html/api/test.html | 2 +- deps/npm/html/api/uninstall.html | 2 +- deps/npm/html/api/unpublish.html | 2 +- deps/npm/html/api/update.html | 2 +- deps/npm/html/api/version.html | 2 +- deps/npm/html/api/view.html | 2 +- deps/npm/html/api/whoami.html | 2 +- deps/npm/html/doc/README.html | 2 +- deps/npm/html/doc/adduser.html | 2 +- deps/npm/html/doc/bin.html | 2 +- deps/npm/html/doc/bugs.html | 2 +- deps/npm/html/doc/build.html | 2 +- deps/npm/html/doc/bundle.html | 2 +- deps/npm/html/doc/cache.html | 2 +- deps/npm/html/doc/changelog.html | 2 +- deps/npm/html/doc/coding-style.html | 2 +- deps/npm/html/doc/completion.html | 2 +- deps/npm/html/doc/config.html | 2 +- deps/npm/html/doc/dedupe.html | 2 +- deps/npm/html/doc/deprecate.html | 2 +- deps/npm/html/doc/developers.html | 2 +- deps/npm/html/doc/disputes.html | 2 +- deps/npm/html/doc/docs.html | 2 +- deps/npm/html/doc/edit.html | 2 +- deps/npm/html/doc/explore.html | 2 +- deps/npm/html/doc/faq.html | 2 +- deps/npm/html/doc/folders.html | 2 +- deps/npm/html/doc/help-search.html | 2 +- deps/npm/html/doc/help.html | 2 +- deps/npm/html/doc/index.html | 2 +- deps/npm/html/doc/init.html | 2 +- deps/npm/html/doc/install.html | 2 +- deps/npm/html/doc/json.html | 4 +- deps/npm/html/doc/link.html | 2 +- deps/npm/html/doc/ls.html | 4 +- deps/npm/html/doc/npm.html | 4 +- deps/npm/html/doc/outdated.html | 2 +- deps/npm/html/doc/owner.html | 2 +- deps/npm/html/doc/pack.html | 2 +- deps/npm/html/doc/prefix.html | 2 +- deps/npm/html/doc/prune.html | 2 +- deps/npm/html/doc/publish.html | 2 +- deps/npm/html/doc/rebuild.html | 2 +- deps/npm/html/doc/registry.html | 2 +- deps/npm/html/doc/removing-npm.html | 2 +- deps/npm/html/doc/restart.html | 2 +- deps/npm/html/doc/root.html | 2 +- deps/npm/html/doc/run-script.html | 2 +- deps/npm/html/doc/scripts.html | 51 ++++++++- deps/npm/html/doc/search.html | 2 +- deps/npm/html/doc/semver.html | 8 +- deps/npm/html/doc/shrinkwrap.html | 2 +- deps/npm/html/doc/star.html | 2 +- deps/npm/html/doc/start.html | 2 +- deps/npm/html/doc/stop.html | 2 +- deps/npm/html/doc/submodule.html | 2 +- deps/npm/html/doc/tag.html | 2 +- deps/npm/html/doc/test.html | 2 +- deps/npm/html/doc/uninstall.html | 2 +- deps/npm/html/doc/unpublish.html | 2 +- deps/npm/html/doc/update.html | 2 +- deps/npm/html/doc/version.html | 2 +- deps/npm/html/doc/view.html | 2 +- deps/npm/html/doc/whoami.html | 2 +- deps/npm/lib/cache.js | 14 ++- deps/npm/lib/dedupe.js | 1 + deps/npm/lib/deprecate.js | 2 +- deps/npm/lib/install.js | 108 ++++++++++++------ deps/npm/lib/ls.js | 17 ++- deps/npm/lib/outdated.js | 2 + deps/npm/lib/publish.js | 1 + deps/npm/lib/run-script.js | 3 + deps/npm/lib/uninstall.js | 1 + deps/npm/lib/unpublish.js | 1 + deps/npm/lib/utils/lifecycle.js | 1 + deps/npm/man/man1/README.1 | 2 +- deps/npm/man/man1/adduser.1 | 2 +- deps/npm/man/man1/bin.1 | 2 +- deps/npm/man/man1/bugs.1 | 2 +- deps/npm/man/man1/build.1 | 2 +- deps/npm/man/man1/bundle.1 | 2 +- deps/npm/man/man1/cache.1 | 2 +- deps/npm/man/man1/changelog.1 | 2 +- deps/npm/man/man1/coding-style.1 | 2 +- deps/npm/man/man1/completion.1 | 2 +- deps/npm/man/man1/config.1 | 2 +- deps/npm/man/man1/dedupe.1 | 2 +- deps/npm/man/man1/deprecate.1 | 2 +- deps/npm/man/man1/developers.1 | 2 +- deps/npm/man/man1/disputes.1 | 2 +- deps/npm/man/man1/docs.1 | 2 +- deps/npm/man/man1/edit.1 | 2 +- deps/npm/man/man1/explore.1 | 2 +- deps/npm/man/man1/faq.1 | 2 +- deps/npm/man/man1/folders.1 | 2 +- deps/npm/man/man1/help-search.1 | 2 +- deps/npm/man/man1/help.1 | 2 +- deps/npm/man/man1/index.1 | 2 +- deps/npm/man/man1/init.1 | 2 +- deps/npm/man/man1/install.1 | 2 +- deps/npm/man/man1/json.1 | 6 +- deps/npm/man/man1/link.1 | 2 +- deps/npm/man/man1/ls.1 | 4 +- deps/npm/man/man1/npm.1 | 4 +- deps/npm/man/man1/outdated.1 | 2 +- deps/npm/man/man1/owner.1 | 2 +- deps/npm/man/man1/pack.1 | 2 +- deps/npm/man/man1/prefix.1 | 2 +- deps/npm/man/man1/prune.1 | 2 +- deps/npm/man/man1/publish.1 | 2 +- deps/npm/man/man1/rebuild.1 | 2 +- deps/npm/man/man1/registry.1 | 2 +- deps/npm/man/man1/removing-npm.1 | 2 +- deps/npm/man/man1/restart.1 | 2 +- deps/npm/man/man1/root.1 | 2 +- deps/npm/man/man1/run-script.1 | 2 +- deps/npm/man/man1/scripts.1 | 77 +++++++++++-- deps/npm/man/man1/search.1 | 2 +- deps/npm/man/man1/semver.1 | 8 +- deps/npm/man/man1/shrinkwrap.1 | 2 +- deps/npm/man/man1/star.1 | 2 +- deps/npm/man/man1/start.1 | 2 +- deps/npm/man/man1/stop.1 | 2 +- deps/npm/man/man1/submodule.1 | 2 +- deps/npm/man/man1/tag.1 | 2 +- deps/npm/man/man1/test.1 | 2 +- deps/npm/man/man1/uninstall.1 | 2 +- deps/npm/man/man1/unpublish.1 | 2 +- deps/npm/man/man1/update.1 | 2 +- deps/npm/man/man1/version.1 | 2 +- deps/npm/man/man1/view.1 | 2 +- deps/npm/man/man1/whoami.1 | 2 +- deps/npm/man/man3/bin.3 | 2 +- deps/npm/man/man3/bugs.3 | 2 +- deps/npm/man/man3/commands.3 | 2 +- deps/npm/man/man3/config.3 | 2 +- deps/npm/man/man3/deprecate.3 | 2 +- deps/npm/man/man3/docs.3 | 2 +- deps/npm/man/man3/edit.3 | 2 +- deps/npm/man/man3/explore.3 | 2 +- deps/npm/man/man3/help-search.3 | 2 +- deps/npm/man/man3/init.3 | 2 +- deps/npm/man/man3/install.3 | 2 +- deps/npm/man/man3/link.3 | 2 +- deps/npm/man/man3/load.3 | 2 +- deps/npm/man/man3/ls.3 | 2 +- deps/npm/man/man3/npm.3 | 4 +- deps/npm/man/man3/outdated.3 | 2 +- deps/npm/man/man3/owner.3 | 2 +- deps/npm/man/man3/pack.3 | 2 +- deps/npm/man/man3/prefix.3 | 2 +- deps/npm/man/man3/prune.3 | 2 +- deps/npm/man/man3/publish.3 | 2 +- deps/npm/man/man3/rebuild.3 | 2 +- deps/npm/man/man3/restart.3 | 2 +- deps/npm/man/man3/root.3 | 2 +- deps/npm/man/man3/run-script.3 | 2 +- deps/npm/man/man3/search.3 | 2 +- deps/npm/man/man3/shrinkwrap.3 | 2 +- deps/npm/man/man3/start.3 | 2 +- deps/npm/man/man3/stop.3 | 2 +- deps/npm/man/man3/submodule.3 | 2 +- deps/npm/man/man3/tag.3 | 2 +- deps/npm/man/man3/test.3 | 2 +- deps/npm/man/man3/uninstall.3 | 2 +- deps/npm/man/man3/unpublish.3 | 2 +- deps/npm/man/man3/update.3 | 2 +- deps/npm/man/man3/version.3 | 2 +- deps/npm/man/man3/view.3 | 2 +- deps/npm/man/man3/whoami.3 | 2 +- .../node_modules/fstream/lib/file-writer.js | 5 + .../node_modules/fstream/lib/proxy-writer.js | 4 +- deps/npm/node_modules/fstream/package.json | 6 +- deps/npm/node_modules/node-gyp/lib/build.js | 57 ++++++--- .../node_modules/node-gyp/lib/configure.js | 4 +- deps/npm/node_modules/node-gyp/lib/install.js | 2 +- deps/npm/node_modules/node-gyp/package.json | 9 +- deps/npm/node_modules/semver/README.md | 2 +- deps/npm/node_modules/semver/package.json | 8 +- deps/npm/package.json | 4 +- .../npm-test-peer-deps-invalid/README | 1 + .../npm-test-peer-deps-invalid/npm-ls.json | 22 ++++ .../npm-test-peer-deps-invalid/package.json | 12 ++ .../npm-test-peer-deps-invalid/test.js | 31 +++++ .../test/packages/npm-test-peer-deps/README | 1 + .../packages/npm-test-peer-deps/npm-ls.json | 18 +++ .../packages/npm-test-peer-deps/package.json | 11 ++ .../test/packages/npm-test-peer-deps/test.js | 20 ++++ 222 files changed, 665 insertions(+), 300 deletions(-) create mode 100644 deps/npm/test/packages/npm-test-peer-deps-invalid/README create mode 100644 deps/npm/test/packages/npm-test-peer-deps-invalid/npm-ls.json create mode 100644 deps/npm/test/packages/npm-test-peer-deps-invalid/package.json create mode 100644 deps/npm/test/packages/npm-test-peer-deps-invalid/test.js create mode 100644 deps/npm/test/packages/npm-test-peer-deps/README create mode 100644 deps/npm/test/packages/npm-test-peer-deps/npm-ls.json create mode 100644 deps/npm/test/packages/npm-test-peer-deps/package.json create mode 100644 deps/npm/test/packages/npm-test-peer-deps/test.js diff --git a/deps/npm/doc/cli/json.md b/deps/npm/doc/cli/json.md index 46df441895..c6cedaaaf3 100644 --- a/deps/npm/doc/cli/json.md +++ b/deps/npm/doc/cli/json.md @@ -366,8 +366,8 @@ a version in the following fashion. For example, the following are equivalent: * `"~1.2.3" = ">=1.2.3 <1.3.0"` -* `"~1.2" = ">=1.2.0 <2.0.0"` -* `"~1" = ">=1.0.0 <2.0.0"` +* `"~1.2" = ">=1.2.0 <1.3.0"` +* `"~1" = ">=1.0.0 <1.1.0"` ### X Version Ranges diff --git a/deps/npm/doc/cli/scripts.md b/deps/npm/doc/cli/scripts.md index 3d33a83919..0eba5f7b12 100644 --- a/deps/npm/doc/cli/scripts.md +++ b/deps/npm/doc/cli/scripts.md @@ -6,6 +6,11 @@ npm-scripts(1) -- How npm handles the "scripts" field npm supports the "scripts" member of the package.json script, for the following scripts: +* prepublish: + Run BEFORE the package is published. (Also run on local `npm + install` without any arguments.) +* publish, postpublish: + Run AFTER the package is published. * preinstall: Run BEFORE the package is installed * install, postinstall: @@ -18,10 +23,6 @@ following scripts: Run BEFORE the package is updated with the update command. * update, postupdate: Run AFTER the package is updated with the update command. -* prepublish: - Run BEFORE the package is published. -* publish, postpublish: - Run AFTER the package is published. * pretest, test, posttest: Run by the `npm test` command. * prestop, stop, poststop: @@ -35,6 +36,50 @@ following scripts: Additionally, arbitrary scrips can be run by doing `npm run-script `. +## NOTE: INSTALL SCRIPTS ARE AN ANTIPATTERN + +**tl;dr** Don't use `install`. Use a `.gyp` file for compilation, and +`prepublish` for anything else. + +You should almost never have to explicitly set a `preinstall` or +`install` script. If you are doing this, please consider if there is +another option. + +The only valid use of `install` or `preinstall` scripts is for +compilation which must be done on the target architecture. In early +versions of node, this was often done using the `node-waf` scripts, or +a standalone `Makefile`, and early versions of npm required that it be +explicitly set in package.json. This was not portable, and harder to +do properly. + +In the current version of node, the standard way to do this is using a +`.gyp` file. If you have a file with a `.gyp` extension in the root +of your package, then npm will run the appropriate `node-gyp` commands +automatically at install time. This is the only officially supported +method for compiling binary addons, and does not require that you add +anything to your package.json file. + +If you have to do other things before your package is used, in a way +that is not dependent on the operating system or architecture of the +target system, then use a `prepublish` script instead. This includes +tasks such as: + +* Compile CoffeeScript source code into JavaScript. +* Create minified versions of JavaScript source code. +* Fetching remote resources that your package will use. + +The advantage of doing these things at `prepublish` time instead of +`preinstall` or `install` time is that they can be done once, in a +single place, and thus greatly reduce complexity and variability. +Additionally, this means that: + +* You can depend on `coffee-script` as a `devDependency`, and thus + your users don't need to have it installed. +* You don't need to include the minifiers in your package, reducing + the size for your users. +* You don't need to rely on your users having `curl` or `wget` or + other system tools on the target machines. + ## DEFAULT VALUES npm will default some script values based on package contents. diff --git a/deps/npm/doc/cli/semver.md b/deps/npm/doc/cli/semver.md index 7eb2240639..493dd7a1ef 100644 --- a/deps/npm/doc/cli/semver.md +++ b/deps/npm/doc/cli/semver.md @@ -11,8 +11,8 @@ As a node module: $ npm install semver - semver.valid('1.2.3') // true - semver.valid('a.b.c') // false + semver.valid('1.2.3') // '1.2.3' + semver.valid('a.b.c') // null semver.clean(' =v1.2.3 ') // '1.2.3' semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true semver.gt('1.2.3', '9.8.7') // false @@ -83,7 +83,7 @@ The following range styles are supported: * `<1.2.3` Less than * `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` * `~1.2.3` := `>=1.2.3 <1.3.0` -* `~1.2` := `>=1.2.0 <2.0.0` +* `~1.2` := `>=1.2.0 <1.3.0` * `~1` := `>=1.0.0 <2.0.0` * `1.2.x` := `>=1.2.0 <1.3.0` * `1.x` := `>=1.0.0 <2.0.0` diff --git a/deps/npm/html/api/bin.html b/deps/npm/html/api/bin.html index 05b588cfe0..73eb5c169b 100644 --- a/deps/npm/html/api/bin.html +++ b/deps/npm/html/api/bin.html @@ -19,7 +19,7 @@

This function should not be used programmatically. Instead, just refer to the npm.bin member.

- +