feat: build tinymist targeting web (#1102)

* feat: add web target

* dev: simple package rule

* dev: update web release

* dev: update workspace

* ci: setup wasm pack

* ci: correct path to upload

* ci: build artifact

* fix: update metadata and launch config
This commit is contained in:
Myriad-Dreamin 2025-01-03 10:30:38 +08:00 committed by GitHub
parent 2464c5b66c
commit d32f6261f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 218 additions and 29 deletions

View file

@ -0,0 +1,31 @@
//! Generates project metadata.
use anyhow::Result;
use vergen::EmitBuilder;
fn main() -> Result<()> {
// Emit the instructions
EmitBuilder::builder()
.all_cargo()
.build_timestamp()
.git_sha(false)
.git_describe(true, true, None)
.all_rustc()
.emit()?;
let metadata = cargo_metadata::MetadataCommand::new().exec().unwrap();
let typst = metadata
.packages
.iter()
.find(|package| package.name == "typst")
.expect("Typst should be a dependency");
println!("cargo:rustc-env=TYPST_VERSION={}", typst.version);
let src = typst
.source
.as_ref()
.map(|e| e.repr.as_str())
.unwrap_or_default();
println!("cargo:rustc-env=TYPST_SOURCE={src}");
Ok(())
}