Skip to content

Commit a970b86

Browse files
committed
BREAKING: pkg_family is changed to pkg_id
- removed all mention of family in ui, family now only exists as variables - in load.mjs, instead of mapping through using family to generate the web page it uses pkg_id - family page now shows mapping through Package ID - minor UI fix
1 parent 5298f15 commit a970b86

24 files changed

Lines changed: 799620 additions & 687052 deletions

web/load.mjs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,17 @@ const run = async (url, branch, arch) => {
2626

2727
if (!data.pkg_webpage) {
2828
console.log(
29-
`⚠️ Auto guessed pkg_webpage for ${branch}-${arch}/${data.pkg_family}/${
30-
data.pkg_name || data.pkg
31-
}`
29+
`⚠️ Auto guessed pkg_webpage for ${branch}-${arch}/${data.pkg_id}/${data.pkg_name || data.pkg}`
3230
);
33-
data.pkg_webpage = `https://pkgs.pkgforge.dev/repo/${branch}/${arch}/${
34-
data.pkg_family
35-
}/${data.pkg_name || data.pkg}`;
31+
data.pkg_webpage = `https://pkgs.pkgforge.dev/repo/${branch}/${arch}/${data.pkg_id}/${data.pkg_name || data.pkg}`;
3632
}
3733

38-
const [, , , , , category, pkg_family, pkg] = data.pkg_webpage.split("/");
39-
40-
const key = `${category}/${pkg_family || data.pkg_family}`;
34+
const key = `${data.category}/${data.pkg_id}`;
4135

4236
if (familyMap[key]) {
43-
familyMap[key].push([pkg, data.pkg_webpage]);
37+
familyMap[key].push([data.pkg_name || data.pkg, data.pkg_webpage]);
4438
} else {
45-
familyMap[key] = [[pkg, data.pkg_webpage]];
39+
familyMap[key] = [[data.pkg_name || data.pkg, data.pkg_webpage]];
4640
}
4741
});
4842

