Skip to content

chore: Update generate-method-action-types script to be used in a single package#7983

Open
GuillaumeRx wants to merge 5 commits intomainfrom
gr/single-package-generate-action-types
Open

chore: Update generate-method-action-types script to be used in a single package#7983
GuillaumeRx wants to merge 5 commits intomainfrom
gr/single-package-generate-action-types

Conversation

@GuillaumeRx
Copy link
Contributor

@GuillaumeRx GuillaumeRx commented Feb 18, 2026

Explanation

This updates the generate-method-action-types to be used in a single package context rather than at the root of the monorepo.

It also adds a positional arg that represents the path of the controller folder. It allows to define a path when the controller is not in the expected src/ folder.

Screenshot 2026-02-18 at 18 15 28

(It's expected that it doesn't find any definition for profile-sync-controller)

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • 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

Note

Low Risk
Build/lint tooling changes only; main risk is CI/dev workflow breakage if a package’s controller sources aren’t under the expected src path or if workspace script wiring is misconfigured.

Overview
Updates generate-method-action-types to run in a single package context instead of scanning the whole monorepo: the script now accepts a positional path (default src) and only searches that directory for MESSENGER_EXPOSED_METHODS.

Wires this into the repo by changing the root generate-method-action-types script to yarn workspaces foreach ... run generate-method-action-types, and adding per-package generate-method-action-types scripts (plus tsx devDependency updates / lockfile entries) so each workspace can invoke the shared generator directly.

Written by Cursor Bugbot for commit 3de1c1e. This will update automatically on new commits. Configure here.

@GuillaumeRx GuillaumeRx force-pushed the gr/single-package-generate-action-types branch from d1723db to 3de1c1e Compare February 18, 2026 18:30
@GuillaumeRx GuillaumeRx marked this pull request as ready for review February 18, 2026 18:30
@GuillaumeRx GuillaumeRx requested review from a team as code owners February 18, 2026 18:30
Copy link

@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.

description:
'Optional path to a specific folder where a controller is located (defaults to src/)',
default: 'src',
})
Copy link

Choose a reason for hiding this comment

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

Positional argument won't parse without command context

Medium Severity

The .positional('path', ...) method in yargs only works inside a .command() builder function. Called at the top level like this, yargs won't bind command-line positional arguments to argv.path. Any custom path passed as a positional arg (e.g., tsx script.ts --fix ./custom-src) will be silently ignored, and the value will either be the default 'src' or undefined depending on internal yargs behavior. If undefined, path.resolve(process.cwd(), undefined) would throw a TypeError. This needs either a default command ($0) wrapping the positional, or conversion to a regular .option().

Fix in Cursor Fix in Web

Copy link
Contributor

@cryptodev-2s cryptodev-2s left a comment

Choose a reason for hiding this comment

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

The changes looks good to me! just one more suggestion can we add this to all packages and add a constraints too here https://github.com/MetaMask/core/blob/main/yarn.config.cjs#L41 ?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments