Skip to content

Production-ship hardening: runnable examples, clean-install verified, FURS runtime documented#6

Merged
terrxo merged 1 commit into
mainfrom
hardening-ship-examples
May 25, 2026
Merged

Production-ship hardening: runnable examples, clean-install verified, FURS runtime documented#6
terrxo merged 1 commit into
mainfrom
hardening-ship-examples

Conversation

@terrxo

@terrxo terrxo commented May 25, 2026

Copy link
Copy Markdown
Contributor

Hardens fiscalize to production-ship state (engine already merged). Docs/examples only — no library code change. 44 pass / 1 skip, tsc clean.

1. Runnable examples (examples/)

  • e-invoice.ts — model → createEInvoice e-SLOG 2.0 (XSD-validated on the way out) + UBL + explicit validateEslogXml + clean 400 on bad input.
  • furs-offline.ts — full FURS crypto offline: load cert → ZOI → printable (QR/PDF417) → request-JWS → response-verify → EOR. Runs under bun (no live call / real cert needed). This is the basis the upcoming demo app can build on.

Both run green (bun run examples/…). README snippets corrected to match.

2. Clean install from a consumer repo — verified

bun pm pack → fresh bun init repo → bun add the tarball → imported and ran as a real consumer:

  • top-level @grunt-it/fiscalize, @grunt-it/fiscalize/eslog, @grunt-it/fiscalize/furs all resolve;
  • the bundled e-SLOG XSDs load from node_modules (the key packaging risk — confirmed working when installed);
  • all transitive deps install; examples are excluded from the package; the 2 XSDs ship.
  • Publish config confirmed: license: UNLICENSED, publishConfig → GitHub Packages, no private: true (publish works), bunfig.toml present (env-var token, house standard).

3. FURS runtime blocker — documented, not silent

New docs/FURS-RUNTIME.md: bun ≤1.3.6 can't present an outbound mTLS client cert, so live FURS (echo/reportInvoice/registerBusinessPremise) must run under Node on a non-proxied network. Includes the opt-in Node snippet + how to run the skipped live integration test + the demo-cert details. README carries a sharpened ⚠ pointer.

Forbidden zone respected

Did not touch the Medusa-plugin consumer (jp2jo0ec's territory).

Next: ready to ship to the registry

The engine + this hardening make v0.1.0 publishable. Publishing = the tag-triggered CI (publish.yml on v* → GitHub Packages). I've teed it up but not pushed the tag — release-to-consumers is a confirm-first action; say go and I'll cut v0.1.0 (needed so the demo app / medusa plugin can bun add @grunt-it/fiscalize from GH Packages rather than a local tarball).

🤖 Generated with Claude Code

- examples/e-invoice.ts: model → e-SLOG 2.0 (XSD-valid) + UBL, runnable.
- examples/furs-offline.ts: FURS ZOI + request-JWS + response-verify, offline
  (runs under bun; no live call / cert needed).
- docs/FURS-RUNTIME.md: the bun-no-outbound-mTLS blocker documented as a
  clearly-marked opt-in/Node-runtime path (not a silent gap), with a runnable
  Node snippet + the opt-in live test instructions.
- README: link examples + the runtime doc; sharpen the FURS runtime warning.

Verified clean install from a fresh consumer repo (bun pm pack → bun add tgz):
top-level + ./eslog + ./furs imports all resolve and run, the bundled e-SLOG
XSDs load from node_modules, and all transitive deps install. UNLICENSED +
GitHub Packages + bunfig.toml confirmed. 44 pass / 1 skip, tsc clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@terrxo terrxo merged commit c6da1ba into main May 25, 2026
2 checks passed
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