@iobroker/repochecker 3.3.0 → 3.3.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 +134 -126
- package/lib/M000_PackageJson.js +32 -17
- package/lib/M800_Github.js +1 -1
- package/lib/common.js +42 -2
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -33,271 +33,279 @@ npx @iobroker/repochecker https://github.com/ioBroker/ioBroker.javascript --loca
|
|
|
33
33
|
-->
|
|
34
34
|
|
|
35
35
|
## Changelog
|
|
36
|
+
### 3.3.2 (2025-01-20)
|
|
37
|
+
|
|
38
|
+
- (mcm1957) Avoid crash if some file cannot be downloaded.
|
|
39
|
+
|
|
40
|
+
### 3.3.1 (2025-01-19)
|
|
41
|
+
|
|
42
|
+
- (mcm1957) Report malformed semver specifications has been fixed.
|
|
43
|
+
|
|
36
44
|
### 3.3.0 (2025-01-19)
|
|
37
45
|
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
+
- (mcm1957) "common.singleton" causes a warning now for non-onlyWWW Adapters.
|
|
47
|
+
- (mcm1957) "$schema" has been blacklisted at io-package.json.
|
|
48
|
+
- (mcm1957) Warn if 'common.nondeletable' flag is detected.
|
|
49
|
+
- (mcm1957) Report request as deprecated package.
|
|
50
|
+
- (mcm1957) Report malformed semver specifications.
|
|
51
|
+
- (mcm1957) Check of copyright-year complains about future dates now.
|
|
52
|
+
- (mcm1957) Checking for responsive design issues has been added.
|
|
53
|
+
- (mcm1957) Releaseinfo has been added to "checks" log.
|
|
46
54
|
|
|
47
55
|
### 3.2.4 (2025-01-16)
|
|
48
|
-
-
|
|
56
|
+
- (mcm1957) Suggested release of testing and adapter-core increased.
|
|
49
57
|
|
|
50
58
|
### 3.2.3 (2025-01-11)
|
|
51
59
|
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
60
|
+
- (mcm1957) An error is issued if js-controller dependency is missing.
|
|
61
|
+
- (mcm1957) Required js-controller has been increased to 5.0.19.
|
|
62
|
+
- (mcm1957) Recommended js-controller version is omitted if identical to required one.
|
|
55
63
|
|
|
56
64
|
### 3.2.2 (2024-11-01)
|
|
57
65
|
|
|
58
|
-
-
|
|
59
|
-
-
|
|
66
|
+
- (mcm1957) Link to open issues has been corrected.
|
|
67
|
+
- (mcm1957) Component name added to responsive check issues.
|
|
60
68
|
|
|
61
69
|
### 3.2.1 (2024-11-01)
|
|
62
70
|
|
|
63
|
-
-
|
|
71
|
+
- (mcm1957) Size checking for "divider" and "staticImage" suspended.
|
|
64
72
|
|
|
65
73
|
### 3.2.0 (2024-11-01)
|
|
66
74
|
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
75
|
+
- (oweitman) Script has been extended to use optionally local data for checking.
|
|
76
|
+
- (mcm1957) Warning if i18n is not used has been fixed [#324].
|
|
77
|
+
- (mcm1957) Check for importent issues has been added.
|
|
78
|
+
- (mcm1957) Checking of jsonConfig (initially) added.
|
|
71
79
|
|
|
72
80
|
### 3.1.4 (2024-10-26)
|
|
73
81
|
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
82
|
+
- (mcm1957) linter has been activated and issues reported have been fixed.
|
|
83
|
+
- (mcm1957) Blacklist for package/dependencies has been extended.
|
|
84
|
+
- (mcm1957) Recommend adapter-core 3.2.2 now.
|
|
85
|
+
- (mcm1957) Clearify test for "[E952] .npmignore not found". [#320]
|
|
86
|
+
- (mcm1957) Abort processing if iobroker.live not reachable. [#321]
|
|
79
87
|
|
|
80
88
|
### 3.1.3 (2024-10-11)
|
|
81
89
|
|
|
82
|
-
-
|
|
90
|
+
- (mcm1957) Checker no longer crash id no npm package exists.
|
|
83
91
|
|
|
84
92
|
### 3.1.2 (2024-10-04)
|
|
85
93
|
|
|
86
|
-
-
|
|
94
|
+
- (mcm1957) Require node 18 minimum as engines clause.
|
|
87
95
|
|
|
88
96
|
### 3.1.1 (2024-10-04)
|
|
89
97
|
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
-
|
|
98
|
+
- (mcm1957) "[E166] 'common.mode: extension' is unknown" has been fixed [#308]
|
|
99
|
+
- (mcm1957) "[E904] file iob_npm.done found in repository, but not found in .gitignore" removed as covered by [E503]. [#309]
|
|
100
|
+
- (mcm1957) "[E500] node_modules found" has been retricted to adapetr root. [#297]
|
|
101
|
+
- (mcm1957) Do not check main entry if common.mode none or extension.
|
|
102
|
+
- (mcm1957) Change "[W113] Adapter should support compact mode" text and honor common.compact set to false. [#300]
|
|
95
103
|
|
|
96
104
|
### 3.1.0 (2024-09-29)
|
|
97
105
|
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
-
|
|
106
|
+
- (mcm1957) "@iobroker/plugin-sentry" blacklisted as dependency [#301]
|
|
107
|
+
- (mcm1957) Accept .ts files as main file too. [#303]
|
|
108
|
+
- (mcm1957) [E405] and [E426] incorrect path has been corrected. [#299]
|
|
101
109
|
|
|
102
110
|
### 3.0.7 (2024-09-19)
|
|
103
111
|
|
|
104
|
-
-
|
|
112
|
+
- (mcm1957) "[W523] 'package-lock.json"'not found in repo!" reduced to suggestion. [#298]
|
|
105
113
|
|
|
106
114
|
### 3.0.6 (2024-09-13)
|
|
107
115
|
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
-
|
|
116
|
+
- (mcm1957) "[E124] Main file not found" no longer raised if `common.nogit` is set
|
|
117
|
+
- (mcm1957) 'Text of "common.main" is deprecated' has been adapted. [#266]
|
|
118
|
+
- (mcm1957) Ignore errors caused by complex .gitignor/.npmignore. [#288]
|
|
111
119
|
|
|
112
120
|
### 3.0.5 (2024-09-13)
|
|
113
121
|
|
|
114
|
-
-
|
|
122
|
+
- (mcm1957) '@iobroker/dev-server' is valid as dev-dependency. [#260]
|
|
115
123
|
|
|
116
124
|
### 3.0.4 (2024-09-12)
|
|
117
125
|
|
|
118
|
-
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
123
|
-
-
|
|
124
|
-
-
|
|
126
|
+
- (mcm1957) Abort with incorrect dependency definition fixed [#287]
|
|
127
|
+
- (mcm1957) Improve handling of malformed dependency definitions [#284]
|
|
128
|
+
- (mcm1957) Improve handling of malformed .releaseconfig.json files [#283]
|
|
129
|
+
- (mcm1957) Missing mandatory translations are considered an error now. [#277, #278]
|
|
130
|
+
- (mcm1957) '.npmignore found but "files" is used' is a warning now. [#274]
|
|
131
|
+
- (mcm1957) '@iobroker/dev-server' has been blacklisted as any dependency. [#260]
|
|
132
|
+
- (mcm1957) Do no longer require a js-controller dependency for wwwOnly adapters. [#250]
|
|
125
133
|
|
|
126
134
|
### 3.0.3 (2024-09-12)
|
|
127
135
|
|
|
128
|
-
-
|
|
136
|
+
- (mcm1957) Check for iob_npm.done at `.npmignore` has been removed [#294]
|
|
129
137
|
|
|
130
138
|
### 3.0.2 (2024-09-11)
|
|
131
139
|
|
|
132
|
-
-
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
140
|
+
- (mcm1957) Handling of a missing LICENSE file corrected. [#282]
|
|
141
|
+
- (mcm1957) [W126] Missing mandatory translation is an error now. [#293]
|
|
142
|
+
- (mcm1957) Record repochcker version used for tests.
|
|
143
|
+
- (mcm1957) Record GitHub commit-sha of last commit used for tests.
|
|
136
144
|
|
|
137
145
|
### 3.0.0 (2024-09-10)
|
|
138
146
|
|
|
139
|
-
-
|
|
140
|
-
-
|
|
147
|
+
- (mcm1957) Error and warning numbering has been reviewed and duplicates removed.
|
|
148
|
+
- (mcm1957) index.js has been split into seperated modules.
|
|
141
149
|
|
|
142
150
|
### 2.10.0 (2024-08-19)
|
|
143
151
|
|
|
144
|
-
-
|
|
152
|
+
- (mcm1957) Suggestions ([Sxxx] have been added).
|
|
145
153
|
|
|
146
154
|
### 2.9.1 (2024-08-12)
|
|
147
155
|
|
|
148
|
-
-
|
|
149
|
-
-
|
|
150
|
-
-
|
|
151
|
-
-
|
|
156
|
+
- (mcm1957) E162 - correct dependency check for js-controller. [#267].
|
|
157
|
+
- (mcm1957) E605 - copyright year range including whitespaces is now accepted. [#269].
|
|
158
|
+
- (mcm1957) E016 - missing vaiable expansion has been added. [#263].
|
|
159
|
+
- (mcm1957) E114 - typo at error message has been fixed [#261].
|
|
152
160
|
|
|
153
161
|
### 2.9.0 (2024-07-29)
|
|
154
162
|
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
163
|
+
- (mcm1957) Adapt text if sources-dist(-stable).json need a correction [#97].
|
|
164
|
+
- (mcm1957) Missing "common.mode" error text corrected [#249].
|
|
165
|
+
- (mcm1957) Files "iob" and "iobroker" are disallowed now [#248].
|
|
166
|
+
- (mcm1957) Checks related to @alcalzone/releasescript modified [#71].
|
|
167
|
+
- (mcm1957) Text of E114 (missing adminUI) adapted.
|
|
160
168
|
|
|
161
169
|
### 2.8.1 (2024-07-28)
|
|
162
170
|
|
|
163
|
-
-
|
|
164
|
-
-
|
|
171
|
+
- (mcm1957) Check of js-controller version has been corrected [#247].
|
|
172
|
+
- (mcm1957) Honor '>' at dependency checks too [#246].
|
|
165
173
|
|
|
166
174
|
### 2.8.0 (2024-07-28)
|
|
167
175
|
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
-
|
|
171
|
-
-
|
|
172
|
-
-
|
|
173
|
-
-
|
|
174
|
-
-
|
|
176
|
+
- (mcm1957) Copyright year check has been fixed for single year entries.
|
|
177
|
+
- (mcm1957) js-controller version check added [#233].
|
|
178
|
+
- (mcm1957) Check for fixed version dependencies and for github dependencies [#233].
|
|
179
|
+
- (mcm1957) Missing language files reduced to warning [#203].
|
|
180
|
+
- (mcm1957) Missing .gitignore is considered an error now.
|
|
181
|
+
- (mcm1957) "common.noConfig" no longer reported as error if "common.adminUI" is present [#245].
|
|
182
|
+
- (mcm1957) "common.noConfig" must match "common.adminUI" setting [#170].
|
|
175
183
|
|
|
176
184
|
### 2.7.2 (2024-07-26)
|
|
177
185
|
|
|
178
|
-
-
|
|
186
|
+
- (mcm1957) package-lock.json check fixed.
|
|
179
187
|
|
|
180
188
|
### 2.7.1 (2024-07-26)
|
|
181
189
|
|
|
182
|
-
-
|
|
190
|
+
- (mcm1957) Reduce setTimeout/setInterval error to warning temporary.
|
|
183
191
|
|
|
184
192
|
### 2.7.0 (2024-07-26)
|
|
185
193
|
|
|
186
|
-
-
|
|
187
|
-
-
|
|
188
|
-
-
|
|
189
|
-
-
|
|
190
|
-
-
|
|
191
|
-
-
|
|
192
|
-
-
|
|
193
|
-
-
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
-
-
|
|
194
|
+
- (mcm1957) Some non trivial keywords related to adapter are enforced now [#234].
|
|
195
|
+
- (mcm1957) Severity if [E105] / [W105] has been corrected [#204].
|
|
196
|
+
- (mcm1957) Disallow 'globalDependencies' at package.json [#204].
|
|
197
|
+
- (mcm1957) Several false positives for wwwOnly widgetadapters have been fixed [#230, #222].
|
|
198
|
+
- (mcm1957) Missing .npmignore is now considered an error [#229].
|
|
199
|
+
- (mcm1957) Usage of package.json 'files' section is now recommended.
|
|
200
|
+
- (mcm1957) If more than 7 common.news entries are present a warning is issued now [#232].
|
|
201
|
+
- (mcm1957) Versions listed at common.news are checked to exist at npm now [#226].
|
|
202
|
+
- (mcm1957) 'package-lock.json' is checked to exist at GitHub now [#188].
|
|
203
|
+
- (mcm1957) travis checks have been removed [#237].
|
|
204
|
+
- (mcm1957) Copyright year now honors commit year and npm publish year too [#237].
|
|
197
205
|
|
|
198
206
|
### 2.6.1 (2024-06-24)
|
|
199
207
|
|
|
200
|
-
-
|
|
208
|
+
- (mcm1957) Check "[W156] Adapter should support admin 5 UI (jsonConfig)" checks for reactUi now.
|
|
201
209
|
|
|
202
210
|
### 2.6.0 (2024-06-24)
|
|
203
211
|
|
|
204
|
-
-
|
|
205
|
-
-
|
|
212
|
+
- (mcm1957) Check has been aded to ensure keywords and common.keywords are present. [#200]
|
|
213
|
+
- (mcm1957) Detection of react has been added, gulpfile.js is accepted for react based UIs now. [#223]
|
|
206
214
|
|
|
207
215
|
### 2.5.1 (2024-06-24)
|
|
208
216
|
|
|
209
|
-
-
|
|
210
|
-
-
|
|
217
|
+
- (mcm1957) Suggestion to update dependencies to recommended version added.
|
|
218
|
+
- (mcm1957) Adapter-core recommended set to 3.1.6 [#220]
|
|
211
219
|
|
|
212
220
|
### 2.5.0 (2024-05-30)
|
|
213
221
|
|
|
214
|
-
-
|
|
222
|
+
- (mcm1957) Check to ensure that dependency revisions are available at repository added. [#180]
|
|
215
223
|
|
|
216
224
|
### 2.4.0 (2024-05-30)
|
|
217
225
|
|
|
218
|
-
-
|
|
219
|
-
-
|
|
226
|
+
- (mcm1957) Add check to protect sensitive data. [#195]
|
|
227
|
+
- (mcm1957) Add check to verify that dependencies and globalDepencies are of type array. [#90]
|
|
220
228
|
|
|
221
229
|
### 2.3.1 (2024-05-07)
|
|
222
230
|
|
|
223
|
-
-
|
|
224
|
-
-
|
|
225
|
-
-
|
|
231
|
+
- (mcm1957) Reduce number of missing translation warnings.
|
|
232
|
+
- (mcm1957) Seperate between required and recommended translations.
|
|
233
|
+
- (mcm1957) Log missing translations in detail.
|
|
226
234
|
|
|
227
235
|
### 2.3.0 (2024-05-07)
|
|
228
236
|
|
|
229
|
-
-
|
|
230
|
-
-
|
|
231
|
-
-
|
|
232
|
-
-
|
|
233
|
-
-
|
|
234
|
-
-
|
|
237
|
+
- (mcm1957) Elements marked as deprectaed added to blacklist.
|
|
238
|
+
- (mcm1957) Blacklist added to block elements at package.json and io-package.json.
|
|
239
|
+
- (mcm1957) Error [E000] will be raised now if repository cannot be accessed at all [#194].
|
|
240
|
+
- (mcm1957) Reading of package.json and io-package.json has been moved to head of tests.
|
|
241
|
+
- (mcm1957) Check minimum and recommended node version at package.json (#160)
|
|
242
|
+
- (mcm1957) Raise an error if version at package.json is lower than latest release at npmjs [#192]
|
|
235
243
|
|
|
236
244
|
### 2.2.3 (2024-03-29)
|
|
237
245
|
|
|
238
|
-
-
|
|
246
|
+
- (mcm1957) Checking of license has been improved
|
|
239
247
|
|
|
240
248
|
### 2.2.2 (2024-03-29)
|
|
241
249
|
|
|
242
|
-
-
|
|
243
|
-
-
|
|
250
|
+
- (mcm1957) Checking of adapter-core has been fixed
|
|
251
|
+
- (mcm1957) Load all potential interesting files, fixes [#149]
|
|
244
252
|
|
|
245
253
|
### 2.2.1 (2024-03-26)
|
|
246
254
|
|
|
247
|
-
-
|
|
248
|
-
-
|
|
249
|
-
-
|
|
250
|
-
-
|
|
251
|
-
-
|
|
252
|
-
-
|
|
255
|
+
- (mcm1957) Added check that own adapter is not listed at common.restartAdapters
|
|
256
|
+
- (mcm1957) Added check of version strings at common.news
|
|
257
|
+
- (mcm1957) Added check for recommended node version (node 18 for now)
|
|
258
|
+
- (mcm1957) Disallow common.mode == subscribe
|
|
259
|
+
- (mcm1957) Deprecate common.wakeup
|
|
260
|
+
- (mcm1957) Added check for adapter-core version (>= 3.0.6)
|
|
253
261
|
|
|
254
262
|
### 2.2.0 (2024-03-24)
|
|
255
263
|
|
|
256
|
-
-
|
|
257
|
-
-
|
|
258
|
-
-
|
|
259
|
-
-
|
|
264
|
+
- (klein0r) Added check for licenseInformation
|
|
265
|
+
- (klein0r) Added check for deprecated license
|
|
266
|
+
- (klein0r) Added check for required attribute common.tier
|
|
267
|
+
- (klein0r) Added check for disallowed attribute common.automaticUpgrade
|
|
260
268
|
|
|
261
269
|
### 2.1.13 (2024-01-02)
|
|
262
270
|
|
|
263
|
-
-
|
|
271
|
+
- (bluefox) Corrected rule W156: adminUI.config === 'none' is allowed
|
|
264
272
|
|
|
265
273
|
### 2.1.12 (2023-09-21)
|
|
266
274
|
|
|
267
|
-
-
|
|
275
|
+
- (bluefox) Added check of using '\_' in adapter name
|
|
268
276
|
|
|
269
277
|
### 2.1.11 (2023-09-05)
|
|
270
278
|
|
|
271
|
-
-
|
|
279
|
+
- (bluefox) Added check of iobroker.js-controller in dependencies
|
|
272
280
|
|
|
273
281
|
### 2.1.7 (2023-08-14)
|
|
274
282
|
|
|
275
|
-
-
|
|
276
|
-
-
|
|
283
|
+
- (mcm57) Update index.js - fix typo in error message (packet.json)
|
|
284
|
+
- (mcm57) Update index.js - renumber E504/1 to 519 - fixes #112
|
|
277
285
|
|
|
278
286
|
### 2.1.6 (2022-12-08)
|
|
279
287
|
|
|
280
|
-
-
|
|
288
|
+
- (bluefox) added better error logging
|
|
281
289
|
|
|
282
290
|
### 2.1.5 (2022-12-07)
|
|
283
291
|
|
|
284
|
-
-
|
|
292
|
+
- (bluefox) added check of `.releaseconfig.json` file
|
|
285
293
|
|
|
286
294
|
### 2.1.4 (2022-08-19)
|
|
287
295
|
|
|
288
|
-
-
|
|
296
|
+
- (bluefox) Added check for adapter name: it may not start with '\_'
|
|
289
297
|
|
|
290
298
|
### 2.1.2 (2022-07-14)
|
|
291
299
|
|
|
292
|
-
-
|
|
300
|
+
- (bluefox) Fixed some errors
|
|
293
301
|
|
|
294
302
|
### 2.1.0 (2022-05-26)
|
|
295
303
|
|
|
296
|
-
-
|
|
304
|
+
- (bluefox) Added support for jsonConfig.json5 and jsonCustom.json5
|
|
297
305
|
|
|
298
306
|
### 2.0.5 (2022-05-22)
|
|
299
307
|
|
|
300
|
-
-
|
|
308
|
+
- (bluefox) Made it possible to run with npx
|
|
301
309
|
|
|
302
310
|
## License
|
|
303
311
|
|
package/lib/M000_PackageJson.js
CHANGED
|
@@ -453,20 +453,26 @@ async function checkPackageJson(context) {
|
|
|
453
453
|
'@iobroker/testing',
|
|
454
454
|
];
|
|
455
455
|
for (const dependency in context.packageJson.dependencies) {
|
|
456
|
-
|
|
456
|
+
const dependencyVersion = context.packageJson.dependencies[dependency];
|
|
457
|
+
if (dependencyVersion.toLowerCase().includes('github.com')) {
|
|
458
|
+
context.warnings.push(
|
|
459
|
+
`[W043] dependency should not require a github version. Please change "${dependency}:${dependencyVersion}"`,
|
|
460
|
+
);
|
|
461
|
+
} else if (dependencyVersion === '*') {
|
|
462
|
+
context.warnings.push(
|
|
463
|
+
`[W056] Wildcard dependencies should be avoided "${dependency}":"${dependencyVersion}". Use "~1.2.3" or "^1.2.3" syntax at package.json.`,
|
|
464
|
+
);
|
|
465
|
+
} else if (!common.validateSemver(dependencyVersion)) {
|
|
457
466
|
context.errors.push(
|
|
458
|
-
`[E054] malformed dependency detected "${dependency}"
|
|
467
|
+
`[E054] malformed dependency detected "${dependency}":"${dependencyVersion}". Please fix at package.json.`,
|
|
459
468
|
);
|
|
460
469
|
} else if (
|
|
461
470
|
!context.packageJson.dependencies[dependency].startsWith('^') &&
|
|
462
471
|
!context.packageJson.dependencies[dependency].startsWith('~') &&
|
|
463
|
-
!context.packageJson.dependencies[dependency].startsWith('>')
|
|
472
|
+
!context.packageJson.dependencies[dependency].startsWith('>') &&
|
|
473
|
+
!context.packageJson.dependencies[dependency].startsWith('<')
|
|
464
474
|
) {
|
|
465
|
-
if (
|
|
466
|
-
context.warnings.push(
|
|
467
|
-
`[W043] dependency should not require a github version. Please change "${dependency}:${context.packageJson.dependencies[dependency]}"`,
|
|
468
|
-
);
|
|
469
|
-
} else if (enforcedDependencies.includes(dependency)) {
|
|
475
|
+
if (enforcedDependencies.includes(dependency)) {
|
|
470
476
|
context.errors.push(
|
|
471
477
|
`[E044] dependency must not require a specific version. Use "~1.2.3" or "^1.2.3" syntax. Please update "${dependency}:${context.packageJson.dependencies[dependency]}"`,
|
|
472
478
|
);
|
|
@@ -479,22 +485,28 @@ async function checkPackageJson(context) {
|
|
|
479
485
|
}
|
|
480
486
|
|
|
481
487
|
for (const dependency in context.packageJson.devDependencies) {
|
|
482
|
-
|
|
488
|
+
const dependencyVersion = context.packageJson.devDependencies[dependency];
|
|
489
|
+
if (dependencyVersion.toLowerCase().includes('github.com')) {
|
|
490
|
+
context.warnings.push(
|
|
491
|
+
`[W045] devDependency should not require github versions. Please change "${dependency}":"${dependencyVersion}"`,
|
|
492
|
+
);
|
|
493
|
+
} else if (dependencyVersion === '*') {
|
|
494
|
+
context.warnings.push(
|
|
495
|
+
`[W057] Wildcard devDependencies should be avoided "${dependency}":"${dependencyVersion}". Use "~1.2.3" or "^1.2.3" syntax at package.json.`,
|
|
496
|
+
);
|
|
497
|
+
} else if (!common.validateSemver(dependencyVersion)) {
|
|
483
498
|
context.errors.push(
|
|
484
|
-
`[E055] malformed dependency detected "${dependency}"
|
|
499
|
+
`[E055] malformed dependency detected "${dependency}":"${dependencyVersion}". Please fix at package.json.`,
|
|
485
500
|
);
|
|
486
501
|
} else if (
|
|
487
502
|
!context.packageJson.devDependencies[dependency].startsWith('^') &&
|
|
488
503
|
!context.packageJson.devDependencies[dependency].startsWith('~') &&
|
|
489
|
-
!context.packageJson.devDependencies[dependency].startsWith('>')
|
|
504
|
+
!context.packageJson.devDependencies[dependency].startsWith('>') &&
|
|
505
|
+
!context.packageJson.devDependencies[dependency].startsWith('<')
|
|
490
506
|
) {
|
|
491
|
-
if (
|
|
492
|
-
context.warnings.push(
|
|
493
|
-
`[W045] devDependency should not require github versions. Please change "${dependency}:${context.packageJson.devDependencies[dependency]}"`,
|
|
494
|
-
);
|
|
495
|
-
} else if (enforcedDependencies.includes(dependency)) {
|
|
507
|
+
if (enforcedDependencies.includes(dependency)) {
|
|
496
508
|
context.errors.push(
|
|
497
|
-
`[E046] devDependency must not require a specific version. Use "~1.2.3" or "^1.2.3" syntax. Please update "${dependency}:${
|
|
509
|
+
`[E046] devDependency must not require a specific version. Use "~1.2.3" or "^1.2.3" syntax. Please update "${dependency}:${dependencyVersion}"`,
|
|
498
510
|
);
|
|
499
511
|
} else {
|
|
500
512
|
context.warnings.push(
|
|
@@ -645,3 +657,6 @@ exports.checkPackageJson = checkPackageJson;
|
|
|
645
657
|
// [053] ${blacklistedDevDependenciesPackageJson[blacklist].msg}
|
|
646
658
|
// [054] malformed dependency detected "${dependency}":${context.packageJson.dependencies[dependency]}". Please fix at package.json.`
|
|
647
659
|
// [055] malformed dependency detected "${dependency}":${context.packageJson.devDependencies[dependency]}". Please fix at package.json.`
|
|
660
|
+
// [056] Wildcard dependencies should be avoided "${dependency}":"${dependencyVersion}". Use "~1.2.3" or "^1.2.3" syntax at package.json.`,
|
|
661
|
+
// [057] Wildcard devDependencies should be avoided "${dependency}":"${dependencyVersion}". Use "~1.2.3" or "^1.2.3" syntax at package.json.`,
|
|
662
|
+
|
package/lib/M800_Github.js
CHANGED
package/lib/common.js
CHANGED
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
const axios = require('axios');
|
|
7
7
|
const fs = require('node:fs/promises');
|
|
8
8
|
const compareVersions = require('compare-versions');
|
|
9
|
+
const semverValid = require('semver/functions/valid');
|
|
9
10
|
|
|
10
11
|
// disable axios caching
|
|
11
|
-
axios.defaults.headers = {
|
|
12
|
+
axios.defaults.headers.common = {
|
|
12
13
|
'Cache-Control': 'no-cache',
|
|
13
14
|
Pragma: 'no-cache',
|
|
14
15
|
Expires: '0',
|
|
@@ -51,7 +52,7 @@ async function downloadFile(githubUrl, path, binary, noError) {
|
|
|
51
52
|
return response.data;
|
|
52
53
|
} catch (e) {
|
|
53
54
|
(!noError || gDebug) && console.error(`Cannot download ${githubUrl}${path || ''} ${e}`);
|
|
54
|
-
|
|
55
|
+
return '';
|
|
55
56
|
}
|
|
56
57
|
} else {
|
|
57
58
|
console.log(`Download local ${path || ''}`);
|
|
@@ -61,6 +62,7 @@ async function downloadFile(githubUrl, path, binary, noError) {
|
|
|
61
62
|
return file;
|
|
62
63
|
}
|
|
63
64
|
}
|
|
65
|
+
|
|
64
66
|
function getDependencyArray(deps) {
|
|
65
67
|
return deps
|
|
66
68
|
.map(dep => (typeof dep === 'object' ? Object.keys(dep) : [dep]))
|
|
@@ -116,6 +118,42 @@ function maxVersion(v1, v2) {
|
|
|
116
118
|
return v2;
|
|
117
119
|
}
|
|
118
120
|
|
|
121
|
+
/*
|
|
122
|
+
analyzes a semver string
|
|
123
|
+
*/
|
|
124
|
+
function parseSemver(p_semver) {
|
|
125
|
+
// console.log(`parseSemver(${p_semver})`);
|
|
126
|
+
const ret = {
|
|
127
|
+
valid: false,
|
|
128
|
+
rangeOp: '',
|
|
129
|
+
trimmed: false,
|
|
130
|
+
version: '',
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const semver = p_semver.trim();
|
|
134
|
+
ret.trimmed = semver !== p_semver;
|
|
135
|
+
ret.version = semver;
|
|
136
|
+
ret.uncompressed = false;
|
|
137
|
+
|
|
138
|
+
const m = semver.match(/^(\^|~|>|>=|<|<=)?(\s*)(.*)$/);
|
|
139
|
+
if (m) {
|
|
140
|
+
// console.log(m);
|
|
141
|
+
ret.rangeOp = m[1];
|
|
142
|
+
ret.uncompressed = m[2] !== '';
|
|
143
|
+
ret.version = m[3];
|
|
144
|
+
}
|
|
145
|
+
ret.version = semverValid(ret.version) || '';
|
|
146
|
+
ret.valid = semverValid(ret.version) !== undefined;
|
|
147
|
+
// console.log(JSON.stringify(ret));
|
|
148
|
+
return ret;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function validateSemver(p_semver) {
|
|
152
|
+
//console.log(`validateSemver(${p_semver})`);
|
|
153
|
+
const ret = parseSemver(p_semver);
|
|
154
|
+
return ret.valid && !ret.uncompressed;
|
|
155
|
+
}
|
|
156
|
+
|
|
119
157
|
exports.setDebug = setDebug;
|
|
120
158
|
exports.debug = debug;
|
|
121
159
|
exports.setLocal = setLocal;
|
|
@@ -126,3 +164,5 @@ exports.downloadFile = downloadFile;
|
|
|
126
164
|
exports.getDependencyArray = getDependencyArray;
|
|
127
165
|
exports.getDependencies = getDependencies;
|
|
128
166
|
exports.maxVersion = maxVersion;
|
|
167
|
+
exports.parseSemver = parseSemver;
|
|
168
|
+
exports.validateSemver = validateSemver;
|
package/package.json
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.3.
|
|
2
|
+
"version": "3.3.2",
|
|
3
3
|
"name": "@iobroker/repochecker",
|
|
4
4
|
"devDependencies": {
|
|
5
5
|
"@alcalzone/release-script": "^3.8.0",
|
|
6
6
|
"@iobroker/eslint-config": "^1.0.0",
|
|
7
|
+
"@tsconfig/node20": "^20.1.4",
|
|
7
8
|
"@types/node": "^20.16.5",
|
|
8
|
-
"@
|
|
9
|
+
"@types/semver": "^7.5.8"
|
|
9
10
|
},
|
|
10
11
|
"dependencies": {
|
|
11
12
|
"axios": "^1.7.9",
|
|
12
13
|
"compare-versions": "^6.1.1",
|
|
13
14
|
"image-size": "^1.2.0",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
15
|
+
"json5": "^2.2.3",
|
|
16
|
+
"semver": "^7.6.3",
|
|
17
|
+
"unzipper": "^0.12.3"
|
|
16
18
|
},
|
|
17
19
|
"publishConfig": {
|
|
18
20
|
"access": "public"
|