Skip to content

Commit 5d71e48

Browse files
authored
chore: Merge branch dev to main (#246)
2 parents 1d36bd9 + f428902 commit 5d71e48

File tree

13 files changed

+4375
-126
lines changed

13 files changed

+4375
-126
lines changed

package-lock.json

Lines changed: 4276 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,29 @@
1313
"format": "prettier --write --plugin-search-dir=. ."
1414
},
1515
"devDependencies": {
16-
"@sveltejs/adapter-static": "^3.0.1",
17-
"@sveltejs/kit": "^2.0.6",
18-
"@sveltejs/vite-plugin-svelte": "^3.0.1",
19-
"@typescript-eslint/eslint-plugin": "^6.16.0",
20-
"@typescript-eslint/parser": "^6.16.0",
16+
"@sveltejs/adapter-static": "3.0.2",
17+
"@sveltejs/kit": "2.5.18",
18+
"@sveltejs/vite-plugin-svelte": "3.1.1",
19+
"@typescript-eslint/eslint-plugin": "7.16.0",
20+
"@typescript-eslint/parser": "7.16.0",
2121
"eslint": "^8.56.0",
2222
"eslint-config-prettier": "^9.1.0",
23-
"eslint-plugin-svelte": "^2.35.1",
23+
"eslint-plugin-svelte": "2.42.0",
2424
"fuse.js": "^7.0.0",
25-
"imagetools-core": "^6.0.3",
26-
"prettier": "^3.1.1",
27-
"prettier-plugin-svelte": "^3.1.2",
25+
"imagetools-core": "7.0.1",
26+
"prettier": "3.3.2",
27+
"prettier-plugin-svelte": "3.2.5",
2828
"qrious": "^4.0.2",
29-
"sass": "^1.69.6",
30-
"semver": "^7.5.4",
29+
"sass": "1.77.8",
30+
"semver": "7.6.2",
3131
"sirv-cli": "^2.0.2",
32-
"svelte": "^4.2.8",
33-
"svelte-check": "^3.6.2",
34-
"svelte-meta-tags": "^3.1.0",
35-
"tslib": "^2.6.2",
36-
"typescript": "^5.3.3",
37-
"vite": "^5.0.10",
38-
"vite-imagetools": "^6.2.8"
32+
"svelte": "4.2.18",
33+
"svelte-check": "3.8.4",
34+
"svelte-meta-tags": "3.1.2",
35+
"tslib": "2.6.3",
36+
"typescript": "5.5.3",
37+
"vite": "5.3.3",
38+
"vite-imagetools": "7.0.4"
3939
},
4040
"type": "module",
4141
"dependencies": {

src/data/api/index.ts

Lines changed: 26 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@ import * as settings from './settings';
33
// API Endpoints
44
import type {
55
Patch,
6-
Repository,
7-
Metadata,
8-
Asset,
6+
Contributable,
7+
Release,
98
TeamMember,
109
DonationPlatform,
1110
CryptoWallet,
1211
Social,
13-
Info,
12+
About,
1413
CompatiblePackage
1514
} from '$lib/types';
1615

17-
export type ReposData = { repositories: Repository[] };
16+
export type ContributorsData = { contributables: Contributable[] };
1817
export type PatchesData = { patches: Patch[]; packages: string[] };
19-
export type ReleaseData = { metadata: Metadata; assets: Asset[] };
18+
export type ReleaseData = { release: Release };
2019
export type TeamData = { members: TeamMember[] };
21-
export type InfoData = { info: Info };
20+
export type AboutData = { about: About };
2221
export type DonationData = { wallets: CryptoWallet[]; platforms: DonationPlatform[] };
2322
export type SocialsData = { socials: Social[] };
2423

@@ -27,25 +26,24 @@ async function get_json(endpoint: string) {
2726
return await fetch(url).then((r) => r.json());
2827
}
2928

30-
async function repositories(): Promise<ReposData> {
31-
const json = await get_json('contributors');
32-
return { repositories: json.repositories };
29+
async function contributors(): Promise<ContributorsData> {
30+
const json = await get_json('v3/contributors');
31+
return { contributables: json };
3332
}
3433

3534
async function manager(): Promise<ReleaseData> {
36-
const json = await get_json('v2/revanced-manager/releases/latest');
37-
// console.log(json.release.metadata.tag_name);
38-
console.log(json.release.assets[0].browser_download_url);
39-
return { metadata: json.release.metadata, assets: json.release.assets };
35+
const json = await get_json('v3/manager/latest');
36+
37+
return { release: json };
4038
}
4139

4240
async function patches(): Promise<PatchesData> {
43-
const json = await get_json('v2/patches/latest');
41+
const json = await get_json('v3/patches/latest/list');
4442
const packagesWithCount: { [key: string]: number } = {};
4543

4644
// gets packages and patch count
47-
for (let i = 0; i < json.patches.length; i++) {
48-
json.patches[i].compatiblePackages?.forEach((pkg: CompatiblePackage) => {
45+
for (let i = 0; i < json.length; i++) {
46+
json[i].compatiblePackages?.forEach((pkg: CompatiblePackage) => {
4947
packagesWithCount[pkg.name] = (packagesWithCount[pkg.name] || 0) + 1;
5048
});
5149
}
@@ -54,27 +52,17 @@ async function patches(): Promise<PatchesData> {
5452
const packages = Object.keys(packagesWithCount);
5553
packages.sort((a, b) => packagesWithCount[b] - packagesWithCount[a]);
5654

57-
return { patches: json.patches, packages };
55+
return { patches: json, packages };
5856
}
5957

6058
async function team(): Promise<TeamData> {
61-
const json = await get_json('v2/team/members');
62-
return { members: json.members };
63-
}
64-
65-
async function info(): Promise<InfoData> {
66-
const json = await get_json('v2/info');
67-
return { info: json.info };
68-
}
69-
70-
async function donate(): Promise<DonationData> {
71-
const json = await get_json('v2/donations');
72-
return { wallets: json.donations.wallets, platforms: json.donations.links };
59+
const json = await get_json('v3/team');
60+
return { members: json };
7361
}
7462

75-
async function socials(): Promise<SocialsData> {
76-
const json = await get_json('v2/socials');
77-
return { socials: json.socials };
63+
async function about(): Promise<AboutData> {
64+
const json = await get_json('v3/about');
65+
return { about: json };
7866
}
7967

8068
export const staleTime = 5 * 60 * 1000;
@@ -89,29 +77,19 @@ export const queries = {
8977
queryFn: patches,
9078
staleTime
9179
},
92-
repositories: {
93-
queryKey: ['repositories'],
94-
queryFn: repositories,
80+
contributors: {
81+
queryKey: ['contributors'],
82+
queryFn: contributors,
9583
staleTime
9684
},
9785
team: {
9886
queryKey: ['team'],
9987
queryFn: team,
10088
staleTime
10189
},
102-
info: {
90+
about: {
10391
queryKey: ['info'],
104-
queryFn: info,
105-
staleTime
106-
},
107-
donate: {
108-
queryKey: ['donate'],
109-
queryFn: donate,
110-
staleTime
111-
},
112-
socials: {
113-
queryKey: ['socials'],
114-
queryFn: socials,
92+
queryFn: about,
11593
staleTime
11694
}
11795
};

src/layout/Footer/FooterHost.svelte

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
import Query from '$lib/components/Query.svelte';
99
import FooterSection from './FooterSection.svelte';
1010
11-
const infoQuery = createQuery(['info'], queries.info);
12-
const socialsQuery = createQuery(['socials'], queries.socials);
11+
const aboutQuery = createQuery(['about'], queries.about);
1312
</script>
1413

1514
<!-- squiggly divider line -->
@@ -33,11 +32,11 @@
3332
<div class="footer-top">
3433
<section class="main-content">
3534
<img src="/logo.svg" class="logo-image" alt="ReVanced Logo" />
36-
<Query query={infoQuery} let:data>
35+
<Query query={aboutQuery} let:data>
3736
{#if data}
3837
<div>
3938
<p>
40-
{data.info.about}
39+
{data.about.about}
4140
</p>
4241
</div>
4342
{/if}
@@ -52,10 +51,10 @@
5251
<li><a href="/contributors">Contributors</a></li>
5352
<li><a href="/donate">Donate</a></li>
5453
</FooterSection>
55-
<Query query={socialsQuery} let:data>
54+
<Query query={aboutQuery} let:data>
5655
{#if data}
5756
<FooterSection title="Socials">
58-
{#each data.socials as { name, url }}
57+
{#each data.about.socials as { name, url }}
5958
<li>
6059
<a href={url} target="_blank" rel="noreferrer">{name}</a>
6160
</li>
@@ -65,12 +64,12 @@
6564
</Query>
6665
</section>
6766
</div>
68-
<Query query={infoQuery} let:data>
67+
<Query query={aboutQuery} let:data>
6968
{#if data}
7069
<div class="footer-bottom">
7170
<div id="logo-name"><span>Re</span>Vanced</div>
7271
<a href="/donate"><div>Donate</div></a>
73-
<a href="mailto:{data.info.contact.email}"><div>Email</div></a>
72+
<a href="mailto:{data.about.contact.email}"><div>Email</div></a>
7473
</div>
7574
{/if}
7675
</Query>

src/layout/Hero/SocialHost.svelte

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
import { createQuery } from '@tanstack/svelte-query';
55
import Query from '$lib/components/Query.svelte';
66
7-
const query = createQuery(['socials'], queries.socials);
7+
const aboutQuery = createQuery(['about'], queries.about);
88
</script>
99

1010
<div class="social-host">
11-
<Query {query} let:data>
11+
<Query query={aboutQuery} let:data>
1212
{#if data}
13-
{#each data.socials.filter((s) => s.name != 'Website') as social}
13+
{#each data.about.socials.filter((s) => s.name != 'Website') as social}
1414
<SocialButton {social} />
1515
{/each}
1616
{/if}
@@ -23,16 +23,12 @@
2323
padding: 0 max(6.5%, calc(50vw - 50rem));
2424
align-items: center;
2525
user-select: none;
26-
position: absolute;
2726
display: flex;
28-
bottom: 2rem;
2927
gap: 1rem;
30-
left: 0;
3128
}
3229
3330
@media screen and (max-width: 767px) {
3431
.social-host {
35-
left: 0;
3632
width: 100%;
3733
display: flex;
3834
flex-wrap: wrap;

src/layout/Navbar/NavHost.svelte

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,10 @@
7878
<Navigation href="/" label="Home">Home</Navigation>
7979
<Navigation queryKey="manager" href="/download" label="Download">Download</Navigation>
8080
<Navigation queryKey="patches" href="/patches" label="Patches">Patches</Navigation>
81-
<Navigation queryKey="repositories" href="/contributors" label="Contributors">
81+
<Navigation queryKey="contributors" href="/contributors" label="Contributors">
8282
Contributors
8383
</Navigation>
84-
<Navigation queryKey={['donate', 'team']} href="/donate" label="Donate">
85-
Donate
86-
</Navigation>
84+
<Navigation queryKey={['about', 'team']} href="/donate" label="Donate">Donate</Navigation>
8785
</ul>
8886
</div>
8987
<div id="secondary-navigation">

src/lib/types.ts

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
export interface Contributor {
2-
login: string;
2+
name: string;
33
avatar_url: string;
4-
html_url: string;
4+
url: string;
5+
contributions: number;
56
}
67

7-
export interface Repository {
8+
export interface Contributable {
89
name: string;
910
contributors: Contributor[];
1011
}
@@ -33,24 +34,20 @@ export interface PatchOption {
3334

3435
export interface Asset {
3536
name: string;
36-
content_type: string;
37-
browser_download_url: string;
37+
download_url: string;
3838
}
3939

40-
export interface Metadata {
41-
tag_name: string;
42-
name: string;
43-
draft: boolean;
44-
prerelease: boolean;
40+
export interface Release {
41+
version: string;
4542
created_at: string;
46-
published_at: string;
47-
body: string;
43+
description: string;
44+
assets: Asset[];
4845
}
4946

5047
export interface TeamMember {
51-
login: string;
48+
name: string;
5249
avatar_url: string;
53-
html_url: string;
50+
url: string;
5451
bio?: string;
5552
}
5653

@@ -70,6 +67,7 @@ export interface DonationPlatform {
7067
export interface Social {
7168
name: string;
7269
url: string;
70+
preferred: boolean;
7371
}
7472

7573
interface Donations {
@@ -81,7 +79,7 @@ interface Contact {
8179
email: string;
8280
}
8381

84-
export interface Info {
82+
export interface About {
8583
name: string;
8684
about: string;
8785
contact: Contact;

src/routes/+page.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,18 @@
129129
<Wave />
130130

131131
<style>
132+
main {
133+
display: flex;
134+
flex-direction: column;
135+
gap: 1.5rem;
136+
}
132137
.wrap {
133138
margin-inline: auto;
134139
width: min(87%, 100rem);
135140
margin-top: 7rem;
136141
}
137142
.wrappezoid {
138-
height: calc(100vh - 120px);
143+
height: calc(100vh - 225px);
139144
display: flex;
140145
flex-direction: row;
141146
justify-content: center;

src/routes/contributors/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import { queries } from '$data/api';
1111
import { createQuery } from '@tanstack/svelte-query';
1212
13-
const query = createQuery(['repositories'], queries.repositories);
13+
const query = createQuery(['contributors'], queries.contributors);
1414
</script>
1515

1616
<Head
@@ -52,7 +52,7 @@
5252
</div>
5353
<div class="repos">
5454
<Query {query} let:data>
55-
{#each data.repositories as { contributors, name: repo }}
55+
{#each data.contributables as { contributors, name: repo }}
5656
<div in:fly={{ y: 10, easing: quintOut, duration: 750 }}>
5757
<ContributorHost {contributors} {repo} />
5858
</div>

0 commit comments

Comments
 (0)