@iobroker/repochecker 3.5.2 → 3.5.4
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 +7 -0
- package/lib/M100_IOPackageJson.js +49 -26
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -33,6 +33,13 @@ npx @iobroker/repochecker https://github.com/ioBroker/ioBroker.javascript --loca
|
|
|
33
33
|
-->
|
|
34
34
|
|
|
35
35
|
## Changelog
|
|
36
|
+
### 3.5.4 (2025-03-03)
|
|
37
|
+
- (mcm1957) Ignore boolean paramters when checking protectedNative/encryptedNative. [#395]
|
|
38
|
+
|
|
39
|
+
### 3.5.3 (2025-02-21)
|
|
40
|
+
|
|
41
|
+
- (mcm1957) Crash has been fixed if protectedNative/encryptedNative is not an array. [#385]
|
|
42
|
+
|
|
36
43
|
### 3.5.2 (2025-02-19)
|
|
37
44
|
|
|
38
45
|
- (mcm1957) Incorrect admin suggestion for very olf html adapters corrected. [#383]
|
|
@@ -127,8 +127,13 @@ async function checkIOPackageJson(context) {
|
|
|
127
127
|
const regex = new RegExp(suspiciousPhrases.join('|'), 'i');
|
|
128
128
|
const nativeKeys = Object.keys(context.ioPackageJson.native) || [];
|
|
129
129
|
|
|
130
|
-
|
|
131
|
-
common.debug(`Suspicious key test: native: ${nativeKeys}
|
|
130
|
+
let suspiciousKeys = nativeKeys.filter(key => regex.test(key.toLowerCase()));
|
|
131
|
+
common.debug(`Suspicious key test: native: ${nativeKeys}`);
|
|
132
|
+
common.debug(`Suspicious key test: suspiciousKeys (unfiltered): ${suspiciousKeys}`);
|
|
133
|
+
if (suspiciousKeys.length) {
|
|
134
|
+
suspiciousKeys = suspiciousKeys.filter(key => typeof context.ioPackageJson.native[key] !== 'boolean');
|
|
135
|
+
common.debug(`Suspicious key test: suspiciousKeys (filtered): ${suspiciousKeys}`);
|
|
136
|
+
}
|
|
132
137
|
if (suspiciousKeys.length) {
|
|
133
138
|
if (context.ioPackageJson.protectedNative) {
|
|
134
139
|
const missingProtected = suspiciousKeys.filter(
|
|
@@ -163,34 +168,48 @@ async function checkIOPackageJson(context) {
|
|
|
163
168
|
}
|
|
164
169
|
}
|
|
165
170
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
+
let valid = true;
|
|
172
|
+
if (context.ioPackageJson.encryptedNative && !Array.isArray(context.ioPackageJson.encryptedNative)) {
|
|
173
|
+
context.errors.push(`[E198] "encryptedNative" must be an array at io-package.json`);
|
|
174
|
+
valid = false;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
if (context.ioPackageJson.protectedNative && !Array.isArray(context.ioPackageJson.protectedNative)) {
|
|
178
|
+
context.errors.push(`[E199] "protectedNative" must be an array at io-package.json`);
|
|
179
|
+
valid = false;
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
if (valid) {
|
|
183
|
+
for (const key of context.ioPackageJson.encryptedNative || []) {
|
|
184
|
+
if (!(context.ioPackageJson.protectedNative && context.ioPackageJson.protectedNative.includes(key))) {
|
|
185
|
+
context.warnings.push(
|
|
186
|
+
`[W193] Encrypted native "${key}" should be listed at "protectedNative" in io-package.json`,
|
|
187
|
+
);
|
|
188
|
+
}
|
|
171
189
|
}
|
|
172
|
-
}
|
|
173
190
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
context.
|
|
177
|
-
|
|
178
|
-
|
|
191
|
+
for (const key of context.ioPackageJson.protectedNative || []) {
|
|
192
|
+
console.log('juhu2a');
|
|
193
|
+
if (!(context.ioPackageJson.encryptedNative && context.ioPackageJson.encryptedNative.includes(key))) {
|
|
194
|
+
context.warnings.push(
|
|
195
|
+
`[S194] Consider adding protected native "${key}" to "encryptedNative" in io-package.json`,
|
|
196
|
+
);
|
|
197
|
+
}
|
|
179
198
|
}
|
|
180
|
-
}
|
|
181
199
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
200
|
+
for (const key of [
|
|
201
|
+
...new Set([
|
|
202
|
+
...(context.ioPackageJson.protectedNative || []),
|
|
203
|
+
...(context.ioPackageJson.encryptedNative || []),
|
|
204
|
+
]),
|
|
205
|
+
]) {
|
|
206
|
+
if (context.ioPackageJson.native[key] === undefined) {
|
|
207
|
+
context.warnings.push(
|
|
208
|
+
`[W195] Protected or encrypted element "${key}" should be listed at "native" in io-package.json`,
|
|
209
|
+
);
|
|
210
|
+
}
|
|
192
211
|
}
|
|
193
|
-
}
|
|
212
|
+
} // if (valid)
|
|
194
213
|
}
|
|
195
214
|
|
|
196
215
|
if (!context.ioPackageJson.common) {
|
|
@@ -1144,4 +1163,8 @@ exports.checkIOPackageJson = checkIOPackageJson;
|
|
|
1144
1163
|
// [193] Encrypted native "${encrypted}" not listed at "protectedNative" in io-package.json
|
|
1145
1164
|
// [194] Protected native "${protected}" not listed at "encryptedNative" in io-package.json
|
|
1146
1165
|
// [195] Protected or encrypted element "${protected}" not listed as "native" in io-package.json
|
|
1147
|
-
// [196] "common.supportCustoms" requires "common.adminUI.custom" to be defined
|
|
1166
|
+
// [196] "common.supportCustoms" requires "common.adminUI.custom" to be defined
|
|
1167
|
+
// [197] External icon ${context.ioPackageJson.common.extIcon} cannot be parsed
|
|
1168
|
+
// [198] "common.encryptedNative" must be an array at io-package.json
|
|
1169
|
+
// [199] "common.protectedNative" must be an array at io-package.json
|
|
1170
|
+
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.5.
|
|
2
|
+
"version": "3.5.4",
|
|
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
7
|
"@tsconfig/node20": "^20.1.4",
|
|
8
|
-
"@types/node": "^22.13.
|
|
8
|
+
"@types/node": "^22.13.7",
|
|
9
9
|
"@types/semver": "^7.5.8"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|