Skip to content

Commit aa742dd

Browse files
committed
npm: Upgrade to v1.2.0
1 parent 7a2ae4c commit aa742dd

222 files changed

Lines changed: 665 additions & 300 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

deps/npm/doc/cli/json.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,8 @@ a version in the following fashion.
366366
For example, the following are equivalent:
367367

368368
* `"~1.2.3" = ">=1.2.3 <1.3.0"`
369-
* `"~1.2" = ">=1.2.0 <2.0.0"`
370-
* `"~1" = ">=1.0.0 <2.0.0"`
369+
* `"~1.2" = ">=1.2.0 <1.3.0"`
370+
* `"~1" = ">=1.0.0 <1.1.0"`
371371

372372
### X Version Ranges
373373

deps/npm/doc/cli/scripts.md

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ npm-scripts(1) -- How npm handles the "scripts" field
66
npm supports the "scripts" member of the package.json script, for the
77
following scripts:
88

9+
* prepublish:
10+
Run BEFORE the package is published. (Also run on local `npm
11+
install` without any arguments.)
12+
* publish, postpublish:
13+
Run AFTER the package is published.
914
* preinstall:
1015
Run BEFORE the package is installed
1116
* install, postinstall:
@@ -18,10 +23,6 @@ following scripts:
1823
Run BEFORE the package is updated with the update command.
1924
* update, postupdate:
2025
Run AFTER the package is updated with the update command.
21-
* prepublish:
22-
Run BEFORE the package is published.
23-
* publish, postpublish:
24-
Run AFTER the package is published.
2526
* pretest, test, posttest:
2627
Run by the `npm test` command.
2728
* prestop, stop, poststop:
@@ -35,6 +36,50 @@ following scripts:
3536
Additionally, arbitrary scrips can be run by doing
3637
`npm run-script <stage> <pkg>`.
3738

39+
## NOTE: INSTALL SCRIPTS ARE AN ANTIPATTERN
40+
41+
**tl;dr** Don't use `install`. Use a `.gyp` file for compilation, and
42+
`prepublish` for anything else.
43+
44+
You should almost never have to explicitly set a `preinstall` or
45+
`install` script. If you are doing this, please consider if there is
46+
another option.
47+
48+
The only valid use of `install` or `preinstall` scripts is for
49+
compilation which must be done on the target architecture. In early
50+
versions of node, this was often done using the `node-waf` scripts, or
51+
a standalone `Makefile`, and early versions of npm required that it be
52+
explicitly set in package.json. This was not portable, and harder to
53+
do properly.
54+
55+
In the current version of node, the standard way to do this is using a
56+
`.gyp` file. If you have a file with a `.gyp` extension in the root
57+
of your package, then npm will run the appropriate `node-gyp` commands
58+
automatically at install time. This is the only officially supported
59+
method for compiling binary addons, and does not require that you add
60+
anything to your package.json file.
61+
62+
If you have to do other things before your package is used, in a way
63+
that is not dependent on the operating system or architecture of the
64+
target system, then use a `prepublish` script instead. This includes
65+
tasks such as:
66+
67+
* Compile CoffeeScript source code into JavaScript.
68+
* Create minified versions of JavaScript source code.
69+
* Fetching remote resources that your package will use.
70+
71+
The advantage of doing these things at `prepublish` time instead of
72+
`preinstall` or `install` time is that they can be done once, in a
73+
single place, and thus greatly reduce complexity and variability.
74+
Additionally, this means that:
75+
76+
* You can depend on `coffee-script` as a `devDependency`, and thus
77+
your users don't need to have it installed.
78+
* You don't need to include the minifiers in your package, reducing
79+
the size for your users.
80+
* You don't need to rely on your users having `curl` or `wget` or
81+
other system tools on the target machines.
82+
3883
## DEFAULT VALUES
3984

4085
npm will default some script values based on package contents.

deps/npm/doc/cli/semver.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ As a node module:
1111

1212
$ npm install semver
1313

