@styleframe/cli 4.0.0 → 4.1.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.
Files changed (67) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/build-CBdsifMN.js +47 -0
  3. package/dist/build-D7cinF0l.cjs +50 -0
  4. package/dist/build-dtcg-BpbjBRCf.js +429 -0
  5. package/dist/build-dtcg-vuGHy-Sl.cjs +434 -0
  6. package/dist/chunk-D6vf50IK.cjs +28 -0
  7. package/dist/commands/build.d.ts +22 -0
  8. package/dist/commands/build.d.ts.map +1 -0
  9. package/dist/commands/dtcg/build-dtcg.d.ts +36 -0
  10. package/dist/commands/dtcg/build-dtcg.d.ts.map +1 -0
  11. package/dist/commands/dtcg/build-dtcg.test.d.ts +2 -0
  12. package/dist/commands/dtcg/build-dtcg.test.d.ts.map +1 -0
  13. package/dist/commands/dtcg/evaluate.d.ts +30 -0
  14. package/dist/commands/dtcg/evaluate.d.ts.map +1 -0
  15. package/dist/commands/dtcg/evaluate.test.d.ts +2 -0
  16. package/dist/commands/dtcg/evaluate.test.d.ts.map +1 -0
  17. package/dist/commands/dtcg/export.d.ts +24 -0
  18. package/dist/commands/dtcg/export.d.ts.map +1 -0
  19. package/dist/commands/dtcg/import.d.ts +38 -0
  20. package/dist/commands/dtcg/import.d.ts.map +1 -0
  21. package/dist/commands/dtcg/index.d.ts +3 -0
  22. package/dist/commands/dtcg/index.d.ts.map +1 -0
  23. package/dist/commands/figma/export.d.ts +24 -0
  24. package/dist/commands/figma/export.d.ts.map +1 -0
  25. package/dist/commands/figma/import.d.ts +38 -0
  26. package/dist/commands/figma/import.d.ts.map +1 -0
  27. package/dist/commands/figma/index.d.ts +3 -0
  28. package/dist/commands/figma/index.d.ts.map +1 -0
  29. package/dist/commands/init/nuxt.d.ts +2 -0
  30. package/dist/commands/init/nuxt.d.ts.map +1 -0
  31. package/dist/commands/init/vite.d.ts +2 -0
  32. package/dist/commands/init/vite.d.ts.map +1 -0
  33. package/dist/commands/init.d.ts +26 -0
  34. package/dist/commands/init.d.ts.map +1 -0
  35. package/dist/constants.d.ts +8 -0
  36. package/dist/constants.d.ts.map +1 -0
  37. package/dist/dtcg-D1-iITOr.js +14 -0
  38. package/dist/dtcg-D84AfyzO.cjs +13 -0
  39. package/dist/export-CBdPGGEq.js +66 -0
  40. package/dist/export-DmPAU9Wh.cjs +69 -0
  41. package/dist/export-ONk9eKoZ.cjs +86 -0
  42. package/dist/export-suUS16eO.js +83 -0
  43. package/dist/figma-BvXoqRPU.cjs +13 -0
  44. package/dist/figma-D2RJh56T.js +14 -0
  45. package/dist/import-BQrcHNjK.cjs +126 -0
  46. package/dist/import-Bll_uBvJ.js +123 -0
  47. package/dist/import-MqLYxb8d.js +114 -0
  48. package/dist/import-ibQc_GXm.cjs +117 -0
  49. package/dist/index.cjs +16 -16
  50. package/dist/index.d.ts +3 -4
  51. package/dist/index.d.ts.map +1 -0
  52. package/dist/index.js +16 -17
  53. package/dist/init-CAO0mA_w.js +262 -0
  54. package/dist/init-CaJoUVv2.cjs +265 -0
  55. package/dist/utils.d.ts +7 -0
  56. package/dist/utils.d.ts.map +1 -0
  57. package/package.json +13 -17
  58. package/dist/build-BIWOTFZD.cjs +0 -49
  59. package/dist/build-CANA04j1.js +0 -49
  60. package/dist/export-BMneJTdq.cjs +0 -517
  61. package/dist/export-Cx6awh55.js +0 -517
  62. package/dist/import-BLbc2zWU.cjs +0 -90
  63. package/dist/import-a5DtGEAY.js +0 -90
  64. package/dist/index-BTHfb82h.js +0 -14
  65. package/dist/index-jMzviwjD.cjs +0 -14
  66. package/dist/init-CKeTXHp5.js +0 -234
  67. package/dist/init-CO7VnQKe.cjs +0 -234
