bolt
bolt copied to clipboard
Feature Request: produce typescript interfaces from the bolt file
The bolt syntax could produce something fit for consumption as typescript interface, if we ignore the path and complex validations. It's no fun creating separate schema/interface code for the same objects.
I've actually released a library which aims to do just that: https://github.com/fny/firebase-bolt-transpiler
Please give it a spin, and let me know if you run into any issues.
Awesome!
Is this still the best reference?
I would propose that either bolt support the already existing JSON schema standard or for there to be a way to transpile from JSON schema to bolt types. There is already a library for converting JSON schema to TypeScript interfaces so adding JSON schema support in bolt or converting from JSON schema to bolt would bridge the gap.
It would ensure that data at the database is validated, that we have editor / compiler support in TypeScript, and developers could use the JSON schema validation outside of the context of TypeScript or Firebase.