Path: blob/main/package/src/common/dependencies/deno.ts
6451 views
/*1* esbuild.ts2*3* Copyright (C) 2020-2022 Posit Software, PBC4*5*/6import { Dependency } from "./dependencies.ts";7import { Configuration } from "../config.ts";8import { join, dirname } from "../../../../src/deno_ral/path.ts";9import { unzip } from "../../util/utils.ts";1011export function deno(version: string): Dependency {12// Handle the configuration for this dependency13const officialDenoRelease = (14platformstr: string,15denoDir: string,16) => {17// https://github.com/denoland/deno/releases/download/v1.30.2/deno-aarch64-apple-darwin.zip18return {19filename: `deno-${platformstr}.zip`,20url: `https://github.com/denoland/deno/releases/download/${version}/`,21configure: async (_config: Configuration, path: string) => {22const vendor = Deno.env.get("QUARTO_VENDOR_BINARIES");23if (vendor === undefined || vendor === "true") {24const dest = join(dirname(path), denoDir);2526// Expand27await unzip(path, dest);28}29},30};31};3233// Handle the configuration for this dependency34const linuxAmd64DenoRelease = () => {35// Before 1.41 available at:36// https://github.com/LukeChannings/deno-arm64/releases/download/v1.28.2/deno-linux-arm64.zip37// but after 1.41 available at:38// https://github.com/denoland/deno/releases/download/v1.41.0/deno-aarch64-unknown-linux-gnu.zip39return {40filename: `deno-aarch64-unknown-linux-gnu.zip`,41url:42`https://github.com/denoland/deno/releases/download/${version}/`,43configure: async (_config: Configuration, path: string) => {44const vendor = Deno.env.get("QUARTO_VENDOR_BINARIES");45if (vendor === undefined || vendor === "true") {46const dest = join(dirname(path), "aarch64");4748// Expand49await unzip(path, dest);50}51},52};53};5455return {56name: "Deno typescript runtime",57bucket: "deno",58version,59architectureDependencies: {60"x86_64": {61"windows": officialDenoRelease("x86_64-pc-windows-msvc", "x86_64"),62"linux": officialDenoRelease(63"x86_64-unknown-linux-gnu",64"x86_64",65),66"darwin": officialDenoRelease(67"x86_64-apple-darwin",68"x86_64",69),70},71"aarch64": {72"darwin": officialDenoRelease(73"aarch64-apple-darwin",74"aarch64",75),76"linux": linuxAmd64DenoRelease(),77},78},79};80}818283