mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-23 04:45:21 +00:00
feat: add js package registry support for tinymist-wasm (#2102)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
This commit is contained in:
parent
c8e723fac7
commit
b239224a63
10 changed files with 278 additions and 79 deletions
|
|
@ -3,6 +3,7 @@
|
|||
use std::{io::Read, path::Path};
|
||||
|
||||
use js_sys::Uint8Array;
|
||||
use tinymist_std::ImmutPath;
|
||||
use typst::diag::{EcoString, eco_format};
|
||||
use wasm_bindgen::{JsValue, prelude::*};
|
||||
|
||||
|
|
@ -120,6 +121,19 @@ impl PackageRegistry for JsRegistry {
|
|||
}
|
||||
}
|
||||
|
||||
impl JsRegistry {
|
||||
/// Returns the path at which non-local packages should be stored when
|
||||
/// downloaded.
|
||||
pub fn package_cache_path(&self) -> Option<&ImmutPath> {
|
||||
None
|
||||
}
|
||||
|
||||
/// Returns the path at which local packages are stored.
|
||||
pub fn package_path(&self) -> Option<&ImmutPath> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
// todo
|
||||
/// Safety: `JsRegistry` is only used in the browser environment, and we cannot
|
||||
/// share data between workers.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue