@iobroker/repochecker 3.2.3 → 3.2.4
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/LICENSE +21 -21
- package/README.md +229 -181
- package/index.js +70 -72
- package/lib/M000_PackageJson.js +141 -65
- package/lib/M100_IOPackageJson.js +602 -455
- package/lib/M250_Npm.js +34 -25
- package/lib/M300_Testing.js +7 -1
- package/lib/M400_Repository.js +130 -45
- package/lib/M500_Code.js +21 -18
- package/lib/M500__JsonConfig.js +197 -190
- package/lib/M600_Readme.js +12 -7
- package/lib/M700_License.js +8 -5
- package/lib/M800_Github.js +15 -7
- package/lib/M900_GitNpmIgnore.js +34 -31
- package/lib/common.js +4 -4
- package/lib/config.js +34 -47
- package/package.json +8 -6
package/lib/M500__JsonConfig.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable no-unused-vars */
|
|
2
1
|
'use strict';
|
|
3
2
|
/*
|
|
4
3
|
This module is a support module for iobroker.repochecker
|
|
@@ -50,75 +49,75 @@ const stdAttributes = [
|
|
|
50
49
|
'validatorErrorText',
|
|
51
50
|
'validatorNoSaveOnError',
|
|
52
51
|
|
|
53
|
-
'#include'
|
|
52
|
+
'#include',
|
|
54
53
|
];
|
|
55
54
|
|
|
56
55
|
const validComponents = {
|
|
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
|
-
|
|
56
|
+
accordion: check_accordion,
|
|
57
|
+
alive: check_alive,
|
|
58
|
+
autocomplete: check_autocomplete,
|
|
59
|
+
autocompleteSendTo: check_autocompleteSendTo,
|
|
60
|
+
|
|
61
|
+
certificate: check_certificate,
|
|
62
|
+
certificates: check_certificates,
|
|
63
|
+
certificateCollection: check_certificateCollection,
|
|
64
|
+
checkbox: check_checkbox,
|
|
65
|
+
checkLicense: check_checkLicense,
|
|
66
|
+
chips: check_chips,
|
|
67
|
+
color: check_color,
|
|
68
|
+
coordinates: check_coordinates,
|
|
69
|
+
cron: check_cron,
|
|
70
|
+
custom: check_custom,
|
|
71
|
+
datePicker: check_datePicker,
|
|
72
|
+
deviceManager: check_deviceManager,
|
|
73
|
+
divider: check_divider,
|
|
74
|
+
|
|
75
|
+
file: check_file,
|
|
76
|
+
fileSelector: check_fileSelector,
|
|
77
|
+
func: check_func,
|
|
78
|
+
|
|
79
|
+
header: check_header,
|
|
80
|
+
|
|
81
|
+
image: check_image,
|
|
82
|
+
imageSendTo: check_imageSendTo,
|
|
83
|
+
instance: check_instance,
|
|
84
|
+
interface: check_interface,
|
|
85
|
+
ip: check_ip,
|
|
86
|
+
|
|
87
|
+
jsonEditor: check_jsonEditor,
|
|
88
|
+
|
|
89
|
+
language: check_language,
|
|
90
|
+
license: check_license,
|
|
91
|
+
|
|
92
|
+
number: check_number,
|
|
93
|
+
|
|
94
|
+
objectId: check_objectId,
|
|
95
|
+
|
|
96
|
+
password: check_password,
|
|
97
|
+
pattern: check_pattern,
|
|
98
|
+
port: check_port,
|
|
99
|
+
|
|
100
|
+
qrCode: check_qrCode,
|
|
101
|
+
|
|
102
|
+
room: check_room,
|
|
103
|
+
|
|
104
|
+
select: check_select,
|
|
105
|
+
selectSendTo: check_selectSendTo,
|
|
106
|
+
sendTo: check_sendTo,
|
|
107
|
+
setState: check_setState,
|
|
108
|
+
slider: check_slider,
|
|
109
|
+
state: check_state,
|
|
110
|
+
staticImage: check_staticImage,
|
|
111
|
+
staticLink: check_staticLink,
|
|
112
|
+
staticText: check_staticText,
|
|
113
|
+
|
|
114
|
+
table: check_table,
|
|
115
|
+
text: check_text,
|
|
116
|
+
textSendTo: check_textSendTo,
|
|
117
|
+
timePicker: check_timePicker,
|
|
118
|
+
|
|
119
|
+
user: check_user,
|
|
120
|
+
uuid: check_uuid,
|
|
122
121
|
};
|
|
123
122
|
|
|
124
123
|
function handleResponsiveError(context, msg) {
|
|
@@ -126,7 +125,9 @@ function handleResponsiveError(context, msg) {
|
|
|
126
125
|
context.errors.push(`${msg}`);
|
|
127
126
|
responsiveErrorLimit--;
|
|
128
127
|
if (responsiveErrorLimit === 0) {
|
|
129
|
-
context.errors.push(
|
|
128
|
+
context.errors.push(
|
|
129
|
+
`[E510] responsive check: maximum issues reached, please fix reported ones and recheck`,
|
|
130
|
+
);
|
|
130
131
|
}
|
|
131
132
|
}
|
|
132
133
|
}
|
|
@@ -136,308 +137,339 @@ function handleResponsiveWarning(context, msg) {
|
|
|
136
137
|
context.warnings.push(`${msg}`);
|
|
137
138
|
responsiveWarningLimit--;
|
|
138
139
|
if (responsiveWarningLimit === 0) {
|
|
139
|
-
context.warnings.push(
|
|
140
|
+
context.warnings.push(
|
|
141
|
+
`[W510] responsive check: maximum issues reached, please fix reported ones and recheck`,
|
|
142
|
+
);
|
|
140
143
|
}
|
|
141
144
|
}
|
|
142
145
|
}
|
|
143
146
|
|
|
144
|
-
function chk_responsive
|
|
147
|
+
function chk_responsive(context, path, jsonConfig, component, opts) {
|
|
145
148
|
common.debug(`chk_responsive ${path}`);
|
|
146
149
|
|
|
147
150
|
if (!opts || !opts.sizesOptional) {
|
|
148
151
|
const missing = [];
|
|
149
|
-
if (!jsonConfig.xs)
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
if (!jsonConfig.
|
|
153
|
-
|
|
152
|
+
if (!jsonConfig.xs) {
|
|
153
|
+
missing.push('xs');
|
|
154
|
+
}
|
|
155
|
+
if (!jsonConfig.sm) {
|
|
156
|
+
missing.push('sm');
|
|
157
|
+
}
|
|
158
|
+
if (!jsonConfig.md) {
|
|
159
|
+
missing.push('md');
|
|
160
|
+
}
|
|
161
|
+
if (!jsonConfig.lg) {
|
|
162
|
+
missing.push('lg');
|
|
163
|
+
}
|
|
164
|
+
if (!jsonConfig.xl) {
|
|
165
|
+
missing.push('xl');
|
|
166
|
+
}
|
|
154
167
|
if (missing.length) {
|
|
155
|
-
handleResponsiveError(
|
|
168
|
+
handleResponsiveError(
|
|
169
|
+
context,
|
|
170
|
+
`[E507] missing size attributes [${missing.join(',')}] for ${component} at ${path}`,
|
|
171
|
+
);
|
|
156
172
|
}
|
|
157
173
|
}
|
|
158
174
|
|
|
159
|
-
if (
|
|
160
|
-
handleResponsiveWarning(
|
|
175
|
+
if (jsonConfig.xs && jsonConfig.xs != 12) {
|
|
176
|
+
handleResponsiveWarning(
|
|
177
|
+
context,
|
|
178
|
+
`[W508] attribute "xs" for ${component} should specify a value of "12" at ${path}`,
|
|
179
|
+
);
|
|
161
180
|
}
|
|
162
181
|
|
|
163
182
|
let ii = 12;
|
|
164
|
-
if (jsonConfig.xs)
|
|
165
|
-
|
|
166
|
-
|
|
183
|
+
if (jsonConfig.xs) {
|
|
184
|
+
ii = jsonConfig.xs;
|
|
185
|
+
}
|
|
186
|
+
if (jsonConfig.sm && jsonConfig.sm > ii) {
|
|
187
|
+
handleResponsiveError(
|
|
188
|
+
context,
|
|
189
|
+
`[E509] "sm" value (${jsonConfig.sm}) for ${component} greater then value for smaller displays`,
|
|
190
|
+
);
|
|
167
191
|
} else {
|
|
168
192
|
ii = jsonConfig.sm;
|
|
169
193
|
}
|
|
170
|
-
if (jsonConfig.md && jsonConfig.md > ii
|
|
171
|
-
handleResponsiveError(
|
|
194
|
+
if (jsonConfig.md && jsonConfig.md > ii) {
|
|
195
|
+
handleResponsiveError(
|
|
196
|
+
context,
|
|
197
|
+
`[E509] "md" value (${jsonConfig.md}) for ${component} greater then value for smaller displays`,
|
|
198
|
+
);
|
|
172
199
|
} else {
|
|
173
200
|
ii = jsonConfig.md;
|
|
174
201
|
}
|
|
175
|
-
if (jsonConfig.lg && jsonConfig.lg > ii
|
|
176
|
-
handleResponsiveError(
|
|
202
|
+
if (jsonConfig.lg && jsonConfig.lg > ii) {
|
|
203
|
+
handleResponsiveError(
|
|
204
|
+
context,
|
|
205
|
+
`[E509] "lg" value (${jsonConfig.lg}) for ${component} greater then value for smaller displays`,
|
|
206
|
+
);
|
|
177
207
|
} else {
|
|
178
208
|
ii = jsonConfig.lg;
|
|
179
209
|
}
|
|
180
|
-
if (jsonConfig.xl && jsonConfig.xl > ii
|
|
181
|
-
handleResponsiveError(
|
|
210
|
+
if (jsonConfig.xl && jsonConfig.xl > ii) {
|
|
211
|
+
handleResponsiveError(
|
|
212
|
+
context,
|
|
213
|
+
`[E509] "xl" value (${jsonConfig.xl}) for ${component} greater then value for smaller displays`,
|
|
214
|
+
);
|
|
182
215
|
}
|
|
183
216
|
}
|
|
184
217
|
|
|
185
|
-
function check_accordion
|
|
218
|
+
function check_accordion(context, path, jsonConfig, _inTable) {
|
|
186
219
|
common.debug(`check_accordion ${path}`);
|
|
187
220
|
chk_responsive(context, path, jsonConfig, 'accordion');
|
|
188
221
|
}
|
|
189
222
|
|
|
190
|
-
function check_alive(context, path, jsonConfig,
|
|
223
|
+
function check_alive(context, path, jsonConfig, _inTable) {
|
|
191
224
|
common.debug(`check_alive ${path}`);
|
|
192
225
|
chk_responsive(context, path, jsonConfig, 'alive');
|
|
193
226
|
}
|
|
194
227
|
|
|
195
|
-
function check_autocomplete(context, path, jsonConfig,
|
|
228
|
+
function check_autocomplete(context, path, jsonConfig, _inTable) {
|
|
196
229
|
common.debug(`check_autocomplete ${path}`);
|
|
197
230
|
chk_responsive(context, path, jsonConfig, 'autocomplete');
|
|
198
231
|
}
|
|
199
232
|
|
|
200
|
-
function check_autocompleteSendTo(context, path, jsonConfig,
|
|
233
|
+
function check_autocompleteSendTo(context, path, jsonConfig, _inTable) {
|
|
201
234
|
common.debug(`check_autocompleteSendTo ${path}`);
|
|
202
235
|
chk_responsive(context, path, jsonConfig, 'autocompleteSendTo');
|
|
203
236
|
}
|
|
204
237
|
|
|
205
|
-
function check_certificate(context, path, jsonConfig,
|
|
238
|
+
function check_certificate(context, path, jsonConfig, _inTable) {
|
|
206
239
|
common.debug(`check_certificate ${path}`);
|
|
207
240
|
chk_responsive(context, path, jsonConfig, 'certificate');
|
|
208
241
|
}
|
|
209
242
|
|
|
210
|
-
function check_certificates(context, path, jsonConfig,
|
|
243
|
+
function check_certificates(context, path, jsonConfig, _inTable) {
|
|
211
244
|
common.debug(`check_certificates ${path}`);
|
|
212
245
|
chk_responsive(context, path, jsonConfig, 'certificates');
|
|
213
246
|
}
|
|
214
247
|
|
|
215
|
-
function check_certificateCollection(context, path, jsonConfig,
|
|
248
|
+
function check_certificateCollection(context, path, jsonConfig, _inTable) {
|
|
216
249
|
common.debug(`check_certificateCollection ${path}`);
|
|
217
250
|
chk_responsive(context, path, jsonConfig, 'certificateCollection');
|
|
218
251
|
}
|
|
219
252
|
|
|
220
|
-
function check_checkbox(context, path, jsonConfig,
|
|
253
|
+
function check_checkbox(context, path, jsonConfig, _inTable) {
|
|
221
254
|
common.debug(`check_checkbox ${path}`);
|
|
222
255
|
chk_responsive(context, path, jsonConfig, 'checkbox');
|
|
223
256
|
}
|
|
224
257
|
|
|
225
|
-
function check_checkLicense(context, path, jsonConfig,
|
|
258
|
+
function check_checkLicense(context, path, jsonConfig, _inTable) {
|
|
226
259
|
common.debug(`check_checkLicense ${path}`);
|
|
227
260
|
chk_responsive(context, path, jsonConfig, 'checkLicense');
|
|
228
261
|
}
|
|
229
262
|
|
|
230
|
-
function check_chips(context, path, jsonConfig,
|
|
263
|
+
function check_chips(context, path, jsonConfig, _inTable) {
|
|
231
264
|
common.debug(`check_chips ${path}`);
|
|
232
265
|
chk_responsive(context, path, jsonConfig, 'chips');
|
|
233
266
|
}
|
|
234
267
|
|
|
235
|
-
function check_color(context, path, jsonConfig,
|
|
268
|
+
function check_color(context, path, jsonConfig, _inTable) {
|
|
236
269
|
common.debug(`check_color ${path}`);
|
|
237
270
|
chk_responsive(context, path, jsonConfig, 'color');
|
|
238
271
|
}
|
|
239
272
|
|
|
240
|
-
function check_coordinates(context, path, jsonConfig,
|
|
273
|
+
function check_coordinates(context, path, jsonConfig, _inTable) {
|
|
241
274
|
common.debug(`check_coordinates ${path}`);
|
|
242
275
|
chk_responsive(context, path, jsonConfig, 'coordinates');
|
|
243
276
|
}
|
|
244
277
|
|
|
245
|
-
function check_cron(context, path, jsonConfig,
|
|
278
|
+
function check_cron(context, path, jsonConfig, _inTable) {
|
|
246
279
|
common.debug(`check_staticText ${path}`);
|
|
247
280
|
chk_responsive(context, path, jsonConfig, 'cron');
|
|
248
281
|
}
|
|
249
282
|
|
|
250
|
-
function check_custom(context, path, jsonConfig,
|
|
283
|
+
function check_custom(context, path, jsonConfig, _inTable) {
|
|
251
284
|
common.debug(`check_custom ${path}`);
|
|
252
|
-
chk_responsive(context, path, jsonConfig, 'custom', {sizesOptional:true});
|
|
285
|
+
chk_responsive(context, path, jsonConfig, 'custom', { sizesOptional: true });
|
|
253
286
|
}
|
|
254
287
|
|
|
255
|
-
function check_datePicker(context, path, jsonConfig,
|
|
288
|
+
function check_datePicker(context, path, jsonConfig, _inTable) {
|
|
256
289
|
common.debug(`check_datePicker ${path}`);
|
|
257
290
|
chk_responsive(context, path, jsonConfig, 'datePicker');
|
|
258
291
|
}
|
|
259
292
|
|
|
260
|
-
function check_deviceManager(context, path, jsonConfig,
|
|
293
|
+
function check_deviceManager(context, path, jsonConfig, _inTable) {
|
|
261
294
|
common.debug(`check_deviceManager ${path}`);
|
|
262
|
-
chk_responsive(context, path, jsonConfig, 'deviceManager', {sizesOptional:true});
|
|
295
|
+
chk_responsive(context, path, jsonConfig, 'deviceManager', { sizesOptional: true });
|
|
263
296
|
}
|
|
264
297
|
|
|
265
|
-
function check_divider(context, path, jsonConfig,
|
|
298
|
+
function check_divider(context, path, jsonConfig, _inTable) {
|
|
266
299
|
common.debug(`check_divider ${path}`);
|
|
267
|
-
chk_responsive(context, path, jsonConfig, 'divider', {sizesOptional:true});
|
|
300
|
+
chk_responsive(context, path, jsonConfig, 'divider', { sizesOptional: true });
|
|
268
301
|
}
|
|
269
302
|
|
|
270
|
-
function check_file(context, path, jsonConfig,
|
|
303
|
+
function check_file(context, path, jsonConfig, _inTable) {
|
|
271
304
|
common.debug(`check_file ${path}`);
|
|
272
305
|
chk_responsive(context, path, jsonConfig, 'file');
|
|
273
306
|
}
|
|
274
307
|
|
|
275
|
-
function check_fileSelector(context, path, jsonConfig,
|
|
308
|
+
function check_fileSelector(context, path, jsonConfig, _inTable) {
|
|
276
309
|
common.debug(`check_fileSelector ${path}`);
|
|
277
310
|
chk_responsive(context, path, jsonConfig, 'fileSelector');
|
|
278
311
|
}
|
|
279
312
|
|
|
280
|
-
function check_func(context, path, jsonConfig,
|
|
313
|
+
function check_func(context, path, jsonConfig, _inTable) {
|
|
281
314
|
common.debug(`check_func ${path}`);
|
|
282
315
|
chk_responsive(context, path, jsonConfig, 'func');
|
|
283
316
|
}
|
|
284
317
|
|
|
285
|
-
function check_header(context, path, jsonConfig,
|
|
318
|
+
function check_header(context, path, jsonConfig, _inTable) {
|
|
286
319
|
common.debug(`check_header ${path}`);
|
|
287
|
-
chk_responsive(context, path, jsonConfig, 'header', {sizesOptional:true});
|
|
320
|
+
chk_responsive(context, path, jsonConfig, 'header', { sizesOptional: true });
|
|
288
321
|
}
|
|
289
322
|
|
|
290
|
-
function check_image(context, path, jsonConfig,
|
|
323
|
+
function check_image(context, path, jsonConfig, _inTable) {
|
|
291
324
|
common.debug(`check_image ${path}`);
|
|
292
325
|
chk_responsive(context, path, jsonConfig, 'image');
|
|
293
326
|
}
|
|
294
327
|
|
|
295
|
-
function check_imageSendTo(context, path, jsonConfig,
|
|
328
|
+
function check_imageSendTo(context, path, jsonConfig, _inTable) {
|
|
296
329
|
common.debug(`check_imageSendTo ${path}`);
|
|
297
330
|
chk_responsive(context, path, jsonConfig, 'imageSendTo');
|
|
298
331
|
}
|
|
299
332
|
|
|
300
|
-
function check_instance(context, path, jsonConfig,
|
|
333
|
+
function check_instance(context, path, jsonConfig, _inTable) {
|
|
301
334
|
common.debug(`check_instance ${path}`);
|
|
302
335
|
chk_responsive(context, path, jsonConfig, 'instance');
|
|
303
336
|
}
|
|
304
337
|
|
|
305
|
-
function check_interface(context, path, jsonConfig,
|
|
338
|
+
function check_interface(context, path, jsonConfig, _inTable) {
|
|
306
339
|
common.debug(`check_interface ${path}`);
|
|
307
340
|
chk_responsive(context, path, jsonConfig, 'interface');
|
|
308
341
|
}
|
|
309
342
|
|
|
310
|
-
function check_ip(context, path, jsonConfig,
|
|
343
|
+
function check_ip(context, path, jsonConfig, _inTable) {
|
|
311
344
|
common.debug(`check_ip ${path}`);
|
|
312
345
|
chk_responsive(context, path, jsonConfig, 'ip');
|
|
313
346
|
}
|
|
314
347
|
|
|
315
|
-
function check_jsonEditor(context, path, jsonConfig,
|
|
348
|
+
function check_jsonEditor(context, path, jsonConfig, _inTable) {
|
|
316
349
|
common.debug(`check_jsonEditor ${path}`);
|
|
317
350
|
chk_responsive(context, path, jsonConfig, 'jsonEditor');
|
|
318
351
|
}
|
|
319
352
|
|
|
320
|
-
function check_language(context, path, jsonConfig,
|
|
353
|
+
function check_language(context, path, jsonConfig, _inTable) {
|
|
321
354
|
common.debug(`check_language ${path}`);
|
|
322
355
|
chk_responsive(context, path, jsonConfig, 'language');
|
|
323
356
|
}
|
|
324
357
|
|
|
325
|
-
function check_license(context, path, jsonConfig,
|
|
358
|
+
function check_license(context, path, jsonConfig, _inTable) {
|
|
326
359
|
common.debug(`check_license ${path}`);
|
|
327
360
|
chk_responsive(context, path, jsonConfig, 'license');
|
|
328
361
|
}
|
|
329
362
|
|
|
330
|
-
function check_number(context, path, jsonConfig,
|
|
363
|
+
function check_number(context, path, jsonConfig, _inTable) {
|
|
331
364
|
common.debug(`check_number ${path}`);
|
|
332
365
|
chk_responsive(context, path, jsonConfig, 'number');
|
|
333
366
|
}
|
|
334
367
|
|
|
335
|
-
function check_objectId(context, path, jsonConfig,
|
|
368
|
+
function check_objectId(context, path, jsonConfig, _inTable) {
|
|
336
369
|
common.debug(`check_objectId ${path}`);
|
|
337
370
|
chk_responsive(context, path, jsonConfig, 'objectId');
|
|
338
371
|
}
|
|
339
372
|
|
|
340
|
-
function check_password(context, path, jsonConfig,
|
|
373
|
+
function check_password(context, path, jsonConfig, _inTable) {
|
|
341
374
|
common.debug(`check_password ${path}`);
|
|
342
375
|
chk_responsive(context, path, jsonConfig, 'password');
|
|
343
376
|
}
|
|
344
377
|
|
|
345
|
-
function check_pattern(context, path, jsonConfig,
|
|
378
|
+
function check_pattern(context, path, jsonConfig, _inTable) {
|
|
346
379
|
common.debug(`check_pattern ${path}`);
|
|
347
380
|
chk_responsive(context, path, jsonConfig, 'pattern');
|
|
348
381
|
}
|
|
349
382
|
|
|
350
|
-
function check_port(context, path, jsonConfig,
|
|
383
|
+
function check_port(context, path, jsonConfig, _inTable) {
|
|
351
384
|
common.debug(`check_port ${path}`);
|
|
352
385
|
chk_responsive(context, path, jsonConfig, 'port');
|
|
353
386
|
}
|
|
354
387
|
|
|
355
|
-
function check_qrCode(context, path, jsonConfig,
|
|
388
|
+
function check_qrCode(context, path, jsonConfig, _inTable) {
|
|
356
389
|
common.debug(`check_qrCode ${path}`);
|
|
357
390
|
chk_responsive(context, path, jsonConfig, 'qrCode');
|
|
358
391
|
}
|
|
359
392
|
|
|
360
|
-
function check_room(context, path, jsonConfig,
|
|
393
|
+
function check_room(context, path, jsonConfig, _inTable) {
|
|
361
394
|
common.debug(`check_room ${path}`);
|
|
362
395
|
chk_responsive(context, path, jsonConfig, 'room');
|
|
363
396
|
}
|
|
364
397
|
|
|
365
|
-
function check_select(context, path, jsonConfig,
|
|
398
|
+
function check_select(context, path, jsonConfig, _inTable) {
|
|
366
399
|
common.debug(`check_select ${path}`);
|
|
367
400
|
chk_responsive(context, path, jsonConfig, 'select');
|
|
368
401
|
}
|
|
369
402
|
|
|
370
|
-
function check_selectSendTo(context, path, jsonConfig,
|
|
403
|
+
function check_selectSendTo(context, path, jsonConfig, _nTable) {
|
|
371
404
|
common.debug(`check_selectSendTo ${path}`);
|
|
372
405
|
chk_responsive(context, path, jsonConfig, 'selectSendTo');
|
|
373
406
|
}
|
|
374
407
|
|
|
375
|
-
function check_sendTo(context, path, jsonConfig,
|
|
408
|
+
function check_sendTo(context, path, jsonConfig, _inTable) {
|
|
376
409
|
common.debug(`check_sendTo ${path}`);
|
|
377
410
|
chk_responsive(context, path, jsonConfig, 'sendTo');
|
|
378
411
|
}
|
|
379
412
|
|
|
380
|
-
function check_setState(context, path, jsonConfig,
|
|
413
|
+
function check_setState(context, path, jsonConfig, _inTable) {
|
|
381
414
|
common.debug(`check_setState ${path}`);
|
|
382
415
|
chk_responsive(context, path, jsonConfig, 'setState');
|
|
383
416
|
}
|
|
384
417
|
|
|
385
|
-
function check_slider(context, path, jsonConfig,
|
|
418
|
+
function check_slider(context, path, jsonConfig, _inTable) {
|
|
386
419
|
common.debug(`check_slider ${path}`);
|
|
387
420
|
chk_responsive(context, path, jsonConfig, 'slider');
|
|
388
421
|
}
|
|
389
422
|
|
|
390
|
-
function check_state(context, path, jsonConfig,
|
|
423
|
+
function check_state(context, path, jsonConfig, _inTable) {
|
|
391
424
|
common.debug(`check_state ${path}`);
|
|
392
425
|
chk_responsive(context, path, jsonConfig, 'state');
|
|
393
426
|
}
|
|
394
427
|
|
|
395
|
-
function check_staticImage(context, path, jsonConfig,
|
|
428
|
+
function check_staticImage(context, path, jsonConfig, _inTable) {
|
|
396
429
|
common.debug(`check_staticImage ${path}`);
|
|
397
|
-
chk_responsive(context, path, jsonConfig, 'staticImage', {sizesOptional:true});
|
|
430
|
+
chk_responsive(context, path, jsonConfig, 'staticImage', { sizesOptional: true });
|
|
398
431
|
}
|
|
399
432
|
|
|
400
|
-
function check_staticLink(context, path, jsonConfig,
|
|
433
|
+
function check_staticLink(context, path, jsonConfig, _inTable) {
|
|
401
434
|
common.debug(`check_staticLink ${path}`);
|
|
402
435
|
chk_responsive(context, path, jsonConfig, 'staticLink');
|
|
403
436
|
}
|
|
404
437
|
|
|
405
|
-
function check_staticText(context, path, jsonConfig,
|
|
438
|
+
function check_staticText(context, path, jsonConfig, _inTable) {
|
|
406
439
|
common.debug(`check_staticText ${path}`);
|
|
407
440
|
chk_responsive(context, path, jsonConfig, 'staticText');
|
|
408
441
|
}
|
|
409
442
|
|
|
410
|
-
function check_table(context, path, jsonConfig,
|
|
443
|
+
function check_table(context, path, jsonConfig, _inTable) {
|
|
411
444
|
common.debug(`check_table ${path}`);
|
|
412
445
|
chk_responsive(context, path, jsonConfig, 'table');
|
|
413
446
|
}
|
|
414
447
|
|
|
415
|
-
function check_text(context, path, jsonConfig,
|
|
448
|
+
function check_text(context, path, jsonConfig, _inTable) {
|
|
416
449
|
common.debug(`check_text ${path}`);
|
|
417
450
|
chk_responsive(context, path, jsonConfig, 'text');
|
|
418
451
|
}
|
|
419
452
|
|
|
420
|
-
function check_textSendTo(context, path, jsonConfig,
|
|
453
|
+
function check_textSendTo(context, path, jsonConfig, _inTable) {
|
|
421
454
|
common.debug(`check_textSendTo ${path}`);
|
|
422
455
|
chk_responsive(context, path, jsonConfig, 'testSendTo');
|
|
423
456
|
}
|
|
424
457
|
|
|
425
|
-
function check_timePicker(context, path, jsonConfig,
|
|
458
|
+
function check_timePicker(context, path, jsonConfig, _inTable) {
|
|
426
459
|
common.debug(`check_timePicker ${path}`);
|
|
427
460
|
chk_responsive(context, path, jsonConfig, 'timePicker');
|
|
428
461
|
}
|
|
429
462
|
|
|
430
|
-
function check_user(context, path, jsonConfig,
|
|
463
|
+
function check_user(context, path, jsonConfig, _inTable) {
|
|
431
464
|
common.debug(`check_user ${path}`);
|
|
432
465
|
chk_responsive(context, path, jsonConfig, 'user');
|
|
433
466
|
}
|
|
434
467
|
|
|
435
|
-
function check_uuid(context, path, jsonConfig,
|
|
468
|
+
function check_uuid(context, path, jsonConfig, _inTable) {
|
|
436
469
|
common.debug(`check_uuid ${path}`);
|
|
437
470
|
chk_responsive(context, path, jsonConfig, 'uuid');
|
|
438
471
|
}
|
|
439
472
|
|
|
440
|
-
|
|
441
473
|
function checkComponent(context, path, jsonConfig) {
|
|
442
474
|
common.debug(`checkComponent (${path})`);
|
|
443
475
|
|
|
@@ -449,36 +481,24 @@ function checkComponent(context, path, jsonConfig) {
|
|
|
449
481
|
|
|
450
482
|
if (validComponents[type] === undefined) {
|
|
451
483
|
context.errors.push(`[E504] unexpected component "${type}" detected at ${path}`);
|
|
452
|
-
} else if (typeof
|
|
453
|
-
|
|
484
|
+
} else if (typeof validComponents[type] === 'function') {
|
|
485
|
+
validComponents[type](context, path, jsonConfig, false);
|
|
454
486
|
} else {
|
|
455
487
|
common.debug(`no checks defined for component ${type}`);
|
|
456
488
|
}
|
|
457
|
-
|
|
458
489
|
}
|
|
459
490
|
|
|
460
491
|
function checkPanel(context, path, jsonConfig, isRoot) {
|
|
461
492
|
common.debug(`checkPanel(${path})`);
|
|
462
493
|
|
|
463
|
-
const rootAttributes = [
|
|
464
|
-
'i18n',
|
|
465
|
-
];
|
|
494
|
+
const rootAttributes = ['i18n'];
|
|
466
495
|
|
|
467
|
-
const myAttributes = [
|
|
468
|
-
'type',
|
|
469
|
-
|
|
470
|
-
'collapsable',
|
|
471
|
-
'color',
|
|
472
|
-
'icon',
|
|
473
|
-
'innerStyle',
|
|
474
|
-
'items',
|
|
475
|
-
'label',
|
|
476
|
-
];
|
|
496
|
+
const myAttributes = ['type', 'collapsable', 'color', 'icon', 'innerStyle', 'items', 'label'];
|
|
477
497
|
|
|
478
498
|
//console.log('on PANEL entry');
|
|
479
499
|
//console.log(jsonConfig);
|
|
480
500
|
|
|
481
|
-
const validAttributes = stdAttributes.concat(myAttributes).concat(isRoot?rootAttributes:[]);
|
|
501
|
+
const validAttributes = stdAttributes.concat(myAttributes).concat(isRoot ? rootAttributes : []);
|
|
482
502
|
|
|
483
503
|
for (const key in jsonConfig) {
|
|
484
504
|
common.debug(` scanning ${key}`);
|
|
@@ -489,7 +509,7 @@ function checkPanel(context, path, jsonConfig, isRoot) {
|
|
|
489
509
|
|
|
490
510
|
if (key === 'type') {
|
|
491
511
|
if (jsonConfig[key] !== 'panel') {
|
|
492
|
-
console.log(
|
|
512
|
+
console.log(`INTERNAL ERROR: unexpected type ${jsonConfig[key]} encountered while scanning "panel"`);
|
|
493
513
|
return;
|
|
494
514
|
}
|
|
495
515
|
}
|
|
@@ -549,29 +569,13 @@ function checkTabs(context, path, jsonConfig) {
|
|
|
549
569
|
function checkJsonConfig(context, path, jsonConfig) {
|
|
550
570
|
common.debug(`checkCode_jsonConfig({context}, ${path}, {jsonConfig}`);
|
|
551
571
|
|
|
552
|
-
const commonAttributes = [
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
];
|
|
557
|
-
|
|
558
|
-
const
|
|
559
|
-
'collapsable',
|
|
560
|
-
'color',
|
|
561
|
-
'icon',
|
|
562
|
-
'innerStyle',
|
|
563
|
-
'label',
|
|
564
|
-
];
|
|
565
|
-
|
|
566
|
-
const tabsAttributes = [
|
|
567
|
-
'iconPosition',
|
|
568
|
-
'tabsStyle',
|
|
569
|
-
];
|
|
570
|
-
|
|
571
|
-
const validTypes = [
|
|
572
|
-
'panel',
|
|
573
|
-
'tabs',
|
|
574
|
-
];
|
|
572
|
+
const commonAttributes = ['i18n', 'items', 'type'];
|
|
573
|
+
|
|
574
|
+
const panelAttributes = ['collapsable', 'color', 'icon', 'innerStyle', 'label'];
|
|
575
|
+
|
|
576
|
+
const tabsAttributes = ['iconPosition', 'tabsStyle'];
|
|
577
|
+
|
|
578
|
+
const validTypes = ['panel', 'tabs'];
|
|
575
579
|
|
|
576
580
|
let baseType = 'panel';
|
|
577
581
|
if (!jsonConfig['type']) {
|
|
@@ -585,8 +589,12 @@ function checkJsonConfig(context, path, jsonConfig) {
|
|
|
585
589
|
}
|
|
586
590
|
|
|
587
591
|
let validAttributes = commonAttributes;
|
|
588
|
-
if (baseType === 'panel')
|
|
589
|
-
|
|
592
|
+
if (baseType === 'panel') {
|
|
593
|
+
validAttributes = validAttributes.concat(panelAttributes);
|
|
594
|
+
}
|
|
595
|
+
if (baseType === 'tabs') {
|
|
596
|
+
validAttributes = validAttributes.concat(tabsAttributes);
|
|
597
|
+
}
|
|
590
598
|
|
|
591
599
|
for (const key in jsonConfig) {
|
|
592
600
|
common.debug(``);
|
|
@@ -596,9 +604,9 @@ function checkJsonConfig(context, path, jsonConfig) {
|
|
|
596
604
|
}
|
|
597
605
|
if (key === 'items') {
|
|
598
606
|
if (baseType == 'panel') {
|
|
599
|
-
checkPanel(
|
|
607
|
+
checkPanel(context, `${path}/items`, jsonConfig, true);
|
|
600
608
|
} else if (baseType == 'tabs') {
|
|
601
|
-
checkTabs(
|
|
609
|
+
checkTabs(context, `${path}/items`, jsonConfig['items'], false);
|
|
602
610
|
}
|
|
603
611
|
}
|
|
604
612
|
}
|
|
@@ -622,4 +630,3 @@ exports.checkJsonConfig = checkJsonConfig;
|
|
|
622
630
|
// [508] responsive check: attribute "xs" should specify a value of "12" at ${path}
|
|
623
631
|
// [509] responsive check: "sm" value (${jsonConfig.sm}) greater then value for smaller displays
|
|
624
632
|
// [510] responsive check: maximum issues reached, please fix reported ones and recheck
|
|
625
|
-
|