diff --git a/packages/react-native/react-native.config.js b/packages/react-native/react-native.config.js index 79a5f5249e2a28..6a8394e8ac1823 100644 --- a/packages/react-native/react-native.config.js +++ b/packages/react-native/react-native.config.js @@ -17,6 +17,33 @@ const { startCommand, } = require('@react-native/community-cli-plugin'); +const codegenCommand = { + name: 'codegen', + options: [ + { + name: '--path ', + description: 'Path to the React Native project root.', + default: process.cwd(), + }, + { + name: '--platform ', + description: + 'Target platform. Supported values: "android", "ios", "all".', + default: 'all', + }, + { + name: '--outputPath ', + description: 'Path where generated artifacts will be output to.', + }, + ], + func: (argv, config, args) => + require('./scripts/codegen/generate-artifacts-executor').execute( + args.path, + args.platform, + args.outputPath, + ), +}; + module.exports = { commands: [ ...ios.commands, @@ -24,6 +51,7 @@ module.exports = { bundleCommand, ramBundleCommand, startCommand, + codegenCommand, ], platforms: { ios: {