@empline/preflight 1.1.37 → 1.1.38

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.
File without changes
package/dist/bin/audit.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/bin/watch.js CHANGED
File without changes
@@ -8,13 +8,28 @@
8
8
  * - Increases maintenance burden
9
9
  * - Creates confusion about which implementation to use
10
10
  *
11
- * NON-BLOCKING: Reports warnings for cleanup consideration
11
+ * IMPORTANT: This check is NON-BLOCKING and ADVISORY ONLY.
12
+ * DO NOT auto-delete files based on this report - many files have
13
+ * legitimate uses that are hard to detect statically:
14
+ * - Dynamic imports
15
+ * - Conditional imports based on environment
16
+ * - Files used by external tools/scripts
17
+ * - Files imported by tests
18
+ * - Worker files
19
+ * - Entry points for scheduled jobs
20
+ *
21
+ * Always manually verify before removing any files!
12
22
  */
13
23
  export declare const id = "code-quality/unused-lib-detection";
14
24
  export declare const name = "Unused Library File Detection";
15
- export declare const description = "Detects lib/ files that are not imported anywhere, identifying dead code for cleanup";
25
+ export declare const description = "Detects lib/ files that may not be imported - ADVISORY ONLY, verify manually before cleanup";
16
26
  export declare const category = "code-quality";
17
27
  export declare const blocking = false;
18
28
  export declare const tags: string[];
19
- export declare function run(): Promise<void>;
29
+ export declare const requires: string[];
30
+ export declare function run(): Promise<{
31
+ success: boolean;
32
+ errors: number;
33
+ warnings: number;
34
+ }>;
20
35
  //# sourceMappingURL=unused-lib-detection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"unused-lib-detection.d.ts","sourceRoot":"","sources":["../../../src/checks/code-quality/unused-lib-detection.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;GAUG;AAQH,eAAO,MAAM,EAAE,sCAAsC,CAAC;AACtD,eAAO,MAAM,IAAI,kCAAkC,CAAC;AACpD,eAAO,MAAM,WAAW,yFACgE,CAAC;AACzF,eAAO,MAAM,QAAQ,iBAAiB,CAAC;AACvC,eAAO,MAAM,QAAQ,QAAQ,CAAC;AAC9B,eAAO,MAAM,IAAI,UAAwD,CAAC;AA8K1E,wBAAsB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CA0GzC"}