@@ -62,11 +56,11 @@ const run = async (url, branch, arch) => {
6256
`./src/metadata_${branch}_${arch}.json`,
6357
JSON.stringify(
6458
response.map((data) => {
65-
const [, , , , , category, pkg_family] = data.pkg_webpage.split("/");
59+
const [, , , , , category] = data.pkg_webpage.split("/");
6660
return {
6761
"name": data.pkg_name || data.pkg,
6862
"pkg": data.pkg,
69-
"family": pkg_family || data.pkg_id,
63+
"family": data.pkg_id,
7064
"version": data.version,
7165
"sha": data.shasum,
7266
"type": data.pkg_type || "none",
@@ -76,7 +70,7 @@ const run = async (url, branch, arch) => {
7670
"id": "N/A",
7771
"Build Date": data.build_date,
7872
"url": data.pkg_webpage,
79-
"familyUrl": `/${branch}/${category}/${pkg_family}`,
73+
"familyUrl": `/${branch}/${category}/${data.pkg_id}`,
8074
};
8175
})
8276
)

web/src/components/app.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,6 @@ function Show({ value, Key, props }: { value: any, props: AppProps, Key?: string
346346
export default function App({ data, logs: build, repo, downloadable = true }: AppProps) {
347347
const { copy, copied } = useClipboard();
348348

349-
// Thanks @Azathothas for forcing us to write this hellifying script
350-
const [, , , , , , pkg_family, pkg] = data.pkg_webpage.split("/");
351-
352349
return (
353350
<TooltipProvider delayDuration={0}>
354351
<div className="flex flex-col lg:flex-row space-y-3 lg:space-y-0 lg:space-x-3 px-5 mt-3 items-start pb-4">
@@ -360,10 +357,6 @@ export default function App({ data, logs: build, repo, downloadable = true }: Ap
360357
<FormulaLinks
361358
webpage_url={data.pkg_webpage}
362359
repo={repo}
363-
arch={data.host}
364-
family={pkg_family}
365-
name={pkg}
366-
download_url={downloadable ? data.download_url : "none"}
367360
/>
368361
<Table className="border border-muted/70 mt-4 rounded-xl">
369362
<TableBody>

web/src/components/data-table-family.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from "react"
22

3-
import type { ColumnDef, VisibilityState, SortingState, ColumnFiltersState } from "@tanstack/react-table";
3+
import type { ColumnDef, SortingState, ColumnFiltersState } from "@tanstack/react-table";
44
import {
55
flexRender,
66
getCoreRowModel,
@@ -21,18 +21,11 @@ import {
2121

2222
import { Input } from "@/components/ui/input"
2323

24-
import {
25-
DropdownMenu,
26-
DropdownMenuCheckboxItem,
27-
DropdownMenuContent,
28-
DropdownMenuTrigger,
29-
} from "@/components/ui/dropdown-menu"
3024
import { Button, buttonVariants } from "./ui/button";
3125
import { Label } from "./ui/label";
32-
import { CheckIcon, ChevronLeft, ChevronRight, ListTree, Search, SkipBack, SkipForward } from "lucide-react";
26+
import { CheckIcon, ChevronLeft, ChevronRight, Search, SkipBack, SkipForward } from "lucide-react";
3327
import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";
3428
import { cn } from "@/lib/utils";
35-
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue } from "./ui/select";
3629
import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";
3730

3831
interface DataTableProps<TData, TValue> {

web/src/components/data-table.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ const getColumnVis = () => {
7777
} catch (e) {
7878
return {
7979
sha: false,
80-
id: false,
81-
size: false,
8280
};
8381
}
8482
};
@@ -267,7 +265,7 @@ export function DataTable<TData>({
267265
<SelectGroup>
268266
<SelectLabel>Filter among</SelectLabel>
269267
<SelectItem value="name">Name</SelectItem>
270-
<SelectItem value="family">Package Family</SelectItem>
268+
<SelectItem value="family">Package ID</SelectItem>
271269
<SelectItem value="category">Category</SelectItem>
272270
</SelectGroup>
273271
</SelectContent>

web/src/components/family.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default function App({ apps, name }: FamilyProps) {
5858
<div className="flex flex-col items-center my-4 space-y-2">
5959
<h1 className="text-2xl font-semibold flex items-center gap-2">
6060
<Package className="h-6 w-6" />
61-
<span>{name} Family</span>
61+
<span>{name}</span>
6262
</h1>
6363
<p className="text-muted-foreground">
6464
A collection of {apps.length} packages

web/src/components/formula-links.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@ import { FileJson, DownloadCloud } from 'lucide-react';
22

33
interface Props {
44
webpage_url: string;
5-
download_url: string;
6-
family: string;
7-
name: string;
85
repo: string;
9-
arch: string;
106
}
117

128
const FormulaLinks = ({ webpage_url, repo }: Props) => {

web/src/components/list.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const columns: (page: string) => ColumnDef<ListItem>[] = (page) => ([
6060
<div
6161
className="flex"
6262
>
63-
Package Family
63+
Package ID
6464
<Button
6565
variant="ghost"
6666
size="sm"
@@ -148,13 +148,6 @@ const columns: (page: string) => ColumnDef<ListItem>[] = (page) => ([
148148
</>;
149149
},
150150
},
151-
{
152-
accessorKey: "id",
153-
header: "ID",
154-
cell: ({ row }) => {
155-
return <span className="text-gray-500 dark:text-gray-400 font-mono text-sm">{row.getValue("id")}</span>
156-
}
157-
},
158151
{
159152
accessorKey: page != "soarpkgs" ? "Build Date" : "Package Type",
160153
header: ({ column }) => {

web/src/layouts/Layout.astro

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import { SocialLink } from "@/components/social-link";
1515
<meta name="generator" content={Astro.generator} />
1616
<title>PkgForge Index</title>
1717
</head>
18-
<body class="overflow-auto md:container">
18+
<body class="overflow-auto">
1919
<nav
20-
class="flex flex-row w-full h-16 px-3 text-center justify-between items-center"
20+
class="flex flex-row w-full h-16 px-3 text-center justify-between items-center md:container"
2121
>
2222
<div class="flex flex-row space-x-2 items-center">
2323
<img id="secret" src="/favicon.svg" class="h-10 w-10" alt="Icon" />
@@ -32,8 +32,13 @@ import { SocialLink } from "@/components/social-link";
3232
<ModeToggle client:load />
3333
</div>
3434
</nav>
35-
<Separator className="mb-4" />
36-
<slot />
35+
36+
<Separator className="mb-4 md:container" />
37+
38+
<div class="md:container">
39+
<slot />
40+
</div>
41+
3742
</body>
3843

3944
<script is:inline>

web/src/metadata_bincache_aarch64-linux.json

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

web/src/metadata_bincache_x86_64-linux.json

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

0 commit comments

Comments
 (0)