-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(formats): add support for Microsoft's JSONC format (#732)
Resolves #698
- Loading branch information
1 parent
65453e0
commit cfa83cb
Showing
13 changed files
with
152 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
{ | ||
// some comment | ||
"source": ["test/properties/**/*.json"], | ||
"platforms": { | ||
"web": { | ||
"transformGroup": "web", | ||
"prefix": "smop", | ||
"buildPath": "test/output/web/", | ||
"files": [ | ||
{ | ||
"destination": "_icons.css", | ||
"format": "scss/icons" | ||
}, | ||
{ | ||
"destination": "_variables.css", | ||
"format": "scss/variables" | ||
}, | ||
{ | ||
"destination": "_styles.js", | ||
"format": "javascript/module" | ||
} | ||
] | ||
}, | ||
"scss": { | ||
"transformGroup": "scss", | ||
"prefix": "smop", | ||
"buildPath": "test/output/scss/", | ||
"files": [ | ||
{ | ||
"destination": "_icons.scss", | ||
"format": "scss/icons" | ||
}, | ||
{ | ||
"destination": "_variables.scss", | ||
"format": "scss/variables" | ||
} | ||
] | ||
}, | ||
"less": { | ||
"transformGroup": "less", | ||
"prefix": "smop", | ||
"buildPath": "test/output/less/", | ||
"files": [ | ||
{ | ||
"destination": "_icons.less", | ||
"format": "less/icons" | ||
}, | ||
{ | ||
"destination": "_variables.less", | ||
"format": "less/variables" | ||
} | ||
] | ||
}, | ||
"android": { | ||
"transformGroup": "android", | ||
"buildPath": "test/output/", | ||
"files": [ | ||
{ | ||
"destination": "android/colors.xml", | ||
"template": "android/colors" | ||
}, | ||
{ | ||
"destination": "android/font_dimen.xml", | ||
"template": "android/fontDimens" | ||
}, | ||
{ | ||
"destination": "android/dimens.xml", | ||
"template": "android/dimens" | ||
} | ||
], | ||
"actions": ["android/copyImages"] | ||
}, | ||
"ios": { | ||
"transformGroup": "ios", | ||
"buildPath": "test/output/ios/", | ||
"files": [ | ||
{ | ||
"destination": "style_dictionary.plist", | ||
"template": "ios/plist" | ||
}, | ||
{ | ||
"destination": "style_dictionary.h", | ||
"template": "ios/macros" | ||
} | ||
] | ||
}, | ||
"react-native": { | ||
"transformGroup": "react-native", | ||
"buildPath": "__tests__/__output/react-native/", | ||
"files": [ | ||
{ | ||
"destination": "style_dictionary.js", | ||
"format": "javascript/es6" | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"jsonCA": 5, | ||
// some comment | ||
"d": { | ||
"jsonCe": 1 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const fs = require("fs"); | ||
const jsonc = require("jsonc-parser"); | ||
|
||
module.exports = { | ||
register(module, filename) { | ||
const content = fs.readFileSync(filename, "utf8"); | ||
try { | ||
module.exports = jsonc.parse(content); | ||
} catch (err) { | ||
err.message = filename + ": " + err.message; | ||
throw err; | ||
} | ||
}, | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters