bun-docx 0.20.4 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bun-docx",
3
- "version": "0.20.4",
3
+ "version": "0.21.0",
4
4
  "description": "Read, edit, redline, and comment on Microsoft Word .docx files from the command line — built for AI agents.",
5
5
  "keywords": [
6
6
  "docx",
@@ -70,11 +70,13 @@
70
70
  },
71
71
  "dependencies": {
72
72
  "@hyzyla/pdfium": "2.1.13",
73
+ "diff": "^9.0.0",
73
74
  "fast-xml-builder": "^1.1.6",
74
75
  "fast-xml-parser": "^5.7.2",
75
76
  "heic-convert": "^2.1.0",
76
77
  "jpeg-js": "^0.4.4",
77
78
  "jszip": "^3.10.1",
79
+ "libxml2-wasm": "^0.7.1",
78
80
  "lowlight": "^3.3.0",
79
81
  "mdast-util-math": "^3.0.0",
80
82
  "pngjs": "^7.0.0",
@@ -71,7 +71,7 @@ docx replace contract.docx --batch fills.jsonl # many fields, one read
71
71
 
72
72
  ### Redline with tracked changes
73
73
  ```sh
74
- docx track-changes on contract.docx # turn tracking on (doc-level)
74
+ docx track-changes contract.docx on # turn tracking on (doc-level)
75
75
  docx replace contract.docx "Net 90" "Net 30" # now auto-emits <w:ins>/<w:del>
76
76
  docx edit --at p12:0-40 contract.docx --text "…" --track # or redline one edit
77
77
  docx track-changes list contract.docx # the tcN handles
@@ -93,6 +93,7 @@ docx read FILE # Markdown (default; tracked changes shown accepted-cl
93
93
  docx read FILE --ast # lossless JSON AST
94
94
  docx wc FILE # word count (whole doc or a slice)
95
95
  docx outline FILE # headings as a locator tree
96
+ docx diff FILE --against OLD.docx # what changed vs another version (snapshot OLD first)
96
97
  ```
97
98
 
98
99
  ### Build from scratch / verify layout
@@ -21,6 +21,7 @@ docx info skill # this skill, regenerated from the binary
21
21
  | `outline FILE` | Headings as a locator tree. |
22
22
  | `render FILE` | Render each page to PNG/JPG via Word or LibreOffice — for verifying LAYOUT only. |
23
23
  | `styles FILE` | List/describe styles (`--used`, `--at ID`). |
24
+ | `validate FILE` | Schema-check every WML part against the bundled ECMA-376 transitional XSDs (exit 0 = clean). |
24
25
  | `info <topic>` | `schema` / `locators` / `skill` — reference material, no FILE. |
25
26
 
26
27
  ## Mutate (overwrite FILE in place; `-o PATH` writes a copy; `--dry-run` previews)
@@ -42,6 +43,7 @@ docx info skill # this skill, regenerated from the binary
42
43
  | `tables` | Insert/delete rows & columns, merge/unmerge, set widths, borders, formatting. |
43
44
  | `lists` | Renumber a numbered list (`set --at pN --start 5` / `--format upper-roman` / `--restart` / `--continue`). |
44
45
  | `track-changes` | `on`/`off`, `list`, `accept`/`reject` (`--at tcN` / `--all`). |
46
+ | `raw` | LAST RESORT: `get` a target's exact XML, `edit --find/--with` to patch in place, `insert`/`replace` raw OOXML at a locator (blocks, sections, `rIdN` relationships), `raw part list\|get\|add\|replace\|edit --name` for package parts — hard-gated (well-formedness, ECMA child order, rId checks, schema validation; nothing written on failure). For constructs no other verb covers. |
45
47
 
46
48
  ## The two gotchas that can trip you up
47
49