@iobroker/repochecker 3.2.1 → 3.2.2

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/README.md CHANGED
@@ -33,6 +33,11 @@ npx @iobroker/repochecker https://github.com/ioBroker/ioBroker.javascript --loca
33
33
  -->
34
34
 
35
35
  ## Changelog
36
+ ### 3.2.2 (2024-11-01)
37
+
38
+ - (mcm1957) Link to open issues has been corrected.
39
+ - (mcm1957) Component name added to resonsive check issues.
40
+
36
41
  ### 3.2.1 (2024-11-01)
37
42
 
38
43
  - (mcm1957) Size checking for "divider" and "staticImage" supended.
@@ -20,6 +20,7 @@
20
20
  const common = require('./common.js');
21
21
 
22
22
  let responsiveErrorLimit = 5;
23
+ let responsiveWarningLimit = 5;
23
24
 
24
25
  const stdAttributes = [
25
26
  'xl',
@@ -130,297 +131,310 @@ function handleResponsiveError(context, msg) {
130
131
  }
131
132
  }
132
133
 
133
- function chk_responsive (context, path, jsonConfig){
134
+ function handleResponsiveWarning(context, msg) {
135
+ if (responsiveWarningLimit) {
136
+ context.warnings.push(`${msg}`);
137
+ responsiveWarningLimit--;
138
+ if (responsiveWarningLimit === 0) {
139
+ context.warnings.push(`[W510] responsive check: maximum issues reached, please fix reported ones and recheck`);
140
+ }
141
+ }
142
+ }
143
+
144
+ function chk_responsive (context, path, jsonConfig, component, opts){
134
145
  common.debug(`chk_responsive ${path}`);
135
- const missing = [];
136
- if (!jsonConfig.xs) missing.push('xs');
137
- if (!jsonConfig.sm) missing.push('sm');
138
- if (!jsonConfig.md) missing.push('md');
139
- if (!jsonConfig.lg) missing.push('lg');
140
- if (!jsonConfig.xl) missing.push('xl');
141
- if (missing.length) {
142
- handleResponsiveError(context, `[E507] responsive check: missing size attributes [${missing.join(',')}] at ${path}`);
146
+
147
+ if (!opts || !opts.sizesOptional) {
148
+ const missing = [];
149
+ if (!jsonConfig.xs) missing.push('xs');
150
+ if (!jsonConfig.sm) missing.push('sm');
151
+ if (!jsonConfig.md) missing.push('md');
152
+ if (!jsonConfig.lg) missing.push('lg');
153
+ if (!jsonConfig.xl) missing.push('xl');
154
+ if (missing.length) {
155
+ handleResponsiveError(context, `[E507] missing size attributes [${missing.join(',')}] for ${component} at ${path}`);
156
+ }
143
157
  }
144
158
 
145
159
  if ( jsonConfig.xs && jsonConfig.xs != 12) {
146
- handleResponsiveError(context, `[E508] responsive check: attribute "xs" should specify a value of "12" at ${path}`);
160
+ handleResponsiveWarning(context, `[W508] attribute "xs" for ${component} should specify a value of "12" at ${path}`);
147
161
  }
148
162
 
149
163
  let ii = 12;
150
164
  if (jsonConfig.xs) ii = jsonConfig.xs;
151
165
  if (jsonConfig.sm && jsonConfig.sm > ii ) {
152
- handleResponsiveError(context, `[E509] responsive check: "sm" value (${jsonConfig.sm}) greater then value for smaller displays`);
166
+ handleResponsiveError(context, `[E509] "sm" value (${jsonConfig.sm}) for ${component} greater then value for smaller displays`);
153
167
  } else {
154
168
  ii = jsonConfig.sm;
155
169
  }
156
170
  if (jsonConfig.md && jsonConfig.md > ii ) {
157
- handleResponsiveError(context, `[E509] responsive check: "md" value (${jsonConfig.md}) greater then value for smaller displays`);
171
+ handleResponsiveError(context, `[E509] "md" value (${jsonConfig.md}) for ${component} greater then value for smaller displays`);
158
172
  } else {
159
173
  ii = jsonConfig.md;
160
174
  }
161
175
  if (jsonConfig.lg && jsonConfig.lg > ii ) {
162
- handleResponsiveError(context, `[E509] responsive check: "lg" value (${jsonConfig.lg}) greater then value for smaller displays`);
176
+ handleResponsiveError(context, `[E509] "lg" value (${jsonConfig.lg}) for ${component} greater then value for smaller displays`);
163
177
  } else {
164
178
  ii = jsonConfig.lg;
165
179
  }
166
180
  if (jsonConfig.xl && jsonConfig.xl > ii ) {
167
- handleResponsiveError(context, `[E509] responsive check: "xl" value (${jsonConfig.xl}) greater then value for smaller displays`);
181
+ handleResponsiveError(context, `[E509] "xl" value (${jsonConfig.xl}) for ${component} greater then value for smaller displays`);
168
182
  }
169
183
  }
170
184
 
171
185
  function check_accordion (context, path, jsonConfig, inTable){
172
186
  common.debug(`check_accordion ${path}`);
173
- chk_responsive(context, path, jsonConfig);
187
+ chk_responsive(context, path, jsonConfig, 'accordion');
174
188
  }
175
189
 
176
190
  function check_alive(context, path, jsonConfig, inTable){
177
191
  common.debug(`check_alive ${path}`);
178
- chk_responsive(context, path, jsonConfig);
192
+ chk_responsive(context, path, jsonConfig, 'alive');
179
193
  }
180
194
 
181
195
  function check_autocomplete(context, path, jsonConfig, inTable){
182
196
  common.debug(`check_autocomplete ${path}`);
183
- chk_responsive(context, path, jsonConfig);
197
+ chk_responsive(context, path, jsonConfig, 'autocomplete');
184
198
  }
185
199
 
186
200
  function check_autocompleteSendTo(context, path, jsonConfig, inTable){
187
201
  common.debug(`check_autocompleteSendTo ${path}`);
188
- chk_responsive(context, path, jsonConfig);
202
+ chk_responsive(context, path, jsonConfig, 'autocompleteSendTo');
189
203
  }
190
204
 
191
205
  function check_certificate(context, path, jsonConfig, inTable){
192
206
  common.debug(`check_certificate ${path}`);
193
- chk_responsive(context, path, jsonConfig);
207
+ chk_responsive(context, path, jsonConfig, 'certificate');
194
208
  }
195
209
 
196
210
  function check_certificates(context, path, jsonConfig, inTable){
197
211
  common.debug(`check_certificates ${path}`);
198
- chk_responsive(context, path, jsonConfig);
212
+ chk_responsive(context, path, jsonConfig, 'certificates');
199
213
  }
200
214
 
201
215
  function check_certificateCollection(context, path, jsonConfig, inTable){
202
216
  common.debug(`check_certificateCollection ${path}`);
203
- chk_responsive(context, path, jsonConfig);
217
+ chk_responsive(context, path, jsonConfig, 'certificateCollection');
204
218
  }
205
219
 
206
220
  function check_checkbox(context, path, jsonConfig, inTable){
207
221
  common.debug(`check_checkbox ${path}`);
208
- chk_responsive(context, path, jsonConfig);
222
+ chk_responsive(context, path, jsonConfig, 'checkbox');
209
223
  }
210
224
 
211
225
  function check_checkLicense(context, path, jsonConfig, inTable){
212
226
  common.debug(`check_checkLicense ${path}`);
213
- chk_responsive(context, path, jsonConfig);
227
+ chk_responsive(context, path, jsonConfig, 'checkLicense');
214
228
  }
215
229
 
216
230
  function check_chips(context, path, jsonConfig, inTable){
217
231
  common.debug(`check_chips ${path}`);
218
- chk_responsive(context, path, jsonConfig);
232
+ chk_responsive(context, path, jsonConfig, 'chips');
219
233
  }
220
234
 
221
235
  function check_color(context, path, jsonConfig, inTable){
222
236
  common.debug(`check_color ${path}`);
223
- chk_responsive(context, path, jsonConfig);
237
+ chk_responsive(context, path, jsonConfig, 'color');
224
238
  }
225
239
 
226
240
  function check_coordinates(context, path, jsonConfig, inTable){
227
241
  common.debug(`check_coordinates ${path}`);
228
- chk_responsive(context, path, jsonConfig);
242
+ chk_responsive(context, path, jsonConfig, 'coordinates');
229
243
  }
230
244
 
231
245
  function check_cron(context, path, jsonConfig, inTable){
232
246
  common.debug(`check_staticText ${path}`);
233
- chk_responsive(context, path, jsonConfig);
247
+ chk_responsive(context, path, jsonConfig, 'cron');
234
248
  }
235
249
 
236
250
  function check_custom(context, path, jsonConfig, inTable){
237
251
  common.debug(`check_custom ${path}`);
238
- chk_responsive(context, path, jsonConfig);
252
+ chk_responsive(context, path, jsonConfig, 'custom', {sizesOptional:true});
239
253
  }
240
254
 
241
255
  function check_datePicker(context, path, jsonConfig, inTable){
242
256
  common.debug(`check_datePicker ${path}`);
243
- chk_responsive(context, path, jsonConfig);
257
+ chk_responsive(context, path, jsonConfig, 'datePicker');
244
258
  }
245
259
 
246
260
  function check_deviceManager(context, path, jsonConfig, inTable){
247
261
  common.debug(`check_deviceManager ${path}`);
248
- chk_responsive(context, path, jsonConfig);
262
+ chk_responsive(context, path, jsonConfig, 'deviceManager', {sizesOptional:true});
249
263
  }
250
264
 
251
265
  function check_divider(context, path, jsonConfig, inTable){
252
266
  common.debug(`check_divider ${path}`);
253
- // chk_responsive(context, path, jsonConfig); // TODO - sizes optional
267
+ chk_responsive(context, path, jsonConfig, 'divider', {sizesOptional:true});
254
268
  }
255
269
 
256
270
  function check_file(context, path, jsonConfig, inTable){
257
271
  common.debug(`check_file ${path}`);
258
- chk_responsive(context, path, jsonConfig);
272
+ chk_responsive(context, path, jsonConfig, 'file');
259
273
  }
260
274
 
261
275
  function check_fileSelector(context, path, jsonConfig, inTable){
262
276
  common.debug(`check_fileSelector ${path}`);
263
- chk_responsive(context, path, jsonConfig);
277
+ chk_responsive(context, path, jsonConfig, 'fileSelector');
264
278
  }
265
279
 
266
280
  function check_func(context, path, jsonConfig, inTable){
267
281
  common.debug(`check_func ${path}`);
268
- chk_responsive(context, path, jsonConfig);
282
+ chk_responsive(context, path, jsonConfig, 'func');
269
283
  }
270
284
 
271
285
  function check_header(context, path, jsonConfig, inTable){
272
286
  common.debug(`check_header ${path}`);
273
- // chk_responsive(context, path, jsonConfig); // must be discussed
287
+ chk_responsive(context, path, jsonConfig, 'header', {sizesOptional:true});
274
288
  }
275
289
 
276
290
  function check_image(context, path, jsonConfig, inTable){
277
291
  common.debug(`check_image ${path}`);
278
- chk_responsive(context, path, jsonConfig);
292
+ chk_responsive(context, path, jsonConfig, 'image');
279
293
  }
280
294
 
281
295
  function check_imageSendTo(context, path, jsonConfig, inTable){
282
296
  common.debug(`check_imageSendTo ${path}`);
283
- chk_responsive(context, path, jsonConfig);
297
+ chk_responsive(context, path, jsonConfig, 'imageSendTo');
284
298
  }
285
299
 
286
300
  function check_instance(context, path, jsonConfig, inTable){
287
301
  common.debug(`check_instance ${path}`);
288
- chk_responsive(context, path, jsonConfig);
302
+ chk_responsive(context, path, jsonConfig, 'instance');
289
303
  }
290
304
 
291
305
  function check_interface(context, path, jsonConfig, inTable){
292
306
  common.debug(`check_interface ${path}`);
293
- chk_responsive(context, path, jsonConfig);
307
+ chk_responsive(context, path, jsonConfig, 'interface');
294
308
  }
295
309
 
296
310
  function check_ip(context, path, jsonConfig, inTable){
297
311
  common.debug(`check_ip ${path}`);
298
- chk_responsive(context, path, jsonConfig);
312
+ chk_responsive(context, path, jsonConfig, 'ip');
299
313
  }
300
314
 
301
315
  function check_jsonEditor(context, path, jsonConfig, inTable){
302
316
  common.debug(`check_jsonEditor ${path}`);
303
- chk_responsive(context, path, jsonConfig);
317
+ chk_responsive(context, path, jsonConfig, 'jsonEditor');
304
318
  }
305
319
 
306
320
  function check_language(context, path, jsonConfig, inTable){
307
321
  common.debug(`check_language ${path}`);
308
- chk_responsive(context, path, jsonConfig);
322
+ chk_responsive(context, path, jsonConfig, 'language');
309
323
  }
310
324
 
311
325
  function check_license(context, path, jsonConfig, inTable){
312
326
  common.debug(`check_license ${path}`);
313
- chk_responsive(context, path, jsonConfig);
327
+ chk_responsive(context, path, jsonConfig, 'license');
314
328
  }
315
329
 
316
330
  function check_number(context, path, jsonConfig, inTable){
317
331
  common.debug(`check_number ${path}`);
318
- chk_responsive(context, path, jsonConfig);
332
+ chk_responsive(context, path, jsonConfig, 'number');
319
333
  }
320
334
 
321
335
  function check_objectId(context, path, jsonConfig, inTable){
322
336
  common.debug(`check_objectId ${path}`);
323
- chk_responsive(context, path, jsonConfig);
337
+ chk_responsive(context, path, jsonConfig, 'objectId');
324
338
  }
325
339
 
326
340
  function check_password(context, path, jsonConfig, inTable){
327
341
  common.debug(`check_password ${path}`);
328
- chk_responsive(context, path, jsonConfig);
342
+ chk_responsive(context, path, jsonConfig, 'password');
329
343
  }
330
344
 
331
345
  function check_pattern(context, path, jsonConfig, inTable){
332
346
  common.debug(`check_pattern ${path}`);
333
- chk_responsive(context, path, jsonConfig);
347
+ chk_responsive(context, path, jsonConfig, 'pattern');
334
348
  }
335
349
 
336
350
  function check_port(context, path, jsonConfig, inTable){
337
351
  common.debug(`check_port ${path}`);
338
- chk_responsive(context, path, jsonConfig);
352
+ chk_responsive(context, path, jsonConfig, 'port');
339
353
  }
340
354
 
341
355
  function check_qrCode(context, path, jsonConfig, inTable){
342
356
  common.debug(`check_qrCode ${path}`);
343
- chk_responsive(context, path, jsonConfig);
357
+ chk_responsive(context, path, jsonConfig, 'qrCode');
344
358
  }
345
359
 
346
360
  function check_room(context, path, jsonConfig, inTable){
347
361
  common.debug(`check_room ${path}`);
348
- chk_responsive(context, path, jsonConfig);
362
+ chk_responsive(context, path, jsonConfig, 'room');
349
363
  }
350
364
 
351
365
  function check_select(context, path, jsonConfig, inTable){
352
366
  common.debug(`check_select ${path}`);
353
- chk_responsive(context, path, jsonConfig);
367
+ chk_responsive(context, path, jsonConfig, 'select');
354
368
  }
355
369
 
356
370
  function check_selectSendTo(context, path, jsonConfig, inTable){
357
371
  common.debug(`check_selectSendTo ${path}`);
358
- chk_responsive(context, path, jsonConfig);
372
+ chk_responsive(context, path, jsonConfig, 'selectSendTo');
359
373
  }
360
374
 
361
375
  function check_sendTo(context, path, jsonConfig, inTable){
362
376
  common.debug(`check_sendTo ${path}`);
363
- chk_responsive(context, path, jsonConfig);
377
+ chk_responsive(context, path, jsonConfig, 'sendTo');
364
378
  }
365
379
 
366
380
  function check_setState(context, path, jsonConfig, inTable){
367
381
  common.debug(`check_setState ${path}`);
368
- chk_responsive(context, path, jsonConfig);
382
+ chk_responsive(context, path, jsonConfig, 'setState');
369
383
  }
370
384
 
371
385
  function check_slider(context, path, jsonConfig, inTable){
372
386
  common.debug(`check_slider ${path}`);
373
- chk_responsive(context, path, jsonConfig);
387
+ chk_responsive(context, path, jsonConfig, 'slider');
374
388
  }
375
389
 
376
390
  function check_state(context, path, jsonConfig, inTable){
377
391
  common.debug(`check_state ${path}`);
378
- chk_responsive(context, path, jsonConfig);
392
+ chk_responsive(context, path, jsonConfig, 'state');
379
393
  }
380
394
 
381
395
  function check_staticImage(context, path, jsonConfig, inTable){
382
396
  common.debug(`check_staticImage ${path}`);
383
- // chk_responsive(context, path, jsonConfig); // TODO sizes optional
397
+ chk_responsive(context, path, jsonConfig, 'staticImage', {sizesOptional:true});
384
398
  }
385
399
 
386
400
  function check_staticLink(context, path, jsonConfig, inTable){
387
401
  common.debug(`check_staticLink ${path}`);
388
- chk_responsive(context, path, jsonConfig);
402
+ chk_responsive(context, path, jsonConfig, 'staticLink');
389
403
  }
390
404
 
391
405
  function check_staticText(context, path, jsonConfig, inTable){
392
406
  common.debug(`check_staticText ${path}`);
393
- chk_responsive(context, path, jsonConfig);
407
+ chk_responsive(context, path, jsonConfig, 'staticText');
394
408
  }
395
409
 
396
410
  function check_table(context, path, jsonConfig, inTable){
397
411
  common.debug(`check_table ${path}`);
398
- chk_responsive(context, path, jsonConfig);
412
+ chk_responsive(context, path, jsonConfig, 'table');
399
413
  }
400
414
 
401
415
  function check_text(context, path, jsonConfig, inTable){
402
416
  common.debug(`check_text ${path}`);
403
- chk_responsive(context, path, jsonConfig);
417
+ chk_responsive(context, path, jsonConfig, 'text');
404
418
  }
405
419
 
406
420
  function check_textSendTo(context, path, jsonConfig, inTable){
407
421
  common.debug(`check_textSendTo ${path}`);
408
- chk_responsive(context, path, jsonConfig);
422
+ chk_responsive(context, path, jsonConfig, 'testSendTo');
409
423
  }
410
424
 
411
425
  function check_timePicker(context, path, jsonConfig, inTable){
412
426
  common.debug(`check_timePicker ${path}`);
413
- chk_responsive(context, path, jsonConfig);
427
+ chk_responsive(context, path, jsonConfig, 'timePicker');
414
428
  }
415
429
 
416
430
  function check_user(context, path, jsonConfig, inTable){
417
431
  common.debug(`check_user ${path}`);
418
- chk_responsive(context, path, jsonConfig);
432
+ chk_responsive(context, path, jsonConfig, 'user');
419
433
  }
420
434
 
421
435
  function check_uuid(context, path, jsonConfig, inTable){
422
436
  common.debug(`check_uuid ${path}`);
423
- chk_responsive(context, path, jsonConfig);
437
+ chk_responsive(context, path, jsonConfig, 'uuid');
424
438
  }
425
439
 
426
440
 
@@ -461,6 +475,9 @@ function checkPanel(context, path, jsonConfig, isRoot) {
461
475
  'label',
462
476
  ];
463
477
 
478
+ //console.log('on PANEL entry');
479
+ //console.log(jsonConfig);
480
+
464
481
  const validAttributes = stdAttributes.concat(myAttributes).concat(isRoot?rootAttributes:[]);
465
482
 
466
483
  for (const key in jsonConfig) {
@@ -472,7 +489,7 @@ function checkPanel(context, path, jsonConfig, isRoot) {
472
489
 
473
490
  if (key === 'type') {
474
491
  if (jsonConfig[key] !== 'panel') {
475
- console.log( `INTERNAL ERROR: unexpected type ${jsonConfig[key]} encounterd while scanning "panel"`);
492
+ console.log( `INTERNAL ERROR: unexpected type ${jsonConfig[key]} encountered while scanning "panel"`);
476
493
  return;
477
494
  }
478
495
  }
@@ -485,7 +502,12 @@ function checkPanel(context, path, jsonConfig, isRoot) {
485
502
  context.errors.push(`[E502] no type specified at ${path}`);
486
503
  }
487
504
 
488
- checkComponent(context, `${path}/${subkey}`, jsonConfig['items'][subkey]);
505
+ if (type === 'panel') {
506
+ common.debug(`nested panel detected at ${path}/${subkey}`);
507
+ checkPanel(context, `${path}/${subkey}/items`, jsonConfig[key][subkey]);
508
+ } else {
509
+ checkComponent(context, `${path}/${subkey}`, jsonConfig['items'][subkey]);
510
+ }
489
511
  }
490
512
  }
491
513
  }
@@ -78,7 +78,7 @@ async function checkGithubRepo(context) {
78
78
  for (const issue of issues){
79
79
  if (issue.pull_request) continue;
80
80
  if (issuesToWatch.includes(issue.title)) {
81
- context.errors.push(`[E804] Please process issue [${issue.number}] "${issue.title}."`);
81
+ context.errors.push(`[E804] Please process issue [[#${issue.number}] "${issue.title}"](${context.githubUrlOriginal}/issues/${issue.number})`);
82
82
  }
83
83
  }
84
84
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.2.1",
2
+ "version": "3.2.2",
3
3
  "name": "@iobroker/repochecker",
4
4
  "dependencies": {
5
5
  "axios": "^1.7.7",