fix: add .ona and drizzle to oxfmt ignore

oxfmt was reformatting generated drizzle migration snapshots and
crashing on .ona/review/comments.json. Also runs the formatter
across the full codebase.

Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
2026-04-12 17:26:55 +00:00
parent 62c8dfe0b1
commit 33edc5c9f1
40 changed files with 1776 additions and 377 deletions

View File

@@ -1,17 +1,14 @@
import type { Context, FeedEnhancement, FeedItem, FeedPostProcessor } from "@aelis/core"
import { TimeRelevance } from "@aelis/core"
import type { CalDavEventData } from "@aelis/source-caldav"
import type { CalendarEventData } from "@aelis/source-google-calendar"
import type { CurrentWeatherData } from "@aelis/source-weatherkit"
import { TimeRelevance } from "@aelis/core"
import { CalDavFeedItemType } from "@aelis/source-caldav"
import { CalendarFeedItemType } from "@aelis/source-google-calendar"
import { TflFeedItemType } from "@aelis/source-tfl"
import { WeatherFeedItemType } from "@aelis/source-weatherkit"
export const TimePeriod = {
Morning: "morning",
Afternoon: "afternoon",
@@ -28,7 +25,6 @@ export const DayType = {
export type DayType = (typeof DayType)[keyof typeof DayType]
const PRE_MEETING_WINDOW_MS = 30 * 60 * 1000
const TRANSITION_WINDOW_MS = 30 * 60 * 1000
@@ -144,7 +140,6 @@ export function createTimeOfDayEnhancer(options?: TimeOfDayEnhancerOptions): Fee
return timeOfDayEnhancer
}
export function getTimePeriod(date: Date): TimePeriod {
const hour = date.getHours()
if (hour >= 22 || hour < 6) return TimePeriod.Night
@@ -182,7 +177,9 @@ function getNextPeriodBoundary(date: Date): { period: TimePeriod; msUntil: numbe
* Google Calendar uses `startTime`, CalDAV uses `startDate`.
*/
function getEventStartTime(data: CalendarEventData | CalDavEventData): Date {
return "startTime" in data ? (data as CalendarEventData).startTime : (data as CalDavEventData).startDate
return "startTime" in data
? (data as CalendarEventData).startTime
: (data as CalDavEventData).startDate
}
/**
@@ -196,7 +193,6 @@ function hasPrecipitationOrExtreme(item: FeedItem): boolean {
return false
}
interface PreMeetingInfo {
/** IDs of calendar items starting within the pre-meeting window */
upcomingMeetingIds: Set<string>
@@ -225,7 +221,6 @@ function detectPreMeetingItems(items: FeedItem[], now: Date): PreMeetingInfo {
return { upcomingMeetingIds, hasLocationMeeting }
}
function findFirstEventOfDay(items: FeedItem[], now: Date): string | null {
let earliest: { id: string; time: number } | null = null
@@ -252,7 +247,6 @@ function findFirstEventOfDay(items: FeedItem[], now: Date): string | null {
return earliest?.id ?? null
}
function applyMorningWeekday(
items: FeedItem[],
boost: Record<string, number>,
@@ -415,7 +409,6 @@ function applyNight(items: FeedItem[], boost: Record<string, number>, suppress:
}
}
function applyPreMeetingOverrides(
items: FeedItem[],
preMeeting: PreMeetingInfo,
@@ -487,7 +480,6 @@ function applyWindDown(
}
}
function applyTransitionLookahead(
items: FeedItem[],
now: Date,
@@ -544,7 +536,6 @@ function getNextPeriodBoostTargets(period: TimePeriod, dayType: DayType): Readon
return targets
}
function applyWeatherTimeCorrelation(
items: FeedItem[],
period: TimePeriod,
@@ -562,7 +553,11 @@ function applyWeatherTimeCorrelation(
break
}
case WeatherFeedItemType.Current:
if (period === TimePeriod.Morning && dayType === DayType.Weekday && hasPrecipitationOrExtreme(item)) {
if (
period === TimePeriod.Morning &&
dayType === DayType.Weekday &&
hasPrecipitationOrExtreme(item)
) {
boost[item.id] = (boost[item.id] ?? 0) + 0.1
}
if (period === TimePeriod.Evening && hasEveningEventWithLocation) {
@@ -591,5 +586,3 @@ function hasEveningCalendarEventWithLocation(items: FeedItem[], now: Date): bool
return false
}