entkapp 5.2.1 → 5.2.3

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/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": "5.2.1",
4
+ "version": "5.2.3",
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",
@@ -604,8 +604,14 @@ export class ASTAnalyzer {
604
604
  if (this.context.verbose) console.log(`[AST-DEBUG] Found require() call in ${fileNode.filePath}`);
605
605
  const arg = node.arguments[0];
606
606
  if (arg && ts.isStringLiteral(arg)) {
607
- if (this.context.verbose) console.log(`[AST-DEBUG] Added import: ${arg.text}`);
608
- fileNode.explicitImports.add(arg.text);
607
+ const specifier = arg.text;
608
+ if (this.context.verbose) console.log(`[AST-DEBUG] Added import: ${specifier}`);
609
+ fileNode.explicitImports.add(specifier);
610
+
611
+ // UPGRADE: Also track package usage for unlisted dependency detection
612
+ if (!specifier.startsWith('.') && !specifier.startsWith('/')) {
613
+ fileNode.externalPackageUsage.add(this._extractPackageName(specifier));
614
+ }
609
615
  }
610
616
  }
611
617
  }
package/src/index.js CHANGED
@@ -498,40 +498,63 @@ export class RefactoringEngine {
498
498
  }
499
499
  }
500
500
 
501
+ // UPGRADE: Unlisted Dependency Audit (Unified Root & Workspace)
502
+ const auditManifests = [];
503
+ // 1. Collect Root Manifest
504
+ const rootPkgPath = path.join(this.context.cwd, 'package.json');
505
+ if (existsSync(rootPkgPath)) {
506
+ auditManifests.push({
507
+ rootDirectory: this.context.cwd,
508
+ manifestPath: rootPkgPath
509
+ });
510
+ }
511
+ // 2. Collect Workspace Manifests
501
512
  if (this.workspaceGraph && this.workspaceGraph.packageManifests) {
502
513
  for (const [_, metadata] of this.workspaceGraph.packageManifests.entries()) {
503
- if (this.context.projectGraph) {
504
- for (const [filePath, fileNode] of this.context.projectGraph.entries()) {
505
- const cleanRelative = path.relative(metadata.rootDirectory, filePath).replace(/\\/g, '/');
506
-
507
- if (!cleanRelative.startsWith('..') && !cleanRelative.startsWith('/') && fileNode.explicitImports) {
508
- try {
509
- const localManifest = JSON.parse(readFileSync(metadata.manifestPath, 'utf8'));
510
- const localDeps = new Set([
511
- ...Object.keys(localManifest.dependencies || {}),
512
- ...Object.keys(localManifest.devDependencies || {}),
513
- ...Object.keys(localManifest.peerDependencies || {})
514
- ]);
515
-
516
- fileNode.explicitImports.forEach(specifier => {
517
- if (specifier.startsWith('.') || specifier.startsWith('/')) return;
518
- const basePkg = specifier.startsWith('@') ? specifier.split('/').slice(0, 2).join('/') : specifier.split('/')[0];
519
-
520
- if (!localDeps.has(basePkg)) {
521
- const alreadyFlagged = this.context.unlistedDependencies.some(u => u.package === basePkg && u.file === filePath);
522
- if (!alreadyFlagged) {
523
- this.context.unlistedDependencies.push({
524
- package: basePkg,
525
- file: path.relative(this.context.cwd, filePath),
526
- manifest: path.relative(this.context.cwd, metadata.manifestPath)
527
- });
528
- }
514
+ auditManifests.push(metadata);
515
+ }
516
+ }
517
+
518
+ for (const metadata of auditManifests) {
519
+ if (this.context.projectGraph) {
520
+ for (const [filePath, fileNode] of this.context.projectGraph.entries()) {
521
+ const cleanRelative = path.relative(metadata.rootDirectory, filePath).replace(/\\/g, '/');
522
+
523
+ // Check if file belongs to this manifest's directory scope
524
+ if (!cleanRelative.startsWith('..') && !cleanRelative.startsWith('/') && fileNode.explicitImports) {
525
+ try {
526
+ const localManifest = JSON.parse(readFileSync(metadata.manifestPath, 'utf8'));
527
+ const localDeps = new Set([
528
+ ...Object.keys(localManifest.dependencies || {}),
529
+ ...Object.keys(localManifest.devDependencies || {}),
530
+ ...Object.keys(localManifest.peerDependencies || {}),
531
+ ...Object.keys(localManifest.optionalDependencies || {})
532
+ ]);
533
+
534
+ fileNode.explicitImports.forEach(specifier => {
535
+ if (specifier.startsWith('.') || specifier.startsWith('/')) return;
536
+
537
+ // Extract base package name (handle scoped packages)
538
+ const basePkg = specifier.startsWith('@') ? specifier.split('/').slice(0, 2).join('/') : specifier.split('/')[0];
539
+
540
+ // Ignore Node.js built-ins
541
+ const nodeBuiltins = ['assert', 'async_hooks', 'buffer', 'child_process', 'cluster', 'console', 'constants', 'crypto', 'dgram', 'dns', 'domain', 'events', 'fs', 'http', 'http2', 'https', 'inspector', 'module', 'net', 'os', 'path', 'perf_hooks', 'process', 'punycode', 'querystring', 'readline', 'repl', 'stream', 'string_decoder', 'timers', 'tls', 'trace_events', 'tty', 'url', 'util', 'v8', 'vm', 'worker_threads', 'zlib'];
542
+ if (nodeBuiltins.includes(basePkg) || nodeBuiltins.includes(basePkg.replace('node:', ''))) return;
543
+
544
+ if (!localDeps.has(basePkg)) {
545
+ const alreadyFlagged = this.context.unlistedDependencies.some(u => u.package === basePkg && u.file === filePath);
546
+ if (!alreadyFlagged) {
547
+ this.context.unlistedDependencies.push({
548
+ package: basePkg,
549
+ file: path.relative(this.context.cwd, filePath),
550
+ manifest: path.relative(this.context.cwd, metadata.manifestPath)
551
+ });
529
552
  }
530
- });
531
- } catch (error) {
532
- if (this.context.options.verbose) {
533
- console.error(ansis.red(` ❌ Manifest Parsing Exception: ${error.message}`));
534
553
  }
554
+ });
555
+ } catch (error) {
556
+ if (this.context.options.verbose) {
557
+ console.error(ansis.red(` ❌ Manifest Parsing Exception: ${error.message}`));
535
558
  }
536
559
  }
537
560
  }
@@ -2,7 +2,7 @@ import { loadAdditionalPlugins } from "./ecosystems/PluginLoader.js";
2
2
  import path from 'path';
3
3
  import fs from 'fs/promises';
4
4
  import { pathToFileURL } from 'url';
5
-
5
+ import { AllPluginClasses } from './ecosystems/UltimateBundle.js';
6
6
  /**
7
7
  * ============================================================================
8
8
  * Plugin Registry for entkapp v5.0.0
@@ -41,107 +41,12 @@ export class PluginRegistry {
41
41
  loadAdditionalPlugins(this);
42
42
 
43
43
  // Also load TypeScript and Next.js plugins (primary framework plugins)
44
- const { ReactPlugin, VuePlugin, SveltePlugin, AngularPlugin, PreactPlugin, SolidPlugin, QwikPlugin, LitPlugin, NuxtPlugin, RemixPlugin, SvelteKitPlugin, AstroPlugin, VitepressPlugin, GatsbyPlugin, RedwoodPlugin, NextJsPlugin, TypeScriptPlugin, ExpressPlugin, FastifyPlugin, NestJsPlugin, HonoPlugin, KoaPlugin, ElysiaPlugin, GraphQLPlugin, ApolloPlugin, TRPCPlugin, DatabasePlugin, PrismaPlugin, DrizzlePlugin, MongoosePlugin, SupabasePlugin, FirebasePlugin, ClerkPlugin, ReduxPlugin, ZustandPlugin, JotaiPlugin, RecoilPlugin, MobXPlugin, PiniaPlugin, TanStackQueryPlugin, ReactRouterPlugin, TanStackRouterPlugin, VueRouterPlugin, AntdPlugin, MuiPlugin, ShadcnPlugin, RadixUIPlugin, ChakraUIPlugin, FramerMotionPlugin, GSAPPlugin, ZodPlugin, YupPlugin, ValibotPlugin, I18nextPlugin, VueI18nPlugin, SentryPlugin, OpenTelemetryPlugin, SocketIoPlugin, TailwindPlugin, PostcssPlugin, UnoCSSPlugin, StylelintPlugin, EslintPlugin, PrettierPlugin, BiomePlugin, OxlintPlugin, HuskyPlugin, LintStagedPlugin, CommitlintPlugin, ChangesetPlugin, BabelPlugin, SWCPlugin, VitePlugin, EsbuildPlugin, RollupPlugin, WebpackPlugin, ParcelPlugin, TurboPlugin, NxPlugin, JestPlugin, VitestPlugin, PlaywrightPlugin, CypressPlugin, StorybookPlugin, MswPlugin, GithubActionsPlugin, DockerPlugin, TerraformPlugin, EditorConfigPlugin, NvmPlugin, VoltaPlugin, DotenvPlugin, PnpmPlugin, YarnPlugin, BunPlugin, SwiperPlugin, QuillPlugin, EnvelopPlugin } = await import('./ecosystems/UltimateBundle.js');
45
- this.register(new ReactPlugin(this.context));
46
- this.register(new VuePlugin(this.context));
47
- this.register(new SveltePlugin(this.context));
48
- this.register(new AngularPlugin(this.context));
49
- this.register(new PreactPlugin(this.context));
50
- this.register(new SolidPlugin(this.context));
51
- this.register(new QwikPlugin(this.context));
52
- this.register(new LitPlugin(this.context));
53
- this.register(new NuxtPlugin(this.context));
54
- this.register(new RemixPlugin(this.context));
55
- this.register(new SvelteKitPlugin(this.context));
56
- this.register(new AstroPlugin(this.context));
57
- this.register(new VitepressPlugin(this.context));
58
- this.register(new GatsbyPlugin(this.context));
59
- this.register(new RedwoodPlugin(this.context));
60
- this.register(new NextJsPlugin(this.context));
61
- this.register(new TypeScriptPlugin(this.context));
62
- this.register(new ExpressPlugin(this.context));
63
- this.register(new FastifyPlugin(this.context));
64
- this.register(new NestJsPlugin(this.context));
65
- this.register(new HonoPlugin(this.context));
66
- this.register(new KoaPlugin(this.context));
67
- this.register(new ElysiaPlugin(this.context));
68
- this.register(new GraphQLPlugin(this.context));
69
- this.register(new ApolloPlugin(this.context));
70
- this.register(new TRPCPlugin(this.context));
71
- this.register(new DatabasePlugin(this.context));
72
- this.register(new PrismaPlugin(this.context));
73
- this.register(new DrizzlePlugin(this.context));
74
- this.register(new MongoosePlugin(this.context));
75
- this.register(new SupabasePlugin(this.context));
76
- this.register(new FirebasePlugin(this.context));
77
- this.register(new ClerkPlugin(this.context));
78
- this.register(new ReduxPlugin(this.context));
79
- this.register(new ZustandPlugin(this.context));
80
- this.register(new JotaiPlugin(this.context));
81
- this.register(new RecoilPlugin(this.context));
82
- this.register(new MobXPlugin(this.context));
83
- this.register(new PiniaPlugin(this.context));
84
- this.register(new TanStackQueryPlugin(this.context));
85
- this.register(new ReactRouterPlugin(this.context));
86
- this.register(new TanStackRouterPlugin(this.context));
87
- this.register(new VueRouterPlugin(this.context));
88
- this.register(new AntdPlugin(this.context));
89
- this.register(new MuiPlugin(this.context));
90
- this.register(new ShadcnPlugin(this.context));
91
- this.register(new RadixUIPlugin(this.context));
92
- this.register(new ChakraUIPlugin(this.context));
93
- this.register(new FramerMotionPlugin(this.context));
94
- this.register(new GSAPPlugin(this.context));
95
- this.register(new ZodPlugin(this.context));
96
- this.register(new YupPlugin(this.context));
97
- this.register(new ValibotPlugin(this.context));
98
- this.register(new I18nextPlugin(this.context));
99
- this.register(new VueI18nPlugin(this.context));
100
- this.register(new SentryPlugin(this.context));
101
- this.register(new OpenTelemetryPlugin(this.context));
102
- this.register(new SocketIoPlugin(this.context));
103
- this.register(new TailwindPlugin(this.context));
104
- this.register(new PostcssPlugin(this.context));
105
- this.register(new UnoCSSPlugin(this.context));
106
- this.register(new StylelintPlugin(this.context));
107
- this.register(new EslintPlugin(this.context));
108
- this.register(new PrettierPlugin(this.context));
109
- this.register(new BiomePlugin(this.context));
110
- this.register(new OxlintPlugin(this.context));
111
- this.register(new HuskyPlugin(this.context));
112
- this.register(new LintStagedPlugin(this.context));
113
- this.register(new CommitlintPlugin(this.context));
114
- this.register(new ChangesetPlugin(this.context));
115
- this.register(new BabelPlugin(this.context));
116
- this.register(new SWCPlugin(this.context));
117
- this.register(new VitePlugin(this.context));
118
- this.register(new EsbuildPlugin(this.context));
119
- this.register(new RollupPlugin(this.context));
120
- this.register(new WebpackPlugin(this.context));
121
- this.register(new ParcelPlugin(this.context));
122
- this.register(new TurboPlugin(this.context));
123
- this.register(new NxPlugin(this.context));
124
- this.register(new JestPlugin(this.context));
125
- this.register(new VitestPlugin(this.context));
126
- this.register(new PlaywrightPlugin(this.context));
127
- this.register(new CypressPlugin(this.context));
128
- this.register(new StorybookPlugin(this.context));
129
- this.register(new MswPlugin(this.context));
130
- this.register(new GithubActionsPlugin(this.context));
131
- this.register(new DockerPlugin(this.context));
132
- this.register(new TerraformPlugin(this.context));
133
- this.register(new EditorConfigPlugin(this.context));
134
- this.register(new NvmPlugin(this.context));
135
- this.register(new VoltaPlugin(this.context));
136
- this.register(new DotenvPlugin(this.context));
137
- this.register(new PnpmPlugin(this.context));
138
- this.register(new YarnPlugin(this.context));
139
- this.register(new BunPlugin(this.context));
140
- this.register(new SwiperPlugin(this.context));
141
- this.register(new QuillPlugin(this.context));
142
- this.register(new EnvelopPlugin(this.context));
143
- }
44
+
144
45
 
46
+ AllPluginClasses.forEach(PluginClass => {
47
+ this.register(new PluginClass(this.context));
48
+ });
49
+ }
145
50
  async loadCustomPlugins(projectRoot) {
146
51
  const pluginsDir = path.join(projectRoot, 'entkapp', 'plugins');
147
52
  try {