@iobroker/repochecker 5.18.4 → 5.18.6

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,8 +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.18.4 (2026-06-09)
28
+ ### 5.18.6 (2026-06-10)
29
29
 
30
+ - (mcm1957) Support role definitions containing wildcards
31
+ - (mcm1957) Support header 'Older versions' within changelog
32
+
33
+ ### 5.18.5 (2026-06-09)
34
+
35
+ - (mcm1957) mode.* roles fixed
30
36
  - (mcm1957) build directory excluded from I18n scans
31
37
  - (mcm1957) Handling of alpha releasea at changelog corrected
32
38
  - (mcm1957) Changing text for missing updates limited to 50 days
@@ -1142,7 +1142,23 @@ async function checkIOPackageJson(context) {
1142
1142
  });
1143
1143
 
1144
1144
  if (typeof instanceObject.common.role === 'string') {
1145
- const roleDefinition = STATE_ROLE_RULES[instanceObject.common.role];
1145
+ // Fast path: direct key lookup (covers the vast majority of roles)
1146
+ let roleDefinition = STATE_ROLE_RULES[instanceObject.common.role];
1147
+
1148
+ // Slow path: scan for wildcard patterns if no direct match was found
1149
+ if (!roleDefinition) {
1150
+ const wildcardKeys = Object.keys(STATE_ROLE_RULES).filter(k => k.includes('*'));
1151
+ for (const pattern of wildcardKeys) {
1152
+ // Convert the wildcard pattern to a RegExp:
1153
+ // escape all regex-special chars except '*', then replace '*' with '.*'
1154
+ const regexStr = pattern.replace(/[.+?^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*');
1155
+ if (new RegExp(`^${regexStr}$`).test(instanceObject.common.role)) {
1156
+ roleDefinition = STATE_ROLE_RULES[pattern];
1157
+ break;
1158
+ }
1159
+ }
1160
+ }
1161
+
1146
1162
  if (!roleDefinition) {
1147
1163
  context.warnings.push(
1148
1164
  `[W1132] io-package.json: instanceObject "${instanceObject._id || index}" common.role "${instanceObject.common.role}" is not a known ioBroker state role`,
@@ -387,7 +387,11 @@ async function checkReadme(context) {
387
387
  for (const header of changelogHeaders) {
388
388
  const match = /^(\d+\.\d+\.\d+(-\w+\.\d+)?)(?:\s+.*)?$/.exec(header);
389
389
  if (!match) {
390
- if (!header.includes('WORK IN PROGRESS') && !header.includes('CHANGELOG_OLD.md')) {
390
+ if (
391
+ !header.includes('WORK IN PROGRESS') &&
392
+ !header.includes('CHANGELOG_OLD.md') &&
393
+ !header.includes('Older versions')
394
+ ) {
391
395
  invalidVersionHeaders.push(header);
392
396
  }
393
397
  } else {
@@ -115,7 +115,7 @@ const STATE_ROLE_RULES = {
115
115
  read: false,
116
116
  write: true,
117
117
  },
118
- 'button.mode.': {
118
+ 'button.mode.*': {
119
119
  types: ['boolean'],
120
120
  read: false,
121
121
  write: true,
@@ -777,7 +777,7 @@ const STATE_ROLE_RULES = {
777
777
  read: true,
778
778
  write: true,
779
779
  },
780
- 'switch.mode.': {
780
+ 'switch.mode.*': {
781
781
  types: ['boolean'],
782
782
  read: true,
783
783
  write: true,
@@ -76,8 +76,8 @@ const mapSeverity4New = {
76
76
  W3032: 'E', // [W3032] Just for Info: No workflow run for "test-and-release.yml" triggered by tag "v0.1.1" was found for current release 0.1.1. Workflow logs might be deleted already.
77
77
  S3032: 'E', // [S3032] Just for Info: No workflow run for "test-and-release.yml" triggered by tag "v0.1.1" was found for current release 0.1.1. Workflow logs might be deleted already.
78
78
  S3042: 'W', // [S3042] Workflow "test-and-release.yml": job "check-and-lint" uses "ioBroker/testing-action-check@v2.0.0" with a pinned version. Consider locking only the major version "@v2" instead.
79
- S5004: 'W', // [S5004] Plain setInterval() found in source files (lib/legacy/states.js, lib/zbDeviceAvailability.js, ...). Please use this.setInterval() or adapter.setInterval() instead.
80
- S5005: 'W', // [S5005] Plain setTimeout() found in source files (lib/localConfig.js, lib/networkmap.js, ...). Please use this.setTimeout() or adapter.setTimeout() instead.
79
+ S5004: 'E', // [S5004] Plain setInterval() found in source files (lib/legacy/states.js, lib/zbDeviceAvailability.js, ...). Please use this.setInterval() or adapter.setInterval() instead.
80
+ S5005: 'E', // [S5005] Plain setTimeout() found in source files (lib/localConfig.js, lib/networkmap.js, ...). Please use this.setTimeout() or adapter.setTimeout() instead.
81
81
  S5022: 'W', // [S5022] Please consider migrating to admin 5 UI (jsonConfig) or react based UI.
82
82
  S5043: 'E', // [S5043] Package "xx" is a built-in Node.js module. Please use "node:fs" instead.
83
83
  S5051: 'W', // [S5051] Custom sleep/wait function(s) found in source files (src/lib/adsb.ts).
@@ -86,8 +86,9 @@ const mapSeverity4New = {
86
86
  W5611: 'E', // [W5611] "admin/jsonConfig.json/items/tab_region/items/country/options[0]" attribute "label" is missing language "uk" in i18n object.
87
87
  S6008: 'E', // [S6008] Changelog for version 0.7.0-beta.19 should be added to README.md
88
88
  S6020: 'W', // [S6020] Consider adding a CHANGELOG_OLD.md file to store older changelog entries. This is supported by @alcalzone/releasescript.
89
- S8901: 'W', // [S8901] Dependabot configuration file ".github/dependabot.yml" not found. Consider adding dependabot to keep dependencies up to date.
89
+ S6022: 'E', // [S6022] CHANGELOG_OLD.md exists but no link to it was found in README.md. Consider adding a link to CHANGELOG_OLD.md at the end of the Changelog section. S8901: 'W', // [S8901] Dependabot configuration file ".github/dependabot.yml" not found. Consider adding dependabot to keep dependencies up to date.
90
90
  S9006: 'E', // [S9006] .commitinfo file should be excluded by .gitignore, please add a line with text ".commitinfo" to .gitignore
91
+
91
92
  };
92
93
 
93
94
  // ---------------------------------------------------------------------------
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.18.4",
2
+ "version": "5.18.6",
3
3
  "name": "@iobroker/repochecker",
4
4
  "dependencies": {
5
5
  "ajv": "^8.20.0",