Skip to content

Commit 26e4305

Browse files
committed
fix: harden rendering contracts and format support
1 parent 5b491a4 commit 26e4305

31 files changed

Lines changed: 761 additions & 66 deletions

CHANGELOG.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@ All notable changes to this project are documented here.
44
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/);
55
this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [Unreleased]
8+
9+
## [0.1.1] - 2026-08-13
10+
11+
### Fixed
12+
13+
- Publish declarations with an explicit Node type reference so strict TypeScript 7 consumers can
14+
resolve the public `Buffer` APIs without changing their compiler options.
15+
- Validate SDK render options, plan inputs and custom engine output at runtime, returning
16+
`DeckRenderError` instead of forwarding invalid values or exposing Node argument errors.
17+
- Isolate DeckRender, DeckFlow and DeckOps configuration plus credential environment variables in
18+
CLI end-to-end tests.
19+
- Correct the legacy Office support matrix: `.doc` is unsupported, while `.ppt` supports image and
20+
video output; `.ppt` to PDF remains planned pending a `.pptx` normalization step.
21+
722
## [0.1.0] - 2026-08-07
823

924
First release.
@@ -14,10 +29,12 @@ First release.
1429

1530
| Input | → image | → pdf | → video |
1631
| ------------------- | ------- | ----- | ------- |
17-
| `.pptx` `.ppt` ||||
32+
| `.pptx` ||||
33+
| `.ppt` || 🕓 ||
1834
| `.pdf` ||| 🕓 |
1935
| `.key` ||| 🕓 |
20-
| `.docx` `.doc` ||||
36+
| `.docx` ||||
37+
| `.doc` ||||
2138
| `.xlsx` | 🕓 | 🕓 ||
2239
| `.pages` `.numbers` ||||
2340
| `.html` and URLs ||||
@@ -62,4 +79,6 @@ output and diffs the result against the documented matrix. Several conversions
6279
that looked plausible from the type definitions turned out not to work, so the
6380
matrix reflects measurement rather than inference.
6481

82+
[Unreleased]: https://github.com/deckflow/deckrender/compare/v0.1.1...HEAD
83+
[0.1.1]: https://github.com/deckflow/deckrender/compare/v0.1.0...v0.1.1
6584
[0.1.0]: https://github.com/deckflow/deckrender/releases/tag/v0.1.0

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,12 @@ deckrender formats
7676
7777
| Input | → image | → pdf | → video |
7878
| -------------- | ------- | ----- | ------- |
79-
| `.pptx` `.ppt` ||||
79+
| `.pptx` ||||
80+
| `.ppt` || 🕓 ||
8081
| `.pdf` ||| 🕓 |
8182
| `.key` ||| 🕓 |
82-
| `.docx` `.doc` ||||
83+
| `.docx` ||||
84+
| `.doc` ||||
8385
| `.xlsx` | 🕓 | 🕓 ||
8486
| `.pages` ||||
8587
| `.numbers` ||||
@@ -92,6 +94,9 @@ Image output supports `png`, `jpg` and `webp` via `--image-format`.
9294
9395
Pages and Numbers render their embedded first-page preview — see [`docs/formats.md`](docs/formats.md) for that and the other per-format notes.
9496
97+
Legacy Word `.doc` files are not supported. Save them as `.docx` or export them to PDF first.
98+
Legacy PowerPoint `.ppt` files support image and video output; PDF conversion is still planned.
99+
95100
Full detail, including which flags each route accepts: [`docs/formats.md`](docs/formats.md).
96101
97102
## Authentication is optional

docs/cli.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ Frame numbers are zero-padded to at least three digits, widening for documents p
7878

7979
## Sizing
8080

81-
`--width` sets the long edge directly. `--scale` multiplies the route's own base — 1920 for slides, 1080 for PDF.
81+
`--width` sets the long edge directly and accepts integer values from 1 to 32768. `--scale`
82+
multiplies the route's own base — 1920 for slides, 1080 for PDF — and accepts values greater
83+
than 0 up to 16. `--timeout` accepts whole seconds from 1 to 86400.
8284

