impeccable 3.2.0 → 3.2.1
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/README.md +3 -3
- package/README.npm.md +3 -3
- package/README.repo.md +24 -7
- package/cli/bin/commands/skills.mjs +134 -74
- package/cli/engine/cli/main.mjs +31 -0
- package/cli/engine/design-system.mjs +64 -0
- package/cli/engine/detect-antipatterns-browser.js +68 -8
- package/cli/engine/engines/regex/detect-text.mjs +13 -8
- package/cli/engine/registry/antipatterns.mjs +55 -0
- package/cli/engine/rules/checks.mjs +4 -8
- package/cli/engine/shared/fonts.mjs +30 -0
- package/cli/lib/impeccable-config.mjs +4 -2
- package/package.json +8 -8
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
parseRgb,
|
|
19
19
|
relativeLuminance,
|
|
20
20
|
} from '../shared/color.mjs';
|
|
21
|
+
import { extractGoogleFontFamilies } from '../shared/fonts.mjs';
|
|
21
22
|
|
|
22
23
|
const DETECTOR_IS_BROWSER = typeof window !== 'undefined';
|
|
23
24
|
|
|
@@ -2072,14 +2073,9 @@ function checkPageTypography(doc, win) {
|
|
|
2072
2073
|
|
|
2073
2074
|
// Check Google Fonts links in HTML
|
|
2074
2075
|
const html = doc.documentElement?.outerHTML || '';
|
|
2075
|
-
const
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
const families = m[1].split('|').map(f => f.split(':')[0].replace(/\+/g, ' ').toLowerCase());
|
|
2079
|
-
for (const f of families) {
|
|
2080
|
-
fonts.add(f);
|
|
2081
|
-
if (OVERUSED_FONTS.has(f)) overusedFound.add(f);
|
|
2082
|
-
}
|
|
2076
|
+
for (const f of extractGoogleFontFamilies(html)) {
|
|
2077
|
+
fonts.add(f);
|
|
2078
|
+
if (OVERUSED_FONTS.has(f)) overusedFound.add(f);
|
|
2083
2079
|
}
|
|
2084
2080
|
|
|
2085
2081
|
// Also parse raw HTML/style content for font-family (jsdom may not expose all via CSSOM)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const GOOGLE_FONTS_URL_RE = /fonts\.googleapis\.com\/css2?\?[^"'\s)<>]*/gi;
|
|
2
|
+
|
|
3
|
+
function normalizeGoogleFontFamilyParam(value) {
|
|
4
|
+
return String(value || '')
|
|
5
|
+
.split('|')
|
|
6
|
+
.map(part => part.split(':')[0].trim().toLowerCase())
|
|
7
|
+
.filter(Boolean);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function extractGoogleFontFamilies(text) {
|
|
11
|
+
const families = [];
|
|
12
|
+
if (!text) return families;
|
|
13
|
+
|
|
14
|
+
GOOGLE_FONTS_URL_RE.lastIndex = 0;
|
|
15
|
+
let urlMatch;
|
|
16
|
+
while ((urlMatch = GOOGLE_FONTS_URL_RE.exec(text)) !== null) {
|
|
17
|
+
const url = urlMatch[0];
|
|
18
|
+
const queryStart = url.indexOf('?');
|
|
19
|
+
if (queryStart === -1) continue;
|
|
20
|
+
|
|
21
|
+
const params = new URLSearchParams(url.slice(queryStart + 1).replace(/&/g, '&'));
|
|
22
|
+
for (const value of params.getAll('family')) {
|
|
23
|
+
families.push(...normalizeGoogleFontFamilyParam(value));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return families;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { extractGoogleFontFamilies };
|
|
@@ -459,11 +459,13 @@ export function filterDetectionFindings(findings, config) {
|
|
|
459
459
|
function isIgnoredFindingValue(finding, ignoreValues) {
|
|
460
460
|
if (!Array.isArray(ignoreValues) || ignoreValues.length === 0) return false;
|
|
461
461
|
const rule = normalizeIgnoreRule(finding.antipattern);
|
|
462
|
+
if (!rule) return false;
|
|
463
|
+
// File-scoped wildcards suppress rules with no extractable value, such as side-tab.
|
|
462
464
|
const value = extractFindingIgnoreValue(finding);
|
|
463
|
-
if (!rule || !value) return false;
|
|
464
465
|
return ignoreValues.some((entry) => {
|
|
466
|
+
if (entry.rule !== rule) return false;
|
|
465
467
|
const wildcardValue = entry.value === '*';
|
|
466
|
-
if (
|
|
468
|
+
if (!wildcardValue && (!value || !ignoreValueMatches(rule, entry.value, value))) return false;
|
|
467
469
|
if (!Array.isArray(entry.files) || entry.files.length === 0) return !wildcardValue;
|
|
468
470
|
return findingMatchesScopedIgnoreFile(finding, entry.files);
|
|
469
471
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "impeccable",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"author": "Paul Bakaus",
|
|
5
5
|
"description": "Design skills, commands, and anti-pattern detection for AI coding agents",
|
|
6
6
|
"keywords": [
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"url": "git+https://github.com/pbakaus/impeccable.git"
|
|
25
25
|
},
|
|
26
26
|
"engines": {
|
|
27
|
-
"node": ">=
|
|
27
|
+
"node": ">=22.12.0"
|
|
28
28
|
},
|
|
29
29
|
"type": "module",
|
|
30
30
|
"bin": {
|
|
@@ -89,14 +89,14 @@
|
|
|
89
89
|
"puppeteer": "^25.1.0"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
|
-
"@ai-sdk/anthropic": "^
|
|
93
|
-
"@ai-sdk/google": "^
|
|
94
|
-
"@ai-sdk/openai": "^
|
|
92
|
+
"@ai-sdk/anthropic": "^4.0.7",
|
|
93
|
+
"@ai-sdk/google": "^4.0.8",
|
|
94
|
+
"@ai-sdk/openai": "^4.0.7",
|
|
95
95
|
"@anthropic-ai/claude-agent-sdk": "^0.3.165",
|
|
96
|
-
"@anthropic-ai/sdk": "^0.
|
|
96
|
+
"@anthropic-ai/sdk": "^0.110.0",
|
|
97
97
|
"@google/genai": "^2.8.0",
|
|
98
|
-
"@paper-design/shaders": "^0.0.
|
|
99
|
-
"ai": "^
|
|
98
|
+
"@paper-design/shaders": "^0.0.77",
|
|
99
|
+
"ai": "^7.0.14",
|
|
100
100
|
"archiver": "^8.0.0",
|
|
101
101
|
"astro": "^7.0.0",
|
|
102
102
|
"fontkit": "^2.0.4",
|