Skip to content

v1.0.46 - Enhanced docxmlater Integration

Choose a tag to compare

@ItMeDiaTech ItMeDiaTech released this 13 Nov 17:32
· 235 commits to master since this release

Improvements

This release enhances the docxmlater integration with improved type safety, cleaner code, and comprehensive memory management documentation.

Type Safety Enhancements

Replaced 4 'any' type annotations with proper docxmlater types:

  • getParagraphText(para: any) → getParagraphText(para: Paragraph)
  • forEach((run: any) => → forEach((run: Run) =>
  • Removed as any assertion in extractHyperlinks with explanatory comment

Benefits:

  • Full TypeScript type checking at compile-time
  • Better IDE autocomplete and IntelliSense
  • Catches errors during development instead of runtime

Code Quality Improvements

Removed unnecessary optional chaining:

  • para.getRuns?.() → para.getRuns() (2 instances)
  • run.setBold?.() → run.setBold() (and similar methods)

Cleaner, more confident code that reflects actual API guarantees from docxmlater v1.19.0.

Documentation Enhancements

Added prominent memory management warnings to 3 methods:

  • loadFromFile() - Document loading from file paths
  • loadFromBuffer() - Document loading from memory
  • createNewDocument() - New document creation

Warning format:

⚠️ IMPORTANT: Memory Management

Always call dispose() on the returned Document when finished to free resources
and prevent memory leaks, especially in long-running applications or when processing
multiple documents.

Dependencies

Updated docxmlater: ^1.18.0 → ^1.19.0

  • Includes recent TypeScript error fixes
  • All 2,073+ tests passing in docxmlater framework

Testing

Unit Tests: ✅ All 21 tests passing

Test Suites: 1 passed
Tests:       21 passed
Time:        1.913 s

Coverage:

  • Document loading and validation
  • Hyperlink extraction and processing
  • PowerAutomate API integration
  • Batch processing
  • Memory management
  • Error handling

Breaking Changes

None - This release is 100% backward compatible.

Migration Guide

No code changes required. Simply update:

```bash
npm install
```

Installation

```bash
git pull origin master
npm install
```

Full Changelog

v1.0.45...v1.0.46


Files Changed:

  • src/services/document/DocXMLaterProcessor.ts (11 improvements)
  • package.json (version bump + dependency update)
  • package-lock.json (automatic update)