Automated Self-Healing β
entkapp v5.4.0 introduces an advanced Self-Healing Engine that goes beyond simple linting. It can automatically fix structural issues in your codebase while ensuring absolute safety through transactional integrity.
π‘οΈ Transactional Safety (GitSandbox) β
Before any modification is made, entkapp ensures your workspace is clean. Every "healing" session follows a strict lifecycle:
- State Capture: entkapp creates a temporary snapshot of your current Git state.
- Impact Analysis: The engine simulates the change and checks for potential breaks in the dependency graph.
- Atomic Write: Changes are applied within a transaction boundary.
- Verification: The engine runs your configured test suite (e.g.,
npm test). - Commit or Rollback: If tests pass, the changes are committed. If they fail, entkapp performs an automatic rollback to the captured state.
π§ What can be healed? β
1. Dependency Mismatches β
If a package is used in your code but missing from package.json, or if a production dependency is incorrectly placed in devDependencies, entkapp will move it to the correct section automatically.
2. Orphaned Exports β
Exports that are never imported anywhere in the reachable graph can be automatically stripped or converted to local declarations to reduce the public API surface.
3. Unused Files β
Verwaiste Dateien, die von keinem Einstiegspunkt aus erreichbar sind, kΓΆnnen sicher in einen _orphaned Ordner verschoben oder gelΓΆscht werden.
4. Barrel Flattening β
Complex, nested barrel files (index.js) that cause performance issues can be flattened to direct imports to improve build times and IDE performance.
π How to use it β
Simply run entkapp with the --fix flag:
npx entkapp --fixFor maximum safety, combine it with the --verbose flag to see exactly what the engine is proposing before it applies the changes.