pretext-pdf 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/README.md +1 -1
- package/package.json +7 -3
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,50 @@ Format: [Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/)
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## [1.0.9] — 2026-05-06
|
|
11
|
+
|
|
12
|
+
Test coverage Phase 2: filling blind spots in the CLI, the pdfmake compat shim, and
|
|
13
|
+
the performance regression guard. Adds c8 coverage tooling for measurability.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **`test/cli.test.ts`** (+13 tests) — End-to-end coverage for the `pretext-pdf` CLI binary,
|
|
18
|
+
spawning `dist/cli.js` as a subprocess. Covers argument parsing (`--version`, `--help`,
|
|
19
|
+
`-i/-o/--markdown/--code-font`, positional fallback, unknown flags), JSON and Markdown
|
|
20
|
+
input modes, stdin/stdout piping, and exit codes 0/1/2.
|
|
21
|
+
|
|
22
|
+
- **`test/compat.test.ts`** (+34 tests) — Coverage for the pdfmake → pretext-pdf
|
|
23
|
+
translation shim (`fromPdfmake`). Covers page setup (pageSize string and object,
|
|
24
|
+
pageMargins scalar/2-tuple/4-tuple, orientation), styles (defaultStyle, named styles,
|
|
25
|
+
headingMap override), all content node types (string, `text`, `ul`/`ol` with nesting,
|
|
26
|
+
`table` with header rows, `image`, `qr`, `pageBreak`, `stack`), header/footer string
|
|
27
|
+
forms, integration render, and unsupported nodes (`columns`, `canvas`).
|
|
28
|
+
|
|
29
|
+
- **c8 coverage tooling** — `npm run coverage` (text + lcov reporters) and
|
|
30
|
+
`npm run coverage:check` (75/65/75 thresholds, non-blocking in CI initially).
|
|
31
|
+
Configuration in `.c8rc.json` excludes type-only files and CLI from instrumentation.
|
|
32
|
+
Coverage step added to CI as `continue-on-error: true` while baseline thresholds
|
|
33
|
+
are calibrated.
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
|
|
37
|
+
- **`test/benchmark-baseline.test.ts`: regression guard now actually guards** —
|
|
38
|
+
Replaced the prior "TODO: enable when baseline is calibrated" stub (which collected
|
|
39
|
+
timings but asserted nothing) with a real 3x-baseline-with-500ms-floor budget per
|
|
40
|
+
corpus. Missing corpora in the baseline JSON now `assert.fail()` instead of silently
|
|
41
|
+
defaulting to a zero budget that would mask any regression.
|
|
42
|
+
|
|
43
|
+
- **CONTRIBUTING.md: removed stale "(676 tests)" annotation** — Test count drift bait;
|
|
44
|
+
the README badge already auto-verifies via `verify:badges`.
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
|
|
48
|
+
- **Test runner now builds first** — Added `pretest:unit: npm run build` so contributors
|
|
49
|
+
running `npm run test:unit` always get a fresh dist; the new CLI tests spawn the
|
|
50
|
+
compiled binary and would otherwise fail with a confusing module-not-found error.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
10
54
|
## [1.0.8] — 2026-05-06
|
|
11
55
|
|
|
12
56
|
Public API contract integrity: the `RenderOptions.logger` option now actually does what
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
[](https://www.npmjs.com/package/pretext-pdf)
|
|
10
10
|
[](https://github.com/Himaan1998Y/pretext-pdf/actions)
|
|
11
11
|
[](https://www.typescriptlang.org/)
|
|
12
|
-
[](#tests)
|
|
13
13
|
[](LICENSE)
|
|
14
14
|
[](#runtime-footprint)
|
|
15
15
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pretext-pdf",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "Generate PDFs from JSON — declarative, serverless, no Chromium. TypeScript-first with professional typography. Ideal for invoices, reports, and AI agents.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pdf",
|
|
@@ -88,7 +88,8 @@
|
|
|
88
88
|
"build": "tsc",
|
|
89
89
|
"api:extract": "api-extractor run --local",
|
|
90
90
|
"api:check": "api-extractor run",
|
|
91
|
-
"test:unit": "tsx --test test/validate.test.ts test/validate-document.test.ts test/builder.test.ts test/rich-text.test.ts test/layout-contract.test.ts test/hard-text-contract.test.ts test/validate-strict.test.ts test/logger-routing.test.ts",
|
|
91
|
+
"test:unit": "tsx --test test/validate.test.ts test/validate-document.test.ts test/builder.test.ts test/rich-text.test.ts test/layout-contract.test.ts test/hard-text-contract.test.ts test/validate-strict.test.ts test/logger-routing.test.ts test/compat.test.ts test/cli.test.ts",
|
|
92
|
+
"pretest:unit": "npm run build",
|
|
92
93
|
"test:validate": "tsx --test test/validate.test.ts test/builder.test.ts",
|
|
93
94
|
"test:e2e": "tsx --test test/e2e.test.ts",
|
|
94
95
|
"test:phase-3": "tsx --test test/signatures-validation.test.ts",
|
|
@@ -109,6 +110,8 @@
|
|
|
109
110
|
"test:contract": "tsx --test test/pretext-api-contract.test.ts test/benchmark-baseline.test.ts test/drift-guards.test.ts test/plugin-registry.test.ts test/benchmark-corpora.test.ts test/smoke-staging.test.ts test/table-determinism.test.ts",
|
|
110
111
|
"test:2f": "cross-env NODE_OPTIONS=--max-old-space-size=4096 tsx --test test/stress.test.ts",
|
|
111
112
|
"test": "npm run test:contract && npm run test:unit && npm run test:e2e && npm run test:phases",
|
|
113
|
+
"coverage": "c8 --reporter=text --reporter=lcov npm test",
|
|
114
|
+
"coverage:check": "c8 check-coverage --lines 75 --branches 65 --functions 75",
|
|
112
115
|
"verify:badges": "cross-env SKIP_TEST_RUN=1 node scripts/verify-badges.js",
|
|
113
116
|
"verify:badges:full": "node scripts/verify-badges.js",
|
|
114
117
|
"test:rich": "tsx --test test/rich-text.test.ts",
|
|
@@ -128,7 +131,7 @@
|
|
|
128
131
|
"example:callout": "tsx examples/phase8-callout.ts",
|
|
129
132
|
"example:gst": "tsx examples/gst-invoice-india.ts",
|
|
130
133
|
"example:plugin": "tsx examples/plugin-custom-element.ts",
|
|
131
|
-
|
|
134
|
+
"example:floats": "tsx examples/phase9b-float-groups.ts",
|
|
132
135
|
"example:showcase-invoice": "tsx examples/showcase-invoice.ts",
|
|
133
136
|
"example:showcase-report": "tsx examples/showcase-report.ts",
|
|
134
137
|
"example:showcase-resume": "tsx examples/showcase-resume.ts",
|
|
@@ -190,6 +193,7 @@
|
|
|
190
193
|
"@types/pngjs": "^6.0.5",
|
|
191
194
|
"@types/qrcode": "^1.5.6",
|
|
192
195
|
"bwip-js": "^4.9.2",
|
|
196
|
+
"c8": "^10.1.3",
|
|
193
197
|
"cross-env": "^10.1.0",
|
|
194
198
|
"highlight.js": "^11.11.1",
|
|
195
199
|
"marked": "^18.0.2",
|