diff --git a/package.json b/package.json index 6bbacb2..7a297f5 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,8 @@ "@nostr-dev-kit/ndk-svelte": "^1.3.0", "@nostr-dev-kit/ndk-svelte-components": "^1.3.0", "daisyui": "^4.4", - "dayjs": "^1.11.10" + "dayjs": "^1.11.10", + "parse-diff": "^0.11.1" }, "resolutions": { "jackspeak": "2.1.1" diff --git a/src/lib/components/events/content/Kind317.svelte b/src/lib/components/events/content/Kind317.svelte new file mode 100644 index 0000000..2004ad9 --- /dev/null +++ b/src/lib/components/events/content/Kind317.svelte @@ -0,0 +1,53 @@ + + +
+
+
+ {commit_message} +
+
+ commit +
+
+ +
+ + + + + {#each files as file} + + + + + {/each} +
Changes:
+ + {file.to || file.from} + + + +{file.additions} + - {file.deletions} +
+
+
diff --git a/src/lib/components/prs/type.ts b/src/lib/components/prs/type.ts index c4c889d..7ccb39f 100644 --- a/src/lib/components/prs/type.ts +++ b/src/lib/components/prs/type.ts @@ -5,6 +5,7 @@ import type { NDKEvent } from "@nostr-dev-kit/ndk"; export interface PRSummary { title: string; + descritpion: string; repo_id: string; id: string; comments: number; @@ -15,6 +16,7 @@ export interface PRSummary { export const summary_defaults: PRSummary = { title: "", + descritpion: "", repo_id: "", id: "", comments: 0, diff --git a/src/lib/stores/PR.ts b/src/lib/stores/PR.ts index 2ff35de..69037ec 100644 --- a/src/lib/stores/PR.ts +++ b/src/lib/stores/PR.ts @@ -54,6 +54,7 @@ export let ensurePRFull = (repo_id: string, pr_id: string) => { summary: { ...full.summary, title: event.tagValue("name") || "", + descritpion: event.tagValue("description") || "", created_at: event.created_at, comments: 0, author: { diff --git a/src/lib/stores/PRs.ts b/src/lib/stores/PRs.ts index eb0f338..4a1c7d7 100644 --- a/src/lib/stores/PRs.ts +++ b/src/lib/stores/PRs.ts @@ -49,7 +49,6 @@ export let ensurePRSummaries = (repo_id: string) => { if (event.kind == pr_kind && event.getMatchingTags("r").find(t => t[1] === `r-${repo_id}`) ) { - console.log(event); pr_summaries.update(prs => { return { ...prs, @@ -60,6 +59,7 @@ export let ensurePRSummaries = (repo_id: string) => { id: event.id, repo_id: repo_id, title: event.tagValue("name") || "", + descritpion: event.tagValue("description") || "", created_at: event.created_at, comments: 0, author: { @@ -76,7 +76,6 @@ export let ensurePRSummaries = (repo_id: string) => { authors_unsubscribers.push( ensureUser(event.pubkey).subscribe((u: User) => { pr_summaries.update(prs => { - console.log('test'); return { ...prs, summaries: prs.summaries.map(o => ({ diff --git a/src/lib/wrappers/EventCard.svelte b/src/lib/wrappers/EventCard.svelte index 72d7451..e3e167e 100644 --- a/src/lib/wrappers/EventCard.svelte +++ b/src/lib/wrappers/EventCard.svelte @@ -1,5 +1,6 @@ -{event.content} + + {#if event.kind == 317} + + {:else} + {event.content} + {/if} + diff --git a/src/routes/repo/[repo_id]/pr/[pr_id]/+page.svelte b/src/routes/repo/[repo_id]/pr/[pr_id]/+page.svelte index 09324a0..f3024ab 100644 --- a/src/routes/repo/[repo_id]/pr/[pr_id]/+page.svelte +++ b/src/routes/repo/[repo_id]/pr/[pr_id]/+page.svelte @@ -22,6 +22,9 @@
+
+ {$selected_pr_full.summary.descritpion} +
{#if $selected_pr_full.pr_event} {/if} diff --git a/yarn.lock b/yarn.lock index a8d14bc..eef1041 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7676,6 +7676,11 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" +parse-diff@^0.11.1: + version "0.11.1" + resolved "https://registry.yarnpkg.com/parse-diff/-/parse-diff-0.11.1.tgz#d93ca2d225abed280782bccb1476711ca9dd84f0" + integrity sha512-Oq4j8LAOPOcssanQkIjxosjATBIEJhCxMCxPhMu+Ci4wdNmAEdx0O+a7gzbR2PyKXgKPvRLIN5g224+dJAsKHA== + parse-json@^5.0.0, parse-json@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd"