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