@iobroker/repochecker 5.7.0 → 5.8.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/README.md CHANGED
@@ -25,6 +25,14 @@ Example:
25
25
  Placeholder for the next version (at the beginning of the line):
26
26
  ### **WORK IN PROGRESS**
27
27
  -->
28
+ ### 5.8.0 (2026-04-07)
29
+ - (@copilot) Limit the listing of `allowedValues` in schema validation errors (E1105, W5512) to 5 values, appending `...` when there are more possibilities.
30
+ - (@copilot) [W5046] Added warning when `admin/jsonConfig.json` or `admin/jsonConfig.json5` is present but `common.adminUI.config` is not set to `"json"` in `io-package.json`.
31
+ - (@copilot) [W5047] Added warning listing obsolete files (`admin/index.html`, `admin/index_m.html`, `admin/style.css`) when jsonConfig is used.
32
+
33
+ ### 5.7.1 (2026-04-07)
34
+ - (mcm1957) Improve jsonConfig schema validation messages.
35
+
28
36
  ### 5.7.0 (2026-04-06)
29
37
  - (@copilot) [S8913] automerge suggestion is no longer shown when dependabot is not configured ([S8901]).
30
38
  - (@copilot) Language detection: `GERMAN_WORDS` and `ENGLISH_WORDS` arrays sorted alphabetically; chapters titled "Haftungsausschluss" in README.md are now ignored when checking for German text.
@@ -146,7 +146,12 @@ async function validateIOPackageSchema(context) {
146
146
  } else if (error.keyword === 'type') {
147
147
  errorMsg = `Property "${path}" should be ${error.params.type}`;
148
148
  } else if (error.keyword === 'enum') {
149
- errorMsg = `Property "${path}" should be one of: ${error.params.allowedValues?.join(', ')}`;
149
+ const allowedValues = error.params.allowedValues ?? [];
150
+ const displayValues =
151
+ allowedValues.length > 5
152
+ ? `${allowedValues.slice(0, 5).join(', ')}, ...`
153
+ : allowedValues.join(', ');
154
+ errorMsg = `Property "${path}" should be one of: ${displayValues}`;
150
155
  } else {
151
156
  errorMsg = `Property "${path}" ${message}`;
152
157
  }
package/lib/M5000_Code.js CHANGED
@@ -735,6 +735,41 @@ async function checkCode(context) {
735
735
  }
736
736
  }
737
737
 
738
+ // Check if admin/jsonConfig.json or admin/jsonConfig.json5 exists but common.adminUI.config is not set to "json" (W5046)
739
+ if (
740
+ (context.filesList.includes('/admin/jsonConfig.json') ||
741
+ context.filesList.includes('/admin/jsonConfig.json5')) &&
742
+ (context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'materialize')
743
+ ) {
744
+ context.errors.push(
745
+ '[E5046] Using admin/jsonConfig.json(5) requires common.adminUI to be set to "common.adminUI": { "config": "json" }.',
746
+ );
747
+ } else if (
748
+ (context.filesList.includes('/admin/jsonConfig.json') ||
749
+ context.filesList.includes('/admin/jsonConfig.json5')) &&
750
+ !(context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'json')
751
+ ) {
752
+ context.warnings.push(
753
+ '[W5046] Using admin/jsonConfig.json(5) requires common.adminUI to be set to "common.adminUI": { "config": "json" }.',
754
+ );
755
+ }
756
+
757
+ // Check for obsolete admin files (index.html, index_m.html, style.css) when jsonConfig is used (W5047)
758
+ if (
759
+ context.ioPackageJson.common.adminUI &&
760
+ context.ioPackageJson.common.adminUI.config === 'json' &&
761
+ (context.filesList.includes('/admin/jsonConfig.json') || context.filesList.includes('/admin/jsonConfig.json5'))
762
+ ) {
763
+ const obsoleteFiles = ['/admin/index.html', '/admin/index_m.html', '/admin/style.css'];
764
+ for (const file of obsoleteFiles) {
765
+ if (context.filesList.includes(file)) {
766
+ context.warnings.push(
767
+ `[W5047] "${file.replace(/^\//, '')}" is most likely outdated since jsonConfig is used. Please consider removing it.`,
768
+ );
769
+ }
770
+ }
771
+ }
772
+
738
773
  if (
739
774
  context.ioPackageJson.common.supportCustoms ||
740
775
  context.ioPackageJson.common.jsonCustom ||
@@ -1230,16 +1265,10 @@ async function checkCode(context) {
1230
1265
  '.dev-server',
1231
1266
  ]);
1232
1267
  // Exact file base names to exclude from dependency scanning
1233
- const excludedSourceFiles = new Set([
1234
- 'tasks.js',
1235
- 'Gruntfile.js',
1236
- 'gulpfile.js'
1237
- ]);
1268
+ const excludedSourceFiles = new Set(['tasks.js', 'Gruntfile.js', 'gulpfile.js']);
1238
1269
 
