Skip to content

Commit 342ee3e

Browse files
authored
fix: some errors (#841)
* fix: some errors * fix: use 2021 * fix: pkgs * fix: tsc * fix: snaps
1 parent 51830b9 commit 342ee3e

40 files changed

+173
-128
lines changed

Cargo.lock

Lines changed: 17 additions & 77 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,4 @@ $ pnpm test -- --updateSnapshot
177177
- [x] Table of contents
178178
- [ ] Section
179179
- [ ] Textbox
180+

docx-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ wasm = ["wasm-bindgen", "ts-rs", "image"]
2626
[dependencies]
2727
xml-rs = { version = "0.8.27", default-features = false }
2828
thiserror = "2.0.12"
29-
zip = { version = "4.3.0", default-features = false, features = ["deflate"] }
29+
zip = { version = "0.6.3", default-features = false, features = ["deflate"] }
3030
serde = { version = "1.0.219", features = ["derive"] }
3131
serde_json = {version = "1.0.142" }
3232
base64 = "0.22.1"

docx-core/src/zipper/mod.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@ where
99
W: Write + Seek,
1010
{
1111
let mut zip = zip::ZipWriter::new(w);
12-
let default_options = FileOptions::<()>::default()
13-
.compression_method(zip::CompressionMethod::Stored)
14-
.unix_permissions(0o755);
15-
zip.add_directory("word/", default_options)?;
16-
zip.add_directory("word/_rels", default_options)?;
17-
zip.add_directory("_rels/", default_options)?;
18-
zip.add_directory("docProps/", default_options)?;
1912

20-
let options = FileOptions::<()>::default()
13+
zip.add_directory("word/", Default::default())?;
14+
zip.add_directory("word/_rels", Default::default())?;
15+
zip.add_directory("_rels/", Default::default())?;
16+
zip.add_directory("docProps/", Default::default())?;
17+
18+
let options = FileOptions::default()
2119
.compression_method(zip::CompressionMethod::Stored)
2220
.unix_permissions(0o755);
2321

@@ -71,7 +69,7 @@ where
7169
}
7270

7371
if !xml.media.is_empty() {
74-
zip.add_directory("word/media/", default_options)?;
72+
zip.add_directory("word/media/", Default::default())?;
7573
for m in xml.media {
7674
// For now only png supported
7775
zip.start_file(format!("word/media/{}.png", m.0), options)?;
@@ -81,11 +79,11 @@ where
8179

8280
// For now support only taskpanes
8381
if let Some(taskpanes) = xml.taskpanes {
84-
zip.add_directory("word/webextensions/", default_options)?;
82+
zip.add_directory("word/webextensions/", Default::default())?;
8583
zip.start_file("word/webextensions/taskpanes.xml", options)?;
8684
zip.write_all(&taskpanes)?;
8785

88-
zip.add_directory("word/webextensions/_rels", default_options)?;
86+
zip.add_directory("word/webextensions/_rels", Default::default())?;
8987
zip.start_file("word/webextensions/_rels/taskpanes.xml.rels", options)?;
9088
zip.write_all(&xml.taskpanes_rels)?;
9189

@@ -99,7 +97,7 @@ where
9997
}
10098

10199
if !xml.custom_items.is_empty() {
102-
zip.add_directory("customXml/_rels", default_options)?;
100+
zip.add_directory("customXml/_rels", Default::default())?;
103101
}
104102

105103
for (i, item) in xml.custom_items.into_iter().enumerate() {

docx-wasm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ edition = "2021"
1010
crate-type = ["cdylib"]
1111

1212
[dependencies]
13-
wasm-bindgen = "0.2.100"
13+
wasm-bindgen = "0.2.92"
1414
console_error_panic_hook = "0.1.7"
1515
docx-rs= { path = "../docx-core", features = ["wasm"] }
1616

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
12

2-
export type AlignmentType = "both" | "center" | "distribute" | "start" | "end" | "left" | "right" | "justified";
3+
export type AlignmentType = "both" | "center" | "distribute" | "start" | "end" | "left" | "right" | "justified";
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
12

2-
export type BorderType = "nil" | "none" | "single" | "thick" | "double" | "dotted" | "dashed" | "dotDash" | "dotDotDash" | "triple" | "thinThickSmallGap" | "thickThinSmallGap" | "thinThickThinSmallGap" | "thinThickMediumGap" | "thickThinMediumGap" | "thinThickThinMediumGap" | "thinThickLargeGap" | "thickThinLargeGap" | "thinThickThinLargeGap" | "wave" | "doubleWave" | "dashSmallGap" | "dashDotStroked" | "threeDEmboss" | "threeDEngrave" | "outset" | "inset" | "apples" | "archedScallops" | "babyPacifier" | "babyRattle";
3+
export type BorderType = "nil" | "none" | "single" | "thick" | "double" | "dotted" | "dashed" | "dotDash" | "dotDotDash" | "triple" | "thinThickSmallGap" | "thickThinSmallGap" | "thinThickThinSmallGap" | "thinThickMediumGap" | "thickThinMediumGap" | "thinThickThinMediumGap" | "thinThickLargeGap" | "thickThinLargeGap" | "thinThickThinLargeGap" | "wave" | "doubleWave" | "dashSmallGap" | "dashDotStroked" | "threeDEmboss" | "threeDEngrave" | "outset" | "inset" | "apples" | "archedScallops" | "babyPacifier" | "babyRattle";
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
12
import type { PicAlign } from "./PicAlign";
23

3-
export type DrawingPosition = { offset: number } | { align: PicAlign };
4+
export type DrawingPosition = { "offset": number } | { "align": PicAlign };
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
12

2-
export type DrawingPositionType = "anchor" | "inline";
3+
export type DrawingPositionType = "anchor" | "inline";
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
12
import type { FieldCharType } from "./FieldCharType";
23

3-
export interface FieldChar { fieldCharType: FieldCharType, dirty: boolean, }
4+
export type FieldChar = { fieldCharType: FieldCharType, dirty: boolean, };

0 commit comments

Comments
 (0)