impeccable 3.5.0 → 3.6.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 +4 -4
- package/README.npm.md +4 -4
- package/README.repo.md +61 -10
- package/cli/bin/cli.js +6 -0
- package/cli/bin/commands/ignores.mjs +4 -0
- package/cli/bin/commands/skills.mjs +294 -82
- package/cli/engine/browser/injected/index.mjs +192 -11
- package/cli/engine/cli/main.mjs +10 -16
- package/cli/engine/design-system.mjs +339 -11
- package/cli/engine/detect-antipatterns-browser.js +1482 -722
- package/cli/engine/detect-antipatterns.mjs +1 -0
- package/cli/engine/engines/browser/detect-url.mjs +64 -2
- package/cli/engine/engines/regex/detect-text.mjs +580 -29
- package/cli/engine/engines/static-html/css-cascade.mjs +62 -7
- package/cli/engine/engines/static-html/detect-html.mjs +31 -7
- package/cli/engine/node/file-system.mjs +23 -22
- package/cli/engine/registry/antipatterns.mjs +18 -0
- package/cli/engine/rules/checks.mjs +471 -370
- package/cli/engine/shared/color.mjs +474 -2
- package/cli/engine/shared/constants.mjs +17 -2
- package/cli/lib/download-providers.js +8 -0
- package/cli/lib/impeccable-config.mjs +41 -59
- package/package.json +5 -4
|
@@ -206,10 +206,10 @@ function parseIgnoreColor(value) {
|
|
|
206
206
|
if (rgb) {
|
|
207
207
|
const parts = splitColorArgs(rgb[1]);
|
|
208
208
|
if (parts.length < 3 || parts.length > 4) return null;
|
|
209
|
-
const r =
|
|
210
|
-
const g =
|
|
211
|
-
const b =
|
|
212
|
-
const a = parts[3] === undefined ? 1 :
|
|
209
|
+
const r = parseColorChannel(parts[0], COLOR_CHANNEL_FORMATS.rgb);
|
|
210
|
+
const g = parseColorChannel(parts[1], COLOR_CHANNEL_FORMATS.rgb);
|
|
211
|
+
const b = parseColorChannel(parts[2], COLOR_CHANNEL_FORMATS.rgb);
|
|
212
|
+
const a = parts[3] === undefined ? 1 : parseColorChannel(parts[3], COLOR_CHANNEL_FORMATS.alpha);
|
|
213
213
|
if ([r, g, b, a].some((v) => v === null)) return null;
|
|
214
214
|
return { r, g, b, a };
|
|
215
215
|
}
|
|
@@ -218,10 +218,10 @@ function parseIgnoreColor(value) {
|
|
|
218
218
|
if (hsl) {
|
|
219
219
|
const parts = splitColorArgs(hsl[1]);
|
|
220
220
|
if (parts.length < 3 || parts.length > 4) return null;
|
|
221
|
-
const h =
|
|
222
|
-
const s =
|
|
223
|
-
const l =
|
|
224
|
-
const a = parts[3] === undefined ? 1 :
|
|
221
|
+
const h = parseColorChannel(parts[0], COLOR_CHANNEL_FORMATS.hue);
|
|
222
|
+
const s = parseColorChannel(parts[1], COLOR_CHANNEL_FORMATS.percent);
|
|
223
|
+
const l = parseColorChannel(parts[2], COLOR_CHANNEL_FORMATS.percent);
|
|
224
|
+
const a = parts[3] === undefined ? 1 : parseColorChannel(parts[3], COLOR_CHANNEL_FORMATS.alpha);
|
|
225
225
|
if ([h, s, l, a].some((v) => v === null)) return null;
|
|
226
226
|
return hslToRgb(h, s, l, a);
|
|
227
227
|
}
|
|
@@ -230,18 +230,13 @@ function parseIgnoreColor(value) {
|
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
function parseHexIgnoreColor(hex) {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
}
|
|
240
|
-
const r = parseInt(hex.slice(0, 2), 16);
|
|
241
|
-
const g = parseInt(hex.slice(2, 4), 16);
|
|
242
|
-
const b = parseInt(hex.slice(4, 6), 16);
|
|
243
|
-
const a = hex.length === 8 ? parseInt(hex.slice(6, 8), 16) / 255 : 1;
|
|
244
|
-
return { r, g, b, a };
|
|
233
|
+
const expanded = hex.length <= 4
|
|
234
|
+
? [...hex].map((digit) => digit.repeat(2)).join('')
|
|
235
|
+
: hex;
|
|
236
|
+
const [r, g, b, alpha = 255] = expanded
|
|
237
|
+
.match(/../g)
|
|
238
|
+
.map((channel) => Number.parseInt(channel, 16));
|
|
239
|
+
return { r, g, b, a: alpha / 255 };
|
|
245
240
|
}
|
|
246
241
|
|
|
247
242
|
function splitColorArgs(body) {
|
|
@@ -259,47 +254,34 @@ function splitColorArgs(body) {
|
|
|
259
254
|
return text.replace(/\s*\/\s*/g, ' / ').split(/\s+/).filter((part) => part && part !== '/');
|
|
260
255
|
}
|
|
261
256
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
return alpha >= 0 && alpha <= 1 ? alpha : null;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
function parseHueChannel(raw) {
|
|
284
|
-
const text = String(raw || '').trim();
|
|
285
|
-
const match = text.match(/^(-?\d*\.?\d+)(deg|rad|turn|grad)?$/);
|
|
286
|
-
if (!match) return null;
|
|
287
|
-
const value = Number.parseFloat(match[1]);
|
|
288
|
-
if (!Number.isFinite(value)) return null;
|
|
289
|
-
const unit = match[2] || 'deg';
|
|
290
|
-
if (unit === 'turn') return value * 360;
|
|
291
|
-
if (unit === 'rad') return value * (180 / Math.PI);
|
|
292
|
-
if (unit === 'grad') return value * 0.9;
|
|
293
|
-
return value;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
function parsePercentChannel(raw) {
|
|
257
|
+
const CSS_NUMBER_RE = /^(-?\d*\.?\d+)(%|deg|rad|turn|grad)?$/;
|
|
258
|
+
const identity = (value) => value;
|
|
259
|
+
const COLOR_CHANNEL_FORMATS = {
|
|
260
|
+
rgb: { units: { '': identity, '%': (value) => value * 2.55 }, min: 0, max: 255, round: true },
|
|
261
|
+
alpha: { units: { '': identity, '%': (value) => value / 100 }, min: 0, max: 1 },
|
|
262
|
+
hue: {
|
|
263
|
+
units: {
|
|
264
|
+
'': identity,
|
|
265
|
+
deg: identity,
|
|
266
|
+
rad: (value) => value * (180 / Math.PI),
|
|
267
|
+
turn: (value) => value * 360,
|
|
268
|
+
grad: (value) => value * 0.9,
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
percent: { units: { '%': (value) => value / 100 }, min: 0, max: 1 },
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
function parseColorChannel(raw, { units, min = -Infinity, max = Infinity, round = false }) {
|
|
297
275
|
const text = String(raw || '').trim();
|
|
298
|
-
const match = text.match(
|
|
276
|
+
const match = text.match(CSS_NUMBER_RE);
|
|
299
277
|
if (!match) return null;
|
|
300
|
-
const
|
|
301
|
-
if (!
|
|
302
|
-
|
|
278
|
+
const convert = units[match[2] || ''];
|
|
279
|
+
if (!convert) return null;
|
|
280
|
+
const number = Number.parseFloat(match[1]);
|
|
281
|
+
if (!Number.isFinite(number)) return null;
|
|
282
|
+
const value = convert(number);
|
|
283
|
+
if (value < min || value > max) return null;
|
|
284
|
+
return round ? Math.round(value) : value;
|
|
303
285
|
}
|
|
304
286
|
|
|
305
287
|
function hslToRgb(hue, saturation, lightness, alpha) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "impeccable",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.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": ">=22.
|
|
27
|
+
"node": ">=22.18.0"
|
|
28
28
|
},
|
|
29
29
|
"type": "module",
|
|
30
30
|
"bin": {
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"test:live": "node scripts/run-tests.mjs live",
|
|
57
57
|
"test:cli-e2e": "node scripts/run-tests.mjs cli-e2e",
|
|
58
58
|
"test:cli-remote-e2e": "node scripts/run-tests.mjs cli-remote-e2e",
|
|
59
|
+
"test:plugin-e2e": "node scripts/run-tests.mjs plugin-e2e",
|
|
59
60
|
"test:live-e2e": "node scripts/run-tests.mjs live-e2e",
|
|
60
61
|
"test:live-e2e-accept-cleanup": "node scripts/run-tests.mjs live-e2e-accept-cleanup",
|
|
61
62
|
"test:new-work-e2e": "node scripts/run-tests.mjs new-work-e2e",
|
|
@@ -88,8 +89,8 @@
|
|
|
88
89
|
"@ai-sdk/google": "^4.0.8",
|
|
89
90
|
"@ai-sdk/openai": "^4.0.7",
|
|
90
91
|
"@anthropic-ai/claude-agent-sdk": "^0.3.165",
|
|
91
|
-
"@anthropic-ai/sdk": "^0.
|
|
92
|
-
"@babel/parser": "^
|
|
92
|
+
"@anthropic-ai/sdk": "^0.122.0",
|
|
93
|
+
"@babel/parser": "^8.0.4",
|
|
93
94
|
"ai": "^7.0.14",
|
|
94
95
|
"archiver": "^8.0.0",
|
|
95
96
|
"playwright": "^1.59.1",
|