1239
1270
  // Exact relative file paths (without leading slash) to exclude from dependency scanning
1240
- const excludedSourceRelPaths = new Set([
1241
- 'lib/tools.js'
1242
- ]);
1271
+ const excludedSourceRelPaths = new Set(['lib/tools.js']);
1243
1272
 
1244
1273
  const packageDependencies = context.packageJson.dependencies || {};
1245
1274
  const packageDevDependencies = context.packageJson.devDependencies || {};
@@ -1288,20 +1317,24 @@ async function checkCode(context) {
1288
1317
 
1289
1318
  // Skip relative paths (./xxx, ../xxx) and absolute paths (/xxx)
1290
1319
  // Skip dynamic generated strings (`${xxx}`) and debug vars
1291
- if (importTarget.startsWith('.') ||
1320
+ if (
1321
+ importTarget.startsWith('.') ||
1292
1322
  importTarget.startsWith('/') ||
1293
1323
  importTarget.includes('~') || // '~debug~xx'
1294
1324
  importTarget.includes('$') || // `${myvar}/xxx`
1295
1325
  importTarget.includes('{') ||
1296
- importTarget.includes('}')) {
1326
+ importTarget.includes('}')
1327
+ ) {
1297
1328
  continue;
1298
1329
  }
1299
1330
 
1300
1331
  // Skip obvious filenames
1301
- if (importTarget.endsWith('.js') ||
1332
+ if (
1333
+ importTarget.endsWith('.js') ||
1302
1334
  importTarget.endsWith('.mjs') ||
1303
1335
  importTarget.endsWith('.cjs') ||
1304
- importTarget.endsWith('.ts')) {
1336
+ importTarget.endsWith('.ts')
1337
+ ) {
1305
1338
  continue;
1306
1339
  }
1307
1340
 
@@ -1415,6 +1448,8 @@ exports.checkCode = checkCode;
1415
1448
  // [S5043] Package "${packageName}" is a built-in Node.js module. Please use "node:${packageName}" prefix instead.
1416
1449
  // [E5044] Cannot parse "/admin/jsonTab.json[5]": ${e}
1417
1450
  // [E5045] "/admin/jsonTab.json[5]" not found, but tab support is declared
1451
+ // [W5046] "admin/jsonConfig.json" or "admin/jsonConfig.json5" found but "common.adminUI.config" is not set to "json" in io-package.json. Please add "common.adminUI": { "config": "json" }.
1452
+ // [W5047] "${file}" is most likely outdated since jsonConfig is used. Please consider removing it.
1418
1453
  // [W5515] Schema validation skipped for "${configFile}" due to parse error: ${e.message}
1419
1454
 
1420
1455
  // [5500 - ] see M5500_jsonConfig.js
@@ -705,19 +705,29 @@ async function validateJsonConfigSchema(context, filePath, jsonConfigData) {
705
705
 
706
706
  // Create a concise, developer-friendly error message
707
707
  let errorMsg;
708
- if (error.keyword === 'required') {
708
+ if (error.keyword === 'if') {
709
+ // ignore this error block
710
+ errorMsg = '';
711
+ } else if (error.keyword === 'required') {
709
712
  errorMsg = `Missing required property "${error.params.missingProperty}" in ${path || filePath}`;
710
713
  } else if (error.keyword === 'additionalProperties') {
711
714
  errorMsg = `Unknown property "${error.params.additionalProperty}" in ${path}`;
712
715
  } else if (error.keyword === 'type') {
713
716
  errorMsg = `Property "${path}" should be ${error.params.type}`;
714
717
  } else if (error.keyword === 'enum') {
715
- errorMsg = `Property "${path}" should be one of: ${error.params.allowedValues?.join(', ')}`;
718
+ const allowedValues = error.params.allowedValues ?? [];
719
+ const displayValues =
720
+ allowedValues.length > 5
721
+ ? `${allowedValues.slice(0, 5).join(', ')}, ...`
722
+ : allowedValues.join(', ');
723
+ errorMsg = `Property "${path}" should be one of: ${displayValues}`;
716
724
  } else {
717
725
  errorMsg = `Property "${path}" ${message}`;
718
726
  }
719
727
 
720
- context.warnings.push(`[W5512] ${filePath} schema validation error: ${errorMsg}`);
728
+ if (errorMsg !== '') {
729
+ context.warnings.push(`[W5512] ${filePath} schema validation error: ${errorMsg}`);
730
+ }
721
731
  }
722
732
  } else {
723
733
  context.warnings.push(`[W5512] ${filePath} does not validate against schema`);
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.7.0",
2
+ "version": "5.8.0",
3
3
  "name": "@iobroker/repochecker",
4
4
  "dependencies": {
5
5
  "ajv": "^8.18.0",