From 8ae123fd0b29e162f13dea81f6c1cfdca1c8715a Mon Sep 17 00:00:00 2001 From: jk <47693+sectore@users.noreply.github.com> Date: Fri, 2 Feb 2024 10:55:44 +0100 Subject: [PATCH] eslint + prettier (#2) Co-authored-by: DanConwayDev <114834599+DanConwayDev@users.noreply.github.com> --- .eslintrc | 44 +++ .prettierrc | 16 + .vscode/settings.json | 14 +- maintainers.yaml | 7 - package.json | 10 + src/lib/components/Container.svelte | 16 +- src/lib/components/Navbar.stories.svelte | 28 +- src/lib/components/Navbar.svelte | 24 +- .../components/RepoSummaryCard.stories.svelte | 20 +- src/lib/components/RepoSummaryCard.svelte | 38 +- .../ReposSummaryList.stories.svelte | 72 ++-- src/lib/components/ReposSummaryList.svelte | 11 +- src/lib/components/events/Compose.svelte | 53 ++- src/lib/components/events/EventWrapper.svelte | 119 +++--- .../components/events/ThreadWrapper.svelte | 2 +- .../events/content/Kind19851985.svelte | 32 +- .../components/events/content/Kind317.svelte | 95 +++-- .../events/content/ParsedContent.svelte | 42 +- src/lib/components/events/content/utils.ts | 147 ++++--- src/lib/components/events/type.ts | 12 +- src/lib/components/prs/PRDetails.svelte | 78 ++-- .../components/prs/PRHeader.stories.svelte | 20 +- src/lib/components/prs/PRHeader.svelte | 136 ++++--- src/lib/components/prs/PRsList.stories.svelte | 72 ++-- src/lib/components/prs/PRsList.svelte | 51 ++- .../components/prs/PRsListItem.stories.svelte | 22 +- src/lib/components/prs/PRsListItem.svelte | 204 +++++----- src/lib/components/prs/Status.stories.svelte | 32 +- src/lib/components/prs/Status.svelte | 128 +++--- src/lib/components/prs/StatusSelector.svelte | 220 +++++------ src/lib/components/prs/icons.ts | 15 +- src/lib/components/prs/type.ts | 107 ++--- src/lib/components/prs/vectors.ts | 112 +++--- .../repo/RepoDetails.stories.svelte | 34 +- src/lib/components/repo/RepoDetails.svelte | 167 ++++---- .../components/repo/RepoHeader.stories.svelte | 20 +- src/lib/components/repo/RepoHeader.svelte | 70 ++-- src/lib/components/repo/type.ts | 36 +- src/lib/components/repo/vectors.ts | 173 ++++---- .../users/UserHeader.stories.svelte | 59 ++- src/lib/components/users/UserHeader.svelte | 53 +-- src/lib/components/users/type.ts | 39 +- src/lib/components/users/vectors.ts | 51 +-- src/lib/kinds.ts | 10 +- src/lib/stores/PR.ts | 371 +++++++++--------- src/lib/stores/PRs.ts | 335 ++++++++-------- src/lib/stores/ndk.ts | 41 +- src/lib/stores/repo.ts | 184 +++++---- src/lib/stores/users.ts | 236 +++++------ src/lib/wrappers/Compose.svelte | 124 +++--- src/lib/wrappers/EventCard.svelte | 57 ++- src/lib/wrappers/Navbar.svelte | 34 +- src/lib/wrappers/OpenPRs.svelte | 14 +- src/lib/wrappers/RepoDetails.svelte | 8 +- src/lib/wrappers/ReposRecent.svelte | 96 ++--- src/lib/wrappers/Thread.svelte | 40 +- src/routes/+layout.svelte | 4 +- src/routes/+page.svelte | 16 +- src/routes/ngit/+page.svelte | 159 ++++---- src/routes/repo/[repo_id]/+page.svelte | 81 ++-- src/routes/repo/[repo_id]/+page.ts | 6 +- .../repo/[repo_id]/pr/[pr_id]/+page.svelte | 200 +++++----- src/routes/repo/[repo_id]/pr/[pr_id]/+page.ts | 8 +- tsconfig.json | 22 +- yarn.lock | 272 ++++++++++++- 65 files changed, 2634 insertions(+), 2385 deletions(-) create mode 100644 .eslintrc create mode 100644 .prettierrc delete mode 100644 maintainers.yaml diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..ce54b43 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,44 @@ +// eslint-plugin-svelte +// https://sveltejs.github.io/eslint-plugin-svelte/user-guide/ +{ + "root": true, + "extends": [ + // add more generic rule sets here, such as: + // 'eslint:recommended', + "plugin:@typescript-eslint/recommended", + "prettier", + "plugin:svelte/recommended" + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + // ... + "project": "./tsconfig.json", + "extraFileExtensions": [".svelte"] // This is a required setting in `@typescript-eslint/parser` v4.24.0. + }, + "plugins": ["@typescript-eslint", "prettier"], + "rules": { + "no-console": 1, + "prettier/prettier": 2, + "comma-dangle": [2, "always-multiline"], + "no-alert": "off", + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": [ + "error", + { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_" + } + ] + // 'svelte/rule-name': 'error' + }, + "overrides": [ + { + "files": ["*.svelte"], + "parser": "svelte-eslint-parser", + // Parse the `
- {#if no_wrap} - - {:else} -
- -
- {/if} + {#if no_wrap} + + {:else} +
+ +
+ {/if}
diff --git a/src/lib/components/Navbar.stories.svelte b/src/lib/components/Navbar.stories.svelte index e32143d..89b5b4e 100644 --- a/src/lib/components/Navbar.stories.svelte +++ b/src/lib/components/Navbar.stories.svelte @@ -1,18 +1,18 @@ @@ -22,11 +22,11 @@ diff --git a/src/lib/components/Navbar.svelte b/src/lib/components/Navbar.svelte index 07c9b3a..d52b2c3 100644 --- a/src/lib/components/Navbar.svelte +++ b/src/lib/components/Navbar.svelte @@ -1,12 +1,12 @@
@@ -24,20 +24,20 @@ {#if logged_in_user} {:else if nip07_plugin === undefined} -
+
{:else if nip07_plugin} Login {:else} Sign up {/if}
diff --git a/src/lib/components/RepoSummaryCard.stories.svelte b/src/lib/components/RepoSummaryCard.stories.svelte index 52acf8f..92080c0 100644 --- a/src/lib/components/RepoSummaryCard.stories.svelte +++ b/src/lib/components/RepoSummaryCard.stories.svelte @@ -1,18 +1,18 @@ diff --git a/src/lib/components/RepoSummaryCard.svelte b/src/lib/components/RepoSummaryCard.svelte index 5517156..7e6eb90 100644 --- a/src/lib/components/RepoSummaryCard.svelte +++ b/src/lib/components/RepoSummaryCard.svelte @@ -1,38 +1,38 @@ -
+
{#if loading} -
-
+
+
{:else} {short_name} -

{short_descrption}

+

{short_descrption}

{/if}
diff --git a/src/lib/components/ReposSummaryList.stories.svelte b/src/lib/components/ReposSummaryList.stories.svelte index 46ce274..f08a0f2 100644 --- a/src/lib/components/ReposSummaryList.stories.svelte +++ b/src/lib/components/ReposSummaryList.stories.svelte @@ -1,56 +1,56 @@ diff --git a/src/lib/components/ReposSummaryList.svelte b/src/lib/components/ReposSummaryList.svelte index 20b84cd..2fbbbff 100644 --- a/src/lib/components/ReposSummaryList.svelte +++ b/src/lib/components/ReposSummaryList.svelte @@ -1,14 +1,11 @@
diff --git a/src/lib/components/events/Compose.svelte b/src/lib/components/events/Compose.svelte index d3e5b02..779a0b0 100644 --- a/src/lib/components/events/Compose.svelte +++ b/src/lib/components/events/Compose.svelte @@ -1,32 +1,31 @@
- -
-
- -
+ +
+
+ +
diff --git a/src/lib/components/events/EventWrapper.svelte b/src/lib/components/events/EventWrapper.svelte index 9ae48fa..2028cfe 100644 --- a/src/lib/components/events/EventWrapper.svelte +++ b/src/lib/components/events/EventWrapper.svelte @@ -1,68 +1,67 @@ -
-
-
- -
- {#if !show_compose} -
- {created_at_ago} - {#if logged_in} - - {/if} -
- {/if} +
+
+
+
-
- - {#if show_compose} -
-
-
- -
-
- -
-
+ {#if !show_compose} +
+ {created_at_ago} + {#if logged_in} + {/if} -
+
+ {/if} +
+
+ + {#if show_compose} +
+
+
+ +
+
+ +
+
+ {/if} +
diff --git a/src/lib/components/events/ThreadWrapper.svelte b/src/lib/components/events/ThreadWrapper.svelte index d150fbd..c6a9ecd 100644 --- a/src/lib/components/events/ThreadWrapper.svelte +++ b/src/lib/components/events/ThreadWrapper.svelte @@ -1,3 +1,3 @@
- +
diff --git a/src/lib/components/events/content/Kind19851985.svelte b/src/lib/components/events/content/Kind19851985.svelte index 8328130..9ed6e19 100644 --- a/src/lib/components/events/content/Kind19851985.svelte +++ b/src/lib/components/events/content/Kind19851985.svelte @@ -1,23 +1,23 @@
- {#if status} - set status to - {:else} - set status incorrectly - {/if} + {#if status} + set status to + {:else} + set status incorrectly + {/if}
diff --git a/src/lib/components/events/content/Kind317.svelte b/src/lib/components/events/content/Kind317.svelte index 4f86c73..9f9e7b0 100644 --- a/src/lib/components/events/content/Kind317.svelte +++ b/src/lib/components/events/content/Kind317.svelte @@ -1,59 +1,54 @@
-
-
- -
-
- commit -
-
+
+
+ +
+
commit
+
-
- - - - - - {#each files as file} - - - - - {/each} -
Changes: - {commit_id.substring(0, 8)} -
- - {file.to || file.from} - - - +{file.additions} - - {file.deletions} -
-
+
+ + + + + + {#each files as file} + + + + + {/each} +
Changes: + {commit_id.substring(0, 8)} +
+ + {file.to || file.from} + + + +{file.additions} + - {file.deletions} +
+
diff --git a/src/lib/components/events/content/ParsedContent.svelte b/src/lib/components/events/content/ParsedContent.svelte index 2a0379b..8a0b054 100644 --- a/src/lib/components/events/content/ParsedContent.svelte +++ b/src/lib/components/events/content/ParsedContent.svelte @@ -1,28 +1,28 @@
- {#each fullContent as part, i} - {#if isParsedNewLine(part)} - {#if part.value.length > 1} -
- {/if} -
- {:else if isParsedText(part)} - {part.value} - {/if} - {/each} + {#each fullContent as part} + {#if isParsedNewLine(part)} + {#if part.value.length > 1} +
+ {/if} +
+ {:else if isParsedText(part)} + {part.value} + {/if} + {/each}
diff --git a/src/lib/components/events/content/utils.ts b/src/lib/components/events/content/utils.ts index bc8f2b6..54d22b6 100644 --- a/src/lib/components/events/content/utils.ts +++ b/src/lib/components/events/content/utils.ts @@ -1,96 +1,95 @@ -import type { NDKTag } from "@nostr-dev-kit/ndk"; -import { nip19 } from "nostr-tools"; -import { identity, last, pluck } from "ramda"; - -export const TOPIC = "topic"; -export const LINK = "link"; -export const LINKCOLLECTION = "link[]"; -export const HTML = "html"; -export const INVOICE = "invoice"; -export const NOSTR_NOTE = "nostr:note"; -export const NOSTR_NEVENT = "nostr:nevent"; -export const NOSTR_NPUB = "nostr:npub"; -export const NOSTR_NPROFILE = "nostr:nprofile"; -export const NOSTR_NADDR = "nostr:naddr"; +import type { NDKTag } from '@nostr-dev-kit/ndk' +import { last } from 'ramda' + +export const TOPIC = 'topic' +export const LINK = 'link' +export const LINKCOLLECTION = 'link[]' +export const HTML = 'html' +export const INVOICE = 'invoice' +export const NOSTR_NOTE = 'nostr:note' +export const NOSTR_NEVENT = 'nostr:nevent' +export const NOSTR_NPUB = 'nostr:npub' +export const NOSTR_NPROFILE = 'nostr:nprofile' +export const NOSTR_NADDR = 'nostr:naddr' // eslint-disable-next-line @typescript-eslint/no-explicit-any -const first = (list: any) => (list ? list[0] : undefined); +const first = (list: any) => (list ? list[0] : undefined) -export const fromNostrURI = (s: string) => s.replace(/^[\w+]+:\/?\/?/, ""); +export const fromNostrURI = (s: string) => s.replace(/^[\w+]+:\/?\/?/, '') export const urlIsMedia = (url: string) => - !url.match(/\.(apk|docx|xlsx|csv|dmg)/) && last(url.split("://"))?.includes("/"); + !url.match(/\.(apk|docx|xlsx|csv|dmg)/) && + last(url.split('://'))?.includes('/') export type ContentArgs = { - content: string; - tags?: Array; -}; + content: string + tags?: Array +} -export type ParsedPart = ParsedNewLine | ParsedText; +export type ParsedPart = ParsedNewLine | ParsedText -export const NEWLINE = "newline"; +export const NEWLINE = 'newline' export type ParsedNewLine = { - type: "newline", - value: string, -}; + type: 'newline' + value: string +} export const isParsedNewLine = (part: ParsedPart): part is ParsedNewLine => { - return part.type == "newline" -}; + return part.type == 'newline' +} -export const TEXT = "text"; +export const TEXT = 'text' export type ParsedText = { - type: "text", - value: string, -}; + type: 'text' + value: string +} export const isParsedText = (part: ParsedPart): part is ParsedText => { - return part.type == "text" -}; - -export const parseContent = ({ content, tags = [] }: ContentArgs): ParsedPart[] => { - const result: ParsedPart[] = []; - let text = content.trim(); - let buffer = ""; - - const parseNewline = () => { - const newline = first(text.match(/^\n+/)); - - if (newline) { - return [NEWLINE, newline, newline]; - } - }; - - while (text) { - // The order that this runs matters - const part = - parseNewline(); - - if (part) { - if (buffer) { - result.push({ type: "text", value: buffer }); - buffer = ""; - } - - const [type, raw, value] = part; - - result.push({ type, value }); - text = text.slice(raw.length); - } else { - // Instead of going character by character and re-running all the above regular expressions - // a million times, try to match the next word and add it to the buffer - const match = first(text.match(/^[\w\d]+ ?/i)) || text[0]; - - buffer += match; - text = text.slice(match.length); - } + return part.type == 'text' +} + +export const parseContent = ({ content }: ContentArgs): ParsedPart[] => { + const result: ParsedPart[] = [] + let text = content.trim() + let buffer = '' + + const parseNewline = () => { + const newline = first(text.match(/^\n+/)) + + if (newline) { + return [NEWLINE, newline, newline] } + } + + while (text) { + // The order that this runs matters + const part = parseNewline() - if (buffer) { - result.push({ type: TEXT, value: buffer }); + if (part) { + if (buffer) { + result.push({ type: 'text', value: buffer }) + buffer = '' + } + + const [type, raw, value] = part + + result.push({ type, value }) + text = text.slice(raw.length) + } else { + // Instead of going character by character and re-running all the above regular expressions + // a million times, try to match the next word and add it to the buffer + const match = first(text.match(/^[\w\d]+ ?/i)) || text[0] + + buffer += match + text = text.slice(match.length) } + } + + if (buffer) { + result.push({ type: TEXT, value: buffer }) + } - return result; -}; + return result +} diff --git a/src/lib/components/events/type.ts b/src/lib/components/events/type.ts index ef7247f..bb51dc7 100644 --- a/src/lib/components/events/type.ts +++ b/src/lib/components/events/type.ts @@ -1,12 +1,6 @@ -import { defaults as user_defaults } from "../users/type"; -import type { User } from "../users/type"; +import type { User } from '../users/type' export interface Event { - author: User; - content: any; + author: User + content: unknown } - -let defaults: Event = { - author: { ...user_defaults }, - content: [], -} \ No newline at end of file diff --git a/src/lib/components/prs/PRDetails.svelte b/src/lib/components/prs/PRDetails.svelte index ce38ac7..11f8d6e 100644 --- a/src/lib/components/prs/PRDetails.svelte +++ b/src/lib/components/prs/PRDetails.svelte @@ -1,47 +1,47 @@
-
- {#if loading} -
-
-
- {:else} -

Author

- - {/if} -
+
+ {#if loading} +
+
+
+ {:else} +

Author

+ + {/if} +
-
- {#if loading} -
-
-
- {:else} -

Status

- - {/if} -
+
+ {#if loading} +
+
+
+ {:else} +

Status

+ + {/if} +
-
- {#if loading} -
-
- {:else} -

Labels

- {#each labels as label} -
{label}
- {/each} - {/if} -
+
+ {#if loading} +
+
+ {:else} +

Labels

+ {#each labels as label} +
{label}
+ {/each} + {/if} +
diff --git a/src/lib/components/prs/PRHeader.stories.svelte b/src/lib/components/prs/PRHeader.stories.svelte index b9617f6..86a65c5 100644 --- a/src/lib/components/prs/PRHeader.stories.svelte +++ b/src/lib/components/prs/PRHeader.stories.svelte @@ -1,18 +1,18 @@ diff --git a/src/lib/components/prs/PRHeader.svelte b/src/lib/components/prs/PRHeader.svelte index 18883a4..e973318 100644 --- a/src/lib/components/prs/PRHeader.svelte +++ b/src/lib/components/prs/PRHeader.svelte @@ -2,78 +2,76 @@
- - {#if loading} -
-
-
-
-
-
-
-
- {:else} -
- {short_title} -
-
-
- -
-
- opened {created_at_ago} -
-
- {#if author.loading} -
- {:else} - {author_name} - {/if} -
-
- {/if} -
+ + {#if loading} +
+
+
+
+
+
+
+
+ {:else} +
+ {short_title} +
+
+
+ +
+
+ opened {created_at_ago} +
+
+ {#if author.loading} +
+ {:else} + {author_name} + {/if} +
+
+ {/if} +
diff --git a/src/lib/components/prs/PRsList.stories.svelte b/src/lib/components/prs/PRsList.stories.svelte index 6c4a300..89fe07e 100644 --- a/src/lib/components/prs/PRsList.stories.svelte +++ b/src/lib/components/prs/PRsList.stories.svelte @@ -1,56 +1,56 @@ diff --git a/src/lib/components/prs/PRsList.svelte b/src/lib/components/prs/PRsList.svelte index 75f82d4..4b2e2a4 100644 --- a/src/lib/components/prs/PRsList.svelte +++ b/src/lib/components/prs/PRsList.svelte @@ -1,34 +1,31 @@
- {#if title.length > 0} -
-

{title}

-
- {/if} - {#if prs.length == 0 && !loading} -

None

+ {#if title.length > 0} +
+

{title}

+
+ {/if} + {#if prs.length == 0 && !loading} +

None

+ {/if} +
    + {#each prs as pr} + + {/each} + {#if loading} + + {#if prs.length == 0} + + + {/if} {/if} -
      - {#each prs as pr} - - {/each} - {#if loading} - - {#if prs.length == 0} - - - {/if} - {/if} -
    +
diff --git a/src/lib/components/prs/PRsListItem.stories.svelte b/src/lib/components/prs/PRsListItem.stories.svelte index c44e319..f9733fc 100644 --- a/src/lib/components/prs/PRsListItem.stories.svelte +++ b/src/lib/components/prs/PRsListItem.stories.svelte @@ -1,18 +1,18 @@ diff --git a/src/lib/components/prs/PRsListItem.svelte b/src/lib/components/prs/PRsListItem.svelte index 52c860e..69044ba 100644 --- a/src/lib/components/prs/PRsListItem.svelte +++ b/src/lib/components/prs/PRsListItem.svelte @@ -2,118 +2,116 @@
  • - - - {#if loading || !status} -
    - {:else if status === "Open"} - - {:else if status === "Closed"} - - {:else if status === "Draft"} - - {:else if status === "Merged"} - - {/if} - --> + + {#if loading || !status} +
    + {:else if status === 'Open'} + + {:else if status === 'Closed'} + + {:else if status === 'Draft'} + - {#if loading} -
    -
    - {:else} -
    - {short_title} -
    - -
      - {#if comments > 0} -
    • - - - {comments} -
    • - {/if} -
    • - opened {created_at_ago} -
    • -
    • - {#if author.loading} -
      - {:else} - {author_name} - {/if} -
    • -
    +
      + {#if comments > 0} +
    • + + + {comments} +
    • {/if} -
      - - - - Open - {:else if status === "Merged"} - - - Merged - {:else if status === "Closed"} - - - Closed - {:else if status === "Draft"} - - - Draft - {:else} - {status} - {/if} - {#if edit_mode} - - {/if} -
  • +
    + {#if status === 'Open'} + + + + Open + {:else if status === 'Merged'} + + + Merged + {:else if status === 'Closed'} + + + Closed + {:else if status === 'Draft'} + + + Draft + {:else} + {status} + {/if} + {#if edit_mode} + + {/if} +
    {/if} diff --git a/src/lib/components/prs/StatusSelector.svelte b/src/lib/components/prs/StatusSelector.svelte index b982a27..698daf4 100644 --- a/src/lib/components/prs/StatusSelector.svelte +++ b/src/lib/components/prs/StatusSelector.svelte @@ -1,126 +1,120 @@ {#if loading || !status} - + {:else} - + + {/if} +
    {/if} diff --git a/src/lib/components/prs/icons.ts b/src/lib/components/prs/icons.ts index 597a4b6..973688b 100644 --- a/src/lib/components/prs/icons.ts +++ b/src/lib/components/prs/icons.ts @@ -1,6 +1,9 @@ -export let pr_icon_path = { - open: "M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25m5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354M3.75 2.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m0 9.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m8.25.75a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0", - close: "M3.25 1A2.25 2.25 0 0 1 4 5.372v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.251 2.251 0 0 1 3.25 1m9.5 5.5a.75.75 0 0 1 .75.75v3.378a2.251 2.251 0 1 1-1.5 0V7.25a.75.75 0 0 1 .75-.75m-2.03-5.273a.75.75 0 0 1 1.06 0l.97.97l.97-.97a.748.748 0 0 1 1.265.332a.75.75 0 0 1-.205.729l-.97.97l.97.97a.751.751 0 0 1-.018 1.042a.751.751 0 0 1-1.042.018l-.97-.97l-.97.97a.749.749 0 0 1-1.275-.326a.749.749 0 0 1 .215-.734l.97-.97l-.97-.97a.75.75 0 0 1 0-1.06ZM2.5 3.25a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0M3.25 12a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m9.5 0a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5", - draft: "M3.25 1A2.25 2.25 0 0 1 4 5.372v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.251 2.251 0 0 1 3.25 1m9.5 14a2.25 2.25 0 1 1 0-4.5a2.25 2.25 0 0 1 0 4.5M2.5 3.25a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0M3.25 12a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m9.5 0a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5M14 7.5a1.25 1.25 0 1 1-2.5 0a1.25 1.25 0 0 1 2.5 0m0-4.25a1.25 1.25 0 1 1-2.5 0a1.25 1.25 0 0 1 2.5 0", - merge: "M5.45 5.154A4.25 4.25 0 0 0 9.25 7.5h1.378a2.251 2.251 0 1 1 0 1.5H9.25A5.734 5.734 0 0 1 5 7.123v3.505a2.25 2.25 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.95-.218M4.25 13.5a.75.75 0 1 0 0-1.5a.75.75 0 0 0 0 1.5m8.5-4.5a.75.75 0 1 0 0-1.5a.75.75 0 0 0 0 1.5M5 3.25a.75.75 0 1 0 0 .005z", -}; \ No newline at end of file +export const pr_icon_path = { + open: 'M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25m5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354M3.75 2.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m0 9.5a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m8.25.75a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0', + close: + 'M3.25 1A2.25 2.25 0 0 1 4 5.372v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.251 2.251 0 0 1 3.25 1m9.5 5.5a.75.75 0 0 1 .75.75v3.378a2.251 2.251 0 1 1-1.5 0V7.25a.75.75 0 0 1 .75-.75m-2.03-5.273a.75.75 0 0 1 1.06 0l.97.97l.97-.97a.748.748 0 0 1 1.265.332a.75.75 0 0 1-.205.729l-.97.97l.97.97a.751.751 0 0 1-.018 1.042a.751.751 0 0 1-1.042.018l-.97-.97l-.97.97a.749.749 0 0 1-1.275-.326a.749.749 0 0 1 .215-.734l.97-.97l-.97-.97a.75.75 0 0 1 0-1.06ZM2.5 3.25a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0M3.25 12a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m9.5 0a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5', + draft: + 'M3.25 1A2.25 2.25 0 0 1 4 5.372v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.251 2.251 0 0 1 3.25 1m9.5 14a2.25 2.25 0 1 1 0-4.5a2.25 2.25 0 0 1 0 4.5M2.5 3.25a.75.75 0 1 0 1.5 0a.75.75 0 0 0-1.5 0M3.25 12a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5m9.5 0a.75.75 0 1 0 0 1.5a.75.75 0 0 0 0-1.5M14 7.5a1.25 1.25 0 1 1-2.5 0a1.25 1.25 0 0 1 2.5 0m0-4.25a1.25 1.25 0 1 1-2.5 0a1.25 1.25 0 0 1 2.5 0', + merge: + 'M5.45 5.154A4.25 4.25 0 0 0 9.25 7.5h1.378a2.251 2.251 0 1 1 0 1.5H9.25A5.734 5.734 0 0 1 5 7.123v3.505a2.25 2.25 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.95-.218M4.25 13.5a.75.75 0 1 0 0-1.5a.75.75 0 0 0 0 1.5m8.5-4.5a.75.75 0 1 0 0-1.5a.75.75 0 0 0 0 1.5M5 3.25a.75.75 0 1 0 0 .005z', +} diff --git a/src/lib/components/prs/type.ts b/src/lib/components/prs/type.ts index 960e39a..f55b85c 100644 --- a/src/lib/components/prs/type.ts +++ b/src/lib/components/prs/type.ts @@ -1,70 +1,71 @@ -import type { User } from "../users/type"; -import { defaults as user_defaults } from "../users/type"; -import type { Event } from "../events/type"; -import type { NDKEvent } from "@nostr-dev-kit/ndk"; +import type { User } from '../users/type' +import { defaults as user_defaults } from '../users/type' +import type { Event } from '../events/type' +import type { NDKEvent } from '@nostr-dev-kit/ndk' export interface PRSummary { - title: string; - descritpion: string; - repo_id: string; - id: string; - comments: number; - status: undefined | PRStatus, - status_date: number, - author: User; - created_at: number | undefined; - loading: boolean; + title: string + descritpion: string + repo_id: string + id: string + comments: number + status: undefined | PRStatus + status_date: number + author: User + created_at: number | undefined + loading: boolean } export const summary_defaults: PRSummary = { - title: "", - descritpion: "", - repo_id: "", - id: "", - comments: 0, - status: undefined, - status_date: 0, - author: { ...user_defaults }, - created_at: 0, - loading: true, -}; + title: '', + descritpion: '', + repo_id: '', + id: '', + comments: 0, + status: undefined, + status_date: 0, + author: { ...user_defaults }, + created_at: 0, + loading: true, +} export interface PRSummaries { - id: string; - summaries: PRSummary[]; - loading: boolean; + id: string + summaries: PRSummary[] + loading: boolean } export const summaries_defaults: PRSummaries = { - id: "", - summaries: [], - loading: true, -}; + id: '', + summaries: [], + loading: true, +} -export type PRStatus = "Draft" | "Open" | "Merged" | "Closed"; +export type PRStatus = 'Draft' | 'Open' | 'Merged' | 'Closed' -export function isPRStatus(potential_status: string | undefined): potential_status is PRStatus { - return !!potential_status - && ( - potential_status == "Draft" - || potential_status == "Open" - || potential_status == "Merged" - || potential_status == "Closed" - ) +export function isPRStatus( + potential_status: string | undefined +): potential_status is PRStatus { + return ( + !!potential_status && + (potential_status == 'Draft' || + potential_status == 'Open' || + potential_status == 'Merged' || + potential_status == 'Closed') + ) } export interface PRFull { - summary: PRSummary; - pr_event: NDKEvent | undefined; - labels: string[]; - events: Event[]; - loading: boolean; + summary: PRSummary + pr_event: NDKEvent | undefined + labels: string[] + events: Event[] + loading: boolean } export const full_defaults: PRFull = { - summary: { ...summary_defaults }, - pr_event: undefined, - labels: [], - events: [], - loading: true, -}; - + summary: { ...summary_defaults }, + pr_event: undefined, + labels: [], + events: [], + loading: true, +} diff --git a/src/lib/components/prs/vectors.ts b/src/lib/components/prs/vectors.ts index 8a6bb58..e02a9c7 100644 --- a/src/lib/components/prs/vectors.ts +++ b/src/lib/components/prs/vectors.ts @@ -1,59 +1,61 @@ -import dayjs from "dayjs"; -import relativeTime from "dayjs/plugin/relativeTime"; -import type { PRSummary } from "./type"; -import { UserVectors } from "../users/vectors"; +import dayjs from 'dayjs' +import relativeTime from 'dayjs/plugin/relativeTime' +import type { PRSummary } from './type' +import { UserVectors } from '../users/vectors' -dayjs.extend(relativeTime); +dayjs.extend(relativeTime) -let Short = { - title: "short title", +const Short = { + title: 'short title', + author: { ...UserVectors.default }, + created_at: dayjs().subtract(7, 'days').unix(), + comments: 2, + status: 'Open', + loading: false, +} as PRSummary + +export const PRsListItemArgsVectors = { + Short, + Long: { + title: + 'rather long title that goes on and on and on and on and on and on and on and on and on and on and on and on and on and on and on', author: { ...UserVectors.default }, - created_at: dayjs().subtract(7, 'days').unix(), - comments: 2, - status: "Open", + created_at: dayjs().subtract(1, 'minute').unix(), + comments: 0, + status: 'Open', loading: false, -} as PRSummary; - -export let PRsListItemArgsVectors = { - Short, - Long: { - title: "rather long title that goes on and on and on and on and on and on and on and on and on and on and on and on and on and on and on", - author: { ...UserVectors.default }, - created_at: dayjs().subtract(1, 'minute').unix(), - comments: 0, - status: "Open", - loading: false, - } as PRSummary, - LongNoSpaces: { - title: "LongNameLongNameLongNameLongNameLongNameLongNameLongNameLongNameLongNameLongNameLongNameLongNameLongNameLongName", - author: { ...UserVectors.default }, - created_at: dayjs().subtract(3, 'month').subtract(3, 'days').unix(), - comments: 1, - status: "Open", - loading: false, - } as PRSummary, - AuthorLoading: { - title: "short title", - author: { ...UserVectors.loading }, - created_at: dayjs().subtract(3, 'month').subtract(3, 'days').unix(), - comments: 1, - status: "Open", - loading: false, - } as PRSummary, - StatusLoading: { - ...Short, - status: undefined, - } as PRSummary, - StatusDraft: { - ...Short, - status: "Draft", - } as PRSummary, - StatusClosed: { - ...Short, - status: "Closed", - } as PRSummary, - StatusMerged: { - ...Short, - status: "Merged", - } as PRSummary, -}; + } as PRSummary, + LongNoSpaces: { + title: + 'LongNameLongNameLongNameLongNameLongNameLongNameLongNameLongNameLongNameLongNameLongNameLongNameLongNameLongName', + author: { ...UserVectors.default }, + created_at: dayjs().subtract(3, 'month').subtract(3, 'days').unix(), + comments: 1, + status: 'Open', + loading: false, + } as PRSummary, + AuthorLoading: { + title: 'short title', + author: { ...UserVectors.loading }, + created_at: dayjs().subtract(3, 'month').subtract(3, 'days').unix(), + comments: 1, + status: 'Open', + loading: false, + } as PRSummary, + StatusLoading: { + ...Short, + status: undefined, + } as PRSummary, + StatusDraft: { + ...Short, + status: 'Draft', + } as PRSummary, + StatusClosed: { + ...Short, + status: 'Closed', + } as PRSummary, + StatusMerged: { + ...Short, + status: 'Merged', + } as PRSummary, +} diff --git a/src/lib/components/repo/RepoDetails.stories.svelte b/src/lib/components/repo/RepoDetails.stories.svelte index a22ad71..b3737c4 100644 --- a/src/lib/components/repo/RepoDetails.stories.svelte +++ b/src/lib/components/repo/RepoDetails.stories.svelte @@ -1,18 +1,18 @@ @@ -32,18 +32,18 @@ diff --git a/src/lib/components/repo/RepoDetails.svelte b/src/lib/components/repo/RepoDetails.svelte index 1b13e34..bc233db 100644 --- a/src/lib/components/repo/RepoDetails.svelte +++ b/src/lib/components/repo/RepoDetails.svelte @@ -1,98 +1,85 @@ - - -
    +
    + {#if loading} +
    +
    +
    + {:else if description.length == 0} +
    + {:else} +

    description

    +

    {short_descrption}

    + {/if} +
    + {#if loading} +
    +
    + {:else} + {#each tags as tag} +
    {tag}
    + {/each} + {/if} +
    +
    + {#if loading} +
    +
    + {:else if git_server.length == 0} +
    + {:else} +

    git server

    + + {git_server} + + {/if} +
    +
    + {#if loading} +
    +
    +
    + {:else if maintainers.length == 0} +
    + {:else} +

    maintainers

    + {#each maintainers as maintainer} + + {/each} + {/if} +
    +
    {#if loading} -
    -
    -
    - {:else if description.length == 0} -
    +
    +
    +
    + {:else if relays.length == 0} +
    {:else} -

    description

    -

    {short_descrption}

    +

    relays

    + {#each relays as relay} +
    {relay}
    + {/each} {/if} -
    - {#if loading} -
    -
    - {:else} - {#each tags as tag} -
    {tag}
    - {/each} - {/if} -
    -
    - {#if loading} -
    -
    - {:else if git_server.length == 0} -
    - {:else} -

    git server

    - - {git_server} - - {/if} -
    -
    - {#if loading} -
    -
    -
    - {:else if maintainers.length == 0} -
    - {:else} -

    maintainers

    - {#each maintainers as maintainer} - - {/each} - {/if} -
    -
    - {#if loading} -
    -
    -
    - {:else if relays.length == 0} -
    - {:else} -

    relays

    - {#each relays as relay} -
    {relay}
    - {/each} - {/if} -
    +
    diff --git a/src/lib/components/repo/RepoHeader.stories.svelte b/src/lib/components/repo/RepoHeader.stories.svelte index 3cc2b95..192f53e 100644 --- a/src/lib/components/repo/RepoHeader.stories.svelte +++ b/src/lib/components/repo/RepoHeader.stories.svelte @@ -1,18 +1,18 @@ diff --git a/src/lib/components/repo/RepoHeader.svelte b/src/lib/components/repo/RepoHeader.svelte index ae02ec8..7e41e6b 100644 --- a/src/lib/components/repo/RepoHeader.svelte +++ b/src/lib/components/repo/RepoHeader.svelte @@ -1,43 +1,37 @@ - - -
    - - {#if loading} -
    -
    -
    - {:else} - {short_name} - {/if} -
    +
    + + {#if loading} +
    +
    +
    + {:else} + {short_name} + {/if} +
    diff --git a/src/lib/components/repo/type.ts b/src/lib/components/repo/type.ts index f97b89e..b109ffe 100644 --- a/src/lib/components/repo/type.ts +++ b/src/lib/components/repo/type.ts @@ -1,22 +1,22 @@ -import type { User } from "../users/type"; +import type { User } from '../users/type' export interface Repo { - repo_id: string; - name: string; - description: string; - git_server: string; - tags: string[]; - maintainers: User[]; - relays: string[]; - loading: boolean; + repo_id: string + name: string + description: string + git_server: string + tags: string[] + maintainers: User[] + relays: string[] + loading: boolean } export const defaults: Repo = { - repo_id: "", - name: "", - description: "", - git_server: "", - tags: [], - maintainers: [], - relays: [], - loading: true, -}; \ No newline at end of file + repo_id: '', + name: '', + description: '', + git_server: '', + tags: [], + maintainers: [], + relays: [], + loading: true, +} diff --git a/src/lib/components/repo/vectors.ts b/src/lib/components/repo/vectors.ts index 0703875..1ac4302 100644 --- a/src/lib/components/repo/vectors.ts +++ b/src/lib/components/repo/vectors.ts @@ -1,92 +1,89 @@ -import type { Args as SummaryCardArgs } from "../RepoSummaryCard.svelte"; -import type { NDKUserProfile } from "@nostr-dev-kit/ndk"; -import type { User } from "../users/type"; -import { UserVectors, withName } from "../users/vectors"; -import type { Repo } from "./type"; +import type { Args as SummaryCardArgs } from '../RepoSummaryCard.svelte' +import { UserVectors, withName } from '../users/vectors' +import type { Repo } from './type' -export let RepoSummaryCardArgsVectors = { - Short: { - name: "Short Name", - description: "short description", - } as SummaryCardArgs, - Long: { - name: "Long Name that goes on and on and on and on and on and on and on and on and on", - description: - "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis quis nisl eget turpis congue molestie. Nulla vitae purus nec augue accumsan facilisis sed sed ligula. Vestibulum sed risus lacinia risus lacinia molestie. Ut lorem quam, consequat eget tempus in, rhoncus vel nunc. Duis efficitur a leo vel sodales. Nam id fermentum lacus. Etiam nec placerat velit. Praesent ac consectetur est. Aenean iaculis commodo enim.", - } as SummaryCardArgs, - LongNoSpaces: { - name: "LongNameLongNameLongNameLongNameLongNameLongNameLongNameLongName", - description: - "LoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsum>", - } as SummaryCardArgs, -}; -let base: Repo = { - repo_id: "9ee507fc4357d7ee16a5d8901bedcd103f23c17d", - name: "Short Name", - description: "short description", - git_server: "github.com/example/example", - tags: ["svelte", "nostr", "code-collaboration", "git"], - relays: [ - "relay.damus.io", - "relay.snort.social", - "relayable.org", +export const RepoSummaryCardArgsVectors = { + Short: { + name: 'Short Name', + description: 'short description', + } as SummaryCardArgs, + Long: { + name: 'Long Name that goes on and on and on and on and on and on and on and on and on', + description: + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis quis nisl eget turpis congue molestie. Nulla vitae purus nec augue accumsan facilisis sed sed ligula. Vestibulum sed risus lacinia risus lacinia molestie. Ut lorem quam, consequat eget tempus in, rhoncus vel nunc. Duis efficitur a leo vel sodales. Nam id fermentum lacus. Etiam nec placerat velit. Praesent ac consectetur est. Aenean iaculis commodo enim.', + } as SummaryCardArgs, + LongNoSpaces: { + name: 'LongNameLongNameLongNameLongNameLongNameLongNameLongNameLongName', + description: + 'LoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsum>', + } as SummaryCardArgs, +} +const base: Repo = { + repo_id: '9ee507fc4357d7ee16a5d8901bedcd103f23c17d', + name: 'Short Name', + description: 'short description', + git_server: 'github.com/example/example', + tags: ['svelte', 'nostr', 'code-collaboration', 'git'], + relays: ['relay.damus.io', 'relay.snort.social', 'relayable.org'], + maintainers: [ + withName(UserVectors.default, 'carole'), + withName(UserVectors.default, 'bob'), + withName(UserVectors.default, 'steve'), + ], + loading: false, +} + +export const RepoDetailsArgsVectors = { + Short: { ...base } as Repo, + Long: { + ...base, + name: 'Long Name that goes on and on and on and on and on and on and on and on and on', + description: + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis quis nisl eget turpis congue molestie. Nulla vitae purus nec augue accumsan facilisis sed sed ligula. Vestibulum sed risus lacinia risus lacinia molestie. Ut lorem quam, consequat eget tempus in, rhoncus vel nunc. Duis efficitur a leo vel sodales. Nam id fermentum lacus. Etiam nec placerat velit. Praesent ac consectetur est. Aenean iaculis commodo enim.\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis quis nisl eget turpis congue molestie.', + } as Repo, + LongNoSpaces: { + ...base, + name: 'LongNameLongNameLongNameLongNameLongNameLongNameLongNameLongName', + description: + 'LoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsum', + } as Repo, + NoNameOrDescription: { ...base, name: '', description: '' } as Repo, + NoDescription: { ...base, description: '' } as Repo, + NoTags: { ...base, tags: [] } as Repo, + NoGitServer: { ...base, git_server: '' } as Repo, + MaintainersOneProfileNotLoaded: { + ...base, + maintainers: [ + { ...base.maintainers[0] }, + { ...UserVectors.loading }, + { ...base.maintainers[2] }, ], + } as Repo, + MaintainersOneProfileDisplayNameWithoutName: { + ...base, maintainers: [ - withName(UserVectors.default, "carole"), - withName(UserVectors.default, "bob"), - withName(UserVectors.default, "steve"), + { ...base.maintainers[0] }, + { ...UserVectors.display_name_only }, + { ...base.maintainers[2] }, ], - loading: false, -}; - -export let RepoDetailsArgsVectors = { - Short: { ...base, } as Repo, - Long: { - ...base, - name: "Long Name that goes on and on and on and on and on and on and on and on and on", - description: - "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis quis nisl eget turpis congue molestie. Nulla vitae purus nec augue accumsan facilisis sed sed ligula. Vestibulum sed risus lacinia risus lacinia molestie. Ut lorem quam, consequat eget tempus in, rhoncus vel nunc. Duis efficitur a leo vel sodales. Nam id fermentum lacus. Etiam nec placerat velit. Praesent ac consectetur est. Aenean iaculis commodo enim.\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis quis nisl eget turpis congue molestie.", - } as Repo, - LongNoSpaces: { - ...base, - name: "LongNameLongNameLongNameLongNameLongNameLongNameLongNameLongName", - description: - "LoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsum", - } as Repo, - NoNameOrDescription: { ...base, name: "", description: "" } as Repo, - NoDescription: { ...base, description: "" } as Repo, - NoTags: { ...base, tags: [] } as Repo, - NoGitServer: { ...base, git_server: "" } as Repo, - MaintainersOneProfileNotLoaded: { - ...base, maintainers: [ - { ...base.maintainers[0] }, - { ...UserVectors.loading }, - { ...base.maintainers[2] }, - ] - } as Repo, - MaintainersOneProfileDisplayNameWithoutName: { - ...base, maintainers: [ - { ...base.maintainers[0] }, - { ...UserVectors.display_name_only }, - { ...base.maintainers[2] }, - ] - } as Repo, - MaintainersOneProfileNameAndDisplayNamePresent: { - ...base, maintainers: [ - { ...base.maintainers[0] }, - { ...UserVectors.display_name_and_name }, - { ...base.maintainers[2] }, - ] - } as Repo, - MaintainersOneProfileNoNameOrDisplayNameBeingPresent: { - ...base, maintainers: [ - { ...base.maintainers[0] }, - { ...UserVectors.no_profile }, - { ...base.maintainers[2] }, - - ] - } as Repo, - NoMaintainers: { ...base, maintainers: [] } as Repo, - NoRelays: { ...base, relays: [] } as Repo, - NoMaintainersOrRelays: { ...base, maintainers: [], relays: [] } as Repo, -}; \ No newline at end of file + } as Repo, + MaintainersOneProfileNameAndDisplayNamePresent: { + ...base, + maintainers: [ + { ...base.maintainers[0] }, + { ...UserVectors.display_name_and_name }, + { ...base.maintainers[2] }, + ], + } as Repo, + MaintainersOneProfileNoNameOrDisplayNameBeingPresent: { + ...base, + maintainers: [ + { ...base.maintainers[0] }, + { ...UserVectors.no_profile }, + { ...base.maintainers[2] }, + ], + } as Repo, + NoMaintainers: { ...base, maintainers: [] } as Repo, + NoRelays: { ...base, relays: [] } as Repo, + NoMaintainersOrRelays: { ...base, maintainers: [], relays: [] } as Repo, +} diff --git a/src/lib/components/users/UserHeader.stories.svelte b/src/lib/components/users/UserHeader.stories.svelte index 43ebbe9..e62c277 100644 --- a/src/lib/components/users/UserHeader.stories.svelte +++ b/src/lib/components/users/UserHeader.stories.svelte @@ -1,41 +1,36 @@ @@ -43,11 +38,11 @@ diff --git a/src/lib/components/users/UserHeader.svelte b/src/lib/components/users/UserHeader.svelte index 3d0a0b5..502466c 100644 --- a/src/lib/components/users/UserHeader.svelte +++ b/src/lib/components/users/UserHeader.svelte @@ -1,32 +1,33 @@ -
    -
    -
    - {#if !!profile?.image} - {display_name} - {/if} -
    -
    -
    - {#if loading} -
    - {:else} - {display_name} - {/if} +
    +
    +
    + {#if profile && profile?.image} + {display_name} + {/if}
    +
    +
    + {#if loading} +
    + {:else} + {display_name} + {/if} +
    diff --git a/src/lib/components/users/type.ts b/src/lib/components/users/type.ts index d9d9286..874eb04 100644 --- a/src/lib/components/users/type.ts +++ b/src/lib/components/users/type.ts @@ -1,29 +1,28 @@ -import type { NDKUserProfile } from "@nostr-dev-kit/ndk"; +import type { NDKUserProfile } from '@nostr-dev-kit/ndk' export interface User { - loading: boolean; - hexpubkey: string; - npub: string; - profile?: NDKUserProfile; + loading: boolean + hexpubkey: string + npub: string + profile?: NDKUserProfile } -export let defaults: User = { - loading: true, - hexpubkey: "", - npub: "", +export const defaults: User = { + loading: true, + hexpubkey: '', + npub: '', } -export function getName(user: User, fallback_to_pubkey: boolean = false): string { - return user.profile ? ( - user.profile.name - ? user.profile.name - : user.profile.displayName - ? user.profile.displayName - : truncateNpub(user.npub) - ) - : truncateNpub(user.npub); +export function getName(user: User): string { + return user.profile + ? user.profile.name + ? user.profile.name + : user.profile.displayName + ? user.profile.displayName + : truncateNpub(user.npub) + : truncateNpub(user.npub) } function truncateNpub(npub: string): string { - return `${npub.substring(0, 9)}...`; -} \ No newline at end of file + return `${npub.substring(0, 9)}...` +} diff --git a/src/lib/components/users/vectors.ts b/src/lib/components/users/vectors.ts index f52a29c..e516ec7 100644 --- a/src/lib/components/users/vectors.ts +++ b/src/lib/components/users/vectors.ts @@ -1,30 +1,35 @@ -import type { User } from "./type"; +import type { User } from './type' // nsec1rg53qfv09az39dlw6j64ange3cx8sh5p8np29qcxtythplvplktsv93tnr -let base: User = { - hexpubkey: - "3eb45c6f15752d796fa5465d0530a5a5feb79fb6f08c0a4176be9d73cc28c40d", - npub: "npub18669cmc4w5khjma9gews2v995hlt08ak7zxq5stkh6wh8npgcsxslt2xjn", - loading: false, -}; +const base: User = { + hexpubkey: '3eb45c6f15752d796fa5465d0530a5a5feb79fb6f08c0a4176be9d73cc28c40d', + npub: 'npub18669cmc4w5khjma9gews2v995hlt08ak7zxq5stkh6wh8npgcsxslt2xjn', + loading: false, +} -let image = "../test-profile-image.jpg"; +const image = '../test-profile-image.jpg' -export let UserVectors = { - loading: { ...base, loading: true } as User, - default: { ...base, profile: { name: "DanConwayDev", image } } as User, - display_name_only: { ...base, profile: { displayName: "DanConwayDev", image } } as User, - display_name_and_name: { ...base, profile: { name: "Dan", displayName: "DanConwayDev", image } } as User, - no_image: { ...base, profile: { name: "DanConwayDev" } } as User, - no_profile: { ...base } as User, -}; +export const UserVectors = { + loading: { ...base, loading: true } as User, + default: { ...base, profile: { name: 'DanConwayDev', image } } as User, + display_name_only: { + ...base, + profile: { displayName: 'DanConwayDev', image }, + } as User, + display_name_and_name: { + ...base, + profile: { name: 'Dan', displayName: 'DanConwayDev', image }, + } as User, + no_image: { ...base, profile: { name: 'DanConwayDev' } } as User, + no_profile: { ...base } as User, +} export function withName(base: User, name: string): User { - return { - ...base, - profile: { - ...base.profile, - name, - } - } as User + return { + ...base, + profile: { + ...base.profile, + name, + }, + } as User } diff --git a/src/lib/kinds.ts b/src/lib/kinds.ts index 23f3122..a4eb06d 100644 --- a/src/lib/kinds.ts +++ b/src/lib/kinds.ts @@ -1,9 +1,9 @@ -export let reply_kind = 1; +export const reply_kind: number = 1 -export let pr_status_kind = 19851985; +export const pr_status_kind: number = 19851985 -export let repo_kind = 30317; +export const repo_kind: number = 30317 -export let pr_kind = 318; +export const pr_kind: number = 318 -export let patch_kind = 317; +export const patch_kind: number = 317 diff --git a/src/lib/stores/PR.ts b/src/lib/stores/PR.ts index a99f0f0..3a6d8ed 100644 --- a/src/lib/stores/PR.ts +++ b/src/lib/stores/PR.ts @@ -1,184 +1,193 @@ -import { NDKRelaySet, type NDKEvent, NDKSubscription } from "@nostr-dev-kit/ndk"; -import { writable, type Unsubscriber, type Writable } from "svelte/store" -import { ndk } from "./ndk"; -import type { User } from "$lib/components/users/type"; -import { ensureUser } from "./users"; -import { type PRFull, full_defaults, isPRStatus, type PRStatus } from "$lib/components/prs/type"; -import { pr_kind, pr_status_kind } from "$lib/kinds"; -import { ensureSelectedRepo } from "./repo"; - -export let selected_pr_full: Writable = writable({ ...full_defaults }); - -let selected_pr_repo_id: string = ""; -let selected_pr_id: string = ""; -let pr_summary_author_unsubsriber: Unsubscriber | undefined; - -export let selected_pr_replies: Writable = writable([]); - -let selected_pr_status_date = 0; - -let sub: NDKSubscription; - -let sub_replies: NDKSubscription; - -export let ensurePRFull = (repo_id: string, pr_id: string) => { - if (selected_pr_id == pr_id) return; - if (pr_id == "") { - selected_pr_full.set({ ...full_defaults }); - selected_pr_replies.set([]); - return; - } - - if (sub) sub.stop(); - if (sub_replies) sub_replies.stop(); - - selected_pr_repo_id = repo_id; - selected_pr_id = pr_id; - selected_pr_status_date = 0; - selected_pr_replies.set([]); - - selected_pr_full.set({ - ...full_defaults, - summary: { - ...full_defaults.summary, - id: pr_id, - repo_id: repo_id, - loading: true, - }, - loading: true, - }); - if (pr_summary_author_unsubsriber) pr_summary_author_unsubsriber(); - pr_summary_author_unsubsriber = undefined; - - new Promise(async (r) => { - let repo = await ensureSelectedRepo(repo_id); - - sub = ndk.subscribe( - { - ids: [pr_id], - kinds: [pr_kind], - '#r': [`r-${repo_id}`], - limit: 50, - }, - { - closeOnEose: false, - }, - NDKRelaySet.fromRelayUrls(repo.relays, ndk), - ); - - sub.on("event", (event: NDKEvent) => { - try { - if (event.kind == pr_kind - && event.getMatchingTags("r").find(t => t[1] === `r-${repo_id}`) - && event.id == pr_id - ) { - selected_pr_full.update(full => { - return { - ...full, - pr_event: event, - summary: { - ...full.summary, - title: event.tagValue("name") || "", - descritpion: event.tagValue("description") || "", - created_at: event.created_at, - comments: 0, - author: { - hexpubkey: event.pubkey, - loading: true, - npub: "", - }, - loading: false, - } - }; - }); - - pr_summary_author_unsubsriber = ensureUser(event.pubkey).subscribe((u: User) => { - selected_pr_full.update(full => { - return { - ...full, - summary: { - ...full.summary, - author: event.pubkey == u.hexpubkey ? u : full.summary.author, - } - }; - }); - }); - } - } catch { } - }); - - sub.on("eose", () => { - selected_pr_full.update(full => { - let updated = { - ...full, - summary: { - ...full.summary, - loading: false, - }, - }; - if (full.loading === false) { - r({ ...updated }); - } - return updated; - }); - }); - - sub_replies = ndk.subscribe( - { - "#e": [pr_id], - }, - { - closeOnEose: false - }, - NDKRelaySet.fromRelayUrls(repo.relays, ndk), - ); - - sub_replies.on("event", (event: NDKEvent) => { - if (event.kind == pr_status_kind - && event.created_at && selected_pr_status_date < event.created_at - && event.getMatchingTags("l").length === 1 - && event.getMatchingTags("l")[0].length > 1 - ) { - let potential_status = event.getMatchingTags("l")[0][1]; - - if (isPRStatus(potential_status)) { - selected_pr_status_date = event.created_at; - selected_pr_full.update(full => { - return { - ...full, - summary: { - ...full.summary, - status: potential_status as PRStatus, - // this wont be 0 as we are ensuring it is not undefined above - status_date: event.created_at || 0, - }, - }; - }); - } +import { NDKRelaySet, type NDKEvent, NDKSubscription } from '@nostr-dev-kit/ndk' +import { writable, type Unsubscriber, type Writable } from 'svelte/store' +import { ndk } from './ndk' +import type { User } from '$lib/components/users/type' +import { ensureUser } from './users' +import { + type PRFull, + full_defaults, + isPRStatus, + type PRStatus, +} from '$lib/components/prs/type' +import { pr_kind, pr_status_kind } from '$lib/kinds' +import { ensureSelectedRepo } from './repo' + +export const selected_pr_full: Writable = writable({ ...full_defaults }) + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +let selected_pr_repo_id: string = '' +let selected_pr_id: string = '' +let pr_summary_author_unsubsriber: Unsubscriber | undefined + +export const selected_pr_replies: Writable = writable([]) + +let selected_pr_status_date = 0 + +let sub: NDKSubscription + +let sub_replies: NDKSubscription + +export const ensurePRFull = (repo_id: string, pr_id: string) => { + if (selected_pr_id == pr_id) return + if (pr_id == '') { + selected_pr_full.set({ ...full_defaults }) + selected_pr_replies.set([]) + return + } + + if (sub) sub.stop() + if (sub_replies) sub_replies.stop() + + selected_pr_repo_id = repo_id + selected_pr_id = pr_id + selected_pr_status_date = 0 + selected_pr_replies.set([]) + + selected_pr_full.set({ + ...full_defaults, + summary: { + ...full_defaults.summary, + id: pr_id, + repo_id: repo_id, + loading: true, + }, + loading: true, + }) + if (pr_summary_author_unsubsriber) pr_summary_author_unsubsriber() + pr_summary_author_unsubsriber = undefined + + new Promise(async (r) => { + const repo = await ensureSelectedRepo(repo_id) + + sub = ndk.subscribe( + { + ids: [pr_id], + kinds: [pr_kind], + '#r': [`r-${repo_id}`], + limit: 50, + }, + { + closeOnEose: false, + }, + NDKRelaySet.fromRelayUrls(repo.relays, ndk) + ) + + sub.on('event', (event: NDKEvent) => { + try { + if ( + event.kind == pr_kind && + event.getMatchingTags('r').find((t) => t[1] === `r-${repo_id}`) && + event.id == pr_id + ) { + selected_pr_full.update((full) => { + return { + ...full, + pr_event: event, + summary: { + ...full.summary, + title: event.tagValue('name') || '', + descritpion: event.tagValue('description') || '', + created_at: event.created_at, + comments: 0, + author: { + hexpubkey: event.pubkey, + loading: true, + npub: '', + }, + loading: false, + }, } - selected_pr_replies.update(replies => { - return [ - ...replies, - event, - ]; - }); - }); - - sub_replies.on("eose", () => { - selected_pr_full.update(full => { - let updated = { - ...full, - summary: { - ...full.summary, - status: full.summary.status || "Open", - }, - loading: false, - }; - if (full.summary.loading === false) { - r({ ...updated }); + }) + + pr_summary_author_unsubsriber = ensureUser(event.pubkey).subscribe( + (u: User) => { + selected_pr_full.update((full) => { + return { + ...full, + summary: { + ...full.summary, + author: + event.pubkey == u.hexpubkey ? u : full.summary.author, + }, } - return updated; - }); - }); - }); + }) + } + ) + } + } catch {} + }) + + sub.on('eose', () => { + selected_pr_full.update((full) => { + const updated = { + ...full, + summary: { + ...full.summary, + loading: false, + }, + } + if (full.loading === false) { + r({ ...updated }) + } + return updated + }) + }) + + sub_replies = ndk.subscribe( + { + '#e': [pr_id], + }, + { + closeOnEose: false, + }, + NDKRelaySet.fromRelayUrls(repo.relays, ndk) + ) + + sub_replies.on('event', (event: NDKEvent) => { + if ( + event.kind == pr_status_kind && + event.created_at && + selected_pr_status_date < event.created_at && + event.getMatchingTags('l').length === 1 && + event.getMatchingTags('l')[0].length > 1 + ) { + const potential_status = event.getMatchingTags('l')[0][1] + + if (isPRStatus(potential_status)) { + selected_pr_status_date = event.created_at + selected_pr_full.update((full) => { + return { + ...full, + summary: { + ...full.summary, + status: potential_status as PRStatus, + // this wont be 0 as we are ensuring it is not undefined above + status_date: event.created_at || 0, + }, + } + }) + } + } + selected_pr_replies.update((replies) => { + return [...replies, event] + }) + }) + + sub_replies.on('eose', () => { + selected_pr_full.update((full) => { + const updated = { + ...full, + summary: { + ...full.summary, + status: full.summary.status || 'Open', + }, + loading: false, + } + if (full.summary.loading === false) { + r({ ...updated }) + } + return updated + }) + }) + }) } diff --git a/src/lib/stores/PRs.ts b/src/lib/stores/PRs.ts index 9b9d084..c73afeb 100644 --- a/src/lib/stores/PRs.ts +++ b/src/lib/stores/PRs.ts @@ -1,173 +1,174 @@ -import { NDKRelaySet, type NDKEvent, NDKSubscription } from "@nostr-dev-kit/ndk"; -import { writable, type Unsubscriber, type Writable } from "svelte/store" -import { ndk } from "./ndk"; -import { isPRStatus, summary_defaults } from "$lib/components/prs/type"; -import type { User } from "$lib/components/users/type"; -import { ensureUser } from "./users"; -import type { PRStatus, PRSummaries } from "$lib/components/prs/type"; -import { ensureSelectedRepo } from "./repo"; -import { pr_status_kind } from "$lib/kinds"; -import type { Repo } from "$lib/components/repo/type"; - -export let pr_summaries: Writable = writable({ - id: "", +import { NDKRelaySet, type NDKEvent, NDKSubscription } from '@nostr-dev-kit/ndk' +import { writable, type Unsubscriber, type Writable } from 'svelte/store' +import { ndk } from './ndk' +import { isPRStatus, summary_defaults } from '$lib/components/prs/type' +import type { User } from '$lib/components/users/type' +import { ensureUser } from './users' +import type { PRStatus, PRSummaries } from '$lib/components/prs/type' +import { ensureSelectedRepo } from './repo' +import { pr_status_kind } from '$lib/kinds' +import type { Repo } from '$lib/components/repo/type' + +export const pr_summaries: Writable = writable({ + id: '', + summaries: [], + loading: false, +}) + +const pr_kind: number = 318 + +let selected_repo_id: string = '' + +let authors_unsubscribers: Unsubscriber[] = [] + +let sub: NDKSubscription + +export const ensurePRSummaries = async (repo_id: string) => { + if (selected_repo_id == repo_id) return + pr_summaries.set({ + id: repo_id, summaries: [], - loading: false, -}); - -let pr_kind: number = 318; - -let selected_repo_id: string = ""; - -let authors_unsubscribers: Unsubscriber[] = []; - -let sub: NDKSubscription; - -export let ensurePRSummaries = async (repo_id: string) => { - if (selected_repo_id == repo_id) return; - pr_summaries.set({ - id: repo_id, - summaries: [], - loading: repo_id !== "", - }); - - if (sub) sub.stop(); - if (sub_statuses) sub_statuses.stop(); - authors_unsubscribers.forEach(u => u()); - authors_unsubscribers = []; - - selected_repo_id = repo_id; - - let repo = await ensureSelectedRepo(repo_id); - - sub = ndk.subscribe( - { - kinds: [pr_kind], - '#r': [`r-${repo_id}`], - limit: 50, - }, - { - closeOnEose: false, - }, - NDKRelaySet.fromRelayUrls(repo.relays, ndk), - ); - - sub.on("event", (event: NDKEvent) => { - try { - if (event.kind == pr_kind - && event.getMatchingTags("r").find(t => t[1] === `r-${repo_id}`) - ) { - pr_summaries.update(prs => { - return { - ...prs, - summaries: [ - ...prs.summaries, - { - ...summary_defaults, - id: event.id, - repo_id: repo_id, - title: event.tagValue("name") || "", - descritpion: event.tagValue("description") || "", - created_at: event.created_at, - comments: 0, - author: { - hexpubkey: event.pubkey, - loading: true, - npub: "", - }, - loading: false, - } - ], - } - }); - - authors_unsubscribers.push( - ensureUser(event.pubkey).subscribe((u: User) => { - pr_summaries.update(prs => { - return { - ...prs, - summaries: prs.summaries.map(o => ({ - ...o, - author: u, - })), - } - }); - }) - ); - } - } catch { } - }); - sub.on("eose", () => { - pr_summaries.update(prs => { - getAndUpdatePRStatus(prs, repo); - return { - ...prs, + loading: repo_id !== '', + }) + + if (sub) sub.stop() + if (sub_statuses) sub_statuses.stop() + authors_unsubscribers.forEach((u) => u()) + authors_unsubscribers = [] + + selected_repo_id = repo_id + + const repo = await ensureSelectedRepo(repo_id) + + sub = ndk.subscribe( + { + kinds: [pr_kind], + '#r': [`r-${repo_id}`], + limit: 50, + }, + { + closeOnEose: false, + }, + NDKRelaySet.fromRelayUrls(repo.relays, ndk) + ) + + sub.on('event', (event: NDKEvent) => { + try { + if ( + event.kind == pr_kind && + event.getMatchingTags('r').find((t) => t[1] === `r-${repo_id}`) + ) { + pr_summaries.update((prs) => { + return { + ...prs, + summaries: [ + ...prs.summaries, + { + ...summary_defaults, + id: event.id, + repo_id: repo_id, + title: event.tagValue('name') || '', + descritpion: event.tagValue('description') || '', + created_at: event.created_at, + comments: 0, + author: { + hexpubkey: event.pubkey, + loading: true, + npub: '', + }, loading: false, - }; - }); - }); + }, + ], + } + }) + + authors_unsubscribers.push( + ensureUser(event.pubkey).subscribe((u: User) => { + pr_summaries.update((prs) => { + return { + ...prs, + summaries: prs.summaries.map((o) => ({ + ...o, + author: u, + })), + } + }) + }) + ) + } + } catch {} + }) + sub.on('eose', () => { + pr_summaries.update((prs) => { + getAndUpdatePRStatus(prs, repo) + return { + ...prs, + loading: false, + } + }) + }) } -let sub_statuses: NDKSubscription; +let sub_statuses: NDKSubscription function getAndUpdatePRStatus(prs: PRSummaries, repo: Repo): void { - if (sub_statuses) sub_statuses.stop(); - sub_statuses = ndk.subscribe( - { - kinds: [pr_status_kind], - "#e": prs.summaries.map(pr => pr.id), - '#r': [`r-${prs.id}`], - }, - { - closeOnEose: false, - }, - NDKRelaySet.fromRelayUrls(repo.relays, ndk), - ); - sub_statuses.on("event", (event: NDKEvent) => { - let tagged_pr_event = event.tagValue('e'); - if (event.kind == pr_status_kind - && tagged_pr_event - && event.created_at - && event.getMatchingTags("l").length === 1 - && event.getMatchingTags("l")[0].length > 1 - ) { - let potential_status = event.getMatchingTags("l")[0][1]; - - if (isPRStatus(potential_status)) { - pr_summaries.update(prs => { - return { - ...prs, - summaries: prs.summaries.map(o => { - if ( - o.id === tagged_pr_event - && event.created_at - && o.status_date < event.created_at - ) { - return { - ...o, - status: potential_status as PRStatus, - status_date: event.created_at, - } - } - - return o; - }), - } - }); - } - } - }); - - sub_statuses.on("eose", () => { - pr_summaries.update(prs => { - return { - ...prs, - summaries: prs.summaries.map(o => ({ - ...o, - status: o.status || "Open", - })), - } - }); - }); - -} \ No newline at end of file + if (sub_statuses) sub_statuses.stop() + sub_statuses = ndk.subscribe( + { + kinds: [pr_status_kind], + '#e': prs.summaries.map((pr) => pr.id), + '#r': [`r-${prs.id}`], + }, + { + closeOnEose: false, + }, + NDKRelaySet.fromRelayUrls(repo.relays, ndk) + ) + sub_statuses.on('event', (event: NDKEvent) => { + const tagged_pr_event = event.tagValue('e') + if ( + event.kind == pr_status_kind && + tagged_pr_event && + event.created_at && + event.getMatchingTags('l').length === 1 && + event.getMatchingTags('l')[0].length > 1 + ) { + const potential_status = event.getMatchingTags('l')[0][1] + + if (isPRStatus(potential_status)) { + pr_summaries.update((prs) => { + return { + ...prs, + summaries: prs.summaries.map((o) => { + if ( + o.id === tagged_pr_event && + event.created_at && + o.status_date < event.created_at + ) { + return { + ...o, + status: potential_status as PRStatus, + status_date: event.created_at, + } + } + + return o + }), + } + }) + } + } + }) + + sub_statuses.on('eose', () => { + pr_summaries.update((prs) => { + return { + ...prs, + summaries: prs.summaries.map((o) => ({ + ...o, + status: o.status || 'Open', + })), + } + }) + }) +} diff --git a/src/lib/stores/ndk.ts b/src/lib/stores/ndk.ts index 37779bb..1860e49 100644 --- a/src/lib/stores/ndk.ts +++ b/src/lib/stores/ndk.ts @@ -1,24 +1,31 @@ -import NDKSvelte from '@nostr-dev-kit/ndk-svelte'; +import NDKSvelte from '@nostr-dev-kit/ndk-svelte' -export let base_relays = import.meta.env.DEV - ? [ - "ws://localhost:8080", - ] - : [ - "wss://relayable.org", - "wss://relay.f7z.io", - "wss://relay.damus.io", - "wss://nos.lol" - // "wss://nostr.wine/", - // "wss://eden.nostr.land/", - // "wss://relay.nostr.band/", +// export let base_relays = import.meta.env.DEV +// ? ["ws://localhost:8080"] +// : [ +// "wss://relayable.org", +// "wss://relay.f7z.io", +// "wss://relay.damus.io", +// "wss://nos.lol", +// "wss://nostr.wine/", +// "wss://eden.nostr.land/", +// "wss://relay.nostr.band/", +// ]; - ]; +export const base_relays = [ + 'wss://relayable.org', + 'wss://relay.f7z.io', + 'wss://relay.damus.io', + 'wss://nos.lol', + 'wss://nostr.wine/', + 'wss://eden.nostr.land/', + 'wss://relay.nostr.band/', +] // TODO: fallback_relays for if profile cannot be found export const ndk = new NDKSvelte({ - explicitRelayUrls: [...base_relays], -}); + explicitRelayUrls: [...base_relays], +}) -ndk.connect(); +ndk.connect() diff --git a/src/lib/stores/repo.ts b/src/lib/stores/repo.ts index 6236bd4..64e244a 100644 --- a/src/lib/stores/repo.ts +++ b/src/lib/stores/repo.ts @@ -1,103 +1,99 @@ -import { NDKRelaySet, NDKSubscription } from "@nostr-dev-kit/ndk"; -import { writable, type Unsubscriber, type Writable, get } from "svelte/store" -import { base_relays, ndk } from "./ndk"; -import type { Repo } from "$lib/components/repo/type"; -import { defaults } from "$lib/components/repo/type"; -import type { User } from "$lib/components/users/type"; -import { ensureUser, users } from "./users"; -import { repo_kind } from "$lib/kinds"; +import { NDKRelaySet, NDKSubscription } from '@nostr-dev-kit/ndk' +import { writable, type Unsubscriber, type Writable } from 'svelte/store' +import { base_relays, ndk } from './ndk' +import type { Repo } from '$lib/components/repo/type' +import { defaults } from '$lib/components/repo/type' +import type { User } from '$lib/components/users/type' +import { ensureUser } from './users' +import { repo_kind } from '$lib/kinds' -export let selected_repo: Writable = writable({ ...defaults }); -let selected_repo_id: string = ""; +export const selected_repo: Writable = writable({ ...defaults }) +let selected_repo_id: string = '' -let maintainers_unsubscribers: Unsubscriber[] = []; - -let sub: NDKSubscription; -export let ensureSelectedRepo = async (repo_id: string): Promise => { - if (selected_repo_id == repo_id) { - return new Promise(r => { - let unsubscriber = selected_repo.subscribe(repo => { - if (repo.repo_id === repo_id && !repo.loading) { - setTimeout(() => { - unsubscriber(); - }, 5); - r({ ...repo }); - } - }); - - }) - } - selected_repo_id = repo_id; - - if (sub) sub.stop(); - sub = ndk.subscribe( - { - kinds: [repo_kind], - '#d': [repo_id], - limit: 1, - }, - { - closeOnEose: false, - }, - NDKRelaySet.fromRelayUrls(base_relays, ndk), - ); +let maintainers_unsubscribers: Unsubscriber[] = [] +let sub: NDKSubscription +export const ensureSelectedRepo = async (repo_id: string): Promise => { + if (selected_repo_id == repo_id) { return new Promise((r) => { - sub.on("event", (event) => { - try { - if (event.kind == repo_kind && event.tagValue("d") == repo_id) { - selected_repo.set({ - loading: false, - repo_id: event.replaceableDTag(), - name: event.tagValue("name") || "", - description: event.tagValue("description") || "", - git_server: event.tagValue("git-server") || "", - tags: event.getMatchingTags("t") || [], - maintainers: event.getMatchingTags("p").map( - (t: string[]) => - ({ - hexpubkey: t[1], - loading: true, - npub: "", - }) as User, - ), - relays: event - .getMatchingTags("relay") - .map((t: string[]) => t[1]), - }); - let old_unsubscribers = maintainers_unsubscribers; - maintainers_unsubscribers = event - .getMatchingTags("p") - .map((t: string[]) => { - return ensureUser(t[1]).subscribe((u: User) => { - selected_repo.update((repo) => { - return { - ...repo, - maintainers: repo.maintainers.map((m) => { - if (m.hexpubkey == u.hexpubkey) return { ...u }; - else return { ...m }; - }), - }; - }); - }) - }); - old_unsubscribers.forEach((unsubscriber) => unsubscriber()); - } - } catch { } - }); + const unsubscriber = selected_repo.subscribe((repo) => { + if (repo.repo_id === repo_id && !repo.loading) { + setTimeout(() => { + unsubscriber() + }, 5) + r({ ...repo }) + } + }) + }) + } + selected_repo_id = repo_id - sub.on("eose", () => { - selected_repo.update((repo) => { - r({ - ...repo, - loading: false, - }); - return { + if (sub) sub.stop() + sub = ndk.subscribe( + { + kinds: [repo_kind], + '#d': [repo_id], + limit: 1, + }, + { + closeOnEose: false, + }, + NDKRelaySet.fromRelayUrls(base_relays, ndk) + ) + + return new Promise((r) => { + sub.on('event', (event) => { + try { + if (event.kind == repo_kind && event.tagValue('d') == repo_id) { + selected_repo.set({ + loading: false, + repo_id: event.replaceableDTag(), + name: event.tagValue('name') || '', + description: event.tagValue('description') || '', + git_server: event.tagValue('git-server') || '', + tags: event.getMatchingTags('t') || [], + maintainers: event.getMatchingTags('p').map( + (t: string[]) => + ({ + hexpubkey: t[1], + loading: true, + npub: '', + }) as User + ), + relays: event.getMatchingTags('relay').map((t: string[]) => t[1]), + }) + const old_unsubscribers = maintainers_unsubscribers + maintainers_unsubscribers = event + .getMatchingTags('p') + .map((t: string[]) => { + return ensureUser(t[1]).subscribe((u: User) => { + selected_repo.update((repo) => { + return { ...repo, - loading: false, - } + maintainers: repo.maintainers.map((m) => { + if (m.hexpubkey == u.hexpubkey) return { ...u } + else return { ...m } + }), + } + }) + }) }) - }); - }); + old_unsubscribers.forEach((unsubscriber) => unsubscriber()) + } + } catch {} + }) + sub.on('eose', () => { + selected_repo.update((repo) => { + r({ + ...repo, + loading: false, + }) + return { + ...repo, + loading: false, + } + }) + }) + }) } diff --git a/src/lib/stores/users.ts b/src/lib/stores/users.ts index 8d0e0b6..2e9f999 100644 --- a/src/lib/stores/users.ts +++ b/src/lib/stores/users.ts @@ -1,137 +1,137 @@ -import { defaults as user_defaults, type User } from "$lib/components/users/type"; -import { NDKNip07Signer, NDKRelayList } from "@nostr-dev-kit/ndk"; -import { get, writable, type Unsubscriber, type Writable } from "svelte/store" -import { ndk } from "./ndk"; +import { + defaults as user_defaults, + type User, +} from '$lib/components/users/type' +import { NDKNip07Signer, NDKRelayList } from '@nostr-dev-kit/ndk' +import { get, writable, type Unsubscriber, type Writable } from 'svelte/store' +import { ndk } from './ndk' -export let users: { [hexpubkey: string]: Writable; } = {}; +export const users: { [hexpubkey: string]: Writable } = {} -export let ensureUser = (hexpubkey: string): Writable => { - if (!users[hexpubkey]) { - let u = ndk.getUser({ hexpubkey }); +export const ensureUser = (hexpubkey: string): Writable => { + if (!users[hexpubkey]) { + const u = ndk.getUser({ hexpubkey }) - let base: User = { - loading: false, - hexpubkey, - npub: u.npub, - }; - - users[hexpubkey] = writable(base); - getUserRelays(hexpubkey); - u.fetchProfile().then( - (p) => { - users[hexpubkey].update((u) => ({ - ...u, - loading: false, - profile: p === null ? undefined : p, - })); - }, - () => { - users[hexpubkey].update((u) => ({ - ...u, - loading: false, - })); - } - ); + const base: User = { + loading: false, + hexpubkey, + npub: u.npub, } - return users[hexpubkey]; + + users[hexpubkey] = writable(base) + getUserRelays(hexpubkey) + u.fetchProfile().then( + (p) => { + users[hexpubkey].update((u) => ({ + ...u, + loading: false, + profile: p === null ? undefined : p, + })) + }, + () => { + users[hexpubkey].update((u) => ({ + ...u, + loading: false, + })) + } + ) + } + return users[hexpubkey] } -export let returnUser = async (hexpubkey: string): Promise => { - return new Promise((r) => { - let unsubscriber = ensureUser(hexpubkey).subscribe((u) => { - if (!u.loading) { - unsubscriber(); - r(u); - } - }); - }); +export const returnUser = async (hexpubkey: string): Promise => { + return new Promise((r) => { + const unsubscriber = ensureUser(hexpubkey).subscribe((u) => { + if (!u.loading) { + unsubscriber() + r(u) + } + }) + }) } // nip07_plugin is set in Navbar component -export let nip07_plugin: Writable = writable(undefined); - -export let checkForNip07Plugin = () => { - if (window.nostr) { - nip07_plugin.set(true); - } else { - let timerId: NodeJS.Timeout; - const intervalId = setInterval(() => { - if (window.nostr) { - clearTimeout(timerId); - clearInterval(intervalId); - nip07_plugin.set(true); - } - }, 100); - timerId = setTimeout(() => { - clearInterval(intervalId); - nip07_plugin.set(false); - }, 5000); - } +export const nip07_plugin: Writable = writable(undefined) -}; +export const checkForNip07Plugin = () => { + if (window.nostr) { + nip07_plugin.set(true) + } else { + let timerId: NodeJS.Timeout | undefined = undefined + const intervalId = setInterval(() => { + if (window.nostr) { + clearTimeout(timerId) + clearInterval(intervalId) + nip07_plugin.set(true) + } + }, 100) + timerId = setTimeout(() => { + clearInterval(intervalId) + nip07_plugin.set(false) + }, 5000) + } +} -let signer = new NDKNip07Signer(2000); +const signer = new NDKNip07Signer(2000) -export let logged_in_user: Writable = writable(undefined); +export const logged_in_user: Writable = writable(undefined) -export let login = async (): Promise => { - return new Promise(async (res, rej) => { - let user = get(logged_in_user); - if (user) return res(); - if (get(nip07_plugin)) { - try { - let ndk_user = await signer.blockUntilReady(); - logged_in_user.set({ - ...user_defaults, - hexpubkey: ndk_user.pubkey, - }); - ndk.signer = signer; - ensureUser(ndk_user.pubkey).subscribe(user => { - logged_in_user.set({ ...user }); - }); - return res(); - } - catch (e) { - alert(e); - rej(); - } - } - else { - rej(); - } - }); -}; +export const login = async (): Promise => { + return new Promise(async (res, rej) => { + const user = get(logged_in_user) + if (user) return res() + if (get(nip07_plugin)) { + try { + const ndk_user = await signer.blockUntilReady() + logged_in_user.set({ + ...user_defaults, + hexpubkey: ndk_user.pubkey, + }) + ndk.signer = signer + ensureUser(ndk_user.pubkey).subscribe((user) => { + logged_in_user.set({ ...user }) + }) + return res() + } catch (e) { + alert(e) + rej() + } + } else { + rej() + } + }) +} interface UserRelays { - loading: boolean; - ndk_relays: NDKRelayList | undefined; + loading: boolean + ndk_relays: NDKRelayList | undefined } -export let user_relays: { [hexpubkey: string]: Writable; } = {}; +export const user_relays: { [hexpubkey: string]: Writable } = {} -export let getUserRelays = async (hexpubkey: string): Promise => { - return new Promise(async (res, rej) => { - if (user_relays[hexpubkey]) { - let unsubscriber: Unsubscriber; - unsubscriber = user_relays[hexpubkey].subscribe(querying_user_relays => { - if (querying_user_relays && !querying_user_relays.loading) { - res(querying_user_relays); - if (unsubscriber) unsubscriber(); - } - }); - } - else { - user_relays[hexpubkey] = writable({ - loading: true, - ndk_relays: undefined, - }); - let relay_list = await ndk.getUser({ hexpubkey }).relayList(); - let querying_user_relays = { - loading: false, - ndk_relays: relay_list, - }; - user_relays[hexpubkey].set({ ...querying_user_relays }); - res(querying_user_relays); +export const getUserRelays = async (hexpubkey: string): Promise => { + return new Promise(async (res, _) => { + if (user_relays[hexpubkey]) { + const unsubscriber: Unsubscriber = user_relays[hexpubkey].subscribe( + (querying_user_relays) => { + if (querying_user_relays && !querying_user_relays.loading) { + res(querying_user_relays) + if (unsubscriber) unsubscriber() + } } - }); -}; + ) + } else { + user_relays[hexpubkey] = writable({ + loading: true, + ndk_relays: undefined, + }) + const relay_list = await ndk.getUser({ hexpubkey }).relayList() + const querying_user_relays = { + loading: false, + ndk_relays: relay_list, + } + user_relays[hexpubkey].set({ ...querying_user_relays }) + res(querying_user_relays) + } + }) +} diff --git a/src/lib/wrappers/Compose.svelte b/src/lib/wrappers/Compose.svelte index fc6dde7..aef410f 100644 --- a/src/lib/wrappers/Compose.svelte +++ b/src/lib/wrappers/Compose.svelte @@ -1,76 +1,74 @@ {#if edit_mode} - + {/if} {#if submitted} -
    sent!
    +
    sent!
    {/if} diff --git a/src/lib/wrappers/EventCard.svelte b/src/lib/wrappers/EventCard.svelte index f105dcb..a79e89d 100644 --- a/src/lib/wrappers/EventCard.svelte +++ b/src/lib/wrappers/EventCard.svelte @@ -1,37 +1,36 @@ - {#if event.kind == patch_kind} - - {:else if event.kind === pr_status_kind} - - {:else} - - {/if} + {#if event.kind == patch_kind} + + {:else if event.kind === pr_status_kind} + + {:else} + + {/if} diff --git a/src/lib/wrappers/Navbar.svelte b/src/lib/wrappers/Navbar.svelte index 0b52b70..4b63bc7 100644 --- a/src/lib/wrappers/Navbar.svelte +++ b/src/lib/wrappers/Navbar.svelte @@ -1,25 +1,23 @@ diff --git a/src/lib/wrappers/OpenPRs.svelte b/src/lib/wrappers/OpenPRs.svelte index ed6101d..bc0c79e 100644 --- a/src/lib/wrappers/OpenPRs.svelte +++ b/src/lib/wrappers/OpenPRs.svelte @@ -1,14 +1,14 @@ diff --git a/src/lib/wrappers/RepoDetails.svelte b/src/lib/wrappers/RepoDetails.svelte index f6decc0..0a6f3cf 100644 --- a/src/lib/wrappers/RepoDetails.svelte +++ b/src/lib/wrappers/RepoDetails.svelte @@ -1,10 +1,10 @@ diff --git a/src/lib/wrappers/ReposRecent.svelte b/src/lib/wrappers/ReposRecent.svelte index a78709d..1e4bea8 100644 --- a/src/lib/wrappers/ReposRecent.svelte +++ b/src/lib/wrappers/ReposRecent.svelte @@ -1,55 +1,55 @@ diff --git a/src/lib/wrappers/Thread.svelte b/src/lib/wrappers/Thread.svelte index 8e8aa2e..bfea93e 100644 --- a/src/lib/wrappers/Thread.svelte +++ b/src/lib/wrappers/Thread.svelte @@ -1,32 +1,28 @@ - {#each $replies_store as event} - - {/each} + {#each $replies_store as event} + + {/each} diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 4c6223e..0f02bea 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,6 +1,6 @@ diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index fc8d9df..a841100 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,11 +1,11 @@
    -
    +
    @@ -30,12 +30,12 @@ >workshop.dev -

    +

    permissionless alternative to GitHub over nostr

    -
    +

    @@ -46,7 +46,7 @@ a command-line tool to create, list and apply PRs and patches -
    +
    @@ -61,7 +61,7 @@ diff --git a/src/routes/ngit/+page.svelte b/src/routes/ngit/+page.svelte index 15a683d..ba037bb 100644 --- a/src/routes/ngit/+page.svelte +++ b/src/routes/ngit/+page.svelte @@ -1,87 +1,84 @@ -
    -

    ngit

    -

    - a command-line tool to create, list and apply PRs and patches to git - repositories via nostr events. -

    - It is designed to work seemlessly with this site gitworkshop.dev. +
    +

    ngit

    +

    + a command-line tool to create, list and apply PRs and patches to git + repositories via nostr events. +

    + It is designed to work seemlessly with this site gitworkshop.dev. -

    Install

    -

    - If you have cargo installed runcargo install ngit. - Alternatively download: -

    - Linux - Mac - Windows - v.0.1.1 -

    add the binary to a directory from which it can be run globally.

    -

    Commands

    -

    - All commands should be run from the directory of the git repository -

    -

    - ngit prs create - use this when you are on a feature branch to propose it gets merged into - the remote branch by repository maintainer. -

    -

    - It creates a PR event and patch events for each commit that isn't - also in the main or master branch. -

    -

    - ngit prs list - fetches a selectable list of open PRs and, if one is selected and the - repository is clean, will create a branch for it and apply the commits. - If the branch already exists it will pull any updates. -

    -

    - ngit pull - if the repository is currently in a branch related to an existing PR, - it will pull any updates from nostr. -

    -

    - ngit push - if the repository is currently in a branch related to an existing PR, - it will create patch events for any new commits. -

    -

    - ngit claim - issue a repository nostr event which lists it on gitworkshop.dev and - indicates you are accepting patches and PRs via nostr. This can be run - many times to update the details. The relays will reflect your user relays - plus blaster. -

    -

    - It also creates an optional maintainers.yaml file in the root of your repo that lists maintainers and relays. If - commited it will make it smoother for contributors to find your repository - event and also makes any future transfer of repository ownership easier. -

    -
    +

    Install

    +

    + If you have cargo installed runcargo install ngit. + Alternatively download: +

    + Linux + Mac + Windows + v.0.1.1 +

    add the binary to a directory from which it can be run globally.

    +

    Commands

    +

    All commands should be run from the directory of the git repository

    +

    + ngit prs create + use this when you are on a feature branch to propose it gets merged into the + remote branch by repository maintainer. +

    +

    + It creates a PR event and patch events for each commit that isn't also in + the main or master branch. +

    +

    + ngit prs list + fetches a selectable list of open PRs and, if one is selected and the repository + is clean, will create a branch for it and apply the commits. If the branch + already exists it will pull any updates. +

    +

    + ngit pull + if the repository is currently in a branch related to an existing PR, it will + pull any updates from nostr. +

    +

    + ngit push + if the repository is currently in a branch related to an existing PR, it will + create patch events for any new commits. +

    +

    + ngit claim + issue a repository nostr event which lists it on gitworkshop.dev and indicates + you are accepting patches and PRs via nostr. This can be run many times to + update the details. The relays will reflect your user relays plus blaster. +

    +

    + It also creates an optional maintainers.yaml file in the root of your repo that lists maintainers and relays. If commited + it will make it smoother for contributors to find your repository event and + also makes any future transfer of repository ownership easier. +

    +
    diff --git a/src/routes/repo/[repo_id]/+page.svelte b/src/routes/repo/[repo_id]/+page.svelte index c039ae7..3172994 100644 --- a/src/routes/repo/[repo_id]/+page.svelte +++ b/src/routes/repo/[repo_id]/+page.svelte @@ -1,51 +1,50 @@ {#if repo_error} - - - + + + {:else} - + - -
    -
    - -
    - -
    -
    + +
    +
    + +
    + +
    +
    {/if} diff --git a/src/routes/repo/[repo_id]/+page.ts b/src/routes/repo/[repo_id]/+page.ts index d370133..6afa119 100644 --- a/src/routes/repo/[repo_id]/+page.ts +++ b/src/routes/repo/[repo_id]/+page.ts @@ -1,5 +1,5 @@ export const load = ({ params }) => { - return { - repo_id: params.repo_id, - } + return { + repo_id: params.repo_id, + } } 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 10c8ddd..57d57f5 100644 --- a/src/routes/repo/[repo_id]/pr/[pr_id]/+page.svelte +++ b/src/routes/repo/[repo_id]/pr/[pr_id]/+page.svelte @@ -1,121 +1,107 @@ {#if !repo_error} - + {/if} {#if pr_error} - - - + + + {:else} - - -
    -
    -
    - -
    - - {#each $selected_pr_replies as event} - - {/each} -
    - -
    -
    - + + +
    +
    +
    + +
    + + {#each $selected_pr_replies as event} + + {/each} +
    +
    - +
    + +
    +
    {/if} diff --git a/src/routes/repo/[repo_id]/pr/[pr_id]/+page.ts b/src/routes/repo/[repo_id]/pr/[pr_id]/+page.ts index 8d224e0..418d202 100644 --- a/src/routes/repo/[repo_id]/pr/[pr_id]/+page.ts +++ b/src/routes/repo/[repo_id]/pr/[pr_id]/+page.ts @@ -1,6 +1,6 @@ export const load = ({ params }) => { - return { - repo_id: params.repo_id, - pr_id: params.pr_id, - } + return { + repo_id: params.repo_id, + pr_id: params.pr_id, + } } diff --git a/tsconfig.json b/tsconfig.json index 0f47472..fd4595a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,13 +1,13 @@ { - "extends": "./.svelte-kit/tsconfig.json", - "compilerOptions": { - "allowJs": true, - "checkJs": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true, - "skipLibCheck": true, - "sourceMap": true, - "strict": true - } + "extends": "./.svelte-kit/tsconfig.json", + "compilerOptions": { + "allowJs": true, + "checkJs": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "sourceMap": true, + "strict": true, + }, } diff --git a/yarn.lock b/yarn.lock index 313d6d3..019d874 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1277,6 +1277,18 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz#786c5f41f043b07afb1af37683d7c33668858f6d" integrity sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ== +"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" + integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== + dependencies: + eslint-visitor-keys "^3.3.0" + +"@eslint-community/regexpp@^4.5.1": + version "4.10.0" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63" + integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA== + "@eslint/eslintrc@^1.0.5": version "1.4.1" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.4.1.tgz#af58772019a2d271b7e2d4c23ff4ddcba3ccfb3e" @@ -1737,6 +1749,11 @@ resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== +"@pkgr/core@^0.1.0": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.1.1.tgz#1ec17e2edbec25c8306d424ecfbf13c7de1aaa31" + integrity sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA== + "@polka/url@^1.0.0-next.20": version "1.0.0-next.24" resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.24.tgz#58601079e11784d20f82d0585865bb42305c4df3" @@ -3255,6 +3272,11 @@ expect "^29.0.0" pretty-format "^29.0.0" +"@types/json-schema@^7.0.12": + version "7.0.15" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== + "@types/lodash@^4.14.167": version "4.14.202" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.202.tgz#f09dbd2fb082d507178b2f2a5c7e74bd72ff98f8" @@ -3372,7 +3394,7 @@ resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.8.tgz#ce5ace04cfeabe7ef87c0091e50752e36707deff" integrity sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A== -"@types/semver@^7.3.4": +"@types/semver@^7.3.4", "@types/semver@^7.5.0": version "7.5.6" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.6.tgz#c65b2bfce1bec346582c07724e3f8c1017a20339" integrity sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A== @@ -3440,6 +3462,92 @@ dependencies: "@types/yargs-parser" "*" +"@typescript-eslint/eslint-plugin@^6.20.0": + version "6.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.20.0.tgz#9cf31546d2d5e884602626d89b0e0d2168ac25ed" + integrity sha512-fTwGQUnjhoYHeSF6m5pWNkzmDDdsKELYrOBxhjMrofPqCkoC2k3B2wvGHFxa1CTIqkEn88nlW1HVMztjo2K8Hg== + dependencies: + "@eslint-community/regexpp" "^4.5.1" + "@typescript-eslint/scope-manager" "6.20.0" + "@typescript-eslint/type-utils" "6.20.0" + "@typescript-eslint/utils" "6.20.0" + "@typescript-eslint/visitor-keys" "6.20.0" + debug "^4.3.4" + graphemer "^1.4.0" + ignore "^5.2.4" + natural-compare "^1.4.0" + semver "^7.5.4" + ts-api-utils "^1.0.1" + +"@typescript-eslint/parser@^6.20.0": + version "6.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.20.0.tgz#17e314177304bdf498527e3c4b112e41287b7416" + integrity sha512-bYerPDF/H5v6V76MdMYhjwmwgMA+jlPVqjSDq2cRqMi8bP5sR3Z+RLOiOMad3nsnmDVmn2gAFCyNgh/dIrfP/w== + dependencies: + "@typescript-eslint/scope-manager" "6.20.0" + "@typescript-eslint/types" "6.20.0" + "@typescript-eslint/typescript-estree" "6.20.0" + "@typescript-eslint/visitor-keys" "6.20.0" + debug "^4.3.4" + +"@typescript-eslint/scope-manager@6.20.0": + version "6.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.20.0.tgz#8a926e60f6c47feb5bab878246dc2ae465730151" + integrity sha512-p4rvHQRDTI1tGGMDFQm+GtxP1ZHyAh64WANVoyEcNMpaTFn3ox/3CcgtIlELnRfKzSs/DwYlDccJEtr3O6qBvA== + dependencies: + "@typescript-eslint/types" "6.20.0" + "@typescript-eslint/visitor-keys" "6.20.0" + +"@typescript-eslint/type-utils@6.20.0": + version "6.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.20.0.tgz#d395475cd0f3610dd80c7d8716fa0db767da3831" + integrity sha512-qnSobiJQb1F5JjN0YDRPHruQTrX7ICsmltXhkV536mp4idGAYrIyr47zF/JmkJtEcAVnIz4gUYJ7gOZa6SmN4g== + dependencies: + "@typescript-eslint/typescript-estree" "6.20.0" + "@typescript-eslint/utils" "6.20.0" + debug "^4.3.4" + ts-api-utils "^1.0.1" + +"@typescript-eslint/types@6.20.0": + version "6.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.20.0.tgz#5ccd74c29011ae7714ae6973e4ec0c634708b448" + integrity sha512-MM9mfZMAhiN4cOEcUOEx+0HmuaW3WBfukBZPCfwSqFnQy0grXYtngKCqpQN339X3RrwtzspWJrpbrupKYUSBXQ== + +"@typescript-eslint/typescript-estree@6.20.0": + version "6.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.20.0.tgz#5b2d0975949e6bdd8d45ee1471461ef5fadc5542" + integrity sha512-RnRya9q5m6YYSpBN7IzKu9FmLcYtErkDkc8/dKv81I9QiLLtVBHrjz+Ev/crAqgMNW2FCsoZF4g2QUylMnJz+g== + dependencies: + "@typescript-eslint/types" "6.20.0" + "@typescript-eslint/visitor-keys" "6.20.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + minimatch "9.0.3" + semver "^7.5.4" + ts-api-utils "^1.0.1" + +"@typescript-eslint/utils@6.20.0": + version "6.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.20.0.tgz#0e52afcfaa51af5656490ba4b7437cc3aa28633d" + integrity sha512-/EKuw+kRu2vAqCoDwDCBtDRU6CTKbUmwwI7SH7AashZ+W+7o8eiyy6V2cdOqN49KsTcASWsC5QeghYuRDTyOOg== + dependencies: + "@eslint-community/eslint-utils" "^4.4.0" + "@types/json-schema" "^7.0.12" + "@types/semver" "^7.5.0" + "@typescript-eslint/scope-manager" "6.20.0" + "@typescript-eslint/types" "6.20.0" + "@typescript-eslint/typescript-estree" "6.20.0" + semver "^7.5.4" + +"@typescript-eslint/visitor-keys@6.20.0": + version "6.20.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.20.0.tgz#f7ada27f2803de89df0edd9fd7be22c05ce6a498" + integrity sha512-E8Cp98kRe4gKHjJD4NExXKz/zOJ1A2hhZc+IMVD6i7w4yjIvh6VyuRI0gRtxAsXtoC35uGMaQ9rjI2zJaXDEAw== + dependencies: + "@typescript-eslint/types" "6.20.0" + eslint-visitor-keys "^3.4.1" + "@ungap/structured-clone@^1.0.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" @@ -5017,7 +5125,43 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-scope@^7.1.0: +eslint-compat-utils@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/eslint-compat-utils/-/eslint-compat-utils-0.1.2.tgz#f45e3b5ced4c746c127cf724fb074cd4e730d653" + integrity sha512-Jia4JDldWnFNIru1Ehx1H5s9/yxiRHY/TimCuUc0jNexew3cF1gI6CYZil1ociakfWO3rRqFjl1mskBblB3RYg== + +eslint-config-prettier@^9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz#31af3d94578645966c082fcb71a5846d3c94867f" + integrity sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw== + +eslint-plugin-prettier@^5.1.3: + version "5.1.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz#17cfade9e732cef32b5f5be53bd4e07afd8e67e1" + integrity sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw== + dependencies: + prettier-linter-helpers "^1.0.0" + synckit "^0.8.6" + +eslint-plugin-svelte@^2.35.1: + version "2.35.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-svelte/-/eslint-plugin-svelte-2.35.1.tgz#7b1e3c263b09dbc9293c25fe02d03d309725d2b9" + integrity sha512-IF8TpLnROSGy98Z3NrsKXWDSCbNY2ReHDcrYTuXZMbfX7VmESISR78TWgO9zdg4Dht1X8coub5jKwHzP0ExRug== + dependencies: + "@eslint-community/eslint-utils" "^4.2.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + debug "^4.3.1" + eslint-compat-utils "^0.1.2" + esutils "^2.0.3" + known-css-properties "^0.29.0" + postcss "^8.4.5" + postcss-load-config "^3.1.4" + postcss-safe-parser "^6.0.0" + postcss-selector-parser "^6.0.11" + semver "^7.5.3" + svelte-eslint-parser ">=0.33.0 <1.0.0" + +eslint-scope@^7.0.0, eslint-scope@^7.1.0: version "7.2.2" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== @@ -5037,7 +5181,7 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint-visitor-keys@^3.1.0, eslint-visitor-keys@^3.4.1: +eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.1.0, eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: version "3.4.3" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== @@ -5100,7 +5244,7 @@ espree@9.2.0: acorn-jsx "^5.3.1" eslint-visitor-keys "^3.1.0" -espree@^9.2.0, espree@^9.4.0: +espree@^9.0.0, espree@^9.2.0, espree@^9.4.0: version "9.6.1" resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== @@ -5145,7 +5289,7 @@ estree-walker@^3.0.0, estree-walker@^3.0.3: dependencies: "@types/estree" "^1.0.0" -esutils@^2.0.2: +esutils@^2.0.2, esutils@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== @@ -5272,6 +5416,11 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== +fast-diff@^1.1.2: + version "1.3.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0" + integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== + fast-glob@^3.2.7, fast-glob@^3.2.9, fast-glob@^3.3.0: version "3.3.2" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" @@ -5760,7 +5909,7 @@ globalyzer@0.1.0: resolved "https://registry.yarnpkg.com/globalyzer/-/globalyzer-0.1.0.tgz#cb76da79555669a1519d5a8edf093afaa0bf1465" integrity sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q== -globby@^11.0.1, globby@^11.0.2: +globby@^11.0.1, globby@^11.0.2, globby@^11.1.0: version "11.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== @@ -5794,6 +5943,11 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.3 resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== +graphemer@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" + integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== + gunzip-maybe@^1.4.2: version "1.4.2" resolved "https://registry.yarnpkg.com/gunzip-maybe/-/gunzip-maybe-1.4.2.tgz#b913564ae3be0eda6f3de36464837a9cd94b98ac" @@ -6043,6 +6197,11 @@ ignore@^5.2.0: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.0.tgz#67418ae40d34d6999c95ff56016759c718c82f78" integrity sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg== +ignore@^5.2.4: + version "5.3.1" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef" + integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw== + import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" @@ -7091,6 +7250,11 @@ kleur@^4.1.5: resolved "https://registry.yarnpkg.com/kleur/-/kleur-4.1.5.tgz#95106101795f7050c6c650f350c683febddb1780" integrity sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ== +known-css-properties@^0.29.0: + version "0.29.0" + resolved "https://registry.yarnpkg.com/known-css-properties/-/known-css-properties-0.29.0.tgz#e8ba024fb03886f23cb882e806929f32d814158f" + integrity sha512-Ne7wqW7/9Cz54PDt4I3tcV+hAyat8ypyOGzYRJQfdxnnjeWsTxt1cy8pjvvKeI5kfXuyvULyeeAvwvvtAX3ayQ== + lazy-universal-dotenv@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/lazy-universal-dotenv/-/lazy-universal-dotenv-4.0.0.tgz#0b220c264e89a042a37181a4928cdd298af73422" @@ -7120,7 +7284,7 @@ light-bolt11-decoder@^3.0.0: dependencies: "@scure/base" "1.1.1" -lilconfig@^2.1.0: +lilconfig@^2.0.5, lilconfig@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52" integrity sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ== @@ -7395,6 +7559,13 @@ min-indent@^1.0.0: resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== +minimatch@9.0.3, minimatch@^9.0.1: + version "9.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" + integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== + dependencies: + brace-expansion "^2.0.1" + minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -7409,13 +7580,6 @@ minimatch@^5.0.1: dependencies: brace-expansion "^2.0.1" -minimatch@^9.0.1: - version "9.0.3" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" - integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== - dependencies: - brace-expansion "^2.0.1" - minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6, minimist@^1.2.8: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" @@ -8045,6 +8209,14 @@ postcss-js@^4, postcss-js@^4.0.1: dependencies: camelcase-css "^2.0.1" +postcss-load-config@^3.1.4: + version "3.1.4" + resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-3.1.4.tgz#1ab2571faf84bb078877e1d07905eabe9ebda855" + integrity sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg== + dependencies: + lilconfig "^2.0.5" + yaml "^1.10.2" + postcss-load-config@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-4.0.2.tgz#7159dcf626118d33e299f485d6afe4aff7c4a3e3" @@ -8060,6 +8232,16 @@ postcss-nested@^6.0.1: dependencies: postcss-selector-parser "^6.0.11" +postcss-safe-parser@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/postcss-safe-parser/-/postcss-safe-parser-6.0.0.tgz#bb4c29894171a94bc5c996b9a30317ef402adaa1" + integrity sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ== + +postcss-scss@^4.0.8: + version "4.0.9" + resolved "https://registry.yarnpkg.com/postcss-scss/-/postcss-scss-4.0.9.tgz#a03c773cd4c9623cb04ce142a52afcec74806685" + integrity sha512-AjKOeiwAitL/MXxQW2DliT28EKukvvbEWx3LBmJIRN8KfBGZbRTxNYW0kSqi1COiTZ57nZ9NW06S6ux//N1c9A== + postcss-selector-parser@6.0.10: version "6.0.10" resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz#79b61e2c0d1bfc2602d549e11d0876256f8df88d" @@ -8090,16 +8272,47 @@ postcss@^8.3.11, postcss@^8.4.23, postcss@^8.4.27, postcss@^8.4.30: picocolors "^1.0.0" source-map-js "^1.0.2" +postcss@^8.4.29, postcss@^8.4.5: + version "8.4.33" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.33.tgz#1378e859c9f69bf6f638b990a0212f43e2aaa742" + integrity sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg== + dependencies: + nanoid "^3.3.7" + picocolors "^1.0.0" + source-map-js "^1.0.2" + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + +prettier-plugin-svelte@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/prettier-plugin-svelte/-/prettier-plugin-svelte-3.1.2.tgz#2e050eb56dbb467a42c45ad6ce18bb277d28ffa0" + integrity sha512-7xfMZtwgAWHMT0iZc8jN4o65zgbAQ3+O32V6W7pXrqNvKnHnkoyQCGCbKeUyXKZLbYE0YhFRnamfxfkEGxm8qA== + +prettier-plugin-tailwindcss@^0.5.11: + version "0.5.11" + resolved "https://registry.yarnpkg.com/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.5.11.tgz#1aa9308c3285b3cb7942aaeaec8d0e0775ac54d0" + integrity sha512-AvI/DNyMctyyxGOjyePgi/gqj5hJYClZ1avtQvLlqMT3uDZkRbi4HhGUpok3DRzv9z7Lti85Kdj3s3/1CeNI0w== + prettier@^2.8.0: version "2.8.8" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== +prettier@^3.2.4: + version "3.2.4" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.4.tgz#4723cadeac2ce7c9227de758e5ff9b14e075f283" + integrity sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ== + pretty-format@^27.0.2: version "27.5.1" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" @@ -9079,6 +9292,17 @@ svelte-check@^3.0.1: svelte-preprocess "^5.1.0" typescript "^5.0.3" +"svelte-eslint-parser@>=0.33.0 <1.0.0": + version "0.33.1" + resolved "https://registry.yarnpkg.com/svelte-eslint-parser/-/svelte-eslint-parser-0.33.1.tgz#c64dbed2fad099577429b3c39377f6b8d36e5d97" + integrity sha512-vo7xPGTlKBGdLH8T5L64FipvTrqv3OQRx9d2z5X05KKZDlF4rQk8KViZO4flKERY+5BiVdOh7zZ7JGJWo5P0uA== + dependencies: + eslint-scope "^7.0.0" + eslint-visitor-keys "^3.0.0" + espree "^9.0.0" + postcss "^8.4.29" + postcss-scss "^4.0.8" + svelte-hmr@^0.15.3: version "0.15.3" resolved "https://registry.yarnpkg.com/svelte-hmr/-/svelte-hmr-0.15.3.tgz#df54ccde9be3f091bf5f18fc4ef7b8eb6405fbe6" @@ -9140,6 +9364,14 @@ synchronous-promise@^2.0.15: resolved "https://registry.yarnpkg.com/synchronous-promise/-/synchronous-promise-2.0.17.tgz#38901319632f946c982152586f2caf8ddc25c032" integrity sha512-AsS729u2RHUfEra9xJrE39peJcc2stq2+poBXX8bcM08Y6g9j/i/PUzwNQqkaJde7Ntg1TO7bSREbR5sdosQ+g== +synckit@^0.8.6: + version "0.8.8" + resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.8.8.tgz#fe7fe446518e3d3d49f5e429f443cf08b6edfcd7" + integrity sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ== + dependencies: + "@pkgr/core" "^0.1.0" + tslib "^2.6.2" + tailwindcss@^3.3.3: version "3.3.6" resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.3.6.tgz#4dd7986bf4902ad385d90d45fd4b2fa5fab26d5f" @@ -9327,6 +9559,11 @@ trough@^2.0.0: resolved "https://registry.yarnpkg.com/trough/-/trough-2.1.0.tgz#0f7b511a4fde65a46f18477ab38849b22c554876" integrity sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g== +ts-api-utils@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.0.3.tgz#f12c1c781d04427313dbac808f453f050e54a331" + integrity sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg== + ts-dedent@^2.0.0, ts-dedent@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/ts-dedent/-/ts-dedent-2.2.0.tgz#39e4bd297cd036292ae2394eb3412be63f563bb5" @@ -9347,7 +9584,7 @@ tslib@^1.13.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.0, tslib@^2.0.1, tslib@^2.1.0, tslib@^2.4.0, tslib@^2.4.1: +tslib@^2.0.0, tslib@^2.0.1, tslib@^2.1.0, tslib@^2.4.0, tslib@^2.4.1, tslib@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== @@ -9991,6 +10228,11 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== +yaml@^1.10.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" + integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== + yaml@^2.3.4: version "2.3.4" resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.4.tgz#53fc1d514be80aabf386dc6001eb29bf3b7523b2"