From 070442aaab83e1ea4d11ccb425f6602a0318966d Mon Sep 17 00:00:00 2001 From: Florian <45694132+flo-bit@users.noreply.github.com> Date: Sun, 3 May 2026 21:45:01 +0200 Subject: [PATCH] small lex-gen fix --- .changeset/feed-targets-shape.md | 4 +++- packages/lexicons/src/generate.ts | 12 ++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.changeset/feed-targets-shape.md b/.changeset/feed-targets-shape.md index 357f1bf..3607331 100644 --- a/.changeset/feed-targets-shape.md +++ b/.changeset/feed-targets-shape.md @@ -2,4 +2,6 @@ "@atmo-dev/contrail-lexicons": patch --- -Handle the new `FeedConfig.targets` shape (`string | { collection, maxItems? }`) when generating the feed lexicon and computing pull NSIDs, and fall back to the default `"follow"` short name when `FeedConfig.follow` is unset. +Handle the new `FeedConfig.targets` shape (`string | { collection, maxItems? }`) when generating the feed lexicon and computing pull NSIDs. + +When `FeedConfig.follow` is unset, mirror contrail's runtime default and emit `app.bsky.graph.follow` into the generated `lex.config.js` pull list — previously the auto-added follow collection was missing from `pull.sources[0].nsids`, so lex-cli wouldn't fetch its schema. diff --git a/packages/lexicons/src/generate.ts b/packages/lexicons/src/generate.ts index 93151f8..8b39b6d 100644 --- a/packages/lexicons/src/generate.ts +++ b/packages/lexicons/src/generate.ts @@ -1040,12 +1040,16 @@ export function generateLexicons(options: GenerateOptions): Record config.collections[f.follow ?? "follow"]?.collection) + .map((f) => { + if (!f.follow) return DEFAULT_FOLLOW_NSID; + return config.collections[f.follow]?.collection; + }) .filter((nsid): nsid is string => typeof nsid === "string") : []; const pullNsids = new Set([...collectionNsids, ...profileNsids, ...feedFollowNsids]); -- 2.51.2