@iobroker/repochecker 2.2.1 → 2.2.3

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
@@ -20,6 +20,17 @@ Branch (`master/main/dev`) is optional.
20
20
  -->
21
21
 
22
22
  ## Changelog
23
+
24
+ <!--
25
+ * (mcm1957) Added deprecate warnings for "main', 'materialize", "materializeTab" and "noConfig"
26
+ -->
27
+ ### 2.2.3 (2024-03-29)
28
+ * (mcm1957) Checking of license has been improved
29
+
30
+ ### 2.2.2 (2024-03-29)
31
+ * (mcm1957) Checking of adapter-core has been fixed
32
+ * (mcm1957) Load all potential interesting files, fixes [#149]
33
+
23
34
  ### 2.2.1 (2024-03-26)
24
35
  * (mcm1957) Added check that own adapter is not listed at common.restartAdapters
25
36
  * (mcm1957) Added check of version strings at common.news
package/doc/issues.json CHANGED
@@ -302,6 +302,12 @@
302
302
  "E176": {
303
303
  "title": "Own adapter is not allowed to be listed at `common.restartAdapters` in io-pacakge.json"
304
304
  },
305
+ "E182": {
306
+ "title": "Please remove `common.license` from io-package.json as `common.licenseInformation` is declared."
307
+ },
308
+ "E183": {
309
+ "title": "`common.licenseInformation.license` is missing"
310
+ },
305
311
  "E200": {
306
312
  "title": "Not found on npm. Please publish"
307
313
  },
@@ -495,11 +501,26 @@
495
501
  "title": "`common.localLink` in io-package.json is deprecated. Please define object `common.localLinks`: { `_default`: `...` }"
496
502
  },
497
503
  "W173": {
498
- "title": "`@iobroker/adapter-core` should be release ${recommendedAdapterCoreVersion} or newer - please update"
504
+ "title": "`@iobroker/adapter-core` (${context.packageJson.dependencies['@iobroker/adapter-core']}) should be ${recommendedAdapterCoreVersion} or newer - please update"
499
505
  },
500
506
  "W174": {
501
507
  "title": "`common.wakeup` is deprectaed. Please remove from io-package.json"
502
508
  },
509
+ "W177": {
510
+ "title": "`common.main` is deprecated in io-package.json. For js-controller >= 3.3 please use package.json main and remove `common.main` from io-package.json."
511
+ },
512
+ "W178": {
513
+ "title": "`common.materialize` is deprecated in io-package.json. For admin version >= 5 please use the property `common.adminUI`"
514
+ },
515
+ "W179": {
516
+ "title": "`common.materializeTab` is deprecated in io-package.json. For admin version >= 5 please use the property `common.adminUI`."
517
+ },
518
+ "W180": {
519
+ "title": "`common.noConfig` is deprecated in io-package.json. For admin version >= 5 please use `common.adminUI.config`:`none`."
520
+ },
521
+ "W181": {
522
+ "title": "`common.license` in io-package.json is deprecated. Please define object `common.licenseInformation`"
523
+ },
503
524
  "W302": {
504
525
  "title": "Use github actions instead of travis-ci"
505
526
  },
