Split app/core up into domain-oriented files

This commit is contained in:
Jon Staab
2026-06-08 15:33:38 -07:00
parent ea6b63de53
commit 926b31de78
171 changed files with 2902 additions and 2628 deletions
+16
View File
@@ -0,0 +1,16 @@
import type {TrustedEvent} from "@welshman/util"
import {COMMENT, makeEvent} from "@welshman/util"
import {publishThunk, tagEventForComment} from "@welshman/app"
export type CommentParams = {
event: TrustedEvent
content: string
tags?: string[][]
url?: string
}
export const makeComment = ({url, event, content, tags = []}: CommentParams) =>
makeEvent(COMMENT, {content, tags: [...tags, ...tagEventForComment(event, url)]})
export const publishComment = ({relays, ...params}: CommentParams & {relays: string[]}) =>
publishThunk({event: makeComment({url: relays[0], ...params}), relays})