@iobroker/repochecker 5.9.0 → 5.9.1

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,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.9.1 (2026-04-08)
29
+ - (@copilot) Added `isNewAdapter` flag: set to `true` when adapter is not listed in the latest repository, with an info log when set.
30
+ - (@copilot) Added `--strict` command line option: when active, outputs an info log "running in strict mode".
31
+ - (@copilot) `[S6020]` suggestion to add `CHANGELOG_OLD.md` is now only shown when `isNewAdapter` is set or strict mode is active.
32
+
28
33
  ### 5.9.0 (2026-04-08)
29
34
  - (@copilot) Added checks W1114/S1114: warn when `common.schedule` is set to a non-empty value for daemon adapters (not supported), and suggest removal when `common.schedule` is an empty string for daemon adapters (unused). Related to [#806].
30
35
  - (@copilot) Added checks to help maintain organized changelog files: warns when CHANGELOG.md is present (changelog belongs in README.md), when both CHANGELOG.md and CHANGELOG_OLD.md coexist, when the README changelog exceeds 20 entries without a CHANGELOG_OLD.md, and suggests adding CHANGELOG_OLD.md when no such file exists. [W6017, W6018, W6019, S6020]
package/index.js CHANGED
@@ -239,6 +239,11 @@ if (typeof module !== 'undefined' && module.parent) {
239
239
  common.setLocal(true);
240
240
  }
241
241
 
242
+ if (process.argv.includes('--strict')) {
243
+ process.argv.splice(process.argv.indexOf('--strict'), 1);
244
+ common.setStrict(true);
245
+ }
246
+
242
247
  // Get url from parameters if possible
243
248
  if (process.argv.length > 2) {
244
249
  repoUrl = process.argv[2];
@@ -1037,7 +1037,7 @@ async function checkIOPackageJson(context) {
1037
1037
 
1038
1038
  if (!adminDependency['admin'].startsWith('>=')) {
1039
1039
  context.errors.push(
1040
- `[E1089] common.dependencies "admin" dependency should always allow future versions (>=x.x.x) - recommended: {"admin": ">=${recommendedAdminVersion}"}.`,
1040
+ `[E1089] common.globalDependencies "admin" dependency should always allow future versions (>=x.x.x) - recommended: {"admin": ">=${recommendedAdminVersion}"}.`,
1041
1041
  );
1042
1042
  } else {
1043
1043
  currentAdminVersion = adminDependency['admin'].replace(/[^\d.]/g, '');
@@ -1100,8 +1100,8 @@ async function checkIOPackageJson(context) {
1100
1100
 
1101
1101
  if (!context.ioPackageJson.common.onlyWWW) {
1102
1102
  if (!context.ioPackageJson.common.tier) {
1103
- context.warnings.push(
1104
- `[W1035] "common.tier" is required in io-package.json. Please check https://github.com/ioBroker/ioBroker.docs/blob/master/docs/en/dev/objectsschema.md#adapter.`,
1103
+ context.errors.push(
1104
+ `[E1035] "common.tier" is required in io-package.json. Please check https://github.com/ioBroker/ioBroker.docs/blob/master/docs/en/dev/objectsschema.md#adapter.`,
1105
1105
  );
1106
1106
  } else if (![1, 2, 3].includes(context.ioPackageJson.common.tier)) {
1107
1107
  context.errors.push(
@@ -38,7 +38,14 @@ async function checkRepository(context) {
38
38
  } else {
39
39
  context.latestRepo = body;
40
40
  if (!context.latestRepo[context.adapterName]) {
41
- context.warnings.push(`[W4001] Cannot find "${context.adapterName}" in latest repository. Please ignore if PR to add adapter to repositories already exists.`);
41
+ context.warnings.push(
42
+ `[W4001] Cannot find "${context.adapterName}" in latest repository. Please ignore if PR to add adapter to repositories already exists.`,
43
+ );
44
+
45
+ context.cfg.isNewAdapter = true;
46
+ common.info(
47
+ `isNewAdapter is set: adapter "${context.adapterName}" is not listed in the latest repository`,
48
+ );
42
49
 
43
50
  if (context.adapterName.includes('_')) {
44
51
  context.errors.push('[E4021] Adapter name should use "-" instead of "_"');
@@ -270,7 +270,7 @@ function getMaxYearFromText(text) {
270
270
  const CHANGELOG_MD_ALLOW_LIST = ['js-controller', 'admin'];
271
271
 
272
272
  // Maximum number of changelog entries in README before a warning is issued about CHANGELOG_OLD.md
273
- const MAX_README_CHANGELOG_ENTRIES = 20;
273
+ const MAX_README_CHANGELOG_ENTRIES = 30;
274
274
 
275
275
  async function checkReadme(context) {
276
276
  // https://raw.githubusercontent.com/userName/ioBroker.adaptername/${context.branch}/README.md
@@ -320,7 +320,7 @@ async function checkReadme(context) {
320
320
  context.warnings.push(
321
321
  `[W6019] README.md contains ${versionEntryCount} changelog entries. Consider adding CHANGELOG_OLD.md file supported by @alcalzone/releasescript.`,
322
322
  );
323
- } else {
323
+ } else if (context.cfg.isNewAdapter || common.isStrict()) {
324
324
  context.warnings.push(
325
325
  '[S6020] Consider adding a CHANGELOG_OLD.md file to store older changelog entries. This is supported by @alcalzone/releasescript.',
326
326
  );
@@ -490,9 +490,7 @@ async function checkReadme(context) {
490
490
  // Check for CHANGELOG.md — changelog should be in README.md (some adapters are exempt)
491
491
  if (hasChangelogMd) {
492
492
  if (!CHANGELOG_MD_ALLOW_LIST.includes(context.adapterName)) {
493
- context.warnings.push(
494
- '[W6017] CHANGELOG.md detected. The changelog must be located within README.md.',
495
- );
493
+ context.warnings.push('[W6017] CHANGELOG.md detected. The changelog must be located within README.md.');
496
494
  }
497
495
  if (hasChangelogOldMd) {
498
496
  context.warnings.push(
package/lib/common.js CHANGED
@@ -12,6 +12,7 @@ let gDebug = false;
12
12
  let gInfo = true;
13
13
  let gSuccess = false;
14
14
  let gLocal = false;
15
+ let gStrict = false;
15
16
 
16
17
  // Cache for getFilesList and getFile functions
17
18
  const filesListCache = new Map();
@@ -66,6 +67,10 @@ function isLocal() {
66
67
  return gLocal;
67
68
  }
68
69
 
70
+ function isStrict() {
71
+ return gStrict;
72
+ }
73
+
69
74
  function setDebug(flag) {
70
75
  gDebug = flag;
71
76
  debug('debug messages have been enabled');
@@ -86,6 +91,11 @@ function setLocal(flag) {
86
91
  info(`running in LOCAL mode`);
87
92
  }
88
93
 
94
+ function setStrict(flag) {
95
+ gStrict = flag;
96
+ info(`running in strict mode`);
97
+ }
98
+
89
99
  function checkLanguages(langObj, languages) {
90
100
  return languages.filter(lang => !langObj[lang]);
91
101
  }
@@ -290,11 +300,13 @@ exports.isDebug = isDebug;
290
300
  exports.isInfo = isInfo;
291
301
  exports.isSuccess = isSuccess;
292
302
  exports.isLocal = isLocal;
303
+ exports.isStrict = isStrict;
293
304
 
294
305
  exports.setDebug = setDebug;
295
306
  exports.setInfo = setInfo;
296
307
  exports.setSuccess = setSuccess;
297
308
  exports.setLocal = setLocal;
309
+ exports.setStrict = setStrict;
298
310
 
299
311
  exports.checkLanguages = checkLanguages;
300
312
  exports.downloadURL = downloadURL;
package/lib/config.js CHANGED
@@ -438,6 +438,7 @@ function initConfig(context) {
438
438
  context.cfg.allowedTypes = allowedTypes;
439
439
  context.cfg.requiredLanguages = requiredLanguages;
440
440
  context.cfg.reservedAdapterNames = reservedAdapterNames;
441
+ context.cfg.isNewAdapter = false;
441
442
 
442
443
  return context;
443
444
  }
@@ -482,6 +483,8 @@ function logEnvironment(context) {
482
483
  common.info(` npmExists: ${context.cfg.npmExists ? 'true' : 'false'}`);
483
484
  common.info(` onlyWWW: ${context.cfg.onlyWWW ? 'true' : 'false'}`);
484
485
  common.info(` usesJson5: ${context.cfg.usesJson5 ? 'true' : 'false'}`);
486
+ common.info(` isNewAdapter: ${context.cfg.isNewAdapter ? 'true' : 'false'}`);
487
+ common.info(` strict: ${common.isStrict() ? 'true' : 'false'}`);
485
488
 
486
489
  return context;
487
490
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.9.0",
2
+ "version": "5.9.1",
3
3
  "name": "@iobroker/repochecker",
4
4
  "dependencies": {
5
5
  "ajv": "^8.18.0",