Skip to content

Commit b89d3ca

Browse files
committed
New repo
1 parent 5a0b028 commit b89d3ca

10 files changed

Lines changed: 113070 additions & 6 deletions

File tree

web/load.mjs

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { writeFileSync } from "fs";
33
const binArm64 = "https://meta.pkgforge.dev/bincache/aarch64-Linux.json";
44
const binX86 = "https://meta.pkgforge.dev/bincache/x86_64-Linux.json";
55

6+
const soarpkgs = "https://meta.pkgforge.dev/soarpkgs/INDEX.json";
7+
68
const run = async (url, branch, arch) => {
79
/**
810
* @type {{ pkg: string, build_date: string, family: string, sha: string, id: string?, name: string, version: string, category: string, size: string, sizeNum: number, type: "base" | "bin" | "pkg" }[]}
@@ -19,14 +21,28 @@ const run = async (url, branch, arch) => {
1921
resp.forEach((data) => {
2022
response.push(data);
2123

24+
if (!data.pkg_webpage) {
25+
console.log(`⚠️ Auto guessed pkg_webpage for ${branch}-${arch}/${data.pkg_family}/${data.pkg_name || data.pkg}`)
26+
data.pkg_webpage = `https://pkgs.pkgforge.dev/repo/${branch}/${arch}/${
27+
data.pkg_family
28+
}/${data.pkg_name || data.pkg}`;
29+
}
30+
2231
if (familyMap[data.pkg_family]) {
23-
familyMap[data.pkg_family].push([data.pkg_name, data.pkg_webpage]);
32+
familyMap[data.pkg_family].push([
33+
data.pkg_name || data.pkg,
34+
data.pkg_webpage,
35+
]);
2436
} else {
25-
familyMap[data.pkg_family] = [[data.pkg_name, data.pkg_webpage]];
37+
familyMap[data.pkg_family] = [
38+
[data.pkg_name || data.pkg, data.pkg_webpage],
39+
];
2640
}
2741
});
2842

29-
response.sort((a, b) => a.pkg_name.localeCompare(b.pkg_name));
43+
response.sort((a, b) =>
44+
(a.pkg_name || a.pkg).localeCompare(b.pkg_name || b.pkg)
45+
);
3046

3147
writeFileSync(
3248
`./src/pages/repo/${branch}/${arch}/_family.json`,
@@ -67,6 +83,9 @@ const run = async (url, branch, arch) => {
6783
console.log("⏲️ Downloading bincache x86_64");
6884
await run(binX86, "bincache", "x86_64-linux");
6985

86+
console.log("⏲️ Downloading soarpkgs");
87+
await run(soarpkgs, "soarpkgs", "linux");
88+
7089
// console.log("⏲️ Downloading Community");
7190
// await run(community, "community", "universal-linux");
7291

web/src/components/data-table.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ import binX86 from "../metadata_bincache_x86_64-linux.json";
3939

4040
const binArm64 = import("../metadata_bincache_aarch64-linux.json");
4141

42+
const soarPkgs = import("../metadata_soarpkgs_linux.json");
43+
4244
interface DataTableProps<TData, TValue> {
4345
columns: ColumnDef<TData, TValue>[]
4446
data: TData[]
@@ -77,6 +79,9 @@ export function DataTable<TData, TValue>({
7779
React.useEffect(() => {
7880
(async () => {
7981
switch (page) {
82+
case "s":
83+
setData(soarPkgs as unknown as TData[]);
84+
break;
8085
case "bin":
8186
setData(binX86 as unknown as TData[]);
8287
break;
@@ -156,6 +161,7 @@ export function DataTable<TData, TValue>({
156161
<SelectItem value="bin">bincache (x86_64)</SelectItem>
157162
<SelectItem value="bina">bincache (aarch64)</SelectItem>
158163
</SelectGroup>
164+
<SelectItem value="s">soarpkgs</SelectItem>
159165
</SelectContent>
160166
</Select>
161167
<Select
@@ -204,7 +210,7 @@ export function DataTable<TData, TValue>({
204210
<DropdownMenuCheckboxItem
205211
key={column.id}
206212
className={cn("capitalize", {
207-
"uppercase": column.id == "sha" || column.id == 'id',
213+
"uppercase": column.id == "sha" || column.id == 'id',
208214
})}
209215
checked={column.getIsVisible()}
210216
onCheckedChange={(value) =>

web/src/metadata_soarpkgs_linux.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

web/src/pages/dl/bincache/aarch64-linux/[family]/[package]/raw.dl.astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
import Layout from "@/layouts/Layout.astro";
33
44
export async function getStaticPaths() {
5-
const { default: apps } = await import("../../../../../repo/bincache/aarch64-linux/_apps.json");
5+
const { default: apps } = await import(
6+
"../../../../../repo/bincache/aarch64-linux/_apps.json"
7+
);
68
79
return apps.map((app) => {
810
// Thanks @Azathothas for forcing us to write this hellifying script

web/src/pages/dl/bincache/x86_64-linux/[family]/[package]/raw.dl.astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
import Layout from "@/layouts/Layout.astro";
33
44
export async function getStaticPaths() {
5-
const { default: apps } = await import("../../../../../repo/bincache/x86_64-linux/_apps.json");
5+
const { default: apps } = await import(
6+
"../../../../../repo/bincache/x86_64-linux/_apps.json"
7+
);
68
79
return apps.map((app) => {
810
// Thanks @Azathothas for forcing us to write this hellifying script
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
import Layout from "@/layouts/Layout.astro";
3+
4+
export async function getStaticPaths() {
5+
const { default: apps } = await import(
6+
"../../../../../repo/soarpkgs/linux/_apps.json"
7+
);
8+
9+
return apps.map((app) => {
10+
// Thanks @Azathothas for forcing us to write this hellifying script
11+
const [, , , , , , pkg_family, pkg] = app.pkg_webpage.split("/");
12+
13+
return {
14+
params: {
15+
family: pkg_family,
16+
package: pkg,
17+
},
18+
props: {
19+
data: app,
20+
},
21+
};
22+
});
23+
}
24+
25+
const { data } = Astro.props;
26+
---
27+
28+
<meta http-equiv="refresh" content={`0;url=${data.download_url}`} />
29+
<Layout>
30+
<div class="flex min-h-[50vh] flex-col items-center justify-center space-y-4">
31+
<h1 class="text-2xl font-bold">Download Started!</h1>
32+
<p class="text-gray-600">
33+
Your download should begin automatically. If it hasn't started, <a
34+
href={data.download_url}
35+
class="text-blue-500 underline">click here</a
36+
>.
37+
</p>
38+
</div>
39+
</Layout>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
import Layout from "../../../../../../layouts/Layout.astro";
3+
import App from "../../../../../../components/app.tsx";
4+
5+
export async function getStaticPaths() {
6+
const { default: apps } = await import("../../_apps.json");
7+
8+
return apps.map((app) => {
9+
// Thanks @Azathothas for forcing us to write this hellifying script
10+
const [, , , , , , pkg_family, pkg] = app.pkg_webpage.split("/");
11+
12+
return {
13+
params: {
14+
family: pkg_family,
15+
package: pkg,
16+
},
17+
props: {
18+
data: app,
19+
logs: app.build_log || "",
20+
},
21+
};
22+
});
23+
}
24+
25+
const { data, logs } = Astro.props;
26+
---
27+
28+
<Layout>
29+
<App data={data} logs={logs} repo="bincache" client:only />
30+
</Layout>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
import Layout from "../../../../../layouts/Layout.astro";
3+
import App from "../../../../../components/family.tsx";
4+
5+
export async function getStaticPaths() {
6+
const { default: family } = await import("../_family.json");
7+
8+
return Object.entries(family).map(([family, apps]) => ({
9+
params: { family },
10+
props: {
11+
name: family,
12+
apps: apps.map(([name, url]) => ({
13+
name,
14+
url,
15+
})),
16+
},
17+
}));
18+
}
19+
20+
const { name, apps } = Astro.props;
21+
---
22+
23+
<Layout>
24+
<App apps={apps} name={name} client:load />
25+
</Layout>

0 commit comments

Comments
 (0)