@opentapd/tplugin-cli 0.65.0 → 0.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lint.js +0 -173
- package/package.json +2 -2
package/lib/lint.js
CHANGED
|
@@ -11,171 +11,6 @@ const yaml = require('js-yaml');
|
|
|
11
11
|
const spinner = require('../util/spinner');
|
|
12
12
|
const tapdsdk = require('../util/tapd');
|
|
13
13
|
const checkPluginYaml = require('../util/checkPluginYaml');
|
|
14
|
-
const Joi = require('joi');
|
|
15
|
-
|
|
16
|
-
const schema = Joi.object({
|
|
17
|
-
app: Joi.object({
|
|
18
|
-
code: Joi.string(),
|
|
19
|
-
desc: Joi.string(),
|
|
20
|
-
name: Joi.string(),
|
|
21
|
-
resources: Joi.array(),
|
|
22
|
-
scopes: Joi.array().items(Joi.string()),
|
|
23
|
-
tag: Joi.array().items({ name: Joi.string() }),
|
|
24
|
-
modules: {
|
|
25
|
-
autotasks: Joi.array().items({
|
|
26
|
-
code: Joi.string().required(),
|
|
27
|
-
conditions: Joi.array().items({
|
|
28
|
-
code: Joi.string().required(),
|
|
29
|
-
data: {
|
|
30
|
-
handler: Joi.string().required(),
|
|
31
|
-
},
|
|
32
|
-
icon: Joi.string().required(),
|
|
33
|
-
name: Joi.string().required(),
|
|
34
|
-
option: {
|
|
35
|
-
handler: Joi.string().required(),
|
|
36
|
-
},
|
|
37
|
-
related: Joi.array().items(Joi.string()),
|
|
38
|
-
type: Joi.string(),
|
|
39
|
-
desc: Joi.string(),
|
|
40
|
-
})
|
|
41
|
-
.unique('code'),
|
|
42
|
-
executors: {
|
|
43
|
-
actions: Joi.array().items({
|
|
44
|
-
code: Joi.string(),
|
|
45
|
-
desc: Joi.string(),
|
|
46
|
-
exec: {
|
|
47
|
-
handler: Joi.string(),
|
|
48
|
-
},
|
|
49
|
-
icon: Joi.string(),
|
|
50
|
-
name: Joi.string(),
|
|
51
|
-
option: {
|
|
52
|
-
handler: Joi.string(),
|
|
53
|
-
},
|
|
54
|
-
related: Joi.array().items(Joi.string()),
|
|
55
|
-
}),
|
|
56
|
-
},
|
|
57
|
-
icon: Joi.string(),
|
|
58
|
-
name: Joi.string(),
|
|
59
|
-
search: {
|
|
60
|
-
handler: Joi.string(),
|
|
61
|
-
},
|
|
62
|
-
trigger: {
|
|
63
|
-
events: Joi.array().items({
|
|
64
|
-
code: Joi.string(),
|
|
65
|
-
desc: Joi.string(),
|
|
66
|
-
event_change: {
|
|
67
|
-
handler: Joi.string(),
|
|
68
|
-
},
|
|
69
|
-
icon: Joi.string(),
|
|
70
|
-
name: Joi.string(),
|
|
71
|
-
option: {
|
|
72
|
-
handler: Joi.string(),
|
|
73
|
-
},
|
|
74
|
-
related: Joi.array().items(Joi.string()),
|
|
75
|
-
}),
|
|
76
|
-
},
|
|
77
|
-
})
|
|
78
|
-
.unique('code'),
|
|
79
|
-
object: Joi.array().items({
|
|
80
|
-
code: Joi.string().required(),
|
|
81
|
-
fields: {
|
|
82
|
-
handler: Joi.string().required(),
|
|
83
|
-
},
|
|
84
|
-
getter: {
|
|
85
|
-
handler: Joi.string().required(),
|
|
86
|
-
},
|
|
87
|
-
name: Joi.string().required(),
|
|
88
|
-
relations: Joi.array().items({
|
|
89
|
-
code: Joi.string().required(),
|
|
90
|
-
handler: Joi.string().required(),
|
|
91
|
-
related: Joi.string(),
|
|
92
|
-
type: Joi.string(),
|
|
93
|
-
})
|
|
94
|
-
.unique('code'),
|
|
95
|
-
})
|
|
96
|
-
.unique('code'),
|
|
97
|
-
webhooks: Joi.array().items({
|
|
98
|
-
handler: Joi.string().required(),
|
|
99
|
-
events: Joi.array().items(Joi.string()),
|
|
100
|
-
}),
|
|
101
|
-
scm: Joi.object({
|
|
102
|
-
support: Joi.object({
|
|
103
|
-
branch: Joi.boolean(),
|
|
104
|
-
mr: Joi.boolean(),
|
|
105
|
-
repo: Joi.boolean(),
|
|
106
|
-
api: Joi.boolean(),
|
|
107
|
-
}).unknown(),
|
|
108
|
-
name: Joi.string(),
|
|
109
|
-
desc: Joi.string(),
|
|
110
|
-
code: Joi.string(),
|
|
111
|
-
adapter: Joi.object({
|
|
112
|
-
_hooks_handler: Joi.object({
|
|
113
|
-
adapter: Joi.string(),
|
|
114
|
-
}),
|
|
115
|
-
branches: Joi.object({
|
|
116
|
-
get: Joi.string(),
|
|
117
|
-
post: Joi.string(),
|
|
118
|
-
}),
|
|
119
|
-
commit: Joi.object({
|
|
120
|
-
get: Joi.string(),
|
|
121
|
-
}),
|
|
122
|
-
commit_diff: Joi.object({
|
|
123
|
-
get: Joi.string(),
|
|
124
|
-
}),
|
|
125
|
-
commits: Joi.object({
|
|
126
|
-
get: Joi.string(),
|
|
127
|
-
}),
|
|
128
|
-
hook: Joi.object({
|
|
129
|
-
delete: Joi.string(),
|
|
130
|
-
put: Joi.string(),
|
|
131
|
-
}),
|
|
132
|
-
hooks: Joi.object({
|
|
133
|
-
get: Joi.string(),
|
|
134
|
-
post: Joi.string(),
|
|
135
|
-
}),
|
|
136
|
-
merge_requests: Joi.object({
|
|
137
|
-
get: Joi.string(),
|
|
138
|
-
get_mr_url: Joi.string(),
|
|
139
|
-
}),
|
|
140
|
-
project: Joi.object({
|
|
141
|
-
get: Joi.string(),
|
|
142
|
-
}),
|
|
143
|
-
projects: Joi.object({
|
|
144
|
-
get: Joi.string(),
|
|
145
|
-
}),
|
|
146
|
-
query_commits: Joi.object({
|
|
147
|
-
get: Joi.string(),
|
|
148
|
-
}),
|
|
149
|
-
}).unknown(),
|
|
150
|
-
}),
|
|
151
|
-
},
|
|
152
|
-
fields: Joi.array().items({
|
|
153
|
-
code: Joi.string().required(),
|
|
154
|
-
name: Joi.string(),
|
|
155
|
-
desc: Joi.string(),
|
|
156
|
-
option: Joi.array().items({
|
|
157
|
-
value: Joi.string().required(),
|
|
158
|
-
name: Joi.string().required(),
|
|
159
|
-
})
|
|
160
|
-
.unique('value'),
|
|
161
|
-
related: Joi.array().items(Joi.string()
|
|
162
|
-
.valid('story', 'bug', 'task')),
|
|
163
|
-
type: Joi.string().valid(
|
|
164
|
-
'text',
|
|
165
|
-
'multi_select',
|
|
166
|
-
'select',
|
|
167
|
-
'checkbox',
|
|
168
|
-
'radio',
|
|
169
|
-
'textarea',
|
|
170
|
-
'cascade_radio',
|
|
171
|
-
'cascade_checkbox',
|
|
172
|
-
)
|
|
173
|
-
.required(),
|
|
174
|
-
validate: Joi.string(),
|
|
175
|
-
})
|
|
176
|
-
.unique('code'),
|
|
177
|
-
}).unknown(),
|
|
178
|
-
});
|
|
179
14
|
|
|
180
15
|
// 检查插件格式
|
|
181
16
|
module.exports = async () => {
|
|
@@ -189,14 +24,6 @@ module.exports = async () => {
|
|
|
189
24
|
const docObj = yaml.load(yamlFile);
|
|
190
25
|
const doc = yaml.dump(docObj);
|
|
191
26
|
|
|
192
|
-
const yamlInJSON = yaml.load(yamlFile, { json: true });
|
|
193
|
-
|
|
194
|
-
const { error } = schema.validate(yamlInJSON);
|
|
195
|
-
if (error) {
|
|
196
|
-
error.title = 'plugin.yaml校验不通过';
|
|
197
|
-
throw error;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
27
|
// 发起lint,远程校验文件配置内容
|
|
201
28
|
const res = await lint(doc);
|
|
202
29
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentapd/tplugin-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.66.0",
|
|
4
4
|
"description": "tplugin-cli",
|
|
5
5
|
"bin": {
|
|
6
6
|
"tplugin-cli": "index.js"
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"node": ">=14.13.0"
|
|
80
80
|
},
|
|
81
81
|
"main": "index.js",
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "f708dd5bc9689f9c7d1def6b1c4e393c8dc6784c"
|
|
83
83
|
}
|