multivendor-invoice
v0.0.8
Published
Invoice issuance, snapshot PDF rendering, outbox, and storage for multi-vendor marketplaces
Maintainers
Readme
multivendor-invoice
Invoice issuance, snapshot PDF rendering (Puppeteer), outbox processing, and PDF object storage for multi-vendor marketplaces.
Install
pnpm add multivendor-invoiceHost apps pin an exact version while the extract stabilizes (e.g. "multivendor-invoice": "0.0.1"). Every fix requires publish + host bump until you move to a range or automate bumps.
Puppeteer / Chromium (hard dependency)
This package depends on puppeteer (pinned major) so hosts get a known renderer.
Ops impact
- First install / Docker build downloads Chromium (~170–300+ MB depending on platform).
- One shared
PdfBrowserPoolper process: expect meaningful RSS for the browser process plusmaxPagesconcurrent tabs. - Set
executablePath(orPUPPETEER_EXECUTABLE_PATH) in containers; prefer the image’s system Chromium when bundling your own.
Do not also depend on another Chromium stack (puppeteer, puppeteer-core, playwright) in the same host process unless everything shares one pool. Duplicate browsers double image size and RSS. For recurring foot-guns, add a CI grep / postinstall sanity check for a second Chromium dependency (not enforced in v0).
Host wiring
import {
registerInvoicePlugin,
INVOICE_PLUGIN_TOKEN,
getInvoiceOrmMetadata,
} from 'multivendor-invoice';
const plugin = registerInvoicePlugin({
dataSource: connection,
// ports + pdf/storage config…
});Use getInvoiceOrmMetadata() when INVOICE_ENGINE=package. Keep host entity classes while INVOICE_ENGINE=host so ORM metadata is not switched before package code serves traffic.
Migration continuity
The package exports CreateInvoiceSubsystem1801000000000 — same class name as the historical server migration. Before removing the server copy, verify each environment:
SELECT * FROM migrations WHERE name LIKE '%CreateInvoiceSubsystem%';Publish tags
invoice-v* (e.g. invoice-v0.0.1).
