JavaScript-optional public web frontend for Bluesky anartia.kelinci.net
sveltekit atcute bluesky typescript svelte
7
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor: upgrade atcute dependencies

Mary cb9018b8 186375db

+43 -55
+3 -3
package.json
··· 26 26 "wrangler": "^4.4.0" 27 27 }, 28 28 "dependencies": { 29 - "@atcute/bluesky": "^1.0.14", 29 + "@atcute/bluesky": "^2.0.0", 30 30 "@atcute/bluesky-richtext-parser": "^1.0.7", 31 - "@atcute/bluesky-richtext-segmenter": "^1.0.5", 32 - "@atcute/client": "^2.0.8", 31 + "@atcute/bluesky-richtext-segmenter": "^2.0.0", 32 + "@atcute/client": "^3.0.0", 33 33 "@badrap/valita": "^0.4.3", 34 34 "@mary/array-fns": "npm:@jsr/mary__array-fns@^0.1.4", 35 35 "@mary/date-fns": "npm:@jsr/mary__date-fns@^0.1.3",
+21 -21
pnpm-lock.yaml
··· 9 9 .: 10 10 dependencies: 11 11 '@atcute/bluesky': 12 - specifier: ^1.0.14 13 - version: 1.0.14(@atcute/client@2.0.8) 12 + specifier: ^2.0.0 13 + version: 2.0.0(@atcute/client@3.0.0) 14 14 '@atcute/bluesky-richtext-parser': 15 15 specifier: ^1.0.7 16 16 version: 1.0.7 17 17 '@atcute/bluesky-richtext-segmenter': 18 - specifier: ^1.0.5 19 - version: 1.0.5(@atcute/bluesky@1.0.14(@atcute/client@2.0.8))(@atcute/client@2.0.8) 18 + specifier: ^2.0.0 19 + version: 2.0.0(@atcute/bluesky@2.0.0(@atcute/client@3.0.0))(@atcute/client@3.0.0) 20 20 '@atcute/client': 21 - specifier: ^2.0.8 22 - version: 2.0.8 21 + specifier: ^3.0.0 22 + version: 3.0.0 23 23 '@badrap/valita': 24 24 specifier: ^0.4.3 25 25 version: 0.4.3 ··· 76 76 '@atcute/bluesky-richtext-parser@1.0.7': 77 77 resolution: {integrity: sha512-nOvU699OXiGMbyswao7JJnY0C9WkwE7PVC/m5WWt0UN9fsXSOor9IZWw+v9SATp+94BTJoG38XyUomUaJnoQRA==} 78 78 79 - '@atcute/bluesky-richtext-segmenter@1.0.5': 80 - resolution: {integrity: sha512-D0FfmJVwppky9naL1OGKcQjtgO0lDLhkG4iCQHpShuHhEZ9FUdf3eUb/eQpVRNJGaJ4ShjEOHA6FlAizcjMkGQ==} 79 + '@atcute/bluesky-richtext-segmenter@2.0.0': 80 + resolution: {integrity: sha512-BummI6zgdXSx9f5TJg2oR2ervCJhG8zcbAMDLWjccNLt/0P38lIRsXqOBdIIAZoBtk8g5LpgnnICdiMsDM2iDQ==} 81 81 peerDependencies: 82 - '@atcute/bluesky': ^1.0.0 83 - '@atcute/client': ^1.0.0 || ^2.0.0 82 + '@atcute/bluesky': ^2.0.0 83 + '@atcute/client': ^3.0.0 84 84 85 - '@atcute/bluesky@1.0.14': 86 - resolution: {integrity: sha512-1ZBfvYsC/Tq7bqKSDzBcQRPDFguFodewow8z+MNRjS6DO9tLUWiKjm1DmR6sJfLQ2ktxU57IZPjvsvVfBdwJ6w==} 85 + '@atcute/bluesky@2.0.0': 86 + resolution: {integrity: sha512-G54WP8ribfH7dojidp6LJjNISauZr2AN9VxRi3k5XTLnT3S5l59e8l48psxTTv+GzBnY8u2GIHMlehBXt7X69A==} 87 87 peerDependencies: 88 - '@atcute/client': ^1.0.0 || ^2.0.0 88 + '@atcute/client': ^3.0.0 89 89 90 - '@atcute/client@2.0.8': 91 - resolution: {integrity: sha512-OTfiWwjB4mOTlp2InGStvoQ+PIA5lvih9cTYU8BvOhzNcCBUpt4l860MKZExHjvQ9Tt1kjq/ED9zRiUjsAgIxw==} 90 + '@atcute/client@3.0.0': 91 + resolution: {integrity: sha512-6OsDqqkrqob/fMJ++s5vPc2MknQ6yfTzK+TY3MjXK3ZOkF0XseB5+QV1IiBWnEZ4X3aY21x2a3kv3YcvSQKxXQ==} 92 92 93 93 '@badrap/valita@0.4.3': 94 94 resolution: {integrity: sha512-C9iZSrVlTb610dxZ2oatK5LwefaHv0Q9eYfVDH3co846x7WinhCfc8jCDTE55yM8WxlmOfX2ckKmsSr7KzZ/gg==} ··· 1141 1141 1142 1142 '@atcute/bluesky-richtext-parser@1.0.7': {} 1143 1143 1144 - '@atcute/bluesky-richtext-segmenter@1.0.5(@atcute/bluesky@1.0.14(@atcute/client@2.0.8))(@atcute/client@2.0.8)': 1144 + '@atcute/bluesky-richtext-segmenter@2.0.0(@atcute/bluesky@2.0.0(@atcute/client@3.0.0))(@atcute/client@3.0.0)': 1145 1145 dependencies: 1146 - '@atcute/bluesky': 1.0.14(@atcute/client@2.0.8) 1147 - '@atcute/client': 2.0.8 1146 + '@atcute/bluesky': 2.0.0(@atcute/client@3.0.0) 1147 + '@atcute/client': 3.0.0 1148 1148 1149 - '@atcute/bluesky@1.0.14(@atcute/client@2.0.8)': 1149 + '@atcute/bluesky@2.0.0(@atcute/client@3.0.0)': 1150 1150 dependencies: 1151 - '@atcute/client': 2.0.8 1151 + '@atcute/client': 3.0.0 1152 1152 1153 - '@atcute/client@2.0.8': {} 1153 + '@atcute/client@3.0.0': {} 1154 1154 1155 1155 '@badrap/valita@0.4.3': {} 1156 1156
+2 -2
src/lib/components/embeds/quote-blocked-embed.svelte
··· 3 3 4 4 import { base } from '$app/paths'; 5 5 6 - import type { ParsedAtUri } from '$lib/types/at-uri'; 6 + import type { AddressedAtUri } from '$lib/types/at-uri'; 7 7 8 8 import CircleBanSignOutlined from '$lib/components/central-icons/circle-ban-sign-outlined.svelte'; 9 9 10 10 interface Props { 11 11 embed: Brand.Union<AppBskyEmbedRecord.ViewBlocked | AppBskyEmbedRecord.ViewDetached>; 12 - uri: ParsedAtUri; 12 + uri: AddressedAtUri; 13 13 } 14 14 15 15 const { embed, uri }: Props = $props();
+2 -2
src/lib/constants.ts
··· 1 - import type { AtUri } from './types/at-uri'; 1 + import type { At } from '@atcute/client/lexicons'; 2 2 3 3 // Popular feeds that requires authentication to view 4 - export const AUTHENTICATED_FEEDS: AtUri[] = [ 4 + export const AUTHENTICATED_FEEDS: At.CanonicalResourceUri[] = [ 5 5 // "Popular With Friends" by @bsky.app 6 6 `at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/with-friends`, 7 7 // "Mutuals" by @skyfeed.xyz
+1 -1
src/lib/moderation.ts
··· 123 123 124 124 export const findLabel = ( 125 125 labels: Label[] | undefined, 126 - authorDid: At.DID, 126 + authorDid: At.Did, 127 127 mask: number, 128 128 ): LabelDefinition | undefined => { 129 129 if (labels?.length) {
+2 -1
src/lib/queries/handle.ts
··· 1 1 import type { XRPC } from '@atcute/client'; 2 + import type { At } from '@atcute/client/lexicons'; 2 3 3 4 import type { Did } from '$lib/types/identity'; 4 5 5 - export const resolveHandle = async ({ rpc, handle }: { rpc: XRPC; handle: string }): Promise<Did> => { 6 + export const resolveHandle = async ({ rpc, handle }: { rpc: XRPC; handle: At.Handle }): Promise<Did> => { 6 7 const { data } = await rpc.get('com.atproto.identity.resolveHandle', { 7 8 params: { handle }, 8 9 });
+2 -4
src/lib/queries/post.ts
··· 1 1 import { XRPC, XRPCError } from '@atcute/client'; 2 - import type { AppBskyFeedDefs } from '@atcute/client/lexicons'; 3 - 4 - import type { AtUri } from '$lib/types/at-uri'; 2 + import type { AppBskyFeedDefs, At } from '@atcute/client/lexicons'; 5 3 6 4 export interface GetPostReturn { 7 5 post: AppBskyFeedDefs.PostView; 8 6 threadgate?: AppBskyFeedDefs.ThreadgateView; 9 7 } 10 8 11 - export const getPost = async ({ rpc, uri }: { rpc: XRPC; uri: AtUri }): Promise<GetPostReturn> => { 9 + export const getPost = async ({ rpc, uri }: { rpc: XRPC; uri: At.ResourceUri }): Promise<GetPostReturn> => { 12 10 const { data } = await rpc.get('app.bsky.feed.getPostThread', { 13 11 params: { 14 12 uri: uri,
+3 -11
src/lib/queries/timeline.ts
··· 1 1 import type { XRPC } from '@atcute/client'; 2 - import type { 3 - AppBskyActorDefs, 4 - AppBskyFeedDefs, 5 - AppBskyFeedGetTimeline, 6 - AppBskyFeedPost, 7 - } from '@atcute/client/lexicons'; 2 + import type { AppBskyActorDefs, AppBskyFeedDefs, AppBskyFeedGetTimeline, At } from '@atcute/client/lexicons'; 8 3 9 4 import { 10 5 buildTimelineSlices, ··· 15 10 type TimelineSlice, 16 11 type UiTimelineItem, 17 12 } from '$lib/models/timeline'; 18 - import type { AtUri } from '$lib/types/at-uri'; 19 13 import type { Did } from '$lib/types/identity'; 20 14 import { assertNever } from '$lib/utils/invariant'; 21 - 22 - type PostRecord = AppBskyFeedPost.Record; 23 15 24 16 export const enum TimelineType { 25 17 PROFILE, ··· 43 35 44 36 export interface CustomFeedTimelineParams { 45 37 type: TimelineType.CUSTOM_FEED; 46 - feed: AtUri; 38 + feed: At.ResourceUri; 47 39 cursor?: string; 48 40 } 49 41 50 42 export interface UserListTimelineParams { 51 43 type: TimelineType.USER_LIST; 52 - list: AtUri; 44 + list: At.ResourceUri; 53 45 cursor?: string; 54 46 } 55 47
+2 -4
src/lib/types/at-uri.ts
··· 1 - import type { Records } from '@atcute/client/lexicons'; 1 + import type { At, Records } from '@atcute/client/lexicons'; 2 2 3 3 import { assert } from '$lib/utils/invariant'; 4 4 5 5 import { isDid, isHandle, type Did, type Handle } from './identity'; 6 6 import { isNsid, type Nsid } from './nsid'; 7 7 import { isRecordKey, type RecordKey } from './rkey'; 8 - 9 - export type AtUri = `at://${Did | Handle}/${Nsid}/${RecordKey}`; 10 8 11 9 const ATURI_RE = 12 10 /^at:\/\/([a-zA-Z0-9._:%-]+)(?:\/([a-zA-Z0-9-.]+)(?:\/([a-zA-Z0-9._~:@!$&%')(*+,;=-]+))?)?(?:#(\/[a-zA-Z0-9._~:@!$&%')(*+,;=\-[\]/\\]*))?$/; ··· 61 59 repo: Did | Handle, 62 60 collection: keyof Records | (Nsid & {}), 63 61 rkey: string, 64 - ): AtUri => { 62 + ): At.ResourceUri => { 65 63 return `at://${repo}/${collection as Nsid}/${rkey}`; 66 64 };
+1 -2
src/routes/(app)/[actor=didOrHandle]/packs/[rkey=rkey]/posts/+page.ts
··· 4 4 import type { PageLoad } from './$types'; 5 5 6 6 import { fetchTimeline, TimelineType } from '$lib/queries/timeline'; 7 - import { type AtUri } from '$lib/types/at-uri'; 8 7 9 8 export const load: PageLoad = async ({ url, fetch, parent }) => { 10 9 const rpc = new XRPC({ handler: simpleFetchHandler({ service: PUBLIC_APPVIEW_URL }) }); ··· 19 18 rpc, 20 19 params: { 21 20 type: TimelineType.USER_LIST, 22 - list: pack.list.uri as AtUri, 21 + list: pack.list.uri, 23 22 cursor: url.searchParams.get('cursor') || undefined, 24 23 }, 25 24 });
+2 -2
src/routes/(app)/[actor=did]/[rkey=tid]/unroll/+page.ts
··· 6 6 import { PUBLIC_APPVIEW_URL } from '$env/static/public'; 7 7 import type { PageLoad } from './$types'; 8 8 9 - import { makeAtUri, type AtUri } from '$lib/types/at-uri'; 9 + import { makeAtUri } from '$lib/types/at-uri'; 10 10 11 11 export const load: PageLoad = async ({ params }) => { 12 12 const rpc = new XRPC({ handler: simpleFetchHandler({ service: PUBLIC_APPVIEW_URL }) }); ··· 81 81 82 82 items.push(replies[0]); 83 83 84 - currentUri = replies[0].post.uri as AtUri; 84 + currentUri = replies[0].post.uri; 85 85 foundReply = true; 86 86 } 87 87
+2 -2
src/routes/(app)/search/feeds/+page.ts
··· 1 1 import { simpleFetchHandler, XRPC } from '@atcute/client'; 2 + import type { At } from '@atcute/client/lexicons'; 2 3 3 4 import { AUTHENTICATED_FEEDS } from '$lib/constants'; 4 - import type { AtUri } from '$lib/types/at-uri'; 5 5 import { asString, useSearchParams } from '$lib/utils/search-params'; 6 6 7 7 import { PUBLIC_APPVIEW_URL } from '$env/static/public'; ··· 26 26 27 27 let feeds = data.feeds; 28 28 if (query.length === 0) { 29 - feeds = feeds.filter((feed) => !AUTHENTICATED_FEEDS.includes(feed.uri as AtUri)); 29 + feeds = feeds.filter((feed) => !AUTHENTICATED_FEEDS.includes(feed.uri as At.CanonicalResourceUri)); 30 30 } 31 31 32 32 return {