mintable icon indicating copy to clipboard operation
mintable copied to clipboard

Bug: v2.0.0 Beta - Any writes to JSON config clear comments

Open kevinschaich opened this issue 3 years ago • 3 comments

  1. Add a comment to your mintable.jsonc:

    {
        ...
        // my comment
        property: [...],
        ....
    }
    
  2. Run mintable account-setup and add an account

  3. Comments get removed because the setup framework was not ever aware they existed (jsonc.parse() effectively strips them when parsing a jsonc file with comments):

    {
        ...
        property: [...],
        ....
    }
    

kevinschaich avatar Jul 02 '20 22:07 kevinschaich

Pushed 15cd1ce to use jsonc.stringify instead of JSON.stringify but this is still broken & not sure really how to fix it.

Will keep jsonc as the file extension since I think it would still be valuable to support comments once you get your mintable setup done – it's also less likely any automated writes to the config file will happen after this point.

kevinschaich avatar Jul 08 '20 15:07 kevinschaich

You could try something like this project: https://github.com/kaelzhang/node-comment-json

user1278654 avatar Jul 09 '20 11:07 user1278654

Thanks for the suggestion @user1278654 – definitely will check that out!

kevinschaich avatar Jul 09 '20 18:07 kevinschaich