Skip to content

fix(deps): replace abandoned docxtemplater-image-module-free with docxtemplater-image#18

Merged
chriskehayias merged 2 commits into
mainfrom
fix/xmldom-critical-via-docxtemplater-image
May 22, 2026
Merged

fix(deps): replace abandoned docxtemplater-image-module-free with docxtemplater-image#18
chriskehayias merged 2 commits into
mainfrom
fix/xmldom-critical-via-docxtemplater-image

Conversation

@chriskehayias
Copy link
Copy Markdown
Contributor

Summary

  • Replaces abandoned docxtemplater-image-module-free@1.1.1 (depends on deprecated xmldom@0.1.x) with maintained docxtemplater-image@0.1.2 (uses @xmldom/xmldom@^0.9.7, same line as core docxtemplater@3.68).
  • Clears the critical xmldom advisory (GHSA-crh6-fp67-6883, CVSS 9.8) plus the related high/moderate xmldom advisories from npm audit.
  • API is identical (getImage / getSize / centered options + {%token} placeholder syntax), so this is a drop-in for the Address Labels Mail Merge feature — no behavioral changes.

npm audit: 4 vulns (1 critical, 3 moderate) → 2 moderate. The remaining two are an unrelated postcss-in-next pin that won't be fixable until Next 16.3 stable.

Changes

  • package.json: dep swap
  • src/components/address-labels/actions.ts: import path
  • src/components/address-labels/actions.test.ts: vi.mock target
  • src/components/address-labels/sample-template.ts: comment-only
  • src/types/docxtemplater-image.d.ts: renamed shim
  • .claude/references/components/address-labels.md: dep mention
  • .claude/TODO/: closed xmldom-critical-vulnerability TODO + INDEX

Test plan

  • npm run test:run — 45 files, 667 tests pass
  • npm run lint — clean
  • npm run build — clean
  • npm audit — critical xmldom cleared
  • Manual end-to-end: generate sample template → upload via Mail Merge UI → merge against 3+ addresses with barcodes → open in Word → confirm:
    • Address text replaces tokens correctly
    • Barcode images render (not blank, not stretched)
    • {#AddressLine2} and {#isNotLast} conditionals behave correctly
    • Page break between each address works

🤖 Generated with Claude Code

chriskehayias and others added 2 commits May 21, 2026 08:02
…xtemplater-image

Removes the critical xmldom advisory (GHSA-crh6-fp67-6883, CVSS 9.8) by
replacing the abandoned docxtemplater-image-module-free@1.1.1 — which
pinned the deprecated xmldom@0.1.x — with maintained docxtemplater-image@0.1.2,
which uses @xmldom/xmldom@^0.9.7 (the same line as core docxtemplater@3.68).

npm audit: 4 vulns (1 critical, 3 moderate) -> 2 moderate.
The remaining 2 are postcss-in-next, unrelated and unfixable until Next 16.3 stable.

API is identical: same getImage/getSize/centered options and {%token} placeholder
syntax. No behavioral change to the Address Labels mail-merge feature; the
upload-your-own-template flow continues to work unchanged.

Verification:
- npm run test:run: 45 files, 667 tests pass
- npm run lint: clean
- npm run build: clean

Manual end-to-end browser test recommended before release (sample template
upload -> merge -> open in Word -> verify barcode image rendering).

Closes the xmldom-critical-vulnerability TODO.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@chriskehayias chriskehayias merged commit f11c5a8 into main May 22, 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