From 6de1cb83ff058412695c7c96c0118e5e533baaa3 Mon Sep 17 00:00:00 2001 From: Salah-Eddine Saakoun Date: Wed, 1 Apr 2026 22:59:06 +0200 Subject: [PATCH 01/10] chore: use @metamask/messenger CLI for action type generation - Delete local scripts/generate-method-action-types.ts (755 lines) - Bump @metamask/messenger from ^0.3.0 to ^1.1.0 - Remove tsx devDependency (no longer needed) - Update generate script to use messenger-generate-action-types CLI --- CHANGELOG.md | 1 + package.json | 8 +- scripts/generate-method-action-types.ts | 755 ------------------ ...nsactionsController-method-action-types.ts | 2 +- yarn.lock | 334 +------- 5 files changed, 24 insertions(+), 1076 deletions(-) delete mode 100755 scripts/generate-method-action-types.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index b3687759..1a3bb73e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **BREAKING:** Upgrade TypeScript from `~4.8.4` to `~5.3.3` ([#574](https://github.com/MetaMask/smart-transactions-controller/pull/574)) - Consumers on TypeScript 4.x may experience type errors and should upgrade to TypeScript 5.x. +- Bump `@metamask/messenger` from `^0.3.0` to `^1.1.0` ## [23.0.0] diff --git a/package.json b/package.json index f43a8079..a303563e 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ ], "scripts": { "build": "ts-bridge --project tsconfig.build.json --clean", - "generate-method-action-types": "tsx ./scripts/generate-method-action-types.ts ./src", + "generate-method-action-types": "messenger-generate-action-types", "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn generate-method-action-types --check", "lint:changelog": "auto-changelog validate --prettier", "lint:eslint": "eslint . --cache --ext js,ts", @@ -50,7 +50,7 @@ "@metamask/controller-utils": "^11.0.0", "@metamask/eth-json-rpc-provider": "^4.1.6", "@metamask/eth-query": "^4.0.0", - "@metamask/messenger": "^0.3.0", + "@metamask/messenger": "^1.1.0", "@metamask/network-controller": "^30.0.0", "@metamask/polling-controller": "^16.0.0", "@metamask/remote-feature-flag-controller": "^4.1.0", @@ -96,7 +96,6 @@ "prettier-plugin-packagejson": "^2.4.3", "sinon": "^9.2.4", "ts-jest": "^29.1.4", - "tsx": "^4.20.5", "typescript": "~5.3.3", "yargs": "^17.7.2" }, @@ -129,8 +128,7 @@ "@metamask/controller-utils>ethereumjs-util>ethereum-cryptography>secp256k1": false, "@metamask/controller-utils>babel-runtime>core-js": false, "@metamask/transaction-controller>@metamask/core-backend>@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography>keccak": false, - "@metamask/transaction-controller>@metamask/core-backend>@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography>secp256k1": false, - "tsx>esbuild": false + "@metamask/transaction-controller>@metamask/core-backend>@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography>secp256k1": false } } } diff --git a/scripts/generate-method-action-types.ts b/scripts/generate-method-action-types.ts deleted file mode 100755 index 93a999f0..00000000 --- a/scripts/generate-method-action-types.ts +++ /dev/null @@ -1,755 +0,0 @@ -#!yarn tsx -/* eslint-disable no-restricted-globals */ -/* eslint-disable @typescript-eslint/await-thenable */ -/* eslint-disable import/no-nodejs-modules */ - -import { assert, hasProperty, isObject } from '@metamask/utils'; -import { ESLint } from 'eslint'; -import * as fs from 'fs'; -import * as path from 'path'; -import * as ts from 'typescript'; -import yargs from 'yargs'; - -type MethodInfo = { - name: string; - jsDoc: string; - signature: string; -}; - -type ControllerInfo = { - name: string; - filePath: string; - exposedMethods: string[]; - methods: MethodInfo[]; -}; - -/** - * The parsed command-line arguments. - */ -type CommandLineArguments = { - /** - * Whether to check if the action types files are up to date. - */ - check: boolean; - /** - * Whether to fix the action types files. - */ - fix: boolean; - /** - * Optional path to a specific controller to process. - */ - controllerPath: string; -}; - -/** - * Uses `yargs` to parse the arguments given to the script. - * - * @returns The command line arguments. - */ -async function parseCommandLineArguments(): Promise { - const { - check, - fix, - path: controllerPath, - } = await yargs(process.argv.slice(2)) - .command( - '$0 [path]', - 'Generate method action types for a controller messenger', - (yargsInstance) => { - yargsInstance.positional('path', { - type: 'string', - description: 'Path to the folder where controllers are located', - default: 'src', - }); - }, - ) - .option('check', { - type: 'boolean', - description: 'Check if generated action type files are up to date', - default: false, - }) - .option('fix', { - type: 'boolean', - description: 'Generate/update action type files', - default: false, - }) - .help() - .check((argv) => { - if (!argv.check && !argv.fix) { - throw new Error('Either --check or --fix must be provided.\n'); - } - return true; - }).argv; - - return { - check, - fix, - // TypeScript doesn't narrow the type of `controllerPath` even though we defined it as a string in yargs, so we need to cast it here. - controllerPath: controllerPath as string, - }; -} - -/** - * Checks if generated action types files are up to date. - * - * @param controllers - Array of controller information objects. - * @param eslint - The ESLint instance to use for formatting. - */ -async function checkActionTypesFiles( - controllers: ControllerInfo[], - eslint: ESLint, -): Promise { - let hasErrors = false; - - // Track files that exist and their corresponding temp files - const fileComparisonJobs: { - expectedTempFile: string; - actualFile: string; - baseFileName: string; - }[] = []; - - try { - // Check each controller and prepare comparison jobs - for (const controller of controllers) { - console.log(`\nšŸ”§ Checking ${controller.name}...`); - const outputDir = path.dirname(controller.filePath); - const baseFileName = path.basename(controller.filePath, '.ts'); - const actualFile = path.join( - outputDir, - `${baseFileName}-method-action-types.ts`, - ); - - const expectedContent = generateActionTypesContent(controller); - const expectedTempFile = actualFile.replace('.ts', '.tmp.ts'); - - try { - // Check if actual file exists first - await fs.promises.access(actualFile); - - // Write expected content to temp file - await fs.promises.writeFile(expectedTempFile, expectedContent, 'utf8'); - - // Add to comparison jobs - fileComparisonJobs.push({ - expectedTempFile, - actualFile, - baseFileName, - }); - } catch (error) { - if ((error as NodeJS.ErrnoException).code === 'ENOENT') { - console.error( - `āŒ ${baseFileName}-method-action-types.ts does not exist`, - ); - } else { - console.error( - `āŒ Error reading ${baseFileName}-method-action-types.ts:`, - error, - ); - } - hasErrors = true; - } - } - - // Run ESLint on all files at once if we have comparisons to make - if (fileComparisonJobs.length > 0) { - console.log('\nšŸ“ Running ESLint to compare files...'); - - const results = await eslint.lintFiles( - fileComparisonJobs.map((job) => job.expectedTempFile), - ); - await ESLint.outputFixes(results); - - // Compare expected vs actual content - for (const job of fileComparisonJobs) { - const expectedContent = await fs.promises.readFile( - job.expectedTempFile, - 'utf8', - ); - const actualContent = await fs.promises.readFile( - job.actualFile, - 'utf8', - ); - - if (expectedContent === actualContent) { - console.log( - `āœ… ${job.baseFileName}-method-action-types.ts is up to date`, - ); - } else { - console.error( - `āŒ ${job.baseFileName}-method-action-types.ts is out of date`, - ); - hasErrors = true; - } - } - } - } finally { - // Clean up temp files - for (const job of fileComparisonJobs) { - try { - await fs.promises.unlink(job.expectedTempFile); - } catch { - // Ignore cleanup errors - } - } - } - - if (hasErrors) { - console.error('\nšŸ’„ Some action type files are out of date or missing.'); - console.error( - 'Run `yarn generate-method-action-types --fix` to update them.', - ); - process.exitCode = 1; - } else { - console.log('\nšŸŽ‰ All action type files are up to date!'); - } -} - -/** - * Main entry point for the script. - */ -async function main(): Promise { - const { fix, controllerPath } = await parseCommandLineArguments(); - - console.log('šŸ” Searching for controllers with MESSENGER_EXPOSED_METHODS...'); - - const controllers = await findControllersWithExposedMethods(controllerPath); - - if (controllers.length === 0) { - console.log('āš ļø No controllers found with MESSENGER_EXPOSED_METHODS'); - return; - } - - console.log( - `šŸ“¦ Found ${controllers.length} controller(s) with exposed methods`, - ); - - const eslint = new ESLint({ - fix: true, - errorOnUnmatchedPattern: false, - }); - - if (fix) { - await generateAllActionTypesFiles(controllers, eslint); - console.log('\nšŸŽ‰ All action types generated successfully!'); - } else { - // -check mode: check files - await checkActionTypesFiles(controllers, eslint); - } -} - -/** - * Check if a path is a directory. - * - * @param pathValue - The path to check. - * @returns True if the path is a directory, false otherwise. - * @throws If an error occurs other than the path not existing. - */ -async function isDirectory(pathValue: string): Promise { - try { - const stats = await fs.promises.stat(pathValue); - return stats.isDirectory(); - } catch (error) { - if ( - isObject(error) && - hasProperty(error, 'code') && - error.code === 'ENOENT' - ) { - return false; - } - - throw error; - } -} - -/** - * Finds all controller files that have MESSENGER_EXPOSED_METHODS constants. - * - * @param controllerPath - Path to the folder where controllers are located. - * @returns A list of controller information objects. - */ -async function findControllersWithExposedMethods( - controllerPath: string, -): Promise { - const srcPath = path.resolve(process.cwd(), controllerPath); - const controllers: ControllerInfo[] = []; - - if (!(await isDirectory(srcPath))) { - throw new Error(`The specified path is not a directory: ${srcPath}`); - } - - const srcFiles = await fs.promises.readdir(srcPath); - - for (const file of srcFiles) { - if (!file.endsWith('.ts') || file.endsWith('.test.ts')) { - continue; - } - - const filePath = path.join(srcPath, file); - const content = await fs.promises.readFile(filePath, 'utf8'); - - if (content.includes('MESSENGER_EXPOSED_METHODS')) { - const controllerInfo = await parseControllerFile(filePath); - if (controllerInfo) { - controllers.push(controllerInfo); - } - } - } - - return controllers; -} - -/** - * Context for AST visiting. - */ -type VisitorContext = { - exposedMethods: string[]; - className: string; - methods: MethodInfo[]; - sourceFile: ts.SourceFile; -}; - -/** - * Visits AST nodes to find exposed methods and controller class. - * - * @param context - The visitor context. - * @returns A function to visit nodes. - */ -function createASTVisitor(context: VisitorContext): (node: ts.Node) => void { - /** - * Visits AST nodes to find exposed methods and controller class. - * - * @param node - The AST node to visit. - */ - function visitNode(node: ts.Node): void { - if (ts.isVariableStatement(node)) { - const declaration = node.declarationList.declarations[0]; - if ( - ts.isIdentifier(declaration.name) && - declaration.name.text === 'MESSENGER_EXPOSED_METHODS' - ) { - if (declaration.initializer) { - let arrayExpression: ts.ArrayLiteralExpression | undefined; - - // Handle direct array literal - if (ts.isArrayLiteralExpression(declaration.initializer)) { - arrayExpression = declaration.initializer; - } - // Handle "as const" assertion: expression is wrapped in type assertion - else if ( - ts.isAsExpression(declaration.initializer) && - ts.isArrayLiteralExpression(declaration.initializer.expression) - ) { - arrayExpression = declaration.initializer.expression; - } - - if (arrayExpression) { - context.exposedMethods = arrayExpression.elements - .filter(ts.isStringLiteral) - .map((element) => element.text); - } - } - } - } - - // Find the controller or service class - if (ts.isClassDeclaration(node) && node.name) { - const classText = node.name.text; - if (classText.includes('Controller') || classText.includes('Service')) { - context.className = classText; - - // Extract method info for exposed methods - const seenMethods = new Set(); - for (const member of node.members) { - if ( - ts.isMethodDeclaration(member) && - member.name && - ts.isIdentifier(member.name) - ) { - const methodName = member.name.text; - if ( - context.exposedMethods.includes(methodName) && - !seenMethods.has(methodName) - ) { - seenMethods.add(methodName); - const jsDoc = extractJSDoc(member, context.sourceFile); - const signature = extractMethodSignature(member); - context.methods.push({ - name: methodName, - jsDoc, - signature, - }); - } - } - } - } - } - - ts.forEachChild(node, visitNode); - } - - return visitNode; -} - -/** - * Create a TypeScript program for the given file by locating the nearest - * tsconfig.json. - * - * @param filePath - Absolute path to the source file. - * @returns A TypeScript program, or null if no tsconfig was found. - */ -function createProgramForFile(filePath: string): ts.Program | null { - const configPath = ts.findConfigFile( - path.dirname(filePath), - ts.sys.fileExists.bind(ts.sys), - 'tsconfig.json', - ); - if (!configPath) { - return null; - } - - const { config, error } = ts.readConfigFile( - configPath, - ts.sys.readFile.bind(ts.sys), - ); - - if (error) { - return null; - } - - const parsedConfig = ts.parseJsonConfigFileContent( - config, - ts.sys, - path.dirname(configPath), - ); - - return ts.createProgram({ - rootNames: parsedConfig.fileNames, - options: parsedConfig.options, - }); -} - -/** - * Find a class declaration with the given name in a source file. - * - * @param sourceFile - The source file to search. - * @param className - The class name to look for. - * @returns The class declaration node, or null if not found. - */ -function findClassInSourceFile( - sourceFile: ts.SourceFile, - className: string, -): ts.ClassDeclaration | null { - return ( - sourceFile.statements.find( - (node): node is ts.ClassDeclaration => - ts.isClassDeclaration(node) && node.name?.text === className, - ) ?? null - ); -} - -/** - * Search through the class hierarchy of a TypeScript type to find the - * declaration of a method with the given name. - * - * @param classType - The class type to search. - * @param methodName - The method name to look for. - * @returns The method declaration node, or null if not found. - */ -function findMethodInHierarchy( - classType: ts.Type, - methodName: string, -): ts.MethodDeclaration | null { - const symbol = classType.getProperty(methodName); - if (!symbol) { - return null; - } - - const declarations = symbol.getDeclarations(); - if (!declarations) { - return null; - } - - for (const declaration of declarations) { - if (ts.isMethodDeclaration(declaration)) { - return declaration; - } - } - - return null; -} - -/** - * Parses a controller file to extract exposed methods and their metadata. - * - * @param filePath - Path to the controller file to parse. - * @returns Controller information or null if parsing fails. - */ -async function parseControllerFile( - filePath: string, -): Promise { - try { - const content = await fs.promises.readFile(filePath, 'utf8'); - const sourceFile = ts.createSourceFile( - filePath, - content, - ts.ScriptTarget.Latest, - true, - ); - - const context: VisitorContext = { - exposedMethods: [], - className: '', - methods: [], - sourceFile, - }; - - createASTVisitor(context)(sourceFile); - - if (context.exposedMethods.length === 0 || !context.className) { - return null; - } - - // For exposed methods not found directly in the class body, attempt to - // locate them in the inheritance hierarchy using the type checker. - const foundMethodNames = new Set( - context.methods.map((method) => method.name), - ); - - const inheritedMethodNames = context.exposedMethods.filter( - (name) => !foundMethodNames.has(name), - ); - - if (inheritedMethodNames.length > 0) { - const program = createProgramForFile(filePath); - const checker = program?.getTypeChecker(); - const programSourceFile = program?.getSourceFile(filePath); - - assert( - checker, - `Type checker could not be created for "${filePath}". Ensure a valid tsconfig.json is present.`, - ); - - assert( - programSourceFile, - `Source file "${filePath}" not found in program.`, - ); - - const classNode = findClassInSourceFile( - programSourceFile, - context.className, - ); - - assert( - classNode, - `Class "${context.className}" not found in "${filePath}".`, - ); - - const classType = checker.getTypeAtLocation(classNode); - for (const methodName of inheritedMethodNames) { - const methodDeclaration = findMethodInHierarchy(classType, methodName); - - const jsDoc = methodDeclaration - ? extractJSDoc(methodDeclaration, methodDeclaration.getSourceFile()) - : ''; - context.methods.push({ name: methodName, jsDoc, signature: '' }); - } - } - - return { - name: context.className, - filePath, - exposedMethods: context.exposedMethods, - methods: context.methods, - }; - } catch (error) { - console.error(`Error parsing ${filePath}:`, error); - return null; - } -} - -/** - * Extracts JSDoc comment from a method declaration. - * - * @param node - The method declaration node. - * @param sourceFile - The source file. - * @returns The JSDoc comment. - */ -function extractJSDoc( - node: ts.MethodDeclaration, - sourceFile: ts.SourceFile, -): string { - const jsDocTags = ts.getJSDocCommentsAndTags(node); - if (jsDocTags.length === 0) { - return ''; - } - - const jsDoc = jsDocTags[0]; - if (ts.isJSDoc(jsDoc)) { - const fullText = sourceFile.getFullText(); - const start = jsDoc.getFullStart(); - const end = jsDoc.getEnd(); - const rawJsDoc = fullText.substring(start, end).trim(); - return formatJSDoc(rawJsDoc); - } - - return ''; -} - -/** - * Formats JSDoc comments to have consistent indentation for the generated file. - * - * @param rawJsDoc - The raw JSDoc comment from the source. - * @returns The formatted JSDoc comment. - */ -function formatJSDoc(rawJsDoc: string): string { - const lines = rawJsDoc.split('\n'); - const formattedLines: string[] = []; - - for (let i = 0; i < lines.length; i++) { - const line = lines[i]; - if (i === 0) { - // First line should be /** - formattedLines.push('/**'); - } else if (i === lines.length - 1) { - // Last line should be */ - formattedLines.push(' */'); - } else { - // Middle lines should start with ' * ' - const trimmed = line.trim(); - if (trimmed.startsWith('*')) { - // Remove existing * and normalize - const content = trimmed.substring(1).trim(); - formattedLines.push(content ? ` * ${content}` : ' *'); - } else { - // Handle lines that don't start with * - formattedLines.push(trimmed ? ` * ${trimmed}` : ' *'); - } - } - } - - return formattedLines.join('\n'); -} - -/** - * Extracts method signature as a string for the handler type. - * - * @param node - The method declaration node. - * @returns The method signature. - */ -function extractMethodSignature(node: ts.MethodDeclaration): string { - // Since we're just using the method reference in the handler type, - // we don't need the full signature - just return the method name - // The actual signature will be inferred from the controller class - return node.name ? (node.name as ts.Identifier).text : ''; -} - -/** - * Generates action types files for all controllers. - * - * @param controllers - Array of controller information objects. - * @param eslint - The ESLint instance to use for formatting. - */ -async function generateAllActionTypesFiles( - controllers: ControllerInfo[], - eslint: ESLint, -): Promise { - const outputFiles: string[] = []; - - // Write all files first - for (const controller of controllers) { - console.log(`\nšŸ”§ Processing ${controller.name}...`); - const outputDir = path.dirname(controller.filePath); - const baseFileName = path.basename(controller.filePath, '.ts'); - const outputFile = path.join( - outputDir, - `${baseFileName}-method-action-types.ts`, - ); - - const generatedContent = generateActionTypesContent(controller); - await fs.promises.writeFile(outputFile, generatedContent, 'utf8'); - outputFiles.push(outputFile); - console.log(`āœ… Generated action types for ${controller.name}`); - } - - // Run ESLint on all the actual files - if (outputFiles.length > 0) { - console.log('\nšŸ“ Running ESLint on generated files...'); - - const results = await eslint.lintFiles(outputFiles); - await ESLint.outputFixes(results); - const errors = ESLint.getErrorResults(results); - if (errors.length > 0) { - console.error('āŒ ESLint errors:', errors); - process.exitCode = 1; - } else { - console.log('āœ… ESLint formatting applied'); - } - } -} - -/** - * Generates the content for the action types file. - * - * @param controller - The controller information object. - * @returns The content for the action types file. - */ -function generateActionTypesContent(controller: ControllerInfo): string { - const baseFileName = path.basename(controller.filePath, '.ts'); - const controllerImportPath = `./${baseFileName}`; - - let content = `/** - * This file is auto generated by \`scripts/generate-method-action-types.ts\`. - * Do not edit manually. - */ - -import type { ${controller.name} } from '${controllerImportPath}'; - -`; - - const actionTypeNames: string[] = []; - - // Generate action types for each exposed method - for (const method of controller.methods) { - const actionTypeName = `${controller.name}${capitalize(method.name)}Action`; - const actionString = `${controller.name}:${method.name}`; - - actionTypeNames.push(actionTypeName); - - // Add the JSDoc if available - if (method.jsDoc) { - content += `${method.jsDoc}\n`; - } - - content += `export type ${actionTypeName} = { - type: \`${actionString}\`; - handler: ${controller.name}['${method.name}']; -};\n\n`; - } - - // Generate union type of all action types - if (actionTypeNames.length > 0) { - const unionTypeName = `${controller.name}MethodActions`; - content += `/** - * Union of all ${controller.name} action types. - */ -export type ${unionTypeName} = ${actionTypeNames.join(' | ')};\n`; - } - - return `${content.trimEnd()}\n`; -} - -/** - * Capitalizes the first letter of a string. - * - * @param str - The string to capitalize. - * @returns The capitalized string. - */ -function capitalize(str: string): string { - return str.charAt(0).toUpperCase() + str.slice(1); -} - -// Error handling wrapper -main().catch((error) => { - console.error('āŒ Script failed:', error); - process.exitCode = 1; -}); diff --git a/src/SmartTransactionsController-method-action-types.ts b/src/SmartTransactionsController-method-action-types.ts index 47171e3f..b8cae3c5 100644 --- a/src/SmartTransactionsController-method-action-types.ts +++ b/src/SmartTransactionsController-method-action-types.ts @@ -1,5 +1,5 @@ /** - * This file is auto generated by `scripts/generate-method-action-types.ts`. + * This file is auto generated. * Do not edit manually. */ diff --git a/yarn.lock b/yarn.lock index 6cde73bd..e2f90678 100644 --- a/yarn.lock +++ b/yarn.lock @@ -450,188 +450,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/aix-ppc64@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/aix-ppc64@npm:0.27.4" - conditions: os=aix & cpu=ppc64 - languageName: node - linkType: hard - -"@esbuild/android-arm64@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/android-arm64@npm:0.27.4" - conditions: os=android & cpu=arm64 - languageName: node - linkType: hard - -"@esbuild/android-arm@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/android-arm@npm:0.27.4" - conditions: os=android & cpu=arm - languageName: node - linkType: hard - -"@esbuild/android-x64@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/android-x64@npm:0.27.4" - conditions: os=android & cpu=x64 - languageName: node - linkType: hard - -"@esbuild/darwin-arm64@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/darwin-arm64@npm:0.27.4" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - -"@esbuild/darwin-x64@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/darwin-x64@npm:0.27.4" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - -"@esbuild/freebsd-arm64@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/freebsd-arm64@npm:0.27.4" - conditions: os=freebsd & cpu=arm64 - languageName: node - linkType: hard - -"@esbuild/freebsd-x64@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/freebsd-x64@npm:0.27.4" - conditions: os=freebsd & cpu=x64 - languageName: node - linkType: hard - -"@esbuild/linux-arm64@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/linux-arm64@npm:0.27.4" - conditions: os=linux & cpu=arm64 - languageName: node - linkType: hard - -"@esbuild/linux-arm@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/linux-arm@npm:0.27.4" - conditions: os=linux & cpu=arm - languageName: node - linkType: hard - -"@esbuild/linux-ia32@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/linux-ia32@npm:0.27.4" - conditions: os=linux & cpu=ia32 - languageName: node - linkType: hard - -"@esbuild/linux-loong64@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/linux-loong64@npm:0.27.4" - conditions: os=linux & cpu=loong64 - languageName: node - linkType: hard - -"@esbuild/linux-mips64el@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/linux-mips64el@npm:0.27.4" - conditions: os=linux & cpu=mips64el - languageName: node - linkType: hard - -"@esbuild/linux-ppc64@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/linux-ppc64@npm:0.27.4" - conditions: os=linux & cpu=ppc64 - languageName: node - linkType: hard - -"@esbuild/linux-riscv64@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/linux-riscv64@npm:0.27.4" - conditions: os=linux & cpu=riscv64 - languageName: node - linkType: hard - -"@esbuild/linux-s390x@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/linux-s390x@npm:0.27.4" - conditions: os=linux & cpu=s390x - languageName: node - linkType: hard - -"@esbuild/linux-x64@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/linux-x64@npm:0.27.4" - conditions: os=linux & cpu=x64 - languageName: node - linkType: hard - -"@esbuild/netbsd-arm64@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/netbsd-arm64@npm:0.27.4" - conditions: os=netbsd & cpu=arm64 - languageName: node - linkType: hard - -"@esbuild/netbsd-x64@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/netbsd-x64@npm:0.27.4" - conditions: os=netbsd & cpu=x64 - languageName: node - linkType: hard - -"@esbuild/openbsd-arm64@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/openbsd-arm64@npm:0.27.4" - conditions: os=openbsd & cpu=arm64 - languageName: node - linkType: hard - -"@esbuild/openbsd-x64@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/openbsd-x64@npm:0.27.4" - conditions: os=openbsd & cpu=x64 - languageName: node - linkType: hard - -"@esbuild/openharmony-arm64@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/openharmony-arm64@npm:0.27.4" - conditions: os=openharmony & cpu=arm64 - languageName: node - linkType: hard - -"@esbuild/sunos-x64@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/sunos-x64@npm:0.27.4" - conditions: os=sunos & cpu=x64 - languageName: node - linkType: hard - -"@esbuild/win32-arm64@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/win32-arm64@npm:0.27.4" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - -"@esbuild/win32-ia32@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/win32-ia32@npm:0.27.4" - conditions: os=win32 & cpu=ia32 - languageName: node - linkType: hard - -"@esbuild/win32-x64@npm:0.27.4": - version: 0.27.4 - resolution: "@esbuild/win32-x64@npm:0.27.4" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - "@eslint-community/eslint-utils@npm:^4.2.0": version: 4.4.0 resolution: "@eslint-community/eslint-utils@npm:4.4.0" @@ -2190,6 +2008,21 @@ __metadata: languageName: node linkType: hard +"@metamask/messenger@npm:^1.1.0": + version: 1.1.0 + resolution: "@metamask/messenger@npm:1.1.0" + dependencies: + "@metamask/utils": ^11.9.0 + yargs: ^17.7.2 + peerDependencies: + eslint: ">=8" + typescript: ">=5.0.0" + bin: + messenger-generate-action-types: ./dist/generate-action-types/cli.mjs + checksum: 076355158d43a989286c20f52c1702a4be567263348c34a52665eed60f3a928a5b2028b66cedda58269d22a1657e2ec7ae60ea53d4c32679c3dcb6d78897e553 + languageName: node + linkType: hard + "@metamask/metamask-eth-abis@npm:^3.1.1": version: 3.1.1 resolution: "@metamask/metamask-eth-abis@npm:3.1.1" @@ -2434,7 +2267,7 @@ __metadata: "@metamask/eth-query": ^4.0.0 "@metamask/gas-fee-controller": ^26.0.0 "@metamask/json-rpc-engine": ^10.0.1 - "@metamask/messenger": ^0.3.0 + "@metamask/messenger": ^1.1.0 "@metamask/network-controller": ^30.0.0 "@metamask/polling-controller": ^16.0.0 "@metamask/remote-feature-flag-controller": ^4.1.0 @@ -2468,7 +2301,6 @@ __metadata: reselect: ^5.1.1 sinon: ^9.2.4 ts-jest: ^29.1.4 - tsx: ^4.20.5 typescript: ~5.3.3 yargs: ^17.7.2 peerDependenciesMeta: @@ -3286,20 +3118,13 @@ __metadata: languageName: node linkType: hard -"@types/json-schema@npm:*": +"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.9": version: 7.0.15 resolution: "@types/json-schema@npm:7.0.15" checksum: 97ed0cb44d4070aecea772b7b2e2ed971e10c81ec87dd4ecc160322ffa55ff330dace1793489540e3e318d90942064bb697cc0f8989391797792d919737b3b98 languageName: node linkType: hard -"@types/json-schema@npm:^7.0.9": - version: 7.0.11 - resolution: "@types/json-schema@npm:7.0.11" - checksum: 527bddfe62db9012fccd7627794bd4c71beb77601861055d87e3ee464f2217c85fca7a4b56ae677478367bbd248dbde13553312b7d4dbc702a2f2bbf60c4018d - languageName: node - linkType: hard - "@types/json5@npm:^0.0.29": version: 0.0.29 resolution: "@types/json5@npm:0.0.29" @@ -5183,95 +5008,6 @@ __metadata: languageName: node linkType: hard -"esbuild@npm:~0.27.0": - version: 0.27.4 - resolution: "esbuild@npm:0.27.4" - dependencies: - "@esbuild/aix-ppc64": 0.27.4 - "@esbuild/android-arm": 0.27.4 - "@esbuild/android-arm64": 0.27.4 - "@esbuild/android-x64": 0.27.4 - "@esbuild/darwin-arm64": 0.27.4 - "@esbuild/darwin-x64": 0.27.4 - "@esbuild/freebsd-arm64": 0.27.4 - "@esbuild/freebsd-x64": 0.27.4 - "@esbuild/linux-arm": 0.27.4 - "@esbuild/linux-arm64": 0.27.4 - "@esbuild/linux-ia32": 0.27.4 - "@esbuild/linux-loong64": 0.27.4 - "@esbuild/linux-mips64el": 0.27.4 - "@esbuild/linux-ppc64": 0.27.4 - "@esbuild/linux-riscv64": 0.27.4 - "@esbuild/linux-s390x": 0.27.4 - "@esbuild/linux-x64": 0.27.4 - "@esbuild/netbsd-arm64": 0.27.4 - "@esbuild/netbsd-x64": 0.27.4 - "@esbuild/openbsd-arm64": 0.27.4 - "@esbuild/openbsd-x64": 0.27.4 - "@esbuild/openharmony-arm64": 0.27.4 - "@esbuild/sunos-x64": 0.27.4 - "@esbuild/win32-arm64": 0.27.4 - "@esbuild/win32-ia32": 0.27.4 - "@esbuild/win32-x64": 0.27.4 - dependenciesMeta: - "@esbuild/aix-ppc64": - optional: true - "@esbuild/android-arm": - optional: true - "@esbuild/android-arm64": - optional: true - "@esbuild/android-x64": - optional: true - "@esbuild/darwin-arm64": - optional: true - "@esbuild/darwin-x64": - optional: true - "@esbuild/freebsd-arm64": - optional: true - "@esbuild/freebsd-x64": - optional: true - "@esbuild/linux-arm": - optional: true - "@esbuild/linux-arm64": - optional: true - "@esbuild/linux-ia32": - optional: true - "@esbuild/linux-loong64": - optional: true - "@esbuild/linux-mips64el": - optional: true - "@esbuild/linux-ppc64": - optional: true - "@esbuild/linux-riscv64": - optional: true - "@esbuild/linux-s390x": - optional: true - "@esbuild/linux-x64": - optional: true - "@esbuild/netbsd-arm64": - optional: true - "@esbuild/netbsd-x64": - optional: true - "@esbuild/openbsd-arm64": - optional: true - "@esbuild/openbsd-x64": - optional: true - "@esbuild/openharmony-arm64": - optional: true - "@esbuild/sunos-x64": - optional: true - "@esbuild/win32-arm64": - optional: true - "@esbuild/win32-ia32": - optional: true - "@esbuild/win32-x64": - optional: true - bin: - esbuild: bin/esbuild - checksum: f560cdef05e3ac35e79ac5480bdc3801530e20f8333a78809604f001363d4bcaa6cce5641af18d5c7279165118561d12116a40e608f01327e2c522d67d79b3f0 - languageName: node - linkType: hard - "escalade@npm:^3.1.1, escalade@npm:^3.2.0": version: 3.2.0 resolution: "escalade@npm:3.2.0" @@ -6044,7 +5780,7 @@ __metadata: languageName: node linkType: hard -"fsevents@npm:^2.3.2, fsevents@npm:~2.3.3": +"fsevents@npm:^2.3.2": version: 2.3.3 resolution: "fsevents@npm:2.3.3" dependencies: @@ -6054,7 +5790,7 @@ __metadata: languageName: node linkType: hard -"fsevents@patch:fsevents@^2.3.2#~builtin, fsevents@patch:fsevents@~2.3.3#~builtin": +"fsevents@patch:fsevents@^2.3.2#~builtin": version: 2.3.3 resolution: "fsevents@patch:fsevents@npm%3A2.3.3#~builtin::version=2.3.3&hash=18f3a7" dependencies: @@ -6189,15 +5925,6 @@ __metadata: languageName: node linkType: hard -"get-tsconfig@npm:^4.7.5": - version: 4.13.6 - resolution: "get-tsconfig@npm:4.13.6" - dependencies: - resolve-pkg-maps: ^1.0.0 - checksum: 946575897a75b3de39905a8e95fe761b1ae9a595c8608c3982fa3a5748ed0d6441c799197a99fee27876cd8c5a2158418ad6e88d8008ec1244639c0f5ee2a2d8 - languageName: node - linkType: hard - "git-hooks-list@npm:^3.0.0": version: 3.1.0 resolution: "git-hooks-list@npm:3.1.0" @@ -9152,13 +8879,6 @@ __metadata: languageName: node linkType: hard -"resolve-pkg-maps@npm:^1.0.0": - version: 1.0.0 - resolution: "resolve-pkg-maps@npm:1.0.0" - checksum: 1012afc566b3fdb190a6309cc37ef3b2dcc35dff5fa6683a9d00cd25c3247edfbc4691b91078c97adc82a29b77a2660c30d791d65dab4fc78bfc473f60289977 - languageName: node - linkType: hard - "resolve.exports@npm:^2.0.0": version: 2.0.2 resolution: "resolve.exports@npm:2.0.2" @@ -10092,22 +9812,6 @@ __metadata: languageName: node linkType: hard -"tsx@npm:^4.20.5": - version: 4.21.0 - resolution: "tsx@npm:4.21.0" - dependencies: - esbuild: ~0.27.0 - fsevents: ~2.3.3 - get-tsconfig: ^4.7.5 - dependenciesMeta: - fsevents: - optional: true - bin: - tsx: dist/cli.mjs - checksum: 50c98e4b6e66d1c30f72925c8e5e7be1a02377574de7cd367d7e7a6d4af43ca8ff659f91c654e7628b25a5498015e32f090529b92c679b0342811e1cf682e8cf - languageName: node - linkType: hard - "tweetnacl@npm:^1.0.3": version: 1.0.3 resolution: "tweetnacl@npm:1.0.3" From 6332e017a8349430014a9d2444b651eb1c754254 Mon Sep 17 00:00:00 2001 From: Salah-Eddine Saakoun Date: Wed, 1 Apr 2026 23:00:07 +0200 Subject: [PATCH 02/10] chore: add PR link to changelog entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a3bb73e..28d41cda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,7 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **BREAKING:** Upgrade TypeScript from `~4.8.4` to `~5.3.3` ([#574](https://github.com/MetaMask/smart-transactions-controller/pull/574)) - Consumers on TypeScript 4.x may experience type errors and should upgrade to TypeScript 5.x. -- Bump `@metamask/messenger` from `^0.3.0` to `^1.1.0` +- Bump `@metamask/messenger` from `^0.3.0` to `^1.1.0` ([#577](https://github.com/MetaMask/smart-transactions-controller/pull/577)) ## [23.0.0] From c18ae365a5da5273ea89f1b241bcbddab42a4648 Mon Sep 17 00:00:00 2001 From: Salah-Eddine Saakoun Date: Wed, 1 Apr 2026 23:26:21 +0200 Subject: [PATCH 03/10] fix: add resolution to force @metamask/messenger@^1.1.0 --- package.json | 3 +++ yarn.lock | 7 ------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index a303563e..ecb1ae64 100644 --- a/package.json +++ b/package.json @@ -114,6 +114,9 @@ } }, "packageManager": "yarn@3.2.1", + "resolutions": { + "@metamask/messenger": "^1.1.0" + }, "engines": { "node": "^18.18 || >=20" }, diff --git a/yarn.lock b/yarn.lock index e2f90678..82f55992 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2001,13 +2001,6 @@ __metadata: languageName: node linkType: hard -"@metamask/messenger@npm:^0.3.0": - version: 0.3.0 - resolution: "@metamask/messenger@npm:0.3.0" - checksum: 72050d7ba672bc82319a6b6ff126c52d372418a9049555a1b94f520e664b6e8037e44203f2ecffb33f8de8e3b874174ad40da306fb8cb17decccaeb50f36f180 - languageName: node - linkType: hard - "@metamask/messenger@npm:^1.1.0": version: 1.1.0 resolution: "@metamask/messenger@npm:1.1.0" From 566b7ff6e4df6ed291e63aafeeef845ebdd57ead Mon Sep 17 00:00:00 2001 From: Salah-Eddine Saakoun Date: Wed, 1 Apr 2026 23:28:30 +0200 Subject: [PATCH 04/10] fix: format package.json with prettier --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ecb1ae64..2c502c51 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,9 @@ "test": "jest && attw --pack", "test:watch": "jest --watchAll" }, + "resolutions": { + "@metamask/messenger": "^1.1.0" + }, "dependencies": { "@babel/runtime": "^7.24.1", "@ethereumjs/tx": "^5.2.1", @@ -114,9 +117,6 @@ } }, "packageManager": "yarn@3.2.1", - "resolutions": { - "@metamask/messenger": "^1.1.0" - }, "engines": { "node": "^18.18 || >=20" }, From 142be633bf7569469d8d0b8a21a3728dc04fe006 Mon Sep 17 00:00:00 2001 From: Salah-Eddine Saakoun Date: Thu, 2 Apr 2026 14:10:24 +0200 Subject: [PATCH 05/10] Revert "fix: format package.json with prettier" This reverts commit 566b7ff6e4df6ed291e63aafeeef845ebdd57ead. --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 2c502c51..ecb1ae64 100644 --- a/package.json +++ b/package.json @@ -39,9 +39,6 @@ "test": "jest && attw --pack", "test:watch": "jest --watchAll" }, - "resolutions": { - "@metamask/messenger": "^1.1.0" - }, "dependencies": { "@babel/runtime": "^7.24.1", "@ethereumjs/tx": "^5.2.1", @@ -117,6 +114,9 @@ } }, "packageManager": "yarn@3.2.1", + "resolutions": { + "@metamask/messenger": "^1.1.0" + }, "engines": { "node": "^18.18 || >=20" }, From 0a28a0be2b8272f55fbda461982e1fc319e7bf28 Mon Sep 17 00:00:00 2001 From: Salah-Eddine Saakoun Date: Thu, 2 Apr 2026 14:10:26 +0200 Subject: [PATCH 06/10] Revert "fix: add resolution to force @metamask/messenger@^1.1.0" This reverts commit c18ae365a5da5273ea89f1b241bcbddab42a4648. --- package.json | 3 --- yarn.lock | 7 +++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ecb1ae64..a303563e 100644 --- a/package.json +++ b/package.json @@ -114,9 +114,6 @@ } }, "packageManager": "yarn@3.2.1", - "resolutions": { - "@metamask/messenger": "^1.1.0" - }, "engines": { "node": "^18.18 || >=20" }, diff --git a/yarn.lock b/yarn.lock index 82f55992..e2f90678 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2001,6 +2001,13 @@ __metadata: languageName: node linkType: hard +"@metamask/messenger@npm:^0.3.0": + version: 0.3.0 + resolution: "@metamask/messenger@npm:0.3.0" + checksum: 72050d7ba672bc82319a6b6ff126c52d372418a9049555a1b94f520e664b6e8037e44203f2ecffb33f8de8e3b874174ad40da306fb8cb17decccaeb50f36f180 + languageName: node + linkType: hard + "@metamask/messenger@npm:^1.1.0": version: 1.1.0 resolution: "@metamask/messenger@npm:1.1.0" From 3b30bffecc8ecbc4099bee6332d26987733c3a94 Mon Sep 17 00:00:00 2001 From: Salah-Eddine Saakoun Date: Thu, 2 Apr 2026 15:44:20 +0200 Subject: [PATCH 07/10] fix: remove tsx from lavamoat.allowScripts --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index df9727b6..8528e448 100644 --- a/package.json +++ b/package.json @@ -130,7 +130,6 @@ "@metamask/controller-utils>babel-runtime>core-js": false, "@metamask/transaction-controller>@metamask/core-backend>@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography>keccak": false, "@metamask/transaction-controller>@metamask/core-backend>@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography>secp256k1": false, - "tsx>esbuild": false, "@metamask/profile-sync-controller>@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography>keccak": false, "@metamask/profile-sync-controller>@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography>secp256k1": false } From de550b2f8a30ca5299b42aac6112a010c14e94dd Mon Sep 17 00:00:00 2001 From: Salah-Eddine Saakoun Date: Sat, 4 Apr 2026 11:59:10 +0200 Subject: [PATCH 08/10] feat: migrate to @metamask/messenger-cli for action types codegen --- package.json | 10 ++++++---- yarn.lock | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 8528e448..0d937613 100644 --- a/package.json +++ b/package.json @@ -29,15 +29,16 @@ ], "scripts": { "build": "ts-bridge --project tsconfig.build.json --clean", - "generate-method-action-types": "messenger-generate-action-types", - "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn generate-method-action-types --check", + "lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:changelog && yarn messenger-action-types:check", "lint:changelog": "auto-changelog validate --prettier", "lint:eslint": "eslint . --cache --ext js,ts", - "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write && yarn lint:changelog && yarn generate-method-action-types --fix", + "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write && yarn lint:changelog && yarn messenger-action-types:generate", "lint:misc": "prettier '**/*.json' '**/*.md' '**/*.yml' '!.yarnrc.yml' --ignore-path .gitignore --no-error-on-unmatched-pattern", "prepack": "./scripts/prepack.sh", "test": "jest && attw --pack", - "test:watch": "jest --watchAll" + "test:watch": "jest --watchAll", + "messenger-action-types:check": "messenger-action-types --check", + "messenger-action-types:generate": "messenger-action-types --generate" }, "dependencies": { "@babel/runtime": "^7.24.1", @@ -74,6 +75,7 @@ "@metamask/eslint-config-typescript": "^12.1.0", "@metamask/gas-fee-controller": "^26.0.0", "@metamask/json-rpc-engine": "^10.0.1", + "@metamask/messenger-cli": "^0.1.0", "@ts-bridge/cli": "^0.6.3", "@types/eslint": "^9.6.1", "@types/jest": "^26.0.24", diff --git a/yarn.lock b/yarn.lock index f5d2a1b6..da582718 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1990,6 +1990,24 @@ __metadata: languageName: node linkType: hard +"@metamask/messenger-cli@npm:^0.1.0": + version: 0.1.0 + resolution: "@metamask/messenger-cli@npm:0.1.0" + dependencies: + "@metamask/utils": ^11.9.0 + yargs: ^17.7.2 + peerDependencies: + eslint: ">=8" + typescript: ">=5.0.0" + peerDependenciesMeta: + eslint: + optional: true + bin: + messenger-action-types: ./dist/cli.mjs + checksum: 2724d143cd6ab1af8d546d981ba04326014ee504f54e77aa1037391d814158ad13ce90c0a8a4dfbfce662619c580cc86847e87a1eeb969a27d8a8bfcae2df63b + languageName: node + linkType: hard + "@metamask/messenger@npm:^0.3.0": version: 0.3.0 resolution: "@metamask/messenger@npm:0.3.0" @@ -2257,6 +2275,7 @@ __metadata: "@metamask/gas-fee-controller": ^26.0.0 "@metamask/json-rpc-engine": ^10.0.1 "@metamask/messenger": ^1.1.0 + "@metamask/messenger-cli": ^0.1.0 "@metamask/network-controller": ^30.0.0 "@metamask/polling-controller": ^16.0.0 "@metamask/profile-sync-controller": ^28.0.2 From ae4a91acb337ce60e9bd942fda2f57b3133d5321 Mon Sep 17 00:00:00 2001 From: Salah-Eddine Saakoun Date: Sat, 4 Apr 2026 12:05:20 +0200 Subject: [PATCH 09/10] fix: prettier formatting --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 0d937613..3c9af49d 100644 --- a/package.json +++ b/package.json @@ -34,11 +34,11 @@ "lint:eslint": "eslint . --cache --ext js,ts", "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write && yarn lint:changelog && yarn messenger-action-types:generate", "lint:misc": "prettier '**/*.json' '**/*.md' '**/*.yml' '!.yarnrc.yml' --ignore-path .gitignore --no-error-on-unmatched-pattern", + "messenger-action-types:check": "messenger-action-types --check", + "messenger-action-types:generate": "messenger-action-types --generate", "prepack": "./scripts/prepack.sh", "test": "jest && attw --pack", - "test:watch": "jest --watchAll", - "messenger-action-types:check": "messenger-action-types --check", - "messenger-action-types:generate": "messenger-action-types --generate" + "test:watch": "jest --watchAll" }, "dependencies": { "@babel/runtime": "^7.24.1", From 70c652656c685bc5a6782ec38bb9f89ab54fa9a1 Mon Sep 17 00:00:00 2001 From: Salah-Eddine Saakoun Date: Mon, 6 Apr 2026 20:29:34 +0200 Subject: [PATCH 10/10] fix: remove yargs unused dependency --- package.json | 3 +-- yarn.lock | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/package.json b/package.json index 3c9af49d..0ba3daa3 100644 --- a/package.json +++ b/package.json @@ -99,8 +99,7 @@ "prettier-plugin-packagejson": "^2.4.3", "sinon": "^9.2.4", "ts-jest": "^29.1.4", - "typescript": "~5.3.3", - "yargs": "^17.7.2" + "typescript": "~5.3.3" }, "peerDependenciesMeta": { "@metamask/accounts-controller": { diff --git a/yarn.lock b/yarn.lock index da582718..0b99bc3c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2311,7 +2311,6 @@ __metadata: sinon: ^9.2.4 ts-jest: ^29.1.4 typescript: ~5.3.3 - yargs: ^17.7.2 peerDependenciesMeta: "@metamask/accounts-controller": optional: true