forked from JS-DevTools/version-bump-prompt
/
version-bump-options.ts
152 lines (135 loc) · 4.13 KB
/
version-bump-options.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
import type { VersionBumpProgress } from './version-bump-progress'
/**
* Options for the `versionBump()` function.
*/
export interface VersionBumpOptions {
/**
* The release version or type. Can be one of the following:
*
* - The new version number (e.g. "1.23.456")
* - A release type (e.g. "major", "minor", "patch", "prerelease", etc.)
* - "prompt" to prompt the user for the version number
*
* Defaults to "prompt".
*/
release?: string
/**
* The prerelease type (e.g. "alpha", "beta", "next").
*
* Defaults to "beta".
*/
preid?: string
/**
* Indicates whether to create a git commit. Can be set to a custom commit message string
* or `true` to use "release v". Any `%s` placeholders in the message string will be replaced
* with the new version number. If the message string does _not_ contain any `%s` placeholders,
* then the new version number will be appended to the message.
*
* Defaults to `false`.
*/
commit?: boolean | string
/**
* Indicates whether to tag the git commit. Can be set to a custom tag string
* or `true` to use "v". Any `%s` placeholders in the tag string will be replaced
* with the new version number. If the tag string does _not_ contain any `%s` placeholders,
* then the new version number will be appended to the tag.
*
* Defaults to `false`.
*/
tag?: boolean | string
/**
* Indicates whether to push the git commit and tag.
*
* Defaults to `false`.
*/
push?: boolean
/**
* Indicates whether the git commit should include ALL files (`git commit --all`)
* rather than just the files that were modified by `versionBump()`.
*
* Defaults to `false`.
*/
all?: boolean
/**
* Prompt for confirmation
*
* @default false
*/
confirm?: boolean
/**
* Indicates whether to bypass git commit hooks (`git commit --no-verify`).
*
* Defaults to `false`.
*/
noVerify?: boolean
/**
* The files to be updated. For certain known files ("package.json", "bower.json", etc.)
* `versionBump()` will explicitly update the file's version number. For other files
* (ReadMe files, config files, source code, etc.) it will simply do a global replacement
* of the old version number with the new version number.
*
* Defaults to ["package.json", "package-lock.json"]
*/
files?: string[]
/**
* The working directory, which is used as the basis for locating all files.
*
* Defaults to `process.cwd()`
*/
cwd?: string
/**
* Options for the command-line interface. Can be one of the following:
*
* - `true` - To default to `process.stdin` and `process.stdout`.
* - `false` - To disable all CLI output. Cannot be used when `release` is "prompt".
* - An object that will be passed to `readline.createInterface()`.
*
* Defaults to `true`.
*/
interface?: boolean | InterfaceOptions
/**
* Indicates whether to ignore version scripts.
*
* Defaults to `false`.
*/
ignoreScripts?: boolean
/**
* A callback that is provides information about the progress of the `versionBump()` function.
*/
progress?(progress: VersionBumpProgress): void
/**
* Excute additional command after bumping and before commiting
*/
execute?: string
}
/**
* Options for the command-line interface.
*/
export interface InterfaceOptions {
/**
* The stream that will be used to read user input. Can be one of the following:
*
* - `true` - To default to `process.stdin`
* - `false` - To disable all CLI input
* - Any readable stream
*
* Defaults to `true`.
*/
input?: NodeJS.ReadableStream | NodeJS.ReadStream | boolean
/**
* The stream that will be used to write output, such as prompts and progress.
* Can be one of the following:
*
* - `true` - To default to `process.stdout`
* - `false` - To disable all CLI output
* - Any writable stream
*
* Defaults to `true`.
*/
output?: NodeJS.WritableStream | NodeJS.WriteStream | boolean
/**
* Any other properties will be passed directly to `readline.createInterface()`.
* See the `ReadLineOptions` interface for possible options.
*/
[key: string]: unknown
}