Skip to content

docs: cover the PDF module where the docs already look for it - #47

Merged
Fl0p merged 5 commits into
mainfrom
docs/pdf-coverage
Aug 30, 2026
Merged

docs: cover the PDF module where the docs already look for it#47
Fl0p merged 5 commits into
mainfrom
docs/pdf-coverage

Conversation

@Fl0p

@Fl0p Fl0p commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

The PDF export shipped with its own guide (docs/pdf-export.md), a homepage card and a README bullet. What it never got was a mention on the three pages a reader consults about the library rather than about the feature — so someone reading the CLI reference, the architecture tour or the test inventory would not learn the module exists.

What this closes

  • docs/cli.md — the Invoices section listed every ksef invoice subcommand except pdf. It now has the same treatment as its siblings: what it does (offline, document kind auto-detected), worked examples, a table of all 16 flags with their defaults, and the one thing that bites — rendering needs the optional pdfmake peer, without which the command exits with an install hint instead of writing a file.
  • docs/architecture.md — every layer was walked except src/pdf/. Added to the Source Layout, plus a section in the shape of the neighbouring ones: a file-by-file table, and the three facts that are not obvious from the tree — it is the only layer KSeFClient does not reach and the package root does not export, its templates are data rather than script, and each entry point being bundled on its own is what decides how its errors are caught.
  • docs/tests.md — the suite table stopped at spec 34. Specs 35 and 36 are in, with a note on why they are the two that authenticate against nothing, need yarn build first, and deliberately leave a reviewable set of pages in .pdf-preview/. The unit coverage table gained its pdf row (29 files), and the counts now match what the suite actually runs — they had been carrying numbers from several releases ago.

Notes

Every flag, default, template name and count was read off the current code or a run of it, not off the feature guide. --template really does accept the UPO layouts, which is why all five built-ins are listed — checked by rendering one.

Docs only: no source, no tests, no behaviour. markdownlint clean.

Heads-up for whoever merges second: feat/pdf-browser-ready also edits architecture.md and tests.md, so one of the two branches will need a rebase over the other.

🤖 Generated with Claude Code

https://claude.ai/code/session_01M7sLete4AKPr5oHz2cMFqM

Summary by CodeRabbit

  • Documentation
    • Added architecture documentation for the PDF rendering layer, including its offline operation and dedicated PDF entry point.
    • Documented the ksef invoice pdf CLI command, supported options, and PDF export examples.
    • Updated testing documentation with expanded PDF coverage and end-to-end test details.

The PDF export shipped with its own guide, a homepage card and a README
bullet, but the three pages a reader consults *about* the library rather than
about the feature never learned it existed: the CLI reference listed every
`ksef invoice` subcommand except `pdf`, the architecture page walked every
layer except `src/pdf/`, and the test inventory stopped at spec 34 while
carrying unit counts from several releases ago.

- CLI: `ksef invoice pdf` gets the section its siblings have — what it does
  offline, the flag table, and the optional peer it needs to render at all.
- Architecture: the PDF layer alongside the others, said plainly to be the one
  layer `KSeFClient` does not reach and the package root does not export, with
  the entry-point split that follows from `pdfmake` being optional — including
  what that split means for catching its errors.
- Tests: specs 35 and 36 in the suite table, a note on why they are the two
  that authenticate against nothing and leave a reviewable set of pages
  behind, the `pdf` row in the unit coverage table, and counts that match what
  the suite actually runs today.

Every flag, default, template name and count here was read off the current
code or a run of it, not off the feature guide.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M7sLete4AKPr5oHz2cMFqM
@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

Next included review available in 38 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: cd79fd32-b972-421a-b52c-bbb500b42e70

📥 Commits

Reviewing files that changed from the base of the PR and between 1e3ad8b and 3642d39.

📒 Files selected for processing (3)
  • packages/ksef-client-ts/CHANGELOG.md
  • packages/ksef-client-ts/docs/architecture.md
  • packages/ksef-client-ts/docs/cli.md

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: adea396f-8143-4043-a88d-a9671e0014c2

📥 Commits

Reviewing files that changed from the base of the PR and between 9dc906c and 1e3ad8b.

📒 Files selected for processing (3)
  • packages/ksef-client-ts/docs/architecture.md
  • packages/ksef-client-ts/docs/cli.md
  • packages/ksef-client-ts/docs/tests.md

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The documentation adds the PDF rendering layer to the architecture guide, documents the ksef invoice pdf command and flags, and updates unit and end-to-end test coverage for PDF rendering.

Changes

PDF documentation

Layer / File(s) Summary
PDF layer architecture
packages/ksef-client-ts/docs/architecture.md
Documents the src/pdf/ layer, its entry point, optional pdfmake peer behavior, files, template DSL, and error identity.
PDF CLI and validation documentation
packages/ksef-client-ts/docs/cli.md, packages/ksef-client-ts/docs/tests.md
Documents the PDF CLI command and flags. Updates unit-test totals and adds CLI and library PDF end-to-end suites.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to 1e3ad

This documentation-only change adds PDF coverage to the CLI, architecture, and test guides without changing product behavior; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately identifies the documentation-only change that adds coverage for the PDF module across the CLI, architecture, and test documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (3 skipped: 3 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/pdf-coverage

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

FlopBut and others added 4 commits August 30, 2026 23:40
The section has carried everything it is going to carry, so it stops being
"Unreleased" and names the day it goes out.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M7sLete4AKPr5oHz2cMFqM
The PDF section told the reader to run `npm i "pdfmake@^0.2.20"`, two screens
below the page's own instruction to install the CLI globally. The peer is
resolved from the installed package's location, not from the working
directory, so that combination installs pdfmake somewhere the CLI never looks
and the command keeps reporting a missing peer.

Both forms are now given, with the rule that decides between them. Checked by
resolving `pdfmake/build/pdfmake.js` from a package placed in a global-style
tree: it finds a peer installed beside it, which is what `npm i -g` produces,
and a project-local install in some other directory is not on that search path
at all.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M7sLete4AKPr5oHz2cMFqM
The PDF layer table said the document version comes from the namespace the
root element is bound to. That is true of a UPO and false of an invoice: an
invoice is read from the kodSystemowy attribute on KodFormularza and from
WariantFormularza, which must agree with each other, and a contributor going
by this line would have looked for a namespace check that is not there.

Both mechanisms are now stated separately, matching detectInvoiceVersion and
detectUpoVersion in src/pdf/parse.ts.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M7sLete4AKPr5oHz2cMFqM
"A template can only name paths the document already carries" described half
of what a template sees. The renderer also exposes the resolved options and
the flags derived from them, and the shipped layouts lean on both: the header
prints a logo it was handed, the totals gate on which reading of P_15 this
document supports, the page marks itself OFFLINE when no KSeF number was
given. A reader taking the old sentence at face value would think none of that
was possible without a code change.

The claim that matters — data, not script — is unchanged, and now says what
the data covers.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M7sLete4AKPr5oHz2cMFqM
@Fl0p
Fl0p merged commit d31b19a into main Aug 30, 2026
9 checks passed
@Fl0p
Fl0p deleted the docs/pdf-coverage branch August 30, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant