Repository navigation
fix(platform-api-docs): scan ESM package declarations - #10968
Open
gaohan1994 wants to merge 3 commits into
Open
gaohan1994 wants to merge 3 commits into
gaohan1994 wants to merge 3 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
The
scanstrategy skips ESM-only dependencies because it only matches.d.ctsundernode_modules/@metamask/*/dist. Match.d.tsin 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-utilsrefactor. The scan implementation and all original regression assertions are preserved.generate.ts: 100% statements/functions/lines, 95.89% branches under Vitest).yarn install --immutablepassed.yarn lint, packagebuild:all, changelog validation, andgit diff --checkpassed.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
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
scanstrategy now picks up.d.tsdeclaration files undernode_modules/@metamask/*/dist(alongside existing.d.ctsmatches), 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.ctsand.d.ts, with added coverage for nesteddistpaths, 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.