EANCH-WP-0001 T02: bootstrap standalone TS package + test harness

Add package.json (name evidence-anchor, exports . and ./pdf, scripts
test/typecheck/lint), tsconfig.json (mirrors engine, DOM+jsx), vitest.config.ts
(happy-dom + react plugin), eslint.config.js (confines viewer libs to src/pdf/),
.nvmrc, and placeholder src entrypoints. Depends on @citation-evidence/engine
via sibling-checkout link only; no citation-evidence internals.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
tegwick 2026-07-08 20:37:59 +02:00
parent 08b3105454
commit 0e93b68982
9 changed files with 170 additions and 2 deletions

17
vitest.config.ts Normal file
View file

@ -0,0 +1,17 @@
import { defineConfig } from "vitest/config";
import react from "@vitejs/plugin-react";
// Pure selector/resolution tests are node-safe; the scroll/highlight and PDF
// adapter tests touch the DOM, so the default environment is happy-dom. The
// react plugin lets the PDF adapter (.tsx) compile under test.
//
// The one shared-type dependency, `@citation-evidence/engine`, resolves through
// its package `exports` map (`./shared`) via the sibling-checkout link — no
// local alias needed. Nothing here imports `citation-evidence` internals.
export default defineConfig({
plugins: [react()],
test: {
environment: "happy-dom",
globals: false,
},
});