Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/sync-working-groups/sync-working-groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const CALENDAR_ID =
const API_KEY = process.env.GOOGLE_CALENDAR_API_KEY
const OUTPUT_FILE = new URL("./working-group-events.ndjson", import.meta.url)
const DAYS_BACK = 36
const DAYS_TO_KEEP = 90
const DAYS_TO_KEEP = 5 * 365
const DAYS_AHEAD = 500

const Instant = type({
Expand Down
98 changes: 65 additions & 33 deletions scripts/sync-working-groups/working-group-events.ndjson

Large diffs are not rendered by default.

19 changes: 4 additions & 15 deletions src/app/(main)/community/events/events-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { WorkingGroupMeeting as CalendarEvent } from "@/../scripts/sync-wor

import { EventCard } from "./event-card"
import { EventsScrollview } from "./events-scrollview"
import type { Event, Meetup } from "./events"
import type { Event } from "./events"
import { EventFilterTag, EventKind } from "./event-filter-tag"

interface FilterChipProps extends ComponentPropsWithoutRef<"button"> {
Expand Down Expand Up @@ -55,7 +55,7 @@ export function FilterChip({
)
}

type AnyEvent = Event | Meetup | CalendarEvent
type AnyEvent = Event | CalendarEvent

// NOTE: the order of this controls the order of the tag toggles
const DEFAULT_VISIBILITY = {
Expand All @@ -79,9 +79,7 @@ function isSoon(date: Date) {
}

function categorizeEvent(event: AnyEvent): EventKind | "duplicate" | null {
if ("node" in event) {
return "meetup"
} else if ("start" in event) {
if ("start" in event) {
// From https://calendar.graphql.org
const summary = event.summary ?? ""
if (/\b(Subcommittee|Committee)\b/i.test(summary)) {
Expand Down Expand Up @@ -249,16 +247,7 @@ export function EventsList({
if (kind === "duplicate" || kind == null) {
return null
}
return "node" in event ? (
<EventCard
key={event.node.id}
name={event.node.name}
href={event.node.link}
city={event.node.city + ", " + event.node.country}
date={event.node.next || event.node.prev}
kind={kind}
/>
) : "start" in event ? (
return "start" in event ? (
// It's from the calendar
<EventCard
key={event.id}
Expand Down
4 changes: 0 additions & 4 deletions src/app/(main)/community/events/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,3 @@ export const events: Event[] = [
hostLink: "https://www.truedigitalpark.com/",
},
].sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime())

import type { meetups } from "@/components/meetups"

export type Meetup = (typeof meetups)[number]
31 changes: 2 additions & 29 deletions src/app/(main)/community/events/get-all-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ import { join } from "node:path"
import { readFile } from "node:fs/promises"
import { cache } from "react"

import { meetups } from "@/components/meetups"

import type { WorkingGroupMeeting } from "@/../scripts/sync-working-groups/sync-working-groups"

import { events, type Event, type Meetup } from "./events"
import { events, type Event } from "./events"

type AnyEvent = Event | Meetup | WorkingGroupMeeting
type AnyEvent = Event | WorkingGroupMeeting

const WORKING_GROUP_MEETINGS_FILE = join(
process.cwd(),
Expand Down Expand Up @@ -38,33 +36,8 @@ export const getAllEvents = cache(async () => {
} else upcomingEvents.push(meeting)
}

for (const meetup of meetups) {
const { next, prev } = meetup.node

// if next is in the past we treat it as past event
if (next && new Date(next) < now) {
pastEvents.push(meetup)
}
// if prev is in the past it is obviously a past event
else if (prev && new Date(prev) < now) {
pastEvents.push({
node: {
...meetup.node,
// we disregard .next, it's checked in nexdt if statement
next: "",
},
})
}

// if next is in the future, it is an upcoming event
if (next && new Date(next) >= now) {
upcomingEvents.push(meetup)
}
}

const getDate = (event: AnyEvent) => {
if ("date" in event) return new Date(event.date)
if ("node" in event) return new Date(event.node.next || event.node.prev)
return new Date(event.start)
}

Expand Down
18 changes: 1 addition & 17 deletions src/app/(main)/community/events/rss.xml/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,7 @@ export async function GET() {
})

for (const event of allEvents) {
if ("node" in event) {
let date: Date
if (event.node.next && new Date(event.node.next) > new Date()) {
date = new Date(event.node.next)
} else {
date = new Date(event.node.prev)
}

feed.item({
title: event.node.name,
date,
url: event.node.link,
description: "",
lat: event.node.latitude,
long: event.node.longitude,
})
} else if ("start" in event) {
if ("start" in event) {
feed.item({
title: event.summary || "GraphQL Working Group",
date: event.start,
Expand Down
40 changes: 0 additions & 40 deletions src/components/meetups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ export const meetups = [
state: "",
country: "Netherlands",
link: "https://www.meetup.com/amsterdam-graphql-meetup",
prev: "2025-09-07",
next: "",
official: true,
},
},
Expand All @@ -25,8 +23,6 @@ export const meetups = [
state: "",
country: "Israel",
link: "https://www.meetup.com/graphql-tlv",
prev: "",
next: "",
official: false,
},
},
Expand All @@ -40,8 +36,6 @@ export const meetups = [
state: "TX",
country: "USA",
link: "https://www.meetup.com/atx-graphql",
prev: "2025-08-24",
next: "",
official: true,
},
},
Expand All @@ -55,8 +49,6 @@ export const meetups = [
state: "",
country: "Germany",
link: "https://www.meetup.com/graphql-hamburg/",
prev: "",
next: "",
official: false,
},
},
Expand All @@ -70,8 +62,6 @@ export const meetups = [
state: "WA",
country: "USA",
link: "https://www.meetup.com/graphql-seattle",
prev: "",
next: "",
official: false,
},
},
Expand All @@ -85,8 +75,6 @@ export const meetups = [
state: "CA",
country: "USA",
link: "http://meetup.com/GraphQL-SF",
prev: "",
next: "",
official: false,
},
},
Expand All @@ -100,8 +88,6 @@ export const meetups = [
state: "",
country: "Switzerland",
link: "https://www.meetup.com/graphql-zurich",
prev: "",
next: "",
official: false,
},
},
Expand All @@ -115,8 +101,6 @@ export const meetups = [
state: "",
country: "Denmark",
link: "https://www.meetup.com/copenhagen-graphql-meetup-group",
prev: "",
next: "",
official: false,
},
},
Expand All @@ -130,8 +114,6 @@ export const meetups = [
state: "",
country: "Germany",
link: "https://www.meetup.com/graphql-berlin/",
prev: "2025-09-11",
next: "",
official: false,
},
},
Expand All @@ -145,8 +127,6 @@ export const meetups = [
state: "",
country: "Thailand",
link: "https://www.meetup.com/graphql-bangkok",
prev: "",
next: "",
official: false,
},
},
Expand All @@ -160,8 +140,6 @@ export const meetups = [
state: "",
country: "Poland",
link: "https://guild.host/graphql-bialystok/",
prev: "",
next: "",
official: true,
},
},
Expand All @@ -175,8 +153,6 @@ export const meetups = [
state: "",
country: "India",
link: "https://guild.host/graphql-hyderabad/",
prev: "2025-08-09",
next: "",
official: true,
},
},
Expand All @@ -190,8 +166,6 @@ export const meetups = [
state: "",
country: "UK",
link: "https://guild.host/london-graphql",
prev: "2025-07-01",
next: "October 2025",
official: true,
},
},
Expand All @@ -205,8 +179,6 @@ export const meetups = [
state: "",
country: "Kenya",
link: "https://www.meetup.com/nairobi-graphql-meetup/",
prev: "",
next: "",
official: false,
},
},
Expand All @@ -220,8 +192,6 @@ export const meetups = [
state: "NY",
country: "USA",
link: "https://guild.host/graphql-new-york/events",
prev: "",
next: "",
official: false,
},
},
Expand All @@ -235,8 +205,6 @@ export const meetups = [
state: "",
country: "Norway",
link: "https://guild.host/graphql-oslo/",
prev: "2025-10-27",
next: "2026-01-26",
official: true,
},
},
Expand All @@ -250,8 +218,6 @@ export const meetups = [
state: "",
country: "France",
link: "https://www.meetup.com/fr-FR/parisgraphql/",
prev: "",
next: "2025-10-22",
official: true,
},
},
Expand All @@ -265,8 +231,6 @@ export const meetups = [
state: "PA",
country: "USA",
link: "https://luma.com/phillygraphql",
prev: "",
next: "2026-01-22",
official: true,
},
},
Expand All @@ -280,8 +244,6 @@ export const meetups = [
state: "",
country: "Australia",
link: "https://luma.com/graphql-sydney",
prev: "2024-11-12",
next: "",
official: false,
},
},
Expand All @@ -295,8 +257,6 @@ export const meetups = [
state: "",
country: "Taiwan",
link: "https://guild.host/graphql-taipei/events",
prev: "",
next: "",
official: false,
},
},
Expand Down
Loading