Skip to content

Commit a7acace

Browse files
terrxoclaude
andauthored
fix: v0.1.1 — consumers typecheck clean without re-adding workarounds (#7)
Because the engine ships TS source (no build), a consumer's tsc/svelte-check resolves into the engine's .ts and inherited two type-resolution needs: - the `declare module "*.xsd"` ambient for the e-SLOG XSD text-imports, and - node-forge types. Fix (no API/runtime change): - validate-eslog.ts carries a triple-slash `/// <reference path>` to types.d.ts so the *.xsd ambient enters any consumer's compilation that loads it. - @types/node-forge moved to dependencies so consumers get node-forge types transitively. Consumers on ^0.1.0 auto-inherit 0.1.1; no consumer bump needed. Benefits the demo lib + the medusa-plugin. 44 pass / 1 skip, tsc clean. Note: the bun `with { type: "text" }` XSD load vs Vite `?raw` (a separate *bundler* concern, not typecheck) is being verified by the demo's vite build — a bundler-neutral load is a candidate v0.1.2 if confirmed. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c6da1ba commit a7acace

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

bun.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@grunt-it/fiscalize",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Private/internal grunt-it Slovenian fiscalization + e-invoicing toolkit (TS/Effect). P1: EN16931 → e-SLOG 2.0 / UBL e-invoice generation + validation, deriving from E-Invoice-EU. Framework-agnostic engine.",
55
"type": "module",
66
"license": "UNLICENSED",
@@ -48,11 +48,11 @@
4848
},
4949
"devDependencies": {
5050
"@types/bun": "latest",
51-
"@types/node-forge": "^1.3.14",
5251
"typescript": "^5"
5352
},
5453
"dependencies": {
5554
"@e-invoice-eu/core": "^3.1.1",
55+
"@types/node-forge": "^1.3.14",
5656
"ajv": "^8.18.0",
5757
"ajv-formats": "^3.0.1",
5858
"effect": "^3.18.4",

src/lib/eslog/validate-eslog.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/// <reference path="../../types.d.ts" />
2+
// The reference above carries the `declare module "*.xsd"` ambient into any
3+
// consumer's compilation that loads this file (the engine ships TS source, so a
4+
// consumer's tsc resolves these .xsd text-imports). Keeps consumers from having
5+
// to re-declare the ambient themselves.
16
import { Effect } from "effect";
27
import { validateXML } from "xmllint-wasm";
38
import { EInvoiceGenerationError, EslogValidationError, type ValidationIssue } from "../foundation/errors";

0 commit comments

Comments
 (0)