rewrite hit format from csv into yml for better maintainability
enhancementclientserver
## Summary
The rewrite of the CSV hit system into a YAML-based one contains the following substeps:
* [x] write a migration tool to migrate from the CSV format to a YML format
- [x] create a cargo workspace to hold more than just 1 crate
- [x] make server become a crate in this workspace
- [x] add core package to contain all the code that needs to be shared among crates in the repository
- [x] add cli package to further run tasks that come up from time to time
- [x] add command to migrate from csv to yml (hitster-cli migrate)
* hitster-cli migrate will generate unique IDs for every hit and pack
* hits will only exist once each, getting linked to all packs they live in
* hitster-cli migrate will also check if a yaml file already exists and if yes, will preserve ids for hits and packs where possible
- [x] replace compiled hits list with yaml file imported via include_str!
* this will not type-check at compile-time
* however it does speed up the compilation process drastically
* hits will be parsed via serde_yml when starting the server
* [x] a new HitsterData struct is now responsible for holding hits and packs in a way that allows for easy querying of certain hits and packs. This structure can be created when parsing the yml file, but it can also be instantiated to be filled on the fly
* [x] the changes introduced some differences between the file format and the payloads that get sent to the server, so some new Payload structs need to be introduced to accomodate for that
* [x] since hits are now associated with multiple packs, there is no need to display the originating pack on the game view / hits view anymore. We'll reintroduce a way to check the packs of a hit in a later step
### Motivation
We currently maintain hits in CSV format exported from an Excel sheet. This however doesn't read nicely and is hard to maintain.
0 条评论