Resolve a bare name against the official registry; user manifest overrides go through `resolve`.
(name: &str)
| 46 | |
| 47 | /// Resolve a bare name against the official registry; user manifest overrides go through `resolve`. |
| 48 | pub fn registry(name: &str) -> Option<(Kind, String)> { |
| 49 | if STD.contains(&name) { |
| 50 | Some((Kind::Std, std_url(name))) |
| 51 | } else if HOST.contains(&name) { |
| 52 | Some((Kind::Host, format!("https://cdn.edgepython.com/host/{name}/index.js"))) |
| 53 | } else { |
| 54 | None |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | /// CDN url for a std package. Most ship as `.wasm`; `test` is pure Edge Python, served as `.py`. Mirrors runtime/src/defaults.js. |
| 59 | fn std_url(name: &str) -> String { |