@muonic/muon 0.0.2-experimental-175-121b4aa.0 → 0.0.2-experimental-176-bef4daf.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/package.json +1 -1
- package/scripts/utils/index.mjs +11 -5
- package/tokens/utils/formats/reference.js +17 -13
package/package.json
CHANGED
package/scripts/utils/index.mjs
CHANGED
|
@@ -230,18 +230,24 @@ const styleDictionary = async () => {
|
|
|
230
230
|
|
|
231
231
|
styleDict.registerFormat(jsonReference);
|
|
232
232
|
|
|
233
|
+
cssFontTemplate.nested = true;
|
|
234
|
+
|
|
233
235
|
styleDict.registerFormat({
|
|
234
236
|
name: 'css/fonts',
|
|
235
237
|
formatter: cssFontTemplate
|
|
236
238
|
});
|
|
237
239
|
|
|
240
|
+
const es6Formatter = function ({ dictionary, file }) {
|
|
241
|
+
return formatHelpers.fileHeader({ file }) +
|
|
242
|
+
'export default ' +
|
|
243
|
+
JSON.stringify(dictionary.tokens, null, 2) + ';';
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
es6Formatter.nested = true;
|
|
247
|
+
|
|
238
248
|
styleDict.registerFormat({
|
|
239
249
|
name: 'es6/module',
|
|
240
|
-
formatter:
|
|
241
|
-
return formatHelpers.fileHeader({ file }) +
|
|
242
|
-
'export default ' +
|
|
243
|
-
JSON.stringify(dictionary.tokens, null, 2) + ';';
|
|
244
|
-
}
|
|
250
|
+
formatter: es6Formatter
|
|
245
251
|
});
|
|
246
252
|
|
|
247
253
|
styleDict.registerTransform(stringTransform);
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
token.
|
|
6
|
-
|
|
7
|
-
token.references = dictionary.getReferences(token.original.value);
|
|
8
|
-
}
|
|
1
|
+
const formatter = function ({ dictionary }) {
|
|
2
|
+
const tokens = dictionary.allTokens.map((token) => {
|
|
3
|
+
token.usesReference = dictionary.usesReference(token.original.value);
|
|
4
|
+
if (token.usesReference) {
|
|
5
|
+
token.references = dictionary.getReferences(token.original.value);
|
|
6
|
+
}
|
|
9
7
|
|
|
10
|
-
|
|
8
|
+
token.nestedName = token.path.join('.').toLowerCase();
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
return token;
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
return JSON.stringify(tokens, null, 2);
|
|
14
|
+
};
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
formatter.nested = true;
|
|
17
|
+
|
|
18
|
+
module.exports = {
|
|
19
|
+
name: 'json/reference',
|
|
20
|
+
formatter
|
|
17
21
|
};
|