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,30 @@
//! Tinymist Core Library
use std::sync::LazyLock;
/// The long version description of the library
pub static LONG_VERSION: LazyLock<String> = LazyLock::new(|| {
format!(
"
Build Timestamp: {}
Build Git Describe: {}
Commit SHA: {}
Commit Date: {}
Commit Branch: {}
Cargo Target Triple: {}
Typst Version: {}
Typst Source: {}
",
env!("VERGEN_BUILD_TIMESTAMP"),
env!("VERGEN_GIT_DESCRIBE"),
option_env!("VERGEN_GIT_SHA").unwrap_or("None"),
option_env!("VERGEN_GIT_COMMIT_TIMESTAMP").unwrap_or("None"),
option_env!("VERGEN_GIT_BRANCH").unwrap_or("None"),
env!("VERGEN_CARGO_TARGET_TRIPLE"),
env!("TYPST_VERSION"),
env!("TYPST_SOURCE"),
)
});
#[cfg(feature = "web")]
pub mod web;

View file

@ -0,0 +1,11 @@
//! Tinymist Web APIs.
use wasm_bindgen::prelude::*;
use crate::LONG_VERSION;
/// Gets the long version description of the library.
#[wasm_bindgen]
pub fn version() -> String {
LONG_VERSION.clone()
}