@designesy/score 0.6.0 → 0.7.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/README.md +5 -5
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +5 -5
- package/dist/engine.d.ts +15 -6
- package/dist/engine.js +1964 -150
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @designesy/score
|
|
2
2
|
|
|
3
|
-
Standalone
|
|
3
|
+
Standalone 44-check design-contract scoring engine. Fetches a URL, extracts CSS + `:root` tokens, runs all checks locally, with **no server required**. Zero dependencies.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -54,14 +54,14 @@ console.log(result.fail); // 3
|
|
|
54
54
|
console.log(result.checks); // [{ id: 'v01', status: 'PASS', detail: '...' }, ...]
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
## The
|
|
57
|
+
## The 44 checks
|
|
58
58
|
|
|
59
59
|
| Category | Checks | Weight |
|
|
60
60
|
|---|---|---|
|
|
61
61
|
| cadence | v14, v15, v16, v17, v18, v19, v20, v26, v28, x01, x02, x03 | 18 |
|
|
62
|
-
| accessibility | v06, v22, v24, v25, v27, v35 | 15 |
|
|
62
|
+
| accessibility | v06, v22, v24, v25, v27, v35, v44 | 15 |
|
|
63
63
|
| semantic | v42, v43 | 12 |
|
|
64
|
-
| motion | v05, v11, v12, v23 | 10 |
|
|
64
|
+
| motion | v05, v11, v12, v23, v45 | 10 |
|
|
65
65
|
| tokens | v01, v29 | 9 |
|
|
66
66
|
| takt | v10, v13 | 8 |
|
|
67
67
|
| copywriting | v38, v39, v40, v41 | 8 |
|
|
@@ -85,7 +85,7 @@ Plus 12 anti-slop deductions (S1 to S12) and 7 originality lifts (O1 to O7).
|
|
|
85
85
|
|
|
86
86
|
## Scope system
|
|
87
87
|
|
|
88
|
-
- **contract** (default for designesy.org): All
|
|
88
|
+
- **contract** (default for designesy.org): All 44 checks active. Absence = WARN/FAIL.
|
|
89
89
|
- **universal** (default for external sites): Optional features SKIP on absence instead of penalizing.
|
|
90
90
|
|
|
91
91
|
Auto-detect: `designesy.org` → contract, everything else → universal.
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* @designesy/score CLI — Score a URL against the
|
|
3
|
+
* @designesy/score CLI — Score a URL against the 44-check Designesy engine.
|
|
4
4
|
*
|
|
5
|
-
* Runs the full
|
|
5
|
+
* Runs the full 44-check scoring engine locally — no server required.
|
|
6
6
|
* Fetches the target URL, extracts CSS + :root tokens, runs all checks,
|
|
7
7
|
* and prints a formatted report. Exits with code 1 when the score drops
|
|
8
8
|
* below --min-score or the grade drops below --min-grade.
|
package/dist/cli.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* @designesy/score CLI — Score a URL against the
|
|
3
|
+
* @designesy/score CLI — Score a URL against the 44-check Designesy engine.
|
|
4
4
|
*
|
|
5
|
-
* Runs the full
|
|
5
|
+
* Runs the full 44-check scoring engine locally — no server required.
|
|
6
6
|
* Fetches the target URL, extracts CSS + :root tokens, runs all checks,
|
|
7
7
|
* and prints a formatted report. Exits with code 1 when the score drops
|
|
8
8
|
* below --min-score or the grade drops below --min-grade.
|
|
@@ -98,10 +98,10 @@ function formatReport(result, url) {
|
|
|
98
98
|
}
|
|
99
99
|
function printUsage() {
|
|
100
100
|
console.log(`
|
|
101
|
-
designesy-score: Score a URL against the
|
|
101
|
+
designesy-score: Score a URL against the 44-check Designesy engine.
|
|
102
102
|
|
|
103
103
|
Runs locally: no server required. Fetches the URL, extracts CSS + tokens,
|
|
104
|
-
and runs all
|
|
104
|
+
and runs all 44 checks in one process.
|
|
105
105
|
|
|
106
106
|
Usage:
|
|
107
107
|
designesy-score <url> [options]
|
|
@@ -192,7 +192,7 @@ async function main() {
|
|
|
192
192
|
// Progress and the gate verdict go to stderr: stdout carries only the
|
|
193
193
|
// result, so --json and the JSON formats pipe straight into a parser.
|
|
194
194
|
if (!args.quiet) {
|
|
195
|
-
console.error(`${DIM}Scoring ${url} locally (
|
|
195
|
+
console.error(`${DIM}Scoring ${url} locally (44-check engine, scope=${scope || 'auto'})…${RESET}`);
|
|
196
196
|
}
|
|
197
197
|
let result;
|
|
198
198
|
try {
|
package/dist/engine.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @designesy/score —
|
|
2
|
+
* @designesy/score — 44-check design-contract scoring engine.
|
|
3
3
|
*
|
|
4
4
|
* Scores a URL against the Designesy design-system contract: fetches the page,
|
|
5
|
-
* extracts CSS + :root tokens, runs
|
|
6
|
-
* score (0-100), assigns a letter grade (A-F),
|
|
7
|
-
* + originality lifts.
|
|
5
|
+
* extracts CSS + :root tokens, runs 44 checks (41 scored, 3 that need a
|
|
6
|
+
* browser), computes a weighted score (0-100), assigns a letter grade (A-F),
|
|
7
|
+
* and applies anti-slop deductions + originality lifts.
|
|
8
8
|
*
|
|
9
9
|
* Zero dependencies. Uses node:https (not fetch/undici) to avoid the Windows
|
|
10
10
|
* libuv crash during process exit.
|
|
@@ -26,6 +26,13 @@ export type CheckResult = {
|
|
|
26
26
|
detail: string;
|
|
27
27
|
weight?: number;
|
|
28
28
|
remediation?: string;
|
|
29
|
+
/** Structured findings (v44, v45), capped at 20 with the rest counted in `truncated`. */
|
|
30
|
+
evidence?: CheckEvidence;
|
|
31
|
+
};
|
|
32
|
+
/** Structured findings a check attaches (v44, v45), capped at 20 with the rest counted. */
|
|
33
|
+
export type CheckEvidence = {
|
|
34
|
+
findings: Array<Record<string, string | number | null>>;
|
|
35
|
+
truncated: number;
|
|
29
36
|
};
|
|
30
37
|
export type ScoreResult = {
|
|
31
38
|
/**
|
|
@@ -147,9 +154,11 @@ export declare function scoreFromParts(input: ScorePartsInput): Promise<ScoreRes
|
|
|
147
154
|
/**
|
|
148
155
|
* The contract revision these checks implement, reported by every emission.
|
|
149
156
|
* The site derives its copy from the contract source; this standalone engine
|
|
150
|
-
* pins it here, once, and each release moves it.
|
|
157
|
+
* pins it here, once, and each release moves it. 0.6.0 shipped v0.4.1 while
|
|
158
|
+
* the site served v0.4.3; test/engine-1-2-0.test.mjs now reads the site's
|
|
159
|
+
* contract source and fails when the two differ.
|
|
151
160
|
*/
|
|
152
|
-
export declare const CONTRACT_VERSION = "v0.4.
|
|
161
|
+
export declare const CONTRACT_VERSION = "v0.4.3";
|
|
153
162
|
/**
|
|
154
163
|
* The one verdict rule, shared by every emission format.
|
|
155
164
|
*
|