Skip to content

docs: Document the core public API with JSDoc - #961

Merged
razor-x merged 7 commits into
mainfrom
claude/public-api-docstrings-28gizu
Aug 19, 2026
Merged

docs: Document the core public API with JSDoc#961
razor-x merged 7 commits into
mainfrom
claude/public-api-docstrings-28gizu

Conversation

@razor-x

@razor-x razor-x commented Aug 13, 2026

Copy link
Copy Markdown
Member

Adds JSDoc to the core client modules — the concepts covered in the README — with lint enforcement so coverage of those modules cannot regress. Generated code and codegen templates are untouched (identical to main); the blueprint already documents resources and endpoint methods.

Scope (all in src/lib core modules):

  • options.ts — every SeamHttpOptions* auth variant and type guard, including the guards' throwing behavior on conflicting auth options, and the endpoint option's env-var defaults.
  • client.ts — the README Advanced Usage options: timeout (per-attempt, ms, 0 disables), axiosOptions, axiosRetryOptions. These surface on every public options interface.
  • request-options.ts / resolve-action-attempt.tswaitForActionAttempt, timeout and pollingInterval (ms), the SeamActionAttempt*Error classes and guards.
  • seam-http-request.tsSeamHttpRequest is lazy/thenable and resolves action attempts on await; execute vs fetchResponse.
  • seam-paginator.tsSeamPaginator and its paging/iteration methods.
  • seam-http-error.ts — the SeamHttpApiError family; requestId is what you give Seam support.

Enforcement: eslint-plugin-jsdoc with jsdoc/require-jsdoc on top-level exports of exactly those six modules (file list in eslint.config.ts). Members and properties are documented only where the docstring says something the signature can't — nothing forces a statusCode: 401-style comment.

⚠️ One small API addition to review: ResolveActionAttemptOptions, SucceededActionAttempt, and FailedActionAttempt are now re-exported from the entrypoint. They already appear in public type signatures (waitForActionAttempt and SeamActionAttemptFailedError) but were not exported, which left TypeDoc unable to link them. Happy to drop this if unwanted.

Verification: npm run lint, npm run typecheck, npm test (125 passed), and npm run docs:build (0 errors) all pass. npm run generate output is unchanged from main.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XQyDWeGYQyCDEJ1rZ8J1iB

claude added 3 commits August 13, 2026 07:57
Add eslint-plugin-jsdoc scoped to the export closure of src/index.ts.
The jsdoc/require-jsdoc rule now flags every undocumented public export:
86 errors in handwritten modules and 1149 in generated code, to be
resolved in subsequent commits. Internal modules (client, parse-options,
api-error-types, version) are excluded by file scope rather than
@internal tags.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XQyDWeGYQyCDEJ1rZ8J1iB
Add JSDoc to every public export reachable from the package entrypoint:
options and their type guards, error classes and their properties,
SeamHttpRequest, SeamPaginator, token predicates, and getOpenapiSchema.

Also export ResolveActionAttemptOptions, SucceededActionAttempt, and
FailedActionAttempt, which already appear in public type signatures
(waitForActionAttempt and SeamActionAttemptFailedError) but were not
re-exported, leaving TypeDoc unable to link them.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XQyDWeGYQyCDEJ1rZ8J1iB
Update the codegen templates to document every generated export:
route class declarations, the client and defaults properties, static
factory methods, sub-route getters, per-endpoint Parameters, Response,
Request, and Options types, and the endpoint path types. Add a fallback
description for resource types missing a description in the blueprint
(DeviceProvider and SeamEvent). Expose routePath in the route and
subroute layout contexts so templates can name the route they document.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XQyDWeGYQyCDEJ1rZ8J1iB
Resolve template conflicts by keeping both the JSDoc additions and the
new request parameter validation from main, then regenerate all
generated files with npm run generate.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XQyDWeGYQyCDEJ1rZ8J1iB
Require JSDoc only on top-level exports, not class members or
properties. Remove the generated docs on the endpoint Parameters,
Response, Request, Options, and path types, and drop handwritten and
template member docs that only repeat the member name or type, e.g.,
statusCode: 401. Member docs that carry real information remain, e.g.,
requestId, waitForActionAttempt, and the polling options.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XQyDWeGYQyCDEJ1rZ8J1iB
@razor-x
razor-x marked this pull request as draft August 18, 2026 23:31
@razor-x razor-x changed the title docs: Document the entire public API with JSDoc docs: Document the public API with JSDoc Aug 19, 2026
claude added 2 commits August 19, 2026 19:16
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XQyDWeGYQyCDEJ1rZ8J1iB
Limit JSDoc to the concepts covered in the README: client options,
authentication options and their type guards, action attempt resolution,
pagination, requests, and errors. Revert all codegen template changes so
generated code matches main, remove docs from the token predicates, auth
helpers, error interceptor, and getOpenapiSchema, and narrow the lint
rule to the core modules. Document the timeout, axiosOptions, and
axiosRetryOptions client options from the README Advanced Usage section.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XQyDWeGYQyCDEJ1rZ8J1iB
@razor-x razor-x changed the title docs: Document the public API with JSDoc docs: Document the core public API with JSDoc Aug 19, 2026
@razor-x
razor-x force-pushed the claude/public-api-docstrings-28gizu branch from 2a574d2 to 79d59a2 Compare August 19, 2026 22:46
@razor-x
razor-x marked this pull request as ready for review August 19, 2026 22:53
@razor-x
razor-x merged commit 7c3277a into main Aug 19, 2026
31 checks passed
@razor-x
razor-x deleted the claude/public-api-docstrings-28gizu branch August 19, 2026 22:54
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.

2 participants