Skip to content

fix: expose the named Builder constructor declared in types - #26

Open
fhgffy wants to merge 1 commit into
NaturalIntelligence:mainfrom
fhgffy:fix-declared-builder-export-20261011
Open

fhgffy wants to merge 1 commit into
NaturalIntelligence:mainfrom
fhgffy:fix-declared-builder-export-20261011

Conversation

@fhgffy

@fhgffy fhgffy commented Oct 10, 2026

Copy link
Copy Markdown

src/fxb.d.ts declares Builder as a named constructor, but the ESM entry point only exports it as the default. Consequently, import { Builder } from 'fast-xml-builder' type-checks and then throws a missing-export error at runtime.

Export the existing constructor by name as well. The regression checks that both exports reference the same constructor and that the named constructor builds XML.

Related to #25.

Validation:

  • The regression fails on the base revision; the named ESM import also fails at runtime.
  • npm test: 137 specs, 0 failures, 1 existing pending spec.
  • npm run bundle: both bundles compile; ESM and rebuilt CommonJS exports work.
  • A TypeScript declaration smoke test and lint of the new spec pass.

The existing lint script references an absent benchmark directory, and test-types references an absent spec/typings/typings-test.ts. Linting the source directly reports the same four errors on the base and patched versions.

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