]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-version.1
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / man / man1 / npm-version.1
1 .TH "NPM\-VERSION" "1" "October 2016" "" ""
2 .SH "NAME"
3 \fBnpm-version\fR \- Bump a package version
4 .SH SYNOPSIS
5 .P
6 .RS 2
7 .nf
8 npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease]
9 .fi
10 .RE
11 .SH DESCRIPTION
12 .P
13 Run this in a package directory to bump the version and write the new
14 data back to \fBpackage\.json\fP and, if present, \fBnpm\-shrinkwrap\.json\fP\|\.
15 .P
16 The \fBnewversion\fP argument should be a valid semver string, \fIor\fR a
17 valid second argument to semver\.inc (one of \fBpatch\fP, \fBminor\fP, \fBmajor\fP,
18 \fBprepatch\fP, \fBpreminor\fP, \fBpremajor\fP, \fBprerelease\fP)\. In the second case,
19 the existing version will be incremented by 1 in the specified field\.
20 .P
21 If run in a git repo, it will also create a version commit and tag\.
22 This behavior is controlled by \fBgit\-tag\-version\fP (see below), and can
23 be disabled on the command line by running \fBnpm \-\-no\-git\-tag\-version version\fP\|\.
24 It will fail if the working directory is not clean, unless the \fB\-\-force\fP
25 flag is set\.
26 .P
27 If supplied with \fB\-\-message\fP (shorthand: \fB\-m\fP) config option, npm will
28 use it as a commit message when creating a version commit\.  If the
29 \fBmessage\fP config contains \fB%s\fP then that will be replaced with the
30 resulting version number\.  For example:
31 .P
32 .RS 2
33 .nf
34 npm version patch \-m "Upgrade to %s for reasons"
35 .fi
36 .RE
37 .P
38 If the \fBsign\-git\-tag\fP config is set, then the tag will be signed using
39 the \fB\-s\fP flag to git\.  Note that you must have a default GPG key set up
40 in your git config for this to work properly\.  For example:
41 .P
42 .RS 2
43 .nf
44 $ npm config set sign\-git\-tag true
45 $ npm version patch
46
47 You need a passphrase to unlock the secret key for
48 user: "isaacs (http://blog\.izs\.me/) <i@izs\.me>"
49 2048\-bit RSA key, ID 6C481CF6, created 2010\-08\-31
50
51 Enter passphrase:
52 .fi
53 .RE
54 .P
55 If \fBpreversion\fP, \fBversion\fP, or \fBpostversion\fP are in the \fBscripts\fP property of
56 the package\.json, they will be executed as part of running \fBnpm version\fP\|\.
57 .P
58 The exact order of execution is as follows:
59 .RS 0
60 .IP 1. 3
61 Check to make sure the git working directory is clean before we get started\.
62 Your scripts may add files to the commit in future steps\.
63 This step is skipped if the \fB\-\-force\fP flag is set\.
64 .IP 2. 3
65 Run the \fBpreversion\fP script\. These scripts have access to the old \fBversion\fP in package\.json\.
66 A typical use would be running your full test suite before deploying\.
67 Any files you want added to the commit should be explicitly added using \fBgit add\fP\|\.
68 .IP 3. 3
69 Bump \fBversion\fP in \fBpackage\.json\fP as requested (\fBpatch\fP, \fBminor\fP, \fBmajor\fP, etc)\.
70 .IP 4. 3
71 Run the \fBversion\fP script\. These scripts have access to the new \fBversion\fP in package\.json
72 (so they can incorporate it into file headers in generated files for example)\.
73 Again, scripts should explicitly add generated files to the commit using \fBgit add\fP\|\.
74 .IP 5. 3
75 Commit and tag\.
76 .IP 6. 3
77 Run the \fBpostversion\fP script\. Use it to clean up the file system or automatically push
78 the commit and/or tag\.
79
80 .RE
81 .P
82 Take the following example:
83 .P
84 .RS 2
85 .nf
86 "scripts": {
87   "preversion": "npm test",
88   "version": "npm run build && git add \-A dist",
89   "postversion": "git push && git push \-\-tags && rm \-rf build/temp"
90 }
91 .fi
92 .RE
93 .P
94 This runs all your tests, and proceeds only if they pass\. Then runs your \fBbuild\fP script, and
95 adds everything in the \fBdist\fP directory to the commit\. After the commit, it pushes the new commit
96 and tag up to the server, and deletes the \fBbuild/temp\fP directory\.
97 .SH CONFIGURATION
98 .SS git\-tag\-version
99 .RS 0
100 .IP \(bu 2
101 Default: true
102 .IP \(bu 2
103 Type: Boolean
104
105 .RE
106 .P
107 Commit and tag the version change\.
108 .SH SEE ALSO
109 .RS 0
110 .IP \(bu 2
111 npm help init
112 .IP \(bu 2
113 npm help run\-script
114 .IP \(bu 2
115 npm help 7 scripts
116 .IP \(bu 2
117 npm help 5 package\.json
118 .IP \(bu 2
119 npm help 7 semver
120 .IP \(bu 2
121 npm help 7 config
122
123 .RE
124