Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
9af5f7d
feat: add Messenger API docs site with local search
cryptodev-2s Feb 22, 2026
6f5169f
feat: add --client flag to generate messenger docs from client depend…
cryptodev-2s Feb 22, 2026
09b2c92
refactor: split generate-messenger-docs into modular folder structure
cryptodev-2s Feb 22, 2026
9396df8
refactor: replace sync fs calls with async fs/promises
cryptodev-2s Feb 22, 2026
b91a407
feat: extract messenger-docs into publishable package (#8014)
cryptodev-2s Feb 24, 2026
195a811
docs: update messenger-docs README with monorepo and client usage
cryptodev-2s Feb 24, 2026
15006c5
fix: restore eslint.config.js scripts changes
cryptodev-2s Feb 24, 2026
17adacd
fix: derive GitHub Pages URL from repo owner and name
cryptodev-2s Feb 24, 2026
8ee4add
Merge remote-tracking branch 'origin/main' into feat/messenger-docs-site
cryptodev-2s Mar 17, 2026
726937a
refactor: remove public API exports, CLI-only package
cryptodev-2s Apr 4, 2026
3c7be5e
fix: remove unused custom footer from docusaurus config
cryptodev-2s Apr 4, 2026
5d791fa
fix: replace Euclid font with Geist
cryptodev-2s Apr 4, 2026
82b3e45
refactor: use glob package for file discovery
cryptodev-2s Apr 4, 2026
196cd2c
refactor: use directoryExists from @metamask/utils
cryptodev-2s Apr 4, 2026
c8e5285
refactor: resolve scanDirs in cli.ts instead of generate.ts
cryptodev-2s Apr 4, 2026
e5a9c27
refactor: simplify package scripts, pass project path from root
cryptodev-2s Apr 4, 2026
b4b841a
refactor: rewrite CLI with yargs and execa
cryptodev-2s Apr 4, 2026
2726f4f
Merge remote-tracking branch 'origin/main' into feat/messenger-docs-site
cryptodev-2s Apr 4, 2026
2b77320
fix: update workflow to use renamed docs:messenger script
cryptodev-2s Apr 4, 2026
808fd3c
refactor: merge messenger-docs into messenger-cli
cryptodev-2s Apr 4, 2026
0c0f5e3
fix: restore yarn.config.cjs
cryptodev-2s Apr 4, 2026
8f51c7a
fix: .gitignore
cryptodev-2s Apr 4, 2026
519826e
fix: use existing.kind for dedup list lookup in docs generator
cryptodev-2s Apr 4, 2026
f439b61
fix: handle single-line JSDoc comments in docs extraction
cryptodev-2s Apr 4, 2026
e19d372
refactor: use fileExists from @metamask/utils instead of local helper
cryptodev-2s Apr 4, 2026
2a71f63
fix: escape braces in single-line JSDoc and use fileExists from @meta…
cryptodev-2s Apr 4, 2026
9999b19
fix: use relative font URL for baseUrl compatibility
cryptodev-2s Apr 6, 2026
b18ca18
fix: use bareSpec for non-DTS import resolution in docs extraction
cryptodev-2s Apr 6, 2026
3ca6451
fix: case-insensitive home-package detection in dedup scoring
cryptodev-2s Apr 6, 2026
b450618
fix: guard against empty prefix in dedup home-score check
cryptodev-2s Apr 6, 2026
d690a4f
fix: use exact anchor match to prevent false cross-reference links
cryptodev-2s Apr 6, 2026
925e551
fix: replace broken glob dep with recursive readdir, add discovery tests
cryptodev-2s Apr 6, 2026
2449194
test: add unit and functional tests for docs generator
cryptodev-2s Apr 7, 2026
f9a7d4b
test: improve docs test coverage to ~89%
cryptodev-2s Apr 7, 2026
e805340
test: adjust coverage thresholds for docs module
cryptodev-2s Apr 7, 2026
b6a517f
fix: use singular/plural in docs generation log messages
cryptodev-2s Apr 7, 2026
325e1ab
Merge remote-tracking branch 'origin/main' into feat/messenger-docs-site
cryptodev-2s Apr 15, 2026
5baf2a7
fix: lint misc
cryptodev-2s Apr 15, 2026
b0c93dd
refactor: split messenger-docs back into its own package
cryptodev-2s Apr 15, 2026
0a1c767
fix: restore execa devDependency in messenger-cli
cryptodev-2s Apr 15, 2026
4b5247d
docs: run readme-content:update
cryptodev-2s Apr 15, 2026
6d28783
refactor: merge hashbang override into existing scripts entry
cryptodev-2s Apr 15, 2026
3dc5593
fix: prettier formatting for messenger-docs package.json
cryptodev-2s Apr 15, 2026
0c5d2c0
test: boost extraction coverage to ~89% with additional edge case tests
cryptodev-2s Apr 15, 2026
2e2a7a0
fix: remove .DS_Store
cryptodev-2s Apr 15, 2026
c904bee
fix: handle single-line @deprecated, dedup kind mismatch, remove dupl…
cryptodev-2s Apr 15, 2026
cbae825
fix: lint:misc
cryptodev-2s Apr 15, 2026
166e62f
fix: correct test assertion and prettier formatting
cryptodev-2s Apr 15, 2026
b441b46
fix: revert eslint glob broadening, strip all tags in single-line JSDoc
cryptodev-2s Apr 15, 2026
0e30615
Merge branch 'main' into feat/messenger-docs-site
mcmire Apr 23, 2026
170f9ea
Bump all Docusaurus dependencies
mcmire Apr 23, 2026
b7921f1
Rename template/ to site/ to better match intended usage
mcmire Apr 23, 2026
e940db5
Add tsx to messenger-docs so it's possible to run the CLI within the …
mcmire Apr 23, 2026
f95346b
Show stack traces for 'file not found' warnings
mcmire Apr 23, 2026
985c43c
TEMPORARILY force-upgrade webpackbar to v7
mcmire Apr 23, 2026
bda8e73
Upgrade auto-changelog
mcmire Apr 23, 2026
26e79fe
Update README and help text to reflect complete intended usage
mcmire Apr 23, 2026
da27777
Address lint issues
mcmire Apr 23, 2026
cba00c2
Remove top-level package scripts
mcmire Apr 23, 2026
f27d25e
Revert "Remove top-level package scripts"
mcmire May 6, 2026
05f2902
Fix files in messenger-docs package.json
mcmire May 6, 2026
96578b1
Fix eslint.config.mjs
mcmire May 6, 2026
af38898
Fix test
mcmire May 6, 2026
4ffd287
Merge branch 'main' into feat/messenger-docs-site
mcmire May 6, 2026
3923f7d
yarn dedupe
mcmire May 6, 2026
b831c27
Refactor messenger-cli parse-source to use ts-morph
cryptodev-2s May 12, 2026
fbb0797
Merge branch 'main' into feat/messenger-docs-site
cryptodev-2s May 12, 2026
187727a
Revert "Refactor messenger-cli parse-source to use ts-morph"
cryptodev-2s May 12, 2026
5a6bf65
Refactor messenger-docs extraction to use ts-morph
cryptodev-2s May 12, 2026
b6d3b4f
Rename docs:messenger to docs:messenger:build and split generate()
cryptodev-2s May 12, 2026
3d02e9f
Rename resolveControllerName to collectStringConstants
cryptodev-2s May 12, 2026
f3adf53
Anchor messenger-docs extraction on Messenger declarations
cryptodev-2s May 12, 2026
baffffe
Update Messenger API Docs workflow to use renamed script
cryptodev-2s May 12, 2026
dea72a3
rename: use platform instead of messenger
cryptodev-2s May 13, 2026
2b9ec1d
Merge branch 'main' into feat/messenger-docs-site
cryptodev-2s May 13, 2026
fbc0aed
Resolve repo default branch instead of hardcoding main
cryptodev-2s May 13, 2026
b334965
Raise messenger-docs coverage back above original threshold
cryptodev-2s May 13, 2026
ccdc8dc
Stamp project label and commit SHA on generated docs
cryptodev-2s May 13, 2026
e5cef32
Merge branch 'main' into feat/messenger-docs-site
cryptodev-2s May 13, 2026
89832b1
Rename messenger-docs types and helpers for clarity
cryptodev-2s May 13, 2026
36158b5
Simplify the Actions/Events type walker
cryptodev-2s May 13, 2026
b664468
Return capability-type AST nodes directly from the messenger walk
cryptodev-2s May 13, 2026
c7cde64
Drop messenger-docs package.json config in favor of CLI flags
cryptodev-2s May 13, 2026
66c8d81
Use ts-morph's JSDoc API instead of parsing raw comment text
cryptodev-2s May 13, 2026
a6585b0
Bring messenger-docs coverage to 100% lines, 93%+ branches
cryptodev-2s May 15, 2026
9d2fbf7
Use the glob package for messenger-docs file discovery
cryptodev-2s May 15, 2026
40ad9c3
Rename messenger-docs to platform-api-docs
cryptodev-2s May 15, 2026
3f115e7
Fix broken npm URL for non-@metamask node_modules sources
cryptodev-2s May 15, 2026
1b1b547
Merge remote-tracking branch 'origin/main' into feat/messenger-docs-site
cryptodev-2s May 15, 2026
34c820f
Deploy Platform API docs to a /platform-api subdirectory
cryptodev-2s May 15, 2026
c767ae0
Accept all three indexed-access forms for handler resolution
cryptodev-2s May 15, 2026
671e21a
Render documented @param and @returns from action JSDoc
cryptodev-2s May 15, 2026
a85fa0f
Resolve capability types across files via ts-morph's type checker
cryptodev-2s May 15, 2026
13ccf66
Narrow getPropertyMember return type to PropertySignature
cryptodev-2s May 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
/packages/error-reporting-service @MetaMask/core-platform
/packages/eth-json-rpc-middleware @MetaMask/core-platform
/packages/messenger @MetaMask/core-platform
/packages/messenger-docs @MetaMask/core-platform
/packages/sample-controllers @MetaMask/core-platform
/packages/polling-controller @MetaMask/core-platform
/packages/preferences-controller @MetaMask/core-platform
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/messenger-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Messenger API Docs
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.

What do you think about calling this "Deploy Platform API Docs" and calling this file deploy-platform-api-docs.yml? Just want to make sure we stick with this terminology as much as we can.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Renamed in 89832b1. The file is now .github/workflows/deploy-platform-api-docs.yml and the workflow's display name is "Deploy Platform API Docs". The job names and step labels inside it also got updated from "Messenger API docs" → "Platform API docs" in 40ad9c3 (the package rename).


on:
push:
branches: [main]
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build-docs:
name: Build Messenger API docs
runs-on: ubuntu-latest
steps:
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v2
with:
is-high-risk-environment: false

- name: Generate and build Messenger docs
run: yarn docs:messenger:build
Comment thread
cursor[bot] marked this conversation as resolved.
Outdated
env:
DOCS_URL: https://${{ github.repository_owner }}.github.io
DOCS_BASE_URL: /${{ github.event.repository.name }}/

- name: Upload build artifact (PR)
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: messenger-api-docs
path: .messenger-docs/build/
retention-days: 7

- name: Upload Pages artifact (main)
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: actions/upload-pages-artifact@v3
with:
path: .messenger-docs/build/

deploy:
name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
needs: build-docs
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,12 @@ scripts/coverage
!.yarn/versions

# typescript
packages/*/*.tsbuildinfo
packages/*/*.tsbuildinfo

# Messenger API docs (generated)
.messenger-docs/

# Emacs
\#*\#
.#*
.~
Comment thread
cursor[bot] marked this conversation as resolved.
Outdated
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Each package in this repository has its own README where you can find installati
- [`@metamask/logging-controller`](packages/logging-controller)
- [`@metamask/message-manager`](packages/message-manager)
- [`@metamask/messenger`](packages/messenger)
- [`@metamask/messenger-docs`](packages/messenger-docs)
- [`@metamask/multichain-account-service`](packages/multichain-account-service)
- [`@metamask/multichain-api-middleware`](packages/multichain-api-middleware)
- [`@metamask/multichain-network-controller`](packages/multichain-network-controller)
Expand Down Expand Up @@ -148,6 +149,7 @@ linkStyle default opacity:0.5
logging_controller(["@metamask/logging-controller"]);
message_manager(["@metamask/message-manager"]);
messenger(["@metamask/messenger"]);
messenger_docs(["@metamask/messenger-docs"]);
multichain_account_service(["@metamask/multichain-account-service"]);
multichain_api_middleware(["@metamask/multichain-api-middleware"]);
multichain_network_controller(["@metamask/multichain-network-controller"]);
Expand Down
13 changes: 12 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const config = createConfig([
'merged-packages/**',
'.yarn/**',
'scripts/create-package/package-template/**',
'.messenger-docs/**',
'packages/messenger-docs/template/**',
Comment thread
cursor[bot] marked this conversation as resolved.
Outdated
],
},
{
Expand Down Expand Up @@ -43,9 +45,18 @@ const config = createConfig([
'**/tests/**/*.{js,ts}',
'scripts/*.ts',
'scripts/create-package/**/*.ts',
'packages/messenger-docs/src/**/*.ts',
],
extends: [nodejs],
},
{
files: ['packages/messenger-docs/src/cli.ts'],
rules: {
// The bin field points to dist/cli.mjs but the source is src/cli.ts.
// Without convertPath, n/hashbang cannot correlate the two.
'n/hashbang': 'off',
},
},
{
files: ['**/*.{js,cjs}'],
languageOptions: {
Expand Down Expand Up @@ -125,7 +136,7 @@ const config = createConfig([
},
},
{
files: ['scripts/*.ts'],
files: ['scripts/**/*.ts'],
rules: {
// Scripts may be self-executable and thus have hashbangs.
'n/hashbang': 'off',
Expand Down
13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"changelog:update": "yarn workspaces foreach --all --no-private --parallel --interlaced --verbose run changelog:update",
"changelog:validate": "yarn workspaces foreach --all --no-private --parallel --interlaced --verbose run changelog:validate",
"create-package": "tsx scripts/create-package",
"docs:messenger:build": "yarn workspace @metamask/messenger-docs docs:build",
"docs:messenger:dev": "yarn workspace @metamask/messenger-docs docs:dev",
"docs:messenger:generate": "yarn workspace @metamask/messenger-docs docs:generate",
"docs:messenger:serve": "yarn workspace @metamask/messenger-docs docs:serve",
"generate-method-action-types": "yarn workspaces foreach --all --parallel --interlaced --verbose run generate-method-action-types",
"lint": "yarn lint:eslint && echo && yarn lint:misc --check && yarn constraints && yarn lint:dependencies && yarn lint:teams && yarn generate-method-action-types --check",
"lint:dependencies": "depcheck && yarn dedupe --check",
Expand All @@ -45,7 +49,11 @@
},
"resolutions": {
"elliptic@6.5.4": "^6.5.7",
"eslint-import-resolver-typescript": "3.7.0",
"eslint-plugin-import-x": "4.6.1",
"eslint-plugin-n": "17.15.1",
"fast-xml-parser@^4.3.4": "^4.4.1",
"prettier@npm:^3.3.3": "3.4.2",
"ws@7.4.6": "^7.5.10"
},
"devDependencies": {
Expand Down Expand Up @@ -107,9 +115,10 @@
"@lavamoat/preinstall-always-fail": false,
"@keystonehq/bc-ur-registry-eth>hdkey>secp256k1": true,
"babel-runtime>core-js": false,
"eslint-import-resolver-typescript>unrs-resolver": false,
"eslint-plugin-import-x>unrs-resolver": false,
"simple-git-hooks": false,
"tsx>esbuild": false,
"eslint-plugin-import-x>unrs-resolver": false
"tsx>esbuild": false
}
}
}
14 changes: 14 additions & 0 deletions packages/messenger-docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Initial release of the messenger-docs package

[Unreleased]: https://github.com/MetaMask/core/
21 changes: 21 additions & 0 deletions packages/messenger-docs/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 MetaMask

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
82 changes: 82 additions & 0 deletions packages/messenger-docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# `@metamask/messenger-docs`

Generate and serve Messenger API documentation for MetaMask controller packages.

Scans TypeScript source files and declaration files for messenger action/event types, then generates a searchable Docusaurus site with per-namespace documentation.

## Installation

`yarn add @metamask/messenger-docs`

or

`npm install @metamask/messenger-docs`

## Usage

### Core monorepo

The package includes workspace scripts for development:

```bash
# Generate docs from all packages
yarn workspace @metamask/messenger-docs docs:generate

# Generate + start dev server with hot reload
yarn workspace @metamask/messenger-docs docs:dev

# Generate + build static site
yarn workspace @metamask/messenger-docs docs:build

# Generate + build + serve
yarn workspace @metamask/messenger-docs docs:serve
```

### Client projects (Extension, Mobile)

Add `@metamask/messenger-docs` as a dev dependency, then add a script to your `package.json`:

```json
{
"scripts": {
"docs:messenger": "messenger-docs --serve"
}
}
```

By default, the tool scans `src/` for `.ts` files and `node_modules/@metamask/` for `.d.cts` declaration files. If your project has source files in other directories, configure `scanDirs` in `package.json`:

```json
{
"messenger-docs": {
"scanDirs": ["app", "src"]
}
}
```

Or pass `--scan-dir` flags:

```bash
messenger-docs --scan-dir app --scan-dir shared --serve
```

### CLI options

```
messenger-docs [project-path] [options]

Arguments:
project-path Path to the project to scan (default: current directory)

Options:
--build Generate docs and build static site
--serve Generate docs, build, and serve static site
--dev Generate docs and start dev server with hot reload
--scan-dir <dir> Extra source directory to scan (repeatable)
--output <dir> Output directory (default: <project-path>/.messenger-docs)
--help Show this help message
```

## Contributing

This package is part of a monorepo. Instructions for contributing can be found in the [monorepo README](https://github.com/MetaMask/core#readme).
29 changes: 29 additions & 0 deletions packages/messenger-docs/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/configuration
*/

const merge = require('deepmerge');
const path = require('path');

const baseConfig = require('../../jest.config.packages');

const displayName = path.basename(__dirname);

module.exports = merge(baseConfig, {
// The display name when running multiple projects
displayName,

// Allow running without any test files
passWithNoTests: true,

// An object that configures minimum threshold enforcement for coverage results
coverageThreshold: {
global: {
branches: 0,
functions: 0,
lines: 0,
statements: 0,
},
},
});
Loading
Loading