Commit 0471bbc
feat: extract generate-action-types CLI into @metamask/messenger-cli (#8378)
## Explanation
The `generate-action-types` CLI tool currently lives inside
`@metamask/messenger`. Consumers may use different ESLint or TypeScript
versions, which complicates usage when these are peer dependencies. This
PR extracts the CLI into its own dedicated package
(`@metamask/messenger-cli`) so consumers can install it as a
devDependency with their own ESLint/TypeScript versions.
### Changes
- **New `@metamask/messenger-cli` package** with all CLI source files
and tests (100% coverage).
- `eslint` and `typescript` are peer dependencies (uses the project's
versions to avoid formatting mismatches).
- `@metamask/utils` and `yargs` are regular dependencies.
- CLI-only package — no public API exports, no typedoc.
- Binary: `messenger-action-types --generate` / `messenger-action-types
--check`
- **`@metamask/messenger` is unchanged for consumers** (non-breaking).
The existing CLI and binary remain, with a deprecation warning pointing
to the new package.
- **Per-package scripts** renamed to `messenger-action-types:generate`
and `messenger-action-types:check` (matching
`changelog:update`/`changelog:validate` pattern).
- **Removed `tsx` devDependency** from ~49 consumer packages (no longer
needed per-package).
- **Updated root scripts** to `messenger-action-types:check` and
`messenger-action-types:generate`.
- **Updated CI, docs, and metadata** (`lint-build-test.yml`,
`controller-guidelines.md`, `teams.json`, `CODEOWNERS`,
`eslint.config.mjs`, `yarn.config.cjs`).
This package will also serve as the home for `@metamask/messenger-docs`
in a follow-up, consolidating all messenger CLI tooling in one place.
## References
- Related to #8264
## Checklist
- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] 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
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Mostly build/dev-tooling changes, but it rewires lint/CI scripts and
per-package workflows; mistakes could break generation checks or CI
across many workspaces.
>
> **Overview**
> Introduces a new workspace package, `@metamask/messenger-cli`, that
provides the `messenger-action-types` binary to **generate** and
**check** `*-method-action-types.ts` files (including source discovery,
JSDoc extraction, optional ESLint formatting, and full test coverage).
>
> Updates the monorepo to use the new CLI everywhere: root
`lint`/`lint:fix` and CI now run `messenger-action-types:*`, and many
workspace `package.json` scripts are renamed from
`generate-method-action-types` to
`messenger-action-types:generate`/`:check` pointing at the new CLI.
>
> Marks the old `@metamask/messenger` `messenger-generate-action-types`
CLI as **deprecated** via a runtime warning, and updates
docs/metadata/config (`README`, controller guidelines, `CODEOWNERS`,
`teams.json`, `eslint.config.mjs`, `tsconfig*`, `yarn.config.cjs`) to
register the new package and its build exceptions.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
ab18925. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>1 parent d16a5f7 commit 0471bbc
81 files changed
Lines changed: 2648 additions & 58 deletions
File tree
- .github
- workflows
- docs/code-guidelines
- packages
- account-tree-controller
- accounts-controller
- address-book-controller
- analytics-controller
- analytics-data-regulation-controller
- announcement-controller
- approval-controller
- assets-controllers
- assets-controller
- base-data-service
- claims-controller
- client-controller
- compliance-controller
- config-registry-controller
- connectivity-controller
- core-backend
- delegation-controller
- earn-controller
- ens-controller
- gas-fee-controller
- gator-permissions-controller
- geolocation-controller
- logging-controller
- messenger-cli
- src
- messenger
- src/generate-action-types
- money-account-controller
- multichain-account-service
- name-controller
- network-controller
- network-enablement-controller
- notification-services-controller
- permission-controller
- permission-log-controller
- perps-controller
- phishing-controller
- preferences-controller
- profile-metrics-controller
- profile-sync-controller
- ramps-controller
- remote-feature-flag-controller
- sample-controllers
- seedless-onboarding-controller
- selected-network-controller
- shield-controller
- signature-controller
- social-controllers
- storage-service
- subscription-controller
- transaction-controller
- transaction-pay-controller
- user-operation-controller
- scripts/create-package/package-template
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
| 153 | + | |
152 | 154 | | |
153 | 155 | | |
154 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
457 | 457 | | |
458 | 458 | | |
459 | 459 | | |
460 | | - | |
| 460 | + | |
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
296 | 302 | | |
297 | 303 | | |
298 | 304 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
| 24 | + | |
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
30 | | - | |
| 28 | + | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
0 commit comments