style-dictionary 4.1.4 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -5
- package/bin/style-dictionary.js +4 -4
- package/examples/advanced/assets-base64-embed/package.json +1 -1
- package/examples/advanced/create-react-app/package.json +1 -1
- package/examples/advanced/create-react-native-app/package.json +1 -1
- package/examples/advanced/create-react-native-app/src/App.js +0 -1
- package/examples/advanced/custom-parser/package.json +1 -1
- package/examples/advanced/custom-parser/sd.config.js +3 -2
- package/examples/advanced/custom-transforms/README.md +1 -1
- package/examples/advanced/custom-transforms/build.js +11 -8
- package/examples/advanced/custom-transforms/package.json +1 -1
- package/examples/advanced/font-face-rules/package.json +1 -1
- package/examples/advanced/font-face-rules/sd.config.js +2 -1
- package/examples/advanced/format-helpers/package.json +1 -1
- package/examples/advanced/format-helpers/sd.config.js +3 -2
- package/examples/advanced/matching-build-files/config.js +15 -10
- package/examples/advanced/matching-build-files/package.json +1 -1
- package/examples/advanced/multi-brand-multi-platform/build.js +10 -7
- package/examples/advanced/multi-brand-multi-platform/package.json +1 -1
- package/examples/advanced/node-modules-as-config-and-properties/config.js +17 -12
- package/examples/advanced/node-modules-as-config-and-properties/package.json +1 -1
- package/examples/advanced/npm-module/package.json +1 -1
- package/examples/advanced/referencing_aliasing/package.json +1 -1
- package/examples/advanced/s3/package.json +1 -1
- package/examples/advanced/tailwind-preset/README.md +94 -0
- package/examples/advanced/tailwind-preset/config/filter.js +3 -0
- package/examples/advanced/tailwind-preset/config/filter.test.js +12 -0
- package/examples/advanced/tailwind-preset/config/format.js +60 -0
- package/examples/advanced/tailwind-preset/config/transform.js +21 -0
- package/examples/advanced/tailwind-preset/config/transform.test.js +37 -0
- package/examples/advanced/tailwind-preset/config.js +55 -0
- package/examples/advanced/tailwind-preset/demo/index.html +27 -0
- package/examples/advanced/tailwind-preset/demo/input.css +3 -0
- package/examples/advanced/tailwind-preset/package.json +18 -0
- package/examples/advanced/tailwind-preset/tailwind.config.js +11 -0
- package/examples/advanced/tailwind-preset/tokens/tokens.json +49 -0
- package/examples/advanced/tokens-deprecation/build.js +2 -1
- package/examples/advanced/tokens-deprecation/package.json +1 -1
- package/examples/advanced/transitive-transforms/package.json +1 -1
- package/examples/advanced/transitive-transforms/sd.config.js +12 -9
- package/examples/advanced/variables-in-outputs/package.json +1 -1
- package/examples/advanced/variables-in-outputs/sd.config.js +10 -5
- package/examples/advanced/yaml-tokens/package.json +1 -1
- package/examples/advanced/yaml-tokens/sd.config.js +3 -2
- package/lib/Register.d.ts +12 -12
- package/lib/Register.js +14 -11
- package/lib/StyleDictionary.d.ts +38 -36
- package/lib/StyleDictionary.js +103 -85
- package/lib/cleanActions.d.ts +9 -9
- package/lib/cleanActions.js +4 -4
- package/lib/cleanDir.d.ts +7 -7
- package/lib/cleanDir.js +5 -4
- package/lib/cleanDirs.d.ts +5 -5
- package/lib/cleanDirs.js +2 -2
- package/lib/cleanFile.d.ts +4 -9
- package/lib/cleanFile.js +8 -5
- package/lib/cleanFiles.d.ts +5 -5
- package/lib/cleanFiles.js +2 -2
- package/lib/common/actions.d.ts +23 -4
- package/lib/common/actions.js +11 -7
- package/lib/common/filters.d.ts +8 -2
- package/lib/common/filters.js +1 -1
- package/lib/common/formatHelpers/createPropertyFormatter.d.ts +11 -9
- package/lib/common/formatHelpers/createPropertyFormatter.js +31 -24
- package/lib/common/formatHelpers/fileHeader.d.ts +8 -8
- package/lib/common/formatHelpers/fileHeader.js +8 -6
- package/lib/common/formatHelpers/formattedVariables.d.ts +10 -8
- package/lib/common/formatHelpers/formattedVariables.js +8 -6
- package/lib/common/formatHelpers/getTypeScriptType.d.ts +6 -6
- package/lib/common/formatHelpers/getTypeScriptType.js +2 -2
- package/lib/common/formatHelpers/iconsWithPrefix.d.ts +6 -6
- package/lib/common/formatHelpers/iconsWithPrefix.js +3 -3
- package/lib/common/formatHelpers/minifyDictionary.d.ts +3 -3
- package/lib/common/formatHelpers/minifyDictionary.js +1 -1
- package/lib/common/formatHelpers/setComposeObjectProperties.d.ts +3 -3
- package/lib/common/formatHelpers/setComposeObjectProperties.js +1 -1
- package/lib/common/formatHelpers/setSwiftFileProperties.d.ts +3 -3
- package/lib/common/formatHelpers/setSwiftFileProperties.js +1 -1
- package/lib/common/formatHelpers/sortByReference.d.ts +3 -3
- package/lib/common/formatHelpers/sortByReference.js +2 -2
- package/lib/common/formats.d.ts +9 -6
- package/lib/common/formats.js +345 -178
- package/lib/common/templates/android/colors.template.d.ts +3 -3
- package/lib/common/templates/android/colors.template.js +3 -3
- package/lib/common/templates/android/dimens.template.d.ts +3 -3
- package/lib/common/templates/android/dimens.template.js +3 -3
- package/lib/common/templates/android/fontDimens.template.d.ts +3 -3
- package/lib/common/templates/android/fontDimens.template.js +3 -3
- package/lib/common/templates/android/integers.template.d.ts +3 -3
- package/lib/common/templates/android/integers.template.js +3 -3
- package/lib/common/templates/android/resources.template.d.ts +6 -6
- package/lib/common/templates/android/resources.template.js +6 -6
- package/lib/common/templates/android/strings.template.d.ts +3 -3
- package/lib/common/templates/android/strings.template.js +3 -3
- package/lib/common/templates/compose/object.kt.template.d.ts +3 -3
- package/lib/common/templates/compose/object.kt.template.js +11 -7
- package/lib/common/templates/css/fonts.css.template.d.ts +1 -1
- package/lib/common/templates/css/fonts.css.template.js +3 -3
- package/lib/common/templates/flutter/class.dart.template.d.ts +4 -4
- package/lib/common/templates/flutter/class.dart.template.js +4 -4
- package/lib/common/templates/ios/colors.h.template.d.ts +4 -4
- package/lib/common/templates/ios/colors.h.template.js +4 -4
- package/lib/common/templates/ios/colors.m.template.d.ts +4 -4
- package/lib/common/templates/ios/colors.m.template.js +4 -4
- package/lib/common/templates/ios/macros.template.d.ts +4 -4
- package/lib/common/templates/ios/macros.template.js +4 -4
- package/lib/common/templates/ios/plist.template.d.ts +4 -4
- package/lib/common/templates/ios/plist.template.js +4 -4
- package/lib/common/templates/ios/singleton.h.template.d.ts +3 -3
- package/lib/common/templates/ios/singleton.h.template.js +3 -3
- package/lib/common/templates/ios/singleton.m.template.d.ts +6 -6
- package/lib/common/templates/ios/singleton.m.template.js +6 -6
- package/lib/common/templates/ios/static.h.template.d.ts +4 -4
- package/lib/common/templates/ios/static.h.template.js +4 -4
- package/lib/common/templates/ios/static.m.template.d.ts +4 -4
- package/lib/common/templates/ios/static.m.template.js +4 -4
- package/lib/common/templates/ios/strings.h.template.d.ts +4 -4
- package/lib/common/templates/ios/strings.h.template.js +4 -4
- package/lib/common/templates/ios/strings.m.template.d.ts +5 -5
- package/lib/common/templates/ios/strings.m.template.js +5 -5
- package/lib/common/templates/ios-swift/any.swift.template.d.ts +4 -4
- package/lib/common/templates/ios-swift/any.swift.template.js +4 -4
- package/lib/common/templates/scss/map-deep.template.d.ts +4 -4
- package/lib/common/templates/scss/map-deep.template.js +4 -4
- package/lib/common/templates/scss/map-flat.template.d.ts +3 -3
- package/lib/common/templates/scss/map-flat.template.js +7 -6
- package/lib/common/transformGroups.d.ts +209 -1
- package/lib/common/transformGroups.js +139 -93
- package/lib/common/transforms.d.ts +965 -5
- package/lib/common/transforms.js +116 -114
- package/lib/enums/actions.d.ts +4 -0
- package/lib/enums/actions.js +4 -0
- package/lib/enums/commentPositions.d.ts +4 -0
- package/lib/enums/commentPositions.js +4 -0
- package/lib/enums/commentStyles.d.ts +5 -0
- package/lib/enums/commentStyles.js +5 -0
- package/lib/enums/fileHeaderCommentStyles.d.ts +5 -0
- package/lib/enums/fileHeaderCommentStyles.js +5 -0
- package/lib/enums/formats.d.ts +46 -0
- package/lib/enums/formats.js +50 -0
- package/lib/enums/index.d.ts +12 -0
- package/lib/enums/index.js +12 -0
- package/lib/enums/logBrokenReferenceLevels.d.ts +5 -0
- package/lib/enums/logBrokenReferenceLevels.js +4 -0
- package/lib/enums/logVerbosityLevels.d.ts +6 -0
- package/lib/enums/logVerbosityLevels.js +5 -0
- package/lib/enums/logWarningLevels.d.ts +5 -0
- package/lib/enums/logWarningLevels.js +5 -0
- package/lib/enums/propertyFormatNames.d.ts +6 -0
- package/lib/enums/propertyFormatNames.js +6 -0
- package/lib/enums/transformGroups.d.ts +17 -0
- package/lib/enums/transformGroups.js +17 -0
- package/lib/enums/transformTypes.d.ts +5 -0
- package/lib/enums/transformTypes.js +5 -0
- package/lib/enums/transforms.d.ts +57 -0
- package/lib/enums/transforms.js +57 -0
- package/lib/filterTokens.d.ts +6 -6
- package/lib/filterTokens.js +10 -5
- package/lib/fs-node.d.ts +2 -2
- package/lib/fs-node.js +1 -1
- package/lib/fs.d.ts +3 -3
- package/lib/fs.js +2 -2
- package/lib/performActions.d.ts +9 -9
- package/lib/performActions.js +4 -4
- package/lib/resolve.d.ts +1 -1
- package/lib/resolve.js +4 -3
- package/lib/transform/config.d.ts +4 -4
- package/lib/transform/config.js +7 -6
- package/lib/transform/object.d.ts +15 -15
- package/lib/transform/object.js +7 -7
- package/lib/transform/token.d.ts +7 -15
- package/lib/transform/token.js +16 -9
- package/lib/transform/tokenSetup.d.ts +4 -4
- package/lib/transform/tokenSetup.js +2 -2
- package/lib/utils/cleanActions.d.ts +23 -0
- package/lib/utils/cleanActions.js +44 -0
- package/lib/utils/combineJSON.d.ts +5 -5
- package/lib/utils/combineJSON.js +16 -36
- package/lib/utils/convertToBase64.d.ts +3 -3
- package/lib/utils/convertToBase64.js +1 -1
- package/lib/utils/convertToDTCG.d.ts +5 -5
- package/lib/utils/convertToDTCG.js +2 -2
- package/lib/utils/convertTokenData.d.ts +30 -0
- package/lib/utils/convertTokenData.js +123 -0
- package/lib/utils/createFormatArgs.d.ts +8 -8
- package/lib/utils/createFormatArgs.js +4 -4
- package/lib/utils/deepExtend.d.ts +5 -5
- package/lib/utils/deepExtend.js +2 -2
- package/lib/utils/deepmerge.d.ts +1 -1
- package/lib/utils/expandObjectTokens.d.ts +9 -9
- package/lib/utils/expandObjectTokens.js +8 -8
- package/lib/utils/flattenTokens.d.ts +9 -5
- package/lib/utils/flattenTokens.js +28 -16
- package/lib/utils/index.d.ts +3 -1
- package/lib/utils/index.js +5 -0
- package/lib/utils/loadFile.d.ts +13 -0
- package/lib/utils/loadFile.js +89 -0
- package/lib/utils/preprocess.d.ts +9 -9
- package/lib/utils/preprocess.js +4 -4
- package/lib/utils/references/createReferenceRegex.d.ts +2 -2
- package/lib/utils/references/createReferenceRegex.js +1 -1
- package/lib/utils/references/defaults.d.ts +5 -1
- package/lib/utils/references/defaults.js +1 -1
- package/lib/utils/references/getName.d.ts +3 -3
- package/lib/utils/references/getName.js +1 -1
- package/lib/utils/references/getReferences.d.ts +7 -7
- package/lib/utils/references/getReferences.js +3 -3
- package/lib/utils/references/getValueByPath.d.ts +4 -4
- package/lib/utils/references/getValueByPath.js +2 -2
- package/lib/utils/references/outputReferencesFilter.d.ts +4 -4
- package/lib/utils/references/outputReferencesFilter.js +2 -2
- package/lib/utils/references/outputReferencesTransformed.d.ts +4 -4
- package/lib/utils/references/outputReferencesTransformed.js +3 -3
- package/lib/utils/references/resolveReferences.d.ts +10 -10
- package/lib/utils/references/resolveReferences.js +4 -4
- package/lib/utils/references/usesReferences.d.ts +3 -3
- package/lib/utils/references/usesReferences.js +1 -1
- package/lib/utils/resolveObject.d.ts +4 -4
- package/lib/utils/resolveObject.js +3 -3
- package/lib/utils/stripMeta.d.ts +20 -0
- package/lib/utils/stripMeta.js +51 -0
- package/lib/utils/typeDtcgDelegate.d.ts +6 -6
- package/lib/utils/typeDtcgDelegate.js +3 -3
- package/package.json +26 -13
- package/types/Action.d.ts +3 -3
- package/types/Config.d.ts +17 -11
- package/types/DesignToken.d.ts +6 -0
- package/types/File.d.ts +10 -6
- package/types/Filter.d.ts +2 -2
- package/types/Format.d.ts +7 -4
- package/types/Parser.d.ts +1 -1
- package/types/Preprocessor.d.ts +2 -2
- package/types/Transform.d.ts +8 -7
- package/types/index.d.ts +10 -10
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export namespace formats {
|
|
2
|
+
let androidColors: "android/colors";
|
|
3
|
+
let androidDimens: "android/dimens";
|
|
4
|
+
let androidFontDimens: "android/fontDimens";
|
|
5
|
+
let androidIntegers: "android/integers";
|
|
6
|
+
let androidResources: "android/resources";
|
|
7
|
+
let androidStrings: "android/strings";
|
|
8
|
+
let composeObject: "compose/object";
|
|
9
|
+
let cssVariables: "css/variables";
|
|
10
|
+
let cssFonts: "css/fonts.css";
|
|
11
|
+
let flutterClassDart: "flutter/class.dart";
|
|
12
|
+
let iosColorsH: "ios/colors.h";
|
|
13
|
+
let iosColorsM: "ios/colors.m";
|
|
14
|
+
let iosMacros: "ios/macros";
|
|
15
|
+
let iosPlist: "ios/plist";
|
|
16
|
+
let iosSingletonH: "ios/singleton.h";
|
|
17
|
+
let iosSingletonM: "ios/singleton.m";
|
|
18
|
+
let iosStaticH: "ios/static.h";
|
|
19
|
+
let iosStaticM: "ios/static.m";
|
|
20
|
+
let iosStringsH: "ios/strings.h";
|
|
21
|
+
let iosStringsM: "ios/strings.m";
|
|
22
|
+
let iosSwiftAnySwift: "ios-swift/any.swift";
|
|
23
|
+
let iosSwiftClassSwift: "ios-swift/class.swift";
|
|
24
|
+
let iosSwiftEnumSwift: "ios-swift/enum.swift";
|
|
25
|
+
let javascriptEs6: "javascript/es6";
|
|
26
|
+
let javascriptEsm: "javascript/esm";
|
|
27
|
+
let javascriptModule: "javascript/module";
|
|
28
|
+
let javascriptModuleFlat: "javascript/module-flat";
|
|
29
|
+
let javascriptObject: "javascript/object";
|
|
30
|
+
let javascriptUmd: "javascript/umd";
|
|
31
|
+
let json: "json";
|
|
32
|
+
let jsonAsset: "json/asset";
|
|
33
|
+
let jsonNested: "json/nested";
|
|
34
|
+
let jsonFlat: "json/flat";
|
|
35
|
+
let sketchPalette: "sketchPalette";
|
|
36
|
+
let sketchPaletteV2: "sketch/palette/v2";
|
|
37
|
+
let lessIcons: "less/icons";
|
|
38
|
+
let lessVariables: "less/variables";
|
|
39
|
+
let scssIcons: "scss/icons";
|
|
40
|
+
let scssMapDeep: "scss/map-deep";
|
|
41
|
+
let scssMapFlat: "scss/map-flat";
|
|
42
|
+
let scssVariables: "scss/variables";
|
|
43
|
+
let stylusVariables: "stylus/variables";
|
|
44
|
+
let typescriptEs6Declarations: "typescript/es6-declarations";
|
|
45
|
+
let typescriptModuleDeclarations: "typescript/module-declarations";
|
|
46
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export const formats = {
|
|
2
|
+
androidColors: /** @type {'android/colors'} */ ('android/colors'),
|
|
3
|
+
androidDimens: /** @type {'android/dimens'} */ ('android/dimens'),
|
|
4
|
+
androidFontDimens: /** @type {'android/fontDimens'} */ ('android/fontDimens'),
|
|
5
|
+
androidIntegers: /** @type {'android/integers'} */ ('android/integers'),
|
|
6
|
+
androidResources: /** @type {'android/resources'} */ ('android/resources'),
|
|
7
|
+
androidStrings: /** @type {'android/strings'} */ ('android/strings'),
|
|
8
|
+
composeObject: /** @type {'compose/object'} */ ('compose/object'),
|
|
9
|
+
cssVariables: /** @type {'css/variables'} */ ('css/variables'),
|
|
10
|
+
cssFonts: /** @type {'css/fonts.css'} */ ('css/fonts.css'),
|
|
11
|
+
flutterClassDart: /** @type {'flutter/class.dart'} */ ('flutter/class.dart'),
|
|
12
|
+
iosColorsH: /** @type {'ios/colors.h'} */ ('ios/colors.h'),
|
|
13
|
+
iosColorsM: /** @type {'ios/colors.m'} */ ('ios/colors.m'),
|
|
14
|
+
iosMacros: /** @type {'ios/macros'} */ ('ios/macros'),
|
|
15
|
+
iosPlist: /** @type {'ios/plist'} */ ('ios/plist'),
|
|
16
|
+
iosSingletonH: /** @type {'ios/singleton.h'} */ ('ios/singleton.h'),
|
|
17
|
+
iosSingletonM: /** @type {'ios/singleton.m'} */ ('ios/singleton.m'),
|
|
18
|
+
iosStaticH: /** @type {'ios/static.h'} */ ('ios/static.h'),
|
|
19
|
+
iosStaticM: /** @type {'ios/static.m'} */ ('ios/static.m'),
|
|
20
|
+
iosStringsH: /** @type {'ios/strings.h'} */ ('ios/strings.h'),
|
|
21
|
+
iosStringsM: /** @type {'ios/strings.m'} */ ('ios/strings.m'),
|
|
22
|
+
iosSwiftAnySwift: /** @type {'ios-swift/any.swift'} */ ('ios-swift/any.swift'),
|
|
23
|
+
iosSwiftClassSwift: /** @type {'ios-swift/class.swift'} */ ('ios-swift/class.swift'),
|
|
24
|
+
iosSwiftEnumSwift: /** @type {'ios-swift/enum.swift'} */ ('ios-swift/enum.swift'),
|
|
25
|
+
javascriptEs6: /** @type {'javascript/es6'} */ ('javascript/es6'),
|
|
26
|
+
javascriptEsm: /** @type {'javascript/esm'} */ ('javascript/esm'),
|
|
27
|
+
javascriptModule: /** @type {'javascript/module'} */ ('javascript/module'),
|
|
28
|
+
javascriptModuleFlat: /** @type {'javascript/module-flat'} */ ('javascript/module-flat'),
|
|
29
|
+
javascriptObject: /** @type {'javascript/object'} */ ('javascript/object'),
|
|
30
|
+
javascriptUmd: /** @type {'javascript/umd'} */ ('javascript/umd'),
|
|
31
|
+
json: /** @type {'json'} */ ('json'),
|
|
32
|
+
jsonAsset: /** @type {'json/asset'} */ ('json/asset'),
|
|
33
|
+
jsonNested: /** @type {'json/nested'} */ ('json/nested'),
|
|
34
|
+
jsonFlat: /** @type {'json/flat'} */ ('json/flat'),
|
|
35
|
+
sketchPalette: /** @type {'sketchPalette'} */ ('sketchPalette'),
|
|
36
|
+
sketchPaletteV2: /** @type {'sketch/palette/v2'} */ ('sketch/palette/v2'),
|
|
37
|
+
lessIcons: /** @type {'less/icons'} */ ('less/icons'),
|
|
38
|
+
lessVariables: /** @type {'less/variables'} */ ('less/variables'),
|
|
39
|
+
scssIcons: /** @type {'scss/icons'} */ ('scss/icons'),
|
|
40
|
+
scssMapDeep: /** @type {'scss/map-deep'} */ ('scss/map-deep'),
|
|
41
|
+
scssMapFlat: /** @type {'scss/map-flat'} */ ('scss/map-flat'),
|
|
42
|
+
scssVariables: /** @type {'scss/variables'} */ ('scss/variables'),
|
|
43
|
+
stylusVariables: /** @type {'stylus/variables'} */ ('stylus/variables'),
|
|
44
|
+
typescriptEs6Declarations: /** @type {'typescript/es6-declarations'} */ (
|
|
45
|
+
'typescript/es6-declarations'
|
|
46
|
+
),
|
|
47
|
+
typescriptModuleDeclarations: /** @type {'typescript/module-declarations'} */ (
|
|
48
|
+
'typescript/module-declarations'
|
|
49
|
+
),
|
|
50
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { actions } from "./actions.js";
|
|
2
|
+
export { logWarningLevels } from "./logWarningLevels.js";
|
|
3
|
+
export { logVerbosityLevels } from "./logVerbosityLevels.js";
|
|
4
|
+
export { logBrokenReferenceLevels } from "./logBrokenReferenceLevels.js";
|
|
5
|
+
export { commentStyles } from "./commentStyles.js";
|
|
6
|
+
export { commentPositions } from "./commentPositions.js";
|
|
7
|
+
export { fileHeaderCommentStyles } from "./fileHeaderCommentStyles.js";
|
|
8
|
+
export { formats } from "./formats.js";
|
|
9
|
+
export { transformGroups } from "./transformGroups.js";
|
|
10
|
+
export { transforms } from "./transforms.js";
|
|
11
|
+
export { transformTypes } from "./transformTypes.js";
|
|
12
|
+
export { propertyFormatNames } from "./propertyFormatNames.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { actions } from './actions.js';
|
|
2
|
+
export { logWarningLevels } from './logWarningLevels.js';
|
|
3
|
+
export { logVerbosityLevels } from './logVerbosityLevels.js';
|
|
4
|
+
export { logBrokenReferenceLevels } from './logBrokenReferenceLevels.js';
|
|
5
|
+
export { commentStyles } from './commentStyles.js';
|
|
6
|
+
export { commentPositions } from './commentPositions.js';
|
|
7
|
+
export { fileHeaderCommentStyles } from './fileHeaderCommentStyles.js';
|
|
8
|
+
export { formats } from './formats.js';
|
|
9
|
+
export { transformGroups } from './transformGroups.js';
|
|
10
|
+
export { transforms } from './transforms.js';
|
|
11
|
+
export { transformTypes } from './transformTypes.js';
|
|
12
|
+
export { propertyFormatNames } from './propertyFormatNames.js';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export namespace transformGroups {
|
|
2
|
+
let web: "web";
|
|
3
|
+
let js: "js";
|
|
4
|
+
let scss: "scss";
|
|
5
|
+
let css: "css";
|
|
6
|
+
let less: "less";
|
|
7
|
+
let html: "html";
|
|
8
|
+
let android: "android";
|
|
9
|
+
let compose: "compose";
|
|
10
|
+
let ios: "ios";
|
|
11
|
+
let iosSwift: "ios-swift";
|
|
12
|
+
let iosSwiftSeparate: "ios-swift-separate";
|
|
13
|
+
let assets: "assets";
|
|
14
|
+
let flutter: "flutter";
|
|
15
|
+
let flutterSeparate: "flutter-separate";
|
|
16
|
+
let reactNative: "react-native";
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const transformGroups = {
|
|
2
|
+
web: /** @type {'web'} */ ('web'),
|
|
3
|
+
js: /** @type {'js'} */ ('js'),
|
|
4
|
+
scss: /** @type {'scss'} */ ('scss'),
|
|
5
|
+
css: /** @type {'css'} */ ('css'),
|
|
6
|
+
less: /** @type {'less'} */ ('less'),
|
|
7
|
+
html: /** @type {'html'} */ ('html'),
|
|
8
|
+
android: /** @type {'android'} */ ('android'),
|
|
9
|
+
compose: /** @type {'compose'} */ ('compose'),
|
|
10
|
+
ios: /** @type {'ios'} */ ('ios'),
|
|
11
|
+
iosSwift: /** @type {'ios-swift'} */ ('ios-swift'),
|
|
12
|
+
iosSwiftSeparate: /** @type {'ios-swift-separate'} */ ('ios-swift-separate'),
|
|
13
|
+
assets: /** @type {'assets'} */ ('assets'),
|
|
14
|
+
flutter: /** @type {'flutter'} */ ('flutter'),
|
|
15
|
+
flutterSeparate: /** @type {'flutter-separate'} */ ('flutter-separate'),
|
|
16
|
+
reactNative: /** @type {'react-native'} */ ('react-native'),
|
|
17
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export namespace transforms {
|
|
2
|
+
let attributeCti: "attribute/cti";
|
|
3
|
+
let attributeColor: "attribute/color";
|
|
4
|
+
let nameHuman: "name/human";
|
|
5
|
+
let nameCamel: "name/camel";
|
|
6
|
+
let nameKebab: "name/kebab";
|
|
7
|
+
let nameSnake: "name/snake";
|
|
8
|
+
let nameConstant: "name/constant";
|
|
9
|
+
let namePascal: "name/pascal";
|
|
10
|
+
let colorRgb: "color/rgb";
|
|
11
|
+
let colorHsl: "color/hsl";
|
|
12
|
+
let colorHsl4: "color/hsl-4";
|
|
13
|
+
let colorHex: "color/hex";
|
|
14
|
+
let colorHex8: "color/hex8";
|
|
15
|
+
let colorHex8android: "color/hex8android";
|
|
16
|
+
let colorComposeColor: "color/composeColor";
|
|
17
|
+
let colorUIColor: "color/UIColor";
|
|
18
|
+
let colorUIColorSwift: "color/UIColorSwift";
|
|
19
|
+
let colorColorSwiftUI: "color/ColorSwiftUI";
|
|
20
|
+
let colorCss: "color/css";
|
|
21
|
+
let colorSketch: "color/sketch";
|
|
22
|
+
let sizeSp: "size/sp";
|
|
23
|
+
let sizeDp: "size/dp";
|
|
24
|
+
let sizeObject: "size/object";
|
|
25
|
+
let sizeRemToSp: "size/remToSp";
|
|
26
|
+
let sizeRemToDp: "size/remToDp";
|
|
27
|
+
let sizePx: "size/px";
|
|
28
|
+
let sizeRem: "size/rem";
|
|
29
|
+
let sizeRemToPt: "size/remToPt";
|
|
30
|
+
let sizeComposeRemToSp: "size/compose/remToSp";
|
|
31
|
+
let sizeComposeRemToDp: "size/compose/remToDp";
|
|
32
|
+
let sizeComposeEm: "size/compose/em";
|
|
33
|
+
let sizeSwiftRemToCGFloat: "size/swift/remToCGFloat";
|
|
34
|
+
let sizeRemToPx: "size/remToPx";
|
|
35
|
+
let sizePxToRem: "size/pxToRem";
|
|
36
|
+
let htmlIcon: "html/icon";
|
|
37
|
+
let contentQuote: "content/quote";
|
|
38
|
+
let contentObjCLiteral: "content/objC/literal";
|
|
39
|
+
let contentSwiftLiteral: "content/swift/literal";
|
|
40
|
+
let timeSeconds: "time/seconds";
|
|
41
|
+
let fontFamilyCss: "fontFamily/css";
|
|
42
|
+
let cubicBezierCss: "cubicBezier/css";
|
|
43
|
+
let strokeStyleCssShorthand: "strokeStyle/css/shorthand";
|
|
44
|
+
let borderCssShorthand: "border/css/shorthand";
|
|
45
|
+
let typographyCssShorthand: "typography/css/shorthand";
|
|
46
|
+
let transitionCssShorthand: "transition/css/shorthand";
|
|
47
|
+
let shadowCssShorthand: "shadow/css/shorthand";
|
|
48
|
+
let assetUrl: "asset/url";
|
|
49
|
+
let assetBase64: "asset/base64";
|
|
50
|
+
let assetPath: "asset/path";
|
|
51
|
+
let assetObjCLiteral: "asset/objC/literal";
|
|
52
|
+
let assetSwiftLiteral: "asset/swift/literal";
|
|
53
|
+
let colorHex8flutter: "color/hex8flutter";
|
|
54
|
+
let contentFlutterLiteral: "content/flutter/literal";
|
|
55
|
+
let assetFlutterLiteral: "asset/flutter/literal";
|
|
56
|
+
let sizeFlutterRemToDouble: "size/flutter/remToDouble";
|
|
57
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export const transforms = {
|
|
2
|
+
attributeCti: /** @type {'attribute/cti'} */ ('attribute/cti'),
|
|
3
|
+
attributeColor: /** @type {'attribute/color'} */ ('attribute/color'),
|
|
4
|
+
nameHuman: /** @type {'name/human'} */ ('name/human'),
|
|
5
|
+
nameCamel: /** @type {'name/camel'} */ ('name/camel'),
|
|
6
|
+
nameKebab: /** @type {'name/kebab'} */ ('name/kebab'),
|
|
7
|
+
nameSnake: /** @type {'name/snake'} */ ('name/snake'),
|
|
8
|
+
nameConstant: /** @type {'name/constant'} */ ('name/constant'),
|
|
9
|
+
namePascal: /** @type {'name/pascal'} */ ('name/pascal'),
|
|
10
|
+
colorRgb: /** @type {'color/rgb'} */ ('color/rgb'),
|
|
11
|
+
colorHsl: /** @type {'color/hsl'} */ ('color/hsl'),
|
|
12
|
+
colorHsl4: /** @type {'color/hsl-4'} */ ('color/hsl-4'),
|
|
13
|
+
colorHex: /** @type {'color/hex'} */ ('color/hex'),
|
|
14
|
+
colorHex8: /** @type {'color/hex8'} */ ('color/hex8'),
|
|
15
|
+
colorHex8android: /** @type {'color/hex8android'} */ ('color/hex8android'),
|
|
16
|
+
colorComposeColor: /** @type {'color/composeColor'} */ ('color/composeColor'),
|
|
17
|
+
colorUIColor: /** @type {'color/UIColor'} */ ('color/UIColor'),
|
|
18
|
+
colorUIColorSwift: /** @type {'color/UIColorSwift'} */ ('color/UIColorSwift'),
|
|
19
|
+
colorColorSwiftUI: /** @type {'color/ColorSwiftUI'} */ ('color/ColorSwiftUI'),
|
|
20
|
+
colorCss: /** @type {'color/css'} */ ('color/css'),
|
|
21
|
+
colorSketch: /** @type {'color/sketch'} */ ('color/sketch'),
|
|
22
|
+
sizeSp: /** @type {'size/sp'} */ ('size/sp'),
|
|
23
|
+
sizeDp: /** @type {'size/dp'} */ ('size/dp'),
|
|
24
|
+
sizeObject: /** @type {'size/object'} */ ('size/object'),
|
|
25
|
+
sizeRemToSp: /** @type {'size/remToSp'} */ ('size/remToSp'),
|
|
26
|
+
sizeRemToDp: /** @type {'size/remToDp'} */ ('size/remToDp'),
|
|
27
|
+
sizePx: /** @type {'size/px'} */ ('size/px'),
|
|
28
|
+
sizeRem: /** @type {'size/rem'} */ ('size/rem'),
|
|
29
|
+
sizeRemToPt: /** @type {'size/remToPt'} */ ('size/remToPt'),
|
|
30
|
+
sizeComposeRemToSp: /** @type {'size/compose/remToSp'} */ ('size/compose/remToSp'),
|
|
31
|
+
sizeComposeRemToDp: /** @type {'size/compose/remToDp'} */ ('size/compose/remToDp'),
|
|
32
|
+
sizeComposeEm: /** @type {'size/compose/em'} */ ('size/compose/em'),
|
|
33
|
+
sizeSwiftRemToCGFloat: /** @type {'size/swift/remToCGFloat'} */ ('size/swift/remToCGFloat'),
|
|
34
|
+
sizeRemToPx: /** @type {'size/remToPx'} */ ('size/remToPx'),
|
|
35
|
+
sizePxToRem: /** @type {'size/pxToRem'} */ ('size/pxToRem'),
|
|
36
|
+
htmlIcon: /** @type {'html/icon'} */ ('html/icon'),
|
|
37
|
+
contentQuote: /** @type {'content/quote'} */ ('content/quote'),
|
|
38
|
+
contentObjCLiteral: /** @type {'content/objC/literal'} */ ('content/objC/literal'),
|
|
39
|
+
contentSwiftLiteral: /** @type {'content/swift/literal'} */ ('content/swift/literal'),
|
|
40
|
+
timeSeconds: /** @type {'time/seconds'} */ ('time/seconds'),
|
|
41
|
+
fontFamilyCss: /** @type {'fontFamily/css'} */ ('fontFamily/css'),
|
|
42
|
+
cubicBezierCss: /** @type {'cubicBezier/css'} */ ('cubicBezier/css'),
|
|
43
|
+
strokeStyleCssShorthand: /** @type {'strokeStyle/css/shorthand'} */ ('strokeStyle/css/shorthand'),
|
|
44
|
+
borderCssShorthand: /** @type {'border/css/shorthand'} */ ('border/css/shorthand'),
|
|
45
|
+
typographyCssShorthand: /** @type {'typography/css/shorthand'} */ ('typography/css/shorthand'),
|
|
46
|
+
transitionCssShorthand: /** @type {'transition/css/shorthand'} */ ('transition/css/shorthand'),
|
|
47
|
+
shadowCssShorthand: /** @type {'shadow/css/shorthand'} */ ('shadow/css/shorthand'),
|
|
48
|
+
assetUrl: /** @type {'asset/url'} */ ('asset/url'),
|
|
49
|
+
assetBase64: /** @type {'asset/base64'} */ ('asset/base64'),
|
|
50
|
+
assetPath: /** @type {'asset/path'} */ ('asset/path'),
|
|
51
|
+
assetObjCLiteral: /** @type {'asset/objC/literal'} */ ('asset/objC/literal'),
|
|
52
|
+
assetSwiftLiteral: /** @type {'asset/swift/literal'} */ ('asset/swift/literal'),
|
|
53
|
+
colorHex8flutter: /** @type {'color/hex8flutter'} */ ('color/hex8flutter'),
|
|
54
|
+
contentFlutterLiteral: /** @type {'content/flutter/literal'} */ ('content/flutter/literal'),
|
|
55
|
+
assetFlutterLiteral: /** @type {'asset/flutter/literal'} */ ('asset/flutter/literal'),
|
|
56
|
+
sizeFlutterRemToDouble: /** @type {'size/flutter/remToDouble'} */ ('size/flutter/remToDouble'),
|
|
57
|
+
};
|
package/lib/filterTokens.d.ts
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
* tokens that matched the filter (or the original dictionary if no filter
|
|
12
12
|
* function was provided).
|
|
13
13
|
*/
|
|
14
|
-
export default function filterTokens(dictionary: Dictionary, filter?:
|
|
15
|
-
export type Dictionary = import("../types/DesignToken.ts").Dictionary;
|
|
16
|
-
export type Tokens = import("../types/DesignToken.ts").TransformedTokens;
|
|
17
|
-
export type Token = import("../types/DesignToken.ts").TransformedToken;
|
|
18
|
-
export type Filter = import("../types/Filter.ts").Filter;
|
|
19
|
-
export type Config = import("../types/Config.ts").Config;
|
|
14
|
+
export default function filterTokens(dictionary: Dictionary, filter?: Filter["filter"], options?: Config): Promise<Dictionary>;
|
|
15
|
+
export type Dictionary = import("../types/DesignToken.d.ts").Dictionary;
|
|
16
|
+
export type Tokens = import("../types/DesignToken.d.ts").TransformedTokens;
|
|
17
|
+
export type Token = import("../types/DesignToken.d.ts").TransformedToken;
|
|
18
|
+
export type Filter = import("../types/Filter.d.ts").Filter;
|
|
19
|
+
export type Config = import("../types/Config.d.ts").Config;
|
package/lib/filterTokens.js
CHANGED
|
@@ -11,13 +11,14 @@
|
|
|
11
11
|
* and limitations under the License.
|
|
12
12
|
*/
|
|
13
13
|
import isPlainObject from 'is-plain-obj';
|
|
14
|
+
import { convertTokenData } from './utils/convertTokenData.js';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
|
-
* @typedef {import('../types/DesignToken.ts').Dictionary} Dictionary
|
|
17
|
-
* @typedef {import('../types/DesignToken.ts').TransformedTokens} Tokens
|
|
18
|
-
* @typedef {import('../types/DesignToken.ts').TransformedToken} Token
|
|
19
|
-
* @typedef {import('../types/Filter.ts').Filter} Filter
|
|
20
|
-
* @typedef {import('../types/Config.ts').Config} Config
|
|
17
|
+
* @typedef {import('../types/DesignToken.d.ts').Dictionary} Dictionary
|
|
18
|
+
* @typedef {import('../types/DesignToken.d.ts').TransformedTokens} Tokens
|
|
19
|
+
* @typedef {import('../types/DesignToken.d.ts').TransformedToken} Token
|
|
20
|
+
* @typedef {import('../types/Filter.d.ts').Filter} Filter
|
|
21
|
+
* @typedef {import('../types/Config.d.ts').Config} Config
|
|
21
22
|
*/
|
|
22
23
|
|
|
23
24
|
/**
|
|
@@ -96,10 +97,14 @@ export default async function filterTokens(dictionary, filter, options = {}) {
|
|
|
96
97
|
} else {
|
|
97
98
|
const allTokens = await asyncFilter(dictionary.allTokens ?? [], filter, options);
|
|
98
99
|
const tokens = await filterTokenObject(dictionary.tokens, filter, options);
|
|
100
|
+
const tokenMap = /** @type {Map<string,Token>} */ (
|
|
101
|
+
convertTokenData(allTokens, { output: 'map' })
|
|
102
|
+
);
|
|
99
103
|
|
|
100
104
|
return {
|
|
101
105
|
allTokens,
|
|
102
106
|
tokens,
|
|
107
|
+
tokenMap,
|
|
103
108
|
};
|
|
104
109
|
}
|
|
105
110
|
}
|
package/lib/fs-node.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { fs } from './fs.js';
|
|
2
2
|
/**
|
|
3
|
-
* @param {import('../types/Volume.ts').Volume} v
|
|
3
|
+
* @param {import('../types/Volume.d.ts').Volume} v
|
|
4
4
|
*/
|
|
5
|
-
export function setFs(v: import("../types/Volume.ts").Volume): void;
|
|
5
|
+
export function setFs(v: import("../types/Volume.d.ts").Volume): void;
|
|
6
6
|
export { fs };
|
package/lib/fs-node.js
CHANGED
|
@@ -4,7 +4,7 @@ import { setFs as _setFs, fs } from './fs.js';
|
|
|
4
4
|
_setFs(_fs, true);
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* @param {import('../types/Volume.ts').Volume} v
|
|
7
|
+
* @param {import('../types/Volume.d.ts').Volume} v
|
|
8
8
|
*/
|
|
9
9
|
const setFs = (v) => {
|
|
10
10
|
// TODO: add a custom test process that tests NodeJS env with memfs FS shim,
|
package/lib/fs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {import('../types/Volume.ts').Volume} Volume
|
|
2
|
+
* @typedef {import('../types/Volume.d.ts').Volume} Volume
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Allow to be overridden by setter, set default to memfs for browser env, node:fs for node env
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
* cast the default import to type of Volume by first casting to unknown...
|
|
8
8
|
*/
|
|
9
9
|
export let fs: Volume;
|
|
10
|
-
export function setFs(_fs: Volume, isNodeFS?: boolean
|
|
11
|
-
export type Volume = import("../types/Volume.ts").Volume;
|
|
10
|
+
export function setFs(_fs: Volume, isNodeFS?: boolean): void;
|
|
11
|
+
export type Volume = import("../types/Volume.d.ts").Volume;
|
package/lib/fs.js
CHANGED
package/lib/performActions.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {import('../types/Volume.ts').Volume} Volume
|
|
3
|
-
* @typedef {import('../types/DesignToken.ts').Dictionary} Dictionary
|
|
4
|
-
* @typedef {import('../types/Config.ts').PlatformConfig} PlatformConfig
|
|
5
|
-
* @typedef {import('../types/Config.ts').Config} Config
|
|
2
|
+
* @typedef {import('../types/Volume.d.ts').Volume} Volume
|
|
3
|
+
* @typedef {import('../types/DesignToken.d.ts').Dictionary} Dictionary
|
|
4
|
+
* @typedef {import('../types/Config.d.ts').PlatformConfig} PlatformConfig
|
|
5
|
+
* @typedef {import('../types/Config.d.ts').Config} Config
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
8
|
* Performs any actions in a platform config. Pretty
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
* @param {Config} options
|
|
16
16
|
* @param {Volume} [vol]
|
|
17
17
|
*/
|
|
18
|
-
export default function performActions(dictionary: Dictionary, platform: PlatformConfig, options: Config, vol?:
|
|
19
|
-
export type Volume = import("../types/Volume.ts").Volume;
|
|
20
|
-
export type Dictionary = import("../types/DesignToken.ts").Dictionary;
|
|
21
|
-
export type PlatformConfig = import("../types/Config.ts").PlatformConfig;
|
|
22
|
-
export type Config = import("../types/Config.ts").Config;
|
|
18
|
+
export default function performActions(dictionary: Dictionary, platform: PlatformConfig, options: Config, vol?: Volume): Promise<void[] | undefined>;
|
|
19
|
+
export type Volume = import("../types/Volume.d.ts").Volume;
|
|
20
|
+
export type Dictionary = import("../types/DesignToken.d.ts").Dictionary;
|
|
21
|
+
export type PlatformConfig = import("../types/Config.d.ts").PlatformConfig;
|
|
22
|
+
export type Config = import("../types/Config.d.ts").Config;
|
package/lib/performActions.js
CHANGED
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
import { fs } from 'style-dictionary/fs';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* @typedef {import('../types/Volume.ts').Volume} Volume
|
|
17
|
-
* @typedef {import('../types/DesignToken.ts').Dictionary} Dictionary
|
|
18
|
-
* @typedef {import('../types/Config.ts').PlatformConfig} PlatformConfig
|
|
19
|
-
* @typedef {import('../types/Config.ts').Config} Config
|
|
16
|
+
* @typedef {import('../types/Volume.d.ts').Volume} Volume
|
|
17
|
+
* @typedef {import('../types/DesignToken.d.ts').Dictionary} Dictionary
|
|
18
|
+
* @typedef {import('../types/Config.d.ts').PlatformConfig} PlatformConfig
|
|
19
|
+
* @typedef {import('../types/Config.d.ts').Config} Config
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
/**
|
package/lib/resolve.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function resolve(path: string, customVolumeUsed?: boolean
|
|
1
|
+
export function resolve(path: string, customVolumeUsed?: boolean): string;
|
package/lib/resolve.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resolve as resolvePosix } from 'path-unified/posix';
|
|
2
|
+
import { resolve as resolveWin32 } from 'path-unified/win32';
|
|
2
3
|
import { isNode } from './utils/isNode.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -13,7 +14,7 @@ export const resolve = (path, customVolumeUsed = false) => {
|
|
|
13
14
|
return path;
|
|
14
15
|
}
|
|
15
16
|
if (isNode && process?.platform === 'win32') {
|
|
16
|
-
return
|
|
17
|
+
return resolveWin32(path);
|
|
17
18
|
}
|
|
18
|
-
return
|
|
19
|
+
return resolvePosix(path);
|
|
19
20
|
};
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
export default function transformConfig(platformConfig: PlatformConfig, dictionary: StyleDictionary, platformName: string): PlatformConfig;
|
|
12
12
|
export type StyleDictionary = import("../StyleDictionary.js").default;
|
|
13
|
-
export type Transform = import("../../types/Transform.ts").Transform;
|
|
14
|
-
export type File = import("../../types/File.ts").File;
|
|
15
|
-
export type Action = import("../../types/Action.ts").Action;
|
|
16
|
-
export type PlatformConfig = import("../../types/Config.ts").PlatformConfig;
|
|
13
|
+
export type Transform = import("../../types/Transform.d.ts").Transform;
|
|
14
|
+
export type File = import("../../types/File.d.ts").File;
|
|
15
|
+
export type Action = import("../../types/Action.d.ts").Action;
|
|
16
|
+
export type PlatformConfig = import("../../types/Config.d.ts").PlatformConfig;
|
package/lib/transform/config.js
CHANGED
|
@@ -16,13 +16,14 @@ import deepExtend from '../utils/deepExtend.js';
|
|
|
16
16
|
import GroupMessages from '../utils/groupMessages.js';
|
|
17
17
|
import { deepmerge } from '../utils/deepmerge.js';
|
|
18
18
|
import chalk from 'chalk';
|
|
19
|
+
import { logWarningLevels, logVerbosityLevels } from '../enums/index.js';
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* @typedef {import('../StyleDictionary.js').default} StyleDictionary
|
|
22
|
-
* @typedef {import('../../types/Transform.ts').Transform} Transform
|
|
23
|
-
* @typedef {import('../../types/File.ts').File} File
|
|
24
|
-
* @typedef {import('../../types/Action.ts').Action} Action
|
|
25
|
-
* @typedef {import('../../types/Config.ts').PlatformConfig} PlatformConfig
|
|
23
|
+
* @typedef {import('../../types/Transform.d.ts').Transform} Transform
|
|
24
|
+
* @typedef {import('../../types/File.d.ts').File} File
|
|
25
|
+
* @typedef {import('../../types/Action.d.ts').Action} Action
|
|
26
|
+
* @typedef {import('../../types/Config.d.ts').PlatformConfig} PlatformConfig
|
|
26
27
|
*/
|
|
27
28
|
|
|
28
29
|
const MISSING_TRANSFORM_ERRORS = GroupMessages.GROUP.MissingRegisterTransformErrors;
|
|
@@ -197,9 +198,9 @@ None of ${transform_warnings} match the name of a registered transform.
|
|
|
197
198
|
/** @param {string} action */ function (action) {
|
|
198
199
|
if (typeof dictionary.hooks.actions?.[action].undo !== 'function') {
|
|
199
200
|
const message = `${action} action does not have a clean function!`;
|
|
200
|
-
if (to_ret.log?.warnings ===
|
|
201
|
+
if (to_ret.log?.warnings === logWarningLevels.error) {
|
|
201
202
|
throw new Error(message);
|
|
202
|
-
} else if (to_ret.log?.verbosity !==
|
|
203
|
+
} else if (to_ret.log?.verbosity !== logVerbosityLevels.silent) {
|
|
203
204
|
// eslint-disable-next-line no-console
|
|
204
205
|
console.log(chalk.rgb(255, 140, 0).bold(message));
|
|
205
206
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {import('../../types/Volume.ts').Volume} Volume
|
|
3
|
-
* @typedef {import('../../types/DesignToken.ts').PreprocessedTokens} Tokens
|
|
4
|
-
* @typedef {import('../../types/DesignToken.ts').TransformedTokens} TransformedTokens
|
|
5
|
-
* @typedef {import('../../types/DesignToken.ts').DesignToken} Token
|
|
6
|
-
* @typedef {import('../../types/DesignToken.ts').TransformedToken} TransformedToken
|
|
7
|
-
* @typedef {import('../../types/Config.ts').PlatformConfig} PlatformConfig
|
|
8
|
-
* @typedef {import('../../types/Config.ts').Config} Config
|
|
2
|
+
* @typedef {import('../../types/Volume.d.ts').Volume} Volume
|
|
3
|
+
* @typedef {import('../../types/DesignToken.d.ts').PreprocessedTokens} Tokens
|
|
4
|
+
* @typedef {import('../../types/DesignToken.d.ts').TransformedTokens} TransformedTokens
|
|
5
|
+
* @typedef {import('../../types/DesignToken.d.ts').DesignToken} Token
|
|
6
|
+
* @typedef {import('../../types/DesignToken.d.ts').TransformedToken} TransformedToken
|
|
7
|
+
* @typedef {import('../../types/Config.d.ts').PlatformConfig} PlatformConfig
|
|
8
|
+
* @typedef {import('../../types/Config.d.ts').Config} Config
|
|
9
9
|
*/
|
|
10
10
|
/**
|
|
11
11
|
* Applies transforms on all tokens. This
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
export default function transformObject(obj: Tokens | TransformedTokens, config: PlatformConfig, options: Config, { transformedPropRefs, deferredPropValueTransforms }?: {
|
|
27
27
|
transformedPropRefs?: string[];
|
|
28
28
|
deferredPropValueTransforms?: string[];
|
|
29
|
-
}
|
|
30
|
-
export type Volume = import("../../types/Volume.ts").Volume;
|
|
31
|
-
export type Tokens = import("../../types/DesignToken.ts").PreprocessedTokens;
|
|
32
|
-
export type TransformedTokens = import("../../types/DesignToken.ts").TransformedTokens;
|
|
33
|
-
export type Token = import("../../types/DesignToken.ts").DesignToken;
|
|
34
|
-
export type TransformedToken = import("../../types/DesignToken.ts").TransformedToken;
|
|
35
|
-
export type PlatformConfig = import("../../types/Config.ts").PlatformConfig;
|
|
36
|
-
export type Config = import("../../types/Config.ts").Config;
|
|
29
|
+
}, path?: string[], transformedObj?: Record<string, Tokens | TransformedTokens | Token | TransformedToken>, volume?: Volume): Promise<TransformedTokens>;
|
|
30
|
+
export type Volume = import("../../types/Volume.d.ts").Volume;
|
|
31
|
+
export type Tokens = import("../../types/DesignToken.d.ts").PreprocessedTokens;
|
|
32
|
+
export type TransformedTokens = import("../../types/DesignToken.d.ts").TransformedTokens;
|
|
33
|
+
export type Token = import("../../types/DesignToken.d.ts").DesignToken;
|
|
34
|
+
export type TransformedToken = import("../../types/DesignToken.d.ts").TransformedToken;
|
|
35
|
+
export type PlatformConfig = import("../../types/Config.d.ts").PlatformConfig;
|
|
36
|
+
export type Config = import("../../types/Config.d.ts").Config;
|