Skip to content

Commit

Permalink
build: bump typst version to 0.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Myriad-Dreamin committed Oct 19, 2024
1 parent d56eb1d commit 0a1a618
Show file tree
Hide file tree
Showing 11 changed files with 300 additions and 304 deletions.
427 changes: 193 additions & 234 deletions Cargo.lock

Large diffs are not rendered by default.

102 changes: 54 additions & 48 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,85 +73,90 @@ strip = true
[workspace.dependencies]

# typesetting
typst = "0.11.1"
typst-ide = "0.11.1"
typst-pdf = "0.11.1"
typst-svg = "0.11.1"
typst-syntax = "0.11.1"
typst = "0.12.0"
typst-ide = "0.12.0"
typst-pdf = "0.12.0"
typst-svg = "0.12.0"
typst-syntax = "0.12.0"
ttf-parser = "0.24.1"

typst-assets = { git = "https://github.com/typst/typst-assets", rev = "4afd428" }
typst-dev-assets = { git = "https://github.com/typst/typst-dev-assets", rev = "e9f8127" }
typst-assets = "0.12.0"
typst-dev-assets = { git = "https://github.com/typst/typst-dev-assets", tag = "v0.12.0" }

# general
anyhow = "1"
async-recursion = "1.0.4"
async-trait = "0.1.68"
async-recursion = "1.1"
async-trait = "0.1.83"
cfg-if = "1.0"
chrono = { version = "0.4.24", default-features = false, features = [
chrono = { version = "0.4.38", default-features = false, features = [
"clock",
"std",
] }
futures-util = "0.3.30"
parking_lot = "0.12.1"
futures-util = "0.3.31"
parking_lot = "0.12.3"
pollster = "0.3.0"
rayon = "1.7.0"
strum = { version = "0.25.0", features = ["derive"] }
tokio = { version = "1.28.1", features = ["full"] }
rayon = "1.10.0"
strum = { version = "0.26.3", features = ["derive"] }
tokio = { version = "1.40.0", features = ["full"] }

# data structure and algorithm
comemo = "0.4"
elsa = "1.8.1"
ecow = "0.2"
elsa = "1.10.0"
ecow = "0.2.2"
indexmap = "2"
unicode-width = "0.1.11"
unicode-width = "0.2.0"
dashmap = "5"

# cli, terminal and tui
ansi_term = "0.12.1"
clap = { version = "4.4", features = ["derive", "env", "unicode", "wrap_help"] }
clap_complete = "4.4"
clap_complete_fig = "4.4"
clap_mangen = { version = "0.2.15" }
human-panic = "1.1.4"
rustyline = { version = "12.0.0", features = ["derive"] }
clap = { version = "4.5.20", features = [
"derive",
"env",
"unicode",
"wrap_help",
] }
clap_complete = "4.5.20"
clap_complete_fig = "4.5.2"
clap_mangen = { version = "0.2.24" }
human-panic = "2.0.2"
rustyline = { version = "14.0.0", features = ["derive"] }

# system
dirs = "5"
fontdb = "0.16"
fontdb = "0.21"
notify = "6"
path-clean = "1.0.1"
pathdiff = "0.2"
pathdiff = "0.2.2"
walkdir = "2"
instant = { version = "0.1" }

# web
js-sys = "^0.3"
wasm-bindgen = "^0.2"
wasm-bindgen-futures = "^0.4"
wasm-bindgen-test = "0.3.36"
wasm-bindgen-test = "0.3.45"
web-sys = "^0.3"
# The `console_error_panic_hook` crate provides better debugging of panics by
# logging them with `console.error`. This is great for development, but requires
# all the `std::fmt` and `std::panicking` infrastructure, so isn't great for
# code size when deploying.
console_error_panic_hook = { version = "0.1.1" }
console_error_panic_hook = { version = "0.1.7" }

# image processing
image = { version = "0.24", default-features = false, features = [
image = { version = "0.25.2", default-features = false, features = [
"png",
"jpeg",
"gif",
] }
resvg = { version = "0.38", default-features = false, features = [
resvg = { version = "0.43", default-features = false, features = [
"raster-images",
] }
svgtypes = "0.13"
tiny-skia = "0.11"
tiny-skia-path = "0.11"
svgtypes = "0.15.2"
tiny-skia = "0.11.4"
tiny-skia-path = "0.11.4"

# cryptography and processing
ansi-to-html = "0.1.3"
ansi-to-html = "0.2.1"
base64 = "0.22"
base64-serde = "0.7.0"
hex = "0.4.3"
Expand All @@ -160,32 +165,33 @@ fxhash = "0.2.1"
nohash-hasher = "0.2.0"
rkyv = "0.7.42"
rustc-hash = "2"
serde = { version = "1.0.197" }
serde_json = "1.0.114"
serde = { version = "1.0.210" }
serde_json = "1.0.131"
serde_with = { version = "3.6", features = ["base64"] }
serde-wasm-bindgen = "^0.6"
sha2 = "0.10.6"
siphasher = "1"
tar = "0.4"
toml = "0.8"
xmlparser = "0.13.5"
xmlparser = "0.13.6"

# logging and tracing
env_logger = "0.10.0"
log = "0.4.17"
env_logger = "0.11.5"
log = "0.4.22"

# test
insta = "1.29.0"
insta = "1.40.0"

# misc
codespan-reporting = "0.11"
vergen = { version = "8.3.1", features = [
vergen = { version = "9.0.1", features = [
"build",
"cargo",
"git",
"gitcl",
# "git",
# "gitcl",
"rustc",
] }
vergen-gitcl = { version = "1.0.1" }

# project core
reflexo = { version = "0.5.0-rc7-2", path = "crates/reflexo", default-features = false }
Expand Down Expand Up @@ -227,11 +233,11 @@ undocumented_unsafe_blocks = "warn"
# typst-pdf = { git = "https://github.com/Myriad-Dreamin/typst.git", branch = "typst-ts-v0.10.0" }

# comemo = { git = "https://github.com/Dherse/comemo", rev = "15c8d5b" }
typst = { git = "https://github.com/ParaN3xus/typst", branch = "typst.ts-tinymist-v0.11.31-content-hint" }
typst-syntax = { git = "https://github.com/ParaN3xus/typst", branch = "typst.ts-tinymist-v0.11.31-content-hint" }
typst-ide = { git = "https://github.com/ParaN3xus/typst", branch = "typst.ts-tinymist-v0.11.31-content-hint" }
typst-svg = { git = "https://github.com/ParaN3xus/typst", branch = "typst.ts-tinymist-v0.11.31-content-hint" }
typst-pdf = { git = "https://github.com/ParaN3xus/typst", branch = "typst.ts-tinymist-v0.11.31-content-hint" }
typst = { git = "https://github.com/Myriad-Dreamin/typst", branch = "typst.ts-v0.5.0" }
typst-syntax = { git = "https://github.com/Myriad-Dreamin/typst", branch = "typst.ts-v0.5.0" }
typst-ide = { git = "https://github.com/Myriad-Dreamin/typst", branch = "typst.ts-v0.5.0" }
typst-svg = { git = "https://github.com/Myriad-Dreamin/typst", branch = "typst.ts-v0.5.0" }
typst-pdf = { git = "https://github.com/Myriad-Dreamin/typst", branch = "typst.ts-v0.5.0" }

# comemo = { path = "../comemo" }
# typst = { path = "../typst/crates/typst" }
Expand Down
1 change: 1 addition & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ reflexo-typst = { workspace = true, default-features = false, features = [
[build-dependencies]
anyhow.workspace = true
vergen.workspace = true
vergen-gitcl.workspace = true

[features]

Expand Down
28 changes: 21 additions & 7 deletions cli/build.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
use anyhow::Result;
use vergen::EmitBuilder;
use vergen::{BuildBuilder, CargoBuilder, Emitter, RustcBuilder};
use vergen_gitcl::GitclBuilder;

fn main() -> Result<()> {
let build = BuildBuilder::default().build_timestamp(true).build()?;
let cargo = CargoBuilder::all_cargo()?;
let rustc = RustcBuilder::default()
.commit_hash(true)
.semver(true)
.host_triple(true)
.channel(true)
.llvm_version(true)
.build()?;
let gitcl = GitclBuilder::default()
.sha(false)
.describe(true, true, None)
.build()?;

// Emit the instructions
EmitBuilder::builder()
.all_cargo()
.build_timestamp()
.git_sha(false)
.git_describe(true, true, None)
.all_rustc()
Emitter::default()
.add_instructions(&build)?
.add_instructions(&cargo)?
.add_instructions(&rustc)?
.add_instructions(&gitcl)?
.emit()?;
Ok(())
}
4 changes: 2 additions & 2 deletions cli/src/query_repl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ impl Highlighter for ReplContext {
self.highlighter.highlight(line, pos)
}

fn highlight_char(&self, line: &str, pos: usize) -> bool {
self.highlighter.highlight_char(line, pos)
fn highlight_char(&self, line: &str, pos: usize, forced: bool) -> bool {
self.highlighter.highlight_char(line, pos, forced)
}
}

Expand Down
7 changes: 4 additions & 3 deletions crates/conversion/typst2vec/src/pass/typst2vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use reflexo::ImmutStr;
use ttf_parser::{GlyphId, OutlineBuilder};
use typst::{
foundations::{Bytes, Smart},
introspection::Introspector,
introspection::{Introspector, Tag},
layout::{
Abs as TypstAbs, Axes, Dir, Frame, FrameItem, FrameKind, Position, Ratio as TypstRatio,
Size, Transform as TypstTransform,
Expand Down Expand Up @@ -376,13 +376,14 @@ impl<const ENABLE_REF_CNT: bool> Typst2VecPassImpl<ENABLE_REF_CNT> {
}
})
}
FrameItem::Tag(tag) => {
if !LINE_HINT_ELEMENTS.contains(tag.elem().func().name()) {
FrameItem::Tag(Tag::Start(elem)) => {
if !LINE_HINT_ELEMENTS.contains(elem.func().name()) {
return None;
}

self.store(VecItem::ContentHint('\n'))
}
FrameItem::Tag(Tag::End(..)) => return None,
#[cfg(not(feature = "no-content-hint"))]
FrameItem::ContentHint(c) => self.store(VecItem::ContentHint(*c)),
// todo: support page label
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ impl TypstCompiler {
.map_err(|e| format!("{e:?}"))?;
let data = cursor.into_inner();

let converted = ansi_to_html::convert_escaped(
let converted = ansi_to_html::convert(
String::from_utf8(data)
.map_err(|e| format!("{e:?}"))?
.as_str(),
Expand Down
1 change: 1 addition & 0 deletions packages/renderer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ send_wrapper = "0.5.0"
[build-dependencies]
anyhow.workspace = true
vergen.workspace = true
vergen-gitcl.workspace = true

[features]

Expand Down
25 changes: 19 additions & 6 deletions packages/renderer/build.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
use anyhow::Result;
use vergen::EmitBuilder;
use vergen::{CargoBuilder, Emitter, RustcBuilder};
use vergen_gitcl::GitclBuilder;

fn main() -> Result<()> {
let cargo = CargoBuilder::default()
.opt_level(true)
.features(true)
.build()?;
let rustc = RustcBuilder::default()
.commit_hash(true)
.semver(true)
.host_triple(true)
.channel(true)
.llvm_version(true)
.build()?;
let gitcl = GitclBuilder::default().sha(false).build()?;

// Emit the instructions
EmitBuilder::builder()
.cargo_features()
.cargo_opt_level()
.build_timestamp()
.git_sha(false)
Emitter::default()
.add_instructions(&cargo)?
.add_instructions(&rustc)?
.add_instructions(&gitcl)?
.emit()?;
Ok(())
}
2 changes: 1 addition & 1 deletion tests/integration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ insta = { workspace = true, features = ["yaml"] }
hex.workspace = true
base64.workspace = true
image.workspace = true
image_hasher = "1.1.0"
image_hasher = "2"
sha2.workspace = true
anyhow.workspace = true
serde.workspace = true
Expand Down
5 changes: 3 additions & 2 deletions tests/integration/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mod tests {

use flate2::write::GzEncoder;
use flate2::Compression;
use std::io::Write;
use std::io::{Cursor, Write};

#[derive(Debug, Clone, Serialize, Deserialize)]
struct TestPoint {
Expand All @@ -29,8 +29,9 @@ mod tests {
let data = base64::engine::general_purpose::STANDARD
.decode(data_url)
.unwrap();
let data = Cursor::new(data);

let image = PngDecoder::new(&data[..]).unwrap();
let image = PngDecoder::new(data).unwrap();
let image = image::DynamicImage::from_decoder(image).unwrap();

let hasher = HasherConfig::new().hash_size(4, 4);
Expand Down

0 comments on commit 0a1a618

Please sign in to comment.