@dsai-io/tools 1.0.7 → 1.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.
- package/README.md +438 -438
- package/bin/dsai-tools.mjs +13 -13
- package/dist/cli/index.cjs +1942 -545
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +1944 -548
- package/dist/cli/index.js.map +1 -1
- package/dist/config/index.cjs +66 -2
- package/dist/config/index.cjs.map +1 -1
- package/dist/config/index.d.cts +50 -3
- package/dist/config/index.d.ts +50 -3
- package/dist/config/index.js +63 -3
- package/dist/config/index.js.map +1 -1
- package/dist/icons/index.cjs.map +1 -1
- package/dist/icons/index.d.cts +1 -1
- package/dist/icons/index.d.ts +1 -1
- package/dist/icons/index.js.map +1 -1
- package/dist/index.cjs +1241 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +213 -4
- package/dist/index.d.ts +213 -4
- package/dist/index.js +1229 -19
- package/dist/index.js.map +1 -1
- package/dist/tokens/index.cjs +15 -15
- package/dist/tokens/index.cjs.map +1 -1
- package/dist/tokens/index.d.cts +1 -1
- package/dist/tokens/index.d.ts +1 -1
- package/dist/tokens/index.js +15 -15
- package/dist/tokens/index.js.map +1 -1
- package/dist/{types-DabOzcsj.d.cts → types-CtE9f0G0.d.cts} +58 -1
- package/dist/{types-DabOzcsj.d.ts → types-CtE9f0G0.d.ts} +58 -1
- package/dist/utils/circuit-breaker.cjs.map +1 -1
- package/dist/utils/circuit-breaker.js.map +1 -1
- package/package.json +102 -102
- package/templates/.dsairc.json +37 -37
- package/templates/dsai-config.schema.json +618 -554
- package/templates/dsai.config.mjs +281 -221
package/dist/index.d.cts
CHANGED
|
@@ -1,14 +1,223 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
1
|
+
import { R as ResolvedAliasesConfig, a as ResolvedComponentsConfig } from './types-CtE9f0G0.cjs';
|
|
2
|
+
export { A as AliasesConfig, B as BuildSummary, C as ComponentsConfig, b as CustomFilter, c as CustomFormat, d as CustomPreprocessor, e as CustomTransform, D as Dictionary, f as DsaiConfig, F as FileConfig, g as FormatArgs, h as FrameworkMappingConfig, i as FrameworkMappingPattern, j as FrameworkTarget, G as GlobalConfig, I as IconFramework, k as IconsConfig, L as LoadConfigOptions, l as LoadConfigResult, m as LogLevel, O as OutputFormat, P as Platform, n as ResolvedConfig, o as ResolvedGlobalConfig, p as ResolvedIconsConfig, q as ResolvedThemeDefinition, r as ResolvedThemesConfig, s as ResolvedTokensConfig, S as ScssOutputConfig, T as ThemeDefinition, t as ThemeSelectorPattern, u as ThemesConfig, v as TokenData, w as TokensConfig, x as TransformOptions } from './types-CtE9f0G0.cjs';
|
|
3
|
+
export { AliasesConfigFromSchema, CONFIG_FILE_NAMES, ComponentsConfigFromSchema, ConfigFormat, DEFAULT_COLLECTIONS_DIR, DEFAULT_ICONS_OUTPUT_DIR, DEFAULT_ICONS_SOURCE_DIR, DEFAULT_LOG_LEVEL, DEFAULT_OUTPUT_DIR, DEFAULT_PREFIX, DEFAULT_SOURCE_DIR, DsaiConfigFromSchema, EnvParseOptions, FrameworkFromSchema, GlobalConfigFromSchema, IconsConfigFromSchema, LogLevelFromSchema, MigrationCheck, OutputFormatFromSchema, ResolveOptions, ThemesConfigFromSchema, TokensConfigFromSchema, ValidationError, ValidationResult, aliasesConfigSchema, buildConfigSchema, checkDeprecatedOptions, checkMigrationNeeded, clearConfigCache, componentsConfigSchema, createResolvedConfig, customFormatSchema, customTransformSchema, defaultAliasesConfig, defaultComponentsConfig, defaultConfig, defaultFormats, defaultGlobalConfig, defaultIconFramework, defaultIconsConfig, defaultOutputFileNames, defaultSelectorPattern, defaultSourcePatterns, defaultThemesConfig, defaultTokensConfig, defineConfig, defineConfigAsync, dsaiConfigSchema, envArrayKeys, envBooleanKeys, envMappings, envNumberKeys, filePathSchema, formatErrorMessage, formatValidationErrors, frameworkSchema, generateMigrationScript, getConfigFromEnv, getDefaultExtension, getDefaultOutputDir, getEnvOverrides, getLogLevelFromEnv, getOutputFileName, globPatternSchema, globalConfigSchema, hashTypeSchema, iconOptimizationSchema, iconSpriteSchema, iconsConfigSchema, isCI, loadConfig, loadConfigSync, logLevelSchema, mergeConfigs, migrateConfig, migrateLegacyTokensConfig, outputFormatSchema, resolveConfig, searchConfigFile, shouldDisableColors, themeDefinitionSchema, themeSelectorPatternSchema, themesConfigSchema, tokenBuildConfigSchema, tokenCacheConfigSchema, tokenWatchConfigSchema, tokensConfigSchema, tokensHooksSchema, validateConfig, validateConfigOrThrow, validateConfigSection, versionSchema } from './config/index.cjs';
|
|
3
4
|
export { BOOTSTRAP_MAPPINGS, BOOTSTRAP_PATTERNS, BuildOptions, BuildResult, BuildStep, BundleConfig, BundleResult, ChangelogOptions, ChangelogResult, CleanOptions, CleanResult, CleanedDirectory, CreateSDConfigOptions, DEFAULT_CLEAN_DIRECTORIES, DEFAULT_FILE_NAMES, DTCGFile, DTCGToken, DTCGTokenCollection, DiscoveryOptions, DiscoveryResult, FigmaCollection, FigmaExport, FigmaExportWithMetadata, FigmaVariablesResponse, FilePreprocessingResult, FormatDefinition, FrameworkMapper, FrameworkMapperWithConfig, LegacyToken, MergeConfig, MergeContent, MergeOptions, MergeResult, ModeExtractionOptions, ModeExtractionResult, MultiThemeBuildOptions, MultiThemeBuildResult, OutputConfig, PlaceholderValues, PostprocessOptions, PostprocessResult, PreprocessingResult, PreprocessorConfig, PreprocessorDefinition, ReplacementRule, SDConfig, SDDictionary, SDFile, SDFormatArgs, SDLogConfig, SDPlatform, SDPlatformType, SDToken, SDTransformOptions, SHADCN_MAPPINGS, SchemaValidationError, SchemaValidationOptions, SchemaValidationResult, StyleDictionaryFileConfig, StyleDictionaryInstance, StyleDictionaryPlatformConfig, StyleMergeResult, StyleScannedFile, StyleScannerOptions, StyleScannerResult, SyncOptions, SyncResult, ThemeBuildConfig, ThemeBuildOptions, ThemeBuildResult, ThemeFilesResult, ThemeStyleDictionaryConfig, Token, TokenChange, TokenChangeType, TokenCollection, TokenDiff, TokenTransformOptions, TokenTransformResult, TokenType, TokenValidationResult, TokenValueChange, TransformDefinition, TransformGroupDefinition, TransformType, VALID_TOKEN_TYPES, ValidateOptions, ValidationIssue, ValidationSeverity, addScssImportHeader, applyNameMapping, autoDetectThemes, bootstrapMapper, buildAllThemes, buildTheme, buildTokens, buildTokensCLI, builtInFormats, builtInPreprocessors, builtInTransforms, cleanTokenOutputs, cleanTokensCLI, createBundle, createBundleFromFiles, createBundles, createFixReferencesPreprocessor, createFrameworkMapper, createOutputConfig, createStyleDictionaryConfig, cssTransformGroup, cssVariablesWithComments, detectFigmaModes, detectModes, detectTransformModes, diffTokens, dimensionRem, discoverThemeFiles, dtcgFileSchema, dtcgTokenCollectionSchema, dtcgTokenSchema, ensureOutputDirs, extractMode, extractModes, figmaExportSchema, figmaExportWithMetadataSchema, figmaVariablesResponseSchema, filterDiff, filterFiles, fixReferences, flattenModeStructure, fontWeightUnitless, generateAndWriteChangelog, generateChangelog, generateChangelogCLI, generateThemeBuildConfig, getBreakingChanges, getCssFormat, getDefaultCssDir, getDefaultFiles, getDefaultIgnorePatterns, getDefaultSyncPaths, getDefaultTransformations, getFrameworkMapper, getPreprocessedFilesForMode, getSDTokenType, getSDTokenValue, getThemeFiles, getThemeSelector, getTokenDescription, getTokenType, getTokenValue, hasDTCGValue, isDTCGToken, isLegacyToken, isSDToken, isToken, isTokenReference, isValidTokenType, jsTransformGroup, lineHeightUnitless, loadContent, mapToBootstrapName, mapToShadcnName, mergeCollections, mergeCollectionsCLI, mergeContent, nameKebab, parseTokenReference, postprocessCLI, postprocessCss, postprocessCssFiles, preprocessFile, preprocessTokenFiles, processScssImportHeader, registerAll, registerFormats, registerPreprocessors, registerTransformGroups, registerTransforms, replacePlaceholders, resolveAllOutputPaths, resolveOutputPath, runBuildCLI, scanDirectories, scssTransformGroup, setupStyleDictionary, shadcnMapper, sortFiles, styleDictionaryInputSchema, styleDictionaryTokenSchema, summarizeDiff, syncTokens, syncTokensCLI, toDTCGToken, transformGroups, transformToken, transformTokenTree, transformTokens, transformTokensCLI, transformType, transformValue, typescriptDeclarations, validateDTCGFile, validateDTCGTokens, validateFigmaCLI, validateFigmaExport, validateFigmaExportWithMetadata, validateFigmaExports, validateFigmaFile, validateFigmaVariablesResponse, validateOutputPaths, validateStyleDictionaryInput, validateStyleDictionaryTokens, validateThemeDefinitions, validateTokens, validateTokensCLI, writeChangelog } from './tokens/index.cjs';
|
|
4
5
|
export { GeneratedIcon, GeneratorOptions, IconBuildOptions, IconBuildResult, IconError, IconErrorCode, IconFormat, IconTemplate, IconWarning, IndexTemplate, OptimizedSVG, ParsedSVG, RawSVGData, SVGOConfig, SVGOPlugin, ScannerOptions, TypesTemplate, buildIcons, cleanSVGForReact, defaultReactIndexTemplate, defaultReactTemplate, defaultReactTypesTemplate, defaultSVGOConfig, extractViewBox, generateReactIcons, generateSVGSprite, isValidIconName, normalizeIconName, optimizeSVG, optimizeSVGFiles, parseSVG, parseSVGFiles, readSVGFile, scanSVGFiles, skipOptimization, toComponentName, toIconName } from './icons/index.cjs';
|
|
5
|
-
import 'zod';
|
|
6
|
+
import { z } from 'zod';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Package version
|
|
9
10
|
*/
|
|
10
11
|
declare const version = "0.0.1";
|
|
11
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Registry type definitions for DSAi component distribution.
|
|
15
|
+
* @module @dsai-io/tools/registry/types
|
|
16
|
+
*/
|
|
17
|
+
type RegistryItemType = 'registry:ui' | 'registry:hook' | 'registry:util' | 'registry:lib' | 'registry:component' | 'registry:style' | 'registry:type';
|
|
18
|
+
interface RegistryFile {
|
|
19
|
+
path: string;
|
|
20
|
+
type: RegistryItemType;
|
|
21
|
+
content: string;
|
|
22
|
+
target?: string;
|
|
23
|
+
}
|
|
24
|
+
interface RegistryItem {
|
|
25
|
+
name: string;
|
|
26
|
+
type: RegistryItemType;
|
|
27
|
+
title: string;
|
|
28
|
+
description: string;
|
|
29
|
+
dependencies: string[];
|
|
30
|
+
devDependencies: string[];
|
|
31
|
+
registryDependencies: string[];
|
|
32
|
+
files: RegistryFile[];
|
|
33
|
+
cssVars?: {
|
|
34
|
+
light?: Record<string, string>;
|
|
35
|
+
dark?: Record<string, string>;
|
|
36
|
+
};
|
|
37
|
+
categories?: string[];
|
|
38
|
+
}
|
|
39
|
+
interface RegistryIndex {
|
|
40
|
+
version: string;
|
|
41
|
+
count: number;
|
|
42
|
+
items: RegistryIndexEntry[];
|
|
43
|
+
}
|
|
44
|
+
interface RegistryIndexEntry {
|
|
45
|
+
name: string;
|
|
46
|
+
type: RegistryItemType;
|
|
47
|
+
title: string;
|
|
48
|
+
description: string;
|
|
49
|
+
dependencies: string[];
|
|
50
|
+
registryDependencies: string[];
|
|
51
|
+
categories?: string[];
|
|
52
|
+
}
|
|
53
|
+
interface ResolvedTree {
|
|
54
|
+
items: RegistryItem[];
|
|
55
|
+
dependencies: string[];
|
|
56
|
+
devDependencies: string[];
|
|
57
|
+
cssVars: {
|
|
58
|
+
light: Record<string, string>;
|
|
59
|
+
dark: Record<string, string>;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Zod schemas for registry validation.
|
|
65
|
+
* @module @dsai-io/tools/registry/schema
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
declare const registryItemTypeSchema: z.ZodEnum<{
|
|
69
|
+
"registry:ui": "registry:ui";
|
|
70
|
+
"registry:hook": "registry:hook";
|
|
71
|
+
"registry:util": "registry:util";
|
|
72
|
+
"registry:lib": "registry:lib";
|
|
73
|
+
"registry:component": "registry:component";
|
|
74
|
+
"registry:style": "registry:style";
|
|
75
|
+
"registry:type": "registry:type";
|
|
76
|
+
}>;
|
|
77
|
+
declare const registryFileSchema: z.ZodObject<{
|
|
78
|
+
path: z.ZodString;
|
|
79
|
+
type: z.ZodEnum<{
|
|
80
|
+
"registry:ui": "registry:ui";
|
|
81
|
+
"registry:hook": "registry:hook";
|
|
82
|
+
"registry:util": "registry:util";
|
|
83
|
+
"registry:lib": "registry:lib";
|
|
84
|
+
"registry:component": "registry:component";
|
|
85
|
+
"registry:style": "registry:style";
|
|
86
|
+
"registry:type": "registry:type";
|
|
87
|
+
}>;
|
|
88
|
+
content: z.ZodString;
|
|
89
|
+
target: z.ZodOptional<z.ZodString>;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
declare const registryItemSchema: z.ZodObject<{
|
|
92
|
+
name: z.ZodString;
|
|
93
|
+
type: z.ZodEnum<{
|
|
94
|
+
"registry:ui": "registry:ui";
|
|
95
|
+
"registry:hook": "registry:hook";
|
|
96
|
+
"registry:util": "registry:util";
|
|
97
|
+
"registry:lib": "registry:lib";
|
|
98
|
+
"registry:component": "registry:component";
|
|
99
|
+
"registry:style": "registry:style";
|
|
100
|
+
"registry:type": "registry:type";
|
|
101
|
+
}>;
|
|
102
|
+
title: z.ZodString;
|
|
103
|
+
description: z.ZodDefault<z.ZodString>;
|
|
104
|
+
dependencies: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
105
|
+
devDependencies: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
106
|
+
registryDependencies: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
107
|
+
files: z.ZodArray<z.ZodObject<{
|
|
108
|
+
path: z.ZodString;
|
|
109
|
+
type: z.ZodEnum<{
|
|
110
|
+
"registry:ui": "registry:ui";
|
|
111
|
+
"registry:hook": "registry:hook";
|
|
112
|
+
"registry:util": "registry:util";
|
|
113
|
+
"registry:lib": "registry:lib";
|
|
114
|
+
"registry:component": "registry:component";
|
|
115
|
+
"registry:style": "registry:style";
|
|
116
|
+
"registry:type": "registry:type";
|
|
117
|
+
}>;
|
|
118
|
+
content: z.ZodString;
|
|
119
|
+
target: z.ZodOptional<z.ZodString>;
|
|
120
|
+
}, z.core.$strip>>;
|
|
121
|
+
cssVars: z.ZodOptional<z.ZodObject<{
|
|
122
|
+
light: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
123
|
+
dark: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
124
|
+
}, z.core.$strip>>;
|
|
125
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
126
|
+
}, z.core.$strip>;
|
|
127
|
+
declare const registryIndexEntrySchema: z.ZodObject<{
|
|
128
|
+
name: z.ZodString;
|
|
129
|
+
type: z.ZodEnum<{
|
|
130
|
+
"registry:ui": "registry:ui";
|
|
131
|
+
"registry:hook": "registry:hook";
|
|
132
|
+
"registry:util": "registry:util";
|
|
133
|
+
"registry:lib": "registry:lib";
|
|
134
|
+
"registry:component": "registry:component";
|
|
135
|
+
"registry:style": "registry:style";
|
|
136
|
+
"registry:type": "registry:type";
|
|
137
|
+
}>;
|
|
138
|
+
title: z.ZodString;
|
|
139
|
+
description: z.ZodString;
|
|
140
|
+
dependencies: z.ZodArray<z.ZodString>;
|
|
141
|
+
registryDependencies: z.ZodArray<z.ZodString>;
|
|
142
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
declare const registryIndexSchema: z.ZodObject<{
|
|
145
|
+
version: z.ZodString;
|
|
146
|
+
count: z.ZodNumber;
|
|
147
|
+
items: z.ZodArray<z.ZodObject<{
|
|
148
|
+
name: z.ZodString;
|
|
149
|
+
type: z.ZodEnum<{
|
|
150
|
+
"registry:ui": "registry:ui";
|
|
151
|
+
"registry:hook": "registry:hook";
|
|
152
|
+
"registry:util": "registry:util";
|
|
153
|
+
"registry:lib": "registry:lib";
|
|
154
|
+
"registry:component": "registry:component";
|
|
155
|
+
"registry:style": "registry:style";
|
|
156
|
+
"registry:type": "registry:type";
|
|
157
|
+
}>;
|
|
158
|
+
title: z.ZodString;
|
|
159
|
+
description: z.ZodString;
|
|
160
|
+
dependencies: z.ZodArray<z.ZodString>;
|
|
161
|
+
registryDependencies: z.ZodArray<z.ZodString>;
|
|
162
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
163
|
+
}, z.core.$strip>>;
|
|
164
|
+
}, z.core.$strip>;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Registry builder — scans @dsai-io/react source, analyzes imports,
|
|
168
|
+
* inlines file content, and writes registry JSON files.
|
|
169
|
+
* @module @dsai-io/tools/registry/builder
|
|
170
|
+
*/
|
|
171
|
+
|
|
172
|
+
interface BuildRegistryOptions {
|
|
173
|
+
/** Absolute path to the @dsai-io/react src directory. */
|
|
174
|
+
reactSrcDir: string;
|
|
175
|
+
/** Absolute path to the output directory for registry JSON files. */
|
|
176
|
+
outputDir: string;
|
|
177
|
+
/** Enable verbose logging. */
|
|
178
|
+
verbose?: boolean;
|
|
179
|
+
}
|
|
180
|
+
declare function buildRegistry(options: BuildRegistryOptions): RegistryIndex;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Registry dependency resolver.
|
|
184
|
+
* @module @dsai-io/tools/registry/resolver
|
|
185
|
+
*/
|
|
186
|
+
|
|
187
|
+
declare function resolveTree(names: string[], registryDir: string): ResolvedTree;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Import path transformer for registry files.
|
|
191
|
+
* @module @dsai-io/tools/registry/transformer
|
|
192
|
+
*/
|
|
193
|
+
|
|
194
|
+
interface TransformOptions {
|
|
195
|
+
aliases: ResolvedAliasesConfig;
|
|
196
|
+
tsx: boolean;
|
|
197
|
+
}
|
|
198
|
+
declare function transformImports(content: string, options: TransformOptions): string;
|
|
199
|
+
declare function normalizeExtensions(content: string, tsx: boolean): string;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Registry file writer.
|
|
203
|
+
* @module @dsai-io/tools/registry/writer
|
|
204
|
+
*/
|
|
205
|
+
|
|
206
|
+
interface WriteOptions {
|
|
207
|
+
projectDir: string;
|
|
208
|
+
aliases: ResolvedAliasesConfig;
|
|
209
|
+
components: ResolvedComponentsConfig;
|
|
210
|
+
overwrite?: boolean;
|
|
211
|
+
dryRun?: boolean;
|
|
212
|
+
log?: (message: string) => void;
|
|
213
|
+
}
|
|
214
|
+
interface WriteResult {
|
|
215
|
+
written: string[];
|
|
216
|
+
skipped: string[];
|
|
217
|
+
installedDeps: string[];
|
|
218
|
+
}
|
|
219
|
+
declare function writeRegistryItems(tree: ResolvedTree, options: WriteOptions): WriteResult;
|
|
220
|
+
|
|
12
221
|
/**
|
|
13
222
|
* Utility functions for @dsai-io/tools
|
|
14
223
|
*
|
|
@@ -96,4 +305,4 @@ declare function formatDuration(ms: number): string;
|
|
|
96
305
|
*/
|
|
97
306
|
declare function deepMerge<T extends Record<string, unknown>>(target: T, source: Partial<T>): T;
|
|
98
307
|
|
|
99
|
-
export { deepMerge, fileExists, findPackageJson, formatDuration, getPackageRoot, isDirectory, isFile, logger, resolvePath, version };
|
|
308
|
+
export { type BuildRegistryOptions, type RegistryFile, type RegistryIndex, type RegistryIndexEntry, type RegistryItem, type RegistryItemType, type TransformOptions as RegistryTransformOptions, ResolvedAliasesConfig, ResolvedComponentsConfig, type ResolvedTree, type WriteOptions, type WriteResult, buildRegistry, deepMerge, fileExists, findPackageJson, formatDuration, getPackageRoot, isDirectory, isFile, logger, normalizeExtensions, registryFileSchema, registryIndexEntrySchema, registryIndexSchema, registryItemSchema, registryItemTypeSchema, resolvePath, resolveTree, transformImports, version, writeRegistryItems };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,223 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
1
|
+
import { R as ResolvedAliasesConfig, a as ResolvedComponentsConfig } from './types-CtE9f0G0.js';
|
|
2
|
+
export { A as AliasesConfig, B as BuildSummary, C as ComponentsConfig, b as CustomFilter, c as CustomFormat, d as CustomPreprocessor, e as CustomTransform, D as Dictionary, f as DsaiConfig, F as FileConfig, g as FormatArgs, h as FrameworkMappingConfig, i as FrameworkMappingPattern, j as FrameworkTarget, G as GlobalConfig, I as IconFramework, k as IconsConfig, L as LoadConfigOptions, l as LoadConfigResult, m as LogLevel, O as OutputFormat, P as Platform, n as ResolvedConfig, o as ResolvedGlobalConfig, p as ResolvedIconsConfig, q as ResolvedThemeDefinition, r as ResolvedThemesConfig, s as ResolvedTokensConfig, S as ScssOutputConfig, T as ThemeDefinition, t as ThemeSelectorPattern, u as ThemesConfig, v as TokenData, w as TokensConfig, x as TransformOptions } from './types-CtE9f0G0.js';
|
|
3
|
+
export { AliasesConfigFromSchema, CONFIG_FILE_NAMES, ComponentsConfigFromSchema, ConfigFormat, DEFAULT_COLLECTIONS_DIR, DEFAULT_ICONS_OUTPUT_DIR, DEFAULT_ICONS_SOURCE_DIR, DEFAULT_LOG_LEVEL, DEFAULT_OUTPUT_DIR, DEFAULT_PREFIX, DEFAULT_SOURCE_DIR, DsaiConfigFromSchema, EnvParseOptions, FrameworkFromSchema, GlobalConfigFromSchema, IconsConfigFromSchema, LogLevelFromSchema, MigrationCheck, OutputFormatFromSchema, ResolveOptions, ThemesConfigFromSchema, TokensConfigFromSchema, ValidationError, ValidationResult, aliasesConfigSchema, buildConfigSchema, checkDeprecatedOptions, checkMigrationNeeded, clearConfigCache, componentsConfigSchema, createResolvedConfig, customFormatSchema, customTransformSchema, defaultAliasesConfig, defaultComponentsConfig, defaultConfig, defaultFormats, defaultGlobalConfig, defaultIconFramework, defaultIconsConfig, defaultOutputFileNames, defaultSelectorPattern, defaultSourcePatterns, defaultThemesConfig, defaultTokensConfig, defineConfig, defineConfigAsync, dsaiConfigSchema, envArrayKeys, envBooleanKeys, envMappings, envNumberKeys, filePathSchema, formatErrorMessage, formatValidationErrors, frameworkSchema, generateMigrationScript, getConfigFromEnv, getDefaultExtension, getDefaultOutputDir, getEnvOverrides, getLogLevelFromEnv, getOutputFileName, globPatternSchema, globalConfigSchema, hashTypeSchema, iconOptimizationSchema, iconSpriteSchema, iconsConfigSchema, isCI, loadConfig, loadConfigSync, logLevelSchema, mergeConfigs, migrateConfig, migrateLegacyTokensConfig, outputFormatSchema, resolveConfig, searchConfigFile, shouldDisableColors, themeDefinitionSchema, themeSelectorPatternSchema, themesConfigSchema, tokenBuildConfigSchema, tokenCacheConfigSchema, tokenWatchConfigSchema, tokensConfigSchema, tokensHooksSchema, validateConfig, validateConfigOrThrow, validateConfigSection, versionSchema } from './config/index.js';
|
|
3
4
|
export { BOOTSTRAP_MAPPINGS, BOOTSTRAP_PATTERNS, BuildOptions, BuildResult, BuildStep, BundleConfig, BundleResult, ChangelogOptions, ChangelogResult, CleanOptions, CleanResult, CleanedDirectory, CreateSDConfigOptions, DEFAULT_CLEAN_DIRECTORIES, DEFAULT_FILE_NAMES, DTCGFile, DTCGToken, DTCGTokenCollection, DiscoveryOptions, DiscoveryResult, FigmaCollection, FigmaExport, FigmaExportWithMetadata, FigmaVariablesResponse, FilePreprocessingResult, FormatDefinition, FrameworkMapper, FrameworkMapperWithConfig, LegacyToken, MergeConfig, MergeContent, MergeOptions, MergeResult, ModeExtractionOptions, ModeExtractionResult, MultiThemeBuildOptions, MultiThemeBuildResult, OutputConfig, PlaceholderValues, PostprocessOptions, PostprocessResult, PreprocessingResult, PreprocessorConfig, PreprocessorDefinition, ReplacementRule, SDConfig, SDDictionary, SDFile, SDFormatArgs, SDLogConfig, SDPlatform, SDPlatformType, SDToken, SDTransformOptions, SHADCN_MAPPINGS, SchemaValidationError, SchemaValidationOptions, SchemaValidationResult, StyleDictionaryFileConfig, StyleDictionaryInstance, StyleDictionaryPlatformConfig, StyleMergeResult, StyleScannedFile, StyleScannerOptions, StyleScannerResult, SyncOptions, SyncResult, ThemeBuildConfig, ThemeBuildOptions, ThemeBuildResult, ThemeFilesResult, ThemeStyleDictionaryConfig, Token, TokenChange, TokenChangeType, TokenCollection, TokenDiff, TokenTransformOptions, TokenTransformResult, TokenType, TokenValidationResult, TokenValueChange, TransformDefinition, TransformGroupDefinition, TransformType, VALID_TOKEN_TYPES, ValidateOptions, ValidationIssue, ValidationSeverity, addScssImportHeader, applyNameMapping, autoDetectThemes, bootstrapMapper, buildAllThemes, buildTheme, buildTokens, buildTokensCLI, builtInFormats, builtInPreprocessors, builtInTransforms, cleanTokenOutputs, cleanTokensCLI, createBundle, createBundleFromFiles, createBundles, createFixReferencesPreprocessor, createFrameworkMapper, createOutputConfig, createStyleDictionaryConfig, cssTransformGroup, cssVariablesWithComments, detectFigmaModes, detectModes, detectTransformModes, diffTokens, dimensionRem, discoverThemeFiles, dtcgFileSchema, dtcgTokenCollectionSchema, dtcgTokenSchema, ensureOutputDirs, extractMode, extractModes, figmaExportSchema, figmaExportWithMetadataSchema, figmaVariablesResponseSchema, filterDiff, filterFiles, fixReferences, flattenModeStructure, fontWeightUnitless, generateAndWriteChangelog, generateChangelog, generateChangelogCLI, generateThemeBuildConfig, getBreakingChanges, getCssFormat, getDefaultCssDir, getDefaultFiles, getDefaultIgnorePatterns, getDefaultSyncPaths, getDefaultTransformations, getFrameworkMapper, getPreprocessedFilesForMode, getSDTokenType, getSDTokenValue, getThemeFiles, getThemeSelector, getTokenDescription, getTokenType, getTokenValue, hasDTCGValue, isDTCGToken, isLegacyToken, isSDToken, isToken, isTokenReference, isValidTokenType, jsTransformGroup, lineHeightUnitless, loadContent, mapToBootstrapName, mapToShadcnName, mergeCollections, mergeCollectionsCLI, mergeContent, nameKebab, parseTokenReference, postprocessCLI, postprocessCss, postprocessCssFiles, preprocessFile, preprocessTokenFiles, processScssImportHeader, registerAll, registerFormats, registerPreprocessors, registerTransformGroups, registerTransforms, replacePlaceholders, resolveAllOutputPaths, resolveOutputPath, runBuildCLI, scanDirectories, scssTransformGroup, setupStyleDictionary, shadcnMapper, sortFiles, styleDictionaryInputSchema, styleDictionaryTokenSchema, summarizeDiff, syncTokens, syncTokensCLI, toDTCGToken, transformGroups, transformToken, transformTokenTree, transformTokens, transformTokensCLI, transformType, transformValue, typescriptDeclarations, validateDTCGFile, validateDTCGTokens, validateFigmaCLI, validateFigmaExport, validateFigmaExportWithMetadata, validateFigmaExports, validateFigmaFile, validateFigmaVariablesResponse, validateOutputPaths, validateStyleDictionaryInput, validateStyleDictionaryTokens, validateThemeDefinitions, validateTokens, validateTokensCLI, writeChangelog } from './tokens/index.js';
|
|
4
5
|
export { GeneratedIcon, GeneratorOptions, IconBuildOptions, IconBuildResult, IconError, IconErrorCode, IconFormat, IconTemplate, IconWarning, IndexTemplate, OptimizedSVG, ParsedSVG, RawSVGData, SVGOConfig, SVGOPlugin, ScannerOptions, TypesTemplate, buildIcons, cleanSVGForReact, defaultReactIndexTemplate, defaultReactTemplate, defaultReactTypesTemplate, defaultSVGOConfig, extractViewBox, generateReactIcons, generateSVGSprite, isValidIconName, normalizeIconName, optimizeSVG, optimizeSVGFiles, parseSVG, parseSVGFiles, readSVGFile, scanSVGFiles, skipOptimization, toComponentName, toIconName } from './icons/index.js';
|
|
5
|
-
import 'zod';
|
|
6
|
+
import { z } from 'zod';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Package version
|
|
9
10
|
*/
|
|
10
11
|
declare const version = "0.0.1";
|
|
11
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Registry type definitions for DSAi component distribution.
|
|
15
|
+
* @module @dsai-io/tools/registry/types
|
|
16
|
+
*/
|
|
17
|
+
type RegistryItemType = 'registry:ui' | 'registry:hook' | 'registry:util' | 'registry:lib' | 'registry:component' | 'registry:style' | 'registry:type';
|
|
18
|
+
interface RegistryFile {
|
|
19
|
+
path: string;
|
|
20
|
+
type: RegistryItemType;
|
|
21
|
+
content: string;
|
|
22
|
+
target?: string;
|
|
23
|
+
}
|
|
24
|
+
interface RegistryItem {
|
|
25
|
+
name: string;
|
|
26
|
+
type: RegistryItemType;
|
|
27
|
+
title: string;
|
|
28
|
+
description: string;
|
|
29
|
+
dependencies: string[];
|
|
30
|
+
devDependencies: string[];
|
|
31
|
+
registryDependencies: string[];
|
|
32
|
+
files: RegistryFile[];
|
|
33
|
+
cssVars?: {
|
|
34
|
+
light?: Record<string, string>;
|
|
35
|
+
dark?: Record<string, string>;
|
|
36
|
+
};
|
|
37
|
+
categories?: string[];
|
|
38
|
+
}
|
|
39
|
+
interface RegistryIndex {
|
|
40
|
+
version: string;
|
|
41
|
+
count: number;
|
|
42
|
+
items: RegistryIndexEntry[];
|
|
43
|
+
}
|
|
44
|
+
interface RegistryIndexEntry {
|
|
45
|
+
name: string;
|
|
46
|
+
type: RegistryItemType;
|
|
47
|
+
title: string;
|
|
48
|
+
description: string;
|
|
49
|
+
dependencies: string[];
|
|
50
|
+
registryDependencies: string[];
|
|
51
|
+
categories?: string[];
|
|
52
|
+
}
|
|
53
|
+
interface ResolvedTree {
|
|
54
|
+
items: RegistryItem[];
|
|
55
|
+
dependencies: string[];
|
|
56
|
+
devDependencies: string[];
|
|
57
|
+
cssVars: {
|
|
58
|
+
light: Record<string, string>;
|
|
59
|
+
dark: Record<string, string>;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Zod schemas for registry validation.
|
|
65
|
+
* @module @dsai-io/tools/registry/schema
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
declare const registryItemTypeSchema: z.ZodEnum<{
|
|
69
|
+
"registry:ui": "registry:ui";
|
|
70
|
+
"registry:hook": "registry:hook";
|
|
71
|
+
"registry:util": "registry:util";
|
|
72
|
+
"registry:lib": "registry:lib";
|
|
73
|
+
"registry:component": "registry:component";
|
|
74
|
+
"registry:style": "registry:style";
|
|
75
|
+
"registry:type": "registry:type";
|
|
76
|
+
}>;
|
|
77
|
+
declare const registryFileSchema: z.ZodObject<{
|
|
78
|
+
path: z.ZodString;
|
|
79
|
+
type: z.ZodEnum<{
|
|
80
|
+
"registry:ui": "registry:ui";
|
|
81
|
+
"registry:hook": "registry:hook";
|
|
82
|
+
"registry:util": "registry:util";
|
|
83
|
+
"registry:lib": "registry:lib";
|
|
84
|
+
"registry:component": "registry:component";
|
|
85
|
+
"registry:style": "registry:style";
|
|
86
|
+
"registry:type": "registry:type";
|
|
87
|
+
}>;
|
|
88
|
+
content: z.ZodString;
|
|
89
|
+
target: z.ZodOptional<z.ZodString>;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
declare const registryItemSchema: z.ZodObject<{
|
|
92
|
+
name: z.ZodString;
|
|
93
|
+
type: z.ZodEnum<{
|
|
94
|
+
"registry:ui": "registry:ui";
|
|
95
|
+
"registry:hook": "registry:hook";
|
|
96
|
+
"registry:util": "registry:util";
|
|
97
|
+
"registry:lib": "registry:lib";
|
|
98
|
+
"registry:component": "registry:component";
|
|
99
|
+
"registry:style": "registry:style";
|
|
100
|
+
"registry:type": "registry:type";
|
|
101
|
+
}>;
|
|
102
|
+
title: z.ZodString;
|
|
103
|
+
description: z.ZodDefault<z.ZodString>;
|
|
104
|
+
dependencies: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
105
|
+
devDependencies: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
106
|
+
registryDependencies: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
107
|
+
files: z.ZodArray<z.ZodObject<{
|
|
108
|
+
path: z.ZodString;
|
|
109
|
+
type: z.ZodEnum<{
|
|
110
|
+
"registry:ui": "registry:ui";
|
|
111
|
+
"registry:hook": "registry:hook";
|
|
112
|
+
"registry:util": "registry:util";
|
|
113
|
+
"registry:lib": "registry:lib";
|
|
114
|
+
"registry:component": "registry:component";
|
|
115
|
+
"registry:style": "registry:style";
|
|
116
|
+
"registry:type": "registry:type";
|
|
117
|
+
}>;
|
|
118
|
+
content: z.ZodString;
|
|
119
|
+
target: z.ZodOptional<z.ZodString>;
|
|
120
|
+
}, z.core.$strip>>;
|
|
121
|
+
cssVars: z.ZodOptional<z.ZodObject<{
|
|
122
|
+
light: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
123
|
+
dark: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
124
|
+
}, z.core.$strip>>;
|
|
125
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
126
|
+
}, z.core.$strip>;
|
|
127
|
+
declare const registryIndexEntrySchema: z.ZodObject<{
|
|
128
|
+
name: z.ZodString;
|
|
129
|
+
type: z.ZodEnum<{
|
|
130
|
+
"registry:ui": "registry:ui";
|
|
131
|
+
"registry:hook": "registry:hook";
|
|
132
|
+
"registry:util": "registry:util";
|
|
133
|
+
"registry:lib": "registry:lib";
|
|
134
|
+
"registry:component": "registry:component";
|
|
135
|
+
"registry:style": "registry:style";
|
|
136
|
+
"registry:type": "registry:type";
|
|
137
|
+
}>;
|
|
138
|
+
title: z.ZodString;
|
|
139
|
+
description: z.ZodString;
|
|
140
|
+
dependencies: z.ZodArray<z.ZodString>;
|
|
141
|
+
registryDependencies: z.ZodArray<z.ZodString>;
|
|
142
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
declare const registryIndexSchema: z.ZodObject<{
|
|
145
|
+
version: z.ZodString;
|
|
146
|
+
count: z.ZodNumber;
|
|
147
|
+
items: z.ZodArray<z.ZodObject<{
|
|
148
|
+
name: z.ZodString;
|
|
149
|
+
type: z.ZodEnum<{
|
|
150
|
+
"registry:ui": "registry:ui";
|
|
151
|
+
"registry:hook": "registry:hook";
|
|
152
|
+
"registry:util": "registry:util";
|
|
153
|
+
"registry:lib": "registry:lib";
|
|
154
|
+
"registry:component": "registry:component";
|
|
155
|
+
"registry:style": "registry:style";
|
|
156
|
+
"registry:type": "registry:type";
|
|
157
|
+
}>;
|
|
158
|
+
title: z.ZodString;
|
|
159
|
+
description: z.ZodString;
|
|
160
|
+
dependencies: z.ZodArray<z.ZodString>;
|
|
161
|
+
registryDependencies: z.ZodArray<z.ZodString>;
|
|
162
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
163
|
+
}, z.core.$strip>>;
|
|
164
|
+
}, z.core.$strip>;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Registry builder — scans @dsai-io/react source, analyzes imports,
|
|
168
|
+
* inlines file content, and writes registry JSON files.
|
|
169
|
+
* @module @dsai-io/tools/registry/builder
|
|
170
|
+
*/
|
|
171
|
+
|
|
172
|
+
interface BuildRegistryOptions {
|
|
173
|
+
/** Absolute path to the @dsai-io/react src directory. */
|
|
174
|
+
reactSrcDir: string;
|
|
175
|
+
/** Absolute path to the output directory for registry JSON files. */
|
|
176
|
+
outputDir: string;
|
|
177
|
+
/** Enable verbose logging. */
|
|
178
|
+
verbose?: boolean;
|
|
179
|
+
}
|
|
180
|
+
declare function buildRegistry(options: BuildRegistryOptions): RegistryIndex;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Registry dependency resolver.
|
|
184
|
+
* @module @dsai-io/tools/registry/resolver
|
|
185
|
+
*/
|
|
186
|
+
|
|
187
|
+
declare function resolveTree(names: string[], registryDir: string): ResolvedTree;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Import path transformer for registry files.
|
|
191
|
+
* @module @dsai-io/tools/registry/transformer
|
|
192
|
+
*/
|
|
193
|
+
|
|
194
|
+
interface TransformOptions {
|
|
195
|
+
aliases: ResolvedAliasesConfig;
|
|
196
|
+
tsx: boolean;
|
|
197
|
+
}
|
|
198
|
+
declare function transformImports(content: string, options: TransformOptions): string;
|
|
199
|
+
declare function normalizeExtensions(content: string, tsx: boolean): string;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Registry file writer.
|
|
203
|
+
* @module @dsai-io/tools/registry/writer
|
|
204
|
+
*/
|
|
205
|
+
|
|
206
|
+
interface WriteOptions {
|
|
207
|
+
projectDir: string;
|
|
208
|
+
aliases: ResolvedAliasesConfig;
|
|
209
|
+
components: ResolvedComponentsConfig;
|
|
210
|
+
overwrite?: boolean;
|
|
211
|
+
dryRun?: boolean;
|
|
212
|
+
log?: (message: string) => void;
|
|
213
|
+
}
|
|
214
|
+
interface WriteResult {
|
|
215
|
+
written: string[];
|
|
216
|
+
skipped: string[];
|
|
217
|
+
installedDeps: string[];
|
|
218
|
+
}
|
|
219
|
+
declare function writeRegistryItems(tree: ResolvedTree, options: WriteOptions): WriteResult;
|
|
220
|
+
|
|
12
221
|
/**
|
|
13
222
|
* Utility functions for @dsai-io/tools
|
|
14
223
|
*
|
|
@@ -96,4 +305,4 @@ declare function formatDuration(ms: number): string;
|
|
|
96
305
|
*/
|
|
97
306
|
declare function deepMerge<T extends Record<string, unknown>>(target: T, source: Partial<T>): T;
|
|
98
307
|
|
|
99
|
-
export { deepMerge, fileExists, findPackageJson, formatDuration, getPackageRoot, isDirectory, isFile, logger, resolvePath, version };
|
|
308
|
+
export { type BuildRegistryOptions, type RegistryFile, type RegistryIndex, type RegistryIndexEntry, type RegistryItem, type RegistryItemType, type TransformOptions as RegistryTransformOptions, ResolvedAliasesConfig, ResolvedComponentsConfig, type ResolvedTree, type WriteOptions, type WriteResult, buildRegistry, deepMerge, fileExists, findPackageJson, formatDuration, getPackageRoot, isDirectory, isFile, logger, normalizeExtensions, registryFileSchema, registryIndexEntrySchema, registryIndexSchema, registryItemSchema, registryItemTypeSchema, resolvePath, resolveTree, transformImports, version, writeRegistryItems };
|