forked from coracle/flotilla
Migrate to new @welshman/domain + instance-based @welshman/app API
Adopts the rewritten welshman API: the removed @welshman/util helpers (Profile/List/Room/Handler/Encryptable) are now Reader/Builder classes in @welshman/domain, and @welshman/app dropped its global singletons for an App instance + app.use(Plugin) registry. - src/app/welshman.ts is now the app bootstrap + session-state module (one shared App instance, multi-account sessions/login, app-wide reactive views) rather than a compat shim re-exporting the old globals. - Rewrote ~100 callers to use app.use(Plugin) directly (thunks, profiles, relays, rooms, zaps, tags, wot, feeds, sync); thunk helpers are now thunk methods. - Added @welshman/domain dependency. - Resolved residual gaps (storage hydration via plugin.onItem/wrapManager/Plaintext, relay-list mutators, search-relay list, outbox #d filter). Best-effort: no toolchain/linking available, so this is not build- or type-checked. Remaining judgment calls are flagged with TODO(welshman-migration). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BsMjvv7krpZeHK1Njeneru
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
import {onMount} from "svelte"
|
||||
import {setKey, popKey} from "@lib/implicit"
|
||||
import {sleep} from "@welshman/lib"
|
||||
import {displayProfileByPubkey} from "@welshman/app"
|
||||
import type {PublishedRoomMeta} from "@welshman/util"
|
||||
import {Profiles} from "@welshman/app"
|
||||
import {app} from "@app/welshman"
|
||||
import AltArrowLeft from "@assets/icons/alt-arrow-left.svg?dataurl"
|
||||
import Spinner from "@lib/components/Spinner.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
@@ -42,7 +42,11 @@
|
||||
// Show loading for auto submit callback
|
||||
await sleep(500)
|
||||
|
||||
const error = await addRoomMembers(url, $room as PublishedRoomMeta, pubkeys)
|
||||
// TODO(welshman-migration): addRoomMembers now expects a RoomMeta domain
|
||||
// Reader, but deriveRoom yields the plain `Room` object. Passing it through
|
||||
// as `any` preserves prior runtime behavior; verify Rooms.addMember accepts
|
||||
// the plain Room shape (url/h/...) or resolve a real RoomMeta reader here.
|
||||
const error = await addRoomMembers(url, $room as any, pubkeys)
|
||||
|
||||
if (error) {
|
||||
pushToast({theme: "error", message: error})
|
||||
@@ -72,7 +76,7 @@
|
||||
subtitle: "Automatically add members to space",
|
||||
message:
|
||||
nonSpaceMembers.length === 1
|
||||
? `${displayProfileByPubkey(nonSpaceMembers[0])} is not a member of this space. Add them?`
|
||||
? `${app.use(Profiles).display(nonSpaceMembers[0]).get()} is not a member of this space. Add them?`
|
||||
: `${nonSpaceMembers.length} people are not members of this space. Add them?`,
|
||||
confirm: async () => {
|
||||
setKey("RoomMembersAdd.confirm", true)
|
||||
|
||||
Reference in New Issue
Block a user