Skip to content

feat: allow FeedOptions.author to be Author | Author[]#135

Merged
otnc merged 1 commit into
mainfrom
feat/feed-level-multiple-authors
Jul 14, 2026
Merged

feat: allow FeedOptions.author to be Author | Author[]#135
otnc merged 1 commit into
mainfrom
feat/feed-level-multiple-authors

Conversation

@otnc

@otnc otnc commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix bug(s)
  • New feature(s)
  • Others

FeedOptions.author now accepts Author | Author[], matching what
FeedItem.author already accepted.

Why?

The neutral model capped the feed at a single author for no spec-side
reason, even though two of the three formats allow more:

  • Atom — RFC 4287 §4.1.1: "atom:feed elements MUST contain one or more
    atom:author elements, unless…" — multiple feed-level <author> elements
    are explicitly permitted.
  • JSON Feed 1.1authors is an array by definition; we always emitted
    a one-element array.
  • RSSmanagingEditor stays single: uses the existing firstAuthor()
    collapse-to-first helper, exactly like item-level authors already do.

All the normalization infrastructure already existed (authorList()/
firstAuthor() in src/utils/author.ts), built for exactly this dual
shape — the item level and the feed level were just asymmetric.

Also: validateInput's "feed needs an author unless every item has one"
rule (RFC 4287 §4.1.1) used to check !options.author, which treats an
empty array as truthy — a [] author on the feed would have silently
satisfied the rule. Added a shared hasAuthor() to utils/author.ts so
both the feed-level and item-level checks now correctly treat an empty
array as "no author," and validate.ts's local duplicate of the item-level
check was removed in favor of it.

Backward-compatible: a plain Author keeps working everywhere.

Related issue(s)

closes #127

Check

  • Check if duplicate PR(s) already exist.
  • Read CONTRIBUTING.md (rules)
  • Run pnpm check (lint & format)
  • Run pnpm test (functions test)
  • Run pnpm build (dist/)
  • (optional) Run pnpm test:coverage and check nothing new went uncovered

@github-actions github-actions Bot added enhancement New feature or request to main for Pull Request to main conflict for Pull Request labels Jul 14, 2026
The neutral model capped the feed at a single author even though two
of the three formats allow more: RFC 4287 §4.1.1 permits multiple
feed-level atom:author elements, and JSON Feed 1.1's authors is an
array by definition (we always emitted a one-element array). RSS
still collapses to the first author via firstAuthor(), same as it
already does for item-level authors.

Atom 1.0/0.3 now emit one <author> per entry via authorList(), and
JSON Feed maps the full list to authors (or the first to the
singular author for jsonFeedVersion 1). validateInput's "feed needs
an author unless every item has one" rule now treats an empty
author array the same as no author, matching the existing item-level
check — both now share utils/author.ts's hasAuthor().

Backward-compatible: a plain Author keeps working everywhere.
@otnc otnc force-pushed the feat/feed-level-multiple-authors branch from 5740ed3 to 48de8fe Compare July 14, 2026 13:48
@github-actions github-actions Bot removed the conflict for Pull Request label Jul 14, 2026
@otnc otnc merged commit fc51bb4 into main Jul 14, 2026
8 checks passed
@otnc otnc deleted the feat/feed-level-multiple-authors branch July 14, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request to main for Pull Request to main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feed-level multiple authors: FeedOptions.author should accept Author[]

1 participant