Skip to content

docs: restructure READMEs around the core contract - #65

Merged
dinwwwh merged 3 commits into
mainfrom
claude/blissful-curran-cee387
Aug 13, 2026
Merged

docs: restructure READMEs around the core contract#65
dinwwwh merged 3 commits into
mainfrom
claude/blissful-curran-cee387

Conversation

@dinwwwh

@dinwwwh dinwwwh commented Aug 13, 2026

Copy link
Copy Markdown
Member

The READMEs are restructured so the shared contract is documented once, in the core README, and everything else links to it. The root README is now just the overview and a package list; adapter READMEs keep only their transport-specific behavior.

Changes

  • The core README gains two sections: The `standard-server` header (why content headers alone cannot identify a body, and when adapters stamp the header) and How body parsing works (the exact `resolveBody(hint?)` priority). Both note they apply to the HTTP adapters, not the peer adapter, which identifies body types through its own message protocol.
  • Adapter READMEs no longer repeat the four-step resolution algorithm; they summarize it and link to the core sections. Package-specific notes (Fastify parser precedence and reply rules, Lambda buffering/cookie behavior, peer codec rules) are unchanged.
  • The root README relative-links every package README and directs readers to the core README for the contract.

Fixes

  • The documented hint name is now `url-search-params`; the root README previously said `url-encoded`, which is not a valid `StandardBodyHint`.
  • The documented fallback rules now match `resolveStandardBodyHint()`: empty bodies resolve to `none`, and a `content-disposition` filename (not just `content-length`) triggers `file` parsing.

Badges and sponsor sections are preserved verbatim in every file; `pnpm eslint` passes on all changed files.

The root README now only lists packages and points to the core README,
which owns the shared contract docs, including new sections on the
standard-server header and how body parsing works. Adapter READMEs link
to those sections instead of duplicating the resolution algorithm, which
had drifted from the implementation (wrong url-search-params hint name,
missing none/file/octet-stream fallback rules).
@pkg-pr-new

pkg-pr-new Bot commented Aug 13, 2026

Copy link
Copy Markdown
@standardserver/aws-lambda

npm i https://pkg.pr.new/@standardserver/aws-lambda@65

@standardserver/core

npm i https://pkg.pr.new/@standardserver/core@65

@standardserver/fastify

npm i https://pkg.pr.new/@standardserver/fastify@65

@standardserver/fetch

npm i https://pkg.pr.new/@standardserver/fetch@65

@standardserver/node

npm i https://pkg.pr.new/@standardserver/node@65

@standardserver/peer

npm i https://pkg.pr.new/@standardserver/peer@65

@standardserver/shared

npm i https://pkg.pr.new/@standardserver/shared@65

commit: b2b56f7

@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed-hq

codspeed-hq Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 26 untouched benchmarks
⏩ 108 skipped benchmarks1


Comparing claude/blissful-curran-cee387 (b2b56f7) with main (2665388)

Open in CodSpeed

Footnotes

  1. 108 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Root README — trimmed to an overview plus a package table whose rows link each adapter README; the deep request/body/parsing documentation was removed and consolidated into the core README.
  • packages/core/README.md — gained two new sections, The standard-server header and How body parsing works, documenting the shared contract once, with a worked resolveStandardBodyHint() example and a note that both apply only to the HTTP adapters.
  • Adapter READMEs (aws-lambda, fastify, fetch, node, peer, shared) — the repeated four-step resolution algorithm was replaced with a short summary and links back to the core sections; transport-specific notes are preserved.
  • Fixes — the body hint name corrected from the invalid url-encoded to url-search-params, and the documented fallback rules updated to match resolveStandardBodyHint() (empty body → none; content-disposition filename or content-lengthfile).

I verified the documentation against the implementation: url-search-params is the valid hint (packages/core/src/types.ts:12, utils.ts:58), the four inference steps mirror resolveStandardBodyHint() exactly (packages/core/src/utils.ts:74-112), the auto-stamping/clearing claims match the node and fetch adapters, and the #the-standard-server-header / #how-body-parsing-works anchors resolve correctly. The restructure is accurate and clean — mergeable as-is.

Pullfrog  | View workflow run | Using DeepSeek Flash (default — pick a model for stronger reviews) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Merged core sections — collapsed ## The \standard-server` headerand## How body parsing worksinto a single## How body parsing workswith### The `standard-server` headerand### Resolution order` subsections. The HTTP-adapter scope note now guards the whole merged section, which is clearer than the previous split.
  • Added intro paragraph — a short lead that names the three hint sources (explicit argument, standard-server header, content-header inference) before the header and resolution details.
  • Polished the upload example — the inline comment now reads // <- keep the payload a File on the server, matching standard-server: file in the example headers.

I confirmed the restructuring doesn't break the load-bearing links: the #the-standard-server-header (now H3) and #how-body-parsing-works (H2) anchors are derived purely from heading text — GitHub strips backticks and preserves hyphens, and level changes don't affect the slug — so every ../core/README.md#... reference from the root and adapter READMEs still resolves. No duplicate or dead anchors, and the content is accurate against resolveStandardBodyHint(). Mergeable as-is.

Pullfrog  | View workflow run | Using DeepSeek Flash (default — pick a model for stronger reviews) | 𝕏

@dinwwwh
dinwwwh merged commit 95fa7e9 into main Aug 13, 2026
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant