@iobroker/repochecker 3.0.0-alpha.2 → 3.0.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
@@ -20,7 +20,8 @@ Branch (`master/main/dev`) is optional.
20
20
  -->
21
21
 
22
22
  ## Changelog
23
- ### 3.0.0-alpha.2 (2024-09-10)
23
+ ### 3.0.0 (2024-09-10)
24
+ * (mcm1957) Error and warning numbering has been reviewed and duplicates removed.
24
25
  * (mcm1957) index.js has been split into seperated modules.
25
26
 
26
27
  ### 2.10.0 (2024-08-19)
package/index.js CHANGED
@@ -22,7 +22,7 @@ const common = require('./lib/common.js');
22
22
  const config = require('./lib/config.js');
23
23
  const M000_PackageJson = require('./lib/M000_PackageJson.js');
24
24
  const M100_IOPackageJson = require('./lib/M100_IOPackageJson.js');
25
- const M200_Npm = require('./lib/M200_Npm.js');
25
+ const M250_Npm = require('./lib/M250_Npm.js');
26
26
  const M300_Testing = require('./lib/M300_Testing.js');
27
27
  const M400_Repository = require('./lib/M400_Repository.js');
28
28
  const M500_Code = require('./lib/M500_Code.js');
@@ -44,10 +44,10 @@ axios.defaults.headers = {
44
44
  // E0xx
45
45
  // check package.json
46
46
  //
47
- // E1xx
47
+ // E100 - 249
48
48
  // check io-package.json
49
49
  //
50
- // E2xx
50
+ // E250 - 299
51
51
  // check npm and npmjs.org
52
52
  //
53
53
  // E3xx
@@ -140,7 +140,7 @@ function check(request, ctx, callback) {
140
140
  .then(context => M100_IOPackageJson.getIOPackageJson(context))
141
141
  .then(context => M000_PackageJson.checkPackageJson(context))
142
142
  .then(context => M100_IOPackageJson.checkIOPackageJson(context))
143
- .then(context => M200_Npm.checkNpm(context))
143
+ .then(context => M250_Npm.checkNpm(context))
144
144
  .then(context => M400_Repository.checkRepository(context))
145
145
  .then(context => M500_Code.checkCode(context))
146
146
  .then(context => M300_Testing.checkTests(context))
@@ -51,15 +51,7 @@ async function getPackageJson(context) {
51
51
  }
52
52
 
53
53
  async function checkPackageJson(context) {
54
- console.log('\ncheckPackageJson [E0xx]');
55
- if (typeof context.packageJson === 'string') {
56
- try {
57
- context.packageJson = JSON.parse(context.packageJson);
58
- } catch (e) {
59
- context.errors.push(`[E001] Cannot parse package.json: ${e}`);
60
- return context;
61
- }
62
- }
54
+ console.log('\ncheckPackageJson [E001 - E099]');
63
55
 
64
56
  if (!context.githubUrlOriginal.match(/\/iobroker\./i)) {
65
57
  context.errors.push('[E002] No "ioBroker." found in the name of repository');
@@ -192,7 +184,7 @@ async function checkPackageJson(context) {
192
184
  context.checks.push('Repository URL is valid in package.json');
193
185
  }
194
186
  } else {
195
- context.errors.push('[E019] Invalid repository URL in package.json');
187
+ context.errors.push('[E012] Invalid repository object in package.json');
196
188
  }
197
189
  }
198
190
 
@@ -238,7 +230,7 @@ async function checkPackageJson(context) {
238
230
  const nodeVal = context.packageJson.engines.node;
239
231
  const match = nodeVal.match(/^(?<cmp>[<>=~]+)?\s*(?<vers>\d+(\.\d+(\.\d+)?)?(-\w+\.\d+)?)/m);
240
232
  if ( ! match ) {
241
- context.warnings.push(`[W027] {'engines' : { 'node' : '${nodeVal}' } }" is not parseable.`);
233
+ context.warnings.push(`[W027] Engines clause at at package.json ({'engines' : { 'node' : '${nodeVal}' } }") is not parseable.`);
242
234
  } else {
243
235
  common.debug( `node check: ${JSON.stringify(match.groups)}`);
244
236
  if ( match.groups.cmp !== '>' && match.groups.cmp !== '>=' ) {
@@ -317,7 +309,7 @@ async function checkPackageJson(context) {
317
309
  } else if (enforcedDependencies.includes(dependency)) {
318
310
  context.errors.push(`[E044] dependency must not require a specific version. Use "~1.2.3" or "^1.2.3" syntax. Please update "${dependency}:${context.packageJson.dependencies[dependency]}"`);
319
311
  } else {
320
- context.warnings.push(`[W044] dependency should not require a specific version. Use "~1.2.3" or "^1.2.3" syntax. Please update "${dependency}:${context.packageJson.dependencies[dependency]}"`);
312
+ context.warnings.push(`[W047] dependency should not require a specific version. Use "~1.2.3" or "^1.2.3" syntax. Please update "${dependency}:${context.packageJson.dependencies[dependency]}"`);
321
313
  }
322
314
  }
323
315
  }
@@ -332,7 +324,7 @@ async function checkPackageJson(context) {
332
324
  } else if (enforcedDependencies.includes(dependency)) {
333
325
  context.errors.push(`[E046] devDependency must not require a specific version. Use "~1.2.3" or "^1.2.3" syntax. Please update "${dependency}:${context.packageJson.devDependencies[dependency]}"`);
334
326
  } else {
335
- context.warnings.push(`[W046] devDependency should not require a specific version. Use "~1.2.3" or "^1.2.3" syntax. Please update "${dependency}:${context.packageJson.devDependencies[dependency]}"`);
327
+ context.warnings.push(`[W048] devDependency should not require a specific version. Use "~1.2.3" or "^1.2.3" syntax. Please update "${dependency}:${context.packageJson.devDependencies[dependency]}"`);
336
328
  }
337
329
  }
338
330
  }
@@ -363,18 +355,16 @@ async function checkPackageJson(context) {
363
355
  }
364
356
  context.checks.push('"blacklist (package)" checked.');
365
357
 
366
- if (! context.packageJson.keywords) {
367
- context.errors.push('[E039] "keywords" must be an array within package.json and contain some useful keywords');
368
- } else if (!Array.isArray(context.packageJson.keywords)) {
358
+ if (!context.packageJson.keywords || !Array.isArray(context.packageJson.keywords)) {
369
359
  context.errors.push('[E039] "keywords" must be an array within package.json and contain some useful keywords');
370
360
  } else {
371
361
  const forbiddenKeywords = [];
372
362
  const ignoredKeywords = ['iobroker', 'smart home', 'smarthome', 'home automation', 'template'];
373
363
  const recommendedKeywords = ['ioBroker'];
374
- //console.log(`[DEBUG] package.keywords: "${context.packageJson.keywords.join(', ')}"`);
375
- //console.log(`[DEBUG] filtered: "${context.packageJson.keywords.filter(keyword => !ignoredKeywords.includes(keyword.toLowerCase()))}"`);
364
+ common.debug(`package.keywords: "${context.packageJson.keywords.join(', ')}"`);
365
+ common.debug(`filtered: "${context.packageJson.keywords.filter(keyword => !ignoredKeywords.includes(keyword.toLowerCase()))}"`);
376
366
  if (context.packageJson.keywords.filter(keyword => !ignoredKeywords.includes(keyword.toLowerCase())).length === 0 ) {
377
- context.errors.push(`[E039] "keywords" within package.json must contain some keywords besides "${context.packageJson.keywords.join(', ')}" related to adapter`);
367
+ context.errors.push(`[E049] "keywords" within package.json must contain some keywords besides "${context.packageJson.keywords.join(', ')}" related to adapter`);
378
368
  }
379
369
  if (! recommendedKeywords.filter(keyword => context.packageJson.keywords.includes(keyword)).length > 0) {
380
370
  context.warnings.push(`[W040] "keywords" within package.json should contain "${recommendedKeywords.join(', ')}"`);
@@ -392,10 +382,68 @@ async function checkPackageJson(context) {
392
382
  context.checks.push('"globalDependencies" not found in package.json');
393
383
  }
394
384
 
395
- // max number is W046
385
+ // single free 008, 011
386
+ // first free 050
396
387
 
397
388
  return context;
398
389
  }
399
390
 
400
391
  exports.getPackageJson = getPackageJson;
401
392
  exports.checkPackageJson = checkPackageJson;
393
+
394
+ // List of error and warnings used at this module
395
+ // ----------------------------------------------
396
+
397
+ // [001] Cannot parse package.json: ${e}
398
+ // [002] No "ioBroker." found in the name of repository
399
+ // [003] Repository must have name ioBroker.adaptername, but now io"b"roker is in lowercase
400
+ // [004] No adapter name found in URL: ${context.githubUrlOriginal}
401
+ // [005] Adapter name must be lowercase
402
+ // [006] Invalid characters found in adapter name "${adapterName}". Only lowercase chars, digits, "-" and "_" are allowed
403
+ // [007] Cannot find author repo in the URL
404
+ // [008] - free -
405
+ // [009] No version found in the package.json
406
+ // [010] No description found in the package.json
407
+ // [011] - free -
408
+ // [012] Invalid repository object in package.json
409
+ // [013] No author found in the package.json
410
+ // [014] NPM information found in package.json. Please remove all attributes starting with "_"
411
+ // [015] No license found in package.json
412
+ // [016] ${context.packageJson.license} found in package.json is no valid SPDX license. Please use one of listed here: https://spdx.org/licenses/
413
+ // [017] No repository found in the package.json
414
+ // [018] Invalid repository type in package.json: ${context.packageJson.repository.type}. It should be git
415
+ // [019] Invalid repository URL in package.json: ${context.packageJson.repository.url}. Expected: ${context.githubApiData.ssh_url} or ${context.githubApiData.clone_url}
416
+ // [019] Invalid repository URL in package.json: ${context.packageJson.repository}. Expected: ${context.githubApiData.ssh_url} or ${context.githubApiData.clone_url}
417
+ // [020] Name of adapter in package.json must be lowercase and be equal to "iobroker.${adapterName.toLowerCase()}". Now is "${packageJson.name}"
418
+ // [021] "licenses" in package.json are deprecated. Please remove and use "license": "NAME" field.
419
+ // [022] Adapter name is reserved. Please rename adapter.
420
+ // [023] Do not include "npm" as dependency!
421
+ // [024] Adapter name "${adapterName}" may not start with '_'
422
+ // [025] Do not include "iobroker.js-controller" as dependency!
423
+ // [026] "{'engines': {'node'>='${requiredNodeVersion}'}}" is required at package.json, "{'engines':{'node'>='${recommendedNodeVersion}'}}" is recommended
424
+ // [026] "{'engines': {'node'>='${requiredNodeVersion}'}}" is required at package.json, "{'engines':{'node'>='${recommendedNodeVersion}'}}" is recommended
425
+ // [027] Engines clause at at package.json ({'engines' : { 'node' : '${nodeVal}' } }") is not parseable.
426
+ // [028] Minimum node.js version ${recommendedNodeVersion} recommended. Please adapt "{'engines' : { 'node' >= '${match.groups.vers}' } }" at package.json.
427
+ // [028] Minimum node.js version ${recommendedNodeVersion} recommended. Please adapt "{'engines' : { 'node' >= '${match.groups.vers}' } }" at package.json.
428
+ // [029] Node.js ${requiredNodeVersion} is required as minimum, node.js ${recommendedNodeVersion} is recommended. Please adapt "{'engines' : { 'node' >= '${match.groups.vers}' } }" at package.json.
429
+ // [030] No dependencies declared at package.json. Is this really correct?
430
+ // [031] No devDependencies declared at package.json. Please correct package.json
431
+ // [032] No dependency declared for ${dependency}. Please add "${dependency}":"${recommendedVersion}" to dependencies at package.json
432
+ // [033] ${dependency} ${dependencyVersion} specified. ${requiredVersion} is required as minimum, ${recommendedVersion} is recommended. Please update dependencies at package.json
433
+ // [034] ${dependency} ${dependencyVersion} specified. ${recommendedVersion} is recommended. Please consider updating dependencies at package.json
434
+ // [035] No devDependency declared for ${dependency}. Please add "${dependency}":"${recommendedVersion}" to devDependencies at package.json
435
+ // [036] ${dependency} ${dependencyVersion} specified. ${requiredVersion} is required as minimum, ${recommendedVersion} is recommended. Please update devDependencies at package.json
436
+ // [037] ${dependency} ${dependencyVersion} specified. ${recommendedVersion} is recommended. Please consider updating devDependencies at package.json
437
+ // [038] ${blacklistPackageJson[blacklist].msg}
438
+ // [038] ${blacklistPackageJson[blacklist].msg}
439
+ // [039] "keywords" must be an array within package.json and contain some useful keywords
440
+ // [040] "keywords" within package.json should contain "${recommendedKeywords.join(', ')}"
441
+ // [041] "keywords" within package.json should not contain "${forbiddenKeywords.join(', ')}"
442
+ // [042] "globalDependencies" is misplaced at package.json. Did you mean "common.globalDependencies" at io-package.json?
443
+ // [043] dependency should not require a github version. Please change "${dependency}:${context.packageJson.dependencies[dependency]}"
444
+ // [044] dependency must not require a specific version. Use "~1.2.3" or "^1.2.3" syntax. Please update "${dependency}:${context.packageJson.dependencies[dependency]}"
445
+ // [045] devDependency should not require github versions. Please change "${dependency}:${context.packageJson.devDependencies[dependency]}"
446
+ // [046] devDependency must not require a specific version. Use "~1.2.3" or "^1.2.3" syntax. Please update "${dependency}:${context.packageJson.devDependencies[dependency]}"
447
+ // [047] dependency should not require a specific version. Use "~1.2.3" or "^1.2.3" syntax. Please update "${dependency}:${context.packageJson.dependencies[dependency]}"
448
+ // [048] devDependency should not require a specific version. Use "~1.2.3" or "^1.2.3" syntax. Please update "${dependency}:${context.packageJson.devDependencies[dependency]}"
449
+ // [049] "keywords" within package.json must contain some keywords besides "${context.packageJson.keywords.join(', ')}" related to adapter
@@ -3,7 +3,7 @@
3
3
  This module is a support module for iobroker.repochecker
4
4
 
5
5
  Area checked: io-package.json
6
- Numbering : 100 - 199
6
+ Numbering : 100 - 199, 250 - 249
7
7
 
8
8
  */
9
9
 
@@ -73,7 +73,7 @@ const blacklistIOPackageJson = {
73
73
 
74
74
 
75
75
  async function checkIOPackageJson(context) {
76
- console.log('\ncheckIOPackage [E1xx]');
76
+ console.log('\ncheckIOPackage [E100 - E249]');
77
77
 
78
78
  if (!context.ioPackageJson.native) {
79
79
  context.errors.push('[E101] io-package.json must have at least empty "native" attribute');
@@ -134,7 +134,7 @@ async function checkIOPackageJson(context) {
134
134
 
135
135
  /*
136
136
  if (context.ioPackageJson.common.title) {
137
- context.warnings.push('[W171] "common.title" is deprecated in io-package.json. Please remove from io-package.json.');
137
+ context.warnings.push('[W158] "common.title" is deprecated in io-package.json. Please remove from io-package.json.');
138
138
  }
139
139
 
140
140
  if (context.ioPackageJson.common.main) {
@@ -163,14 +163,14 @@ async function checkIOPackageJson(context) {
163
163
  } else {
164
164
  let missingLang = common.checkLanguages(context.ioPackageJson.common.titleLang, context.cfg.requiredLanguages);
165
165
  if (missingLang.length) {
166
- context.warnings.push(`[W105] Missing mandatory translation into ${missingLang.join()} of "common.titleLang" in io-package.json.`);
166
+ context.warnings.push(`[W126] Missing mandatory translation into ${missingLang.join()} of "common.titleLang" in io-package.json.`);
167
167
  }
168
168
 
169
169
  missingLang = common.checkLanguages(context.ioPackageJson.common.titleLang, context.cfg.allowedLanguages);
170
170
  missingLang = missingLang.filter( lang => !context.cfg.requiredLanguages.includes(lang));
171
171
  if (missingLang.length) {
172
172
  missingLang = [... new Set(missingLang)]; // make unique
173
- context.warnings.push(`[W105] Missing suggested translation into ${missingLang.join()} of "common.titleLang" in io-package.json.`);
173
+ context.warnings.push(`[W127] Missing suggested translation into ${missingLang.join()} of "common.titleLang" in io-package.json.`);
174
174
  }
175
175
  }
176
176
 
@@ -183,7 +183,7 @@ async function checkIOPackageJson(context) {
183
183
  }
184
184
 
185
185
  if (text.match(/\sadapter|adapter\s/i)) {
186
- context.warnings.push(`[W106] "common.titleLang" should not contain word "adapter" in the name. It is clear, that this is adapter. Now: ${JSON.stringify(context.ioPackageJson.common.titleLang)}`);
186
+ context.warnings.push(`[W128] "common.titleLang" should not contain word "adapter" in the name. It is clear, that this is adapter. Now: ${JSON.stringify(context.ioPackageJson.common.titleLang)}`);
187
187
  } else {
188
188
  context.checks.push('"common.titleLang" has no "adapter" in it in io-package.json');
189
189
  }
@@ -208,19 +208,19 @@ async function checkIOPackageJson(context) {
208
208
  context.checks.push('"common.desc" found in io-package.json');
209
209
 
210
210
  if (typeof context.ioPackageJson.common.desc !== 'object') {
211
- context.errors.push(`[E109] "common.desc" in io-package.json should be an object for many languages. Found only "${context.ioPackageJson.common.desc}"`);
211
+ context.errors.push(`[E109] "common.desc" in io-package.json must be an object for many languages. Found only "${context.ioPackageJson.common.desc}"`);
212
212
  } else {
213
213
 
214
214
  let missingLang = common.checkLanguages(context.ioPackageJson.common.desc, context.cfg.requiredLanguages);
215
215
  if (missingLang.length) {
216
- context.warnings.push(`[E109] Missing mandatory translation into ${missingLang.join()} of "common.desc" in io-package.json.`);
216
+ context.warnings.push(`[E133] Missing mandatory translation into ${missingLang.join()} of "common.desc" in io-package.json.`);
217
217
  }
218
218
 
219
219
  missingLang = common.checkLanguages(context.ioPackageJson.common.desc, context.cfg.allowedLanguages);
220
220
  missingLang = missingLang.filter( lang => !context.cfg.requiredLanguages.includes(lang));
221
221
  if (missingLang.length) {
222
222
  missingLang = [... new Set(missingLang)]; // make unique
223
- context.warnings.push(`[W109] Missing suggested translation into ${missingLang.join()} of "common.desc" in io-package.json.`);
223
+ context.warnings.push(`[W134] Missing suggested translation into ${missingLang.join()} of "common.desc" in io-package.json.`);
224
224
  }
225
225
  }
226
226
  }
@@ -234,7 +234,7 @@ async function checkIOPackageJson(context) {
234
234
  } else if (context.ioPackageJson.common.keywords.length === 0) {
235
235
  context.errors.push('[E169] "common.keywords" must be an array within io-package.json and contain some useful keywords');
236
236
  } else if (forbiddenKeywords.filter(keyword => context.ioPackageJson.common.keywords.map(k => k.toLowerCase()).includes(keyword)).length > 0) {
237
- context.warnings.push(`[W170] "common.keywords" should not contain "${forbiddenKeywords.join(', ')}" io-package.json`);
237
+ context.warnings.push(`[W168] "common.keywords" should not contain "${forbiddenKeywords.join(', ')}" io-package.json`);
238
238
  }
239
239
 
240
240
  context.checks.push('"common.keywords" found in io-package.json');
@@ -285,7 +285,7 @@ async function checkIOPackageJson(context) {
285
285
  !(context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'html') &&
286
286
  !(context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'none')
287
287
  ) {
288
- context.errors.push('[E114] Admin support not specified. Please add "common.adminUI.config = json|materialize|html|none"');
288
+ context.errors.push('[E129] Admin support not specified. Please add "common.adminUI.config = json|materialize|html|none"');
289
289
  } else {
290
290
  context.checks.push('"common.materialize" or valid "common.adminUI.config:xxx" found in io-package.json');
291
291
  }
@@ -348,7 +348,7 @@ async function checkIOPackageJson(context) {
348
348
  context.checks.push('"common.mode" has known mode in io-package.json');
349
349
 
350
350
  if (context.ioPackageJson.common.onlyWWW && context.ioPackageJson.common.mode !== 'none') {
351
- context.errors.push('[E162] onlyWWW should have common.mode "none" in io-package.json');
351
+ context.errors.push('[E164] onlyWWW should have common.mode "none" in io-package.json');
352
352
  }
353
353
 
354
354
  if (context.ioPackageJson.common.mode === 'schedule' && !context.ioPackageJson.common.schedule) {
@@ -399,9 +399,9 @@ async function checkIOPackageJson(context) {
399
399
  context.checks.push('"common.news" found in io-package.json');
400
400
 
401
401
  if (Object.keys(context.ioPackageJson.common.news).length > 20) {
402
- context.errors.push('[E130] Too many "common.news" found in io-package.json. Must be less than 20. Please remove old news.');
402
+ context.errors.push('[E131] Too many "common.news" found in io-package.json. Must be less than 20. Please remove old news.');
403
403
  } else if (Object.keys(context.ioPackageJson.common.news).length > 7) {
404
- context.warnings.push('[W130] Many "common.news" found in io-package.json. Repository builder will truncate at 7 news. Please remove old news.');
404
+ context.warnings.push('[W132] Many "common.news" found in io-package.json. Repository builder will truncate at 7 news. Please remove old news.');
405
405
  }
406
406
 
407
407
  Object.keys(context.ioPackageJson.common.news).forEach(version => {
@@ -411,7 +411,7 @@ async function checkIOPackageJson(context) {
411
411
  });
412
412
 
413
413
  if (!context.ioPackageJson.common.news[context.ioPackageJson.common.version]) {
414
- context.errors.push(`[E145] No "common.news" found for actual version ${context.ioPackageJson.common.version} in io-package.json`);
414
+ context.errors.push(`[E136] No "common.news" found for actual version ${context.ioPackageJson.common.version} in io-package.json`);
415
415
  }
416
416
 
417
417
  let missingLang =[];
@@ -430,7 +430,7 @@ async function checkIOPackageJson(context) {
430
430
  missingLang = missingLang.filter( lang => !context.cfg.requiredLanguages.includes(lang));
431
431
  if (missingLang.length) {
432
432
  missingLang = [... new Set(missingLang)]; // make unique
433
- context.warnings.push(`[W145] Missing suggested translation into ${missingLang.join()} of some "common.news" in io-package.json.`);
433
+ context.warnings.push(`[W154] Missing suggested translation into ${missingLang.join()} of some "common.news" in io-package.json.`);
434
434
  }
435
435
 
436
436
  }
@@ -530,9 +530,9 @@ async function checkIOPackageJson(context) {
530
530
 
531
531
 
532
532
  if ( currentJsControllerVersion && compareVersions.compare( requiredJsControllerVersion, currentJsControllerVersion, '>' )) {
533
- context.errors.push(`[E162] js-controller ${currentJsControllerVersion} listed as dependency but ${requiredJsControllerVersion} is required as minimum, ${recommendedJsControllerVersion} is recommended. Please update dependency at io-package.json.`);
533
+ context.errors.push(`[E157] js-controller ${currentJsControllerVersion} listed as dependency but ${requiredJsControllerVersion} is required as minimum, ${recommendedJsControllerVersion} is recommended. Please update dependency at io-package.json.`);
534
534
  } else if ( currentJsControllerVersion && compareVersions.compare( recommendedJsControllerVersion, currentJsControllerVersion, '>' )) {
535
- context.warnings.push(`[W162] js-controller ${currentJsControllerVersion} listed as dependency but ${recommendedJsControllerVersion} is recommended. Please consider updating dependency at io-package.json.`);
535
+ context.warnings.push(`[W156] js-controller ${currentJsControllerVersion} listed as dependency but ${recommendedJsControllerVersion} is recommended. Please consider updating dependency at io-package.json.`);
536
536
  }
537
537
 
538
538
  if (context.ioPackageJson.common.globalDependencies) {
@@ -552,7 +552,7 @@ async function checkIOPackageJson(context) {
552
552
 
553
553
  if (!context.ioPackageJson.common.onlyWWW) {
554
554
  if (!context.ioPackageJson.common.tier) {
555
- 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.`);
555
+ context.warnings.push(`[W135] "common.tier" is required in io-package.json. Please check https://github.com/ioBroker/ioBroker.docs/blob/master/docs/en/dev/objectsschema.md#adapter.`);
556
556
  } else if (![1, 2, 3].includes(context.ioPackageJson.common.tier)) {
557
557
  context.errors.push(`[E155] Invalid "common.tier" value: ${context.ioPackageJson.common.tier} at io-package.json. Only 1, 2 or 3 are allowed!`);
558
558
  } else {
@@ -563,17 +563,11 @@ async function checkIOPackageJson(context) {
563
563
  }
564
564
 
565
565
  if (context.ioPackageJson.common.automaticUpgrade) {
566
- context.errors.push(`[E172] "common.automaticUpgrade" will be defined by the user. Please remove from io-package.json`);
566
+ context.errors.push(`[E137] "common.automaticUpgrade" will be defined by the user. Please remove from io-package.json`);
567
567
  } else {
568
568
  context.checks.push('"common.automaticUpgrade" does not exist in io-package.json');
569
569
  }
570
570
 
571
- //if (context.ioPackageJson.common.wakeup) {
572
- // context.warnings.push(`[W174] "common.wakeup" is deprecated. Please remove from io-package.json`);
573
- //} else {
574
- // context.checks.push('"common.wakeup" does not exist in io-package.json');
575
- //}
576
-
577
571
  if (context.ioPackageJson.common.restartAdapters) {
578
572
  const restartAdaptersArray = context.ioPackageJson.common.restartAdapters;
579
573
 
@@ -644,15 +638,109 @@ async function checkIOPackageJson(context) {
644
638
  context.errors.push(`[E124] Main file not found under URL: ${context.githubUrl}/${context.packageJson.main}`);
645
639
  }
646
640
  }
647
-
648
- // max number is E186
649
- // free 144
650
- // duplicates to check 145
651
641
  }
652
642
 
653
- return context;
643
+ // single free 138, 139
644
+ // first free 187
654
645
 
646
+ return context;
655
647
  }
656
648
 
657
649
  exports.getIOPackageJson = getIOPackageJson;
658
- exports.checkIOPackageJson = checkIOPackageJson;
650
+ exports.checkIOPackageJson = checkIOPackageJson;
651
+
652
+ // List of error and warnings used at this module
653
+ // ----------------------------------------------
654
+
655
+ // [100] Cannot parse ioPackage.json: ${e}
656
+ // [101] io-package.json must have at least empty "native" attribute
657
+ // [102] io-package.json must have common object
658
+ // [103] "common.name" in io-package.json must be equal to "${context.adapterName.toLowerCase()}'". Now is ${context.ioPackageJson.common.name}
659
+ // [104] No "common.titleLang" found in io-package.json
660
+ // [105] "common.titleLang" must be an object. Now: ${JSON.stringify(context.ioPackageJson.common.titleLang)}
661
+ // [106] "common.titleLang" must not have ioBroker in the name. It is clear, for what this adapter was created. Now: ${JSON.stringify(context.ioPackageJson.common.titleLang)}
662
+ // [107] No "common.version" found in io-package.json
663
+ // [108] No "common.desc" found in io-package.json
664
+ // [109] "common.desc" in io-package.json must be an object for many languages. Found only "${context.ioPackageJson.common.desc}"
665
+ // [110] Icon not found in the io-package.json
666
+ // [111] extIcon not found in the io-package.json
667
+ // [112] extIcon must be the same as an icon but with github path
668
+ // [113] Adapter should support compact mode
669
+ // [114] "common.noConfig=true" requires "common.adminUI.config" to be set to "none"'
670
+ // [115] "common.licenseInformation" not found in io-package.json
671
+ // [116] No SPDX license found at "common.licenseInformation". Please use one of listed here: https://spdx.org/licenses/
672
+ // [117] Licenses in package.json and in io-package.json are different
673
+ // [118] Versions in package.json and in io-package.json are different
674
+ // [119] No type found in io-package.json
675
+ // [120] Unknown type found in io-package.json
676
+ // [121] No authors found in io-package.json
677
+ // [122] authors must be an Array in io-package.json
678
+ // [123] Authors may not be empty in io-package.json
679
+ // [124] Main file not found under URL: ${context.githubUrl}/${context.packageJson.main}
680
+ // [125] External icon not found under URL: ${context.ioPackageJson.common.extIcon}
681
+ // [126] Missing mandatory translation into ${missingLang.join()} of "common.titleLang" in io-package.json.
682
+ // [127] Missing suggested translation into ${missingLang.join()} of "common.titleLang" in io-package.json.
683
+ // [128] "common.titleLang" should not contain word "adapter" in the name. It is clear, that this is adapter. Now: ${JSON.stringify(context.ioPackageJson.common.titleLang)}
684
+ // [129] Admin support not specified. Please add "common.adminUI.config = json|materialize|html|none"
685
+ // [130] No "common.news" found in io-package.json
686
+ // [131] Too many "common.news" found in io-package.json. Must be less than 20. Please remove old news.
687
+ // [132] Many "common.news" found in io-package.json. Repository builder will truncate at 7 news. Please remove old news.
688
+ // [133] Missing mandatory translation into ${missingLang.join()} of "common.desc" in io-package.json.
689
+ // [134] Missing suggested translation into ${missingLang.join()} of "common.desc" in io-package.json.
690
+ // [135] "common.tier" is required in io-package.json. Please check https://github.com/ioBroker/ioBroker.docs/blob/master/docs/en/dev/objectsschema.md#adapter.
691
+ // [136] No "common.news" found for actual version ${context.ioPackageJson.common.version} in io-package.json
692
+ // [137] "common.automaticUpgrade" will be defined by the user. Please remove from io-package.json
693
+ // [138]
694
+ // [139]
695
+ // [140] width and height of logo are not equal
696
+ // [141] logo is too small. It must be greater or equal than 32x32
697
+ // [142] logo is too big. It must be less or equal than 512x512
698
+ // [143] No main found in the package.json
699
+ // [144] common.installedFrom field found in io-package.json. Must be removed.
700
+ // [145] Missing mandatory translation into ${missingLang.join()} of some "common.news" in io-package.json.
701
+ // [146] instanceObjects must be an Array in io-package.json
702
+ // [147] instanceObject type has an invalid type: ${instanceObject.type}
703
+ // [148] instanceObject common.type has an invalid type! Expected "string", received "${typeof instanceObject.common.type}"
704
+ // [149] instanceObject common.type has an invalid value: ${instanceObject.common.type}
705
+ // [150] No "common.connectionType" found in io-package.json
706
+ // [151] "common.connectionType" type has an invalid value "${context.ioPackageJson.common.connectionType}"
707
+ // [152] No "common.dataSource" found in io-package.json
708
+ // [153] "common.dataSource" type has an invalid value "${context.ioPackageJson.common.dataSource}"
709
+ // [154] Missing suggested translation into ${missingLang.join()} of some "common.news" in io-package.json.
710
+ // [155] Invalid "common.tier" value: ${context.ioPackageJson.common.tier} at io-package.json. Only 1, 2 or 3 are allowed!
711
+ // [156] js-controller ${currentJsControllerVersion} listed as dependency but ${recommendedJsControllerVersion} is recommended. Please consider updating dependency at io-package.json.
712
+ // [157] js-controller ${currentJsControllerVersion} listed as dependency but ${requiredJsControllerVersion} is required as minimum, ${recommendedJsControllerVersion} is recommended. Please update dependency at io-package.json.
713
+ // [158] "common.title" is deprecated in io-package.json. Please remove from io-package.json.
714
+ // [159] common.dependencies "js-controller" dependency should always allow future versions (>=x.x.x) - recommended: {"js-controller": ">=${recommendedJsControllerVersion}"}
715
+ // [160] "admin" is not allowed in common.dependencies
716
+ // [161] "js-controller" is not allowed in common.globalDependencies
717
+ // [162] js-controller dependency missing. js-controller ${requiredJsControllerVersion} is required as minimum, ${recommendedJsControllerVersion} is recommended. Please add to dependencies at io-package.json.
718
+ // [163] common.mode "${context.ioPackageJson.common.mode}" requires JavaScript file for "main" in package.json
719
+ // [164] onlyWWW should have common.mode "none" in io-package.json
720
+ // [165] "common.mode" not found in io-package.json
721
+ // [166] "common.mode: ${context.ioPackageJson.common.mode}" is unknown in io-package.json.
722
+ // [167] scheduled adapters must have "common.schedule" property in io-package.json
723
+ // [168] "common.keywords" should not contain "${forbiddenKeywords.join(', ')}" io-package.json0
724
+ // [169] "common.keywords" must be an array within io-package.json and contain some useful keywords
725
+ // [169] "common.keywords" must be an array within io-package.json and contain some useful keywords
726
+ // [169] "common.keywords" must be an array within io-package.json and contain some useful keywords
727
+ // [170] "common.licenseInformation.type" is invalid. Select valid type (e.g. free)
728
+ // [171] "common.licenseInformation.link" is required for non-free adapters
729
+ // [172] "common.localLink" in io-package.json is deprecated. Please define object "common.localLinks": { "_default": "..." }
730
+ // [173] Potential sensitive data "${missingProtected.join()}" not listed at "protectedNative" in io-package.json
731
+ // [173] Potential sensitive data "${suspiciousKeys.join()}" not listed at "protectedNative" in io-package.json
732
+ // [174] Potential sensitive data "${missingProtected.join()}" not listed at "encryptedNative" in io-package.json
733
+ // [174] Potential sensitive data "${suspiciousKeys.join()}" not listed at "encryptedNative" in io-package.json
734
+ // [175] Release "${version}" at "common.news" in io-package.json is malformed.
735
+ // [176] Own adapter is not allowed to be listed at "common.restartAdapters" in io-package.json
736
+ // [177] "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.
737
+ // [178] "common.materialize" is deprecated in io-package.json. For admin version >= 5 please use the property "common.adminUI"
738
+ // [179] "common.materializeTab" is deprecated in io-package.json. For admin version >= 5 please use the property "common.adminUI".
739
+ // [180] "common.noConfig" is deprecated in io-package.json. For admin version >= 5 please use "common.adminUI.config":"none".
740
+ // [181] "common.license" in io-package.json is deprecated. Please define object "common.licenseInformation"
741
+ // [182] Please remove "common.license" from io-package.json as "common.licenseInformation" is declared.
742
+ // [183] "common.licenseInformation.license" is missing
743
+ // [184] ${blacklistIOPackageJson[blacklist].msg}
744
+ // [184] ${blacklistIOPackageJson[blacklist].msg}
745
+ // [185] "common.dependencies" must be an array at io-package.json
746
+ // [186] "common.globalDependencies" must be an array at io-package.json
@@ -3,7 +3,7 @@
3
3
  This module is a support module for iobroker.repochecker
4
4
 
5
5
  Area checked: NPM
6
- Numbering : 200 - 299
6
+ Numbering : 250 - 299
7
7
 
8
8
  */
9
9
 
@@ -20,7 +20,7 @@ axios.defaults.headers = {
20
20
  // const common = require('./common.js');
21
21
 
22
22
  async function checkNpm(context) {
23
- console.log('\ncheckNpm [E2xx]');
23
+ console.log('\ncheckNpm [E250 - 299]');
24
24
  const response = await axios(`https://registry.npmjs.org/iobroker.${context.adapterName}`)
25
25
  let body = response.data;
26
26
  // bug in NPM some modules could be accessed via normal web page, but not by API
@@ -28,20 +28,20 @@ async function checkNpm(context) {
28
28
  try {
29
29
  const _response = await axios(`https://www.npmjs.com/package/iobroker.${context.adapterName}`);
30
30
  if (!_response.data) {
31
- context.errors.push('[E200] Not found on npm. Please publish');
31
+ context.errors.push('[E250] Not found on npm. Please publish');
32
32
  return context;
33
33
  } else {
34
34
  body = _response.data;
35
35
 
36
36
  context.checks.push('Adapter found on npm');
37
37
  if (!body.includes('href="/~bluefox"') && body.includes('href="/~iobluefox"')) {
38
- context.errors.push(`[E201] Bluefox was not found in the collaborators on NPM!. Please execute in adapter directory: "npm owner add bluefox iobroker.${context.adapterName}"`);
38
+ context.errors.push(`[E251] Bluefox was not found in the collaborators on NPM!. Please execute in adapter directory: "npm owner add bluefox iobroker.${context.adapterName}"`);
39
39
  } else {
40
40
  context.checks.push('Bluefox found in collaborators on NPM');
41
41
  }
42
42
  }
43
43
  } catch (error) {
44
- context.errors.push('[E200] Not found on npm. Please publish');
44
+ context.errors.push('[E250] Not found on npm. Please publish');
45
45
  return context;
46
46
  }
47
47
  } else {
@@ -49,7 +49,7 @@ async function checkNpm(context) {
49
49
  if (!body.maintainers ||
50
50
  !body.maintainers.length ||
51
51
  !body.maintainers.find(user => user.name === 'bluefox' || user.name === 'iobluefox')) {
52
- context.errors.push(`[E201] Bluefox was not found in the collaborators on NPM!. Please execute in adapter directory: "npm owner add bluefox iobroker.${context.adapterName}"`);
52
+ context.errors.push(`[E251] Bluefox was not found in the collaborators on NPM!. Please execute in adapter directory: "npm owner add bluefox iobroker.${context.adapterName}"`);
53
53
  } else {
54
54
  context.checks.push('Bluefox found in collaborators on NPM');
55
55
  }
@@ -58,10 +58,10 @@ async function checkNpm(context) {
58
58
  context.packageJson.version !== body['dist-tags'].latest
59
59
  ) {
60
60
  if ( compareVersions.compare( body['dist-tags'].latest, context.packageJson.version, '>=' )) {
61
- context.errors.push(`[E203] Version of package.json (${context.packageJson.version}) lower than latest version on NPM (${
61
+ context.errors.push(`[E253] Version of package.json (${context.packageJson.version}) lower than latest version on NPM (${
62
62
  (body['dist-tags'] && body['dist-tags'].latest) || JSON.stringify(body)})`);
63
63
  } else {
64
- context.warnings.push(`[W202] Version of package.json (${context.packageJson.version}) doesn't match latest version on NPM (${
64
+ context.warnings.push(`[W252] Version of package.json (${context.packageJson.version}) doesn't match latest version on NPM (${
65
65
  (body['dist-tags'] && body['dist-tags'].latest) || JSON.stringify(body)})`);
66
66
  }
67
67
  } else {
@@ -79,16 +79,31 @@ async function checkNpm(context) {
79
79
  }
80
80
  if (missingVersions.length) {
81
81
  if (missingVersions.length === 1) {
82
- context.errors.push(`[E204] Version "${missingVersions.join(', ')}" listed at common.news at io-package.json does not exist at NPM. Please remove from news section.`);
82
+ context.errors.push(`[E254] Version "${missingVersions.join(', ')}" listed at common.news at io-package.json does not exist at NPM. Please remove from news section.`);
83
83
  } else {
84
- context.errors.push(`[E204] Versions "${missingVersions.join(', ')}" listed at common.news at io-package.json do not exist at NPM. Please remove from news section.`);
84
+ context.errors.push(`[E254] Versions "${missingVersions.join(', ')}" listed at common.news at io-package.json do not exist at NPM. Please remove from news section.`);
85
85
  }
86
86
  } else {
87
87
  context.checks.push(`All versions listed at news exist at npm`);
88
88
  }
89
89
  }
90
90
 
91
+ // single free -
92
+ // first free 255
93
+
91
94
  return context;
92
95
  }
93
96
 
94
97
  exports.checkNpm = checkNpm;
98
+
99
+ // List of error and warnings used at this module
100
+ // ----------------------------------------------
101
+
102
+ // [250] Not found on npm. Please publish
103
+ // [250] Not found on npm. Please publish
104
+ // [251] Bluefox was not found in the collaborators on NPM!. Please execute in adapter directory: "npm owner add bluefox iobroker.${context.adapterName}"
105
+ // [251] Bluefox was not found in the collaborators on NPM!. Please execute in adapter directory: "npm owner add bluefox iobroker.${context.adapterName}"
106
+ // [252] Version of package.json (${context.packageJson.version}) doesn't match latest version on NPM (${
107
+ // [253] Version of package.json (${context.packageJson.version}) lower than latest version on NPM (${
108
+ // [254] Version "${missingVersions.join(', ')}" listed at common.news at io-package.json does not exist at NPM. Please remove from news section.
109
+ // [254] Versions "${missingVersions.join(', ')}" listed at common.news at io-package.json do not exist at NPM. Please remove from news section.
@@ -10,7 +10,7 @@
10
10
  // const common = require('./common.js');
11
11
 
12
12
  async function checkTests(context) {
13
- console.log('\ncheckTests [E3xx]');
13
+ console.log('\ncheckTests [E300 - E399]');
14
14
  // if found some file in `\.github\workflows` with the test inside => it is OK too
15
15
  if (context && context.filesList.find(name => name.startsWith('.github/workflows/') && name.endsWith('.yml') && name.toLowerCase().includes('test'))) {
16
16
  context.checks.push('Tests found on github actions');
@@ -20,7 +20,8 @@ axios.defaults.headers = {
20
20
  const common = require('./common.js');
21
21
 
22
22
  async function checkRepository(context) {
23
- console.log('\ncheckRepository [E4xx]');
23
+ console.log('\ncheckRepository [E400 - E499]');
24
+
24
25
  if (context.ioPackageJson && context.ioPackageJson.common && context.ioPackageJson.common.type) { /* TODO: why check type here ? */
25
26
  // download latest repo
26
27
  const response = await axios('https://raw.githubusercontent.com/ioBroker/ioBroker.repositories/master/sources-dist.json')
@@ -30,10 +31,10 @@ async function checkRepository(context) {
30
31
  } else {
31
32
  context.latestRepo = body;
32
33
  if (!context.latestRepo[context.adapterName]) {
33
- context.warnings.push(`[W400] Cannot find "${context.adapterName}" in latest repository`);
34
+ context.warnings.push(`[W401] Cannot find "${context.adapterName}" in latest repository`);
34
35
 
35
36
  if (context.adapterName.includes('_')) {
36
- context.errors.push('[E429] Adapter name should use "-" instead of "_"');
37
+ context.errors.push('[E421] Adapter name should use "-" instead of "_"');
37
38
  } else {
38
39
  context.checks.push('Adapter name does not have "_"');
39
40
  }
@@ -172,7 +173,7 @@ async function checkRepository(context) {
172
173
  }
173
174
 
174
175
  if ( !context.stableRepoLive[dependency] ) {
175
- context.warnings.push(`[W433] Dependency ${dependency} not available at stable repository`);
176
+ context.warnings.push(`[W433] Dependency '${dependency}':'${dependencies[dependency]}' not available at stable repository`);
176
177
  } else {
177
178
  const versDependency = dependencies[dependency];
178
179
  const versRepository = context.stableRepoLive[dependency].version;
@@ -181,7 +182,7 @@ async function checkRepository(context) {
181
182
  context.warnings.push(`[W434] Dependency '${dependency}':'${dependencies[dependency]}' should specify '>='`);
182
183
  } else {
183
184
  if ( !compareVersions.compare( versRepository, versDependency.replace('>=',''), '>=')) {
184
- context.errors.push(`[E433] Dependency '${dependency}':'${dependencies[dependency]}' not available at latest repository`);
185
+ context.errors.push(`[E433] Dependency '${dependency}':'${dependencies[dependency]}' not available at stable repository`);
185
186
  } else {
186
187
  context.checks.push(`Dependency '${dependency}':'${dependencies[dependency]}' available at stable repository`);
187
188
  }
@@ -215,7 +216,7 @@ async function checkRepository(context) {
215
216
  }
216
217
 
217
218
  if ( !context.stableRepoLive[dependency] ) {
218
- context.warnings.push(`[W433] Dependency ${dependency} not available at stable repository`);
219
+ context.warnings.push(`[W433] Dependency '${dependency}':'${dependencies[dependency]}' not available at stable repository`);
219
220
  } else {
220
221
  const versDependency = dependencies[dependency];
221
222
  const versRepository = context.stableRepoLive[dependency].version;
@@ -244,4 +245,51 @@ async function checkRepository(context) {
244
245
  // max number is E429
245
246
  }
246
247
 
247
- exports.checkRepository = checkRepository;
248
+ exports.checkRepository = checkRepository;
249
+
250
+ // List of error and warnings used at this module
251
+ // ----------------------------------------------
252
+
253
+ // [400] Cannot download https://raw.githubusercontent.com/ioBroker/ioBroker.repositories/master/sources-dist.json
254
+ // [401] Cannot find "${context.adapterName}" in latest repository
255
+ // [402] Types of adapter in latest repository and in io-package.json are different "${context.latestRepo[context.adapterName].type}" !== "${context.ioPackageJson.common.type}"
256
+ // [403] Version set in latest repository
257
+ // [404] Icon not found in latest repository
258
+ // [405] Icon must be in the following path: ${url}; correct sources-dist.json
259
+ // [406] Meta URL not found in latest repository; correct sources-dist.json
260
+ // [407] Meta URL must be equal to ${url}io-package.json; correct sources-dist.json
261
+ // [408]
262
+ // [409]
263
+ // [410]
264
+ // [411]
265
+ // [412]
266
+ // [413]
267
+ // [414]
268
+ // [415]
269
+ // [416]
270
+ // [417]
271
+ // [418]
272
+ // [419]
273
+ // [420] Cannot download https://raw.githubusercontent.com/ioBroker/ioBroker.repositories/master/sources-dist-stable.json
274
+ // [421] Adapter name should use "-" instead of "_"
275
+ // [422] Types of adapter in stable repository and in io-package.json are different "${context.stableRepo[context.adapterName].type}" !== "${context.ioPackageJson.common.type}"
276
+ // [423] Adapter was found in stable repository but not in latest repo
277
+ // [424] No version set in stable repository
278
+ // [425] Icon not found in stable repository
279
+ // [426] Icon must be in the following path: ${url}; correct sources-dist-stable.json
280
+ // [427] Meta URL not found in latest repository; correct sources-dist.json
281
+ // [428] Meta URL must be equal to ${url}io-package.json; correct sources-dist-stable.json
282
+ // [429] Cannot download http://repo.iobroker.live/sources-dist-latest.json
283
+ // [430] Cannot download http://repo.iobroker.live/sources-dist.json
284
+ // [431] Dependency '${dependency}':'${dependencies[dependency]}' not available at latest repository
285
+ // [431] Dependency '${dependency}':'${dependencies[dependency]}' not available at latest repository
286
+ // [431] Dependency '${dependency}':'${dependencies[dependency]}' not available at latest repository
287
+ // [431] Dependency '${dependency}':'${dependencies[dependency]}' not available at latest repository
288
+ // [432] Dependency '${dependency}':'${dependencies[dependency]}' should specify '>='
289
+ // [432] Dependency '${dependency}':'${dependencies[dependency]}' should specify '>='
290
+ // [433] Dependency '${dependency}':'${dependencies[dependency]}' not available at stable repository
291
+ // [433] Dependency '${dependency}':'${dependencies[dependency]}' not available at stable repository
292
+ // [433] Dependency '${dependency}':'${dependencies[dependency]}' not available at stable repository
293
+ // [433] Dependency '${dependency}':'${dependencies[dependency]}' not available at stable repository
294
+ // [434] Dependency '${dependency}':'${dependencies[dependency]}' should specify '>='
295
+ // [434] Dependency '${dependency}':'${dependencies[dependency]}' should specify '>='
package/lib/M500_Code.js CHANGED
@@ -328,7 +328,7 @@ async function checkCode(context) {
328
328
 
329
329
  if (context.ioPackageJson.common.javascriptRules) {
330
330
  if (!context.ioPackageJson.common.javascriptRules.url) {
331
- context.errors.push('[E515] JavaScript-Rules support is declared, but no location in property common.javascriptRules.url defined');
331
+ context.errors.push('[E517] JavaScript-Rules support is declared, but no location in property common.javascriptRules.url defined');
332
332
  }
333
333
  if (!context.filesList.includes('admin/' + context.ioPackageJson.common.javascriptRules.url)) {
334
334
  context.errors.push(`[E516] "${context.ioPackageJson.common.javascriptRules.url}" not found, but JavaScript-Rules support is declared`);
@@ -347,10 +347,6 @@ async function checkCode(context) {
347
347
  }
348
348
  });
349
349
 
350
- //if (context['/iob_npm.done']) {
351
- // context.errors.push('[E503] File "iob_npm.done" found in repo! Remove that file');
352
- //}
353
-
354
350
  if (!context.filesList.includes('package-lock.json')) {
355
351
  context.warnings.push('[W523] "package-lock.json" not found in repo! Please remove from .gitignore!');
356
352
  }
@@ -384,24 +380,24 @@ async function checkCode(context) {
384
380
  const plugins = releaseConfigJson.plugins;
385
381
  console.log(`plugins: ${plugins}`);
386
382
  if (!context.packageJson.devDependencies['@alcalzone/release-script-plugin-iobroker']) {
387
- context.errors.push('[E519] "@alcalzone/release-script" requires plugin "@alcalzone/release-script-plugin-iobroker". Please add.');
383
+ context.errors.push('[E524] "@alcalzone/release-script" requires plugin "@alcalzone/release-script-plugin-iobroker". Please add.');
388
384
  } else {
389
385
  if (!plugins.includes('iobroker')) {
390
- context.errors.push('[E520] Plugin "iobroker" missing at .releaseconfig.json. Please add.');
386
+ context.errors.push('[E527] Plugin "iobroker" missing at .releaseconfig.json. Please add.');
391
387
  }
392
388
  }
393
389
  if (!context.packageJson.devDependencies['@alcalzone/release-script-plugin-license']) {
394
- context.errors.push('[E519] "@alcalzone/release-script" requires plugin "@alcalzone/release-script-plugin-license". Please add.');
390
+ context.errors.push('[E525] "@alcalzone/release-script" requires plugin "@alcalzone/release-script-plugin-license". Please add.');
395
391
  } else {
396
392
  if (!plugins.includes('license')) {
397
- context.errors.push('[E520] Plugin "license" missing at .releaseconfig.json. Please add.');
393
+ context.errors.push('[E528] Plugin "license" missing at .releaseconfig.json. Please add.');
398
394
  }
399
395
  }
400
396
  if (!context.packageJson.devDependencies['@alcalzone/release-script-plugin-manual-review']) {
401
- context.warnings.push('[S519] Consider adding plugin "@alcalzone/release-script-plugin-manual-review".');
397
+ context.warnings.push('[S526] Consider adding plugin "@alcalzone/release-script-plugin-manual-review".');
402
398
  } else {
403
399
  if (!plugins.includes('manual-review')) {
404
- context.warnings.push('[W520] Plugin "manual-review" missing at .releaseconfig.json. Please add.');
400
+ context.warnings.push('[W529] Plugin "manual-review" missing at .releaseconfig.json. Please add.');
405
401
  }
406
402
  }
407
403
  }
@@ -434,7 +430,51 @@ async function checkCode(context) {
434
430
  }
435
431
  }
436
432
 
433
+ // single free 522
434
+ // first free 0530
435
+
437
436
  return context;
438
437
  }
439
438
 
440
- exports.checkCode = checkCode;
439
+ exports.checkCode = checkCode;
440
+
441
+ // List of error and warnings used at this module
442
+ // ----------------------------------------------
443
+
444
+ // [500] node_modules found in repo. Please delete it
445
+ // [501] Cannot get ${context.branch}.zip on github
446
+ // [502] "admin/img/info-big.png" not found, but selectID.js used in index_m.html
447
+ // [503] File "${file}" found in repo! Please remove file.
448
+ // [504] setInterval found in "${context.packageJson.main}", but no clearInterval detected
449
+ // [504] setInterval found in "${context.packageJson.main}", but no clearInterval detected
450
+ // [505] setTimeout found in "${context.packageJson.main}", but no clearTimeout detected
451
+ // [505] setTimeout found in "${context.packageJson.main}", but no clearTimeout detected
452
+ // [505] setTimeout found in "${context.packageJson.main}", but no clearTimeout detected
453
+ // [506] More non translated in german or russian words found in admin/words.js. You can use https://translator.iobroker.in/ for translations
454
+ // [506] Word "${word}" is not translated to german in admin/words.js. You can use https://translator.iobroker.in/ for translations
455
+ // [506] Word "${word}" is not translated to russian in admin/words.js. You can use https://translator.iobroker.in/ for translations
456
+ // [507] Cannot parse "admin/jsonConfig.json${context['/admin/jsonConfig.json'] ? '' : '5'}": ${e}
457
+ // [508] "admin/jsonConfig.json${context['/admin/jsonConfig.json'] ? '' : '5'}" not found, but admin support is declared
458
+ // [509] Cannot parse "admin/i18n/${lang}.json": ${e}
459
+ // [509] Cannot parse "admin/i18n/${lang}/translations.json": ${e}
460
+ // [510] "/admin/i18n/${lang}/translations.json" or "admin/i18n/${lang}.json" not found, but admin support is declared. Please add.
461
+ // [511] Cannot parse "admin/jsonCustom.json${context['/admin/jsonCustom.json'] ? '' : '5'}": ${e}
462
+ // [512] "admin/jsonCustom.json${context['/admin/jsonCustom.json'] ? '' : '5'}" not found, but custom support is declared
463
+ // [513] "gulpfile.js" found in repo! Think about migrating to @iobroker/adapter-dev package
464
+ // [514] "admin/blockly.js" not found, but blockly support is declared
465
+ // [515] Why did you decide to disable i18n support?
466
+ // [516] "${context.ioPackageJson.common.javascriptRules.url}" not found, but JavaScript-Rules support is declared
467
+ // [517] JavaScript-Rules support is declared, but no location in property common.javascriptRules.url defined
468
+ // [518] "@alcalzone/release-script" (>=3.0.0) is used, but ".releaseconfig.json" not found. Please create.
469
+ // [519] "${context.packageJson.main}" found in package.json, but not found as file
470
+ // [520] "gulpfile.js" found in repo but "gulp" not found at devDependencies at package.json. Check whether it can be removed.
471
+ // [521] "gulp" found at devDependencies at package.json but no "gulpfile.js" found. Is this dependency really required?
472
+ // [522]
473
+ // [523] "package-lock.json" not found in repo! Please remove from .gitignore!
474
+ // [524] "@alcalzone/release-script" requires plugin "@alcalzone/release-script-plugin-iobroker". Please add.
475
+ // [525] "@alcalzone/release-script" requires plugin "@alcalzone/release-script-plugin-license". Please add.
476
+ // [526] Consider adding plugin "@alcalzone/release-script-plugin-manual-review".
477
+ // [527] Plugin "iobroker" missing at .releaseconfig.json. Please add.
478
+ // [528] Plugin "license" missing at .releaseconfig.json. Please add.
479
+ // [529] Plugin "manual-review" missing at .releaseconfig.json. Please add.
480
+
@@ -21,7 +21,7 @@ function getAuthor(author) {
21
21
 
22
22
  async function checkReadme(context) {
23
23
  // https://raw.githubusercontent.com/userName/ioBroker.adaptername/${context.branch}/README.md
24
- console.log('\ncheckReadme [E6xx]');
24
+ console.log('\ncheckReadme [E600 - E699]');
25
25
 
26
26
  const data = await common.downloadFile(context.githubUrl, '/README.md');
27
27
  if (!data) {
@@ -102,4 +102,15 @@ async function checkReadme(context) {
102
102
  return context;
103
103
  }
104
104
 
105
- exports.checkReadme = checkReadme;
105
+ exports.checkReadme = checkReadme;
106
+
107
+ // List of error and warnings used at this module
108
+ // ----------------------------------------------
109
+
110
+ // [601] No README.md found
111
+ // [603] NO "## Changelog" found in README.md
112
+ // [606] Current adapter version ${context.packageJson.version} not found in README.md
113
+ // [604] No "## License" found in README.md
114
+ // [605] No actual year found in copyright. Please add "Copyright (c) ${m[1]}-${year} ${getAuthor(context.packageJson.author)}" at the end of README.md
115
+ // [605] No actual year found in copyright. Please add "Copyright (c) ${year} ${getAuthor(context.packageJson.author)}" at the end of README.md
116
+ // [606] Could not retrieve timestamp of LATEST revision at npm.
@@ -25,7 +25,7 @@ async function checkLicenseFile(context) {
25
25
 
26
26
  const data = await common.downloadFile(context.githubUrl, '/LICENSE');
27
27
  if (!data) {
28
- context.errors.push('[E701] NO LICENSE file found, please add it.');
28
+ context.errors.push('[E700] NO LICENSE file found, please add it.');
29
29
  } else {
30
30
  context.checks.push('LICENSE file found');
31
31
 
@@ -80,4 +80,11 @@ async function checkLicenseFile(context) {
80
80
  return context;
81
81
  }
82
82
 
83
- exports.checkLicenseFile = checkLicenseFile;
83
+ exports.checkLicenseFile = checkLicenseFile;
84
+
85
+ // List of error and warnings used at this module
86
+ // ----------------------------------------------
87
+
88
+ // [E700] NO LICENSE file found, please add it.
89
+ // [E701] No actual year found in LICENSE. Please add "Copyright (c) ${m[1]}-${year} ${getAuthor(context.packageJson.author)}" at the start of LICENSE
90
+ // [E701] No actual year found in LICENSE. Please add "Copyright (c) ${year} ${getAuthor(context.packageJson.author)}" at the start of LICENSE
@@ -53,4 +53,11 @@ function checkGithubRepo(context) {
53
53
  }
54
54
 
55
55
  exports.getCommitInfos = getCommitInfos;
56
- exports.checkGithubRepo = checkGithubRepo;
56
+ exports.checkGithubRepo = checkGithubRepo;
57
+
58
+ // List of error and warnings used at this module
59
+ // ----------------------------------------------
60
+
61
+ // [E801] No repository about text found. Please go to "${context.githubUrlOriginal}", press the settings button beside the about title and add the description.
62
+ // [E802] No topics found in the repository. Please go to "${context.githubUrlOriginal}", press the settings button beside the about title and add some topics.
63
+ // [E803] Archived repositories are not allowed.
@@ -148,7 +148,7 @@ async function checkNpmIgnore(context) {
148
148
  }*/
149
149
  if (!tooComplexToCheck) {
150
150
  if (!rules.includes('iob_npm.done') && !rules.includes('/iob_npm.done')) {
151
- /*!check &&*/ context.errors.push(`[E953] iob_npm.done not found in .npmignore`);
151
+ /*!check &&*/ context.errors.push(`[E955] iob_npm.done not found in .npmignore`);
152
152
  }
153
153
 
154
154
  checkFiles.forEach((file, i) => {
@@ -171,4 +171,18 @@ async function checkNpmIgnore(context) {
171
171
  }
172
172
 
173
173
  exports.checkGitIgnore = checkGitIgnore;
174
- exports.checkNpmIgnore = checkNpmIgnore;
174
+ exports.checkNpmIgnore = checkNpmIgnore;
175
+
176
+ // List of error and warnings used at this module
177
+ // ----------------------------------------------
178
+
179
+ // [901] .gitignore not found
180
+ // [902] node_modules not found in .npmignore
181
+ // [903] iob_npm.done not found in .gitignore
182
+ // [904] file ${file} found in repository, but not found in .gitignore
183
+
184
+ // [951] .npmignore found but "files" is used at package.json. Please remove .npmignore.
185
+ // [952] .npmignore not found
186
+ // [953] .npmignore found - consider using package.json object "files" instead.
187
+ // [954] node_modules not found in `.npmignore`
188
+ // [955] iob_npm.done not found in .npmignore`
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.0.0-alpha.2",
2
+ "version": "3.0.0",
3
3
  "name": "@iobroker/repochecker",
4
4
  "dependencies": {
5
5
  "axios": "^1.7.7",