build: bump version to 0.10.3 (#54)

* build: bump typst to v0.11.0

* build: bump dependencies

* build: update readme and changelog

* build: bump version to 0.10.3

* fix: use a different branch for building

* build: set correct rev to typst-preview

* fix: in perfects
This commit is contained in:
Myriad-Dreamin 2024-03-17 00:57:36 +08:00 committed by GitHub
parent d8cc783c14
commit 3c37ce174a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 256 additions and 159 deletions

View file

@ -80,6 +80,7 @@ jobs:
with:
repository: Enter-tainer/typst-preview
path: external/typst-preview
ref: preview-disable-frontend
if: (startsWith(github.ref, 'refs/tags/') || matrix.regular_build == 'true')
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.4
@ -228,6 +229,7 @@ jobs:
with:
repository: Enter-tainer/typst-preview
path: external/typst-preview
ref: preview-disable-frontend
- name: Hack typst-preview
run: |
mv src/main.rs src/main.rsx

142
Cargo.lock generated
View file

@ -102,9 +102,9 @@ dependencies = [
[[package]]
name = "anyhow"
version = "1.0.80"
version = "1.0.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1"
checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247"
[[package]]
name = "append-only-vec"
@ -219,7 +219,7 @@ checksum = "27fe7285040d0227cd8b5395e1c4783f44f0b673eca5a657f4432ae401f2b7b8"
dependencies = [
"numerals",
"paste",
"strum 0.26.1",
"strum 0.26.2",
"unicode-normalization",
"unscanny",
]
@ -324,9 +324,9 @@ dependencies = [
[[package]]
name = "bytemuck"
version = "1.14.3"
version = "1.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f"
checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15"
[[package]]
name = "byteorder"
@ -458,9 +458,9 @@ dependencies = [
[[package]]
name = "clap"
version = "4.5.2"
version = "4.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b230ab84b0ffdf890d5a10abdbc8b83ae1c4918275daea1ab8801f71536b2651"
checksum = "949626d00e063efc93b6dca932419ceb5432f99769911c0b995f7e884c778813"
dependencies = [
"clap_builder",
"clap_derive",
@ -502,11 +502,11 @@ dependencies = [
[[package]]
name = "clap_derive"
version = "4.5.0"
version = "4.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47"
checksum = "90239a040c80f5e14809ca132ddc4176ab33d5e17e49691793296e3fcb34d72f"
dependencies = [
"heck",
"heck 0.5.0",
"proc-macro2",
"quote",
"syn 2.0.52",
@ -1343,9 +1343,9 @@ dependencies = [
[[package]]
name = "h2"
version = "0.3.24"
version = "0.3.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9"
checksum = "4fbd2820c5e49886948654ab546d0688ff24530286bdcf8fca3cefb16d4618eb"
dependencies = [
"bytes",
"fnv",
@ -1412,6 +1412,12 @@ version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
[[package]]
name = "heck"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "hermit-abi"
version = "0.3.9"
@ -2011,9 +2017,9 @@ checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c"
[[package]]
name = "lipsum"
version = "0.9.0"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c5e9ef2d2ad6fe67a59ace27c203c8d3a71d195532ee82e3bbe0d5f9a9ca541"
checksum = "636860251af8963cc40f6b4baadee105f02e21b28131d76eba8e40ce84ab8064"
dependencies = [
"rand",
"rand_chacha",
@ -2533,9 +2539,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
[[package]]
name = "proc-macro2"
version = "1.0.78"
version = "1.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae"
checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e"
dependencies = [
"unicode-ident",
]
@ -2673,7 +2679,7 @@ dependencies = [
[[package]]
name = "reflexo"
version = "0.4.2-rc8"
source = "git+https://github.com/Myriad-Dreamin/typst.ts?rev=2ba02c5ff3e2ab735849d4e96b331bec14c24a00#2ba02c5ff3e2ab735849d4e96b331bec14c24a00"
source = "git+https://github.com/Myriad-Dreamin/typst.ts?rev=2fc877de0a4bcd7a8f057933546a97348e9621c7#2fc877de0a4bcd7a8f057933546a97348e9621c7"
dependencies = [
"base64 0.22.0",
"bitvec",
@ -2733,9 +2739,9 @@ dependencies = [
[[package]]
name = "reqwest"
version = "0.11.25"
version = "0.11.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eea5a9eb898d3783f17c6407670e3592fd174cb81a10e51d4c37f49450b9946"
checksum = "78bf93c4af7a8bb7d879d51cebe797356ff10ae8516ace542b5182d9dcac10b2"
dependencies = [
"base64 0.21.7",
"bytes",
@ -3094,9 +3100,9 @@ dependencies = [
[[package]]
name = "serde_with"
version = "3.6.1"
version = "3.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "15d167997bd841ec232f5b2b8e0e26606df2e7caa4c31b95ea9ca52b200bd270"
checksum = "ee80b0e361bbf88fd2f6e242ccd19cfda072cb0faa6ae694ecee08199938569a"
dependencies = [
"base64 0.21.7",
"chrono",
@ -3112,9 +3118,9 @@ dependencies = [
[[package]]
name = "serde_with_macros"
version = "3.6.1"
version = "3.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "865f9743393e638991566a8b7a479043c2c8da94a33e0a31f18214c9cae0a64d"
checksum = "6561dc161a9224638a31d876ccdfefbc1df91d3f3a8342eddb35f055d48c7655"
dependencies = [
"darling 0.20.8",
"proc-macro2",
@ -3302,11 +3308,11 @@ dependencies = [
[[package]]
name = "strum"
version = "0.26.1"
version = "0.26.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "723b93e8addf9aa965ebe2d11da6d7540fa2283fcea14b3371ff055f7ba13f5f"
checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29"
dependencies = [
"strum_macros 0.26.1",
"strum_macros 0.26.2",
]
[[package]]
@ -3315,7 +3321,7 @@ version = "0.25.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0"
dependencies = [
"heck",
"heck 0.4.1",
"proc-macro2",
"quote",
"rustversion",
@ -3324,11 +3330,11 @@ dependencies = [
[[package]]
name = "strum_macros"
version = "0.26.1"
version = "0.26.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a3417fc93d76740d974a01654a09777cb500428cc874ca9f45edfe0c4d4cd18"
checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946"
dependencies = [
"heck",
"heck 0.4.1",
"proc-macro2",
"quote",
"rustversion",
@ -3429,20 +3435,20 @@ dependencies = [
[[package]]
name = "system-configuration"
version = "0.6.0"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "658bc6ee10a9b4fcf576e9b0819d95ec16f4d2c02d39fd83ac1c8789785c4a42"
checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7"
dependencies = [
"bitflags 2.4.2",
"bitflags 1.3.2",
"core-foundation",
"system-configuration-sys",
]
[[package]]
name = "system-configuration-sys"
version = "0.6.0"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"
checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9"
dependencies = [
"core-foundation-sys",
"libc",
@ -3498,18 +3504,18 @@ dependencies = [
[[package]]
name = "thiserror"
version = "1.0.57"
version = "1.0.58"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b"
checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.57"
version = "1.0.58"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81"
checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7"
dependencies = [
"proc-macro2",
"quote",
@ -3577,7 +3583,7 @@ dependencies = [
[[package]]
name = "tinymist"
version = "0.10.2"
version = "0.10.3"
dependencies = [
"anyhow",
"async-trait",
@ -3617,7 +3623,7 @@ dependencies = [
[[package]]
name = "tinymist-query"
version = "0.10.2"
version = "0.10.3"
dependencies = [
"anyhow",
"comemo",
@ -3634,7 +3640,7 @@ dependencies = [
"regex",
"serde",
"serde_json",
"strum 0.25.0",
"strum 0.26.2",
"toml",
"typst",
"typst-ide",
@ -3747,9 +3753,9 @@ dependencies = [
[[package]]
name = "toml"
version = "0.8.10"
version = "0.8.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290"
checksum = "af06656561d28735e9c1cd63dfd57132c8155426aa6af24f36a00a351f88c48e"
dependencies = [
"serde",
"serde_spanned",
@ -3768,9 +3774,9 @@ dependencies = [
[[package]]
name = "toml_edit"
version = "0.22.6"
version = "0.22.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6"
checksum = "18769cd1cec395d70860ceb4d932812a0b4d06b1a4bb336745a4d21b9496e992"
dependencies = [
"indexmap 2.2.5",
"serde",
@ -3872,8 +3878,8 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
[[package]]
name = "typst"
version = "0.10.0"
source = "git+https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.0#e1daef5ab881af01bd86f2dd9700dd759c017387"
version = "0.11.0"
source = "git+https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.0#88608109579929b0c1fbab12d7a2afaea0baaf74"
dependencies = [
"az",
"bitflags 2.4.2",
@ -3919,7 +3925,7 @@ dependencies = [
"ttf-parser",
"two-face",
"typed-arena",
"typst-assets 0.10.0",
"typst-assets 0.11.0",
"typst-macros",
"typst-syntax",
"typst-timing",
@ -3938,13 +3944,14 @@ source = "git+https://github.com/typst/typst-assets?rev=4d1211a#4d1211ab5ba8a029
[[package]]
name = "typst-assets"
version = "0.11.0-rc1"
source = "git+https://github.com/typst/typst-assets?tag=v0.11.0-rc1#0ef66188759fc7035be57d9608ccb1ecfd3ef796"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f13f85360328da54847dd7fefaf272dfa5b6d1fdeb53f32938924c39bf5b2c6c"
[[package]]
name = "typst-ide"
version = "0.10.0"
source = "git+https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.0#e1daef5ab881af01bd86f2dd9700dd759c017387"
version = "0.11.0"
source = "git+https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.0#88608109579929b0c1fbab12d7a2afaea0baaf74"
dependencies = [
"comemo",
"ecow",
@ -3957,10 +3964,10 @@ dependencies = [
[[package]]
name = "typst-macros"
version = "0.10.0"
source = "git+https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.0#e1daef5ab881af01bd86f2dd9700dd759c017387"
version = "0.11.0"
source = "git+https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.0#88608109579929b0c1fbab12d7a2afaea0baaf74"
dependencies = [
"heck",
"heck 0.4.1",
"proc-macro2",
"quote",
"syn 2.0.52",
@ -3968,8 +3975,8 @@ dependencies = [
[[package]]
name = "typst-pdf"
version = "0.10.0"
source = "git+https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.0#e1daef5ab881af01bd86f2dd9700dd759c017387"
version = "0.11.0"
source = "git+https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.0#88608109579929b0c1fbab12d7a2afaea0baaf74"
dependencies = [
"base64 0.22.0",
"bytemuck",
@ -3983,7 +3990,7 @@ dependencies = [
"svg2pdf",
"ttf-parser",
"typst",
"typst-assets 0.10.0",
"typst-assets 0.11.0",
"typst-macros",
"typst-timing",
"unicode-properties",
@ -4017,7 +4024,7 @@ dependencies = [
"tokio",
"tokio-tungstenite",
"typst",
"typst-assets 0.11.0-rc1",
"typst-assets 0.11.0",
"typst-ts-compiler",
"typst-ts-core",
"typst-ts-svg-exporter",
@ -4026,8 +4033,8 @@ dependencies = [
[[package]]
name = "typst-syntax"
version = "0.10.0"
source = "git+https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.0#e1daef5ab881af01bd86f2dd9700dd759c017387"
version = "0.11.0"
source = "git+https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.0#88608109579929b0c1fbab12d7a2afaea0baaf74"
dependencies = [
"comemo",
"ecow",
@ -4042,8 +4049,8 @@ dependencies = [
[[package]]
name = "typst-timing"
version = "0.10.0"
source = "git+https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.0#e1daef5ab881af01bd86f2dd9700dd759c017387"
version = "0.11.0"
source = "git+https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.0#88608109579929b0c1fbab12d7a2afaea0baaf74"
dependencies = [
"parking_lot",
"serde",
@ -4054,7 +4061,7 @@ dependencies = [
[[package]]
name = "typst-ts-compiler"
version = "0.4.2-rc8"
source = "git+https://github.com/Myriad-Dreamin/typst.ts?rev=2ba02c5ff3e2ab735849d4e96b331bec14c24a00#2ba02c5ff3e2ab735849d4e96b331bec14c24a00"
source = "git+https://github.com/Myriad-Dreamin/typst.ts?rev=2fc877de0a4bcd7a8f057933546a97348e9621c7#2fc877de0a4bcd7a8f057933546a97348e9621c7"
dependencies = [
"append-only-vec",
"base64 0.22.0",
@ -4092,7 +4099,7 @@ dependencies = [
[[package]]
name = "typst-ts-core"
version = "0.4.2-rc8"
source = "git+https://github.com/Myriad-Dreamin/typst.ts?rev=2ba02c5ff3e2ab735849d4e96b331bec14c24a00#2ba02c5ff3e2ab735849d4e96b331bec14c24a00"
source = "git+https://github.com/Myriad-Dreamin/typst.ts?rev=2fc877de0a4bcd7a8f057933546a97348e9621c7#2fc877de0a4bcd7a8f057933546a97348e9621c7"
dependencies = [
"base64 0.22.0",
"base64-serde",
@ -4129,13 +4136,14 @@ dependencies = [
[[package]]
name = "typst-ts-svg-exporter"
version = "0.4.2-rc8"
source = "git+https://github.com/Myriad-Dreamin/typst.ts?rev=2ba02c5ff3e2ab735849d4e96b331bec14c24a00#2ba02c5ff3e2ab735849d4e96b331bec14c24a00"
source = "git+https://github.com/Myriad-Dreamin/typst.ts?rev=2fc877de0a4bcd7a8f057933546a97348e9621c7#2fc877de0a4bcd7a8f057933546a97348e9621c7"
dependencies = [
"base64 0.22.0",
"comemo",
"log",
"once_cell",
"rayon",
"reflexo",
"siphasher 1.0.0",
"tiny-skia",
"typst",

View file

@ -1,7 +1,7 @@
[workspace.package]
description = "An integrated language service for Typst."
authors = ["Myriad-Dreamin <camiyoru@gmail.com>", "Nathan Varner"]
version = "0.10.2"
version = "0.10.3"
edition = "2021"
readme = "README.md"
license = "Apache-2.0"
@ -19,36 +19,38 @@ once_cell = "1"
anyhow = "1"
fxhash = "0.2.1"
ecow = "0.2.0"
ecow = "0.2.1"
comemo = "0.4"
ena = "0.14.2"
futures = "0.3"
regex = "1.8.1"
itertools = "0.12.0"
regex = "1.10.3"
itertools = "0.12.1"
lazy_static = "1.4.0"
env_logger = "0.11.1"
log = "0.4.17"
strum = { version = "0.25.0", features = ["derive"] }
async-trait = "0.1.73"
env_logger = "0.11.3"
log = "0.4.21"
strum = { version = "0.26.2", features = ["derive"] }
async-trait = "0.1.77"
parking_lot = "0.12.1"
thiserror = "1.0.44"
walkdir = "2"
indexmap = "2.1.0"
paste = "1.0"
toml = { version = "0.8", default-features = false, features = [
"parse",
"display",
] }
codespan-reporting = "0.11"
typst = "0.10.0"
typst-ide = "0.10.0"
typst-pdf = "0.10.0"
typst = "0.11.0"
typst-ide = "0.11.0"
typst-pdf = "0.11.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 = { git = "https://github.com/Enter-tainer/typst-preview", rev = "b7db246d8a61a2f1caf9d3a6aa6b74ac68c3027c" }
typst-ts-core = { version = "0.4.2-rc8" }
typst-ts-compiler = { version = "0.4.2-rc8" }
typst-preview = { git = "https://github.com/Enter-tainer/typst-preview", rev = "18630ebda22339109ef675a885787f4fc8731ba8" }
lsp-server = "0.7.3"
lsp-server = "0.7.6"
lsp-types = { version = "=0.95.0", features = ["proposed"] }
crossbeam-channel = "0.5.8"
crossbeam-channel = "0.5.12"
clap = { version = "4.4", features = ["derive", "env", "unicode", "wrap_help"] }
clap_builder = { version = "4", features = ["string"] }
@ -62,7 +64,7 @@ vergen = { version = "8.2.5", features = [
"gitcl",
"rustc",
] }
tokio = { version = "1.34.0", features = [
tokio = { version = "1.36.0", features = [
"macros",
"rt-multi-thread",
"io-std",
@ -71,8 +73,8 @@ tokio-util = "0.7.10"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
divan = "0.1.7"
insta = { vesrion = "1.34", features = ["glob"] }
divan = "0.1.14"
insta = { vesrion = "1.36", features = ["glob"] }
[profile.dev.package.insta]
opt-level = 3
@ -110,9 +112,9 @@ typst-syntax = { git = "https://github.com/Myriad-Dreamin/typst.git", branch = "
# typst-pdf = { path = "../typst/crates/typst-pdf" }
# typst-syntax = { path = "../typst/crates/typst-syntax" }
typst-ts-svg-exporter = { git = "https://github.com/Myriad-Dreamin/typst.ts", rev = "2ba02c5ff3e2ab735849d4e96b331bec14c24a00", package = "typst-ts-svg-exporter" }
typst-ts-core = { git = "https://github.com/Myriad-Dreamin/typst.ts", rev = "2ba02c5ff3e2ab735849d4e96b331bec14c24a00", package = "typst-ts-core" }
typst-ts-compiler = { git = "https://github.com/Myriad-Dreamin/typst.ts", rev = "2ba02c5ff3e2ab735849d4e96b331bec14c24a00", package = "typst-ts-compiler" }
typst-ts-svg-exporter = { git = "https://github.com/Myriad-Dreamin/typst.ts", rev = "2fc877de0a4bcd7a8f057933546a97348e9621c7", package = "typst-ts-svg-exporter" }
typst-ts-core = { git = "https://github.com/Myriad-Dreamin/typst.ts", rev = "2fc877de0a4bcd7a8f057933546a97348e9621c7", package = "typst-ts-core" }
typst-ts-compiler = { git = "https://github.com/Myriad-Dreamin/typst.ts", rev = "2fc877de0a4bcd7a8f057933546a97348e9621c7", package = "typst-ts-compiler" }
# typst-ts-svg-exporter = { path = "../typst.ts/exporter/svg" }
# typst-ts-core = { path = "../typst.ts/core" }

View file

@ -39,6 +39,9 @@ Language service (LSP) features:
Extra features:
- Compiles to PDF on save (configurable to as-you-type, or other options)
- [Editor tools](https://github.com/Myriad-Dreamin/tinymist/tree/main/tools/editor-tools):
- View a list of templates in template gallery.
- Click a button in template gallery to initialize a new project with a template.
## Installation

View file

@ -27,7 +27,7 @@ once_cell.workspace = true
fxhash.workspace = true
toml.workspace = true
walkdir.workspace = true
indexmap = "2.1.0"
indexmap.workspace = true
typst.workspace = true
typst-ide.workspace = true

View file

@ -68,7 +68,7 @@ pub fn analyze_import(world: &dyn World, source: &LinkedNode) -> Option<Value> {
let context = Context::none();
let mut vm = Vm::new(
engine,
&context,
context.track(),
Scopes::new(Some(world.library())),
Span::detached(),
);

View file

@ -27,7 +27,7 @@ log.workspace = true
serde.workspace = true
serde_json.workspace = true
parking_lot.workspace = true
paste = "1.0"
paste.workspace = true
clap = { workspace = true, optional = true }
clap_builder.workspace = true
@ -44,7 +44,7 @@ typst-ts-core = { version = "0.4.2-rc6", default-features = false, features = [
"vector-bbox",
"no-content-hint",
] }
codespan-reporting = "0.11"
codespan-reporting.workspace = true
typst-ts-compiler.workspace = true
toml.workspace = true
walkdir.workspace = true

View file

@ -4,7 +4,53 @@ All notable changes to the "tinymist" extension will be documented in this file.
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
## v0.10.3 - [2024-03-16]
### Commands/Tools (New)
* feat: support rest code lens in https://github.com/Myriad-Dreamin/tinymist/pull/45
* Preview
* Preview in ..
* `doc` or `slide` mode
* `tab` or `browser` target
* Export as ..
* PDF format
* feat: add init template command in https://github.com/Myriad-Dreamin/tinymist/pull/50
* feat: add template gallery as template picker in https://github.com/Myriad-Dreamin/tinymist/pull/52
### References (New)
* feat: support find/goto syntactic references in https://github.com/Myriad-Dreamin/tinymist/pull/34 and https://github.com/Myriad-Dreamin/tinymist/pull/42
### Autocompletion
* feat: upgrade compiler for autocompleting package in https://github.com/Myriad-Dreamin/tinymist/pull/30
### Definition
* dev: reimplements definition analysis in https://github.com/Myriad-Dreamin/tinymist/pull/43
### Inlay Hint
* feat: implement inlay hint configuration in https://github.com/Myriad-Dreamin/tinymist/pull/37
* feat: disable inlay hints on one line content blocks in https://github.com/Myriad-Dreamin/tinymist/pull/48
* dev: change position of inlay hint params in https://github.com/Myriad-Dreamin/tinymist/pull/51
### Misc
* feat: supports vscode variables in configurations, more testing, and validation in https://github.com/Myriad-Dreamin/tinymist/pull/53
* You can set root/server/font path(s) with vscode variables. The variables are listed in https://www.npmjs.com/package/vscode-variables.
### Internal Optimization
* feat: deferred root resolution in https://github.com/Myriad-Dreamin/tinymist/pull/32
* feat: allow fuzzy selection to deref targets in https://github.com/Myriad-Dreamin/tinymist/pull/46
* feat: implements def-use analysis in https://github.com/Myriad-Dreamin/tinymist/pull/17, https://github.com/Myriad-Dreamin/tinymist/pull/19, https://github.com/Myriad-Dreamin/tinymist/pull/25, and https://github.com/Myriad-Dreamin/tinymist/pull/26
**Full Changelog**: https://github.com/Myriad-Dreamin/tinymist/compare/v0.10.2...v0.10.3
## v0.10.2 - [2024-03-12]
* use implicit autocomplete in https://github.com/Myriad-Dreamin/tinymist/pull/3
* add the new context keyword in https://github.com/Myriad-Dreamin/tinymist/pull/6
* correctly drop sender after the server shutting down in https://github.com/Myriad-Dreamin/tinymist/pull/7

View file

@ -1,6 +1,10 @@
# Tinymist Typst VS Code Extension
A VS Code extension for Typst.
A VS Code or VS Codium extension for Typst. You can find the extension on:
- Night versions available at [GitHub Actions](https://github.com/Myriad-Dreamin/tinymist/actions).
- Stable versions available at [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=myriad-dreamin.tinymist).
- Stable versions available at [Open VSX](https://open-vsx.org/extension/myriad-dreamin/tinymist).
## Features
@ -8,21 +12,33 @@ See [Tinymist features](https://github.com/Myriad-Dreamin/tinymist#features) for
## Usage Tips
- This extension compiles to PDF, but it doesn't have a PDF viewer yet. To view
the output as you work, install a PDF viewer extension, such as
`vscode-pdf`.
- This extension compiles to PDF, but it doesn't have a PDF viewer yet. To view the output as you work, install a PDF viewer extension, such as `vscode-pdf`.
- To initialize a Typst project:
- Use command `Typst Init Template` (tinymist.initTemplate) to initialize a new Typst project based on a template.
- Use command `Typst Show Template` (tinymist.showTemplateGallery) to show available Typst templates for picking up a template to initialize.
- There is a **global** configuration `tinymist.typstExtraArgs` to pass extra arguments to tinymist LSP, like what you usually do with `typst-cli` CLI.
- For example, you can set it to `["--input=awa=1", "--input=abaaba=2"]` to configure `sys.inputs`.
- Note: the arguments has quite low priority, and that may be overridden by other settings.
- To find a way to compile PDF:
- Use command `Typst Show PDF ...` to show the current document to PDF.
- Use command `Typst Export PDF ...` to export the current document to PDF.
- There are code lens buttons at the start of the document to export your
document to PDF or other formats.
- Click the code len `Export PDF` at the top of document, or use command `Typst Show PDF ...`, to show the current document to PDF.
- Use command `Typst Export PDF` to export the current document to PDF.
- There are code lens buttons at the start of the document to export your document to PDF or other formats.
- To configure path to search fonts:
1. Open settings.
- File -> Preferences -> Settings (Linux, Windows).
- Code -> Preferences -> Settings (Mac).
2. Search for "Tinymist Font Paths" for providing paths to search fonts order-by-order.
3. Search for "Tinymist No System Fonts" for disabling system fonts to be searched, which is useful for reproducible rendering your PDF documents.
4. Reload the window or restart the vscode editor to make the settings take effect.
**Note:** you must provide absolute paths.
**Note':** you can use vscode variables in the settings, see [vscode-variables](https://www.npmjs.com/package/vscode-variables) for more information.
- To configure the root path resolved for Typst compiler:
1. Open settings.
2. Search for "Tinymist Root Path" and modify the value.
3. Reload the window or restart the vscode editor to make the settings take effect.
**Note:** you must provide absolute paths.
- To configure when PDFs are compiled:
1. Open settings.
- File -> Preferences -> Settings (Linux, Windows)
- Code -> Preferences -> Settings (Mac)
2. Search for "Tinymist Export PDF".
3. Change the "Export PDF" setting.
- `onSave` makes a PDF after saving the Typst file.

View file

@ -13,7 +13,7 @@
],
"publisher": "myriad-dreamin",
"license": "Apache-2.0",
"version": "0.10.2",
"version": "0.10.3",
"engines": {
"vscode": "^1.71.0"
},
@ -333,7 +333,7 @@
},
{
"command": "tinymist.showTemplateGallery",
"title": "Show available Typst templates for picking up a template to initialize",
"title": "Show available Typst templates (gallery) for picking up a template to initialize",
"category": "Typst"
}
],

View file

@ -31,11 +31,13 @@ export function activate(context: ExtensionContext): Promise<void> {
}
async function startClient(context: ExtensionContext): Promise<void> {
let config: Record<string, any> = workspace.getConfiguration("tinymist");
let config: Record<string, any> = JSON.parse(
JSON.stringify(workspace.getConfiguration("tinymist"))
);
{
const keys = Object.keys(config);
let values = keys.map((key) => config.get(key));
let values = keys.map((key) => config[key]);
values = substVscodeVarsInConfig(keys, values);
config = {};
for (let i = 0; i < keys.length; i++) {
@ -127,7 +129,7 @@ export function deactivate(): Promise<void> | undefined {
}
function getServer(conf: Record<string, any>): string {
const pathInConfig = substVscodeVars(conf.serverPath);
const pathInConfig = conf.serverPath;
if (pathInConfig) {
const validation = validateServer(pathInConfig);
if (!validation.valid) {
@ -360,7 +362,12 @@ function substVscodeVars(str: string | null | undefined): string | undefined {
if (str === undefined || str === null) {
return undefined;
}
return vscodeVariables(str);
try {
return vscodeVariables(str);
} catch (e) {
console.error("failed to substitute vscode variables", e);
return str;
}
}
const STR_VARIABLES = [

View file

@ -66,13 +66,24 @@
"(prefers-color-scheme: dark)"
).matches;
const defaultDarkBackgroundColor = "rgb(17, 17, 17)";
const defaultLightBackgroundColor = "rgb(255, 255, 255)";
const defaultBackgroundColor = serverDark
? "rgb(17, 17, 17)"
: "rgb(255, 255, 255)";
var previewBackgroundColor =
? defaultDarkBackgroundColor
: defaultLightBackgroundColor;
const defaultToolbarDarkFgColor = "#fff";
const defaultToolbarLightFgColor = "#000";
const defaultToolbarFgColor = serverDark
? defaultToolbarDarkFgColor
: defaultToolbarLightFgColor;
const previewBackgroundColor =
getComputedStyle(document.documentElement).getPropertyValue(
"--vscode-sideBar-background"
) || defaultBackgroundColor;
const previewToolbarFgColor =
getComputedStyle(document.documentElement).getPropertyValue(
"--vscode-menu-foreground"
) || defaultToolbarFgColor;
let preferColorScheme = "dark";
/// Perceptible distance between colors:
@ -80,28 +91,22 @@
/// 1~2: perceptible through close observation
/// 2~10: perceptible at a glance
if (deltaE(cssColorToRgba(previewBackgroundColor), [255, 255, 255]) < 5) {
previewBackgroundColor = defaultBackgroundColor;
previewForegroundColor = defaultToolbarFgColor;
previewBackgroundColor = defaultLightBackgroundColor;
previewToolbarFgColor = defaultToolbarLightFgColor;
preferColorScheme = "light";
}
document.documentElement.style.colorScheme = preferColorScheme;
var defaultToolbarFgColor = "#fff";
var previewToolbarFgColor =
getComputedStyle(document.documentElement).getPropertyValue(
"--vscode-menu-foreground"
) || defaultToolbarFgColor;
const previewForegroundColor = previewToolbarFgColor;
var previewForegroundColor = previewToolbarFgColor;
var defaultToolbarBorderColor = "rgba(0, 0, 0, 0)";
var previewToolbarBorderColor =
const defaultToolbarBorderColor = "rgba(0, 0, 0, 0)";
const previewToolbarBorderColor =
getComputedStyle(document.documentElement).getPropertyValue(
"--vscode-menu-border"
) || defaultToolbarBorderColor;
var defaultToolbarBgColor = "rgb(50, 54, 57)";
var previewToolbarBgColor =
const defaultToolbarBgColor = "rgb(50, 54, 57)";
const previewToolbarBgColor =
getComputedStyle(document.documentElement).getPropertyValue(
"--vscode-menu-background"
) || defaultToolbarBgColor;
@ -111,6 +116,11 @@
previewForegroundColor = defaultToolbarFgColor;
}
if (preferColorScheme === "dark") {
document.body.classList.add("typst-preview-dark");
} else {
document.body.classList.add("typst-preview-light");
}
// append css variable --typst-preview-background-color
document.documentElement.style.setProperty(
"--typst-preview-background-color",
@ -145,6 +155,14 @@
background-color: var(--typst-preview-background-color) !important;
"
>
<script>
const themeKind = document.body?.getAttribute("data-vscode-theme-kind");
if (themeKind === "vscode-dark") {
document.body.classList.add("typst-preview-dark");
} else {
document.body.classList.add("typst-preview-light");
}
</script>
<div id="tinymist-app"></div>
</body>
</html>

View file

@ -62,38 +62,33 @@ html, body {
margin: 24px 28px;
}
@media (prefers-color-scheme: dark) {
.tinymist-card {
background: rgba(255, 255, 255, 0.05);
}
.tinymist-category {
background: rgba(255, 255, 255, 0.05);
}
.tinymist-category-filter-button {
background: rgba(129, 60, 133, 0.6);
}
.tinymist-category-filter-button:hover {
background: rgba(129, 60, 133, 0.9);
}
.tinymist-category-filter-button.activated {
background: rgba(129, 60, 133, 0.9);
}
body.typst-preview-dark .tinymist-card {
background: rgba(193, 108, 108, 0.05);
}
@media (prefers-color-scheme: light) {
.tinymist-card {
background: rgba(0, 0, 0, 0.05);
}
.tinymist-category {
background: rgba(0, 0, 0, 0.05);
}
.tinymist-category-filter-button {
background: rgba(186, 204, 217, 0.6);
}
.tinymist-category-filter-button:hover {
background: rgba(186, 204, 217, 0.9);
}
.tinymist-category-filter-button.activated {
background: rgba(186, 204, 217, 0.9);
}
body.typst-preview-dark .tinymist-category {
background: rgba(255, 255, 255, 0.05);
}
body.typst-preview-dark .tinymist-category-filter-button {
background: rgba(129, 60, 133, 0.6);
}
body.typst-preview-dark .tinymist-category-filter-button:hover {
background: rgba(129, 60, 133, 0.9);
}
body.typst-preview-dark .tinymist-category-filter-button.activated {
background: rgba(129, 60, 133, 0.9);
}
body.typst-preview-light .tinymist-card {
background: rgba(0, 0, 0, 0.05);
}
body.typst-preview-light .tinymist-category {
background: rgba(0, 0, 0, 0.05);
}
body.typst-preview-light .tinymist-category-filter-button {
background: rgba(186, 204, 217, 0.6);
}
body.typst-preview-light .tinymist-category-filter-button:hover {
background: rgba(186, 204, 217, 0.9);
}
body.typst-preview-light .tinymist-category-filter-button.activated {
background: rgba(186, 204, 217, 0.9);
}