pub struct Package {
pub manifest: HashMap<String, Manifest>,
pub module_graph1: Option<HashMap<String, Value>>,
pub module_graph2: Option<HashMap<String, ModuleGraph2>>,
pub exports: HashMap<String, String>,
}
Expand description
The package result
See https://jsr.io/docs/api#package-version-metadata
Fields§
§manifest: HashMap<String, Manifest>
List of file manifests in one package
(HashMap Key prefix: /
(see this example for differences))
module_graph1: Option<HashMap<String, Value>>
Module graph 1. Since it was used only for old & early JSR packages (example), Package::module_graph2 was widely used
(HashMap Key prefix: /
(see this example for differences))
module_graph2: Option<HashMap<String, ModuleGraph2>>
Module graph 2. This is the most widely used graph on JSR packages
(HashMap Key prefix: /
(see this example for differences))
exports: HashMap<String, String>
Exported files. For main entry, usually .
exist. But can be changed using ./
prefix
The key and value on exports
outputted from meta.json
are converted to HashMap
So if deno.json
file only has this
"exports":"hi.ts"
JSR will convert it as this in meta.json
"exports":{
".":"./hi.ts"
}
Though, you can change it so it dosent contain the main entry:
"exports":{
"./hi":"./hi.ts"
}
JSR will kept it like that
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Package
impl<'de> Deserialize<'de> for Package
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Package
impl StructuralPartialEq for Package
Auto Trait Implementations§
impl Freeze for Package
impl RefUnwindSafe for Package
impl Send for Package
impl Sync for Package
impl Unpin for Package
impl UnwindSafe for Package
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.