SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

Update `generate-artifacts-executor` script to account for optional output path (#54609)

Summary:
The argument for the output path to this CLI has always been optional, but the types didn't reflect this, which caused a few regressions in recent changes (e.g. https://github.com/facebook/react-native/issues/53503)

There's several code paths where the `baseOutputPath` can be altered or derived in different ways, which wasn't respected in logic before the main codegen output block or in `generateReactCodegenPodspec`.

When applied, this PR alters the `baseOutputPath` logic to use a default by `computeBaseOutputPath` extracted from `computeOutputPath` and have an added `process.env.RCT_SCRIPT_OUTPUT_DIR` override, which was previously only applied to `readReactNativeConfig`

This should restore:
- `react-native codegen` being run without an `--outputPath` argument
- codegen running with a `package.json:codegenConfig.outputDir` override

Resolves https://github.com/facebook/react-native/issues/54473

## Changelog:

[GENERAL] [FIXED] - Ensure codegen CLI supports unspecified `--outputPath` argument and respects `codegenConfig.outputDir` configurations

Pull Request resolved: https://github.com/facebook/react-native/pull/54609

Test Plan: - Manually run `react-native codegen` in `rn-tester`

Reviewed By: cipolleschi

Differential Revision: D87456501

Pulled By: cortinico

fbshipit-source-id: 997e99af1f99227eb70955478643b28b1a90df61
P
Phil Pluckthun committed
f8207d6c757552ddac472aa278d7dd56ad04fb7e
Parent: ad5e268
Committed by React Native Bot <bot@reactnative.dev> on 12/2/2025, 5:47:50 PM