turbo-html2pdf 0.1.7 → 0.2.1

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
@@ -201,7 +201,7 @@ fs.writeFileSync('out.pdf', pdf) // %PDF-1.7
201
201
 
202
202
  ## Status
203
203
 
204
- `v0.1.7`. The core engine is complete and heavily tested (the `turbo-pdf-core`
204
+ `v0.2.1`. The core engine is complete and heavily tested (the `turbo-pdf-core`
205
205
  crate holds 100% line coverage with a cyclomatic-complexity ≤ 5 gate). Bindings:
206
206
  Node (napi) and WebAssembly. See [`docs/`](https://github.com/miaskiewicz/turbo-html2pdf/blob/main/docs/) for the full guide and
207
207
  [`benches/competitive/`](https://github.com/miaskiewicz/turbo-html2pdf/blob/main/benches/competitive/) for the benchmark harness.
package/index.d.ts CHANGED
@@ -1,8 +1,12 @@
1
1
  /* turbo-pdf N-API binding — TypeScript surface (Phase 10).
2
2
  *
3
- * Hand-maintained to mirror the `#[napi]` exports in `src/lib.rs`. When the repo
4
- * gains a `napi build` step in CI this can be regenerated; the shapes below are
5
- * the contract callers depend on. */
3
+ * Hand-maintained to mirror the `#[napi]` exports in `src/lib.rs`. The shapes
4
+ * below are the contract callers depend on — richer than napi's auto-codegen
5
+ * (`Span`, `TurboPdfError`, `CompileOptions`, `unknown` over `any`).
6
+ *
7
+ * Do NOT let `napi build` overwrite this file. The `build`/`build:debug` scripts
8
+ * redirect codegen to `index.generated.d.ts` (git-ignored) via `--dts`. If you
9
+ * run `napi build` by hand, pass `--dts index.generated.d.ts` too. */
6
10
 
7
11
  /** A source location: 1-based line/column (0 when unknown) and byte offset. */
8
12
  export interface Span {
package/index.js CHANGED
@@ -4,6 +4,11 @@
4
4
  * surface so that fatal faults surface as a typed `TurboPdfError` (carrying
5
5
  * `.code` and `.span`) instead of a bare Error. Non-fatal lints are returned in
6
6
  * `result.diagnostics` by the native layer and are passed through untouched.
7
+ *
8
+ * Do NOT let `napi build` overwrite this file — its plain loader has no
9
+ * `TurboPdfError` wrapper. The build scripts redirect codegen to
10
+ * `index.generated.js` (git-ignored) via `--js`; pass that flag if running
11
+ * `napi build` by hand.
7
12
  */
8
13
 
9
14
  "use strict";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turbo-html2pdf",
3
- "version": "0.1.7",
3
+ "version": "0.2.1",
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",
@@ -41,8 +41,8 @@
41
41
  }
42
42
  },
43
43
  "scripts": {
44
- "build": "napi build --platform --release",
45
- "build:debug": "napi build --platform",
44
+ "build": "napi build --platform --release --dts index.generated.d.ts --js index.generated.js",
45
+ "build:debug": "napi build --platform --dts index.generated.d.ts --js index.generated.js",
46
46
  "build:cargo": "cargo build -p turbo-pdf-napi --release && node scripts/copy-addon.mjs",
47
47
  "test": "node --test __test__/*.test.mjs",
48
48
  "test:rust": "cargo test -p turbo-pdf-napi"
Binary file
Binary file
Binary file
Binary file
Binary file