feat(runtime): require Node.js 22 and refresh PDF parsing - #253
Merged
Conversation
Coverage: 95.93% (was 94.97%) BREAKING CHANGE: Node.js 22 or later is now required.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR raises the runtime floor to Node.js 22+ and updates the PDF parsing/teardown flow to align with the newer unpdf loading-task lifecycle, while strengthening CI by running deterministic E2E coverage across all supported Node versions.
Changes:
- Require Node.js
>=22(package engines, docs, CI matrix) and remove Node 20 from CI coverage. - Update
unpdfto1.8.1and switch PDF teardown toloadingTask.destroy()via a dedicated teardown helper. - Add/expand unit + E2E coverage for PDF worker teardown and deterministic local PDF extraction, and run E2E in CI.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/pdf-worker.ts | Refactors PDF worker extraction to inject the document loader and reliably teardown via loadingTask.destroy(). |
| src/pdf-worker-bootstrap.mjs | Updates worker bootstrap comment to be runtime-agnostic (tsx loader timing). |
| README.md | Updates installation guidance to require Node.js 22+. |
| package.json | Bumps Node engine requirement to >=22 and updates unpdf to 1.8.1. |
| package-lock.json | Locks updated Node engine requirement and unpdf@1.8.1 metadata. |
| docs/client-configurations.md | Updates NPX/STDIO client requirement to Node.js 22+. |
| .github/workflows/ci.yml | Removes Node 20 from the matrix and makes E2E tests mandatory on each runtime. |
| tests/unit/pdf-reader.test.ts | Adds deterministic unit coverage for loading-task teardown and worker timeout/cleanup behaviors. |
| tests/unit/documentation.test.ts | Extends metadata/documentation assertions for Node floor, unpdf version, and CI/E2E requirements. |
| tests/e2e/url-reader.e2e.ts | Adds a deterministic local-PDF E2E test validating SSRF boundaries and PDF extraction behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Breaking change
Node.js 20 is no longer supported. Consumers must use Node.js 22 or later.
Verification
This pull request does not change the package version, create a tag, or publish artifacts.