mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-08-04 02:08:17 +00:00
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:
parent
2464c5b66c
commit
d32f6261f1
18 changed files with 218 additions and 29 deletions
31
crates/tinymist-core/build.rs
Normal file
31
crates/tinymist-core/build.rs
Normal 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(())
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue