Commit 7163033
Update
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. #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 #54473
## Changelog:
[GENERAL] [FIXED] - Ensure codegen CLI supports unspecified `--outputPath` argument and respects `codegenConfig.outputDir` configurations
Pull Request resolved: #54609
Test Plan: - Manually run `react-native codegen` in `rn-tester`
Reviewed By: cipolleschi
Differential Revision: D87456501
Pulled By: cortinico
fbshipit-source-id: 997e99af1f99227eb70955478643b28b1a90df61generate-artifacts-executor script to account for optional output path (#54609)1 parent 7c95d68 commit 7163033
File tree
3 files changed
+70
-35
lines changed- packages/react-native/scripts/codegen/generate-artifacts-executor
3 files changed
+70
-35
lines changedLines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
81 | 85 | | |
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
85 | 89 | | |
86 | | - | |
| 90 | + | |
87 | 91 | | |
88 | 92 | | |
89 | 93 | | |
| |||
Lines changed: 48 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 91 | + | |
114 | 92 | | |
115 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
116 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
117 | 120 | | |
118 | 121 | | |
119 | 122 | | |
| |||
208 | 211 | | |
209 | 212 | | |
210 | 213 | | |
211 | | - | |
| 214 | + | |
212 | 215 | | |
213 | | - | |
| 216 | + | |
214 | 217 | | |
215 | 218 | | |
216 | 219 | | |
217 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
218 | 228 | | |
219 | 229 | | |
220 | | - | |
221 | 230 | | |
222 | 231 | | |
223 | | - | |
224 | 232 | | |
225 | 233 | | |
| 234 | + | |
| 235 | + | |
226 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
227 | 246 | | |
228 | 247 | | |
229 | 248 | | |
| |||
Lines changed: 15 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| 105 | + | |
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
| |||
120 | 122 | | |
121 | 123 | | |
122 | 124 | | |
123 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
124 | 129 | | |
125 | 130 | | |
126 | 131 | | |
| |||
141 | 146 | | |
142 | 147 | | |
143 | 148 | | |
| 149 | + | |
144 | 150 | | |
145 | 151 | | |
146 | 152 | | |
| |||
149 | 155 | | |
150 | 156 | | |
151 | 157 | | |
152 | | - | |
153 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
154 | 166 | | |
155 | 167 | | |
156 | 168 | | |
| |||
0 commit comments