Skip to content

v0.10.0: fs-free environment-agnostic core + ksef-client-ts/node entry (GH#24)#31

Merged
Fl0p merged 10 commits into
mainfrom
flo-240-fs-free-core
Jun 14, 2026
Merged

v0.10.0: fs-free environment-agnostic core + ksef-client-ts/node entry (GH#24)#31
Fl0p merged 10 commits into
mainfrom
flo-240-fs-free-core

Conversation

@Fl0p

@Fl0p Fl0p commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Consolidated PR for GH#24 / FLO-240 — make the ksef-client-ts core environment-agnostic (Node/Deno/browser/edge) by moving all filesystem- and native-binding-dependent features behind a dedicated ksef-client-ts/node subpath export.

What changed

Unit Issue PR Summary
A FLO-244 #27 fs-free root barrel + new ksef-client-ts/node entry point
B FLO-245 #28 CI guard: assert core bundles contain no fs/native-binding leaks
C FLO-246 #29 /node subpath resolution tests (ESM + CJS + types)
D FLO-247 #30 docs, README, CHANGELOG & v0.10.0 migration guide

Breaking change (v0.10.0)

Node-only symbols are no longer exported from the main entry. Import them from ksef-client-ts/node instead:

  • FileOfflineInvoiceStorage, FileHwmStore
  • validateAgainstXsd, resolveXsdFor, FA_XSD_PATHS, PEF_XSD_PATHS, libxmljsAvailable, isMissingLibxmljsError

Crypto signing modules (loginWithCertificate / loginWithPkcs12) are now dynamically imported to keep the core bundle small — public API unchanged.

Migration guide: packages/ksef-client-ts/docs/migration-v0.10.md

Local validation (integration branch)

  • yarn lint (tsc --noEmit) ✓
  • yarn build ✓ — emits dual index + node entries (ESM/CJS/DTS)
  • yarn test ✓ — 2167 unit tests pass, including node-subpath (24) and fs-cleanliness guard

Notes for review

  • Minor follow-up nit (non-blocking): the CHANGELOG async-crypto bullet names methods, slightly against our "no method names in CHANGELOG" rule — can be reworded before tagging the release.

Closes FLO-244, FLO-245, FLO-246, FLO-247.

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes v0.10.0

  • Breaking Changes

    • Node-specific features (FileOfflineInvoiceStorage, FileHwmStore, validateAgainstXsd) are now imported from ksef-client-ts/node.
  • New Features

    • The main entry is “fs-free core” and works across Node.js, Deno, and edge environments.
    • Smaller core with cryptographic signing modules loaded on demand.
  • Documentation

    • Added a v0.10 migration guide and updated examples/imports across the docs.
  • Quality & CI

    • Improved CI verification, including stricter checks for fs-free core bundles and ksef-client-ts/node type exports.

Fl0p and others added 4 commits June 14, 2026 20:10
Unit A of GH#24: move fs-backed symbols out of the root barrel into a dedicated `ksef-client-ts/node` entry, keeping the core import fs-free.

- Drop FileOfflineInvoiceStorage, the xsd-validator block, and FileHwmStore from the sub-barrels so root `export *` no longer re-exports them.
- Add src/node.ts re-exporting exactly those symbols from their deep modules.
- package.json: sideEffects:false, `./node` export (import/require + types), version 0.9.1 → 0.10.0.
- tsup.config.ts: add src/node.ts as a library entry with its own dts.

Verified by Daedalus: build emits dist/node.{js,cjs,d.ts,d.cts}; root bundle has 0 of the moved symbols, /node resolves all; lint clean; unit 2141 passed; e2e 115 passed.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
- 24 unit tests covering all moved symbols exported from ksef-client-ts/node
  in both ESM (import) and CJS (require) modes
- 8 additional tests asserting moved symbols are absent from the root barrel
- Type-check fixture (tests/fixtures/node-types-check.ts) compiled via
  tsconfig.node-check.json to prove node.d.ts and node.d.cts are wired correctly
- Lint script extended to include the node-check tsconfig pass

Co-authored-by: Daedalus <daedalus@agents.flopbut.local>
Co-authored-by: Paperclip <noreply@paperclip.ing>
Adds an fs-cleanliness guard asserting dist/index.js and dist/index.cjs contain no fs usage, with dist/node.js as a positive control. Wired into CI after build and into the vitest unit suite.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
…247) (#30)

Unit D of GH#24: repoint docs to ksef-client-ts/node, add v0.10.0 migration guide, CHANGELOG, README/index cards.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Fl0p, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 49 minutes and 12 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: ad7fb80b-2aff-4139-a5da-ef39dd80333e

📥 Commits

Reviewing files that changed from the base of the PR and between a5fd178 and be6fe9c.

📒 Files selected for processing (1)
  • packages/ksef-client-ts/docs/migration-v0.10.md
📝 Walkthrough

Walkthrough

Version 0.10.0 isolates Node.js-specific exports (FileOfflineInvoiceStorage, FileHwmStore, XSD validation symbols) from the main ksef-client-ts barrel into a new ksef-client-ts/node subpath. A new guard script enforces fs-cleanliness on built bundles, CI validates it, and documentation is updated throughout.

Changes

ksef-client-ts v0.10.0: Node-only export isolation

Layer / File(s) Summary
Remove Node-only symbols from core barrels
packages/ksef-client-ts/src/offline/index.ts, packages/ksef-client-ts/src/validation/index.ts, packages/ksef-client-ts/src/workflows/index.ts
FileOfflineInvoiceStorage, all XSD validator exports, and FileHwmStore are removed from their respective barrel re-exports, keeping the main bundle environment-agnostic.
New ksef-client-ts/node entry point and build wiring
packages/ksef-client-ts/src/node.ts, packages/ksef-client-ts/tsup.config.ts, packages/ksef-client-ts/package.json
src/node.ts re-exports all moved symbols. tsup.config.ts adds src/node.ts to the build entry. package.json bumps to 0.10.0, adds "sideEffects": false, registers the ./node exports subpath with import/require/types targets, and adds the check:node-types script.
fs-cleanliness guard script
packages/ksef-client-ts/scripts/check-fs-free-core.mjs
Defines regex patterns to detect fs references, findFsMarkers to test detection, readBundle to load bundle text, and checkFsFreeCore to verify core bundles are fs-free while node bundles contain fs markers.
CI build order and fs-cleanliness check
.github/workflows/ci.yml, package.json
Reorders CI steps so yarn build runs before yarn lint type-check. Adds "Check fs-free core bundles" step invoking the guard script after type-check and before test coverage. Root workspace adds check:node-types script delegation.
Type-check fixture and unit tests
packages/ksef-client-ts/tsconfig.node-check.json, packages/ksef-client-ts/tests/fixtures/node-types-check.ts, packages/ksef-client-ts/tests/unit/node-subpath.test.ts, packages/ksef-client-ts/tests/unit/utils/fs-free-core.test.ts
tsconfig.node-check.json scopes a Node16 type-check to the fixture file. node-types-check.ts validates compile-time shapes via InstanceType assertions. node-subpath.test.ts verifies ESM/CJS accessibility of moved symbols and their absence from the root barrel. fs-free-core.test.ts validates marker normalization and guard success.
Documentation updates
packages/ksef-client-ts/CHANGELOG.md, packages/ksef-client-ts/docs/migration-v0.10.md, packages/ksef-client-ts/docs/deno.md, packages/ksef-client-ts/docs/offline-mode.md, packages/ksef-client-ts/docs/workflows.md, packages/ksef-client-ts/docs/xml-serialization.md, packages/ksef-client-ts/README.md, packages/ksef-client-ts/docs/index.md, packages/ksef-client-ts/docs/.vitepress/config.ts
New migration guide with before/after import examples. Deno page rewritten for the new subpath model. Import snippets updated across offline-mode, workflows, and xml-serialization docs. README, docs index, and VitePress sidebar reflect the fs-free core isolation. CHANGELOG records breaking changes and bundle size improvements.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

Suggested labels

enhancement

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: making the ksef-client-ts core fs-free and adding a new /node entry point, with reference to the GitHub issue.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch flo-240-fs-free-core

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 and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/ksef-client-ts/CHANGELOG.md`:
- Line 16: The CHANGELOG entry for "Asynchronous crypto modules" contains method
names and implementation details that should be removed. Replace the specific
references to `loginWithCertificate` and `loginWithPkcs12` methods and the
"dynamically import" implementation detail with a user-focused description that
emphasizes the key benefits: reduced bundle size and transparent behavior for
users. Keep the message brief and remove technical "how" details, focusing
instead on the user-facing impact and what they need to know.
- Around line 9-12: The CHANGELOG entry for the Node.js-specific features
section includes excessive implementation details (specific class names like
FileOfflineInvoiceStorage and FileHwmStore, function names like
validateAgainstXsd, and import paths). Refactor this entry to focus on the
user-facing impact by explaining in a single concise sentence that
Node.js-specific features have been moved to a separate entry point to improve
portability and reduce bundle size for web/edge environments, and direct users
to consult the migration guide for information about which symbols moved and how
to import them. Remove all references to specific symbol names, function names,
and import paths from the CHANGELOG entry itself.

In `@packages/ksef-client-ts/package.json`:
- Line 46: The "lint" script in package.json runs two tsc commands, but only the
first one includes the --noEmit flag. Add the --noEmit flag to the second tsc
command (the one that uses tsconfig.node-check.json) to ensure that the lint
task never writes any artifacts and maintains consistency across both
type-checking operations.

In `@packages/ksef-client-ts/scripts/check-fs-free-core.mjs`:
- Around line 11-12: The `nodeBundlePath` constant only validates the ESM bundle
(`dist/node.js`), but `package.json` also publishes a CommonJS bundle at
`dist/node.cjs`. Add a new constant to define the CJS bundle path (e.g.,
`nodeCJSBundlePath`) set to `dist/node.cjs`, and then update the validation
logic around lines 72-76 to check both the ESM bundle and the newly defined CJS
bundle path to ensure both artifacts are present and valid. This prevents broken
CJS bundles from passing the guard.
- Around line 33-37: The regex patterns for readFile, writeFile, and homedir in
the check-fs-free-core.mjs file are too broad and match standalone identifiers
unrelated to the fs module, causing false-positive failures. Refine these three
pattern definitions to be context-aware by binding them to fs import or require
statements, such as matching patterns like fs.readFile, fs.writeFile, and
fs.homedir, or by ensuring the patterns only trigger when these functions are
actually called in the context of fs module usage.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: d9c04f05-653d-4032-91b0-d5248df9ea84

📥 Commits

Reviewing files that changed from the base of the PR and between b342059 and c810cca.

📒 Files selected for processing (21)
  • .github/workflows/ci.yml
  • packages/ksef-client-ts/CHANGELOG.md
  • packages/ksef-client-ts/README.md
  • packages/ksef-client-ts/docs/.vitepress/config.ts
  • packages/ksef-client-ts/docs/deno.md
  • packages/ksef-client-ts/docs/index.md
  • packages/ksef-client-ts/docs/migration-v0.10.md
  • packages/ksef-client-ts/docs/offline-mode.md
  • packages/ksef-client-ts/docs/workflows.md
  • packages/ksef-client-ts/docs/xml-serialization.md
  • packages/ksef-client-ts/package.json
  • packages/ksef-client-ts/scripts/check-fs-free-core.mjs
  • packages/ksef-client-ts/src/node.ts
  • packages/ksef-client-ts/src/offline/index.ts
  • packages/ksef-client-ts/src/validation/index.ts
  • packages/ksef-client-ts/src/workflows/index.ts
  • packages/ksef-client-ts/tests/fixtures/node-types-check.ts
  • packages/ksef-client-ts/tests/unit/node-subpath.test.ts
  • packages/ksef-client-ts/tests/unit/utils/fs-free-core.test.ts
  • packages/ksef-client-ts/tsconfig.node-check.json
  • packages/ksef-client-ts/tsup.config.ts
💤 Files with no reviewable changes (2)
  • packages/ksef-client-ts/src/offline/index.ts
  • packages/ksef-client-ts/src/validation/index.ts

Comment thread packages/ksef-client-ts/CHANGELOG.md Outdated
Comment thread packages/ksef-client-ts/CHANGELOG.md Outdated
Comment thread packages/ksef-client-ts/package.json Outdated
Comment thread packages/ksef-client-ts/scripts/check-fs-free-core.mjs Outdated
Comment thread packages/ksef-client-ts/scripts/check-fs-free-core.mjs
…LO-240)

The Unit C type-check fixture imports ksef-client-ts/node, which resolves
via package exports to dist/node.d.ts. The unit-test job ran 'yarn lint'
(type check) before 'yarn build', so dist was absent and tsc failed with
TS2307 on all Node versions. Build now runs first.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@Fl0p Fl0p self-assigned this Jun 14, 2026
FlopBut and others added 5 commits June 14, 2026 21:54
Per CodeRabbit PR review on #31: the 0.10.0 entry for the Node-only features listed class/function names and import paths, which the project's CHANGELOG convention forbids. Condense to one user-facing sentence and point to the v0.10 migration guide for the moved exports.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Per CodeRabbit PR review on #31: the entry named specific auth methods and described the dynamic-import mechanism. Reword to the user-facing benefit (smaller core bundle, on-demand signing modules) without method names or implementation detail.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Per CodeRabbit PR review on #31: the fs-cleanliness guard only inspected the ESM node bundle (dist/node.js), but package.json also publishes the node entry as CommonJS (dist/node.cjs). A broken CJS node bundle would have passed the guard. Check both ESM and CJS node bundles.

Co-Authored-By: Claude Code <noreply@anthropic.com>
… lint

Per local Codex review on #31. (1) The core still imports node:crypto/stream/zlib, so 'environment-agnostic / portable across browsers' overstated it; reword README, docs homepage, and migration guide to 'fs-free core' that runs on Node, Deno, and edge runtimes. (2) The combined lint ran a project type-check whose fixture resolves the built /node dist, so a clean checkout (or release.yml, which lints before building) could fail; split it into a separate check:node-types script and run it after Build in CI, leaving lint self-contained.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Document the two non-obvious failure modes when moving an import to ksef-client-ts/node: TypeScript needs moduleResolution node16+ (legacy node10 fails with TS2307 despite working at runtime), and CommonJS require silently yields undefined (fails later as a TypeError, not at require time).

Co-Authored-By: Claude Code <noreply@anthropic.com>
@Fl0p Fl0p merged commit c226a02 into main Jun 14, 2026
9 checks passed
@Fl0p Fl0p deleted the flo-240-fs-free-core branch June 14, 2026 21:26
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