mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-24 21:19:37 +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
30
crates/tinymist-core/src/lib.rs
Normal file
30
crates/tinymist-core/src/lib.rs
Normal 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;
|
||||
11
crates/tinymist-core/src/web.rs
Normal file
11
crates/tinymist-core/src/web.rs
Normal 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()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue