@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muonic/muon",
3
- "version": "0.0.2-experimental-175-121b4aa.0",
3
+ "version": "0.0.2-experimental-176-bef4daf.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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: function ({ dictionary, file }) {
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
- module.exports = {
2
- name: 'json/reference',
3
- formatter: function ({ dictionary }) {
4
- const tokens = dictionary.allTokens.map((token) => {
5
- token.usesReference = dictionary.usesReference(token.original.value);
6
- if (token.usesReference) {
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
- token.nestedName = token.path.join('.').toLowerCase();
8
+ token.nestedName = token.path.join('.').toLowerCase();
11
9
 
12
- return token;
13
- });
10
+ return token;
11
+ });
12
+
13
+ return JSON.stringify(tokens, null, 2);
14
+ };
14
15
 
15
- return JSON.stringify(tokens, null, 2);
16
- }
16
+ formatter.nested = true;
17
+
18
+ module.exports = {
19
+ name: 'json/reference',
20
+ formatter
17
21
  };