Skip to content

feat: support installing Deno runtime#9791

Merged
zkochan merged 35 commits intomainfrom
deno
Jul 30, 2025
Merged

feat: support installing Deno runtime#9791
zkochan merged 35 commits intomainfrom
deno

Conversation

@zkochan
Copy link
Member

@zkochan zkochan commented Jul 23, 2025

There are two ways we can install Deno. We can install it either from the npm registry or from github release pages.

If we decide to install it from Github, version resolution can be done by getting the list of tag names via: https://api.github.com/repos/denoland/deno/releases. However, we need to make multiple requests as this list is paginated and can return not more than 100 items per page.

We can use a mixed approach and use npm registry just for resolving the version.

For getting the checksums of assets we can use the github API for newer versions: https://api.github.com/repos/denoland/deno/releases/tags/v2.4.2. However, seems like it is a recent feature of Github and older versions don't have the digest field defined: https://api.github.com/repos/denoland/deno/releases/tags/v2.0.0. So, for older versions we need to fetch the .sha256sum file of the asset.

@zkochan zkochan marked this pull request as ready for review July 29, 2025 18:44
@zkochan zkochan added the area: runtime engine Installation of Node.js, Deno, Bun label Jul 29, 2025
@zkochan zkochan requested a review from Copilot July 30, 2025 00:17

This comment was marked as outdated.

@zkochan zkochan requested a review from Copilot July 30, 2025 07:57

This comment was marked as outdated.

@zkochan zkochan requested a review from Copilot July 30, 2025 08:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for installing the Deno runtime through a new resolver that fetches platform-specific binary assets from GitHub releases. The implementation uses version resolution from the npm registry and asset downloads from GitHub to provide a mixed approach for better performance.

Key changes include:

  • Introduction of a new binary resolution system with platform-specific asset variants
  • New Deno resolver that handles version resolution and asset fetching
  • Unified binary fetcher infrastructure for downloading and extracting runtime binaries

Reviewed Changes

Copilot reviewed 42 out of 47 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
resolving/resolver-base/src/index.ts Introduces BinaryResolution and VariationsResolution types for platform-specific binary assets
resolving/deno-resolver/ New package implementing Deno runtime resolution from GitHub releases
fetching/binary-fetcher/ New generic binary fetcher for downloading and extracting zip/tarball archives
env/node.resolver/src/index.ts Refactored to use new VariationsResolution format instead of NodeRuntimeResolution
pkg-manager/package-requester/src/packageRequester.ts Updated to handle VariationsResolution and select appropriate platform-specific assets
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

fetching/binary-fetcher/src/index.ts:141

  • The variable name nodeDir is misleading since this is a generic binary fetcher, not Node.js specific. Consider renaming to extractDir or baseDir.
  const nodeDir = basename === '' ? targetDir : path.dirname(targetDir)

@zkochan zkochan merged commit d1edf73 into main Jul 30, 2025
11 of 13 checks passed
@zkochan zkochan deleted the deno branch July 30, 2025 09:27
@oskarkivra
Copy link

Maybe late to the table but is it possible to add a list of engines? I have a few projects where I use both node and Deno.

@zkochan
Copy link
Member Author

zkochan commented Aug 3, 2025

Yes, it is possible. Like this:

{
  "devEngines": {
    "runtime": [
      {
        "name": "node",
        "version": "^24.4.0",
        "onFail": "download"
      },
      {
        "name": "deno",
        "version": "^2.4.3",
        "onFail": "download"
      }
    ]
  }
}

It is documented here: https://pnpm.io/package_json#devenginesruntime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: runtime engine Installation of Node.js, Deno, Bun

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants