refactor: manually write like 3,000 import statements because i must test my willpower

This commit is contained in:
Xylight committed 2025-09-24 21:19:19 -07:00
1 parent 75f907743e
commit 0479aba095
274 files changed
+1222 -1702

No files matched your search

@@ -1,11 +1,10 @@
<script lang="ts">
import { preventDefault } from 'svelte/legacy'
import UserLink from '$comp/lemmy/user/UserLink.svelte'
import MarkdownEditor from '$lib/app/markdown/MarkdownEditor.svelte'
import { t } from '$lib/app/i18n'
import type { Person } from '$lib/api/types'
import { t } from '$lib/app/i18n'
import MarkdownEditor from '$lib/app/markdown/MarkdownEditor.svelte'
import { Button, Modal } from 'mono-svelte'
import { preventDefault } from 'svelte/legacy'
import UserLink from '../user/UserLink.svelte'
interface Props {
open?: boolean
+7 -7
View File
@@ -1,13 +1,13 @@
<script lang="ts">
import Avatar from '$lib/ui/generic/Avatar.svelte'
import type { Community, Person } from '$lib/api/types'
import { client } from '$lib/api/client.svelte'
import { Label, toast, Button, Modal, Switch } from 'mono-svelte'
import { profile } from '$lib/app/auth.svelte.js'
import MarkdownEditor from '$lib/app/markdown/MarkdownEditor.svelte'
import type { Community, Person } from '$lib/api/types'
import { profile } from '$lib/app/auth.svelte'
import { errorMessage } from '$lib/app/error'
import { t } from '$lib/app/i18n'
import Duration from '$comp/form/Duration.svelte'
import { errorMessage } from '$lib/lemmy/error'
import MarkdownEditor from '$lib/app/markdown/MarkdownEditor.svelte'
import Duration from '$lib/ui/form/Duration.svelte'
import Avatar from '$lib/ui/generic/Avatar.svelte'
import { Button, Label, Modal, Switch, toast } from 'mono-svelte'
import CommunityLink from '../community/CommunityLink.svelte'
interface Props {
@@ -1,9 +1,7 @@
<script lang="ts">
import { profile } from '$lib/app/auth.svelte.js'
import ShieldIcon from '$comp/lemmy/moderation/ShieldIcon.svelte'
import { t } from '$lib/app/i18n'
import { isCommentView } from '$lib/lemmy/item.js'
import type { CommentView } from '$lib/api/types'
import { profile } from '$lib/app/auth.svelte'
import { t } from '$lib/app/i18n'
import { Button, Menu, MenuButton, MenuDivider } from 'mono-svelte'
import {
ArrowsUpDown,
@@ -13,8 +11,10 @@
Newspaper,
ShieldExclamation,
Trash,
} from 'svelte-hero-icons'
} from 'svelte-hero-icons/dist'
import { isCommentView } from '../legacy/item'
import { amMod, ban, feature, isAdmin, remove, viewVotes } from './moderation'
import ShieldIcon from './ShieldIcon.svelte'
interface Props {
item: CommentView
+5 -5
View File
@@ -1,10 +1,10 @@
<script lang="ts">
import { modals } from '$comp/lemmy/moderation/moderation.js'
import { modals } from './moderation'
</script>
<!--These weird await hacks are for lazy loading, better network performance-->
{#if $modals.reporting.open}
{#await import('$comp/lemmy/moderation/ReportModal.svelte') then { default: ReportModal }}
{#await import('./ReportModal.svelte') then { default: ReportModal }}
<ReportModal
bind:open={$modals.reporting.open}
bind:item={$modals.reporting.item}
@@ -12,7 +12,7 @@
{/await}
{/if}
{#if $modals.removing.open}
{#await import('$comp/lemmy/moderation/RemoveModal.svelte') then { default: RemoveModal }}
{#await import('./RemoveModal.svelte') then { default: RemoveModal }}
<RemoveModal
bind:open={$modals.removing.open}
item={$modals.removing.item}
@@ -21,7 +21,7 @@
{/await}
{/if}
{#if $modals.banning.open}
{#await import('$comp/lemmy/moderation/BanModal.svelte') then { default: BanModal }}
{#await import('./BanModal.svelte') then { default: BanModal }}
<BanModal
bind:open={$modals.banning.open}
banned={$modals.banning.banned}
@@ -32,7 +32,7 @@
{/if}
{#if $modals.votes.open}
{#await import('$comp/lemmy/moderation/ViewVotesModal.svelte') then { default: VotesModal }}
{#await import('./ViewVotesModal.svelte') then { default: VotesModal }}
<VotesModal bind:open={$modals.votes.open} item={$modals.votes.item} />
{/await}
{/if}
@@ -1,10 +1,9 @@
<script lang="ts">
import { profile } from '$lib/app/auth.svelte.js'
import { t } from '$lib/app/i18n'
import { getClient } from '$lib/api/client.svelte'
import { errorMessage } from '$lib/lemmy/error'
import { isCommentView, isPostView } from '$lib/lemmy/item.js'
import type { CommentView, PostView } from '$lib/api/types'
import { profile } from '$lib/app/auth.svelte'
import { errorMessage } from '$lib/app/error'
import { t } from '$lib/app/i18n'
import { Menu, MenuButton, MenuDivider, toast } from 'mono-svelte'
import type { Snippet } from 'svelte'
import {
@@ -17,9 +16,10 @@
Newspaper,
ShieldExclamation,
Trash,
} from 'svelte-hero-icons'
import { amMod, ban, isAdmin, remove, viewVotes } from './moderation'
} from 'svelte-hero-icons/dist'
import type { Attachment } from 'svelte/attachments'
import { isCommentView, isPostView } from '../legacy/item'
import { amMod, ban, isAdmin, remove, viewVotes } from './moderation'
interface Props {
item: PostView | CommentView
+11 -14
View File
@@ -1,23 +1,20 @@
<script lang="ts">
import { preventDefault, run } from 'svelte/legacy'
import MultiSelect from '$comp/input/Switch.svelte'
import { removalTemplate } from '$comp/lemmy/moderation/moderation.js'
import MarkdownEditor from '$lib/app/markdown/MarkdownEditor.svelte'
import { profile } from '$lib/app/auth.svelte.js'
import { getClient } from '$lib/api/client.svelte'
import type { CommentView, PostView } from '$lib/api/types'
import { profile } from '$lib/app/auth.svelte'
import { errorMessage } from '$lib/app/error'
import { t } from '$lib/app/i18n'
import { errorMessage } from '$lib/lemmy/error'
import { isCommentView, isPostView } from '$lib/lemmy/item.js'
import { settings } from '$lib/settings.svelte.js'
import { fullCommunityName } from '$lib/util.svelte.js'
import { Button, Modal, Select, Switch, toast } from 'mono-svelte'
import Option from 'mono-svelte/forms/select/Option.svelte'
import { Fire, Trash } from 'svelte-hero-icons'
import MarkdownEditor from '$lib/app/markdown/MarkdownEditor.svelte'
import { settings } from '$lib/app/settings.svelte'
import { fullCommunityName } from '$lib/app/util.svelte'
import MultiSelect from '$lib/ui/form/Switch.svelte'
import { Button, Modal, Option, Select, Switch, toast } from 'mono-svelte'
import { Fire, Trash } from 'svelte-hero-icons/dist'
import { preventDefault, run } from 'svelte/legacy'
import Comment from '../comment/Comment.svelte'
import { isCommentView, isPostView } from '../legacy/item'
import { Post } from '../post'
import { amMod, isAdmin } from './moderation'
import { amMod, isAdmin, removalTemplate } from './moderation'
interface Props {
open: boolean
@@ -1,20 +1,19 @@
<script lang="ts">
import { preventDefault, run } from 'svelte/legacy'
import { profile } from '$lib/app/auth.svelte.js'
import MarkdownEditor from '$lib/app/markdown/MarkdownEditor.svelte'
import { t } from '$lib/app/i18n'
import { getClient } from '$lib/api/client.svelte'
import type {
CommentView,
PostView,
PrivateMessageView,
} from '$lib/api/types'
import { profile } from '$lib/app/auth.svelte'
import { errorMessage } from '$lib/app/error'
import { t } from '$lib/app/i18n'
import MarkdownEditor from '$lib/app/markdown/MarkdownEditor.svelte'
import { Button, Modal, toast } from 'mono-svelte'
import PrivateMessage from '../inbox/PrivateMessage.svelte'
import { errorMessage } from '$lib/lemmy/error'
import { Post } from '../post'
import { preventDefault, run } from 'svelte/legacy'
import Comment from '../comment/Comment.svelte'
import PrivateMessage from '../inbox/PrivateMessage.svelte'
import { Post } from '../post'
interface Props {
open: boolean
@@ -1,8 +1,7 @@
<script lang="ts">
import { t } from '$lib/app/i18n'
import { client } from '$lib/api/client.svelte'
import { isCommentView, isPostView } from '$lib/lemmy/item'
import type { CommentView, PostView, VoteView } from '$lib/api/types'
import { t } from '$lib/app/i18n'
import { Button, Modal, Spinner } from 'mono-svelte'
import {
ArrowDownCircle,
@@ -11,7 +10,8 @@
ChevronRight,
Icon,
Newspaper,
} from 'svelte-hero-icons'
} from 'svelte-hero-icons/dist'
import { isCommentView, isPostView } from '../legacy/item'
import UserLink from '../user/UserLink.svelte'
interface Props {
+1 -2
View File
@@ -1,6 +1,5 @@
import { client } from '$lib/api/client.svelte'
import type {
Comment,
CommentView,
Community,
MyUserInfo,
@@ -8,8 +7,8 @@ import type {
PostView,
PrivateMessageView,
} from '$lib/api/types'
import type { SubmissionView } from '$lib/lemmy/contentview.js'
import { writable } from 'svelte/store'
import type { SubmissionView } from '../legacy/contentview'
interface Modals {
reporting: {
+3 -3
View File
@@ -1,4 +1,3 @@
import { publishedToDate } from '$comp/util/date.js'
import type {
CommentReportView,
CommentView,
@@ -7,7 +6,8 @@ import type {
PostView,
PrivateMessage,
PrivateMessageReportView,
} from '$lib/client/types'
} from '$lib/api/types'
import { publishedToDate } from '$lib/ui/util/date'
interface CommentReport {
type: 'comment'
@@ -47,7 +47,7 @@ export const generalizeCommentReport = (
creator: report.comment_creator,
banned_from_community: false,
},
reason: report.comment_report.reason,
reason: report.comment_report.reason!,
type: 'comment',
timestamp: publishedToDate(report.comment_report.published),
resolved: report.comment_report.resolved,