style-dictionary 4.1.3 → 4.2.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/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/custom-parser/package.json +1 -1
- package/examples/advanced/custom-transforms/package.json +1 -1
- package/examples/advanced/font-face-rules/package.json +1 -1
- package/examples/advanced/format-helpers/package.json +1 -1
- package/examples/advanced/matching-build-files/package.json +1 -1
- package/examples/advanced/multi-brand-multi-platform/package.json +1 -1
- 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/tokens-deprecation/package.json +1 -1
- package/examples/advanced/transitive-transforms/package.json +1 -1
- package/examples/advanced/variables-in-outputs/package.json +1 -1
- package/examples/advanced/yaml-tokens/package.json +1 -1
- package/lib/Register.d.ts +12 -12
- package/lib/Register.js +8 -8
- package/lib/StyleDictionary.d.ts +24 -24
- package/lib/StyleDictionary.js +18 -16
- package/lib/cleanActions.d.ts +9 -9
- package/lib/cleanActions.js +4 -4
- package/lib/cleanDir.d.ts +7 -7
- package/lib/cleanDir.js +3 -3
- package/lib/cleanDirs.d.ts +5 -5
- package/lib/cleanDirs.js +2 -2
- package/lib/cleanFile.d.ts +7 -7
- package/lib/cleanFile.js +3 -3
- package/lib/cleanFiles.d.ts +5 -5
- package/lib/cleanFiles.js +2 -2
- package/lib/common/actions.d.ts +3 -3
- package/lib/common/actions.js +3 -3
- package/lib/common/filters.d.ts +1 -1
- package/lib/common/filters.js +1 -1
- package/lib/common/formatHelpers/createPropertyFormatter.d.ts +8 -8
- package/lib/common/formatHelpers/createPropertyFormatter.js +5 -5
- package/lib/common/formatHelpers/fileHeader.d.ts +7 -7
- package/lib/common/formatHelpers/fileHeader.js +4 -4
- package/lib/common/formatHelpers/formattedVariables.d.ts +7 -7
- package/lib/common/formatHelpers/formattedVariables.js +5 -5
- package/lib/common/formatHelpers/getTypeScriptType.d.ts +5 -5
- 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 +2 -2
- package/lib/common/formatHelpers/minifyDictionary.js +1 -1
- package/lib/common/formatHelpers/setComposeObjectProperties.d.ts +2 -2
- package/lib/common/formatHelpers/setComposeObjectProperties.js +1 -1
- package/lib/common/formatHelpers/setSwiftFileProperties.d.ts +2 -2
- package/lib/common/formatHelpers/setSwiftFileProperties.js +1 -1
- package/lib/common/formatHelpers/sortByReference.d.ts +2 -2
- package/lib/common/formatHelpers/sortByReference.js +9 -4
- package/lib/common/formats.d.ts +9 -6
- package/lib/common/formats.js +121 -26
- 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 +3 -3
- package/lib/common/templates/css/fonts.css.template.d.ts +1 -1
- package/lib/common/templates/css/fonts.css.template.js +1 -1
- 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 +3 -3
- package/lib/common/transformGroups.js +2 -2
- package/lib/common/transforms.d.ts +4 -4
- package/lib/common/transforms.js +4 -4
- package/lib/filterTokens.d.ts +6 -6
- package/lib/filterTokens.js +5 -5
- package/lib/fs-node.d.ts +2 -2
- package/lib/fs-node.js +1 -1
- package/lib/fs.d.ts +2 -2
- package/lib/fs.js +1 -1
- package/lib/performActions.d.ts +9 -9
- package/lib/performActions.js +4 -4
- package/lib/resolve.js +2 -1
- package/lib/transform/config.d.ts +4 -4
- package/lib/transform/config.js +4 -4
- package/lib/transform/object.d.ts +15 -15
- package/lib/transform/object.js +7 -7
- package/lib/transform/token.d.ts +13 -13
- package/lib/transform/token.js +6 -6
- 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 +7 -6
- package/lib/utils/convertToBase64.d.ts +5 -5
- package/lib/utils/convertToBase64.js +32 -9
- package/lib/utils/convertToDTCG.d.ts +3 -3
- package/lib/utils/convertToDTCG.js +2 -2
- package/lib/utils/createFormatArgs.d.ts +8 -8
- package/lib/utils/createFormatArgs.js +4 -4
- package/lib/utils/deepExtend.d.ts +4 -4
- package/lib/utils/deepExtend.js +2 -2
- package/lib/utils/expandObjectTokens.d.ts +9 -9
- package/lib/utils/expandObjectTokens.js +7 -7
- package/lib/utils/flattenTokens.d.ts +2 -2
- package/lib/utils/flattenTokens.js +2 -2
- package/lib/utils/index.d.ts +2 -1
- package/lib/utils/index.js +2 -0
- package/lib/utils/isNode.d.ts +1 -0
- package/lib/utils/isNode.js +1 -0
- package/lib/utils/preprocess.d.ts +10 -8
- package/lib/utils/preprocess.js +5 -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 +1 -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 +2 -2
- 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 +5 -2
- package/types/Action.d.ts +3 -3
- package/types/Config.d.ts +8 -8
- package/types/File.d.ts +4 -4
- package/types/Filter.d.ts +2 -2
- package/types/Format.d.ts +3 -3
- package/types/Parser.d.ts +1 -1
- package/types/Preprocessor.d.ts +3 -3
- package/types/Transform.d.ts +4 -4
- package/types/index.d.ts +10 -10
package/lib/Register.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export class Register {
|
|
|
7
7
|
*
|
|
8
8
|
* Therefore, we have to make use of static props vs instance props and use getters and setters to merge these together.
|
|
9
9
|
*/
|
|
10
|
-
static hooks: Required<import("../types/Config.ts").Hooks>;
|
|
10
|
+
static hooks: Required<import("../types/Config.d.ts").Hooks>;
|
|
11
11
|
/**
|
|
12
12
|
* @param {typeof Register | Register} target
|
|
13
13
|
* @param {keyof Hooks} hook
|
|
@@ -101,10 +101,10 @@ export class Register {
|
|
|
101
101
|
/**
|
|
102
102
|
* @param {Required<Hooks>} v
|
|
103
103
|
*/
|
|
104
|
-
set hooks(v: Required<import("../types/Config.ts").Hooks>);
|
|
104
|
+
set hooks(v: Required<import("../types/Config.d.ts").Hooks>);
|
|
105
105
|
/** @type {Required<Hooks>} */
|
|
106
|
-
get hooks(): Required<import("../types/Config.ts").Hooks>;
|
|
107
|
-
_hooks: Required<import("../types/Config.ts").Hooks> | undefined;
|
|
106
|
+
get hooks(): Required<import("../types/Config.d.ts").Hooks>;
|
|
107
|
+
_hooks: Required<import("../types/Config.d.ts").Hooks> | undefined;
|
|
108
108
|
/**
|
|
109
109
|
* @param {Transform} cfg
|
|
110
110
|
*/
|
|
@@ -144,11 +144,11 @@ export class Register {
|
|
|
144
144
|
fileHeader: FileHeader;
|
|
145
145
|
}): void;
|
|
146
146
|
}
|
|
147
|
-
export type FileHeader = import("../types/File.ts").FileHeader;
|
|
148
|
-
export type Parser = import("../types/Parser.ts").Parser;
|
|
149
|
-
export type Preprocessor = import("../types/Preprocessor.ts").Preprocessor;
|
|
150
|
-
export type Transform = import("../types/Transform.ts").Transform;
|
|
151
|
-
export type Filter = import("../types/Filter.ts").Filter;
|
|
152
|
-
export type Format = import("../types/Format.ts").Format;
|
|
153
|
-
export type Action = import("../types/Action.ts").Action;
|
|
154
|
-
export type Hooks = import("../types/Config.ts").Hooks;
|
|
147
|
+
export type FileHeader = import("../types/File.d.ts").FileHeader;
|
|
148
|
+
export type Parser = import("../types/Parser.d.ts").Parser;
|
|
149
|
+
export type Preprocessor = import("../types/Preprocessor.d.ts").Preprocessor;
|
|
150
|
+
export type Transform = import("../types/Transform.d.ts").Transform;
|
|
151
|
+
export type Filter = import("../types/Filter.d.ts").Filter;
|
|
152
|
+
export type Format = import("../types/Format.d.ts").Format;
|
|
153
|
+
export type Action = import("../types/Action.d.ts").Action;
|
|
154
|
+
export type Hooks = import("../types/Config.d.ts").Hooks;
|
package/lib/Register.js
CHANGED
|
@@ -6,14 +6,14 @@ import filterBuiltins from './common/filters.js';
|
|
|
6
6
|
import { deepmerge } from './utils/deepmerge.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* @typedef {import('../types/File.ts').FileHeader} FileHeader
|
|
10
|
-
* @typedef {import('../types/Parser.ts').Parser} Parser
|
|
11
|
-
* @typedef {import('../types/Preprocessor.ts').Preprocessor} Preprocessor
|
|
12
|
-
* @typedef {import('../types/Transform.ts').Transform} Transform
|
|
13
|
-
* @typedef {import('../types/Filter.ts').Filter} Filter
|
|
14
|
-
* @typedef {import('../types/Format.ts').Format} Format
|
|
15
|
-
* @typedef {import('../types/Action.ts').Action} Action
|
|
16
|
-
* @typedef {import('../types/Config.ts').Hooks} Hooks
|
|
9
|
+
* @typedef {import('../types/File.d.ts').FileHeader} FileHeader
|
|
10
|
+
* @typedef {import('../types/Parser.d.ts').Parser} Parser
|
|
11
|
+
* @typedef {import('../types/Preprocessor.d.ts').Preprocessor} Preprocessor
|
|
12
|
+
* @typedef {import('../types/Transform.d.ts').Transform} Transform
|
|
13
|
+
* @typedef {import('../types/Filter.d.ts').Filter} Filter
|
|
14
|
+
* @typedef {import('../types/Format.d.ts').Format} Format
|
|
15
|
+
* @typedef {import('../types/Action.d.ts').Action} Action
|
|
16
|
+
* @typedef {import('../types/Config.d.ts').Hooks} Hooks
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
/**
|
package/lib/StyleDictionary.d.ts
CHANGED
|
@@ -27,11 +27,11 @@ export default class StyleDictionary extends Register {
|
|
|
27
27
|
volume?: Volume;
|
|
28
28
|
});
|
|
29
29
|
/** @param {Config} v */
|
|
30
|
-
set options(v: import("../types/Config.ts").Config);
|
|
30
|
+
set options(v: import("../types/Config.d.ts").Config);
|
|
31
31
|
/** @returns {Config} */
|
|
32
|
-
get options(): import("../types/Config.ts").Config;
|
|
33
|
-
_options: import("../types/Config.ts").Config | undefined;
|
|
34
|
-
config: string | import("../types/Config.ts").Config;
|
|
32
|
+
get options(): import("../types/Config.d.ts").Config;
|
|
33
|
+
_options: import("../types/Config.d.ts").Config | undefined;
|
|
34
|
+
config: string | import("../types/Config.d.ts").Config;
|
|
35
35
|
/** @type {PreprocessedTokens} */
|
|
36
36
|
tokens: PreprocessedTokens;
|
|
37
37
|
/** @type {PreprocessedTokens[]} */
|
|
@@ -90,7 +90,7 @@ export default class StyleDictionary extends Register {
|
|
|
90
90
|
* }} [opts]
|
|
91
91
|
* @returns {Promise<StyleDictionary>}
|
|
92
92
|
*/
|
|
93
|
-
extend(config?: string | import("../types/Config.ts").Config | undefined, opts?: {
|
|
93
|
+
extend(config?: string | import("../types/Config.d.ts").Config | undefined, opts?: {
|
|
94
94
|
mutateOriginal?: boolean;
|
|
95
95
|
verbosity?: LogConfig["verbosity"];
|
|
96
96
|
warnings?: LogConfig["warnings"];
|
|
@@ -100,21 +100,21 @@ export default class StyleDictionary extends Register {
|
|
|
100
100
|
* @param {ExpandConfig} [expandCfg]
|
|
101
101
|
* @returns
|
|
102
102
|
*/
|
|
103
|
-
shouldRunExpansion(expandCfg?: import("../types/Config.ts").ExpandConfig | undefined): boolean;
|
|
103
|
+
shouldRunExpansion(expandCfg?: import("../types/Config.d.ts").ExpandConfig | undefined): boolean;
|
|
104
104
|
/**
|
|
105
105
|
* @param {string} platform
|
|
106
106
|
* @param {{ cache?: boolean }} [opts]
|
|
107
107
|
*/
|
|
108
108
|
getPlatformConfig(platform: string, opts?: {
|
|
109
109
|
cache?: boolean;
|
|
110
|
-
} | undefined): import("../types/Config.ts").PlatformConfig;
|
|
110
|
+
} | undefined): import("../types/Config.d.ts").PlatformConfig;
|
|
111
111
|
/**
|
|
112
112
|
* @param {string} platform
|
|
113
113
|
* @param {{ cache?: boolean }} [opts]
|
|
114
114
|
*/
|
|
115
115
|
getPlatformTokens(platform: string, opts?: {
|
|
116
116
|
cache?: boolean;
|
|
117
|
-
} | undefined): Promise<import("../types/DesignToken.ts").Dictionary>;
|
|
117
|
+
} | undefined): Promise<import("../types/DesignToken.d.ts").Dictionary>;
|
|
118
118
|
/**
|
|
119
119
|
* Public wrapper around _exportPlatform, returns only tokens object
|
|
120
120
|
* Here for backwards compatibility.
|
|
@@ -143,8 +143,8 @@ export default class StyleDictionary extends Register {
|
|
|
143
143
|
getPlatform(platform: string, opts?: {
|
|
144
144
|
cache?: boolean;
|
|
145
145
|
} | undefined): Promise<{
|
|
146
|
-
dictionary: import("../types/DesignToken.ts").Dictionary;
|
|
147
|
-
platformConfig: import("../types/Config.ts").PlatformConfig;
|
|
146
|
+
dictionary: import("../types/DesignToken.d.ts").Dictionary;
|
|
147
|
+
platformConfig: import("../types/Config.d.ts").PlatformConfig;
|
|
148
148
|
}>;
|
|
149
149
|
/**
|
|
150
150
|
* Runs the format step and collects logs
|
|
@@ -215,18 +215,18 @@ export default class StyleDictionary extends Register {
|
|
|
215
215
|
cache?: boolean;
|
|
216
216
|
} | undefined): Promise<this>;
|
|
217
217
|
}
|
|
218
|
-
export type Volume = import("../types/Volume.ts").Volume;
|
|
219
|
-
export type Config = import("../types/Config.ts").Config;
|
|
220
|
-
export type PlatformConfig = import("../types/Config.ts").PlatformConfig;
|
|
221
|
-
export type LogConfig = import("../types/Config.ts").LogConfig;
|
|
222
|
-
export type Expand = import("../types/Config.ts").Expand;
|
|
223
|
-
export type ExpandConfig = import("../types/Config.ts").ExpandConfig;
|
|
224
|
-
export type File = import("../types/File.ts").File;
|
|
225
|
-
export type Filter = import("../types/Filter.ts").Filter;
|
|
226
|
-
export type Token = import("../types/DesignToken.ts").DesignToken;
|
|
227
|
-
export type TransformedToken = import("../types/DesignToken.ts").TransformedToken;
|
|
228
|
-
export type Tokens = import("../types/DesignToken.ts").DesignTokens;
|
|
229
|
-
export type PreprocessedTokens = import("../types/DesignToken.ts").PreprocessedTokens;
|
|
230
|
-
export type TransformedTokens = import("../types/DesignToken.ts").TransformedTokens;
|
|
231
|
-
export type Dictionary = import("../types/DesignToken.ts").Dictionary;
|
|
218
|
+
export type Volume = import("../types/Volume.d.ts").Volume;
|
|
219
|
+
export type Config = import("../types/Config.d.ts").Config;
|
|
220
|
+
export type PlatformConfig = import("../types/Config.d.ts").PlatformConfig;
|
|
221
|
+
export type LogConfig = import("../types/Config.d.ts").LogConfig;
|
|
222
|
+
export type Expand = import("../types/Config.d.ts").Expand;
|
|
223
|
+
export type ExpandConfig = import("../types/Config.d.ts").ExpandConfig;
|
|
224
|
+
export type File = import("../types/File.d.ts").File;
|
|
225
|
+
export type Filter = import("../types/Filter.d.ts").Filter;
|
|
226
|
+
export type Token = import("../types/DesignToken.d.ts").DesignToken;
|
|
227
|
+
export type TransformedToken = import("../types/DesignToken.d.ts").TransformedToken;
|
|
228
|
+
export type Tokens = import("../types/DesignToken.d.ts").DesignTokens;
|
|
229
|
+
export type PreprocessedTokens = import("../types/DesignToken.d.ts").PreprocessedTokens;
|
|
230
|
+
export type TransformedTokens = import("../types/DesignToken.d.ts").TransformedTokens;
|
|
231
|
+
export type Dictionary = import("../types/DesignToken.d.ts").Dictionary;
|
|
232
232
|
import { Register } from './Register.js';
|
package/lib/StyleDictionary.js
CHANGED
|
@@ -39,22 +39,23 @@ import filterTokens from './filterTokens.js';
|
|
|
39
39
|
import cleanFiles from './cleanFiles.js';
|
|
40
40
|
import cleanDirs from './cleanDirs.js';
|
|
41
41
|
import cleanActions from './cleanActions.js';
|
|
42
|
+
import { isNode } from './utils/isNode.js';
|
|
42
43
|
|
|
43
44
|
/**
|
|
44
|
-
* @typedef {import('../types/Volume.ts').Volume} Volume
|
|
45
|
-
* @typedef {import('../types/Config.ts').Config} Config
|
|
46
|
-
* @typedef {import('../types/Config.ts').PlatformConfig} PlatformConfig
|
|
47
|
-
* @typedef {import('../types/Config.ts').LogConfig} LogConfig
|
|
48
|
-
* @typedef {import('../types/Config.ts').Expand} Expand
|
|
49
|
-
* @typedef {import('../types/Config.ts').ExpandConfig} ExpandConfig
|
|
50
|
-
* @typedef {import('../types/File.ts').File} File
|
|
51
|
-
* @typedef {import('../types/Filter.ts').Filter} Filter
|
|
52
|
-
* @typedef {import('../types/DesignToken.ts').DesignToken} Token
|
|
53
|
-
* @typedef {import('../types/DesignToken.ts').TransformedToken} TransformedToken
|
|
54
|
-
* @typedef {import('../types/DesignToken.ts').DesignTokens} Tokens
|
|
55
|
-
* @typedef {import('../types/DesignToken.ts').PreprocessedTokens} PreprocessedTokens
|
|
56
|
-
* @typedef {import('../types/DesignToken.ts').TransformedTokens} TransformedTokens
|
|
57
|
-
* @typedef {import('../types/DesignToken.ts').Dictionary} Dictionary
|
|
45
|
+
* @typedef {import('../types/Volume.d.ts').Volume} Volume
|
|
46
|
+
* @typedef {import('../types/Config.d.ts').Config} Config
|
|
47
|
+
* @typedef {import('../types/Config.d.ts').PlatformConfig} PlatformConfig
|
|
48
|
+
* @typedef {import('../types/Config.d.ts').LogConfig} LogConfig
|
|
49
|
+
* @typedef {import('../types/Config.d.ts').Expand} Expand
|
|
50
|
+
* @typedef {import('../types/Config.d.ts').ExpandConfig} ExpandConfig
|
|
51
|
+
* @typedef {import('../types/File.d.ts').File} File
|
|
52
|
+
* @typedef {import('../types/Filter.d.ts').Filter} Filter
|
|
53
|
+
* @typedef {import('../types/DesignToken.d.ts').DesignToken} Token
|
|
54
|
+
* @typedef {import('../types/DesignToken.d.ts').TransformedToken} TransformedToken
|
|
55
|
+
* @typedef {import('../types/DesignToken.d.ts').DesignTokens} Tokens
|
|
56
|
+
* @typedef {import('../types/DesignToken.d.ts').PreprocessedTokens} PreprocessedTokens
|
|
57
|
+
* @typedef {import('../types/DesignToken.d.ts').TransformedTokens} TransformedTokens
|
|
58
|
+
* @typedef {import('../types/DesignToken.d.ts').Dictionary} Dictionary
|
|
58
59
|
*/
|
|
59
60
|
|
|
60
61
|
const PROPERTY_VALUE_COLLISIONS = GroupMessages.GROUP.PropertyValueCollisions;
|
|
@@ -78,7 +79,7 @@ export default class StyleDictionary extends Register {
|
|
|
78
79
|
// Placeholder is transformed on prepublish -> see scripts/inject-version.js
|
|
79
80
|
// Another option might be import pkg from './package.json' with { "type": "json" } which would work in both browser and node, but support is not there yet.
|
|
80
81
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#browser_compatibility
|
|
81
|
-
static VERSION = '4.
|
|
82
|
+
static VERSION = '4.2.0';
|
|
82
83
|
|
|
83
84
|
/** @returns {Config} */
|
|
84
85
|
get options() {
|
|
@@ -227,7 +228,7 @@ export default class StyleDictionary extends Register {
|
|
|
227
228
|
);
|
|
228
229
|
} else {
|
|
229
230
|
let _filePath = cfgFilePath;
|
|
230
|
-
if (
|
|
231
|
+
if (isNode && process?.platform === 'win32') {
|
|
231
232
|
// Windows FS compatibility. If in browser, we use an FS shim which doesn't require this Windows workaround
|
|
232
233
|
_filePath = new URL(`file:///${_filePath}`).href;
|
|
233
234
|
}
|
|
@@ -442,6 +443,7 @@ export default class StyleDictionary extends Register {
|
|
|
442
443
|
platformProcessedTokens,
|
|
443
444
|
platformConfig.preprocessors,
|
|
444
445
|
this.hooks.preprocessors,
|
|
446
|
+
platformConfig,
|
|
445
447
|
);
|
|
446
448
|
if (this.shouldRunExpansion(platformConfig.expand)) {
|
|
447
449
|
platformProcessedTokens = expandTokens(platformProcessedTokens, this.options, platformConfig);
|
package/lib/cleanActions.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 the undo of any actions defined in a platform. Pretty
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
* @param {Config} options
|
|
17
17
|
* @param {Volume} [vol]
|
|
18
18
|
*/
|
|
19
|
-
export default function cleanActions(dictionary: Dictionary, platform: PlatformConfig, options: Config, vol?: import("../types/Volume.ts").Volume | undefined): Promise<void[] | undefined>;
|
|
20
|
-
export type Volume = import("../types/Volume.ts").Volume;
|
|
21
|
-
export type Dictionary = import("../types/DesignToken.ts").Dictionary;
|
|
22
|
-
export type PlatformConfig = import("../types/Config.ts").PlatformConfig;
|
|
23
|
-
export type Config = import("../types/Config.ts").Config;
|
|
19
|
+
export default function cleanActions(dictionary: Dictionary, platform: PlatformConfig, options: Config, vol?: import("../types/Volume.d.ts").Volume | undefined): Promise<void[] | undefined>;
|
|
20
|
+
export type Volume = import("../types/Volume.d.ts").Volume;
|
|
21
|
+
export type Dictionary = import("../types/DesignToken.d.ts").Dictionary;
|
|
22
|
+
export type PlatformConfig = import("../types/Config.d.ts").PlatformConfig;
|
|
23
|
+
export type Config = import("../types/Config.d.ts").Config;
|
package/lib/cleanActions.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/cleanDir.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {import('../types/Volume.ts').Volume} Volume
|
|
3
|
-
* @typedef {import('../types/Config.ts').PlatformConfig} Config
|
|
4
|
-
* @typedef {import('../types/File.ts').File} File
|
|
2
|
+
* @typedef {import('../types/Volume.d.ts').Volume} Volume
|
|
3
|
+
* @typedef {import('../types/Config.d.ts').PlatformConfig} Config
|
|
4
|
+
* @typedef {import('../types/File.d.ts').File} File
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
7
|
* Takes the style property object and a format and returns a
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* @param {Config} [platform]
|
|
12
12
|
* @param {Volume} [vol]
|
|
13
13
|
*/
|
|
14
|
-
export default function cleanDir(file: File, platform?: import("../types/Config.ts").PlatformConfig | undefined, vol?: import("../types/Volume.ts").Volume | undefined): Promise<void>;
|
|
15
|
-
export type Volume = import("../types/Volume.ts").Volume;
|
|
16
|
-
export type Config = import("../types/Config.ts").PlatformConfig;
|
|
17
|
-
export type File = import("../types/File.ts").File;
|
|
14
|
+
export default function cleanDir(file: File, platform?: import("../types/Config.d.ts").PlatformConfig | undefined, vol?: import("../types/Volume.d.ts").Volume | undefined): Promise<void>;
|
|
15
|
+
export type Volume = import("../types/Volume.d.ts").Volume;
|
|
16
|
+
export type Config = import("../types/Config.d.ts").PlatformConfig;
|
|
17
|
+
export type File = import("../types/File.d.ts").File;
|
package/lib/cleanDir.js
CHANGED
|
@@ -16,9 +16,9 @@ import { dirname } from 'path-unified';
|
|
|
16
16
|
import { fs } from 'style-dictionary/fs';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* @typedef {import('../types/Volume.ts').Volume} Volume
|
|
20
|
-
* @typedef {import('../types/Config.ts').PlatformConfig} Config
|
|
21
|
-
* @typedef {import('../types/File.ts').File} File
|
|
19
|
+
* @typedef {import('../types/Volume.d.ts').Volume} Volume
|
|
20
|
+
* @typedef {import('../types/Config.d.ts').PlatformConfig} Config
|
|
21
|
+
* @typedef {import('../types/File.d.ts').File} File
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
/**
|
package/lib/cleanDirs.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {import('../types/Volume.ts').Volume} Volume
|
|
3
|
-
* @typedef {import('../types/Config.ts').PlatformConfig} Config
|
|
2
|
+
* @typedef {import('../types/Volume.d.ts').Volume} Volume
|
|
3
|
+
* @typedef {import('../types/Config.d.ts').PlatformConfig} Config
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* Takes a platform config object and a tokens
|
|
@@ -11,6 +11,6 @@
|
|
|
11
11
|
* @param {Config} platform
|
|
12
12
|
* @param {Volume} [vol]
|
|
13
13
|
*/
|
|
14
|
-
export default function cleanDirs(platform: Config, vol?: import("../types/Volume.ts").Volume | undefined): Promise<void[] | undefined>;
|
|
15
|
-
export type Volume = import("../types/Volume.ts").Volume;
|
|
16
|
-
export type Config = import("../types/Config.ts").PlatformConfig;
|
|
14
|
+
export default function cleanDirs(platform: Config, vol?: import("../types/Volume.d.ts").Volume | undefined): Promise<void[] | undefined>;
|
|
15
|
+
export type Volume = import("../types/Volume.d.ts").Volume;
|
|
16
|
+
export type Config = import("../types/Config.d.ts").PlatformConfig;
|
package/lib/cleanDirs.js
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
import cleanDir from './cleanDir.js';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* @typedef {import('../types/Volume.ts').Volume} Volume
|
|
18
|
-
* @typedef {import('../types/Config.ts').PlatformConfig} Config
|
|
17
|
+
* @typedef {import('../types/Volume.d.ts').Volume} Volume
|
|
18
|
+
* @typedef {import('../types/Config.d.ts').PlatformConfig} Config
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
/**
|
package/lib/cleanFile.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {import('../types/Volume.ts').Volume} Volume
|
|
3
|
-
* @typedef {import('../types/File.ts').File} File
|
|
4
|
-
* @typedef {import('../types/Config.ts').PlatformConfig} PlatformConfig
|
|
2
|
+
* @typedef {import('../types/Volume.d.ts').Volume} Volume
|
|
3
|
+
* @typedef {import('../types/File.d.ts').File} File
|
|
4
|
+
* @typedef {import('../types/Config.d.ts').PlatformConfig} PlatformConfig
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
7
|
* Takes the style property object and a format and returns a
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* @param {PlatformConfig} [platform]
|
|
12
12
|
* @param {Volume} [vol]
|
|
13
13
|
*/
|
|
14
|
-
export default function cleanFile(file: File, platform?: import("../types/Config.ts").PlatformConfig | undefined, vol?: import("../types/Volume.ts").Volume | undefined): Promise<Record<"warning" | "success", string[]>>;
|
|
15
|
-
export type Volume = import("../types/Volume.ts").Volume;
|
|
16
|
-
export type File = import("../types/File.ts").File;
|
|
17
|
-
export type PlatformConfig = import("../types/Config.ts").PlatformConfig;
|
|
14
|
+
export default function cleanFile(file: File, platform?: import("../types/Config.d.ts").PlatformConfig | undefined, vol?: import("../types/Volume.d.ts").Volume | undefined): Promise<Record<"warning" | "success", string[]>>;
|
|
15
|
+
export type Volume = import("../types/Volume.d.ts").Volume;
|
|
16
|
+
export type File = import("../types/File.d.ts").File;
|
|
17
|
+
export type PlatformConfig = import("../types/Config.d.ts").PlatformConfig;
|
package/lib/cleanFile.js
CHANGED
|
@@ -15,9 +15,9 @@ import chalk from 'chalk';
|
|
|
15
15
|
import { fs } from 'style-dictionary/fs';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* @typedef {import('../types/Volume.ts').Volume} Volume
|
|
19
|
-
* @typedef {import('../types/File.ts').File} File
|
|
20
|
-
* @typedef {import('../types/Config.ts').PlatformConfig} PlatformConfig
|
|
18
|
+
* @typedef {import('../types/Volume.d.ts').Volume} Volume
|
|
19
|
+
* @typedef {import('../types/File.d.ts').File} File
|
|
20
|
+
* @typedef {import('../types/Config.d.ts').PlatformConfig} PlatformConfig
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
/**
|
package/lib/cleanFiles.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {import('../types/Volume.ts').Volume} Volume
|
|
3
|
-
* @typedef {import('../types/Config.ts').PlatformConfig} PlatformConfig
|
|
2
|
+
* @typedef {import('../types/Volume.d.ts').Volume} Volume
|
|
3
|
+
* @typedef {import('../types/Config.d.ts').PlatformConfig} PlatformConfig
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* Takes a platform config object and a dictionary
|
|
@@ -11,6 +11,6 @@
|
|
|
11
11
|
* @param {PlatformConfig} platform
|
|
12
12
|
* @param {Volume} [vol]
|
|
13
13
|
*/
|
|
14
|
-
export default function cleanFiles(platform: PlatformConfig, vol?: import("../types/Volume.ts").Volume | undefined): Promise<Record<"warning" | "success", string[]>[] | undefined>;
|
|
15
|
-
export type Volume = import("../types/Volume.ts").Volume;
|
|
16
|
-
export type PlatformConfig = import("../types/Config.ts").PlatformConfig;
|
|
14
|
+
export default function cleanFiles(platform: PlatformConfig, vol?: import("../types/Volume.d.ts").Volume | undefined): Promise<Record<"warning" | "success", string[]>[] | undefined>;
|
|
15
|
+
export type Volume = import("../types/Volume.d.ts").Volume;
|
|
16
|
+
export type PlatformConfig = import("../types/Config.d.ts").PlatformConfig;
|
package/lib/cleanFiles.js
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
import cleanFile from './cleanFile.js';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* @typedef {import('../types/Volume.ts').Volume} Volume
|
|
18
|
-
* @typedef {import('../types/Config.ts').PlatformConfig} PlatformConfig
|
|
17
|
+
* @typedef {import('../types/Volume.d.ts').Volume} Volume
|
|
18
|
+
* @typedef {import('../types/Config.d.ts').PlatformConfig} PlatformConfig
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
/**
|
package/lib/common/actions.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: Record<string, Omit<Action, "name">>;
|
|
2
2
|
export default _default;
|
|
3
|
-
export type Dictionary = import("../../types/DesignToken.ts").Dictionary;
|
|
4
|
-
export type Action = import("../../types/Action.ts").Action;
|
|
3
|
+
export type Dictionary = import("../../types/DesignToken.d.ts").Dictionary;
|
|
4
|
+
export type Action = import("../../types/Action.d.ts").Action;
|
|
5
5
|
export type Config = import("../../types/Config.js").PlatformConfig;
|
|
6
|
-
export type Token = import("../../types/DesignToken.ts").TransformedToken;
|
|
6
|
+
export type Token = import("../../types/DesignToken.d.ts").TransformedToken;
|
package/lib/common/actions.js
CHANGED
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
import { fs } from 'style-dictionary/fs';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* @typedef {import('../../types/DesignToken.ts').Dictionary} Dictionary
|
|
18
|
-
* @typedef {import('../../types/Action.ts').Action} Action
|
|
17
|
+
* @typedef {import('../../types/DesignToken.d.ts').Dictionary} Dictionary
|
|
18
|
+
* @typedef {import('../../types/Action.d.ts').Action} Action
|
|
19
19
|
* @typedef {import('../../types/Config.js').PlatformConfig} Config
|
|
20
|
-
* @typedef {import('../../types/DesignToken.ts').TransformedToken} Token
|
|
20
|
+
* @typedef {import('../../types/DesignToken.d.ts').TransformedToken} Token
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
/**
|
package/lib/common/filters.d.ts
CHANGED