Needed for writing to .toml files in a way to preserve comments. (hacky regex *might work to start)
I would love to delegate this to a library if we can find one that supports parsing and serializing comments.
If you can find one. That would be legit =)
I couldn't find anything out there last time I checked
No AST parser exists in the wild. We will likely have to bake our own.
Here is a md AST parser that might help get the ball rolling https://github.com/leebyron/spec-md/tree/7c4f3ca2012e0b8d07e79ff370b9230f9323b8be/src
Maybe these toml pegjs refs will help:
We need an AST parser to programatically write to toml files for improve DX
@phae @DavidWells I've been learning Rust, which can interface into NodeJS.
Rust has a fantastic project for preserving toml while editing. It's used in a project for cargo.
https://crates.io/crates/toml_edit
I could give it a swing to take that crate and make it compatible with NodeJS.
Sounds good to me.
On Fri, Jul 26, 2019 at 4:03 AM jschatz1 notifications@github.com wrote:
@phae https://github.com/phae @DavidWells
https://github.com/DavidWells I've been learning Rust, which can
interface into NodeJS.
Rust has a fantastic project for preserving toml while editing. It's used
in a project for cargo.
https://crates.io/crates/toml_editI could give it a swing to take that crate and make it compatible with
NodeJS.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/netlify/cli/issues/223?email_source=notifications&email_token=AAEB6MGZMIHUHD25XBJBIK3QBLKYHA5CNFSM4GTMB5JKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD24IY7Q#issuecomment-515411070,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEB6MHY4ZUIM34KVGDF2TDQBLKYHANCNFSM4GTMB5JA
.>
I recently found @toml-tools/parser which preserves all of the comments and existing structure of the TOML file. After tinkering with it for a while, I think it will be almost perfect for our use-case since it is
I recommend using this.
Most helpful comment
I recently found @toml-tools/parser which preserves all of the comments and existing structure of the TOML file. After tinkering with it for a while, I think it will be almost perfect for our use-case since it is
I recommend using this.