-
Notifications
You must be signed in to change notification settings - Fork 7
feat(session): implement the data loader of sessions #35
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
Conversation
✅ Deploy Preview for velvety-pony-8aa5d9 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Pull Request Overview
This PR ports the COSCUP 2024 session data loader to VitePress by implementing utility functions, type definitions, and processing logic to transform Pretalx API responses into the required sessions format.
- Implements utility functions for filtering characters and generating MD5 hashes.
- Adds comprehensive type definitions and constants for sessions, speakers, rooms, and tags.
- Processes API responses to generate structured session data and integrates collaborative writing mappings.
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| loaders/sessions/utils.ts | Adds helper functions for text filtering and MD5 hash generation. |
| loaders/sessions/types.ts | Introduces type definitions for session-related data. |
| loaders/sessions/processors.ts | Implements the logic to process Pretalx API responses into session data. |
| loaders/sessions/pretalx.ts | Defines interfaces for Pretalx API responses. |
| loaders/sessions/hackmd.ts | Provides interface for HackMD URL mappings. |
| loaders/sessions/constants.ts | Sets constant values used for mapping questions and tags. |
| loaders/session.data.ts | Defines the data loader that fetches and processes session data using VitePress. |
Files not reviewed (1)
- .env.example: Language not supported
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.
Pull Request Overview
This PR implements a VitePress data loader that fetches and processes session data from Pretalx and integrates additional information such as HackMD URL mappings.
- Introduces utility functions for string filtering and MD5 hash generation.
- Adds comprehensive TypeScript types for sessions, speakers, and related entities.
- Implements processors to transform Pretalx API responses into the session format used by the application, and integrates the loader in VitePress.
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| loaders/sessions/utils.ts | Utility functions for string processing and hash generation. |
| loaders/sessions/types.ts | Type definitions for sessions, speakers, rooms, tags, and related entities. |
| loaders/sessions/processors.ts | Functions for processing Pretalx responses into the session data format. |
| loaders/sessions/pretalx.ts | Type definitions for the Pretalx API responses. |
| loaders/sessions/hackmd.ts | Interface for HackMD URL mapping. |
| loaders/sessions/constants.ts | Constants for question IDs and language mappings. |
| loaders/session.data.ts | Loader implementation fetching external data and generating session results. |
Files not reviewed (1)
- .env.example: Language not supported
| @@ -1 +1 @@ | |||
| VITE_YEAR="" | |||
| PRETALX_TOKEN= | |||
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.
我記得 dataloader 不會主動讀 .env。你可以驗證一下他會不會把你指定的 PRETALX_TOKEN 讀進去。
d432968 to
ef767d6
Compare
Co-authored-by: Riley Ho <[email protected]>
note: backward compatibility changes; will be removed soon
ef767d6 to
2e7c059
Compare
Port the script at https://github.com/COSCUP/2024/blob/eff079441b85a3007a357c071ff1df243bf80738/scripts/pre-build/generateSession.ts as a VitePress data loader. Ensure proper typing according to the Pretalx API documentation and reorganize the code structure.
Usage:
Please note that we fetch the sessions from COSCUP 2024, as the sessions for 2025 have not been released yet.
You can optionally pass a
PRETALX_TOKENto access restricted resources, although the sessions for COSCUP 2024 are open.You can check the generated result in #34.
Squashed from commit 4312f65
TODOs: