feat: hydration

This commit is contained in:
Ax333l
2022-10-21 20:31:18 +02:00
parent a1b893b346
commit 01bc0f2063
8 changed files with 79 additions and 61 deletions

View File

@ -1,7 +1,8 @@
<script lang="ts">
import type { Contributor } from '$lib/types';
import ContributorButton from '../atoms/ContributorPerson.svelte';
export let contribs;
export let contribs: Contributor[];
export let repo: string;
let repo_name = repo

View File

@ -1,10 +0,0 @@
import { readable } from "svelte/store";
const fetchContributors = async () => {
const response = await fetch('https://releases.rvcd.win/contributors');
const json = await response.json();
return json;
};
const ContributorsStore = readable(fetchContributors());
export default ContributorsStore;

View File

@ -1,11 +0,0 @@
import { readable } from "svelte/store";
const fetchPatches = async () => {
const response = await fetch('https://releases.rvcd.win/patches');
const json = await response.json();
console.log(typeof json)
return json;
};
const PatchesStore = readable(fetchPatches());
export default PatchesStore;

34
src/lib/types.ts Normal file
View File

@ -0,0 +1,34 @@
export interface Contributor {
login: string;
avatar_url: string;
html_url: string;
}
export interface Repository {
name: string;
contributors: Contributor[];
}
export interface Patch {
name: string;
description: string;
version: string;
excluded: boolean;
deprecated: boolean;
dependencies: string[];
options: PatchOption[];
compatiblePackages: CompatiblePackage[];
}
export interface CompatiblePackage {
name: string;
versions: string[];
}
export interface PatchOption {
key: string;
title: string;
description: string;
required: boolean;
choices: string[];
}