Skip to content

Commit 7e3881f

Browse files
authored
Merge branch 'ep2025' into ep2025-meta
2 parents 0e68e39 + 88ac254 commit 7e3881f

File tree

4 files changed

+101
-57
lines changed

4 files changed

+101
-57
lines changed

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@
4040
"rehype-slug": "^6.0.0",
4141
"remark-toc": "^9.0.0",
4242
"sharp": "^0.34.0",
43-
"tailwindcss": "^3.4.17",
44-
"typescript": "^5.8.3"
43+
"tailwindcss": "^3.4.17"
4544
},
4645
"devDependencies": {
4746
"@types/js-yaml": "^4.0.9",
4847
"prettier": "^3.5.3",
49-
"prettier-plugin-astro": "^0.14.1"
48+
"prettier-plugin-astro": "^0.14.1",
49+
"tsx": "^4.19.3",
50+
"typescript": "^5.8.3"
5051
},
5152
"prettier": {
5253
"proseWrap": "always"

pnpm-lock.yaml

Lines changed: 61 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/content/config.ts

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -59,21 +59,23 @@ const keynoters = defineCollection({
5959
}),
6060
});
6161

62-
// Shared data fetching function
6362
async function getCollectionsData() {
6463
const speakersData = await loadData(import.meta.env.EP_SPEAKERS_API);
6564
const sessionsData = await loadData(import.meta.env.EP_SESSIONS_API);
6665

67-
// Create indexed versions for efficient lookups
68-
const speakersById = Object.entries(speakersData).reduce(
66+
const speakersById = Object.entries(
67+
speakersData as Record<string, {}>
68+
).reduce(
6969
(acc, [id, speaker]: [string, any]) => {
7070
acc[id] = { id, ...speaker };
7171
return acc;
7272
},
7373
{} as Record<string, any>
7474
);
7575

76-
const sessionsById = Object.entries(sessionsData).reduce(
76+
const sessionsById = Object.entries(
77+
sessionsData as Record<string, {}>
78+
).reduce(
7779
(acc, [id, session]: [string, any]) => {
7880
acc[id] = { id, ...session };
7981
return acc;
@@ -93,13 +95,15 @@ const speakers = defineCollection({
9395
loader: async (): Promise<any> => {
9496
const { speakersData, sessionsById } = await getCollectionsData();
9597

96-
return Object.values(speakersData).map((speaker: any) => ({
97-
id: speaker.slug,
98-
...speaker,
99-
submissions: (speaker.submissions || [])
100-
.filter((sessionId: string) => sessionId in sessionsById)
101-
.map((sessionId: string) => sessionsById[sessionId].slug),
102-
}));
98+
return Object.values(speakersData as Record<string, {}>).map(
99+
(speaker: any) => ({
100+
id: speaker.slug,
101+
...speaker,
102+
submissions: (speaker.submissions || [])
103+
.filter((sessionId: string) => sessionId in sessionsById)
104+
.map((sessionId: string) => sessionsById[sessionId].slug),
105+
})
106+
);
103107
},
104108
schema: z.object({
105109
code: z.string(),
@@ -122,13 +126,15 @@ const sessions = defineCollection({
122126
loader: async (): Promise<any> => {
123127
const { sessionsData, speakersById } = await getCollectionsData();
124128

125-
return Object.values(sessionsData).map((session: any) => ({
126-
id: session.slug,
127-
...session,
128-
speakers: (session.speakers || [])
129-
.filter((speakerId: string) => speakerId in speakersById)
130-
.map((speakerId: string) => speakersById[speakerId].slug),
131-
}));
129+
return Object.values(sessionsData as Record<string, {}>).map(
130+
(session: any) => ({
131+
id: session.slug,
132+
...session,
133+
speakers: (session.speakers || [])
134+
.filter((speakerId: string) => speakerId in speakersById)
135+
.map((speakerId: string) => speakersById[speakerId].slug),
136+
})
137+
);
132138
},
133139
schema: z.object({
134140
code: z.string(),
@@ -159,13 +165,20 @@ const sessions = defineCollection({
159165
}),
160166
});
161167

168+
interface ScheduleData {
169+
days: Record<string, any>;
170+
}
171+
162172
const days = defineCollection({
163173
loader: async (): Promise<any[]> => {
164-
const schedule = await loadData(import.meta.env.EP_SCHEDULE_API);
174+
const schedule = (await loadData(
175+
import.meta.env.EP_SCHEDULE_API
176+
)) as ScheduleData;
165177

166-
if (Object.keys(schedule).length === 0) {
167-
return schedule;
178+
if (!schedule || Object.keys(schedule).length === 0) {
179+
return [];
168180
}
181+
169182
return Object.entries(schedule.days).map(([date, data]: [string, any]) => ({
170183
id: date,
171184
...data,

0 commit comments

Comments
 (0)