From 02173556abf35c871068001fab433f6ef7b87fb3 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Tue, 4 Aug 2026 04:56:30 +0300 Subject: [PATCH] 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 --- package.json | 1 - pnpm-lock.yaml | 43 ------------------- src/features/inviteFriends/urls.ts | 2 +- src/lib/strings/__tests__/errors.test.ts | 3 +- .../Messages/components/MessagesList.tsx | 5 +-- src/state/messages/convo/agent.ts | 4 +- .../queries/bookmarks/useBookmarksQuery.ts | 6 +-- src/state/queries/post.ts | 3 +- src/state/queries/search-posts-params.ts | 2 +- src/view/com/composer/drafts/state/queries.ts | 5 +-- src/view/com/composer/drafts/state/schema.ts | 2 +- webpack.config.js | 2 +- 12 files changed, 16 insertions(+), 62 deletions(-) diff --git a/package.json b/package.json index 5d92bc833f..4415b0fa58 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,6 @@ "prettier": "prettier --check ." }, "dependencies": { - "@atproto/api": "0.20.39", "@atproto/common-web": "0.5.9", "@atproto/lex": "0.3.6", "@atproto/lex-password-session": "0.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3b8bcb5f36..92a4d68c35 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -242,9 +242,6 @@ importers: .: dependencies: - '@atproto/api': - specifier: 0.20.39 - version: 0.20.39 '@atproto/common-web': specifier: 0.5.9 version: 0.5.9 @@ -908,10 +905,6 @@ packages: resolution: {integrity: sha512-vfvoDhu6ds6BT3Pqe+d2/LBU1WpDRtt69y6zltlfMCoucPm82m1j50/Wb6xTvv+oZ+2j0JyZVXsmXQ12SWYQJg==} engines: {node: '>=22'} - '@atproto/api@0.20.39': - resolution: {integrity: sha512-FRjwAmYe0kKlWsAe8IvfbmAAKyjpXnl2NV67vWEEjux0FwIEIG6JbOo6YkD5tjK2xjL0Daa429R0E8phmxRrrQ==} - engines: {node: '>=22'} - '@atproto/common-web@0.5.9': resolution: {integrity: sha512-2c5C6YV8352JJz9Z5fNfcsstllaKGAb3cQW9aO7unMAGh/FzTGFq+xOwNMW2lTeagO6z530uxYm8AiSRM6O+DQ==} engines: {node: '>=22'} @@ -973,10 +966,6 @@ packages: engines: {node: '>=22'} hasBin: true - '@atproto/lexicon@0.7.11': - resolution: {integrity: sha512-ukCZMCWmiu7fAlssBbLs+IMaf2K2R9mADaTKz2jEeC/xeZ3jT77Ka0S2G+ELBB+Dc9ijBACU0iPMQLhquOkuzQ==} - engines: {node: '>=22'} - '@atproto/repo@0.10.11': resolution: {integrity: sha512-QqDzEv8d6NUuqZ0xvWG+n8DfWd4Vuka04nyuD9oglKsj5avB1zbEsWx3Oit1oYtZFUf9JSVWMDqMXhu3UbB+lA==} engines: {node: '>=22'} @@ -985,10 +974,6 @@ packages: resolution: {integrity: sha512-EHsEHtasH/DGPljBYecVDjweGMQ5eTu6Ns0GZ5z0qdqpOI8ipBvldWnMIxWkA+5HfZ9Dsu4V1MX0WP7wgL8cuA==} engines: {node: '>=22'} - '@atproto/xrpc@0.8.10': - resolution: {integrity: sha512-++FNpTVF61fF8+3Kk1RYtdTO7xyUTdIc/Cmfk2CMn29Qw9tZD8bmW+M5db1Z0okYWFWK8Wqu7bc9VmF8tUB8Jg==} - engines: {node: '>=22'} - '@babel/code-frame@7.10.4': resolution: {integrity: sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==} @@ -4320,9 +4305,6 @@ packages: resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} engines: {node: '>= 0.4'} - await-lock@3.0.0: - resolution: {integrity: sha512-eO6fLiSnrJrMdjWMNK8zbVRXPs2TKJg78iKZd9wDpN3na5tcoV6EoeiOlMgk2QaAQ1gIrK1YuMsJHXWqz89tSA==} - babel-jest@29.7.0: resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -9754,17 +9736,6 @@ snapshots: '@atproto-labs/simple-store@0.5.1': {} - '@atproto/api@0.20.39': - dependencies: - '@atproto/common-web': 0.5.9 - '@atproto/lexicon': 0.7.11 - '@atproto/syntax': 0.7.4 - '@atproto/xrpc': 0.8.10 - await-lock: 3.0.0 - multiformats: 13.4.2 - tlds: 1.261.0 - zod: 3.25.76 - '@atproto/common-web@0.5.9': dependencies: '@atproto/lex-data': 0.1.7 @@ -9875,13 +9846,6 @@ snapshots: tslib: 2.8.1 yargs: 18.1.0 - '@atproto/lexicon@0.7.11': - dependencies: - '@atproto/common-web': 0.5.9 - '@atproto/syntax': 0.7.4 - multiformats: 13.4.2 - zod: 3.25.76 - '@atproto/repo@0.10.11': dependencies: '@atproto/common': 0.8.0 @@ -9898,11 +9862,6 @@ snapshots: iso-datestring-validator: 2.2.2 tslib: 2.8.1 - '@atproto/xrpc@0.8.10': - dependencies: - '@atproto/lexicon': 0.7.11 - zod: 3.25.76 - '@babel/code-frame@7.10.4': dependencies: '@babel/highlight': 7.25.9 @@ -13788,8 +13747,6 @@ snapshots: dependencies: possible-typed-array-names: 1.1.0 - await-lock@3.0.0: {} - babel-jest@29.7.0(@babel/core@7.29.0(supports-color@8.1.1))(supports-color@8.1.1): dependencies: '@babel/core': 7.29.0(supports-color@8.1.1) diff --git a/src/features/inviteFriends/urls.ts b/src/features/inviteFriends/urls.ts index 7a22b8faf4..776a8bdf16 100644 --- a/src/features/inviteFriends/urls.ts +++ b/src/features/inviteFriends/urls.ts @@ -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 { diff --git a/src/lib/strings/__tests__/errors.test.ts b/src/lib/strings/__tests__/errors.test.ts index c5ef2d30b9..703cc955fb 100644 --- a/src/lib/strings/__tests__/errors.test.ts +++ b/src/lib/strings/__tests__/errors.test.ts @@ -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. */ diff --git a/src/screens/Messages/components/MessagesList.tsx b/src/screens/Messages/components/MessagesList.tsx index 087d247c02..042eaee0ab 100644 --- a/src/screens/Messages/components/MessagesList.tsx +++ b/src/screens/Messages/components/MessagesList.tsx @@ -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, diff --git a/src/state/messages/convo/agent.ts b/src/state/messages/convo/agent.ts index 9e54c9c6a6..85a98d32c7 100644 --- a/src/state/messages/convo/agent.ts +++ b/src/state/messages/convo/agent.ts @@ -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. diff --git a/src/state/queries/bookmarks/useBookmarksQuery.ts b/src/state/queries/bookmarks/useBookmarksQuery.ts index db3d316cb1..cc0119aeba 100644 --- a/src/state/queries/bookmarks/useBookmarksQuery.ts +++ b/src/state/queries/bookmarks/useBookmarksQuery.ts @@ -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(), diff --git a/src/state/queries/post.ts b/src/state/queries/post.ts index 3b1b2b12a1..29d1ca9447 100644 --- a/src/state/queries/post.ts +++ b/src/state/queries/post.ts @@ -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( diff --git a/src/state/queries/search-posts-params.ts b/src/state/queries/search-posts-params.ts index 6284022a4e..f75f2204c1 100644 --- a/src/state/queries/search-posts-params.ts +++ b/src/state/queries/search-posts-params.ts @@ -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 => { diff --git a/src/view/com/composer/drafts/state/queries.ts b/src/view/com/composer/drafts/state/queries.ts index fa2d11771a..70a1fa06c1 100644 --- a/src/view/com/composer/drafts/state/queries.ts +++ b/src/view/com/composer/drafts/state/queries.ts @@ -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 diff --git a/src/view/com/composer/drafts/state/schema.ts b/src/view/com/composer/drafts/state/schema.ts index 5fd5bbb861..bfe639390c 100644 --- a/src/view/com/composer/drafts/state/schema.ts +++ b/src/view/com/composer/drafts/state/schema.ts @@ -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. */ /** diff --git a/webpack.config.js b/webpack.config.js index 889a2cb83f..dace4e8fe5 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -45,7 +45,7 @@ function patchSourceMapFilter(rules, pathPattern) { module.exports = async function (env, argv) { env.babel = { - dangerouslyAddModulePathsToTranspile: ['@bsky.app/expo', '@atproto/api'], + dangerouslyAddModulePathsToTranspile: ['@bsky.app/expo'], } let config = await createExpoWebpackConfigAsync(env, argv) /*