constyble
constyble copied to clipboard
Add command to initialize a new config
Be able to let Constyle generate a new .constyblerc file based on CSS that is provided. This should make getting started a lot easier.
constyble init style.css
# or
cat style.css | constyble init
Should generate a .constyblerc
file in the current working directory based on the css statistics of the passed CSS.
# Generating a custom file path config
constyble init style.css --config='/path/to/constyle.json'
# or
cat style.css | constyble init --config='/path/to/constyle.json'
To be discussed
- What to do when file cannot be written?
- What to when file already exists?
- Should we implement
constyble init --help
, displaying an init oriented help message?
Idea credit: @jeroen-severein
@jeroen-severein Could you chime in and give some thoughts on the above?
In case it can’t be written I would expect it to exit with a “can’t write to output file”-error.
If it already exists, I would expect a “overwrite yes or no?” prompt.
What would the init specific help need to explain further? I feel it would be enough if the init option is explained in the general constyble --help option. It would be nice to have explanations in comments of the settings file it generates though.
It could be useful to replace Meow with Sade, to gain support for subcommands (meow lacks them): https://www.npmjs.com/package/sade