1
+ {"version":3,"file":"unused-lib-detection.d.ts","sourceRoot":"","sources":["../../../src/checks/code-quality/unused-lib-detection.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AAOH,eAAO,MAAM,EAAE,sCAAsC,CAAC;AACtD,eAAO,MAAM,IAAI,kCAAkC,CAAC;AACpD,eAAO,MAAM,WAAW,gGACuE,CAAC;AAChG,eAAO,MAAM,QAAQ,iBAAiB,CAAC;AACvC,eAAO,MAAM,QAAQ,QAAQ,CAAC;AAC9B,eAAO,MAAM,IAAI,UAAoE,CAAC;AACtF,eAAO,MAAM,QAAQ,UAA0B,CAAC;AAwahD,wBAAsB,GAAG,IAAI,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAuG3F"}
@@ -9,57 +9,171 @@
9
9
  * - Increases maintenance burden
10
10
  * - Creates confusion about which implementation to use
11
11
  *
12
- * NON-BLOCKING: Reports warnings for cleanup consideration
12
+ * IMPORTANT: This check is NON-BLOCKING and ADVISORY ONLY.
13
+ * DO NOT auto-delete files based on this report - many files have
14
+ * legitimate uses that are hard to detect statically:
15
+ * - Dynamic imports
16
+ * - Conditional imports based on environment
17
+ * - Files used by external tools/scripts
18
+ * - Files imported by tests
19
+ * - Worker files
20
+ * - Entry points for scheduled jobs
21
+ *
22
+ * Always manually verify before removing any files!
13
23
  */
14
24
  var __importDefault = (this && this.__importDefault) || function (mod) {
15
25
  return (mod && mod.__esModule) ? mod : { "default": mod };
16
26
  };
17
27
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.tags = exports.blocking = exports.category = exports.description = exports.name = exports.id = void 0;
28
+ exports.requires = exports.tags = exports.blocking = exports.category = exports.description = exports.name = exports.id = void 0;
19
29
  exports.run = run;
20
30
  const node_fs_1 = __importDefault(require("node:fs"));
21
31
  const node_path_1 = __importDefault(require("node:path"));
22
32
  const console_chars_1 = require("../../utils/console-chars");
23
- const universal_progress_reporter_1 = require("../system/universal-progress-reporter");
24
33
  // METADATA - Required for plugin loader discovery
25
34
  exports.id = "code-quality/unused-lib-detection";
26
35
  exports.name = "Unused Library File Detection";
27
- exports.description = "Detects lib/ files that are not imported anywhere, identifying dead code for cleanup";
36
+ exports.description = "Detects lib/ files that may not be imported - ADVISORY ONLY, verify manually before cleanup";
28
37
  exports.category = "code-quality";
29
38
  exports.blocking = false;
30
- exports.tags = ["dead-code", "cleanup", "ai-clarity", "maintenance"];
31
- const unusedFiles = [];
32
- // Files to explicitly exclude from unused detection
33
- const EXCLUDED_FILES = [
39
+ exports.tags = ["dead-code", "cleanup", "ai-clarity", "maintenance", "advisory"];
40
+ exports.requires = ["trading-card-system"];
41
+ // =============================================================================
42
+ // EXCLUSIONS - Files that should NEVER be flagged as unused
43
+ // =============================================================================
44
+ /**
45
+ * Explicit file exclusions - these are known to be used in ways
46
+ * that static analysis can't easily detect
47
+ */
48
+ const EXCLUDED_FILES = new Set([
34
49
  // Entry points and exports
35
50
  "lib/index.ts",
36
51
  "lib/types.ts",
37
- // Utility barrel exports
38
- "lib/recognition/index.ts",
39
- "lib/images/index.ts",
40
- "lib/constants/index.ts",
41
- // Environment/config
52
+ // Environment/config (loaded at startup)
42
53
  "lib/env-loader.ts",
43
54
  "lib/logger.ts",
44
- // DB/Prisma (imported dynamically)
55
+ "lib/debug-logger.ts",
56
+ // DB/Prisma (imported dynamically or at startup)
45
57
  "lib/prisma.ts",
46
58
  "lib/db.ts",
59
+ // Auth (used by middleware/edge functions)
60
+ "lib/auth.ts",
61
+ "lib/auth-server.ts",
62
+ "lib/auth-utils.ts",
63
+ "lib/auth-fetch.ts",
64
+ "lib/auth-server-utils.ts",
65
+ "lib/simple-auth.ts",
66
+ "lib/mock-auth-service.ts",
67
+ ]);
68
+ /**
69
+ * Directory patterns to exclude entirely
70
+ */
71
+ const EXCLUDED_DIRS = [
72
+ "__mocks__", // Jest mocks - used by test framework
73
+ "__tests__", // Test files
74
+ "examples", // Example/documentation code
75
+ "workers", // Web workers - loaded dynamically
76
+ "scrapers", // Often run as separate scripts
77
+ ];
78
+ /**
79
+ * File patterns to exclude (regex)
80
+ */
81
+ const EXCLUDED_PATTERNS = [
82
+ // Index/barrel files - they re-export other files
83
+ /\/index\.ts$/,
84
+ // Worker files - loaded dynamically by bundler
85
+ /\.worker\.ts$/,
86
+ // Type definition files
87
+ /\.d\.ts$/,
88
+ // Test files
89
+ /\.test\.tsx?$/,
90
+ /\.spec\.tsx?$/,
91
+ // Mock files anywhere in the path
92
+ /__mocks__\//,
93
+ // Example files
94
+ /examples?\//,
95
+ // Migration/seed files - run by CLI tools
96
+ /migrations?\//,
97
+ /seeds?\//,
98
+ // Config files that might be imported dynamically
99
+ /-config\.ts$/,
100
+ /\.config\.ts$/,
47
101
  ];
48
- // Directories to check for lib imports
102
+ /**
103
+ * Files that are commonly used in ways static analysis misses
104
+ * These get "low confidence" instead of being flagged as unused
105
+ */
106
+ const LOW_CONFIDENCE_PATTERNS = [
107
+ // Integration adapters - often imported dynamically based on user config
108
+ /adapters?\//,
109
+ /integrations?\//,
110
+ // Catalog helpers - may be imported conditionally by category
111
+ /-catalog-helpers?\.ts$/,
112
+ // Database utilities - often loaded conditionally
113
+ /database\//,
114
+ /connection/,
115
+ /sharding/,
116
+ /query-retry/,
117
+ // OCR/AI utilities - may be conditionally loaded
118
+ /ocr/i,
119
+ /recognition/,
120
+ /-ai-/,
121
+ /ai-/,
122
+ // Image processing - often in workers or conditional
123
+ /image-/,
124
+ /-image/,
125
+ // Webhook/notification services - triggered by external events
126
+ /webhook/,
127
+ /notification/,
128
+ /trigger/,
129
+ // Cache/performance utilities - often loaded conditionally
130
+ /cache/,
131
+ /warming/,
132
+ /monitoring/,
133
+ // SEO/sitemap generators - often run as build scripts
134
+ /sitemap/,
135
+ /schema-org/,
136
+ /seo-/,
137
+ // Market data - may be loaded conditionally
138
+ /market-/,
139
+ // Validation utilities - may be imported dynamically
140
+ /validation/,
141
+ /anti-workaround/,
142
+ // 2FA/security - conditionally loaded
143
+ /2fa/,
144
+ /sms\.ts$/,
145
+ // Platform/haptics - conditionally loaded based on platform
146
+ /haptics/,
147
+ /platform-/,
148
+ // Learning/ML utilities - conditionally loaded
149
+ /learning/,
150
+ /confidence/,
151
+ // Field mapping utilities - used by import adapters
152
+ /field-mapping/,
153
+ /woocommerce-/,
154
+ // Theme/styling utilities - may be imported by build tools
155
+ /theme-/,
156
+ /tokens/,
157
+ ];
158
+ // =============================================================================
159
+ // IMPORT CHECK DIRECTORIES
160
+ // =============================================================================
49
161
  const IMPORT_CHECK_DIRS = [
50
162
  "app",
51
163
  "components",
52
164
  "hooks",
53
165
  "lib",
54
166
  "pages",
55
- "scripts/active",
56
- ];
57
- // Files that are only used via barrel exports (check separately)
58
- const BARREL_EXPORTED_PATTERNS = [
59
- /lib\/recognition\/.*\.ts$/,
60
- /lib\/images\/.*\.ts$/,
61
- /lib\/constants\/.*\.ts$/,
167
+ "scripts", // All scripts, not just active
168
+ "middleware",
169
+ "instrumentation",
170
+ "e2e", // E2E tests may import lib files
171
+ "tests", // Unit tests
172
+ "__tests__",
62
173
  ];
174
+ // =============================================================================
175
+ // HELPERS
176
+ // =============================================================================
63
177
  function getAllLibFiles(dir) {
64
178
  const files = [];
65
179
  function traverse(currentDir) {
@@ -68,10 +182,15 @@ function getAllLibFiles(dir) {
68
182
  const entries = node_fs_1.default.readdirSync(currentDir, { withFileTypes: true });
69
183
  for (const entry of entries) {
70
184
  const fullPath = node_path_1.default.join(currentDir, entry.name);
185
+ // Skip excluded directories
71
186
  if (entry.isDirectory()) {
72
- traverse(fullPath);
187
+ if (!EXCLUDED_DIRS.includes(entry.name)) {
188
+ traverse(fullPath);
189
+ }
190
+ continue;
73
191
  }
74
- else if (entry.isFile() &&
192
+ // Only check .ts/.tsx files
193
+ if (entry.isFile() &&
75
194
  (entry.name.endsWith(".ts") || entry.name.endsWith(".tsx")) &&
76
195
  !entry.name.endsWith(".test.ts") &&
77
196
  !entry.name.endsWith(".test.tsx") &&
@@ -91,24 +210,51 @@ function getImportableNames(filePath) {
91
210
  // Remove lib/ prefix and extension
92
211
  const withoutLib = relativePath.replace(/^lib\//, "");
93
212
  const withoutExt = withoutLib.replace(/\.(ts|tsx)$/, "");
94
- // Add various import patterns
213
+ const basename = node_path_1.default.basename(withoutExt);
214
+ const dirname = node_path_1.default.dirname(withoutExt);
215
+ // @/ alias imports
95
216
  names.push(`@/lib/${withoutExt}`);
96
- names.push(`../lib/${withoutExt}`);
97
- names.push(`../../lib/${withoutExt}`);
98
- names.push(`../../../lib/${withoutExt}`);
99
- names.push(`../../../../lib/${withoutExt}`);
100
- names.push(`"./` + node_path_1.default.basename(withoutExt) + '"');
101
- names.push(`'./${node_path_1.default.basename(withoutExt)}'`);
102
- // Handle index files
217
+ names.push(`"@/lib/${withoutExt}"`);
218
+ names.push(`'@/lib/${withoutExt}'`);
219
+ // Relative imports from various depths
220
+ for (let i = 1; i <= 6; i++) {
221
+ const prefix = "../".repeat(i);
222
+ names.push(`${prefix}lib/${withoutExt}`);
223
+ names.push(`"${prefix}lib/${withoutExt}"`);
224
+ names.push(`'${prefix}lib/${withoutExt}'`);
225
+ }
226
+ // Same-directory imports (from within lib/)
227
+ names.push(`./${basename}`);
228
+ names.push(`"./${basename}"`);
229
+ names.push(`'./${basename}'`);
230
+ names.push(`"../${dirname}/${basename}"`);
231
+ names.push(`'../${dirname}/${basename}'`);
232
+ // Handle index files - can be imported as directory
103
233
  if (withoutExt.endsWith("/index")) {
104
234
  const dir = withoutExt.replace(/\/index$/, "");
105
235
  names.push(`@/lib/${dir}`);
106
- names.push(`../lib/${dir}`);
236
+ names.push(`"@/lib/${dir}"`);
237
+ names.push(`'@/lib/${dir}'`);
107
238
  }
239
+ // Dynamic imports
240
+ names.push(`import("@/lib/${withoutExt}")`);
241
+ names.push(`import('@/lib/${withoutExt}')`);
242
+ names.push(`require("@/lib/${withoutExt}")`);
243
+ names.push(`require('@/lib/${withoutExt}')`);
244
+ // Re-exports from barrel files (check for the export name)
245
+ names.push(`from "./${basename}"`);
246
+ names.push(`from './${basename}'`);
247
+ names.push(`export * from "./${basename}"`);
248
+ names.push(`export * from './${basename}'`);
108
249
  return names;
109
250
  }
110
- function isFileImported(filePath, allSourceFiles) {
251
+ function isFileImported(filePath, allSourceFiles, barrelExports) {
111
252
  const importableNames = getImportableNames(filePath);
253
+ const relativePath = node_path_1.default
254
+ .relative(process.cwd(), filePath)
255
+ .replace(/\\/g, "/");
256
+ const basename = node_path_1.default.basename(relativePath, node_path_1.default.extname(relativePath));
257
+ // Check direct imports
112
258
  for (const [_, content] of allSourceFiles) {
113
259
  for (const importName of importableNames) {
114
260
  if (content.includes(importName)) {
@@ -116,6 +262,20 @@ function isFileImported(filePath, allSourceFiles) {
116
262
  }
117
263
  }
118
264
  }
265
+ // Check if exported from a barrel file
266
+ for (const [barrelPath, exports] of barrelExports) {
267
+ if (exports.has(basename) || exports.has(relativePath)) {
268
+ // The barrel file exports this - check if barrel is imported
269
+ const barrelImportNames = getImportableNames(barrelPath);
270
+ for (const [_, content] of allSourceFiles) {
271
+ for (const importName of barrelImportNames) {
272
+ if (content.includes(importName)) {
273
+ return true;
274
+ }
275
+ }
276
+ }
277
+ }
278
+ }
119
279
  return false;
120
280
  }
121
281
  function loadSourceFiles(dirs) {
@@ -125,52 +285,114 @@ function loadSourceFiles(dirs) {
125
285
  if (!node_fs_1.default.existsSync(fullDir))
126
286
  continue;
127
287
  function traverse(currentDir) {
128
- const entries = node_fs_1.default.readdirSync(currentDir, { withFileTypes: true });
129
- for (const entry of entries) {
130
- const fullPath = node_path_1.default.join(currentDir, entry.name);
131
- if (entry.isDirectory() && !entry.name.startsWith(".")) {
132
- traverse(fullPath);
133
- }
134
- else if (entry.isFile() &&
135
- (entry.name.endsWith(".ts") ||
136
- entry.name.endsWith(".tsx") ||
137
- entry.name.endsWith(".js") ||
138
- entry.name.endsWith(".jsx") ||
139
- entry.name.endsWith(".md"))) {
140
- try {
141
- files.set(fullPath, node_fs_1.default.readFileSync(fullPath, "utf-8"));
288
+ try {
289
+ const entries = node_fs_1.default.readdirSync(currentDir, { withFileTypes: true });
290
+ for (const entry of entries) {
291
+ const fullPath = node_path_1.default.join(currentDir, entry.name);
292
+ if (entry.isDirectory() && !entry.name.startsWith(".") && entry.name !== "node_modules") {
293
+ traverse(fullPath);
142
294
  }
143
- catch {
144
- // Skip unreadable files
295
+ else if (entry.isFile() &&
296
+ (entry.name.endsWith(".ts") ||
297
+ entry.name.endsWith(".tsx") ||
298
+ entry.name.endsWith(".js") ||
299
+ entry.name.endsWith(".jsx") ||
300
+ entry.name.endsWith(".mjs") ||
301
+ entry.name.endsWith(".md") ||
302
+ entry.name.endsWith(".json"))) {
303
+ try {
304
+ files.set(fullPath, node_fs_1.default.readFileSync(fullPath, "utf-8"));
305
+ }
306
+ catch {
307
+ // Skip unreadable files
308
+ }
145
309
  }
146
310
  }
147
311
  }
312
+ catch {
313
+ // Skip unreadable directories
314
+ }
148
315
  }
149
316
  traverse(fullDir);
150
317
  }
151
318
  return files;
152
319
  }
320
+ function findBarrelExports(libDir) {
321
+ const barrels = new Map();
322
+ function findIndexFiles(dir) {
323
+ if (!node_fs_1.default.existsSync(dir))
324
+ return;
325
+ const entries = node_fs_1.default.readdirSync(dir, { withFileTypes: true });
326
+ for (const entry of entries) {
327
+ const fullPath = node_path_1.default.join(dir, entry.name);
328
+ if (entry.isDirectory()) {
329
+ findIndexFiles(fullPath);
330
+ }
331
+ else if (entry.name === "index.ts" || entry.name === "index.tsx") {
332
+ // Parse barrel file for re-exports
333
+ try {
334
+ const content = node_fs_1.default.readFileSync(fullPath, "utf-8");
335
+ const exports = new Set();
336
+ // Match: export * from "./something"
337
+ const reExportPattern = /export\s+\*\s+from\s+["']\.\/([^"']+)["']/g;
338
+ let match;
339
+ while ((match = reExportPattern.exec(content)) !== null) {
340
+ exports.add(match[1]);
341
+ }
342
+ // Match: export { x, y } from "./something"
343
+ const namedExportPattern = /export\s+\{[^}]+\}\s+from\s+["']\.\/([^"']+)["']/g;
344
+ while ((match = namedExportPattern.exec(content)) !== null) {
345
+ exports.add(match[1]);
346
+ }
347
+ if (exports.size > 0) {
348
+ barrels.set(fullPath, exports);
349
+ }
350
+ }
351
+ catch {
352
+ // Skip unreadable files
353
+ }
354
+ }
355
+ }
356
+ }
357
+ findIndexFiles(libDir);
358
+ return barrels;
359
+ }
153
360
  function isExcluded(filePath) {
154
361
  const relativePath = node_path_1.default
155
362
  .relative(process.cwd(), filePath)
156
363
  .replace(/\\/g, "/");
157
364
  // Check explicit exclusions
158
- if (EXCLUDED_FILES.includes(relativePath)) {
365
+ if (EXCLUDED_FILES.has(relativePath)) {
159
366
  return true;
160
367
  }
161
- // Check barrel export patterns
162
- for (const pattern of BARREL_EXPORTED_PATTERNS) {
368
+ // Check pattern exclusions
369
+ for (const pattern of EXCLUDED_PATTERNS) {
163
370
  if (pattern.test(relativePath)) {
164
371
  return true;
165
372
  }
166
373
  }
167
374
  return false;
168
375
  }
376
+ function getLowConfidenceReason(filePath) {
377
+ const relativePath = node_path_1.default
378
+ .relative(process.cwd(), filePath)
379
+ .replace(/\\/g, "/");
380
+ for (const pattern of LOW_CONFIDENCE_PATTERNS) {
381
+ if (pattern.test(relativePath)) {
382
+ return "File matches pattern that's often dynamically imported or conditionally used";
383
+ }
384
+ }
385
+ return null;
386
+ }
169
387
  async function run() {
170
- const reporter = (0, universal_progress_reporter_1.createUniversalProgressReporter)(exports.name);
171
388
  const libDir = node_path_1.default.join(process.cwd(), "lib");
389
+ const unusedFiles = [];
390
+ if (!node_fs_1.default.existsSync(libDir)) {
391
+ console.log(`${console_chars_1.emoji.info} No lib/ directory found - skipping check`);
392
+ return { success: true, errors: 0, warnings: 0 };
393
+ }
172
394
  console.log((0, console_chars_1.createDivider)());
173
- console.log(`${console_chars_1.emoji.search} Checking for unused lib/ files...`);
395
+ console.log(`${console_chars_1.emoji.search} Checking for potentially unused lib/ files...`);
174
396
  console.log();
175
397
  // Get all lib files
176
398
  const libFiles = getAllLibFiles(libDir);
@@ -179,6 +401,10 @@ async function run() {
179
401
  console.log(`Loading source files from: ${IMPORT_CHECK_DIRS.join(", ")}`);
180
402
  const sourceFiles = loadSourceFiles(IMPORT_CHECK_DIRS);
181
403
  console.log(`Loaded ${sourceFiles.size} source files`);
404
+ // Find barrel exports
405
+ console.log(`Scanning for barrel exports...`);
406
+ const barrelExports = findBarrelExports(libDir);
407
+ console.log(`Found ${barrelExports.size} barrel files with re-exports`);
182
408
  console.log();
183
409
  // Check each lib file
184
410
  for (const libFile of libFiles) {
@@ -188,75 +414,73 @@ async function run() {
188
414
  if (isExcluded(libFile)) {
189
415
  continue;
190
416
  }
191
- if (!isFileImported(libFile, sourceFiles)) {
192
- // Categorize the unused file
193
- let reason = "Not imported in any source file";
194
- let suggestion = "Consider archiving or removing";
195
- let severity = "warning";
196
- // Check for specific patterns
197
- if (relativePath.includes("rotation")) {
198
- reason = "Unused rotation detection implementation";
199
- suggestion =
200
- "Multiple rotation algorithms exist - consolidate to one primary implementation";
201
- }
202
- else if (relativePath.includes("border")) {
203
- reason = "Unused border processing implementation";
204
- suggestion =
205
- "Multiple border removal implementations exist - consolidate to one";
206
- }
207
- else if (relativePath.includes("recognition")) {
208
- reason = "Unused recognition component";
209
- suggestion = "Check if this was replaced by another implementation";
210
- }
211
- else if (relativePath.includes("debug")) {
212
- reason = "Debug utility not imported";
213
- suggestion = "Move to scripts/archived/ or remove";
214
- severity = "info";
215
- }
417
+ if (!isFileImported(libFile, sourceFiles, barrelExports)) {
418
+ const lowConfidenceReason = getLowConfidenceReason(libFile);
216
419
  unusedFiles.push({
217
420
  file: relativePath,
218
- reason,
219
- suggestion,
220
- severity,
421
+ reason: lowConfidenceReason || "Not found in any import statement",
422
+ confidence: lowConfidenceReason ? "low" : "medium",
221
423
  });
222
424
  }
223
425
  }
224
426
  // Report findings
225
427
  if (unusedFiles.length === 0) {
226
- console.log(`${console_chars_1.emoji.success} No unused lib/ files detected`);
428
+ console.log(`${console_chars_1.emoji.success} No potentially unused lib/ files detected`);
429
+ console.log((0, console_chars_1.createDivider)());
430
+ return { success: true, errors: 0, warnings: 0 };
227
431
  }
228
- else {
229
- console.log(`${console_chars_1.emoji.warning} Found ${unusedFiles.length} potentially unused lib/ files:`);
432
+ // Sort by confidence
433
+ const lowConfidence = unusedFiles.filter((f) => f.confidence === "low");
434
+ const mediumConfidence = unusedFiles.filter((f) => f.confidence === "medium");
435
+ console.log(`${console_chars_1.emoji.warning} Found ${unusedFiles.length} potentially unused lib/ files:`);
436
+ console.log();
437
+ if (mediumConfidence.length > 0) {
438
+ console.log(`${console_chars_1.chars.warning} Medium confidence (${mediumConfidence.length}) - verify before cleanup:`);
439
+ for (const file of mediumConfidence.slice(0, 20)) {
440
+ console.log(` ${console_chars_1.chars.bullet} ${file.file}`);
441
+ }
442
+ if (mediumConfidence.length > 20) {
443
+ console.log(` ... and ${mediumConfidence.length - 20} more`);
444
+ }
230
445
  console.log();
231
- const warnings = unusedFiles.filter((f) => f.severity === "warning");
232
- const infos = unusedFiles.filter((f) => f.severity === "info");
233
- if (warnings.length > 0) {
234
- console.log(`${console_chars_1.chars.warning} Warnings (${warnings.length}):`);
235
- for (const file of warnings) {
236
- console.log(` ${console_chars_1.chars.bullet} ${file.file}`);
237
- console.log(` ${console_chars_1.chars.arrow} ${file.reason}`);
238
- console.log(` ${console_chars_1.chars.arrow} ${file.suggestion}`);
239
- }
240
- console.log();
446
+ }
447
+ if (lowConfidence.length > 0) {
448
+ console.log(`${console_chars_1.chars.info} Low confidence (${lowConfidence.length}) - likely false positives:`);
449
+ for (const file of lowConfidence.slice(0, 10)) {
450
+ console.log(` ${console_chars_1.chars.bullet} ${file.file}`);
451
+ console.log(` ${console_chars_1.chars.arrow} ${file.reason}`);
241
452
  }
242
- if (infos.length > 0) {
243
- console.log(`${console_chars_1.chars.info} Info (${infos.length}):`);
244
- for (const file of infos) {
245
- console.log(` ${console_chars_1.chars.bullet} ${file.file}`);
246
- console.log(` ${console_chars_1.chars.arrow} ${file.reason}`);
247
- }
248
- console.log();
453
+ if (lowConfidence.length > 10) {
454
+ console.log(` ... and ${lowConfidence.length - 10} more`);
249
455
  }
250
- console.log((0, console_chars_1.createDivider)());
251
- console.log("Recommendations for AI clarity:");
252
- console.log(" 1. Archive unused rotation/border implementations to scripts/archived/");
253
- console.log(" 2. Add comments to remaining files explaining which is the primary implementation");
254
- console.log(' 3. Update lib/recognition/index.ts to clearly document the "happy path"');
456
+ console.log();
255
457
  }
256
458
  console.log((0, console_chars_1.createDivider)());
459
+ console.log(`${console_chars_1.emoji.warning} IMPORTANT: This is ADVISORY ONLY!`);
460
+ console.log();
461
+ console.log(" DO NOT auto-delete these files. Many have legitimate uses that");
462
+ console.log(" static analysis cannot detect:");
463
+ console.log(" - Dynamic imports (import() expressions)");
464
+ console.log(" - Conditional imports based on environment");
465
+ console.log(" - Files used by external tools/scripts");
466
+ console.log(" - Worker files loaded by bundler");
467
+ console.log(" - Integration adapters loaded by configuration");
468
+ console.log(" - Files imported by tests not in standard locations");
469
+ console.log();
470
+ console.log(" Always verify manually before removing any files!");
471
+ console.log((0, console_chars_1.createDivider)());
472
+ // Return success (non-blocking) but report warning count
473
+ return { success: true, errors: 0, warnings: mediumConfidence.length };
257
474
  }
258
475
  // Allow direct execution
259
476
  if (require.main === module) {
260
- run().catch(console.error);
477
+ run()
478
+ .then((result) => {
479
+ process.exit(result.success ? 0 : 1);
480
+ })
481
+ .catch((err) => {
482
+ console.error(err);
483
+ process.exit(1);
484
+ });
261
485
  }
262
486
  //# sourceMappingURL=unused-lib-detection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"unused-lib-detection.js","sourceRoot":"","sources":["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AC,GAAG,CAAC,GAAG,qBAAK,CAAC,IAAI,UAAU,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;YACrD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBACzB,OAAO,CAAC,GAAG,CAAC,KAAK,qBAAK,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;gBAC9C,OAAO,CAAC,GAAG,CAAC,OAAO,qBAAK,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;YACnD,CAAC;YACD,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,IAAA,6BAAa,GAAE,CAAC,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;QAC/C,OAAO,CAAC,GAAG,CACT,0EAA0E,CAC3E,CAAC;QACF,OAAO,CAAC,GAAG,CACT,qFAAqF,CACtF,CAAC;QACF,OAAO,CAAC,GAAG,CACT,2EAA2E,CAC5E,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,IAAA,6BAAa,GAAE,CAAC,CAAC;AAC/B,CAAC;AAED,yBAAyB;AACzB,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC7B,CAAC"}
1
+ {"version":3,"file":"unused-lib-detection.js","sourceRoot":"","sources":["../../../src/checks/code-quality/unused-lib-detection.ts"],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;AAsbH,kBAuGC;AA3hBD,sDAAyB;AACzB,0DAA6B;AAC7B,6DAAwE;AAExE,kDAAkD;AACrC,QAAA,EAAE,GAAG,mCAAmC,CAAC;AACzC,QAAA,IAAI,GAAG,+BAA+B,CAAC;AACvC,QAAA,WAAW,GACtB,6FAA6F,CAAC;AACnF,QAAA,QAAQ,G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d,OAAO,CAAC,GAAG,CAAC,kEAAkE,CAAC,CAAC;IAChF,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC;IAC5D,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;IAC9D,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;IAC1D,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;IACpD,OAAO,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAAC;IACvE,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAC;IACnE,OAAO,CAAC,GAAG,CAAC,IAAA,6BAAa,GAAE,CAAC,CAAC;IAE7B,yDAAyD;IACzD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,gBAAgB,CAAC,MAAM,EAAE,CAAC;AACzE,CAAC;AAED,yBAAyB;AACzB,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,GAAG,EAAE;SACF,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;QACf,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC"}
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empline/preflight",
3
- "version": "1.1.37",
3
+ "version": "1.1.38",
4
4
  "description": "Distributable preflight validation system with app-specific plugin support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -17,6 +17,23 @@
17
17
  "preflight-review-drift": "dist/bin/review-drift.js",
18
18
  "preflight-sync-check": "dist/bin/sync-check.js"
19
19
  },
20
+ "scripts": {
21
+ "build": "tsc",
22
+ "prebuild": "npx ai-manager cleanup -q -r . && npm run check:hygiene && npm run check:metadata && npm run check:broken",
23
+ "dev": "tsc --watch",
24
+ "preflight": "tsx src/bin/preflight.ts",
25
+ "check:system": "tsx src/bin/preflight.ts --category system",
26
+ "check:security": "tsx src/bin/preflight.ts --category security",
27
+ "check:business": "tsx src/bin/preflight.ts --category business",
28
+ "check:hygiene": "tsx scripts/maintenance/module-boundary-validator.ts",
29
+ "check:metadata": "tsx src/checks/system/preflight-metadata-validator.ts",
30
+ "check:broken": "tsx src/checks/system/broken-preflight-detection.ts",
31
+ "check:hygiene:all": "tsx scripts/maintenance/module-boundary-validator.ts && tsx scripts/maintenance/workflow-composition-validator.ts && tsx scripts/maintenance/canonical-import-enforcer.ts",
32
+ "lint": "eslint src/",
33
+ "test": "vitest",
34
+ "preinstall": "node dist/bin/preinstall.js",
35
+ "prepublishOnly": "node -e \"const pkg = require('./package.json'); if (pkg.publishConfig?.access !== 'restricted') { console.error('ERROR: publishConfig.access must be restricted'); process.exit(1); }\" && npm run build"
36
+ },
20
37
  "exports": {
21
38
  ".": {
22
39
  "types": "./dist/index.d.ts",
@@ -69,21 +86,5 @@
69
86
  },
70
87
  "engines": {
71
88
  "node": ">=18.0.0"
72
- },
73
- "scripts": {
74
- "build": "tsc",
75
- "prebuild": "npx ai-manager cleanup -q -r . && npm run check:hygiene && npm run check:metadata && npm run check:broken",
76
- "dev": "tsc --watch",
77
- "preflight": "tsx src/bin/preflight.ts",
78
- "check:system": "tsx src/bin/preflight.ts --category system",
79
- "check:security": "tsx src/bin/preflight.ts --category security",
80
- "check:business": "tsx src/bin/preflight.ts --category business",
81
- "check:hygiene": "tsx scripts/maintenance/module-boundary-validator.ts",
82
- "check:metadata": "tsx src/checks/system/preflight-metadata-validator.ts",
83
- "check:broken": "tsx src/checks/system/broken-preflight-detection.ts",
84
- "check:hygiene:all": "tsx scripts/maintenance/module-boundary-validator.ts && tsx scripts/maintenance/workflow-composition-validator.ts && tsx scripts/maintenance/canonical-import-enforcer.ts",
85
- "lint": "eslint src/",
86
- "test": "vitest",
87
- "preinstall": "node dist/bin/preinstall.js"
88
89
  }
89
- }
90
+ }