4 ms·
I like it. Env variables should be a solved problem but no one has made the simplest general solution yet. Seems like you are on track. One suggestion: no nee
by breck 2y ago
I like it.
Env variables should be a solved problem but no one has made the simplest general solution yet. Seems like you are on track.
One suggestion: no need to use SQLite. Just develop a simple (and _lasting_), plain text DSL and save to a file.
Here's one I made using your example.
https://sdk.scroll.pub/designer/#parsers%0A%20valueCell%0A%20%20highlightScope%20string%0A%20variableNameCell%0A%20%20highlightScope%20keyword%0A%20%0A%20envelopeParser%0A%20%20root%0A%20%20description%20This%20is%20a%20stub%20for%20a%20DSL%20for%20Mattia%20Righetti'%20Envelope%20tool.%0A%20%20catchAllParser%20catchAllErrorParser%0A%20%20inScope%20variableParser%0A%20variableParser%0A%20%20catchAllCellType%20valueCell%0A%20%20cells%20variableNameCell%0A%20%20pattern%20%5BA-Z_%5D%2B%0A%20catchAllErrorParser%0A%20%20baseParser%20errorParser%0Asample%0A%20API_KEY%20your_api_key_here%0A%20AWS_ACCESS_KEY_ID%20your_access_key_id%0A%20DATABASE_URL%20postgres%3A%2F%2Fuser%3Apassword%40localhost%3A5432%2Fmydb%0A%20DEBUG_MODE%20true%0A%20SECRET_KEY%20mysecretkey123%0A%20SMTP_HOST%20smtp.example.com https://sdk.scroll.pub/designer/#parsers%0A%20valueCell%0A%2...
I'm happy to chat more to nail that design if that would be helpful.
- gtirloni 2y agoI was thinking the same because how do you version control SQLite in git?
- skeledrew 2y agoI don't think you want your secrets committed...
- gtirloni 2y agoIt's common for projects to have placeholder values for dev/local environments. Environment variables aren't only for secrets (some say they should have never been).
- skeledrew 2y agoSure, but we've seen time and again where someone got hacked because secrets got committed, whether accidentally or deliberately. Why tempt fate with something that encourages committing of any env vars? The reason why we even pull these things out in the first place is because they're considered dynamic values. Otherwise we'd just hardcode them in a committed constants file.
- gtirloni 2y agoThis is a tool to manage environment variables. People use .env files with dev/local env var values in Git repositories for a good reason. They won't stop doing this.
- mattrighetti 2y ago> how do you version control SQLite in git? Interesting article just about that [0] [0]: https://garrit.xyz/posts/2023-11-01-tracking-sqlite-database-changes-in-git https://garrit.xyz/posts/2023-11-01-tracking-sqlite-database...
- bloopernova 2y agoA parser playground? Wow that is very cool.
- breck 2y agoThanks. It is not "great" yet but it is pretty good and reliable and has served me well for many years. At some point I may clean up the code so that it can really shine. Higher priority though is getting support for this Parsers language in Sublime and VS Code.
- cbarrick 2y agoSeems like .env is already an ideal DSL here. It's just a subset of shell. Easy to parse and index too.
- breck 2y agoIt's close to ideal, but not ideal.
- eikenberry 2y ago> Env variables should be a solved problem I think the main problem is that this problem is 99% solved by the shell alone. Shells are very versatile and it is quite easy to setup different environments using your shell. I'd bet that the crossover of people good at manipulating environments on workstations and people good with shells is pretty big. That is, the people with good domain knowledge have little motivation to write tools to address this.