Problem
Three source files are significantly oversized:
src/wsdl/index.ts — 1,464 LOC
src/wsdl/elements.ts — 1,198 LOC
src/client.ts — 633 LOC
Combined, these three files hold almost all of the complexity in the library.
Why it matters
Proposed approach
This is a multi-PR effort. Suggested sequence:
Phase 1 — client.ts (smallest, clearest wins):
- Extract request-builder into
src/client/request-builder.ts.
- Extract response-parser into
src/client/response-parser.ts.
- Extract event-wiring / EventEmitter surface into
src/client/events.ts.
- Keep
client.ts as the public facade.
Phase 2 — src/wsdl/elements.ts:
- Each "element" class is roughly independent. Split into a directory with one file per element class (or small related groups).
- Keep a barrel
src/wsdl/elements/index.ts.
Phase 3 — src/wsdl/index.ts:
- After elements are split, the WSDL parser can be broken into:
- schema loader
- schema cache
- XML ingestion (sax wiring)
- tree builder
- Land each as its own PR.
Each phase: tests pass, public API unchanged.
Acceptance criteria
- No source file exceeds ~500 LOC.
- Public API (exports) unchanged.
- All tests pass.
- Internal module boundaries are clearer (no circular deps).
Problem
Three source files are significantly oversized:
src/wsdl/index.ts— 1,464 LOCsrc/wsdl/elements.ts— 1,198 LOCsrc/client.ts— 633 LOCCombined, these three files hold almost all of the complexity in the library.
Why it matters
Proposed approach
This is a multi-PR effort. Suggested sequence:
Phase 1 —
client.ts(smallest, clearest wins):src/client/request-builder.ts.src/client/response-parser.ts.src/client/events.ts.client.tsas the public facade.Phase 2 —
src/wsdl/elements.ts:src/wsdl/elements/index.ts.Phase 3 —
src/wsdl/index.ts:Each phase: tests pass, public API unchanged.
Acceptance criteria