8385
`convertor.ppt2image` only accepts 1080, 1920 or 2560, so other values snap to the nearest tier and the chosen value is reported on stderr:
8486

@@ -104,7 +106,8 @@ deckrender report.pdf --pages 1,3,5-7
104106
deckrender deck.pptx --page 3
105107
```
106108

107-
Pages are 1-based and ranges are inclusive. Requesting a page past the end of the document is an error.
109+
Pages are 1-based, capped at 100000, and ranges are inclusive. Requesting a page past the end of
110+
the document is an error.
108111

109112
`--pages` filters at download time — **the backend still renders every page**, so this saves bandwidth and disk, not compute or cost. It does not apply to single-file output (pdf, video) or to HTML and Markdown, which produce one image.
110113

docs/configuration.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,15 @@ deckrender config set width 2560
9090
deckrender config unset width
9191
```
9292

93-
| Key | Values |
94-
| ------------------------- | ------------------------------------------- |
95-
| `profile` | `web`, `presentation`, `print`, `thumbnail` |
96-
| `format` | `image`, `pdf`, `video` |
97-
| `image-format` | `png`, `jpg`, `webp` |
98-
| `quality` | `low`, `medium`, `high` |
99-
| `width` `scale` `timeout` | numbers |
93+
| Key | Values |
94+
| -------------- | ------------------------------------------- |
95+
| `profile` | `web`, `presentation`, `print`, `thumbnail` |
96+
| `format` | `image`, `pdf`, `video` |
97+
| `image-format` | `png`, `jpg`, `webp` |
98+
| `quality` | `low`, `medium`, `high` |
99+
| `width` | integer from `1` to `32768` |
100+
| `scale` | number greater than `0`, up to `16` |
101+
| `timeout` | integer seconds from `1` to `86400` |
100102

101103
Precedence, lowest first:
102104

@@ -120,6 +122,7 @@ Redirect config to a scratch directory when you need isolation:
120122
```bash
121123
export DECKFLOW_CONFIG_DIR=/tmp/deckflow
122124
export DECKRENDER_CONFIG_DIR=/tmp/deckrender
125+
export DECKOPS_CONFIG_DIR=/tmp/deckops
123126
```
124127

125128
## File permissions

docs/formats.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ deckrender formats --json # machine-readable, includes the backend task chain
99

1010
| Input | → image | → pdf | → video |
1111
| ----------------------- | ------- | ----- | ------- |
12-
| `.pptx` `.ppt` ||||
12+
| `.pptx` ||||
13+
| `.ppt` || 🕓 ||
1314
| `.pdf` ||| 🕓 |
1415
| `.key` ||| 🕓 |
15-
| `.docx` `.doc` ||||
16+
| `.docx` ||||
17+
| `.doc` ||||
1618
| `.xlsx` | 🕓 | 🕓 ||
1719
| `.pages` ||||
1820
| `.numbers` ||||
@@ -45,7 +47,7 @@ Not every option applies everywhere. What a route can honour depends on how the
4547
| ------------------- | ---------------------------- | ---------------- | ----------- |
4648
| `.pptx` `.ppt` | ✅ snapped to 1080/1920/2560 | png, jpg, webp ||
4749
| `.pdf` | ✅ any value | png, jpg, webp ||
48-
| `.docx` `.doc` | ✅ any value | png, jpg, webp ||
50+
| `.docx` | ✅ any value | png, jpg, webp ||
4951
| `.key` || png, webp ||
5052
| `.html` and URLs || png, webp | ✗ one image |
5153
| `.md` || png, webp | ✗ one image |
@@ -57,9 +59,17 @@ PDF and video output accept no sizing, encoding, quality or page options — the
5759

5860
## Per-format notes
5961

60-
Everything in the matrix works. These notes are about what the output _is_ — the
62+
Everything marked ✅ in the matrix works. These notes are about what the output _is_ — the
6163
cases where the result differs from a plain full-fidelity render.
6264

