-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdevpackage.schema.json
More file actions
276 lines (275 loc) · 9.26 KB
/
devpackage.schema.json
File metadata and controls
276 lines (275 loc) · 9.26 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
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "JSON schema for devpm devpackage.json files",
"definitions": {
"vscodeDependency": {
"description": "Packages installed by visutal studio code. Key for vscode extension id, value for version. Version definitions: ''(empty) - install when not exists; 'latest' - uninstall and install latest, '1.0.0'(specified) - install when version mismatched.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"pythonDependency": {
"description": "Packages installed by pip. Key for pip name, value for version. Version definitions: ''(empty) - install when not exists; 'latest' - uninstall and install latest, '1.0.0'(specified) - install when version mismatched.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"vscodeSettings": {
"description": "Write to visual studio code user settings <https://code.visualstudio.com/docs/getstarted/settings#_settings-file-locations>. Key and value format same to the user settings. In addition, the value support `devpm expression`: `$bash.which:[bin]` - returns the bin path in system by `which [bin]`; `$pip.which:[bin]` - returns the bin path in pip by `pip show [bin]`",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"osDependency": {
"type": "object",
"description": "Packages installed by custom bash script. Key for excutable name after installed, value is an object describes script in platforms. The platform is from python `sys.platform`, include 'darwin', 'win32' and 'linux'.",
"patternProperties": {
".+": {
"type": "object",
"properties": {
"win32": {
"type": "string",
"description": "The dependency in win32, specified with a bash script or file URL."
},
"linux": {
"type": "string",
"description": "The dependency in linux, specified with a bash script or file URL."
},
"darwin": {
"type": "string",
"description": "The dependency in darwin, specified with a bash script or file URL."
}
},
"additionalProperties": false
}
}
},
"preCommitRepo": {
"type": "object",
"properties": {
"repo": {
"description": "The repo uri for pre-commit plugin. see https://pre-commit.com/hooks.html",
"type": "string",
"format": "uri"
},
"rev": {
"description": "The revision of the repo, see https://pre-commit.com/hooks.html",
"type": "string"
},
"hooks": {
"description": "The hooks provided by the repo, see https://pre-commit.com/hooks.html",
"type": "array",
"items": [
{
"type": "object",
"properties": {
"id": {
"description": "The hook id, see https://pre-commit.com/hooks.html",
"type": "string"
}
}
}
]
}
},
"additionalProperties": false
},
"gitHook": {
"description": "Write to git hooks for root project and it's git submodules. Support commit-msg, pre-commit",
"type": "object",
"properties": {
"commit-msg": {
"description": "The commit-msg git hook.",
"type": "object",
"properties": {
"type": {
"enum": ["regexp"],
"description": "The hook type, regexp for regular expression"
},
"pattern": {
"description": "The pattern(s) to match the commit-msg",
"oneOf":[
{"type": "string", "format": "regex"},
{"type": "array", "items": {"type": "string", "format": "regex"}}
]
},
"tips": {
"description": "The tips to show when the commit-msg test failed, used array to show multi-line.",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"pre-commit": {
"description": "The pre-commit git hook.",
"type": "object",
"properties": {
"type": {
"description": "The pre-commit hook type, 'pre-commit' for the python pre-commit which would generate '.pre-commit-config.yaml'",
"enum": ["pre-commit"]
},
"repos": {
"description": "The repos config used to generate '.pre-commit-config.yaml'",
"type": "array",
"items": {
"$ref": "#/definitions/preCommitRepo"
}
}
}
}
}
},
"scriptsInstallAfter": {
"description": "Run AFTER the package is installed.",
"type": "string",
"x-intellij-language-injection": "Shell Script"
},
"scriptsRestart": {
"description": "Run by the 'devpm restart' command. Note: 'devpm restart' will run the stop and start scripts if no restart script is provided.",
"type": "string",
"x-intellij-language-injection": "Shell Script"
},
"scriptsStart": {
"description": "Run by the 'devpm start' command.",
"type": "string",
"x-intellij-language-injection": "Shell Script"
},
"scriptsStop": {
"description": "Run by the 'devpm stop' command.",
"type": "string",
"x-intellij-language-injection": "Shell Script"
},
"scriptsTest": {
"description": "Run by the 'devpm test' command.",
"type": "string",
"x-intellij-language-injection": "Shell Script"
},
"scriptsUninstallBefore": {
"description": "Run BEFORE the package is uninstalled.",
"type": "string",
"x-intellij-language-injection": "Shell Script"
},
"scriptsVersionBefore": {
"description": "Run BEFORE bump the package version.",
"type": "string",
"x-intellij-language-injection": "Shell Script"
}
},
"type": "object",
"properties": {
"version": {
"description": "Version used for `devpm version` auto increasement.",
"type": "string"
},
"versionLoader": {
"type": "object",
"properties": {
}
},
"vscodeDependencies": {
"$ref": "#/definitions/vscodeDependency"
},
"pythonDependencies": {
"$ref": "#/definitions/pythonDependency"
},
"bashDependencies": {
"$ref": "#/definitions/osDependency"
},
"vscodeUserSettings": {
"$ref": "#/definitions/vscodeSettings"
},
"gitHooks": {
"$ref": "#/definitions/gitHook"
},
"scripts": {
"description": "The 'scripts' member is an object hash of script commands that are run at various times in the lifecycle of your package. The key is the lifecycle event, and the value is the command to run at that point.",
"type": "object",
"properties": {
"lint": {
"type": "string",
"description": "Run code quality tools, e.g. cpplint, ESLint, TSLint, etc."
},
"preversion": {
"$ref": "#/definitions/scriptsVersionBefore"
},
"version": {
"$ref": "#/definitions/scriptsVersionBefore"
},
"postversion": {
"type": "string",
"description": "Run AFTER bump the package version."
},
"preinstall": {
"type": "string",
"description": "Run BEFORE the package is installed."
},
"install": {
"$ref": "#/definitions/scriptsInstallAfter"
},
"postinstall": {
"$ref": "#/definitions/scriptsInstallAfter"
},
"preuninstall": {
"$ref": "#/definitions/scriptsUninstallBefore"
},
"uninstall": {
"$ref": "#/definitions/scriptsUninstallBefore"
},
"postuninstall": {
"type": "string",
"description": "Run AFTER the package is uninstalled."
},
"pretest": {
"$ref": "#/definitions/scriptsTest"
},
"test": {
"$ref": "#/definitions/scriptsTest"
},
"posttest": {
"$ref": "#/definitions/scriptsTest"
},
"prestop": {
"$ref": "#/definitions/scriptsStop"
},
"stop": {
"$ref": "#/definitions/scriptsStop"
},
"poststop": {
"$ref": "#/definitions/scriptsStop"
},
"prestart": {
"$ref": "#/definitions/scriptsStart"
},
"start": {
"$ref": "#/definitions/scriptsStart"
},
"poststart": {
"$ref": "#/definitions/scriptsStart"
},
"prerestart": {
"$ref": "#/definitions/scriptsRestart"
},
"restart": {
"$ref": "#/definitions/scriptsRestart"
},
"postrestart": {
"$ref": "#/definitions/scriptsRestart"
},
"serve": {
"type": "string",
"description": "Start dev server to serve application files"
}
},
"additionalProperties": {
"type": "string",
"tsType": "string | undefined",
"x-intellij-language-injection": "Shell Script"
}
}
}
}