drop @atproto/api from the dependency tree
The last references were stale comments; the package itself leaves package.json, webpack's transpile list, and 102 packages from the lockfile. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* label simply drops the `https://` scheme for readability.
|
||||
*
|
||||
* Kept as a dependency-free leaf module (no #/lib/strings/url-helpers import)
|
||||
* so its unit tests stay fast and isolated from the heavy @atproto/api graph.
|
||||
* so its unit tests stay fast and isolated from the lexicon graph.
|
||||
*/
|
||||
|
||||
function stripLeadingAt(handle: string): string {
|
||||
|
||||
@@ -94,7 +94,8 @@ describe('cleanError', () => {
|
||||
it('surfaces the authentication-required code of a lex error', () => {
|
||||
/*
|
||||
* The lex client derives `AuthenticationRequired` from a 401 with no XRPC
|
||||
* payload, where `@atproto/api` used the spaced "Authentication Required".
|
||||
* payload, where the pre-migration client used the spaced
|
||||
* "Authentication Required".
|
||||
* Neither is special-cased in `cleanError`, so what matters is that the
|
||||
* class- and code-prefixed stringification does not reach the user.
|
||||
*/
|
||||
|
||||
@@ -568,9 +568,8 @@ export function MessagesList({
|
||||
embed = {
|
||||
$type: 'app.bsky.embed.record',
|
||||
/*
|
||||
* `getPost` still returns an `@atproto/api` view, whose `uri` and
|
||||
* `cid` are plain strings rather than the branded syntax types
|
||||
* the lexicon input declares.
|
||||
* `getPost` hands back `uri` and `cid` as plain strings rather
|
||||
* than the branded syntax types the lexicon input declares.
|
||||
*/
|
||||
record: {
|
||||
uri: post.uri,
|
||||
|
||||
@@ -1187,8 +1187,8 @@ export class Convo {
|
||||
}
|
||||
|
||||
/*
|
||||
* The lex client throws `XrpcResponseError`, not `@atproto/api`'s
|
||||
* `XRPCError`, so the status/message branch narrows on the lex class. Only
|
||||
* The lex client throws `XrpcResponseError`, so the status/message branch
|
||||
* narrows on that class. Only
|
||||
* a genuine server response carries a status: transport and internal lex
|
||||
* failures are `XrpcInternalError`s and fall through to the generic arm,
|
||||
* where `isNetworkError` keeps them out of the logs.
|
||||
|
||||
@@ -72,9 +72,9 @@ export async function optimisticallySaveBookmark(
|
||||
if (index === 0) {
|
||||
post.$type = 'app.bsky.feed.defs#postView'
|
||||
/*
|
||||
* The optimistic entry is synthesized from an `@atproto/api`
|
||||
* `PostView`, whose string fields are unbranded, so it is asserted
|
||||
* to the vendored view type the query data is now keyed on.
|
||||
* The optimistic entry is synthesized with unbranded string
|
||||
* fields, so it is asserted to the generated view type the query
|
||||
* data is keyed on.
|
||||
*/
|
||||
const bookmark = {
|
||||
createdAt: new Date().toISOString(),
|
||||
|
||||
@@ -45,8 +45,7 @@ export function usePostQuery(uri: string | undefined) {
|
||||
* Read one post by AT-URI, resolving a handle authority first when the URI
|
||||
* carries one.
|
||||
*
|
||||
* The appview still answers with `@atproto/api`-shaped views for the callers of
|
||||
* these hooks, so the generated view is asserted across at this single
|
||||
* The appview response is asserted to the generated view at this single
|
||||
* boundary rather than at every consumer.
|
||||
*/
|
||||
async function fetchPost(
|
||||
|
||||
@@ -287,7 +287,7 @@ export function buildSearchPostsV2Filters(
|
||||
}
|
||||
|
||||
/**
|
||||
* Consistent with timestamp parsing in @atproto/api. Only the date is used; the
|
||||
* Only the date is used; the
|
||||
* time is appended here since the lexicon expects a datetime value.
|
||||
*/
|
||||
const parseTimestamp = (value: string | undefined): string | undefined => {
|
||||
|
||||
@@ -144,9 +144,8 @@ export function useSaveDraftMutation() {
|
||||
composerState,
|
||||
)
|
||||
/*
|
||||
* `composerStateToDraft` builds the draft against the `@atproto/api`
|
||||
* types, whose string fields are unbranded, so it is asserted once here
|
||||
* to the vendored input type.
|
||||
* `composerStateToDraft` builds the draft with unbranded string fields,
|
||||
* so it is asserted once here to the generated input type.
|
||||
*/
|
||||
const draft = apiDraft as unknown as app.bsky.draft.defs.Draft
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {app} from '#/lexicons'
|
||||
/**
|
||||
* Types for draft display and local media tracking.
|
||||
* Server draft types come from @atproto/api.
|
||||
* Server draft types come from the generated `#/lexicons` modules.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user