package/index.js CHANGED
@@ -759,7 +759,23 @@ function checkIOPackageJson(context) {
759
759
  if (context.ioPackageJson.common.title) {
760
760
  context.warnings.push('[W171] "common.title" is deprecated in io-package.json. Please remove from io-package.json.');
761
761
  }
762
+ /*
763
+ if (context.ioPackageJson.common.main) {
764
+ context.warnings.push('[W177] "common.main" is deprecated in io-package.json. For js-controller >= 3.3 please use package.json main and remove "common.main" from io-package.json.');
765
+ }
762
766
 
767
+ if (context.ioPackageJson.common.materialize) {
768
+ context.warnings.push('[W178] "common.materialize" is deprecated in io-package.json. For admin version >= 5 please use the property "common.adminUI"');
769
+ }
770
+
771
+ if (context.ioPackageJson.common.materializeTab) {
772
+ context.warnings.push('[W179] "common.materializeTab" is deprecated in io-package.json. For admin version >= 5 please use the property "common.adminUI".');
773
+ }
774
+
775
+ if (context.ioPackageJson.common.noConfig) {
776
+ context.warnings.push('[W180] "common.noConfig" is deprecated in io-package.json. For admin version >= 5 please use "common.adminUI.config":"none".');
777
+ }
778
+ */
763
779
  if (!context.ioPackageJson.common.titleLang) {
764
780
  context.errors.push('[E104] No "common.titleLang" found in io-package.json');
765
781
  } else {
@@ -880,7 +896,7 @@ function checkIOPackageJson(context) {
880
896
  }
881
897
 
882
898
  if (context.ioPackageJson.common.license) {
883
- context.warnings.push('[W114] "common.license" in io-package.json is deprecated. Please define object "common.licenseInformation"');
899
+ context.warnings.push('[W181] "common.license" in io-package.json is deprecated. Please define object "common.licenseInformation"');
884
900
  }
885
901
 
886
902
  if (!context.ioPackageJson.common.licenseInformation) {
@@ -890,9 +906,15 @@ function checkIOPackageJson(context) {
890
906
  } else {
891
907
  context.checks.push('"common.licenseInformation" found in io-package.json');
892
908
 
893
- // check if license valid
894
- if (!licenses.includes(context.ioPackageJson.common?.licenseInformation?.license)) {
895
- context.errors.push('[E116] No SPDX license found. Please use one of listed here: https://spdx.org/licenses/');
909
+ if (context.ioPackageJson.common.license) {
910
+ context.errors.push('[E182] Please remove "common.license" from io-package.json as "common.licenseInformation" is declared.');
911
+ }
912
+
913
+ // check if license valid
914
+ if (!context.ioPackageJson.common.licenseInformation.license) {
915
+ context.errors.push('[E183] "common.licenseInformation.license" is missing');
916
+ } else if (!licenses.includes(context.ioPackageJson.common?.licenseInformation?.license)) {
917
+ context.errors.push('[E116] No SPDX license found at "common.licenseInformation". Please use one of listed here: https://spdx.org/licenses/');
896
918
  } else {
897
919
  context.checks.push('"common.licenseInformation" is valid in io-package.json');
898
920
  }
@@ -1125,11 +1147,12 @@ function checkIOPackageJson(context) {
1125
1147
  }
1126
1148
 
1127
1149
  /*
1128
- - adapter-core 3.0.0+ requires node 16+ (*** TODO ***)
1150
+ - adapter-core 3.0.0+ requires node 16+ - solved as node 16 is global minimum
1129
1151
  - adapter-core 3.0.6 is recommended as minimum
1130
1152
  */
1131
- if (!compareVersions.compare(context.packageJson.dependencies['@iobroker/adapter-core'], `${recommendedJsControllerVersion}`, '>=')) {
1132
- context.warnings.push(`[W173] "@iobroker/adapter-core" should be release ${recommendedAdapterCoreVersion} or newer - please update`);
1153
+
1154
+ if (!compareVersions.compare(context.packageJson.dependencies['@iobroker/adapter-core'], `${recommendedAdapterCoreVersion}`, '>=')) {
1155
+ context.warnings.push(`[W173] "@iobroker/adapter-core" (${context.packageJson.dependencies['@iobroker/adapter-core']}) should be ${recommendedAdapterCoreVersion} or newer - please update`);
1133
1156
  } else {
1134
1157
  context.checks.push(`adapter-core ${context.packageJson.dependencies['@iobroker/adapter-core']} matches recommendation`);
1135
1158
  }
@@ -1161,7 +1184,7 @@ function checkIOPackageJson(context) {
1161
1184
 
1162
1185
  if (!context.ioPackageJson.common.onlyWWW) {
1163
1186
  if (!context.ioPackageJson.common.tier) {
1164
- context.warnings.push(`[W115] common.tier is required in io-package.json. Please check https://https://github.com/ioBroker/ioBroker.docs/blob/master/docs/en/dev/objectsschema.md#adapter.`);
1187
+ context.warnings.push(`[W115] common.tier is required in io-package.json. Please check https://github.com/ioBroker/ioBroker.docs/blob/master/docs/en/dev/objectsschema.md#adapter.`);
1165
1188
  } else if (![1, 2, 3].includes(context.ioPackageJson.common.tier)) {
1166
1189
  context.errors.push(`[E155] Invalid common.tier value: ${context.ioPackageJson.common.tier}. Only 1, 2 or 3 are allowed!`);
1167
1190
  } else {
@@ -1272,7 +1295,7 @@ function checkIOPackageJson(context) {
1272
1295
  }
1273
1296
  // do not put any code behind this line
1274
1297
 
1275
- // max number is E176
1298
+ // max number is E183
1276
1299
  }
1277
1300
  });
1278
1301
  });
@@ -1540,36 +1563,50 @@ function checkCode(context) {
1540
1563
  '.travis.yml',
1541
1564
  'gulpfile.js',
1542
1565
  '.releaseconfig.json',
1543
- ];
1566
+
1567
+ // add all potential files anyway. If they exist they must be valid.
1568
+ // if the are nozt needed a warning could be issued
1569
+ 'admin/index_m.html',
1570
+ 'admin/words.js',
1571
+ 'admin/jsonConfig.json',
1572
+ 'admin/jsonConfig.json5',
1573
+ 'admin/jsonCustom.json',
1574
+ 'admin/jsonCustom.json5',
1575
+ 'admin/blockly.js',
1576
+ ];
1577
+ allowedLanguages.forEach(lang =>
1578
+ readFiles.push(`admin/i18n/${lang}/translations.json`));
1579
+ allowedLanguages.forEach(lang =>
1580
+ readFiles.push(`admin/i18n/${lang}.json`));
1544
1581
 
1545
1582
  if (context.packageJson.main) {
1546
1583
  readFiles.push(context.packageJson.main);
1547
1584
  }
1548
1585
 
1549
- if (!context.ioPackageJson.common.noConfig) {
1550
- if (context.ioPackageJson.common.materialize || (context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'materialize')) {
1551
- readFiles.push('admin/index_m.html');
1552
- readFiles.push('admin/words.js');
1553
- }
1554
-
1555
- if (context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'json') {
1556
- readFiles.push('admin/jsonConfig.json');
1557
- readFiles.push('admin/jsonConfig.json5');
1558
- allowedLanguages.forEach(lang =>
1559
- readFiles.push(`admin/i18n/${lang}/translations.json`));
1560
- allowedLanguages.forEach(lang =>
1561
- readFiles.push(`admin/i18n/${lang}.json`));
1562
- }
1563
-
1564
- if (context.ioPackageJson.common.supportCustoms || context.ioPackageJson.common.jsonCustom || (context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.custom === 'json')) {
1565
- readFiles.push('admin/jsonCustom.json');
1566
- readFiles.push('admin/jsonCustom.json5');
1567
- }
1568
- }
1569
-
1570
- if (context.ioPackageJson.common.blockly) {
1571
- readFiles.push('admin/blockly.js');
1572
- }
1586
+ // if (!context.ioPackageJson.common.noConfig) {
1587
+ // if (context.ioPackageJson.common.materialize || (context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'materialize')) {
1588
+ // readFiles.push('admin/index_m.html');
1589
+ // readFiles.push('admin/words.js');
1590
+ // }
1591
+ //
1592
+ // if (context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'json') {
1593
+ // readFiles.push('admin/jsonConfig.json');
1594
+ // readFiles.push('admin/jsonConfig.json5');
1595
+ // allowedLanguages.forEach(lang =>
1596
+ // readFiles.push(`admin/i18n/${lang}/translations.json`));
1597
+ // allowedLanguages.forEach(lang =>
1598
+ // readFiles.push(`admin/i18n/${lang}.json`));
1599
+ // }
1600
+ //
1601
+ // if (context.ioPackageJson.common.supportCustoms || context.ioPackageJson.common.jsonCustom || (context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.custom === 'json')) {
1602
+ // readFiles.push('admin/jsonCustom.json');
1603
+ // readFiles.push('admin/jsonCustom.json5');
1604
+ // }
1605
+ // }
1606
+ //
1607
+ // if (context.ioPackageJson.common.blockly) {
1608
+ // readFiles.push('admin/blockly.js');
1609
+ // }
1573
1610
 
1574
1611
  // https://github.com/userName/ioBroker.adaptername/archive/${context.branch}.zip
1575
1612
  return new Promise((resolve, reject) => {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.2.1",
2
+ "version": "2.2.3",
3
3
  "name": "@iobroker/repochecker",
4
4
  "dependencies": {
5
5
  "axios": "^1.6.8",