@iobroker/repochecker 3.0.5 → 3.0.6

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 CHANGED
@@ -20,6 +20,11 @@ Branch (`master/main/dev`) is optional.
20
20
  -->
21
21
 
22
22
  ## Changelog
23
+ ### 3.0.6 (2024-09-13)
24
+ * (mcm1957) "[E124] Main file not found" no longer raised if common.nogit is set
25
+ * (mcm1957) 'Text of "common.main" is deprecated' has been adapted. [#266]
26
+ * (mcm1957) Ignore errors caused by complex .gitignor/.npmignore. [#288]
27
+
23
28
  ### 3.0.5 (2024-09-13)
24
29
  * (mcm1957) '@iobroker/dev-server' is valid as dev-dependency. [#260]
25
30
 
@@ -46,7 +46,7 @@ const blacklistIOPackageJson = {
46
46
  err:false
47
47
  },
48
48
  'common.main': {
49
- msg: '"common.main" is deprecated and ignored. Please remove from io-package.json. Use "main" at package.json instead.',
49
+ msg: '"common.main" is deprecated and ignored. Please remove from io-package.json. Executable is defined by entry "main" at package.json.',
50
50
  err:false
51
51
  },
52
52
  'common.materialize': {
@@ -132,27 +132,27 @@ async function checkIOPackageJson(context) {
132
132
  context.checks.push('"common.name" is valid in io-package.json');
133
133
  }
134
134
 
135
- /*
136
- if (context.ioPackageJson.common.title) {
137
- context.warnings.push('[W158] "common.title" is deprecated in io-package.json. Please remove from io-package.json.');
138
- }
135
+ // /*
136
+ // if (context.ioPackageJson.common.title) {
137
+ // context.warnings.push('[W158] "common.title" is deprecated in io-package.json. Please remove from io-package.json.');
138
+ // }
139
139
 
140
- if (context.ioPackageJson.common.main) {
141
- 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.');
142
- }
140
+ // if (context.ioPackageJson.common.main) {
141
+ // 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.');
142
+ // }
143
143
 
144
- if (context.ioPackageJson.common.materialize) {
145
- context.warnings.push('[W178] "common.materialize" is deprecated in io-package.json. For admin version >= 5 please use the property "common.adminUI"');
146
- }
144
+ // if (context.ioPackageJson.common.materialize) {
145
+ // context.warnings.push('[W178] "common.materialize" is deprecated in io-package.json. For admin version >= 5 please use the property "common.adminUI"');
146
+ // }
147
147
 
148
- if (context.ioPackageJson.common.materializeTab) {
149
- context.warnings.push('[W179] "common.materializeTab" is deprecated in io-package.json. For admin version >= 5 please use the property "common.adminUI".');
150
- }
148
+ // if (context.ioPackageJson.common.materializeTab) {
149
+ // context.warnings.push('[W179] "common.materializeTab" is deprecated in io-package.json. For admin version >= 5 please use the property "common.adminUI".');
150
+ // }
151
151
 
152
- if (context.ioPackageJson.common.noConfig) {
153
- context.warnings.push('[W180] "common.noConfig" is deprecated in io-package.json. For admin version >= 5 please use "common.adminUI.config":"none".');
154
- }
155
- */
152
+ // if (context.ioPackageJson.common.noConfig) {
153
+ // context.warnings.push('[W180] "common.noConfig" is deprecated in io-package.json. For admin version >= 5 please use "common.adminUI.config":"none".');
154
+ // }
155
+ // */
156
156
  if (!context.ioPackageJson.common.titleLang) {
157
157
  context.errors.push('[E104] No "common.titleLang" found in io-package.json');
158
158
  } else {
@@ -637,12 +637,16 @@ async function checkIOPackageJson(context) {
637
637
  context.checks.push(`${context.packageJson.main} could be downloaded`);
638
638
  } catch (e) {
639
639
  common.debug (e);
640
- context.errors.push(`[E124] Main file not found under URL: ${context.githubUrl}/${context.packageJson.main}`);
640
+ if (!context.ioPackageJson.common.nogit) {
641
+ context.errors.push(`[E124] Main file not found under URL: ${context.githubUrl}/${context.packageJson.main}.`);
642
+ } else if (!context.packageJson.main.startsWith('build/')) {
643
+ context.warnings.push(`[W138] Main file not found under URL: ${context.githubUrl}/${context.packageJson.main} and not located at build/ directory too.`);
644
+ }
641
645
  }
642
646
  }
643
647
  }
644
648
 
645
- // single free 138, 139
649
+ // single free 139
646
650
  // first free 187
647
651
 
648
652
  return context;
@@ -692,7 +696,7 @@ exports.checkIOPackageJson = checkIOPackageJson;
692
696
  // [135] "common.tier" is required in io-package.json. Please check https://github.com/ioBroker/ioBroker.docs/blob/master/docs/en/dev/objectsschema.md#adapter.
693
697
  // [136] No "common.news" found for actual version ${context.ioPackageJson.common.version} in io-package.json
694
698
  // [137] "common.automaticUpgrade" will be defined by the user. Please remove from io-package.json
695
- // [138]
699
+ // [138] Main file not found under URL: ${context.githubUrl}/${context.packageJson.main} and not located at build/ directory too.`
696
700
  // [139]
697
701
  // [140] width and height of logo are not equal
698
702
  // [141] logo is too small. It must be greater or equal than 32x32
@@ -11,6 +11,7 @@
11
11
  /*
12
12
  TODO:
13
13
  - something is wrong with undefined 'check' variable
14
+ - conversion of github to regex is wrong with multiple stars
14
15
  */
15
16
 
16
17
  // const common = require('./common.js');
@@ -41,14 +42,19 @@ async function checkGitIgnore(context) {
41
42
  context.errors.push(`[E901] .gitignore not found`);
42
43
  } else {
43
44
  const rules = (context['/.gitignore'] || '').split('\n').map(line => line.trim().replace('\r', '')).filter(line => line);
45
+ let tooComplexToCheck = false;
44
46
  rules.forEach((name, i) => {
45
47
  if (name.includes('*')) {
46
- rules[i] = new RegExp(name
47
- .replace('.', '\\.')
48
- .replace('/', '\\/')
49
- .replace('**', '.*')
50
- .replace('*', '[^\\/]*')
51
- );
48
+ try {
49
+ rules[i] = new RegExp(name
50
+ .replace('.', '\\.')
51
+ .replace('/', '\\/')
52
+ .replace('**', '.*')
53
+ .replace('*', '[^\\/]*')
54
+ );
55
+ } catch (e) {
56
+ tooComplexToCheck = true;
57
+ }
52
58
  }
53
59
  });
54
60
 
@@ -61,20 +67,22 @@ async function checkGitIgnore(context) {
61
67
  }
62
68
  */
63
69
 
64
- checkFiles.forEach(file => {
65
- if (context.filesList.includes(file)) {
66
- // maybe it is with regex
67
- const check = rules.some(rule => {
68
- if (typeof rule === 'string') {
69
- return rule === file || rule === file.replace(/\/$/, '');
70
- } else {
71
- return rule.test(file);
72
- }
73
- });
74
-
75
- !check && context.errors.push(`[E904] file ${file} found in repository, but not found in .gitignore`);
76
- }
77
- });
70
+ if (!tooComplexToCheck) {
71
+ checkFiles.forEach(file => {
72
+ if (context.filesList.includes(file)) {
73
+ // maybe it is with regex
74
+ const check = rules.some(rule => {
75
+ if (typeof rule === 'string') {
76
+ return rule === file || rule === file.replace(/\/$/, '');
77
+ } else {
78
+ return rule.test(file);
79
+ }
80
+ });
81
+
82
+ !check && context.errors.push(`[E904] file ${file} found in repository, but not found in .gitignore`);
83
+ }
84
+ });
85
+ }
78
86
  }
79
87
 
80
88
  return context;
@@ -130,12 +138,16 @@ async function checkNpmIgnore(context) {
130
138
  let tooComplexToCheck = false;
131
139
  rules.forEach((name, i) => {
132
140
  if (name.includes('*')) {
133
- rules[i] = new RegExp(name
134
- .replace('.', '\\.')
135
- .replace('/', '\\/')
136
- .replace('**', '.*')
137
- .replace('*', '[^\\/]*')
138
- );
141
+ try {
142
+ rules[i] = new RegExp(name
143
+ .replace('.', '\\.')
144
+ .replace('/', '\\/')
145
+ .replace('**', '.*')
146
+ .replace('*', '[^\\/]*')
147
+ );
148
+ } catch (e) {
149
+ tooComplexToCheck = true;
150
+ }
139
151
  }
140
152
  if (name.startsWith('!')) {
141
153
  tooComplexToCheck = true;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.0.5",
2
+ "version": "3.0.6",
3
3
  "name": "@iobroker/repochecker",
4
4
  "dependencies": {
5
5
  "axios": "^1.7.7",