Deno July Update: monorepo, workspace, and private npm registry support
Deno July Update
This month’s update includes Deno 1.45, JSR updates, and more! Let’s dive right in.
Join us for a livestream next Tuesday, July 16th, 9am PT (UTC-7), where we cover how to setup monorepos and workspaces with Deno and answer your questions.
Deno 1.45: Workspaces, monorepos, private npm registries
We’ve had a busy summer so far, with added support for workspaces, monorepo, and private npm registries (as of 1.44).
Workspace support
There are two forms of supported workspaces: Deno-first workspaces (defined in a root-level deno.json
) and backwards-compatible npm workspaces.
To get started, define a "workspace"
element inside your deno.json
and list the member directories:
{
"workspace": ["./add", "./subtract"]
}
npm
workspaces also work in Deno, whether you’re including a Deno library in a larger npm workspace or vice versa.
To learn more about workspaces and to see examples, check out Deno Docs.
We’re also hosting a one-hour livestream on YouTube on Tuesday, July 16th, 9AM PT (UTC-7) to cover our new workspace support in detail and answer your questions.
Private npm registries
As of Deno 1.44, you can use an .npmrc
file to configure Deno to fetch packages from a private registry. Here’s an example:
// .npmrc
@mycompany:registry=http://mycompany.com:8111/
//mycompany.com:8111/:_auth=secretToken
// deno.json
{
"imports": {
"@mycompany/package": "npm:@mycompany/package@1.0.0"
}
}
// main.ts
import { hello } from "@mycompany/package";
console.log(hello());
$ deno run main.ts
Hello world!
You can also watch a short demo on how to use private npm registries on YouTube.
Other runtime updates
We’ve made a ton of improvements and bug fixes to the Deno runtime in 1.44 and 1.45. The most notable updates being:
- gRPC connections are now supported
- improved lockfile management with the new
--frozen
flag that lets you know if your lockfile is out of date - updated
deno install
that will behave more likenpm install
to support common workflows deno init --lib
to easily setup a new librarydeno compile
now supports the--env
flag
And more!
Read the full 1.45 release notes ⇒
JSR: Hono, Deno Standard Library, and more
Everyday, we continue to see modules being added to JSR. Recent ones of note include the Deno Standard Library and Hono. Note that we are working towards stabilizing the Standard Library, which will be stabilized on a package-by-package basis. (As of this newsletter, we have stabilized 13 out of 38 utility packages.)
We also recently published a video that shows, side-by-side, publishing a TypeScript module to npm vs. JSR. There are a bunch of steps that one must take to make sure the right files are getting to npm, which are handled by JSR behind the scenes:
From the community
deco.cx Hackathon
The 5thThat’s right, the HTMX Edition of this hackathon begins today, Friday, July 12th. It’s a great opportunity to turn your ideas into high-performance websites using HTMX. Plus, there’s also over $5k in prizes 💰️.
#Showcase
There have been plenty of new projects being shared in our Discord’s #showcase channel:
- The Jupyter kernel in Zed is powered by Deno
- A feature flag library for Deno Deploy
- Erodev: a Deno development server with auto-reload
- NoMake-zit: a simple compression/decompression library for Deno
- An excalidraw demo written as a single JSR import 🤯️
- jex: a configurable API client that lets you define strongly-typed HTTP calls with a JSON-like schema
- A simple HTML bundler that offers a CLI, Deno and a web API.
If you’ve created something with Deno and would like to share it with the Deno community, please use the Discord’s #showcase channel.
In case you missed it…
- How we made our Deno language server faster ten times faster
- Did you know the Guardian uses Deno to audit 2.7m articles?
- We’ve quietly added more features to Subhosting, our product that lets you easily run third-party JavaScript securely, such as more flexible domain association and KV backup
- Haven’t found time to learn TypeScript? We’re starting a new bite-sized TypeScript tutorial series!
And that’s it for this issue! If you think someone might find this useful, please forward it to them.
— Andy