@iobroker/repochecker 5.10.0 → 5.10.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 +7 -1
- package/lib/M0000_PackageJson.js +29 -0
- package/lib/M5000_Code.js +10 -0
- package/lib/M9000_GitNpmIgnore.js +29 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,13 @@ Example:
|
|
|
25
25
|
Placeholder for the next version (at the beginning of the line):
|
|
26
26
|
### **WORK IN PROGRESS**
|
|
27
27
|
-->
|
|
28
|
-
### 5.10.
|
|
28
|
+
### 5.10.2 (2026-04-11)
|
|
29
|
+
- (@copilot) Fixed false positive `[E9507]` for i18n directories inside source directories (`src-rules`, `rules-src`, `src-editor`, `src-widgets`, `admin/src`, etc.) by expanding the ignored source directory list and checking the full parent path instead of only the top-level segment. Related to [#828].
|
|
30
|
+
- (@copilot) Added adapter-specific exceptions to E0050 blacklist: `@iobroker/plugin-sentry` is now allowed as a dependency for `ioBroker.javascript`.
|
|
31
|
+
- (@copilot) Added system-provided packages ignore list for W5042: `@iobroker/plugin-sentry` will no longer raise "dependency might be missing" warnings as it is provided by js-controller.
|
|
32
|
+
|
|
33
|
+
### 5.10.1 (2026-04-10)
|
|
34
|
+
- (@copilot) Fixed `TypeError: minimatch is not a function` in `checkNpmIgnore` by correctly destructuring `minimatch` from the `minimatch` v10+ package export.
|
|
29
35
|
- (@copilot) Added `minimatch` as an explicit dependency in `package.json` (used by `M9000_GitNpmIgnore.js` for glob pattern matching).
|
|
30
36
|
- (@copilot) Fixed false positives in `[E9507]` when i18n directories are covered by glob patterns in `package.json` `"files"` field.
|
|
31
37
|
- (@copilot) Added [W4047]: warn when adapter is found in the latest repository but not yet available in the stable repository. Related to [#820].
|
package/lib/M0000_PackageJson.js
CHANGED
|
@@ -131,6 +131,7 @@ const blacklistedAllDependenciesPackageJson = {
|
|
|
131
131
|
'@iobroker/plugin-sentry': {
|
|
132
132
|
msg: "'@iobroker/plugin-sentry' must not be listed as any dependency at package.json as it will crash js-controller 7 systems. Please remove and create new release.",
|
|
133
133
|
err: true,
|
|
134
|
+
exceptions: ['javascript'],
|
|
134
135
|
},
|
|
135
136
|
'@iobroker/repochecker': {
|
|
136
137
|
msg: "'@iobroker/repochecker' must not be listed as any dependency at package.json. Please remove and create new release.",
|
|
@@ -749,6 +750,13 @@ async function checkPackageJson(context) {
|
|
|
749
750
|
continue;
|
|
750
751
|
}
|
|
751
752
|
|
|
753
|
+
if (
|
|
754
|
+
blacklistedDependenciesPackageJson[blacklist].exceptions &&
|
|
755
|
+
blacklistedDependenciesPackageJson[blacklist].exceptions.includes(adapterName)
|
|
756
|
+
) {
|
|
757
|
+
continue;
|
|
758
|
+
}
|
|
759
|
+
|
|
752
760
|
// if (context.packageJson.dependencies[blacklist]) {
|
|
753
761
|
// if (blacklistedDependenciesPackageJson[blacklist].err) {
|
|
754
762
|
// context.errors.push(`[E0050] ${blacklistedDependenciesPackageJson[blacklist].msg}`);
|
|
@@ -795,6 +803,13 @@ async function checkPackageJson(context) {
|
|
|
795
803
|
continue;
|
|
796
804
|
}
|
|
797
805
|
|
|
806
|
+
if (
|
|
807
|
+
blacklistedDevDependenciesPackageJson[blacklist].exceptions &&
|
|
808
|
+
blacklistedDevDependenciesPackageJson[blacklist].exceptions.includes(adapterName)
|
|
809
|
+
) {
|
|
810
|
+
continue;
|
|
811
|
+
}
|
|
812
|
+
|
|
798
813
|
// if (context.packageJson.devDependencies[blacklist]) {
|
|
799
814
|
// if (blacklistedDevDependenciesPackageJson[blacklist].err) {
|
|
800
815
|
// context.errors.push(`[E0050] ${blacklistedDevDependenciesPackageJson[blacklist].msg}`);
|
|
@@ -841,6 +856,13 @@ async function checkPackageJson(context) {
|
|
|
841
856
|
continue;
|
|
842
857
|
}
|
|
843
858
|
|
|
859
|
+
if (
|
|
860
|
+
blacklistedPeerDependenciesPackageJson[blacklist].exceptions &&
|
|
861
|
+
blacklistedPeerDependenciesPackageJson[blacklist].exceptions.includes(adapterName)
|
|
862
|
+
) {
|
|
863
|
+
continue;
|
|
864
|
+
}
|
|
865
|
+
|
|
844
866
|
if (context.packageJson.peerDependencies[blacklist]) {
|
|
845
867
|
if (blacklistedPeerDependenciesPackageJson[blacklist].err) {
|
|
846
868
|
context.errors.push(`[E0050] ${blacklistedPeerDependenciesPackageJson[blacklist].msg}`);
|
|
@@ -866,6 +888,13 @@ async function checkPackageJson(context) {
|
|
|
866
888
|
continue;
|
|
867
889
|
}
|
|
868
890
|
|
|
891
|
+
if (
|
|
892
|
+
blacklistedOptionalDependenciesPackageJson[blacklist].exceptions &&
|
|
893
|
+
blacklistedOptionalDependenciesPackageJson[blacklist].exceptions.includes(adapterName)
|
|
894
|
+
) {
|
|
895
|
+
continue;
|
|
896
|
+
}
|
|
897
|
+
|
|
869
898
|
if (context.packageJson.optionalDependencies[blacklist]) {
|
|
870
899
|
if (blacklistedOptionalDependenciesPackageJson[blacklist].err) {
|
|
871
900
|
context.errors.push(`[E0052] ${blacklistedOptionalDependenciesPackageJson[blacklist].msg}`);
|
package/lib/M5000_Code.js
CHANGED
|
@@ -1274,6 +1274,9 @@ async function checkCode(context) {
|
|
|
1274
1274
|
}
|
|
1275
1275
|
}
|
|
1276
1276
|
|
|
1277
|
+
// Packages known to be provided by the js-controller/system and therefore not required as dependencies
|
|
1278
|
+
const systemProvidedPackages = new Set(['@iobroker/plugin-sentry']);
|
|
1279
|
+
|
|
1277
1280
|
// W5042/S5043: Scan source files for require/import statements and check dependencies
|
|
1278
1281
|
// Exclude files in admin/, build/, doc/, src-admin/, admin-src/, test/ directories
|
|
1279
1282
|
// and *.test.* and *.config.* files
|
|
@@ -1284,9 +1287,11 @@ async function checkCode(context) {
|
|
|
1284
1287
|
'doc',
|
|
1285
1288
|
'src-admin',
|
|
1286
1289
|
'src-editor', // java-script adapter
|
|
1290
|
+
'src-rules',
|
|
1287
1291
|
'src-widgets',
|
|
1288
1292
|
'widgets',
|
|
1289
1293
|
'admin-src',
|
|
1294
|
+
'rules-src',
|
|
1290
1295
|
'test',
|
|
1291
1296
|
'node_modules',
|
|
1292
1297
|
'.git',
|
|
@@ -1385,6 +1390,11 @@ async function checkCode(context) {
|
|
|
1385
1390
|
continue;
|
|
1386
1391
|
}
|
|
1387
1392
|
|
|
1393
|
+
// Skip packages known to be provided by the js-controller/system
|
|
1394
|
+
if (systemProvidedPackages.has(packageName)) {
|
|
1395
|
+
continue;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1388
1398
|
// For @types/* packages, devDependencies is also acceptable
|
|
1389
1399
|
if (packageName.startsWith('@types/') && packageDevDependencies[packageName]) {
|
|
1390
1400
|
continue;
|
|
@@ -15,17 +15,29 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
// const common = require('./common.js');
|
|
18
|
-
const minimatch = require('minimatch');
|
|
19
|
-
|
|
20
|
-
// Source directories whose i18n subdirectories are excluded from npm packaging
|
|
21
|
-
// since their contents are typically compiled/moved to build/ or admin/ during the build
|
|
22
|
-
|
|
18
|
+
const { minimatch } = require('minimatch');
|
|
19
|
+
|
|
20
|
+
// Source directories (or directory paths) whose i18n subdirectories are excluded from npm packaging
|
|
21
|
+
// checks, since their contents are typically compiled/moved to build/ or admin/ during the build
|
|
22
|
+
// process. Entries may be top-level directory names (e.g. 'src') or multi-level paths (e.g.
|
|
23
|
+
// 'admin/src'). An i18n directory is ignored when its parent path equals one of these entries or
|
|
24
|
+
// starts with one of these entries followed by '/'.
|
|
25
|
+
const SRC_DIRS_TO_IGNORE = [
|
|
26
|
+
'src',
|
|
27
|
+
'src-admin',
|
|
28
|
+
'src-editor',
|
|
29
|
+
'src-rules',
|
|
30
|
+
'src-widgets',
|
|
31
|
+
'admin-src',
|
|
32
|
+
'rules-src',
|
|
33
|
+
'admin/src',
|
|
34
|
+
];
|
|
23
35
|
|
|
24
36
|
/**
|
|
25
37
|
* Returns a deduplicated list of i18n directory paths found in the given file list.
|
|
26
38
|
* Example: '/admin/i18n/en/translations.json' → '/admin/i18n'
|
|
27
|
-
* Directories
|
|
28
|
-
* and are not packaged directly.
|
|
39
|
+
* Directories whose parent path matches any entry in SRC_DIRS_TO_IGNORE (exact match or prefix)
|
|
40
|
+
* are excluded because their contents are build sources and are not packaged directly.
|
|
29
41
|
*
|
|
30
42
|
* @param {string[]} filesList list of file paths from the repository (each with a leading slash)
|
|
31
43
|
* @returns {string[]} array of unique i18n directory paths with leading slash
|
|
@@ -35,10 +47,16 @@ function findI18nDirs(filesList) {
|
|
|
35
47
|
for (const file of filesList) {
|
|
36
48
|
const match = file.match(/^(\/(?:[^/]+\/)*i18n)(?:\/|$)/);
|
|
37
49
|
if (match) {
|
|
38
|
-
const i18nDir = match[1]; // e.g. '/admin/i18n'
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
50
|
+
const i18nDir = match[1]; // e.g. '/admin/i18n' or '/src-rules/src/i18n'
|
|
51
|
+
const i18nPath = i18nDir.replace(/^\//, ''); // strip leading slash
|
|
52
|
+
// parentPath is everything before the final '/i18n' segment
|
|
53
|
+
const parts = i18nPath.split('/');
|
|
54
|
+
const parentPath = parts.slice(0, -1).join('/'); // e.g. 'admin', 'src-rules/src', ''
|
|
55
|
+
// Skip i18n dirs that reside inside a known source directory (or sub-path thereof)
|
|
56
|
+
const isInSrcDir = SRC_DIRS_TO_IGNORE.some(
|
|
57
|
+
srcDir => parentPath === srcDir || parentPath.startsWith(`${srcDir}/`),
|
|
58
|
+
);
|
|
59
|
+
if (!isInSrcDir) {
|
|
42
60
|
i18nDirs.add(i18nDir);
|
|
43
61
|
}
|
|
44
62
|
}
|
package/package.json
CHANGED