turbo-html2pdf 0.8.3 → 0.8.5

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/README.md CHANGED
@@ -202,7 +202,7 @@ fs.writeFileSync('out.pdf', pdf) // %PDF-1.7
202
202
 
203
203
  ## Status
204
204
 
205
- `v0.8.3` is the release version for npm, PyPI and crates.io; registry
205
+ `v0.8.5` is the release version for npm, PyPI and crates.io; registry
206
206
  verification follows the root `PUBLISHING.md`. The core engine is heavily tested (the `turbo-html2pdf-core`
207
207
  crate holds 100% line coverage with a cyclomatic-complexity ≤ 5 gate). Bindings:
208
208
  Node (N-API), WebAssembly and Python (PyO3), plus the Rust MCP server. See [`docs/`](https://github.com/miaskiewicz/turbo-html2pdf/blob/main/docs/) for the full guide and
package/index.d.ts CHANGED
@@ -225,6 +225,9 @@ export interface Program {
225
225
  hasFooter(): boolean;
226
226
  }
227
227
 
228
+ /** Version embedded in the compiled native engine (detects stale local addons). */
229
+ export function version(): string;
230
+
228
231
  /** Compile a template into a reusable {@link Program}. Throws `TurboPdfError`. */
229
232
  export function compile(templateHtml: string, opts?: CompileOptions): Program;
230
233
 
package/index.js CHANGED
@@ -144,6 +144,7 @@ const layoutBoxes = guard((html, css, width, height) =>
144
144
  const stamp = guard((pdf, opts) => native.stamp(pdf, opts));
145
145
 
146
146
  module.exports = {
147
+ version: native.version,
147
148
  compile,
148
149
  render,
149
150
  appendPdf,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turbo-html2pdf",
3
- "version": "0.8.3",
3
+ "version": "0.8.5",
4
4
  "description": "Fast native HTML/CSS + Jinja templating to PDF for Node — no headless browser, no Chromium.",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
package/src/lib.rs CHANGED
@@ -41,6 +41,12 @@ use turbo_html2pdf_core::{
41
41
 
42
42
  use convert::{build_registry, diagnostics_to_js, JsDiagnostic, JsFont, JsImage, MapResolver};
43
43
 
44
+ /// Version of the compiled native engine, independent of JavaScript package metadata.
45
+ #[napi]
46
+ pub fn version() -> String {
47
+ env!("CARGO_PKG_VERSION").to_owned()
48
+ }
49
+
44
50
  /// Options for a single render pass. All fields are optional; omit what you do
45
51
  /// not need. `data` defaults to `null`, `css` to empty, `fonts`/`images` to empty.
46
52
  #[napi(object)]
Binary file
Binary file
Binary file
Binary file
Binary file