65+
### Legacy Office formats
66+
67+
Legacy PowerPoint `.ppt` files render to images and video. PDF output is planned but not currently
68+
supported: the reliable route needs to normalize `.ppt` to `.pptx` before PDF conversion.
69+
70+
Legacy Word `.doc` files are not supported by the backend converter. Save them as `.docx` or export
71+
them to PDF before rendering.
72+
6373
### Pages and Numbers — first page only
6474

6575
These render the preview iWork embeds in the document, which covers the **first

docs/roadmap.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
## v0.1 — shipped
44

5-
- `pptx` `ppt` `pdf` `key` `docx` `doc` `html` `md` and URLs → image and PDF
6-
- `pptx` `ppt` → video
5+
- `pptx` `pdf` `key` `docx` `html` `md` and URLs → image and PDF
6+
- `ppt` → image and video
7+
- `pptx` → video
78
- Cloud engine over `@deckops/sdk`
89
- Profiles, `--json` envelope, page selection, zip and stdout output
910
- Credentials shared with DeckHTML and DeckOps; guest mode without login
@@ -24,6 +25,7 @@ Combinations the CLI marks `soon` and reports as `not_implemented`:
2425

2526
| Combination | Blocked on |
2627
| -------------------- | ------------------------------------------------------------------------------------------------------------------ |
28+
| `.ppt` → pdf | Normalize the legacy binary file to `.pptx` before invoking the stable PDF converter. |
2729
| `.xlsx` → image, pdf | A spreadsheet layout engine. A workbook needs a real layout pass — not something to fake from an embedded preview. |
2830
| `.pdf` → video | Local frame assembly (ffmpeg), not bundled. |
2931
| `.key` → video | Local frame assembly (ffmpeg), not bundled. |

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@deckflow/deckrender",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Render any document format into visual artifacts. PPTX, PDF, DOCX, Keynote, HTML and Markdown to images, PDF or video.",
55
"type": "module",
66
"main": "./dist/index.js",
@@ -28,12 +28,13 @@
2828
"test:integration": "vitest run tests/integration",
2929
"test:e2e": "vitest run tests/e2e",
3030
"test:cloud": "vitest run tests/e2e/cloud.test.ts",
31+
"test:consumer": "node node_modules/typescript-7/bin/tsc -p tests/consumer/tsconfig.json",
3132
"test:conformance": "node scripts/conformance.mjs",
3233
"test:coverage": "vitest run --coverage",
3334
"lint": "eslint src tests --ext .ts",
3435
"format": "prettier --write 'src/**/*.ts' 'tests/**/*.ts'",
35-
"typecheck": "tsc --noEmit",
36-
"check": "pnpm typecheck && pnpm lint && pnpm test:unit && pnpm test:integration"
36+
"typecheck": "node node_modules/typescript/bin/tsc --noEmit",
37+
"check": "pnpm typecheck && pnpm lint && pnpm test:unit && pnpm test:integration && pnpm build && pnpm test:consumer"
3738
},
3839
"keywords": [
3940
"cli",
@@ -58,6 +59,7 @@
5859
},
5960
"dependencies": {
6061
"@deckops/sdk": "^0.7.3",
62+
"@types/node": "^20.10.0",
6163
"chalk": "^5.3.0",
6264
"commander": "^11.1.0",
6365
"open": "^11.0.0",
@@ -66,14 +68,14 @@
6668
"zod": "^3.22.0"
6769
},
6870
"devDependencies": {
69-
"@types/node": "^20.10.0",
7071
"@typescript-eslint/eslint-plugin": "^6.13.0",
7172
"@typescript-eslint/parser": "^6.13.0",
7273
"@vitest/coverage-v8": "^1.0.0",
7374
"eslint": "^8.55.0",
7475
"prettier": "^3.1.0",
7576
"tsup": "^8.0.0",
7677
"typescript": "^5.3.0",
78+
"typescript-7": "npm:typescript@7.0.2",
7779
"vitest": "^1.0.0"
7880
},
7981
"engines": {

0 commit comments

Comments
 (0)