]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-version.html
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / html / doc / cli / npm-version.html
1 <!doctype html>
2 <html>
3   <title>npm-version</title>
4   <meta charset="utf-8">
5   <link rel="stylesheet" type="text/css" href="../../static/style.css">
6   <link rel="canonical" href="https://www.npmjs.org/doc/cli/npm-version.html">
7   <script async=true src="../../static/toc.js"></script>
8
9   <body>
10     <div id="wrapper">
11
12 <h1><a href="../cli/npm-version.html">npm-version</a></h1> <p>Bump a package version</p>
13 <h2 id="synopsis">SYNOPSIS</h2>
14 <pre><code>npm version [&lt;newversion&gt; | major | minor | patch | premajor | preminor | prepatch | prerelease]
15 </code></pre><h2 id="description">DESCRIPTION</h2>
16 <p>Run this in a package directory to bump the version and write the new
17 data back to <code>package.json</code> and, if present, <code>npm-shrinkwrap.json</code>.</p>
18 <p>The <code>newversion</code> argument should be a valid semver string, <em>or</em> a
19 valid second argument to semver.inc (one of <code>patch</code>, <code>minor</code>, <code>major</code>,
20 <code>prepatch</code>, <code>preminor</code>, <code>premajor</code>, <code>prerelease</code>). In the second case,
21 the existing version will be incremented by 1 in the specified field.</p>
22 <p>If run in a git repo, it will also create a version commit and tag.
23 This behavior is controlled by <code>git-tag-version</code> (see below), and can
24 be disabled on the command line by running <code>npm --no-git-tag-version version</code>.
25 It will fail if the working directory is not clean, unless the <code>--force</code>
26 flag is set.</p>
27 <p>If supplied with <code>--message</code> (shorthand: <code>-m</code>) config option, npm will
28 use it as a commit message when creating a version commit.  If the
29 <code>message</code> config contains <code>%s</code> then that will be replaced with the
30 resulting version number.  For example:</p>
31 <pre><code>npm version patch -m &quot;Upgrade to %s for reasons&quot;
32 </code></pre><p>If the <code>sign-git-tag</code> config is set, then the tag will be signed using
33 the <code>-s</code> flag to git.  Note that you must have a default GPG key set up
34 in your git config for this to work properly.  For example:</p>
35 <pre><code>$ npm config set sign-git-tag true
36 $ npm version patch
37
38 You need a passphrase to unlock the secret key for
39 user: &quot;isaacs (http://blog.izs.me/) &lt;i@izs.me&gt;&quot;
40 2048-bit RSA key, ID 6C481CF6, created 2010-08-31
41
42 Enter passphrase:
43 </code></pre><p>If <code>preversion</code>, <code>version</code>, or <code>postversion</code> are in the <code>scripts</code> property of
44 the package.json, they will be executed as part of running <code>npm version</code>.</p>
45 <p>The exact order of execution is as follows:</p>
46 <ol>
47 <li>Check to make sure the git working directory is clean before we get started.
48 Your scripts may add files to the commit in future steps.
49 This step is skipped if the <code>--force</code> flag is set.</li>
50 <li>Run the <code>preversion</code> script. These scripts have access to the old <code>version</code> in package.json.
51 A typical use would be running your full test suite before deploying.
52 Any files you want added to the commit should be explicitly added using <code>git add</code>.</li>
53 <li>Bump <code>version</code> in <code>package.json</code> as requested (<code>patch</code>, <code>minor</code>, <code>major</code>, etc). </li>
54 <li>Run the <code>version</code> script. These scripts have access to the new <code>version</code> in package.json
55 (so they can incorporate it into file headers in generated files for example).
56 Again, scripts should explicitly add generated files to the commit using <code>git add</code>.</li>
57 <li>Commit and tag.</li>
58 <li>Run the <code>postversion</code> script. Use it to clean up the file system or automatically push
59 the commit and/or tag.</li>
60 </ol>
61 <p>Take the following example:</p>
62 <pre><code>&quot;scripts&quot;: {
63   &quot;preversion&quot;: &quot;npm test&quot;,
64   &quot;version&quot;: &quot;npm run build &amp;&amp; git add -A dist&quot;,
65   &quot;postversion&quot;: &quot;git push &amp;&amp; git push --tags &amp;&amp; rm -rf build/temp&quot;
66 }
67 </code></pre><p>This runs all your tests, and proceeds only if they pass. Then runs your <code>build</code> script, and
68 adds everything in the <code>dist</code> directory to the commit. After the commit, it pushes the new commit
69 and tag up to the server, and deletes the <code>build/temp</code> directory.</p>
70 <h2 id="configuration">CONFIGURATION</h2>
71 <h3 id="git-tag-version">git-tag-version</h3>
72 <ul>
73 <li>Default: true</li>
74 <li>Type: Boolean</li>
75 </ul>
76 <p>Commit and tag the version change.</p>
77 <h2 id="see-also">SEE ALSO</h2>
78 <ul>
79 <li><a href="../cli/npm-init.html">npm-init(1)</a></li>
80 <li><a href="../cli/npm-run-script.html">npm-run-script(1)</a></li>
81 <li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li>
82 <li><a href="../files/package.json.html">package.json(5)</a></li>
83 <li><a href="../misc/semver.html">semver(7)</a></li>
84 <li><a href="../misc/config.html">config(7)</a></li>
85 </ul>
86
87 </div>
88
89 <table border=0 cellspacing=0 cellpadding=0 id=npmlogo>
90 <tr><td style="width:180px;height:10px;background:rgb(237,127,127)" colspan=18>&nbsp;</td></tr>
91 <tr><td rowspan=4 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td><td style="width:40px;height:10px;background:#fff" colspan=4>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=4>&nbsp;</td><td style="width:40px;height:10px;background:#fff" colspan=4>&nbsp;</td><td rowspan=4 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td><td colspan=6 style="width:60px;height:10px;background:#fff">&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=4>&nbsp;</td></tr>
92 <tr><td colspan=2 style="width:20px;height:30px;background:#fff" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:#fff" rowspan=3>&nbsp;</td><td style="width:20px;height:10px;background:#fff" rowspan=4 colspan=2>&nbsp;</td><td style="width:10px;height:20px;background:rgb(237,127,127)" rowspan=2>&nbsp;</td><td style="width:10px;height:10px;background:#fff" rowspan=3>&nbsp;</td><td style="width:20px;height:10px;background:#fff" rowspan=3 colspan=2>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:#fff" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3>&nbsp;</td></tr>
93 <tr><td style="width:10px;height:10px;background:#fff" rowspan=2>&nbsp;</td></tr>
94 <tr><td style="width:10px;height:10px;background:#fff">&nbsp;</td></tr>
95 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
96 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
97 </table>
98 <p id="footer">npm-version &mdash; npm@2.15.11</p>
99