Skip to content

chore(pdf-server): switch to maintained @cantoo/pdf-lib fork#651

Draft
ochafik wants to merge 1 commit intomainfrom
chore/pdf-server-cantoo-pdf-lib
Draft

chore(pdf-server): switch to maintained @cantoo/pdf-lib fork#651
ochafik wants to merge 1 commit intomainfrom
chore/pdf-server-cantoo-pdf-lib

Conversation

@ochafik
Copy link
Copy Markdown
Contributor

@ochafik ochafik commented May 5, 2026

Summary

  • Replaces pdf-lib@1.17.1 (unmaintained since Nov 2021) with @cantoo/pdf-lib@^2.6.5 in examples/pdf-server
  • Updates 4 import sites (pdf-annotations.ts, two test files, tests/helpers/range-counting-server.ts)
  • Replaces deprecated PDFNumber.value() with PDFNumber.asNumber() in test assertions

Why

pdf-lib has had no release in 4+ years (see Hopding/pdf-lib#1423). @cantoo/pdf-lib is the community-recognized successor: ~180k downloads/week, 12 releases in the last 8 months, MIT-licensed, drop-in API compatible. Snyk and npm audit both report 0 vulnerabilities for the fork and its transitive deps.

Supply-chain scanners flag pdf-lib's dist/pdf-lib.esm.min.js as "obfuscated code" — that is a false positive on terser-minified output (no eval/Function/atob, sourcemap present), and the file is CDN-only (unpkg field), never loaded by Node or our Vite/bun builds. The fork ships the same dist/ layout, so this PR does not clear that scanner finding — it should be allowlisted separately. This PR is about moving to a maintained dependency.

New transitive deps: color, crypto-js@^4.2.0, node-html-better-parser (used by the fork's SVG/encryption features; all audited clean).

Test plan

  • npm run --workspace examples/pdf-server build — typecheck + Vite + bun bundle all green
  • npm test — 374 pass / 0 fail
  • npm run test:e2e — all green incl. PDF Server "loads app UI" + "screenshot matches golden"
  • Verified all 14 pdf-lib exports we use are present in the fork
  • npm audit — no new advisories introduced (pre-existing postcss finding is unrelated, comes from Vite/Vue)

The original pdf-lib package has been unmaintained since Nov 2021.
@cantoo/pdf-lib is an actively maintained, API-compatible fork with
ongoing releases and accumulated bugfixes.

Also updates test assertions from the deprecated PDFNumber.value() to
PDFNumber.asNumber() per the fork's API guidance.
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 5, 2026

Open in StackBlitz

@modelcontextprotocol/ext-apps

npm i https://pkg.pr.new/@modelcontextprotocol/ext-apps@651

@modelcontextprotocol/server-basic-preact

npm i https://pkg.pr.new/@modelcontextprotocol/server-basic-preact@651

@modelcontextprotocol/server-basic-react

npm i https://pkg.pr.new/@modelcontextprotocol/server-basic-react@651

@modelcontextprotocol/server-basic-solid

npm i https://pkg.pr.new/@modelcontextprotocol/server-basic-solid@651

@modelcontextprotocol/server-basic-svelte

npm i https://pkg.pr.new/@modelcontextprotocol/server-basic-svelte@651

@modelcontextprotocol/server-basic-vanillajs

npm i https://pkg.pr.new/@modelcontextprotocol/server-basic-vanillajs@651

@modelcontextprotocol/server-basic-vue

npm i https://pkg.pr.new/@modelcontextprotocol/server-basic-vue@651

@modelcontextprotocol/server-budget-allocator

npm i https://pkg.pr.new/@modelcontextprotocol/server-budget-allocator@651

@modelcontextprotocol/server-cohort-heatmap

npm i https://pkg.pr.new/@modelcontextprotocol/server-cohort-heatmap@651

@modelcontextprotocol/server-customer-segmentation

npm i https://pkg.pr.new/@modelcontextprotocol/server-customer-segmentation@651

@modelcontextprotocol/server-debug

npm i https://pkg.pr.new/@modelcontextprotocol/server-debug@651

@modelcontextprotocol/server-map

npm i https://pkg.pr.new/@modelcontextprotocol/server-map@651

@modelcontextprotocol/server-pdf

npm i https://pkg.pr.new/@modelcontextprotocol/server-pdf@651

@modelcontextprotocol/server-scenario-modeler

npm i https://pkg.pr.new/@modelcontextprotocol/server-scenario-modeler@651

@modelcontextprotocol/server-shadertoy

npm i https://pkg.pr.new/@modelcontextprotocol/server-shadertoy@651

@modelcontextprotocol/server-sheet-music

npm i https://pkg.pr.new/@modelcontextprotocol/server-sheet-music@651

@modelcontextprotocol/server-system-monitor

npm i https://pkg.pr.new/@modelcontextprotocol/server-system-monitor@651

@modelcontextprotocol/server-threejs

npm i https://pkg.pr.new/@modelcontextprotocol/server-threejs@651

@modelcontextprotocol/server-transcript

npm i https://pkg.pr.new/@modelcontextprotocol/server-transcript@651

@modelcontextprotocol/server-video-resource

npm i https://pkg.pr.new/@modelcontextprotocol/server-video-resource@651

@modelcontextprotocol/server-wiki-explorer

npm i https://pkg.pr.new/@modelcontextprotocol/server-wiki-explorer@651

commit: a0562f9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant