MEGAINFRA-WEBAPP/package.json
DEls 3e06a78fcb feat(reports): add a real, server-side PDF builder
Replaces Ask's screenshot-then-wrap PDFs with an actual PDF pipeline
that runs in plain Node (no Chromium/Puppeteer, Alpine-safe): pdfmake
draws real text, real tables (zebra rows, right-aligned numbers, a
repeated header row across a page break) and vector charts (bar,
stacked bar, line, area, donut) built from ChartSpec as hand-rolled
SVG, using pdfkit's standard 14 fonts so no font files ship at all.
Chosen over @react-pdf/renderer for its native repeated-table-header
support, which that library only gets via manual pagination.

- chart-svg.ts: ChartSpec -> drawing plan (bar count, axis max) -> SVG.
- markdown-blocks.ts: GFM markdown -> headings/paragraphs/lists/tables.
- table-content.ts / kpi-content.ts / chart-content.ts / image-content.ts:
  the pdfmake content nodes for each piece.
- chrome.ts: masthead + running header + "Page n of N" footer.
- resolve-section-table.ts: a report section's table, preferring the
  cached query_records result (table: { resultId }) so figures are
  never hand-copied.
- build.ts: assembles either an answer's markdown or a make_pdf_report
  structured document into one PDF.

Verified against real pdftotext/pdftoppm output, including the header
repeating across a page break.

Adds pdfmake, unified, remark-parse (+ @types/pdfmake, @types/pdfkit);
drops html-to-image, whose only caller is removed in a later commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 09:16:20 +02:00

78 lines
2.4 KiB
JSON

{
"name": "mega-infrastructure-dashboard",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "next dev -H 0.0.0.0 -p 6004 --webpack",
"build": "npm run icons && npm run og-image && next build --webpack",
"icons": "node scripts/build-icons.mjs",
"og-image": "node scripts/build-og-image.mjs",
"start": "next start -H 0.0.0.0 -p 3000",
"lint": "eslint .",
"typecheck": "tsc --noEmit",
"test": "vitest",
"test:run": "vitest run",
"mcp": "tsx --env-file=.env.local src/mcp/server.ts",
"postinstall": "node scripts/patch-next-dev-blocker.cjs"
},
"dependencies": {
"@anthropic-ai/sdk": "^0.122.0",
"@ducanh2912/next-pwa": "^10.2.9",
"@modelcontextprotocol/sdk": "^1.30.0",
"@n8n/workflow-sdk": "^0.29.3",
"@radix-ui/react-dialog": "^1.1.4",
"@radix-ui/react-dropdown-menu": "^2.1.4",
"@radix-ui/react-label": "^2.1.1",
"@radix-ui/react-select": "^2.1.4",
"@radix-ui/react-slot": "^1.1.1",
"@radix-ui/react-tabs": "^1.1.2",
"@radix-ui/react-tooltip": "^1.1.6",
"@tanstack/react-table": "^8.20.6",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"date-fns": "^4.1.0",
"jsqr": "^1.4.0",
"leaflet": "^1.9.4",
"leaflet.markercluster": "^1.5.3",
"lucide-react": "^0.469.0",
"next": "^16",
"openai": "^7.8.0",
"papaparse": "^5.4.1",
"pdf-lib": "^1.17.1",
"pdfmake": "^0.2.23",
"pocketbase": "^0.27.3",
"qrcode": "^1.5.4",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-leaflet": "^5.0.0",
"react-leaflet-cluster": "^4.1.3",
"react-markdown": "^10.1.0",
"recharts": "^2.15.0",
"remark-gfm": "^4.0.1",
"remark-parse": "^11.0.0",
"sharp": "^0.35.4",
"tailwind-merge": "^2.6.0",
"unified": "^11.0.5",
"xlsx": "^0.18.5",
"zod": "^3.25.76",
"zod-to-json-schema": "^3.25.2"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.0.0",
"@types/leaflet": "^1.9.22",
"@types/node": "^22.10.5",
"@types/papaparse": "^5.3.15",
"@types/pdfkit": "^0.17.6",
"@types/pdfmake": "^0.3.3",
"@types/qrcode": "^1.5.6",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
"eslint": "^9.17.0",
"eslint-config-next": "^16",
"postcss": "^8.4.49",
"tailwindcss": "^4.0.0",
"tsx": "^4.23.12",
"typescript": "^5.7.2",
"vitest": "^2.1.9"
}
}