-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.json
170 lines (170 loc) · 5.14 KB
/
schema.json
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
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "JSON schema for myver configuration files.",
"type": "object",
"definitions": {
"part": {
"description": "Configuration of a single version part.",
"type": "object",
"properties": {
"value": {
"description": "The actual value of a part.",
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "string"
},
{
"type": "null"
}
]
},
"requires": {
"description": "Defines another part this this part requires. If this value is specified, it means that the part that is required will always be set as long as this part is set.",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"prefix": {
"description": "The prefix string for the part.",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"identifier": {
"$ref": "#/definitions/identifier"
},
"number": {
"$ref": "#/definitions/number"
}
},
"required": [
"value"
],
"not": {
"required": [
"identifier",
"number"
]
}
},
"identifier": {
"description": "This configures a part to be an identifier string. You would use this when you have multiple possible strings for a part that have a chronological order between each string. A common example are the pre-release identifiers of `alpha`, `beta`, and `rc`.",
"type": "object",
"properties": {
"strings": {
"description": "These are the strings which should be listed in their chronological order.",
"type": "array",
"items": {
"type": "string",
"pattern": "(?!null)"
},
"minItems": 1,
"uniqueItems": true
},
"start": {
"description": "You can define a custom start value, by default the start value will be the first value in the `strings` list. If you do define a custom start value, it needs to be a value that is also in the string list.",
"type": "string"
}
}
},
"number": {
"description": "This configures a part to be a number. This means that it is easily incremented, and it cannot contain alphabetic characters.",
"type": "object",
"properties": {
"label": {
"description": "Sometimes you will want a label for a number part. An example of this would be a `build` part, instead of just using a number to represent this part, you may instead see something like `build.4` as a part.",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"label-suffix": {
"description": "A label may have a suffix (characters after the label) in order to separate the label with the number. An example of this would be the `.` suffix on a `build` label, which would give something like `build.4` as a part.",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"start": {
"description": "When the part is reset or invoked, this is the value that the part will start at. By default, number parts start at 0.",
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"show-start": {
"description": "Sometimes you may not want to show the first value of a number part. An example of this would be a `dev` part, commonly you may see a version like `3.4.5+dev` which would define the first dev instance of a version, then the second dev instance would look like this `3.4.5+dev.2`.",
"type": "boolean"
}
},
"required": [
"start"
]
}
},
"properties": {
"files": {
"description": "List of paths to update with version changes.",
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"description": "The path or glob defining the file(s) to update.",
"type": "string"
},
"patterns": {
"description": "List of patterns to look for when updating a file.",
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"path"
],
"minItems": 1
}
},
"parts": {
"description": "The collections of all part configurations.",
"type": "object",
"patternProperties": {
"^[_a-zA-Z][a-zA-Z0-9_-]*$": {
"$ref": "#/definitions/part"
}
},
"minProperties": 1
}
},
"required": [
"parts"
]
}