@iobroker/repochecker 2.8.1 → 2.9.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,6 +20,13 @@ Branch (`master/main/dev`) is optional.
20
20
  -->
21
21
 
22
22
  ## Changelog
23
+ ### 2.9.0 (2024-07-29)
24
+ * (mcm1957) Adapt text if sources-dist(-stable).json need a correction [#97].
25
+ * (mcm1957) Missing "common.mode" error text corrected [#249].
26
+ * (mcm1957) Files "iob" and "iobroker" are disallowed now [#248].
27
+ * (mcm1957) Checks related to @alcalzone/releasescript modified [#71].
28
+ * (mcm1957) Text of E114 (missing adminUI) adapted.
29
+
23
30
  ### 2.8.1 (2024-07-28)
24
31
  * (mcm1957) Check of js-controller version has been corrected [#247].
25
32
  * (mcm1957) Honor '>' at dependency checks too [#246].
package/doc/issues.json CHANGED
@@ -360,7 +360,7 @@
360
360
  "title": "Bluefox was not found in the collaborators on NPM!. Please execute in adapter directory: `npm owner add bluefox iobroker.adapterName`"
361
361
  },
362
362
  "E204": {
363
- "title": "Version `${missingVersions.join(`, `)}` listed at common.news at io-package.json does not exist at NPM. Please remove from news."
363
+ "title": "Version `${missingVersions.join(`, `)}` listed at common.news at io-package.json does not exist at NPM. Please remove from news section."
364
364
  },
365
365
  "E300": {
366
366
  "title": "Not found on travis. Please setup travis or use github actions (preferred)"
@@ -479,6 +479,9 @@
479
479
  "E519": {
480
480
  "title": "`${context.packageJson.main}` found in package.json, but not found as file"
481
481
  },
482
+ "E520": {
483
+ "title": "Plugin `iobroker` missing at .releaseconfig.json. Please add."
484
+ },
482
485
  "E601": {
483
486
  "title": "No README.md found"
484
487
  },
@@ -668,6 +671,9 @@
668
671
  "W515": {
669
672
  "title": "Why you decided to disable i18n support?"
670
673
  },
674
+ "W519": {
675
+ "title": "Consider adding plugin `@alcalzone/release-script-plugin-manual-review`."
676
+ },
671
677
  "W520": {
672
678
  "title": "`gulpfile.js` found in repo but `gulp` not found at devDependencies at package.json. Check whether it can be removed."
673
679
  },
package/index.js CHANGED
@@ -187,7 +187,7 @@ function getDependencies(deps) {
187
187
  return the greater of two semver versions
188
188
  */
189
189
  function maxVersion (v1, v1){
190
- if ( compareVersions.compareversion( v1, v2 ) > 0) return v1; else return v2;
190
+ if ( compareVersions.compareVersions( v1, v2 ) > 0) return v1; else return v2;
191
191
  }
192
192
 
193
193
  /*
@@ -1322,7 +1322,7 @@ function checkIOPackageJson(context) {
1322
1322
  !(context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'html') &&
1323
1323
  !(context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'none')
1324
1324
  ) {
1325
- context.errors.push('[E114] No adapter are allowed in the repo without admin support (set "common.adminUI.config = none" if adapter has no configuration)');
1325
+ context.errors.push('[E114] Admin support not specified. Please add "common.adminUI.config = json|materialize<|html|none"');
1326
1326
  } else {
1327
1327
  context.checks.push('"common.materialize" or valid "common.adminUI.config:xxx" found in io-package.json');
1328
1328
  }
@@ -1375,12 +1375,12 @@ function checkIOPackageJson(context) {
1375
1375
  }
1376
1376
 
1377
1377
  if (!context.ioPackageJson.common.mode) {
1378
- context.errors.push('[E165] Node mode found in package.json');
1378
+ context.errors.push('[E165] "common.mode" not found in io-package.json');
1379
1379
  } else {
1380
1380
  context.checks.push('"common.mode" found in io-package.json');
1381
1381
 
1382
1382
  if (!allowedModes[context.ioPackageJson.common.mode]) {
1383
- context.errors.push(`[E166] "common.mode" ${context.ioPackageJson.common.mode} is unknown in io-package.json.`);
1383
+ context.errors.push(`[E166] "common.mode: ${context.ioPackageJson.common.mode}" is unknown in io-package.json.`);
1384
1384
  } else {
1385
1385
  context.checks.push('"common.mode" has known mode in io-package.json');
1386
1386
 
@@ -1389,7 +1389,7 @@ function checkIOPackageJson(context) {
1389
1389
  }
1390
1390
 
1391
1391
  if (context.ioPackageJson.common.mode === 'schedule' && !context.ioPackageJson.common.schedule) {
1392
- context.errors.push('[E167] schedule adapters must have common.schedule property in io-package.json');
1392
+ context.errors.push('[E167] scheduled adapters must have "common.schedule" property in io-package.json');
1393
1393
  }
1394
1394
  }
1395
1395
  }
@@ -1753,9 +1753,9 @@ function checkNpm(context) {
1753
1753
  }
1754
1754
  if (missingVersions.length) {
1755
1755
  if (missingVersions.length == 1) {
1756
- context.errors.push(`[E204] Version "${missingVersions.join(", ")}" listed at common.news at io-package.json does not exist at NPM. Please remove from news.`);
1756
+ 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.`);
1757
1757
  } else {
1758
- context.errors.push(`[E204] Versions "${missingVersions.join(", ")}" listed at common.news at io-package.json do not exist at NPM. Please remove from news.`);
1758
+ 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.`);
1759
1759
  }
1760
1760
  } else {
1761
1761
  context.checks.push(`All versions listed at news exist at npm`);
@@ -1858,18 +1858,18 @@ function checkRepo(context) {
1858
1858
  context.checks.push('Icon found in latest repository');
1859
1859
 
1860
1860
  if (!context.latestRepo[context.adapterName].icon.startsWith(url)) {
1861
- context.errors.push(`[E405] Icon (latest) must be in the following path: ${url}`);
1861
+ context.errors.push(`[E405] Icon must be in the following path: ${url}; correct sources-dist.json`);
1862
1862
  } else {
1863
1863
  context.checks.push('Icon found in latest repository');
1864
1864
  }
1865
1865
  }
1866
1866
  if (!context.latestRepo[context.adapterName].meta) {
1867
- context.errors.push('[E406] Meta URL (latest) not found in latest repository');
1867
+ context.errors.push('[E406] Meta URL not found in latest repository; correct sources-dist.json');
1868
1868
  } else {
1869
1869
  context.checks.push('Meta URL(latest) found in latest repository');
1870
1870
 
1871
1871
  if (context.latestRepo[context.adapterName].meta !== `${url}io-package.json`) {
1872
- context.errors.push(`[E407] Meta URL (latest) must be equal to ${url}io-package.json`);
1872
+ context.errors.push(`[E407] Meta URL must be equal to ${url}io-package.json; correct sources-dist.json`);
1873
1873
  } else {
1874
1874
  context.checks.push('Meta URL (latest) is OK in latest repository');
1875
1875
  }
@@ -1911,19 +1911,19 @@ function checkRepo(context) {
1911
1911
  context.checks.push('Icon found in stable repository');
1912
1912
 
1913
1913
  if (!context.stableRepo[context.adapterName].icon.startsWith(url)) {
1914
- context.errors.push(`[E426] Icon (stable) must be in the following path: ${url}`);
1914
+ context.errors.push(`[E426] Icon must be in the following path: ${url}; correct sources-dist-stable.json`);
1915
1915
  } else {
1916
1916
  context.checks.push('Icon (stable) found in latest repository');
1917
1917
  }
1918
1918
  }
1919
1919
 
1920
1920
  if (!context.stableRepo[context.adapterName].meta) {
1921
- context.errors.push('[E427] Meta URL (stable) not found in latest repository');
1921
+ context.errors.push('[E427] Meta URL not found in latest repository; correct sources-dist.json');
1922
1922
  } else {
1923
1923
  context.checks.push('Meta URL (stable) found in latest repository');
1924
1924
 
1925
1925
  if (context.stableRepo[context.adapterName].meta !== `${url}io-package.json`) {
1926
- context.errors.push(`[E428] Meta URL (stable) must be equal to ${url}io-package.json`);
1926
+ context.errors.push(`[E428] Meta URL must be equal to ${url}io-package.json; correct sources-dist-stable.json`);
1927
1927
  } else {
1928
1928
  context.checks.push('Meta URL (stable) is OK in latest repository');
1929
1929
  }
@@ -2329,9 +2329,21 @@ function checkCode(context) {
2329
2329
  }
2330
2330
  }
2331
2331
 
2332
- if (context['/iob_npm.done']) {
2333
- context.errors.push('[E503] "iob_npm.done" found in repo! Remove that file');
2334
- }
2332
+ const forbiddenFiles = [
2333
+ 'iob_npm.done',
2334
+ 'iob',
2335
+ 'iobroker'
2336
+ ];
2337
+
2338
+ forbiddenFiles.forEach( file => {
2339
+ if (context.filesList.includes(file)){
2340
+ context.errors.push(`[E503] File "${file}" found in repo! Please remove file.`);
2341
+ }
2342
+ });
2343
+
2344
+ //if (context['/iob_npm.done']) {
2345
+ // context.errors.push('[E503] File "iob_npm.done" found in repo! Remove that file');
2346
+ //}
2335
2347
 
2336
2348
  if (!context.filesList.includes('package-lock.json')) {
2337
2349
  context.warnings.push('[W523] "package-lock.json" not found in repo! Please remove from .gitignore!');
@@ -2354,8 +2366,40 @@ function checkCode(context) {
2354
2366
  }
2355
2367
  }
2356
2368
 
2357
- if (context.packageJson.devDependencies && context.packageJson.devDependencies['@alcalzone/release-script'] && !context['/.releaseconfig.json']) {
2358
- context.errors.push('[E518] "@alcalzone/release-script" is used, but ".releaseconfig.json" not found');
2369
+ if (context.packageJson.devDependencies && context.packageJson.devDependencies['@alcalzone/release-script'] ) {
2370
+ const version = context.packageJson.devDependencies['@alcalzone/release-script'];
2371
+ if ( compareVersions.compareVersions( version, '3.0.0' ) >= 0) {
2372
+ if (!context['/.releaseconfig.json']) {
2373
+ context.errors.push('[E518] "@alcalzone/release-script" (>=3.0.0) is used, but ".releaseconfig.json" not found. Please create.');
2374
+ } else {
2375
+ console.log('context[/.releaseconfig.json: '+ context['/.releaseconfig.json']);
2376
+ const releaseConfigJson = JSON.parse(context['/.releaseconfig.json']);
2377
+ console.log(`releaseConfigJson: ${releaseConfigJson}`);
2378
+ const plugins = releaseConfigJson.plugins;
2379
+ console.log(`plugins: ${plugins}`);
2380
+ if (!context.packageJson.devDependencies['@alcalzone/release-script-plugin-iobroker']) {
2381
+ context.errors.push('[E519] "@alcalzone/release-script" requires plugin "@alcalzone/release-script-plugin-iobroker". Please add.');
2382
+ } else {
2383
+ if (!plugins.includes('iobroker')) {
2384
+ context.errors.push('[E520] Plugin "iobroker" missing at .releaseconfig.json. Please add.');
2385
+ }
2386
+ }
2387
+ if (!context.packageJson.devDependencies['@alcalzone/release-script-plugin-license']) {
2388
+ context.errors.push('[E519] "@alcalzone/release-script" requires plugin "@alcalzone/release-script-plugin-license". Please add.');
2389
+ } else {
2390
+ if (!plugins.includes('license')) {
2391
+ context.errors.push('[E520] Plugin "license" missing at .releaseconfig.json. Please add.');
2392
+ }
2393
+ }
2394
+ if (!context.packageJson.devDependencies['@alcalzone/release-script-plugin-manual-review']) {
2395
+ context.warnings.push('[W519] Consider adding plugin "@alcalzone/release-script-plugin-manual-review".');
2396
+ } else {
2397
+ if (!plugins.includes('manual-review')) {
2398
+ context.warnings.push('[W520] Plugin "manual-review" missing at .releaseconfig.json. Please add.');
2399
+ }
2400
+ }
2401
+ }
2402
+ }
2359
2403
  }
2360
2404
 
2361
2405
  if (context.packageJson.main && context.packageJson.main.endsWith('.js')) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.8.1",
2
+ "version": "2.9.0",
3
3
  "name": "@iobroker/repochecker",
4
4
  "dependencies": {
5
5
  "axios": "^1.7.2",