-
Notifications
You must be signed in to change notification settings - Fork 576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unclear doc about javascript configuration with CLI tool #238
Comments
Good catch. We added javascript module support for config files and didn't update all of the documentation. If you would like, feel free to open a PR to update the documentation. P.S. Nice use of npx! |
@dbanksdesign, I would like to, but I need some context : By default, will style-dictionary look for either a config.js or config.json file ? I would love to update the doc, but I don't want to dive too deep into the code right now. I have limited available time. :) |
No worries! I can also update the documentation if I get some time this week. By default the style dictionary CLI will only look for config.json: Although, I feel like it would make sense to look for both config.js and config.json by default, so maybe we should change that... And javascript object is supported by both CLI and NPM. Really the CLI is a pretty basic wrapper around the NPM module. The NPM module accepts a string, which can be a path to anything that const StyleDictionary = require('style-dictionary').extend({
source: ['properties/*.json'],
platforms: {
scss: {
transformGroup: 'scss',
buildPath: 'build/',
files: [{
destination: 'variables.scss',
format: 'scss/variables'
}]
}
// ...
}
}); |
@dbanksdesign thank's |
Created a PR, #247 |
…tion (#249) feat(config): use config.js if config.json is not found; updating documentation Added functionality to search / use 'config.js' in root if 'config.json' is not found in root. Modified documentation to ensure clarity around using JS based config with the CLI. fix: #238 docs: #238 replaces #247 to be from master branch instead of develop
The doc is a bit unclear about the ability to use javascript file instead of JSON with CLI tool.
reading the doc, it imply that we may only use JS config with the nom module.
but in fact, using JS file seem to work properly using cli tool as well. Here my CLI command :
The text was updated successfully, but these errors were encountered: