Open Bakkhos opened 4 years ago
The simplest way probably is to go and change netlify cms to write a single json file containing a list, instad of one json file per collection entry. Even better would be to output typescript right away, with type definitions for each collection automatically derived from the widgets and the schema.
Then we can dump importAll entirely and just use import.
Currently the JSON data imported by /src/data/index.tsx files is not type checked in those cases where one is using importAll (rather than import) - that is, in case of folder collections.
Ideally these types would be checked somehow, so that the app does not crash when the json files are corrupt (e.g. because netlify cms writes unexpected things in there)