@iobroker/repochecker 2.2.0 → 2.2.2
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 +12 -0
- package/doc/issues.json +36 -0
- package/index.js +175 -52
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,6 +20,18 @@ Branch (`master/main/dev`) is optional.
|
|
|
20
20
|
-->
|
|
21
21
|
|
|
22
22
|
## Changelog
|
|
23
|
+
### 2.2.2 (2024-03-29)
|
|
24
|
+
* (mcm1957) Checking of adapter-core has been fixed
|
|
25
|
+
* (mcm1957) Load all potential interesting files, fixes [#149]
|
|
26
|
+
|
|
27
|
+
### 2.2.1 (2024-03-26)
|
|
28
|
+
* (mcm1957) Added check that own adapter is not listed at common.restartAdapters
|
|
29
|
+
* (mcm1957) Added check of version strings at common.news
|
|
30
|
+
* (mcm1957) Added check for recommended node version (node 18 for now)
|
|
31
|
+
* (mcm1957) Disallow common.mode == subscribe
|
|
32
|
+
* (mcm1957) Deprecate common.wakeup
|
|
33
|
+
* (mcm1957) Added check for adapter-core version (>= 3.0.6)
|
|
34
|
+
|
|
23
35
|
### 2.2.0 (2024-03-24)
|
|
24
36
|
* (klein0r) Added check for licenseInformation
|
|
25
37
|
* (klein0r) Added check for deprecated license
|
package/doc/issues.json
CHANGED
|
@@ -122,6 +122,9 @@
|
|
|
122
122
|
"E025": {
|
|
123
123
|
"title": "Do not include `iobroker.js-controller` as dependency!"
|
|
124
124
|
},
|
|
125
|
+
"E029": {
|
|
126
|
+
"title": "Node.js ${requiredNodeVersion} is required as minimum, node.js ${recommendedNodeVersion} is recommended. Please adapt `{'engines' : { 'node' >= '${match.groups.vers}' } }` at package.json."
|
|
127
|
+
},
|
|
125
128
|
"E100": {
|
|
126
129
|
"title": "Cannot parse io-package.json"
|
|
127
130
|
},
|
|
@@ -293,6 +296,12 @@
|
|
|
293
296
|
"E172": {
|
|
294
297
|
"title": "`common.automaticUpgrade` will be defined by the user. Remove the attribute from io-package.json"
|
|
295
298
|
},
|
|
299
|
+
"E175": {
|
|
300
|
+
"title": "Release `${version}` at `common.news` in io-package.json is malformed."
|
|
301
|
+
},
|
|
302
|
+
"E176": {
|
|
303
|
+
"title": "Own adapter is not allowed to be listed at `common.restartAdapters` in io-pacakge.json"
|
|
304
|
+
},
|
|
296
305
|
"E200": {
|
|
297
306
|
"title": "Not found on npm. Please publish"
|
|
298
307
|
},
|
|
@@ -443,6 +452,15 @@
|
|
|
443
452
|
"E903": {
|
|
444
453
|
"title": "iob_npm.done not found in .gitignore"
|
|
445
454
|
},
|
|
455
|
+
"W026": {
|
|
456
|
+
"title": "`{'engines' : { 'node' >= '${recommendedNodeVersion}' } }` is required at package.json"
|
|
457
|
+
},
|
|
458
|
+
"W027": {
|
|
459
|
+
"title": "{'engines' : { 'node' : '${nodeVal}' } }` is not parseable."
|
|
460
|
+
},
|
|
461
|
+
"W028": {
|
|
462
|
+
"title": "Minimum node.js version ${recommendedNodeVersion} recommended. Please adapt `{'engines' : { 'node' >= '${match.groups.vers}' } }` at package.json."
|
|
463
|
+
},
|
|
446
464
|
"W105": {
|
|
447
465
|
"title": "`common.titleLang` should be translated into all supported languages"
|
|
448
466
|
},
|
|
@@ -476,6 +494,24 @@
|
|
|
476
494
|
"W172": {
|
|
477
495
|
"title": "`common.localLink` in io-package.json is deprecated. Please define object `common.localLinks`: { `_default`: `...` }"
|
|
478
496
|
},
|
|
497
|
+
"W173": {
|
|
498
|
+
"title": "`@iobroker/adapter-core` (${context.packageJson.dependencies['@iobroker/adapter-core']}) should be ${recommendedAdapterCoreVersion} or newer - please update"
|
|
499
|
+
},
|
|
500
|
+
"W174": {
|
|
501
|
+
"title": "`common.wakeup` is deprectaed. Please remove from io-package.json"
|
|
502
|
+
},
|
|
503
|
+
"W177": {
|
|
504
|
+
"title": "`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."
|
|
505
|
+
},
|
|
506
|
+
"W178": {
|
|
507
|
+
"title": "`common.materialize` is deprecated in io-package.json. For admin version >= 5 please use the property `common.adminUI`"
|
|
508
|
+
},
|
|
509
|
+
"W179": {
|
|
510
|
+
"title": "`common.materializeTab` is deprecated in io-package.json. For admin version >= 5 please use the property `common.adminUI`."
|
|
511
|
+
},
|
|
512
|
+
"W180": {
|
|
513
|
+
"title": "`common.noConfig` is deprecated in io-package.json. For admin version >= 5 please use `common.adminUI.config`:`none`."
|
|
514
|
+
},
|
|
479
515
|
"W302": {
|
|
480
516
|
"title": "Use github actions instead of travis-ci"
|
|
481
517
|
},
|
package/index.js
CHANGED
|
@@ -23,7 +23,12 @@ const compareVersions = require('compare-versions');
|
|
|
23
23
|
const issues = require('./doc/issues');
|
|
24
24
|
|
|
25
25
|
const version = require('./package.json').version;
|
|
26
|
+
|
|
27
|
+
// adapt recommended version here
|
|
28
|
+
const recommendedAdapterCoreVersion = '3.0.6';
|
|
26
29
|
const recommendedJsControllerVersion = '5.0.11';
|
|
30
|
+
const recommendedNodeVersion = '18';
|
|
31
|
+
const requiredNodeVersion = '16';
|
|
27
32
|
|
|
28
33
|
const memStore = {};
|
|
29
34
|
|
|
@@ -80,7 +85,7 @@ function checkLanguages(langObj) {
|
|
|
80
85
|
|
|
81
86
|
function getGithubApiData(context) {
|
|
82
87
|
return new Promise((resolve, reject) => {
|
|
83
|
-
axios.get(context.githubUrlApi)
|
|
88
|
+
axios.get(context.githubUrlApi, { cache: false })
|
|
84
89
|
.then(response => {
|
|
85
90
|
context.githubApiData = response.data;
|
|
86
91
|
// console.log(`API Data: ${JSON.stringify(context.githubApiData)}`);
|
|
@@ -103,6 +108,7 @@ function getGithubApiData(context) {
|
|
|
103
108
|
// E0xx
|
|
104
109
|
function checkPackageJson(context) {
|
|
105
110
|
return new Promise((resolve, reject) => {
|
|
111
|
+
console.log('\ncheckPackageJson [E0xx]');
|
|
106
112
|
if (context.packageJson) {
|
|
107
113
|
return resolve(context.packageJson);
|
|
108
114
|
} else {
|
|
@@ -277,7 +283,10 @@ function checkPackageJson(context) {
|
|
|
277
283
|
} else {
|
|
278
284
|
context.checks.push('iobroker.js-controller is not in dependencies');
|
|
279
285
|
}
|
|
280
|
-
|
|
286
|
+
|
|
287
|
+
// SPECIAL NOTE: E026-E029 are used at checkIoPackage.json
|
|
288
|
+
|
|
289
|
+
// max number is E029
|
|
281
290
|
|
|
282
291
|
return context;
|
|
283
292
|
});
|
|
@@ -300,7 +309,6 @@ const allowedLanguages = [
|
|
|
300
309
|
const allowedModes = {
|
|
301
310
|
'none': 'this adapter will not be started',
|
|
302
311
|
'daemon': 'always running process (will be restarted if process exits)',
|
|
303
|
-
'subscribe': 'is started when state system.adapter…alive changes to true. Is killed when .alive changes to false and sets .alive to false if process exits (will not be restarted when process exits)',
|
|
304
312
|
'schedule': 'is started by schedule found in system.adapter…common.schedule - reacts on changes of .schedule by rescheduling with new state',
|
|
305
313
|
'once': 'his adapter will be started every time the system.adapter.. object changed. It will not be restarted after termination.',
|
|
306
314
|
'extension': ''
|
|
@@ -711,7 +719,7 @@ const licenses = [
|
|
|
711
719
|
function checkIOPackageJson(context) {
|
|
712
720
|
context = context || {};
|
|
713
721
|
return new Promise((resolve, reject) => {
|
|
714
|
-
console.log('
|
|
722
|
+
console.log('\ncheckIOPackageJson [E1xx]');
|
|
715
723
|
if (context.ioPackageJson) {
|
|
716
724
|
return resolve(context.ioPackageJson);
|
|
717
725
|
} else {
|
|
@@ -749,9 +757,25 @@ function checkIOPackageJson(context) {
|
|
|
749
757
|
}
|
|
750
758
|
|
|
751
759
|
if (context.ioPackageJson.common.title) {
|
|
752
|
-
context.warnings.push('[W171] "common.title" is deprecated in io-package.json');
|
|
760
|
+
context.warnings.push('[W171] "common.title" is deprecated in io-package.json. Please remove from io-package.json.');
|
|
761
|
+
}
|
|
762
|
+
/*
|
|
763
|
+
if (context.ioPackageJson.common.main) {
|
|
764
|
+
context.warnings.push('[W177] "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.');
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
if (context.ioPackageJson.common.materialize) {
|
|
768
|
+
context.warnings.push('[W178] "common.materialize" is deprecated in io-package.json. For admin version >= 5 please use the property "common.adminUI"');
|
|
753
769
|
}
|
|
754
770
|
|
|
771
|
+
if (context.ioPackageJson.common.materializeTab) {
|
|
772
|
+
context.warnings.push('[W179] "common.materializeTab" is deprecated in io-package.json. For admin version >= 5 please use the property "common.adminUI".');
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
if (context.ioPackageJson.common.noConfig) {
|
|
776
|
+
context.warnings.push('[W180] "common.noConfig" is deprecated in io-package.json. For admin version >= 5 please use "common.adminUI.config":"none".');
|
|
777
|
+
}
|
|
778
|
+
*/
|
|
755
779
|
if (!context.ioPackageJson.common.titleLang) {
|
|
756
780
|
context.errors.push('[E104] No "common.titleLang" found in io-package.json');
|
|
757
781
|
} else {
|
|
@@ -877,7 +901,7 @@ function checkIOPackageJson(context) {
|
|
|
877
901
|
|
|
878
902
|
if (!context.ioPackageJson.common.licenseInformation) {
|
|
879
903
|
if (!context.ioPackageJson.common.license) {
|
|
880
|
-
context.errors.push('[E115]
|
|
904
|
+
context.errors.push('[E115] "common.licenseInformation" not found in io-package.json');
|
|
881
905
|
}
|
|
882
906
|
} else {
|
|
883
907
|
context.checks.push('"common.licenseInformation" found in io-package.json');
|
|
@@ -918,7 +942,7 @@ function checkIOPackageJson(context) {
|
|
|
918
942
|
context.checks.push('"common.mode" found in io-package.json');
|
|
919
943
|
|
|
920
944
|
if (!allowedModes[context.ioPackageJson.common.mode]) {
|
|
921
|
-
context.errors.push(
|
|
945
|
+
context.errors.push(`[E166] "common.mode" ${context.ioPackageJson.common.mode} is unknown in io-package.json.`);
|
|
922
946
|
} else {
|
|
923
947
|
context.checks.push('"common.mode" has known mode in io-package.json');
|
|
924
948
|
|
|
@@ -977,6 +1001,12 @@ function checkIOPackageJson(context) {
|
|
|
977
1001
|
context.errors.push('[E130] Too many "common.news" found in io-package.json. Must be less than 20. Please remove old news.');
|
|
978
1002
|
}
|
|
979
1003
|
|
|
1004
|
+
Object.keys(context.ioPackageJson.common.news).forEach(version => {
|
|
1005
|
+
if (!compareVersions.validateStrict(version)) {
|
|
1006
|
+
context.errors.push(`[E175] Release "${version}" at "common.news" in io-package.json is malformed.`);
|
|
1007
|
+
}
|
|
1008
|
+
});
|
|
1009
|
+
|
|
980
1010
|
if (!context.ioPackageJson.common.news[context.ioPackageJson.common.version]) {
|
|
981
1011
|
context.errors.push(`[E145] No "common.news" found for actual version ${context.ioPackageJson.common.version}`);
|
|
982
1012
|
}
|
|
@@ -1109,6 +1139,17 @@ function checkIOPackageJson(context) {
|
|
|
1109
1139
|
}
|
|
1110
1140
|
}
|
|
1111
1141
|
}
|
|
1142
|
+
|
|
1143
|
+
/*
|
|
1144
|
+
- adapter-core 3.0.0+ requires node 16+ - solved as node 16 is global minimum
|
|
1145
|
+
- adapter-core 3.0.6 is recommended as minimum
|
|
1146
|
+
*/
|
|
1147
|
+
|
|
1148
|
+
if (!compareVersions.compare(context.packageJson.dependencies['@iobroker/adapter-core'], `${recommendedAdapterCoreVersion}`, '>=')) {
|
|
1149
|
+
context.warnings.push(`[W173] "@iobroker/adapter-core" (${context.packageJson.dependencies['@iobroker/adapter-core']}) should be ${recommendedAdapterCoreVersion} or newer - please update`);
|
|
1150
|
+
} else {
|
|
1151
|
+
context.checks.push(`adapter-core ${context.packageJson.dependencies['@iobroker/adapter-core']} matches recommendation`);
|
|
1152
|
+
}
|
|
1112
1153
|
}
|
|
1113
1154
|
|
|
1114
1155
|
if (context.ioPackageJson.common.protectedNative) {
|
|
@@ -1135,16 +1176,85 @@ function checkIOPackageJson(context) {
|
|
|
1135
1176
|
}
|
|
1136
1177
|
}
|
|
1137
1178
|
|
|
1138
|
-
if (!context.ioPackageJson.common.
|
|
1139
|
-
context.
|
|
1140
|
-
|
|
1141
|
-
|
|
1179
|
+
if (!context.ioPackageJson.common.onlyWWW) {
|
|
1180
|
+
if (!context.ioPackageJson.common.tier) {
|
|
1181
|
+
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.`);
|
|
1182
|
+
} else if (![1, 2, 3].includes(context.ioPackageJson.common.tier)) {
|
|
1183
|
+
context.errors.push(`[E155] Invalid common.tier value: ${context.ioPackageJson.common.tier}. Only 1, 2 or 3 are allowed!`);
|
|
1184
|
+
} else {
|
|
1185
|
+
context.checks.push('"common.tier" is valid in io-package.json');
|
|
1186
|
+
}
|
|
1142
1187
|
} else {
|
|
1143
|
-
context.checks.push('"common.tier"
|
|
1188
|
+
context.checks.push('"common.tier" check skipped for wwwOnly adapter.');
|
|
1144
1189
|
}
|
|
1145
1190
|
|
|
1146
1191
|
if (context.ioPackageJson.common.automaticUpgrade) {
|
|
1147
|
-
context.errors.push(`[E172] common.automaticUpgrade will be defined by the user.
|
|
1192
|
+
context.errors.push(`[E172] "common.automaticUpgrade" will be defined by the user. Please remove from io-package.json`);
|
|
1193
|
+
} else {
|
|
1194
|
+
context.checks.push('"common.automaticUpgrade" does not exist in io-package.json');
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
if (context.ioPackageJson.common.wakeup) {
|
|
1198
|
+
context.warnings.push(`[W174] "common.wakeup" is deprectaed. Please remove from io-package.json`);
|
|
1199
|
+
} else {
|
|
1200
|
+
context.checks.push('"common.wakeup" does not exist in io-package.json');
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
/*
|
|
1204
|
+
* The following check is logical related to package.json. It is placed here as the check must be performed only
|
|
1205
|
+
* if wwwOnly attribute is not set at io-package.json. Please note that these errors use error number form package.json range.
|
|
1206
|
+
*
|
|
1207
|
+
*/
|
|
1208
|
+
|
|
1209
|
+
if (!context.ioPackageJson.common.onlyWWW) {
|
|
1210
|
+
if (!context.packageJson.engines) {
|
|
1211
|
+
context.warnings.push(`[W026] "{'engines' : { 'node' >= '${recommendedNodeVersion}' } }" is required at package.json`);
|
|
1212
|
+
} else {
|
|
1213
|
+
if (!context.packageJson.engines.node) {
|
|
1214
|
+
context.warnings.push(`[W026] "{'engines' : { 'node' >= '${recommendedNodeVersion}' } }" is required at package.json`);
|
|
1215
|
+
} else {
|
|
1216
|
+
context.checks.push('engines attribute containing node requirements exist.');
|
|
1217
|
+
// 'engines': { 'node': '>= 18' }
|
|
1218
|
+
// 'engines': { 'node': '>= 18.1.2' }
|
|
1219
|
+
// 'engines': { 'node': '>= 18.1.2 < 19' }
|
|
1220
|
+
const nodeVal = context.packageJson.engines.node;
|
|
1221
|
+
let match = nodeVal.match(/^^(?<cmp>[<>=~]+)?\s*(?<vers>\d+(\.\d+(\.\d+)?)?(\-\w+\.\d+)?)/m);
|
|
1222
|
+
if ( ! match ) {
|
|
1223
|
+
context.warnings.push(`[W027] {'engines' : { 'node' : '${nodeVal}' } }" is not parseable.`);
|
|
1224
|
+
} else {
|
|
1225
|
+
//console.log( `${JSON.stringify(match.groups)}`);
|
|
1226
|
+
if ( match.groups.cmp !== '>' && match.groups.cmp !== '>=' ) {
|
|
1227
|
+
context.warnings.push(`[W026] "{'engines' : { 'node' >= '${recommendedNodeVersion}' } }" is required at package.json`);
|
|
1228
|
+
} else {
|
|
1229
|
+
//console.log( `${match.groups.vers} - ${recommendedNodeVersion}`);
|
|
1230
|
+
if ( ! compareVersions.compare( match.groups.vers, requiredNodeVersion, '>=')) {
|
|
1231
|
+
context.errors.push(`[E029] Node.js ${requiredNodeVersion} is required as minimum, node.js ${recommendedNodeVersion} is recommended. Please adapt "{'engines' : { 'node' >= '${match.groups.vers}' } }" at package.json.`);
|
|
1232
|
+
} else if ( ! compareVersions.compare( match.groups.vers, recommendedNodeVersion, '>=')) {
|
|
1233
|
+
context.warnings.push(`[W028] Minimum node.js version ${recommendedNodeVersion} recommended. Please adapt "{'engines' : { 'node' >= '${match.groups.vers}' } }" at package.json.`);
|
|
1234
|
+
} else {
|
|
1235
|
+
context.checks.push('Correct node.js version requested by "engines" attribute at package.json.');
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
} else {
|
|
1242
|
+
context.checks.push('"engines" check skipped for wwwOnly adapter.');
|
|
1243
|
+
}
|
|
1244
|
+
/* end of foreign check */
|
|
1245
|
+
|
|
1246
|
+
|
|
1247
|
+
if (context.ioPackageJson.common.restartAdapters) {
|
|
1248
|
+
const restartAdaptersArray = context.ioPackageJson.common.restartAdapters;
|
|
1249
|
+
|
|
1250
|
+
// own adapter is not allowed in restart array
|
|
1251
|
+
if (restartAdaptersArray.includes(context.ioPackageJson.common.name)) {
|
|
1252
|
+
context.errors.push(`[E176] Own adapter is not allowed to be listed at "common.restartAdapters" in io-pacakge.json`);
|
|
1253
|
+
} else {
|
|
1254
|
+
context.checks.push('Own adapter not listed at "common.restartAdapters".');
|
|
1255
|
+
}
|
|
1256
|
+
} else {
|
|
1257
|
+
context.checks.push('"restartAdapters" check skipped as object not present.');
|
|
1148
1258
|
}
|
|
1149
1259
|
|
|
1150
1260
|
if (context.ioPackageJson.common.extIcon) {
|
|
@@ -1179,7 +1289,7 @@ function checkIOPackageJson(context) {
|
|
|
1179
1289
|
}
|
|
1180
1290
|
// do not put any code behind this line
|
|
1181
1291
|
|
|
1182
|
-
// max number is
|
|
1292
|
+
// max number is E180
|
|
1183
1293
|
}
|
|
1184
1294
|
});
|
|
1185
1295
|
});
|
|
@@ -1187,7 +1297,7 @@ function checkIOPackageJson(context) {
|
|
|
1187
1297
|
|
|
1188
1298
|
// E2xx
|
|
1189
1299
|
function checkNpm(context) {
|
|
1190
|
-
console.log('
|
|
1300
|
+
console.log('\ncheckNpm [E2xx]');
|
|
1191
1301
|
return axios(`https://registry.npmjs.org/iobroker.${context.adapterName}`)
|
|
1192
1302
|
.catch(() => ({body: null}))
|
|
1193
1303
|
.then(async response => {
|
|
@@ -1240,7 +1350,7 @@ function checkNpm(context) {
|
|
|
1240
1350
|
|
|
1241
1351
|
// E3xx
|
|
1242
1352
|
function checkTests(context) {
|
|
1243
|
-
console.log('
|
|
1353
|
+
console.log('\ncheckTests [E3xx]');
|
|
1244
1354
|
// if found some file in `\.github\workflows` with the test inside => it is OK too
|
|
1245
1355
|
if (context && context.filesList.find(name => name.startsWith('.github/workflows/') && name.endsWith('.yml') && name.toLowerCase().includes('test'))) {
|
|
1246
1356
|
context.checks.push('Tests found on github actions');
|
|
@@ -1288,7 +1398,7 @@ function checkTests(context) {
|
|
|
1288
1398
|
|
|
1289
1399
|
// E4xx
|
|
1290
1400
|
function checkRepo(context) {
|
|
1291
|
-
console.log('
|
|
1401
|
+
console.log('\ncheckRepo [E4xx]');
|
|
1292
1402
|
if (context.ioPackageJson && context.ioPackageJson.common && context.ioPackageJson.common.type) {
|
|
1293
1403
|
// download latest repo
|
|
1294
1404
|
return axios('https://raw.githubusercontent.com/ioBroker/ioBroker.repositories/master/sources-dist.json')
|
|
@@ -1447,40 +1557,54 @@ function checkCode(context) {
|
|
|
1447
1557
|
'.travis.yml',
|
|
1448
1558
|
'gulpfile.js',
|
|
1449
1559
|
'.releaseconfig.json',
|
|
1450
|
-
|
|
1560
|
+
|
|
1561
|
+
// add all potential files anyway. If they exist they must be valid.
|
|
1562
|
+
// if the are nozt needed a warning could be issued
|
|
1563
|
+
'admin/index_m.html',
|
|
1564
|
+
'admin/words.js',
|
|
1565
|
+
'admin/jsonConfig.json',
|
|
1566
|
+
'admin/jsonConfig.json5',
|
|
1567
|
+
'admin/jsonCustom.json',
|
|
1568
|
+
'admin/jsonCustom.json5',
|
|
1569
|
+
'admin/blockly.js',
|
|
1570
|
+
];
|
|
1571
|
+
allowedLanguages.forEach(lang =>
|
|
1572
|
+
readFiles.push(`admin/i18n/${lang}/translations.json`));
|
|
1573
|
+
allowedLanguages.forEach(lang =>
|
|
1574
|
+
readFiles.push(`admin/i18n/${lang}.json`));
|
|
1451
1575
|
|
|
1452
1576
|
if (context.packageJson.main) {
|
|
1453
1577
|
readFiles.push(context.packageJson.main);
|
|
1454
1578
|
}
|
|
1455
1579
|
|
|
1456
|
-
if (!context.ioPackageJson.common.noConfig) {
|
|
1457
|
-
if (context.ioPackageJson.common.materialize || (context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'materialize')) {
|
|
1458
|
-
readFiles.push('admin/index_m.html');
|
|
1459
|
-
readFiles.push('admin/words.js');
|
|
1460
|
-
}
|
|
1461
|
-
|
|
1462
|
-
if (context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'json') {
|
|
1463
|
-
readFiles.push('admin/jsonConfig.json');
|
|
1464
|
-
readFiles.push('admin/jsonConfig.json5');
|
|
1465
|
-
allowedLanguages.forEach(lang =>
|
|
1466
|
-
readFiles.push(`admin/i18n/${lang}/translations.json`));
|
|
1467
|
-
allowedLanguages.forEach(lang =>
|
|
1468
|
-
readFiles.push(`admin/i18n/${lang}.json`));
|
|
1469
|
-
}
|
|
1470
|
-
|
|
1471
|
-
if (context.ioPackageJson.common.supportCustoms || context.ioPackageJson.common.jsonCustom || (context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.custom === 'json')) {
|
|
1472
|
-
readFiles.push('admin/jsonCustom.json');
|
|
1473
|
-
readFiles.push('admin/jsonCustom.json5');
|
|
1474
|
-
}
|
|
1475
|
-
}
|
|
1476
|
-
|
|
1477
|
-
if (context.ioPackageJson.common.blockly) {
|
|
1478
|
-
readFiles.push('admin/blockly.js');
|
|
1479
|
-
}
|
|
1580
|
+
// if (!context.ioPackageJson.common.noConfig) {
|
|
1581
|
+
// if (context.ioPackageJson.common.materialize || (context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'materialize')) {
|
|
1582
|
+
// readFiles.push('admin/index_m.html');
|
|
1583
|
+
// readFiles.push('admin/words.js');
|
|
1584
|
+
// }
|
|
1585
|
+
//
|
|
1586
|
+
// if (context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'json') {
|
|
1587
|
+
// readFiles.push('admin/jsonConfig.json');
|
|
1588
|
+
// readFiles.push('admin/jsonConfig.json5');
|
|
1589
|
+
// allowedLanguages.forEach(lang =>
|
|
1590
|
+
// readFiles.push(`admin/i18n/${lang}/translations.json`));
|
|
1591
|
+
// allowedLanguages.forEach(lang =>
|
|
1592
|
+
// readFiles.push(`admin/i18n/${lang}.json`));
|
|
1593
|
+
// }
|
|
1594
|
+
//
|
|
1595
|
+
// if (context.ioPackageJson.common.supportCustoms || context.ioPackageJson.common.jsonCustom || (context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.custom === 'json')) {
|
|
1596
|
+
// readFiles.push('admin/jsonCustom.json');
|
|
1597
|
+
// readFiles.push('admin/jsonCustom.json5');
|
|
1598
|
+
// }
|
|
1599
|
+
// }
|
|
1600
|
+
//
|
|
1601
|
+
// if (context.ioPackageJson.common.blockly) {
|
|
1602
|
+
// readFiles.push('admin/blockly.js');
|
|
1603
|
+
// }
|
|
1480
1604
|
|
|
1481
1605
|
// https://github.com/userName/ioBroker.adaptername/archive/${context.branch}.zip
|
|
1482
1606
|
return new Promise((resolve, reject) => {
|
|
1483
|
-
console.log('
|
|
1607
|
+
console.log('\ncheckCode [E5xx]');
|
|
1484
1608
|
return downloadFile(context.githubUrlOriginal, `/archive/${context.branch}.zip`, true)
|
|
1485
1609
|
.then(data => {
|
|
1486
1610
|
console.log(`${context.branch}.zip ${data.length} bytes`);
|
|
@@ -1686,7 +1810,7 @@ function checkCommits(context) {
|
|
|
1686
1810
|
// E8xx
|
|
1687
1811
|
function checkGithubRepo(context) {
|
|
1688
1812
|
return new Promise((resolve) => {
|
|
1689
|
-
console.log('
|
|
1813
|
+
console.log('\ncheckGithubRepo [E8xx]');
|
|
1690
1814
|
|
|
1691
1815
|
if (!context.githubApiData.description) {
|
|
1692
1816
|
context.errors.push(`[E801] No repository about text found. Please go to "${context.githubUrlOriginal}", press the settings button beside the about title and add the description.`);
|
|
@@ -1713,7 +1837,7 @@ function checkGithubRepo(context) {
|
|
|
1713
1837
|
function checkReadme(context) {
|
|
1714
1838
|
// https://raw.githubusercontent.com/userName/ioBroker.adaptername/${context.branch}/README.md
|
|
1715
1839
|
return new Promise((resolve, reject) => {
|
|
1716
|
-
console.log('
|
|
1840
|
+
console.log('\ncheckReadme [E6xx]');
|
|
1717
1841
|
downloadFile(context.githubUrl, '/README.md')
|
|
1718
1842
|
.then(data => {
|
|
1719
1843
|
if (!data) {
|
|
@@ -1764,7 +1888,7 @@ function checkReadme(context) {
|
|
|
1764
1888
|
function checkLicenseFile(context) {
|
|
1765
1889
|
// https://raw.githubusercontent.com/userName/ioBroker.adaptername/${context.branch}/LICENSE
|
|
1766
1890
|
return new Promise((resolve, reject) => {
|
|
1767
|
-
console.log('
|
|
1891
|
+
console.log('\ncheckLicenseFile [E7xx]');
|
|
1768
1892
|
downloadFile(context.githubUrl, '/LICENSE')
|
|
1769
1893
|
.then(data => {
|
|
1770
1894
|
if (!data) {
|
|
@@ -1827,7 +1951,7 @@ function checkNpmIgnore(context) {
|
|
|
1827
1951
|
];
|
|
1828
1952
|
|
|
1829
1953
|
// https://raw.githubusercontent.com/userName/ioBroker.adaptername/${context.branch}/.npmignore
|
|
1830
|
-
console.log('checkNpmIgnore [E8xx]');
|
|
1954
|
+
console.log('\checkNpmIgnore [E8xx]');
|
|
1831
1955
|
if (context.packageJson.files && context.packageJson.files.length) {
|
|
1832
1956
|
return Promise.resolve(context);
|
|
1833
1957
|
}
|
|
@@ -1889,7 +2013,7 @@ function checkGitIgnore(context) {
|
|
|
1889
2013
|
];
|
|
1890
2014
|
|
|
1891
2015
|
// https://raw.githubusercontent.com/userName/ioBroker.adaptername/${context.branch}/.gitignore
|
|
1892
|
-
console.log('
|
|
2016
|
+
console.log('\ncheckGitIgnore [E9xx]');
|
|
1893
2017
|
if (!context.filesList.includes('.gitignore')) {
|
|
1894
2018
|
context.warnings.push(`[W901] .gitignore not found`);
|
|
1895
2019
|
} else {
|
|
@@ -2044,7 +2168,7 @@ if (typeof module !== 'undefined' && module.parent) {
|
|
|
2044
2168
|
console.log('\n\n########## SUMMARY ##########');
|
|
2045
2169
|
if (context.errors.length) {
|
|
2046
2170
|
console.log('\n\nErrors:');
|
|
2047
|
-
context.errors.forEach(err => {
|
|
2171
|
+
context.errors.sort().forEach(err => {
|
|
2048
2172
|
const issue = err.substring(1, 5);
|
|
2049
2173
|
console.error(err);
|
|
2050
2174
|
if (issues[issue]) {
|
|
@@ -2068,11 +2192,10 @@ if (typeof module !== 'undefined' && module.parent) {
|
|
|
2068
2192
|
}
|
|
2069
2193
|
if (context.warnings.length) {
|
|
2070
2194
|
console.log('\nWarnings:');
|
|
2071
|
-
context.warnings.forEach(err => {
|
|
2195
|
+
context.warnings.sort().forEach(err => {
|
|
2072
2196
|
const issue = err.substring(1, 5);
|
|
2197
|
+
console.warn(err);
|
|
2073
2198
|
if (issues[issue]) {
|
|
2074
|
-
console.warn(err);
|
|
2075
|
-
|
|
2076
2199
|
//if (issues[issue].title) {
|
|
2077
2200
|
// console.warn(getText(issues[issue].title, 'en'));
|
|
2078
2201
|
//}
|
package/package.json
CHANGED