Skip to content

fix(platform-api-docs): scan ESM package declarations - #10968

Open
gaohan1994 wants to merge 3 commits into
MetaMask:mainfrom
gaohan1994:fix/platform-api-docs-esm-scan
Open

gaohan1994 wants to merge 3 commits into
MetaMask:mainfrom
gaohan1994:fix/platform-api-docs-esm-scan

Conversation

@gaohan1994

@gaohan1994 gaohan1994 commented Oct 21, 2026 •

Copy link
Copy Markdown

Explanation

The scan strategy skips ESM-only dependencies because it only matches .d.cts under node_modules/@metamask/*/dist. Match .d.ts in the same scan, retaining the existing path ordering, exclusions, and deduplication. Update the scan summary and README accordingly. Issue #10472 reports no missing documentation in the current repository; this closes the discovery gap for published dependencies.

Tests exercise both extensions, nested declaration paths, symlinked packages, project-root scans, and source preference. A dual-format fixture checks that duplicate actions/events appear once and that selection follows path order across extensions.

Validation

Revalidated on October 28, 2026, after merging upstream main at dd41a78ab9, including the package's Vitest migration and @metamask/node-utils refactor. The scan implementation and all original regression assertions are preserved.

  • Original regression check before the fix: 4 expected failures, 32 passing tests.
  • Complete package suite on the latest merged tree: 5 files / 182 tests passed, with no reported type errors. Coverage meets the unchanged upstream thresholds: 100% statements/functions/lines and 97.62% branches overall (generate.ts: 100% statements/functions/lines, 95.89% branches under Vitest).
  • yarn install --immutable passed.
  • Root yarn lint, package build:all, changelog validation, and git diff --check passed.
  • Validated with Node 24.13.1 and Yarn 4.17.1. No live RPC calls or wallet credentials are needed for this change.

AI assistance

Investigation, implementation, tests, and this description were prepared with OpenAI Codex assistance. Independent AI-assisted reviews check scope and code quality; they do not replace maintainer review.

References

Fixes #10472

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

No breaking API changes or dependency changes are included.


Note

Low Risk
Documentation-generation scan behavior only; no runtime API, auth, or consumer contract changes beyond more complete doc output.

Overview
The scan strategy now picks up .d.ts declaration files under node_modules/@metamask/*/dist (alongside existing .d.cts matches), so messenger actions and events from ESM-only published packages show up in generated platform API docs. Scan logging and the README describe the dual-extension behavior and unchanged deduplication (including stable path order when both formats exist).

Tests are parameterized for .d.cts and .d.ts, with added coverage for nested dist paths, dual-format deduplication, and richer markdown assertions. The changelog records the fix (#10968).

Reviewed by Cursor Bugbot for commit 809a411. Bugbot is set up for automated code reviews on this repo. Configure here.

@gaohan1994
gaohan1994 requested a review from a team as a code owner October 21, 2026 09:25

This branch has not been deployed

No deployments
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.

platform-api-docs: scan strategy misses ESM-only packages, which ship .d.ts rather than .d.cts

1 participant