@dsai-io/tools 0.0.1

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.
@@ -0,0 +1,1115 @@
1
+ 'use strict';
2
+
3
+ var zod = require('zod');
4
+ var path2 = require('path');
5
+ var cosmiconfig = require('cosmiconfig');
6
+
7
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
+
9
+ var path2__default = /*#__PURE__*/_interopDefault(path2);
10
+
11
+ /* @dsai-io/tools - DSAi Design System Build Tools */
12
+
13
+ var logLevelSchema = zod.z.enum(["silent", "error", "warn", "info", "debug", "verbose"]);
14
+ var outputFormatSchema = zod.z.enum(["css", "scss", "less", "json", "js", "ts", "esm", "cjs"]);
15
+ var frameworkSchema = zod.z.enum(["react", "vue", "angular", "svelte", "vanilla"]);
16
+ var hashTypeSchema = zod.z.enum(["content", "timestamp", "version", "none"]);
17
+ var globPatternSchema = zod.z.string().min(1, "Glob pattern cannot be empty");
18
+ var filePathSchema = zod.z.string().min(1, "File path cannot be empty");
19
+ var versionSchema = zod.z.string().refine(
20
+ (val) => {
21
+ const parts = val.split("-");
22
+ const version = parts[0] ?? "";
23
+ const preRelease = parts[1];
24
+ const versionParts = version.split(".");
25
+ if (versionParts.length !== 3) {
26
+ return false;
27
+ }
28
+ for (const part of versionParts) {
29
+ const num = Number(part);
30
+ if (!Number.isInteger(num) || num < 0) {
31
+ return false;
32
+ }
33
+ }
34
+ if (preRelease !== void 0 && preRelease.length === 0) {
35
+ return false;
36
+ }
37
+ return true;
38
+ },
39
+ { message: "Invalid semantic version format" }
40
+ );
41
+ var customTransformSchema = zod.z.object({
42
+ name: zod.z.string().min(1, "Transform name is required"),
43
+ description: zod.z.string().optional(),
44
+ type: zod.z.enum(["value", "attribute", "name"]).optional().default("value"),
45
+ transform: zod.z.function().args(zod.z.any(), zod.z.any()).returns(zod.z.any()).optional(),
46
+ filter: zod.z.function().args(zod.z.any()).returns(zod.z.boolean()).optional(),
47
+ matcher: zod.z.function().args(zod.z.any()).returns(zod.z.boolean()).optional()
48
+ });
49
+ var customFormatSchema = zod.z.object({
50
+ name: zod.z.string().min(1, "Format name is required"),
51
+ description: zod.z.string().optional(),
52
+ formatter: zod.z.function().args(zod.z.any()).returns(zod.z.string()).optional(),
53
+ extension: zod.z.string().min(1).optional()
54
+ });
55
+ var themeModeSchema = zod.z.object({
56
+ selector: zod.z.string().min(1, "Theme selector is required"),
57
+ mediaQuery: zod.z.string().optional(),
58
+ dataAttribute: zod.z.string().optional(),
59
+ cssVariables: zod.z.boolean().optional().default(true),
60
+ generateSeparateFiles: zod.z.boolean().optional().default(false),
61
+ prefix: zod.z.string().optional()
62
+ });
63
+ var themesConfigSchema = zod.z.object({
64
+ enabled: zod.z.boolean().optional().default(true),
65
+ defaultMode: zod.z.enum(["light", "dark", "system"]).optional().default("light"),
66
+ modes: zod.z.record(zod.z.string(), themeModeSchema).optional().default({
67
+ light: { selector: ":root", cssVariables: true, generateSeparateFiles: false },
68
+ dark: {
69
+ selector: '[data-theme="dark"]',
70
+ mediaQuery: "(prefers-color-scheme: dark)",
71
+ cssVariables: true,
72
+ generateSeparateFiles: false
73
+ }
74
+ }),
75
+ outputFileName: zod.z.string().optional().default("themes"),
76
+ colorScheme: zod.z.object({
77
+ light: zod.z.string().optional(),
78
+ dark: zod.z.string().optional()
79
+ }).optional()
80
+ });
81
+ var iconOptimizationSchema = zod.z.object({
82
+ enabled: zod.z.boolean().optional().default(true),
83
+ removeComments: zod.z.boolean().optional().default(true),
84
+ removeDimensions: zod.z.boolean().optional().default(false),
85
+ removeViewBox: zod.z.boolean().optional().default(false),
86
+ removeXMLNS: zod.z.boolean().optional().default(true),
87
+ cleanupIds: zod.z.boolean().optional().default(true),
88
+ minify: zod.z.boolean().optional().default(true)
89
+ });
90
+ var iconSpriteSchema = zod.z.object({
91
+ enabled: zod.z.boolean().optional().default(true),
92
+ fileName: zod.z.string().optional().default("icons"),
93
+ format: zod.z.enum(["symbol", "stack", "css"]).optional().default("symbol"),
94
+ prefix: zod.z.string().optional().default("icon-")
95
+ });
96
+ var iconsConfigSchema = zod.z.object({
97
+ enabled: zod.z.boolean().optional().default(true),
98
+ sourceDir: zod.z.string().optional().default("assets/icons"),
99
+ outputDir: zod.z.string().optional().default("dist/icons"),
100
+ formats: zod.z.array(zod.z.enum(["svg", "react", "vue", "sprite", "font"])).optional().default(["svg"]),
101
+ optimization: iconOptimizationSchema.optional(),
102
+ sprite: iconSpriteSchema.optional(),
103
+ componentPrefix: zod.z.string().optional().default("Icon"),
104
+ componentSuffix: zod.z.string().optional().default(""),
105
+ generateIndex: zod.z.boolean().optional().default(true),
106
+ generateTypes: zod.z.boolean().optional().default(true)
107
+ });
108
+ var tokenBuildConfigSchema = zod.z.object({
109
+ format: outputFormatSchema,
110
+ outputDir: zod.z.string().optional(),
111
+ outputFileName: zod.z.string().optional(),
112
+ fileExtension: zod.z.string().optional(),
113
+ prefix: zod.z.string().optional(),
114
+ useVariables: zod.z.boolean().optional(),
115
+ selector: zod.z.string().optional(),
116
+ transforms: zod.z.array(zod.z.string()).optional(),
117
+ customTransforms: zod.z.array(customTransformSchema).optional(),
118
+ filter: zod.z.function().args(zod.z.any()).returns(zod.z.union([zod.z.boolean(), zod.z.promise(zod.z.boolean())])).optional(),
119
+ header: zod.z.string().optional(),
120
+ footer: zod.z.string().optional()
121
+ });
122
+ var tokenCacheConfigSchema = zod.z.object({
123
+ enabled: zod.z.boolean().optional().default(true),
124
+ directory: zod.z.string().optional().default(".cache"),
125
+ hashType: hashTypeSchema.optional().default("content"),
126
+ maxAge: zod.z.number().optional().default(864e5)
127
+ });
128
+ var tokenWatchConfigSchema = zod.z.object({
129
+ enabled: zod.z.boolean().optional().default(false),
130
+ debounce: zod.z.number().optional().default(300),
131
+ clearScreen: zod.z.boolean().optional().default(true),
132
+ ignorePatterns: zod.z.array(zod.z.string()).optional().default([])
133
+ });
134
+ var tokensHooksSchema = zod.z.object({
135
+ onBuildStart: zod.z.function().args(zod.z.any()).returns(zod.z.union([zod.z.void(), zod.z.promise(zod.z.void())])).optional(),
136
+ onFormatComplete: zod.z.function().args(zod.z.any()).returns(zod.z.union([zod.z.void(), zod.z.promise(zod.z.void())])).optional(),
137
+ onAllFormatsComplete: zod.z.function().args(zod.z.any()).returns(zod.z.union([zod.z.void(), zod.z.promise(zod.z.void())])).optional(),
138
+ onBuildComplete: zod.z.function().args(zod.z.any()).returns(zod.z.union([zod.z.void(), zod.z.promise(zod.z.void())])).optional(),
139
+ onError: zod.z.function().args(zod.z.any()).returns(zod.z.union([zod.z.void(), zod.z.promise(zod.z.void())])).optional()
140
+ });
141
+ var buildPipelineStepSchema = zod.z.enum([
142
+ "validate",
143
+ "transform",
144
+ "style-dictionary",
145
+ "sync",
146
+ "sass-theme",
147
+ "sass-theme-minified",
148
+ "postprocess",
149
+ "sass-utilities",
150
+ "sass-utilities-minified",
151
+ "bundle"
152
+ ]);
153
+ var tokensBuildPipelineSchema = zod.z.object({
154
+ /**
155
+ * Steps to include in the build.
156
+ * Order matters - steps run in sequence.
157
+ * Default includes all steps for full @dsai-io/tokens build.
158
+ * Simpler packages can use subset like ['validate', 'transform', 'style-dictionary']
159
+ */
160
+ steps: zod.z.array(buildPipelineStepSchema).optional().default([
161
+ "validate",
162
+ "transform",
163
+ "style-dictionary",
164
+ "sync",
165
+ "sass-theme",
166
+ "sass-theme-minified",
167
+ "postprocess",
168
+ "sass-utilities",
169
+ "sass-utilities-minified",
170
+ "bundle"
171
+ ]),
172
+ /**
173
+ * Paths configuration for build steps
174
+ */
175
+ paths: zod.z.object({
176
+ /** Source file for sync step (Style Dictionary JS output) */
177
+ syncSource: zod.z.string().optional().default("dist/js/tokens.js"),
178
+ /** Target file for sync step */
179
+ syncTarget: zod.z.string().optional().default("src/tokens-flat.ts"),
180
+ /** SCSS theme input file */
181
+ sassThemeInput: zod.z.string().optional().default("src/scss/dsai-theme-bs.scss"),
182
+ /** CSS theme output file */
183
+ sassThemeOutput: zod.z.string().optional().default("dist/css/dsai-theme-bs.css"),
184
+ /** CSS theme minified output file */
185
+ sassThemeMinifiedOutput: zod.z.string().optional().default("dist/css/dsai-theme-bs.min.css"),
186
+ /** SCSS utilities input file */
187
+ sassUtilitiesInput: zod.z.string().optional().default("src/scss/dsai-utilities.scss"),
188
+ /** CSS utilities output file */
189
+ sassUtilitiesOutput: zod.z.string().optional().default("dist/css/dsai.css"),
190
+ /** CSS utilities minified output file */
191
+ sassUtilitiesMinifiedOutput: zod.z.string().optional().default("dist/css/dsai.min.css")
192
+ }).optional(),
193
+ /** Style Dictionary config file name */
194
+ styleDictionaryConfig: zod.z.string().optional().default("sd.config.mjs")
195
+ });
196
+ var tokensConfigSchema = zod.z.object({
197
+ enabled: zod.z.boolean().optional().default(true),
198
+ sourcePatterns: zod.z.array(zod.z.string()).optional().default(["src/tokens/**/*.json", "src/tokens/**/*.yaml"]),
199
+ outputDirs: zod.z.object({
200
+ css: zod.z.string().optional().default("dist/css"),
201
+ scss: zod.z.string().optional().default("dist/scss"),
202
+ less: zod.z.string().optional().default("dist/less"),
203
+ js: zod.z.string().optional().default("dist/js"),
204
+ ts: zod.z.string().optional().default("dist/ts"),
205
+ json: zod.z.string().optional().default("dist/json")
206
+ }).optional(),
207
+ additionalScssDirectories: zod.z.array(zod.z.string()).optional().default([]),
208
+ outputFileNames: zod.z.object({
209
+ variables: zod.z.string().optional().default("variables"),
210
+ utilities: zod.z.string().optional().default("utilities"),
211
+ mixins: zod.z.string().optional().default("mixins"),
212
+ tokens: zod.z.string().optional().default("tokens")
213
+ }).optional(),
214
+ prefix: zod.z.string().optional().default("dsai"),
215
+ mergeOrder: zod.z.array(zod.z.string()).optional().default(["base", "semantic", "component"]),
216
+ createBundle: zod.z.boolean().optional().default(true),
217
+ bundleFileName: zod.z.string().optional().default("bundle"),
218
+ formats: zod.z.array(outputFormatSchema).optional().default(["css", "scss", "json"]),
219
+ platforms: zod.z.record(zod.z.string(), tokenBuildConfigSchema).optional(),
220
+ transforms: zod.z.array(zod.z.string()).optional().default([]),
221
+ customTransforms: zod.z.array(customTransformSchema).optional().default([]),
222
+ customFormats: zod.z.array(customFormatSchema).optional().default([]),
223
+ hooks: tokensHooksSchema.optional(),
224
+ cache: tokenCacheConfigSchema.optional(),
225
+ watch: tokenWatchConfigSchema.optional(),
226
+ verbose: zod.z.boolean().optional().default(false),
227
+ /** Build pipeline configuration */
228
+ pipeline: tokensBuildPipelineSchema.optional()
229
+ });
230
+ var buildConfigSchema = zod.z.object({
231
+ outDir: zod.z.string().optional().default("dist"),
232
+ clean: zod.z.boolean().optional().default(true),
233
+ sourcemap: zod.z.boolean().optional().default(false),
234
+ minify: zod.z.boolean().optional().default(true),
235
+ parallel: zod.z.boolean().optional().default(true),
236
+ maxConcurrency: zod.z.number().optional().default(4)
237
+ });
238
+ var globalConfigSchema = zod.z.object({
239
+ logLevel: logLevelSchema.optional().default("info"),
240
+ colors: zod.z.boolean().optional().default(true),
241
+ ci: zod.z.boolean().optional().default(false),
242
+ dryRun: zod.z.boolean().optional().default(false),
243
+ cwd: zod.z.string().optional(),
244
+ configPath: zod.z.string().optional(),
245
+ framework: frameworkSchema.optional(),
246
+ build: buildConfigSchema.optional()
247
+ });
248
+ var dsaiConfigSchema = zod.z.object({
249
+ $schema: zod.z.string().optional(),
250
+ extends: zod.z.union([zod.z.string(), zod.z.array(zod.z.string())]).optional(),
251
+ global: globalConfigSchema.optional(),
252
+ tokens: tokensConfigSchema.optional(),
253
+ themes: themesConfigSchema.optional(),
254
+ icons: iconsConfigSchema.optional()
255
+ });
256
+ function formatValidationErrors(zodError) {
257
+ return zodError.errors.map((err) => ({
258
+ path: err.path.join(".") || "root",
259
+ message: err.message,
260
+ code: err.code,
261
+ expected: "expected" in err ? String(err.expected) : void 0,
262
+ received: "received" in err ? String(err.received) : void 0
263
+ }));
264
+ }
265
+ function validateConfig(config) {
266
+ const result = dsaiConfigSchema.safeParse(config);
267
+ if (result.success) {
268
+ return {
269
+ success: true,
270
+ data: result.data
271
+ };
272
+ }
273
+ return {
274
+ success: false,
275
+ errors: formatValidationErrors(result.error)
276
+ };
277
+ }
278
+ function validateConfigOrThrow(config) {
279
+ const result = validateConfig(config);
280
+ if (!result.success) {
281
+ const errorMessages = result.errors?.map((e) => ` - ${e.path}: ${e.message}`).join("\n");
282
+ throw new Error(`Configuration validation failed:
283
+ ${errorMessages}`);
284
+ }
285
+ return result.data;
286
+ }
287
+ function validateConfigSection(section, config) {
288
+ const sectionSchemas = {
289
+ global: globalConfigSchema,
290
+ tokens: tokensConfigSchema,
291
+ themes: themesConfigSchema,
292
+ icons: iconsConfigSchema
293
+ };
294
+ const schema = sectionSchemas[section];
295
+ if (!schema) {
296
+ return {
297
+ success: false,
298
+ errors: [
299
+ {
300
+ path: section,
301
+ message: `Unknown configuration section: ${section}`,
302
+ code: "unknown_section"
303
+ }
304
+ ]
305
+ };
306
+ }
307
+ const result = schema.safeParse(config);
308
+ if (result.success) {
309
+ return {
310
+ success: true,
311
+ data: result.data
312
+ };
313
+ }
314
+ return {
315
+ success: false,
316
+ errors: formatValidationErrors(result.error)
317
+ };
318
+ }
319
+ function formatErrorMessage(errors) {
320
+ const lines = ["Configuration validation failed:", ""];
321
+ for (const error of errors) {
322
+ lines.push(` \u2717 ${error.path}`);
323
+ lines.push(` ${error.message}`);
324
+ if (error.expected && error.received) {
325
+ lines.push(` Expected: ${error.expected}`);
326
+ lines.push(` Received: ${error.received}`);
327
+ }
328
+ lines.push("");
329
+ }
330
+ return lines.join("\n");
331
+ }
332
+
333
+ // src/config/defaults.ts
334
+ var DEFAULT_PREFIX = "--dsai-";
335
+ var DEFAULT_LOG_LEVEL = "info";
336
+ var DEFAULT_OUTPUT_DIR = "dist";
337
+ var DEFAULT_SOURCE_DIR = "figma-exports";
338
+ var DEFAULT_COLLECTIONS_DIR = "collections";
339
+ var DEFAULT_ICONS_SOURCE_DIR = "icons";
340
+ var DEFAULT_ICONS_OUTPUT_DIR = "dist/icons";
341
+ var defaultSourcePatterns = ["theme.json", "tokens.json", "*.tokens.json"];
342
+ var defaultFormats = ["css", "scss", "js", "ts", "json"];
343
+ var defaultOutputFileNames = {
344
+ css: "tokens.css",
345
+ scss: "_tokens.scss",
346
+ js: "tokens.js",
347
+ ts: "tokens.ts",
348
+ json: "tokens.json",
349
+ android: "tokens.xml",
350
+ ios: "tokens.h"
351
+ };
352
+ var defaultSelectorPattern = {
353
+ default: ":root",
354
+ others: '[data-dsai-theme="{mode}"]'
355
+ };
356
+ var defaultThemesConfig = {
357
+ autoDetect: true,
358
+ default: "Light",
359
+ ignoreModes: [],
360
+ selectorPattern: defaultSelectorPattern
361
+ };
362
+ var defaultIconFramework = "react";
363
+ var defaultIconsConfig = {
364
+ sourceDir: DEFAULT_ICONS_SOURCE_DIR,
365
+ outputDir: DEFAULT_ICONS_OUTPUT_DIR,
366
+ framework: defaultIconFramework,
367
+ typescript: true,
368
+ optimize: true,
369
+ prefix: "Icon"
370
+ };
371
+ var defaultTokensConfig = {
372
+ source: "theme",
373
+ sourceDir: DEFAULT_SOURCE_DIR,
374
+ collectionsDir: DEFAULT_COLLECTIONS_DIR,
375
+ sourcePatterns: defaultSourcePatterns,
376
+ collectionMapping: {},
377
+ outputDir: DEFAULT_OUTPUT_DIR,
378
+ outputDirs: {},
379
+ outputFileNames: defaultOutputFileNames,
380
+ prefix: DEFAULT_PREFIX,
381
+ formats: defaultFormats,
382
+ additionalScssDirectories: [],
383
+ additionalCssDirectories: [],
384
+ mergeOrder: "after",
385
+ createBundle: false,
386
+ themes: defaultThemesConfig,
387
+ transforms: [],
388
+ customFormats: [],
389
+ preprocessors: [],
390
+ filters: [],
391
+ outputReferences: true,
392
+ baseFontSize: 16,
393
+ separateThemeFiles: false,
394
+ watch: false,
395
+ watchDirectories: []
396
+ };
397
+ var defaultGlobalConfig = {
398
+ cwd: process.cwd(),
399
+ debug: false,
400
+ logLevel: DEFAULT_LOG_LEVEL
401
+ };
402
+ var defaultConfig = {
403
+ tokens: defaultTokensConfig,
404
+ icons: defaultIconsConfig,
405
+ global: defaultGlobalConfig,
406
+ configDir: process.cwd()
407
+ };
408
+ var envMappings = {
409
+ // Global settings
410
+ DSAI_LOG_LEVEL: "global.logLevel",
411
+ DSAI_DEBUG: "global.debug",
412
+ DSAI_CWD: "global.cwd",
413
+ // Token settings
414
+ DSAI_PREFIX: "tokens.prefix",
415
+ DSAI_SOURCE_DIR: "tokens.sourceDir",
416
+ DSAI_OUTPUT_DIR: "tokens.outputDir",
417
+ DSAI_WATCH: "tokens.watch",
418
+ DSAI_CREATE_BUNDLE: "tokens.createBundle",
419
+ DSAI_BASE_FONT_SIZE: "tokens.baseFontSize",
420
+ // Theme settings
421
+ DSAI_DEFAULT_THEME: "tokens.themes.default",
422
+ DSAI_AUTO_DETECT_THEMES: "tokens.themes.autoDetect",
423
+ // Icon settings
424
+ DSAI_ICONS_SOURCE_DIR: "icons.sourceDir",
425
+ DSAI_ICONS_OUTPUT_DIR: "icons.outputDir",
426
+ DSAI_ICONS_FRAMEWORK: "icons.framework",
427
+ DSAI_ICONS_TYPESCRIPT: "icons.typescript",
428
+ DSAI_ICONS_OPTIMIZE: "icons.optimize",
429
+ DSAI_ICONS_PREFIX: "icons.prefix"
430
+ };
431
+ var envBooleanKeys = /* @__PURE__ */ new Set([
432
+ "DSAI_DEBUG",
433
+ "DSAI_WATCH",
434
+ "DSAI_CREATE_BUNDLE",
435
+ "DSAI_AUTO_DETECT_THEMES",
436
+ "DSAI_ICONS_TYPESCRIPT",
437
+ "DSAI_ICONS_OPTIMIZE"
438
+ ]);
439
+ var envNumberKeys = /* @__PURE__ */ new Set(["DSAI_BASE_FONT_SIZE"]);
440
+ var envArrayKeys = /* @__PURE__ */ new Set(["DSAI_FORMATS", "DSAI_IGNORE_MODES"]);
441
+ function getOutputFileName(format, theme) {
442
+ let baseName;
443
+ switch (format) {
444
+ case "css":
445
+ baseName = "tokens.css";
446
+ break;
447
+ case "scss":
448
+ baseName = "_tokens.scss";
449
+ break;
450
+ case "js":
451
+ baseName = "tokens.js";
452
+ break;
453
+ case "ts":
454
+ baseName = "tokens.ts";
455
+ break;
456
+ case "json":
457
+ baseName = "tokens.json";
458
+ break;
459
+ case "android":
460
+ baseName = "tokens.xml";
461
+ break;
462
+ case "ios":
463
+ baseName = "tokens.h";
464
+ break;
465
+ default:
466
+ baseName = "tokens.txt";
467
+ }
468
+ if (!theme) {
469
+ return baseName;
470
+ }
471
+ const dotIndex = baseName.lastIndexOf(".");
472
+ if (dotIndex === -1) {
473
+ return `${baseName}-${theme}`;
474
+ }
475
+ const name = baseName.slice(0, dotIndex);
476
+ const ext = baseName.slice(dotIndex);
477
+ return `${name}-${theme}${ext}`;
478
+ }
479
+ function getDefaultOutputDir(format) {
480
+ switch (format) {
481
+ case "css":
482
+ return `${DEFAULT_OUTPUT_DIR}/css`;
483
+ case "scss":
484
+ return `${DEFAULT_OUTPUT_DIR}/scss`;
485
+ case "js":
486
+ case "ts":
487
+ return `${DEFAULT_OUTPUT_DIR}/js`;
488
+ case "json":
489
+ return `${DEFAULT_OUTPUT_DIR}/json`;
490
+ case "android":
491
+ return `${DEFAULT_OUTPUT_DIR}/android`;
492
+ case "ios":
493
+ return `${DEFAULT_OUTPUT_DIR}/ios`;
494
+ default:
495
+ return DEFAULT_OUTPUT_DIR;
496
+ }
497
+ }
498
+ function getDefaultExtension(format) {
499
+ switch (format) {
500
+ case "css":
501
+ return ".css";
502
+ case "scss":
503
+ return ".scss";
504
+ case "js":
505
+ return ".js";
506
+ case "ts":
507
+ return ".ts";
508
+ case "json":
509
+ return ".json";
510
+ case "android":
511
+ return ".xml";
512
+ case "ios":
513
+ return ".h";
514
+ default:
515
+ return ".txt";
516
+ }
517
+ }
518
+ function resolveGlobalConfig(config, options) {
519
+ const base = defaultGlobalConfig;
520
+ const cwd = options.cwd ?? process.cwd();
521
+ return {
522
+ cwd: config?.cwd ? path2__default.default.resolve(cwd, config.cwd) : cwd,
523
+ debug: config?.debug ?? base.debug,
524
+ logLevel: config?.logLevel ?? base.logLevel
525
+ };
526
+ }
527
+ function resolveThemesConfig(config) {
528
+ const base = defaultThemesConfig;
529
+ return {
530
+ autoDetect: config?.autoDetect ?? base.autoDetect,
531
+ default: config?.default ?? base.default,
532
+ ignoreModes: config?.ignoreModes ?? [...base.ignoreModes],
533
+ selectorPattern: {
534
+ default: config?.selectorPattern?.default ?? base.selectorPattern.default,
535
+ others: config?.selectorPattern?.others ?? base.selectorPattern.others
536
+ }
537
+ };
538
+ }
539
+ function resolveIconsConfig(config, options) {
540
+ const base = defaultIconsConfig;
541
+ const configDir = options.configDir ?? options.cwd ?? process.cwd();
542
+ return {
543
+ sourceDir: config?.sourceDir ? path2__default.default.resolve(configDir, config.sourceDir) : base.sourceDir,
544
+ outputDir: config?.outputDir ? path2__default.default.resolve(configDir, config.outputDir) : base.outputDir,
545
+ framework: config?.framework ?? base.framework,
546
+ typescript: config?.typescript ?? base.typescript,
547
+ optimize: config?.optimize ?? base.optimize,
548
+ prefix: config?.prefix ?? base.prefix
549
+ };
550
+ }
551
+ function resolveTokensConfig(config, options) {
552
+ const base = defaultTokensConfig;
553
+ const configDir = options.configDir ?? options.cwd ?? process.cwd();
554
+ const resolveDir = (dir) => path2__default.default.resolve(configDir, dir);
555
+ const outputDirsMap = new Map(Object.entries(base.outputDirs));
556
+ if (config?.outputDirs) {
557
+ for (const [format, dir] of Object.entries(config.outputDirs)) {
558
+ if (dir !== void 0) {
559
+ outputDirsMap.set(format, resolveDir(dir));
560
+ }
561
+ }
562
+ }
563
+ const outputDirs = Object.fromEntries(outputDirsMap);
564
+ const collectionMappingMap = /* @__PURE__ */ new Map();
565
+ if (config?.collectionMapping) {
566
+ for (const [name, filePath] of Object.entries(config.collectionMapping)) {
567
+ collectionMappingMap.set(name, resolveDir(filePath));
568
+ }
569
+ }
570
+ const collectionMapping = Object.fromEntries(collectionMappingMap);
571
+ const additionalScssDirectories = (config?.additionalScssDirectories ?? []).map(resolveDir);
572
+ const additionalCssDirectories = (config?.additionalCssDirectories ?? []).map(resolveDir);
573
+ const watchDirectories = (config?.watchDirectories ?? []).map(resolveDir);
574
+ return {
575
+ source: config?.source ?? base.source,
576
+ sourceDir: config?.sourceDir ? resolveDir(config.sourceDir) : base.sourceDir,
577
+ collectionsDir: config?.collectionsDir ? resolveDir(config.collectionsDir) : base.collectionsDir,
578
+ sourcePatterns: config?.sourcePatterns ?? [...base.sourcePatterns],
579
+ collectionMapping,
580
+ outputDir: config?.outputDir ? resolveDir(config.outputDir) : base.outputDir,
581
+ outputDirs,
582
+ outputFileNames: { ...base.outputFileNames, ...config?.outputFileNames },
583
+ prefix: config?.prefix ?? base.prefix,
584
+ formats: config?.formats ?? [...base.formats],
585
+ additionalScssDirectories,
586
+ additionalCssDirectories,
587
+ mergeOrder: config?.mergeOrder ?? base.mergeOrder,
588
+ createBundle: config?.createBundle ?? base.createBundle,
589
+ scssImportHeader: config?.scssImportHeader,
590
+ themes: resolveThemesConfig(config?.themes),
591
+ transforms: config?.transforms ?? [],
592
+ customFormats: config?.customFormats ?? [],
593
+ preprocessors: config?.preprocessors ?? [],
594
+ filters: config?.filters ?? [],
595
+ onBuildStart: config?.onBuildStart,
596
+ onFormatComplete: config?.onFormatComplete,
597
+ onAllFormatsComplete: config?.onAllFormatsComplete,
598
+ onBuildComplete: config?.onBuildComplete,
599
+ outputReferences: config?.outputReferences ?? base.outputReferences,
600
+ baseFontSize: config?.baseFontSize ?? base.baseFontSize,
601
+ separateThemeFiles: config?.separateThemeFiles ?? base.separateThemeFiles,
602
+ watch: config?.watch ?? base.watch,
603
+ watchDirectories,
604
+ pipeline: config?.pipeline
605
+ };
606
+ }
607
+ function applyOverrides(config, overrides) {
608
+ return {
609
+ tokens: overrides.tokens ? { ...config.tokens, ...overrides.tokens } : config.tokens,
610
+ icons: overrides.icons ? { ...config.icons, ...overrides.icons } : config.icons,
611
+ global: overrides.global ? { ...config.global, ...overrides.global } : config.global
612
+ };
613
+ }
614
+ function resolveConfig(config = {}, options = {}) {
615
+ const mergedConfig = options.overrides ? applyOverrides(config, options.overrides) : config;
616
+ const configDir = options.configDir ?? options.cwd ?? process.cwd();
617
+ return {
618
+ global: resolveGlobalConfig(mergedConfig.global, options),
619
+ tokens: resolveTokensConfig(mergedConfig.tokens, options),
620
+ icons: resolveIconsConfig(mergedConfig.icons, options),
621
+ configDir
622
+ };
623
+ }
624
+ function mergeConfigs(...configs) {
625
+ let result = {};
626
+ for (const config of configs) {
627
+ result = applyOverrides(result, config);
628
+ }
629
+ return result;
630
+ }
631
+ function createResolvedConfig(partial = {}) {
632
+ return {
633
+ global: partial.global ?? defaultConfig.global,
634
+ tokens: partial.tokens ?? defaultConfig.tokens,
635
+ icons: partial.icons ?? defaultConfig.icons,
636
+ configDir: partial.configDir ?? process.cwd(),
637
+ configPath: partial.configPath
638
+ };
639
+ }
640
+
641
+ // src/config/loader.ts
642
+ var MODULE_NAME = "dsai";
643
+ var CONFIG_FILE_NAMES = [
644
+ "dsai.config.ts",
645
+ "dsai.config.mjs",
646
+ "dsai.config.js",
647
+ "dsai.config.cjs",
648
+ ".dsairc.ts",
649
+ ".dsairc.mjs",
650
+ ".dsairc.js",
651
+ ".dsairc.cjs",
652
+ ".dsairc.json",
653
+ ".dsairc.yaml",
654
+ ".dsairc.yml",
655
+ ".dsairc",
656
+ "package.json"
657
+ ];
658
+ function createExplorer(options) {
659
+ return cosmiconfig.cosmiconfig(MODULE_NAME, {
660
+ searchPlaces: CONFIG_FILE_NAMES,
661
+ stopDir: options?.stopDir,
662
+ packageProp: MODULE_NAME
663
+ });
664
+ }
665
+ function createExplorerSync(options) {
666
+ return cosmiconfig.cosmiconfigSync(MODULE_NAME, {
667
+ searchPlaces: CONFIG_FILE_NAMES,
668
+ stopDir: options?.stopDir,
669
+ packageProp: MODULE_NAME
670
+ });
671
+ }
672
+ async function loadConfig(options = {}) {
673
+ const { cwd = process.cwd(), configPath, overrides, skipFile = false } = options;
674
+ const warnings = [];
675
+ let fileConfig = {};
676
+ let resolvedConfigPath;
677
+ if (!skipFile) {
678
+ const explorer = createExplorer({ stopDir: path2__default.default.dirname(cwd) });
679
+ let cosmicResult;
680
+ try {
681
+ if (configPath) {
682
+ const absolutePath = path2__default.default.isAbsolute(configPath) ? configPath : path2__default.default.resolve(cwd, configPath);
683
+ cosmicResult = await explorer.load(absolutePath);
684
+ } else {
685
+ cosmicResult = await explorer.search(cwd);
686
+ }
687
+ if (cosmicResult && !cosmicResult.isEmpty) {
688
+ fileConfig = cosmicResult.config;
689
+ resolvedConfigPath = cosmicResult.filepath;
690
+ }
691
+ } catch (error) {
692
+ const message = error instanceof Error ? error.message : String(error);
693
+ warnings.push(`Failed to load configuration: ${message}`);
694
+ }
695
+ }
696
+ const configDir = resolvedConfigPath ? path2__default.default.dirname(resolvedConfigPath) : cwd;
697
+ const resolvedConfig = resolveConfig(fileConfig, {
698
+ cwd,
699
+ configDir,
700
+ overrides
701
+ });
702
+ return {
703
+ config: resolvedConfig,
704
+ configPath: resolvedConfigPath,
705
+ warnings
706
+ };
707
+ }
708
+ async function searchConfigFile(cwd = process.cwd()) {
709
+ const explorer = createExplorer();
710
+ try {
711
+ const result = await explorer.search(cwd);
712
+ return result?.filepath;
713
+ } catch {
714
+ return void 0;
715
+ }
716
+ }
717
+ function clearConfigCache() {
718
+ const explorer = createExplorer();
719
+ explorer.clearCaches();
720
+ }
721
+ function loadConfigSync(options = {}) {
722
+ const { cwd = process.cwd(), configPath, overrides, skipFile = false } = options;
723
+ const warnings = [];
724
+ let fileConfig = {};
725
+ let resolvedConfigPath;
726
+ if (!skipFile) {
727
+ const explorer = createExplorerSync({ stopDir: path2__default.default.dirname(cwd) });
728
+ try {
729
+ if (configPath) {
730
+ const absolutePath = path2__default.default.isAbsolute(configPath) ? configPath : path2__default.default.resolve(cwd, configPath);
731
+ const result = explorer.load(absolutePath);
732
+ if (result && !result.isEmpty) {
733
+ fileConfig = result.config;
734
+ resolvedConfigPath = result.filepath;
735
+ }
736
+ } else {
737
+ const result = explorer.search(cwd);
738
+ if (result && !result.isEmpty) {
739
+ fileConfig = result.config;
740
+ resolvedConfigPath = result.filepath;
741
+ }
742
+ }
743
+ } catch (error) {
744
+ const message = error instanceof Error ? error.message : String(error);
745
+ warnings.push(`Failed to load configuration: ${message}`);
746
+ }
747
+ }
748
+ const configDir = resolvedConfigPath ? path2__default.default.dirname(resolvedConfigPath) : cwd;
749
+ const resolvedConfig = resolveConfig(fileConfig, {
750
+ cwd,
751
+ configDir,
752
+ overrides
753
+ });
754
+ return {
755
+ config: resolvedConfig,
756
+ configPath: resolvedConfigPath,
757
+ warnings
758
+ };
759
+ }
760
+ function defineConfig(config) {
761
+ return config;
762
+ }
763
+ function defineConfigAsync(configFn) {
764
+ return configFn();
765
+ }
766
+
767
+ // src/config/env.ts
768
+ function parseBoolean(value) {
769
+ if (value === void 0) {
770
+ return void 0;
771
+ }
772
+ const normalized = value.toLowerCase().trim();
773
+ if (normalized === "true" || normalized === "1" || normalized === "yes") {
774
+ return true;
775
+ }
776
+ if (normalized === "false" || normalized === "0" || normalized === "no") {
777
+ return false;
778
+ }
779
+ return void 0;
780
+ }
781
+ function parseNumber(value) {
782
+ if (value === void 0) {
783
+ return void 0;
784
+ }
785
+ const num = Number(value);
786
+ return Number.isNaN(num) ? void 0 : num;
787
+ }
788
+ function parseArray(value) {
789
+ if (value === void 0 || value.trim() === "") {
790
+ return void 0;
791
+ }
792
+ return value.split(",").map((item) => item.trim()).filter(Boolean);
793
+ }
794
+ function setNestedValue(obj, path3, value) {
795
+ const parts = path3.split(".");
796
+ if (parts.length === 1) {
797
+ const key = parts[0];
798
+ if (key !== void 0) {
799
+ Object.defineProperty(obj, key, {
800
+ value,
801
+ writable: true,
802
+ enumerable: true,
803
+ configurable: true
804
+ });
805
+ }
806
+ return;
807
+ }
808
+ if (parts.length === 2) {
809
+ const [first, second] = parts;
810
+ if (first !== void 0 && second !== void 0) {
811
+ if (!(first in obj)) {
812
+ Object.defineProperty(obj, first, {
813
+ value: {},
814
+ writable: true,
815
+ enumerable: true,
816
+ configurable: true
817
+ });
818
+ }
819
+ const nested = obj[first];
820
+ Object.defineProperty(nested, second, {
821
+ value,
822
+ writable: true,
823
+ enumerable: true,
824
+ configurable: true
825
+ });
826
+ }
827
+ return;
828
+ }
829
+ if (parts.length === 3) {
830
+ const [first, second, third] = parts;
831
+ if (first !== void 0 && second !== void 0 && third !== void 0) {
832
+ if (!(first in obj)) {
833
+ Object.defineProperty(obj, first, {
834
+ value: {},
835
+ writable: true,
836
+ enumerable: true,
837
+ configurable: true
838
+ });
839
+ }
840
+ const nested1 = obj[first];
841
+ if (!(second in nested1)) {
842
+ Object.defineProperty(nested1, second, {
843
+ value: {},
844
+ writable: true,
845
+ enumerable: true,
846
+ configurable: true
847
+ });
848
+ }
849
+ const nested2 = nested1[second];
850
+ Object.defineProperty(nested2, third, {
851
+ value,
852
+ writable: true,
853
+ enumerable: true,
854
+ configurable: true
855
+ });
856
+ }
857
+ }
858
+ }
859
+ function getConfigFromEnv(options = {}) {
860
+ const env = options.env ?? process.env;
861
+ const prefix = options.prefix ?? "DSAI_";
862
+ const config = {};
863
+ for (const [envKey, configPath] of Object.entries(envMappings)) {
864
+ if (!envKey.startsWith(prefix)) {
865
+ continue;
866
+ }
867
+ const envValue = env[envKey];
868
+ if (envValue === void 0) {
869
+ continue;
870
+ }
871
+ let parsedValue;
872
+ if (envBooleanKeys.has(envKey)) {
873
+ parsedValue = parseBoolean(envValue);
874
+ } else if (envNumberKeys.has(envKey)) {
875
+ parsedValue = parseNumber(envValue);
876
+ } else if (envArrayKeys.has(envKey)) {
877
+ parsedValue = parseArray(envValue);
878
+ } else {
879
+ parsedValue = envValue;
880
+ }
881
+ if (parsedValue !== void 0) {
882
+ setNestedValue(config, configPath, parsedValue);
883
+ }
884
+ }
885
+ return config;
886
+ }
887
+ function isCI(env = process.env) {
888
+ return env["CI"] === "true" || env["CONTINUOUS_INTEGRATION"] === "true" || env["GITHUB_ACTIONS"] === "true" || env["GITLAB_CI"] === "true" || env["CIRCLECI"] === "true" || env["TRAVIS"] === "true" || env["BUILDKITE"] === "true" || env["JENKINS_URL"] !== void 0 || env["TF_BUILD"] === "True";
889
+ }
890
+ function shouldDisableColors(env = process.env) {
891
+ return env["NO_COLOR"] !== void 0 || env["FORCE_COLOR"] === "0" || env["TERM"] === "dumb";
892
+ }
893
+ function getLogLevelFromEnv(env = process.env) {
894
+ const dsaiLogLevel = env["DSAI_LOG_LEVEL"];
895
+ const dsaiDebug = env["DSAI_DEBUG"];
896
+ const debug = env["DEBUG"];
897
+ const verbose = env["VERBOSE"];
898
+ if (dsaiLogLevel) {
899
+ return dsaiLogLevel;
900
+ }
901
+ if (dsaiDebug === "true" || debug?.includes("dsai")) {
902
+ return "debug";
903
+ }
904
+ if (verbose === "true") {
905
+ return "verbose";
906
+ }
907
+ return void 0;
908
+ }
909
+ function getEnvOverrides(env = process.env) {
910
+ const config = getConfigFromEnv({ env });
911
+ if (isCI(env) && !config.global) {
912
+ config.global = { debug: false };
913
+ }
914
+ const logLevel = getLogLevelFromEnv(env);
915
+ if (logLevel) {
916
+ config.global = {
917
+ ...config.global,
918
+ logLevel
919
+ };
920
+ }
921
+ return config;
922
+ }
923
+
924
+ // src/config/migrate.ts
925
+ function checkMigrationNeeded(config, filename) {
926
+ const warnings = [];
927
+ const suggestions = [];
928
+ if (filename?.includes("tokens.config.json")) {
929
+ warnings.push("tokens.config.json is deprecated. Please migrate to dsai.config.mjs.");
930
+ suggestions.push("Run: npx @dsai-io/tools migrate to automatically migrate your config.");
931
+ return {
932
+ needsMigration: true,
933
+ detectedFormat: "legacy-tokens",
934
+ warnings,
935
+ suggestions
936
+ };
937
+ }
938
+ if (isLegacyTokensConfig(config)) {
939
+ warnings.push("Legacy configuration format detected. Some options may be deprecated.");
940
+ suggestions.push("Consider updating to the new configuration format.");
941
+ return {
942
+ needsMigration: true,
943
+ detectedFormat: "legacy-tokens",
944
+ warnings,
945
+ suggestions
946
+ };
947
+ }
948
+ return {
949
+ needsMigration: false,
950
+ detectedFormat: "current",
951
+ warnings,
952
+ suggestions
953
+ };
954
+ }
955
+ function isLegacyTokensConfig(config) {
956
+ if (typeof config !== "object" || config === null) {
957
+ return false;
958
+ }
959
+ const obj = config;
960
+ return typeof obj["output"] === "string" || typeof obj["source"] === "string" && !("sourceDir" in obj);
961
+ }
962
+ function migrateLegacyTokensConfig(legacy) {
963
+ const tokens = {};
964
+ if (legacy.source !== void 0 && legacy.source !== null) {
965
+ tokens.sourceDir = legacy.source;
966
+ }
967
+ if (legacy.output !== void 0 && legacy.output !== null) {
968
+ tokens.outputDir = legacy.output;
969
+ }
970
+ if (legacy.prefix !== void 0 && legacy.prefix !== null) {
971
+ tokens.prefix = legacy.prefix;
972
+ }
973
+ if (Array.isArray(legacy.formats)) {
974
+ const validFormats = ["css", "scss", "js", "ts", "json", "android", "ios"];
975
+ tokens.formats = legacy.formats.filter(
976
+ (f) => validFormats.includes(f)
977
+ );
978
+ }
979
+ if (legacy.themes !== void 0 && legacy.themes !== null) {
980
+ tokens.themes = {
981
+ default: legacy.themes.default ?? "Light"
982
+ // ignoreModes can be derived from modes if needed
983
+ };
984
+ }
985
+ return { tokens };
986
+ }
987
+ function migrateConfig(config, filename) {
988
+ const check = checkMigrationNeeded(config, filename);
989
+ if (!check.needsMigration) {
990
+ return {
991
+ config,
992
+ warnings: check.warnings
993
+ };
994
+ }
995
+ switch (check.detectedFormat) {
996
+ case "legacy-tokens":
997
+ return {
998
+ config: migrateLegacyTokensConfig(config),
999
+ warnings: check.warnings
1000
+ };
1001
+ default:
1002
+ return {
1003
+ config,
1004
+ warnings: [...check.warnings, "Unknown config format - using as-is."]
1005
+ };
1006
+ }
1007
+ }
1008
+ function checkDeprecatedOptions(config) {
1009
+ const warnings = [];
1010
+ const configAny = config;
1011
+ const tokens = configAny["tokens"];
1012
+ if (tokens !== void 0) {
1013
+ if ("output" in tokens) {
1014
+ warnings.push(
1015
+ `Deprecated: Use 'tokens.outputDir' instead of 'tokens.output' (tokens.outputDir)`
1016
+ );
1017
+ }
1018
+ if ("source" in tokens && typeof tokens["source"] === "string") {
1019
+ warnings.push(
1020
+ `Deprecated: Use 'tokens.sourceDir' instead of 'tokens.source' for directory paths (tokens.sourceDir)`
1021
+ );
1022
+ }
1023
+ }
1024
+ return warnings;
1025
+ }
1026
+ function generateMigrationScript(_oldConfig, newConfig) {
1027
+ const configJson = JSON.stringify(newConfig, null, " ");
1028
+ return `// @ts-check
1029
+ /**
1030
+ * DSAI Configuration
1031
+ *
1032
+ * Migrated from legacy format.
1033
+ * Please review and adjust as needed.
1034
+ *
1035
+ * @type {import('@dsai-io/tools').DsaiConfig}
1036
+ */
1037
+ import { defineConfig } from '@dsai-io/tools';
1038
+
1039
+ export default defineConfig(${configJson.replace(/"([^"]+)":/g, "$1:")});
1040
+ `;
1041
+ }
1042
+
1043
+ exports.CONFIG_FILE_NAMES = CONFIG_FILE_NAMES;
1044
+ exports.DEFAULT_COLLECTIONS_DIR = DEFAULT_COLLECTIONS_DIR;
1045
+ exports.DEFAULT_ICONS_OUTPUT_DIR = DEFAULT_ICONS_OUTPUT_DIR;
1046
+ exports.DEFAULT_ICONS_SOURCE_DIR = DEFAULT_ICONS_SOURCE_DIR;
1047
+ exports.DEFAULT_LOG_LEVEL = DEFAULT_LOG_LEVEL;
1048
+ exports.DEFAULT_OUTPUT_DIR = DEFAULT_OUTPUT_DIR;
1049
+ exports.DEFAULT_PREFIX = DEFAULT_PREFIX;
1050
+ exports.DEFAULT_SOURCE_DIR = DEFAULT_SOURCE_DIR;
1051
+ exports.buildConfigSchema = buildConfigSchema;
1052
+ exports.checkDeprecatedOptions = checkDeprecatedOptions;
1053
+ exports.checkMigrationNeeded = checkMigrationNeeded;
1054
+ exports.clearConfigCache = clearConfigCache;
1055
+ exports.createResolvedConfig = createResolvedConfig;
1056
+ exports.customFormatSchema = customFormatSchema;
1057
+ exports.customTransformSchema = customTransformSchema;
1058
+ exports.defaultConfig = defaultConfig;
1059
+ exports.defaultFormats = defaultFormats;
1060
+ exports.defaultGlobalConfig = defaultGlobalConfig;
1061
+ exports.defaultIconFramework = defaultIconFramework;
1062
+ exports.defaultIconsConfig = defaultIconsConfig;
1063
+ exports.defaultOutputFileNames = defaultOutputFileNames;
1064
+ exports.defaultSelectorPattern = defaultSelectorPattern;
1065
+ exports.defaultSourcePatterns = defaultSourcePatterns;
1066
+ exports.defaultThemesConfig = defaultThemesConfig;
1067
+ exports.defaultTokensConfig = defaultTokensConfig;
1068
+ exports.defineConfig = defineConfig;
1069
+ exports.defineConfigAsync = defineConfigAsync;
1070
+ exports.dsaiConfigSchema = dsaiConfigSchema;
1071
+ exports.envArrayKeys = envArrayKeys;
1072
+ exports.envBooleanKeys = envBooleanKeys;
1073
+ exports.envMappings = envMappings;
1074
+ exports.envNumberKeys = envNumberKeys;
1075
+ exports.filePathSchema = filePathSchema;
1076
+ exports.formatErrorMessage = formatErrorMessage;
1077
+ exports.formatValidationErrors = formatValidationErrors;
1078
+ exports.frameworkSchema = frameworkSchema;
1079
+ exports.generateMigrationScript = generateMigrationScript;
1080
+ exports.getConfigFromEnv = getConfigFromEnv;
1081
+ exports.getDefaultExtension = getDefaultExtension;
1082
+ exports.getDefaultOutputDir = getDefaultOutputDir;
1083
+ exports.getEnvOverrides = getEnvOverrides;
1084
+ exports.getLogLevelFromEnv = getLogLevelFromEnv;
1085
+ exports.getOutputFileName = getOutputFileName;
1086
+ exports.globPatternSchema = globPatternSchema;
1087
+ exports.globalConfigSchema = globalConfigSchema;
1088
+ exports.hashTypeSchema = hashTypeSchema;
1089
+ exports.iconOptimizationSchema = iconOptimizationSchema;
1090
+ exports.iconSpriteSchema = iconSpriteSchema;
1091
+ exports.iconsConfigSchema = iconsConfigSchema;
1092
+ exports.isCI = isCI;
1093
+ exports.loadConfig = loadConfig;
1094
+ exports.loadConfigSync = loadConfigSync;
1095
+ exports.logLevelSchema = logLevelSchema;
1096
+ exports.mergeConfigs = mergeConfigs;
1097
+ exports.migrateConfig = migrateConfig;
1098
+ exports.migrateLegacyTokensConfig = migrateLegacyTokensConfig;
1099
+ exports.outputFormatSchema = outputFormatSchema;
1100
+ exports.resolveConfig = resolveConfig;
1101
+ exports.searchConfigFile = searchConfigFile;
1102
+ exports.shouldDisableColors = shouldDisableColors;
1103
+ exports.themeModeSchema = themeModeSchema;
1104
+ exports.themesConfigSchema = themesConfigSchema;
1105
+ exports.tokenBuildConfigSchema = tokenBuildConfigSchema;
1106
+ exports.tokenCacheConfigSchema = tokenCacheConfigSchema;
1107
+ exports.tokenWatchConfigSchema = tokenWatchConfigSchema;
1108
+ exports.tokensConfigSchema = tokensConfigSchema;
1109
+ exports.tokensHooksSchema = tokensHooksSchema;
1110
+ exports.validateConfig = validateConfig;
1111
+ exports.validateConfigOrThrow = validateConfigOrThrow;
1112
+ exports.validateConfigSection = validateConfigSection;
1113
+ exports.versionSchema = versionSchema;
1114
+ //# sourceMappingURL=index.cjs.map
1115
+ //# sourceMappingURL=index.cjs.map