@impeccable/detect 2.0.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/LICENSE ADDED
@@ -0,0 +1,77 @@
1
+ Business Source License 1.1
2
+
3
+ Parameters
4
+
5
+ Licensor: Paul Bakaus
6
+ Licensed Work: Impeccable Detect 2.0.2
7
+ The Licensed Work is (c) 2026 Paul Bakaus.
8
+ Additional Use Grant: You may make use of the Licensed Work, provided that
9
+ you do not use the Licensed Work for a Commercial
10
+ Purpose.
11
+
12
+ A "Commercial Purpose" means use of the Licensed Work
13
+ that meets ALL of the following conditions:
14
+ (a) the use is within or on behalf of an organization
15
+ with more than five (5) individuals (employees,
16
+ contractors, or agents) who access, interact with,
17
+ or benefit from the Licensed Work; AND
18
+ (b) that organization has annual recurring revenue
19
+ exceeding one million US dollars ($1,000,000 USD).
20
+
21
+ For the avoidance of doubt, the following are NOT
22
+ Commercial Purposes regardless of organization size
23
+ or revenue:
24
+ - Personal, educational, or evaluation use
25
+ - Use in open source projects licensed under an
26
+ OSI-approved license
27
+ - Non-commercial research
28
+
29
+ Change Date: 2030-04-03
30
+ Change License: Apache License, Version 2.0
31
+
32
+ For information about alternative licensing arrangements for the Licensed
33
+ Work, please contact paul.bakaus@gmail.com.
34
+
35
+ -----------------------------------------------------------------------------
36
+
37
+ Terms
38
+
39
+ The Licensor hereby grants you the right to copy, modify, create derivative
40
+ works, redistribute, and make non-production use of the Licensed Work. The
41
+ Licensor may make an Additional Use Grant, above, permitting limited
42
+ production use.
43
+
44
+ Effective on the Change Date, or the fourth anniversary of the first publicly
45
+ available distribution of a specific version of the Licensed Work under this
46
+ License, whichever comes first, the Licensor hereby grants you rights under
47
+ the terms of the Change License, and the rights granted in the paragraph
48
+ above terminate.
49
+
50
+ If your use of the Licensed Work does not comply with the requirements
51
+ currently in effect as described in this License, you must purchase a
52
+ commercial license from the Licensor, its affiliated entities, or authorized
53
+ resellers, or you must refrain from using the Licensed Work.
54
+
55
+ All copies of the original and modified Licensed Work, and derivative works
56
+ of the Licensed Work, are subject to this License. This License applies
57
+ separately for each version of the Licensed Work and the Change Date may vary
58
+ for each version of the Licensed Work released by Licensor.
59
+
60
+ You must conspicuously display this License on each original or modified copy
61
+ of the Licensed Work. If you receive the Licensed Work in original or
62
+ modified form from a third party, the terms and conditions set forth in this
63
+ License apply to your use of that work.
64
+
65
+ Any use of the Licensed Work in violation of this License will automatically
66
+ terminate your rights under this License for the current and all other
67
+ versions of the Licensed Work.
68
+
69
+ This License does not grant you any right in any trademark or logo of
70
+ Licensor or its affiliates (provided that you may use a trademark or logo of
71
+ Licensor as expressly required by this License).
72
+
73
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
74
+ AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
75
+ EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
76
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
77
+ TITLE.
package/README.md ADDED
@@ -0,0 +1,64 @@
1
+ # @impeccable/detect
2
+
3
+ Deterministic UI anti-pattern detector. Catches AI slop (side-tab borders, purple gradients, bounce easing, dark glows) and general design quality issues (line length, cramped padding, skipped headings, and more) across HTML, CSS, JSX, TSX, Vue, and Svelte files.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @impeccable/detect
9
+ ```
10
+
11
+ ## CLI Usage
12
+
13
+ ```bash
14
+ npx @impeccable/detect src/ # scan a directory
15
+ npx @impeccable/detect index.html # scan an HTML file
16
+ npx @impeccable/detect https://example.com # scan a URL (Puppeteer)
17
+ npx @impeccable/detect --fast --json . # regex-only, JSON output
18
+ ```
19
+
20
+ ### Options
21
+
22
+ - `--fast` -- Regex-only mode (skip jsdom, faster but misses linked stylesheets)
23
+ - `--json` -- Output results as JSON (for CI/CD integration)
24
+ - `--help` -- Show help
25
+
26
+ ### Detection modes
27
+
28
+ | Input | Method | Best for |
29
+ |---|---|---|
30
+ | HTML files | jsdom + computed styles | Full accuracy, catches linked CSS |
31
+ | Non-HTML files | Regex pattern matching | JSX, TSX, Vue, Svelte, CSS-in-JS |
32
+ | URLs | Puppeteer rendering | Production sites, full browser fidelity |
33
+ | `--fast` | Regex for all files | Speed, CI/CD pipelines |
34
+
35
+ ### Exit codes
36
+
37
+ - `0` -- No anti-patterns found
38
+ - `2` -- Anti-patterns detected
39
+
40
+ ### Framework detection
41
+
42
+ When scanning a directory, the CLI detects framework configs (Next.js, Vite, SvelteKit, Nuxt, Astro, Angular, Remix) and suggests scanning the running dev server via URL for more accurate results.
43
+
44
+ ## Programmatic Usage
45
+
46
+ ```js
47
+ import { detectText, detectHtml } from '@impeccable/detect';
48
+
49
+ // Scan a string (regex-based)
50
+ const findings = detectText(cssContent, 'styles.css');
51
+
52
+ // Scan an HTML file (jsdom-based)
53
+ const findings = await detectHtml('path/to/index.html');
54
+ ```
55
+
56
+ ## What it detects
57
+
58
+ 25 anti-patterns across borders, color, typography, layout, motion, and quality.
59
+
60
+ ## License
61
+
62
+ [BSL 1.1](./LICENSE) -- free for individuals, open source projects, and small teams (5 or fewer people, or under $1M ARR). Commercial license required for larger organizations. Converts to Apache 2.0 on 2030-04-03.
63
+
64
+ Part of the [Impeccable](https://impeccable.style) project.
package/bin/cli.js ADDED
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @impeccable/detect CLI
5
+ *
6
+ * Usage:
7
+ * npx @impeccable/detect [file-or-dir-or-url...] # scan for anti-patterns
8
+ * npx @impeccable/detect live [--port=PORT] # start browser overlay server
9
+ * npx @impeccable/detect --help
10
+ */
11
+
12
+ import { detectCli, liveCli } from '../src/detect-antipatterns.mjs';
13
+
14
+ const command = process.argv[2];
15
+
16
+ if (command === 'live') {
17
+ // Shift args so liveCli sees --port etc. in the right positions
18
+ process.argv.splice(2, 1);
19
+ await liveCli();
20
+ } else {
21
+ await detectCli();
22
+ }
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@impeccable/detect",
3
+ "version": "2.0.3",
4
+ "description": "Deterministic UI anti-pattern detector for design quality analysis",
5
+ "author": "Paul Bakaus",
6
+ "license": "BSL-1.1",
7
+ "type": "module",
8
+ "bin": {
9
+ "impeccable-detect": "bin/cli.js"
10
+ },
11
+ "main": "./src/detect-antipatterns.mjs",
12
+ "exports": {
13
+ ".": "./src/detect-antipatterns.mjs",
14
+ "./browser": "./src/detect-antipatterns-browser.js"
15
+ },
16
+ "files": [
17
+ "bin/",
18
+ "src/",
19
+ "LICENSE"
20
+ ],
21
+ "dependencies": {
22
+ "jsdom": "^29.0.0"
23
+ },
24
+ "optionalDependencies": {
25
+ "puppeteer": "^24.39.1"
26
+ },
27
+ "scripts": {
28
+ "test": "bun test tests/detect-antipatterns.test.js && node --test tests/detect-antipatterns-fixtures.test.mjs",
29
+ "build:browser": "node scripts/build-browser-detector.js"
30
+ },
31
+ "keywords": [
32
+ "design",
33
+ "frontend",
34
+ "ux",
35
+ "anti-patterns",
36
+ "lint",
37
+ "accessibility",
38
+ "css",
39
+ "html",
40
+ "detection",
41
+ "ci-cd"
42
+ ],
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "git+https://github.com/pbakaus/impeccable-detect.git"
46
+ },
47
+ "engines": {
48
+ "node": ">=18.0.0"
49
+ }
50
+ }