Skip to content
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

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

Open
kevinschaich opened this issue Jul 2, 2020 · 3 comments
Open

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

kevinschaich opened this issue Jul 2, 2020 · 3 comments
Labels
Help Wanted Extra attention is needed

Comments

@kevinschaich
Copy link
Owner

kevinschaich commented Jul 2, 2020

  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 kevinschaich added the Bug: v2.0.0 Beta Bugs found in the v2.0.0 Pre-release beta label Jul 3, 2020
@kevinschaich
Copy link
Owner Author

kevinschaich commented Jul 8, 2020

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 kevinschaich added Help Wanted Extra attention is needed and removed Bug: v2.0.0 Beta Bugs found in the v2.0.0 Pre-release beta labels Jul 8, 2020
@user1278654
Copy link

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

@kevinschaich
Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants