@iobroker/repochecker 4.3.0-alpha.0 → 5.0.0-alpha.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 +14 -1
- package/doc/issues.json +0 -6
- package/index.js +37 -37
- package/lib/{M000_PackageJson.js → M0000_PackageJson.js} +184 -162
- package/lib/{M100_IOPackageJson.js → M1000_IOPackageJson.js} +246 -242
- package/lib/{M250_Npm.js → M2000_Npm.js} +36 -20
- package/lib/{M300_Testing.js → M3000_Testing.js} +8 -8
- package/lib/{M400_Repository.js → M4000_Repository.js} +117 -110
- package/lib/{M500_Code.js → M5000_Code.js} +89 -85
- package/lib/{M500__JsonConfig.js → M5500__JsonConfig.js} +30 -30
- package/lib/{M600_Readme.js → M6000_Readme.js} +28 -21
- package/lib/{M700_License.js → M7000_License.js} +12 -12
- package/lib/{M800_Github.js → M8000_Github.js} +12 -12
- package/lib/{M900_GitNpmIgnore.js → M9000_GitNpmIgnore.js} +25 -25
- package/lib/common.js +9 -1
- package/package.json +1 -1
|
@@ -3,13 +3,15 @@
|
|
|
3
3
|
This module is a support module for iobroker.repochecker
|
|
4
4
|
|
|
5
5
|
Area checked: NPM
|
|
6
|
-
Numbering :
|
|
6
|
+
Numbering : 2000 - 2999
|
|
7
7
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
const axios = require('axios');
|
|
11
11
|
const compareVersions = require('compare-versions');
|
|
12
12
|
|
|
13
|
+
const common = require('./common.js');
|
|
14
|
+
|
|
13
15
|
// disable axios caching
|
|
14
16
|
axios.defaults.headers = {
|
|
15
17
|
'Cache-Control': 'no-cache',
|
|
@@ -20,7 +22,7 @@ axios.defaults.headers = {
|
|
|
20
22
|
// const common = require('./common.js');
|
|
21
23
|
|
|
22
24
|
async function checkNpm(context) {
|
|
23
|
-
console.log('\n[
|
|
25
|
+
console.log('\n[E2000 - E2999] checkNpm');
|
|
24
26
|
let body;
|
|
25
27
|
try {
|
|
26
28
|
const response = await axios(`https://registry.npmjs.org/iobroker.${context.adapterName}`);
|
|
@@ -33,7 +35,9 @@ async function checkNpm(context) {
|
|
|
33
35
|
try {
|
|
34
36
|
const _response = await axios(`https://www.npmjs.com/package/iobroker.${context.adapterName}`);
|
|
35
37
|
if (!_response.data) {
|
|
36
|
-
context.errors.push(
|
|
38
|
+
context.errors.push(
|
|
39
|
+
`[E2000] Package iobroker.${context.adapterName} found on npm. Please publish at npm`,
|
|
40
|
+
);
|
|
37
41
|
return context;
|
|
38
42
|
}
|
|
39
43
|
body = _response.data;
|
|
@@ -41,13 +45,13 @@ async function checkNpm(context) {
|
|
|
41
45
|
context.checks.push('Adapter found on npm');
|
|
42
46
|
if (!body.includes('href="/~bluefox"') && body.includes('href="/~iobluefox"')) {
|
|
43
47
|
context.errors.push(
|
|
44
|
-
`[
|
|
48
|
+
`[E2001] Bluefox was not found in the collaborators on NPM!. Please execute in adapter directory: "npm owner add bluefox iobroker.${context.adapterName}"`,
|
|
45
49
|
);
|
|
46
50
|
} else {
|
|
47
51
|
context.checks.push('Bluefox found in collaborators on NPM');
|
|
48
52
|
}
|
|
49
53
|
} catch {
|
|
50
|
-
context.errors.push('[
|
|
54
|
+
context.errors.push('[E2000] Not found on npm. Please publish');
|
|
51
55
|
return context;
|
|
52
56
|
}
|
|
53
57
|
} else {
|
|
@@ -58,7 +62,7 @@ async function checkNpm(context) {
|
|
|
58
62
|
!body.maintainers.find(user => user.name === 'bluefox' || user.name === 'iobluefox')
|
|
59
63
|
) {
|
|
60
64
|
context.errors.push(
|
|
61
|
-
`[
|
|
65
|
+
`[E2001] Bluefox was not found in the collaborators on NPM!. Please execute in adapter directory: "npm owner add bluefox iobroker.${context.adapterName}"`,
|
|
62
66
|
);
|
|
63
67
|
} else {
|
|
64
68
|
context.checks.push('Bluefox found in collaborators on NPM');
|
|
@@ -67,16 +71,28 @@ async function checkNpm(context) {
|
|
|
67
71
|
if (!body['dist-tags'] || context.packageJson.version !== body['dist-tags'].latest) {
|
|
68
72
|
if (compareVersions.compare(body['dist-tags'].latest, context.packageJson.version, '>=')) {
|
|
69
73
|
context.errors.push(
|
|
70
|
-
`[
|
|
74
|
+
`[E2003] Version of package.json (${context.packageJson.version}) lower than latest version on NPM (${(body['dist-tags'] && body['dist-tags'].latest) || JSON.stringify(body)})`,
|
|
71
75
|
);
|
|
72
76
|
} else {
|
|
73
|
-
context.
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
if (!common.isAlphaVersion(context.packageJson.version)) {
|
|
78
|
+
context.warnings.push(
|
|
79
|
+
`[W2002] Version of package.json (${context.packageJson.version}) doesn't match latest version on NPM (${(body['dist-tags'] && body['dist-tags'].latest) || JSON.stringify(body)})`,
|
|
80
|
+
);
|
|
81
|
+
} else {
|
|
82
|
+
context.checks.push(`Alpha version ${context.packageJson.version} not checked`);
|
|
83
|
+
}
|
|
76
84
|
}
|
|
77
85
|
} else {
|
|
78
86
|
context.checks.push(`Version of package.json ${context.packageJson.version} matches latest version on NPM`);
|
|
79
87
|
}
|
|
88
|
+
|
|
89
|
+
if (body['dist-tags'] && body['dist-tags'].latest) {
|
|
90
|
+
if (!context.ioPackageJson.common.news[body['dist-tags'].latest]) {
|
|
91
|
+
context.errors.push(
|
|
92
|
+
`[E2005] No "common.news" in io-package.json found for version ${body['dist-tags'].latest} marked as "latest" at npm`,
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
80
96
|
}
|
|
81
97
|
|
|
82
98
|
if (context.ioPackageJson && context.ioPackageJson.common && context.ioPackageJson.common.news) {
|
|
@@ -90,11 +106,11 @@ async function checkNpm(context) {
|
|
|
90
106
|
if (missingVersions.length) {
|
|
91
107
|
if (missingVersions.length === 1) {
|
|
92
108
|
context.errors.push(
|
|
93
|
-
`[
|
|
109
|
+
`[E2004] Version "${missingVersions.join(', ')}" listed at common.news at io-package.json does not exist at NPM. Please remove from news section.`,
|
|
94
110
|
);
|
|
95
111
|
} else {
|
|
96
112
|
context.errors.push(
|
|
97
|
-
`[
|
|
113
|
+
`[E2004] Versions "${missingVersions.join(', ')}" listed at common.news at io-package.json do not exist at NPM. Please remove from news section.`,
|
|
98
114
|
);
|
|
99
115
|
}
|
|
100
116
|
} else {
|
|
@@ -113,11 +129,11 @@ exports.checkNpm = checkNpm;
|
|
|
113
129
|
// List of error and warnings used at this module
|
|
114
130
|
// ----------------------------------------------
|
|
115
131
|
|
|
116
|
-
// [
|
|
117
|
-
// [
|
|
118
|
-
// [
|
|
119
|
-
// [
|
|
120
|
-
// [
|
|
121
|
-
// [
|
|
122
|
-
// [
|
|
123
|
-
// [
|
|
132
|
+
// [2000] Not found on npm. Please publish
|
|
133
|
+
// [2000] Not found on npm. Please publish
|
|
134
|
+
// [2001] Bluefox was not found in the collaborators on NPM!. Please execute in adapter directory: "npm owner add bluefox iobroker.${context.adapterName}"
|
|
135
|
+
// [2001] Bluefox was not found in the collaborators on NPM!. Please execute in adapter directory: "npm owner add bluefox iobroker.${context.adapterName}"
|
|
136
|
+
// [2002] Version of package.json (${context.packageJson.version}) doesn't match latest version on NPM (${
|
|
137
|
+
// [2003] Version of package.json (${context.packageJson.version}) lower than latest version on NPM (${
|
|
138
|
+
// [2004] Version "${missingVersions.join(', ')}" listed at common.news at io-package.json does not exist at NPM. Please remove from news section.
|
|
139
|
+
// [2004] Versions "${missingVersions.join(', ')}" listed at common.news at io-package.json do not exist at NPM. Please remove from news section.
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
This module is a support module for iobroker.repochecker
|
|
4
4
|
|
|
5
5
|
Area checked: Testing
|
|
6
|
-
Numbering :
|
|
6
|
+
Numbering : 3000 - 3099
|
|
7
7
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
// const common = require('./common.js');
|
|
11
11
|
|
|
12
12
|
async function checkTests(context) {
|
|
13
|
-
console.log('\n[
|
|
13
|
+
console.log('\n[E3000 - E3999] checking tests');
|
|
14
14
|
// if found some file in `\.github\workflows` with the test inside => it is OK too
|
|
15
15
|
if (
|
|
16
16
|
context &&
|
|
@@ -28,31 +28,31 @@ async function checkTests(context) {
|
|
|
28
28
|
// return axios(travisURL)
|
|
29
29
|
// .then(response => {
|
|
30
30
|
// if (!response.data) {
|
|
31
|
-
// context.errors.push('[
|
|
31
|
+
// context.errors.push('[E3000] Not found on travis. Please setup travis or use github actions (preferred)');
|
|
32
32
|
// return context;
|
|
33
33
|
// }
|
|
34
34
|
// if (!response.headers || !response.headers['content-disposition']) {
|
|
35
|
-
// context.errors.push('[
|
|
35
|
+
// context.errors.push('[E3000] Not found on travis. Please setup travis or use github actions (preferred)');
|
|
36
36
|
// return context;
|
|
37
37
|
// }
|
|
38
38
|
// // inline; filename="passing.png"
|
|
39
39
|
// const m = response.headers['content-disposition'].match(/filename="(.+)"$/);
|
|
40
40
|
// if (!m) {
|
|
41
|
-
// context.errors.push('[
|
|
41
|
+
// context.errors.push('[E3000] Not found on travis. Please setup travis or use github actions (preferred)');
|
|
42
42
|
// return context;
|
|
43
43
|
// }
|
|
44
44
|
//
|
|
45
45
|
// if (m[1] === 'unknown.png') {
|
|
46
|
-
// context.errors.push('[
|
|
46
|
+
// context.errors.push('[E3000] Not found on travis. Please setup travis or use github actions (preferred)');
|
|
47
47
|
// return context;
|
|
48
48
|
// }
|
|
49
49
|
//
|
|
50
50
|
// context.checks.push('Found on travis-ci');
|
|
51
51
|
//
|
|
52
|
-
// context.warnings.push('[
|
|
52
|
+
// context.warnings.push('[W3002] Use github actions instead of travis-ci');
|
|
53
53
|
//
|
|
54
54
|
// if (m[1] !== 'passing.png') {
|
|
55
|
-
// context.errors.push('[
|
|
55
|
+
// context.errors.push('[E3001] Tests on Travis-ci.org are broken. Please fix.');
|
|
56
56
|
// } else {
|
|
57
57
|
// context.checks.push('Tests are OK on travis-ci');
|
|
58
58
|
// }
|