// the css side of pierre theming lives in src/pierre.css import type { FileDiffOptions, FileOptions, VirtualFileMetrics } from "@pierre/diffs"; import { browser } from "$app/env"; import diffShadowCSS from "#lib/components/repo/pierreDiff.css?raw"; import { getSharedHighlighter, SYNTAX_HIGHLIGHTER, SYNTAX_THEME_NAME } from "#lib/syntax.ts"; 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", preferredHighlighter: SYNTAX_HIGHLIGHTER, 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 `