Skip to content

feat: migrate to @metamask/messenger-cli for action types codegen#28397

Draft
cryptodev-2s wants to merge 2 commits intomainfrom
feat/messenger-cli-action-types
Draft

feat: migrate to @metamask/messenger-cli for action types codegen#28397
cryptodev-2s wants to merge 2 commits intomainfrom
feat/messenger-cli-action-types

Conversation

@cryptodev-2s
Copy link
Copy Markdown
Contributor

@cryptodev-2s cryptodev-2s commented Apr 4, 2026

Description

Migrates from the deprecated messenger-generate-action-types binary in @metamask/messenger to the new standalone @metamask/messenger-cli package.

  • Add @metamask/messenger-cli@^0.1.0 as devDependency
  • Add messenger-action-types:generate script (generates action type files, scans app/, runs prettier)
  • Add messenger-action-types:check script (generates and verifies no diff)
  • Integrate into lint and lint:fix
  • Remove old generate-method-action-types scripts

Changelog

CHANGELOG entry: null

Related issues

Related to MetaMask/core#8378

Manual testing steps

Feature: messenger action types codegen

  Scenario: developer generates action types
    Given the project has controllers with MESSENGER_EXPOSED_METHODS

    When developer runs yarn messenger-action-types:generate
    Then action type files are generated for all controllers

  Scenario: developer checks action types are up to date
    Given the project has controllers with MESSENGER_EXPOSED_METHODS

    When developer runs yarn messenger-action-types:check
    Then the check passes if files are up to date

Screenshots/Recordings

N/A — developer tooling change, no UI impact.

Pre-merge author checklist


Note

Low Risk
Low risk developer-tooling change that updates action-type codegen commands and lint wiring; main risk is CI/lint failures if the new CLI’s output differs or the check script behavior changes.

Overview
Migrates messenger action-types code generation from the deprecated messenger-generate-action-types binary to the new @metamask/messenger-cli.

Updates lint/lint:fix to run the new messenger-action-types:check/messenger-action-types:generate scripts, removes the old generate-method-action-types* scripts, and adds @metamask/messenger-cli@^0.1.0 to dependencies (with corresponding yarn.lock updates).

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-core-platform Core Platform team label Apr 4, 2026
@cryptodev-2s cryptodev-2s self-assigned this Apr 4, 2026
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Apr 4, 2026
@github-actions github-actions bot added the size-S label Apr 4, 2026
@socket-security
Copy link
Copy Markdown

socket-security bot commented Apr 4, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​metamask/​messenger-cli@​0.1.0761007589100

View full report

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 4, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

E2E Fixture Validation — Schema is up to date
18 value mismatches detected (expected — fixture represents an existing user).
View details

@cryptodev-2s cryptodev-2s marked this pull request as ready for review April 4, 2026 15:27
@cryptodev-2s cryptodev-2s enabled auto-merge April 4, 2026 15:27
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 046008c. Configure here.

"a:setup:android": "scripts/perps/agentic/preflight.sh --platform android --clean --wallet-setup"
"a:setup:android": "scripts/perps/agentic/preflight.sh --platform android --clean --wallet-setup",
"messenger-action-types:generate": "messenger-action-types --generate app && prettier --write \"app/**/*-method-action-types.ts\"",
"messenger-action-types:check": "messenger-action-types --generate app; prettier --write \"app/**/*-method-action-types.ts\" && git diff --exit-code \"app/**/*-method-action-types.ts\""
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Semicolon silently ignores generation failure in check script

High Severity

The messenger-action-types:check script uses a semicolon (;) instead of && after the messenger-action-types --generate app command. This means if the generation step fails (non-zero exit), the error is silently ignored, and the script continues to run prettier and git diff --exit-code. Since no files changed (generation failed), git diff --exit-code passes, making the overall lint command succeed even though codegen is broken. The :generate script correctly uses &&, so this inconsistency appears unintentional.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 046008c. Configure here.

@cryptodev-2s cryptodev-2s force-pushed the feat/messenger-cli-action-types branch from 046008c to 0708534 Compare April 7, 2026 13:52
@cryptodev-2s cryptodev-2s marked this pull request as draft April 7, 2026 13:52
auto-merge was automatically disabled April 7, 2026 13:52

Pull request was converted to draft

@github-actions github-actions bot added the risk-low Low testing needed · Low bug introduction risk label Apr 7, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 97%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes in this PR are purely developer tooling changes with no runtime impact:

  1. package.json script renaming: The generate-method-action-types and generate-method-action-types:check scripts were renamed to messenger-action-types:generate and messenger-action-types:check. The lint and lint:fix scripts were updated to reference the new names. These are development-time scripts only.

  2. New devDependency: @metamask/messenger-cli@^0.1.0 was added as a devDependency. This is a CLI tool used only during development for generating TypeScript messenger action types. It has no runtime presence in the app bundle.

  3. yarn.lock: Updated to include the lockfile entry for the new devDependency.

None of these changes affect:

  • Application runtime code or behavior
  • Any user-facing features or flows
  • E2E test scenarios
  • App performance
  • Controllers, Engine, or core architecture
  • Navigation, modals, confirmations, or any shared components

No E2E tests need to run for these purely tooling/DX changes.

Performance Test Selection:
The changes are purely developer tooling (script renaming and a new devDependency CLI tool). There is no runtime code change, no UI component change, no state management change, and no performance-sensitive code path affected. No performance tests are needed.

View GitHub Actions results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template risk-low Low testing needed · Low bug introduction risk size-S team-core-platform Core Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants