@iobroker/repochecker 4.1.0-alpha.4 → 4.2.0-alpha.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
@@ -33,7 +33,13 @@ npx @iobroker/repochecker https://github.com/ioBroker/ioBroker.javascript --loca
33
33
  -->
34
34
 
35
35
  ## Changelog
36
- ### 4.1.0-alpha.4 (2025-08-24)
36
+ ### 4.2.0-alpha.0 (2025-09-12)
37
+ - (copilot) Add detection for empty dependency objects in io-package.json (E200, E201) [#422].
38
+ - (copilot) Add suggestion to restart 'vis-2' when 'vis' is in restartAdapters (S202) [#412].
39
+ - (copilot) Modify W513 gulpfile.js warning to check for @iobroker/adapter-dev dependency and add S531 suggestion [#469].
40
+ - (copilot) Fix W195 warning for array elements - add W203 warning for unsupported array encryption [#399].
41
+
42
+ ### 4.1.0 (2025-09-11)
37
43
  - (mcm1957) eslint-config and testing suggestions have been updated.
38
44
  - (mcm1957) adapter-core suggestions has been updated.
39
45
  - (mcm1957) URGENT and IMPORTANT issued are watched now.
@@ -1030,5 +1030,5 @@ exports.checkPackageJson = checkPackageJson;
1030
1030
  // [058] Key ${objectName} at package.json is not supported. Please remove.
1031
1031
  // [059] No "scripts" key found in the package.json.
1032
1032
  // [060] ${dependency} listed as dependency and as devDependency.
1033
- // [062] No devDependency declared for ${dependency}. Please consider adding "${dependency}":"${recommendedVersion}" to devDependencies at package.json`
1033
+ // [061] Consider using "${dependency}".
1034
1034
  // [062] No devDependency declared for ${dependency}. Please consider adding "${dependency}":"${recommendedVersion}" to devDependencies at package.json`
@@ -203,9 +203,14 @@ async function checkIOPackageJson(context) {
203
203
  ]),
204
204
  ]) {
205
205
  if (context.ioPackageJson.native[key] === undefined) {
206
- context.warnings.push(
207
- `[W195] Protected or encrypted element "${key}" should be listed at "native" in io-package.json`,
208
- );
206
+ // Check if the key contains a dot, indicating an array element path
207
+ if (key.includes('.')) {
208
+ context.warnings.push(`[W203] Encryption of array elements "${key}" is not yet available`);
209
+ } else {
210
+ context.warnings.push(
211
+ `[W195] Protected or encrypted element "${key}" should be listed at "native" in io-package.json`,
212
+ );
213
+ }
209
214
  }
210
215
  }
211
216
  } // if (valid)
@@ -719,6 +724,16 @@ async function checkIOPackageJson(context) {
719
724
  if (!(context.ioPackageJson.common.dependencies instanceof Array)) {
720
725
  context.errors.push(`[E185] "common.dependencies" must be an array at io-package.json`);
721
726
  } else {
727
+ // Check for empty dependency objects
728
+ const emptyDependencies = context.ioPackageJson.common.dependencies.filter(
729
+ dep => typeof dep === 'object' && dep !== null && Object.keys(dep).length === 0,
730
+ );
731
+ if (emptyDependencies.length > 0) {
732
+ context.errors.push(
733
+ `[E200] Empty dependency objects found in "common.dependencies" at io-package.json. Please remove empty objects.`,
734
+ );
735
+ }
736
+
722
737
  const dependencyArray = common.getDependencyArray(context.ioPackageJson.common.dependencies);
723
738
 
724
739
  // Admin is not allowed in dependencies (globalDependencies only)
@@ -825,6 +840,16 @@ async function checkIOPackageJson(context) {
825
840
  if (!(context.ioPackageJson.common.globalDependencies instanceof Array)) {
826
841
  context.errors.push(`[E186] "common.globalDependencies" must be an array at io-package.json`);
827
842
  } else {
843
+ // Check for empty dependency objects
844
+ const emptyGlobalDependencies = context.ioPackageJson.common.globalDependencies.filter(
845
+ dep => typeof dep === 'object' && dep !== null && Object.keys(dep).length === 0,
846
+ );
847
+ if (emptyGlobalDependencies.length > 0) {
848
+ context.errors.push(
849
+ `[E201] Empty dependency objects found in "common.globalDependencies" at io-package.json. Please remove empty objects.`,
850
+ );
851
+ }
852
+
828
853
  const dependencyArray = common.getDependencyArray(context.ioPackageJson.common.globalDependencies);
829
854
 
830
855
  // js-controller is not allowed in global dependencies (dependencies only)
@@ -936,6 +961,13 @@ async function checkIOPackageJson(context) {
936
961
  } else {
937
962
  context.checks.push('Own adapter not listed at "common.restartAdapters".');
938
963
  }
964
+
965
+ // suggest to restart 'vis-2' if 'vis' is in restart list
966
+ if (restartAdaptersArray.includes('vis') && !restartAdaptersArray.includes('vis-2')) {
967
+ context.warnings.push(
968
+ `[S202] Consider adding 'vis-2' to "common.restartAdapters" as 'vis' is already listed in io-package.json`,
969
+ );
970
+ }
939
971
  } else {
940
972
  context.checks.push('"restartAdapters" check skipped as object not present.');
941
973
  }
@@ -1166,3 +1198,7 @@ exports.checkIOPackageJson = checkIOPackageJson;
1166
1198
  // [197] External icon ${context.ioPackageJson.common.extIcon} cannot be parsed
1167
1199
  // [198] "common.encryptedNative" must be an array at io-package.json
1168
1200
  // [199] "common.protectedNative" must be an array at io-package.json
1201
+ // [200] Empty dependency objects found in "common.dependencies" at io-package.json. Please remove empty objects.
1202
+ // [201] Empty dependency objects found in "common.globalDependencies" at io-package.json. Please remove empty objects.
1203
+ // [202] Consider adding 'vis-2' to "common.restartAdapters" as 'vis' is already listed in io-package.json
1204
+ // [203] Encryption of array elements "${key}" is not yet available
package/lib/M500_Code.js CHANGED
@@ -379,9 +379,16 @@ async function checkCode(context) {
379
379
  '[W520] "gulpfile.js" found in repo but "gulp" not found at devDependencies at package.json. Check whether it can be removed.',
380
380
  );
381
381
  } else if (!usesReact) {
382
- context.warnings.push(
383
- '[W513] "gulpfile.js" found in repo! Think about migrating to @iobroker/adapter-dev package',
384
- );
382
+ // Check if @iobroker/adapter-dev is present in devDependencies
383
+ if (context.packageJson.devDependencies && context.packageJson.devDependencies['@iobroker/adapter-dev']) {
384
+ context.warnings.push(
385
+ '[S531] "gulpfile.js" found in repo while @iobroker/adapter-dev already used. Please check if gulp is still needed.',
386
+ );
387
+ } else {
388
+ context.warnings.push(
389
+ '[W513] "gulpfile.js" found in repo! Think about migrating to @iobroker/adapter-dev package',
390
+ );
391
+ }
385
392
  }
386
393
  } else {
387
394
  if (context.packageJson.devDependencies['gulp']) {
@@ -532,5 +539,6 @@ exports.checkCode = checkCode;
532
539
  // [528] Plugin "license" missing at .releaseconfig.json. Please add.
533
540
  // [529] Plugin "manual-review" missing at .releaseconfig.json. Please add.
534
541
  // [530] .releaseconfig.json is no valid json file - ${e}.
542
+ // [531] "gulpfile.js" found in repo with @iobroker/adapter-dev. Check if gulp is still needed.
535
543
 
536
544
  // [550 - ] see M500_jsonConfig.js
@@ -16,9 +16,7 @@ const issuesToWatchAsError = [
16
16
  'Compatibility check and testing for Responsive Design (materialize)',
17
17
  ];
18
18
 
19
- const issuesToWatchAsWarning = [
20
- 'Migration to ESLint 9 and @iobroker/eslint-config',
21
- ];
19
+ const issuesToWatchAsWarning = ['Migration to ESLint 9 and @iobroker/eslint-config'];
22
20
 
23
21
  // disable axios caching
24
22
  axios.defaults.headers.common = {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.1.0-alpha.4",
2
+ "version": "4.2.0-alpha.0",
3
3
  "name": "@iobroker/repochecker",
4
4
  "dependencies": {
5
5
  "axios": "^1.11.0",
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "devDependencies": {
12
12
  "@alcalzone/release-script": "^3.8.0",
13
- "@iobroker/eslint-config": "^2.0.3",
13
+ "@iobroker/eslint-config": "^2.1.0",
14
14
  "@tsconfig/node20": "^20.1.6",
15
15
  "@types/node": "^24.3.0",
16
16
  "@types/semver": "^7.7.0"