@iobroker/repochecker 2.1.0 → 2.1.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.
Files changed (3) hide show
  1. package/README.md +3 -0
  2. package/index.js +34 -18
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -20,6 +20,9 @@ Branch (`master/main/dev`) is optional.
20
20
  -->
21
21
 
22
22
  ## Changelog
23
+ ### 2.1.2 (2022-07-14)
24
+ * (bluefox) Fixed some errors
25
+
23
26
  ### 2.1.0 (2022-05-26)
24
27
  * (bluefox) Added support of jsonConfig.json5 and jsonCustom.json5
25
28
 
package/index.js CHANGED
@@ -1184,8 +1184,10 @@ function checkNpm(context) {
1184
1184
  !body.collected ||
1185
1185
  !body.collected.metadata ||
1186
1186
  !body.collected.metadata.version ||
1187
- context.packageJson.version !== body.collected.metadata.version) {
1188
- context.warnings.push(`[W202] Version of package.json (${context.packageJson.version}) doesn't match latest version on NPM (${body.collected.metadata.version})`);
1187
+ context.packageJson.version !== body.collected.metadata.version
1188
+ ) {
1189
+ context.warnings.push(`[W202] Version of package.json (${context.packageJson.version}) doesn't match latest version on NPM (${
1190
+ (body && body.collected && body.collected.metadata && body.collected.metadata.version) || JSON.stringify(body)})`);
1189
1191
  } else {
1190
1192
  context.checks.push('Version of package.json matches latest version on NPM');
1191
1193
  }
@@ -1506,9 +1508,10 @@ function checkCode(context) {
1506
1508
  }
1507
1509
 
1508
1510
  if (context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.config === 'json') {
1511
+ let jsonConfig;
1509
1512
  if (context['/admin/jsonConfig.json'] || context['/admin/jsonConfig.json5']) {
1510
1513
  try {
1511
- context['/admin/jsonConfig.json'] ? JSON.parse(context['/admin/jsonConfig.json']) : JSON5.parse(context['/admin/jsonConfig.json5']);
1514
+ jsonConfig = context['/admin/jsonConfig.json'] ? JSON.parse(context['/admin/jsonConfig.json']) : JSON5.parse(context['/admin/jsonConfig.json5']);
1512
1515
  } catch (e) {
1513
1516
  context.errors.push(`[E507] Cannot parse "admin/jsonConfig.json${context['/admin/jsonConfig.json'] ? '' : '5'}": ${e}`);
1514
1517
  }
@@ -1516,17 +1519,22 @@ function checkCode(context) {
1516
1519
  context.errors.push(`[E508] "admin/jsonConfig.json${context['/admin/jsonConfig.json'] ? '' : '5'}" not found, but admin support is declared`);
1517
1520
  }
1518
1521
 
1519
- allowedLanguages.forEach(lang => {
1520
- if (context[`/admin/i18n/${lang}/translations.json`]) {
1521
- try {
1522
- JSON.parse(context[`/admin/i18n/${lang}/translations.json`]);
1523
- } catch (e) {
1524
- context.errors.push(`[E509] Cannot parse "admin/i18n/${lang}/translations.json": ${e}`);
1522
+ if (jsonConfig && jsonConfig.i18n === true) {
1523
+ allowedLanguages.forEach(lang => {
1524
+ if (context[`/admin/i18n/${lang}/translations.json`]) {
1525
+ try {
1526
+ JSON.parse(context[`/admin/i18n/${lang}/translations.json`]);
1527
+ } catch (e) {
1528
+ context.errors.push(`[E509] Cannot parse "admin/i18n/${lang}/translations.json": ${e}`);
1529
+ }
1530
+ } else {
1531
+ context.errors.push(`[E510] "/admin/i18n/${lang}/translations.json" not found, but admin support is declared`);
1525
1532
  }
1526
- } else {
1527
- context.errors.push(`[E510] "/admin/i18n/${lang}/translations.json" not found, but admin support is declared`);
1528
- }
1529
- });
1533
+ });
1534
+ }
1535
+ if (jsonConfig && jsonConfig.i18n === false) {
1536
+ context.warnings.push(`[W515] Why you decided to disable i18n support?`);
1537
+ }
1530
1538
  }
1531
1539
 
1532
1540
  if (context.ioPackageJson.common.supportCustoms || context.ioPackageJson.common.jsonCustom || (context.ioPackageJson.common.adminUI && context.ioPackageJson.common.adminUI.custom === 'json')) {
@@ -1579,7 +1587,7 @@ function checkCode(context) {
1579
1587
  }
1580
1588
  }
1581
1589
  }
1582
- // max E514
1590
+ // max E515
1583
1591
  resolve(context);
1584
1592
  })
1585
1593
  .catch(e => reject(e));
@@ -1904,9 +1912,17 @@ function check(request, ctx, callback) {
1904
1912
  return callback(null, makeResponse(200, {result: 'OK', checks: context.checks, errors: context.errors, warnings: context.warnings, version, hasTravis: context.hasTravis}));
1905
1913
  })
1906
1914
  .catch(err => {
1907
- console.error(err);
1908
-
1909
- return callback(err, makeResponse(200, {result: 'Errors found', checks: context.checks, errors: context.errors, warnings: context.warnings, version, hasTravis: context.hasTravis}));
1915
+ console.error('GLOBAL ERROR' + err);
1916
+
1917
+ return callback(null, makeResponse(200, {
1918
+ result: 'Errors found',
1919
+ checks: context.checks,
1920
+ errors: context.errors,
1921
+ warnings: context.warnings,
1922
+ version,
1923
+ hasTravis: context.hasTravis,
1924
+ error: `${err.request ? err.request.path : ''} ${err.message}`,
1925
+ }));
1910
1926
  });
1911
1927
  }
1912
1928
  }
@@ -1914,7 +1930,7 @@ function check(request, ctx, callback) {
1914
1930
  if (typeof module !== 'undefined' && module.parent) {
1915
1931
  exports.handler = check;
1916
1932
  } else {
1917
- let repoUrl = 'https://github.com/ioBroker/ioBroker.admin';
1933
+ let repoUrl = 'https://github.com/Dirk-Peter-md/ioBroker.sprinklecontrol';
1918
1934
  let repoBranch = null;
1919
1935
 
1920
1936
  // Get url from parameters if possible
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "2.1.0",
2
+ "version": "2.1.2",
3
3
  "name": "@iobroker/repochecker",
4
4
  "dependencies": {
5
5
  "axios": "^0.27.2",
6
6
  "compare-versions": "^4.1.3",
7
- "image-size": "^1.0.1",
7
+ "image-size": "^1.0.2",
8
8
  "unzipper": "^0.10.11",
9
9
  "json5": "^2.2.1"
10
10
  },