entkapp 4.4.1 → 4.5.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.
- package/bin/cli.js +7 -9
- package/package.json +1 -1
- package/src/EngineContext.js +8 -1
- package/src/ast/AdvancedAnalysis.js +518 -89
- package/src/ast/DeadCodeDetector.js +5 -0
- package/src/ast/OxcAnalyzer.js +77 -22
- package/src/index.js +213 -29
- package/src/performance/GraphCache.js +3 -1
- package/src/performance/WorkerPool.js +10 -1
- package/src/performance/WorkerTaskRunner.js +10 -3
- package/src/resolution/DepencyResolver.js +3 -4
package/bin/cli.js
CHANGED
|
@@ -28,7 +28,7 @@ async function bootstrap() {
|
|
|
28
28
|
program
|
|
29
29
|
.name('entkapp')
|
|
30
30
|
.description(ansis.cyan('Enterprise-Grade AST Syntax Refactoring & Self-Healing Engine'))
|
|
31
|
-
.version(packageJsonContent.version || '4.
|
|
31
|
+
.version(packageJsonContent.version || '4.0.0');
|
|
32
32
|
|
|
33
33
|
program
|
|
34
34
|
.option('-c, --cwd <path>', 'Specify the execution context root directory', process.cwd())
|
|
@@ -36,19 +36,16 @@ async function bootstrap() {
|
|
|
36
36
|
.option('--fix', 'Enable atomic code updates, structural file pruning, and active type sanitization', false)
|
|
37
37
|
.option('--tsconfig <filename>', 'Specify path to custom layout configurations', 'tsconfig.json')
|
|
38
38
|
.option('--test-command <command>', 'Integrated continuous safety test validation script execution path', 'npm test')
|
|
39
|
-
.option('--no-fix', 'Deprecated flag, this is now default')
|
|
40
39
|
.option('--workspace', 'Enable high-density workspace workspace/monorepo cluster mesh evaluation parsing', false)
|
|
41
40
|
.option('--verbose', 'Toggle expanded trace telemetry for debug operational diagnostics', false)
|
|
41
|
+
.option('--visualize', 'Generate an interactive execution graph visualization', false)
|
|
42
42
|
.option('-r, --run', 'Execute the primary operational pipeline loop', false)
|
|
43
43
|
.option('-y, --yes', 'Skip confirmation prompts and execute planned structural modifications automatically', false)
|
|
44
44
|
.option('--timeout <ms>', 'Set execution timeout in milliseconds', '30000');
|
|
45
45
|
|
|
46
46
|
program.parse(process.argv);
|
|
47
47
|
const options = program.opts();
|
|
48
|
-
|
|
49
|
-
console.warn("\n⚠️ [DEPRECATION] The --no-fix flag is deprecated. No-fix is now the default behavior.");
|
|
50
|
-
console.warn("👉 To apply structural changes, use the --fix flag instead.\n");
|
|
51
|
-
}
|
|
48
|
+
|
|
52
49
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
53
50
|
|
|
54
51
|
// --- Onboarding Check (Skipped in Non-Interactive Mode) ---
|
|
@@ -69,7 +66,7 @@ async function bootstrap() {
|
|
|
69
66
|
const answer = await rl.question(ansis.bold.yellow('❓ No "entkapp:run" script found in package.json. Install it? (y/n): '));
|
|
70
67
|
if (answer.toLowerCase() === 'y') {
|
|
71
68
|
pkgJson.scripts = pkgJson.scripts || {};
|
|
72
|
-
pkgJson.scripts['entkapp:run'] = 'npx entkapp';
|
|
69
|
+
pkgJson.scripts['entkapp:run'] = 'npx entkapp --fix';
|
|
73
70
|
await fs.writeFile(pkgJsonPath, JSON.stringify(pkgJson, null, 2));
|
|
74
71
|
console.log(ansis.green('✅ "entkapp:run" script added to package.json.'));
|
|
75
72
|
}
|
|
@@ -93,7 +90,7 @@ async function bootstrap() {
|
|
|
93
90
|
enabledPlugins: ["nextjs", "nuxt", "remix", "sveltekit", "astro"]
|
|
94
91
|
};
|
|
95
92
|
await fs.writeFile(path.join(configDirPath, 'config.json'), JSON.stringify(defaultConfig, null, 2));
|
|
96
|
-
console.log(ansis.green('✅ "/entkapp" folder and default config created.'));
|
|
93
|
+
console.log(ansis.green('✅ "/entkapp" folder? and default config created.'));
|
|
97
94
|
configInstalled = true;
|
|
98
95
|
}
|
|
99
96
|
}
|
|
@@ -135,7 +132,7 @@ async function bootstrap() {
|
|
|
135
132
|
}, timeoutMs);
|
|
136
133
|
timeoutTimer.unref(); // Allow process to exit if work finishes
|
|
137
134
|
|
|
138
|
-
console.log(ansis.bold.green(`\n📦 entkapp v${packageJsonContent.version || '4.
|
|
135
|
+
console.log(ansis.bold.green(`\n📦 entkapp v${packageJsonContent.version || '4.0.0'} Engine Activation`));
|
|
139
136
|
console.log(ansis.dim('------------------------------------------------------------'));
|
|
140
137
|
console.log(`${ansis.bold('Target Workspace Root :')} ${ansis.blue(targetCwd)}`);
|
|
141
138
|
console.log(`${ansis.bold('Refactoring Mode :')} ${options.fix ? ansis.yellow('Active Fixing & Self-Healing Enabled') : ansis.gray('Dry-Run Reporting Only')}`);
|
|
@@ -157,6 +154,7 @@ async function bootstrap() {
|
|
|
157
154
|
exclude: localConfig.exclude,
|
|
158
155
|
rules: localConfig.rules,
|
|
159
156
|
debug: options.debug,
|
|
157
|
+
visualize: options.visualize,
|
|
160
158
|
});
|
|
161
159
|
|
|
162
160
|
await engine.run();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"name": "entkapp",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.5.0",
|
|
5
5
|
"description": "The Ultimate Enterprise Codebase Janitor. Faster than Knip with OXC integration, type-aware analysis, and automated structural healing. Fully standalone - solving what Knip cannot.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "index.js",
|
package/src/EngineContext.js
CHANGED
|
@@ -152,7 +152,14 @@ export class EngineContext {
|
|
|
152
152
|
const isSuppressed = node.localSuppressedRules.has('*') || node.localSuppressedRules.has('unused-file');
|
|
153
153
|
|
|
154
154
|
if (node.incomingEdges.size === 0 && !node.isEntry && !node.isLibraryEntry && !node.isFrameworkComponent && !isSuppressed) {
|
|
155
|
-
|
|
155
|
+
const relPath = path.relative(this.cwd, filePath);
|
|
156
|
+
report.orphanedFiles.push(relPath);
|
|
157
|
+
if (this.verbose) {
|
|
158
|
+
console.log(`[Orphan Auditor] File marked as orphan: ${relPath}`);
|
|
159
|
+
console.log(` - Incoming Edges: ${node.incomingEdges.size}`);
|
|
160
|
+
console.log(` - isEntry: ${node.isEntry}, isLibraryEntry: ${node.isLibraryEntry}, isFrameworkComponent: ${node.isFrameworkComponent}`);
|
|
161
|
+
console.log(` - Suppressed: ${isSuppressed}`);
|
|
162
|
+
}
|
|
156
163
|
}
|
|
157
164
|
|
|
158
165
|
for (const [symbol, meta] of node.internalExports.entries()) {
|