Compare commits

..

3 Commits

Author SHA1 Message Date
CELESTIFYX Team
0d1f1c5e74 Add @Xlebylllek as an author in metadata 2025-01-14 19:42:25 +02:00
CELESTIFYX Team
9b968adbff change packages.json file url 2025-01-14 19:07:24 +02:00
CELESTIFYX Team
751a77ac42 feat: Refactor package parsing from text format to JSON 2025-01-14 11:14:26 +02:00
2 changed files with 14 additions and 20 deletions

View File

@@ -6,12 +6,12 @@
<meta name="description" content="Browse and explore Snigdha OS packages easily with this lightweight package viewer." />
<!-- Author Metadata -->
<meta name="author" content="Eshan Roy, d3v1l0n" />
<meta name="author:website" content="https://www.eshanized.github.io/, https://www.d3v1l0n.github.io/" />
<meta name="author:github" content="https://github.com/eshanized, https://github.com/d3v1l0n" />
<meta name="author" content="Eshan Roy, d3v1l0n, XlebyllleK" />
<meta name="author:website" content="https://www.eshanized.github.io/, https://www.d3v1l0n.github.io/, https://github.com/Xlebylllek/" />
<meta name="author:github" content="https://github.com/eshanized, https://github.com/d3v1l0n, https://github.com/XlebyllleK" />
<meta name="author:twitter" content="https://twitter.com/eshanized, https://twitter.com/d3v1l0n" />
<meta name="author:bio" content="Eshan Roy is a software developer, open-source enthusiast, and the creator of Snigdha OS. d3v1l0n is a cybersecurity expert and open-source contributor working on various security-focused tools." />
<meta name="author:email" content="m.eshanized@gmail.com, d3v1l0n@outlook.in" />
<meta name="author:bio" content="Eshan Roy is a software developer, open-source enthusiast, and the creator of Snigdha OS. d3v1l0n is a cybersecurity expert and open-source contributor working on various security-focused tools. XlebyllleK is a software developer, open-source enthusiast, and the creator of Snigdha OS." />
<meta name="author:email" content="m.eshanized@gmail.com, d3v1l0n@outlook.in, celestifyx@gmail.com" />
<!-- Open Graph Meta Tags for social media sharing -->
<meta property="og:title" content="Snigdha OS Packages" />

View File

@@ -9,33 +9,27 @@ export const MIRRORS: Record<string, {
repository: Repository;
}> = {
'core': {
url: 'https://raw.githubusercontent.com/Snigdha-OS/snigdhaos-core/refs/heads/master/packages.txt',
url: 'https://raw.githubusercontent.com/Snigdha-OS/snigdhaos-pkgbuilds/refs/heads/master/snigdhaos-core/packages.json',
repository: ('core' as Repository)
},
'extra': {
url: 'https://raw.githubusercontent.com/Snigdha-OS/snigdhaos-extra/refs/heads/master/packages.txt',
url: 'https://raw.githubusercontent.com/Snigdha-OS/snigdhaos-pkgbuilds/refs/heads/master/snigdhaos-extra/packages.json',
repository: ('extra' as Repository)
}
}
// Fetch data from a single mirror (Core or Extra repository)
// Fetch data from a single mirror
async function fetchFromMirror(url: string, repository: Repository): Promise<Package[]> {
const response = await fetch(url);
const text = await response.text();
// Parse the text file content and return a list of packages
return text.split('\n').filter(Boolean).map((line) => {
const [
name,
version,
...description
] = line.split(' ');
const data = await response.json();
// Parse the json file content and return a list of packages
return data.map((item: any) => {
return {
name,
version,
description: description.join(' '),
name: item.name,
version: item.version,
description: item.description,
repository
};
});