@@ -1,49 +0,0 @@
1
- import path from "node:path";
2
- import { loadConfiguration, build as build$1 } from "@styleframe/loader";
3
- import { defineCommand } from "citty";
4
- import consola from "consola";
5
- const build = defineCommand({
6
- meta: {
7
- name: "build",
8
- description: "Build Styleframe project from source files"
9
- },
10
- args: {
11
- entry: {
12
- type: "positional",
13
- description: "Entry point file(s) for the build",
14
- default: "styleframe.config.ts",
15
- valueHint: "path"
16
- },
17
- outputDir: {
18
- type: "string",
19
- description: "Output directory for built files",
20
- default: "styleframe",
21
- alias: ["o", "out"],
22
- valueHint: "path"
23
- },
24
- clean: {
25
- type: "boolean",
26
- description: "Clean output directory before build",
27
- default: false
28
- }
29
- },
30
- async run({ args }) {
31
- consola.info(
32
- `Loading configuration from "${path.relative(process.cwd(), path.resolve(args.entry))}"...`
33
- );
34
- const instance = await loadConfiguration({ entry: args.entry });
35
- consola.info("Building styleframe...");
36
- try {
37
- await build$1(instance, {
38
- outputDir: args.outputDir,
39
- clean: args.clean
40
- });
41
- consola.success("Styleframe built successfully!");
42
- } catch (error) {
43
- consola.error("Failed to build Styleframe:", error);
44
- }
45
- }
46
- });
47
- export {
48
- build as default
49
- };
@@ -1,517 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const promises = require("node:fs/promises");
4
- const path = require("node:path");
5
- const loader = require("@styleframe/loader");
6
- const citty = require("citty");
7
- const consola = require("consola");
8
- const dtcg = require("@styleframe/dtcg");
9
- function isReference(value) {
10
- return typeof value === "object" && value !== null && "type" in value && value.type === "reference";
11
- }
12
- function isCss(value) {
13
- return typeof value === "object" && value !== null && "type" in value && value.type === "css";
14
- }
15
- function isPrimitive(value) {
16
- return typeof value === "string" || typeof value === "number" || typeof value === "boolean";
17
- }
18
- function resolveReferenceTarget(ref, context) {
19
- const visited = context.visited ?? /* @__PURE__ */ new Set();
20
- if (visited.has(ref.name)) {
21
- return {
22
- resolved: null,
23
- reason: `Reference cycle: ${[...visited, ref.name].join(" → ")}`
24
- };
25
- }
26
- const target = context.variables.get(ref.name);
27
- if (!target) {
28
- if (ref.fallback !== void 0 && ref.fallback !== null) {
29
- return evaluateValue(ref.fallback, context);
30
- }
31
- return { resolved: null, reason: `Unknown reference target: ${ref.name}` };
32
- }
33
- const nextContext = {
34
- variables: context.variables,
35
- visited: /* @__PURE__ */ new Set([...visited, ref.name]),
36
- maxViewport: context.maxViewport
37
- };
38
- return evaluateValue(target.value, nextContext);
39
- }
40
- function evaluateCss(css, context) {
41
- const parts = [];
42
- let unevaluable = false;
43
- let unevaluableReason;
44
- for (const part of css.value) {
45
- if (typeof part === "string") {
46
- parts.push({ kind: "literal", text: part });
47
- continue;
48
- }
49
- const evaluated = evaluateValue(part, context);
50
- if (evaluated.resolved === null) {
51
- unevaluable = true;
52
- unevaluableReason = evaluated.reason;
53
- parts.push({ kind: "value", text: "" });
54
- continue;
55
- }
56
- const text = String(evaluated.resolved);
57
- const numeric = typeof evaluated.resolved === "number" ? evaluated.resolved : void 0;
58
- parts.push({ kind: "value", text, numeric });
59
- }
60
- const folded = parts.map((p) => p.text).join("");
61
- if (unevaluable) {
62
- return {
63
- resolved: null,
64
- cssExpression: folded,
65
- reason: unevaluableReason ?? "Computed expression includes an unresolvable reference"
66
- };
67
- }
68
- const isPureArithmetic = parts.every((p) => {
69
- if (p.kind === "value") return p.numeric !== void 0;
70
- return /^[\d.\s+\-*/()]*$/.test(p.text);
71
- });
72
- if (isPureArithmetic && parts.some((p) => p.kind === "value")) {
73
- try {
74
- const result = safeArithmetic(folded.trim());
75
- if (typeof result === "number" && Number.isFinite(result)) {
76
- return { resolved: result };
77
- }
78
- } catch (err) {
79
- return {
80
- resolved: null,
81
- cssExpression: folded,
82
- reason: `Arithmetic evaluation failed: ${err.message}`
83
- };
84
- }
85
- }
86
- const subResult = substituteFluidUnits(folded, context.maxViewport ?? 1440);
87
- if (subResult && /^[\d.\s+\-*/()]+$/.test(subResult.rebased)) {
88
- try {
89
- const result = safeArithmetic(subResult.rebased.trim());
90
- if (typeof result === "number" && Number.isFinite(result)) {
91
- return {
92
- resolved: result,
93
- ...subResult.substituted ? { normalisationSource: "fluid-max" } : {}
94
- };
95
- }
96
- } catch {
97
- }
98
- }
99
- return { resolved: folded };
100
- }
101
- function substituteFluidUnits(expression, maxViewport) {
102
- let substituted = false;
103
- let rebased = expression.replace(/\bcalc\b/g, "");
104
- if (rebased.includes("100vw")) {
105
- rebased = rebased.replace(/100vw/g, String(maxViewport));
106
- substituted = true;
107
- }
108
- if (/(-?\d*\.?\d+)\s*rem/.test(rebased)) {
109
- rebased = rebased.replace(/(-?\d*\.?\d+)\s*rem/g, "($1 * 16)");
110
- substituted = true;
111
- }
112
- if (/(-?\d*\.?\d+)\s*px/.test(rebased)) {
113
- rebased = rebased.replace(/(-?\d*\.?\d+)\s*px/g, "$1");
114
- substituted = true;
115
- }
116
- if (/[a-zA-Z%]/.test(rebased)) return null;
117
- return { rebased, substituted };
118
- }
119
- function safeArithmetic(expression) {
120
- if (!/^[\d.\s+\-*/()]+$/.test(expression)) {
121
- throw new Error(`Disallowed characters in expression: "${expression}"`);
122
- }
123
- const fn = new Function(`return (${expression});`);
124
- return fn();
125
- }
126
- function evaluateValue(value, context) {
127
- if (value === null || value === void 0) {
128
- return { resolved: null, reason: "Value is null/undefined" };
129
- }
130
- if (isPrimitive(value)) {
131
- return { resolved: value };
132
- }
133
- if (isReference(value)) {
134
- const targetResolution = resolveReferenceTarget(value, context);
135
- const isTopLevel = !context.visited || context.visited.size === 0;
136
- if (isTopLevel && targetResolution.resolved !== null) {
137
- return { ...targetResolution, aliasTarget: value.name };
138
- }
139
- return targetResolution;
140
- }
141
- if (isCss(value)) {
142
- return evaluateCss(value, context);
143
- }
144
- if (Array.isArray(value)) {
145
- return {
146
- resolved: null,
147
- reason: "Heterogeneous array — DTCG composite encoding not yet implemented"
148
- };
149
- }
150
- return {
151
- resolved: null,
152
- reason: `Unsupported value shape: ${typeof value}`
153
- };
154
- }
155
- const TOKENS_SCHEMA_URL = "https://design-tokens.org/schemas/2025.10/tokens.json";
156
- const RESOLVER_SCHEMA_URL = "https://www.designtokens.org/schemas/2025.10/resolver.json";
157
- function buildVariableMap(root) {
158
- const map = /* @__PURE__ */ new Map();
159
- for (const v of root.variables) map.set(v.name, v);
160
- for (const theme of root.themes) {
161
- for (const v of theme.variables) {
162
- if (!map.has(v.name)) map.set(v.name, v);
163
- }
164
- }
165
- return map;
166
- }
167
- function processVariable(variable, context) {
168
- const evaluation = evaluateValue(variable.value, context);
169
- const classification = classifyValueForVariable(variable.name, evaluation);
170
- return { name: variable.name, evaluation, classification };
171
- }
172
- function classifyValueForVariable(name, evaluation) {
173
- if (evaluation.resolved === null) return void 0;
174
- return dtcg.classifyValue(evaluation.resolved, { path: name });
175
- }
176
- function setNestedToken(doc, dotPath, token) {
177
- const segments = dotPath.split(".");
178
- let cursor = doc;
179
- for (let i = 0; i < segments.length - 1; i++) {
180
- const segment = segments[i];
181
- const next = cursor[segment];
182
- if (typeof next !== "object" || next === null || Array.isArray(next)) {
183
- cursor[segment] = {};
184
- } else if ("$value" in next) {
185
- cursor[segment] = { $root: next };
186
- }
187
- cursor = cursor[segment];
188
- }
189
- const leaf = segments[segments.length - 1];
190
- const existing = cursor[leaf];
191
- if (typeof existing === "object" && existing !== null && !Array.isArray(existing) && !("$value" in existing)) {
192
- existing.$root = token;
193
- } else {
194
- cursor[leaf] = token;
195
- }
196
- }
197
- function setNestedOverride(context, dotPath, value, type) {
198
- const segments = dotPath.split(".");
199
- let cursor = context;
200
- for (let i = 0; i < segments.length - 1; i++) {
201
- const segment = segments[i];
202
- const next = cursor[segment];
203
- if (typeof next !== "object" || next === null || Array.isArray(next) || "$value" in next) {
204
- cursor[segment] = {};
205
- }
206
- cursor = cursor[segment];
207
- }
208
- const token = { $value: value };
209
- if (type !== void 0) token.$type = type;
210
- cursor[segments[segments.length - 1]] = token;
211
- }
212
- function makeAliasToken(target, type, description) {
213
- const token = { $value: dtcg.formatAlias(target) };
214
- if (type !== void 0) token.$type = type;
215
- return token;
216
- }
217
- function makeValueToken(classification, description, fluidBound) {
218
- const token = {
219
- $value: classification.value,
220
- $type: classification.type
221
- };
222
- if (fluidBound) {
223
- token.$extensions = {
224
- "dev.styleframe": { fluidBound }
225
- };
226
- }
227
- return token;
228
- }
229
- function makeExpressionToken(expression, description) {
230
- const token = {
231
- $value: expression,
232
- $extensions: {
233
- "dev.styleframe": { expression }
234
- }
235
- };
236
- return token;
237
- }
238
- function valuesEqual(a, b) {
239
- if (a === b) return true;
240
- if (typeof a !== typeof b) return false;
241
- if (typeof a === "object") return JSON.stringify(a) === JSON.stringify(b);
242
- return false;
243
- }
244
- function capitalizeContextName(name) {
245
- if (name.length === 0) return name;
246
- return name.charAt(0).toUpperCase() + name.slice(1);
247
- }
248
- function buildDTCG(root, options = {}) {
249
- const includeSchema = options.includeSchema ?? true;
250
- const schemaUrl = options.schemaUrl ?? TOKENS_SCHEMA_URL;
251
- const modifierName = options.modifierName ?? "theme";
252
- const collectionName = options.collectionName ?? "Design Tokens";
253
- const defaultModeName = options.defaultModeName ?? "Default";
254
- const tokensSourceRef = options.tokensSourceRef ?? "tokens.json";
255
- const variableMap = buildVariableMap(root);
256
- const fluidMaxVariable = variableMap.get("fluid.max-width");
257
- const fluidMaxResolved = fluidMaxVariable ? evaluateValue(fluidMaxVariable.value, { variables: variableMap }).resolved : null;
258
- const maxViewport = typeof fluidMaxResolved === "number" ? fluidMaxResolved : 1440;
259
- const context = { variables: variableMap, maxViewport };
260
- const processed = /* @__PURE__ */ new Map();
261
- const typeMap = /* @__PURE__ */ new Map();
262
- for (const variable of root.variables) {
263
- const p = processVariable(variable, context);
264
- processed.set(variable.name, p);
265
- if (p.classification) typeMap.set(variable.name, p.classification.type);
266
- }
267
- const resolveTypeFromAliasChain = (name, seen) => {
268
- if (seen.has(name)) return void 0;
269
- const direct = typeMap.get(name);
270
- if (direct) return direct;
271
- const p = processed.get(name);
272
- if (p?.evaluation.aliasTarget) {
273
- return resolveTypeFromAliasChain(
274
- p.evaluation.aliasTarget,
275
- /* @__PURE__ */ new Set([...seen, name])
276
- );
277
- }
278
- return void 0;
279
- };
280
- const tokens = {};
281
- if (includeSchema) tokens.$schema = schemaUrl;
282
- tokens.$extensions = {
283
- "dev.styleframe": { collection: collectionName }
284
- };
285
- const diagnostics = [];
286
- let emittedCount = 0;
287
- let fluidNormalisedCount = 0;
288
- for (const variable of root.variables) {
289
- const p = processed.get(variable.name);
290
- if (!p) continue;
291
- const { evaluation, classification } = p;
292
- if (evaluation.aliasTarget) {
293
- const targetType = resolveTypeFromAliasChain(
294
- evaluation.aliasTarget,
295
- /* @__PURE__ */ new Set()
296
- );
297
- setNestedToken(
298
- tokens,
299
- variable.name,
300
- makeAliasToken(evaluation.aliasTarget, targetType)
301
- );
302
- emittedCount++;
303
- continue;
304
- }
305
- if (classification) {
306
- const fluidBound = evaluation.normalisationSource === "fluid-max" ? "max" : void 0;
307
- const promoted = fluidBound && classification.type === "number" && typeof classification.value === "number" ? {
308
- type: "dimension",
309
- value: { value: classification.value, unit: "px" }
310
- } : classification;
311
- setNestedToken(
312
- tokens,
313
- variable.name,
314
- makeValueToken(promoted, void 0, fluidBound)
315
- );
316
- if (fluidBound) fluidNormalisedCount++;
317
- emittedCount++;
318
- continue;
319
- }
320
- if (evaluation.cssExpression) {
321
- setNestedToken(
322
- tokens,
323
- variable.name,
324
- makeExpressionToken(evaluation.cssExpression)
325
- );
326
- diagnostics.push({
327
- name: variable.name,
328
- level: "warn",
329
- reason: evaluation.reason ?? "Computed expression — preserved as dev.styleframe.expression extension"
330
- });
331
- emittedCount++;
332
- continue;
333
- }
334
- if (evaluation.resolved !== null && typeof evaluation.resolved !== "boolean") {
335
- setNestedToken(tokens, variable.name, {
336
- $value: String(evaluation.resolved),
337
- $extensions: { "dev.styleframe": { unknownType: true } }
338
- });
339
- diagnostics.push({
340
- name: variable.name,
341
- level: "warn",
342
- reason: "Could not infer DTCG $type — emitted as untyped string"
343
- });
344
- emittedCount++;
345
- continue;
346
- }
347
- diagnostics.push({
348
- name: variable.name,
349
- level: "warn",
350
- reason: evaluation.reason ?? "Unrepresentable value — skipped"
351
- });
352
- }
353
- const themedThemes = root.themes.filter(
354
- (t) => t.variables.length > 0
355
- );
356
- let resolver;
357
- if (themedThemes.length > 0) {
358
- const contexts = {};
359
- for (const theme of themedThemes) {
360
- const contextDoc = {};
361
- for (const variable of theme.variables) {
362
- const themeProcessed = processVariable(variable, context);
363
- const defaultProcessed = processed.get(variable.name);
364
- let themeValue;
365
- let themeType;
366
- if (themeProcessed.evaluation.aliasTarget) {
367
- themeValue = dtcg.formatAlias(themeProcessed.evaluation.aliasTarget);
368
- themeType = resolveTypeFromAliasChain(
369
- themeProcessed.evaluation.aliasTarget,
370
- /* @__PURE__ */ new Set()
371
- );
372
- } else if (themeProcessed.classification) {
373
- themeValue = themeProcessed.classification.value;
374
- themeType = themeProcessed.classification.type;
375
- }
376
- if (themeValue === void 0) continue;
377
- let defaultValue;
378
- if (defaultProcessed?.evaluation.aliasTarget) {
379
- defaultValue = dtcg.formatAlias(defaultProcessed.evaluation.aliasTarget);
380
- } else if (defaultProcessed?.classification) {
381
- defaultValue = defaultProcessed.classification.value;
382
- }
383
- if (defaultValue !== void 0 && valuesEqual(themeValue, defaultValue)) {
384
- continue;
385
- }
386
- setNestedOverride(
387
- contextDoc,
388
- variable.name,
389
- themeValue,
390
- themeType
391
- );
392
- }
393
- contexts[capitalizeContextName(theme.name)] = contextDoc;
394
- }
395
- for (const key of Object.keys(contexts)) {
396
- if (Object.keys(contexts[key]).length === 0)
397
- delete contexts[key];
398
- }
399
- const themeContextNames = Object.keys(contexts);
400
- if (themeContextNames.length > 0) {
401
- const allContexts = {
402
- [defaultModeName]: []
403
- };
404
- for (const name of themeContextNames) {
405
- allContexts[name] = [contexts[name]];
406
- }
407
- resolver = {
408
- $schema: RESOLVER_SCHEMA_URL,
409
- version: "2025.10",
410
- modifiers: {
411
- [modifierName]: {
412
- contexts: allContexts,
413
- default: defaultModeName
414
- }
415
- },
416
- resolutionOrder: [
417
- { type: "set", sources: [{ $ref: tokensSourceRef }] },
418
- { $ref: `#/modifiers/${modifierName}` }
419
- ]
420
- };
421
- }
422
- }
423
- return {
424
- tokens,
425
- resolver,
426
- diagnostics,
427
- emittedCount,
428
- fluidNormalisedCount,
429
- maxViewport
430
- };
431
- }
432
- const _export = citty.defineCommand({
433
- meta: {
434
- name: "export",
435
- description: "Export Styleframe variables to spec-conformant DTCG JSON"
436
- },
437
- args: {
438
- config: {
439
- type: "string",
440
- description: "Path to the Styleframe config file",
441
- default: "styleframe.config.ts",
442
- alias: ["c"],
443
- valueHint: "path"
444
- },
445
- output: {
446
- type: "string",
447
- description: "Output JSON file path",
448
- default: "tokens.json",
449
- alias: ["o"],
450
- valueHint: "path"
451
- },
452
- collection: {
453
- type: "string",
454
- description: "Collection name embedded in the export",
455
- default: "Design Tokens",
456
- alias: ["n", "name"]
457
- }
458
- },
459
- async run({ args }) {
460
- const configPath = path.resolve(args.config);
461
- const outputPath = path.resolve(args.output);
462
- consola.info(
463
- `Loading configuration from "${path.relative(process.cwd(), configPath)}"...`
464
- );
465
- const instance = await loader.loadConfiguration({ entry: configPath });
466
- const root = instance.root;
467
- consola.info("Building DTCG document...");
468
- const {
469
- tokens,
470
- resolver,
471
- diagnostics,
472
- emittedCount,
473
- fluidNormalisedCount,
474
- maxViewport
475
- } = buildDTCG(root, {
476
- collectionName: args.collection,
477
- tokensSourceRef: path.basename(outputPath)
478
- });
479
- await promises.writeFile(outputPath, `${JSON.stringify(tokens, null, 2)}
480
- `);
481
- consola.info(
482
- `Wrote ${emittedCount} tokens to "${path.relative(process.cwd(), outputPath)}"`
483
- );
484
- if (fluidNormalisedCount > 0) {
485
- consola.info(
486
- `Normalised ${fluidNormalisedCount} fluid token(s) using max viewport (${maxViewport}px).`
487
- );
488
- }
489
- if (resolver) {
490
- const resolverPath = outputPath.replace(/\.json$/, ".resolver.json");
491
- await promises.writeFile(resolverPath, `${JSON.stringify(resolver, null, 2)}
492
- `);
493
- consola.info(
494
- `Wrote resolver to "${path.relative(process.cwd(), resolverPath)}"`
495
- );
496
- }
497
- const warnings = diagnostics.filter((d) => d.level === "warn");
498
- if (warnings.length > 0) {
499
- consola.warn(
500
- `${warnings.length} variable(s) needed special handling — see Styleframe ↔ DTCG round-trip notes`
501
- );
502
- for (const w of warnings.slice(0, 10)) {
503
- consola.info(` - ${w.name}: ${w.reason}`);
504
- }
505
- if (warnings.length > 10) {
506
- consola.info(` ... and ${warnings.length - 10} more`);
507
- }
508
- consola.info(
509
- 'Tip: untyped tokens are usually CSS keywords (e.g. "normal", "thin", "italic") with no DTCG equivalent — they round-trip to Figma as STRING variables.'
510
- );
511
- }
512
- consola.success(
513
- `Exported ${emittedCount} tokens in DTCG format to "${path.relative(process.cwd(), outputPath)}"`
514
- );
515
- }
516
- });
517
- exports.default = _export;