mirror of
https://github.com/kennethnym/aris.git
synced 2026-04-22 17:51:18 +01:00
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:
@@ -1,5 +1,5 @@
|
||||
import { Hono } from "hono"
|
||||
import { describe, expect, test } from "bun:test"
|
||||
import { Hono } from "hono"
|
||||
|
||||
import type { Auth } from "./index.ts"
|
||||
import type { AuthSession, AuthUser } from "./session.ts"
|
||||
|
||||
@@ -47,5 +47,3 @@ export function createFeedEnhancer(config: FeedEnhancerConfig): FeedEnhancer {
|
||||
return mergeEnhancement(items, result, currentTime)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -36,8 +36,7 @@ export function buildPrompt(
|
||||
|
||||
for (const item of items) {
|
||||
const hasUnfilledSlots =
|
||||
item.slots &&
|
||||
Object.values(item.slots).some((slot) => slot.content === null)
|
||||
item.slots && Object.values(item.slots).some((slot) => slot.content === null)
|
||||
|
||||
if (hasUnfilledSlots) {
|
||||
enhanceItems.push({
|
||||
@@ -79,9 +78,7 @@ export function buildPrompt(
|
||||
*/
|
||||
export function hasUnfilledSlots(items: FeedItem[]): boolean {
|
||||
return items.some(
|
||||
(item) =>
|
||||
item.slots &&
|
||||
Object.values(item.slots).some((slot) => slot.content === null),
|
||||
(item) => item.slots && Object.values(item.slots).some((slot) => slot.content === null),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -129,7 +126,20 @@ function extractCalendarEntry(item: FeedItem): CalendarEntry | null {
|
||||
}
|
||||
|
||||
const DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] as const
|
||||
const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] as const
|
||||
const MONTHS = [
|
||||
"Jan",
|
||||
"Feb",
|
||||
"Mar",
|
||||
"Apr",
|
||||
"May",
|
||||
"Jun",
|
||||
"Jul",
|
||||
"Aug",
|
||||
"Sep",
|
||||
"Oct",
|
||||
"Nov",
|
||||
"Dec",
|
||||
] as const
|
||||
|
||||
function pad2(n: number): string {
|
||||
return n.toString().padStart(2, "0")
|
||||
@@ -144,7 +154,11 @@ function formatDayShort(date: Date): string {
|
||||
}
|
||||
|
||||
function formatDayLabel(date: Date, currentTime: Date): string {
|
||||
const currentDay = Date.UTC(currentTime.getUTCFullYear(), currentTime.getUTCMonth(), currentTime.getUTCDate())
|
||||
const currentDay = Date.UTC(
|
||||
currentTime.getUTCFullYear(),
|
||||
currentTime.getUTCMonth(),
|
||||
currentTime.getUTCDate(),
|
||||
)
|
||||
const targetDay = Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate())
|
||||
const diffDays = Math.round((targetDay - currentDay) / (1000 * 60 * 60 * 24))
|
||||
|
||||
|
||||
@@ -135,9 +135,7 @@ describe("schema sync", () => {
|
||||
|
||||
// JSON Schema structure matches
|
||||
const jsonSchema = enhancementResultJsonSchema
|
||||
expect(Object.keys(jsonSchema.properties).sort()).toEqual(
|
||||
Object.keys(payload).sort(),
|
||||
)
|
||||
expect(Object.keys(jsonSchema.properties).sort()).toEqual(Object.keys(payload).sort())
|
||||
expect([...jsonSchema.required].sort()).toEqual(Object.keys(payload).sort())
|
||||
|
||||
// syntheticItems item schema has the right required fields
|
||||
@@ -167,11 +165,7 @@ describe("schema sync", () => {
|
||||
|
||||
// JSON Schema only allows string or null for slot values
|
||||
const slotValueSchema =
|
||||
enhancementResultJsonSchema.properties.slotFills.additionalProperties
|
||||
.additionalProperties
|
||||
expect(slotValueSchema.anyOf).toEqual([
|
||||
{ type: "string" },
|
||||
{ type: "null" },
|
||||
])
|
||||
enhancementResultJsonSchema.properties.slotFills.additionalProperties.additionalProperties
|
||||
expect(slotValueSchema.anyOf).toEqual([{ type: "string" }, { type: "null" }])
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { randomBytes } from "node:crypto"
|
||||
import { describe, expect, test } from "bun:test"
|
||||
import { randomBytes } from "node:crypto"
|
||||
|
||||
import { CredentialEncryptor } from "./crypto.ts"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user