diff options
Diffstat (limited to 'deps/npm/html/doc/misc/npm-scripts.html')
-rw-r--r-- | deps/npm/html/doc/misc/npm-scripts.html | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/deps/npm/html/doc/misc/npm-scripts.html b/deps/npm/html/doc/misc/npm-scripts.html index 172a6cd748..c140ea2152 100644 --- a/deps/npm/html/doc/misc/npm-scripts.html +++ b/deps/npm/html/doc/misc/npm-scripts.html @@ -16,7 +16,13 @@ following scripts:</p> <ul> <li>prepublish: Run BEFORE the package is published. (Also run on local <code>npm -install</code> without any arguments.)</li> +install</code> without any arguments. See below.)</li> +<li>prepare: +Run both BEFORE the package is published, and on local <code>npm +install</code> without any arguments. (See below.) This is run +AFTER <code>prepublish</code>, but BEFORE <code>prepublishOnly</code>.</li> +<li>prepublishOnly: +Run BEFORE the package is published. (See below.)</li> <li>publish, postpublish: Run AFTER the package is published.</li> <li>preinstall: @@ -50,7 +56,25 @@ run-script <stage></code>. <em>Pre</em> and <em>post</em> commands with ma names will be run for those as well (e.g. <code>premyscript</code>, <code>myscript</code>, <code>postmyscript</code>). Scripts from dependencies can be run with `npm explore</p> <p><pkg> -- npm run <stage>`.</p> -<h2 id="common-uses">COMMON USES</h2> +<h2 id="prepublish-and-prepare">PREPUBLISH AND PREPARE</h2> +<h3 id="deprecation-note">DEPRECATION NOTE</h3> +<p>Since <code>npm@1.1.71</code>, the npm CLI has run the <code>prepublish</code> script for both <code>npm +publish</code> and <code>npm install</code>, because it's a convenient way to prepare a package +for use (some common use cases are described in the section below). It has +also turned out to be, in practice, <a href="https://github.com/npm/npm/issues/10074">very +confusing</a>. As of <code>npm@4.0.0</code>, a new +event has been introduced, <code>prepare</code>, that preserves this existing behavior. A +<em>new</em> event, <code>prepublishOnly</code> has been added as a transitional strategy to +allow users to avoid the confusing behavior of existing npm versions and only +run on <code>npm publish</code> (for instance, running the tests one last time to ensure +they're in good shape).</p> +<p><strong>IMPORTANT:</strong> As of <code>npm@5</code>, <code>prepublish</code> will <em>only</em> be run for <code>npm +publish</code>. This will make its behavior identical to <code>prepublishOnly</code>, so +<code>npm@6</code> or later may drop support for the use of <code>prepublishOnly</code>, and then +maybe we can all forget this embarrassing thing ever happened.</p> +<p>See <a href="https://github.com/npm/npm/issues/10074">https://github.com/npm/npm/issues/10074</a> for a much lengthier +justification, with further reading, for this change.</p> +<h3 id="use-cases">USE CASES</h3> <p>If you need to perform operations on your package before it is used, in a way that is not dependent on the operating system or architecture of the target system, use a <code>prepublish</code> script. This includes @@ -213,5 +237,5 @@ scripts is for compilation which must be done on the target architecture.</li> <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr> <tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr> </table> -<p id="footer">npm-scripts — npm@3.10.10</p> +<p id="footer">npm-scripts — npm@4.0.5</p> |