Files
pbakaus_impeccable/package.json
T
Paul BakausandClaude Opus 4.6 5bc5ece1ab Wire quality rules into the CLI and add Puppeteer fixture tests
The quality detection rules (line-length, cramped-padding, tight-leading,
tiny-text, justified-text, all-caps-body, wide-tracking, skipped-heading)
were originally added as browser-only and wired only into the overlay
loop. The CLI's jsdom path silently skipped all of them.

Two of the eight rules genuinely need real browser layout
(line-length reads rect.width for chars-per-line; cramped-padding reads
rect.width/height to filter small badges). The other six only need
computed CSS values and pure DOM walks — they can run in jsdom too.

Refactor

- Extract a pure checkQuality(opts) from checkElementQualityDOM, taking
  pre-resolved lineHeightPx and letterSpacingPx so each adapter handles
  its own unit resolution.
- Add resolveFontSizePx(el, win) — walks the parent chain to compute
  effective font-size in pixels, handling px / rem / em / % through
  inheritance. Browsers do this automatically in getComputedStyle, but
  jsdom returns "0.875rem" verbatim, which broke naive parseFloat math.
- Add resolveLengthPx(value, fontSizePx) — generic CSS length → px
  helper used for line-height and letter-spacing in the Node adapter.
- Extract checkPageQualityFromDoc(doc) and add a Node call site so
  skipped-heading fires from the CLI too.
- Add checkElementQuality(el, style, tag, window) Node adapter and wire
  it into detectHtml's element loop.

Tests

- New tests/detect-antipatterns-browser.test.mjs — Puppeteer-backed
  runner that spins up a temporary static server (port 8765, mirrors
  the dev server's /fixtures/* and /js/* routes) and uses detectUrl()
  to load fixtures in headless Chrome. Asserts the two browser-only
  rules (cramped-padding, line-length) that need real layout.
- New tests/fixtures/antipatterns/cramped-padding.html — focused
  side-by-side fixture for the cramped-padding rule. Pass column
  includes a faithful replica of .detection-cmd from the homepage
  (the disputed "small inline pill" case the user is deciding what
  to do with). Test asserts 3 findings: 2 from the obvious flag
  column + 1 from the disputed pill.
- New tests/fixtures/antipatterns/quality.html — merged side-by-side
  replacement for the orphaned quality-should-flag/pass.html files.
  Covers all 7 typography-quality rules. The 6 jsdom-compatible rules
  are asserted in the jsdom test; line-length stays in the Puppeteer
  test.
- Delete the orphaned quality-should-flag.html / quality-should-pass.html.
- Wire the new browser test into bun run test (~2.6s overhead).

Coverage win: the CLI now catches tight-leading, tiny-text,
justified-text, all-caps-body, wide-tracking, and skipped-heading on
real projects, where it previously missed all six.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 00:07:34 -07:00

71 lines
1.9 KiB
JSON

{
"name": "impeccable",
"version": "2.0.6",
"author": "Paul Bakaus",
"description": "Design skills, commands, and anti-pattern detection for AI coding agents",
"keywords": [
"design",
"frontend",
"ux",
"skills",
"ai",
"anti-patterns",
"lint",
"accessibility",
"css",
"html",
"detection",
"ci-cd"
],
"license": "Apache-2.0",
"homepage": "https://impeccable.style",
"repository": {
"type": "git",
"url": "git+https://github.com/pbakaus/impeccable.git"
},
"engines": {
"node": ">=18"
},
"type": "module",
"bin": {
"impeccable": "bin/cli.js"
},
"main": "./src/detect-antipatterns.mjs",
"exports": {
".": "./src/detect-antipatterns.mjs",
"./browser": "./src/detect-antipatterns-browser.js"
},
"files": [
"bin/",
"src/",
"LICENSE"
],
"scripts": {
"build": "bun run scripts/build.js",
"build:browser": "node scripts/build-browser-detector.js",
"build:extension": "node scripts/build-extension.js",
"clean": "rm -rf dist build",
"rebuild": "bun run clean && bun run build",
"dev": "bun run server/index.js",
"preview": "bun run build && wrangler pages dev",
"deploy": "bun run build && wrangler pages deploy build/",
"test": "bun test tests/build.test.js tests/detect-antipatterns.test.js && node --test tests/detect-antipatterns-fixtures.test.mjs && node --test tests/detect-antipatterns-browser.test.mjs",
"prepack": "cp README.md README.repo.md && cp README.npm.md README.md",
"postpack": "cp README.repo.md README.md && rm README.repo.md",
"screenshot": "bun run scripts/screenshot-antipatterns.js",
"og-image": "bun run scripts/generate-og-image.js"
},
"dependencies": {
"jsdom": "^29.0.0"
},
"optionalDependencies": {
"puppeteer": "^24.39.1"
},
"devDependencies": {
"archiver": "^7.0.1",
"motion": "^12.38.0",
"playwright": "^1.58.2",
"wrangler": "^4.75.0"
}
}