import { projects, publicRecords, releases } from "./public-content.ts"; import { getHomeFocusItems, searchPublicContent } from "./public-query.ts"; export { publicSiteConfig as siteConfig } from "../../contracts/public-site-config.ts"; export type { FocusKey, HomeFocusItem as FocusItem, } from "../../application/ports/public-content-queries.ts"; export const focusItems = getHomeFocusItems(); export type LatestEntry = { id: string; typeLabel: string; title: string; summary: string; date: string; dateTime: string; topic: string; project: string; path: string; }; const publicRecordByPath = new Map(publicRecords.map((record) => [record.path, record])); const projectTimeline: ReadonlyArray = projects.flatMap((project) => project.activity.map((activity) => { const record = publicRecordByPath.get(activity.recordPath ?? activity.path); return { id: activity.id, typeLabel: activity.type === "PUBLICATION" && record ? record.kind : "PROJECT ACTIVITY", title: activity.type === "PUBLICATION" && record ? record.title : activity.title, summary: activity.summary, date: activity.date, dateTime: activity.dateTime, topic: record?.topic ?? project.topics[0]?.name ?? "", project: project.title, path: activity.path, }; }), ); const releaseTimeline: ReadonlyArray = releases.map((release) => ({ id: `release-${release.version}`, typeLabel: "RELEASE", title: release.title, summary: release.summary, date: release.publishedLabel, dateTime: release.publishedAt, topic: "TechLog", project: "TechLog", path: release.path, })); export const latestEntries: ReadonlyArray = [ ...projectTimeline, ...releaseTimeline, ].sort((left, right) => right.dateTime.localeCompare(left.dateTime)); export const exploreEntries = [ { label: "Case", description: "문제를 따라가며 검증 과정을 읽습니다", path: "/explore/cases", }, { label: "Reference", description: "다시 찾을 수 있는 기술 기준을 확인합니다", path: "/explore/references", }, { label: "OpenQuestion", description: "아직 끝나지 않은 판단과 다음 검증을 봅니다", path: "/explore/questions", }, { label: "Project", description: "여러 기록을 하나의 시스템 맥락에서 연결합니다", path: "/projects", }, ] as const; export const searchEntries = searchPublicContent(""); const fetchJoinCase = publicRecords.find( (record) => record.kind === "CASE" && record.slug === "collection-fetch-join-pagination", ); if (!fetchJoinCase || fetchJoinCase.kind !== "CASE") { throw new Error("Missing canonical Fetch Join Case"); } export const caseDocument = { title: fetchJoinCase.title, eyebrow: "Case / JPA / Backend Skeleton", summary: fetchJoinCase.summary, problem: fetchJoinCase.problem, conclusion: fetchJoinCase.conclusion, environment: fetchJoinCase.environment, dataset: `Dataset: ${fetchJoinCase.verification}`, dates: `게시 ${fetchJoinCase.publishedLabel} · 마지막 검증 ${fetchJoinCase.lastVerifiedLabel}`, } as const; export const documentHeadings = fetchJoinCase.sections.map(({ id, title }) => ({ id, label: title, })); export const caseSections = fetchJoinCase.sections; export const documentRelations = fetchJoinCase.relations; export const failedQueryCode = `@Query(""" select distinct fi from FeedItem fi join fetch fi.user join fetch fi.page left join fetch fi.highlights h where fi.visibility = :visibility order by fi.firstHighlightedAt desc, fi.id desc """) List findFeed( @Param("visibility") Visibility visibility, Pageable pageable );`; export const splitQueryCode = `Page page = feedItemQuery.findPage( Visibility.PUBLIC, PageRequest.of(0, 20, Sort.by( Sort.Order.desc("firstHighlightedAt"), Sort.Order.desc("id") )) ); List feedItemIds = page.getContent().stream() .map(FeedItemRow::id) .toList(); Map> highlights = highlightQuery.findLatestByFeedItemIds(feedItemIds, 3);`;