designlang 12.4.0 → 12.8.0
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/.claude-plugin/marketplace.json +15 -7
- package/.claude-plugin/plugin.json +19 -8
- package/CHANGELOG.md +254 -0
- package/README.md +34 -4
- package/SUPPORT.md +22 -0
- package/bin/design-extract.js +295 -0
- package/commands/battle.md +27 -0
- package/commands/brand.md +59 -0
- package/commands/extract.md +41 -0
- package/commands/grade.md +29 -0
- package/commands/pack.md +37 -0
- package/commands/pair.md +68 -0
- package/commands/remix.md +29 -0
- package/commands/theme-swap.md +42 -0
- package/package.json +3 -3
- package/src/ci.js +36 -2
- package/src/formatters/brand-book.js +1052 -0
- package/src/formatters/pair.js +331 -0
- package/src/formatters/theme-swap.js +272 -0
- package/src/fuse.js +154 -0
- package/src/recolor.js +199 -0
- package/src/utils/color-gamut.js +64 -0
package/src/ci.js
CHANGED
|
@@ -32,9 +32,43 @@ export async function runCi(url, opts) {
|
|
|
32
32
|
out.push(`## designlang · design regression guard`);
|
|
33
33
|
out.push(`\n**URL:** \`${url}\` \n**Run:** ${new Date().toISOString()}\n`);
|
|
34
34
|
|
|
35
|
-
// 1. Extract
|
|
35
|
+
// 1. Extract — guard the throw site so CI artifacts never come back empty.
|
|
36
|
+
// Playwright can crash on flaky networks, ad-walled URLs, or self-signed
|
|
37
|
+
// proxies; when that happens we still want a report file + a summary.json
|
|
38
|
+
// so downstream jobs (artifact uploads, status comments, dashboards) have
|
|
39
|
+
// something to point at. We preserve the original error via `cause` so the
|
|
40
|
+
// stack survives — losing the trace was a real problem with #76's draft.
|
|
36
41
|
const { extractDesignLanguage } = await import('./index.js');
|
|
37
|
-
|
|
42
|
+
let design;
|
|
43
|
+
try {
|
|
44
|
+
design = await extractDesignLanguage(url);
|
|
45
|
+
} catch (err) {
|
|
46
|
+
const stack = err?.stack || String(err);
|
|
47
|
+
out.push(section('Extraction', [
|
|
48
|
+
`_failed — ${err.message}_`,
|
|
49
|
+
'',
|
|
50
|
+
'```',
|
|
51
|
+
stack,
|
|
52
|
+
'```',
|
|
53
|
+
].join('\n')));
|
|
54
|
+
const md = out.join('\n');
|
|
55
|
+
const mdPath = join(outDir, 'ci-report.md');
|
|
56
|
+
writeFileSync(mdPath, md, 'utf-8');
|
|
57
|
+
const summary = {
|
|
58
|
+
url,
|
|
59
|
+
score: null,
|
|
60
|
+
grade: null,
|
|
61
|
+
driftVerdict: 'unknown',
|
|
62
|
+
extractionFailed: true,
|
|
63
|
+
error: err.message,
|
|
64
|
+
timestamp: new Date().toISOString(),
|
|
65
|
+
};
|
|
66
|
+
writeFileSync(join(outDir, 'ci-summary.json'), JSON.stringify(summary, null, 2), 'utf-8');
|
|
67
|
+
if (process.env.GITHUB_STEP_SUMMARY) {
|
|
68
|
+
try { writeFileSync(process.env.GITHUB_STEP_SUMMARY, md, { flag: 'a' }); } catch {}
|
|
69
|
+
}
|
|
70
|
+
return { mdPath, md, summary, shouldFail: true, cause: err };
|
|
71
|
+
}
|
|
38
72
|
|
|
39
73
|
// 2. Score block
|
|
40
74
|
if (design.score) {
|