@dsgraph/adapters 0.0.0-stage → 0.3.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/LICENSE +21 -0
- package/README.md +29 -2
- package/dist/css-tokens.d.ts +13 -0
- package/dist/css-tokens.d.ts.map +1 -0
- package/dist/css-tokens.js +231 -0
- package/dist/css-tokens.js.map +1 -0
- package/dist/css-values.d.ts +19 -0
- package/dist/css-values.d.ts.map +1 -0
- package/dist/css-values.js +205 -0
- package/dist/css-values.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/json-values.d.ts +30 -0
- package/dist/json-values.d.ts.map +1 -0
- package/dist/json-values.js +332 -0
- package/dist/json-values.js.map +1 -0
- package/dist/styles.d.ts +20 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/styles.js +182 -0
- package/dist/styles.js.map +1 -0
- package/dist/tokens-json.d.ts +10 -0
- package/dist/tokens-json.d.ts.map +1 -0
- package/dist/tokens-json.js +499 -0
- package/dist/tokens-json.js.map +1 -0
- package/package.json +32 -4
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
import { excludeFor, matchGlob, NOT_TOKENS, parseJsonLenient, prefetch, } from '@dsgraph/core';
|
|
2
|
+
import { convertValue, groupType, normalizeRefs, SET_FORMAT_TYPES, } from './json-values.js';
|
|
3
|
+
/** The `$extensions` key under which token-set files keep color modifiers (`modify`). */
|
|
4
|
+
const MODIFIER_EXTENSION = 'studio.tokens';
|
|
5
|
+
const isObj = (v) => v !== null && typeof v === 'object' && !Array.isArray(v);
|
|
6
|
+
const base = (p) => p.slice(p.lastIndexOf('/') + 1);
|
|
7
|
+
const dir = (p) => (p.includes('/') ? p.slice(0, p.lastIndexOf('/')) : '');
|
|
8
|
+
const META = /(^|\/)\$(themes|metadata)\.json$/;
|
|
9
|
+
/** `{ value }` without `$`: a token in value/type JSON, the older token notation. */
|
|
10
|
+
function isLegacyToken(o) {
|
|
11
|
+
if (!Object.hasOwn(o, 'value') || Object.hasOwn(o, '$value'))
|
|
12
|
+
return false;
|
|
13
|
+
const v = o.value;
|
|
14
|
+
return 'type' in o || !isObj(v) || !Object.values(v).every(isObj);
|
|
15
|
+
}
|
|
16
|
+
/** A token whose values per mode sit under `sets`: `{ "sets": { "light": { "value" }, "dark": … } }`. */
|
|
17
|
+
function isSetToken(o) {
|
|
18
|
+
if (Object.hasOwn(o, 'value') || Object.hasOwn(o, '$value') || !isObj(o.sets))
|
|
19
|
+
return false;
|
|
20
|
+
const sets = Object.values(o.sets);
|
|
21
|
+
return sets.length > 0 && sets.every((v) => isObj(v) && (Object.hasOwn(v, 'value') || isSetToken(v)));
|
|
22
|
+
}
|
|
23
|
+
const isToken = (o) => Object.hasOwn(o, '$value') || isLegacyToken(o) || isSetToken(o);
|
|
24
|
+
/** A type named by the token's `$schema` link (`…/token-types/color.json`); aliases and sets have none. */
|
|
25
|
+
function schemaType(o) {
|
|
26
|
+
const m = typeof o.$schema === 'string' ? /token-types\/([\w-]+)\.json$/.exec(o.$schema) : null;
|
|
27
|
+
return m && m[1] !== 'alias' && !m[1].endsWith('-set') ? m[1] : undefined;
|
|
28
|
+
}
|
|
29
|
+
/** Leaves of `sets`, nested sets joined with ` / `. */
|
|
30
|
+
function setLeaves(o, prefix = '') {
|
|
31
|
+
const out = [];
|
|
32
|
+
for (const [name, v] of Object.entries(o.sets)) {
|
|
33
|
+
const mode = prefix ? `${prefix} / ${name}` : name;
|
|
34
|
+
if (isSetToken(v))
|
|
35
|
+
out.push(...setLeaves(v, mode));
|
|
36
|
+
else
|
|
37
|
+
out.push([mode, v]);
|
|
38
|
+
}
|
|
39
|
+
return out;
|
|
40
|
+
}
|
|
41
|
+
/** A `sets` token as one token with its values per mode in `$extensions.mode`. */
|
|
42
|
+
function fromSets(o) {
|
|
43
|
+
const leaves = setLeaves(o);
|
|
44
|
+
const { sets: _sets, ...rest } = o;
|
|
45
|
+
const type = schemaType(o) ?? leaves.map(([, l]) => l.type ?? schemaType(l)).find((t) => typeof t === 'string');
|
|
46
|
+
const token = { ...rest, value: leaves[0][1].value };
|
|
47
|
+
if (type)
|
|
48
|
+
token.type = type;
|
|
49
|
+
const ext = isObj(o.$extensions) ? o.$extensions : {};
|
|
50
|
+
token.$extensions = { ...ext, mode: Object.fromEntries(leaves.map(([m, l]) => [m, l.value])) };
|
|
51
|
+
return token;
|
|
52
|
+
}
|
|
53
|
+
const newSurvey = () => ({
|
|
54
|
+
legacy: 0,
|
|
55
|
+
dtcg: 0,
|
|
56
|
+
typed: 0,
|
|
57
|
+
setTypes: 0,
|
|
58
|
+
values: new Set(),
|
|
59
|
+
ids: new Set(),
|
|
60
|
+
});
|
|
61
|
+
function survey(node, s, inheritsType = false, path = []) {
|
|
62
|
+
if (!isObj(node))
|
|
63
|
+
return;
|
|
64
|
+
const tree = isSetToken(node) ? fromSets(node) : node;
|
|
65
|
+
if (isToken(tree)) {
|
|
66
|
+
const dollar = Object.hasOwn(tree, '$value');
|
|
67
|
+
if (dollar)
|
|
68
|
+
s.dtcg++;
|
|
69
|
+
else
|
|
70
|
+
s.legacy++;
|
|
71
|
+
// The token's own type as written; a type taken from `$schema` or `sets` says nothing about the format.
|
|
72
|
+
const own = node.type ?? node.$type;
|
|
73
|
+
if (typeof own === 'string' || inheritsType || schemaType(tree))
|
|
74
|
+
s.typed++;
|
|
75
|
+
if (typeof own === 'string' && SET_FORMAT_TYPES.has(own))
|
|
76
|
+
s.setTypes++;
|
|
77
|
+
const v = dollar ? tree.$value : tree.value;
|
|
78
|
+
if ((typeof v === 'string' && !v.includes('{')) || typeof v === 'number')
|
|
79
|
+
s.values.add(String(v).trim().toLowerCase());
|
|
80
|
+
s.ids.add(path.join('.'));
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const groupType = typeof tree.$type === 'string';
|
|
84
|
+
if (groupType && SET_FORMAT_TYPES.has(tree.$type))
|
|
85
|
+
s.setTypes++;
|
|
86
|
+
for (const [k, v] of Object.entries(tree))
|
|
87
|
+
if (!k.startsWith('$'))
|
|
88
|
+
survey(v, s, inheritsType || groupType, [...path, k]);
|
|
89
|
+
}
|
|
90
|
+
/** JSON Schema documents describe tokens; they are not tokens. */
|
|
91
|
+
const isJsonSchema = (tree) => isObj(tree) &&
|
|
92
|
+
((typeof tree.$schema === 'string' && /json-schema\.org/.test(tree.$schema)) ||
|
|
93
|
+
(isObj(tree.properties) && ('type' in tree || 'allOf' in tree || '$id' in tree)));
|
|
94
|
+
async function readAll(source, config, diag) {
|
|
95
|
+
const exclude = excludeFor(config, 'tokens');
|
|
96
|
+
const files = (await source.list(config.tokens?.include ?? ['**/*.json', '**/*.json5']))
|
|
97
|
+
.filter((p) => /\.(json5?|tokens)$/i.test(p) && !matchGlob(p, exclude) && (META.test(p) || !NOT_TOKENS.test(p)))
|
|
98
|
+
.sort()
|
|
99
|
+
.slice(0, 2000);
|
|
100
|
+
const out = [];
|
|
101
|
+
await prefetch(source, files);
|
|
102
|
+
for (const file of files) {
|
|
103
|
+
const text = await source.readText(file);
|
|
104
|
+
if (!META.test(file) && !/["']?\$?value["']?\s*:|"sets"\s*:/.test(text))
|
|
105
|
+
continue;
|
|
106
|
+
try {
|
|
107
|
+
const tree = parseJsonLenient(text).value;
|
|
108
|
+
if (isJsonSchema(tree))
|
|
109
|
+
continue;
|
|
110
|
+
out.push({ file, tree });
|
|
111
|
+
}
|
|
112
|
+
catch (e) {
|
|
113
|
+
diag?.error('tokens/invalid-json', e.message, { file });
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return out;
|
|
117
|
+
}
|
|
118
|
+
const hasMarkers = (f) => META.test(f.file) || (isObj(f.tree) && ('$themes' in f.tree || '$metadata' in f.tree));
|
|
119
|
+
/**
|
|
120
|
+
* Which tool wrote these files, or undefined for typed DTCG (left to the core). DTCG syntax
|
|
121
|
+
* without any `$type` is read like value/type JSON: types come from names and values.
|
|
122
|
+
*/
|
|
123
|
+
function dialectOf(files) {
|
|
124
|
+
const s = newSurvey();
|
|
125
|
+
for (const f of files)
|
|
126
|
+
survey(f.tree, s);
|
|
127
|
+
// Only a single exported file keeps its token sets as top-level keys.
|
|
128
|
+
const tokenFiles = files.filter((f) => !hasMarkers(f));
|
|
129
|
+
const setsAtTop = tokenFiles.length === 1 && isObj(tokenFiles[0].tree) && topLevelAreSets(tokenFiles[0].tree);
|
|
130
|
+
if (files.some(hasMarkers) || s.setTypes > 0 || setsAtTop)
|
|
131
|
+
return 'token-sets';
|
|
132
|
+
if (s.legacy > 0)
|
|
133
|
+
return 'legacy-json';
|
|
134
|
+
if (s.dtcg > 0 && s.typed === 0)
|
|
135
|
+
return 'legacy-json';
|
|
136
|
+
return undefined;
|
|
137
|
+
}
|
|
138
|
+
/** Prefer the export with the most typed tokens; then DTCG, token sets, value/type JSON. */
|
|
139
|
+
function rankOf(s) {
|
|
140
|
+
const typed = Math.round((s.typed / Math.max(1, s.legacy + s.dtcg)) * 10);
|
|
141
|
+
return typed * 10 + (s.setTypes > 0 ? 3 : s.legacy > 0 ? 2 : 4);
|
|
142
|
+
}
|
|
143
|
+
const jaccard = (a, b) => {
|
|
144
|
+
let common = 0;
|
|
145
|
+
for (const v of a)
|
|
146
|
+
if (b.has(v))
|
|
147
|
+
common++;
|
|
148
|
+
return common / (a.size + b.size - common);
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Two files are exports of the same tokens when they are about the same size, their literal
|
|
152
|
+
* values mostly coincide, and they differ in format or repeat the same token names. Sibling
|
|
153
|
+
* files of one system share many values (8px, 12px) but not their size, format and names.
|
|
154
|
+
*/
|
|
155
|
+
function alternatives(a, b) {
|
|
156
|
+
const na = a.legacy + a.dtcg;
|
|
157
|
+
const nb = b.legacy + b.dtcg;
|
|
158
|
+
if (Math.min(na, nb) / Math.max(na, nb) < 0.7)
|
|
159
|
+
return false;
|
|
160
|
+
if (jaccard(a.values, b.values) < 0.5)
|
|
161
|
+
return false;
|
|
162
|
+
const sameFormat = a.setTypes > 0 === b.setTypes > 0 && a.dtcg > 0 === b.dtcg > 0;
|
|
163
|
+
return !sameFormat || jaccard(a.ids, b.ids) >= 0.8;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Packages often ship the same tokens in several formats (`tokens.json`,
|
|
167
|
+
* `tokens.figma.json`, `tokens.legacy.json`). Files whose literal values mostly
|
|
168
|
+
* coincide are alternatives: only the best-typed one is read.
|
|
169
|
+
*/
|
|
170
|
+
function pickExports(files, diag) {
|
|
171
|
+
const info = files
|
|
172
|
+
.filter((f) => !hasMarkers(f))
|
|
173
|
+
.map((f) => {
|
|
174
|
+
const s = newSurvey();
|
|
175
|
+
survey(f.tree, s);
|
|
176
|
+
return { f, s };
|
|
177
|
+
})
|
|
178
|
+
.filter((x) => x.s.values.size >= 10);
|
|
179
|
+
if (info.length < 2 || info.length > 200)
|
|
180
|
+
return files;
|
|
181
|
+
const parent = info.map((_, i) => i);
|
|
182
|
+
const find = (i) => {
|
|
183
|
+
while (parent[i] !== i)
|
|
184
|
+
i = parent[i];
|
|
185
|
+
return i;
|
|
186
|
+
};
|
|
187
|
+
for (let i = 0; i < info.length; i++)
|
|
188
|
+
for (let j = i + 1; j < info.length; j++)
|
|
189
|
+
if (alternatives(info[i].s, info[j].s))
|
|
190
|
+
parent[find(i)] = find(j);
|
|
191
|
+
const clusters = new Map();
|
|
192
|
+
for (const [i, x] of info.entries())
|
|
193
|
+
clusters.set(find(i), [...(clusters.get(find(i)) ?? []), x]);
|
|
194
|
+
const dropped = new Set();
|
|
195
|
+
for (const list of clusters.values()) {
|
|
196
|
+
if (list.length < 2)
|
|
197
|
+
continue;
|
|
198
|
+
const [best, ...rest] = [...list].sort((x, y) => rankOf(y.s) - rankOf(x.s) ||
|
|
199
|
+
y.s.legacy + y.s.dtcg - (x.s.legacy + x.s.dtcg) ||
|
|
200
|
+
x.f.file.localeCompare(y.f.file));
|
|
201
|
+
for (const r of rest)
|
|
202
|
+
dropped.add(r.f.file);
|
|
203
|
+
diag?.info('tokens/alternative-exports', `${rest.map((r) => `"${r.f.file}"`).join(', ')} repeat the tokens of "${best.f.file}"; reading "${best.f.file}"`);
|
|
204
|
+
}
|
|
205
|
+
return files.filter((f) => !dropped.has(f.file));
|
|
206
|
+
}
|
|
207
|
+
const DTCG_PROPS = new Set(['$type', '$description', '$deprecated', '$extensions']);
|
|
208
|
+
/** Converts a token tree to DTCG 2025.10. Group types are carried down to convert values. */
|
|
209
|
+
function convertTree(tree, dialect, unit, path = [], type) {
|
|
210
|
+
if (!isObj(tree))
|
|
211
|
+
return tree;
|
|
212
|
+
const out = {};
|
|
213
|
+
const inherited = typeof tree.$type === 'string' ? tree.$type : type;
|
|
214
|
+
for (const [k, v] of Object.entries(tree)) {
|
|
215
|
+
if (k.startsWith('$')) {
|
|
216
|
+
if (k === '$type' && typeof v === 'string') {
|
|
217
|
+
const t = groupType(v);
|
|
218
|
+
if (t)
|
|
219
|
+
out.$type = t;
|
|
220
|
+
}
|
|
221
|
+
else if (DTCG_PROPS.has(k))
|
|
222
|
+
out[k] = v;
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
if (!isObj(v))
|
|
226
|
+
continue;
|
|
227
|
+
// Figma-style names are paths: `Dark/color.background.hovered` is a group chain.
|
|
228
|
+
const segs = splitName(k);
|
|
229
|
+
const at = [...path, ...segs];
|
|
230
|
+
const converted = isToken(v)
|
|
231
|
+
? convertToken(v, at, dialect, unit, inherited)
|
|
232
|
+
: convertTree(v, dialect, unit, at, inherited);
|
|
233
|
+
place(out, segs, converted);
|
|
234
|
+
}
|
|
235
|
+
return out;
|
|
236
|
+
}
|
|
237
|
+
/** `a/b.c` → `[a, b, c]`; decimal steps such as `0.5` stay whole. */
|
|
238
|
+
function splitName(key) {
|
|
239
|
+
if (!/[./]/.test(key))
|
|
240
|
+
return [key];
|
|
241
|
+
return key
|
|
242
|
+
.split('/')
|
|
243
|
+
.flatMap((part) => (/^\d+\.\d+$/.test(part) ? [part] : part.split('.')))
|
|
244
|
+
.filter((p) => p !== '');
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Puts a converted node at a path. Flat names can make one path both a token and a group
|
|
248
|
+
* (`color.bg` and `color.bg.hovered`); the token then becomes the group's `$root`.
|
|
249
|
+
*/
|
|
250
|
+
function place(out, segs, value) {
|
|
251
|
+
const isTok = (v) => isObj(v) && '$value' in v;
|
|
252
|
+
let node = out;
|
|
253
|
+
for (const seg of segs.slice(0, -1)) {
|
|
254
|
+
const cur = node[seg];
|
|
255
|
+
if (isTok(cur))
|
|
256
|
+
node[seg] = { $root: cur };
|
|
257
|
+
else if (!isObj(cur))
|
|
258
|
+
node[seg] = {};
|
|
259
|
+
node = node[seg];
|
|
260
|
+
}
|
|
261
|
+
const last = segs[segs.length - 1];
|
|
262
|
+
const prev = node[last];
|
|
263
|
+
if (!isObj(prev) || !isObj(value)) {
|
|
264
|
+
node[last] = value;
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
const a = prev;
|
|
268
|
+
const b = value;
|
|
269
|
+
if (isTok(b) && !isTok(a))
|
|
270
|
+
node[last] = { ...a, $root: b };
|
|
271
|
+
else if (!isTok(b) && isTok(a))
|
|
272
|
+
node[last] = { ...b, $root: a };
|
|
273
|
+
else if (!isTok(b))
|
|
274
|
+
node[last] = { ...a, ...b };
|
|
275
|
+
else
|
|
276
|
+
node[last] = b;
|
|
277
|
+
}
|
|
278
|
+
function convertToken(node, path, dialect, unit, inherited) {
|
|
279
|
+
if (isSetToken(node))
|
|
280
|
+
node = fromSets(node);
|
|
281
|
+
const dollar = Object.hasOwn(node, '$value');
|
|
282
|
+
const raw = dollar ? node.$value : node.value;
|
|
283
|
+
const ownType = (dollar ? node.$type : node.type) ?? (dollar ? undefined : node.$type) ?? schemaType(node);
|
|
284
|
+
const c = { dialect, unit, expression: false };
|
|
285
|
+
const sourceType = typeof ownType === 'string' ? ownType : inherited;
|
|
286
|
+
const { type, value, inferred } = convertValue(sourceType, raw, path, c);
|
|
287
|
+
const token = { $value: value };
|
|
288
|
+
// A type inherited from the group stays inherited unless conversion changed it.
|
|
289
|
+
if (type && (typeof ownType === 'string' || type !== (inherited && groupType(inherited))))
|
|
290
|
+
token.$type = type;
|
|
291
|
+
const description = node.$description ?? node.description ?? node.comment;
|
|
292
|
+
if (typeof description === 'string' && description !== '')
|
|
293
|
+
token.$description = description;
|
|
294
|
+
const deprecated = node.$deprecated ?? node.deprecated;
|
|
295
|
+
if (typeof deprecated === 'boolean' || typeof deprecated === 'string') {
|
|
296
|
+
const comment = node.deprecated_comment;
|
|
297
|
+
token.$deprecated = deprecated === true && typeof comment === 'string' ? comment : deprecated;
|
|
298
|
+
}
|
|
299
|
+
const ext = {
|
|
300
|
+
...(isObj(node.extensions) ? node.extensions : {}),
|
|
301
|
+
...(isObj(node.$extensions) ? normalizeRefs(node.$extensions) : {}),
|
|
302
|
+
};
|
|
303
|
+
// Per-mode values (`$extensions.mode`) are values of the same token: converted the same way.
|
|
304
|
+
if (isObj(ext.mode))
|
|
305
|
+
ext.mode = Object.fromEntries(Object.entries(ext.mode).map(([m, v]) => [m, convertValue(type ?? sourceType, v, path, c).value]));
|
|
306
|
+
const dev = {};
|
|
307
|
+
if (inferred)
|
|
308
|
+
dev.typeInferred = true;
|
|
309
|
+
if (c.expression)
|
|
310
|
+
dev.expression = { unit };
|
|
311
|
+
if (sourceType && sourceType !== type)
|
|
312
|
+
dev.sourceType = sourceType;
|
|
313
|
+
// A `uuid` stays when a token is renamed: the diff matches renames by it.
|
|
314
|
+
if (typeof node.uuid === 'string' && node.uuid)
|
|
315
|
+
dev.stableId = node.uuid;
|
|
316
|
+
const carrier = ext[MODIFIER_EXTENSION];
|
|
317
|
+
if (isObj(carrier) && isObj(carrier.modify) && typeof carrier.modify.type === 'string') {
|
|
318
|
+
const m = carrier.modify;
|
|
319
|
+
dev.colorModifier = { type: m.type, value: m.value, space: m.space, color: m.color };
|
|
320
|
+
}
|
|
321
|
+
if (Object.keys(dev).length > 0)
|
|
322
|
+
ext['dev.dsgraph'] = dev;
|
|
323
|
+
if (Object.keys(ext).length > 0)
|
|
324
|
+
token.$extensions = ext;
|
|
325
|
+
return token;
|
|
326
|
+
}
|
|
327
|
+
function themesOf(raw, diag, file) {
|
|
328
|
+
if (!Array.isArray(raw))
|
|
329
|
+
return [];
|
|
330
|
+
const out = [];
|
|
331
|
+
for (const t of raw) {
|
|
332
|
+
if (!isObj(t) || typeof t.name !== 'string')
|
|
333
|
+
continue;
|
|
334
|
+
const sets = new Map();
|
|
335
|
+
if (isObj(t.selectedTokenSets))
|
|
336
|
+
for (const [k, v] of Object.entries(t.selectedTokenSets))
|
|
337
|
+
if (typeof v === 'string')
|
|
338
|
+
sets.set(k, v);
|
|
339
|
+
out.push({ name: t.name, group: typeof t.group === 'string' && t.group ? t.group : 'theme', sets });
|
|
340
|
+
}
|
|
341
|
+
if (out.length === 0 && raw.length > 0)
|
|
342
|
+
diag.warn('token-sets/invalid-themes', 'No usable themes found', { file });
|
|
343
|
+
return out;
|
|
344
|
+
}
|
|
345
|
+
/** Ids of tokens in a tree, prefixed by `prefix`. */
|
|
346
|
+
function tokenIds(tree, prefix, out) {
|
|
347
|
+
if (!isObj(tree))
|
|
348
|
+
return;
|
|
349
|
+
for (const [k, v] of Object.entries(tree)) {
|
|
350
|
+
if (k.startsWith('$') || !isObj(v))
|
|
351
|
+
continue;
|
|
352
|
+
if (isToken(v))
|
|
353
|
+
out.add([...prefix, k].join('.'));
|
|
354
|
+
else
|
|
355
|
+
tokenIds(v, [...prefix, k], out);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
function refsIn(v, out) {
|
|
359
|
+
if (typeof v === 'string')
|
|
360
|
+
for (const m of v.matchAll(/\{([^{}]+)\}/g))
|
|
361
|
+
out.push(m[1].replace(/\.\$?value$/, ''));
|
|
362
|
+
else if (Array.isArray(v))
|
|
363
|
+
for (const x of v)
|
|
364
|
+
refsIn(x, out);
|
|
365
|
+
else if (isObj(v))
|
|
366
|
+
for (const x of Object.values(v))
|
|
367
|
+
refsIn(x, out);
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* A single exported token-set file keeps its sets as top-level keys; references then leave the set
|
|
371
|
+
* name out. Without `$themes`/`$metadata` the references decide which reading resolves more.
|
|
372
|
+
*/
|
|
373
|
+
function topLevelAreSets(tree) {
|
|
374
|
+
if ('$themes' in tree || '$metadata' in tree)
|
|
375
|
+
return true;
|
|
376
|
+
const asGroups = new Set();
|
|
377
|
+
const asSets = new Set();
|
|
378
|
+
tokenIds(tree, [], asGroups);
|
|
379
|
+
for (const [k, v] of Object.entries(tree))
|
|
380
|
+
if (!k.startsWith('$'))
|
|
381
|
+
tokenIds(v, [], asSets);
|
|
382
|
+
const refs = [];
|
|
383
|
+
refsIn(tree, refs);
|
|
384
|
+
if (refs.length === 0)
|
|
385
|
+
return false;
|
|
386
|
+
const hits = (ids) => refs.filter((r) => ids.has(r)).length;
|
|
387
|
+
return hits(asSets) > hits(asGroups);
|
|
388
|
+
}
|
|
389
|
+
function setsSystem(files, diag) {
|
|
390
|
+
const unit = 'px';
|
|
391
|
+
const sets = new Map();
|
|
392
|
+
let order;
|
|
393
|
+
let themes = [];
|
|
394
|
+
const metaFile = files.find((f) => base(f.file) === '$metadata.json');
|
|
395
|
+
const themesFile = files.find((f) => base(f.file) === '$themes.json');
|
|
396
|
+
const root = dir((metaFile ?? themesFile)?.file ?? '');
|
|
397
|
+
if (metaFile && isObj(metaFile.tree) && Array.isArray(metaFile.tree.tokenSetOrder))
|
|
398
|
+
order = metaFile.tree.tokenSetOrder.filter((s) => typeof s === 'string');
|
|
399
|
+
if (themesFile)
|
|
400
|
+
themes = themesOf(themesFile.tree, diag, themesFile.file);
|
|
401
|
+
const single = files.filter((f) => !META.test(f.file)).length === 1;
|
|
402
|
+
for (const f of files) {
|
|
403
|
+
if (META.test(f.file) || !isObj(f.tree))
|
|
404
|
+
continue;
|
|
405
|
+
if (isObj(f.tree.$metadata) && Array.isArray(f.tree.$metadata.tokenSetOrder))
|
|
406
|
+
order ??= f.tree.$metadata.tokenSetOrder.filter((s) => typeof s === 'string');
|
|
407
|
+
if (f.tree.$themes)
|
|
408
|
+
themes = themes.length ? themes : themesOf(f.tree.$themes, diag, f.file);
|
|
409
|
+
const exported = '$themes' in f.tree || '$metadata' in f.tree;
|
|
410
|
+
if (exported || (single && topLevelAreSets(f.tree))) {
|
|
411
|
+
for (const [name, tree] of Object.entries(f.tree))
|
|
412
|
+
if (!name.startsWith('$') && isObj(tree))
|
|
413
|
+
sets.set(name, { file: `${f.file}#/${name}`, tree: convertTree(tree, 'token-sets', unit) });
|
|
414
|
+
}
|
|
415
|
+
else {
|
|
416
|
+
const rel = root && f.file.startsWith(`${root}/`) ? f.file.slice(root.length + 1) : f.file;
|
|
417
|
+
const name = rel.replace(/\.(json|tokens)$/i, '');
|
|
418
|
+
sets.set(name, { file: f.file, tree: convertTree(f.tree, 'token-sets', unit) });
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
const names = [
|
|
422
|
+
...(order ?? []).filter((n) => sets.has(n)),
|
|
423
|
+
...[...sets.keys()].filter((n) => !order?.includes(n)),
|
|
424
|
+
];
|
|
425
|
+
const docs = (list) => list.map((n) => sets.get(n));
|
|
426
|
+
const system = {
|
|
427
|
+
sets: new Map(),
|
|
428
|
+
modifiers: new Map(),
|
|
429
|
+
order: [{ kind: 'set', name: 'base' }],
|
|
430
|
+
synthetic: true,
|
|
431
|
+
kind: 'token-sets',
|
|
432
|
+
};
|
|
433
|
+
if (themes.length === 0) {
|
|
434
|
+
system.sets.set('base', docs(names));
|
|
435
|
+
if (sets.size > 1)
|
|
436
|
+
diag.info('token-sets/no-themes', `No themes: ${sets.size} token sets are merged in set order`);
|
|
437
|
+
return system;
|
|
438
|
+
}
|
|
439
|
+
const used = (t) => new Set(names.filter((n) => t.sets.get(n) === 'enabled' || t.sets.get(n) === 'source'));
|
|
440
|
+
const groups = new Map();
|
|
441
|
+
for (const t of themes)
|
|
442
|
+
groups.set(t.group, [...(groups.get(t.group) ?? []), t]);
|
|
443
|
+
// A group with one theme is always on: its sets join the base, like sets every theme uses.
|
|
444
|
+
const switching = themes.filter((t) => groups.get(t.group).length > 1);
|
|
445
|
+
const fixed = new Set(themes.filter((t) => !switching.includes(t)).flatMap((t) => [...used(t)]));
|
|
446
|
+
const shared = names.filter((n) => fixed.has(n) || (switching.length > 0 && switching.every((t) => used(t).has(n))));
|
|
447
|
+
system.sets.set('base', docs(shared));
|
|
448
|
+
for (const [group, list] of groups) {
|
|
449
|
+
if (list.length < 2)
|
|
450
|
+
continue;
|
|
451
|
+
const contexts = new Map();
|
|
452
|
+
for (const t of list) {
|
|
453
|
+
const u = used(t);
|
|
454
|
+
contexts.set(t.name, docs(names.filter((n) => u.has(n) && !shared.includes(n))));
|
|
455
|
+
}
|
|
456
|
+
system.modifiers.set(group, { contexts, default: list[0].name });
|
|
457
|
+
system.order.push({ kind: 'modifier', name: group });
|
|
458
|
+
}
|
|
459
|
+
const unused = names.filter((n) => !themes.some((t) => used(t).has(n)));
|
|
460
|
+
if (unused.length > 0)
|
|
461
|
+
diag.info('token-sets/unused-sets', `Token sets in no theme are not read: ${unused.join(', ')}`);
|
|
462
|
+
return system;
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Token-set JSON and value/type JSON → token system (DTCG 2025.10 values).
|
|
466
|
+
* Token sets: one file each or top-level keys of one file, `$metadata.json` for
|
|
467
|
+
* set order and `$themes.json` for themes; theme groups become modifiers. Value/type JSON: every
|
|
468
|
+
* file merges into one set, untyped tokens take their type from the category (`color`, `size`,
|
|
469
|
+
* `time`) or the value. Plain DTCG files are left to the core.
|
|
470
|
+
*/
|
|
471
|
+
export const jsonTokens = {
|
|
472
|
+
name: 'tokens-json',
|
|
473
|
+
priority: 'first',
|
|
474
|
+
async detect(source, config) {
|
|
475
|
+
const files = pickExports(await readAll(source, config));
|
|
476
|
+
return dialectOf(files) ? files.map((f) => f.file) : [];
|
|
477
|
+
},
|
|
478
|
+
async load(source, files, config, diag) {
|
|
479
|
+
const wanted = new Set(files);
|
|
480
|
+
const all = await readAll(source, config, diag);
|
|
481
|
+
pickExports(all, diag);
|
|
482
|
+
const loaded = all.filter((f) => wanted.has(f.file));
|
|
483
|
+
const dialect = dialectOf(loaded) ?? 'legacy-json';
|
|
484
|
+
if (dialect === 'token-sets')
|
|
485
|
+
return setsSystem(loaded, diag);
|
|
486
|
+
const docs = loaded.map((f) => ({
|
|
487
|
+
file: f.file,
|
|
488
|
+
tree: convertTree(f.tree, 'legacy-json', 'px'),
|
|
489
|
+
}));
|
|
490
|
+
return {
|
|
491
|
+
sets: new Map([['default', docs]]),
|
|
492
|
+
modifiers: new Map(),
|
|
493
|
+
order: [{ kind: 'set', name: 'default' }],
|
|
494
|
+
synthetic: true,
|
|
495
|
+
kind: 'legacy-json',
|
|
496
|
+
};
|
|
497
|
+
},
|
|
498
|
+
};
|
|
499
|
+
//# sourceMappingURL=tokens-json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens-json.js","sourceRoot":"","sources":["../src/tokens-json.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,QAAQ,GAMT,MAAM,eAAe,CAAA;AACtB,OAAO,EAEL,YAAY,EAEZ,SAAS,EACT,aAAa,EACb,gBAAgB,GACjB,MAAM,kBAAkB,CAAA;AAEzB,yFAAyF;AACzF,MAAM,kBAAkB,GAAG,eAAe,CAAA;AAE1C,MAAM,KAAK,GAAG,CAAC,CAAU,EAAgC,EAAE,CACzD,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AAE1D,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,K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AAG,MAAM,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;QAC/C,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;QACtB,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;QACpD,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,aAAa,CAAA;QAClD,IAAI,OAAO,KAAK,YAAY;YAAE,OAAO,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;QAC7D,MAAM,IAAI,GAAoB,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC/C,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,IAAI,EAAE,aAAa,EAAE,IAAI,CAAC;SAC/C,CAAC,CAAC,CAAA;QACH,OAAO;YACL,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;YAClC,SAAS,EAAE,IAAI,GAAG,EAAE;YACpB,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;YACzC,SAAS,EAAE,IAAI;YACf,IAAI,EAAE,aAAa;SACpB,CAAA;IACH,CAAC;CACF,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsgraph/adapters",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Token adapters for dsgraph: token-set and value/type JSON (sets, themes, math, color modifiers), CSS custom properties (themes by selectors and media queries).",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/specsure/specsure.git",
|
|
20
|
+
"directory": "packages/dsgraph-adapters"
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://github.com/specsure/specsure/tree/main/packages/dsgraph-adapters#readme",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/specsure/specsure/issues"
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=20.19"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@dsgraph/core": "0.3.0",
|
|
31
|
+
"postcss": "8.5.28",
|
|
32
|
+
"postcss-scss": "4.0.9"
|
|
33
|
+
}
|
|
34
|
+
}
|