-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Bikes #43
base: main
Are you sure you want to change the base?
Add Bikes #43
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- we need to reexport
bikes.ts
fromsrc/index.ts
make: string; | ||
name: string; | ||
year?: number; | ||
level: number; // negative for special cases like Tron bike |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make the level optional instead of storing negative values?
@@ -234,6 +234,19 @@ export interface Segment { | |||
|
|||
export type SegmentType = "sprint" | "climb" | "segment"; | |||
|
|||
export interface Bike { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do bikes have some kind of id we can use to identify them?
year?: number; | ||
level: number; // negative for special cases like Tron bike | ||
frameWeight: number; | ||
frameCdA: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some frames have 0 or a negative number as CdA. Not an aero expert, but this looks more like the difference of the current frame compared to a "default bike". Maybe we can be more explicit in the name about this. A negative bike would probably ride itself :D
name: string; | ||
year?: number; | ||
level: number; // negative for special cases like Tron bike | ||
frameWeight: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a jsdoc comment about the unit of the weights. It's obvious from the numbers but with the types it could be kg or gramms.
As mentioned in the issue, this PR is not adding Zwift source files.
I wanted to avoid polluting dependencies and the main codebase with ugly XML parsing & processing, so I've put everything that handles it into the
scripts/extract-data-from-app-source
folderRunning
scripts/extract-data-from-app-source/index.mjs
will generatedata/bikes.json
.data/bikes.json
will then be processed byupdate-data
as the other existing data (routes, segments, worlds), type-checked, and outputted to thesrc
folder for publishing.I'm not used to coding without ESLint so the formatting might not be consistent, feel free to share your config and I'll reformat it.
I'll DM you a quick video walk-through with some background info :)