@design-parity/baseline 0.1.49 → 0.1.51
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 +56 -4
- package/dist/bootstrap.js.map +1 -1
- package/dist/cli/bootstrap.js.map +1 -1
- package/dist/cli/propose-refs.d.ts +3 -0
- package/dist/cli/propose-refs.d.ts.map +1 -0
- package/dist/cli/propose-refs.js +228 -0
- package/dist/cli/propose-refs.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/ref-proposals.d.ts +131 -0
- package/dist/ref-proposals.d.ts.map +1 -0
- package/dist/ref-proposals.js +213 -0
- package/dist/ref-proposals.js.map +1 -0
- package/dist/seed.js.map +1 -1
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -55,12 +55,64 @@ The live CMP render path (preferring `compose-preview`'s desktop/JVM render in
|
|
|
55
55
|
`@design-parity/candidate` when capable, plus a Compose-for-Web/wasm spike) is
|
|
56
56
|
deferred — it needs the JVM/Compose toolchain. See [docs/cmp.md](./docs/cmp.md).
|
|
57
57
|
|
|
58
|
+
## Proposing references
|
|
59
|
+
|
|
60
|
+
A `design-map.json` entry is only useful once it names a real node, and node ids
|
|
61
|
+
are not discoverable without API access: a design tool's MCP server exposes only
|
|
62
|
+
the page a user is looking at, and Code Connect — which would hand the mapping
|
|
63
|
+
back directly — is gated behind a paid seat. So something has to guess which
|
|
64
|
+
node goes with which component.
|
|
65
|
+
|
|
66
|
+
`design-parity-propose-refs` is that guess. It fetches the design file's
|
|
67
|
+
components, ranks them against each code component by name, and prints the
|
|
68
|
+
`reference = "figma:<fileKey>/<nodeId>"` line to paste. It **writes nothing** —
|
|
69
|
+
the reference belongs wherever the repo keeps correspondence (an annotation, a
|
|
70
|
+
`design-map.json` entry), put there by a human who read the table.
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
FIGMA_TOKEN=figd_… design-parity-propose-refs \
|
|
74
|
+
--file ocdacdEsnHipMJD3egzxKb \
|
|
75
|
+
--previews catalog/build/compose-previews/previews.json
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Subjects come from a compose-preview manifest (`--previews`), a convention scan
|
|
79
|
+
of the repo (`--dir`, the same discovery the bootstrap review list uses), or one
|
|
80
|
+
name at a time (`--subject`). Candidates come from `/v1/files/:key/components`
|
|
81
|
+
when the file publishes any, and from a page-by-page tree walk when it doesn't —
|
|
82
|
+
a community duplicate subscribes to the original library rather than
|
|
83
|
+
republishing it, and publishes nothing.
|
|
84
|
+
|
|
85
|
+
Ranking is token overlap over the shorter name, weighted: icons are dropped
|
|
86
|
+
outright (a glyph named `radio_button_checked` otherwise beats the real
|
|
87
|
+
`Checkbox` set on "Checkbox Checked"), and building blocks, other platforms' XR
|
|
88
|
+
components, and a kit's private `.`-prefixed components are demoted rather than
|
|
89
|
+
dropped so they can still win when nothing else fits. Ties go to the candidate
|
|
90
|
+
accounting for more of the subject — between `Button` and `Button - elevated`
|
|
91
|
+
for a `Button/Elevated`, the specific one — and a short stemmer bridges the two
|
|
92
|
+
spellings a boundary produces (`Checkboxes` for `Checkbox`, `outline` for
|
|
93
|
+
`Outlined`).
|
|
94
|
+
|
|
95
|
+
Measured against the 116 references a human accepted by hand for the
|
|
96
|
+
[m3-catalog](https://github.com/yschimke/m3-catalog) Material 3 kit, the top
|
|
97
|
+
proposal is the accepted node for 79 of them and it appears somewhere in the
|
|
98
|
+
three for 110. That measurement is a committed fixture
|
|
99
|
+
([`test/fixtures/m3-ref-proposals.json`](./test/fixtures/m3-ref-proposals.json))
|
|
100
|
+
with floors asserted in CI, so a change to the ranking has to say what it costs.
|
|
101
|
+
|
|
102
|
+
The `GOOD`/`MAYBE`/`LOW` label is a confidence band, not a verdict: a kit names
|
|
103
|
+
by its own taxonomy (`Button - tonal`, `Connected button group`), which does not
|
|
104
|
+
always agree with a component's documented name. The remaining misses are mostly
|
|
105
|
+
components whose accepted reference is not a component set at all — a specimen
|
|
106
|
+
sheet, one node inside a set — which no name match can reach.
|
|
107
|
+
|
|
58
108
|
## CLI
|
|
59
109
|
|
|
60
110
|
```sh
|
|
61
|
-
design-parity-bootstrap
|
|
111
|
+
design-parity-bootstrap [--dir <path>] [--direction design-led|code-led] [--yes] [--force]
|
|
112
|
+
design-parity-propose-refs --file <fileKey> [--previews <path> | --dir <path> | --subject <name>…]
|
|
113
|
+
[--limit <n>] [--json]
|
|
62
114
|
```
|
|
63
115
|
|
|
64
|
-
Interactive setup, run once locally; commit the artifacts it writes.
|
|
65
|
-
to run in CI — the GitHub Action enforces
|
|
66
|
-
bootstraps.
|
|
116
|
+
Interactive setup, run once locally; commit the artifacts it writes.
|
|
117
|
+
`design-parity-bootstrap` refuses to run in CI — the GitHub Action enforces
|
|
118
|
+
committed artifacts, it never bootstraps.
|
package/dist/bootstrap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,EACL,WAAW,EACX,WAAW,EACX,eAAe,EACf,WAAW,GACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAElE,OAAO,EAAE,sBAAsB,EAAE,MAA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,GAAG,EAAE,CAAC;QACd,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,WAAW,OAAO,CAAC,MAAM,eAAe,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;QAC9E,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;YACzC,OAAO,CAAC,CAAC;QACX,CAAC;IACH,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;IACjE,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO;QAAE,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IAC5D,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO;QAAE,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IACrE,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;IACvD,OAAO,CAAC,CAAC;AACX,CAAC;AAED,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propose-refs.d.ts","sourceRoot":"","sources":["../../src/cli/propose-refs.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* CLI: propose a design reference per code component — interactively.
|
|
4
|
+
*
|
|
5
|
+
* design-parity-propose-refs --file <fileKey> [subject source] [options]
|
|
6
|
+
*
|
|
7
|
+
* It prints proposals and **writes nothing**. The reference belongs next to the
|
|
8
|
+
* component, in whatever the repo's own correspondence artifact is — an
|
|
9
|
+
* annotation, a `design-map.json` entry — and a human puts it there after
|
|
10
|
+
* reading the table. A kit names components by its own taxonomy (`Button -
|
|
11
|
+
* tonal`, `Connected button group`), which does not always agree with the
|
|
12
|
+
* documented component names, so a high score is a proposal and not a fact.
|
|
13
|
+
*
|
|
14
|
+
* Interactive setup only, like the rest of `baseline`: it needs a Figma token
|
|
15
|
+
* and network, and it produces something a human reviews. Nothing on the
|
|
16
|
+
* unattended Action path calls it.
|
|
17
|
+
*/
|
|
18
|
+
import { readFile } from "node:fs/promises";
|
|
19
|
+
import { argv, env, exit, stdout } from "node:process";
|
|
20
|
+
import { FigmaRestClient } from "@design-parity/adapter-figma";
|
|
21
|
+
import { candidatesFromTree, confidenceOf, rankCandidates, subjectFor, subjectsFromPreviewManifest, } from "../ref-proposals.js";
|
|
22
|
+
import { discoverCodeComponents } from "../seed.js";
|
|
23
|
+
const HELP = `design-parity-propose-refs — propose a design reference per code component
|
|
24
|
+
|
|
25
|
+
Usage:
|
|
26
|
+
design-parity-propose-refs --file <fileKey> [subject source] [options]
|
|
27
|
+
|
|
28
|
+
Subject sources (pick one; defaults to --dir .):
|
|
29
|
+
--previews <path> compose-preview manifest (previews.json) — proposes for
|
|
30
|
+
every catalogued COMPONENT in it
|
|
31
|
+
--dir <path> scan a repo for UI components by name convention
|
|
32
|
+
--subject <name> propose for one name; repeatable
|
|
33
|
+
|
|
34
|
+
Options:
|
|
35
|
+
--file <fileKey> Design file to search (the segment after /design/ in the URL)
|
|
36
|
+
--limit <n> Proposals per component (default 3)
|
|
37
|
+
--json Emit JSON instead of the table
|
|
38
|
+
--help, -h Show this help
|
|
39
|
+
|
|
40
|
+
Needs FIGMA_TOKEN (a read-only PAT with file_content:read) or FIGMA_OAUTH_TOKEN.
|
|
41
|
+
Prints proposals; writes nothing. Review before pasting a reference anywhere.`;
|
|
42
|
+
function parseArgs(args) {
|
|
43
|
+
const out = { subjects: [], limit: 3, json: false, help: false };
|
|
44
|
+
for (let i = 0; i < args.length; i++) {
|
|
45
|
+
const a = args[i];
|
|
46
|
+
const next = () => {
|
|
47
|
+
const v = args[(i += 1)];
|
|
48
|
+
if (v === undefined)
|
|
49
|
+
throw new Error(`missing value for ${a}`);
|
|
50
|
+
return v;
|
|
51
|
+
};
|
|
52
|
+
switch (a) {
|
|
53
|
+
case "--file":
|
|
54
|
+
out.fileKey = next();
|
|
55
|
+
break;
|
|
56
|
+
case "--previews":
|
|
57
|
+
out.previews = next();
|
|
58
|
+
break;
|
|
59
|
+
case "--dir":
|
|
60
|
+
out.dir = next();
|
|
61
|
+
break;
|
|
62
|
+
case "--subject":
|
|
63
|
+
out.subjects.push(next());
|
|
64
|
+
break;
|
|
65
|
+
case "--limit": {
|
|
66
|
+
const n = Number(next());
|
|
67
|
+
if (!Number.isInteger(n) || n < 1)
|
|
68
|
+
throw new Error("--limit must be a positive integer");
|
|
69
|
+
out.limit = n;
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
case "--json":
|
|
73
|
+
out.json = true;
|
|
74
|
+
break;
|
|
75
|
+
case "--help":
|
|
76
|
+
case "-h":
|
|
77
|
+
out.help = true;
|
|
78
|
+
break;
|
|
79
|
+
default:
|
|
80
|
+
throw new Error(`unknown argument '${a}'`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return out;
|
|
84
|
+
}
|
|
85
|
+
/** Subjects from a convention scan — the greenfield path, same as bootstrap's review list. */
|
|
86
|
+
async function subjectsFromRepo(dir) {
|
|
87
|
+
const discovered = await discoverCodeComponents(dir);
|
|
88
|
+
return discovered.map((c) => ({ label: c.code, text: c.symbol }));
|
|
89
|
+
}
|
|
90
|
+
async function subjectsFor(args) {
|
|
91
|
+
if (args.subjects.length > 0) {
|
|
92
|
+
return args.subjects.map((s) => ({ label: s, text: subjectFor(s) }));
|
|
93
|
+
}
|
|
94
|
+
if (args.previews) {
|
|
95
|
+
const manifest = JSON.parse(await readFile(args.previews, "utf8"));
|
|
96
|
+
return subjectsFromPreviewManifest(manifest);
|
|
97
|
+
}
|
|
98
|
+
return subjectsFromRepo(args.dir ?? ".");
|
|
99
|
+
}
|
|
100
|
+
function figmaClient() {
|
|
101
|
+
const oauthToken = env.FIGMA_OAUTH_TOKEN;
|
|
102
|
+
const token = env.FIGMA_TOKEN;
|
|
103
|
+
if (!oauthToken && !token) {
|
|
104
|
+
throw new Error("no Figma credentials — set FIGMA_TOKEN (a read-only PAT with file_content:read) or FIGMA_OAUTH_TOKEN");
|
|
105
|
+
}
|
|
106
|
+
return new FigmaRestClient(oauthToken ? { oauthToken } : { token });
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Every component in the file, by whichever of two routes works.
|
|
110
|
+
*
|
|
111
|
+
* `/components` is exact and one request, but only returns what the file itself
|
|
112
|
+
* PUBLISHES — a community duplicate subscribes to the original library instead
|
|
113
|
+
* of republishing it, and then returns nothing. The tree walk always works and
|
|
114
|
+
* costs a request per page, so it is the fallback rather than the default.
|
|
115
|
+
*
|
|
116
|
+
* The walk is exactly the shape that trips Figma's per-token limiter: one large
|
|
117
|
+
* request per page, back to back. It is not paced here because the REST client
|
|
118
|
+
* already retries a 429 honouring `Retry-After` — a walk that is most of the
|
|
119
|
+
* way done should wait, not be thrown away.
|
|
120
|
+
*/
|
|
121
|
+
async function kitCandidates(client, fileKey, log) {
|
|
122
|
+
const published = await client.getFileComponents(fileKey);
|
|
123
|
+
const components = published.meta?.components ?? [];
|
|
124
|
+
if (components.length > 0) {
|
|
125
|
+
log(`Resolved ${components.length} published component(s) from ${fileKey}.`);
|
|
126
|
+
return components.map((c) => ({
|
|
127
|
+
name: c.name,
|
|
128
|
+
nodeId: c.node_id,
|
|
129
|
+
containing: c.containing_frame?.name ?? "",
|
|
130
|
+
}));
|
|
131
|
+
}
|
|
132
|
+
log(`${fileKey} publishes no components; walking the file tree.`);
|
|
133
|
+
const file = await client.getFilePages(fileKey);
|
|
134
|
+
const pages = file.document.children ?? [];
|
|
135
|
+
log(`Walking ${pages.length} page(s).`);
|
|
136
|
+
const found = [];
|
|
137
|
+
const failed = [];
|
|
138
|
+
for (const [i, page] of pages.entries()) {
|
|
139
|
+
let root;
|
|
140
|
+
try {
|
|
141
|
+
// depth=3 reaches the component sets sitting inside a page's sections and
|
|
142
|
+
// frames — where a kit puts them — without dragging every variant's inner
|
|
143
|
+
// layers down the wire.
|
|
144
|
+
const nodes = await client.getFileNodes(fileKey, [page.id], { depth: 3 });
|
|
145
|
+
root = nodes.nodes[page.id]?.document;
|
|
146
|
+
}
|
|
147
|
+
catch (err) {
|
|
148
|
+
// One unreachable page shouldn't discard the pages that did resolve: a
|
|
149
|
+
// partial proposal list is useful, and the summary names what is missing.
|
|
150
|
+
log(` page "${page.name}" failed: ${err.message.slice(0, 120)}`);
|
|
151
|
+
failed.push(page.name);
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
log(` [${i + 1}/${pages.length}] ${page.name}`);
|
|
155
|
+
if (root)
|
|
156
|
+
found.push(...candidatesFromTree(root));
|
|
157
|
+
}
|
|
158
|
+
if (failed.length > 0) {
|
|
159
|
+
log(`\nWARNING: ${failed.length} page(s) did not resolve: ${failed.join(", ")}`);
|
|
160
|
+
log("Components living only on those pages will show as LOW / no candidate.");
|
|
161
|
+
}
|
|
162
|
+
log(`Found ${found.length} component(s) by tree walk.`);
|
|
163
|
+
return found;
|
|
164
|
+
}
|
|
165
|
+
async function main() {
|
|
166
|
+
let args;
|
|
167
|
+
try {
|
|
168
|
+
args = parseArgs(argv.slice(2));
|
|
169
|
+
}
|
|
170
|
+
catch (err) {
|
|
171
|
+
console.error(err.message);
|
|
172
|
+
console.error("\n" + HELP);
|
|
173
|
+
return 2;
|
|
174
|
+
}
|
|
175
|
+
if (args.help) {
|
|
176
|
+
console.log(HELP);
|
|
177
|
+
return 0;
|
|
178
|
+
}
|
|
179
|
+
if (!args.fileKey) {
|
|
180
|
+
console.error("--file <fileKey> is required.\n\n" + HELP);
|
|
181
|
+
return 2;
|
|
182
|
+
}
|
|
183
|
+
// In `--json` mode the progress commentary would corrupt the document, so it
|
|
184
|
+
// goes to stderr and stdout carries the result alone.
|
|
185
|
+
const log = (line) => {
|
|
186
|
+
if (args.json)
|
|
187
|
+
console.error(line);
|
|
188
|
+
else
|
|
189
|
+
console.log(line);
|
|
190
|
+
};
|
|
191
|
+
const subjects = await subjectsFor(args);
|
|
192
|
+
if (subjects.length === 0) {
|
|
193
|
+
console.error("No components to propose for. Pass --previews, --dir or --subject.");
|
|
194
|
+
return 1;
|
|
195
|
+
}
|
|
196
|
+
const candidates = await kitCandidates(figmaClient(), args.fileKey, log);
|
|
197
|
+
const results = subjects.map((subject) => {
|
|
198
|
+
const ranked = rankCandidates(subject.text, candidates, { limit: args.limit });
|
|
199
|
+
return {
|
|
200
|
+
component: subject.label,
|
|
201
|
+
confidence: confidenceOf(ranked[0]),
|
|
202
|
+
reference: ranked[0] ? `figma:${args.fileKey}/${ranked[0].nodeId}` : null,
|
|
203
|
+
proposals: ranked.map((r) => ({
|
|
204
|
+
name: r.name,
|
|
205
|
+
score: Number(r.score.toFixed(2)),
|
|
206
|
+
reference: `figma:${args.fileKey}/${r.nodeId}`,
|
|
207
|
+
})),
|
|
208
|
+
};
|
|
209
|
+
});
|
|
210
|
+
if (args.json) {
|
|
211
|
+
stdout.write(`${JSON.stringify({ file: args.fileKey, components: results }, null, 2)}\n`);
|
|
212
|
+
return 0;
|
|
213
|
+
}
|
|
214
|
+
console.log("");
|
|
215
|
+
for (const result of results) {
|
|
216
|
+
console.log(`${result.confidence.padEnd(5)} ${result.component}`);
|
|
217
|
+
for (const p of result.proposals) {
|
|
218
|
+
console.log(` ${p.score.toFixed(2)} ${p.name} -> ${p.reference}`);
|
|
219
|
+
}
|
|
220
|
+
console.log(result.reference
|
|
221
|
+
? ` reference = "${result.reference}"`
|
|
222
|
+
: " (no candidate — nothing in this file plausibly depicts it)");
|
|
223
|
+
console.log("");
|
|
224
|
+
}
|
|
225
|
+
return 0;
|
|
226
|
+
}
|
|
227
|
+
exit(await main());
|
|
228
|
+
//# sourceMappingURL=propose-refs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propose-refs.js","sourceRoot":"","sources":["../../src/cli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CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QAC1F,OAAO,CAAC,CAAC;IACX,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QAClE,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YACjC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;QAC9E,CAAC;QACD,OAAO,CAAC,GAAG,CACT,MAAM,CAAC,SAAS;YACd,CAAC,CAAC,wBAAwB,MAAM,CAAC,SAAS,GAAG;YAC7C,CAAC,CAAC,oEAAoE,CACzE,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -20,4 +20,6 @@ export type { DiscoveredComponent } from "./seed.js";
|
|
|
20
20
|
export { CONFIG_FILE, TOKENS_FILE, CHECKS_FILE, DESIGN_MAP_FILE, } from "./artifacts.js";
|
|
21
21
|
export { planBootstrap, applyBootstrap, } from "./bootstrap.js";
|
|
22
22
|
export type { PlannedArtifact, BootstrapPlan, PlanOptions, ApplyOptions, ApplyResult, } from "./bootstrap.js";
|
|
23
|
+
export { candidatesFromTree, candidateWeight, confidenceOf, isBuildingBlock, isIcon, isPrivate, isXr, rankCandidates, score, subjectFor, subjectsFromPreviewManifest, } from "./ref-proposals.js";
|
|
24
|
+
export type { CandidateNode, Confidence, KitCandidate, PreviewManifestLike, ProposalSubject, RankedCandidate, RankOptions, } from "./ref-proposals.js";
|
|
23
25
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElE,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,aAAa,GACd,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,SAAS,EACT,aAAa,EACb,aAAa,GACd,MAAM,UAAU,CAAC;AAClB,6EAA6E;AAC7E,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EACL,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EACL,sBAAsB,EACtB,aAAa,GACd,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAErD,OAAO,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,aAAa,EACb,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,eAAe,EACf,aAAa,EACb,WAAW,EACX,YAAY,EACZ,WAAW,GACZ,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElE,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,aAAa,GACd,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,SAAS,EACT,aAAa,EACb,aAAa,GACd,MAAM,UAAU,CAAC;AAClB,6EAA6E;AAC7E,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EACL,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EACL,sBAAsB,EACtB,aAAa,GACd,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAErD,OAAO,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,aAAa,EACb,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,eAAe,EACf,aAAa,EACb,WAAW,EACX,YAAY,EACZ,WAAW,GACZ,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,eAAe,EACf,MAAM,EACN,SAAS,EACT,IAAI,EACJ,cAAc,EACd,KAAK,EACL,UAAU,EACV,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,aAAa,EACb,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,WAAW,GACZ,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14,4 +14,7 @@ export { defaultCheckConfig } from "./checks.js";
|
|
|
14
14
|
export { discoverCodeComponents, seedDesignMap, } from "./seed.js";
|
|
15
15
|
export { CONFIG_FILE, TOKENS_FILE, CHECKS_FILE, DESIGN_MAP_FILE, } from "./artifacts.js";
|
|
16
16
|
export { planBootstrap, applyBootstrap, } from "./bootstrap.js";
|
|
17
|
+
// Reference proposals: rank a design file's components against a code
|
|
18
|
+
// component's name. Interactive only — this proposes, it never writes a map.
|
|
19
|
+
export { candidatesFromTree, candidateWeight, confidenceOf, isBuildingBlock, isIcon, isPrivate, isXr, rankCandidates, score, subjectFor, subjectsFromPreviewManifest, } from "./ref-proposals.js";
|
|
17
20
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,aAAa,GACd,MAAM,UAAU,CAAC;AASlB,OAAO,EACL,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EACL,sBAAsB,EACtB,aAAa,GACd,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,aAAa,EACb,cAAc,GACf,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,aAAa,GACd,MAAM,UAAU,CAAC;AASlB,OAAO,EACL,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EACL,sBAAsB,EACtB,aAAa,GACd,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,aAAa,EACb,cAAc,GACf,MAAM,gBAAgB,CAAC;AASxB,sEAAsE;AACtE,6EAA6E;AAC7E,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,eAAe,EACf,MAAM,EACN,SAAS,EACT,IAAI,EACJ,cAAc,EACd,KAAK,EACL,UAAU,EACV,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Proposing a design reference per code component, by name.
|
|
3
|
+
*
|
|
4
|
+
* Node ids are not discoverable without API access — a design tool's MCP server
|
|
5
|
+
* exposes only the page a user is looking at, and Code Connect (which would
|
|
6
|
+
* hand the mapping back directly) is gated behind a paid seat. So the ids come
|
|
7
|
+
* from the REST API, and something has to guess which one goes with which
|
|
8
|
+
* component.
|
|
9
|
+
*
|
|
10
|
+
* This is that guess, and it is **only** a guess. It writes no mapping file: it
|
|
11
|
+
* ranks candidates and prints the `reference = "…"` line to paste onto an
|
|
12
|
+
* annotation. A kit names components by its own taxonomy — `Button - tonal`,
|
|
13
|
+
* `Connected button group` — which does not always agree with the documented
|
|
14
|
+
* component names, so a high score is a proposal and not a fact. Keeping the
|
|
15
|
+
* human in the loop is the point, which is why this lives in `baseline`
|
|
16
|
+
* (interactive, never on the Action path) rather than in the resolver.
|
|
17
|
+
*
|
|
18
|
+
* Pure: the caller does the fetching.
|
|
19
|
+
*/
|
|
20
|
+
/** One component the design file publishes, as a candidate. */
|
|
21
|
+
export interface KitCandidate {
|
|
22
|
+
name: string;
|
|
23
|
+
nodeId: string;
|
|
24
|
+
/** The frame or page trail it sits under; often carries the word the name drops. */
|
|
25
|
+
containing: string;
|
|
26
|
+
}
|
|
27
|
+
/** A candidate with its score, after weighting. */
|
|
28
|
+
export interface RankedCandidate extends KitCandidate {
|
|
29
|
+
score: number;
|
|
30
|
+
/** How many of the subject's words this candidate's name actually accounts for. */
|
|
31
|
+
shared: number;
|
|
32
|
+
}
|
|
33
|
+
/** How much to trust the top proposal. */
|
|
34
|
+
export type Confidence = "GOOD" | "MAYBE" | "LOW";
|
|
35
|
+
/** True for a Material Symbols glyph: snake_case with no spaces. */
|
|
36
|
+
export declare const isIcon: (name: string) => boolean;
|
|
37
|
+
/** The internal parts a component set is assembled from — real nodes, wrong altitude. */
|
|
38
|
+
export declare const isBuildingBlock: (name: string, containing: string) => boolean;
|
|
39
|
+
/** Another platform's component: a phone/desktop catalog should not resolve to one. */
|
|
40
|
+
export declare const isXr: (name: string, containing: string) => boolean;
|
|
41
|
+
/** Leading-dot names are a kit's own private components (`.Tonal palettes`). */
|
|
42
|
+
export declare const isPrivate: (name: string) => boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Multiplier applied to a candidate's raw name score. `0` drops it entirely.
|
|
45
|
+
*
|
|
46
|
+
* Icons are dropped rather than demoted because nothing here should EVER
|
|
47
|
+
* resolve to a glyph — a design catalog compares components. The rest are
|
|
48
|
+
* demoted, so they can still win when genuinely nothing else fits.
|
|
49
|
+
*/
|
|
50
|
+
export declare function candidateWeight(name: string, containing: string): number;
|
|
51
|
+
/**
|
|
52
|
+
* Token-overlap score in [0, 1]: how much of the SHORTER name the two share.
|
|
53
|
+
*
|
|
54
|
+
* Shorter rather than longer, so a candidate whose name is a superset —
|
|
55
|
+
* `Button segment` against `Button` — is not punished for its extra words.
|
|
56
|
+
*/
|
|
57
|
+
export declare function score(a: string, b: string): number;
|
|
58
|
+
export declare function confidenceOf(best: RankedCandidate | undefined): Confidence;
|
|
59
|
+
export interface RankOptions {
|
|
60
|
+
/** How many proposals to keep. */
|
|
61
|
+
limit?: number;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The best candidates for one code component, best first.
|
|
65
|
+
*
|
|
66
|
+
* `subject` should carry the component's group as well as its id — a kit names
|
|
67
|
+
* by its own taxonomy, and the group often carries the word the leaf drops
|
|
68
|
+
* (`Button/Tonal` is `Button - tonal` there).
|
|
69
|
+
*
|
|
70
|
+
* Each candidate is scored against its bare name AND against name-plus-trail,
|
|
71
|
+
* taking the better: the trail rescues a component whose own name is generic
|
|
72
|
+
* (`Button segment`) and would hurt one whose name is already exact, since
|
|
73
|
+
* every extra token dilutes the overlap.
|
|
74
|
+
*/
|
|
75
|
+
export declare function rankCandidates(subject: string, candidates: readonly KitCandidate[], opts?: RankOptions): RankedCandidate[];
|
|
76
|
+
/** The subject string to rank against: the group plus the id, de-slashed. */
|
|
77
|
+
export declare function subjectFor(componentId: string, group?: string): string;
|
|
78
|
+
/** One thing to propose a reference for. */
|
|
79
|
+
export interface ProposalSubject {
|
|
80
|
+
/** How the repo names it — what a human will paste the reference next to. */
|
|
81
|
+
label: string;
|
|
82
|
+
/** The words to match on, which may carry a group the label doesn't. */
|
|
83
|
+
text: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The subset of a compose-preview manifest this reads. Structural on purpose:
|
|
87
|
+
* the manifest is compose-ai-tools' artifact, and pinning its whole shape here
|
|
88
|
+
* would make an unrelated field of theirs a breaking change here.
|
|
89
|
+
*/
|
|
90
|
+
export interface PreviewManifestLike {
|
|
91
|
+
previews?: {
|
|
92
|
+
catalog?: {
|
|
93
|
+
role?: string;
|
|
94
|
+
componentId?: string;
|
|
95
|
+
group?: string;
|
|
96
|
+
};
|
|
97
|
+
}[];
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Subjects from a compose-preview manifest, sorted by component id.
|
|
101
|
+
*
|
|
102
|
+
* `COMPONENT`-role previews only — a manifest also carries screens and gallery
|
|
103
|
+
* entries, and neither has a component-level reference to propose. First
|
|
104
|
+
* preview per component id wins: several previews picturing one component are
|
|
105
|
+
* variants of a single reference, not several references.
|
|
106
|
+
*/
|
|
107
|
+
export declare function subjectsFromPreviewManifest(manifest: PreviewManifestLike): ProposalSubject[];
|
|
108
|
+
/**
|
|
109
|
+
* The structural shape a tree walk needs, so this module stays independent of
|
|
110
|
+
* any one adapter's node type. A Figma `FigmaNodeDoc` satisfies it.
|
|
111
|
+
*/
|
|
112
|
+
export interface CandidateNode {
|
|
113
|
+
id: string;
|
|
114
|
+
name: string;
|
|
115
|
+
type: string;
|
|
116
|
+
children?: CandidateNode[];
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Every component reachable from `root`, with the trail of frames it sits under.
|
|
120
|
+
*
|
|
121
|
+
* Stops at the first component-ish node on each branch: descending into a
|
|
122
|
+
* component set would yield its variants (`Button/Size=Small`), which are not
|
|
123
|
+
* candidates for a component-level reference and would each outscore the set
|
|
124
|
+
* they belong to on any name that happens to mention a size.
|
|
125
|
+
*
|
|
126
|
+
* `root` is normally a page, and its name heads every trail: a kit that names a
|
|
127
|
+
* page `Navigation` is the only thing telling you that the `Rail` on it is a
|
|
128
|
+
* navigation rail.
|
|
129
|
+
*/
|
|
130
|
+
export declare function candidatesFromTree(root: CandidateNode): KitCandidate[];
|
|
131
|
+
//# sourceMappingURL=ref-proposals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ref-proposals.d.ts","sourceRoot":"","sources":["../src/ref-proposals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,+DAA+D;AAC/D,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,UAAU,EAAE,MAAM,C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,CAAC;IACd,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE;QACT,OAAO,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,WAAW,CAAC,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KACnE,EAAE,CAAC;CACL;AAED;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,mBAAmB,GAC5B,eAAe,EAAE,CAYnB;AAID;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;CAC5B;AAKD;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,aAAa,GAAG,YAAY,EAAE,CAWtE"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Proposing a design reference per code component, by name.
|
|
3
|
+
*
|
|
4
|
+
* Node ids are not discoverable without API access — a design tool's MCP server
|
|
5
|
+
* exposes only the page a user is looking at, and Code Connect (which would
|
|
6
|
+
* hand the mapping back directly) is gated behind a paid seat. So the ids come
|
|
7
|
+
* from the REST API, and something has to guess which one goes with which
|
|
8
|
+
* component.
|
|
9
|
+
*
|
|
10
|
+
* This is that guess, and it is **only** a guess. It writes no mapping file: it
|
|
11
|
+
* ranks candidates and prints the `reference = "…"` line to paste onto an
|
|
12
|
+
* annotation. A kit names components by its own taxonomy — `Button - tonal`,
|
|
13
|
+
* `Connected button group` — which does not always agree with the documented
|
|
14
|
+
* component names, so a high score is a proposal and not a fact. Keeping the
|
|
15
|
+
* human in the loop is the point, which is why this lives in `baseline`
|
|
16
|
+
* (interactive, never on the Action path) rather than in the resolver.
|
|
17
|
+
*
|
|
18
|
+
* Pure: the caller does the fetching.
|
|
19
|
+
*/
|
|
20
|
+
// --- Candidate filtering -----------------------------------------------------
|
|
21
|
+
//
|
|
22
|
+
// A kit's several hundred components are not several hundred candidates. Most
|
|
23
|
+
// are noise here, and leaving them in does not merely add clutter — it WINS
|
|
24
|
+
// matches it should not, because an icon named `radio_button_checked` shares
|
|
25
|
+
// more tokens with "Checkbox Checked" than the real `Checkbox` component set
|
|
26
|
+
// does. A first run proposed exactly that, plus `format_color_fill` for a
|
|
27
|
+
// colour role sheet and `text_fields` for a text field.
|
|
28
|
+
/** True for a Material Symbols glyph: snake_case with no spaces. */
|
|
29
|
+
export const isIcon = (name) => /^[a-z0-9]+(_[a-z0-9]+)+$/.test(name.trim());
|
|
30
|
+
/** The internal parts a component set is assembled from — real nodes, wrong altitude. */
|
|
31
|
+
export const isBuildingBlock = (name, containing) => /(^|\/)\.?Building [Bb]locks\//.test(name) || /Building [Bb]locks/.test(containing);
|
|
32
|
+
/** Another platform's component: a phone/desktop catalog should not resolve to one. */
|
|
33
|
+
export const isXr = (name, containing) => /(^|\/)XR(\/|$)/.test(name) || /\bXR\b/.test(containing);
|
|
34
|
+
/** Leading-dot names are a kit's own private components (`.Tonal palettes`). */
|
|
35
|
+
export const isPrivate = (name) => name.trim().startsWith(".");
|
|
36
|
+
/**
|
|
37
|
+
* Multiplier applied to a candidate's raw name score. `0` drops it entirely.
|
|
38
|
+
*
|
|
39
|
+
* Icons are dropped rather than demoted because nothing here should EVER
|
|
40
|
+
* resolve to a glyph — a design catalog compares components. The rest are
|
|
41
|
+
* demoted, so they can still win when genuinely nothing else fits.
|
|
42
|
+
*/
|
|
43
|
+
export function candidateWeight(name, containing) {
|
|
44
|
+
if (isIcon(name))
|
|
45
|
+
return 0;
|
|
46
|
+
let weight = 1;
|
|
47
|
+
if (isBuildingBlock(name, containing))
|
|
48
|
+
weight *= 0.35;
|
|
49
|
+
if (isXr(name, containing))
|
|
50
|
+
weight *= 0.4;
|
|
51
|
+
if (isPrivate(name))
|
|
52
|
+
weight *= 0.5;
|
|
53
|
+
return weight;
|
|
54
|
+
}
|
|
55
|
+
// --- Matching ----------------------------------------------------------------
|
|
56
|
+
const normalise = (s) => s
|
|
57
|
+
.toLowerCase()
|
|
58
|
+
.replace(/[^a-z0-9]+/g, " ")
|
|
59
|
+
.trim();
|
|
60
|
+
/**
|
|
61
|
+
* Just enough stemming to survive the two ways the same word is spelled either
|
|
62
|
+
* side of the boundary: a kit pluralises the family (`Checkboxes`, `Radio
|
|
63
|
+
* buttons`) where code names one component, and a kit says `Button - outline`
|
|
64
|
+
* where code says `Outlined`. Both are exact-token misses otherwise.
|
|
65
|
+
*
|
|
66
|
+
* Deliberately crude and deliberately short. Anything cleverer starts merging
|
|
67
|
+
* words that only look alike, and a wrong merge here is worse than a miss —
|
|
68
|
+
* it produces a confident proposal for the wrong node.
|
|
69
|
+
*/
|
|
70
|
+
function stem(token) {
|
|
71
|
+
let t = token;
|
|
72
|
+
// Plurals. `-es` only after a sibilant, or `badges` would stem to `badg`
|
|
73
|
+
// while `badge` stayed put — the very collapse this is meant to produce.
|
|
74
|
+
if (t.length > 4 && /[sxzh]es$/.test(t))
|
|
75
|
+
t = t.slice(0, -2);
|
|
76
|
+
else if (t.length > 3 && t.endsWith("s"))
|
|
77
|
+
t = t.slice(0, -1);
|
|
78
|
+
// Past participles used as adjectives: `outlined`/`outline`, `elevated`.
|
|
79
|
+
if (t.length > 4 && t.endsWith("d"))
|
|
80
|
+
t = t.slice(0, -1);
|
|
81
|
+
return t;
|
|
82
|
+
}
|
|
83
|
+
const tokenise = (s) => new Set(normalise(s).split(" ").filter(Boolean).map(stem));
|
|
84
|
+
/** How many tokens two names share, and that as a fraction of the shorter one. */
|
|
85
|
+
function overlap(a, b) {
|
|
86
|
+
const at = tokenise(a);
|
|
87
|
+
const bt = tokenise(b);
|
|
88
|
+
if (!at.size || !bt.size)
|
|
89
|
+
return { shared: 0, ratio: 0 };
|
|
90
|
+
let shared = 0;
|
|
91
|
+
for (const token of at)
|
|
92
|
+
if (bt.has(token))
|
|
93
|
+
shared += 1;
|
|
94
|
+
return { shared, ratio: shared / Math.min(at.size, bt.size) };
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Token-overlap score in [0, 1]: how much of the SHORTER name the two share.
|
|
98
|
+
*
|
|
99
|
+
* Shorter rather than longer, so a candidate whose name is a superset —
|
|
100
|
+
* `Button segment` against `Button` — is not punished for its extra words.
|
|
101
|
+
*/
|
|
102
|
+
export function score(a, b) {
|
|
103
|
+
return overlap(a, b).ratio;
|
|
104
|
+
}
|
|
105
|
+
/** Thresholds the confidence label reads. Tuned on the Material 3 kit. */
|
|
106
|
+
const GOOD = 0.67;
|
|
107
|
+
const MAYBE = 0.34;
|
|
108
|
+
export function confidenceOf(best) {
|
|
109
|
+
if (!best || best.score < MAYBE)
|
|
110
|
+
return "LOW";
|
|
111
|
+
return best.score < GOOD ? "MAYBE" : "GOOD";
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The best candidates for one code component, best first.
|
|
115
|
+
*
|
|
116
|
+
* `subject` should carry the component's group as well as its id — a kit names
|
|
117
|
+
* by its own taxonomy, and the group often carries the word the leaf drops
|
|
118
|
+
* (`Button/Tonal` is `Button - tonal` there).
|
|
119
|
+
*
|
|
120
|
+
* Each candidate is scored against its bare name AND against name-plus-trail,
|
|
121
|
+
* taking the better: the trail rescues a component whose own name is generic
|
|
122
|
+
* (`Button segment`) and would hurt one whose name is already exact, since
|
|
123
|
+
* every extra token dilutes the overlap.
|
|
124
|
+
*/
|
|
125
|
+
export function rankCandidates(subject, candidates, opts = {}) {
|
|
126
|
+
const limit = opts.limit ?? 3;
|
|
127
|
+
return candidates
|
|
128
|
+
.map((candidate) => {
|
|
129
|
+
const bare = overlap(subject, candidate.name);
|
|
130
|
+
const trailed = overlap(subject, `${candidate.name} ${candidate.containing}`);
|
|
131
|
+
// Strictly better only. Counting the trail's extra shared words on a tie
|
|
132
|
+
// is tempting and wrong: a bare `Icon` sitting under an `Icon button`
|
|
133
|
+
// frame would then tie `Icon button` on words shared and win on being
|
|
134
|
+
// shorter, which is the part beating the component.
|
|
135
|
+
const best = trailed.ratio > bare.ratio ? trailed : bare;
|
|
136
|
+
return {
|
|
137
|
+
...candidate,
|
|
138
|
+
score: best.ratio * candidateWeight(candidate.name, candidate.containing),
|
|
139
|
+
shared: best.shared,
|
|
140
|
+
};
|
|
141
|
+
})
|
|
142
|
+
.filter((candidate) => candidate.score > 0)
|
|
143
|
+
.sort((a, b) => b.score - a.score ||
|
|
144
|
+
// A tie on the RATIO means both names are fully accounted for; the one
|
|
145
|
+
// accounting for MORE of the subject is the more specific component.
|
|
146
|
+
// `Button/Elevated` against a kit holding both `Button` and `Button -
|
|
147
|
+
// elevated` scores 1.0 either way — one shares a word, the other shares
|
|
148
|
+
// two, and the two-word match is the one a human picks. Measured
|
|
149
|
+
// against the 116 references a human accepted by hand for the Material
|
|
150
|
+
// 3 kit, this alone moved the top proposal onto the accepted node for
|
|
151
|
+
// 8 more of them (63 → 71).
|
|
152
|
+
b.shared - a.shared ||
|
|
153
|
+
// Still tied, so the extra words are noise: between `Button` and
|
|
154
|
+
// `Button segment` for a subject of just "Button", the plainer name is
|
|
155
|
+
// the component and the other is a part of one.
|
|
156
|
+
a.name.length - b.name.length)
|
|
157
|
+
.slice(0, limit);
|
|
158
|
+
}
|
|
159
|
+
/** The subject string to rank against: the group plus the id, de-slashed. */
|
|
160
|
+
export function subjectFor(componentId, group) {
|
|
161
|
+
return `${group ?? ""} ${componentId.replace(/\//g, " ")}`.trim();
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Subjects from a compose-preview manifest, sorted by component id.
|
|
165
|
+
*
|
|
166
|
+
* `COMPONENT`-role previews only — a manifest also carries screens and gallery
|
|
167
|
+
* entries, and neither has a component-level reference to propose. First
|
|
168
|
+
* preview per component id wins: several previews picturing one component are
|
|
169
|
+
* variants of a single reference, not several references.
|
|
170
|
+
*/
|
|
171
|
+
export function subjectsFromPreviewManifest(manifest) {
|
|
172
|
+
const seen = new Map();
|
|
173
|
+
for (const preview of manifest.previews ?? []) {
|
|
174
|
+
const entry = preview.catalog;
|
|
175
|
+
if (entry?.role !== "COMPONENT" || !entry.componentId)
|
|
176
|
+
continue;
|
|
177
|
+
if (seen.has(entry.componentId))
|
|
178
|
+
continue;
|
|
179
|
+
seen.set(entry.componentId, {
|
|
180
|
+
label: entry.componentId,
|
|
181
|
+
text: subjectFor(entry.componentId, entry.group),
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
return [...seen.values()].sort((a, b) => a.label.localeCompare(b.label));
|
|
185
|
+
}
|
|
186
|
+
/** Node types that ARE a candidate, rather than something containing one. */
|
|
187
|
+
const COMPONENT_TYPES = new Set(["COMPONENT_SET", "COMPONENT"]);
|
|
188
|
+
/**
|
|
189
|
+
* Every component reachable from `root`, with the trail of frames it sits under.
|
|
190
|
+
*
|
|
191
|
+
* Stops at the first component-ish node on each branch: descending into a
|
|
192
|
+
* component set would yield its variants (`Button/Size=Small`), which are not
|
|
193
|
+
* candidates for a component-level reference and would each outscore the set
|
|
194
|
+
* they belong to on any name that happens to mention a size.
|
|
195
|
+
*
|
|
196
|
+
* `root` is normally a page, and its name heads every trail: a kit that names a
|
|
197
|
+
* page `Navigation` is the only thing telling you that the `Rail` on it is a
|
|
198
|
+
* navigation rail.
|
|
199
|
+
*/
|
|
200
|
+
export function candidatesFromTree(root) {
|
|
201
|
+
const found = [];
|
|
202
|
+
const walk = (node, trail) => {
|
|
203
|
+
if (COMPONENT_TYPES.has(node.type)) {
|
|
204
|
+
found.push({ name: node.name, nodeId: node.id, containing: trail.join(" / ") });
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
for (const child of node.children ?? [])
|
|
208
|
+
walk(child, [...trail, node.name]);
|
|
209
|
+
};
|
|
210
|
+
walk(root, []);
|
|
211
|
+
return found;
|
|
212
|
+
}
|
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,CAAC;IACnB,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CAAC;AAClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAC3B,UAAU,GAA0B,EAAE;IAEtC,MAAM,UAAU,GAAqB,UAAU;SAC5C,MAAM,CAAC,CAAC,CAAC,EAA8C,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,SAAS,CAAC;SAC9E,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;SACtE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAChD,OAAO;QACL,OAAO,EACL,kEAAkE;QACpE,UAAU;KACX,CAAC;AACJ,CAAC;AAED,4DAA4D;AAC5D,SAAS,WAAW,CAAC,GAAW;IAC9B,IAAI,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,OAAO,CAAC;IACvE,IAAI,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,OAAO,QAAQ,CAAC;IAC/C,IAAI,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,eAAe,CAAC;IAC3D,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@design-parity/baseline",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.51",
|
|
4
4
|
"description": "Detect a repo's design-system maturity and, for a repo with no design system, bootstrap an opinionated committed baseline (tokens, design-map, check config, parity direction).",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -13,16 +13,18 @@
|
|
|
13
13
|
"dist"
|
|
14
14
|
],
|
|
15
15
|
"bin": {
|
|
16
|
-
"design-parity-bootstrap": "./dist/cli/bootstrap.js"
|
|
16
|
+
"design-parity-bootstrap": "./dist/cli/bootstrap.js",
|
|
17
|
+
"design-parity-propose-refs": "./dist/cli/propose-refs.js"
|
|
17
18
|
},
|
|
18
19
|
"scripts": {
|
|
19
20
|
"build": "tsc --build",
|
|
20
21
|
"test": "vitest run --root ../.. packages/baseline/test"
|
|
21
22
|
},
|
|
22
23
|
"dependencies": {
|
|
23
|
-
"@design-parity/
|
|
24
|
-
"@design-parity/
|
|
25
|
-
"@design-parity/
|
|
24
|
+
"@design-parity/adapter-figma": "^0.1.51",
|
|
25
|
+
"@design-parity/checks": "^0.1.51",
|
|
26
|
+
"@design-parity/core": "^0.1.51",
|
|
27
|
+
"@design-parity/policy": "^0.1.51"
|
|
26
28
|
},
|
|
27
29
|
"repository": {
|
|
28
30
|
"type": "git",
|