detect-antipatterns.mjs

 1#!/usr/bin/env node
 2
 3/**
 4 * Anti-Pattern Detector for Impeccable
 5 * Copyright (c) 2026 Paul Bakaus
 6 * SPDX-License-Identifier: Apache-2.0
 7 *
 8 * Public API facade. Runtime engines live under cli/engine/engines/.
 9 */
10
11import { detectCli } from './cli/main.mjs';
12
13export { ANTIPATTERNS, RULE_ENGINE_SUPPORT, getAntipattern, getRulesForCategory, getRuleEngineSupport } from './registry/antipatterns.mjs';
14export { SAFE_TAGS, BORDER_SAFE_TAGS, OVERUSED_FONTS, GENERIC_FONTS, KNOWN_SERIF_FONTS } from './shared/constants.mjs';
15export { isNeutralColor, parseRgb, relativeLuminance, contrastRatio, parseGradientColors, hasChroma, getHue, colorToHex } from './shared/color.mjs';
16export { isFullPage } from './shared/page.mjs';
17export {
18  checkElementBorders,
19  checkElementMotion,
20  checkElementGlow,
21  checkPageTypography,
22  checkPageLayout,
23  checkHtmlPatterns,
24} from './rules/checks.mjs';
25export { createDetectorProfile, summarizeDetectorProfile } from './profile/profiler.mjs';
26export { detectHtml } from './engines/static-html/detect-html.mjs';
27export { detectUrl, createBrowserDetector } from './engines/browser/detect-url.mjs';
28export { detectText, extractStyleBlocks, extractCSSinJS } from './engines/regex/detect-text.mjs';
29export {
30  walkDir,
31  SCANNABLE_EXTENSIONS,
32  SKIP_DIRS,
33  buildImportGraph,
34  resolveImport,
35  detectFrameworkConfig,
36  isPortListening,
37  FRAMEWORK_CONFIGS,
38} from './node/file-system.mjs';
39export { formatFindings, detectCli } from './cli/main.mjs';
40
41const isMainModule = process.argv[1]?.endsWith('detect-antipatterns.mjs') ||
42  process.argv[1]?.endsWith('detect-antipatterns.mjs/');
43if (isMainModule) detectCli();