-
-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathczrc-schema.d.ts
More file actions
440 lines (387 loc) · 11.1 KB
/
czrc-schema.d.ts
File metadata and controls
440 lines (387 loc) · 11.1 KB
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
export interface CommitizenGitOptions {
/**
* project: "node_modules/cz-git"
* root: "cz-git"
* @default node_modules/cz-git
*/
path?: string
$schema?: string
prompt?: CommitizenGitOptions
/**
* define commonly used commit message alias
*
* @default { fd: "docs: fix typos" }
* @use commitizen CLI: "cz_alias=fd cz"
* @use czg CLI: "czg --alias=fd" | "czg :fd"
* @note use commitizen CLI will meet process not exit. cz-git can't resolve it.
*/
alias?: Record<string, string>
/**
* Customize prompt questions
*/
messages?: Answers
/**
* the prompt inquirer primary color
*
* @rule `38;5;${color_code}`
* @tip the color_code can get by https://github.com/sindresorhus/xterm-colors
* @example "38;5;043"
* @default '' //cyan color
*/
themeColorCode?: string
/**
* Customize prompt type
*/
types?: TypesOption[]
/**
* Add extra types to default types
*
* @use Use when you don't want to add bloated defaults and don't want to adjust the default order in configuration
* @example `typesAppend: [ { value: "workflow", name: "workflow: Workflow changes"} ],`
* @default []
*/
typesAppend?: TypesOption[]
/**
* Default types list fuzzy search types `value` key of list.
* If choose `false` will search `name` key of list.
*
* @use Using emoji unicode as `value` and that can't be searched
* @default true
*/
typesSearchValue?: boolean
/**
* Use OpenAI to auto generate short description for commit message
*
* @default false
*/
useAI?: boolean
/**
* If >1 will turn on select mode, select generate options like returned by OpenAI
*
* @default 1
*/
aiNumber?: number
/**
* Choose the AI model you want to use
*
* @see https://platform.openai.com/docs/models/model-endpoint-compatibility => /v1/chat/completions
* @example "gpt-3.5-turbo" | "gpt-4" | "gpt-4o" | "gpt-4o-mini"
* @default "gpt-4o-mini"
*/
aiModel?: string
/**
* To ignore selection codes when sending AI API requests
*
* @default [ "package-lock.json", "yarn.lock", "pnpm-lock.yaml" ]
* @example [ "pnpm-lock.yaml", "docs/public" ]
*/
aiDiffIgnore?: string[]
/**
* Use emoji ?It will be use typesOption.emoji code
*
* @default false
*/
useEmoji?: boolean
/**
* Set the location of emoji in header
*
* @default "center"
*/
emojiAlign?: 'left' | 'center' | 'right'
/**
* Provides a select of prompt to select module scopes
*
* @commitlint it auto import value from rule "scope-enum"
*/
scopes?: ScopesType
/**
* Default scope list fuzzy search types `name` key of list.
* If choose `true` will search `value` key of list.
*
* @use If have long description of scope. can use it to enhanced search.
* @default false
*/
scopesSearchValue?: boolean
/**
* Provides an overriding select of prompt to select module scopes under specific type
*
* @note use this option should set `scopes` option to realize distinguish
* @example { "test": ["e2eTest", "unitTest"] }
*/
scopeOverrides?: { [type: string]: ScopesType }
/**
* Filter select of prompt to select module scopes by the scope.value
*
* @default ['.DS_Store']
*/
scopeFilters?: string[]
/**
* Whether to enable scope multiple mode
*
* @default false
*/
enableMultipleScopes?: boolean
/**
* Multiple choice scope separator
*
* @default ","
*/
scopeEnumSeparator?: string
/**
* Whether to show "custom" when selecting scopes
*
* @note it auto check rule "scope-enum" set the option with `@commitlint`
* @use when you not use commitlint
* @default true
*/
allowCustomScopes?: boolean
/**
* Whether to show "empty" when selecting scopes
*
* @default true
*/
allowEmptyScopes?: boolean
/**
* Set the location of empty option (empty) and custom option (custom) in selection range
*
* @default "bottom"
*/
customScopesAlign?: 'top' | 'bottom' | 'top-bottom' | 'bottom-top'
/**
* @default "custom"
*/
customScopesAlias?: string
/**
* @default "empty"
*/
emptyScopesAlias?: string
/**
* Subject is need upper case first.
*
* - `null`: Do not process
* - `true`: Automatically capitalize the first letter
* - `false`: Automatically lowercase the first letter
* @default null
*/
upperCaseSubject?: boolean | null
/**
* Whether to add extra prompt BREAKCHANGE ask. to add an extra "!" to the header
*
* @see: https://cz-git.qbb.sh/recipes/breakingchange
* @default false
*/
markBreakingChangeMode?: boolean
/**
* Allow breaking changes in the included types output box
*
* @default ['feat', 'fix']
*/
allowBreakingChanges?: string[]
/**
* set body and BREAKING CHANGE max length to break-line
*
* @default 100
* @commitlint it auto check rule "body-max-line-length".
*/
breaklineNumber?: number
/**
* body and BREAKINGCHANGES new line char
*
* @default "|"
*/
breaklineChar?: string
/**
* Provides a select issue prefix box in footer
*
* @default issuePrefixes: [{ value: "closed", name: "ISSUES has been processed" }]
*/
issuePrefixes?: Option[]
/**
* @default "top"
*/
customIssuePrefixAlign?: 'top' | 'bottom' | 'top-bottom' | 'bottom-top'
/**
* @default "skip"
*/
emptyIssuePrefixAlias?: string
/**
* @default "custom"
*/
customIssuePrefixAlias?: string
/**
* Whether to show "custom" selecting issue prefixes
*
* @default true
*/
allowCustomIssuePrefix?: boolean
/**
* Whether to show "skip(empty)" when selecting issue prefixes
*
* @default true
*/
allowEmptyIssuePrefix?: boolean
/**
* Prompt final determination whether to display the color
*
* @default true
*/
confirmColorize?: boolean
/**
* List of questions you want to skip
*
* @default []
* @example ['body']
*/
skipQuestions?: Array<'scope' | 'body' | 'breaking' | 'footerPrefix' | 'footer' | 'confirmCommit'>
/**
* Force set max header length | Equivalent setting maxSubjectLength.
*
* @commitlint it auto check rule and use value from "header-max-length".
* @use when you not use commitlint
*/
maxHeaderLength?: number
/**
* Force set max subject length.
*
* @commitlint it auto check rule and use value from "subject-max-length".
* @use when you not use commitlint
*/
maxSubjectLength?: number
/**
* Is not strict subject rule. Just provide prompt word length warning.
* Effected maxHeader and maxSubject commitlint.
*
* @example [1, 'always', 80] 1: mean warning. will be true
* @default false
*/
isIgnoreCheckMaxSubjectLength?: boolean
/**
* Force set header width.
*
* @commitlint it auto check rule and use value from "subject-min-length".
* @use when you not use commitlint
*/
minSubjectLength?: number
/**
* pin type item the top of the types list (match item value)
*/
defaultType?: string
/**
* Whether to use display default value in custom scope
*
* @tip
* 1. pin scope item the top of the scope list (match item value)
* 2. `string[]` for checkbox mode will default-select the options whose values match those within the `scopes` range list.
* @usage When you want to use default, just keyboard `Enter` it
*/
defaultScope?: string | string[]
/**
* default value show subject template prompt
*
* @usage If you want to use template complete. just keyboard `Tab` or `Right Arrow` it
* @usage If you want to use default, just keyboard `Enter` it
*/
defaultSubject?: string
/**
* default value show body and BREAKINGCHANGES template prompt
*
* @usage If you want to use template complete. just keyboard `Tab` or `Right Arrow` it
* @usage When you want to use default, just keyboard `Enter` it
*/
defaultBody?: string
/**
* default value show issuePrefixes custom template prompt
*
* @usage If you want to use template complete. just keyboard `Tab` or `Right Arrow` it
* @usage When you want to use default, just keyboard `Enter` it
*/
defaultFooterPrefix?: string
/**
* default value show issue foot template prompt
*
* @usage If you want to use template complete. just keyboard `Tab` or `Right Arrow` it
* @usage When you want to use default, just keyboard `Enter` it
*/
defaultIssues?: string
/**
* Whether to use GPG sign commit message (git commit -S -m)
* @note the options only support `czg` cz-git cli and no support git hooks mode
* @see https://github.com/Zhengqbbb/cz-git/issues/58
* @default false
*/
useCommitSignGPG?: boolean
}
export interface Answers {
/**
* @default "Select the type of change that you're committing:"
*/
type?: string
/**
* @default 'Denote the SCOPE of this change (optional):'
*/
scope?: string | string[]
/**
* @default 'Denote the SCOPE of this change:'
*/
customScope?: string
/**
* @default 'Write a SHORT, IMPERATIVE tense description of the change:\n'
*/
subject?: string
/**
* @default 'a LONGER description of the change (optional). Use "|" to break new line:\n'
*/
body?: string
/**
* @default 'Is any BREAKING CHANGE (add "!" in header) (optional) ?'
* @use need turn on options "markBreakingChangeMode"
*/
markBreaking?: string | boolean
/**
* @default 'List any BREAKING CHANGES (optional). Use "|" to break new line:\n'
*/
breaking?: string
/**
* @default 'Select the ISSUES type of change (optional):'
*/
footerPrefixesSelect?: string
/**
* @default 'Input ISSUES prefix:'
*/
customFooterPrefix?: string
/**
* @default 'List any ISSUES AFFECTED by this change. E.g.: #31, #34:'
*/
footer?: string
/**
* @default 'Are you sure you want to proceed with the commit above?'
*/
confirmCommit?: string
/**
* @default 'Generating your AI commit subject...'
*/
generatingByAI?: string
/**
* @default 'Select suitable subject by AI generated:'
*/
generatedSelectByAI?: string
}
export interface Option {
/**
* @description: show prompt name
*/
name: string
/**
* @description: output real value
*/
value: string
}
export interface TypesOption extends Option {
/**
* @description: Submit emoji commit string
* @see: https://gitmoji.dev/
* @example: ":bug:" => 🐛
*/
emoji?: string
}
export type ScopesType = string[] | Array<{ name: string, value?: string }>