Open kkukshtel opened 2 years ago
I'm not sure this is the same topic I mentioned on reddit, but I want Depot to have a separate schema file and data file. Separating the business layout from data - much like a JSON $schema
is a separate file, having a items.depot
and items.json
would be nice. Benefits:
.depot
file changes, but changing data just requires a team member reviewA Depot file contains its data model, making the file itself portable to any other program
. I think it makes it less portable than a plain json data would, alongside a depot "schema". I think Depot is awesome and I think this would make it more practical for game development in teams.
This is a slightly different issue that you're bringing up but it's a bit related so I'll address it here.
Given how Depot works inside VS Code, having a multi-file dependency for edit-time authoring isn't really possible without a lot of user burden for config + managing the data (we leverage Code's "custom editor" API, that only operates as a "view" on the single opened file). On top of that, having multiple files to manage runs counter to the ethos of the project, as the goal and aims are to have a single file that represents all of your data.
I think in your use case, if multiple files are an absolute requirement, there's two support paths I see:
Let me know what you think of option 2, as it seems like the one most ready at hand.
Forgot about this and ran into it again cleaning out my abundant GitHub notifications. #2 as an export would be fine. I think the versioning is reversed though, the depot would be versioned and the exported (generated) files would not be tracked. Otherwise the setup could get out of sync with the data. Being able to automate it is really the desire, and you're right a simple jq
could work. We can also just read the depot to build a zod or TypeScript types for the imports.
Lots of people have suggested that Depot should support the importing of raw JSON data. This issue is meant to track use cases/needs and what people would expect as the workflow for that use case.