14-
semver.valid('1.2.3') // true
15-
semver.valid('a.b.c') // false
14+
semver.valid('1.2.3') // '1.2.3'
15+
semver.valid('a.b.c') // null
1616
semver.clean(' =v1.2.3 ') // '1.2.3'
1717
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
1818
semver.gt('1.2.3', '9.8.7') // false
@@ -83,7 +83,7 @@ The following range styles are supported:
8383
* `<1.2.3` Less than
8484
* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
8585
* `~1.2.3` := `>=1.2.3 <1.3.0`
86-
* `~1.2` := `>=1.2.0 <2.0.0`
86+
* `~1.2` := `>=1.2.0 <1.3.0`
8787
* `~1` := `>=1.0.0 <2.0.0`
8888
* `1.2.x` := `>=1.2.0 <1.3.0`
8989
* `1.x` := `>=1.0.0 <2.0.0`

deps/npm/html/api/bin.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ <h2 id="DESCRIPTION">DESCRIPTION</h2>
1919
<p>This function should not be used programmatically. Instead, just refer
2020
to the <code>npm.bin</code> member.</p>
2121
</div>
22-
<p id="footer">bin &mdash; npm@1.1.70</p>
22+
<p id="footer">bin &mdash; npm@1.2.0</p>
2323
<script>
2424
;(function () {
2525
var wrapper = document.getElementById("wrapper")

deps/npm/html/api/bugs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ <h2 id="DESCRIPTION">DESCRIPTION</h2>
2525
<p>This command will launch a browser, so this command may not be the most
2626
friendly for programmatic use.</p>
2727
</div>
28-
<p id="footer">bugs &mdash; npm@1.1.70</p>
28+
<p id="footer">bugs &mdash; npm@1.2.0</p>
2929
<script>
3030
;(function () {
3131
var wrapper = document.getElementById("wrapper")

deps/npm/html/api/commands.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ <h2 id="SEE-ALSO">SEE ALSO</h2>
2828

2929
<ul><li><a href="../doc/index.html">index(1)</a></li></ul>
3030
</div>
31-
<p id="footer">commands &mdash; npm@1.1.70</p>
31+
<p id="footer">commands &mdash; npm@1.2.0</p>
3232
<script>
3333
;(function () {
3434
var wrapper = document.getElementById("wrapper")

deps/npm/html/api/config.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h2 id="SEE-ALSO">SEE ALSO</h2>
3333

3434
<ul><li><a href="../api/npm.html">npm(3)</a></li></ul>
3535
</div>
36-
<p id="footer">config &mdash; npm@1.1.70</p>
36+
<p id="footer">config &mdash; npm@1.2.0</p>
3737
<script>
3838
;(function () {
3939
var wrapper = document.getElementById("wrapper")

deps/npm/html/api/deprecate.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ <h2 id="SEE-ALSO">SEE ALSO</h2>
3232

3333
<ul><li><a href="../api/publish.html">publish(3)</a></li><li><a href="../api/unpublish.html">unpublish(3)</a></li><li><a href="../doc/registry.html">registry(1)</a></li></ul>
3434
</div>
35-
<p id="footer">deprecate &mdash; npm@1.1.70</p>
35+
<p id="footer">deprecate &mdash; npm@1.2.0</p>
3636
<script>
3737
;(function () {
3838
var wrapper = document.getElementById("wrapper")

deps/npm/html/api/docs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ <h2 id="DESCRIPTION">DESCRIPTION</h2>
2525
<p>This command will launch a browser, so this command may not be the most
2626
friendly for programmatic use.</p>
2727
</div>
28-
<p id="footer">docs &mdash; npm@1.1.70</p>
28+
<p id="footer">docs &mdash; npm@1.2.0</p>
2929
<script>
3030
;(function () {
3131
var wrapper = document.getElementById("wrapper")

deps/npm/html/api/edit.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ <h2 id="DESCRIPTION">DESCRIPTION</h2>
3030
<p>Since this command opens an editor in a new process, be careful about where
3131
and how this is used.</p>
3232
</div>
33-
<p id="footer">edit &mdash; npm@1.1.70</p>
33+
<p id="footer">edit &mdash; npm@1.2.0</p>
3434
<script>
3535
;(function () {
3636
var wrapper = document.getElementById("wrapper")

0 commit comments

Comments
 (0)