@iobroker/repochecker 2.8.1 → 2.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 +13 -0
- package/doc/issues.json +7 -1
- package/index.js +66 -22
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -20,6 +20,19 @@ Branch (`master/main/dev`) is optional.
|
|
|
20
20
|
-->
|
|
21
21
|
|
|
22
22
|
## Changelog
|
|
23
|
+
### 2.9.1 (2024-08-12)
|
|
24
|
+
* (mcm1957) E162 - correct dependency check for js-controller. [#267].
|
|
25
|
+
* (mcm1957) E605 - copyright year range including whitespaces is now accepted. [#269].
|
|
26
|
+
* (mcm1957) E016 - missing vaiableexpansion has been added. [#263].
|
|
27
|
+
* (mcm1957) E114 - typo at error message has been fixed [#261].
|
|
28
|
+
|
|
29
|
+
### 2.9.0 (2024-07-29)
|
|
30
|
+
* (mcm1957) Adapt text if sources-dist(-stable).json need a correction [#97].
|
|
31
|
+
* (mcm1957) Missing "common.mode" error text corrected [#249].
|
|
32
|
+
* (mcm1957) Files "iob" and "iobroker" are disallowed now [#248].
|
|
33
|
+
* (mcm1957) Checks related to @alcalzone/releasescript modified [#71].
|
|
34
|
+
* (mcm1957) Text of E114 (missing adminUI) adapted.
|
|
35
|
+
|
|
23
36
|
### 2.8.1 (2024-07-28)
|
|
24
37
|
* (mcm1957) Check of js-controller version has been corrected [#247].
|
|
25
38
|
* (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.
|
|
190
|
+
if ( compareVersions.compareVersions( v1, v2 ) > 0) return v1; else return v2;
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
/*
|
|
@@ -416,7 +416,7 @@ function checkPackageJson(context) {
|
|
|
416
416
|
|
|
417
417
|
// check if license valid
|
|
418
418
|
if (!licenses.includes(context.packageJson.license)) {
|
|
419
|
-
context.errors.push(
|
|
419
|
+
context.errors.push(`[E016] ${context.packageJson.license} found in package.json is no valid SPDX license. Please use one of listed here: https://spdx.org/licenses/`);
|
|
420
420
|
} else {
|
|
421
421
|
context.checks.push('"license" is valid in package.json');
|
|
422
422
|
}
|
|
@@ -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]
|
|
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]
|
|
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
|
|
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]
|
|
1392
|
+
context.errors.push('[E167] scheduled adapters must have "common.schedule" property in io-package.json');
|
|
1393
1393
|
}
|
|
1394
1394
|
}
|
|
1395
1395
|
}
|
|
@@ -1566,7 +1566,7 @@ function checkIOPackageJson(context) {
|
|
|
1566
1566
|
}
|
|
1567
1567
|
|
|
1568
1568
|
|
|
1569
|
-
if ( currentJsControllerVersion && compareVersions.compare( requiredJsControllerVersion, currentJsControllerVersion, '
|
|
1569
|
+
if ( currentJsControllerVersion && compareVersions.compare( requiredJsControllerVersion, currentJsControllerVersion, '>' )) {
|
|
1570
1570
|
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.`);
|
|
1571
1571
|
} else if ( currentJsControllerVersion && compareVersions.compare( recommendedJsControllerVersion, currentJsControllerVersion, '>' )) {
|
|
1572
1572
|
context.warnings.push(`[W162] js-controller ${currentJsControllerVersion} listed as dependency but ${recommendedJsControllerVersion} is recommended. Please consider updating dependency at io-package.json.`);
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
2333
|
-
|
|
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']
|
|
2358
|
-
context.
|
|
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')) {
|
|
@@ -2459,7 +2503,7 @@ function checkReadme(context) {
|
|
|
2459
2503
|
const year = new Date().getFullYear();
|
|
2460
2504
|
const commitYear = context.lastCommitYear || 0;
|
|
2461
2505
|
let readmeYear = 0;
|
|
2462
|
-
let m = text.match(/\d\d\d\d
|
|
2506
|
+
let m = text.match(/\d\d\d\d\s*-\s*(\d\d\d\d)/);
|
|
2463
2507
|
if (m) {
|
|
2464
2508
|
readmeYear = Number(m[1]);
|
|
2465
2509
|
}
|
|
@@ -2530,7 +2574,7 @@ function checkLicenseFile(context) {
|
|
|
2530
2574
|
const year = new Date().getFullYear();
|
|
2531
2575
|
const commitYear = context.lastCommitYear || 0;
|
|
2532
2576
|
let licenseYear = 0;
|
|
2533
|
-
let m = text.match(/\d\d\d\d
|
|
2577
|
+
let m = text.match(/\d\d\d\d\s*-\s*(\d\d\d\d)/);
|
|
2534
2578
|
if (m) {
|
|
2535
2579
|
licenseYear = Number(m[1]);
|
|
2536
2580
|
}
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.
|
|
2
|
+
"version": "2.9.1",
|
|
3
3
|
"name": "@iobroker/repochecker",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"axios": "^1.7.2",
|
|
6
|
-
"compare-versions": "^6.1.
|
|
6
|
+
"compare-versions": "^6.1.1",
|
|
7
7
|
"image-size": "^1.1.1",
|
|
8
|
-
"unzipper": "^0.12.
|
|
8
|
+
"unzipper": "^0.12.3",
|
|
9
9
|
"json5": "^2.2.3"
|
|
10
10
|
},
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@alcalzone/release-script": "^3.
|
|
15
|
+
"@alcalzone/release-script": "^3.8.0",
|
|
16
16
|
"eslint": "^8.57.0"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|