Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/lib/landing/software-data.ts
1450 views
1
/*
2
* This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
// NOTE: this pulls in a lot of data. Make sure to never load it indirectly from a page.
7
8
import { fromPairs } from "lodash";
9
10
import {
11
SoftwareEnvNames,
12
SOFTWARE_ENV_NAMES,
13
} from "@cocalc/util/consts/software-envs";
14
import { EnvData } from "./types";
15
16
import SOFTWARE_2004 from "software-inventory/20.04.json";
17
import SOFTWARE_2204 from "software-inventory/22.04.json";
18
import SOFTWARE_2404 from "software-inventory/24.04.json";
19
20
21
export const SOFTWARE_URLS: { [key in SoftwareEnvNames]: string } = fromPairs(
22
SOFTWARE_ENV_NAMES.map((name) => [
23
name,
24
`https://storage.googleapis.com/cocalc-compute-environment/software-inventory-${name}.json`,
25
]),
26
);
27
28
// Note: we need to be explicit with these rougher types, because TS can't infer them from the JSON files since they're too large.
29
export const SOFTWARE_FALLBACK: { [key in SoftwareEnvNames]: EnvData } = {
30
"20.04": SOFTWARE_2004 as EnvData,
31
"22.04": SOFTWARE_2204 as EnvData,
32
"24.04": SOFTWARE_2404 as EnvData,
33
34
} as const;
35
36