Skip to content

Commit 684fcf7

Browse files
chrfalchclaude
andcommitted
style: apply prettier to ios-prebuild scripts and docs
`yarn format-check` (prettier) was failing CI on PR #57285. Run prettier on the ios-prebuild headers scripts (headers-compose.js, headers-inventory.js), replace-rncore-version.js, and __docs__/README.md so format-check passes. No logic changes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 9748a92 commit 684fcf7

4 files changed

Lines changed: 29 additions & 22 deletions

File tree

packages/react-native/scripts/ios-prebuild/__docs__/README.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,15 @@ overlay**. The layout contract is defined and validated in code:
122122
rejected.
123123
- `headers-inventory.js`: scans the source tree to build the live header
124124
inventory that feeds the spec.
125-
- `headers-compose.js`: emits the layout. `emitReactFrameworkHeaders()` writes the
126-
`React/` and bare-aliased headers into every slice's `React.framework/Headers`,
127-
and `buildReactNativeHeadersXcframework()` assembles the headers-only
128-
`ReactNativeHeaders.xcframework` carrying every other namespace (incl. `react/`)
129-
plus the third-party dependency namespaces (`folly`, `glog`, `boost`, `fmt`,
130-
`double-conversion`, `fast_float`). The Hermes public headers (`<hermes/...>`)
131-
are folded in only on the SwiftPM consumer side (`ensureHeadersLayout`); the
132-
published prebuild artifact does not yet carry them (TODO in `xcframework.js`).
125+
- `headers-compose.js`: emits the layout. `emitReactFrameworkHeaders()` writes
126+
the `React/` and bare-aliased headers into every slice's
127+
`React.framework/Headers`, and `buildReactNativeHeadersXcframework()`
128+
assembles the headers-only `ReactNativeHeaders.xcframework` carrying every
129+
other namespace (incl. `react/`) plus the third-party dependency namespaces
130+
(`folly`, `glog`, `boost`, `fmt`, `double-conversion`, `fast_float`). The
131+
Hermes public headers (`<hermes/...>`) are folded in only on the SwiftPM
132+
consumer side (`ensureHeadersLayout`); the published prebuild artifact does
133+
not yet carry them (TODO in `xcframework.js`).
133134

134135
### Artifacts
135136

@@ -138,19 +139,20 @@ The prebuild (`xcframework.js`) always produces:
138139
- `React.xcframework` — the compiled React core. Each slice's `React.framework`
139140
carries the headers-spec layout (every `<React/...>` header + the framework
140141
module map), which is what both CocoaPods and SwiftPM consume.
141-
- `ReactNativeHeaders.xcframework` — headers-only; carries every other namespace.
142-
Consumed by SwiftPM as a `binaryTarget` and by CocoaPods via the
142+
- `ReactNativeHeaders.xcframework` — headers-only; carries every other
143+
namespace. Consumed by SwiftPM as a `binaryTarget` and by CocoaPods via the
143144
`React-Core-prebuilt` pod (headers flattened onto the header search path).
144145

145146
### CocoaPods consumption
146147

147148
The `React-Core-prebuilt` pod vends `React.xcframework` (so `<React/...>` and
148-
`@import React;` resolve through the framework module via `FRAMEWORK_SEARCH_PATHS`)
149-
and flattens `ReactNativeHeaders.xcframework`'s headers into a top-level `Headers/`
150-
exposed on the pod header search path (so `<react/...>`, `<yoga/...>`, `<folly/...>`
151-
resolve). `rncore.rb` adds the `HEADER_SEARCH_PATHS` entry to
152-
`React-Core-prebuilt/Headers` for podspec, aggregate (main app), and third-party
153-
pod targets. No `-ivfsoverlay` flags are added.
149+
`@import React;` resolve through the framework module via
150+
`FRAMEWORK_SEARCH_PATHS`) and flattens `ReactNativeHeaders.xcframework`'s
151+
headers into a top-level `Headers/` exposed on the pod header search path (so
152+
`<react/...>`, `<yoga/...>`, `<folly/...>` resolve). `rncore.rb` adds the
153+
`HEADER_SEARCH_PATHS` entry to `React-Core-prebuilt/Headers` for podspec,
154+
aggregate (main app), and third-party pod targets. No `-ivfsoverlay` flags are
155+
added.
154156

155157
## Integrating in your project with Cocoapods
156158

packages/react-native/scripts/ios-prebuild/headers-compose.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,7 @@ function emitReactFrameworkHeaders(
8989
// by a pre-existing Headers/.
9090
const slices = fs
9191
.readdirSync(xcfwPath)
92-
.filter(d =>
93-
fs.existsSync(path.join(xcfwPath, d, 'React.framework')),
94-
);
92+
.filter(d => fs.existsSync(path.join(xcfwPath, d, 'React.framework')));
9593
for (const slice of slices) {
9694
const fwk = path.join(xcfwPath, slice, 'React.framework');
9795
fs.rmSync(path.join(fwk, 'Headers'), {recursive: true, force: true});

packages/react-native/scripts/ios-prebuild/headers-inventory.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ function scanHeader(text /*: string */) /*: {
218218

219219
// Meta-internal headers referenced behind RN_DISABLE_OSS_PLUGIN_HEADER (the
220220
// FB*Plugins pattern) or fbjni/FBI18n — never resolvable in OSS, by design.
221-
const META_INTERNAL_RE /*: RegExp */ = /^(fbjni|FBI18n)\/|^React\/FB\w+Plugins\.h$/;
221+
const META_INTERNAL_RE /*: RegExp */ =
222+
/^(fbjni|FBI18n)\/|^React\/FB\w+Plugins\.h$/;
222223
// Non-Apple platform headers (Android-only branches in shared headers).
223224
const OTHER_PLATFORM_PREFIXES = new Set(['android', 'jni']);
224225

packages/react-native/scripts/replace-rncore-version.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,20 @@ function replaceRNCoreConfiguration(
159159
.find(
160160
dirent =>
161161
dirent.isDirectory() &&
162-
fs.existsSync(path.join(rnhXcfw, dirent.name.toString(), 'Headers')),
162+
fs.existsSync(
163+
path.join(rnhXcfw, dirent.name.toString(), 'Headers'),
164+
),
163165
);
164166
if (slice) {
165167
const headersDest = path.join(finalLocation, 'Headers');
166168
fs.rmSync(headersDest, {force: true, recursive: true});
167169
const cpHeaders = spawnSync(
168170
'cp',
169-
['-R', path.join(rnhXcfw, slice.name.toString(), 'Headers'), headersDest],
171+
[
172+
'-R',
173+
path.join(rnhXcfw, slice.name.toString(), 'Headers'),
174+
headersDest,
175+
],
170176
{stdio: 'inherit'},
171177
);
172178
if (cpHeaders.status !== 0) {

0 commit comments

Comments
 (0)