@iobroker/repochecker 5.20.14 → 5.21.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/lib/config.js CHANGED
@@ -430,7 +430,7 @@ const schemaUrls = {
430
430
 
431
431
  const testingNodeJs = {
432
432
  // Required minimum action versions
433
- 'ioBroker/testing-action-check': 'v1',
433
+ 'ioBroker/testing-action-check': 'v2',
434
434
  'ioBroker/testing-action-adapter': 'v1',
435
435
  'ioBroker/testing-action-deploy': 'v1',
436
436
 
@@ -444,7 +444,7 @@ const testingNodeJs = {
444
444
  // older versions disallowed by engines clause are removed automatically
445
445
  validMatrixNodeVersions: ['20', '22', '24', '26', '27'], // valid versions to use in testing matrix
446
446
  requiredMatrixNodeVersions: ['20', '22', '24'], // versions that MUST be present in testing matrix
447
- recommendedMatrixNodeVersions: ['20', '22', '24'], // recommended versions that SHOULD be added to testing matrix
447
+ recommendedMatrixNodeVersions: ['22', '24', '26'], // recommended versions that SHOULD be added to testing matrix
448
448
 
449
449
  // Required operating systems for the adapter-tests matrix
450
450
  requiredOsMatrix: ['ubuntu-latest', 'windows-latest', 'macos-latest'],
@@ -523,9 +523,63 @@ async function updateConfig(context) {
523
523
  context.filesList = filesList;
524
524
  context.cfg.usesJson5 = filesList.some(file => file.endsWith('.json5') && !file.includes('node_modules'));
525
525
 
526
+ // detect whether the adapter uses a react based UI
527
+ context.usesReact = await detectReact(context);
528
+
526
529
  return context;
527
530
  }
528
531
 
532
+ // Detect whether the adapter uses a react based UI.
533
+ // React can be declared at the root package.json as well as at any package.json
534
+ // file located within a subdirectory of the repository (e.g. src, src-admin, src-widgets).
535
+ async function detectReact(context) {
536
+ const reactPackages = ['@iobroker/adapter-react-v5', '@iobroker/gui-components', 'react'];
537
+
538
+ // helper to check whether one of the react packages is listed within
539
+ // the dependencies or devDependencies of a package.json object
540
+ const dependsOnReact = packageJson => {
541
+ for (const section of ['dependencies', 'devDependencies']) {
542
+ const deps = packageJson[section];
543
+ if (deps && reactPackages.some(name => deps[name])) {
544
+ return true;
545
+ }
546
+ }
547
+ return false;
548
+ };
549
+
550
+ let usesReact = false;
551
+
552
+ // check the root package.json
553
+ if (context.packageJson && dependsOnReact(context.packageJson)) {
554
+ common.info('REACT detected at package.json');
555
+ usesReact = true;
556
+ }
557
+
558
+ // check all package.json files located within subdirectories of the repository
559
+ // (the root package.json has already been handled above and node_modules is ignored)
560
+ const packageFiles = context.filesList.filter(
561
+ file => file.endsWith('/package.json') && file !== '/package.json' && !file.includes('/node_modules/'),
562
+ );
563
+ for (const fileName of packageFiles) {
564
+ // load the file if it has not been cached yet
565
+ if (context[fileName] === undefined) {
566
+ context[fileName] = await common.getFile(context, fileName);
567
+ }
568
+
569
+ try {
570
+ const packageJson = JSON.parse(context[fileName]);
571
+ if (dependsOnReact(packageJson)) {
572
+ common.info(`REACT detected at ${fileName.slice(1)}`);
573
+ usesReact = true;
574
+ }
575
+ } catch {
576
+ common.warn(`Cannot parse ${fileName.slice(1)} while detecting react usage`);
577
+ }
578
+ }
579
+
580
+ return usesReact;
581
+ }
582
+
529
583
  function logEnvironment(context) {
530
584
  common.info('');
531
585
  common.info('Environment');
@@ -544,6 +598,7 @@ function logEnvironment(context) {
544
598
  common.info(` npmExists: ${context.cfg.npmExists ? 'true' : 'false'}`);
545
599
  common.info(` onlyWWW: ${context.cfg.onlyWWW ? 'true' : 'false'}`);
546
600
  common.info(` usesJson5: ${context.cfg.usesJson5 ? 'true' : 'false'}`);
601
+ common.info(` usesReact: ${context.usesReact ? 'true' : 'false'}`);
547
602
  common.info(` isNewAdapter: ${context.cfg.isNewAdapter ? 'true' : 'false'}`);
548
603
  common.info(` strict: ${common.isStrict() ? 'true' : 'false'}`);
549
604
  common.info(' ');
@@ -33,6 +33,7 @@ const filterByAdapter = {
33
33
  backitup: [
34
34
  '[E5050] process.exit() used in * (lib/restore.js)*',
35
35
  '[E5050] process.exit() used in * (src/lib/restore.ts)*',
36
+ '[W0095] "prepublishOnly" script is not needed in most cases when using the standard ioBroker workflow test-and-release.*',
36
37
  '[W1144] Untranslated "common.news" entries detected*', // reduce disussions ...
37
38
  '[W8905] Repository contains package.json files in non-root directories*', // reduce disussions ...
38
39
  '[S5004] Plain setInterval() found in source files (src/lib/restore/mysql.ts*',
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
- "version": "5.20.14",
2
+ "version": "5.21.1",
3
3
  "name": "@iobroker/repochecker",
4
4
  "dependencies": {
5
5
  "ajv": "^8.20.0",
6
- "axios": "^1.18.1",
6
+ "axios": "^1.20.0",
7
7
  "compare-versions": "^6.1.1",
8
+ "dotenv": "^17.4.2",
8
9
  "image-size": "^1.2.0",
9
- "js-yaml": "^4.3.1",
10
+ "js-yaml": "^5.4.1",
10
11
  "json5": "^2.2.3",
11
12
  "minimatch": "^10.2.6",
12
13
  "semver": "^7.8.5"
@@ -14,9 +15,9 @@
14
15
  "devDependencies": {
15
16
  "@alcalzone/release-script": "^5.2.1",
16
17
  "@iobroker/eslint-config": "^2.3.4",
17
- "@tsconfig/node20": "^20.1.9",
18
- "@types/node": "^26.1.2",
19
- "@types/semver": "^7.7.1"
18
+ "@tsconfig/node20": "^20.1.10",
19
+ "@types/node": "^26.4.1",
20
+ "@types/semver": "^7.8.0"
20
21
  },
21
22
  "repository": {
22
23
  "type": "git",