Repository navigation
chore(js): validate API declarations with API Extractor - #6794
Conversation
Quest-Claim: 1100d1eefed49159
Enable strict extractor diagnostics, define the shared module tag, and exercise declaration failures. External dependency resolution remains a maintainer decision; workspace migration and checker removal are incomplete. Co-Authored-By: GPT-6 <noreply@openai.com>
…Extractor Link each package's declared dependencies into the isolated dist copy so API Extractor resolves their types, with workspace siblings resolving to source. Accept a forgotten export only when another entrypoint or a rename makes it nameable, migrate the findings, and delete the hand-rolled declarations and docs checkers. Record the maintainer's decision in the quest Plan. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # js/net/api/index.api.md # js/net/src/connection/accept.ts # js/net/src/connection/connect.ts
API Extractor types its program `unknown`, so the checks libav's build script runs failed to typecheck. Declare the parts of the TypeScript compiler API the analysis uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 851378c
No actionable bugs found in the reviewed changes. Consolidating declaration/docs validation into the existing API Extractor build gate is a sound direction; the shared compiler state, declared-dependency isolation and symbol-based cross-entrypoint exceptions justify the remaining custom logic. The public type additions and alias inlining preserve the inspected runtime behavior.
Useful follow-up coverage: add adversarial fixtures for same-named hidden/exported declarations and chained aliases around nameableReference, since this exception is now part of the release gate. The five fixtures cover the principal positive/negative cases but not those boundaries.
Verification: static inspection of the checker, packaging/workspace integration, fixtures and API/source changes only. I did not run builds/tests or independently reproduce the reported planted-failure checks. Dependency-source diagnostics and unresolved TSDoc links remain intentionally outside this gate.
|
Landing summary: the OpenAI review of The review suggested more fixtures for (Written by Claude Opus 5.5) |
# Conflicts: # js/net/api/index.api.md
# Conflicts: # js/net/api/index.api.md # js/net/api/zod.api.md # quest/m1/README.md
|
Requeuing after the merge queue dropped this on
(Written by Claude Opus 5.5) |
…r-checks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged origin/main (after moq-dev/moq#6859) to clear the merge-queue conflict:
(Written by Claude Opus 5.5) |
js/hang/src/timeline.ts stays deleted: main only documented its fields (#6794), and this branch replaces the module with Hls.Consumer. The hang API reports are regenerated with main's API Extractor setup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
js/common/declarations.tsandjs/common/docs.tshand-roll checks that API Extractor already does, and the shared API report configuration silenced every API Extractor message. So a public signature could use a type no entrypoint exports, such as the old@moq/authAccessInput, or an export could ship without docs, and the build would still pass.Approach
Every published
@moq/*entrypoint now goes through API Extractor at build time, with compiler, extractor and TSDoc messages as errors. The two hand-rolled checkers and their tests are deleted.The maintainer picked the broader design: resolve declared dependency types without needing sibling packages to be built.
dist/copy gets anode_modulesthat links only the declared dependencies, peer dependencies and optional dependencies, each to its workspace install. A workspace sibling resolves to its source through itsexports, so nothing has to be built first. An undeclared bare import fails with TS2307.ae-forgotten-exportacceptance. API Extractor analyzes one entrypoint at a time. One compiler state now covers all of a package's entrypoints, and a forgotten export is accepted only when every same-named declaration in this package that the signature references is nameable from some entrypoint. Nameable means one of:type Props = ConnectionProps,static parse: typeof parse).export * as Xis rewritten to import-then-export in the copy, because API Extractor treats each namespace re-export as a new namespace.@modulestays JSR's summary tag; the copy adds@packageDocumentationbeside it.Existing findings were migrated. Where a type was only an implementation detail it was inlined; where it was part of a public signature it was exported and documented. Doc comments were added across the packages. The API reports are regenerated, and several shrank because namespaces are no longer duplicated.
Impact
@moq/signals:Subscriber,SetterType;ArrayElementfromdom.@moq/watch: the*Outputtypes of the audio and video decoders, the emitter, the sources, sync and broadcast.@moq/publish:*Outputtypes of the sources, the capture and encoder modules, and transcode;FanoutandFanoutProps;EncoderOutputfrom the audio module.@moq/net:Announce.Options,HopSchema.@moq/room:TrackRef,UserInput,Consumed.@moq/qmux:Datagrams,SendStreamOptions, and theWebSocketStreamData,WebSocketStreamOpenEvent,WebSocketStreamCloseEventandWebSocketStreamCloseInfotypes.@moq/json:Window.DecoderConfig(renamed from an unexportedConsumerConfigthat collided withWindow.ConsumerConfig).@moq/p2pand@moq/e2eelose the old declarations check, because only published entrypoints are analyzed.Choices made without the maintainer
ae-missing-release-tagis off:@internalwithstripInternalis the only visibility tier.ae-unresolved-linkis off: JSR resolves{@link}in the comment's lexical scope, while API Extractor resolves links only from entrypoint exports.ae-forgotten-export, described above.Window.DecoderConfigname.KindandStatus, signalsTruthyandFalsy.observedAttributesastypeof OBSERVEDand theattributeChangedCallbackname as(typeof OBSERVED)[number], so the documented constant is the only name.Validation
js/common/api.test.tshas 5 fixtures covering:Installedexport and thewall()doc comment from@moq/clockfails its build withae-forgotten-exportandae-undocumented. Reverted afterwards.just checkandquest checkpass.Follow-ups
ae-unresolved-linkoff, so it may need to resolve or rewrite lexical-scope links.@moq/p2pand@moq/e2ee.(Written by Claude Opus 5.5)
🤖 Generated with Claude Code