@iobroker/repochecker 5.7.1 → 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 +5 -0
- package/lib/M1000_IOPackageJson.js +6 -1
- package/lib/M5000_Code.js +37 -0
- package/lib/M5500__JsonConfig.js +6 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,6 +25,11 @@ 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
|
+
|
|
28
33
|
### 5.7.1 (2026-04-07)
|
|
29
34
|
- (mcm1957) Improve jsonConfig schema validation messages.
|
|
30
35
|
|
|
@@ -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
|
-
|
|
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 ||
|
|
@@ -1413,6 +1448,8 @@ exports.checkCode = checkCode;
|
|
|
1413
1448
|
// [S5043] Package "${packageName}" is a built-in Node.js module. Please use "node:${packageName}" prefix instead.
|
|
1414
1449
|
// [E5044] Cannot parse "/admin/jsonTab.json[5]": ${e}
|
|
1415
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.
|
|
1416
1453
|
// [W5515] Schema validation skipped for "${configFile}" due to parse error: ${e.message}
|
|
1417
1454
|
|
|
1418
1455
|
// [5500 - ] see M5500_jsonConfig.js
|
package/lib/M5500__JsonConfig.js
CHANGED
|
@@ -715,7 +715,12 @@ async function validateJsonConfigSchema(context, filePath, jsonConfigData) {
|
|
|
715
715
|
} else if (error.keyword === 'type') {
|
|
716
716
|
errorMsg = `Property "${path}" should be ${error.params.type}`;
|
|
717
717
|
} else if (error.keyword === 'enum') {
|
|
718
|
-
|
|
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}`;
|
|
719
724
|
} else {
|
|
720
725
|
errorMsg = `Property "${path}" ${message}`;
|
|
721
726
|
}
|
package/package.json
CHANGED