Skip to content

Commit cfccfe4

Browse files
authored
Merge pull request #129 from hajareshyam/feat/2.4.0-dx-validation-helpers
Release v2.4.0: DX improvements, validation, optional Handlebars helpers, tests & CI
2 parents 8157584 + 15e9c69 commit cfccfe4

23 files changed

Lines changed: 2475 additions & 1896 deletions

.github/workflows/ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master, main]
6+
pull_request:
7+
branches: [master, main]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: [18.x, 20.x, 22.x]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
cache: npm
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Build
29+
run: npm run build
30+
31+
- name: Test
32+
run: npm test

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
node_modules/
22
.package-lock.json
3+
dist/
4+
example/output.pdf
35

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Changelog
2+
3+
## [2.4.0] — 2026-04-03
4+
5+
### Added
6+
7+
- Clear validation errors for missing `html`, `data`, or `path` (when writing a file).
8+
- `document.data` can be any value except `null`/`undefined` (e.g. `0` is allowed).
9+
- Optional `handlebarsHelpers` on PDF options to register extra Handlebars helpers for that render (isolated `Handlebars.create()` instance).
10+
- Stricter TypeScript types: `PdfDocumentFile`, `PdfDocumentBuffer`, `PdfDocumentStream`, and a `PdfDocument` union.
11+
- `src/validation.ts` with `validatePdfDocument()` (used internally).
12+
- Automated tests (`npm test`) and GitHub Actions CI.
13+
- `engines.node` set to `>=18`.
14+
15+
### Changed
16+
17+
- Template compile/render errors are wrapped with prefix `pdf-creator-node: template rendering failed:`.
18+
- README: corrected `ifCond` HTML example, TypeScript usage, optional helpers, and license line (`package.json` `license` set to **MIT** to match `LICENSE`).
19+
- `package.json` keywords deduplicated.
20+
21+
## Earlier releases
22+
23+
See git history for changes before this changelog was added.

docs/.nojekyll

Whitespace-only changes.

0 commit comments

Comments
 (0)