
jsr: SupportWe're excited to announce that you can now installJSR packages directly with thevlt client!
$ vltinstall jsr:<scope>/<name>$ vltinstall jsr:<scope>/<name>@<version range>For example, to install@luca/cases from thejsr: registry, you can do this:
$ vltinstall jsr:@luca/cases@1This will save the spec back to yourpackage.json in the way you might expect:
{"dependencies":{"@luca/cases":"jsr:1"}}If you just wanna useJSR packages in yourvlt projects, you can stop reading now. If you're curious about how it works and what kinds of things it opens up in the future, keep reading!
If you look closely atvlt's lockfile, you'll see a clue about what's actually going on under the hood:
$cat vlt-lock.json{"options":{},"nodes":{"·https%3A§§npm.jsr.io§·@jsr§[email protected]":[0,"@jsr/luca__cases","sha512-h3nOT3+JVCXBsLd+st9cytZO+iqJYTTsm3rOrtZZXBgJ0nzBA5mDR9dI3k8wBDQ5AAqqJjD3UkhLxoRCEKwzgg==","https://npm.jsr.io/~/11/@jsr/luca__cases/1.0.0.tgz"]},"edges":{"file·. @luca/cases":"prod jsr:1 ·https%3A§§npm.jsr.io§·@jsr§[email protected]"}}Thejsr: prefix uses a special new configuration,jsr-registries, which maps these prefixes to the URL serving the JSR style registry. Thehttps://npm.jsr.io/ registry is hard coded as thejsr: prefix, but this is extensible with the expectation that some day you'll be able to host your own JSR registries elsewhere.
The vlt dependency specification parser translates thisjsr: specifier to a normal registry specifier using JSR'snpm compatibility layer. While this is arguably not ideal for cases where you want the uncompiled TypeScript, it offers the best trade-off in terms of compatibility with zero added configuration.
At some point in the future, we may add a way to tellvlt to fetch the raw un-transpiled TypeScript from your JSR registries, but for now, we went with the thing that Just Works™️ for all Node, Bun, and Deno projects.
Technically thisjsr: prefix is an alias just likenpm:, but with the added behavior of doing this name remapping to the compiled version of the package.
What do you think of this feature? What would you like to see us support next?
Curious to learn more about vlt? Join our waitlist and get early access.