feat(smartpdf): replace internal Express server with @push.rocks/smartserve, add PDF→WebP rendering, improve start/stop handling and bump dependencies

This commit is contained in:
2026-03-09 17:05:19 +00:00
parent d0c5821f80
commit c1208b5216
7 changed files with 700 additions and 1751 deletions

View File

@@ -73,7 +73,7 @@ interface IPdf {
## 📚 How It Works
SmartPDF spins up a lightweight Express server bound to `localhost` and a headless Chromium browser. When you call a generation method:
SmartPDF spins up a lightweight HTTP server (via `@push.rocks/smartserve`) bound to `localhost` and a headless Chromium browser. When you call a generation method:
1. Your HTML is registered internally and served at `http://localhost:{port}/{id}`
2. Puppeteer navigates to that URL, waits for the page to fully render, and captures a PDF
@@ -362,7 +362,7 @@ await Promise.all(instances.map(i => i.stop()));
| Property | Type | Description |
|----------|------|-------------|
| `serverPort` | `number` | The port the internal Express server is listening on |
| `serverPort` | `number` | The port the internal HTTP server is listening on |
#### Instance Methods