@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.
- package/README.md +186 -0
- package/bin/dsai-tools.mjs +13 -0
- package/dist/cli/index.cjs +9052 -0
- package/dist/cli/index.cjs.map +1 -0
- package/dist/cli/index.d.cts +432 -0
- package/dist/cli/index.d.ts +432 -0
- package/dist/cli/index.js +9018 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/config/index.cjs +1115 -0
- package/dist/config/index.cjs.map +1 -0
- package/dist/config/index.d.cts +2667 -0
- package/dist/config/index.d.ts +2667 -0
- package/dist/config/index.js +1039 -0
- package/dist/config/index.js.map +1 -0
- package/dist/icons/index.cjs +577 -0
- package/dist/icons/index.cjs.map +1 -0
- package/dist/icons/index.d.cts +473 -0
- package/dist/icons/index.d.ts +473 -0
- package/dist/icons/index.js +557 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.cjs +5584 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +99 -0
- package/dist/index.d.ts +99 -0
- package/dist/index.js +5375 -0
- package/dist/index.js.map +1 -0
- package/dist/tokens/index.cjs +3787 -0
- package/dist/tokens/index.cjs.map +1 -0
- package/dist/tokens/index.d.cts +2070 -0
- package/dist/tokens/index.d.ts +2070 -0
- package/dist/tokens/index.js +3682 -0
- package/dist/tokens/index.js.map +1 -0
- package/dist/types-Idj08nad.d.cts +546 -0
- package/dist/types-Idj08nad.d.ts +546 -0
- package/package.json +97 -0
- package/templates/.dsairc.json +37 -0
- package/templates/dsai-config.schema.json +554 -0
- package/templates/dsai.config.mjs +221 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export { B as BuildSummary, i as CustomFilter, g as CustomFormat, h as CustomPreprocessor, C as CustomTransform, l as Dictionary, D as DsaiConfig, m as FileConfig, F as FormatArgs, G as GlobalConfig, p as IconFramework, I as IconsConfig, L as LoadConfigOptions, n as LoadConfigResult, o as LogLevel, O as OutputFormat, P as Platform, R as ResolvedConfig, c as ResolvedGlobalConfig, e as ResolvedIconsConfig, f as ResolvedThemesConfig, d as ResolvedTokensConfig, b as ThemeSelectorPattern, a as ThemesConfig, j as TokenData, T as TokensConfig, k as TransformOptions } from './types-Idj08nad.cjs';
|
|
2
|
+
export { CONFIG_FILE_NAMES, 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, buildConfigSchema, checkDeprecatedOptions, checkMigrationNeeded, clearConfigCache, createResolvedConfig, customFormatSchema, customTransformSchema, 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, themeModeSchema, themesConfigSchema, tokenBuildConfigSchema, tokenCacheConfigSchema, tokenWatchConfigSchema, tokensConfigSchema, tokensHooksSchema, validateConfig, validateConfigOrThrow, validateConfigSection, versionSchema } from './config/index.cjs';
|
|
3
|
+
export { BuildOptions, BuildResult, BuildStep, BundleConfig, BundleResult, CleanOptions, CleanResult, CleanedDirectory, CreateSDConfigOptions, DEFAULT_CLEAN_DIRECTORIES, DEFAULT_FILE_NAMES, DTCGToken, FigmaCollection, FigmaExport, FormatDefinition, LegacyToken, MergeConfig, MergeContent, MergeOptions, MergeResult, OutputConfig, PlaceholderValues, PostprocessOptions, PostprocessResult, PreprocessorDefinition, ReplacementRule, SDConfig, SDDictionary, SDFile, SDFormatArgs, SDLogConfig, SDPlatform, SDPlatformType, SDToken, SDTransformOptions, StyleDictionaryInstance, StyleMergeResult, StyleScannedFile, StyleScannerOptions, StyleScannerResult, SyncOptions, SyncResult, Token, TokenCollection, TokenTransformOptions, TokenTransformResult, TokenType, TokenValidationResult, TransformDefinition, TransformGroupDefinition, TransformType, VALID_TOKEN_TYPES, ValidateOptions, ValidationIssue, ValidationSeverity, addScssImportHeader, buildTokens, buildTokensCLI, builtInFormats, builtInPreprocessors, builtInTransforms, cleanTokenOutputs, cleanTokensCLI, createBundle, createBundleFromFiles, createBundles, createFixReferencesPreprocessor, createOutputConfig, createStyleDictionaryConfig, cssTransformGroup, cssVariablesWithComments, detectFigmaModes, detectTransformModes, dimensionRem, ensureOutputDirs, filterFiles, fixReferences, fontWeightUnitless, getDefaultCssDir, getDefaultFiles, getDefaultIgnorePatterns, getDefaultSyncPaths, getDefaultTransformations, getSDTokenType, getSDTokenValue, getTokenDescription, getTokenType, getTokenValue, hasDTCGValue, isDTCGToken, isLegacyToken, isSDToken, isToken, isTokenReference, isValidTokenType, jsTransformGroup, lineHeightUnitless, loadContent, mergeCollections, mergeCollectionsCLI, mergeContent, nameKebab, parseTokenReference, postprocessCLI, postprocessCss, postprocessCssFiles, processScssImportHeader, registerAll, registerFormats, registerPreprocessors, registerTransformGroups, registerTransforms, replacePlaceholders, resolveAllOutputPaths, resolveOutputPath, runBuildCLI, scanDirectories, scssTransformGroup, setupStyleDictionary, sortFiles, syncTokens, syncTokensCLI, toDTCGToken, transformGroups, transformToken, transformTokenTree, transformTokens, transformTokensCLI, transformType, transformValue, typescriptDeclarations, validateFigmaCLI, validateFigmaExports, validateFigmaFile, validateOutputPaths, validateTokens, validateTokensCLI } from './tokens/index.cjs';
|
|
4
|
+
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
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Package version
|
|
9
|
+
*/
|
|
10
|
+
declare const version = "0.0.1";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Utility functions for @dsai-io/tools
|
|
14
|
+
*
|
|
15
|
+
* Common utilities used across the tools package.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Get the root directory of the @dsai-io/tools package
|
|
19
|
+
*
|
|
20
|
+
* @returns Absolute path to package root
|
|
21
|
+
*/
|
|
22
|
+
declare function getPackageRoot(): string;
|
|
23
|
+
/**
|
|
24
|
+
* Resolve a path relative to the current working directory
|
|
25
|
+
*
|
|
26
|
+
* @param segments - Path segments to join
|
|
27
|
+
* @returns Absolute path
|
|
28
|
+
*/
|
|
29
|
+
declare function resolvePath(...segments: string[]): string;
|
|
30
|
+
/**
|
|
31
|
+
* Check if a file or directory exists
|
|
32
|
+
*
|
|
33
|
+
* @param path - Path to check
|
|
34
|
+
* @returns True if the path exists
|
|
35
|
+
*/
|
|
36
|
+
declare function fileExists(targetPath: string): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Check if a path is a directory
|
|
39
|
+
*
|
|
40
|
+
* @param path - Path to check
|
|
41
|
+
* @returns True if the path is a directory
|
|
42
|
+
*/
|
|
43
|
+
declare function isDirectory(targetPath: string): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Check if a path is a file
|
|
46
|
+
*
|
|
47
|
+
* @param path - Path to check
|
|
48
|
+
* @returns True if the path is a file
|
|
49
|
+
*/
|
|
50
|
+
declare function isFile(targetPath: string): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Find package.json by traversing up from a starting directory
|
|
53
|
+
*
|
|
54
|
+
* @param startFrom - Directory to start searching from
|
|
55
|
+
* @returns Path to package.json or null if not found
|
|
56
|
+
*/
|
|
57
|
+
declare function findPackageJson(startFrom?: string): string | null;
|
|
58
|
+
/**
|
|
59
|
+
* Logger utility with colored output
|
|
60
|
+
*/
|
|
61
|
+
declare const logger: {
|
|
62
|
+
/**
|
|
63
|
+
* Log an info message
|
|
64
|
+
*/
|
|
65
|
+
info(message: string): void;
|
|
66
|
+
/**
|
|
67
|
+
* Log a success message
|
|
68
|
+
*/
|
|
69
|
+
success(message: string): void;
|
|
70
|
+
/**
|
|
71
|
+
* Log a warning message
|
|
72
|
+
*/
|
|
73
|
+
warn(message: string): void;
|
|
74
|
+
/**
|
|
75
|
+
* Log an error message
|
|
76
|
+
*/
|
|
77
|
+
error(message: string): void;
|
|
78
|
+
/**
|
|
79
|
+
* Log a debug message (only in verbose mode)
|
|
80
|
+
*/
|
|
81
|
+
debug(message: string, verbose?: boolean): void;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Format milliseconds to human-readable duration
|
|
85
|
+
*
|
|
86
|
+
* @param ms - Duration in milliseconds
|
|
87
|
+
* @returns Formatted duration string
|
|
88
|
+
*/
|
|
89
|
+
declare function formatDuration(ms: number): string;
|
|
90
|
+
/**
|
|
91
|
+
* Deep merge two objects
|
|
92
|
+
*
|
|
93
|
+
* @param target - Target object
|
|
94
|
+
* @param source - Source object to merge
|
|
95
|
+
* @returns Merged object
|
|
96
|
+
*/
|
|
97
|
+
declare function deepMerge<T extends Record<string, unknown>>(target: T, source: Partial<T>): T;
|
|
98
|
+
|
|
99
|
+
export { deepMerge, fileExists, findPackageJson, formatDuration, getPackageRoot, isDirectory, isFile, logger, resolvePath, version };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export { B as BuildSummary, i as CustomFilter, g as CustomFormat, h as CustomPreprocessor, C as CustomTransform, l as Dictionary, D as DsaiConfig, m as FileConfig, F as FormatArgs, G as GlobalConfig, p as IconFramework, I as IconsConfig, L as LoadConfigOptions, n as LoadConfigResult, o as LogLevel, O as OutputFormat, P as Platform, R as ResolvedConfig, c as ResolvedGlobalConfig, e as ResolvedIconsConfig, f as ResolvedThemesConfig, d as ResolvedTokensConfig, b as ThemeSelectorPattern, a as ThemesConfig, j as TokenData, T as TokensConfig, k as TransformOptions } from './types-Idj08nad.js';
|
|
2
|
+
export { CONFIG_FILE_NAMES, 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, buildConfigSchema, checkDeprecatedOptions, checkMigrationNeeded, clearConfigCache, createResolvedConfig, customFormatSchema, customTransformSchema, 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, themeModeSchema, themesConfigSchema, tokenBuildConfigSchema, tokenCacheConfigSchema, tokenWatchConfigSchema, tokensConfigSchema, tokensHooksSchema, validateConfig, validateConfigOrThrow, validateConfigSection, versionSchema } from './config/index.js';
|
|
3
|
+
export { BuildOptions, BuildResult, BuildStep, BundleConfig, BundleResult, CleanOptions, CleanResult, CleanedDirectory, CreateSDConfigOptions, DEFAULT_CLEAN_DIRECTORIES, DEFAULT_FILE_NAMES, DTCGToken, FigmaCollection, FigmaExport, FormatDefinition, LegacyToken, MergeConfig, MergeContent, MergeOptions, MergeResult, OutputConfig, PlaceholderValues, PostprocessOptions, PostprocessResult, PreprocessorDefinition, ReplacementRule, SDConfig, SDDictionary, SDFile, SDFormatArgs, SDLogConfig, SDPlatform, SDPlatformType, SDToken, SDTransformOptions, StyleDictionaryInstance, StyleMergeResult, StyleScannedFile, StyleScannerOptions, StyleScannerResult, SyncOptions, SyncResult, Token, TokenCollection, TokenTransformOptions, TokenTransformResult, TokenType, TokenValidationResult, TransformDefinition, TransformGroupDefinition, TransformType, VALID_TOKEN_TYPES, ValidateOptions, ValidationIssue, ValidationSeverity, addScssImportHeader, buildTokens, buildTokensCLI, builtInFormats, builtInPreprocessors, builtInTransforms, cleanTokenOutputs, cleanTokensCLI, createBundle, createBundleFromFiles, createBundles, createFixReferencesPreprocessor, createOutputConfig, createStyleDictionaryConfig, cssTransformGroup, cssVariablesWithComments, detectFigmaModes, detectTransformModes, dimensionRem, ensureOutputDirs, filterFiles, fixReferences, fontWeightUnitless, getDefaultCssDir, getDefaultFiles, getDefaultIgnorePatterns, getDefaultSyncPaths, getDefaultTransformations, getSDTokenType, getSDTokenValue, getTokenDescription, getTokenType, getTokenValue, hasDTCGValue, isDTCGToken, isLegacyToken, isSDToken, isToken, isTokenReference, isValidTokenType, jsTransformGroup, lineHeightUnitless, loadContent, mergeCollections, mergeCollectionsCLI, mergeContent, nameKebab, parseTokenReference, postprocessCLI, postprocessCss, postprocessCssFiles, processScssImportHeader, registerAll, registerFormats, registerPreprocessors, registerTransformGroups, registerTransforms, replacePlaceholders, resolveAllOutputPaths, resolveOutputPath, runBuildCLI, scanDirectories, scssTransformGroup, setupStyleDictionary, sortFiles, syncTokens, syncTokensCLI, toDTCGToken, transformGroups, transformToken, transformTokenTree, transformTokens, transformTokensCLI, transformType, transformValue, typescriptDeclarations, validateFigmaCLI, validateFigmaExports, validateFigmaFile, validateOutputPaths, validateTokens, validateTokensCLI } from './tokens/index.js';
|
|
4
|
+
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
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Package version
|
|
9
|
+
*/
|
|
10
|
+
declare const version = "0.0.1";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Utility functions for @dsai-io/tools
|
|
14
|
+
*
|
|
15
|
+
* Common utilities used across the tools package.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Get the root directory of the @dsai-io/tools package
|
|
19
|
+
*
|
|
20
|
+
* @returns Absolute path to package root
|
|
21
|
+
*/
|
|
22
|
+
declare function getPackageRoot(): string;
|
|
23
|
+
/**
|
|
24
|
+
* Resolve a path relative to the current working directory
|
|
25
|
+
*
|
|
26
|
+
* @param segments - Path segments to join
|
|
27
|
+
* @returns Absolute path
|
|
28
|
+
*/
|
|
29
|
+
declare function resolvePath(...segments: string[]): string;
|
|
30
|
+
/**
|
|
31
|
+
* Check if a file or directory exists
|
|
32
|
+
*
|
|
33
|
+
* @param path - Path to check
|
|
34
|
+
* @returns True if the path exists
|
|
35
|
+
*/
|
|
36
|
+
declare function fileExists(targetPath: string): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Check if a path is a directory
|
|
39
|
+
*
|
|
40
|
+
* @param path - Path to check
|
|
41
|
+
* @returns True if the path is a directory
|
|
42
|
+
*/
|
|
43
|
+
declare function isDirectory(targetPath: string): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Check if a path is a file
|
|
46
|
+
*
|
|
47
|
+
* @param path - Path to check
|
|
48
|
+
* @returns True if the path is a file
|
|
49
|
+
*/
|
|
50
|
+
declare function isFile(targetPath: string): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Find package.json by traversing up from a starting directory
|
|
53
|
+
*
|
|
54
|
+
* @param startFrom - Directory to start searching from
|
|
55
|
+
* @returns Path to package.json or null if not found
|
|
56
|
+
*/
|
|
57
|
+
declare function findPackageJson(startFrom?: string): string | null;
|
|
58
|
+
/**
|
|
59
|
+
* Logger utility with colored output
|
|
60
|
+
*/
|
|
61
|
+
declare const logger: {
|
|
62
|
+
/**
|
|
63
|
+
* Log an info message
|
|
64
|
+
*/
|
|
65
|
+
info(message: string): void;
|
|
66
|
+
/**
|
|
67
|
+
* Log a success message
|
|
68
|
+
*/
|
|
69
|
+
success(message: string): void;
|
|
70
|
+
/**
|
|
71
|
+
* Log a warning message
|
|
72
|
+
*/
|
|
73
|
+
warn(message: string): void;
|
|
74
|
+
/**
|
|
75
|
+
* Log an error message
|
|
76
|
+
*/
|
|
77
|
+
error(message: string): void;
|
|
78
|
+
/**
|
|
79
|
+
* Log a debug message (only in verbose mode)
|
|
80
|
+
*/
|
|
81
|
+
debug(message: string, verbose?: boolean): void;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Format milliseconds to human-readable duration
|
|
85
|
+
*
|
|
86
|
+
* @param ms - Duration in milliseconds
|
|
87
|
+
* @returns Formatted duration string
|
|
88
|
+
*/
|
|
89
|
+
declare function formatDuration(ms: number): string;
|
|
90
|
+
/**
|
|
91
|
+
* Deep merge two objects
|
|
92
|
+
*
|
|
93
|
+
* @param target - Target object
|
|
94
|
+
* @param source - Source object to merge
|
|
95
|
+
* @returns Merged object
|
|
96
|
+
*/
|
|
97
|
+
declare function deepMerge<T extends Record<string, unknown>>(target: T, source: Partial<T>): T;
|
|
98
|
+
|
|
99
|
+
export { deepMerge, fileExists, findPackageJson, formatDuration, getPackageRoot, isDirectory, isFile, logger, resolvePath, version };
|