feat: extract generate-action-types CLI into @metamask/messenger-cli#8378
feat: extract generate-action-types CLI into @metamask/messenger-cli#8378cryptodev-2s merged 16 commits intomainfrom
Conversation
561db3c to
23f4dfd
Compare
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
23f4dfd to
73e2323
Compare
|
@metamaskbot publish-preview |
73e2323 to
2951c0e
Compare
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
mcmire
left a comment
There was a problem hiding this comment.
A couple of things and then this is good.
|
@metamaskbot publish-preview |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| ); | ||
|
|
||
| const expectedContent = generateActionTypesContent(source); | ||
| const expectedTempFile = actualFile.replace('.ts', '.tmp.ts'); |
There was a problem hiding this comment.
Temp file path breaks with .ts in directory name
Low Severity
actualFile.replace('.ts', '.tmp.ts') uses String.replace which only replaces the first occurrence. If the resolved directory path contains .ts (e.g., a folder like .ts-cache or my.ts.project), the replacement targets the wrong substring, producing an incorrect temp file path. Using a regex with $ anchor or targeting only the file extension would be safer.
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
mcmire
left a comment
There was a problem hiding this comment.
One more thing I noticed.
Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |


Explanation
The
generate-action-typesCLI 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
@metamask/messenger-clipackage with all CLI source files and tests (100% coverage).eslintandtypescriptare peer dependencies (uses the project's versions to avoid formatting mismatches).@metamask/utilsandyargsare regular dependencies.messenger-action-types --generate/messenger-action-types --check@metamask/messengeris unchanged for consumers (non-breaking). The existing CLI and binary remain, with a deprecation warning pointing to the new package.messenger-action-types:generateandmessenger-action-types:check(matchingchangelog:update/changelog:validatepattern).tsxdevDependency from ~49 consumer packages (no longer needed per-package).messenger-action-types:checkandmessenger-action-types:generate.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-docsin a follow-up, consolidating all messenger CLI tooling in one place.References
generate-action-typesCLI tool as subpath export #8264Checklist
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 themessenger-action-typesbinary to generate and check*-method-action-types.tsfiles (including source discovery, JSDoc extraction, optional ESLint formatting, and full test coverage).Updates the monorepo to use the new CLI everywhere: root
lint/lint:fixand CI now runmessenger-action-types:*, and many workspacepackage.jsonscripts are renamed fromgenerate-method-action-typestomessenger-action-types:generate/:checkpointing at the new CLI.Marks the old
@metamask/messengermessenger-generate-action-typesCLI 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.Written by Cursor Bugbot for commit ab18925. This will update automatically on new commits. Configure here.