@iobroker/repochecker 5.6.6 → 5.6.7

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
@@ -25,6 +25,9 @@ Example:
25
25
  Placeholder for the next version (at the beginning of the line):
26
26
  ### **WORK IN PROGRESS**
27
27
  -->
28
+ ### 5.6.7 (2026-04-02)
29
+ - (@copilot) Fixed false positive package detection in `extractImports`: dynamic imports like `import("pkg")` no longer incorrectly trigger the `import ... from ...` pattern, preventing values in log strings (e.g. `from 'force_full'`) from being mistaken for package names.
30
+
28
31
  ### 5.6.6 (2026-03-29)
29
32
  - (mcm1957) Severity for [S3010] has been corrected.
30
33
 
package/lib/M5000_Code.js CHANGED
@@ -215,6 +215,7 @@ function extractImports(content) {
215
215
  const requirePattern = /\brequire\s*\(\s*['"`]([^'"`\n]+)['"`]\s*\)/g;
216
216
  let match;
217
217
  while ((match = requirePattern.exec(code)) !== null) {
218
+ console.debug(` require: found ${match[1]}`);
218
219
  imports.add(match[1]);
219
220
  }
220
221
 
@@ -223,20 +224,25 @@ function extractImports(content) {
223
224
  // 'from' in log messages, strings, or other non-import contexts.
224
225
  // Non-greedy [\s\S]*? always stops at the nearest 'from', so consecutive
225
226
  // import statements are each matched independently.
226
- const fromPattern = /\b(?:import)\b[\s\S]*?\bfrom\s+['"`]([^'"`\n]+)['"`]/g;
227
+ // The negative lookahead (?!\s*\() excludes dynamic imports like import("pkg")
228
+ // which would otherwise span many lines and falsely match 'from' in string literals.
229
+ const fromPattern = /\b(?:import)\b(?!\s*\()[\s\S]*?\bfrom\s+['"`]([^'"`\n]+)['"`]/g;
227
230
  while ((match = fromPattern.exec(code)) !== null) {
231
+ console.debug(` import from: found ${match[1]}`);
228
232
  imports.add(match[1]);
229
233
  }
230
234
 
231
235
  // Side-effect imports: import 'package'
232
236
  const sideEffectImportPattern = /\bimport\s+['"`]([^'"`\n]+)['"`]/g;
233
237
  while ((match = sideEffectImportPattern.exec(code)) !== null) {
238
+ console.debug(` import ...: found ${match[1]}`);
234
239
  imports.add(match[1]);
235
240
  }
236
241
 
237
242
  // dynamic import('...')
238
243
  const dynamicImportPattern = /\bimport\s*\(\s*['"`]([^'"`\n]+)['"`]\s*\)/g;
239
244
  while ((match = dynamicImportPattern.exec(code)) !== null) {
245
+ console.debug(` dyn import: found ${match[1]}`);
240
246
  imports.add(match[1]);
241
247
  }
242
248
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.6.6",
2
+ "version": "5.6.7",
3
3
  "name": "@iobroker/repochecker",
4
4
  "dependencies": {
5
5
  "ajv": "^8.18.0",
@@ -14,7 +14,7 @@
14
14
  "@alcalzone/release-script": "^5.1.1",
15
15
  "@iobroker/eslint-config": "^2.2.0",
16
16
  "@tsconfig/node20": "^20.1.9",
17
- "@types/node": "^24.11.0",
17
+ "@types/node": "^24.12.0",
18
18
  "@types/semver": "^7.7.1"
19
19
  },
20
20
  "repository": {