Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/package/src/common/dependencies/deno.ts
6451 views
1
/*
2
* esbuild.ts
3
*
4
* Copyright (C) 2020-2022 Posit Software, PBC
5
*
6
*/
7
import { Dependency } from "./dependencies.ts";
8
import { Configuration } from "../config.ts";
9
import { join, dirname } from "../../../../src/deno_ral/path.ts";
10
import { unzip } from "../../util/utils.ts";
11
12
export function deno(version: string): Dependency {
13
// Handle the configuration for this dependency
14
const officialDenoRelease = (
15
platformstr: string,
16
denoDir: string,
17
) => {
18
// https://github.com/denoland/deno/releases/download/v1.30.2/deno-aarch64-apple-darwin.zip
19
return {
20
filename: `deno-${platformstr}.zip`,
21
url: `https://github.com/denoland/deno/releases/download/${version}/`,
22
configure: async (_config: Configuration, path: string) => {
23
const vendor = Deno.env.get("QUARTO_VENDOR_BINARIES");
24
if (vendor === undefined || vendor === "true") {
25
const dest = join(dirname(path), denoDir);
26
27
// Expand
28
await unzip(path, dest);
29
}
30
},
31
};
32
};
33
34
// Handle the configuration for this dependency
35
const linuxAmd64DenoRelease = () => {
36
// Before 1.41 available at:
37
// https://github.com/LukeChannings/deno-arm64/releases/download/v1.28.2/deno-linux-arm64.zip
38
// but after 1.41 available at:
39
// https://github.com/denoland/deno/releases/download/v1.41.0/deno-aarch64-unknown-linux-gnu.zip
40
return {
41
filename: `deno-aarch64-unknown-linux-gnu.zip`,
42
url:
43
`https://github.com/denoland/deno/releases/download/${version}/`,
44
configure: async (_config: Configuration, path: string) => {
45
const vendor = Deno.env.get("QUARTO_VENDOR_BINARIES");
46
if (vendor === undefined || vendor === "true") {
47
const dest = join(dirname(path), "aarch64");
48
49
// Expand
50
await unzip(path, dest);
51
}
52
},
53
};
54
};
55
56
return {
57
name: "Deno typescript runtime",
58
bucket: "deno",
59
version,
60
architectureDependencies: {
61
"x86_64": {
62
"windows": officialDenoRelease("x86_64-pc-windows-msvc", "x86_64"),
63
"linux": officialDenoRelease(
64
"x86_64-unknown-linux-gnu",
65
"x86_64",
66
),
67
"darwin": officialDenoRelease(
68
"x86_64-apple-darwin",
69
"x86_64",
70
),
71
},
72
"aarch64": {
73
"darwin": officialDenoRelease(
74
"aarch64-apple-darwin",
75
"aarch64",
76
),
77
"linux": linuxAmd64DenoRelease(),
78
},
79
},
80
};
81
}
82
83