@iobroker/repochecker 3.5.0 → 3.5.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,12 @@ npx @iobroker/repochecker https://github.com/ioBroker/ioBroker.javascript --loca
33
33
  -->
34
34
 
35
35
  ## Changelog
36
+ ### 3.5.2 (2025-02-19)
37
+
38
+ - (mcm1957) Incorrect admin suggestion for very olf html adapters corrected. [#383]
39
+ - (mcm1957) Errors during parsing if icon improved. [#381]
40
+ - (mcm1957) Crash if protectedNative or encryptedNative is missing. [#382]
41
+
36
42
  ### 3.5.0 (2025-02-18)
37
43
 
38
44
  - (mcm1957) Fixed dependency warning ([W174]) has been reduces to suggestion. [#374]
@@ -132,7 +132,8 @@ async function checkIOPackageJson(context) {
132
132
  if (suspiciousKeys.length) {
133
133
  if (context.ioPackageJson.protectedNative) {
134
134
  const missingProtected = suspiciousKeys.filter(
135
- key => !context.ioPackageJson.protectedNative.includes(key),
135
+ key =>
136
+ !(context.ioPackageJson.protectedNative && context.ioPackageJson.protectedNative.includes(key)),
136
137
  );
137
138
  if (missingProtected.length) {
138
139
  context.warnings.push(
@@ -147,7 +148,8 @@ async function checkIOPackageJson(context) {
147
148
 
148
149
  if (context.ioPackageJson.encryptedNative) {
149
150
  const missingProtected = suspiciousKeys.filter(
150
- key => !context.ioPackageJson.encryptedNative.includes(key),
151
+ key =>
152
+ !(context.ioPackageJson.encryptedNative && context.ioPackageJson.encryptedNative.includes(key)),
151
153
  );
152
154
  if (missingProtected.length) {
153
155
  context.warnings.push(
@@ -162,7 +164,7 @@ async function checkIOPackageJson(context) {
162
164
  }
163
165
 
164
166
  for (const key of context.ioPackageJson.encryptedNative || []) {
165
- if (!context.ioPackageJson.protectedNative.includes(key)) {
167
+ if (!(context.ioPackageJson.protectedNative && context.ioPackageJson.protectedNative.includes(key))) {
166
168
  context.warnings.push(
167
169
  `[W193] Encrypted native "${key}" should be listed at "protectedNative" in io-package.json`,
168
170
  );
@@ -170,7 +172,7 @@ async function checkIOPackageJson(context) {
170
172
  }
171
173
 
172
174
  for (const key of context.ioPackageJson.protectedNative || []) {
173
- if (!context.ioPackageJson.encryptedNative.includes(key)) {
175
+ if (!(context.ioPackageJson.encryptedNative && context.ioPackageJson.encryptedNative.includes(key))) {
174
176
  context.warnings.push(
175
177
  `[S194] Consider adding protected native "${key}" to "encryptedNative" in io-package.json`,
176
178
  );
@@ -183,7 +185,7 @@ async function checkIOPackageJson(context) {
183
185
  ...(context.ioPackageJson.encryptedNative || []),
184
186
  ]),
185
187
  ]) {
186
- if (context.ioPackageJson.native[key] === undefined){
188
+ if (context.ioPackageJson.native[key] === undefined) {
187
189
  context.warnings.push(
188
190
  `[W195] Protected or encrypted element "${key}" should be listed at "native" in io-package.json`,
189
191
  );
@@ -782,11 +784,18 @@ async function checkIOPackageJson(context) {
782
784
 
783
785
  // check admin dependency
784
786
  let requireAdmin =
787
+ // some config is present and does not state 'none'
785
788
  context.ioPackageJson.common.materialize ||
786
789
  context.ioPackageJson.common.materializeTab ||
787
790
  (context.ioPackageJson.common.adminUI?.config && context.ioPackageJson.common.adminUI?.config !== 'none') ||
788
791
  (context.ioPackageJson.common.adminUI?.custom && context.ioPackageJson.common.adminUI?.custom !== 'none') ||
789
- (context.ioPackageJson.common.adminUI?.tab && context.ioPackageJson.common.adminUI?.tab !== 'none');
792
+ (context.ioPackageJson.common.adminUI?.tab && context.ioPackageJson.common.adminUI?.tab !== 'none') ||
793
+ // or its pure old html without any setting
794
+ (!context.ioPackageJson.common.materialize &&
795
+ !context.ioPackageJson.common.materializeTab &&
796
+ !context.ioPackageJson.common.adminUI?.config &&
797
+ !context.ioPackageJson.common.adminUI?.custom &&
798
+ !context.ioPackageJson.common.adminUI?.tab);
790
799
  common.debug(`admin dependency is ${requireAdmin ? '' : 'not'}required`);
791
800
 
792
801
  if (context.cfg.hasJsonConfig) {
@@ -957,8 +966,8 @@ async function checkIOPackageJson(context) {
957
966
  context.checks.push('blacklist for io-package.json checked.');
958
967
 
959
968
  if (context.ioPackageJson.common.extIcon) {
969
+ let icon = null;
960
970
  try {
961
- let icon = null;
962
971
  if (common.isLocal()) {
963
972
  const url = context.ioPackageJson.common.extIcon.replace(context.githubUrl, '');
964
973
  icon = await common.downloadFile(null, url, true);
@@ -966,29 +975,41 @@ async function checkIOPackageJson(context) {
966
975
  icon = await common.downloadFile(context.ioPackageJson.common.extIcon, null, true);
967
976
  }
968
977
  context.checks.push('"extIcon" could be downloaded');
969
-
970
- // @ts-expect-error sizeOf does not have typing
971
- const image = sizeOf(icon);
972
- common.debug(`logo ${context.ioPackageJson.common.icon} width: ${image.width}, height: ${image.height}`);
973
- if (image.width !== image.height) {
974
- context.errors.push('[E140] width and height of logo (specified at "common.extIcon") are not equal');
975
- } else {
976
- context.checks.push('width and height of "extIcon" logo are equal');
977
- if (image.width < 32) {
978
- context.errors.push(
979
- '[E141] logo (specified at "common.extIcon") is too small. It must be greater or equal than 32x32',
980
- );
981
- } else if (image.width > 512) {
978
+ //console.log(icon);
979
+ } catch (e) {
980
+ common.debug(e);
981
+ context.errors.push(`[E125] External icon not found under URL: ${context.ioPackageJson.common.extIcon}`);
982
+ icon = null;
983
+ }
984
+ if (icon) {
985
+ try {
986
+ // @ts-expect-error sizeOf does not have typing
987
+ const image = sizeOf(icon);
988
+ common.debug(
989
+ `logo ${context.ioPackageJson.common.icon} width: ${image.width}, height: ${image.height}`,
990
+ );
991
+ if (image.width !== image.height) {
982
992
  context.errors.push(
983
- '[E142] logo (specified at "common.extIcon") is too big. It must be less or equal than 512x512',
993
+ '[E140] width and height of logo (specified at "common.extIcon") are not equal',
984
994
  );
985
995
  } else {
986
- context.checks.push('"extIcon" logo is of correct size');
996
+ context.checks.push('width and height of "extIcon" logo are equal');
997
+ if (image.width < 32) {
998
+ context.errors.push(
999
+ '[E141] logo (specified at "common.extIcon") is too small. It must be greater or equal than 32x32',
1000
+ );
1001
+ } else if (image.width > 512) {
1002
+ context.errors.push(
1003
+ '[E142] logo (specified at "common.extIcon") is too big. It must be less or equal than 512x512',
1004
+ );
1005
+ } else {
1006
+ context.checks.push('"extIcon" logo is of correct size');
1007
+ }
987
1008
  }
1009
+ } catch (e) {
1010
+ common.debug(e);
1011
+ context.errors.push(`[E197] External icon ${context.ioPackageJson.common.extIcon} cannot be parsed`);
988
1012
  }
989
- } catch (e) {
990
- common.debug(e);
991
- context.errors.push(`[E125] External icon not found under URL: ${context.ioPackageJson.common.extIcon}`);
992
1013
  }
993
1014
  }
994
1015
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.5.0",
2
+ "version": "3.5.2",
3
3
  "name": "@iobroker/repochecker",
4
4
  "devDependencies": {
5
5
  "@alcalzone/release-script": "^3.8.0",