Skip to content

Commit

Permalink
feat: remove exporters (#569)
Browse files Browse the repository at this point in the history
* feat: move ast exporter

* feat: move pdf,json exporter

* feat: move text exporter

* feat: create typst2vec crate

* feat: move exporters
  • Loading branch information
Myriad-Dreamin authored Aug 3, 2024
1 parent ceded76 commit 3b8eebf
Show file tree
Hide file tree
Showing 90 changed files with 472 additions and 524 deletions.
103 changes: 54 additions & 49 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 6 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,17 @@ members = [
"crates/reflexo",
"crates/reflexo-vfs",
"crates/reflexo-world",
"crates/conversion/typst2vec",
"crates/conversion/vec2canvas",
"crates/conversion/vec2bbox",
"crates/conversion/vec2sema",
"crates/conversion/vec2dom",
"crates/conversion/vec2svg",

"cli",
"core",
"compiler",

"exporter/ast",
"exporter/dom",
"exporter/pdf",
"exporter/serde",
"exporter/svg",

"fuzzers/incremental",

"packages/parser",
Expand Down Expand Up @@ -208,6 +205,7 @@ reflexo-vfs = { version = "0.5.0-rc6", path = "crates/reflexo-vfs" }
reflexo-world = { version = "0.5.0-rc6", path = "crates/reflexo-world" }

# conversions
reflexo-typst2vec = { version = "0.5.0-rc6", path = "crates/conversion/typst2vec" }
reflexo-vec2canvas = { version = "0.5.0-rc6", path = "crates/conversion/vec2canvas" }
reflexo-vec2sema = { version = "0.5.0-rc6", path = "crates/conversion/vec2sema" }
reflexo-vec2bbox = { version = "0.5.0-rc6", path = "crates/conversion/vec2bbox" }
Expand All @@ -217,12 +215,8 @@ typst-ts-compiler = { version = "0.5.0-rc6", default-features = false }
typst-ts-test-common = { version = "0.5.0-rc6", path = "tests/common" }

# project exporters
typst-ts-ast-exporter = "0.5.0-rc6"
typst-ts-dom-exporter = { path = "exporter/dom" }
typst-ts-pdf-exporter = "0.5.0-rc6"
typst-ts-serde-exporter = "0.5.0-rc6"
typst-ts-dom-exporter = { path = "crates/conversion/vec2dom" }
typst-ts-svg-exporter = "0.5.0-rc6"
typst-ts-text-exporter = "0.5.0-rc6"

# project common components
typst-ts-dev-server = { version = "0.5.0-rc6", path = "server/dev" }
Expand All @@ -231,11 +225,7 @@ typst-ts-cli = { version = "0.5.0-rc6", path = "cli" }
[patch.crates-io]
typst-ts-core = { path = "core" }
typst-ts-compiler = { path = "compiler" }
typst-ts-ast-exporter = { path = "exporter/ast" }
typst-ts-pdf-exporter = { path = "exporter/pdf" }
typst-ts-serde-exporter = { path = "exporter/serde" }
typst-ts-svg-exporter = { path = "exporter/svg" }
typst-ts-text-exporter = { path = "exporter/text" }
typst-ts-svg-exporter = { path = "crates/conversion/vec2svg" }

# typst = { git = "https://github.com/Myriad-Dreamin/typst.git", branch = "typst.ts-v0.10.0" }
# typst-syntax = { git = "https://github.com/Myriad-Dreamin/typst.git", branch = "typst.ts-v0.10.0" }
Expand Down
1 change: 1 addition & 0 deletions benches/lowering/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ repository.workspace = true
divan = "0.1.3"
typst.workspace = true
once_cell.workspace = true
reflexo-typst2vec.workspace = true
typst-ts-core = { workspace = true, features = ["flat-vector"] }
typst-ts-cli.workspace = true
typst-ts-compiler = { workspace = true, default-features = false, features = [
Expand Down
6 changes: 2 additions & 4 deletions benches/lowering/src/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ use std::sync::{Arc, Mutex};

use divan::Bencher;
use once_cell::sync::Lazy;
use reflexo_typst2vec::pass::{IncrTypst2VecPass, Typst2VecPass};
use typst_ts_cli::CompileOnceArgs;
use typst_ts_compiler::{
CompileDriver as CompileDriverT, Compiler, PureCompiler, ShadowApiExt, TypstSystemWorld,
};
use typst_ts_core::{
vector::pass::{IncrTypst2VecPass, Typst2VecPass},
TypstDocument,
};
use typst_ts_core::TypstDocument;

type CompileDriver = Lazy<Mutex<CompileDriverT<PureCompiler<TypstSystemWorld>>>>;

Expand Down
27 changes: 6 additions & 21 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,36 +46,21 @@ typst-ts-compiler = { workspace = true, default-features = false, features = [
"dynamic-layout",
] }

typst-ts-ast-exporter.workspace = true
typst-ts-pdf-exporter = { workspace = true, optional = true }
typst-ts-serde-exporter = { workspace = true, optional = true }
typst-ts-svg-exporter = { workspace = true, optional = true }
typst-ts-text-exporter = { workspace = true, optional = true }

[build-dependencies]
anyhow.workspace = true
vergen.workspace = true

[features]

default = [
"pdf",
"serde-json",
"serde-rmp",
"svg",
"text",
"gen-manual",
"embedded-fonts",
]
default = ["ast", "pdf", "svg", "text", "gen-manual", "embedded-fonts"]
gen-manual = ["dep:clap_mangen"]
embedded-fonts = []
debug-repl = []
pdf = ["typst-ts-pdf-exporter"]
serde-json = ["typst-ts-serde-exporter", "typst-ts-serde-exporter/json"]
serde-rmp = ["typst-ts-serde-exporter", "typst-ts-serde-exporter/rmp"]
ast = ["typst-ts-core/ast"]
pdf = ["typst-ts-core/pdf"]
svg = [
#
"typst-ts-svg-exporter",
"typst-ts-svg-exporter/experimental-ligature",
"typst-ts-core/svg",
"typst-ts-core/experimental-ligature",
]
text = ["typst-ts-text-exporter"]
text = []
Loading

0 comments on commit 3b8eebf

Please sign in to comment.