generated from coulomb/repo-seed
Implement CE-WP-0002 T01-T02: engine types + PDF viewer adapter spike
T01: shared engine types (Document, Selector union, Annotation, EvidenceItem, branded IDs with newId factory) per wiki/SharedContracts.md §1-§3. T02: react-pdf-highlighter-plus v1.1.4 spike behind the §5 DocumentViewerAdapter contract in src/anchor/. Pure round-trip math extracted to pdf-selector-math.ts with 11 unit tests proving lossless capture → selectors → JSON → restored-rects. ADR-0004 accepted; full user-flow Playwright verification deferred to T09. Adds Vite app shell (index.html, src/app/SpikeApp.tsx) so the spike is exercisable via pnpm dev. tsconfig --noEmit prevents tsc -b from littering src/ with stray .js outputs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
31
vite.config.ts
Normal file
31
vite.config.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { dirname, resolve } from "node:path";
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
resolve: {
|
||||
alias: {
|
||||
"@shared": resolve(__dirname, "src/shared"),
|
||||
"@engine": resolve(__dirname, "src/engine"),
|
||||
"@anchor": resolve(__dirname, "src/anchor"),
|
||||
"@source": resolve(__dirname, "src/source"),
|
||||
"@binder": resolve(__dirname, "src/binder"),
|
||||
"@work": resolve(__dirname, "src/work"),
|
||||
"@app": resolve(__dirname, "src/app"),
|
||||
},
|
||||
},
|
||||
server: {
|
||||
fs: {
|
||||
// Allow Vite to serve /fixtures/pdfs/*.pdf from the project root.
|
||||
allow: [resolve(__dirname)],
|
||||
},
|
||||
},
|
||||
optimizeDeps: {
|
||||
// pdfjs-dist ships its worker as a .mjs Vite needs to handle.
|
||||
exclude: ["pdfjs-dist"],
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user