Skip to content

Commit

Permalink
feat: leave typst-preview as optional dependencies (#49)
Browse files Browse the repository at this point in the history
* feat: leave typst-preview as optional dependencies

* build: configure cargo.toml correctly
  • Loading branch information
Myriad-Dreamin authored Mar 16, 2024
1 parent 222681c commit f4fd0fc
Show file tree
Hide file tree
Showing 4 changed files with 186 additions and 147 deletions.
59 changes: 22 additions & 37 deletions Cargo.lock

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

10 changes: 8 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ rust-version = "1.74"

[workspace]
resolver = "2"
members = ["crates/*", "external/typst-preview"]
members = ["crates/*"]

[workspace.dependencies]

Expand Down Expand Up @@ -39,7 +39,7 @@ typst-pdf = "0.10.0"
typst-assets = { git = "https://github.com/typst/typst-assets", rev = "4d1211a" }
typst-ts-core = { version = "0.4.2-rc7" }
typst-ts-compiler = { version = "0.4.2-rc7" }
typst-preview = { path = "external/typst-preview" }
typst-preview = { git = "https://github.com/Enter-tainer/typst-preview", rev = "b7db246d8a61a2f1caf9d3a6aa6b74ac68c3027c" }

lsp-server = "0.7.3"
lsp-types = { version = "=0.95.0", features = ["proposed"] }
Expand Down Expand Up @@ -93,6 +93,8 @@ missing_safety_doc = "warn"
undocumented_unsafe_blocks = "warn"

[patch.crates-io]


typst = { git = "https://github.com/Myriad-Dreamin/typst.git", branch = "tinymist-v0.11.0" }
typst-ide = { git = "https://github.com/Myriad-Dreamin/typst.git", branch = "tinymist-v0.11.0" }
typst-pdf = { git = "https://github.com/Myriad-Dreamin/typst.git", branch = "tinymist-v0.11.0" }
Expand All @@ -110,3 +112,7 @@ typst-ts-compiler = { git = "https://github.com/Myriad-Dreamin/typst.ts", rev =
# typst-ts-svg-exporter = { path = "../typst.ts/exporter/svg" }
# typst-ts-core = { path = "../typst.ts/core" }
# typst-ts-compiler = { path = "../typst.ts/compiler" }

# https://github.com/rust-lang/cargo/issues/8690
[patch."https://github.com/Enter-tainer/typst-preview"]
typst-preview = { path = "external/typst-preview" }
5 changes: 3 additions & 2 deletions crates/tinymist/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,16 @@ typst-ts-core = { version = "0.4.2-rc6", default-features = false, features = [
] }
codespan-reporting = "0.11"
typst-ts-compiler.workspace = true
typst-preview.workspace = true
typst-preview = { workspace = true, optional = true }

lsp-server.workspace = true
crossbeam-channel.workspace = true
lsp-types.workspace = true

[features]
default = ["cli"]
default = ["cli", "preview"]
cli = ["clap"]
preview = ["typst-preview"]

[build-dependencies]
anyhow.workspace = true
Expand Down
Loading

0 comments on commit f4fd0fc

Please sign in to comment.