EANCH-WP-0001 T05 (prep): make root a full barrel for umbrella cutover

The umbrella's DOM tests vi.mock the single @anchor/index barrel (spreading
the original and overriding PdfSpikeViewer). To keep the cutover a mechanical
specifier swap and preserve those mocks, the evidence-anchor root re-exports
the full surface (pure core + PDF adapter), matching the prior @anchor/index.
evidence-anchor/pdf remains a focused viewer entry. Viewer code still lives
only under src/pdf/ (eslint-enforced). Repo stays green: 30 tests, tc, lint.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
tegwick 2026-07-08 21:02:06 +02:00
parent 243cb41938
commit d5c5155df8
3 changed files with 37 additions and 14 deletions

View file

@ -1,16 +1,38 @@
// Public entrypoint for `evidence-anchor`.
// Public entrypoint for `evidence-anchor` — the full barrel.
//
// The stable surface consumers depend on:
// - adapter-side types + the viewer contract (./types)
// - selector creation / resolution (./selectors)
// Mirrors the surface the umbrella previously consumed as `@anchor/index`, so
// consumers (and their `vi.mock(...)` calls) resolve every anchor symbol from a
// single specifier. Viewer *code* still lives only under `src/pdf/` (enforced
// by eslint); this barrel merely re-exports it.
//
// The concrete PDF adapter lives behind the `evidence-anchor/pdf` subpath
// (./pdf) so pure consumers do not pull PDF.js or React into their bundle.
// A focused, viewer-free entry is also available at `evidence-anchor/pdf` for
// consumers that want the PDF surface explicitly — but importing the package
// root pulls in the PDF adapter, matching the pre-extraction behaviour.
// Adapter-side types + the viewer contract.
export * from "./types";
// Selector creation / resolution (pure core).
export {
createSelectors,
resolveSelectors,
DEFAULT_CONTEXT_CHARS,
type CreateSelectorsOptions,
} from "./selectors";
// PDF adapter + helpers (re-exported from the src/pdf/ boundary).
export {
PdfSpikeViewer,
getHighlightClientRects,
selectorsFromPdfCapture,
findPdfRectSelector,
findTextQuoteSelector,
unionRect,
runScrollToHighlightJob,
DEFAULT_SCROLL_ATTEMPTS,
type PdfSpikeViewerProps,
type StoredAnnotation,
type ScrollToHighlightJob,
type ScrollToHighlightDeps,
type ScrollToHighlightState,
} from "./pdf";