Skip to content

Commit d36a2ff

Browse files
committed
Add XLSX donor worksheet extraction and one-pass row spooling
1 parent ded66dc commit d36a2ff

6 files changed

Lines changed: 579 additions & 17 deletions

File tree

docs/insert-existing-workbook-plan.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,19 +178,21 @@ Acceptance:
178178

179179
Depends on Task 1.
180180

181-
- [ ] Add an internal donor builder that invokes the current `XlsxWriter` for exactly one sheet.
182-
- [ ] Extract the donor worksheet, styles, shared strings, and AutoFilter defined-name metadata.
183-
- [ ] Convert donor shared-string cells to inline strings using structured XML parsing.
184-
- [ ] Preserve formulas exactly as emitted; do not calculate them.
185-
- [ ] Expose an internal result containing worksheet XML, data-row count, donor style model, and optional local defined names.
186-
- [ ] Add dynamic, explicit-schema, Serde, header-only, and empty/no-header donor tests.
187-
- [ ] Add a one-pass explicit-schema row-spool path for future large producers. The spool must be deleted on success, iterator error, or panic unwinding.
181+
- [x] Add an internal donor builder that invokes the current `XlsxWriter` for exactly one sheet.
182+
- [x] Extract the donor worksheet, styles, shared strings, and AutoFilter defined-name metadata.
183+
- [x] Convert donor shared-string cells to inline strings using structured XML parsing.
184+
- [x] Preserve formulas exactly as emitted; do not calculate them.
185+
- [x] Expose an internal result containing worksheet XML, data-row count, donor style model, and optional local defined names.
186+
- [x] Add dynamic, explicit-schema, Serde, header-only, and empty/no-header donor tests.
187+
- [x] Add a one-pass explicit-schema row-spool path for future large producers. The spool must be deleted on success, iterator error, or panic unwinding.
188+
189+
Completed on 2026-08-24. Focused test: `cargo +1.85.0 test -p miniexcel insert::donor::tests --lib --locked`.
188190

189191
Acceptance:
190192

191193
- Donor output has no dependency on donor `sharedStrings.xml`.
192194
- Row count and all current `WriteOptions` behavior match normal `save_as` output.
193-
- Focused command: `cargo +1.85.0 test -p miniexcel --test insert donor_sheet --locked`.
195+
- Focused command: `cargo +1.85.0 test -p miniexcel insert::donor::tests --lib --locked`.
194196

195197
### Task 3: Append-Only Style Rebase
196198

docs/insert-existing-workbook-plan.zh-CN.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,19 +178,21 @@ Donor-workbook 方案复用经过测试的 `XlsxWriter`,避免重复实现 ser
178178

179179
依赖 Task 1。
180180

181-
- [ ] 新增内部 donor builder,调用当前 `XlsxWriter` 生成正好一个 sheet。
182-
- [ ] 提取 donor worksheet、style、shared string 和 AutoFilter defined-name metadata。
183-
- [ ] 使用结构化 XML parser 将 donor shared-string cell 转成 inline string。
184-
- [ ] 按原样保留 donor formula,不执行计算。
185-
- [ ] 内部结果包含 worksheet XML、数据 row count、donor style model 和可选 local defined name。
186-
- [ ] 增加 dynamic、显式 schema、Serde、header-only 和 empty/no-header donor 测试。
187-
- [ ] 为未来大 producer 增加 one-pass 显式 schema row spool;成功、iterator error 或 panic unwind 时都删除 spool。
181+
- [x] 新增内部 donor builder,调用当前 `XlsxWriter` 生成正好一个 sheet。
182+
- [x] 提取 donor worksheet、style、shared string 和 AutoFilter defined-name metadata。
183+
- [x] 使用结构化 XML parser 将 donor shared-string cell 转成 inline string。
184+
- [x] 按原样保留 donor formula,不执行计算。
185+
- [x] 内部结果包含 worksheet XML、数据 row count、donor style model 和可选 local defined name。
186+
- [x] 增加 dynamic、显式 schema、Serde、header-only 和 empty/no-header donor 测试。
187+
- [x] 为未来大 producer 增加 one-pass 显式 schema row spool;成功、iterator error 或 panic unwind 时都删除 spool。
188+
189+
已于 2026-08-24 完成。聚焦测试:`cargo +1.85.0 test -p miniexcel insert::donor::tests --lib --locked`
188190

189191
验收:
190192

191193
- Donor output 不依赖 donor `sharedStrings.xml`
192194
- Row count 和全部当前 `WriteOptions` 行为与普通 `save_as` 一致。
193-
- 聚焦命令:`cargo +1.85.0 test -p miniexcel --test insert donor_sheet --locked`
195+
- 聚焦命令:`cargo +1.85.0 test -p miniexcel insert::donor::tests --lib --locked`
194196

195197
### Task 3:Append-only Style Rebase
196198

miniexcel/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ sha2.workspace = true
2424
thiserror.workspace = true
2525
zip.workspace = true
2626

27+
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
28+
tempfile.workspace = true
29+
2730
[dev-dependencies]
2831
serde_json.workspace = true
2932
tempfile.workspace = true

0 commit comments

Comments
 (0)