entkapp 5.5.0 → 5.6.0

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.
Files changed (62) hide show
  1. package/README.md +1 -1
  2. package/bin/cli.js +2 -2
  3. package/bin/cli.mjs +175 -0
  4. package/index.cjs +18 -0
  5. package/index.mjs +51 -0
  6. package/package.json +7 -6
  7. package/src/EngineContext.mjs +428 -0
  8. package/src/Initializer.mjs +82 -0
  9. package/src/analyzers/CodeSmellAnalyzer.mjs +106 -0
  10. package/src/analyzers/OxcAnalyzer.mjs +11 -0
  11. package/src/api/HeadlessAPI.js +31 -16
  12. package/src/api/HeadlessAPI.mjs +369 -0
  13. package/src/api/PluginSDK.mjs +135 -0
  14. package/src/ast/ASTAnalyzer.js +17 -3
  15. package/src/ast/ASTAnalyzer.mjs +742 -0
  16. package/src/ast/AdvancedAnalysis.mjs +586 -0
  17. package/src/ast/BarrelParser.mjs +230 -0
  18. package/src/ast/DeadCodeDetector.js +7 -5
  19. package/src/ast/DeadCodeDetector.mjs +92 -0
  20. package/src/ast/MagicDetector.mjs +203 -0
  21. package/src/ast/OxcAnalyzer.mjs +188 -0
  22. package/src/ast/SecretScanner.mjs +374 -0
  23. package/src/healing/GitSandbox.mjs +82 -0
  24. package/src/healing/SelfHealer.mjs +48 -0
  25. package/src/index.js +37 -1
  26. package/src/index.mjs +1176 -0
  27. package/src/performance/GraphCache.mjs +108 -0
  28. package/src/performance/SupplyChainGuard.mjs +92 -0
  29. package/src/performance/WorkerPool.mjs +132 -0
  30. package/src/performance/WorkerTaskRunner.mjs +144 -0
  31. package/src/plugins/BasePlugin.mjs +240 -0
  32. package/src/plugins/PluginRegistry.mjs +203 -0
  33. package/src/plugins/ecosystems/BackendServices.mjs +197 -0
  34. package/src/plugins/ecosystems/GenericPlugins.mjs +142 -0
  35. package/src/plugins/ecosystems/ModernFrameworks.mjs +162 -0
  36. package/src/plugins/ecosystems/MorePlugins.mjs +562 -0
  37. package/src/plugins/ecosystems/NewPlugins.mjs +526 -0
  38. package/src/plugins/ecosystems/NextJsPlugin.mjs +45 -0
  39. package/src/plugins/ecosystems/PluginLoader.mjs +193 -0
  40. package/src/plugins/ecosystems/TypeScriptPlugin.mjs +56 -0
  41. package/src/plugins/ecosystems/UltimateBundle.mjs +1182 -0
  42. package/src/refractor/ImpactAnalyzer.mjs +92 -0
  43. package/src/refractor/SourceRewriter.mjs +86 -0
  44. package/src/refractor/TransactionManager.mjs +5 -0
  45. package/src/refractor/TypeIntegrity.mjs +4 -0
  46. package/src/resolution/BuildOrchestrator.mjs +46 -0
  47. package/src/resolution/CircularDetector.mjs +91 -0
  48. package/src/resolution/ConfigGenerator.mjs +83 -0
  49. package/src/resolution/ConfigLoader.mjs +94 -0
  50. package/src/resolution/DepencyResolver.mjs +66 -0
  51. package/src/resolution/DependencyFixer.mjs +88 -0
  52. package/src/resolution/DependencyProfiler.mjs +286 -0
  53. package/src/resolution/EntryPointDetector.mjs +134 -0
  54. package/src/resolution/FrameworkConfigParser.mjs +119 -0
  55. package/src/resolution/GraphAnalyzer.mjs +80 -0
  56. package/src/resolution/MigrationAnalyzer.mjs +60 -0
  57. package/src/resolution/PathMapper.mjs +82 -0
  58. package/src/resolution/TSConfigLoader.mjs +162 -0
  59. package/src/resolution/WorkSpaceGraph.mjs +183 -0
  60. package/src/resolution/WorkspaceDiagnostic.mjs +139 -0
  61. package/test.js +76 -0
  62. package/wrangler.toml +6 -0
package/src/index.js CHANGED
@@ -347,7 +347,18 @@ export class RefactoringEngine {
347
347
  }
348
348
  }
349
349
  if (entryCount === 0) {
350
- console.log(ansis.bold.red(' 🚨 ALARM: Keine einzige Datei wurde als Entry Point markiert!'));
350
+ console.log(ansis.bold.yellow(' 🚨 ALARM: Keine einzige Datei wurde als Entry Point markiert! Greife auf Fallbacks zurück...'));
351
+ const fallbackFiles = ['index.js', 'index.mjs', 'src/index.js', 'src/index.mjs', 'main.js', 'src/main.js'];
352
+ for (const fallback of fallbackFiles) {
353
+ const absFallback = path.resolve(this.context.cwd, fallback).replace(/\\/g, '/');
354
+ if (this.context.projectGraph.has(absFallback)) {
355
+ const node = this.context.projectGraph.get(absFallback);
356
+ node.isEntry = true;
357
+ console.log(ansis.green(` • 💎 FALLBACK ENTRY: ${fallback}`));
358
+ entryCount++;
359
+ break;
360
+ }
361
+ }
351
362
  }
352
363
 
353
364
  // Mark workspace packages as used to block false alarms in the manifest auditor
@@ -743,6 +754,31 @@ export class RefactoringEngine {
743
754
  await this.typeIntegrity.synchronizeDeclarationFile(absPath, unusedExport.symbol);
744
755
  }
745
756
  }
757
+
758
+ // --- FIXED: Added dependency removal logic ---
759
+ for (const dep of (analysisSummary.unusedDependencies || [])) {
760
+ try {
761
+ const absPath = path.resolve(this.context.cwd, dep.manifest);
762
+ const pkgContent = await fs.readFile(absPath, 'utf8');
763
+ const pkg = JSON.parse(pkgContent);
764
+
765
+ let removed = false;
766
+ if (pkg.dependencies && pkg.dependencies[dep.package]) {
767
+ delete pkg.dependencies[dep.package];
768
+ removed = true;
769
+ } else if (pkg.devDependencies && pkg.devDependencies[dep.package]) {
770
+ delete pkg.devDependencies[dep.package];
771
+ removed = true;
772
+ }
773
+
774
+ if (removed) {
775
+ console.log(ansis.red(`📦 Removing unused dependency [${dep.package}] from ${dep.manifest}`));
776
+ await this.txManager.stageWrite(absPath, JSON.stringify(pkg, null, 2) + '\n');
777
+ }
778
+ } catch (e) {
779
+ console.error(ansis.red(`❌ Failed to remove dependency ${dep.package}: ${e.message}`));
780
+ }
781
+ }
746
782
  });
747
783
  } else {
748
784
  console.log(ansis.bold.yellow('\n⚠️ Optimization plan aborted by user. No changes applied.'));