// the css side of pierre theming lives in src/pierre.css import { getSharedHighlighter, type FileDiffOptions, type FileOptions, type VirtualFileMetrics } from "@pierre/diffs"; import { browser } from "$app/environment"; import diffShadowCSS from "$lib/components/repo/pierreDiff.css?raw"; import { SYNTAX_THEME_NAME } from "$lib/syntax"; import type { WorkerPoolManager } from "@pierre/diffs/worker"; // pierre's two diff layouts, threaded from the ?diff= url param down to the // FileDiff instances export type DiffStyle = NonNullable["diffStyle"]>; // pierre stops highlighting after 1000 characters, lockfiles often run longer const PIERRE_TOKENIZE_MAX_LINE_LENGTH = 5000; const PIERRE_BASE_OPTIONS = { theme: SYNTAX_THEME_NAME, themeType: "system", tokenizeMaxLineLength: PIERRE_TOKENIZE_MAX_LINE_LENGTH } as const; // pierre's core stylesheet reaches a container two ways: the `diffs-container` // custom element adopts it in its constructor, but bails when the element already // has a shadow root — which an ssr'd `