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]);